@i14ks/ccv 0.40.0 → 0.42.0
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/bundle/ccv.mjs +722 -145
- package/package.json +1 -1
- package/web/assets/{codemirror-BFhD_Qok.js → codemirror-D_aocakD.js} +1 -1
- package/web/assets/{index-Bng1dR8P.js → index-Ah1jCJ1U.js} +1 -1
- package/web/assets/{index-DkREaKVS.js → index-B0wzgXzo.js} +1 -1
- package/web/assets/{index-C0UJgxDk.js → index-BUB7eB21.js} +1 -1
- package/web/assets/{index-Jk59gidx.js → index-Bqw5VmKB.js} +1 -1
- package/web/assets/index-C43uypKd.css +1 -0
- package/web/assets/{index-DGvQxxdB.js → index-CGl8tRHI.js} +1 -1
- package/web/assets/{index-D6n8Nr5h.js → index-CTJjaC2C.js} +1 -1
- package/web/assets/{index-MdNspwJW.js → index-CU5O6qy8.js} +1 -1
- package/web/assets/{index-BqphMi4s.js → index-D3QPzaZ2.js} +1 -1
- package/web/assets/{index-DwvMx-lF.js → index-DP6n5Sf2.js} +1 -1
- package/web/assets/{index-BKQ3S7R4.js → index-DRswmveP.js} +1 -1
- package/web/assets/{index-BeqGzcF4.js → index-DSyXOala.js} +1 -1
- package/web/assets/{index-Cp-Vx5md.js → index-Daw0RVbK.js} +1 -1
- package/web/assets/{index-H0NO4iIy.js → index-Djyf6cqy.js} +1 -1
- package/web/assets/{index-Sbrdg0Zd.js → index-HJo8MrpC.js} +1 -1
- package/web/assets/{index-CTd3OD36.js → index-Jj_AHiE6.js} +1 -1
- package/web/assets/{index-BfM9EE1E.js → index-UG3FALpE.js} +1 -1
- package/web/assets/{index-CO8tJjX2.js → index-aSVj6-S6.js} +1 -1
- package/web/assets/{index-C--xwv_c.js → index-k5pUSa38.js} +1 -1
- package/web/assets/{index-DswRCrFR.js → index-kZWq9En4.js} +1 -1
- package/web/assets/index-tzF8oiHD.js +135 -0
- package/web/index.html +2 -2
- package/web/assets/index-D48z24MD.js +0 -134
- package/web/assets/index-DmlVq6mR.css +0 -1
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-BeqGzcF4.js","./index-D6n8Nr5h.js","./index-Sbrdg0Zd.js","./index-BHot-lnj.js","./index-891wE-Rj.js","./index-BfM9EE1E.js","./index-BKQ3S7R4.js","./index-Jk59gidx.js","./index-CTd3OD36.js","./index-C--xwv_c.js","./index-Cp-Vx5md.js","./index-DwvMx-lF.js","./index-BqphMi4s.js","./index-DGvQxxdB.js","./index-DkREaKVS.js","./index-H0NO4iIy.js","./index-DswRCrFR.js","./index-CO8tJjX2.js","./index-C0UJgxDk.js","./index-Bng1dR8P.js","./index-MdNspwJW.js","./codemirror-BFhD_Qok.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 W0=Object.defineProperty;var Ix=n=>{throw TypeError(n)};var P0=(n,l,r)=>l in n?W0(n,l,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[l]=r;var Qt=(n,l,r)=>P0(n,typeof l!="symbol"?l+"":l,r),Kh=(n,l,r)=>l.has(n)||Ix("Cannot "+r);var Ze=(n,l,r)=>(Kh(n,l,"read from private field"),r?r.call(n):l.get(n)),xn=(n,l,r)=>l.has(n)?Ix("Cannot add the same private member more than once"):l instanceof WeakSet?l.add(n):l.set(n,r),Mt=(n,l,r,c)=>(Kh(n,l,"write to private field"),c?c.call(n,r):l.set(n,r),r),Bn=(n,l,r)=>(Kh(n,l,"access private method"),r);(function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))c(o);new MutationObserver(o=>{for(const d of o)if(d.type==="childList")for(const h of d.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&c(h)}).observe(document,{childList:!0,subtree:!0});function r(o){const d={};return o.integrity&&(d.integrity=o.integrity),o.referrerPolicy&&(d.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?d.credentials="include":o.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function c(o){if(o.ep)return;o.ep=!0;const d=r(o);fetch(o.href,d)}})();var Zh={exports:{}},eu={};/**
|
|
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 $x;function ev(){if($x)return eu;$x=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function r(c,o,d){var h=null;if(d!==void 0&&(h=""+d),o.key!==void 0&&(h=""+o.key),"key"in o){d={};for(var m in o)m!=="key"&&(d[m]=o[m])}else d=o;return o=d.ref,{$$typeof:n,type:c,key:h,ref:o!==void 0?o:null,props:d}}return eu.Fragment=l,eu.jsx=r,eu.jsxs=r,eu}var qx;function tv(){return qx||(qx=1,Zh.exports=ev()),Zh.exports}var a=tv(),Fh={exports:{}},st={};/**
|
|
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 Gx;function nv(){if(Gx)return st;Gx=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),h=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),v=Symbol.iterator;function T(k){return k===null||typeof k!="object"?null:(k=v&&k[v]||k["@@iterator"],typeof k=="function"?k:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,C={};function F(k,se,q){this.props=k,this.context=se,this.refs=C,this.updater=q||w}F.prototype.isReactComponent={},F.prototype.setState=function(k,se){if(typeof k!="object"&&typeof k!="function"&&k!=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,k,se,"setState")},F.prototype.forceUpdate=function(k){this.updater.enqueueForceUpdate(this,k,"forceUpdate")};function Q(){}Q.prototype=F.prototype;function I(k,se,q){this.props=k,this.context=se,this.refs=C,this.updater=q||w}var L=I.prototype=new Q;L.constructor=I,A(L,F.prototype),L.isPureReactComponent=!0;var G=Array.isArray;function M(){}var z={H:null,A:null,T:null,S:null},O=Object.prototype.hasOwnProperty;function P(k,se,q){var je=q.ref;return{$$typeof:n,type:k,key:se,ref:je!==void 0?je:null,props:q}}function U(k,se){return P(k.type,se,k.props)}function B(k){return typeof k=="object"&&k!==null&&k.$$typeof===n}function J(k){var se={"=":"=0",":":"=2"};return"$"+k.replace(/[=:]/g,function(q){return se[q]})}var me=/\/+/g;function we(k,se){return typeof k=="object"&&k!==null&&k.key!=null?J(""+k.key):se.toString(36)}function ve(k){switch(k.status){case"fulfilled":return k.value;case"rejected":throw k.reason;default:switch(typeof k.status=="string"?k.then(M,M):(k.status="pending",k.then(function(se){k.status==="pending"&&(k.status="fulfilled",k.value=se)},function(se){k.status==="pending"&&(k.status="rejected",k.reason=se)})),k.status){case"fulfilled":return k.value;case"rejected":throw k.reason}}throw k}function $(k,se,q,je,te){var ke=typeof k;(ke==="undefined"||ke==="boolean")&&(k=null);var De=!1;if(k===null)De=!0;else switch(ke){case"bigint":case"string":case"number":De=!0;break;case"object":switch(k.$$typeof){case n:case l:De=!0;break;case y:return De=k._init,$(De(k._payload),se,q,je,te)}}if(De)return te=te(k),De=je===""?"."+we(k,0):je,G(te)?(q="",De!=null&&(q=De.replace(me,"$&/")+"/"),$(te,se,q,"",function(bt){return bt})):te!=null&&(B(te)&&(te=U(te,q+(te.key==null||k&&k.key===te.key?"":(""+te.key).replace(me,"$&/")+"/")+De)),se.push(te)),1;De=0;var Ge=je===""?".":je+":";if(G(k))for(var He=0;He<k.length;He++)je=k[He],ke=Ge+we(je,He),De+=$(je,se,q,ke,te);else if(He=T(k),typeof He=="function")for(k=He.call(k),He=0;!(je=k.next()).done;)je=je.value,ke=Ge+we(je,He++),De+=$(je,se,q,ke,te);else if(ke==="object"){if(typeof k.then=="function")return $(ve(k),se,q,je,te);throw se=String(k),Error("Objects are not valid as a React child (found: "+(se==="[object Object]"?"object with keys {"+Object.keys(k).join(", ")+"}":se)+"). If you meant to render a collection of children, use an array instead.")}return De}function Y(k,se,q){if(k==null)return k;var je=[],te=0;return $(k,je,"","",function(ke){return se.call(q,ke,te++)}),je}function W(k){if(k._status===-1){var se=k._result;se=se(),se.then(function(q){(k._status===0||k._status===-1)&&(k._status=1,k._result=q)},function(q){(k._status===0||k._status===-1)&&(k._status=2,k._result=q)}),k._status===-1&&(k._status=0,k._result=se)}if(k._status===1)return k._result.default;throw k._result}var he=typeof reportError=="function"?reportError:function(k){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var se=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof k=="object"&&k!==null&&typeof k.message=="string"?String(k.message):String(k),error:k});if(!window.dispatchEvent(se))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",k);return}console.error(k)},Se={map:Y,forEach:function(k,se,q){Y(k,function(){se.apply(this,arguments)},q)},count:function(k){var se=0;return Y(k,function(){se++}),se},toArray:function(k){return Y(k,function(se){return se})||[]},only:function(k){if(!B(k))throw Error("React.Children.only expected to receive a single React element child.");return k}};return st.Activity=j,st.Children=Se,st.Component=F,st.Fragment=r,st.Profiler=o,st.PureComponent=I,st.StrictMode=c,st.Suspense=g,st.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=z,st.__COMPILER_RUNTIME={__proto__:null,c:function(k){return z.H.useMemoCache(k)}},st.cache=function(k){return function(){return k.apply(null,arguments)}},st.cacheSignal=function(){return null},st.cloneElement=function(k,se,q){if(k==null)throw Error("The argument must be a React element, but you passed "+k+".");var je=A({},k.props),te=k.key;if(se!=null)for(ke in se.key!==void 0&&(te=""+se.key),se)!O.call(se,ke)||ke==="key"||ke==="__self"||ke==="__source"||ke==="ref"&&se.ref===void 0||(je[ke]=se[ke]);var ke=arguments.length-2;if(ke===1)je.children=q;else if(1<ke){for(var De=Array(ke),Ge=0;Ge<ke;Ge++)De[Ge]=arguments[Ge+2];je.children=De}return P(k.type,te,je)},st.createContext=function(k){return k={$$typeof:h,_currentValue:k,_currentValue2:k,_threadCount:0,Provider:null,Consumer:null},k.Provider=k,k.Consumer={$$typeof:d,_context:k},k},st.createElement=function(k,se,q){var je,te={},ke=null;if(se!=null)for(je in se.key!==void 0&&(ke=""+se.key),se)O.call(se,je)&&je!=="key"&&je!=="__self"&&je!=="__source"&&(te[je]=se[je]);var De=arguments.length-2;if(De===1)te.children=q;else if(1<De){for(var Ge=Array(De),He=0;He<De;He++)Ge[He]=arguments[He+2];te.children=Ge}if(k&&k.defaultProps)for(je in De=k.defaultProps,De)te[je]===void 0&&(te[je]=De[je]);return P(k,ke,te)},st.createRef=function(){return{current:null}},st.forwardRef=function(k){return{$$typeof:m,render:k}},st.isValidElement=B,st.lazy=function(k){return{$$typeof:y,_payload:{_status:-1,_result:k},_init:W}},st.memo=function(k,se){return{$$typeof:x,type:k,compare:se===void 0?null:se}},st.startTransition=function(k){var se=z.T,q={};z.T=q;try{var je=k(),te=z.S;te!==null&&te(q,je),typeof je=="object"&&je!==null&&typeof je.then=="function"&&je.then(M,he)}catch(ke){he(ke)}finally{se!==null&&q.types!==null&&(se.types=q.types),z.T=se}},st.unstable_useCacheRefresh=function(){return z.H.useCacheRefresh()},st.use=function(k){return z.H.use(k)},st.useActionState=function(k,se,q){return z.H.useActionState(k,se,q)},st.useCallback=function(k,se){return z.H.useCallback(k,se)},st.useContext=function(k){return z.H.useContext(k)},st.useDebugValue=function(){},st.useDeferredValue=function(k,se){return z.H.useDeferredValue(k,se)},st.useEffect=function(k,se){return z.H.useEffect(k,se)},st.useEffectEvent=function(k){return z.H.useEffectEvent(k)},st.useId=function(){return z.H.useId()},st.useImperativeHandle=function(k,se,q){return z.H.useImperativeHandle(k,se,q)},st.useInsertionEffect=function(k,se){return z.H.useInsertionEffect(k,se)},st.useLayoutEffect=function(k,se){return z.H.useLayoutEffect(k,se)},st.useMemo=function(k,se){return z.H.useMemo(k,se)},st.useOptimistic=function(k,se){return z.H.useOptimistic(k,se)},st.useReducer=function(k,se,q){return z.H.useReducer(k,se,q)},st.useRef=function(k){return z.H.useRef(k)},st.useState=function(k){return z.H.useState(k)},st.useSyncExternalStore=function(k,se,q){return z.H.useSyncExternalStore(k,se,q)},st.useTransition=function(){return z.H.useTransition()},st.version="19.2.8",st}var Yx;function Hp(){return Yx||(Yx=1,Fh.exports=nv()),Fh.exports}var b=Hp(),Jh={exports:{}},tu={},Wh={exports:{}},Ph={};/**
|
|
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 Xx;function sv(){return Xx||(Xx=1,(function(n){function l($,Y){var W=$.length;$.push(Y);e:for(;0<W;){var he=W-1>>>1,Se=$[he];if(0<o(Se,Y))$[he]=Y,$[W]=Se,W=he;else break e}}function r($){return $.length===0?null:$[0]}function c($){if($.length===0)return null;var Y=$[0],W=$.pop();if(W!==Y){$[0]=W;e:for(var he=0,Se=$.length,k=Se>>>1;he<k;){var se=2*(he+1)-1,q=$[se],je=se+1,te=$[je];if(0>o(q,W))je<Se&&0>o(te,q)?($[he]=te,$[je]=W,he=je):($[he]=q,$[se]=W,he=se);else if(je<Se&&0>o(te,W))$[he]=te,$[je]=W,he=je;else break e}}return Y}function o($,Y){var W=$.sortIndex-Y.sortIndex;return W!==0?W:$.id-Y.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;n.unstable_now=function(){return d.now()}}else{var h=Date,m=h.now();n.unstable_now=function(){return h.now()-m}}var g=[],x=[],y=1,j=null,v=3,T=!1,w=!1,A=!1,C=!1,F=typeof setTimeout=="function"?setTimeout:null,Q=typeof clearTimeout=="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null;function L($){for(var Y=r(x);Y!==null;){if(Y.callback===null)c(x);else if(Y.startTime<=$)c(x),Y.sortIndex=Y.expirationTime,l(g,Y);else break;Y=r(x)}}function G($){if(A=!1,L($),!w)if(r(g)!==null)w=!0,M||(M=!0,J());else{var Y=r(x);Y!==null&&ve(G,Y.startTime-$)}}var M=!1,z=-1,O=5,P=-1;function U(){return C?!0:!(n.unstable_now()-P<O)}function B(){if(C=!1,M){var $=n.unstable_now();P=$;var Y=!0;try{e:{w=!1,A&&(A=!1,Q(z),z=-1),T=!0;var W=v;try{t:{for(L($),j=r(g);j!==null&&!(j.expirationTime>$&&U());){var he=j.callback;if(typeof he=="function"){j.callback=null,v=j.priorityLevel;var Se=he(j.expirationTime<=$);if($=n.unstable_now(),typeof Se=="function"){j.callback=Se,L($),Y=!0;break t}j===r(g)&&c(g),L($)}else c(g);j=r(g)}if(j!==null)Y=!0;else{var k=r(x);k!==null&&ve(G,k.startTime-$),Y=!1}}break e}finally{j=null,v=W,T=!1}Y=void 0}}finally{Y?J():M=!1}}}var J;if(typeof I=="function")J=function(){I(B)};else if(typeof MessageChannel<"u"){var me=new MessageChannel,we=me.port2;me.port1.onmessage=B,J=function(){we.postMessage(null)}}else J=function(){F(B,0)};function ve($,Y){z=F(function(){$(n.unstable_now())},Y)}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($){$.callback=null},n.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<$?Math.floor(1e3/$):5},n.unstable_getCurrentPriorityLevel=function(){return v},n.unstable_next=function($){switch(v){case 1:case 2:case 3:var Y=3;break;default:Y=v}var W=v;v=Y;try{return $()}finally{v=W}},n.unstable_requestPaint=function(){C=!0},n.unstable_runWithPriority=function($,Y){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var W=v;v=$;try{return Y()}finally{v=W}},n.unstable_scheduleCallback=function($,Y,W){var he=n.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?he+W:he):W=he,$){case 1:var Se=-1;break;case 2:Se=250;break;case 5:Se=1073741823;break;case 4:Se=1e4;break;default:Se=5e3}return Se=W+Se,$={id:y++,callback:Y,priorityLevel:$,startTime:W,expirationTime:Se,sortIndex:-1},W>he?($.sortIndex=W,l(x,$),r(g)===null&&$===r(x)&&(A?(Q(z),z=-1):A=!0,ve(G,W-he))):($.sortIndex=Se,l(g,$),w||T||(w=!0,M||(M=!0,J()))),$},n.unstable_shouldYield=U,n.unstable_wrapCallback=function($){var Y=v;return function(){var W=v;v=Y;try{return $.apply(this,arguments)}finally{v=W}}}})(Ph)),Ph}var Vx;function lv(){return Vx||(Vx=1,Wh.exports=sv()),Wh.exports}var ep={exports:{}},ys={};/**
|
|
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 Qx;function av(){if(Qx)return ys;Qx=1;var n=Hp();function l(g){var x="https://react.dev/errors/"+g;if(1<arguments.length){x+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)x+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+g+"; visit "+x+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var c={d:{f:r,r:function(){throw Error(l(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for("react.portal");function d(g,x,y){var j=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:j==null?null:""+j,children:g,containerInfo:x,implementation:y}}var h=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(g,x){if(g==="font")return"";if(typeof x=="string")return x==="use-credentials"?x:""}return ys.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,ys.createPortal=function(g,x){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!x||x.nodeType!==1&&x.nodeType!==9&&x.nodeType!==11)throw Error(l(299));return d(g,x,null,y)},ys.flushSync=function(g){var x=h.T,y=c.p;try{if(h.T=null,c.p=2,g)return g()}finally{h.T=x,c.p=y,c.d.f()}},ys.preconnect=function(g,x){typeof g=="string"&&(x?(x=x.crossOrigin,x=typeof x=="string"?x==="use-credentials"?x:"":void 0):x=null,c.d.C(g,x))},ys.prefetchDNS=function(g){typeof g=="string"&&c.d.D(g)},ys.preinit=function(g,x){if(typeof g=="string"&&x&&typeof x.as=="string"){var y=x.as,j=m(y,x.crossOrigin),v=typeof x.integrity=="string"?x.integrity:void 0,T=typeof x.fetchPriority=="string"?x.fetchPriority:void 0;y==="style"?c.d.S(g,typeof x.precedence=="string"?x.precedence:void 0,{crossOrigin:j,integrity:v,fetchPriority:T}):y==="script"&&c.d.X(g,{crossOrigin:j,integrity:v,fetchPriority:T,nonce:typeof x.nonce=="string"?x.nonce:void 0})}},ys.preinitModule=function(g,x){if(typeof g=="string")if(typeof x=="object"&&x!==null){if(x.as==null||x.as==="script"){var y=m(x.as,x.crossOrigin);c.d.M(g,{crossOrigin:y,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0})}}else x==null&&c.d.M(g)},ys.preload=function(g,x){if(typeof g=="string"&&typeof x=="object"&&x!==null&&typeof x.as=="string"){var y=x.as,j=m(y,x.crossOrigin);c.d.L(g,y,{crossOrigin:j,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})}},ys.preloadModule=function(g,x){if(typeof g=="string")if(x){var y=m(x.as,x.crossOrigin);c.d.m(g,{as:typeof x.as=="string"&&x.as!=="script"?x.as:void 0,crossOrigin:y,integrity:typeof x.integrity=="string"?x.integrity:void 0})}else c.d.m(g)},ys.requestFormReset=function(g){c.d.r(g)},ys.unstable_batchedUpdates=function(g,x){return g(x)},ys.useFormState=function(g,x,y){return h.H.useFormState(g,x,y)},ys.useFormStatus=function(){return h.H.useHostTransitionStatus()},ys.version="19.2.8",ys}var Kx;function iv(){if(Kx)return ep.exports;Kx=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(l){console.error(l)}}return n(),ep.exports=av(),ep.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 Zx;function rv(){if(Zx)return tu;Zx=1;var n=lv(),l=Hp(),r=iv();function c(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)t+="&args[]="+encodeURIComponent(arguments[s])}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 d(e){var t=e,s=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(s=t.return),e=t.return;while(e)}return t.tag===3?s: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 m(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function g(e){if(d(e)!==e)throw Error(c(188))}function x(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(c(188));return t!==e?null:e}for(var s=e,i=t;;){var u=s.return;if(u===null)break;var f=u.alternate;if(f===null){if(i=u.return,i!==null){s=i;continue}break}if(u.child===f.child){for(f=u.child;f;){if(f===s)return g(u),e;if(f===i)return g(u),t;f=f.sibling}throw Error(c(188))}if(s.return!==i.return)s=u,i=f;else{for(var _=!1,N=u.child;N;){if(N===s){_=!0,s=u,i=f;break}if(N===i){_=!0,i=u,s=f;break}N=N.sibling}if(!_){for(N=f.child;N;){if(N===s){_=!0,s=f,i=u;break}if(N===i){_=!0,i=f,s=u;break}N=N.sibling}if(!_)throw Error(c(189))}}if(s.alternate!==i)throw Error(c(190))}if(s.tag!==3)throw Error(c(188));return s.stateNode.current===s?e:t}function y(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=y(e),t!==null)return t;e=e.sibling}return null}var j=Object.assign,v=Symbol.for("react.element"),T=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),F=Symbol.for("react.profiler"),Q=Symbol.for("react.consumer"),I=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),G=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),U=Symbol.for("react.memo_cache_sentinel"),B=Symbol.iterator;function J(e){return e===null||typeof e!="object"?null:(e=B&&e[B]||e["@@iterator"],typeof e=="function"?e:null)}var me=Symbol.for("react.client.reference");function we(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===me?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case A:return"Fragment";case F:return"Profiler";case C:return"StrictMode";case G:return"Suspense";case M:return"SuspenseList";case P:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case w:return"Portal";case I:return e.displayName||"Context";case Q: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 z:return t=e.displayName||null,t!==null?t:we(e.type)||"Memo";case O:t=e._payload,e=e._init;try{return we(e(t))}catch{}}return null}var ve=Array.isArray,$=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W={pending:!1,data:null,method:null,action:null},he=[],Se=-1;function k(e){return{current:e}}function se(e){0>Se||(e.current=he[Se],he[Se]=null,Se--)}function q(e,t){Se++,he[Se]=e.current,e.current=t}var je=k(null),te=k(null),ke=k(null),De=k(null);function Ge(e,t){switch(q(ke,t),q(te,e),q(je,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?ox(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=ox(t),e=ux(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}se(je),q(je,e)}function He(){se(je),se(te),se(ke)}function bt(e){e.memoizedState!==null&&q(De,e);var t=je.current,s=ux(t,e.type);t!==s&&(q(te,e),q(je,s))}function Ve(e){te.current===e&&(se(je),se(te)),De.current===e&&(se(De),Fo._currentValue=W)}var fn,We;function at(e){if(fn===void 0)try{throw Error()}catch(s){var t=s.stack.trim().match(/\n( *(at )?)/);fn=t&&t[1]||"",We=-1<s.stack.indexOf(`
|
|
43
|
-
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
44
|
-
`+fn+e+We}var ct=!1;function jt(e,t){if(!e||ct)return"";ct=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var pe=function(){throw Error()};if(Object.defineProperty(pe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(pe,[])}catch(ce){var ie=ce}Reflect.construct(e,[],pe)}else{try{pe.call()}catch(ce){ie=ce}e.call(pe.prototype)}}else{try{throw Error()}catch(ce){ie=ce}(pe=e())&&typeof pe.catch=="function"&&pe.catch(function(){})}}catch(ce){if(ce&&ie&&typeof ce.stack=="string")return[ce.stack,ie.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=i.DetermineComponentFrameRoot(),_=f[0],N=f[1];if(_&&N){var D=_.split(`
|
|
45
|
-
`),le=N.split(`
|
|
46
|
-
`);for(u=i=0;i<D.length&&!D[i].includes("DetermineComponentFrameRoot");)i++;for(;u<le.length&&!le[u].includes("DetermineComponentFrameRoot");)u++;if(i===D.length||u===le.length)for(i=D.length-1,u=le.length-1;1<=i&&0<=u&&D[i]!==le[u];)u--;for(;1<=i&&0<=u;i--,u--)if(D[i]!==le[u]){if(i!==1||u!==1)do if(i--,u--,0>u||D[i]!==le[u]){var ue=`
|
|
47
|
-
`+D[i].replace(" at new "," at ");return e.displayName&&ue.includes("<anonymous>")&&(ue=ue.replace("<anonymous>",e.displayName)),ue}while(1<=i&&0<=u);break}}}finally{ct=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?at(s):""}function ut(e,t){switch(e.tag){case 26:case 27:case 5:return at(e.type);case 16:return at("Lazy");case 13:return e.child!==t&&t!==null?at("Suspense Fallback"):at("Suspense");case 19:return at("SuspenseList");case 0:case 15:return jt(e.type,!1);case 11:return jt(e.type.render,!1);case 1:return jt(e.type,!0);case 31:return at("Activity");default:return""}}function $t(e){try{var t="",s=null;do t+=ut(e,s),s=e,e=e.return;while(e);return t}catch(i){return`
|
|
48
|
-
Error generating stack: `+i.message+`
|
|
49
|
-
`+i.stack}}var wt=Object.prototype.hasOwnProperty,Ce=n.unstable_scheduleCallback,Pe=n.unstable_cancelCallback,Rt=n.unstable_shouldYield,dt=n.unstable_requestPaint,Fe=n.unstable_now,bn=n.unstable_getCurrentPriorityLevel,ts=n.unstable_ImmediatePriority,Lt=n.unstable_UserBlockingPriority,kt=n.unstable_NormalPriority,hs=n.unstable_LowPriority,hn=n.unstable_IdlePriority,tn=n.log,ps=n.unstable_setDisableYieldValue,_n=null,Ft=null;function Cn(e){if(typeof tn=="function"&&ps(e),Ft&&typeof Ft.setStrictMode=="function")try{Ft.setStrictMode(_n,e)}catch{}}var zt=Math.clz32?Math.clz32:ye,Tt=Math.log,re=Math.LN2;function ye(e){return e>>>=0,e===0?32:31-(Tt(e)/re|0)|0}var Xe=256,it=262144,Je=4194304;function nn(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 Z(e,t,s){var i=e.pendingLanes;if(i===0)return 0;var u=0,f=e.suspendedLanes,_=e.pingedLanes;e=e.warmLanes;var N=i&134217727;return N!==0?(i=N&~f,i!==0?u=nn(i):(_&=N,_!==0?u=nn(_):s||(s=N&~e,s!==0&&(u=nn(s))))):(N=i&~f,N!==0?u=nn(N):_!==0?u=nn(_):s||(s=i&~e,s!==0&&(u=nn(s)))),u===0?0:t!==0&&t!==u&&(t&f)===0&&(f=u&-u,s=t&-t,f>=s||f===32&&(s&4194048)!==0)?t:u}function fe(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Me(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 $e(){var e=Je;return Je<<=1,(Je&62914560)===0&&(Je=4194304),e}function Dt(e){for(var t=[],s=0;31>s;s++)t.push(e);return t}function pn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function An(e,t,s,i,u,f){var _=e.pendingLanes;e.pendingLanes=s,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=s,e.entangledLanes&=s,e.errorRecoveryDisabledLanes&=s,e.shellSuspendCounter=0;var N=e.entanglements,D=e.expirationTimes,le=e.hiddenUpdates;for(s=_&~s;0<s;){var ue=31-zt(s),pe=1<<ue;N[ue]=0,D[ue]=-1;var ie=le[ue];if(ie!==null)for(le[ue]=null,ue=0;ue<ie.length;ue++){var ce=ie[ue];ce!==null&&(ce.lane&=-536870913)}s&=~pe}i!==0&&Fs(e,i,0),f!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=f&~(_&~t))}function Fs(e,t,s){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-zt(t);e.entangledLanes|=t,e.entanglements[i]=e.entanglements[i]|1073741824|s&261930}function yn(e,t){var s=e.entangledLanes|=t;for(e=e.entanglements;s;){var i=31-zt(s),u=1<<i;u&t|e[i]&t&&(e[i]|=t),s&=~u}}function cl(e,t){var s=t&-t;return s=(s&42)!==0?1:ws(s),(s&(e.suspendedLanes|t))!==0?0:s}function ws(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 ns(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Vl(){var e=Y.p;return e!==0?e:(e=window.event,e===void 0?32:Dx(e.type))}function ks(e,t){var s=Y.p;try{return Y.p=e,t()}finally{Y.p=s}}var Us=Math.random().toString(36).slice(2),sn="__reactFiber$"+Us,et="__reactProps$"+Us,$n="__reactContainer$"+Us,ol="__reactEvents$"+Us,Js="__reactListeners$"+Us,Mn="__reactHandles$"+Us,ka="__reactResources$"+Us,ss="__reactMarker$"+Us;function ms(e){delete e[sn],delete e[et],delete e[ol],delete e[Js],delete e[Mn]}function Ss(e){var t=e[sn];if(t)return t;for(var s=e.parentNode;s;){if(t=s[$n]||s[sn]){if(s=t.alternate,t.child!==null||s!==null&&s.child!==null)for(e=xx(e);e!==null;){if(s=e[sn])return s;e=xx(e)}return t}e=s,s=e.parentNode}return null}function Rn(e){if(e=e[sn]||e[$n]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function gs(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function ln(e){var t=e[ka];return t||(t=e[ka]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function tt(e){e[ss]=!0}var Kn=new Set,vn={};function ls(e,t){_t(e,t),_t(e+"Capture",t)}function _t(e,t){for(vn[e]=t,e=0;e<t.length;e++)Kn.add(t[e])}var wl=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]*$"),qn={},Ws={};function as(e){return wt.call(Ws,e)?!0:wt.call(qn,e)?!1:wl.test(e)?Ws[e]=!0:(qn[e]=!0,!1)}function Zn(e,t,s){if(as(t))if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var i=t.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+s)}}function Gn(e,t,s){if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+s)}}function ft(e,t,s,i){if(i===null)e.removeAttribute(s);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(s);return}e.setAttributeNS(t,s,""+i)}}function Nt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function jn(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ri(e,t,s){var i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var u=i.get,f=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(_){s=""+_,f.call(this,_)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return s},setValue:function(_){s=""+_},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Es(e){if(!e._valueTracker){var t=jn(e)?"checked":"value";e._valueTracker=ri(e,t,""+e[t])}}function ul(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),i="";return e&&(i=jn(e)?e.checked?"true":"false":e.value),e=i,e!==s?(t.setValue(e),!0):!1}function Ql(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 ci=/[\n"\\]/g;function Dn(e){return e.replace(ci,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function is(e,t,s,i,u,f,_,N){e.name="",_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?e.type=_:e.removeAttribute("type"),t!=null?_==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Nt(t)):e.value!==""+Nt(t)&&(e.value=""+Nt(t)):_!=="submit"&&_!=="reset"||e.removeAttribute("value"),t!=null?qt(e,_,Nt(t)):s!=null?qt(e,_,Nt(s)):i!=null&&e.removeAttribute("value"),u==null&&f!=null&&(e.defaultChecked=!!f),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?e.name=""+Nt(N):e.removeAttribute("name")}function Hs(e,t,s,i,u,f,_,N){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.type=f),t!=null||s!=null){if(!(f!=="submit"&&f!=="reset"||t!=null)){Es(e);return}s=s!=null?""+Nt(s):"",t=t!=null?""+Nt(t):s,N||t===e.value||(e.value=t),e.defaultValue=t}i=i??u,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=N?e.checked:!!i,e.defaultChecked=!!i,_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(e.name=_),Es(e)}function qt(e,t,s){t==="number"&&Ql(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function Ts(e,t,s,i){if(e=e.options,t){t={};for(var u=0;u<s.length;u++)t["$"+s[u]]=!0;for(s=0;s<e.length;s++)u=t.hasOwnProperty("$"+e[s].value),e[s].selected!==u&&(e[s].selected=u),u&&i&&(e[s].defaultSelected=!0)}else{for(s=""+Nt(s),t=null,u=0;u<e.length;u++){if(e[u].value===s){e[u].selected=!0,i&&(e[u].defaultSelected=!0);return}t!==null||e[u].disabled||(t=e[u])}t!==null&&(t.selected=!0)}}function Ne(e,t,s){if(t!=null&&(t=""+Nt(t),t!==e.value&&(e.value=t),s==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=s!=null?""+Nt(s):""}function S(e,t,s,i){if(t==null){if(i!=null){if(s!=null)throw Error(c(92));if(ve(i)){if(1<i.length)throw Error(c(93));i=i[0]}s=i}s==null&&(s=""),t=s}s=Nt(t),e.defaultValue=s,i=e.textContent,i===s&&i!==""&&i!==null&&(e.value=i),Es(e)}function ee(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=t;return}}e.textContent=t}var ge=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 Ee(e,t,s){var i=t.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?i?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":i?e.setProperty(t,s):typeof s!="number"||s===0||ge.has(t)?t==="float"?e.cssFloat=s:e[t]=(""+s).trim():e[t]=s+"px"}function Le(e,t,s){if(t!=null&&typeof t!="object")throw Error(c(62));if(e=e.style,s!=null){for(var i in s)!s.hasOwnProperty(i)||t!=null&&t.hasOwnProperty(i)||(i.indexOf("--")===0?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="");for(var u in t)i=t[u],t.hasOwnProperty(u)&&s[u]!==i&&Ee(e,u,i)}else for(var f in t)t.hasOwnProperty(f)&&Ee(e,f,t[f])}function Oe(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 Ct=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"]]),an=/^[\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 Nn(e){return an.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Ut(){}var zn=null;function mn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ps=null,kl=null;function E(e){var t=Rn(e);if(t&&(e=t.stateNode)){var s=e[et]||null;e:switch(e=t.stateNode,t.type){case"input":if(is(e,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),t=s.name,s.type==="radio"&&t!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+Dn(""+t)+'"][type="radio"]'),t=0;t<s.length;t++){var i=s[t];if(i!==e&&i.form===e.form){var u=i[et]||null;if(!u)throw Error(c(90));is(i,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(t=0;t<s.length;t++)i=s[t],i.form===e.form&&ul(i)}break e;case"textarea":Ne(e,s.value,s.defaultValue);break e;case"select":t=s.value,t!=null&&Ts(e,!!s.multiple,t,!1)}}}var oe=!1;function Te(e,t,s){if(oe)return e(t,s);oe=!0;try{var i=e(t);return i}finally{if(oe=!1,(Ps!==null||kl!==null)&&(id(),Ps&&(t=Ps,e=kl,kl=Ps=null,E(t),e)))for(t=0;t<e.length;t++)E(e[t])}}function Qe(e,t){var s=e.stateNode;if(s===null)return null;var i=s[et]||null;if(i===null)return null;s=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(c(231,t,typeof s));return s}var ot=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Zt=!1;if(ot)try{var Yn={};Object.defineProperty(Yn,"passive",{get:function(){Zt=!0}}),window.addEventListener("test",Yn,Yn),window.removeEventListener("test",Yn,Yn)}catch{Zt=!1}var wn=null,Sa=null,Ea=null;function sr(){if(Ea)return Ea;var e,t=Sa,s=t.length,i,u="value"in wn?wn.value:wn.textContent,f=u.length;for(e=0;e<s&&t[e]===u[e];e++);var _=s-e;for(i=1;i<=_&&t[s-i]===u[f-i];i++);return Ea=u.slice(e,1<i?1-i:void 0)}function dl(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 xs(){return!0}function lr(){return!1}function kn(e){function t(s,i,u,f,_){this._reactName=s,this._targetInst=u,this.type=i,this.nativeEvent=f,this.target=_,this.currentTarget=null;for(var N in e)e.hasOwnProperty(N)&&(s=e[N],this[N]=s?s(f):f[N]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?xs:lr,this.isPropagationStopped=lr,this}return j(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=xs)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=xs)},persist:function(){},isPersistent:xs}),t}var Ta={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},el=kn(Ta),Sl=j({},Ta,{view:0,detail:0}),Vr=kn(Sl),Ca,oi,ar,ui=j({},Sl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Aa,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!==ar&&(ar&&e.type==="mousemove"?(Ca=e.screenX-ar.screenX,oi=e.screenY-ar.screenY):oi=Ca=0,ar=e),Ca)},movementY:function(e){return"movementY"in e?e.movementY:oi}}),ir=kn(ui),vu=j({},ui,{dataTransfer:0}),Qr=kn(vu),ju=j({},Sl,{relatedTarget:0}),El=kn(ju),rr=j({},Ta,{animationName:0,elapsedTime:0,pseudoElement:0}),_f=kn(rr),no=j({},Ta,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Kr=kn(no),so=j({},Ta,{data:0}),lo=kn(so),Zr={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},di={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"},ao={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Fr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=ao[e])?!!t[e]:!1}function Aa(){return Fr}var yf=j({},Sl,{key:function(e){if(e.key){var t=Zr[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=dl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?di[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Aa,charCode:function(e){return e.type==="keypress"?dl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?dl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Jr=kn(yf),vf=j({},ui,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),cr=kn(vf),Wr=j({},Sl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Aa}),io=kn(Wr),or=j({},Ta,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ma=kn(or),Pr=j({},ui,{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}),ro=kn(Pr),jf=j({},Ta,{newState:0,oldState:0}),Ra=kn(jf),ec=[9,13,27,32],tc=ot&&"CompositionEvent"in window,Kl=null;ot&&"documentMode"in document&&(Kl=document.documentMode);var Nu=ot&&"TextEvent"in window&&!Kl,ur=ot&&(!tc||Kl&&8<Kl&&11>=Kl),fl=" ",dr=!1;function fi(e,t){switch(e){case"keyup":return ec.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Zl(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var hl=!1;function rn(e,t){switch(e){case"compositionend":return Zl(t);case"keypress":return t.which!==32?null:(dr=!0,fl);case"textInput":return e=t.data,e===fl&&dr?null:e;default:return null}}function co(e,t){if(hl)return e==="compositionend"||!tc&&fi(e,t)?(e=sr(),Ea=Sa=wn=null,hl=!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 ur&&t.locale!=="ko"?null:t.data;default:return null}}var Nf={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 wu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Nf[e.type]:t==="textarea"}function nc(e,t,s,i){Ps?kl?kl.push(i):kl=[i]:Ps=i,t=hd(t,"onChange"),0<t.length&&(s=new el("onChange","change",null,s,i),e.push({event:s,listeners:t}))}var Fl=null,cn=null;function fr(e){sx(e,0)}function Jl(e){var t=gs(e);if(ul(t))return e}function oo(e,t){if(e==="change")return t}var On=!1;if(ot){var sc;if(ot){var lc="oninput"in document;if(!lc){var pl=document.createElement("div");pl.setAttribute("oninput","return;"),lc=typeof pl.oninput=="function"}sc=lc}else sc=!1;On=sc&&(!document.documentMode||9<document.documentMode)}function uo(){Fl&&(Fl.detachEvent("onpropertychange",hr),cn=Fl=null)}function hr(e){if(e.propertyName==="value"&&Jl(cn)){var t=[];nc(t,cn,e,mn(e)),Te(fr,t)}}function ac(e,t,s){e==="focusin"?(uo(),Fl=t,cn=s,Fl.attachEvent("onpropertychange",hr)):e==="focusout"&&uo()}function pr(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Jl(cn)}function Da(e,t){if(e==="click")return Jl(t)}function ku(e,t){if(e==="input"||e==="change")return Jl(t)}function mr(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Fn=typeof Object.is=="function"?Object.is:mr;function Tl(e,t){if(Fn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var s=Object.keys(e),i=Object.keys(t);if(s.length!==i.length)return!1;for(i=0;i<s.length;i++){var u=s[i];if(!wt.call(t,u)||!Fn(e[u],t[u]))return!1}return!0}function hi(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function fo(e,t){var s=hi(e);e=0;for(var i;s;){if(s.nodeType===3){if(i=e+s.textContent.length,e<=t&&i>=t)return{node:s,offset:t-e};e=i}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=hi(s)}}function pi(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?pi(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Su(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ql(e.document);t instanceof e.HTMLIFrameElement;){try{var s=typeof t.contentWindow.location.href=="string"}catch{s=!1}if(s)e=t.contentWindow;else break;t=Ql(e.document)}return t}function ae(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 mi=ot&&"documentMode"in document&&11>=document.documentMode,Wl=null,ho=null,gr=null,K=!1;function ml(e,t,s){var i=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;K||Wl==null||Wl!==Ql(i)||(i=Wl,"selectionStart"in i&&ae(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),gr&&Tl(gr,i)||(gr=i,i=hd(ho,"onSelect"),0<i.length&&(t=new el("onSelect","select",null,t,s),e.push({event:t,listeners:i}),t.target=Wl)))}function Xn(e,t){var s={};return s[e.toLowerCase()]=t.toLowerCase(),s["Webkit"+e]="webkit"+t,s["Moz"+e]="moz"+t,s}var Oa={animationend:Xn("Animation","AnimationEnd"),animationiteration:Xn("Animation","AnimationIteration"),animationstart:Xn("Animation","AnimationStart"),transitionrun:Xn("Transition","TransitionRun"),transitionstart:Xn("Transition","TransitionStart"),transitioncancel:Xn("Transition","TransitionCancel"),transitionend:Xn("Transition","TransitionEnd")},gi={},po={};ot&&(po=document.createElement("div").style,"AnimationEvent"in window||(delete Oa.animationend.animation,delete Oa.animationiteration.animation,delete Oa.animationstart.animation),"TransitionEvent"in window||delete Oa.transitionend.transition);function La(e){if(gi[e])return gi[e];if(!Oa[e])return e;var t=Oa[e],s;for(s in t)if(t.hasOwnProperty(s)&&s in po)return gi[e]=t[s];return e}var Bs=La("animationend"),Eu=La("animationiteration"),mo=La("animationstart"),wf=La("transitionrun"),xi=La("transitionstart"),kf=La("transitioncancel"),Tu=La("transitionend"),Cu=new Map,go="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(" ");go.push("scrollEnd");function tl(e,t){Cu.set(e,t),ls(t,[e])}var Cl=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)},Is=[],bi=0,xo=0;function ic(){for(var e=bi,t=xo=bi=0;t<e;){var s=Is[t];Is[t++]=null;var i=Is[t];Is[t++]=null;var u=Is[t];Is[t++]=null;var f=Is[t];if(Is[t++]=null,i!==null&&u!==null){var _=i.pending;_===null?u.next=u:(u.next=_.next,_.next=u),i.pending=u}f!==0&&Au(s,u,f)}}function rc(e,t,s,i){Is[bi++]=e,Is[bi++]=t,Is[bi++]=s,Is[bi++]=i,xo|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function bo(e,t,s,i){return rc(e,t,s,i),cc(e)}function za(e,t){return rc(e,null,null,t),cc(e)}function Au(e,t,s){e.lanes|=s;var i=e.alternate;i!==null&&(i.lanes|=s);for(var u=!1,f=e.return;f!==null;)f.childLanes|=s,i=f.alternate,i!==null&&(i.childLanes|=s),f.tag===22&&(e=f.stateNode,e===null||e._visibility&1||(u=!0)),e=f,f=f.return;return e.tag===3?(f=e.stateNode,u&&t!==null&&(u=31-zt(s),e=f.hiddenUpdates,i=e[u],i===null?e[u]=[t]:i.push(t),t.lane=s|536870912),f):null}function cc(e){if(50<Go)throw Go=0,bh=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Pl={};function Sf(e,t,s,i){this.tag=e,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Cs(e,t,s,i){return new Sf(e,t,s,i)}function xr(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Al(e,t){var s=e.alternate;return s===null?(s=Cs(e.tag,t,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=t,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&65011712,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,t=e.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s.refCleanup=e.refCleanup,s}function Mu(e,t){e.flags&=65011714;var s=e.alternate;return s===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=s.childLanes,e.lanes=s.lanes,e.child=s.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=s.memoizedProps,e.memoizedState=s.memoizedState,e.updateQueue=s.updateQueue,e.type=s.type,t=s.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function _i(e,t,s,i,u,f){var _=0;if(i=e,typeof e=="function")xr(e)&&(_=1);else if(typeof e=="string")_=I0(e,s,je.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case P:return e=Cs(31,s,t,u),e.elementType=P,e.lanes=f,e;case A:return Ua(s.children,u,f,t);case C:_=8,u|=24;break;case F:return e=Cs(12,s,t,u|2),e.elementType=F,e.lanes=f,e;case G:return e=Cs(13,s,t,u),e.elementType=G,e.lanes=f,e;case M:return e=Cs(19,s,t,u),e.elementType=M,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case I:_=10;break e;case Q:_=9;break e;case L:_=11;break e;case z:_=14;break e;case O:_=16,i=null;break e}_=29,s=Error(c(130,e===null?"null":typeof e,"")),i=null}return t=Cs(_,s,t,u),t.elementType=e,t.type=i,t.lanes=f,t}function Ua(e,t,s,i){return e=Cs(7,e,i,t),e.lanes=s,e}function oc(e,t,s){return e=Cs(6,e,null,t),e.lanes=s,e}function uc(e){var t=Cs(18,null,null,0);return t.stateNode=e,t}function dc(e,t,s){return t=Cs(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var fc=new WeakMap;function As(e,t){if(typeof e=="object"&&e!==null){var s=fc.get(e);return s!==void 0?s:(t={value:e,source:t,stack:$t(t)},fc.set(e,t),t)}return{value:e,source:t,stack:$t(t)}}var Ha=[],Ba=0,hc=null,yi=0,Ms=[],$s=0,Ml=null,qs=1,gl="";function nl(e,t){Ha[Ba++]=yi,Ha[Ba++]=hc,hc=e,yi=t}function Ru(e,t,s){Ms[$s++]=qs,Ms[$s++]=gl,Ms[$s++]=Ml,Ml=e;var i=qs;e=gl;var u=32-zt(i)-1;i&=~(1<<u),s+=1;var f=32-zt(t)+u;if(30<f){var _=u-u%5;f=(i&(1<<_)-1).toString(32),i>>=_,u-=_,qs=1<<32-zt(t)+u|s<<u|i,gl=f+e}else qs=1<<f|s<<u|i,gl=e}function _o(e){e.return!==null&&(nl(e,1),Ru(e,1,0))}function yo(e){for(;e===hc;)hc=Ha[--Ba],Ha[Ba]=null,yi=Ha[--Ba],Ha[Ba]=null;for(;e===Ml;)Ml=Ms[--$s],Ms[$s]=null,gl=Ms[--$s],Ms[$s]=null,qs=Ms[--$s],Ms[$s]=null}function Du(e,t){Ms[$s++]=qs,Ms[$s++]=gl,Ms[$s++]=Ml,qs=t.id,gl=t.overflow,Ml=e}var gn=null,Gt=null,ht=!1,Rl=null,Gs=!1,vo=Error(c(519));function ea(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw br(As(t,e)),vo}function Ou(e){var t=e.stateNode,s=e.type,i=e.memoizedProps;switch(t[sn]=e,t[et]=i,s){case"dialog":mt("cancel",t),mt("close",t);break;case"iframe":case"object":case"embed":mt("load",t);break;case"video":case"audio":for(s=0;s<Xo.length;s++)mt(Xo[s],t);break;case"source":mt("error",t);break;case"img":case"image":case"link":mt("error",t),mt("load",t);break;case"details":mt("toggle",t);break;case"input":mt("invalid",t),Hs(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":mt("invalid",t);break;case"textarea":mt("invalid",t),S(t,i.value,i.defaultValue,i.children)}s=i.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||t.textContent===""+s||i.suppressHydrationWarning===!0||rx(t.textContent,s)?(i.popover!=null&&(mt("beforetoggle",t),mt("toggle",t)),i.onScroll!=null&&mt("scroll",t),i.onScrollEnd!=null&&mt("scrollend",t),i.onClick!=null&&(t.onclick=Ut),t=!0):t=!1,t||ea(e,!0)}function Lu(e){for(gn=e.return;gn;)switch(gn.tag){case 5:case 31:case 13:Gs=!1;return;case 27:case 3:Gs=!0;return;default:gn=gn.return}}function vi(e){if(e!==gn)return!1;if(!ht)return Lu(e),ht=!0,!1;var t=e.tag,s;if((s=t!==3&&t!==27)&&((s=t===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||Dh(e.type,e.memoizedProps)),s=!s),s&&Gt&&ea(e),Lu(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));Gt=gx(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));Gt=gx(e)}else t===27?(t=Gt,Hi(e.type)?(e=Hh,Hh=null,Gt=e):Gt=t):Gt=gn?_l(e.stateNode.nextSibling):null;return!0}function Ia(){Gt=gn=null,ht=!1}function jo(){var e=Rl;return e!==null&&(Qs===null?Qs=e:Qs.push.apply(Qs,e),Rl=null),e}function br(e){Rl===null?Rl=[e]:Rl.push(e)}var No=k(null),$a=null,Dl=null;function Ol(e,t,s){q(No,t._currentValue),t._currentValue=s}function Ll(e){e._currentValue=No.current,se(No)}function wo(e,t,s){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===s)break;e=e.return}}function ko(e,t,s,i){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var f=u.dependencies;if(f!==null){var _=u.child;f=f.firstContext;e:for(;f!==null;){var N=f;f=u;for(var D=0;D<t.length;D++)if(N.context===t[D]){f.lanes|=s,N=f.alternate,N!==null&&(N.lanes|=s),wo(f.return,s,e),i||(_=null);break e}f=N.next}}else if(u.tag===18){if(_=u.return,_===null)throw Error(c(341));_.lanes|=s,f=_.alternate,f!==null&&(f.lanes|=s),wo(_,s,e),_=null}else _=u.child;if(_!==null)_.return=u;else for(_=u;_!==null;){if(_===e){_=null;break}if(u=_.sibling,u!==null){u.return=_.return,_=u;break}_=_.return}u=_}}function ji(e,t,s,i){e=null;for(var u=t,f=!1;u!==null;){if(!f){if((u.flags&524288)!==0)f=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var _=u.alternate;if(_===null)throw Error(c(387));if(_=_.memoizedProps,_!==null){var N=u.type;Fn(u.pendingProps.value,_.value)||(e!==null?e.push(N):e=[N])}}else if(u===De.current){if(_=u.alternate,_===null)throw Error(c(387));_.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(Fo):e=[Fo])}u=u.return}e!==null&&ko(t,e,s,i),t.flags|=262144}function Ni(e){for(e=e.firstContext;e!==null;){if(!Fn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function zl(e){$a=e,Dl=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Sn(e){return zu($a,e)}function pc(e,t){return $a===null&&zl(e),zu(e,t)}function zu(e,t){var s=t._currentValue;if(t={context:t,memoizedValue:s,next:null},Dl===null){if(e===null)throw Error(c(308));Dl=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Dl=Dl.next=t;return s}var Ef=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(s,i){e.push(i)}};this.abort=function(){t.aborted=!0,e.forEach(function(s){return s()})}},Tf=n.unstable_scheduleCallback,Cf=n.unstable_NormalPriority,En={$$typeof:I,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function So(){return{controller:new Ef,data:new Map,refCount:0}}function _r(e){e.refCount--,e.refCount===0&&Tf(Cf,function(){e.controller.abort()})}var yr=null,Eo=0,wi=0,ki=null;function Af(e,t){if(yr===null){var s=yr=[];Eo=0,wi=wh(),ki={status:"pending",value:void 0,then:function(i){s.push(i)}}}return Eo++,t.then(Uu,Uu),t}function Uu(){if(--Eo===0&&yr!==null){ki!==null&&(ki.status="fulfilled");var e=yr;yr=null,wi=0,ki=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Mf(e,t){var s=[],i={status:"pending",value:null,reason:null,then:function(u){s.push(u)}};return e.then(function(){i.status="fulfilled",i.value=t;for(var u=0;u<s.length;u++)(0,s[u])(t)},function(u){for(i.status="rejected",i.reason=u,u=0;u<s.length;u++)(0,s[u])(void 0)}),i}var Hu=$.S;$.S=function(e,t){Mg=Fe(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Af(e,t),Hu!==null&&Hu(e,t)};var qa=k(null);function mc(){var e=qa.current;return e!==null?e:Kt.pooledCache}function vr(e,t){t===null?q(qa,qa.current):q(qa,t.pool)}function jr(){var e=mc();return e===null?null:{parent:En._currentValue,pool:e}}var Jn=Error(c(460)),Rs=Error(c(474)),Ht=Error(c(542)),Si={then:function(){}};function Bu(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Iu(e,t,s){switch(s=e[s],s===void 0?e.push(t):s!==t&&(t.then(Ut,Ut),t=s),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,gc(e),e;default:if(typeof t.status=="string")t.then(Ut,Ut);else{if(e=Kt,e!==null&&100<e.shellSuspendCounter)throw Error(c(482));e=t,e.status="pending",e.then(function(i){if(t.status==="pending"){var u=t;u.status="fulfilled",u.value=i}},function(i){if(t.status==="pending"){var u=t;u.status="rejected",u.reason=i}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,gc(e),e}throw ta=t,Jn}}function xl(e){try{var t=e._init;return t(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(ta=s,Jn):s}}var ta=null;function Nr(){if(ta===null)throw Error(c(459));var e=ta;return ta=null,e}function gc(e){if(e===Jn||e===Ht)throw Error(c(483))}var Ga=null,na=0;function wr(e){var t=na;return na+=1,Ga===null&&(Ga=[]),Iu(Ga,e,t)}function kr(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function sa(e,t){throw t.$$typeof===v?Error(c(525)):(e=Object.prototype.toString.call(t),Error(c(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function To(e){function t(V,H){if(e){var ne=V.deletions;ne===null?(V.deletions=[H],V.flags|=16):ne.push(H)}}function s(V,H){if(!e)return null;for(;H!==null;)t(V,H),H=H.sibling;return null}function i(V){for(var H=new Map;V!==null;)V.key!==null?H.set(V.key,V):H.set(V.index,V),V=V.sibling;return H}function u(V,H){return V=Al(V,H),V.index=0,V.sibling=null,V}function f(V,H,ne){return V.index=ne,e?(ne=V.alternate,ne!==null?(ne=ne.index,ne<H?(V.flags|=67108866,H):ne):(V.flags|=67108866,H)):(V.flags|=1048576,H)}function _(V){return e&&V.alternate===null&&(V.flags|=67108866),V}function N(V,H,ne,de){return H===null||H.tag!==6?(H=oc(ne,V.mode,de),H.return=V,H):(H=u(H,ne),H.return=V,H)}function D(V,H,ne,de){var Ye=ne.type;return Ye===A?ue(V,H,ne.props.children,de,ne.key):H!==null&&(H.elementType===Ye||typeof Ye=="object"&&Ye!==null&&Ye.$$typeof===O&&xl(Ye)===H.type)?(H=u(H,ne.props),kr(H,ne),H.return=V,H):(H=_i(ne.type,ne.key,ne.props,null,V.mode,de),kr(H,ne),H.return=V,H)}function le(V,H,ne,de){return H===null||H.tag!==4||H.stateNode.containerInfo!==ne.containerInfo||H.stateNode.implementation!==ne.implementation?(H=dc(ne,V.mode,de),H.return=V,H):(H=u(H,ne.children||[]),H.return=V,H)}function ue(V,H,ne,de,Ye){return H===null||H.tag!==7?(H=Ua(ne,V.mode,de,Ye),H.return=V,H):(H=u(H,ne),H.return=V,H)}function pe(V,H,ne){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return H=oc(""+H,V.mode,ne),H.return=V,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case T:return ne=_i(H.type,H.key,H.props,null,V.mode,ne),kr(ne,H),ne.return=V,ne;case w:return H=dc(H,V.mode,ne),H.return=V,H;case O:return H=xl(H),pe(V,H,ne)}if(ve(H)||J(H))return H=Ua(H,V.mode,ne,null),H.return=V,H;if(typeof H.then=="function")return pe(V,wr(H),ne);if(H.$$typeof===I)return pe(V,pc(V,H),ne);sa(V,H)}return null}function ie(V,H,ne,de){var Ye=H!==null?H.key:null;if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return Ye!==null?null:N(V,H,""+ne,de);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case T:return ne.key===Ye?D(V,H,ne,de):null;case w:return ne.key===Ye?le(V,H,ne,de):null;case O:return ne=xl(ne),ie(V,H,ne,de)}if(ve(ne)||J(ne))return Ye!==null?null:ue(V,H,ne,de,null);if(typeof ne.then=="function")return ie(V,H,wr(ne),de);if(ne.$$typeof===I)return ie(V,H,pc(V,ne),de);sa(V,ne)}return null}function ce(V,H,ne,de,Ye){if(typeof de=="string"&&de!==""||typeof de=="number"||typeof de=="bigint")return V=V.get(ne)||null,N(H,V,""+de,Ye);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case T:return V=V.get(de.key===null?ne:de.key)||null,D(H,V,de,Ye);case w:return V=V.get(de.key===null?ne:de.key)||null,le(H,V,de,Ye);case O:return de=xl(de),ce(V,H,ne,de,Ye)}if(ve(de)||J(de))return V=V.get(ne)||null,ue(H,V,de,Ye,null);if(typeof de.then=="function")return ce(V,H,ne,wr(de),Ye);if(de.$$typeof===I)return ce(V,H,ne,pc(H,de),Ye);sa(H,de)}return null}function ze(V,H,ne,de){for(var Ye=null,St=null,Be=H,rt=H=0,xt=null;Be!==null&&rt<ne.length;rt++){Be.index>rt?(xt=Be,Be=null):xt=Be.sibling;var Et=ie(V,Be,ne[rt],de);if(Et===null){Be===null&&(Be=xt);break}e&&Be&&Et.alternate===null&&t(V,Be),H=f(Et,H,rt),St===null?Ye=Et:St.sibling=Et,St=Et,Be=xt}if(rt===ne.length)return s(V,Be),ht&&nl(V,rt),Ye;if(Be===null){for(;rt<ne.length;rt++)Be=pe(V,ne[rt],de),Be!==null&&(H=f(Be,H,rt),St===null?Ye=Be:St.sibling=Be,St=Be);return ht&&nl(V,rt),Ye}for(Be=i(Be);rt<ne.length;rt++)xt=ce(Be,V,rt,ne[rt],de),xt!==null&&(e&&xt.alternate!==null&&Be.delete(xt.key===null?rt:xt.key),H=f(xt,H,rt),St===null?Ye=xt:St.sibling=xt,St=xt);return e&&Be.forEach(function(Gi){return t(V,Gi)}),ht&&nl(V,rt),Ye}function Ke(V,H,ne,de){if(ne==null)throw Error(c(151));for(var Ye=null,St=null,Be=H,rt=H=0,xt=null,Et=ne.next();Be!==null&&!Et.done;rt++,Et=ne.next()){Be.index>rt?(xt=Be,Be=null):xt=Be.sibling;var Gi=ie(V,Be,Et.value,de);if(Gi===null){Be===null&&(Be=xt);break}e&&Be&&Gi.alternate===null&&t(V,Be),H=f(Gi,H,rt),St===null?Ye=Gi:St.sibling=Gi,St=Gi,Be=xt}if(Et.done)return s(V,Be),ht&&nl(V,rt),Ye;if(Be===null){for(;!Et.done;rt++,Et=ne.next())Et=pe(V,Et.value,de),Et!==null&&(H=f(Et,H,rt),St===null?Ye=Et:St.sibling=Et,St=Et);return ht&&nl(V,rt),Ye}for(Be=i(Be);!Et.done;rt++,Et=ne.next())Et=ce(Be,V,rt,Et.value,de),Et!==null&&(e&&Et.alternate!==null&&Be.delete(Et.key===null?rt:Et.key),H=f(Et,H,rt),St===null?Ye=Et:St.sibling=Et,St=Et);return e&&Be.forEach(function(J0){return t(V,J0)}),ht&&nl(V,rt),Ye}function Vt(V,H,ne,de){if(typeof ne=="object"&&ne!==null&&ne.type===A&&ne.key===null&&(ne=ne.props.children),typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case T:e:{for(var Ye=ne.key;H!==null;){if(H.key===Ye){if(Ye=ne.type,Ye===A){if(H.tag===7){s(V,H.sibling),de=u(H,ne.props.children),de.return=V,V=de;break e}}else if(H.elementType===Ye||typeof Ye=="object"&&Ye!==null&&Ye.$$typeof===O&&xl(Ye)===H.type){s(V,H.sibling),de=u(H,ne.props),kr(de,ne),de.return=V,V=de;break e}s(V,H);break}else t(V,H);H=H.sibling}ne.type===A?(de=Ua(ne.props.children,V.mode,de,ne.key),de.return=V,V=de):(de=_i(ne.type,ne.key,ne.props,null,V.mode,de),kr(de,ne),de.return=V,V=de)}return _(V);case w:e:{for(Ye=ne.key;H!==null;){if(H.key===Ye)if(H.tag===4&&H.stateNode.containerInfo===ne.containerInfo&&H.stateNode.implementation===ne.implementation){s(V,H.sibling),de=u(H,ne.children||[]),de.return=V,V=de;break e}else{s(V,H);break}else t(V,H);H=H.sibling}de=dc(ne,V.mode,de),de.return=V,V=de}return _(V);case O:return ne=xl(ne),Vt(V,H,ne,de)}if(ve(ne))return ze(V,H,ne,de);if(J(ne)){if(Ye=J(ne),typeof Ye!="function")throw Error(c(150));return ne=Ye.call(ne),Ke(V,H,ne,de)}if(typeof ne.then=="function")return Vt(V,H,wr(ne),de);if(ne.$$typeof===I)return Vt(V,H,pc(V,ne),de);sa(V,ne)}return typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint"?(ne=""+ne,H!==null&&H.tag===6?(s(V,H.sibling),de=u(H,ne),de.return=V,V=de):(s(V,H),de=oc(ne,V.mode,de),de.return=V,V=de),_(V)):s(V,H)}return function(V,H,ne,de){try{na=0;var Ye=Vt(V,H,ne,de);return Ga=null,Ye}catch(Be){if(Be===Jn||Be===Ht)throw Be;var St=Cs(29,Be,null,V.mode);return St.lanes=de,St.return=V,St}finally{}}}var Ya=To(!0),xc=To(!1),la=!1;function Xa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function aa(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 ia(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ul(e,t,s){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(At&2)!==0){var u=i.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),i.pending=t,t=cc(e),Au(e,null,s),t}return rc(e,i,t,s),cc(e)}function Ei(e,t,s){if(t=t.updateQueue,t!==null&&(t=t.shared,(s&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,s|=i,t.lanes=s,yn(e,s)}}function Co(e,t){var s=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,s===i)){var u=null,f=null;if(s=s.firstBaseUpdate,s!==null){do{var _={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};f===null?u=f=_:f=f.next=_,s=s.next}while(s!==null);f===null?u=f=t:f=f.next=t}else u=f=t;s={baseState:i.baseState,firstBaseUpdate:u,lastBaseUpdate:f,shared:i.shared,callbacks:i.callbacks},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=t:e.next=t,s.lastBaseUpdate=t}var Ao=!1;function Ti(){if(Ao){var e=ki;if(e!==null)throw e}}function Ci(e,t,s,i){Ao=!1;var u=e.updateQueue;la=!1;var f=u.firstBaseUpdate,_=u.lastBaseUpdate,N=u.shared.pending;if(N!==null){u.shared.pending=null;var D=N,le=D.next;D.next=null,_===null?f=le:_.next=le,_=D;var ue=e.alternate;ue!==null&&(ue=ue.updateQueue,N=ue.lastBaseUpdate,N!==_&&(N===null?ue.firstBaseUpdate=le:N.next=le,ue.lastBaseUpdate=D))}if(f!==null){var pe=u.baseState;_=0,ue=le=D=null,N=f;do{var ie=N.lane&-536870913,ce=ie!==N.lane;if(ce?(gt&ie)===ie:(i&ie)===ie){ie!==0&&ie===wi&&(Ao=!0),ue!==null&&(ue=ue.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var ze=e,Ke=N;ie=t;var Vt=s;switch(Ke.tag){case 1:if(ze=Ke.payload,typeof ze=="function"){pe=ze.call(Vt,pe,ie);break e}pe=ze;break e;case 3:ze.flags=ze.flags&-65537|128;case 0:if(ze=Ke.payload,ie=typeof ze=="function"?ze.call(Vt,pe,ie):ze,ie==null)break e;pe=j({},pe,ie);break e;case 2:la=!0}}ie=N.callback,ie!==null&&(e.flags|=64,ce&&(e.flags|=8192),ce=u.callbacks,ce===null?u.callbacks=[ie]:ce.push(ie))}else ce={lane:ie,tag:N.tag,payload:N.payload,callback:N.callback,next:null},ue===null?(le=ue=ce,D=pe):ue=ue.next=ce,_|=ie;if(N=N.next,N===null){if(N=u.shared.pending,N===null)break;ce=N,N=ce.next,ce.next=null,u.lastBaseUpdate=ce,u.shared.pending=null}}while(!0);ue===null&&(D=pe),u.baseState=D,u.firstBaseUpdate=le,u.lastBaseUpdate=ue,f===null&&(u.shared.lanes=0),Di|=_,e.lanes=_,e.memoizedState=pe}}function $u(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function qu(e,t){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)$u(s[e],t)}var bs=k(null),bc=k(0);function sl(e,t){e=ei,q(bc,e),q(bs,t),ei=e|t.baseLanes}function Ai(){q(bc,ei),q(bs,bs.current)}function Mo(){ei=bc.current,se(bs),se(bc)}var rs=k(null),Ds=null;function ra(e){var t=e.alternate;q(on,on.current&1),q(rs,e),Ds===null&&(t===null||bs.current!==null||t.memoizedState!==null)&&(Ds=e)}function bl(e){q(on,on.current),q(rs,e),Ds===null&&(Ds=e)}function _c(e){e.tag===22?(q(on,on.current),q(rs,e),Ds===null&&(Ds=e)):ca()}function ca(){q(on,on.current),q(rs,rs.current)}function _s(e){se(rs),Ds===e&&(Ds=null),se(on)}var on=k(0);function p(e){for(var t=e;t!==null;){if(t.tag===13){var s=t.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||zh(s)||Uh(s)))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 R=0,X=null,xe=null,Ie=null,Yt=!1,un=!1,cs=!1,Va=0,oa=0,Hl=null,_e=0;function be(){throw Error(c(321))}function Ue(e,t){if(t===null)return!1;for(var s=0;s<t.length&&s<e.length;s++)if(!Fn(e[s],t[s]))return!1;return!0}function qe(e,t,s,i,u,f){return R=f,X=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,$.H=e===null||e.memoizedState===null?qm:Qf,cs=!1,f=s(i,u),cs=!1,un&&(f=Vn(t,s,i,u)),nt(e),f}function nt(e){$.H=Oo;var t=xe!==null&&xe.next!==null;if(R=0,Ie=xe=X=null,Yt=!1,oa=0,Hl=null,t)throw Error(c(300));e===null||Un||(e=e.dependencies,e!==null&&Ni(e)&&(Un=!0))}function Vn(e,t,s,i){X=e;var u=0;do{if(un&&(Hl=null),oa=0,un=!1,25<=u)throw Error(c(301));if(u+=1,Ie=xe=null,e.updateQueue!=null){var f=e.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}$.H=Gm,f=t(s,i)}while(un);return f}function Rf(){var e=$.H,t=e.useState()[0];return t=typeof t.then=="function"?Ro(t):t,e=e.useState()[0],(xe!==null?xe.memoizedState:null)!==e&&(X.flags|=1024),t}function Df(){var e=Va!==0;return Va=0,e}function Of(e,t,s){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s}function Lf(e){if(Yt){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Yt=!1}R=0,Ie=xe=X=null,un=!1,oa=Va=0,Hl=null}function Os(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ie===null?X.memoizedState=Ie=e:Ie=Ie.next=e,Ie}function Ln(){if(xe===null){var e=X.alternate;e=e!==null?e.memoizedState:null}else e=xe.next;var t=Ie===null?X.memoizedState:Ie.next;if(t!==null)Ie=t,xe=e;else{if(e===null)throw X.alternate===null?Error(c(467)):Error(c(310));xe=e,e={memoizedState:xe.memoizedState,baseState:xe.baseState,baseQueue:xe.baseQueue,queue:xe.queue,next:null},Ie===null?X.memoizedState=Ie=e:Ie=Ie.next=e}return Ie}function Gu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ro(e){var t=oa;return oa+=1,Hl===null&&(Hl=[]),e=Iu(Hl,e,t),t=X,(Ie===null?t.memoizedState:Ie.next)===null&&(t=t.alternate,$.H=t===null||t.memoizedState===null?qm:Qf),e}function Yu(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ro(e);if(e.$$typeof===I)return Sn(e)}throw Error(c(438,String(e)))}function zf(e){var t=null,s=X.updateQueue;if(s!==null&&(t=s.memoCache),t==null){var i=X.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(t={data:i.data.map(function(u){return u.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),s===null&&(s=Gu(),X.updateQueue=s),s.memoCache=t,s=t.data[t.index],s===void 0)for(s=t.data[t.index]=Array(e),i=0;i<e;i++)s[i]=U;return t.index++,s}function Qa(e,t){return typeof t=="function"?t(e):t}function Xu(e){var t=Ln();return Uf(t,xe,e)}function Uf(e,t,s){var i=e.queue;if(i===null)throw Error(c(311));i.lastRenderedReducer=s;var u=e.baseQueue,f=i.pending;if(f!==null){if(u!==null){var _=u.next;u.next=f.next,f.next=_}t.baseQueue=u=f,i.pending=null}if(f=e.baseState,u===null)e.memoizedState=f;else{t=u.next;var N=_=null,D=null,le=t,ue=!1;do{var pe=le.lane&-536870913;if(pe!==le.lane?(gt&pe)===pe:(R&pe)===pe){var ie=le.revertLane;if(ie===0)D!==null&&(D=D.next={lane:0,revertLane:0,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null}),pe===wi&&(ue=!0);else if((R&ie)===ie){le=le.next,ie===wi&&(ue=!0);continue}else pe={lane:0,revertLane:le.revertLane,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},D===null?(N=D=pe,_=f):D=D.next=pe,X.lanes|=ie,Di|=ie;pe=le.action,cs&&s(f,pe),f=le.hasEagerState?le.eagerState:s(f,pe)}else ie={lane:pe,revertLane:le.revertLane,gesture:le.gesture,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},D===null?(N=D=ie,_=f):D=D.next=ie,X.lanes|=pe,Di|=pe;le=le.next}while(le!==null&&le!==t);if(D===null?_=f:D.next=N,!Fn(f,e.memoizedState)&&(Un=!0,ue&&(s=ki,s!==null)))throw s;e.memoizedState=f,e.baseState=_,e.baseQueue=D,i.lastRenderedState=f}return u===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function Hf(e){var t=Ln(),s=t.queue;if(s===null)throw Error(c(311));s.lastRenderedReducer=e;var i=s.dispatch,u=s.pending,f=t.memoizedState;if(u!==null){s.pending=null;var _=u=u.next;do f=e(f,_.action),_=_.next;while(_!==u);Fn(f,t.memoizedState)||(Un=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),s.lastRenderedState=f}return[f,i]}function cm(e,t,s){var i=X,u=Ln(),f=ht;if(f){if(s===void 0)throw Error(c(407));s=s()}else s=t();var _=!Fn((xe||u).memoizedState,s);if(_&&(u.memoizedState=s,Un=!0),u=u.queue,$f(dm.bind(null,i,u,e),[e]),u.getSnapshot!==t||_||Ie!==null&&Ie.memoizedState.tag&1){if(i.flags|=2048,yc(9,{destroy:void 0},um.bind(null,i,u,s,t),null),Kt===null)throw Error(c(349));f||(R&127)!==0||om(i,t,s)}return s}function om(e,t,s){e.flags|=16384,e={getSnapshot:t,value:s},t=X.updateQueue,t===null?(t=Gu(),X.updateQueue=t,t.stores=[e]):(s=t.stores,s===null?t.stores=[e]:s.push(e))}function um(e,t,s,i){t.value=s,t.getSnapshot=i,fm(t)&&hm(e)}function dm(e,t,s){return s(function(){fm(t)&&hm(e)})}function fm(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!Fn(e,s)}catch{return!0}}function hm(e){var t=za(e,2);t!==null&&Ks(t,e,2)}function Bf(e){var t=Os();if(typeof e=="function"){var s=e;if(e=s(),cs){Cn(!0);try{s()}finally{Cn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qa,lastRenderedState:e},t}function pm(e,t,s,i){return e.baseState=s,Uf(e,xe,typeof i=="function"?i:Qa)}function Gy(e,t,s,i,u){if(Ku(e))throw Error(c(485));if(e=t.action,e!==null){var f={payload:u,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(_){f.listeners.push(_)}};$.T!==null?s(!0):f.isTransition=!1,i(f),s=t.pending,s===null?(f.next=t.pending=f,mm(t,f)):(f.next=s.next,t.pending=s.next=f)}}function mm(e,t){var s=t.action,i=t.payload,u=e.state;if(t.isTransition){var f=$.T,_={};$.T=_;try{var N=s(u,i),D=$.S;D!==null&&D(_,N),gm(e,t,N)}catch(le){If(e,t,le)}finally{f!==null&&_.types!==null&&(f.types=_.types),$.T=f}}else try{f=s(u,i),gm(e,t,f)}catch(le){If(e,t,le)}}function gm(e,t,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(i){xm(e,t,i)},function(i){return If(e,t,i)}):xm(e,t,s)}function xm(e,t,s){t.status="fulfilled",t.value=s,bm(t),e.state=s,t=e.pending,t!==null&&(s=t.next,s===t?e.pending=null:(s=s.next,t.next=s,mm(e,s)))}function If(e,t,s){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do t.status="rejected",t.reason=s,bm(t),t=t.next;while(t!==i)}e.action=null}function bm(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function _m(e,t){return t}function ym(e,t){if(ht){var s=Kt.formState;if(s!==null){e:{var i=X;if(ht){if(Gt){t:{for(var u=Gt,f=Gs;u.nodeType!==8;){if(!f){u=null;break t}if(u=_l(u.nextSibling),u===null){u=null;break t}}f=u.data,u=f==="F!"||f==="F"?u:null}if(u){Gt=_l(u.nextSibling),i=u.data==="F!";break e}}ea(i)}i=!1}i&&(t=s[0])}}return s=Os(),s.memoizedState=s.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:_m,lastRenderedState:t},s.queue=i,s=Bm.bind(null,X,i),i.dispatch=s,i=Bf(!1),f=Vf.bind(null,X,!1,i.queue),i=Os(),u={state:t,dispatch:null,action:e,pending:null},i.queue=u,s=Gy.bind(null,X,u,f,s),u.dispatch=s,i.memoizedState=e,[t,s,!1]}function vm(e){var t=Ln();return jm(t,xe,e)}function jm(e,t,s){if(t=Uf(e,t,_m)[0],e=Xu(Qa)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var i=Ro(t)}catch(_){throw _===Jn?Ht:_}else i=t;t=Ln();var u=t.queue,f=u.dispatch;return s!==t.memoizedState&&(X.flags|=2048,yc(9,{destroy:void 0},Yy.bind(null,u,s),null)),[i,f,e]}function Yy(e,t){e.action=t}function Nm(e){var t=Ln(),s=xe;if(s!==null)return jm(t,s,e);Ln(),t=t.memoizedState,s=Ln();var i=s.queue.dispatch;return s.memoizedState=e,[t,i,!1]}function yc(e,t,s,i){return e={tag:e,create:s,deps:i,inst:t,next:null},t=X.updateQueue,t===null&&(t=Gu(),X.updateQueue=t),s=t.lastEffect,s===null?t.lastEffect=e.next=e:(i=s.next,s.next=e,e.next=i,t.lastEffect=e),e}function wm(){return Ln().memoizedState}function Vu(e,t,s,i){var u=Os();X.flags|=e,u.memoizedState=yc(1|t,{destroy:void 0},s,i===void 0?null:i)}function Qu(e,t,s,i){var u=Ln();i=i===void 0?null:i;var f=u.memoizedState.inst;xe!==null&&i!==null&&Ue(i,xe.memoizedState.deps)?u.memoizedState=yc(t,f,s,i):(X.flags|=e,u.memoizedState=yc(1|t,f,s,i))}function km(e,t){Vu(8390656,8,e,t)}function $f(e,t){Qu(2048,8,e,t)}function Xy(e){X.flags|=4;var t=X.updateQueue;if(t===null)t=Gu(),X.updateQueue=t,t.events=[e];else{var s=t.events;s===null?t.events=[e]:s.push(e)}}function Sm(e){var t=Ln().memoizedState;return Xy({ref:t,nextImpl:e}),function(){if((At&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function Em(e,t){return Qu(4,2,e,t)}function Tm(e,t){return Qu(4,4,e,t)}function Cm(e,t){if(typeof t=="function"){e=e();var s=t(e);return function(){typeof s=="function"?s():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Am(e,t,s){s=s!=null?s.concat([e]):null,Qu(4,4,Cm.bind(null,t,e),s)}function qf(){}function Mm(e,t){var s=Ln();t=t===void 0?null:t;var i=s.memoizedState;return t!==null&&Ue(t,i[1])?i[0]:(s.memoizedState=[e,t],e)}function Rm(e,t){var s=Ln();t=t===void 0?null:t;var i=s.memoizedState;if(t!==null&&Ue(t,i[1]))return i[0];if(i=e(),cs){Cn(!0);try{e()}finally{Cn(!1)}}return s.memoizedState=[i,t],i}function Gf(e,t,s){return s===void 0||(R&1073741824)!==0&&(gt&261930)===0?e.memoizedState=t:(e.memoizedState=s,e=Dg(),X.lanes|=e,Di|=e,s)}function Dm(e,t,s,i){return Fn(s,t)?s:bs.current!==null?(e=Gf(e,s,i),Fn(e,t)||(Un=!0),e):(R&42)===0||(R&1073741824)!==0&&(gt&261930)===0?(Un=!0,e.memoizedState=s):(e=Dg(),X.lanes|=e,Di|=e,t)}function Om(e,t,s,i,u){var f=Y.p;Y.p=f!==0&&8>f?f:8;var _=$.T,N={};$.T=N,Vf(e,!1,t,s);try{var D=u(),le=$.S;if(le!==null&&le(N,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var ue=Mf(D,i);Do(e,t,ue,il(e))}else Do(e,t,i,il(e))}catch(pe){Do(e,t,{then:function(){},status:"rejected",reason:pe},il())}finally{Y.p=f,_!==null&&N.types!==null&&(_.types=N.types),$.T=_}}function Vy(){}function Yf(e,t,s,i){if(e.tag!==5)throw Error(c(476));var u=Lm(e).queue;Om(e,u,t,W,s===null?Vy:function(){return zm(e),s(i)})}function Lm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:W,baseState:W,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qa,lastRenderedState:W},next:null};var s={};return t.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qa,lastRenderedState:s},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function zm(e){var t=Lm(e);t.next===null&&(t=e.alternate.memoizedState),Do(e,t.next.queue,{},il())}function Xf(){return Sn(Fo)}function Um(){return Ln().memoizedState}function Hm(){return Ln().memoizedState}function Qy(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var s=il();e=ia(s);var i=Ul(t,e,s);i!==null&&(Ks(i,t,s),Ei(i,t,s)),t={cache:So()},e.payload=t;return}t=t.return}}function Ky(e,t,s){var i=il();s={lane:i,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Ku(e)?Im(t,s):(s=bo(e,t,s,i),s!==null&&(Ks(s,e,i),$m(s,t,i)))}function Bm(e,t,s){var i=il();Do(e,t,s,i)}function Do(e,t,s,i){var u={lane:i,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(Ku(e))Im(t,u);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var _=t.lastRenderedState,N=f(_,s);if(u.hasEagerState=!0,u.eagerState=N,Fn(N,_))return rc(e,t,u,0),Kt===null&&ic(),!1}catch{}finally{}if(s=bo(e,t,u,i),s!==null)return Ks(s,e,i),$m(s,t,i),!0}return!1}function Vf(e,t,s,i){if(i={lane:2,revertLane:wh(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Ku(e)){if(t)throw Error(c(479))}else t=bo(e,s,i,2),t!==null&&Ks(t,e,2)}function Ku(e){var t=e.alternate;return e===X||t!==null&&t===X}function Im(e,t){un=Yt=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function $m(e,t,s){if((s&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,s|=i,t.lanes=s,yn(e,s)}}var Oo={readContext:Sn,use:Yu,useCallback:be,useContext:be,useEffect:be,useImperativeHandle:be,useLayoutEffect:be,useInsertionEffect:be,useMemo:be,useReducer:be,useRef:be,useState:be,useDebugValue:be,useDeferredValue:be,useTransition:be,useSyncExternalStore:be,useId:be,useHostTransitionStatus:be,useFormState:be,useActionState:be,useOptimistic:be,useMemoCache:be,useCacheRefresh:be};Oo.useEffectEvent=be;var qm={readContext:Sn,use:Yu,useCallback:function(e,t){return Os().memoizedState=[e,t===void 0?null:t],e},useContext:Sn,useEffect:km,useImperativeHandle:function(e,t,s){s=s!=null?s.concat([e]):null,Vu(4194308,4,Cm.bind(null,t,e),s)},useLayoutEffect:function(e,t){return Vu(4194308,4,e,t)},useInsertionEffect:function(e,t){Vu(4,2,e,t)},useMemo:function(e,t){var s=Os();t=t===void 0?null:t;var i=e();if(cs){Cn(!0);try{e()}finally{Cn(!1)}}return s.memoizedState=[i,t],i},useReducer:function(e,t,s){var i=Os();if(s!==void 0){var u=s(t);if(cs){Cn(!0);try{s(t)}finally{Cn(!1)}}}else u=t;return i.memoizedState=i.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},i.queue=e,e=e.dispatch=Ky.bind(null,X,e),[i.memoizedState,e]},useRef:function(e){var t=Os();return e={current:e},t.memoizedState=e},useState:function(e){e=Bf(e);var t=e.queue,s=Bm.bind(null,X,t);return t.dispatch=s,[e.memoizedState,s]},useDebugValue:qf,useDeferredValue:function(e,t){var s=Os();return Gf(s,e,t)},useTransition:function(){var e=Bf(!1);return e=Om.bind(null,X,e.queue,!0,!1),Os().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,s){var i=X,u=Os();if(ht){if(s===void 0)throw Error(c(407));s=s()}else{if(s=t(),Kt===null)throw Error(c(349));(gt&127)!==0||om(i,t,s)}u.memoizedState=s;var f={value:s,getSnapshot:t};return u.queue=f,km(dm.bind(null,i,f,e),[e]),i.flags|=2048,yc(9,{destroy:void 0},um.bind(null,i,f,s,t),null),s},useId:function(){var e=Os(),t=Kt.identifierPrefix;if(ht){var s=gl,i=qs;s=(i&~(1<<32-zt(i)-1)).toString(32)+s,t="_"+t+"R_"+s,s=Va++,0<s&&(t+="H"+s.toString(32)),t+="_"}else s=_e++,t="_"+t+"r_"+s.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Xf,useFormState:ym,useActionState:ym,useOptimistic:function(e){var t=Os();t.memoizedState=t.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=s,t=Vf.bind(null,X,!0,s),s.dispatch=t,[e,t]},useMemoCache:zf,useCacheRefresh:function(){return Os().memoizedState=Qy.bind(null,X)},useEffectEvent:function(e){var t=Os(),s={impl:e};return t.memoizedState=s,function(){if((At&2)!==0)throw Error(c(440));return s.impl.apply(void 0,arguments)}}},Qf={readContext:Sn,use:Yu,useCallback:Mm,useContext:Sn,useEffect:$f,useImperativeHandle:Am,useInsertionEffect:Em,useLayoutEffect:Tm,useMemo:Rm,useReducer:Xu,useRef:wm,useState:function(){return Xu(Qa)},useDebugValue:qf,useDeferredValue:function(e,t){var s=Ln();return Dm(s,xe.memoizedState,e,t)},useTransition:function(){var e=Xu(Qa)[0],t=Ln().memoizedState;return[typeof e=="boolean"?e:Ro(e),t]},useSyncExternalStore:cm,useId:Um,useHostTransitionStatus:Xf,useFormState:vm,useActionState:vm,useOptimistic:function(e,t){var s=Ln();return pm(s,xe,e,t)},useMemoCache:zf,useCacheRefresh:Hm};Qf.useEffectEvent=Sm;var Gm={readContext:Sn,use:Yu,useCallback:Mm,useContext:Sn,useEffect:$f,useImperativeHandle:Am,useInsertionEffect:Em,useLayoutEffect:Tm,useMemo:Rm,useReducer:Hf,useRef:wm,useState:function(){return Hf(Qa)},useDebugValue:qf,useDeferredValue:function(e,t){var s=Ln();return xe===null?Gf(s,e,t):Dm(s,xe.memoizedState,e,t)},useTransition:function(){var e=Hf(Qa)[0],t=Ln().memoizedState;return[typeof e=="boolean"?e:Ro(e),t]},useSyncExternalStore:cm,useId:Um,useHostTransitionStatus:Xf,useFormState:Nm,useActionState:Nm,useOptimistic:function(e,t){var s=Ln();return xe!==null?pm(s,xe,e,t):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:zf,useCacheRefresh:Hm};Gm.useEffectEvent=Sm;function Kf(e,t,s,i){t=e.memoizedState,s=s(i,t),s=s==null?t:j({},t,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var Zf={enqueueSetState:function(e,t,s){e=e._reactInternals;var i=il(),u=ia(i);u.payload=t,s!=null&&(u.callback=s),t=Ul(e,u,i),t!==null&&(Ks(t,e,i),Ei(t,e,i))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var i=il(),u=ia(i);u.tag=1,u.payload=t,s!=null&&(u.callback=s),t=Ul(e,u,i),t!==null&&(Ks(t,e,i),Ei(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=il(),i=ia(s);i.tag=2,t!=null&&(i.callback=t),t=Ul(e,i,s),t!==null&&(Ks(t,e,s),Ei(t,e,s))}};function Ym(e,t,s,i,u,f,_){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,f,_):t.prototype&&t.prototype.isPureReactComponent?!Tl(s,i)||!Tl(u,f):!0}function Xm(e,t,s,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(s,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(s,i),t.state!==e&&Zf.enqueueReplaceState(t,t.state,null)}function Sr(e,t){var s=t;if("ref"in t){s={};for(var i in t)i!=="ref"&&(s[i]=t[i])}if(e=e.defaultProps){s===t&&(s=j({},s));for(var u in e)s[u]===void 0&&(s[u]=e[u])}return s}function Vm(e){Cl(e)}function Qm(e){console.error(e)}function Km(e){Cl(e)}function Zu(e,t){try{var s=e.onUncaughtError;s(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function Zm(e,t,s){try{var i=e.onCaughtError;i(s.value,{componentStack:s.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function Ff(e,t,s){return s=ia(s),s.tag=3,s.payload={element:null},s.callback=function(){Zu(e,t)},s}function Fm(e){return e=ia(e),e.tag=3,e}function Jm(e,t,s,i){var u=s.type.getDerivedStateFromError;if(typeof u=="function"){var f=i.value;e.payload=function(){return u(f)},e.callback=function(){Zm(t,s,i)}}var _=s.stateNode;_!==null&&typeof _.componentDidCatch=="function"&&(e.callback=function(){Zm(t,s,i),typeof u!="function"&&(Oi===null?Oi=new Set([this]):Oi.add(this));var N=i.stack;this.componentDidCatch(i.value,{componentStack:N!==null?N:""})})}function Zy(e,t,s,i,u){if(s.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=s.alternate,t!==null&&ji(t,s,u,!0),s=rs.current,s!==null){switch(s.tag){case 31:case 13:return Ds===null?rd():s.alternate===null&&Tn===0&&(Tn=3),s.flags&=-257,s.flags|=65536,s.lanes=u,i===Si?s.flags|=16384:(t=s.updateQueue,t===null?s.updateQueue=new Set([i]):t.add(i),vh(e,i,u)),!1;case 22:return s.flags|=65536,i===Si?s.flags|=16384:(t=s.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},s.updateQueue=t):(s=t.retryQueue,s===null?t.retryQueue=new Set([i]):s.add(i)),vh(e,i,u)),!1}throw Error(c(435,s.tag))}return vh(e,i,u),rd(),!1}if(ht)return t=rs.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,i!==vo&&(e=Error(c(422),{cause:i}),br(As(e,s)))):(i!==vo&&(t=Error(c(423),{cause:i}),br(As(t,s))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,i=As(i,s),u=Ff(e.stateNode,i,u),Co(e,u),Tn!==4&&(Tn=2)),!1;var f=Error(c(520),{cause:i});if(f=As(f,s),qo===null?qo=[f]:qo.push(f),Tn!==4&&(Tn=2),t===null)return!0;i=As(i,s),s=t;do{switch(s.tag){case 3:return s.flags|=65536,e=u&-u,s.lanes|=e,e=Ff(s.stateNode,i,e),Co(s,e),!1;case 1:if(t=s.type,f=s.stateNode,(s.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(Oi===null||!Oi.has(f))))return s.flags|=65536,u&=-u,s.lanes|=u,u=Fm(u),Jm(u,e,s,i),Co(s,u),!1}s=s.return}while(s!==null);return!1}var Jf=Error(c(461)),Un=!1;function os(e,t,s,i){t.child=e===null?xc(t,null,s,i):Ya(t,e.child,s,i)}function Wm(e,t,s,i,u){s=s.render;var f=t.ref;if("ref"in i){var _={};for(var N in i)N!=="ref"&&(_[N]=i[N])}else _=i;return zl(t),i=qe(e,t,s,_,f,u),N=Df(),e!==null&&!Un?(Of(e,t,u),Ka(e,t,u)):(ht&&N&&_o(t),t.flags|=1,os(e,t,i,u),t.child)}function Pm(e,t,s,i,u){if(e===null){var f=s.type;return typeof f=="function"&&!xr(f)&&f.defaultProps===void 0&&s.compare===null?(t.tag=15,t.type=f,eg(e,t,f,i,u)):(e=_i(s.type,null,i,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!ah(e,u)){var _=f.memoizedProps;if(s=s.compare,s=s!==null?s:Tl,s(_,i)&&e.ref===t.ref)return Ka(e,t,u)}return t.flags|=1,e=Al(f,i),e.ref=t.ref,e.return=t,t.child=e}function eg(e,t,s,i,u){if(e!==null){var f=e.memoizedProps;if(Tl(f,i)&&e.ref===t.ref)if(Un=!1,t.pendingProps=i=f,ah(e,u))(e.flags&131072)!==0&&(Un=!0);else return t.lanes=e.lanes,Ka(e,t,u)}return Wf(e,t,s,i,u)}function tg(e,t,s,i){var u=i.children,f=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((t.flags&128)!==0){if(f=f!==null?f.baseLanes|s:s,e!==null){for(i=t.child=e.child,u=0;i!==null;)u=u|i.lanes|i.childLanes,i=i.sibling;i=u&~f}else i=0,t.child=null;return ng(e,t,f,s,i)}if((s&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&vr(t,f!==null?f.cachePool:null),f!==null?sl(t,f):Ai(),_c(t);else return i=t.lanes=536870912,ng(e,t,f!==null?f.baseLanes|s:s,s,i)}else f!==null?(vr(t,f.cachePool),sl(t,f),ca(),t.memoizedState=null):(e!==null&&vr(t,null),Ai(),ca());return os(e,t,u,s),t.child}function Lo(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function ng(e,t,s,i,u){var f=mc();return f=f===null?null:{parent:En._currentValue,pool:f},t.memoizedState={baseLanes:s,cachePool:f},e!==null&&vr(t,null),Ai(),_c(t),e!==null&&ji(e,t,i,!0),t.childLanes=u,null}function Fu(e,t){return t=Wu({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function sg(e,t,s){return Ya(t,e.child,null,s),e=Fu(t,t.pendingProps),e.flags|=2,_s(t),t.memoizedState=null,e}function Fy(e,t,s){var i=t.pendingProps,u=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(ht){if(i.mode==="hidden")return e=Fu(t,i),t.lanes=536870912,Lo(null,e);if(bl(t),(e=Gt)?(e=mx(e,Gs),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ml!==null?{id:qs,overflow:gl}:null,retryLane:536870912,hydrationErrors:null},s=uc(e),s.return=t,t.child=s,gn=t,Gt=null)):e=null,e===null)throw ea(t);return t.lanes=536870912,null}return Fu(t,i)}var f=e.memoizedState;if(f!==null){var _=f.dehydrated;if(bl(t),u)if(t.flags&256)t.flags&=-257,t=sg(e,t,s);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(c(558));else if(Un||ji(e,t,s,!1),u=(s&e.childLanes)!==0,Un||u){if(i=Kt,i!==null&&(_=cl(i,s),_!==0&&_!==f.retryLane))throw f.retryLane=_,za(e,_),Ks(i,e,_),Jf;rd(),t=sg(e,t,s)}else e=f.treeContext,Gt=_l(_.nextSibling),gn=t,ht=!0,Rl=null,Gs=!1,e!==null&&Du(t,e),t=Fu(t,i),t.flags|=4096;return t}return e=Al(e.child,{mode:i.mode,children:i.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Ju(e,t){var s=t.ref;if(s===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(c(284));(e===null||e.ref!==s)&&(t.flags|=4194816)}}function Wf(e,t,s,i,u){return zl(t),s=qe(e,t,s,i,void 0,u),i=Df(),e!==null&&!Un?(Of(e,t,u),Ka(e,t,u)):(ht&&i&&_o(t),t.flags|=1,os(e,t,s,u),t.child)}function lg(e,t,s,i,u,f){return zl(t),t.updateQueue=null,s=Vn(t,i,s,u),nt(e),i=Df(),e!==null&&!Un?(Of(e,t,f),Ka(e,t,f)):(ht&&i&&_o(t),t.flags|=1,os(e,t,s,f),t.child)}function ag(e,t,s,i,u){if(zl(t),t.stateNode===null){var f=Pl,_=s.contextType;typeof _=="object"&&_!==null&&(f=Sn(_)),f=new s(i,f),t.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=Zf,t.stateNode=f,f._reactInternals=t,f=t.stateNode,f.props=i,f.state=t.memoizedState,f.refs={},Xa(t),_=s.contextType,f.context=typeof _=="object"&&_!==null?Sn(_):Pl,f.state=t.memoizedState,_=s.getDerivedStateFromProps,typeof _=="function"&&(Kf(t,s,_,i),f.state=t.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(_=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),_!==f.state&&Zf.enqueueReplaceState(f,f.state,null),Ci(t,i,f,u),Ti(),f.state=t.memoizedState),typeof f.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){f=t.stateNode;var N=t.memoizedProps,D=Sr(s,N);f.props=D;var le=f.context,ue=s.contextType;_=Pl,typeof ue=="object"&&ue!==null&&(_=Sn(ue));var pe=s.getDerivedStateFromProps;ue=typeof pe=="function"||typeof f.getSnapshotBeforeUpdate=="function",N=t.pendingProps!==N,ue||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(N||le!==_)&&Xm(t,f,i,_),la=!1;var ie=t.memoizedState;f.state=ie,Ci(t,i,f,u),Ti(),le=t.memoizedState,N||ie!==le||la?(typeof pe=="function"&&(Kf(t,s,pe,i),le=t.memoizedState),(D=la||Ym(t,s,D,i,ie,le,_))?(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=i,t.memoizedState=le),f.props=i,f.state=le,f.context=_,i=D):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{f=t.stateNode,aa(e,t),_=t.memoizedProps,ue=Sr(s,_),f.props=ue,pe=t.pendingProps,ie=f.context,le=s.contextType,D=Pl,typeof le=="object"&&le!==null&&(D=Sn(le)),N=s.getDerivedStateFromProps,(le=typeof N=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(_!==pe||ie!==D)&&Xm(t,f,i,D),la=!1,ie=t.memoizedState,f.state=ie,Ci(t,i,f,u),Ti();var ce=t.memoizedState;_!==pe||ie!==ce||la||e!==null&&e.dependencies!==null&&Ni(e.dependencies)?(typeof N=="function"&&(Kf(t,s,N,i),ce=t.memoizedState),(ue=la||Ym(t,s,ue,i,ie,ce,D)||e!==null&&e.dependencies!==null&&Ni(e.dependencies))?(le||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(i,ce,D),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(i,ce,D)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||_===e.memoizedProps&&ie===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||_===e.memoizedProps&&ie===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=ce),f.props=i,f.state=ce,f.context=D,i=ue):(typeof f.componentDidUpdate!="function"||_===e.memoizedProps&&ie===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||_===e.memoizedProps&&ie===e.memoizedState||(t.flags|=1024),i=!1)}return f=i,Ju(e,t),i=(t.flags&128)!==0,f||i?(f=t.stateNode,s=i&&typeof s.getDerivedStateFromError!="function"?null:f.render(),t.flags|=1,e!==null&&i?(t.child=Ya(t,e.child,null,u),t.child=Ya(t,null,s,u)):os(e,t,s,u),t.memoizedState=f.state,e=t.child):e=Ka(e,t,u),e}function ig(e,t,s,i){return Ia(),t.flags|=256,os(e,t,s,i),t.child}var Pf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function eh(e){return{baseLanes:e,cachePool:jr()}}function th(e,t,s){return e=e!==null?e.childLanes&~s:0,t&&(e|=al),e}function rg(e,t,s){var i=t.pendingProps,u=!1,f=(t.flags&128)!==0,_;if((_=f)||(_=e!==null&&e.memoizedState===null?!1:(on.current&2)!==0),_&&(u=!0,t.flags&=-129),_=(t.flags&32)!==0,t.flags&=-33,e===null){if(ht){if(u?ra(t):ca(),(e=Gt)?(e=mx(e,Gs),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ml!==null?{id:qs,overflow:gl}:null,retryLane:536870912,hydrationErrors:null},s=uc(e),s.return=t,t.child=s,gn=t,Gt=null)):e=null,e===null)throw ea(t);return Uh(e)?t.lanes=32:t.lanes=536870912,null}var N=i.children;return i=i.fallback,u?(ca(),u=t.mode,N=Wu({mode:"hidden",children:N},u),i=Ua(i,u,s,null),N.return=t,i.return=t,N.sibling=i,t.child=N,i=t.child,i.memoizedState=eh(s),i.childLanes=th(e,_,s),t.memoizedState=Pf,Lo(null,i)):(ra(t),nh(t,N))}var D=e.memoizedState;if(D!==null&&(N=D.dehydrated,N!==null)){if(f)t.flags&256?(ra(t),t.flags&=-257,t=sh(e,t,s)):t.memoizedState!==null?(ca(),t.child=e.child,t.flags|=128,t=null):(ca(),N=i.fallback,u=t.mode,i=Wu({mode:"visible",children:i.children},u),N=Ua(N,u,s,null),N.flags|=2,i.return=t,N.return=t,i.sibling=N,t.child=i,Ya(t,e.child,null,s),i=t.child,i.memoizedState=eh(s),i.childLanes=th(e,_,s),t.memoizedState=Pf,t=Lo(null,i));else if(ra(t),Uh(N)){if(_=N.nextSibling&&N.nextSibling.dataset,_)var le=_.dgst;_=le,i=Error(c(419)),i.stack="",i.digest=_,br({value:i,source:null,stack:null}),t=sh(e,t,s)}else if(Un||ji(e,t,s,!1),_=(s&e.childLanes)!==0,Un||_){if(_=Kt,_!==null&&(i=cl(_,s),i!==0&&i!==D.retryLane))throw D.retryLane=i,za(e,i),Ks(_,e,i),Jf;zh(N)||rd(),t=sh(e,t,s)}else zh(N)?(t.flags|=192,t.child=e.child,t=null):(e=D.treeContext,Gt=_l(N.nextSibling),gn=t,ht=!0,Rl=null,Gs=!1,e!==null&&Du(t,e),t=nh(t,i.children),t.flags|=4096);return t}return u?(ca(),N=i.fallback,u=t.mode,D=e.child,le=D.sibling,i=Al(D,{mode:"hidden",children:i.children}),i.subtreeFlags=D.subtreeFlags&65011712,le!==null?N=Al(le,N):(N=Ua(N,u,s,null),N.flags|=2),N.return=t,i.return=t,i.sibling=N,t.child=i,Lo(null,i),i=t.child,N=e.child.memoizedState,N===null?N=eh(s):(u=N.cachePool,u!==null?(D=En._currentValue,u=u.parent!==D?{parent:D,pool:D}:u):u=jr(),N={baseLanes:N.baseLanes|s,cachePool:u}),i.memoizedState=N,i.childLanes=th(e,_,s),t.memoizedState=Pf,Lo(e.child,i)):(ra(t),s=e.child,e=s.sibling,s=Al(s,{mode:"visible",children:i.children}),s.return=t,s.sibling=null,e!==null&&(_=t.deletions,_===null?(t.deletions=[e],t.flags|=16):_.push(e)),t.child=s,t.memoizedState=null,s)}function nh(e,t){return t=Wu({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Wu(e,t){return e=Cs(22,e,null,t),e.lanes=0,e}function sh(e,t,s){return Ya(t,e.child,null,s),e=nh(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function cg(e,t,s){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),wo(e.return,t,s)}function lh(e,t,s,i,u,f){var _=e.memoizedState;_===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:s,tailMode:u,treeForkCount:f}:(_.isBackwards=t,_.rendering=null,_.renderingStartTime=0,_.last=i,_.tail=s,_.tailMode=u,_.treeForkCount=f)}function og(e,t,s){var i=t.pendingProps,u=i.revealOrder,f=i.tail;i=i.children;var _=on.current,N=(_&2)!==0;if(N?(_=_&1|2,t.flags|=128):_&=1,q(on,_),os(e,t,i,s),i=ht?yi:0,!N&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&cg(e,s,t);else if(e.tag===19)cg(e,s,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(u){case"forwards":for(s=t.child,u=null;s!==null;)e=s.alternate,e!==null&&p(e)===null&&(u=s),s=s.sibling;s=u,s===null?(u=t.child,t.child=null):(u=s.sibling,s.sibling=null),lh(t,!1,u,s,f,i);break;case"backwards":case"unstable_legacy-backwards":for(s=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&p(e)===null){t.child=u;break}e=u.sibling,u.sibling=s,s=u,u=e}lh(t,!0,s,null,f,i);break;case"together":lh(t,!1,null,null,void 0,i);break;default:t.memoizedState=null}return t.child}function Ka(e,t,s){if(e!==null&&(t.dependencies=e.dependencies),Di|=t.lanes,(s&t.childLanes)===0)if(e!==null){if(ji(e,t,s,!1),(s&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,s=Al(e,e.pendingProps),t.child=s,s.return=t;e.sibling!==null;)e=e.sibling,s=s.sibling=Al(e,e.pendingProps),s.return=t;s.sibling=null}return t.child}function ah(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Ni(e)))}function Jy(e,t,s){switch(t.tag){case 3:Ge(t,t.stateNode.containerInfo),Ol(t,En,e.memoizedState.cache),Ia();break;case 27:case 5:bt(t);break;case 4:Ge(t,t.stateNode.containerInfo);break;case 10:Ol(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,bl(t),null;break;case 13:var i=t.memoizedState;if(i!==null)return i.dehydrated!==null?(ra(t),t.flags|=128,null):(s&t.child.childLanes)!==0?rg(e,t,s):(ra(t),e=Ka(e,t,s),e!==null?e.sibling:null);ra(t);break;case 19:var u=(e.flags&128)!==0;if(i=(s&t.childLanes)!==0,i||(ji(e,t,s,!1),i=(s&t.childLanes)!==0),u){if(i)return og(e,t,s);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),q(on,on.current),i)break;return null;case 22:return t.lanes=0,tg(e,t,s,t.pendingProps);case 24:Ol(t,En,e.memoizedState.cache)}return Ka(e,t,s)}function ug(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps)Un=!0;else{if(!ah(e,s)&&(t.flags&128)===0)return Un=!1,Jy(e,t,s);Un=(e.flags&131072)!==0}else Un=!1,ht&&(t.flags&1048576)!==0&&Ru(t,yi,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=xl(t.elementType),t.type=e,typeof e=="function")xr(e)?(i=Sr(e,i),t.tag=1,t=ag(null,t,e,i,s)):(t.tag=0,t=Wf(null,t,e,i,s));else{if(e!=null){var u=e.$$typeof;if(u===L){t.tag=11,t=Wm(null,t,e,i,s);break e}else if(u===z){t.tag=14,t=Pm(null,t,e,i,s);break e}}throw t=we(e)||e,Error(c(306,t,""))}}return t;case 0:return Wf(e,t,t.type,t.pendingProps,s);case 1:return i=t.type,u=Sr(i,t.pendingProps),ag(e,t,i,u,s);case 3:e:{if(Ge(t,t.stateNode.containerInfo),e===null)throw Error(c(387));i=t.pendingProps;var f=t.memoizedState;u=f.element,aa(e,t),Ci(t,i,null,s);var _=t.memoizedState;if(i=_.cache,Ol(t,En,i),i!==f.cache&&ko(t,[En],s,!0),Ti(),i=_.element,f.isDehydrated)if(f={element:i,isDehydrated:!1,cache:_.cache},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){t=ig(e,t,i,s);break e}else if(i!==u){u=As(Error(c(424)),t),br(u),t=ig(e,t,i,s);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(Gt=_l(e.firstChild),gn=t,ht=!0,Rl=null,Gs=!0,s=xc(t,null,i,s),t.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(Ia(),i===u){t=Ka(e,t,s);break e}os(e,t,i,s)}t=t.child}return t;case 26:return Ju(e,t),e===null?(s=vx(t.type,null,t.pendingProps,null))?t.memoizedState=s:ht||(s=t.type,e=t.pendingProps,i=pd(ke.current).createElement(s),i[sn]=t,i[et]=e,us(i,s,e),tt(i),t.stateNode=i):t.memoizedState=vx(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return bt(t),e===null&&ht&&(i=t.stateNode=bx(t.type,t.pendingProps,ke.current),gn=t,Gs=!0,u=Gt,Hi(t.type)?(Hh=u,Gt=_l(i.firstChild)):Gt=u),os(e,t,t.pendingProps.children,s),Ju(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ht&&((u=i=Gt)&&(i=E0(i,t.type,t.pendingProps,Gs),i!==null?(t.stateNode=i,gn=t,Gt=_l(i.firstChild),Gs=!1,u=!0):u=!1),u||ea(t)),bt(t),u=t.type,f=t.pendingProps,_=e!==null?e.memoizedProps:null,i=f.children,Dh(u,f)?i=null:_!==null&&Dh(u,_)&&(t.flags|=32),t.memoizedState!==null&&(u=qe(e,t,Rf,null,null,s),Fo._currentValue=u),Ju(e,t),os(e,t,i,s),t.child;case 6:return e===null&&ht&&((e=s=Gt)&&(s=T0(s,t.pendingProps,Gs),s!==null?(t.stateNode=s,gn=t,Gt=null,e=!0):e=!1),e||ea(t)),null;case 13:return rg(e,t,s);case 4:return Ge(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Ya(t,null,i,s):os(e,t,i,s),t.child;case 11:return Wm(e,t,t.type,t.pendingProps,s);case 7:return os(e,t,t.pendingProps,s),t.child;case 8:return os(e,t,t.pendingProps.children,s),t.child;case 12:return os(e,t,t.pendingProps.children,s),t.child;case 10:return i=t.pendingProps,Ol(t,t.type,i.value),os(e,t,i.children,s),t.child;case 9:return u=t.type._context,i=t.pendingProps.children,zl(t),u=Sn(u),i=i(u),t.flags|=1,os(e,t,i,s),t.child;case 14:return Pm(e,t,t.type,t.pendingProps,s);case 15:return eg(e,t,t.type,t.pendingProps,s);case 19:return og(e,t,s);case 31:return Fy(e,t,s);case 22:return tg(e,t,s,t.pendingProps);case 24:return zl(t),i=Sn(En),e===null?(u=mc(),u===null&&(u=Kt,f=So(),u.pooledCache=f,f.refCount++,f!==null&&(u.pooledCacheLanes|=s),u=f),t.memoizedState={parent:i,cache:u},Xa(t),Ol(t,En,u)):((e.lanes&s)!==0&&(aa(e,t),Ci(t,null,null,s),Ti()),u=e.memoizedState,f=t.memoizedState,u.parent!==i?(u={parent:i,cache:i},t.memoizedState=u,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=u),Ol(t,En,i)):(i=f.cache,Ol(t,En,i),i!==u.cache&&ko(t,[En],s,!0))),os(e,t,t.pendingProps.children,s),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function Za(e){e.flags|=4}function ih(e,t,s,i,u){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(u&335544128)===u)if(e.stateNode.complete)e.flags|=8192;else if(Ug())e.flags|=8192;else throw ta=Si,Rs}else e.flags&=-16777217}function dg(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Sx(t))if(Ug())e.flags|=8192;else throw ta=Si,Rs}function Pu(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?$e():536870912,e.lanes|=t,wc|=t)}function zo(e,t){if(!ht)switch(e.tailMode){case"hidden":t=e.tail;for(var s=null;t!==null;)t.alternate!==null&&(s=t),t=t.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var i=null;s!==null;)s.alternate!==null&&(i=s),s=s.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function Jt(e){var t=e.alternate!==null&&e.alternate.child===e.child,s=0,i=0;if(t)for(var u=e.child;u!==null;)s|=u.lanes|u.childLanes,i|=u.subtreeFlags&65011712,i|=u.flags&65011712,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)s|=u.lanes|u.childLanes,i|=u.subtreeFlags,i|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=i,e.childLanes=s,t}function Wy(e,t,s){var i=t.pendingProps;switch(yo(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Jt(t),null;case 1:return Jt(t),null;case 3:return s=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Ll(En),He(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(vi(t)?Za(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,jo())),Jt(t),null;case 26:var u=t.type,f=t.memoizedState;return e===null?(Za(t),f!==null?(Jt(t),dg(t,f)):(Jt(t),ih(t,u,null,i,s))):f?f!==e.memoizedState?(Za(t),Jt(t),dg(t,f)):(Jt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==i&&Za(t),Jt(t),ih(t,u,e,i,s)),null;case 27:if(Ve(t),s=ke.current,u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&Za(t);else{if(!i){if(t.stateNode===null)throw Error(c(166));return Jt(t),null}e=je.current,vi(t)?Ou(t):(e=bx(u,i,s),t.stateNode=e,Za(t))}return Jt(t),null;case 5:if(Ve(t),u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&Za(t);else{if(!i){if(t.stateNode===null)throw Error(c(166));return Jt(t),null}if(f=je.current,vi(t))Ou(t);else{var _=pd(ke.current);switch(f){case 1:f=_.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:f=_.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":f=_.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":f=_.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":f=_.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof i.is=="string"?_.createElement("select",{is:i.is}):_.createElement("select"),i.multiple?f.multiple=!0:i.size&&(f.size=i.size);break;default:f=typeof i.is=="string"?_.createElement(u,{is:i.is}):_.createElement(u)}}f[sn]=t,f[et]=i;e:for(_=t.child;_!==null;){if(_.tag===5||_.tag===6)f.appendChild(_.stateNode);else if(_.tag!==4&&_.tag!==27&&_.child!==null){_.child.return=_,_=_.child;continue}if(_===t)break e;for(;_.sibling===null;){if(_.return===null||_.return===t)break e;_=_.return}_.sibling.return=_.return,_=_.sibling}t.stateNode=f;e:switch(us(f,u,i),u){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Za(t)}}return Jt(t),ih(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,s),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&Za(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(c(166));if(e=ke.current,vi(t)){if(e=t.stateNode,s=t.memoizedProps,i=null,u=gn,u!==null)switch(u.tag){case 27:case 5:i=u.memoizedProps}e[sn]=t,e=!!(e.nodeValue===s||i!==null&&i.suppressHydrationWarning===!0||rx(e.nodeValue,s)),e||ea(t,!0)}else e=pd(e).createTextNode(i),e[sn]=t,t.stateNode=e}return Jt(t),null;case 31:if(s=t.memoizedState,e===null||e.memoizedState!==null){if(i=vi(t),s!==null){if(e===null){if(!i)throw Error(c(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(557));e[sn]=t}else Ia(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Jt(t),e=!1}else s=jo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return t.flags&256?(_s(t),t):(_s(t),null);if((t.flags&128)!==0)throw Error(c(558))}return Jt(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=vi(t),i!==null&&i.dehydrated!==null){if(e===null){if(!u)throw Error(c(318));if(u=t.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(c(317));u[sn]=t}else Ia(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Jt(t),u=!1}else u=jo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(_s(t),t):(_s(t),null)}return _s(t),(t.flags&128)!==0?(t.lanes=s,t):(s=i!==null,e=e!==null&&e.memoizedState!==null,s&&(i=t.child,u=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(u=i.alternate.memoizedState.cachePool.pool),f=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(f=i.memoizedState.cachePool.pool),f!==u&&(i.flags|=2048)),s!==e&&s&&(t.child.flags|=8192),Pu(t,t.updateQueue),Jt(t),null);case 4:return He(),e===null&&Th(t.stateNode.containerInfo),Jt(t),null;case 10:return Ll(t.type),Jt(t),null;case 19:if(se(on),i=t.memoizedState,i===null)return Jt(t),null;if(u=(t.flags&128)!==0,f=i.rendering,f===null)if(u)zo(i,!1);else{if(Tn!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=p(e),f!==null){for(t.flags|=128,zo(i,!1),e=f.updateQueue,t.updateQueue=e,Pu(t,e),t.subtreeFlags=0,e=s,s=t.child;s!==null;)Mu(s,e),s=s.sibling;return q(on,on.current&1|2),ht&&nl(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&Fe()>ld&&(t.flags|=128,u=!0,zo(i,!1),t.lanes=4194304)}else{if(!u)if(e=p(f),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,Pu(t,e),zo(i,!0),i.tail===null&&i.tailMode==="hidden"&&!f.alternate&&!ht)return Jt(t),null}else 2*Fe()-i.renderingStartTime>ld&&s!==536870912&&(t.flags|=128,u=!0,zo(i,!1),t.lanes=4194304);i.isBackwards?(f.sibling=t.child,t.child=f):(e=i.last,e!==null?e.sibling=f:t.child=f,i.last=f)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=Fe(),e.sibling=null,s=on.current,q(on,u?s&1|2:s&1),ht&&nl(t,i.treeForkCount),e):(Jt(t),null);case 22:case 23:return _s(t),Mo(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?(s&536870912)!==0&&(t.flags&128)===0&&(Jt(t),t.subtreeFlags&6&&(t.flags|=8192)):Jt(t),s=t.updateQueue,s!==null&&Pu(t,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==s&&(t.flags|=2048),e!==null&&se(qa),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),Ll(En),Jt(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function Py(e,t){switch(yo(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ll(En),He(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ve(t),null;case 31:if(t.memoizedState!==null){if(_s(t),t.alternate===null)throw Error(c(340));Ia()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(_s(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));Ia()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return se(on),null;case 4:return He(),null;case 10:return Ll(t.type),null;case 22:case 23:return _s(t),Mo(),e!==null&&se(qa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ll(En),null;case 25:return null;default:return null}}function fg(e,t){switch(yo(t),t.tag){case 3:Ll(En),He();break;case 26:case 27:case 5:Ve(t);break;case 4:He();break;case 31:t.memoizedState!==null&&_s(t);break;case 13:_s(t);break;case 19:se(on);break;case 10:Ll(t.type);break;case 22:case 23:_s(t),Mo(),e!==null&&se(qa);break;case 24:Ll(En)}}function Uo(e,t){try{var s=t.updateQueue,i=s!==null?s.lastEffect:null;if(i!==null){var u=i.next;s=u;do{if((s.tag&e)===e){i=void 0;var f=s.create,_=s.inst;i=f(),_.destroy=i}s=s.next}while(s!==u)}}catch(N){It(t,t.return,N)}}function Mi(e,t,s){try{var i=t.updateQueue,u=i!==null?i.lastEffect:null;if(u!==null){var f=u.next;i=f;do{if((i.tag&e)===e){var _=i.inst,N=_.destroy;if(N!==void 0){_.destroy=void 0,u=t;var D=s,le=N;try{le()}catch(ue){It(u,D,ue)}}}i=i.next}while(i!==f)}}catch(ue){It(t,t.return,ue)}}function hg(e){var t=e.updateQueue;if(t!==null){var s=e.stateNode;try{qu(t,s)}catch(i){It(e,e.return,i)}}}function pg(e,t,s){s.props=Sr(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(i){It(e,t,i)}}function Ho(e,t){try{var s=e.ref;if(s!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof s=="function"?e.refCleanup=s(i):s.current=i}}catch(u){It(e,t,u)}}function ua(e,t){var s=e.ref,i=e.refCleanup;if(s!==null)if(typeof i=="function")try{i()}catch(u){It(e,t,u)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(u){It(e,t,u)}else s.current=null}function mg(e){var t=e.type,s=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":s.autoFocus&&i.focus();break e;case"img":s.src?i.src=s.src:s.srcSet&&(i.srcset=s.srcSet)}}catch(u){It(e,e.return,u)}}function rh(e,t,s){try{var i=e.stateNode;v0(i,e.type,s,t),i[et]=t}catch(u){It(e,e.return,u)}}function gg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Hi(e.type)||e.tag===4}function ch(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||gg(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&&Hi(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 oh(e,t,s){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(e,t):(t=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,t.appendChild(e),s=s._reactRootContainer,s!=null||t.onclick!==null||(t.onclick=Ut));else if(i!==4&&(i===27&&Hi(e.type)&&(s=e.stateNode,t=null),e=e.child,e!==null))for(oh(e,t,s),e=e.sibling;e!==null;)oh(e,t,s),e=e.sibling}function ed(e,t,s){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?s.insertBefore(e,t):s.appendChild(e);else if(i!==4&&(i===27&&Hi(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(ed(e,t,s),e=e.sibling;e!==null;)ed(e,t,s),e=e.sibling}function xg(e){var t=e.stateNode,s=e.memoizedProps;try{for(var i=e.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);us(t,i,s),t[sn]=e,t[et]=s}catch(f){It(e,e.return,f)}}var Fa=!1,Hn=!1,uh=!1,bg=typeof WeakSet=="function"?WeakSet:Set,Wn=null;function e0(e,t){if(e=e.containerInfo,Mh=vd,e=Su(e),ae(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var i=s.getSelection&&s.getSelection();if(i&&i.rangeCount!==0){s=i.anchorNode;var u=i.anchorOffset,f=i.focusNode;i=i.focusOffset;try{s.nodeType,f.nodeType}catch{s=null;break e}var _=0,N=-1,D=-1,le=0,ue=0,pe=e,ie=null;t:for(;;){for(var ce;pe!==s||u!==0&&pe.nodeType!==3||(N=_+u),pe!==f||i!==0&&pe.nodeType!==3||(D=_+i),pe.nodeType===3&&(_+=pe.nodeValue.length),(ce=pe.firstChild)!==null;)ie=pe,pe=ce;for(;;){if(pe===e)break t;if(ie===s&&++le===u&&(N=_),ie===f&&++ue===i&&(D=_),(ce=pe.nextSibling)!==null)break;pe=ie,ie=pe.parentNode}pe=ce}s=N===-1||D===-1?null:{start:N,end:D}}else s=null}s=s||{start:0,end:0}}else s=null;for(Rh={focusedElem:e,selectionRange:s},vd=!1,Wn=t;Wn!==null;)if(t=Wn,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Wn=e;else for(;Wn!==null;){switch(t=Wn,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(s=0;s<e.length;s++)u=e[s],u.ref.impl=u.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&f!==null){e=void 0,s=t,u=f.memoizedProps,f=f.memoizedState,i=s.stateNode;try{var ze=Sr(s.type,u);e=i.getSnapshotBeforeUpdate(ze,f),i.__reactInternalSnapshotBeforeUpdate=e}catch(Ke){It(s,s.return,Ke)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,s=e.nodeType,s===9)Lh(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Lh(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,Wn=e;break}Wn=t.return}}function _g(e,t,s){var i=s.flags;switch(s.tag){case 0:case 11:case 15:Wa(e,s),i&4&&Uo(5,s);break;case 1:if(Wa(e,s),i&4)if(e=s.stateNode,t===null)try{e.componentDidMount()}catch(_){It(s,s.return,_)}else{var u=Sr(s.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(_){It(s,s.return,_)}}i&64&&hg(s),i&512&&Ho(s,s.return);break;case 3:if(Wa(e,s),i&64&&(e=s.updateQueue,e!==null)){if(t=null,s.child!==null)switch(s.child.tag){case 27:case 5:t=s.child.stateNode;break;case 1:t=s.child.stateNode}try{qu(e,t)}catch(_){It(s,s.return,_)}}break;case 27:t===null&&i&4&&xg(s);case 26:case 5:Wa(e,s),t===null&&i&4&&mg(s),i&512&&Ho(s,s.return);break;case 12:Wa(e,s);break;case 31:Wa(e,s),i&4&&jg(e,s);break;case 13:Wa(e,s),i&4&&Ng(e,s),i&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=o0.bind(null,s),C0(e,s))));break;case 22:if(i=s.memoizedState!==null||Fa,!i){t=t!==null&&t.memoizedState!==null||Hn,u=Fa;var f=Hn;Fa=i,(Hn=t)&&!f?Pa(e,s,(s.subtreeFlags&8772)!==0):Wa(e,s),Fa=u,Hn=f}break;case 30:break;default:Wa(e,s)}}function yg(e){var t=e.alternate;t!==null&&(e.alternate=null,yg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ms(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 dn=null,Ys=!1;function Ja(e,t,s){for(s=s.child;s!==null;)vg(e,t,s),s=s.sibling}function vg(e,t,s){if(Ft&&typeof Ft.onCommitFiberUnmount=="function")try{Ft.onCommitFiberUnmount(_n,s)}catch{}switch(s.tag){case 26:Hn||ua(s,t),Ja(e,t,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Hn||ua(s,t);var i=dn,u=Ys;Hi(s.type)&&(dn=s.stateNode,Ys=!1),Ja(e,t,s),Qo(s.stateNode),dn=i,Ys=u;break;case 5:Hn||ua(s,t);case 6:if(i=dn,u=Ys,dn=null,Ja(e,t,s),dn=i,Ys=u,dn!==null)if(Ys)try{(dn.nodeType===9?dn.body:dn.nodeName==="HTML"?dn.ownerDocument.body:dn).removeChild(s.stateNode)}catch(f){It(s,t,f)}else try{dn.removeChild(s.stateNode)}catch(f){It(s,t,f)}break;case 18:dn!==null&&(Ys?(e=dn,hx(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),Rc(e)):hx(dn,s.stateNode));break;case 4:i=dn,u=Ys,dn=s.stateNode.containerInfo,Ys=!0,Ja(e,t,s),dn=i,Ys=u;break;case 0:case 11:case 14:case 15:Mi(2,s,t),Hn||Mi(4,s,t),Ja(e,t,s);break;case 1:Hn||(ua(s,t),i=s.stateNode,typeof i.componentWillUnmount=="function"&&pg(s,t,i)),Ja(e,t,s);break;case 21:Ja(e,t,s);break;case 22:Hn=(i=Hn)||s.memoizedState!==null,Ja(e,t,s),Hn=i;break;default:Ja(e,t,s)}}function jg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Rc(e)}catch(s){It(t,t.return,s)}}}function Ng(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Rc(e)}catch(s){It(t,t.return,s)}}function t0(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new bg),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new bg),t;default:throw Error(c(435,e.tag))}}function td(e,t){var s=t0(e);t.forEach(function(i){if(!s.has(i)){s.add(i);var u=u0.bind(null,e,i);i.then(u,u)}})}function Xs(e,t){var s=t.deletions;if(s!==null)for(var i=0;i<s.length;i++){var u=s[i],f=e,_=t,N=_;e:for(;N!==null;){switch(N.tag){case 27:if(Hi(N.type)){dn=N.stateNode,Ys=!1;break e}break;case 5:dn=N.stateNode,Ys=!1;break e;case 3:case 4:dn=N.stateNode.containerInfo,Ys=!0;break e}N=N.return}if(dn===null)throw Error(c(160));vg(f,_,u),dn=null,Ys=!1,f=u.alternate,f!==null&&(f.return=null),u.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)wg(t,e),t=t.sibling}var Bl=null;function wg(e,t){var s=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Xs(t,e),Vs(e),i&4&&(Mi(3,e,e.return),Uo(3,e),Mi(5,e,e.return));break;case 1:Xs(t,e),Vs(e),i&512&&(Hn||s===null||ua(s,s.return)),i&64&&Fa&&(e=e.updateQueue,e!==null&&(i=e.callbacks,i!==null&&(s=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=s===null?i:s.concat(i))));break;case 26:var u=Bl;if(Xs(t,e),Vs(e),i&512&&(Hn||s===null||ua(s,s.return)),i&4){var f=s!==null?s.memoizedState:null;if(i=e.memoizedState,s===null)if(i===null)if(e.stateNode===null){e:{i=e.type,s=e.memoizedProps,u=u.ownerDocument||u;t:switch(i){case"title":f=u.getElementsByTagName("title")[0],(!f||f[ss]||f[sn]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=u.createElement(i),u.head.insertBefore(f,u.querySelector("head > title"))),us(f,i,s),f[sn]=e,tt(f),i=f;break e;case"link":var _=wx("link","href",u).get(i+(s.href||""));if(_){for(var N=0;N<_.length;N++)if(f=_[N],f.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&f.getAttribute("rel")===(s.rel==null?null:s.rel)&&f.getAttribute("title")===(s.title==null?null:s.title)&&f.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){_.splice(N,1);break t}}f=u.createElement(i),us(f,i,s),u.head.appendChild(f);break;case"meta":if(_=wx("meta","content",u).get(i+(s.content||""))){for(N=0;N<_.length;N++)if(f=_[N],f.getAttribute("content")===(s.content==null?null:""+s.content)&&f.getAttribute("name")===(s.name==null?null:s.name)&&f.getAttribute("property")===(s.property==null?null:s.property)&&f.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&f.getAttribute("charset")===(s.charSet==null?null:s.charSet)){_.splice(N,1);break t}}f=u.createElement(i),us(f,i,s),u.head.appendChild(f);break;default:throw Error(c(468,i))}f[sn]=e,tt(f),i=f}e.stateNode=i}else kx(u,e.type,e.stateNode);else e.stateNode=Nx(u,i,e.memoizedProps);else f!==i?(f===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):f.count--,i===null?kx(u,e.type,e.stateNode):Nx(u,i,e.memoizedProps)):i===null&&e.stateNode!==null&&rh(e,e.memoizedProps,s.memoizedProps)}break;case 27:Xs(t,e),Vs(e),i&512&&(Hn||s===null||ua(s,s.return)),s!==null&&i&4&&rh(e,e.memoizedProps,s.memoizedProps);break;case 5:if(Xs(t,e),Vs(e),i&512&&(Hn||s===null||ua(s,s.return)),e.flags&32){u=e.stateNode;try{ee(u,"")}catch(ze){It(e,e.return,ze)}}i&4&&e.stateNode!=null&&(u=e.memoizedProps,rh(e,u,s!==null?s.memoizedProps:u)),i&1024&&(uh=!0);break;case 6:if(Xs(t,e),Vs(e),i&4){if(e.stateNode===null)throw Error(c(162));i=e.memoizedProps,s=e.stateNode;try{s.nodeValue=i}catch(ze){It(e,e.return,ze)}}break;case 3:if(xd=null,u=Bl,Bl=md(t.containerInfo),Xs(t,e),Bl=u,Vs(e),i&4&&s!==null&&s.memoizedState.isDehydrated)try{Rc(t.containerInfo)}catch(ze){It(e,e.return,ze)}uh&&(uh=!1,kg(e));break;case 4:i=Bl,Bl=md(e.stateNode.containerInfo),Xs(t,e),Vs(e),Bl=i;break;case 12:Xs(t,e),Vs(e);break;case 31:Xs(t,e),Vs(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,td(e,i)));break;case 13:Xs(t,e),Vs(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(sd=Fe()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,td(e,i)));break;case 22:u=e.memoizedState!==null;var D=s!==null&&s.memoizedState!==null,le=Fa,ue=Hn;if(Fa=le||u,Hn=ue||D,Xs(t,e),Hn=ue,Fa=le,Vs(e),i&8192)e:for(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,u&&(s===null||D||Fa||Hn||Er(e)),s=null,t=e;;){if(t.tag===5||t.tag===26){if(s===null){D=s=t;try{if(f=D.stateNode,u)_=f.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none";else{N=D.stateNode;var pe=D.memoizedProps.style,ie=pe!=null&&pe.hasOwnProperty("display")?pe.display:null;N.style.display=ie==null||typeof ie=="boolean"?"":(""+ie).trim()}}catch(ze){It(D,D.return,ze)}}}else if(t.tag===6){if(s===null){D=t;try{D.stateNode.nodeValue=u?"":D.memoizedProps}catch(ze){It(D,D.return,ze)}}}else if(t.tag===18){if(s===null){D=t;try{var ce=D.stateNode;u?px(ce,!0):px(D.stateNode,!1)}catch(ze){It(D,D.return,ze)}}}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;s===t&&(s=null),t=t.return}s===t&&(s=null),t.sibling.return=t.return,t=t.sibling}i&4&&(i=e.updateQueue,i!==null&&(s=i.retryQueue,s!==null&&(i.retryQueue=null,td(e,s))));break;case 19:Xs(t,e),Vs(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,td(e,i)));break;case 30:break;case 21:break;default:Xs(t,e),Vs(e)}}function Vs(e){var t=e.flags;if(t&2){try{for(var s,i=e.return;i!==null;){if(gg(i)){s=i;break}i=i.return}if(s==null)throw Error(c(160));switch(s.tag){case 27:var u=s.stateNode,f=ch(e);ed(e,f,u);break;case 5:var _=s.stateNode;s.flags&32&&(ee(_,""),s.flags&=-33);var N=ch(e);ed(e,N,_);break;case 3:case 4:var D=s.stateNode.containerInfo,le=ch(e);oh(e,le,D);break;default:throw Error(c(161))}}catch(ue){It(e,e.return,ue)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function kg(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;kg(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Wa(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)_g(e,t.alternate,t),t=t.sibling}function Er(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Mi(4,t,t.return),Er(t);break;case 1:ua(t,t.return);var s=t.stateNode;typeof s.componentWillUnmount=="function"&&pg(t,t.return,s),Er(t);break;case 27:Qo(t.stateNode);case 26:case 5:ua(t,t.return),Er(t);break;case 22:t.memoizedState===null&&Er(t);break;case 30:Er(t);break;default:Er(t)}e=e.sibling}}function Pa(e,t,s){for(s=s&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var i=t.alternate,u=e,f=t,_=f.flags;switch(f.tag){case 0:case 11:case 15:Pa(u,f,s),Uo(4,f);break;case 1:if(Pa(u,f,s),i=f,u=i.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(le){It(i,i.return,le)}if(i=f,u=i.updateQueue,u!==null){var N=i.stateNode;try{var D=u.shared.hiddenCallbacks;if(D!==null)for(u.shared.hiddenCallbacks=null,u=0;u<D.length;u++)$u(D[u],N)}catch(le){It(i,i.return,le)}}s&&_&64&&hg(f),Ho(f,f.return);break;case 27:xg(f);case 26:case 5:Pa(u,f,s),s&&i===null&&_&4&&mg(f),Ho(f,f.return);break;case 12:Pa(u,f,s);break;case 31:Pa(u,f,s),s&&_&4&&jg(u,f);break;case 13:Pa(u,f,s),s&&_&4&&Ng(u,f);break;case 22:f.memoizedState===null&&Pa(u,f,s),Ho(f,f.return);break;case 30:break;default:Pa(u,f,s)}t=t.sibling}}function dh(e,t){var s=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==s&&(e!=null&&e.refCount++,s!=null&&_r(s))}function fh(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&_r(e))}function Il(e,t,s,i){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Sg(e,t,s,i),t=t.sibling}function Sg(e,t,s,i){var u=t.flags;switch(t.tag){case 0:case 11:case 15:Il(e,t,s,i),u&2048&&Uo(9,t);break;case 1:Il(e,t,s,i);break;case 3:Il(e,t,s,i),u&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&_r(e)));break;case 12:if(u&2048){Il(e,t,s,i),e=t.stateNode;try{var f=t.memoizedProps,_=f.id,N=f.onPostCommit;typeof N=="function"&&N(_,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(D){It(t,t.return,D)}}else Il(e,t,s,i);break;case 31:Il(e,t,s,i);break;case 13:Il(e,t,s,i);break;case 23:break;case 22:f=t.stateNode,_=t.alternate,t.memoizedState!==null?f._visibility&2?Il(e,t,s,i):Bo(e,t):f._visibility&2?Il(e,t,s,i):(f._visibility|=2,vc(e,t,s,i,(t.subtreeFlags&10256)!==0||!1)),u&2048&&dh(_,t);break;case 24:Il(e,t,s,i),u&2048&&fh(t.alternate,t);break;default:Il(e,t,s,i)}}function vc(e,t,s,i,u){for(u=u&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var f=e,_=t,N=s,D=i,le=_.flags;switch(_.tag){case 0:case 11:case 15:vc(f,_,N,D,u),Uo(8,_);break;case 23:break;case 22:var ue=_.stateNode;_.memoizedState!==null?ue._visibility&2?vc(f,_,N,D,u):Bo(f,_):(ue._visibility|=2,vc(f,_,N,D,u)),u&&le&2048&&dh(_.alternate,_);break;case 24:vc(f,_,N,D,u),u&&le&2048&&fh(_.alternate,_);break;default:vc(f,_,N,D,u)}t=t.sibling}}function Bo(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var s=e,i=t,u=i.flags;switch(i.tag){case 22:Bo(s,i),u&2048&&dh(i.alternate,i);break;case 24:Bo(s,i),u&2048&&fh(i.alternate,i);break;default:Bo(s,i)}t=t.sibling}}var Io=8192;function jc(e,t,s){if(e.subtreeFlags&Io)for(e=e.child;e!==null;)Eg(e,t,s),e=e.sibling}function Eg(e,t,s){switch(e.tag){case 26:jc(e,t,s),e.flags&Io&&e.memoizedState!==null&&$0(s,Bl,e.memoizedState,e.memoizedProps);break;case 5:jc(e,t,s);break;case 3:case 4:var i=Bl;Bl=md(e.stateNode.containerInfo),jc(e,t,s),Bl=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=Io,Io=16777216,jc(e,t,s),Io=i):jc(e,t,s));break;default:jc(e,t,s)}}function Tg(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 $o(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var i=t[s];Wn=i,Ag(i,e)}Tg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Cg(e),e=e.sibling}function Cg(e){switch(e.tag){case 0:case 11:case 15:$o(e),e.flags&2048&&Mi(9,e,e.return);break;case 3:$o(e);break;case 12:$o(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,nd(e)):$o(e);break;default:$o(e)}}function nd(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var i=t[s];Wn=i,Ag(i,e)}Tg(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Mi(8,t,t.return),nd(t);break;case 22:s=t.stateNode,s._visibility&2&&(s._visibility&=-3,nd(t));break;default:nd(t)}e=e.sibling}}function Ag(e,t){for(;Wn!==null;){var s=Wn;switch(s.tag){case 0:case 11:case 15:Mi(8,s,t);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var i=s.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:_r(s.memoizedState.cache)}if(i=s.child,i!==null)i.return=s,Wn=i;else e:for(s=e;Wn!==null;){i=Wn;var u=i.sibling,f=i.return;if(yg(i),i===s){Wn=null;break e}if(u!==null){u.return=f,Wn=u;break e}Wn=f}}}var n0={getCacheForType:function(e){var t=Sn(En),s=t.data.get(e);return s===void 0&&(s=e(),t.data.set(e,s)),s},cacheSignal:function(){return Sn(En).controller.signal}},s0=typeof WeakMap=="function"?WeakMap:Map,At=0,Kt=null,pt=null,gt=0,Bt=0,ll=null,Ri=!1,Nc=!1,hh=!1,ei=0,Tn=0,Di=0,Tr=0,ph=0,al=0,wc=0,qo=null,Qs=null,mh=!1,sd=0,Mg=0,ld=1/0,ad=null,Oi=null,Qn=0,Li=null,kc=null,ti=0,gh=0,xh=null,Rg=null,Go=0,bh=null;function il(){return(At&2)!==0&>!==0?gt&-gt:$.T!==null?wh():Vl()}function Dg(){if(al===0)if((gt&536870912)===0||ht){var e=it;it<<=1,(it&3932160)===0&&(it=262144),al=e}else al=536870912;return e=rs.current,e!==null&&(e.flags|=32),al}function Ks(e,t,s){(e===Kt&&(Bt===2||Bt===9)||e.cancelPendingCommit!==null)&&(Sc(e,0),zi(e,gt,al,!1)),pn(e,s),((At&2)===0||e!==Kt)&&(e===Kt&&((At&2)===0&&(Tr|=s),Tn===4&&zi(e,gt,al,!1)),da(e))}function Og(e,t,s){if((At&6)!==0)throw Error(c(327));var i=!s&&(t&127)===0&&(t&e.expiredLanes)===0||fe(e,t),u=i?i0(e,t):yh(e,t,!0),f=i;do{if(u===0){Nc&&!i&&zi(e,t,0,!1);break}else{if(s=e.current.alternate,f&&!l0(s)){u=yh(e,t,!1),f=!1;continue}if(u===2){if(f=t,e.errorRecoveryDisabledLanes&f)var _=0;else _=e.pendingLanes&-536870913,_=_!==0?_:_&536870912?536870912:0;if(_!==0){t=_;e:{var N=e;u=qo;var D=N.current.memoizedState.isDehydrated;if(D&&(Sc(N,_).flags|=256),_=yh(N,_,!1),_!==2){if(hh&&!D){N.errorRecoveryDisabledLanes|=f,Tr|=f,u=4;break e}f=Qs,Qs=u,f!==null&&(Qs===null?Qs=f:Qs.push.apply(Qs,f))}u=_}if(f=!1,u!==2)continue}}if(u===1){Sc(e,0),zi(e,t,0,!0);break}e:{switch(i=e,f=u,f){case 0:case 1:throw Error(c(345));case 4:if((t&4194048)!==t)break;case 6:zi(i,t,al,!Ri);break e;case 2:Qs=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(u=sd+300-Fe(),10<u)){if(zi(i,t,al,!Ri),Z(i,0,!0)!==0)break e;ti=t,i.timeoutHandle=dx(Lg.bind(null,i,s,Qs,ad,mh,t,al,Tr,wc,Ri,f,"Throttled",-0,0),u);break e}Lg(i,s,Qs,ad,mh,t,al,Tr,wc,Ri,f,null,-0,0)}}break}while(!0);da(e)}function Lg(e,t,s,i,u,f,_,N,D,le,ue,pe,ie,ce){if(e.timeoutHandle=-1,pe=t.subtreeFlags,pe&8192||(pe&16785408)===16785408){pe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ut},Eg(t,f,pe);var ze=(f&62914560)===f?sd-Fe():(f&4194048)===f?Mg-Fe():0;if(ze=q0(pe,ze),ze!==null){ti=f,e.cancelPendingCommit=ze(Gg.bind(null,e,t,f,s,i,u,_,N,D,ue,pe,null,ie,ce)),zi(e,f,_,!le);return}}Gg(e,t,f,s,i,u,_,N,D)}function l0(e){for(var t=e;;){var s=t.tag;if((s===0||s===11||s===15)&&t.flags&16384&&(s=t.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var i=0;i<s.length;i++){var u=s[i],f=u.getSnapshot;u=u.value;try{if(!Fn(f(),u))return!1}catch{return!1}}if(s=t.child,t.subtreeFlags&16384&&s!==null)s.return=t,t=s;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 zi(e,t,s,i){t&=~ph,t&=~Tr,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var u=t;0<u;){var f=31-zt(u),_=1<<f;i[f]=-1,u&=~_}s!==0&&Fs(e,s,t)}function id(){return(At&6)===0?(Yo(0),!1):!0}function _h(){if(pt!==null){if(Bt===0)var e=pt.return;else e=pt,Dl=$a=null,Lf(e),Ga=null,na=0,e=pt;for(;e!==null;)fg(e.alternate,e),e=e.return;pt=null}}function Sc(e,t){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,w0(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),ti=0,_h(),Kt=e,pt=s=Al(e.current,null),gt=t,Bt=0,ll=null,Ri=!1,Nc=fe(e,t),hh=!1,wc=al=ph=Tr=Di=Tn=0,Qs=qo=null,mh=!1,(t&8)!==0&&(t|=t&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=t;0<i;){var u=31-zt(i),f=1<<u;t|=e[u],i&=~f}return ei=t,ic(),s}function zg(e,t){X=null,$.H=Oo,t===Jn||t===Ht?(t=Nr(),Bt=3):t===Rs?(t=Nr(),Bt=4):Bt=t===Jf?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,ll=t,pt===null&&(Tn=1,Zu(e,As(t,e.current)))}function Ug(){var e=rs.current;return e===null?!0:(gt&4194048)===gt?Ds===null:(gt&62914560)===gt||(gt&536870912)!==0?e===Ds:!1}function Hg(){var e=$.H;return $.H=Oo,e===null?Oo:e}function Bg(){var e=$.A;return $.A=n0,e}function rd(){Tn=4,Ri||(gt&4194048)!==gt&&rs.current!==null||(Nc=!0),(Di&134217727)===0&&(Tr&134217727)===0||Kt===null||zi(Kt,gt,al,!1)}function yh(e,t,s){var i=At;At|=2;var u=Hg(),f=Bg();(Kt!==e||gt!==t)&&(ad=null,Sc(e,t)),t=!1;var _=Tn;e:do try{if(Bt!==0&&pt!==null){var N=pt,D=ll;switch(Bt){case 8:_h(),_=6;break e;case 3:case 2:case 9:case 6:rs.current===null&&(t=!0);var le=Bt;if(Bt=0,ll=null,Ec(e,N,D,le),s&&Nc){_=0;break e}break;default:le=Bt,Bt=0,ll=null,Ec(e,N,D,le)}}a0(),_=Tn;break}catch(ue){zg(e,ue)}while(!0);return t&&e.shellSuspendCounter++,Dl=$a=null,At=i,$.H=u,$.A=f,pt===null&&(Kt=null,gt=0,ic()),_}function a0(){for(;pt!==null;)Ig(pt)}function i0(e,t){var s=At;At|=2;var i=Hg(),u=Bg();Kt!==e||gt!==t?(ad=null,ld=Fe()+500,Sc(e,t)):Nc=fe(e,t);e:do try{if(Bt!==0&&pt!==null){t=pt;var f=ll;t:switch(Bt){case 1:Bt=0,ll=null,Ec(e,t,f,1);break;case 2:case 9:if(Bu(f)){Bt=0,ll=null,$g(t);break}t=function(){Bt!==2&&Bt!==9||Kt!==e||(Bt=7),da(e)},f.then(t,t);break e;case 3:Bt=7;break e;case 4:Bt=5;break e;case 7:Bu(f)?(Bt=0,ll=null,$g(t)):(Bt=0,ll=null,Ec(e,t,f,7));break;case 5:var _=null;switch(pt.tag){case 26:_=pt.memoizedState;case 5:case 27:var N=pt;if(_?Sx(_):N.stateNode.complete){Bt=0,ll=null;var D=N.sibling;if(D!==null)pt=D;else{var le=N.return;le!==null?(pt=le,cd(le)):pt=null}break t}}Bt=0,ll=null,Ec(e,t,f,5);break;case 6:Bt=0,ll=null,Ec(e,t,f,6);break;case 8:_h(),Tn=6;break e;default:throw Error(c(462))}}r0();break}catch(ue){zg(e,ue)}while(!0);return Dl=$a=null,$.H=i,$.A=u,At=s,pt!==null?0:(Kt=null,gt=0,ic(),Tn)}function r0(){for(;pt!==null&&!Rt();)Ig(pt)}function Ig(e){var t=ug(e.alternate,e,ei);e.memoizedProps=e.pendingProps,t===null?cd(e):pt=t}function $g(e){var t=e,s=t.alternate;switch(t.tag){case 15:case 0:t=lg(s,t,t.pendingProps,t.type,void 0,gt);break;case 11:t=lg(s,t,t.pendingProps,t.type.render,t.ref,gt);break;case 5:Lf(t);default:fg(s,t),t=pt=Mu(t,ei),t=ug(s,t,ei)}e.memoizedProps=e.pendingProps,t===null?cd(e):pt=t}function Ec(e,t,s,i){Dl=$a=null,Lf(t),Ga=null,na=0;var u=t.return;try{if(Zy(e,u,t,s,gt)){Tn=1,Zu(e,As(s,e.current)),pt=null;return}}catch(f){if(u!==null)throw pt=u,f;Tn=1,Zu(e,As(s,e.current)),pt=null;return}t.flags&32768?(ht||i===1?e=!0:Nc||(gt&536870912)!==0?e=!1:(Ri=e=!0,(i===2||i===9||i===3||i===6)&&(i=rs.current,i!==null&&i.tag===13&&(i.flags|=16384))),qg(t,e)):cd(t)}function cd(e){var t=e;do{if((t.flags&32768)!==0){qg(t,Ri);return}e=t.return;var s=Wy(t.alternate,t,ei);if(s!==null){pt=s;return}if(t=t.sibling,t!==null){pt=t;return}pt=t=e}while(t!==null);Tn===0&&(Tn=5)}function qg(e,t){do{var s=Py(e.alternate,e);if(s!==null){s.flags&=32767,pt=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!t&&(e=e.sibling,e!==null)){pt=e;return}pt=e=s}while(e!==null);Tn=6,pt=null}function Gg(e,t,s,i,u,f,_,N,D){e.cancelPendingCommit=null;do od();while(Qn!==0);if((At&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));if(f=t.lanes|t.childLanes,f|=xo,An(e,s,f,_,N,D),e===Kt&&(pt=Kt=null,gt=0),kc=t,Li=e,ti=s,gh=f,xh=u,Rg=i,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,d0(kt,function(){return Kg(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||i){i=$.T,$.T=null,u=Y.p,Y.p=2,_=At,At|=4;try{e0(e,t,s)}finally{At=_,Y.p=u,$.T=i}}Qn=1,Yg(),Xg(),Vg()}}function Yg(){if(Qn===1){Qn=0;var e=Li,t=kc,s=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||s){s=$.T,$.T=null;var i=Y.p;Y.p=2;var u=At;At|=4;try{wg(t,e);var f=Rh,_=Su(e.containerInfo),N=f.focusedElem,D=f.selectionRange;if(_!==N&&N&&N.ownerDocument&&pi(N.ownerDocument.documentElement,N)){if(D!==null&&ae(N)){var le=D.start,ue=D.end;if(ue===void 0&&(ue=le),"selectionStart"in N)N.selectionStart=le,N.selectionEnd=Math.min(ue,N.value.length);else{var pe=N.ownerDocument||document,ie=pe&&pe.defaultView||window;if(ie.getSelection){var ce=ie.getSelection(),ze=N.textContent.length,Ke=Math.min(D.start,ze),Vt=D.end===void 0?Ke:Math.min(D.end,ze);!ce.extend&&Ke>Vt&&(_=Vt,Vt=Ke,Ke=_);var V=fo(N,Ke),H=fo(N,Vt);if(V&&H&&(ce.rangeCount!==1||ce.anchorNode!==V.node||ce.anchorOffset!==V.offset||ce.focusNode!==H.node||ce.focusOffset!==H.offset)){var ne=pe.createRange();ne.setStart(V.node,V.offset),ce.removeAllRanges(),Ke>Vt?(ce.addRange(ne),ce.extend(H.node,H.offset)):(ne.setEnd(H.node,H.offset),ce.addRange(ne))}}}}for(pe=[],ce=N;ce=ce.parentNode;)ce.nodeType===1&&pe.push({element:ce,left:ce.scrollLeft,top:ce.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<pe.length;N++){var de=pe[N];de.element.scrollLeft=de.left,de.element.scrollTop=de.top}}vd=!!Mh,Rh=Mh=null}finally{At=u,Y.p=i,$.T=s}}e.current=t,Qn=2}}function Xg(){if(Qn===2){Qn=0;var e=Li,t=kc,s=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||s){s=$.T,$.T=null;var i=Y.p;Y.p=2;var u=At;At|=4;try{_g(e,t.alternate,t)}finally{At=u,Y.p=i,$.T=s}}Qn=3}}function Vg(){if(Qn===4||Qn===3){Qn=0,dt();var e=Li,t=kc,s=ti,i=Rg;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Qn=5:(Qn=0,kc=Li=null,Qg(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(Oi=null),ns(s),t=t.stateNode,Ft&&typeof Ft.onCommitFiberRoot=="function")try{Ft.onCommitFiberRoot(_n,t,void 0,(t.current.flags&128)===128)}catch{}if(i!==null){t=$.T,u=Y.p,Y.p=2,$.T=null;try{for(var f=e.onRecoverableError,_=0;_<i.length;_++){var N=i[_];f(N.value,{componentStack:N.stack})}}finally{$.T=t,Y.p=u}}(ti&3)!==0&&od(),da(e),u=e.pendingLanes,(s&261930)!==0&&(u&42)!==0?e===bh?Go++:(Go=0,bh=e):Go=0,Yo(0)}}function Qg(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,_r(t)))}function od(){return Yg(),Xg(),Vg(),Kg()}function Kg(){if(Qn!==5)return!1;var e=Li,t=gh;gh=0;var s=ns(ti),i=$.T,u=Y.p;try{Y.p=32>s?32:s,$.T=null,s=xh,xh=null;var f=Li,_=ti;if(Qn=0,kc=Li=null,ti=0,(At&6)!==0)throw Error(c(331));var N=At;if(At|=4,Cg(f.current),Sg(f,f.current,_,s),At=N,Yo(0,!1),Ft&&typeof Ft.onPostCommitFiberRoot=="function")try{Ft.onPostCommitFiberRoot(_n,f)}catch{}return!0}finally{Y.p=u,$.T=i,Qg(e,t)}}function Zg(e,t,s){t=As(s,t),t=Ff(e.stateNode,t,2),e=Ul(e,t,2),e!==null&&(pn(e,2),da(e))}function It(e,t,s){if(e.tag===3)Zg(e,e,s);else for(;t!==null;){if(t.tag===3){Zg(t,e,s);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Oi===null||!Oi.has(i))){e=As(s,e),s=Fm(2),i=Ul(t,s,2),i!==null&&(Jm(s,i,t,e),pn(i,2),da(i));break}}t=t.return}}function vh(e,t,s){var i=e.pingCache;if(i===null){i=e.pingCache=new s0;var u=new Set;i.set(t,u)}else u=i.get(t),u===void 0&&(u=new Set,i.set(t,u));u.has(s)||(hh=!0,u.add(s),e=c0.bind(null,e,t,s),t.then(e,e))}function c0(e,t,s){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,Kt===e&&(gt&s)===s&&(Tn===4||Tn===3&&(gt&62914560)===gt&&300>Fe()-sd?(At&2)===0&&Sc(e,0):ph|=s,wc===gt&&(wc=0)),da(e)}function Fg(e,t){t===0&&(t=$e()),e=za(e,t),e!==null&&(pn(e,t),da(e))}function o0(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),Fg(e,s)}function u0(e,t){var s=0;switch(e.tag){case 31:case 13:var i=e.stateNode,u=e.memoizedState;u!==null&&(s=u.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(c(314))}i!==null&&i.delete(t),Fg(e,s)}function d0(e,t){return Ce(e,t)}var ud=null,Tc=null,jh=!1,dd=!1,Nh=!1,Ui=0;function da(e){e!==Tc&&e.next===null&&(Tc===null?ud=Tc=e:Tc=Tc.next=e),dd=!0,jh||(jh=!0,h0())}function Yo(e,t){if(!Nh&&dd){Nh=!0;do for(var s=!1,i=ud;i!==null;){if(e!==0){var u=i.pendingLanes;if(u===0)var f=0;else{var _=i.suspendedLanes,N=i.pingedLanes;f=(1<<31-zt(42|e)+1)-1,f&=u&~(_&~N),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(s=!0,ex(i,f))}else f=gt,f=Z(i,i===Kt?f:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(f&3)===0||fe(i,f)||(s=!0,ex(i,f));i=i.next}while(s);Nh=!1}}function f0(){Jg()}function Jg(){dd=jh=!1;var e=0;Ui!==0&&N0()&&(e=Ui);for(var t=Fe(),s=null,i=ud;i!==null;){var u=i.next,f=Wg(i,t);f===0?(i.next=null,s===null?ud=u:s.next=u,u===null&&(Tc=s)):(s=i,(e!==0||(f&3)!==0)&&(dd=!0)),i=u}Qn!==0&&Qn!==5||Yo(e),Ui!==0&&(Ui=0)}function Wg(e,t){for(var s=e.suspendedLanes,i=e.pingedLanes,u=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var _=31-zt(f),N=1<<_,D=u[_];D===-1?((N&s)===0||(N&i)!==0)&&(u[_]=Me(N,t)):D<=t&&(e.expiredLanes|=N),f&=~N}if(t=Kt,s=gt,s=Z(e,e===t?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,s===0||e===t&&(Bt===2||Bt===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&Pe(i),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||fe(e,s)){if(t=s&-s,t===e.callbackPriority)return t;switch(i!==null&&Pe(i),ns(s)){case 2:case 8:s=Lt;break;case 32:s=kt;break;case 268435456:s=hn;break;default:s=kt}return i=Pg.bind(null,e),s=Ce(s,i),e.callbackPriority=t,e.callbackNode=s,t}return i!==null&&i!==null&&Pe(i),e.callbackPriority=2,e.callbackNode=null,2}function Pg(e,t){if(Qn!==0&&Qn!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(od()&&e.callbackNode!==s)return null;var i=gt;return i=Z(e,e===Kt?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(Og(e,i,t),Wg(e,Fe()),e.callbackNode!=null&&e.callbackNode===s?Pg.bind(null,e):null)}function ex(e,t){if(od())return null;Og(e,t,!0)}function h0(){k0(function(){(At&6)!==0?Ce(ts,f0):Jg()})}function wh(){if(Ui===0){var e=wi;e===0&&(e=Xe,Xe<<=1,(Xe&261888)===0&&(Xe=256)),Ui=e}return Ui}function tx(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Nn(""+e)}function nx(e,t){var s=t.ownerDocument.createElement("input");return s.name=t.name,s.value=t.value,e.id&&s.setAttribute("form",e.id),t.parentNode.insertBefore(s,t),e=new FormData(e),s.parentNode.removeChild(s),e}function p0(e,t,s,i,u){if(t==="submit"&&s&&s.stateNode===u){var f=tx((u[et]||null).action),_=i.submitter;_&&(t=(t=_[et]||null)?tx(t.formAction):_.getAttribute("formAction"),t!==null&&(f=t,_=null));var N=new el("action","action",null,i,u);e.push({event:N,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(Ui!==0){var D=_?nx(u,_):new FormData(u);Yf(s,{pending:!0,data:D,method:u.method,action:f},null,D)}}else typeof f=="function"&&(N.preventDefault(),D=_?nx(u,_):new FormData(u),Yf(s,{pending:!0,data:D,method:u.method,action:f},f,D))},currentTarget:u}]})}}for(var kh=0;kh<go.length;kh++){var Sh=go[kh],m0=Sh.toLowerCase(),g0=Sh[0].toUpperCase()+Sh.slice(1);tl(m0,"on"+g0)}tl(Bs,"onAnimationEnd"),tl(Eu,"onAnimationIteration"),tl(mo,"onAnimationStart"),tl("dblclick","onDoubleClick"),tl("focusin","onFocus"),tl("focusout","onBlur"),tl(wf,"onTransitionRun"),tl(xi,"onTransitionStart"),tl(kf,"onTransitionCancel"),tl(Tu,"onTransitionEnd"),_t("onMouseEnter",["mouseout","mouseover"]),_t("onMouseLeave",["mouseout","mouseover"]),_t("onPointerEnter",["pointerout","pointerover"]),_t("onPointerLeave",["pointerout","pointerover"]),ls("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ls("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ls("onBeforeInput",["compositionend","keypress","textInput","paste"]),ls("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ls("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ls("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Xo="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(" "),x0=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Xo));function sx(e,t){t=(t&4)!==0;for(var s=0;s<e.length;s++){var i=e[s],u=i.event;i=i.listeners;e:{var f=void 0;if(t)for(var _=i.length-1;0<=_;_--){var N=i[_],D=N.instance,le=N.currentTarget;if(N=N.listener,D!==f&&u.isPropagationStopped())break e;f=N,u.currentTarget=le;try{f(u)}catch(ue){Cl(ue)}u.currentTarget=null,f=D}else for(_=0;_<i.length;_++){if(N=i[_],D=N.instance,le=N.currentTarget,N=N.listener,D!==f&&u.isPropagationStopped())break e;f=N,u.currentTarget=le;try{f(u)}catch(ue){Cl(ue)}u.currentTarget=null,f=D}}}}function mt(e,t){var s=t[ol];s===void 0&&(s=t[ol]=new Set);var i=e+"__bubble";s.has(i)||(lx(t,e,2,!1),s.add(i))}function Eh(e,t,s){var i=0;t&&(i|=4),lx(s,e,i,t)}var fd="_reactListening"+Math.random().toString(36).slice(2);function Th(e){if(!e[fd]){e[fd]=!0,Kn.forEach(function(s){s!=="selectionchange"&&(x0.has(s)||Eh(s,!1,e),Eh(s,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[fd]||(t[fd]=!0,Eh("selectionchange",!1,t))}}function lx(e,t,s,i){switch(Dx(t)){case 2:var u=X0;break;case 8:u=V0;break;default:u=Gh}s=u.bind(null,t,s,e),u=void 0,!Zt||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(u=!0),i?u!==void 0?e.addEventListener(t,s,{capture:!0,passive:u}):e.addEventListener(t,s,!0):u!==void 0?e.addEventListener(t,s,{passive:u}):e.addEventListener(t,s,!1)}function Ch(e,t,s,i,u){var f=i;if((t&1)===0&&(t&2)===0&&i!==null)e:for(;;){if(i===null)return;var _=i.tag;if(_===3||_===4){var N=i.stateNode.containerInfo;if(N===u)break;if(_===4)for(_=i.return;_!==null;){var D=_.tag;if((D===3||D===4)&&_.stateNode.containerInfo===u)return;_=_.return}for(;N!==null;){if(_=Ss(N),_===null)return;if(D=_.tag,D===5||D===6||D===26||D===27){i=f=_;continue e}N=N.parentNode}}i=i.return}Te(function(){var le=f,ue=mn(s),pe=[];e:{var ie=Cu.get(e);if(ie!==void 0){var ce=el,ze=e;switch(e){case"keypress":if(dl(s)===0)break e;case"keydown":case"keyup":ce=Jr;break;case"focusin":ze="focus",ce=El;break;case"focusout":ze="blur",ce=El;break;case"beforeblur":case"afterblur":ce=El;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ce=ir;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ce=Qr;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ce=io;break;case Bs:case Eu:case mo:ce=_f;break;case Tu:ce=Ma;break;case"scroll":case"scrollend":ce=Vr;break;case"wheel":ce=ro;break;case"copy":case"cut":case"paste":ce=Kr;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ce=cr;break;case"toggle":case"beforetoggle":ce=Ra}var Ke=(t&4)!==0,Vt=!Ke&&(e==="scroll"||e==="scrollend"),V=Ke?ie!==null?ie+"Capture":null:ie;Ke=[];for(var H=le,ne;H!==null;){var de=H;if(ne=de.stateNode,de=de.tag,de!==5&&de!==26&&de!==27||ne===null||V===null||(de=Qe(H,V),de!=null&&Ke.push(Vo(H,de,ne))),Vt)break;H=H.return}0<Ke.length&&(ie=new ce(ie,ze,null,s,ue),pe.push({event:ie,listeners:Ke}))}}if((t&7)===0){e:{if(ie=e==="mouseover"||e==="pointerover",ce=e==="mouseout"||e==="pointerout",ie&&s!==zn&&(ze=s.relatedTarget||s.fromElement)&&(Ss(ze)||ze[$n]))break e;if((ce||ie)&&(ie=ue.window===ue?ue:(ie=ue.ownerDocument)?ie.defaultView||ie.parentWindow:window,ce?(ze=s.relatedTarget||s.toElement,ce=le,ze=ze?Ss(ze):null,ze!==null&&(Vt=d(ze),Ke=ze.tag,ze!==Vt||Ke!==5&&Ke!==27&&Ke!==6)&&(ze=null)):(ce=null,ze=le),ce!==ze)){if(Ke=ir,de="onMouseLeave",V="onMouseEnter",H="mouse",(e==="pointerout"||e==="pointerover")&&(Ke=cr,de="onPointerLeave",V="onPointerEnter",H="pointer"),Vt=ce==null?ie:gs(ce),ne=ze==null?ie:gs(ze),ie=new Ke(de,H+"leave",ce,s,ue),ie.target=Vt,ie.relatedTarget=ne,de=null,Ss(ue)===le&&(Ke=new Ke(V,H+"enter",ze,s,ue),Ke.target=ne,Ke.relatedTarget=Vt,de=Ke),Vt=de,ce&&ze)t:{for(Ke=b0,V=ce,H=ze,ne=0,de=V;de;de=Ke(de))ne++;de=0;for(var Ye=H;Ye;Ye=Ke(Ye))de++;for(;0<ne-de;)V=Ke(V),ne--;for(;0<de-ne;)H=Ke(H),de--;for(;ne--;){if(V===H||H!==null&&V===H.alternate){Ke=V;break t}V=Ke(V),H=Ke(H)}Ke=null}else Ke=null;ce!==null&&ax(pe,ie,ce,Ke,!1),ze!==null&&Vt!==null&&ax(pe,Vt,ze,Ke,!0)}}e:{if(ie=le?gs(le):window,ce=ie.nodeName&&ie.nodeName.toLowerCase(),ce==="select"||ce==="input"&&ie.type==="file")var St=oo;else if(wu(ie))if(On)St=ku;else{St=pr;var Be=ac}else ce=ie.nodeName,!ce||ce.toLowerCase()!=="input"||ie.type!=="checkbox"&&ie.type!=="radio"?le&&Oe(le.elementType)&&(St=oo):St=Da;if(St&&(St=St(e,le))){nc(pe,St,s,ue);break e}Be&&Be(e,ie,le),e==="focusout"&&le&&ie.type==="number"&&le.memoizedProps.value!=null&&qt(ie,"number",ie.value)}switch(Be=le?gs(le):window,e){case"focusin":(wu(Be)||Be.contentEditable==="true")&&(Wl=Be,ho=le,gr=null);break;case"focusout":gr=ho=Wl=null;break;case"mousedown":K=!0;break;case"contextmenu":case"mouseup":case"dragend":K=!1,ml(pe,s,ue);break;case"selectionchange":if(mi)break;case"keydown":case"keyup":ml(pe,s,ue)}var rt;if(tc)e:{switch(e){case"compositionstart":var xt="onCompositionStart";break e;case"compositionend":xt="onCompositionEnd";break e;case"compositionupdate":xt="onCompositionUpdate";break e}xt=void 0}else hl?fi(e,s)&&(xt="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(xt="onCompositionStart");xt&&(ur&&s.locale!=="ko"&&(hl||xt!=="onCompositionStart"?xt==="onCompositionEnd"&&hl&&(rt=sr()):(wn=ue,Sa="value"in wn?wn.value:wn.textContent,hl=!0)),Be=hd(le,xt),0<Be.length&&(xt=new lo(xt,e,null,s,ue),pe.push({event:xt,listeners:Be}),rt?xt.data=rt:(rt=Zl(s),rt!==null&&(xt.data=rt)))),(rt=Nu?rn(e,s):co(e,s))&&(xt=hd(le,"onBeforeInput"),0<xt.length&&(Be=new lo("onBeforeInput","beforeinput",null,s,ue),pe.push({event:Be,listeners:xt}),Be.data=rt)),p0(pe,e,le,s,ue)}sx(pe,t)})}function Vo(e,t,s){return{instance:e,listener:t,currentTarget:s}}function hd(e,t){for(var s=t+"Capture",i=[];e!==null;){var u=e,f=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||f===null||(u=Qe(e,s),u!=null&&i.unshift(Vo(e,u,f)),u=Qe(e,t),u!=null&&i.push(Vo(e,u,f))),e.tag===3)return i;e=e.return}return[]}function b0(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function ax(e,t,s,i,u){for(var f=t._reactName,_=[];s!==null&&s!==i;){var N=s,D=N.alternate,le=N.stateNode;if(N=N.tag,D!==null&&D===i)break;N!==5&&N!==26&&N!==27||le===null||(D=le,u?(le=Qe(s,f),le!=null&&_.unshift(Vo(s,le,D))):u||(le=Qe(s,f),le!=null&&_.push(Vo(s,le,D)))),s=s.return}_.length!==0&&e.push({event:t,listeners:_})}var _0=/\r\n?/g,y0=/\u0000|\uFFFD/g;function ix(e){return(typeof e=="string"?e:""+e).replace(_0,`
|
|
50
|
-
`).replace(y0,"")}function rx(e,t){return t=ix(t),ix(e)===t}function Xt(e,t,s,i,u,f){switch(s){case"children":typeof i=="string"?t==="body"||t==="textarea"&&i===""||ee(e,i):(typeof i=="number"||typeof i=="bigint")&&t!=="body"&&ee(e,""+i);break;case"className":Gn(e,"class",i);break;case"tabIndex":Gn(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":Gn(e,s,i);break;case"style":Le(e,i,f);break;case"data":if(t!=="object"){Gn(e,"data",i);break}case"src":case"href":if(i===""&&(t!=="a"||s!=="href")){e.removeAttribute(s);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(s);break}i=Nn(""+i),e.setAttribute(s,i);break;case"action":case"formAction":if(typeof i=="function"){e.setAttribute(s,"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"&&(s==="formAction"?(t!=="input"&&Xt(e,t,"name",u.name,u,null),Xt(e,t,"formEncType",u.formEncType,u,null),Xt(e,t,"formMethod",u.formMethod,u,null),Xt(e,t,"formTarget",u.formTarget,u,null)):(Xt(e,t,"encType",u.encType,u,null),Xt(e,t,"method",u.method,u,null),Xt(e,t,"target",u.target,u,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(s);break}i=Nn(""+i),e.setAttribute(s,i);break;case"onClick":i!=null&&(e.onclick=Ut);break;case"onScroll":i!=null&&mt("scroll",e);break;case"onScrollEnd":i!=null&&mt("scrollend",e);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(c(61));if(s=i.__html,s!=null){if(u.children!=null)throw Error(c(60));e.innerHTML=s}}break;case"multiple":e.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":e.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){e.removeAttribute("xlink:href");break}s=Nn(""+i),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(s,""+i):e.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":i&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(s,""):e.removeAttribute(s);break;case"capture":case"download":i===!0?e.setAttribute(s,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(s,i):e.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(s,i):e.removeAttribute(s);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?e.removeAttribute(s):e.setAttribute(s,i);break;case"popover":mt("beforetoggle",e),mt("toggle",e),Zn(e,"popover",i);break;case"xlinkActuate":ft(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":ft(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":ft(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":ft(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":ft(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":ft(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":ft(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":ft(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":ft(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":Zn(e,"is",i);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=Ct.get(s)||s,Zn(e,s,i))}}function Ah(e,t,s,i,u,f){switch(s){case"style":Le(e,i,f);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(c(61));if(s=i.__html,s!=null){if(u.children!=null)throw Error(c(60));e.innerHTML=s}}break;case"children":typeof i=="string"?ee(e,i):(typeof i=="number"||typeof i=="bigint")&&ee(e,""+i);break;case"onScroll":i!=null&&mt("scroll",e);break;case"onScrollEnd":i!=null&&mt("scrollend",e);break;case"onClick":i!=null&&(e.onclick=Ut);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!vn.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(u=s.endsWith("Capture"),t=s.slice(2,u?s.length-7:void 0),f=e[et]||null,f=f!=null?f[s]:null,typeof f=="function"&&e.removeEventListener(t,f,u),typeof i=="function")){typeof f!="function"&&f!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(t,i,u);break e}s in e?e[s]=i:i===!0?e.setAttribute(s,""):Zn(e,s,i)}}}function us(e,t,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":mt("error",e),mt("load",e);var i=!1,u=!1,f;for(f in s)if(s.hasOwnProperty(f)){var _=s[f];if(_!=null)switch(f){case"src":i=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Xt(e,t,f,_,s,null)}}u&&Xt(e,t,"srcSet",s.srcSet,s,null),i&&Xt(e,t,"src",s.src,s,null);return;case"input":mt("invalid",e);var N=f=_=u=null,D=null,le=null;for(i in s)if(s.hasOwnProperty(i)){var ue=s[i];if(ue!=null)switch(i){case"name":u=ue;break;case"type":_=ue;break;case"checked":D=ue;break;case"defaultChecked":le=ue;break;case"value":f=ue;break;case"defaultValue":N=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(c(137,t));break;default:Xt(e,t,i,ue,s,null)}}Hs(e,f,N,D,le,_,u,!1);return;case"select":mt("invalid",e),i=_=f=null;for(u in s)if(s.hasOwnProperty(u)&&(N=s[u],N!=null))switch(u){case"value":f=N;break;case"defaultValue":_=N;break;case"multiple":i=N;default:Xt(e,t,u,N,s,null)}t=f,s=_,e.multiple=!!i,t!=null?Ts(e,!!i,t,!1):s!=null&&Ts(e,!!i,s,!0);return;case"textarea":mt("invalid",e),f=u=i=null;for(_ in s)if(s.hasOwnProperty(_)&&(N=s[_],N!=null))switch(_){case"value":i=N;break;case"defaultValue":u=N;break;case"children":f=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(c(91));break;default:Xt(e,t,_,N,s,null)}S(e,i,u,f);return;case"option":for(D in s)if(s.hasOwnProperty(D)&&(i=s[D],i!=null))switch(D){case"selected":e.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:Xt(e,t,D,i,s,null)}return;case"dialog":mt("beforetoggle",e),mt("toggle",e),mt("cancel",e),mt("close",e);break;case"iframe":case"object":mt("load",e);break;case"video":case"audio":for(i=0;i<Xo.length;i++)mt(Xo[i],e);break;case"image":mt("error",e),mt("load",e);break;case"details":mt("toggle",e);break;case"embed":case"source":case"link":mt("error",e),mt("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(le in s)if(s.hasOwnProperty(le)&&(i=s[le],i!=null))switch(le){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Xt(e,t,le,i,s,null)}return;default:if(Oe(t)){for(ue in s)s.hasOwnProperty(ue)&&(i=s[ue],i!==void 0&&Ah(e,t,ue,i,s,void 0));return}}for(N in s)s.hasOwnProperty(N)&&(i=s[N],i!=null&&Xt(e,t,N,i,s,null))}function v0(e,t,s,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,f=null,_=null,N=null,D=null,le=null,ue=null;for(ce in s){var pe=s[ce];if(s.hasOwnProperty(ce)&&pe!=null)switch(ce){case"checked":break;case"value":break;case"defaultValue":D=pe;default:i.hasOwnProperty(ce)||Xt(e,t,ce,null,i,pe)}}for(var ie in i){var ce=i[ie];if(pe=s[ie],i.hasOwnProperty(ie)&&(ce!=null||pe!=null))switch(ie){case"type":f=ce;break;case"name":u=ce;break;case"checked":le=ce;break;case"defaultChecked":ue=ce;break;case"value":_=ce;break;case"defaultValue":N=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(c(137,t));break;default:ce!==pe&&Xt(e,t,ie,ce,i,pe)}}is(e,_,N,D,le,ue,f,u);return;case"select":ce=_=N=ie=null;for(f in s)if(D=s[f],s.hasOwnProperty(f)&&D!=null)switch(f){case"value":break;case"multiple":ce=D;default:i.hasOwnProperty(f)||Xt(e,t,f,null,i,D)}for(u in i)if(f=i[u],D=s[u],i.hasOwnProperty(u)&&(f!=null||D!=null))switch(u){case"value":ie=f;break;case"defaultValue":N=f;break;case"multiple":_=f;default:f!==D&&Xt(e,t,u,f,i,D)}t=N,s=_,i=ce,ie!=null?Ts(e,!!s,ie,!1):!!i!=!!s&&(t!=null?Ts(e,!!s,t,!0):Ts(e,!!s,s?[]:"",!1));return;case"textarea":ce=ie=null;for(N in s)if(u=s[N],s.hasOwnProperty(N)&&u!=null&&!i.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:Xt(e,t,N,null,i,u)}for(_ in i)if(u=i[_],f=s[_],i.hasOwnProperty(_)&&(u!=null||f!=null))switch(_){case"value":ie=u;break;case"defaultValue":ce=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(c(91));break;default:u!==f&&Xt(e,t,_,u,i,f)}Ne(e,ie,ce);return;case"option":for(var ze in s)if(ie=s[ze],s.hasOwnProperty(ze)&&ie!=null&&!i.hasOwnProperty(ze))switch(ze){case"selected":e.selected=!1;break;default:Xt(e,t,ze,null,i,ie)}for(D in i)if(ie=i[D],ce=s[D],i.hasOwnProperty(D)&&ie!==ce&&(ie!=null||ce!=null))switch(D){case"selected":e.selected=ie&&typeof ie!="function"&&typeof ie!="symbol";break;default:Xt(e,t,D,ie,i,ce)}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 Ke in s)ie=s[Ke],s.hasOwnProperty(Ke)&&ie!=null&&!i.hasOwnProperty(Ke)&&Xt(e,t,Ke,null,i,ie);for(le in i)if(ie=i[le],ce=s[le],i.hasOwnProperty(le)&&ie!==ce&&(ie!=null||ce!=null))switch(le){case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(c(137,t));break;default:Xt(e,t,le,ie,i,ce)}return;default:if(Oe(t)){for(var Vt in s)ie=s[Vt],s.hasOwnProperty(Vt)&&ie!==void 0&&!i.hasOwnProperty(Vt)&&Ah(e,t,Vt,void 0,i,ie);for(ue in i)ie=i[ue],ce=s[ue],!i.hasOwnProperty(ue)||ie===ce||ie===void 0&&ce===void 0||Ah(e,t,ue,ie,i,ce);return}}for(var V in s)ie=s[V],s.hasOwnProperty(V)&&ie!=null&&!i.hasOwnProperty(V)&&Xt(e,t,V,null,i,ie);for(pe in i)ie=i[pe],ce=s[pe],!i.hasOwnProperty(pe)||ie===ce||ie==null&&ce==null||Xt(e,t,pe,ie,i,ce)}function cx(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function j0(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,s=performance.getEntriesByType("resource"),i=0;i<s.length;i++){var u=s[i],f=u.transferSize,_=u.initiatorType,N=u.duration;if(f&&N&&cx(_)){for(_=0,N=u.responseEnd,i+=1;i<s.length;i++){var D=s[i],le=D.startTime;if(le>N)break;var ue=D.transferSize,pe=D.initiatorType;ue&&cx(pe)&&(D=D.responseEnd,_+=ue*(D<N?1:(N-le)/(D-le)))}if(--i,t+=8*(f+_)/(u.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 Mh=null,Rh=null;function pd(e){return e.nodeType===9?e:e.ownerDocument}function ox(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 ux(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 Dh(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 Oh=null;function N0(){var e=window.event;return e&&e.type==="popstate"?e===Oh?!1:(Oh=e,!0):(Oh=null,!1)}var dx=typeof setTimeout=="function"?setTimeout:void 0,w0=typeof clearTimeout=="function"?clearTimeout:void 0,fx=typeof Promise=="function"?Promise:void 0,k0=typeof queueMicrotask=="function"?queueMicrotask:typeof fx<"u"?function(e){return fx.resolve(null).then(e).catch(S0)}:dx;function S0(e){setTimeout(function(){throw e})}function Hi(e){return e==="head"}function hx(e,t){var s=t,i=0;do{var u=s.nextSibling;if(e.removeChild(s),u&&u.nodeType===8)if(s=u.data,s==="/$"||s==="/&"){if(i===0){e.removeChild(u),Rc(t);return}i--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")i++;else if(s==="html")Qo(e.ownerDocument.documentElement);else if(s==="head"){s=e.ownerDocument.head,Qo(s);for(var f=s.firstChild;f;){var _=f.nextSibling,N=f.nodeName;f[ss]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&f.rel.toLowerCase()==="stylesheet"||s.removeChild(f),f=_}}else s==="body"&&Qo(e.ownerDocument.body);s=u}while(s);Rc(t)}function px(e,t){var s=e;e=0;do{var i=s.nextSibling;if(s.nodeType===1?t?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(t?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),i&&i.nodeType===8)if(s=i.data,s==="/$"){if(e===0)break;e--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||e++;s=i}while(s)}function Lh(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var s=t;switch(t=t.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":Lh(s),ms(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function E0(e,t,s,i){for(;e.nodeType===1;){var u=s;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[ss])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!==u.rel||e.getAttribute("href")!==(u.href==null||u.href===""?null:u.href)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin)||e.getAttribute("title")!==(u.title==null?null:u.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(f=e.getAttribute("src"),(f!==(u.src==null?null:u.src)||e.getAttribute("type")!==(u.type==null?null:u.type)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin))&&f&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var f=u.name==null?null:""+u.name;if(u.type==="hidden"&&e.getAttribute("name")===f)return e}else return e;if(e=_l(e.nextSibling),e===null)break}return null}function T0(e,t,s){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=_l(e.nextSibling),e===null))return null;return e}function mx(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=_l(e.nextSibling),e===null))return null;return e}function zh(e){return e.data==="$?"||e.data==="$~"}function Uh(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function C0(e,t){var s=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||s.readyState!=="loading")t();else{var i=function(){t(),s.removeEventListener("DOMContentLoaded",i)};s.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}function _l(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 Hh=null;function gx(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"||s==="/&"){if(t===0)return _l(e.nextSibling);t--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||t++}e=e.nextSibling}return null}function xx(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(t===0)return e;t--}else s!=="/$"&&s!=="/&"||t++}e=e.previousSibling}return null}function bx(e,t,s){switch(t=pd(s),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 Qo(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ms(e)}var yl=new Map,_x=new Set;function md(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ni=Y.d;Y.d={f:A0,r:M0,D:R0,C:D0,L:O0,m:L0,X:U0,S:z0,M:H0};function A0(){var e=ni.f(),t=id();return e||t}function M0(e){var t=Rn(e);t!==null&&t.tag===5&&t.type==="form"?zm(t):ni.r(e)}var Cc=typeof document>"u"?null:document;function yx(e,t,s){var i=Cc;if(i&&typeof t=="string"&&t){var u=Dn(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof s=="string"&&(u+='[crossorigin="'+s+'"]'),_x.has(u)||(_x.add(u),e={rel:e,crossOrigin:s,href:t},i.querySelector(u)===null&&(t=i.createElement("link"),us(t,"link",e),tt(t),i.head.appendChild(t)))}}function R0(e){ni.D(e),yx("dns-prefetch",e,null)}function D0(e,t){ni.C(e,t),yx("preconnect",e,t)}function O0(e,t,s){ni.L(e,t,s);var i=Cc;if(i&&e&&t){var u='link[rel="preload"][as="'+Dn(t)+'"]';t==="image"&&s&&s.imageSrcSet?(u+='[imagesrcset="'+Dn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(u+='[imagesizes="'+Dn(s.imageSizes)+'"]')):u+='[href="'+Dn(e)+'"]';var f=u;switch(t){case"style":f=Ac(e);break;case"script":f=Mc(e)}yl.has(f)||(e=j({rel:"preload",href:t==="image"&&s&&s.imageSrcSet?void 0:e,as:t},s),yl.set(f,e),i.querySelector(u)!==null||t==="style"&&i.querySelector(Ko(f))||t==="script"&&i.querySelector(Zo(f))||(t=i.createElement("link"),us(t,"link",e),tt(t),i.head.appendChild(t)))}}function L0(e,t){ni.m(e,t);var s=Cc;if(s&&e){var i=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+Dn(i)+'"][href="'+Dn(e)+'"]',f=u;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=Mc(e)}if(!yl.has(f)&&(e=j({rel:"modulepreload",href:e},t),yl.set(f,e),s.querySelector(u)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Zo(f)))return}i=s.createElement("link"),us(i,"link",e),tt(i),s.head.appendChild(i)}}}function z0(e,t,s){ni.S(e,t,s);var i=Cc;if(i&&e){var u=ln(i).hoistableStyles,f=Ac(e);t=t||"default";var _=u.get(f);if(!_){var N={loading:0,preload:null};if(_=i.querySelector(Ko(f)))N.loading=5;else{e=j({rel:"stylesheet",href:e,"data-precedence":t},s),(s=yl.get(f))&&Bh(e,s);var D=_=i.createElement("link");tt(D),us(D,"link",e),D._p=new Promise(function(le,ue){D.onload=le,D.onerror=ue}),D.addEventListener("load",function(){N.loading|=1}),D.addEventListener("error",function(){N.loading|=2}),N.loading|=4,gd(_,t,i)}_={type:"stylesheet",instance:_,count:1,state:N},u.set(f,_)}}}function U0(e,t){ni.X(e,t);var s=Cc;if(s&&e){var i=ln(s).hoistableScripts,u=Mc(e),f=i.get(u);f||(f=s.querySelector(Zo(u)),f||(e=j({src:e,async:!0},t),(t=yl.get(u))&&Ih(e,t),f=s.createElement("script"),tt(f),us(f,"link",e),s.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},i.set(u,f))}}function H0(e,t){ni.M(e,t);var s=Cc;if(s&&e){var i=ln(s).hoistableScripts,u=Mc(e),f=i.get(u);f||(f=s.querySelector(Zo(u)),f||(e=j({src:e,async:!0,type:"module"},t),(t=yl.get(u))&&Ih(e,t),f=s.createElement("script"),tt(f),us(f,"link",e),s.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},i.set(u,f))}}function vx(e,t,s,i){var u=(u=ke.current)?md(u):null;if(!u)throw Error(c(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(t=Ac(s.href),s=ln(u).hoistableStyles,i=s.get(t),i||(i={type:"style",instance:null,count:0,state:null},s.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){e=Ac(s.href);var f=ln(u).hoistableStyles,_=f.get(e);if(_||(u=u.ownerDocument||u,_={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,_),(f=u.querySelector(Ko(e)))&&!f._p&&(_.instance=f,_.state.loading=5),yl.has(e)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},yl.set(e,s),f||B0(u,e,s,_.state))),t&&i===null)throw Error(c(528,""));return _}if(t&&i!==null)throw Error(c(529,""));return null;case"script":return t=s.async,s=s.src,typeof s=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Mc(s),s=ln(u).hoistableScripts,i=s.get(t),i||(i={type:"script",instance:null,count:0,state:null},s.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,e))}}function Ac(e){return'href="'+Dn(e)+'"'}function Ko(e){return'link[rel="stylesheet"]['+e+"]"}function jx(e){return j({},e,{"data-precedence":e.precedence,precedence:null})}function B0(e,t,s,i){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?i.loading=1:(t=e.createElement("link"),i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2}),us(t,"link",s),tt(t),e.head.appendChild(t))}function Mc(e){return'[src="'+Dn(e)+'"]'}function Zo(e){return"script[async]"+e}function Nx(e,t,s){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+Dn(s.href)+'"]');if(i)return t.instance=i,tt(i),i;var u=j({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),tt(i),us(i,"style",u),gd(i,s.precedence,e),t.instance=i;case"stylesheet":u=Ac(s.href);var f=e.querySelector(Ko(u));if(f)return t.state.loading|=4,t.instance=f,tt(f),f;i=jx(s),(u=yl.get(u))&&Bh(i,u),f=(e.ownerDocument||e).createElement("link"),tt(f);var _=f;return _._p=new Promise(function(N,D){_.onload=N,_.onerror=D}),us(f,"link",i),t.state.loading|=4,gd(f,s.precedence,e),t.instance=f;case"script":return f=Mc(s.src),(u=e.querySelector(Zo(f)))?(t.instance=u,tt(u),u):(i=s,(u=yl.get(f))&&(i=j({},s),Ih(i,u)),e=e.ownerDocument||e,u=e.createElement("script"),tt(u),us(u,"link",i),e.head.appendChild(u),t.instance=u);case"void":return null;default:throw Error(c(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(i=t.instance,t.state.loading|=4,gd(i,s.precedence,e));return t.instance}function gd(e,t,s){for(var i=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=i.length?i[i.length-1]:null,f=u,_=0;_<i.length;_++){var N=i[_];if(N.dataset.precedence===t)f=N;else if(f!==u)break}f?f.parentNode.insertBefore(e,f.nextSibling):(t=s.nodeType===9?s.head:s,t.insertBefore(e,t.firstChild))}function Bh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Ih(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var xd=null;function wx(e,t,s){if(xd===null){var i=new Map,u=xd=new Map;u.set(s,i)}else u=xd,i=u.get(s),i||(i=new Map,u.set(s,i));if(i.has(e))return i;for(i.set(e,null),s=s.getElementsByTagName(e),u=0;u<s.length;u++){var f=s[u];if(!(f[ss]||f[sn]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var _=f.getAttribute(t)||"";_=e+_;var N=i.get(_);N?N.push(f):i.set(_,[f])}}return i}function kx(e,t,s){e=e.ownerDocument||e,e.head.insertBefore(s,t==="title"?e.querySelector("head > title"):null)}function I0(e,t,s){if(s===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 Sx(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function $0(e,t,s,i){if(s.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var u=Ac(i.href),f=t.querySelector(Ko(u));if(f){t=f._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=bd.bind(e),t.then(e,e)),s.state.loading|=4,s.instance=f,tt(f);return}f=t.ownerDocument||t,i=jx(i),(u=yl.get(u))&&Bh(i,u),f=f.createElement("link"),tt(f);var _=f;_._p=new Promise(function(N,D){_.onload=N,_.onerror=D}),us(f,"link",i),s.instance=f}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(s,t),(t=s.state.preload)&&(s.state.loading&3)===0&&(e.count++,s=bd.bind(e),t.addEventListener("load",s),t.addEventListener("error",s))}}var $h=0;function q0(e,t){return e.stylesheets&&e.count===0&&yd(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var i=setTimeout(function(){if(e.stylesheets&&yd(e,e.stylesheets),e.unsuspend){var f=e.unsuspend;e.unsuspend=null,f()}},6e4+t);0<e.imgBytes&&$h===0&&($h=62500*j0());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&yd(e,e.stylesheets),e.unsuspend)){var f=e.unsuspend;e.unsuspend=null,f()}},(e.imgBytes>$h?50:800)+t);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(u)}}:null}function bd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)yd(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var _d=null;function yd(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,_d=new Map,t.forEach(G0,e),_d=null,bd.call(e))}function G0(e,t){if(!(t.state.loading&4)){var s=_d.get(e);if(s)var i=s.get(null);else{s=new Map,_d.set(e,s);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<u.length;f++){var _=u[f];(_.nodeName==="LINK"||_.getAttribute("media")!=="not all")&&(s.set(_.dataset.precedence,_),i=_)}i&&s.set(null,i)}u=t.instance,_=u.getAttribute("data-precedence"),f=s.get(_)||i,f===i&&s.set(null,u),s.set(_,u),this.count++,i=bd.bind(this),u.addEventListener("load",i),u.addEventListener("error",i),f?f.parentNode.insertBefore(u,f.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),t.state.loading|=4}}var Fo={$$typeof:I,Provider:null,Consumer:null,_currentValue:W,_currentValue2:W,_threadCount:0};function Y0(e,t,s,i,u,f,_,N,D){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=Dt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Dt(0),this.hiddenUpdates=Dt(null),this.identifierPrefix=i,this.onUncaughtError=u,this.onCaughtError=f,this.onRecoverableError=_,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=D,this.incompleteTransitions=new Map}function Ex(e,t,s,i,u,f,_,N,D,le,ue,pe){return e=new Y0(e,t,s,_,D,le,ue,pe,N),t=1,f===!0&&(t|=24),f=Cs(3,null,null,t),e.current=f,f.stateNode=e,t=So(),t.refCount++,e.pooledCache=t,t.refCount++,f.memoizedState={element:i,isDehydrated:s,cache:t},Xa(f),e}function Tx(e){return e?(e=Pl,e):Pl}function Cx(e,t,s,i,u,f){u=Tx(u),i.context===null?i.context=u:i.pendingContext=u,i=ia(t),i.payload={element:s},f=f===void 0?null:f,f!==null&&(i.callback=f),s=Ul(e,i,t),s!==null&&(Ks(s,e,t),Ei(s,e,t))}function Ax(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<t?s:t}}function qh(e,t){Ax(e,t),(e=e.alternate)&&Ax(e,t)}function Mx(e){if(e.tag===13||e.tag===31){var t=za(e,67108864);t!==null&&Ks(t,e,67108864),qh(e,67108864)}}function Rx(e){if(e.tag===13||e.tag===31){var t=il();t=ws(t);var s=za(e,t);s!==null&&Ks(s,e,t),qh(e,t)}}var vd=!0;function X0(e,t,s,i){var u=$.T;$.T=null;var f=Y.p;try{Y.p=2,Gh(e,t,s,i)}finally{Y.p=f,$.T=u}}function V0(e,t,s,i){var u=$.T;$.T=null;var f=Y.p;try{Y.p=8,Gh(e,t,s,i)}finally{Y.p=f,$.T=u}}function Gh(e,t,s,i){if(vd){var u=Yh(i);if(u===null)Ch(e,t,i,jd,s),Ox(e,i);else if(K0(u,e,t,s,i))i.stopPropagation();else if(Ox(e,i),t&4&&-1<Q0.indexOf(e)){for(;u!==null;){var f=Rn(u);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var _=nn(f.pendingLanes);if(_!==0){var N=f;for(N.pendingLanes|=2,N.entangledLanes|=2;_;){var D=1<<31-zt(_);N.entanglements[1]|=D,_&=~D}da(f),(At&6)===0&&(ld=Fe()+500,Yo(0))}}break;case 31:case 13:N=za(f,2),N!==null&&Ks(N,f,2),id(),qh(f,2)}if(f=Yh(i),f===null&&Ch(e,t,i,jd,s),f===u)break;u=f}u!==null&&i.stopPropagation()}else Ch(e,t,i,null,s)}}function Yh(e){return e=mn(e),Xh(e)}var jd=null;function Xh(e){if(jd=null,e=Ss(e),e!==null){var t=d(e);if(t===null)e=null;else{var s=t.tag;if(s===13){if(e=h(t),e!==null)return e;e=null}else if(s===31){if(e=m(t),e!==null)return e;e=null}else if(s===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return jd=e,null}function Dx(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(bn()){case ts:return 2;case Lt:return 8;case kt:case hs:return 32;case hn:return 268435456;default:return 32}default:return 32}}var Vh=!1,Bi=null,Ii=null,$i=null,Jo=new Map,Wo=new Map,qi=[],Q0="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 Ox(e,t){switch(e){case"focusin":case"focusout":Bi=null;break;case"dragenter":case"dragleave":Ii=null;break;case"mouseover":case"mouseout":$i=null;break;case"pointerover":case"pointerout":Jo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Wo.delete(t.pointerId)}}function Po(e,t,s,i,u,f){return e===null||e.nativeEvent!==f?(e={blockedOn:t,domEventName:s,eventSystemFlags:i,nativeEvent:f,targetContainers:[u]},t!==null&&(t=Rn(t),t!==null&&Mx(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function K0(e,t,s,i,u){switch(t){case"focusin":return Bi=Po(Bi,e,t,s,i,u),!0;case"dragenter":return Ii=Po(Ii,e,t,s,i,u),!0;case"mouseover":return $i=Po($i,e,t,s,i,u),!0;case"pointerover":var f=u.pointerId;return Jo.set(f,Po(Jo.get(f)||null,e,t,s,i,u)),!0;case"gotpointercapture":return f=u.pointerId,Wo.set(f,Po(Wo.get(f)||null,e,t,s,i,u)),!0}return!1}function Lx(e){var t=Ss(e.target);if(t!==null){var s=d(t);if(s!==null){if(t=s.tag,t===13){if(t=h(s),t!==null){e.blockedOn=t,ks(e.priority,function(){Rx(s)});return}}else if(t===31){if(t=m(s),t!==null){e.blockedOn=t,ks(e.priority,function(){Rx(s)});return}}else if(t===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Nd(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var s=Yh(e.nativeEvent);if(s===null){s=e.nativeEvent;var i=new s.constructor(s.type,s);zn=i,s.target.dispatchEvent(i),zn=null}else return t=Rn(s),t!==null&&Mx(t),e.blockedOn=s,!1;t.shift()}return!0}function zx(e,t,s){Nd(e)&&s.delete(t)}function Z0(){Vh=!1,Bi!==null&&Nd(Bi)&&(Bi=null),Ii!==null&&Nd(Ii)&&(Ii=null),$i!==null&&Nd($i)&&($i=null),Jo.forEach(zx),Wo.forEach(zx)}function wd(e,t){e.blockedOn===t&&(e.blockedOn=null,Vh||(Vh=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,Z0)))}var kd=null;function Ux(e){kd!==e&&(kd=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){kd===e&&(kd=null);for(var t=0;t<e.length;t+=3){var s=e[t],i=e[t+1],u=e[t+2];if(typeof i!="function"){if(Xh(i||s)===null)continue;break}var f=Rn(s);f!==null&&(e.splice(t,3),t-=3,Yf(f,{pending:!0,data:u,method:s.method,action:i},i,u))}}))}function Rc(e){function t(D){return wd(D,e)}Bi!==null&&wd(Bi,e),Ii!==null&&wd(Ii,e),$i!==null&&wd($i,e),Jo.forEach(t),Wo.forEach(t);for(var s=0;s<qi.length;s++){var i=qi[s];i.blockedOn===e&&(i.blockedOn=null)}for(;0<qi.length&&(s=qi[0],s.blockedOn===null);)Lx(s),s.blockedOn===null&&qi.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(i=0;i<s.length;i+=3){var u=s[i],f=s[i+1],_=u[et]||null;if(typeof f=="function")_||Ux(s);else if(_){var N=null;if(f&&f.hasAttribute("formAction")){if(u=f,_=f[et]||null)N=_.formAction;else if(Xh(u)!==null)continue}else N=_.action;typeof N=="function"?s[i+1]=N:(s.splice(i,3),i-=3),Ux(s)}}}function Hx(){function e(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(_){return u=_})},focusReset:"manual",scroll:"manual"})}function t(){u!==null&&(u(),u=null),i||setTimeout(s,20)}function s(){if(!i&&!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 i=!1,u=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(s,100),function(){i=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),u!==null&&(u(),u=null)}}}function Qh(e){this._internalRoot=e}Sd.prototype.render=Qh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var s=t.current,i=il();Cx(s,i,e,t,null,null)},Sd.prototype.unmount=Qh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Cx(e.current,2,null,e,null,null),id(),t[$n]=null}};function Sd(e){this._internalRoot=e}Sd.prototype.unstable_scheduleHydration=function(e){if(e){var t=Vl();e={blockedOn:null,target:e,priority:t};for(var s=0;s<qi.length&&t!==0&&t<qi[s].priority;s++);qi.splice(s,0,e),s===0&&Lx(e)}};var Bx=l.version;if(Bx!=="19.2.8")throw Error(c(527,Bx,"19.2.8"));Y.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?y(e):null,e=e===null?null:e.stateNode,e};var F0={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:$,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ed=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ed.isDisabled&&Ed.supportsFiber)try{_n=Ed.inject(F0),Ft=Ed}catch{}}return tu.createRoot=function(e,t){if(!o(e))throw Error(c(299));var s=!1,i="",u=Vm,f=Qm,_=Km;return t!=null&&(t.unstable_strictMode===!0&&(s=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onUncaughtError!==void 0&&(u=t.onUncaughtError),t.onCaughtError!==void 0&&(f=t.onCaughtError),t.onRecoverableError!==void 0&&(_=t.onRecoverableError)),t=Ex(e,1,!1,null,null,s,i,null,u,f,_,Hx),e[$n]=t.current,Th(e),new Qh(t)},tu.hydrateRoot=function(e,t,s){if(!o(e))throw Error(c(299));var i=!1,u="",f=Vm,_=Qm,N=Km,D=null;return s!=null&&(s.unstable_strictMode===!0&&(i=!0),s.identifierPrefix!==void 0&&(u=s.identifierPrefix),s.onUncaughtError!==void 0&&(f=s.onUncaughtError),s.onCaughtError!==void 0&&(_=s.onCaughtError),s.onRecoverableError!==void 0&&(N=s.onRecoverableError),s.formState!==void 0&&(D=s.formState)),t=Ex(e,1,!0,t,s??null,i,u,D,f,_,N,Hx),t.context=Tx(null),s=t.current,i=il(),i=ws(i),u=ia(i),u.callback=null,Ul(s,u,i),s=i,t.current.lanes=s,pn(t,s),da(t),e[$n]=t.current,Th(e),new Sd(t)},tu.version="19.2.8",tu}var Fx;function cv(){if(Fx)return Jh.exports;Fx=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(l){console.error(l)}}return n(),Jh.exports=rv(),Jh.exports}var ov=cv();const C_=1,Ki="main",Jx=["skills","agents","hooks","commands","plugins","output-styles","CLAUDE.md","settings.json","keybindings.json"],ii=["orange","blue","green","purple","pink","teal"];function uv(n){return`${n.replace(/[^\p{L}\p{N}\p{M}]/gu,"-").replace(/-+/g,"-").toLowerCase().replace(/^-|-$/g,"")||"project"}-${A_(n)}`}function dv(n){const l=n.replace(/[^a-zA-Z0-9]/g,"-").replace(/-+/g,"-").toLowerCase(),r=`${l.replace(/^-+|-+$/g,"")||"project"}-${A_(n)}`,c=uv(n);return[l,r].filter(o=>o!==c)}function A_(n){const l=/^[a-zA-Z]:[\\/]|^\\\\/.test(n);return fv(l?n.toLowerCase():n)}function fv(n){let l=3735928559,r=1103547991;for(let c=0;c<n.length;c++){const o=n.charCodeAt(c);l=Math.imul(l^o,2654435761),r=Math.imul(r^o,1597334677)}return l=Math.imul(l^l>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507)^Math.imul(l^l>>>13,3266489909),(4294967296*(2097151&r)+(l>>>0)).toString(36)}const Bp=b.createContext({accounts:[],auth:{},multi:!1});function Ip(){return b.useContext(Bp)}function hv(n,l="claude"){const{accounts:r,multi:c}=b.useContext(Bp);return!c||l==="antigravity"||!n?null:r.find(o=>o.id===n)??null}const Yd={orange:"оранжевый",blue:"синий",green:"зелёный",purple:"фиолетовый",pink:"розовый",teal:"бирюзовый"};function M_(n){const l=Array.from(n.trim())[0];return l?l.toUpperCase():"?"}function R_(n){return n?n.loggedIn?n.plan||"вход выполнен":"вход не выполнен":""}const D_="ccv:last-account";function pv(){try{return localStorage.getItem(D_)}catch{return null}}function mv(n){try{localStorage.setItem(D_,n)}catch{}}function wa({account:n,size:l="sm",className:r}){const c=`Аккаунт «${n.name}», ${Yd[n.color]}`;return a.jsx("span",{className:`acct-mark acct-mark--${l} acct--${n.color}${r?` ${r}`:""}`,role:"img","aria-label":c,title:c,children:a.jsx("span",{"aria-hidden":"true",children:M_(n.name)})})}function Wx({account:n,onClick:l,className:r}){const c=a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"acct-mark acct-mark--sm","aria-hidden":"true",children:a.jsx("span",{children:M_(n.name)})}),a.jsx("span",{className:"acct-chip__name",children:n.name})]}),o=`acct-chip acct--${n.color}${r?` ${r}`:""}`,d=`Сессия идёт под аккаунтом «${n.name}» — лимиты и тариф берутся из него`;return l?a.jsx("button",{type:"button",className:o,title:d,"aria-label":`Аккаунт «${n.name}». Открыть аккаунты`,onClick:l,children:c}):a.jsx("span",{className:o,title:d,role:"group","aria-label":`Аккаунт «${n.name}»`,children:c})}var ai,Yc,Xc,Vc,Qc,_u,Kc,df,O_;class gv{constructor(l){xn(this,df);xn(this,ai,null);xn(this,Yc,new Set);xn(this,Xc,500);xn(this,Vc,null);xn(this,Qc,!1);xn(this,_u,null);xn(this,Kc,null);this.url=l}get statusText(){return this.connected?"Хост на связи":"Нет связи с хостом"}onStatus(l){Mt(this,Kc,l)}connect(){if(Ze(this,Qc))return;const l=new WebSocket(this.url);Mt(this,ai,l),l.addEventListener("open",()=>{var r,c;Mt(this,Xc,500),this.send({type:"hello",protocol:C_,clientName:"ccv-web"}),(r=Ze(this,_u))==null||r.call(this),(c=Ze(this,Kc))==null||c.call(this)}),l.addEventListener("message",r=>{let c;try{c=JSON.parse(String(r.data))}catch{return}for(const o of Ze(this,Yc))o(c)}),l.addEventListener("close",()=>{var r;Mt(this,ai,null),(r=Ze(this,Kc))==null||r.call(this),Bn(this,df,O_).call(this)}),l.addEventListener("error",()=>l.close())}onReconnect(l){Mt(this,_u,l)}on(l){return Ze(this,Yc).add(l),()=>Ze(this,Yc).delete(l)}send(l){var r;((r=Ze(this,ai))==null?void 0:r.readyState)===WebSocket.OPEN&&Ze(this,ai).send(JSON.stringify(l))}get connected(){var l;return((l=Ze(this,ai))==null?void 0:l.readyState)===WebSocket.OPEN}close(){var l;Mt(this,Qc,!0),(l=Ze(this,ai))==null||l.close()}}ai=new WeakMap,Yc=new WeakMap,Xc=new WeakMap,Vc=new WeakMap,Qc=new WeakMap,_u=new WeakMap,Kc=new WeakMap,df=new WeakSet,O_=function(){if(Ze(this,Qc)||Ze(this,Vc)!==null)return;const l=Ze(this,Xc);Mt(this,Xc,Math.min(l*2,1e4)),Mt(this,Vc,window.setTimeout(()=>{Mt(this,Vc,null),this.connect()},l))};const xv=1,L_="ccv:relay",Xd="ccv:relay.host";function bv(){try{const n=localStorage.getItem(L_);if(!n)return null;const l=JSON.parse(n);return typeof(l==null?void 0:l.token)!="string"||typeof l.expiresAt=="number"&&l.expiresAt<=Date.now()?null:l}catch{return null}}function z_(){localStorage.removeItem(L_)}var _a,Zc,ya,Fc,Jc,Pi,Lr,zr,er,Ur,Wc,Hr,Br,Pt,Vi,yp,U_,Dr,vp;class _v{constructor(l){xn(this,Pt);xn(this,_a,null);xn(this,Zc,new Set);xn(this,ya,null);xn(this,Fc,null);xn(this,Jc,500);xn(this,Pi,null);xn(this,Lr,!1);xn(this,zr,!1);xn(this,er,!1);xn(this,Ur,null);xn(this,Wc,"Подключаемся…");xn(this,Hr,0);xn(this,Br,[]);this.session=l}get connected(){return Ze(this,zr)&&Ze(this,er)}get statusText(){return Ze(this,Wc)}get hostId(){return Ze(this,Ur)}on(l){return Ze(this,Zc).add(l),()=>Ze(this,Zc).delete(l)}onReconnect(l){Mt(this,Fc,l)}onStatus(l){Mt(this,ya,l)}connect(){Ze(this,Lr)||Bn(this,Pt,yp).call(this)}send(l){if(!Ze(this,zr)){Ze(this,Br).length<64&&Ze(this,Br).push(l);return}Bn(this,Pt,Dr).call(this,{t:"client.frame",body:l})}close(){var l;Mt(this,Lr,!0),Ze(this,Pi)!==null&&window.clearTimeout(Ze(this,Pi)),(l=Ze(this,_a))==null||l.close()}}_a=new WeakMap,Zc=new WeakMap,ya=new WeakMap,Fc=new WeakMap,Jc=new WeakMap,Pi=new WeakMap,Lr=new WeakMap,zr=new WeakMap,er=new WeakMap,Ur=new WeakMap,Wc=new WeakMap,Hr=new WeakMap,Br=new WeakMap,Pt=new WeakSet,Vi=function(l){var r;Ze(this,Wc)!==l&&(Mt(this,Wc,l),(r=Ze(this,ya))==null||r.call(this))},yp=async function(){if(Ze(this,_a))return;if(!Ze(this,Ur))try{Mt(this,Ur,await yv(this.session.token))}catch(c){Bn(this,Pt,Vi).call(this,c instanceof Error?c.message:String(c)),Bn(this,Pt,vp).call(this);return}const l=location.protocol==="https:"?"wss":"ws",r=new WebSocket(`${l}://${location.host}/relay/client`);Mt(this,_a,r),r.addEventListener("open",()=>{Bn(this,Pt,Dr).call(this,{t:"client.hello",protocol:xv,token:this.session.token})}),r.addEventListener("message",c=>{let o;try{o=JSON.parse(String(c.data))}catch{return}Bn(this,Pt,U_).call(this,o)}),r.addEventListener("close",()=>{var c;Mt(this,_a,null),Mt(this,zr,!1),Mt(this,er,!1),Bn(this,Pt,Vi).call(this,"Нет связи с сервером"),(c=Ze(this,ya))==null||c.call(this),Bn(this,Pt,vp).call(this)}),r.addEventListener("error",()=>r.close())},U_=function(l){var r,c,o,d,h,m,g;switch(l.t){case"client.ok":Mt(this,Jc,500),Bn(this,Pt,Dr).call(this,{t:"client.attach",hostId:Ze(this,Ur)??"",...Ze(this,Hr)>0?{sinceRseq:Ze(this,Hr)}:{}});return;case"client.attached":Mt(this,zr,!0),Mt(this,er,l.online),Mt(this,Hr,l.rseq),Bn(this,Pt,Vi).call(this,l.online?"Хост на связи":"Компьютер не на связи"),Bn(this,Pt,Dr).call(this,{t:"client.frame",body:{type:"hello",protocol:C_,clientName:"ccv-web-relay"}});const x=Ze(this,Br);Mt(this,Br,[]);for(const y of x)Bn(this,Pt,Dr).call(this,{t:"client.frame",body:y});(r=Ze(this,Fc))==null||r.call(this),(c=Ze(this,ya))==null||c.call(this);return;case"host.frame":{l.rseq>0&&Mt(this,Hr,l.rseq);const y=l.body;for(const j of Ze(this,Zc))j(y);return}case"host.online":Mt(this,er,!0),Bn(this,Pt,Vi).call(this,"Хост на связи"),(o=Ze(this,Fc))==null||o.call(this),(d=Ze(this,ya))==null||d.call(this);return;case"host.offline":Mt(this,er,!1),Bn(this,Pt,Vi).call(this,"Компьютер не на связи"),(h=Ze(this,ya))==null||h.call(this);return;case"ping":Bn(this,Pt,Dr).call(this,{t:"pong",nonce:l.nonce});return;case"error":if(l.code==="auth"){z_(),location.href="/login";return}if(l.code==="not_found"){localStorage.removeItem(Xd),Bn(this,Pt,Vi).call(this,"Этот компьютер отвязан от аккаунта"),Mt(this,Lr,!0),(m=Ze(this,_a))==null||m.close();return}l.code!=="offline"&&Bn(this,Pt,Vi).call(this,l.message),(g=Ze(this,ya))==null||g.call(this);return}},Dr=function(l){var r;((r=Ze(this,_a))==null?void 0:r.readyState)===WebSocket.OPEN&&Ze(this,_a).send(JSON.stringify(l))},vp=function(){if(Ze(this,Lr)||Ze(this,Pi)!==null)return;const l=Ze(this,Jc);Mt(this,Jc,Math.min(l*2,1e4)),Mt(this,Pi,window.setTimeout(()=>{Mt(this,Pi,null),Bn(this,Pt,yp).call(this)},l))};async function yv(n){const l=new URLSearchParams(location.search).get("host");if(l)return localStorage.setItem(Xd,l),l;const r=localStorage.getItem(Xd);if(r)return r;const c=await fetch("/api/hosts",{headers:{authorization:`Bearer ${n}`}});if(c.status===401)throw z_(),location.href="/login",new Error("нужен вход");const d=(await c.json()).hosts??[];if(d.length===1&&d[0])return localStorage.setItem(Xd,d[0].id),d[0].id;throw location.href="/hosts",new Error("выберите компьютер")}function Vd(){return location.pathname==="/app"||location.pathname.startsWith("/app/")?"relay":"local"}const vv=`${location.protocol==="https:"?"wss":"ws"}://${location.host}/ws`;function jv(){if(Vd()==="local")return new gv(vv);const n=bv();return n?new _v(n):(location.replace(`/login?next=${encodeURIComponent(location.pathname+location.search)}`),null)}const H_="ccv:drafts",Nv=40,wv=2e4,kv=500;let du=null,fu=null;function $p(){if(du)return du;const n=new Map;try{const l=localStorage.getItem(H_);if(l){const r=JSON.parse(l);if(typeof r=="object"&&r!==null)for(const[c,o]of Object.entries(r))typeof o=="string"&&o!==""&&n.set(c,o)}}catch{}return du=n,window.addEventListener("pagehide",$_),n}function tp(n){return $p().get(n)??""}function B_(n,l){const r=$p(),c=l.slice(0,wv),o=r.has(n);if(o&&r.delete(n),c!=="")r.set(n,c);else if(!o)return;for(;r.size>Nv;){const d=r.keys().next();if(d.done)break;r.delete(d.value)}Tv(),Ev()}function I_(){const n=new Set;for(const l of $p().keys())n.add(l.startsWith("side:")?l.slice(5):l);return[...n].sort()}const jp=new Set;let Px="";function Sv(n){return jp.add(n),()=>jp.delete(n)}function Ev(){const n=I_(),l=n.join(`
|
|
51
|
-
`);if(l!==Px){Px=l;for(const r of jp)r(n)}}function Tv(){fu===null&&(fu=window.setTimeout($_,kv))}function $_(){if(fu!==null&&window.clearTimeout(fu),fu=null,!!du)try{localStorage.setItem(H_,JSON.stringify(Object.fromEntries(du)))}catch{}}const Ls={items:[],pending:[],lastSeq:0,contextTokens:null},np={entries:[],total:0,loading:!1};function q_(n){var l;return((l=n.entries[0])==null?void 0:l.seq)??1}function eb(n){return n.total>0&&q_(n)>1}function Cv(n,l){const r=new Set(n.entries.map(o=>o.seq));return{entries:[...n.entries,...l.entries.filter(o=>!r.has(o.seq))].sort((o,d)=>o.seq-d.seq),total:l.total,loading:!1}}function Av(n){return Qd(Ls,n).items.map(l=>({...l,id:`h:${l.id}`}))}function Qd(n,l){let r=n;for(const c of l)c.seq<=r.lastSeq||(r={...Mv(r,c.event,c.seq),lastSeq:c.seq});return r}function Mv(n,l,r){var o,d;const c=n.items;switch(l.kind){case"user.message":return fa(n,{id:`u${r}`,kind:"user",text:l.text,images:l.images});case"assistant.delta":{const h=c.findIndex(g=>g.id===l.blockId);if(h===-1)return fa(n,{id:l.blockId,kind:"assistant",text:l.text,streaming:!0});const m=c[h];return Dc(n,h,{...m,text:m.text+l.text})}case"assistant.text":{const h=c.findIndex(g=>g.id===l.blockId),m={id:l.blockId,kind:"assistant",text:l.text,streaming:!1};return h===-1?fa(n,m):Dc(n,h,m)}case"thinking.delta":{const h=c.findIndex(g=>g.id===l.blockId);if(h===-1)return fa(n,{id:l.blockId,kind:"thinking",text:l.text});const m=c[h];return Dc(n,h,{...m,text:m.text+l.text})}case"assistant.thinking":{const h=c.findIndex(g=>g.id===l.blockId),m={id:l.blockId,kind:"thinking",text:l.text};return h===-1?fa(n,m):Dc(n,h,m)}case"tool.use":return fa(n,{id:`t${l.toolUseId}`,kind:"tool",toolUseId:l.toolUseId,name:l.name,input:l.input,result:null,isError:!1,awaitingPermission:!1});case"tool.result":{const h=c.findIndex(g=>g.kind==="tool"&&g.toolUseId===l.toolUseId);if(h===-1)return n;const m=c[h];return Dc(n,h,{...m,result:l.content,isError:l.isError,awaitingPermission:!1})}case"permission.request":return{...n,pending:[...n.pending,{requestId:l.requestId,toolName:l.toolName,input:l.input,...l.reason?{reason:l.reason}:{},...l.questions?{questions:l.questions}:{},...l.toolUseId?{toolUseId:l.toolUseId}:{}}]};case"permission.resolved":{const h=n.pending.find(g=>g.requestId===l.requestId),m=n.pending.filter(g=>g.requestId!==l.requestId);if(l.answers&&(h!=null&&h.toolUseId)){const g=c.findIndex(x=>x.kind==="tool"&&x.toolUseId===h.toolUseId);if(g!==-1){const x=c[g];return Dc({...n,pending:m},g,{...x,answers:l.answers})}}return l.decision==="allow"?{...n,pending:m}:fa({...n,pending:m},{id:`p${r}`,kind:"notice",tone:"info",text:`Отклонено${l.reason?`: ${l.reason}`:""}`})}case"result":{const h=n.items.map(g=>g.kind==="assistant"&&g.streaming?{...g,streaming:!1}:g),m=l.contextTokens??n.contextTokens;return fa({...n,items:h,contextTokens:m},{id:`r${r}`,kind:"result",subtype:l.subtype,isError:l.isError,durationMs:l.durationMs,costUsd:l.costUsd,inputTokens:((o=l.usage)==null?void 0:o.inputTokens)??0,outputTokens:((d=l.usage)==null?void 0:d.outputTokens)??0})}case"system":return l.subtype!=="compact_boundary"?n:fa(n,{id:`s${r}`,kind:"notice",tone:"info",text:"Контекст сжат"});case"error":return fa(n,{id:`e${r}`,kind:"notice",tone:"error",text:l.message});case"state":return n;case"rewound":return n;default:return n}}function Rv(n,l){let r=0;for(let c=0;c<n.length;c++)if(n[c].event.kind==="user.message"){if(r===l)return n.slice(0,c);r++}return n}function Dv(n,l,r){const c=l-r;if(c<=0)return[];let o=0;for(let d=0;d<n.length;d++)if(n[d].kind==="user"){if(o===c)return n.slice(0,d);o++}return n}function fa(n,l){return{...n,items:[...n.items,l]}}function Dc(n,l,r){const c=n.items.slice();return c[l]=r,{...n,items:c}}const Np="ccv:theme",sp=["system","light","dark"];function Ov(){const[n,l]=b.useState(Lv);b.useEffect(()=>{const o=window.matchMedia("(prefers-color-scheme: dark)"),d=()=>{const h=n==="dark"||n==="system"&&o.matches;document.documentElement.dataset.theme=h?"dark":"light"};return d(),o.addEventListener("change",d),()=>o.removeEventListener("change",d)},[n]);const r=b.useCallback(o=>{try{localStorage.setItem(Np,o)}catch{}l(o)},[]),c=b.useCallback(()=>{l(o=>{const d=sp[(sp.indexOf(o)+1)%sp.length];try{localStorage.setItem(Np,d)}catch{}return d})},[]);return[n,r,c]}function Lv(){try{const n=localStorage.getItem(Np);if(n==="light"||n==="dark"||n==="system")return n}catch{}return"system"}const G_=[{value:"default",hint:"спрашивать перед каждым действием"},{value:"acceptEdits",hint:"правки файлов без подтверждения"},{value:"plan",hint:"только чтение и план, без изменений"},{value:"auto",hint:"спрашивать только о рискованном — решает сам"},{value:"bypassPermissions",hint:"ничего не спрашивать"}],zv=[{value:"default",hint:"рискованное agy отклоняет сам: спросить он не может"},{value:"acceptEdits",hint:"правки файлов без подтверждения, команды — нет"},{value:"plan",hint:"только план, без изменений"},{value:"bypassPermissions",hint:"разрешено всё, включая команды"}],Ir={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:"вопроса"}},Uv=320,Y_="ccv:panes";function Hv(n){return`--${n}-w`}function X_(n,l){const r=Ir[n];return Math.round(Math.min(r.max,Math.max(r.min,l)))}function Bv(){const n={};for(const l of Object.keys(Ir))n[l]=Ir[l].width;try{const l=localStorage.getItem(Y_);if(l){const r=JSON.parse(l);for(const c of Object.keys(Ir)){const o=r[c];typeof o=="number"&&Number.isFinite(o)&&(n[c]=X_(c,o))}}}catch{}return n}function Iv(){const[n,l]=b.useState(Bv),r=b.useCallback(h=>{try{localStorage.setItem(Y_,JSON.stringify(h))}catch{}},[]),c=b.useCallback((h,m)=>{l(g=>{const x=X_(h,m);if(g[h]===x)return g;const y={...g,[h]:x};return r(y),y})},[r]),o=b.useCallback(h=>{l(m=>{const g={...m,[h]:Ir[h].width};return r(g),g})},[r]),d={};for(const h of Object.keys(Ir))d[Hv(h)]=`${n[h]}px`;return{widths:n,style:d,setWidth:c,reset:o}}const lp=260,V_=120,$v=200,tb="ccv:terminal-h";function nb(n,l){return Math.round(Math.min(l,Math.max(V_,n)))}function qv(){const[n,l]=b.useState(()=>{try{const d=localStorage.getItem(tb);if(d){const h=Number(d);if(Number.isFinite(h))return nb(h,1/0)}}catch{}return lp}),r=b.useCallback(d=>{try{localStorage.setItem(tb,String(d))}catch{}},[]),c=b.useCallback((d,h)=>{const m=nb(d,h);l(g=>g===m?g:(r(m),m))},[r]),o=b.useCallback(()=>{l(lp),r(lp)},[r]);return{height:n,setHeight:c,reset:o}}function ff(n){const[l,r]=b.useState(()=>typeof window>"u"?!1:window.matchMedia(n).matches);return b.useEffect(()=>{const c=window.matchMedia(n),o=()=>r(c.matches);return o(),c.addEventListener("change",o),()=>c.removeEventListener("change",o)},[n]),l}const Gv=500,Yv=6;function Q_({onLongPress:n,onClick:l,disabled:r=!1,thresholdMs:c=Gv,moveCancelPx:o=Yv}){const d=b.useRef(null),[h,m]=b.useState(!1),g=b.useCallback(()=>{d.current&&window.clearTimeout(d.current.timer),d.current=null,m(!1)},[]),x=b.useCallback(A=>{if(r||A.button!==0)return;const C={timer:0,x:A.clientX,y:A.clientY,fired:!1};C.timer=window.setTimeout(()=>{C.fired=!0,m(!1),n()},c),d.current=C,m(!0)},[r,c,n]),y=b.useCallback(A=>{const C=d.current;!C||C.fired||Math.hypot(A.clientX-C.x,A.clientY-C.y)>o&&g()},[o,g]),j=b.useCallback(()=>{d.current&&!d.current.fired?g():m(!1)},[g]),v=b.useCallback(A=>{var C;if((C=d.current)!=null&&C.fired){d.current=null,A.preventDefault();return}if(!r){if(A.shiftKey){n();return}l()}},[r,l,n]),T=b.useCallback(A=>{A.preventDefault()},[]),w=b.useCallback(A=>{r||A.shiftKey&&(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),n())},[r,n]);return{holding:h,thresholdMs:c,handlers:{onPointerDown:x,onPointerMove:y,onPointerUp:j,onPointerCancel:j,onPointerLeave:j,onClick:v,onContextMenu:T,onKeyDown:w}}}const Xv={height:0,offsetTop:0,offsetLeft:0};function sb(){if(typeof window>"u")return Xv;const n=window.visualViewport;return n?{height:n.height,offsetTop:n.offsetTop,offsetLeft:n.offsetLeft}:{height:window.innerHeight,offsetTop:0,offsetLeft:0}}function Vv(n){const[l,r]=b.useState(sb);return b.useEffect(()=>{if(!n)return;const c=window.visualViewport,o=()=>{const d=sb();r(h=>h.height===d.height&&h.offsetTop===d.offsetTop&&h.offsetLeft===d.offsetLeft?h:d)};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]),l}function qp(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Yr=qp();function K_(n){Yr=n}var Or={exec:()=>null};function Oc(n){let l=[];return r=>{let c=Math.max(0,Math.min(3,r-1)),o=l[c];return o||(o=n(c),l[c]=o),o}}function vt(n,l=""){let r=typeof n=="string"?n:n.source,c={replace:(o,d)=>{let h=typeof d=="string"?d:d.source;return h=h.replace(js.caret,"$1"),r=r.replace(o,h),c},getRegex:()=>new RegExp(r,l)};return c}var Qv=((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:Oc(n=>new RegExp(`^ {0,${n}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Oc(n=>new RegExp(`^ {0,${n}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Oc(n=>new RegExp(`^ {0,${n}}(?:\`\`\`|~~~)`)),headingBeginRegex:Oc(n=>new RegExp(`^ {0,${n}}#`)),htmlBeginRegex:Oc(n=>new RegExp(`^ {0,${n}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:Oc(n=>new RegExp(`^ {0,${n}}>`))},Kv=/^(?:[ \t]*(?:\n|$))+/,Zv=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Fv=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,yu=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Jv=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Gp=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Z_=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,F_=vt(Z_).replace(/bull/g,Gp).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(),Wv=vt(Z_).replace(/bull/g,Gp).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(),Yp=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,Pv=/^[^\n]+/,Xp=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,ej=vt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Xp).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),tj=vt(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Gp).getRegex(),hf="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",Vp=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,nj=vt("^ {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",Vp).replace("tag",hf).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),J_=n=>vt(Yp).replace("hr",yu).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",hf).getRegex(),sj=J_(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),lj=J_(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),aj=vt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",lj).getRegex(),Qp={blockquote:aj,code:Zv,def:ej,fences:Fv,heading:Jv,hr:yu,html:nj,lheading:F_,list:tj,newline:Kv,paragraph:sj,table:Or,text:Pv},lb=vt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",yu).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",hf).getRegex(),ij={...Qp,lheading:Wv,table:lb,paragraph:vt(Yp).replace("hr",yu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",lb).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",hf).getRegex()},rj={...Qp,html:vt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Vp).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:Or,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:vt(Yp).replace("hr",yu).replace("heading",` *#{1,6} *[^
|
|
52
|
-
]`).replace("lheading",F_).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},cj=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,oj=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,W_=/^( {2,}|\\)\n(?!\s*$)/,uj=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,eo=/[\p{P}\p{S}]/u,pf=/[\s\p{P}\p{S}]/u,Kp=/[^\s\p{P}\p{S}]/u,dj=vt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,pf).getRegex(),P_=/(?!~)[\p{P}\p{S}]/u,fj=/(?!~)[\s\p{P}\p{S}]/u,hj=/(?:[^\s\p{P}\p{S}]|~)/u,pj=vt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Qv?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),ey=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,mj=vt(ey,"u").replace(/punct/g,eo).getRegex(),gj=vt(ey,"u").replace(/punct/g,P_).getRegex(),ty="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",xj=vt(ty,"gu").replace(/notPunctSpace/g,Kp).replace(/punctSpace/g,pf).replace(/punct/g,eo).getRegex(),bj=vt(ty,"gu").replace(/notPunctSpace/g,hj).replace(/punctSpace/g,fj).replace(/punct/g,P_).getRegex(),_j=vt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Kp).replace(/punctSpace/g,pf).replace(/punct/g,eo).getRegex(),yj=vt(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,eo).getRegex(),vj="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",jj=vt(vj,"gu").replace(/notPunctSpace/g,Kp).replace(/punctSpace/g,pf).replace(/punct/g,eo).getRegex(),Nj=vt(/\\(punct)/,"gu").replace(/punct/g,eo).getRegex(),wj=vt(/^<(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(),kj=vt(Vp).replace("(?:-->|$)","-->").getRegex(),Sj=vt("^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",kj).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ef=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Ej=vt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",ef).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ny=vt(/^!?\[(label)\]\[(ref)\]/).replace("label",ef).replace("ref",Xp).getRegex(),sy=vt(/^!?\[(ref)\](?:\[\])?/).replace("ref",Xp).getRegex(),Tj=vt("reflink|nolink(?!\\()","g").replace("reflink",ny).replace("nolink",sy).getRegex(),ab=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Zp={_backpedal:Or,anyPunctuation:Nj,autolink:wj,blockSkip:pj,br:W_,code:oj,del:Or,delLDelim:Or,delRDelim:Or,emStrongLDelim:mj,emStrongRDelimAst:xj,emStrongRDelimUnd:_j,escape:cj,link:Ej,nolink:sy,punctuation:dj,reflink:ny,reflinkSearch:Tj,tag:Sj,text:uj,url:Or},Cj={...Zp,link:vt(/^!?\[(label)\]\((.*?)\)/).replace("label",ef).getRegex(),reflink:vt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ef).getRegex()},wp={...Zp,emStrongRDelimAst:bj,emStrongLDelim:gj,delLDelim:yj,delRDelim:jj,url:vt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",ab).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:vt(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",ab).getRegex()},Aj={...wp,br:vt(W_).replace("{2,}","*").getRegex(),text:vt(wp.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Td={normal:Qp,gfm:ij,pedantic:rj},nu={normal:Zp,gfm:wp,breaks:Aj,pedantic:Cj},Mj={"&":"&","<":"<",">":">",'"':""","'":"'"},ib=n=>Mj[n];function ga(n,l){if(l){if(js.escapeTest.test(n))return n.replace(js.escapeReplace,ib)}else if(js.escapeTestNoEncode.test(n))return n.replace(js.escapeReplaceNoEncode,ib);return n}function rb(n){try{n=encodeURI(n).replace(js.percentDecode,"%")}catch{return null}return n}function cb(n,l){var d;let r=n.replace(js.findPipe,(h,m,g)=>{let x=!1,y=m;for(;--y>=0&&g[y]==="\\";)x=!x;return x?"|":" |"}),c=r.split(js.splitPipe),o=0;if(c[0].trim()||c.shift(),c.length>0&&!((d=c.at(-1))!=null&&d.trim())&&c.pop(),l)if(c.length>l)c.splice(l);else for(;c.length<l;)c.push("");for(;o<c.length;o++)c[o]=c[o].trim().replace(js.slashPipe,"|");return c}function Yi(n,l,r){let c=n.length;if(c===0)return"";let o=0;for(;o<c&&n.charAt(c-o-1)===l;)o++;return n.slice(0,c-o)}function ob(n){let l=n.split(`
|
|
53
|
-
`),r=l.length-1;for(;r>=0&&js.blankLine.test(l[r]);)r--;return l.length-r<=2?n:l.slice(0,r+1).join(`
|
|
54
|
-
`)}function Rj(n,l){if(n.indexOf(l[1])===-1)return-1;let r=0;for(let c=0;c<n.length;c++)if(n[c]==="\\")c++;else if(n[c]===l[0])r++;else if(n[c]===l[1]&&(r--,r<0))return c;return r>0?-2:-1}function Dj(n,l=0){let r=l,c="";for(let o of n)if(o===" "){let d=4-r%4;c+=" ".repeat(d),r+=d}else c+=o,r++;return c}function ub(n,l,r,c,o){let d=l.href,h=l.title||null,m=n[1].replace(o.other.outputLinkReplace,"$1");c.state.inLink=!0;let g={type:n[0].charAt(0)==="!"?"image":"link",raw:r,href:d,title:h,text:m,tokens:c.inlineTokens(m)};return c.state.inLink=!1,g}function Oj(n,l,r){let c=n.match(r.other.indentCodeCompensation);if(c===null)return l;let o=c[1];return l.split(`
|
|
55
|
-
`).map(d=>{let h=d.match(r.other.beginningSpace);if(h===null)return d;let[m]=h;return m.length>=o.length?d.slice(o.length):d}).join(`
|
|
56
|
-
`)}var tf=class{constructor(n){Qt(this,"options");Qt(this,"rules");Qt(this,"lexer");this.options=n||Yr}space(n){let l=this.rules.block.newline.exec(n);if(l&&l[0].length>0)return{type:"space",raw:l[0]}}code(n){let l=this.rules.block.code.exec(n);if(l){let r=this.options.pedantic?l[0]:ob(l[0]),c=r.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r,codeBlockStyle:"indented",text:c}}}fences(n){let l=this.rules.block.fences.exec(n);if(l){let r=l[0],c=Oj(r,l[3]||"",this.rules);return{type:"code",raw:r,lang:l[2]?l[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):l[2],text:c}}}heading(n){let l=this.rules.block.heading.exec(n);if(l){let r=l[2].trim();if(this.rules.other.endingHash.test(r)){let c=Yi(r,"#");(this.options.pedantic||!c||this.rules.other.endingSpaceChar.test(c))&&(r=c.trim())}return{type:"heading",raw:Yi(l[0],`
|
|
57
|
-
`),depth:l[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(n){let l=this.rules.block.hr.exec(n);if(l)return{type:"hr",raw:Yi(l[0],`
|
|
58
|
-
`)}}blockquote(n){let l=this.rules.block.blockquote.exec(n);if(l){let r=Yi(l[0],`
|
|
59
|
-
`).split(`
|
|
60
|
-
`),c="",o="",d=[];for(;r.length>0;){let h=!1,m=[],g;for(g=0;g<r.length;g++)if(this.rules.other.blockquoteStart.test(r[g]))m.push(r[g]),h=!0;else if(!h)m.push(r[g]);else break;r=r.slice(g);let x=m.join(`
|
|
61
|
-
`),y=x.replace(this.rules.other.blockquoteSetextReplace,`
|
|
62
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");c=c?`${c}
|
|
63
|
-
${x}`:x,o=o?`${o}
|
|
64
|
-
${y}`:y;let j=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(y,d,!0),this.lexer.state.top=j,r.length===0)break;let v=d.at(-1);if((v==null?void 0:v.type)==="code")break;if((v==null?void 0:v.type)==="blockquote"){let T=v,w=T.raw+`
|
|
65
|
-
`+r.join(`
|
|
66
|
-
`),A=this.blockquote(w);d[d.length-1]=A,c=c.substring(0,c.length-T.raw.length)+A.raw,o=o.substring(0,o.length-T.text.length)+A.text;break}else if((v==null?void 0:v.type)==="list"){let T=v,w=T.raw+`
|
|
67
|
-
`+r.join(`
|
|
68
|
-
`),A=this.list(w);d[d.length-1]=A,c=c.substring(0,c.length-v.raw.length)+A.raw,o=o.substring(0,o.length-T.raw.length)+A.raw,r=w.substring(d.at(-1).raw.length).split(`
|
|
69
|
-
`);continue}}return{type:"blockquote",raw:c,tokens:d,text:o}}}list(n){let l=this.rules.block.list.exec(n);if(l){let r=l[1].trim(),c=r.length>1,o={type:"list",raw:"",ordered:c,start:c?+r.slice(0,-1):"",loose:!1,items:[]};r=c?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=c?r:"[*+-]");let d=this.rules.other.listItemRegex(r),h=!1;for(;n;){let g=!1,x="",y="";if(!(l=d.exec(n))||this.rules.block.hr.test(n))break;x=l[0],n=n.substring(x.length);let j=Dj(l[2].split(`
|
|
70
|
-
`,1)[0],l[1].length),v=n.split(`
|
|
71
|
-
`,1)[0],T=!j.trim(),w=0;if(this.options.pedantic?(w=2,y=j.trimStart()):T?w=l[1].length+1:(w=j.search(this.rules.other.nonSpaceChar),w=w>4?1:w,y=j.slice(w),w+=l[1].length),T&&this.rules.other.blankLine.test(v)&&(x+=v+`
|
|
72
|
-
`,n=n.substring(v.length+1),g=!0),!g){let A=this.rules.other.nextBulletRegex(w),C=this.rules.other.hrRegex(w),F=this.rules.other.fencesBeginRegex(w),Q=this.rules.other.headingBeginRegex(w),I=this.rules.other.htmlBeginRegex(w),L=this.rules.other.blockquoteBeginRegex(w);for(;n;){let G=n.split(`
|
|
73
|
-
`,1)[0],M;if(v=G,this.options.pedantic?(v=v.replace(this.rules.other.listReplaceNesting," "),M=v):M=v.replace(this.rules.other.tabCharGlobal," "),F.test(v)||Q.test(v)||I.test(v)||L.test(v)||A.test(v)||C.test(v))break;if(M.search(this.rules.other.nonSpaceChar)>=w||!v.trim())y+=`
|
|
74
|
-
`+M.slice(w);else{if(T||j.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||F.test(j)||Q.test(j)||C.test(j))break;y+=`
|
|
75
|
-
`+v}T=!v.trim(),x+=G+`
|
|
76
|
-
`,n=n.substring(G.length+1),j=M.slice(w)}}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(y),loose:!1,text:y,tokens:[]}),o.raw+=x}let m=o.items.at(-1);if(m)m.raw=m.raw.trimEnd(),m.text=m.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let g of o.items){this.lexer.state.top=!1,g.tokens=this.lexer.blockTokens(g.text,[]);let x=g.tokens[0];if(g.task&&((x==null?void 0:x.type)==="text"||(x==null?void 0:x.type)==="paragraph")){g.text=g.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 j=this.lexer.inlineQueue.length-1;j>=0;j--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[j].src)){this.lexer.inlineQueue[j].src=this.lexer.inlineQueue[j].src.replace(this.rules.other.listReplaceTask,"");break}let y=this.rules.other.listTaskCheckbox.exec(g.raw);if(y){let j={type:"checkbox",raw:y[0]+" ",checked:y[0]!=="[ ]"};g.checked=j.checked,o.loose?g.tokens[0]&&["paragraph","text"].includes(g.tokens[0].type)&&"tokens"in g.tokens[0]&&g.tokens[0].tokens?(g.tokens[0].raw=j.raw+g.tokens[0].raw,g.tokens[0].text=j.raw+g.tokens[0].text,g.tokens[0].tokens.unshift(j)):g.tokens.unshift({type:"paragraph",raw:j.raw,text:j.raw,tokens:[j]}):g.tokens.unshift(j)}}else g.task&&(g.task=!1);if(!o.loose){let y=g.tokens.filter(v=>v.type==="space"),j=y.length>0&&y.some(v=>this.rules.other.anyLine.test(v.raw));o.loose=j}}if(o.loose)for(let g of o.items){g.loose=!0;for(let x of g.tokens)x.type==="text"&&(x.type="paragraph")}return o}}html(n){let l=this.rules.block.html.exec(n);if(l){let r=ob(l[0]);return{type:"html",block:!0,raw:r,pre:l[1]==="pre"||l[1]==="script"||l[1]==="style",text:r}}}def(n){let l=this.rules.block.def.exec(n);if(l){let r=l[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),c=l[2]?l[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=l[3]?l[3].substring(1,l[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):l[3];return{type:"def",tag:r,raw:Yi(l[0],`
|
|
77
|
-
`),href:c,title:o}}}table(n){var h;let l=this.rules.block.table.exec(n);if(!l||!this.rules.other.tableDelimiter.test(l[2]))return;let r=cb(l[1]),c=l[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=(h=l[3])!=null&&h.trim()?l[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
78
|
-
`):[],d={type:"table",raw:Yi(l[0],`
|
|
79
|
-
`),header:[],align:[],rows:[]};if(r.length===c.length){for(let m of c)this.rules.other.tableAlignRight.test(m)?d.align.push("right"):this.rules.other.tableAlignCenter.test(m)?d.align.push("center"):this.rules.other.tableAlignLeft.test(m)?d.align.push("left"):d.align.push(null);for(let m=0;m<r.length;m++)d.header.push({text:r[m],tokens:this.lexer.inline(r[m]),header:!0,align:d.align[m]});for(let m of o)d.rows.push(cb(m,d.header.length).map((g,x)=>({text:g,tokens:this.lexer.inline(g),header:!1,align:d.align[x]})));return d}}lheading(n){let l=this.rules.block.lheading.exec(n);if(l){let r=l[1].trim();return{type:"heading",raw:Yi(l[0],`
|
|
80
|
-
`),depth:l[2].charAt(0)==="="?1:2,text:r,tokens:this.lexer.inline(r)}}}paragraph(n){let l=this.rules.block.paragraph.exec(n);if(l){let r=l[1].charAt(l[1].length-1)===`
|
|
81
|
-
`?l[1].slice(0,-1):l[1];return{type:"paragraph",raw:l[0],text:r,tokens:this.lexer.inline(r)}}}text(n){let l=this.rules.block.text.exec(n);if(l)return{type:"text",raw:l[0],text:l[0],tokens:this.lexer.inline(l[0])}}escape(n){let l=this.rules.inline.escape.exec(n);if(l)return{type:"escape",raw:l[0],text:l[1]}}tag(n){let l=this.rules.inline.tag.exec(n);if(l)return!this.lexer.state.inLink&&this.rules.other.startATag.test(l[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(l[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(l[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(l[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:l[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:l[0]}}link(n){let l=this.rules.inline.link.exec(n);if(l){let r=l[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let d=Yi(r.slice(0,-1),"\\");if((r.length-d.length)%2===0)return}else{let d=Rj(l[2],"()");if(d===-2)return;if(d>-1){let h=(l[0].indexOf("!")===0?5:4)+l[1].length+d;l[2]=l[2].substring(0,d),l[0]=l[0].substring(0,h).trim(),l[3]=""}}let c=l[2],o="";if(this.options.pedantic){let d=this.rules.other.pedanticHrefTitle.exec(c);d&&(c=d[1],o=d[3])}else o=l[3]?l[3].slice(1,-1):"";return c=c.trim(),this.rules.other.startAngleBracket.test(c)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?c=c.slice(1):c=c.slice(1,-1)),ub(l,{href:c&&c.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},l[0],this.lexer,this.rules)}}reflink(n,l){let r;if((r=this.rules.inline.reflink.exec(n))||(r=this.rules.inline.nolink.exec(n))){let c=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=l[c.toLowerCase()];if(!o){let d=r[0].charAt(0);return{type:"text",raw:d,text:d}}return ub(r,o,r[0],this.lexer,this.rules)}}emStrong(n,l,r=""){let c=this.rules.inline.emStrongLDelim.exec(n);if(!(!c||!c[1]&&!c[2]&&!c[3]&&!c[4]||c[4]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(c[1]||c[3])||!r||this.rules.inline.punctuation.exec(r))){let o=[...c[0]].length-1,d,h,m=o,g=0,x=c[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(x.lastIndex=0,l=l.slice(-1*n.length+o);(c=x.exec(l))!==null;){if(d=c[1]||c[2]||c[3]||c[4]||c[5]||c[6],!d)continue;if(h=[...d].length,c[3]||c[4]){m+=h;continue}else if((c[5]||c[6])&&o%3&&!((o+h)%3)){g+=h;continue}if(m-=h,m>0)continue;h=Math.min(h,h+m+g);let y=[...c[0]][0].length,j=n.slice(0,o+c.index+y+h);if(Math.min(o,h)%2){let T=j.slice(1,-1);return{type:"em",raw:j,text:T,tokens:this.lexer.inlineTokens(T)}}let v=j.slice(2,-2);return{type:"strong",raw:j,text:v,tokens:this.lexer.inlineTokens(v)}}}}codespan(n){let l=this.rules.inline.code.exec(n);if(l){let r=l[2].replace(this.rules.other.newLineCharGlobal," "),c=this.rules.other.nonSpaceChar.test(r),o=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return c&&o&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:l[0],text:r}}}br(n){let l=this.rules.inline.br.exec(n);if(l)return{type:"br",raw:l[0]}}del(n,l,r=""){let c=this.rules.inline.delLDelim.exec(n);if(c&&(!c[1]||!r||this.rules.inline.punctuation.exec(r))){let o=[...c[0]].length-1,d,h,m=o,g=this.rules.inline.delRDelim;for(g.lastIndex=0,l=l.slice(-1*n.length+o);(c=g.exec(l))!==null;){if(d=c[1]||c[2]||c[3]||c[4]||c[5]||c[6],!d||(h=[...d].length,h!==o))continue;if(c[3]||c[4]){m+=h;continue}if(m-=h,m>0)continue;h=Math.min(h,h+m);let x=[...c[0]][0].length,y=n.slice(0,o+c.index+x+h),j=y.slice(o,-o);return{type:"del",raw:y,text:j,tokens:this.lexer.inlineTokens(j)}}}}autolink(n){let l=this.rules.inline.autolink.exec(n);if(l){let r,c;return l[2]==="@"?(r=l[1],c="mailto:"+r):(r=l[1],c=r),{type:"link",raw:l[0],text:r,href:c,tokens:[{type:"text",raw:r,text:r}]}}}url(n){var r;let l;if(l=this.rules.inline.url.exec(n)){let c,o;if(l[2]==="@")c=l[0],o="mailto:"+c;else{let d;do d=l[0],l[0]=((r=this.rules.inline._backpedal.exec(l[0]))==null?void 0:r[0])??"";while(d!==l[0]);c=l[0],l[1]==="www."?o="http://"+l[0]:o=l[0]}return{type:"link",raw:l[0],text:c,href:o,tokens:[{type:"text",raw:c,text:c}]}}}inlineText(n){let l=this.rules.inline.text.exec(n);if(l){let r=this.lexer.state.inRawBlock;return{type:"text",raw:l[0],text:l[0],escaped:r}}}},ql=class kp{constructor(l){Qt(this,"tokens");Qt(this,"options");Qt(this,"state");Qt(this,"inlineQueue");Qt(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=l||Yr,this.options.tokenizer=this.options.tokenizer||new tf,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 r={other:js,block:Td.normal,inline:nu.normal};this.options.pedantic?(r.block=Td.pedantic,r.inline=nu.pedantic):this.options.gfm&&(r.block=Td.gfm,this.options.breaks?r.inline=nu.breaks:r.inline=nu.gfm),this.tokenizer.rules=r}static get rules(){return{block:Td,inline:nu}}static lex(l,r){return new kp(r).lex(l)}static lexInline(l,r){return new kp(r).inlineTokens(l)}lex(l){l=l.replace(js.carriageReturn,`
|
|
82
|
-
`),this.blockTokens(l,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let c=this.inlineQueue[r];this.inlineTokens(c.src,c.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(l,r=[],c=!1){var d,h,m;this.tokenizer.lexer=this,this.options.pedantic&&(l=l.replace(js.tabCharGlobal," ").replace(js.spaceLine,""));let o=1/0;for(;l;){if(l.length<o)o=l.length;else{this.infiniteLoopError(l.charCodeAt(0));break}let g;if((h=(d=this.options.extensions)==null?void 0:d.block)!=null&&h.some(y=>(g=y.call({lexer:this},l,r))?(l=l.substring(g.raw.length),r.push(g),!0):!1))continue;if(g=this.tokenizer.space(l)){l=l.substring(g.raw.length);let y=r.at(-1);g.raw.length===1&&y!==void 0?y.raw+=`
|
|
83
|
-
`:r.push(g);continue}if(g=this.tokenizer.code(l)){l=l.substring(g.raw.length);let y=r.at(-1);(y==null?void 0:y.type)==="paragraph"||(y==null?void 0:y.type)==="text"?(y.raw+=(y.raw.endsWith(`
|
|
84
|
-
`)?"":`
|
|
85
|
-
`)+g.raw,y.text+=`
|
|
86
|
-
`+g.text,this.inlineQueue.at(-1).src=y.text):r.push(g);continue}if(g=this.tokenizer.fences(l)){l=l.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.heading(l)){l=l.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.hr(l)){l=l.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.blockquote(l)){l=l.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.list(l)){l=l.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.html(l)){l=l.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.def(l)){l=l.substring(g.raw.length);let y=r.at(-1);(y==null?void 0:y.type)==="paragraph"||(y==null?void 0:y.type)==="text"?(y.raw+=(y.raw.endsWith(`
|
|
87
|
-
`)?"":`
|
|
88
|
-
`)+g.raw,y.text+=`
|
|
89
|
-
`+g.raw,this.inlineQueue.at(-1).src=y.text):this.tokens.links[g.tag]||(this.tokens.links[g.tag]={href:g.href,title:g.title},r.push(g));continue}if(g=this.tokenizer.table(l)){l=l.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.lheading(l)){l=l.substring(g.raw.length),r.push(g);continue}let x=l;if((m=this.options.extensions)!=null&&m.startBlock){let y=1/0,j=l.slice(1),v;this.options.extensions.startBlock.forEach(T=>{v=T.call({lexer:this},j),typeof v=="number"&&v>=0&&(y=Math.min(y,v))}),y<1/0&&y>=0&&(x=l.substring(0,y+1))}if(this.state.top&&(g=this.tokenizer.paragraph(x))){let y=r.at(-1);c&&(y==null?void 0:y.type)==="paragraph"?(y.raw+=(y.raw.endsWith(`
|
|
90
|
-
`)?"":`
|
|
91
|
-
`)+g.raw,y.text+=`
|
|
92
|
-
`+g.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=y.text):r.push(g),c=x.length!==l.length,l=l.substring(g.raw.length);continue}if(g=this.tokenizer.text(l)){l=l.substring(g.raw.length);let y=r.at(-1);(y==null?void 0:y.type)==="text"?(y.raw+=(y.raw.endsWith(`
|
|
93
|
-
`)?"":`
|
|
94
|
-
`)+g.raw,y.text+=`
|
|
95
|
-
`+g.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=y.text):r.push(g);continue}if(l){this.infiniteLoopError(l.charCodeAt(0));break}}return this.state.top=!0,r}inline(l,r=[]){return this.inlineQueue.push({src:l,tokens:r}),r}inlineTokens(l,r=[]){var m,g,x,y,j;this.tokenizer.lexer=this;let c=l;if(this.tokens.links){let v=Object.keys(this.tokens.links);v.length>0&&(c=c.replace(this.tokenizer.rules.inline.reflinkSearch,T=>v.includes(T.slice(T.lastIndexOf("[")+1,-1))?"["+"a".repeat(T.length-2)+"]":T))}c=c.replace(this.tokenizer.rules.inline.anyPunctuation,"++"),c=c.replace(this.tokenizer.rules.inline.blockSkip,(v,T,w)=>{let A=w?w.length:0;return v.slice(0,A)+"["+"a".repeat(v.length-A-2)+"]"}),c=((g=(m=this.options.hooks)==null?void 0:m.emStrongMask)==null?void 0:g.call({lexer:this},c))??c;let o=!1,d="",h=1/0;for(;l;){if(l.length<h)h=l.length;else{this.infiniteLoopError(l.charCodeAt(0));break}o||(d=""),o=!1;let v;if((y=(x=this.options.extensions)==null?void 0:x.inline)!=null&&y.some(w=>(v=w.call({lexer:this},l,r))?(l=l.substring(v.raw.length),r.push(v),!0):!1))continue;if(v=this.tokenizer.escape(l)){l=l.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.tag(l)){l=l.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.link(l)){l=l.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.reflink(l,this.tokens.links)){l=l.substring(v.raw.length);let w=r.at(-1);v.type==="text"&&(w==null?void 0:w.type)==="text"?(w.raw+=v.raw,w.text+=v.text):r.push(v);continue}if(v=this.tokenizer.emStrong(l,c,d)){l=l.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.codespan(l)){l=l.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.br(l)){l=l.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.del(l,c,d)){l=l.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.autolink(l)){l=l.substring(v.raw.length),r.push(v);continue}if(!this.state.inLink&&(v=this.tokenizer.url(l))){l=l.substring(v.raw.length),r.push(v);continue}let T=l;if((j=this.options.extensions)!=null&&j.startInline){let w=1/0,A=l.slice(1),C;this.options.extensions.startInline.forEach(F=>{C=F.call({lexer:this},A),typeof C=="number"&&C>=0&&(w=Math.min(w,C))}),w<1/0&&w>=0&&(T=l.substring(0,w+1))}if(v=this.tokenizer.inlineText(T)){l=l.substring(v.raw.length),v.raw.slice(-1)!=="_"&&(d=v.raw.slice(-1)),o=!0;let w=r.at(-1);(w==null?void 0:w.type)==="text"?(w.raw+=v.raw,w.text+=v.text):r.push(v);continue}if(l){this.infiniteLoopError(l.charCodeAt(0));break}}return r}infiniteLoopError(l){let r="Infinite loop on byte: "+l;if(this.options.silent)console.error(r);else throw new Error(r)}},nf=class{constructor(n){Qt(this,"options");Qt(this,"parser");this.options=n||Yr}space(n){return""}code({text:n,lang:l,escaped:r}){var d;let c=(d=(l||"").match(js.notSpaceStart))==null?void 0:d[0],o=n.replace(js.endingNewline,"")+`
|
|
96
|
-
`;return c?'<pre><code class="language-'+ga(c)+'">'+(r?o:ga(o,!0))+`</code></pre>
|
|
97
|
-
`:"<pre><code>"+(r?o:ga(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:l}){return`<h${l}>${this.parser.parseInline(n)}</h${l}>
|
|
101
|
-
`}hr(n){return`<hr>
|
|
102
|
-
`}list(n){let l=n.ordered,r=n.start,c="";for(let h=0;h<n.items.length;h++){let m=n.items[h];c+=this.listitem(m)}let o=l?"ol":"ul",d=l&&r!==1?' start="'+r+'"':"";return"<"+o+d+`>
|
|
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 l="",r="";for(let o=0;o<n.header.length;o++)r+=this.tablecell(n.header[o]);l+=this.tablerow({text:r});let c="";for(let o=0;o<n.rows.length;o++){let d=n.rows[o];r="";for(let h=0;h<d.length;h++)r+=this.tablecell(d[h]);c+=this.tablerow({text:r})}return c&&(c=`<tbody>${c}</tbody>`),`<table>
|
|
107
|
-
<thead>
|
|
108
|
-
`+l+`</thead>
|
|
109
|
-
`+c+`</table>
|
|
110
|
-
`}tablerow({text:n}){return`<tr>
|
|
111
|
-
${n}</tr>
|
|
112
|
-
`}tablecell(n){let l=this.parser.parseInline(n.tokens),r=n.header?"th":"td";return(n.align?`<${r} align="${n.align}">`:`<${r}>`)+l+`</${r}>
|
|
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>${ga(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:l,tokens:r}){let c=this.parser.parseInline(r),o=rb(n);if(o===null)return c;n=o;let d='<a href="'+n+'"';return l&&(d+=' title="'+ga(l)+'"'),d+=">"+c+"</a>",d}image({href:n,title:l,text:r,tokens:c}){c&&(r=this.parser.parseInline(c,this.parser.textRenderer));let o=rb(n);if(o===null)return ga(r);n=o;let d=`<img src="${n}" alt="${ga(r)}"`;return l&&(d+=` title="${ga(l)}"`),d+=">",d}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:ga(n.text)}},Fp=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}},Gl=class Sp{constructor(l){Qt(this,"options");Qt(this,"renderer");Qt(this,"textRenderer");this.options=l||Yr,this.options.renderer=this.options.renderer||new nf,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Fp}static parse(l,r){return new Sp(r).parse(l)}static parseInline(l,r){return new Sp(r).parseInline(l)}parse(l){var c,o;this.renderer.parser=this;let r="";for(let d=0;d<l.length;d++){let h=l[d];if((o=(c=this.options.extensions)==null?void 0:c.renderers)!=null&&o[h.type]){let g=h,x=this.options.extensions.renderers[g.type].call({parser:this},g);if(x!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(g.type)){r+=x||"";continue}}let m=h;switch(m.type){case"space":{r+=this.renderer.space(m);break}case"hr":{r+=this.renderer.hr(m);break}case"heading":{r+=this.renderer.heading(m);break}case"code":{r+=this.renderer.code(m);break}case"table":{r+=this.renderer.table(m);break}case"blockquote":{r+=this.renderer.blockquote(m);break}case"list":{r+=this.renderer.list(m);break}case"checkbox":{r+=this.renderer.checkbox(m);break}case"html":{r+=this.renderer.html(m);break}case"def":{r+=this.renderer.def(m);break}case"paragraph":{r+=this.renderer.paragraph(m);break}case"text":{r+=this.renderer.text(m);break}default:{let g='Token with "'+m.type+'" type was not found.';if(this.options.silent)return console.error(g),"";throw new Error(g)}}}return r}parseInline(l,r=this.renderer){var o,d;this.renderer.parser=this;let c="";for(let h=0;h<l.length;h++){let m=l[h];if((d=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&d[m.type]){let x=this.options.extensions.renderers[m.type].call({parser:this},m);if(x!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(m.type)){c+=x||"";continue}}let g=m;switch(g.type){case"escape":{c+=r.text(g);break}case"html":{c+=r.html(g);break}case"link":{c+=r.link(g);break}case"image":{c+=r.image(g);break}case"checkbox":{c+=r.checkbox(g);break}case"strong":{c+=r.strong(g);break}case"em":{c+=r.em(g);break}case"codespan":{c+=r.codespan(g);break}case"br":{c+=r.br(g);break}case"del":{c+=r.del(g);break}case"text":{c+=r.text(g);break}default:{let x='Token with "'+g.type+'" type was not found.';if(this.options.silent)return console.error(x),"";throw new Error(x)}}}return c}},Gd,cu=(Gd=class{constructor(n){Qt(this,"options");Qt(this,"block");this.options=n||Yr}preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}emStrongMask(n){return n}provideLexer(n=this.block){return n?ql.lex:ql.lexInline}provideParser(n=this.block){return n?Gl.parse:Gl.parseInline}},Qt(Gd,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),Qt(Gd,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Gd),Lj=class{constructor(...n){Qt(this,"defaults",qp());Qt(this,"options",this.setOptions);Qt(this,"parse",this.parseMarkdown(!0));Qt(this,"parseInline",this.parseMarkdown(!1));Qt(this,"Parser",Gl);Qt(this,"Renderer",nf);Qt(this,"TextRenderer",Fp);Qt(this,"Lexer",ql);Qt(this,"Tokenizer",tf);Qt(this,"Hooks",cu);this.use(...n)}walkTokens(n,l){var c,o;let r=[];for(let d of n)switch(r=r.concat(l.call(this,d)),d.type){case"table":{let h=d;for(let m of h.header)r=r.concat(this.walkTokens(m.tokens,l));for(let m of h.rows)for(let g of m)r=r.concat(this.walkTokens(g.tokens,l));break}case"list":{let h=d;r=r.concat(this.walkTokens(h.items,l));break}default:{let h=d;(o=(c=this.defaults.extensions)==null?void 0:c.childTokens)!=null&&o[h.type]?this.defaults.extensions.childTokens[h.type].forEach(m=>{let g=h[m].flat(1/0);r=r.concat(this.walkTokens(g,l))}):h.tokens&&(r=r.concat(this.walkTokens(h.tokens,l)))}}return r}use(...n){let l=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(r=>{let c={...r};if(c.async=this.defaults.async||c.async||!1,r.extensions&&(r.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let d=l.renderers[o.name];d?l.renderers[o.name]=function(...h){let m=o.renderer.apply(this,h);return m===!1&&(m=d.apply(this,h)),m}:l.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 d=l[o.level];d?d.unshift(o.tokenizer):l[o.level]=[o.tokenizer],o.start&&(o.level==="block"?l.startBlock?l.startBlock.push(o.start):l.startBlock=[o.start]:o.level==="inline"&&(l.startInline?l.startInline.push(o.start):l.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(l.childTokens[o.name]=o.childTokens)}),c.extensions=l),r.renderer){let o=this.defaults.renderer||new nf(this.defaults);for(let d in r.renderer){if(!(d in o))throw new Error(`renderer '${d}' does not exist`);if(["options","parser"].includes(d))continue;let h=d,m=r.renderer[h],g=o[h];o[h]=(...x)=>{let y=m.apply(o,x);return y===!1&&(y=g.apply(o,x)),y||""}}c.renderer=o}if(r.tokenizer){let o=this.defaults.tokenizer||new tf(this.defaults);for(let d in r.tokenizer){if(!(d in o))throw new Error(`tokenizer '${d}' does not exist`);if(["options","rules","lexer"].includes(d))continue;let h=d,m=r.tokenizer[h],g=o[h];o[h]=(...x)=>{let y=m.apply(o,x);return y===!1&&(y=g.apply(o,x)),y}}c.tokenizer=o}if(r.hooks){let o=this.defaults.hooks||new cu;for(let d in r.hooks){if(!(d in o))throw new Error(`hook '${d}' does not exist`);if(["options","block"].includes(d))continue;let h=d,m=r.hooks[h],g=o[h];cu.passThroughHooks.has(d)?o[h]=x=>{if(this.defaults.async&&cu.passThroughHooksRespectAsync.has(d))return(async()=>{let j=await m.call(o,x);return g.call(o,j)})();let y=m.call(o,x);return g.call(o,y)}:o[h]=(...x)=>{if(this.defaults.async)return(async()=>{let j=await m.apply(o,x);return j===!1&&(j=await g.apply(o,x)),j})();let y=m.apply(o,x);return y===!1&&(y=g.apply(o,x)),y}}c.hooks=o}if(r.walkTokens){let o=this.defaults.walkTokens,d=r.walkTokens;c.walkTokens=function(h){let m=[];return m.push(d.call(this,h)),o&&(m=m.concat(o.call(this,h))),m}}this.defaults={...this.defaults,...c}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,l){return ql.lex(n,l??this.defaults)}parser(n,l){return Gl.parse(n,l??this.defaults)}parseMarkdown(n){return(l,r)=>{let c={...r},o={...this.defaults,...c},d=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&c.async===!1)return d(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 l>"u"||l===null)return d(new Error("marked(): input parameter is undefined or null"));if(typeof l!="string")return d(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(l)+", 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(l):l,m=await(o.hooks?await o.hooks.provideLexer(n):n?ql.lex:ql.lexInline)(h,o),g=o.hooks?await o.hooks.processAllTokens(m):m;o.walkTokens&&await Promise.all(this.walkTokens(g,o.walkTokens));let x=await(o.hooks?await o.hooks.provideParser(n):n?Gl.parse:Gl.parseInline)(g,o);return o.hooks?await o.hooks.postprocess(x):x})().catch(d);try{o.hooks&&(l=o.hooks.preprocess(l));let h=(o.hooks?o.hooks.provideLexer(n):n?ql.lex:ql.lexInline)(l,o);o.hooks&&(h=o.hooks.processAllTokens(h)),o.walkTokens&&this.walkTokens(h,o.walkTokens);let m=(o.hooks?o.hooks.provideParser(n):n?Gl.parse:Gl.parseInline)(h,o);return o.hooks&&(m=o.hooks.postprocess(m)),m}catch(h){return d(h)}}}onError(n,l){return r=>{if(r.message+=`
|
|
114
|
-
Please report this to https://github.com/markedjs/marked.`,n){let c="<p>An error occurred:</p><pre>"+ga(r.message+"",!0)+"</pre>";return l?Promise.resolve(c):c}if(l)return Promise.reject(r);throw r}}},Gr=new Lj;function Ot(n,l){return Gr.parse(n,l)}Ot.options=Ot.setOptions=function(n){return Gr.setOptions(n),Ot.defaults=Gr.defaults,K_(Ot.defaults),Ot};Ot.getDefaults=qp;Ot.defaults=Yr;Ot.use=function(...n){return Gr.use(...n),Ot.defaults=Gr.defaults,K_(Ot.defaults),Ot};Ot.walkTokens=function(n,l){return Gr.walkTokens(n,l)};Ot.parseInline=Gr.parseInline;Ot.Parser=Gl;Ot.parser=Gl.parse;Ot.Renderer=nf;Ot.TextRenderer=Fp;Ot.Lexer=ql;Ot.lexer=ql.lex;Ot.Tokenizer=tf;Ot.Hooks=cu;Ot.parse=Ot;Ot.options;Ot.setOptions;Ot.use;Ot.walkTokens;Ot.parseInline;Gl.parse;ql.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 db(n,l){(l==null||l>n.length)&&(l=n.length);for(var r=0,c=Array(l);r<l;r++)c[r]=n[r];return c}function zj(n){if(Array.isArray(n))return n}function Uj(n,l){var r=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(r!=null){var c,o,d,h,m=[],g=!0,x=!1;try{if(d=(r=r.call(n)).next,l!==0)for(;!(g=(c=d.call(r)).done)&&(m.push(c.value),m.length!==l);g=!0);}catch(y){x=!0,o=y}finally{try{if(!g&&r.return!=null&&(h=r.return(),Object(h)!==h))return}finally{if(x)throw o}}return m}}function Hj(){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 Bj(n,l){return zj(n)||Uj(n,l)||Ij(n,l)||Hj()}function Ij(n,l){if(n){if(typeof n=="string")return db(n,l);var r={}.toString.call(n).slice(8,-1);return r==="Object"&&n.constructor&&(r=n.constructor.name),r==="Map"||r==="Set"?Array.from(n):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?db(n,l):void 0}}const ly=Object.entries,fb=Object.setPrototypeOf,$j=Object.isFrozen,qj=Object.getPrototypeOf,Gj=Object.getOwnPropertyDescriptor;let ds=Object.freeze,fs=Object.seal,Uc=Object.create,ay=typeof Reflect<"u"&&Reflect,Ep=ay.apply,Tp=ay.construct;ds||(ds=function(l){return l});fs||(fs=function(l){return l});Ep||(Ep=function(l,r){for(var c=arguments.length,o=new Array(c>2?c-2:0),d=2;d<c;d++)o[d-2]=arguments[d];return l.apply(r,o)});Tp||(Tp=function(l){for(var r=arguments.length,c=new Array(r>1?r-1:0),o=1;o<r;o++)c[o-1]=arguments[o];return new l(...c)});const Lc=In(Array.prototype.forEach),Yj=In(Array.prototype.lastIndexOf),hb=In(Array.prototype.pop),zc=In(Array.prototype.push),Xj=In(Array.prototype.splice),Wi=Array.isArray,ou=In(String.prototype.toLowerCase),ap=In(String.prototype.toString),pb=In(String.prototype.match),su=In(String.prototype.replace),mb=In(String.prototype.indexOf),Vj=In(String.prototype.trim),Qj=In(Number.prototype.toString),Kj=In(Boolean.prototype.toString),gb=typeof BigInt>"u"?null:In(BigInt.prototype.toString),xb=typeof Symbol>"u"?null:In(Symbol.prototype.toString),es=In(Object.prototype.hasOwnProperty),lu=In(Object.prototype.toString),Pn=In(RegExp.prototype.test),Cr=Zj(TypeError);function In(n){return function(l){l instanceof RegExp&&(l.lastIndex=0);for(var r=arguments.length,c=new Array(r>1?r-1:0),o=1;o<r;o++)c[o-1]=arguments[o];return Ep(n,l,c)}}function Zj(n){return function(){for(var l=arguments.length,r=new Array(l),c=0;c<l;c++)r[c]=arguments[c];return Tp(n,r)}}function yt(n,l){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ou;if(fb&&fb(n,null),!Wi(l))return n;let c=l.length;for(;c--;){let o=l[c];if(typeof o=="string"){const d=r(o);d!==o&&($j(l)||(l[c]=d),o=d)}n[o]=!0}return n}function Fj(n){for(let l=0;l<n.length;l++)es(n,l)||(n[l]=null);return n}function zs(n){const l=Uc(null);for(const c of ly(n)){var r=Bj(c,2);const o=r[0],d=r[1];es(n,o)&&(Wi(d)?l[o]=Fj(d):d&&typeof d=="object"&&d.constructor===Object?l[o]=zs(d):l[o]=d)}return l}function Jj(n){switch(typeof n){case"string":return n;case"number":return Qj(n);case"boolean":return Kj(n);case"bigint":return gb?gb(n):"0";case"symbol":return xb?xb(n):"Symbol()";case"undefined":return lu(n);case"function":case"object":{if(n===null)return lu(n);const l=n,r=xa(l,"toString");if(typeof r=="function"){const c=r(l);return typeof c=="string"?c:lu(c)}return lu(n)}default:return lu(n)}}function xa(n,l){for(;n!==null;){const c=Gj(n,l);if(c){if(c.get)return In(c.get);if(typeof c.value=="function")return In(c.value)}n=qj(n)}function r(){return null}return r}function Wj(n){try{return Pn(n,""),!0}catch{return!1}}const bb=ds(["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"]),ip=ds(["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"]),rp=ds(["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"]),Pj=ds(["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"]),cp=ds(["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"]),e1=ds(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),_b=ds(["#text"]),yb=ds(["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"]),op=ds(["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"]),vb=ds(["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"]),Cd=ds(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),t1=fs(/{{[\w\W]*|^[\w\W]*}}/g),n1=fs(/<%[\w\W]*|^[\w\W]*%>/g),s1=fs(/\${[\w\W]*/g),l1=fs(/^data-[\-\w.\u00B7-\uFFFF]+$/),a1=fs(/^aria-[\-\w]+$/),jb=fs(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),i1=fs(/^(?:\w+script|data):/i),r1=fs(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),c1=fs(/^html$/i),o1=fs(/^[a-z][.\w]*(-[.\w]+)+$/i),Nb=fs(/<[/\w!]/g),wb=fs(/<[/\w]/g),u1=fs(/<\/no(script|embed|frames)/i),d1=fs(/\/>/i),rl={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},f1=function(){return typeof window>"u"?null:window},h1=function(l,r){if(typeof l!="object"||typeof l.createPolicy!="function")return null;let c=null;const o="data-tt-policy-suffix";r&&r.hasAttribute(o)&&(c=r.getAttribute(o));const d="dompurify"+(c?"#"+c:"");try{return l.createPolicy(d,{createHTML(h){return h},createScriptURL(h){return h}})}catch{return console.warn("TrustedTypes policy "+d+" could not be created."),null}},kb=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Xi=function(l,r,c,o){return es(l,r)&&Wi(l[r])?yt(o.base?zs(o.base):{},l[r],o.transform):c};function iy(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:f1();const l=Ne=>iy(Ne);if(l.version="3.4.12",l.removed=[],!n||!n.document||n.document.nodeType!==rl.document||!n.Element)return l.isSupported=!1,l;let r=n.document;const c=r,o=c.currentScript;n.DocumentFragment;const d=n.HTMLTemplateElement,h=n.Node,m=n.Element,g=n.NodeFilter,x=n.NamedNodeMap;x===void 0&&(n.NamedNodeMap||n.MozNamedAttrMap),n.HTMLFormElement;const y=n.DOMParser,j=n.trustedTypes,v=m.prototype,T=xa(v,"cloneNode"),w=xa(v,"remove"),A=xa(v,"nextSibling"),C=xa(v,"childNodes"),F=xa(v,"parentNode"),Q=xa(v,"shadowRoot"),I=xa(v,"attributes"),L=h&&h.prototype?xa(h.prototype,"nodeType"):null,G=h&&h.prototype?xa(h.prototype,"nodeName"):null;if(typeof d=="function"){const Ne=r.createElement("template");Ne.content&&Ne.content.ownerDocument&&(r=Ne.content.ownerDocument)}let M,z="",O,P=!1,U=0;const B=function(){if(U>0)throw Cr('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.')},J=function(S){B(),U++;try{return M.createHTML(S)}finally{U--}},me=function(S){B(),U++;try{return M.createScriptURL(S)}finally{U--}},we=function(){return P||(O=h1(j,o),P=!0),O},ve=r,$=ve.implementation,Y=ve.createNodeIterator,W=ve.createDocumentFragment,he=ve.getElementsByTagName,Se=c.importNode;let k=kb();l.isSupported=typeof ly=="function"&&typeof F=="function"&&$&&$.createHTMLDocument!==void 0;const se=t1,q=n1,je=s1,te=l1,ke=a1,De=i1,Ge=r1,He=o1;let bt=jb,Ve=null;const fn=yt({},[...bb,...ip,...rp,...cp,..._b]);let We=null;const at=yt({},[...yb,...op,...vb,...Cd]);let ct=Object.seal(Uc(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}})),jt=null,ut=null;const $t=Object.seal(Uc(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let wt=!0,Ce=!0,Pe=!1,Rt=!0,dt=!1,Fe=!0,bn=!1,ts=!1,Lt=null,kt=null,hs=!1,hn=!1,tn=!1,ps=!1,_n=!0,Ft=!1;const Cn="user-content-";let zt=!0,Tt=!1,re={},ye=null;const Xe=yt({},["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 it=null;const Je=yt({},["audio","video","img","source","image","track"]);let nn=null;const Z=yt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),fe="http://www.w3.org/1998/Math/MathML",Me="http://www.w3.org/2000/svg",$e="http://www.w3.org/1999/xhtml";let Dt=$e,pn=!1,An=null;const Fs=yt({},[fe,Me,$e],ap),yn=ds(["mi","mo","mn","ms","mtext"]);let cl=yt({},yn);const ws=ds(["annotation-xml"]);let ns=yt({},ws);const Vl=yt({},["title","style","font","a","script"]);let ks=null;const Us=["application/xhtml+xml","text/html"],sn="text/html";let et=null,$n=null;const ol=r.createElement("form"),Js=function(S){return S instanceof RegExp||S instanceof Function},Mn=function(){let S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if($n&&$n===S)return;(!S||typeof S!="object")&&(S={}),S=zs(S),ks=Us.indexOf(S.PARSER_MEDIA_TYPE)===-1?sn:S.PARSER_MEDIA_TYPE,et=ks==="application/xhtml+xml"?ap:ou,Ve=Xi(S,"ALLOWED_TAGS",fn,{transform:et}),We=Xi(S,"ALLOWED_ATTR",at,{transform:et}),An=Xi(S,"ALLOWED_NAMESPACES",Fs,{transform:ap}),nn=Xi(S,"ADD_URI_SAFE_ATTR",Z,{transform:et,base:Z}),it=Xi(S,"ADD_DATA_URI_TAGS",Je,{transform:et,base:Je}),ye=Xi(S,"FORBID_CONTENTS",Xe,{transform:et}),jt=Xi(S,"FORBID_TAGS",zs({}),{transform:et}),ut=Xi(S,"FORBID_ATTR",zs({}),{transform:et}),re=es(S,"USE_PROFILES")?S.USE_PROFILES&&typeof S.USE_PROFILES=="object"?zs(S.USE_PROFILES):S.USE_PROFILES:!1,wt=S.ALLOW_ARIA_ATTR!==!1,Ce=S.ALLOW_DATA_ATTR!==!1,Pe=S.ALLOW_UNKNOWN_PROTOCOLS||!1,Rt=S.ALLOW_SELF_CLOSE_IN_ATTR!==!1,dt=S.SAFE_FOR_TEMPLATES||!1,Fe=S.SAFE_FOR_XML!==!1,bn=S.WHOLE_DOCUMENT||!1,hn=S.RETURN_DOM||!1,tn=S.RETURN_DOM_FRAGMENT||!1,ps=S.RETURN_TRUSTED_TYPE||!1,hs=S.FORCE_BODY||!1,_n=S.SANITIZE_DOM!==!1,Ft=S.SANITIZE_NAMED_PROPS||!1,zt=S.KEEP_CONTENT!==!1,Tt=S.IN_PLACE||!1,bt=Wj(S.ALLOWED_URI_REGEXP)?S.ALLOWED_URI_REGEXP:jb,Dt=typeof S.NAMESPACE=="string"?S.NAMESPACE:$e,cl=es(S,"MATHML_TEXT_INTEGRATION_POINTS")&&S.MATHML_TEXT_INTEGRATION_POINTS&&typeof S.MATHML_TEXT_INTEGRATION_POINTS=="object"?zs(S.MATHML_TEXT_INTEGRATION_POINTS):yt({},yn),ns=es(S,"HTML_INTEGRATION_POINTS")&&S.HTML_INTEGRATION_POINTS&&typeof S.HTML_INTEGRATION_POINTS=="object"?zs(S.HTML_INTEGRATION_POINTS):yt({},ws);const ee=es(S,"CUSTOM_ELEMENT_HANDLING")&&S.CUSTOM_ELEMENT_HANDLING&&typeof S.CUSTOM_ELEMENT_HANDLING=="object"?zs(S.CUSTOM_ELEMENT_HANDLING):Uc(null);if(ct=Uc(null),es(ee,"tagNameCheck")&&Js(ee.tagNameCheck)&&(ct.tagNameCheck=ee.tagNameCheck),es(ee,"attributeNameCheck")&&Js(ee.attributeNameCheck)&&(ct.attributeNameCheck=ee.attributeNameCheck),es(ee,"allowCustomizedBuiltInElements")&&typeof ee.allowCustomizedBuiltInElements=="boolean"&&(ct.allowCustomizedBuiltInElements=ee.allowCustomizedBuiltInElements),fs(ct),dt&&(Ce=!1),tn&&(hn=!0),re&&(Ve=yt({},_b),We=Uc(null),re.html===!0&&(yt(Ve,bb),yt(We,yb)),re.svg===!0&&(yt(Ve,ip),yt(We,op),yt(We,Cd)),re.svgFilters===!0&&(yt(Ve,rp),yt(We,op),yt(We,Cd)),re.mathMl===!0&&(yt(Ve,cp),yt(We,vb),yt(We,Cd))),$t.tagCheck=null,$t.attributeCheck=null,es(S,"ADD_TAGS")&&(typeof S.ADD_TAGS=="function"?$t.tagCheck=S.ADD_TAGS:Wi(S.ADD_TAGS)&&(Ve===fn&&(Ve=zs(Ve)),yt(Ve,S.ADD_TAGS,et))),es(S,"ADD_ATTR")&&(typeof S.ADD_ATTR=="function"?$t.attributeCheck=S.ADD_ATTR:Wi(S.ADD_ATTR)&&(We===at&&(We=zs(We)),yt(We,S.ADD_ATTR,et))),es(S,"ADD_URI_SAFE_ATTR")&&Wi(S.ADD_URI_SAFE_ATTR)&&yt(nn,S.ADD_URI_SAFE_ATTR,et),es(S,"FORBID_CONTENTS")&&Wi(S.FORBID_CONTENTS)&&(ye===Xe&&(ye=zs(ye)),yt(ye,S.FORBID_CONTENTS,et)),es(S,"ADD_FORBID_CONTENTS")&&Wi(S.ADD_FORBID_CONTENTS)&&(ye===Xe&&(ye=zs(ye)),yt(ye,S.ADD_FORBID_CONTENTS,et)),zt&&(Ve["#text"]=!0),bn&&yt(Ve,["html","head","body"]),Ve.table&&(yt(Ve,["tbody"]),delete jt.tbody),S.TRUSTED_TYPES_POLICY){if(typeof S.TRUSTED_TYPES_POLICY.createHTML!="function")throw Cr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof S.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Cr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const ge=M;M=S.TRUSTED_TYPES_POLICY;try{z=J("")}catch(Ee){throw M=ge,Ee}}else S.TRUSTED_TYPES_POLICY===null?(M=void 0,z=""):(M===void 0&&(M=we()),M&&typeof z=="string"&&(z=J("")));ds&&ds(S),$n=S},ka=yt({},[...ip,...rp,...Pj]),ss=yt({},[...cp,...e1]),ms=function(S,ee,ge){return ee.namespaceURI===$e?S==="svg":ee.namespaceURI===fe?S==="svg"&&(ge==="annotation-xml"||cl[ge]):!!ka[S]},Ss=function(S,ee,ge){return ee.namespaceURI===$e?S==="math":ee.namespaceURI===Me?S==="math"&&ns[ge]:!!ss[S]},Rn=function(S,ee,ge){return ee.namespaceURI===Me&&!ns[ge]||ee.namespaceURI===fe&&!cl[ge]?!1:!ss[S]&&(Vl[S]||!ka[S])},gs=function(S){let ee=F(S);(!ee||!ee.tagName)&&(ee={namespaceURI:Dt,tagName:"template"});const ge=ou(S.tagName),Ee=ou(ee.tagName);return An[S.namespaceURI]?S.namespaceURI===Me?ms(ge,ee,Ee):S.namespaceURI===fe?Ss(ge,ee,Ee):S.namespaceURI===$e?Rn(ge,ee,Ee):!!(ks==="application/xhtml+xml"&&An[S.namespaceURI]):!1},ln=function(S){zc(l.removed,{element:S});try{F(S).removeChild(S)}catch{if(w(S),!F(S))throw Cr("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},tt=function(S){ls(S);const ee=C(S);if(ee){const Ee=[];Lc(ee,Le=>{zc(Ee,Le)}),Lc(Ee,Le=>{try{w(Le)}catch{}})}const ge=I(S);if(ge)for(let Ee=ge.length-1;Ee>=0;--Ee){const Le=ge[Ee],Oe=Le&&Le.name;if(typeof Oe=="string")try{S.removeAttribute(Oe)}catch{}}},Kn=function(S,ee){try{zc(l.removed,{attribute:ee.getAttributeNode(S),from:ee})}catch{zc(l.removed,{attribute:null,from:ee})}if(ee.removeAttribute(S),S==="is")if(hn||tn)try{ln(ee)}catch{}else try{ee.setAttribute(S,"")}catch{}},vn=function(S){const ee=I(S);if(ee)for(let ge=ee.length-1;ge>=0;--ge){const Ee=ee[ge],Le=Ee&&Ee.name;if(!(typeof Le!="string"||We[et(Le)]))try{S.removeAttribute(Le)}catch{}}},ls=function(S){const ee=[S];for(;ee.length>0;){const ge=ee.pop();(L?L(ge):ge.nodeType)===rl.element&&vn(ge);const Le=C(ge);if(Le)for(let Oe=Le.length-1;Oe>=0;--Oe)ee.push(Le[Oe])}},_t=function(S){if(!Fe)return;const ee=[S];for(;ee.length>0;){const ge=ee.pop(),Ee=L?L(ge):ge.nodeType;if(Ee===rl.processingInstruction||Ee===rl.comment&&Pn(wb,ge.data)){try{w(ge)}catch{}continue}if(Ee===rl.element){const Oe=ge,Ct=et(G?G(ge):ge.nodeName);try{Oe.hasAttribute&&Oe.hasAttribute("patchsrc")&&Oe.removeAttribute("patchsrc"),Oe.hasAttribute&&Oe.hasAttribute("for")&&Ct!=="label"&&Ct!=="output"&&Oe.removeAttribute("for")}catch{}}const Le=C(ge);if(Le)for(let Oe=Le.length-1;Oe>=0;--Oe)ee.push(Le[Oe])}},wl=function(S){let ee=null,ge=null;if(hs)S="<remove></remove>"+S;else{const Oe=pb(S,/^[\r\n\t ]+/);ge=Oe&&Oe[0]}ks==="application/xhtml+xml"&&Dt===$e&&(S='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+S+"</body></html>");const Ee=M?J(S):S;if(Dt===$e)try{ee=new y().parseFromString(Ee,ks)}catch{}if(!ee||!ee.documentElement){ee=$.createDocument(Dt,"template",null);try{ee.documentElement.innerHTML=pn?z:Ee}catch{}}const Le=ee.body||ee.documentElement;return S&&ge&&Le.insertBefore(r.createTextNode(ge),Le.childNodes[0]||null),Dt===$e?he.call(ee,bn?"html":"body")[0]:bn?ee.documentElement:Le},qn=function(S){return Y.call(S.ownerDocument||S,S,g.SHOW_ELEMENT|g.SHOW_COMMENT|g.SHOW_TEXT|g.SHOW_PROCESSING_INSTRUCTION|g.SHOW_CDATA_SECTION,null)},Ws=function(S){return S=su(S,se," "),S=su(S,q," "),S=su(S,je," "),S},as=function(S){var ee;S.normalize();const ge=Y.call(S.ownerDocument||S,S,g.SHOW_TEXT|g.SHOW_COMMENT|g.SHOW_CDATA_SECTION|g.SHOW_PROCESSING_INSTRUCTION,null);let Ee=ge.nextNode();for(;Ee;)Ee.data=Ws(Ee.data),Ee=ge.nextNode();const Le=(ee=S.querySelectorAll)===null||ee===void 0?void 0:ee.call(S,"template");Le&&Lc(Le,Oe=>{Gn(Oe.content)&&as(Oe.content)})},Zn=function(S){const ee=G?G(S):null;return typeof ee!="string"||et(ee)!=="form"?!1:typeof S.nodeName!="string"||typeof S.textContent!="string"||typeof S.removeChild!="function"||S.attributes!==I(S)||typeof S.removeAttribute!="function"||typeof S.setAttribute!="function"||typeof S.namespaceURI!="string"||typeof S.insertBefore!="function"||typeof S.hasChildNodes!="function"||S.nodeType!==L(S)||S.childNodes!==C(S)},Gn=function(S){if(!L||typeof S!="object"||S===null)return!1;try{return L(S)===rl.documentFragment}catch{return!1}},ft=function(S){if(!L||typeof S!="object"||S===null)return!1;try{return typeof L(S)=="number"}catch{return!1}};function Nt(Ne,S,ee){Ne.length!==0&&Lc(Ne,ge=>{ge.call(l,S,ee,$n)})}const jn=function(S,ee){return!!(Fe&&S.hasChildNodes()&&!ft(S.firstElementChild)&&Pn(Nb,S.textContent)&&Pn(Nb,S.innerHTML)||Fe&&S.namespaceURI===$e&&ee==="style"&&ft(S.firstElementChild)||S.nodeType===rl.processingInstruction||Fe&&S.nodeType===rl.comment&&Pn(wb,S.data))},ri=function(S,ee){if(!jt[ee]&&ci(ee)&&(ct.tagNameCheck instanceof RegExp&&Pn(ct.tagNameCheck,ee)||ct.tagNameCheck instanceof Function&&ct.tagNameCheck(ee)))return!1;if(zt&&!ye[ee]){const ge=F(S),Ee=C(S);if(Ee&&ge){const Le=Ee.length;for(let Oe=Le-1;Oe>=0;--Oe){const Ct=Tt?Ee[Oe]:T(Ee[Oe],!0);ge.insertBefore(Ct,A(S))}}}return ln(S),!0},Es=function(S,ee){if(Nt(k.beforeSanitizeElements,S,null),S!==ee&&F(S)===null)return!0;if(Zn(S))return ln(S),!0;const ge=et(G?G(S):S.nodeName);if(Nt(k.uponSanitizeElement,S,{tagName:ge,allowedTags:Ve}),S!==ee&&F(S)===null)return!0;if(jn(S,ge))return ln(S),!0;if(jt[ge]||!($t.tagCheck instanceof Function&&$t.tagCheck(ge))&&!Ve[ge]){const Le=ri(S,ge);return Le===!1&&Nt(k.afterSanitizeElements,S,null),Le}if((L?L(S):S.nodeType)===rl.element&&!gs(S)||(ge==="noscript"||ge==="noembed"||ge==="noframes")&&Pn(u1,S.innerHTML))return ln(S),!0;if(dt&&S.nodeType===rl.text){const Le=Ws(S.textContent);S.textContent!==Le&&(zc(l.removed,{element:S.cloneNode()}),S.textContent=Le)}return Nt(k.afterSanitizeElements,S,null),!1},ul=function(S,ee,ge){if(ut[ee]||Fe&&ee==="patchsrc"||Fe&&ee==="for"&&S!=="label"&&S!=="output"||_n&&(ee==="id"||ee==="name")&&(ge in r||ge in ol))return!1;const Ee=We[ee]||$t.attributeCheck instanceof Function&&$t.attributeCheck(ee,S);if(!(Ce&&Pn(te,ee))){if(!(wt&&Pn(ke,ee))){if(Ee){if(!nn[ee]){if(!Pn(bt,su(ge,Ge,""))){if(!((ee==="src"||ee==="xlink:href"||ee==="href")&&S!=="script"&&mb(ge,"data:")===0&&it[S])){if(!(Pe&&!Pn(De,su(ge,Ge,"")))){if(ge)return!1}}}}}else if(!(ci(S)&&(ct.tagNameCheck instanceof RegExp&&Pn(ct.tagNameCheck,S)||ct.tagNameCheck instanceof Function&&ct.tagNameCheck(S))&&(ct.attributeNameCheck instanceof RegExp&&Pn(ct.attributeNameCheck,ee)||ct.attributeNameCheck instanceof Function&&ct.attributeNameCheck(ee,S))||ee==="is"&&ct.allowCustomizedBuiltInElements&&(ct.tagNameCheck instanceof RegExp&&Pn(ct.tagNameCheck,ge)||ct.tagNameCheck instanceof Function&&ct.tagNameCheck(ge))))return!1}}return!0},Ql=yt({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),ci=function(S){return!Ql[ou(S)]&&Pn(He,S)},Dn=function(S,ee,ge,Ee){if(M&&typeof j=="object"&&typeof j.getAttributeType=="function"&&!ge)switch(j.getAttributeType(S,ee)){case"TrustedHTML":return J(Ee);case"TrustedScriptURL":return me(Ee)}return Ee},is=function(S,ee,ge,Ee){try{ge?S.setAttributeNS(ge,ee,Ee):S.setAttribute(ee,Ee),Zn(S)?ln(S):hb(l.removed)}catch{Kn(ee,S)}},Hs=function(S){Nt(k.beforeSanitizeAttributes,S,null);const ee=S.attributes;if(!ee||Zn(S))return;const ge={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:We,forceKeepAttr:void 0};let Ee=ee.length;const Le=et(S.nodeName);for(;Ee--;){const Oe=ee[Ee],Ct=Oe.name,an=Oe.namespaceURI,Nn=Oe.value,Ut=et(Ct),zn=Nn;let mn=Ct==="value"?zn:Vj(zn);if(ge.attrName=Ut,ge.attrValue=mn,ge.keepAttr=!0,ge.forceKeepAttr=void 0,Nt(k.uponSanitizeAttribute,S,ge),mn=ge.attrValue,Ft&&(Ut==="id"||Ut==="name")&&mb(mn,Cn)!==0&&(Kn(Ct,S),mn=Cn+mn),Fe&&Pn(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,mn)){Kn(Ct,S);continue}if(Ut==="attributename"&&pb(mn,"href")){Kn(Ct,S);continue}if(!ge.forceKeepAttr){if(!ge.keepAttr){Kn(Ct,S);continue}if(!Rt&&Pn(d1,mn)){Kn(Ct,S);continue}if(dt&&(mn=Ws(mn)),!ul(Le,Ut,mn)){Kn(Ct,S);continue}mn=Dn(Le,Ut,an,mn),mn!==zn&&is(S,Ct,an,mn)}}Nt(k.afterSanitizeAttributes,S,null)},qt=function(S){let ee=null;const ge=qn(S);for(Nt(k.beforeSanitizeShadowDOM,S,null);ee=ge.nextNode();)if(Nt(k.uponSanitizeShadowNode,ee,null),Es(ee,S),Hs(ee),Gn(ee.content)&&qt(ee.content),(L?L(ee):ee.nodeType)===rl.element){const Le=Q(ee);Gn(Le)&&(Ts(Le),qt(Le))}Nt(k.afterSanitizeShadowDOM,S,null)},Ts=function(S){const ee=[{node:S,shadow:null}];for(;ee.length>0;){const ge=ee.pop();if(ge.shadow){qt(ge.shadow);continue}const Ee=ge.node,Oe=(L?L(Ee):Ee.nodeType)===rl.element,Ct=C(Ee);if(Ct)for(let an=Ct.length-1;an>=0;--an)ee.push({node:Ct[an],shadow:null});if(Oe){const an=G?G(Ee):null;if(typeof an=="string"&&et(an)==="template"){const Nn=Ee.content;Gn(Nn)&&ee.push({node:Nn,shadow:null})}}if(Oe){const an=Q(Ee);Gn(an)&&ee.push({node:null,shadow:an},{node:an,shadow:null})}}};return l.sanitize=function(Ne){let S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ee=null,ge=null,Ee=null,Le=null;if(pn=!Ne,pn&&(Ne="<!-->"),typeof Ne!="string"&&!ft(Ne)&&(Ne=Jj(Ne),typeof Ne!="string"))throw Cr("dirty is not a string, aborting");if(!l.isSupported)return Ne;ts?(Ve=Lt,We=kt):Mn(S),(k.uponSanitizeElement.length>0||k.uponSanitizeAttribute.length>0)&&(Ve=zs(Ve)),k.uponSanitizeAttribute.length>0&&(We=zs(We)),l.removed=[];const Oe=Tt&&typeof Ne!="string"&&ft(Ne);if(Oe){_t(Ne);const Ut=G?G(Ne):Ne.nodeName;if(typeof Ut=="string"){const zn=et(Ut);if(!Ve[zn]||jt[zn])throw tt(Ne),Cr("root node is forbidden and cannot be sanitized in-place")}if(Zn(Ne))throw tt(Ne),Cr("root node is clobbered and cannot be sanitized in-place");try{Ts(Ne)}catch(zn){throw tt(Ne),zn}}else if(ft(Ne))ee=wl("<!---->"),ge=ee.ownerDocument.importNode(Ne,!0),ge.nodeType===rl.element&&ge.nodeName==="BODY"||ge.nodeName==="HTML"?ee=ge:ee.appendChild(ge),Ts(ge);else{if(!hn&&!dt&&!bn&&Ne.indexOf("<")===-1)return M&&ps?J(Ne):Ne;if(ee=wl(Ne),!ee)return hn?null:ps?z:""}ee&&hs&&ln(ee.firstChild);const Ct=Oe?Ne:ee,an=qn(Ct);try{for(;Ee=an.nextNode();)Es(Ee,Ct),Hs(Ee),Gn(Ee.content)&&qt(Ee.content)}catch(Ut){throw Oe&&(tt(Ne),Lc(l.removed,zn=>{zn.element&&ls(zn.element)})),Ut}if(Oe)return Lc(l.removed,Ut=>{Ut.element&&ls(Ut.element)}),dt&&as(Ne),Ne;if(hn){if(dt&&as(ee),tn)for(Le=W.call(ee.ownerDocument);ee.firstChild;)Le.appendChild(ee.firstChild);else Le=ee;return(We.shadowroot||We.shadowrootmode)&&(Le=Se.call(c,Le,!0)),Le}let Nn=bn?ee.outerHTML:ee.innerHTML;return bn&&Ve["!doctype"]&&ee.ownerDocument&&ee.ownerDocument.doctype&&ee.ownerDocument.doctype.name&&Pn(c1,ee.ownerDocument.doctype.name)&&(Nn="<!DOCTYPE "+ee.ownerDocument.doctype.name+`>
|
|
116
|
-
`+Nn),dt&&(Nn=Ws(Nn)),M&&ps?J(Nn):Nn},l.setConfig=function(){let Ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Mn(Ne),ts=!0,Lt=Ve,kt=We},l.clearConfig=function(){$n=null,ts=!1,Lt=null,kt=null,M=O,z=""},l.isValidAttribute=function(Ne,S,ee){$n||Mn({});const ge=et(Ne),Ee=et(S);return ul(ge,Ee,ee)},l.addHook=function(Ne,S){typeof S=="function"&&es(k,Ne)&&zc(k[Ne],S)},l.removeHook=function(Ne,S){if(es(k,Ne)){if(S!==void 0){const ee=Yj(k[Ne],S);return ee===-1?void 0:Xj(k[Ne],ee,1)[0]}return hb(k[Ne])}},l.removeHooks=function(Ne){es(k,Ne)&&(k[Ne]=[])},l.removeAllHooks=function(){k=kb()},l}var p1=iy();const m1=1024;let g1=0;class Nl{constructor(l,r){this.from=l,this.to=r}}class en{constructor(l={}){this.id=g1++,this.perNode=!!l.perNode,this.deserialize=l.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=l.combine||null}add(l){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof l!="function"&&(l=Xl.match(l)),r=>{let c=l(r);return c===void 0?null:[this,c]}}}en.closedBy=new en({deserialize:n=>n.split(" ")});en.openedBy=new en({deserialize:n=>n.split(" ")});en.group=new en({deserialize:n=>n.split(" ")});en.isolate=new en({deserialize:n=>{if(n&&n!="rtl"&&n!="ltr"&&n!="auto")throw new RangeError("Invalid value for isolate: "+n);return n||"auto"}});en.contextHash=new en({perNode:!0});en.lookAhead=new en({perNode:!0});en.mounted=new en({perNode:!0});class qc{constructor(l,r,c,o=!1){this.tree=l,this.overlay=r,this.parser=c,this.bracketed=o}static get(l){return l&&l.props&&l.props[en.mounted.id]}}const x1=Object.create(null);class Xl{constructor(l,r,c,o=0){this.name=l,this.props=r,this.id=c,this.flags=o}static define(l){let r=l.props&&l.props.length?Object.create(null):x1,c=(l.top?1:0)|(l.skipped?2:0)|(l.error?4:0)|(l.name==null?8:0),o=new Xl(l.name||"",r,l.id,c);if(l.props){for(let d of l.props)if(Array.isArray(d)||(d=d(o)),d){if(d[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");r[d[0].id]=d[1]}}return o}prop(l){return this.props[l.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(l){if(typeof l=="string"){if(this.name==l)return!0;let r=this.prop(en.group);return r?r.indexOf(l)>-1:!1}return this.id==l}static match(l){let r=Object.create(null);for(let c in l)for(let o of c.split(" "))r[o]=l[c];return c=>{for(let o=c.prop(en.group),d=-1;d<(o?o.length:0);d++){let h=r[d<0?c.name:o[d]];if(h)return h}}}}Xl.none=new Xl("",Object.create(null),0,8);class ry{constructor(l){this.types=l;for(let r=0;r<l.length;r++)if(l[r].id!=r)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...l){let r=[];for(let c of this.types){let o=null;for(let d of l){let h=d(c);if(h){o||(o=Object.assign({},c.props));let m=h[1],g=h[0];g.combine&&g.id in o&&(m=g.combine(o[g.id],m)),o[g.id]=m}}r.push(o?new Xl(c.name,o,c.id,c.flags):c)}return new ry(r)}}const Ad=new WeakMap,Sb=new WeakMap;var Wt;(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"})(Wt||(Wt={}));class Zs{constructor(l,r,c,o,d){if(this.type=l,this.children=r,this.positions=c,this.length=o,this.props=null,d&&d.length){this.props=Object.create(null);for(let[h,m]of d)this.props[typeof h=="number"?h:h.id]=m}}toString(){let l=qc.get(this);if(l&&!l.overlay)return l.tree.toString();let r="";for(let c of this.children){let o=c.toString();o&&(r&&(r+=","),r+=o)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(r.length?"("+r+")":""):r}cursor(l=0){return new sf(this.topNode,l)}cursorAt(l,r=0,c=0){let o=Ad.get(this)||this.topNode,d=new sf(o);return d.moveTo(l,r),Ad.set(this,d._tree),d}get topNode(){return new Ns(this,0,0,null)}resolve(l,r=0){let c=gu(Ad.get(this)||this.topNode,l,r,!1);return Ad.set(this,c),c}resolveInner(l,r=0){let c=gu(Sb.get(this)||this.topNode,l,r,!0);return Sb.set(this,c),c}resolveStack(l,r=0){return y1(this,l,r)}iterate(l){let{enter:r,leave:c,from:o=0,to:d=this.length}=l,h=l.mode||0,m=(h&Wt.IncludeAnonymous)>0;for(let g=this.cursor(h|Wt.IncludeAnonymous);;){let x=!1;if(g.from<=d&&g.to>=o&&(!m&&g.type.isAnonymous||r(g)!==!1)){if(g.firstChild())continue;x=!0}for(;x&&c&&(m||!g.type.isAnonymous)&&c(g),!g.nextSibling();){if(!g.parent())return;x=!0}}}prop(l){return l.perNode?this.props?this.props[l.id]:void 0:this.type.prop(l)}get propValues(){let l=[];if(this.props)for(let r in this.props)l.push([+r,this.props[r]]);return l}balance(l={}){return this.children.length<=8?this:Pp(Xl.none,this.children,this.positions,0,this.children.length,0,this.length,(r,c,o)=>new Zs(this.type,r,c,o,this.propValues),l.makeTree||((r,c,o)=>new Zs(Xl.none,r,c,o)))}static build(l){return v1(l)}}Zs.empty=new Zs(Xl.none,[],[],0);class Jp{constructor(l,r){this.buffer=l,this.index=r}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 Jp(this.buffer,this.index)}}class nr{constructor(l,r,c){this.buffer=l,this.length=r,this.set=c}get type(){return Xl.none}toString(){let l=[];for(let r=0;r<this.buffer.length;)l.push(this.childString(r)),r=this.buffer[r+3];return l.join(",")}childString(l){let r=this.buffer[l],c=this.buffer[l+3],o=this.set.types[r],d=o.name;if(/\W/.test(d)&&!o.isError&&(d=JSON.stringify(d)),l+=4,c==l)return d;let h=[];for(;l<c;)h.push(this.childString(l)),l=this.buffer[l+3];return d+"("+h.join(",")+")"}findChild(l,r,c,o,d){let{buffer:h}=this,m=-1;for(let g=l;g!=r&&!(cy(d,o,h[g+1],h[g+2])&&(m=g,c>0));g=h[g+3]);return m}slice(l,r,c){let o=this.buffer,d=new Uint16Array(r-l),h=0;for(let m=l,g=0;m<r;){d[g++]=o[m++],d[g++]=o[m++]-c;let x=d[g++]=o[m++]-c;d[g++]=o[m++]-l,h=Math.max(h,x)}return new nr(d,h,this.set)}}function cy(n,l,r,c){switch(n){case-2:return r<l;case-1:return c>=l&&r<l;case 0:return r<l&&c>l;case 1:return r<=l&&c>l;case 2:return c>l;case 4:return!0}}function gu(n,l,r,c){for(var o;n.from==n.to||(r<1?n.from>=l:n.from>l)||(r>-1?n.to<=l:n.to<l);){let h=!c&&n instanceof Ns&&n.index<0?null:n.parent;if(!h)return n;n=h}let d=c?0:Wt.IgnoreOverlays;if(c)for(let h=n,m=h.parent;m;h=m,m=h.parent)h instanceof Ns&&h.index<0&&((o=m.enter(l,r,d))===null||o===void 0?void 0:o.from)!=h.from&&(n=m);for(;;){let h=n.enter(l,r,d);if(!h)return n;n=h}}class oy{cursor(l=0){return new sf(this,l)}getChild(l,r=null,c=null){let o=Eb(this,l,r,c);return o.length?o[0]:null}getChildren(l,r=null,c=null){return Eb(this,l,r,c)}resolve(l,r=0){return gu(this,l,r,!1)}resolveInner(l,r=0){return gu(this,l,r,!0)}matchContext(l){return Cp(this.parent,l)}enterUnfinishedNodesBefore(l){let r=this.childBefore(l),c=this;for(;r;){let o=r.lastChild;if(!o||o.to!=r.to)break;o.type.isError&&o.from==o.to?(c=r,r=o.prevSibling):r=o}return c}get node(){return this}get next(){return this.parent}}class Ns extends oy{constructor(l,r,c,o){super(),this._tree=l,this.from=r,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(l,r,c,o,d=0){for(let h=this;;){for(let{children:m,positions:g}=h._tree,x=r>0?m.length:-1;l!=x;l+=r){let y=m[l],j=g[l]+h.from,v;if(!(!(d&Wt.EnterBracketed&&y instanceof Zs&&(v=qc.get(y))&&!v.overlay&&v.bracketed&&c>=j&&c<=j+y.length)&&!cy(o,c,j,j+y.length))){if(y instanceof nr){if(d&Wt.ExcludeBuffers)continue;let T=y.findChild(0,y.buffer.length,r,c-j,o);if(T>-1)return new va(new b1(h,y,l,j),null,T)}else if(d&Wt.IncludeAnonymous||!y.type.isAnonymous||Wp(y)){let T;if(!(d&Wt.IgnoreMounts)&&(T=qc.get(y))&&!T.overlay)return new Ns(T.tree,j,l,h);let w=new Ns(y,j,l,h);return d&Wt.IncludeAnonymous||!w.type.isAnonymous?w:w.nextChild(r<0?y.children.length-1:0,r,c,o,d)}}}if(d&Wt.IncludeAnonymous||!h.type.isAnonymous||(h.index>=0?l=h.index+r:l=r<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(l){return this.nextChild(0,1,l,2)}childBefore(l){return this.nextChild(this._tree.children.length-1,-1,l,-2)}prop(l){return this._tree.prop(l)}enter(l,r,c=0){let o;if(!(c&Wt.IgnoreOverlays)&&(o=qc.get(this._tree))&&o.overlay){let d=l-this.from,h=c&Wt.EnterBracketed&&o.bracketed;for(let{from:m,to:g}of o.overlay)if((r>0||h?m<=d:m<d)&&(r<0||h?g>=d:g>d))return new Ns(o.tree,o.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,l,r,c)}nextSignificantParent(){let l=this;for(;l.type.isAnonymous&&l._parent;)l=l._parent;return l}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 Eb(n,l,r,c){let o=n.cursor(),d=[];if(!o.firstChild())return d;if(r!=null){for(let h=!1;!h;)if(h=o.type.is(r),!o.nextSibling())return d}for(;;){if(c!=null&&o.type.is(c))return d;if(o.type.is(l)&&d.push(o.node),!o.nextSibling())return c==null?d:[]}}function Cp(n,l,r=l.length-1){for(let c=n;r>=0;c=c.parent){if(!c)return!1;if(!c.type.isAnonymous){if(l[r]&&l[r]!=c.name)return!1;r--}}return!0}class b1{constructor(l,r,c,o){this.parent=l,this.buffer=r,this.index=c,this.start=o}}class va extends oy{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(l,r,c){super(),this.context=l,this._parent=r,this.index=c,this.type=l.buffer.set.types[l.buffer.buffer[c]]}child(l,r,c){let{buffer:o}=this.context,d=o.findChild(this.index+4,o.buffer[this.index+3],l,r-this.context.start,c);return d<0?null:new va(this.context,this,d)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(l){return this.child(1,l,2)}childBefore(l){return this.child(-1,l,-2)}prop(l){return this.type.prop(l)}enter(l,r,c=0){if(c&Wt.ExcludeBuffers)return null;let{buffer:o}=this.context,d=o.findChild(this.index+4,o.buffer[this.index+3],r>0?1:-1,l-this.context.start,r);return d<0?null:new va(this.context,this,d)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(l){return this._parent?null:this.context.parent.nextChild(this.context.index+l,l,0,4)}get nextSibling(){let{buffer:l}=this.context,r=l.buffer[this.index+3];return r<(this._parent?l.buffer[this._parent.index+3]:l.buffer.length)?new va(this.context,this._parent,r):this.externalSibling(1)}get prevSibling(){let{buffer:l}=this.context,r=this._parent?this._parent.index+4:0;return this.index==r?this.externalSibling(-1):new va(this.context,this._parent,l.findChild(r,this.index,-1,0,4))}get tree(){return null}toTree(){let l=[],r=[],{buffer:c}=this.context,o=this.index+4,d=c.buffer[this.index+3];if(d>o){let h=c.buffer[this.index+1];l.push(c.slice(o,d,h)),r.push(0)}return new Zs(this.type,l,r,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function uy(n){if(!n.length)return null;let l=0,r=n[0];for(let d=1;d<n.length;d++){let h=n[d];(h.from>r.from||h.to<r.to)&&(r=h,l=d)}let c=r instanceof Ns&&r.index<0?null:r.parent,o=n.slice();return c?o[l]=c:o.splice(l,1),new _1(o,r)}class _1{constructor(l,r){this.heads=l,this.node=r}get next(){return uy(this.heads)}}function y1(n,l,r){let c=n.resolveInner(l,r),o=null;for(let d=c instanceof Ns?c:c.context.parent;d;d=d.parent)if(d.index<0){let h=d.parent;(o||(o=[c])).push(h.resolve(l,r)),d=h}else{let h=qc.get(d.tree);if(h&&h.overlay&&h.overlay[0].from<=l&&h.overlay[h.overlay.length-1].to>=l){let m=new Ns(h.tree,h.overlay[0].from+d.from,-1,d);(o||(o=[c])).push(gu(m,l,r,!1))}}return o?uy(o):c}class sf{get name(){return this.type.name}constructor(l,r=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=r&~Wt.EnterBracketed,l instanceof Ns)this.yieldNode(l);else{this._tree=l.context.parent,this.buffer=l.context;for(let c=l._parent;c;c=c._parent)this.stack.unshift(c.index);this.bufferNode=l,this.yieldBuf(l.index)}}yieldNode(l){return l?(this._tree=l,this.type=l.type,this.from=l.from,this.to=l.to,!0):!1}yieldBuf(l,r){this.index=l;let{start:c,buffer:o}=this.buffer;return this.type=r||o.set.types[o.buffer[l]],this.from=c+o.buffer[l+1],this.to=c+o.buffer[l+2],!0}yield(l){return l?l instanceof Ns?(this.buffer=null,this.yieldNode(l)):(this.buffer=l.context,this.yieldBuf(l.index,l.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(l,r,c){if(!this.buffer)return this.yield(this._tree.nextChild(l<0?this._tree._tree.children.length-1:0,l,r,c,this.mode));let{buffer:o}=this.buffer,d=o.findChild(this.index+4,o.buffer[this.index+3],l,r-this.buffer.start,c);return d<0?!1:(this.stack.push(this.index),this.yieldBuf(d))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(l){return this.enterChild(1,l,2)}childBefore(l){return this.enterChild(-1,l,-2)}enter(l,r,c=this.mode){return this.buffer?c&Wt.ExcludeBuffers?!1:this.enterChild(1,l,r):this.yield(this._tree.enter(l,r,c))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Wt.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let l=this.mode&Wt.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(l)}sibling(l){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+l,l,0,4,this.mode)):!1;let{buffer:r}=this.buffer,c=this.stack.length-1;if(l<0){let o=c<0?0:this.stack[c]+4;if(this.index!=o)return this.yieldBuf(r.findChild(o,this.index,-1,0,4))}else{let o=r.buffer[this.index+3];if(o<(c<0?r.buffer.length:r.buffer[this.stack[c]+3]))return this.yieldBuf(o)}return c<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+l,l,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(l){let r,c,{buffer:o}=this;if(o){if(l>0){if(this.index<o.buffer.buffer.length)return!1}else for(let d=0;d<this.index;d++)if(o.buffer.buffer[d+3]<this.index)return!1;({index:r,parent:c}=o)}else({index:r,_parent:c}=this._tree);for(;c;{index:r,_parent:c}=c)if(r>-1)for(let d=r+l,h=l<0?-1:c._tree.children.length;d!=h;d+=l){let m=c._tree.children[d];if(this.mode&Wt.IncludeAnonymous||m instanceof nr||!m.type.isAnonymous||Wp(m))return!1}return!0}move(l,r){if(r&&this.enterChild(l,0,4))return!0;for(;;){if(this.sibling(l))return!0;if(this.atLastNode(l)||!this.parent())return!1}}next(l=!0){return this.move(1,l)}prev(l=!0){return this.move(-1,l)}moveTo(l,r=0){for(;(this.from==this.to||(r<1?this.from>=l:this.from>l)||(r>-1?this.to<=l:this.to<l))&&this.parent(););for(;this.enterChild(1,l,r););return this}get node(){if(!this.buffer)return this._tree;let l=this.bufferNode,r=null,c=0;if(l&&l.context==this.buffer)e:for(let o=this.index,d=this.stack.length;d>=0;){for(let h=l;h;h=h._parent)if(h.index==o){if(o==this.index)return h;r=h,c=d+1;break e}o=this.stack[--d]}for(let o=c;o<this.stack.length;o++)r=new va(this.buffer,r,this.stack[o]);return this.bufferNode=new va(this.buffer,r,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(l,r){for(let c=0;;){let o=!1;if(this.type.isAnonymous||l(this)!==!1){if(this.firstChild()){c++;continue}this.type.isAnonymous||(o=!0)}for(;;){if(o&&r&&r(this),o=this.type.isAnonymous,!c)return;if(this.nextSibling())break;this.parent(),c--,o=!0}}}matchContext(l){if(!this.buffer)return Cp(this.node.parent,l);let{buffer:r}=this.buffer,{types:c}=r.set;for(let o=l.length-1,d=this.stack.length-1;o>=0;d--){if(d<0)return Cp(this._tree,l,o);let h=c[r.buffer[this.stack[d]]];if(!h.isAnonymous){if(l[o]&&l[o]!=h.name)return!1;o--}}return!0}}function Wp(n){return n.children.some(l=>l instanceof nr||!l.type.isAnonymous||Wp(l))}function v1(n){var l;let{buffer:r,nodeSet:c,maxBufferLength:o=m1,reused:d=[],minRepeatType:h=c.types.length}=n,m=Array.isArray(r)?new Jp(r,r.length):r,g=c.types,x=0,y=0;function j(G,M,z,O,P,U){let{id:B,start:J,end:me,size:we}=m,ve=y,$=x;if(we<0)if(m.next(),we==-1){let k=d[B];z.push(k),O.push(J-G);return}else if(we==-3){x=B;return}else if(we==-4){y=B;return}else throw new RangeError(`Unrecognized record size: ${we}`);let Y=g[B],W,he,Se=J-G;if(me-J<=o&&(he=C(m.pos-M,P))){let k=new Uint16Array(he.size-he.skip),se=m.pos-he.size,q=k.length;for(;m.pos>se;)q=F(he.start,k,q);W=new nr(k,me-he.start,c),Se=he.start-G}else{let k=m.pos-we;m.next();let se=[],q=[],je=B>=h?B:-1,te=0,ke=me;for(;m.pos>k;)je>=0&&m.id==je&&m.size>=0?(m.end<=ke-o&&(w(se,q,J,te,m.end,ke,je,ve,$),te=se.length,ke=m.end),m.next()):U>2500?v(J,k,se,q):j(J,k,se,q,je,U+1);if(je>=0&&te>0&&te<se.length&&w(se,q,J,te,J,ke,je,ve,$),se.reverse(),q.reverse(),je>-1&&te>0){let De=T(Y,$);W=Pp(Y,se,q,0,se.length,0,me-J,De,De)}else W=A(Y,se,q,me-J,ve-me,$)}z.push(W),O.push(Se)}function v(G,M,z,O){let P=[],U=0,B=-1;for(;m.pos>M;){let{id:J,start:me,end:we,size:ve}=m;if(ve>4)m.next();else{if(B>-1&&me<B)break;B<0&&(B=we-o),P.push(J,me,we),U++,m.next()}}if(U){let J=new Uint16Array(U*4),me=P[P.length-2];for(let we=P.length-3,ve=0;we>=0;we-=3)J[ve++]=P[we],J[ve++]=P[we+1]-me,J[ve++]=P[we+2]-me,J[ve++]=ve;z.push(new nr(J,P[2]-me,c)),O.push(me-G)}}function T(G,M){return(z,O,P)=>{let U=0,B=z.length-1,J,me;if(B>=0&&(J=z[B])instanceof Zs){if(!B&&J.type==G&&J.length==P)return J;(me=J.prop(en.lookAhead))&&(U=O[B]+J.length+me)}return A(G,z,O,P,U,M)}}function w(G,M,z,O,P,U,B,J,me){let we=[],ve=[];for(;G.length>O;)we.push(G.pop()),ve.push(M.pop()+z-P);G.push(A(c.types[B],we,ve,U-P,J-U,me)),M.push(P-z)}function A(G,M,z,O,P,U,B){if(U){let J=[en.contextHash,U];B=B?[J].concat(B):[J]}if(P>25){let J=[en.lookAhead,P];B=B?[J].concat(B):[J]}return new Zs(G,M,z,O,B)}function C(G,M){let z=m.fork(),O=0,P=0,U=0,B=z.end-o,J={size:0,start:0,skip:0};e:for(let me=z.pos-G;z.pos>me;){let we=z.size;if(z.id==M&&we>=0){J.size=O,J.start=P,J.skip=U,U+=4,O+=4,z.next();continue}let ve=z.pos-we;if(we<0||ve<me||z.start<B)break;let $=z.id>=h?4:0,Y=z.start;for(z.next();z.pos>ve;){if(z.size<0)if(z.size==-3||z.size==-4)$+=4;else break e;else z.id>=h&&($+=4);z.next()}P=Y,O+=we,U+=$}return(M<0||O==G)&&(J.size=O,J.start=P,J.skip=U),J.size>4?J:void 0}function F(G,M,z){let{id:O,start:P,end:U,size:B}=m;if(m.next(),B>=0&&O<h){let J=z;if(B>4){let me=m.pos-(B-4);for(;m.pos>me;)z=F(G,M,z)}M[--z]=J,M[--z]=U-G,M[--z]=P-G,M[--z]=O}else B==-3?x=O:B==-4&&(y=O);return z}let Q=[],I=[];for(;m.pos>0;)j(n.start||0,n.bufferStart||0,Q,I,-1,0);let L=(l=n.length)!==null&&l!==void 0?l:Q.length?I[0]+Q[0].length:0;return new Zs(g[n.topID],Q.reverse(),I.reverse(),L)}const Tb=new WeakMap;function Kd(n,l){if(!n.isAnonymous||l instanceof nr||l.type!=n)return 1;let r=Tb.get(l);if(r==null){r=1;for(let c of l.children){if(c.type!=n||!(c instanceof Zs)){r=1;break}r+=Kd(n,c)}Tb.set(l,r)}return r}function Pp(n,l,r,c,o,d,h,m,g){let x=0;for(let w=c;w<o;w++)x+=Kd(n,l[w]);let y=Math.ceil(x*1.5/8),j=[],v=[];function T(w,A,C,F,Q){for(let I=C;I<F;){let L=I,G=A[I],M=Kd(n,w[I]);for(I++;I<F;I++){let z=Kd(n,w[I]);if(M+z>=y)break;M+=z}if(I==L+1){if(M>y){let z=w[L];T(z.children,z.positions,0,z.children.length,A[L]+Q);continue}j.push(w[L])}else{let z=A[I-1]+w[I-1].length-G;j.push(Pp(n,w,A,L,I,G,z,null,g))}v.push(G+Q-d)}}return T(l,r,c,o,0),(m||g)(j,v,h)}class BE{constructor(){this.map=new WeakMap}setBuffer(l,r,c){let o=this.map.get(l);o||this.map.set(l,o=new Map),o.set(r,c)}getBuffer(l,r){let c=this.map.get(l);return c&&c.get(r)}set(l,r){l instanceof va?this.setBuffer(l.context.buffer,l.index,r):l instanceof Ns&&this.map.set(l.tree,r)}get(l){return l instanceof va?this.getBuffer(l.context.buffer,l.index):l instanceof Ns?this.map.get(l.tree):void 0}cursorSet(l,r){l.buffer?this.setBuffer(l.buffer.buffer,l.index,r):this.map.set(l.tree,r)}cursorGet(l){return l.buffer?this.getBuffer(l.buffer.buffer,l.index):this.map.get(l.tree)}}class xu{constructor(l,r,c,o,d=!1,h=!1){this.from=l,this.to=r,this.tree=c,this.offset=o,this.open=(d?1:0)|(h?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(l,r=[],c=!1){let o=[new xu(0,l.length,l,0,!1,c)];for(let d of r)d.to>l.length&&o.push(d);return o}static applyChanges(l,r,c=128){if(!r.length)return l;let o=[],d=1,h=l.length?l[0]:null;for(let m=0,g=0,x=0;;m++){let y=m<r.length?r[m]:null,j=y?y.fromA:1e9;if(j-g>=c)for(;h&&h.from<j;){let v=h;if(g>=v.from||j<=v.to||x){let T=Math.max(v.from,g)-x,w=Math.min(v.to,j)-x;v=T>=w?null:new xu(T,w,v.tree,v.offset+x,m>0,!!y)}if(v&&o.push(v),h.to>j)break;h=d<l.length?l[d++]:null}if(!y)break;g=y.toA,x=y.toA-y.toB}return o}}class IE{startParse(l,r,c){return typeof l=="string"&&(l=new j1(l)),c=c?c.length?c.map(o=>new Nl(o.from,o.to)):[new Nl(0,0)]:[new Nl(0,l.length)],this.createParse(l,r||[],c)}parse(l,r,c){let o=this.startParse(l,r,c);for(;;){let d=o.advance();if(d)return d}}}class j1{constructor(l){this.string=l}get length(){return this.string.length}chunk(l){return this.string.slice(l)}get lineChunks(){return!1}read(l,r){return this.string.slice(l,r)}}function $E(n){return(l,r,c,o)=>new w1(l,n,r,c,o)}class Cb{constructor(l,r,c,o,d,h){this.parser=l,this.parse=r,this.overlay=c,this.bracketed=o,this.target=d,this.from=h}}function Ab(n){if(!n.length||n.some(l=>l.from>=l.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(n))}class N1{constructor(l,r,c,o,d,h,m,g){this.parser=l,this.predicate=r,this.mounts=c,this.index=o,this.start=d,this.bracketed=h,this.target=m,this.prev=g,this.depth=0,this.ranges=[]}}const Ap=new en({perNode:!0});class w1{constructor(l,r,c,o,d){this.nest=r,this.input=c,this.fragments=o,this.ranges=d,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=l}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 Zs(c.type,c.children,c.positions,c.length,c.propValues.concat([[Ap,this.stoppedAt]]))),c}let l=this.inner[this.innerDone],r=l.parse.advance();if(r){this.innerDone++;let c=Object.assign(Object.create(null),l.target.props);c[en.mounted.id]=new qc(r,l.overlay,l.parser,l.bracketed),l.target.props=c}return null}get parsedPos(){if(this.baseParse)return 0;let l=this.input.length;for(let r=this.innerDone;r<this.inner.length;r++)this.inner[r].from<l&&(l=Math.min(l,this.inner[r].parse.parsedPos));return l}stopAt(l){if(this.stoppedAt=l,this.baseParse)this.baseParse.stopAt(l);else for(let r=this.innerDone;r<this.inner.length;r++)this.inner[r].parse.stopAt(l)}startInner(){let l=new E1(this.fragments),r=null,c=null,o=new sf(new Ns(this.baseTree,this.ranges[0].from,0,null),Wt.IncludeAnonymous|Wt.IgnoreMounts);e:for(let d,h;;){let m=!0,g;if(this.stoppedAt!=null&&o.from>=this.stoppedAt)m=!1;else if(l.hasNode(o)){if(r){let x=r.mounts.find(y=>y.frag.from<=o.from&&y.frag.to>=o.to&&y.mount.overlay);if(x)for(let y of x.mount.overlay){let j=y.from+x.pos,v=y.to+x.pos;j>=o.from&&v<=o.to&&!r.ranges.some(T=>T.from<v&&T.to>j)&&r.ranges.push({from:j,to:v})}}m=!1}else if(c&&(h=k1(c.ranges,o.from,o.to)))m=h!=2;else if(!o.type.isAnonymous&&(d=this.nest(o,this.input))&&(o.from<o.to||!d.overlay)){o.tree||(S1(o),r&&r.depth++,c&&c.depth++);let x=l.findMounts(o.from,d.parser);if(typeof d.overlay=="function")r=new N1(d.parser,d.overlay,x,this.inner.length,o.from,!!d.bracketed,o.tree,r);else{let y=Db(this.ranges,d.overlay||(o.from<o.to?[new Nl(o.from,o.to)]:[]));y.length&&Ab(y),(y.length||!d.overlay)&&this.inner.push(new Cb(d.parser,y.length?d.parser.startParse(this.input,Ob(x,y),y):d.parser.startParse(""),d.overlay?d.overlay.map(j=>new Nl(j.from-o.from,j.to-o.from)):null,!!d.bracketed,o.tree,y.length?y[0].from:o.from)),d.overlay?y.length&&(c={ranges:y,depth:0,prev:c}):m=!1}}else if(r&&(g=r.predicate(o))&&(g===!0&&(g=new Nl(o.from,o.to)),g.from<g.to)){let x=r.ranges.length-1;x>=0&&r.ranges[x].to==g.from?r.ranges[x]={from:r.ranges[x].from,to:g.to}:r.ranges.push(g)}if(m&&o.firstChild())r&&r.depth++,c&&c.depth++;else for(;!o.nextSibling();){if(!o.parent())break e;if(r&&!--r.depth){let x=Db(this.ranges,r.ranges);x.length&&(Ab(x),this.inner.splice(r.index,0,new Cb(r.parser,r.parser.startParse(this.input,Ob(r.mounts,x),x),r.ranges.map(y=>new Nl(y.from-r.start,y.to-r.start)),r.bracketed,r.target,x[0].from))),r=r.prev}c&&!--c.depth&&(c=c.prev)}}}}function k1(n,l,r){for(let c of n){if(c.from>=r)break;if(c.to>l)return c.from<=l&&c.to>=r?2:1}return 0}function Mb(n,l,r,c,o,d){if(l<r){let h=n.buffer[l+1];c.push(n.slice(l,r,h)),o.push(h-d)}}function S1(n){let{node:l}=n,r=[],c=l.context.buffer;do r.push(n.index),n.parent();while(!n.tree);let o=n.tree,d=o.children.indexOf(c),h=o.children[d],m=h.buffer,g=[d];function x(y,j,v,T,w,A){let C=r[A],F=[],Q=[];Mb(h,y,C,F,Q,T);let I=m[C+1],L=m[C+2];g.push(F.length);let G=A?x(C+4,m[C+3],h.set.types[m[C]],I,L-I,A-1):l.toTree();return F.push(G),Q.push(I-T),Mb(h,m[C+3],j,F,Q,T),new Zs(v,F,Q,w)}o.children[d]=x(0,m.length,Xl.none,0,h.length,r.length-1);for(let y of g){let j=n.tree.children[y],v=n.tree.positions[y];n.yield(new Ns(j,v+n.from,y,n._tree))}}class Rb{constructor(l,r){this.offset=r,this.done=!1,this.cursor=l.cursor(Wt.IncludeAnonymous|Wt.IgnoreMounts)}moveTo(l){let{cursor:r}=this,c=l-this.offset;for(;!this.done&&r.from<c;)if(!(r.to>=l&&r.enter(c,1,Wt.IgnoreOverlays|Wt.ExcludeBuffers)))if(r.to<=l)r.next(!1)||(this.done=!0);else break}hasNode(l){if(this.moveTo(l.from),!this.done&&this.cursor.from+this.offset==l.from&&this.cursor.tree)for(let r=this.cursor.tree;;){if(r==l.tree)return!0;if(r.children.length&&r.positions[0]==0&&r.children[0]instanceof Zs)r=r.children[0];else break}return!1}}class E1{constructor(l){var r;if(this.fragments=l,this.curTo=0,this.fragI=0,l.length){let c=this.curFrag=l[0];this.curTo=(r=c.tree.prop(Ap))!==null&&r!==void 0?r:c.to,this.inner=new Rb(c.tree,-c.offset)}else this.curFrag=this.inner=null}hasNode(l){for(;this.curFrag&&l.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=l.from&&this.curTo>=l.to&&this.inner.hasNode(l)}nextFrag(){var l;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let r=this.curFrag=this.fragments[this.fragI];this.curTo=(l=r.tree.prop(Ap))!==null&&l!==void 0?l:r.to,this.inner=new Rb(r.tree,-r.offset)}}findMounts(l,r){var c;let o=[];if(this.inner){this.inner.cursor.moveTo(l,1);for(let d=this.inner.cursor.node;d;d=d.parent){let h=(c=d.tree)===null||c===void 0?void 0:c.prop(en.mounted);if(h&&h.parser==r)for(let m=this.fragI;m<this.fragments.length;m++){let g=this.fragments[m];if(g.from>=d.to)break;g.tree==this.curFrag.tree&&o.push({frag:g,pos:d.from-g.offset,mount:h})}}}return o}}function Db(n,l){let r=null,c=l;for(let o=1,d=0;o<n.length;o++){let h=n[o-1].to,m=n[o].from;for(;d<c.length;d++){let g=c[d];if(g.from>=m)break;g.to<=h||(r||(c=r=l.slice()),g.from<h?(r[d]=new Nl(g.from,h),g.to>m&&r.splice(d+1,0,new Nl(m,g.to))):g.to>m?r[d--]=new Nl(m,g.to):r.splice(d--,1))}}return c}function T1(n,l,r,c){let o=0,d=0,h=!1,m=!1,g=-1e9,x=[];for(;;){let y=o==n.length?1e9:h?n[o].to:n[o].from,j=d==l.length?1e9:m?l[d].to:l[d].from;if(h!=m){let v=Math.max(g,r),T=Math.min(y,j,c);v<T&&x.push(new Nl(v,T))}if(g=Math.min(y,j),g==1e9)break;y==g&&(h?(h=!1,o++):h=!0),j==g&&(m?(m=!1,d++):m=!0)}return x}function Ob(n,l){let r=[];for(let{pos:c,mount:o,frag:d}of n){let h=c+(o.overlay?o.overlay[0].from:0),m=h+o.tree.length,g=Math.max(d.from,h),x=Math.min(d.to,m);if(o.overlay){let y=o.overlay.map(v=>new Nl(v.from+c,v.to+c)),j=T1(l,y,g,x);for(let v=0,T=g;;v++){let w=v==j.length,A=w?x:j[v].from;if(A>T&&r.push(new xu(T,A,o.tree,-h,d.from>=T||d.openStart,d.to<=A||d.openEnd)),w)break;T=j[v].to}}else r.push(new xu(g,x,o.tree,-h,d.from>=h||d.openStart,d.to<=m||d.openEnd))}return r}let C1=0;class jl{constructor(l,r,c,o){this.name=l,this.set=r,this.base=c,this.modified=o,this.id=C1++}toString(){let{name:l}=this;for(let r of this.modified)r.name&&(l=`${r.name}(${l})`);return l}static define(l,r){let c=typeof l=="string"?l:"?";if(l instanceof jl&&(r=l),r!=null&&r.base)throw new Error("Can not derive from a modified tag");let o=new jl(c,[],null,[]);if(o.set.push(o),r)for(let d of r.set)o.set.push(d);return o}static defineModifier(l){let r=new lf(l);return c=>c.modified.indexOf(r)>-1?c:lf.get(c.base||c,c.modified.concat(r).sort((o,d)=>o.id-d.id))}}let A1=0;class lf{constructor(l){this.name=l,this.instances=[],this.id=A1++}static get(l,r){if(!r.length)return l;let c=r[0].instances.find(m=>m.base==l&&M1(r,m.modified));if(c)return c;let o=[],d=new jl(l.name,o,l,r);for(let m of r)m.instances.push(d);let h=R1(r);for(let m of l.set)if(!m.modified.length)for(let g of h)o.push(lf.get(m,g));return d}}function M1(n,l){return n.length==l.length&&n.every((r,c)=>r==l[c])}function R1(n){let l=[[]];for(let r=0;r<n.length;r++)for(let c=0,o=l.length;c<o;c++)l.push(l[c].concat(n[r]));return l.sort((r,c)=>c.length-r.length)}function qE(n){let l=Object.create(null);for(let r in n){let c=n[r];Array.isArray(c)||(c=[c]);for(let o of r.split(" "))if(o){let d=[],h=2,m=o;for(let j=0;;){if(m=="..."&&j>0&&j+3==o.length){h=1;break}let v=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(m);if(!v)throw new RangeError("Invalid path: "+o);if(d.push(v[0]=="*"?"":v[0][0]=='"'?JSON.parse(v[0]):v[0]),j+=v[0].length,j==o.length)break;let T=o[j++];if(j==o.length&&T=="!"){h=0;break}if(T!="/")throw new RangeError("Invalid path: "+o);m=o.slice(j)}let g=d.length-1,x=d[g];if(!x)throw new RangeError("Invalid path: "+o);let y=new bu(c,h,g>0?d.slice(0,g):null);l[x]=y.sort(l[x])}}return dy.add(l)}const dy=new en({combine(n,l){let r,c,o;for(;n||l;){if(!n||l&&n.depth>=l.depth?(o=l,l=l.next):(o=n,n=n.next),r&&r.mode==o.mode&&!o.context&&!r.context)continue;let d=new bu(o.tags,o.mode,o.context);r?r.next=d:c=d,r=d}return c}});class bu{constructor(l,r,c,o){this.tags=l,this.mode=r,this.context=c,this.next=o}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(l){return!l||l.depth<this.depth?(this.next=l,this):(l.next=this.sort(l.next),l)}get depth(){return this.context?this.context.length:0}}bu.empty=new bu([],2,null);function fy(n,l){let r=Object.create(null);for(let d of n)if(!Array.isArray(d.tag))r[d.tag.id]=d.class;else for(let h of d.tag)r[h.id]=d.class;let{scope:c,all:o=null}=l||{};return{style:d=>{let h=o;for(let m of d)for(let g of m.set){let x=r[g.id];if(x){h=h?h+" "+x:x;break}}return h},scope:c}}function D1(n,l){let r=null;for(let c of n){let o=c.style(l);o&&(r=r?r+" "+o:o)}return r}function O1(n,l,r,c=0,o=n.length){let d=new z1(c,Array.isArray(l)?l:[l],r);d.highlightRange(n.cursor(),c,o,"",d.highlighters),d.flush(o)}function L1(n,l,r,c,o,d=0,h=n.length){let m=d;function g(x,y){if(!(x<=m)){for(let j=n.slice(m,x),v=0;;){let T=j.indexOf(`
|
|
117
|
-
`,v),w=T<0?j.length:T;if(w>v&&c(j.slice(v,w),y),T<0)break;o(),v=T+1}m=x}}O1(l,r,(x,y,j)=>{g(x,""),g(y,j)},d,h),g(h,"")}class z1{constructor(l,r,c){this.at=l,this.highlighters=r,this.span=c,this.class=""}startSpan(l,r){r!=this.class&&(this.flush(l),l>this.at&&(this.at=l),this.class=r)}flush(l){l>this.at&&this.class&&this.span(this.at,l,this.class)}highlightRange(l,r,c,o,d){let{type:h,from:m,to:g}=l;if(m>=c||g<=r)return;h.isTop&&(d=this.highlighters.filter(T=>!T.scope||T.scope(h)));let x=o,y=U1(l)||bu.empty,j=D1(d,y.tags);if(j&&(x&&(x+=" "),x+=j,y.mode==1&&(o+=(o?" ":"")+j)),this.startSpan(Math.max(r,m),x),y.opaque)return;let v=l.tree&&l.tree.prop(en.mounted);if(v&&v.overlay){let T=l.node.enter(v.overlay[0].from+m,1),w=this.highlighters.filter(C=>!C.scope||C.scope(v.tree.type)),A=l.firstChild();for(let C=0,F=m;;C++){let Q=C<v.overlay.length?v.overlay[C]:null,I=Q?Q.from+m:g,L=Math.max(r,F),G=Math.min(c,I);if(L<G&&A)for(;l.from<G&&(this.highlightRange(l,L,G,o,d),this.startSpan(Math.min(G,l.to),x),!(l.to>=I||!l.nextSibling())););if(!Q||I>c)break;F=Q.to+m,F>r&&(this.highlightRange(T.cursor(),Math.max(r,Q.from+m),Math.min(c,F),"",w),this.startSpan(Math.min(c,F),x))}A&&l.parent()}else if(l.firstChild()){v&&(o="");do if(!(l.to<=r)){if(l.from>=c)break;this.highlightRange(l,r,c,o,d),this.startSpan(Math.min(c,l.to),x)}while(l.nextSibling());l.parent()}}}function U1(n){let l=n.type.prop(dy);for(;l&&l.context&&!n.matchContext(l.context);)l=l.next;return l||null}const Ae=jl.define,Md=Ae(),Zi=Ae(),Lb=Ae(Zi),zb=Ae(Zi),Fi=Ae(),Rd=Ae(Fi),up=Ae(Fi),ba=Ae(),Ar=Ae(ba),ha=Ae(),pa=Ae(),Mp=Ae(),au=Ae(Mp),Dd=Ae(),Re={comment:Md,lineComment:Ae(Md),blockComment:Ae(Md),docComment:Ae(Md),name:Zi,variableName:Ae(Zi),typeName:Lb,tagName:Ae(Lb),propertyName:zb,attributeName:Ae(zb),className:Ae(Zi),labelName:Ae(Zi),namespace:Ae(Zi),macroName:Ae(Zi),literal:Fi,string:Rd,docString:Ae(Rd),character:Ae(Rd),attributeValue:Ae(Rd),number:up,integer:Ae(up),float:Ae(up),bool:Ae(Fi),regexp:Ae(Fi),escape:Ae(Fi),color:Ae(Fi),url:Ae(Fi),keyword:ha,self:Ae(ha),null:Ae(ha),atom:Ae(ha),unit:Ae(ha),modifier:Ae(ha),operatorKeyword:Ae(ha),controlKeyword:Ae(ha),definitionKeyword:Ae(ha),moduleKeyword:Ae(ha),operator:pa,derefOperator:Ae(pa),arithmeticOperator:Ae(pa),logicOperator:Ae(pa),bitwiseOperator:Ae(pa),compareOperator:Ae(pa),updateOperator:Ae(pa),definitionOperator:Ae(pa),typeOperator:Ae(pa),controlOperator:Ae(pa),punctuation:Mp,separator:Ae(Mp),bracket:au,angleBracket:Ae(au),squareBracket:Ae(au),paren:Ae(au),brace:Ae(au),content:ba,heading:Ar,heading1:Ae(Ar),heading2:Ae(Ar),heading3:Ae(Ar),heading4:Ae(Ar),heading5:Ae(Ar),heading6:Ae(Ar),contentSeparator:Ae(ba),list:Ae(ba),quote:Ae(ba),emphasis:Ae(ba),strong:Ae(ba),link:Ae(ba),monospace:Ae(ba),strikethrough:Ae(ba),inserted:Ae(),deleted:Ae(),changed:Ae(),invalid:Ae(),meta:Dd,documentMeta:Ae(Dd),annotation:Ae(Dd),processingInstruction:Ae(Dd),definition:jl.defineModifier("definition"),constant:jl.defineModifier("constant"),function:jl.defineModifier("function"),standard:jl.defineModifier("standard"),local:jl.defineModifier("local"),special:jl.defineModifier("special")};for(let n in Re){let l=Re[n];l instanceof jl&&(l.name=n)}fy([{tag:Re.link,class:"tok-link"},{tag:Re.heading,class:"tok-heading"},{tag:Re.emphasis,class:"tok-emphasis"},{tag:Re.strong,class:"tok-strong"},{tag:Re.keyword,class:"tok-keyword"},{tag:Re.atom,class:"tok-atom"},{tag:Re.bool,class:"tok-bool"},{tag:Re.url,class:"tok-url"},{tag:Re.labelName,class:"tok-labelName"},{tag:Re.inserted,class:"tok-inserted"},{tag:Re.deleted,class:"tok-deleted"},{tag:Re.literal,class:"tok-literal"},{tag:Re.string,class:"tok-string"},{tag:Re.number,class:"tok-number"},{tag:[Re.regexp,Re.escape,Re.special(Re.string)],class:"tok-string2"},{tag:Re.variableName,class:"tok-variableName"},{tag:Re.local(Re.variableName),class:"tok-variableName tok-local"},{tag:Re.definition(Re.variableName),class:"tok-variableName tok-definition"},{tag:Re.special(Re.variableName),class:"tok-variableName2"},{tag:Re.definition(Re.propertyName),class:"tok-propertyName tok-definition"},{tag:Re.typeName,class:"tok-typeName"},{tag:Re.namespace,class:"tok-namespace"},{tag:Re.className,class:"tok-className"},{tag:Re.macroName,class:"tok-macroName"},{tag:Re.propertyName,class:"tok-propertyName"},{tag:Re.operator,class:"tok-operator"},{tag:Re.comment,class:"tok-comment"},{tag:Re.meta,class:"tok-meta"},{tag:Re.invalid,class:"tok-invalid"},{tag:Re.punctuation,class:"tok-punctuation"}]);const H1="modulepreload",B1=function(n,l){return new URL(n,l).href},Ub={},lt=function(l,r,c){let o=Promise.resolve();if(r&&r.length>0){let h=function(y){return Promise.all(y.map(j=>Promise.resolve(j).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};const m=document.getElementsByTagName("link"),g=document.querySelector("meta[property=csp-nonce]"),x=(g==null?void 0:g.nonce)||(g==null?void 0:g.getAttribute("nonce"));o=h(r.map(y=>{if(y=B1(y,c),y in Ub)return;Ub[y]=!0;const j=y.endsWith(".css"),v=j?'[rel="stylesheet"]':"";if(!!c)for(let A=m.length-1;A>=0;A--){const C=m[A];if(C.href===y&&(!j||C.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${y}"]${v}`))return;const w=document.createElement("link");if(w.rel=j?"stylesheet":H1,j||(w.as="script"),w.crossOrigin="",w.href=y,x&&w.setAttribute("nonce",x),document.head.appendChild(w),j)return new Promise((A,C)=>{w.addEventListener("load",A),w.addEventListener("error",()=>C(new Error(`Unable to preload CSS for ${y}`)))})}))}function d(h){const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=h,window.dispatchEvent(m),!m.defaultPrevented)throw h}return o.then(h=>{for(const m of h||[])m.status==="rejected"&&d(m.reason);return l().catch(d)})},hy={js:async()=>(await lt(async()=>{const{javascript:n}=await import("./index-BeqGzcF4.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({jsx:!0}),cjs:async()=>(await lt(async()=>{const{javascript:n}=await import("./index-BeqGzcF4.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript(),mjs:async()=>(await lt(async()=>{const{javascript:n}=await import("./index-BeqGzcF4.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript(),jsx:async()=>(await lt(async()=>{const{javascript:n}=await import("./index-BeqGzcF4.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({jsx:!0}),ts:async()=>(await lt(async()=>{const{javascript:n}=await import("./index-BeqGzcF4.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),mts:async()=>(await lt(async()=>{const{javascript:n}=await import("./index-BeqGzcF4.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),cts:async()=>(await lt(async()=>{const{javascript:n}=await import("./index-BeqGzcF4.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),tsx:async()=>(await lt(async()=>{const{javascript:n}=await import("./index-BeqGzcF4.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0,jsx:!0}),json:async()=>(await lt(async()=>{const{json:n}=await import("./index-BKQ3S7R4.js");return{json:n}},__vite__mapDeps([6,1,2,3,4]),import.meta.url)).json(),jsonc:async()=>(await lt(async()=>{const{json:n}=await import("./index-BKQ3S7R4.js");return{json:n}},__vite__mapDeps([6,1,2,3,4]),import.meta.url)).json(),css:async()=>(await lt(async()=>{const{css:n}=await import("./index-Jk59gidx.js");return{css:n}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),scss:async()=>(await lt(async()=>{const{css:n}=await import("./index-Jk59gidx.js");return{css:n}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),less:async()=>(await lt(async()=>{const{css:n}=await import("./index-Jk59gidx.js");return{css:n}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),html:async()=>(await lt(async()=>{const{html:n}=await import("./index-CTd3OD36.js");return{html:n}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),htm:async()=>(await lt(async()=>{const{html:n}=await import("./index-CTd3OD36.js");return{html:n}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),vue:async()=>(await lt(async()=>{const{html:n}=await import("./index-CTd3OD36.js");return{html:n}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),svelte:async()=>(await lt(async()=>{const{html:n}=await import("./index-CTd3OD36.js");return{html:n}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),md:async()=>(await lt(async()=>{const{markdown:n}=await import("./index-C--xwv_c.js");return{markdown:n}},__vite__mapDeps([9,3,4,2,5,8,1,7,0]),import.meta.url)).markdown(),markdown:async()=>(await lt(async()=>{const{markdown:n}=await import("./index-C--xwv_c.js");return{markdown:n}},__vite__mapDeps([9,3,4,2,5,8,1,7,0]),import.meta.url)).markdown(),py:async()=>(await lt(async()=>{const{python:n}=await import("./index-Cp-Vx5md.js");return{python:n}},__vite__mapDeps([10,1,2,3,4,5]),import.meta.url)).python(),pyi:async()=>(await lt(async()=>{const{python:n}=await import("./index-Cp-Vx5md.js");return{python:n}},__vite__mapDeps([10,1,2,3,4,5]),import.meta.url)).python(),yaml:async()=>(await lt(async()=>{const{yaml:n}=await import("./index-DwvMx-lF.js");return{yaml:n}},__vite__mapDeps([11,1,2,3,4]),import.meta.url)).yaml(),yml:async()=>(await lt(async()=>{const{yaml:n}=await import("./index-DwvMx-lF.js");return{yaml:n}},__vite__mapDeps([11,1,2,3,4]),import.meta.url)).yaml(),rs:async()=>(await lt(async()=>{const{rust:n}=await import("./index-BqphMi4s.js");return{rust:n}},__vite__mapDeps([12,1,2,3,4]),import.meta.url)).rust(),c:async()=>(await lt(async()=>{const{cpp:n}=await import("./index-DGvQxxdB.js");return{cpp:n}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),h:async()=>(await lt(async()=>{const{cpp:n}=await import("./index-DGvQxxdB.js");return{cpp:n}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),cc:async()=>(await lt(async()=>{const{cpp:n}=await import("./index-DGvQxxdB.js");return{cpp:n}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),cpp:async()=>(await lt(async()=>{const{cpp:n}=await import("./index-DGvQxxdB.js");return{cpp:n}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),hpp:async()=>(await lt(async()=>{const{cpp:n}=await import("./index-DGvQxxdB.js");return{cpp:n}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),java:async()=>(await lt(async()=>{const{java:n}=await import("./index-DkREaKVS.js");return{java:n}},__vite__mapDeps([14,1,2,3,4]),import.meta.url)).java(),go:async()=>(await lt(async()=>{const{go:n}=await import("./index-H0NO4iIy.js");return{go:n}},__vite__mapDeps([15,1,2,3,4,5]),import.meta.url)).go(),php:async()=>(await lt(async()=>{const{php:n}=await import("./index-DswRCrFR.js");return{php:n}},__vite__mapDeps([16,1,8,7,2,3,4,0,5]),import.meta.url)).php(),sql:async()=>(await lt(async()=>{const{sql:n}=await import("./index-CO8tJjX2.js");return{sql:n}},__vite__mapDeps([17,2,3,4,1,5]),import.meta.url)).sql(),xml:async()=>(await lt(async()=>{const{xml:n}=await import("./index-C0UJgxDk.js");return{xml:n}},__vite__mapDeps([18,1,2,3,4]),import.meta.url)).xml(),svg:async()=>(await lt(async()=>{const{xml:n}=await import("./index-C0UJgxDk.js");return{xml:n}},__vite__mapDeps([18,1,2,3,4]),import.meta.url)).xml()},I1={".mcp.json":"json",dockerfile:"yaml",makefile:"yaml"},$1={javascript:"js",node:"js",typescript:"ts",python:"py",python3:"py",yml:"yaml",rust:"rs",golang:"go","c++":"cpp",cplusplus:"cpp"};async function q1(n){const l=$1[n.toLowerCase()]??n.toLowerCase(),r=hy[l];return r?r().catch(()=>null):null}async function G1(n){const l=(n.split("/").pop()??"").toLowerCase(),r=I1[l]??l.split(".").pop()??"",c=hy[r];return c?c().catch(()=>null):null}const Y1=fy([{tag:[Re.keyword,Re.modifier,Re.controlKeyword,Re.moduleKeyword],class:"cmh-key"},{tag:[Re.propertyName],class:"cmh-prop"},{tag:[Re.function(Re.variableName),Re.labelName],class:"cmh-fn"},{tag:[Re.color,Re.constant(Re.name),Re.standard(Re.name),Re.bool],class:"cmh-const"},{tag:[Re.typeName,Re.className,Re.changed,Re.annotation,Re.self,Re.namespace],class:"cmh-type"},{tag:[Re.number,Re.integer,Re.float],class:"cmh-num"},{tag:[Re.string,Re.special(Re.string),Re.regexp],class:"cmh-str"},{tag:[Re.operator,Re.operatorKeyword,Re.escape],class:"cmh-op"},{tag:[Re.meta,Re.comment],class:"cmh-comment"},{tag:Re.invalid,class:"cmh-invalid"}]);function Od(n){return n.replace(/[&<>]/g,l=>l==="&"?"&":l==="<"?"<":">")}async function X1(n,l){const r=l?await q1(l):null;if(!r)return Od(n);try{const c=r.language.parser.parse(n);let o="";return L1(n,c,Y1,(d,h)=>{o+=h?`<span class="${h}">${Od(d)}</span>`:Od(d)},()=>{o+=`
|
|
118
|
-
`}),o}catch{return Od(n)}}Ot.setOptions({gfm:!0,breaks:!1});function py(n){var r;const l=(r=n.split(".").pop())==null?void 0:r.toLowerCase();return l==="md"||l==="markdown"}async function mf(n){const l=await Ot.parse(n,{async:!0,walkTokens:async r=>{if(r.type!=="code")return;const c=r;c.text=await X1(c.text,c.lang??""),c.escaped=!0}});return p1.sanitize(l)}function Hb(n,l){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:l,previewMode:py(n.path)}}function si(n){return!n.binary&&!n.tooLarge&&n.text!==n.saved}function V1(n){return n.split("/").pop()??n}function $r(n){const l=n.lastIndexOf("/");return l===-1?"":n.slice(0,l)}function Zd(n){return n<1024?`${n} Б`:n<1024*1024?`${(n/1024).toFixed(1)} КБ`:`${(n/1024/1024).toFixed(1)} МБ`}function tr({x:n,y:l,items:r,note:c,onClose:o}){const d=b.useRef(null),[h,m]=b.useState({left:n,top:l}),[g,x]=b.useState(()=>{const v=r.findIndex(T=>!T.disabled);return v===-1?0:v});b.useLayoutEffect(()=>{const v=d.current;if(!v)return;const T=v.getBoundingClientRect(),w=8,A=Math.max(w,Math.min(n,window.innerWidth-T.width-w)),C=Math.max(w,Math.min(l,window.innerHeight-T.height-w));m({left:A,top:C})},[n,l]),b.useLayoutEffect(()=>{var v;(v=d.current)==null||v.focus()},[]),b.useLayoutEffect(()=>{function v(w){var A;(A=d.current)!=null&&A.contains(w.target)||o()}function T(){o()}return document.addEventListener("mousedown",v),document.addEventListener("scroll",T,!0),()=>{document.removeEventListener("mousedown",v),document.removeEventListener("scroll",T,!0)}},[o]);function y(v){v.disabled||(v.onSelect(),o())}function j(v){if(v.key==="Escape"){v.preventDefault(),v.stopPropagation(),o();return}const T=r.map((w,A)=>({item:w,index:A})).filter(w=>!w.item.disabled);if(T.length!==0){if(v.key==="ArrowDown"||v.key==="ArrowUp"){v.preventDefault();const w=v.key==="ArrowDown"?1:-1,A=T.findIndex(F=>F.index===g),C=T[(((A===-1?0:A)+w)%T.length+T.length)%T.length];C&&x(C.index);return}if(v.key==="Enter"||v.key===" "){v.preventDefault();const w=r[g];w&&y(w)}}}return a.jsxs("div",{ref:d,className:"ctxmenu",style:{left:h.left,top:h.top},role:"menu",tabIndex:-1,onKeyDown:j,children:[c&&a.jsx("div",{className:"ctxmenu__note",children:c}),r.map((v,T)=>a.jsxs("button",{type:"button",role:"menuitem","aria-disabled":v.disabled,className:"ctxmenu__item"+(T===g?" is-cursor":""),onMouseEnter:()=>x(T),onClick:()=>y(v),children:[a.jsx("span",{className:"ctxmenu__label",children:v.label}),v.hint&&a.jsx("span",{className:"ctxmenu__hint",children:v.hint})]},v.id))]})}const Q1=3500,K1=9e3,Bb=220;function Xr({result:n,onDismiss:l}){const[r,c]=b.useState(n),[o,d]=b.useState(!1);if(b.useEffect(()=>{if(!n){c(null),d(!1);return}if(c(n),d(!1),n.url)return;const m=n.ok?Q1:K1,g=setTimeout(()=>d(!0),m),x=setTimeout(()=>c(null),m+Bb);return()=>{clearTimeout(g),clearTimeout(x)}},[n]),!r)return null;const h=()=>{d(!0),setTimeout(()=>{c(null),l==null||l()},Bb)};return a.jsxs("div",{className:"oplog "+(r.ok?"oplog--ok":"oplog--bad")+(o?" oplog--leaving":"")+(r.url?" oplog--dismissible":""),role:"status","aria-live":r.ok?"polite":"assertive",children:[r.message,r.url&&a.jsxs("a",{className:"oplog__link",href:r.url,target:"_blank",rel:"noreferrer",onClick:m=>m.stopPropagation(),children:[r.url.replace(/^https?:\/\//,"")," ↗"]}),r.url&&l&&a.jsx("button",{type:"button",className:"oplog__dismiss",title:"Закрыть","aria-label":"Закрыть сообщение",onClick:h,children:"✕"})]})}function ja({value:n,className:l,placeholder:r="Название сессии",onCommit:c,onCancel:o}){const[d,h]=b.useState(n),m=b.useRef(null);b.useEffect(()=>{var x;(x=m.current)==null||x.select()},[]);function g(){const x=d.trim();if(!x||x===n)return o();c(x)}return a.jsx("input",{ref:m,className:l?`rename ${l}`:"rename",value:d,autoFocus:!0,spellCheck:!1,placeholder:r,onChange:x=>h(x.target.value),onBlur:g,onKeyDown:x=>{x.stopPropagation(),x.key==="Enter"?(x.preventDefault(),g()):x.key==="Escape"&&(x.preventDefault(),o())}})}function to({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 Z1=500,Mr="application/x-ccv-fs-path",F1=200;function J1({open:n,tree:l,expanded:r,activePath:c,dirty:o,gitChanges:d,result:h,searchResult:m,onSearch:g,onReveal:x,onToggle:y,onOpen:j,onCreate:v,onRename:T,onMove:w,onCopy:A,onDelete:C,onRefresh:F,onClose:Q,zoomed:I,onToggleZoom:L}){const[G,M]=b.useState(""),[z,O]=b.useState(null),[P,U]=b.useState(null),[B,J]=b.useState(null),[me,we]=b.useState(null),[ve,$]=b.useState(null),[Y,W]=b.useState(null),he=ff("(hover: hover)"),Se=b.useRef(null),k=b.useMemo(()=>eN(d),[d]);function se(re){return!(!B||re===B.path||B.kind==="dir"&&re.startsWith(`${B.path}/`)||re===$r(B.path))}function q(re){return!(!ve||re===ve.path||ve.kind==="dir"&&re.startsWith(`${ve.path}/`)||ve.mode==="cut"&&re===$r(ve.path))}function je(re){$({path:re.path,kind:re.kind,mode:"copy"})}function te(re){$({path:re.path,kind:re.kind,mode:"cut"})}function ke(re){!ve||!q(re)||(re&&!r.has(re)&&y(re),ve.mode==="cut"?(w(ve.path,re),$(null)):A(ve.path,re))}function De(re,ye){const Xe=re.touches[0];if(!Xe)return;const it={timer:0,x:Xe.clientX,y:Xe.clientY,el:re.currentTarget,fired:!1};it.timer=window.setTimeout(()=>{it.fired=!0,ye(it.x,it.y,it.el)},Z1),Se.current=it}function Ge(re){const ye=Se.current,Xe=re.touches[0];!ye||!Xe||Math.hypot(Xe.clientX-ye.x,Xe.clientY-ye.y)>10&&(window.clearTimeout(ye.timer),Se.current=null)}function He(re){const ye=Se.current;ye&&(window.clearTimeout(ye.timer),ye.fired&&re.preventDefault())}function bt(){var re;return(re=Se.current)!=null&&re.fired?(Se.current=null,!0):!1}function Ve(re,ye,Xe,it){M((it==null?void 0:it.path)??""),W({x:re,y:ye,opener:Xe,entry:it})}function fn(){const re=Y==null?void 0:Y.opener;W(null),re!=null&&re.isConnected&&re.focus()}function We(re){return{onContextMenu:ye=>{ye.preventDefault(),Ve(ye.clientX,ye.clientY,ye.currentTarget,re)},onTouchStart:ye=>De(ye,(Xe,it,Je)=>Ve(Xe,it,Je,re)),onTouchMove:Ge,onTouchEnd:He,onTouchCancel:He}}function at(re){re.target===re.currentTarget&&(re.preventDefault(),Ve(re.clientX,re.clientY,re.currentTarget,null))}function ct(re){re.target===re.currentTarget&&De(re,(ye,Xe,it)=>Ve(ye,Xe,it,null))}function jt(re){if(!(re.ctrlKey||re.metaKey)||re.target instanceof HTMLInputElement)return;const ye=re.key.toLowerCase();if(ye==="v"){re.preventDefault(),ke(ps());return}if(!G)return;const Xe=Ib(l,G);Xe&&(ye==="c"?(re.preventDefault(),je(Xe)):ye==="x"&&(re.preventDefault(),te(Xe)))}function ut(re){return ye=>{ye.dataTransfer.effectAllowed="move",ye.dataTransfer.setData(Mr,re.path),J({path:re.path,kind:re.kind})}}function $t(){J(null),we(null)}function wt(re){return ye=>{ye.dataTransfer.types.includes(Mr)&&(ye.stopPropagation(),!(re.kind!=="dir"||!se(re.path))&&(ye.preventDefault(),we(re.path)))}}function Ce(re){return ye=>{if(!ye.dataTransfer.types.includes(Mr)||(ye.stopPropagation(),re.kind!=="dir"||!se(re.path)))return;ye.preventDefault();const Xe=ye.dataTransfer.getData(Mr);we(null),Xe&&w(Xe,re.path)}}function Pe(re){!re.dataTransfer.types.includes(Mr)||!se("")||(re.preventDefault(),we(""))}function Rt(re){if(!re.dataTransfer.types.includes(Mr)||!se(""))return;re.preventDefault();const ye=re.dataTransfer.getData(Mr);we(null),ye&&w(ye,"")}const[dt,Fe]=b.useState(""),bn=dt.trim(),ts=bn.length>0,Lt=b.useRef(null),kt=b.useRef(g);kt.current=g;function hs(re){Fe(re),Lt.current&&clearTimeout(Lt.current);const ye=re.trim();if(!ye){kt.current("");return}Lt.current=setTimeout(()=>kt.current(ye),F1)}function hn(re){Lt.current&&clearTimeout(Lt.current),Fe(""),kt.current(""),M(re.path),x(re)}const tn=ts&&(m==null?void 0:m.query)===bn?m:null;function ps(){if(G==="")return"";const re=Ib(l,G);if((re==null?void 0:re.kind)==="dir")return G;const ye=G.lastIndexOf("/");return ye===-1?"":G.slice(0,ye)}function _n(re,ye){const Xe=ye??ps();Xe&&!r.has(Xe)&&y(Xe),U({parent:Xe,kind:re})}function Ft(){if(!Y)return[];const re=it=>he?it:void 0;if(!Y.entry)return[{id:"paste",label:"Вставить в корень проекта",hint:re("Ctrl+V"),disabled:!q(""),onSelect:()=>ke("")},{id:"new-file",label:"Создать файл",onSelect:()=>_n("file","")},{id:"new-dir",label:"Создать каталог",onSelect:()=>_n("dir","")}];const ye=Y.entry,Xe=[ye.kind==="file"?{id:"open",label:"Открыть",onSelect:()=>j(ye.path)}:{id:"toggle",label:r.has(ye.path)?"Свернуть":"Развернуть",onSelect:()=>y(ye.path)},{id:"copy",label:"Копировать",hint:re("Ctrl+C"),onSelect:()=>je(ye)},{id:"cut",label:"Вырезать",hint:re("Ctrl+X"),onSelect:()=>te(ye)}];return ye.kind==="dir"&&(Xe.push({id:"paste",label:"Вставить",hint:re("Ctrl+V"),disabled:!q(ye.path),onSelect:()=>ke(ye.path)}),Xe.push({id:"new-file",label:"Создать файл",onSelect:()=>_n("file",ye.path)}),Xe.push({id:"new-dir",label:"Создать каталог",onSelect:()=>_n("dir",ye.path)})),Xe.push({id:"rename",label:"Переименовать",onSelect:()=>O(ye.path)}),Xe.push({id:"delete",label:"Удалить",onSelect:()=>C(ye)}),Xe}const Cn=ts?[]:zt("",0);function zt(re,ye){const Xe=l[re],it=[];if(P&&P.parent===re&&it.push(a.jsxs("div",{className:"fsrow fsrow--draft",style:li(ye),children:[a.jsx("span",{className:"fsrow__icon",children:P.kind==="dir"?a.jsx(rf,{}):a.jsx(cf,{})}),a.jsx(ja,{className:"rename--file",value:"",placeholder:P.kind==="dir"?"имя каталога":"имя файла",onCommit:Je=>{U(null),v(re,P.kind,Je)},onCancel:()=>U(null)})]},`draft:${re}`)),!Xe)return it.push(a.jsx("p",{className:"fsrow__pending",style:li(ye),children:"читаем…"},`wait:${re}`)),it;Xe.length===0&&!P&&it.push(a.jsx("p",{className:"fsrow__pending",style:li(ye),children:"пусто"},`empty:${re}`));for(const Je of Xe){const nn=Je.kind==="dir"&&r.has(Je.path);it.push(z===Je.path?a.jsxs("div",{className:"fsrow fsrow--draft",style:li(ye),children:[a.jsx("span",{className:"fsrow__icon",children:Je.kind==="dir"?a.jsx(rf,{open:nn}):a.jsx(cf,{})}),a.jsx(ja,{className:"rename--file",value:Je.name,placeholder:"новое имя",onCommit:Z=>{O(null),T(Je.path,Z)},onCancel:()=>O(null)})]},Je.path):a.jsx(W1,{entry:Je,depth:ye,open:nn,active:Je.path===c,selected:Je.path===G,dirty:o.has(Je.path),gitStatus:k.get(Je.path),dragging:(B==null?void 0:B.path)===Je.path,dropTarget:me===Je.path,cut:(ve==null?void 0:ve.mode)==="cut"&&ve.path===Je.path,onClick:()=>{bt()||(M(Je.path),Je.kind==="dir"?y(Je.path):j(Je.path))},onRename:()=>O(Je.path),onDelete:()=>C(Je),onDragStart:ut(Je),onDragEnd:$t,onDragOver:wt(Je),onDrop:Ce(Je),...We(Je)},Je.path)),nn&&it.push(...zt(Je.path,ye+1))}return it}function Tt(){if(!tn)return[a.jsx("p",{className:"fsrow__pending",style:li(0),children:"ищем…"},"search:wait")];if(tn.entries.length===0)return[a.jsx("p",{className:"fsrow__pending",style:li(0),children:"ничего не найдено"},"search:empty")];const re=tn.entries.map(ye=>a.jsx(P1,{entry:ye,gitStatus:k.get(ye.path),onClick:()=>hn(ye)},ye.path));return tn.truncated&&re.push(a.jsxs("p",{className:"fsrow__pending",style:li(0),children:["показаны первые ",tn.entries.length," — уточните запрос"]},"search:truncated")),re}return a.jsxs("aside",{className:(n?"sidepane sidepane--files sidepane--open":"sidepane sidepane--files")+(I?" sidepane--zoomed":""),"aria-label":"Файлы проекта",onKeyDown:jt,children:[a.jsxs("div",{className:"sidepane__head",onDoubleClick:re=>{L&&(re.target.closest("button")||L())},children:[a.jsx(lN,{}),a.jsx("span",{className:"sidepane__title",children:"Файлы"}),a.jsx("button",{className:"sidepane__btn",title:"Новый файл","aria-label":"Новый файл",onClick:()=>_n("file"),children:a.jsx(nN,{})}),a.jsx("button",{className:"sidepane__btn",title:"Новый каталог","aria-label":"Новый каталог",onClick:()=>_n("dir"),children:a.jsx(sN,{})}),a.jsx("button",{className:"sidepane__btn",title:"Перечитать дерево","aria-label":"Перечитать дерево",onClick:F,children:"↻"}),L&&a.jsx("button",{className:"sidepane__btn",title:I?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":I?"Свернуть панель файлов":"Развернуть панель файлов на весь экран","aria-pressed":I,onClick:L,children:a.jsx(to,{active:I})}),a.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель файлов",onClick:Q,children:"✕"})]}),a.jsxs("div",{className:"fssearch",children:[a.jsx(aN,{}),a.jsx("input",{className:"fssearch__input",type:"text",value:dt,spellCheck:!1,placeholder:"Поиск файлов и папок…","aria-label":"Поиск файлов и папок",onChange:re=>hs(re.target.value),onKeyDown:re=>{re.stopPropagation(),re.key==="Escape"&&(re.preventDefault(),dt?hs(""):re.currentTarget.blur())}}),dt&&a.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>hs(""),children:"✕"})]}),a.jsx("div",{className:"sidepane__scroll fstree"+(me===""?" fstree--drop-target":""),tabIndex:-1,onDragOver:Pe,onDrop:Rt,onContextMenu:at,onTouchStart:ct,onTouchMove:Ge,onTouchEnd:He,onTouchCancel:He,children:ts?Tt():Cn}),a.jsx(Xr,{result:h}),Y&&a.jsx(tr,{x:Y.x,y:Y.y,items:Ft(),onClose:fn})]})}function W1({entry:n,depth:l,open:r,active:c,selected:o,dirty:d,gitStatus:h,dragging:m,dropTarget:g,cut:x,onClick:y,onRename:j,onDelete:v,onDragStart:T,onDragEnd:w,onDragOver:A,onDrop:C,onContextMenu:F,onTouchStart:Q,onTouchMove:I,onTouchEnd:L,onTouchCancel:G}){const M="fsrow"+(c?" is-open":"")+(o&&!c?" is-selected":"")+(n.ignored?" fsrow--ignored":"")+(m?" fsrow--dragging":"")+(g?" fsrow--drop-target":"")+(x?" fsrow--cut":"");return a.jsxs("div",{className:M,style:li(l),draggable:!0,onDragStart:T,onDragEnd:w,onDragOver:A,onDrop:C,onContextMenu:F,onTouchStart:Q,onTouchMove:I,onTouchEnd:L,onTouchCancel:G,children:[a.jsxs("button",{className:"fsrow__main",onClick:y,title:my(n),children:[a.jsx("span",{className:"fsrow__icon"+af("fsrow__icon",h),children:n.kind==="dir"?a.jsx(rf,{open:r}):a.jsx(cf,{})}),a.jsx("span",{className:"fsrow__name"+af("fsrow__name",h),children:n.name}),n.ignored&&a.jsx("span",{className:"fsrow__tag",title:"Игнорируется git (.gitignore)",children:"git-ignore"}),d&&a.jsx("span",{className:"fsrow__dot",title:"Есть несохранённые правки"})]}),a.jsx("button",{className:"fsrow__act",title:"Переименовать","aria-label":`Переименовать ${n.name}`,onClick:j,children:"✎"}),a.jsx("button",{className:"fsrow__act",title:"Удалить","aria-label":`Удалить ${n.name}`,onClick:v,children:"✕"})]})}function P1({entry:n,gitStatus:l,onClick:r}){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:li(0),onClick:r,title:my(n),children:[a.jsx("span",{className:"fsrow__icon"+af("fsrow__icon",l),children:n.kind==="dir"?a.jsx(rf,{}):a.jsx(cf,{})}),a.jsx("span",{className:"fsrow__name"+af("fsrow__name",l),children:n.name}),n.ignored&&a.jsx("span",{className:"fsrow__tag",children:"git-ignore"}),c&&a.jsx("span",{className:"fsrow__path",children:c})]})}function my(n){return n.ignored?`${n.path} — игнорируется git (.gitignore)`:n.path}function li(n){return{"--depth":n}}function Ib(n,l){var o;const r=l.lastIndexOf("/"),c=r===-1?"":l.slice(0,r);return((o=n[c])==null?void 0:o.find(d=>d.path===l))??null}function eN(n){const l=new Map,r={added:1,modified:2},c=(o,d)=>{const h=l.get(o);(!h||r[d]>r[h])&&l.set(o,d)};for(const o of n){const d=tN(o.status);if(!d)continue;c(o.path,d);let h=$r(o.path);for(;c(h,d),!!h;)h=$r(h)}return l}function tN(n){if(n==="??")return"added";const[l="",r=""]=n;return l==="A"||l==="R"||l==="C"?"added":l==="M"||r==="M"?"modified":null}function af(n,l){return l?` ${n}--git-${l}`:""}function rf({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 cf(){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 nN(){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 sN(){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 lN(){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 aN(){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 iN=200;function rN({open:n,result:l,onSearch:r,onOpenMatch:c,onClose:o,zoomed:d,onToggleZoom:h}){const[m,g]=b.useState(""),x=m.trim(),y=x.length>0,j=b.useRef(null),v=b.useRef(r);v.current=r;function T(C){g(C),j.current&&clearTimeout(j.current);const F=C.trim();if(!F){v.current("");return}j.current=setTimeout(()=>v.current(F),iN)}const w=y&&(l==null?void 0:l.query)===x?l:null;function A(){if(!w)return[a.jsx("p",{className:"fsrow__pending",children:"ищем…"},"grep:wait")];if(w.matches.length===0)return[a.jsx("p",{className:"fsrow__pending",children:"ничего не найдено"},"grep:empty")];const C=[];let F="";for(const Q of w.matches)Q.path!==F&&(F=Q.path,C.push(a.jsx("p",{className:"searchgroup__path",title:Q.path,children:Q.path},`path:${Q.path}`))),C.push(a.jsx(cN,{match:Q,onClick:()=>c(Q)},`${Q.path}:${Q.line}:${Q.column}`));return w.truncated&&C.push(a.jsxs("p",{className:"fsrow__pending",children:["показаны первые ",w.matches.length," — уточните запрос"]},"grep:truncated")),C}return a.jsxs("aside",{className:(n?"sidepane sidepane--search sidepane--open":"sidepane sidepane--search")+(d?" sidepane--zoomed":""),"aria-label":"Поиск по тексту в проекте",children:[a.jsxs("div",{className:"sidepane__head",onDoubleClick:C=>{h&&(C.target.closest("button")||h())},children:[a.jsx(oN,{}),a.jsx("span",{className:"sidepane__title",children:"Поиск по тексту"}),h&&a.jsx("button",{className:"sidepane__btn",title:d?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":d?"Свернуть панель поиска":"Развернуть панель поиска на весь экран","aria-pressed":d,onClick:h,children:a.jsx(to,{active:d})}),a.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель поиска",onClick:o,children:"✕"})]}),a.jsxs("div",{className:"fssearch",children:[a.jsx(uN,{}),a.jsx("input",{className:"fssearch__input",type:"text",value:m,spellCheck:!1,placeholder:"Поиск по тексту во всех файлах…","aria-label":"Поиск по тексту во всех файлах",onChange:C=>T(C.target.value),onKeyDown:C=>{C.stopPropagation(),C.key==="Escape"&&(C.preventDefault(),m?T(""):C.currentTarget.blur())}}),m&&a.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>T(""),children:"✕"})]}),a.jsx("div",{className:"sidepane__scroll fstree",children:y?A():a.jsx("p",{className:"sidepane__empty",children:"Введите текст, чтобы найти его во всех файлах проекта."})})]})}function cN({match:n,onClick:l}){const r=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:l,title:`${n.path}:${n.line}`,children:[a.jsx("span",{className:"searchmatch__line",children:n.line}),a.jsxs("span",{className:"searchmatch__text",children:[r,a.jsx("mark",{children:c}),o]})]})}function oN(){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 uN(){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 Ld=null;function dN(){return Ld||(Ld=Promise.all([lt(()=>import("./index-Bng1dR8P.js"),__vite__mapDeps([19,4,3,2,20,5]),import.meta.url),lt(()=>import("./index-891wE-Rj.js").then(n=>n.v),__vite__mapDeps([4,3]),import.meta.url),lt(()=>import("./index-BHot-lnj.js"),[],import.meta.url),lt(()=>import("./index-MdNspwJW.js"),__vite__mapDeps([20,3,4,2]),import.meta.url),lt(()=>import("./codemirror-BFhD_Qok.js"),__vite__mapDeps([21,2,3,4]),import.meta.url)]).then(([n,l,r,c,o])=>({EditorView:l.EditorView,EditorState:r.EditorState,Compartment:r.Compartment,EditorSelection:r.EditorSelection,Prec:r.Prec,keymap:l.keymap,indentWithTab:c.indentWithTab,basicSetup:n.basicSetup,editorTheme:o.editorTheme,editorHighlight:o.editorHighlight})).catch(n=>{throw Ld=null,n})),Ld}function fN({path:n,doc:l,revision:r,goto:c,onChange:o,onSave:d}){const h=b.useRef(null),m=b.useRef(null),g=b.useRef(null),x=b.useRef(new Map),y=b.useRef(new Map),j=b.useRef(new Set),v=b.useRef(null),T=b.useRef(o),w=b.useRef(d),A=b.useRef(n),C=b.useRef(r),F=b.useRef(l);T.current=o,w.current=d,A.current=n,C.current=r,F.current=l;const[Q,I]=b.useState("loading"),[L,G]=b.useState(!1);function M(O,P,U,B,J){const me=x.current.get(B),we=y.current.get(B)===J;if(me&&we)U.setState(me);else{const $=O.EditorState.create({doc:F.current,extensions:[O.basicSetup,O.Prec.highest(O.keymap.of([{key:"Mod-s",preventDefault:!0,run:()=>(w.current(A.current),!0)}])),O.keymap.of([O.indentWithTab]),P.of([]),O.editorTheme,O.editorHighlight,O.EditorView.updateListener.of(Y=>{Y.docChanged&&T.current(A.current,Y.state.doc.toString())})]});x.current.set(B,$),y.current.set(B,J),U.setState($),j.current.delete(B)}if(j.current.has(B))return()=>{};let ve=!1;return G1(B).then($=>{ve||!$||A.current!==B||(U.dispatch({effects:P.reconfigure($)}),x.current.set(B,U.state),j.current.add(B))}),()=>{ve=!0}}b.useEffect(()=>{if(!h.current)return;let P=!1,U=null,B=null;I("loading"),G(!1);const J=window.setTimeout(()=>{P||G(!0)},200);return(async()=>{let me;try{me=await dN()}catch{window.clearTimeout(J),P||I("error");return}if(P||!h.current)return;window.clearTimeout(J);const we=new me.Compartment;v.current=we,g.current=me,B=new me.EditorView({parent:h.current}),m.current=B,U=M(me,we,B,A.current,C.current),I("ready")})(),()=>{P=!0,window.clearTimeout(J),U==null||U(),B==null||B.destroy(),m.current===B&&(m.current=null),g.current=null,v.current=null}},[]),b.useEffect(()=>{const O=g.current,P=m.current,U=v.current;if(!(!O||!P||!U))return M(O,U,P,n,r)},[n,r]);const z=b.useRef(0);return b.useEffect(()=>{const O=m.current,P=g.current;if(!O||!P||!c||c.token===z.current)return;z.current=c.token;const U=O.state.doc.lines,B=Math.min(Math.max(c.line,1),U),J=O.state.doc.line(B),me=Math.min(J.from+Math.max(c.column-1,0),J.to);O.dispatch({selection:P.EditorSelection.cursor(me),effects:P.EditorView.scrollIntoView(me,{y:"center"})}),O.focus()},[c]),b.useEffect(()=>()=>{const O=m.current;O&&x.current.set(n,O.state)},[n]),a.jsxs("div",{className:"editor__code",children:[a.jsx("div",{ref:h,className:"editor__code-surface"+(Q==="ready"?"":" is-hidden")}),Q==="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:"Загружается редактор…"})]}),Q==="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:l})]})]})}function Yl({value:n,options:l,onChange:r,className:c,title:o,ariaLabel:d,placeholder:h="—"}){const[m,g]=b.useState(!1),[x,y]=b.useState(0),j=b.useRef(null),v=b.useRef(null),T=l.find(C=>C.value===n)??null;b.useEffect(()=>{if(!m)return;const C=l.findIndex(F=>F.value===n);y(C===-1?0:C)},[m]),b.useEffect(()=>{if(!m)return;function C(F){var Q;(Q=j.current)!=null&&Q.contains(F.target)||g(!1)}return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[m]),b.useEffect(()=>{var C,F;m&&((F=(C=v.current)==null?void 0:C.querySelector(".is-cursor"))==null||F.scrollIntoView({block:"nearest"}))},[m,x]),b.useEffect(()=>{if(!m)return;const C=v.current,F=hN(j.current);if(!C||!F)return;const Q=C.getBoundingClientRect().bottom-F.getBoundingClientRect().bottom;Q>0&&(F.scrollTop+=Math.min(Q+8,C.offsetHeight))},[m]);function w(C){g(!1),C.value!==n&&r(C.value)}function A(C){if(C.key==="Escape"){if(!m)return;C.preventDefault(),C.stopPropagation(),g(!1);return}if(C.key==="ArrowDown"||C.key==="ArrowUp"){if(C.preventDefault(),!m)return g(!0);const F=C.key==="ArrowDown"?1:l.length-1;return y(Q=>(Q+F)%l.length)}if(C.key==="Enter"||C.key===" "){if(C.preventDefault(),!m)return g(!0);const F=l[x];F&&w(F)}}return a.jsxs("div",{ref:j,className:"select"+(m?" select--open":"")+(c?` ${c}`:""),children:[a.jsxs("button",{type:"button",className:"select__trigger",title:o,"aria-label":d??o,"aria-haspopup":"listbox","aria-expanded":m,onClick:()=>g(C=>!C),onKeyDown:A,children:[a.jsx("span",{className:"select__value",children:(T==null?void 0:T.label)??h}),a.jsx(pN,{})]}),m&&a.jsx("div",{ref:v,className:"select__menu",role:"listbox","aria-label":d??o,children:l.map((C,F)=>a.jsxs("button",{type:"button",role:"option","aria-selected":C.value===n,className:"select__option"+(F===x?" is-cursor":"")+(C.value===n?" is-on":""),onMouseEnter:()=>y(F),onClick:()=>w(C),children:[a.jsx("span",{className:"select__check","aria-hidden":"true",children:C.value===n?"✓":""}),a.jsx("span",{className:"select__label",children:C.label}),C.hint&&a.jsx("span",{className:"select__hint",children:C.hint})]},C.value))})]})}function hN(n){let l=(n==null?void 0:n.parentElement)??null;for(;l;){if(l.scrollHeight>l.clientHeight&&getComputedStyle(l).overflowY!=="visible")return l;l=l.parentElement}return null}function pN(){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 mN(){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 gN(){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 xN(){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 bN({path:n,mime:l,base64:r,error:c,tooLarge:o,size:d,onRequestMedia:h}){b.useEffect(()=>{!o&&r===void 0&&c===void 0&&h(n)},[]);const m=_N(r,l);return o?a.jsx("div",{className:"mediaview mediaview--message",children:a.jsxs("p",{className:"mediaview__error",children:["Файл слишком велик для просмотра (",Zd(d),"). Лимит — 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:"Повторить"})]}):m?l.startsWith("image/")?a.jsx(vN,{url:m}):l.startsWith("video/")?a.jsx(NN,{url:m}):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 _N(n,l){const[r,c]=b.useState(null);return b.useEffect(()=>{if(n===void 0){c(null);return}const o=atob(n),d=new Uint8Array(o.length);for(let m=0;m<o.length;m++)d[m]=o.charCodeAt(m);const h=URL.createObjectURL(new Blob([d],{type:l}));return c(h),()=>URL.revokeObjectURL(h)},[n,l]),r}const Qi=1,gy=8,zd=1.25;function yN(n){return Math.min(gy,Math.max(Qi,n))}function vN({url:n}){const[l,r]=b.useState({scale:Qi,x:0,y:0}),[c,o]=b.useState(!1),d=b.useRef(null),h=b.useRef(null);function m(T,w,A){r(C=>{const F=yN(C.scale*T);if(F===C.scale)return C;if(F<=Qi)return{scale:Qi,x:0,y:0};const Q=(w-C.x)/C.scale,I=(A-C.y)/C.scale;return{scale:F,x:w-F*Q,y:A-F*I}})}b.useEffect(()=>{const T=d.current;if(!T)return;function w(A){A.preventDefault();const C=T.getBoundingClientRect(),F=A.clientX-C.left-C.width/2,Q=A.clientY-C.top-C.height/2;m(A.deltaY<0?zd:1/zd,F,Q)}return T.addEventListener("wheel",w,{passive:!1}),()=>T.removeEventListener("wheel",w)},[]);function g(T){l.scale<=Qi||(T.currentTarget.setPointerCapture(T.pointerId),h.current={pointerId:T.pointerId,startX:T.clientX,startY:T.clientY,origX:l.x,origY:l.y},o(!0))}function x(T){const w=h.current;!w||w.pointerId!==T.pointerId||r(A=>({...A,x:w.origX+(T.clientX-w.startX),y:w.origY+(T.clientY-w.startY)}))}function y(){h.current=null,o(!1)}const j=l.scale>Qi,v=!j&&l.x===0&&l.y===0;return a.jsxs("div",{className:"mediaview mediaview--image",children:[a.jsx("div",{ref:d,className:"mediaview__stage"+(j?c?" is-dragging":" is-zoomed":""),onPointerDown:g,onPointerMove:x,onPointerUp:y,onPointerCancel:y,children:a.jsx("img",{src:n,alt:"",className:"mediaview__image",draggable:!1,style:{transform:`translate(${l.x}px, ${l.y}px) scale(${l.scale})`}})}),a.jsxs("div",{className:"mediaview__toolbar",children:[a.jsx("button",{className:"btn btn--sm",disabled:l.scale<=Qi,title:"Уменьшить","aria-label":"Уменьшить",onClick:()=>m(1/zd,0,0),children:a.jsx(gN,{})}),a.jsxs("span",{className:"mediaview__zoomlabel",children:[Math.round(l.scale*100),"%"]}),a.jsx("button",{className:"btn btn--sm",disabled:l.scale>=gy,title:"Увеличить","aria-label":"Увеличить",onClick:()=>m(zd,0,0),children:a.jsx(mN,{})}),a.jsx("button",{className:"btn btn--sm",disabled:v,title:"Вписать в окно","aria-label":"Сбросить масштаб — вписать в окно",onClick:()=>r({scale:Qi,x:0,y:0}),children:a.jsx(xN,{})})]})]})}const jN=[{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 NN({url:n}){const l=b.useRef(null),[r,c]=b.useState("1");return b.useEffect(()=>{l.current&&(l.current.playbackRate=Number(r))},[r]),a.jsxs("div",{className:"mediaview mediaview--video",children:[a.jsx("video",{ref:l,className:"mediaview__video",src:n,controls:!0}),a.jsxs("div",{className:"mediaview__speedbar",children:[a.jsx("span",{className:"mediaview__speedlabel",children:"Скорость"}),a.jsx(Yl,{className:"mediaview__speedselect",value:r,onChange:c,ariaLabel:"Скорость воспроизведения",options:jN})]})]})}function wN({file:n,goto:l,onChange:r,onSave:c,onReload:o,onOverwrite:d,onRequestMedia:h,onTogglePreview:m}){const g=si(n),x=py(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:[Zd(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&&m(n.path),children:"Просмотр"}),a.jsx("button",{className:"btn btn--sm"+(n.previewMode?"":" is-on"),role:"tab","aria-selected":!n.previewMode,onClick:()=>n.previewMode&&m(n.path),children:"Код"})]}),a.jsx("button",{className:"btn btn--sm",disabled:!g,title:"Сохранить (Ctrl+S)",onClick:()=>c(n.path),children:g?"Сохранить":"Сохранено"})]}),n.stale&&a.jsxs("div",{className:"editor__warn",children:[a.jsxs("span",{children:["Файл изменился на диске",g?" — а здесь есть несохранённые правки.":"."]}),a.jsx("button",{className:"btn btn--sm",onClick:()=>o(n.path),children:"Взять с диска"}),g&&a.jsx("button",{className:"btn btn--sm btn--danger",onClick:()=>d(n.path),children:"Сохранить поверх"})]}),n.binary&&n.mediaMime?a.jsx(bN,{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:["Это не текстовый файл — редактировать его здесь нечем. ",Zd(n.size)," на диске."]}):n.tooLarge?a.jsxs("p",{className:"editor__empty",children:["Файл слишком велик для редактора (",Zd(n.size),"). Такие правит агент, а не браузер."]}):x&&n.previewMode?a.jsx(kN,{text:n.text}):a.jsx(fN,{path:n.path,doc:n.text,revision:n.revision,goto:l,onChange:r,onSave:c})]})}function kN({text:n}){const[l,r]=b.useState("");return b.useEffect(()=>{let c=!1;return mf(n).then(o=>{c||r(o)}),()=>{c=!0}},[n]),a.jsx("div",{className:"markdown-preview",dangerouslySetInnerHTML:{__html:l}})}function SN({files:n,activePath:l,busy:r,onSelect:c,onClose:o,zoomed:d,onToggleZoom:h}){return a.jsxs("div",{className:"worktabs",role:"tablist",onDoubleClick:m=>{h&&(m.target.closest("button")||h())},children:[a.jsxs("button",{className:"worktab"+(l===null?" is-on":""),role:"tab","aria-selected":l===null,onClick:()=>c(null),onDoubleClick:()=>h==null?void 0:h(),children:[a.jsx("span",{className:"worktab__name",children:"Разговор"}),r&&a.jsx("span",{className:"worktab__dot worktab__dot--busy",title:"Агент работает"})]}),n.map(m=>a.jsxs("div",{className:"worktab"+(m.path===l?" is-on":""),role:"tab","aria-selected":m.path===l,onDoubleClick:g=>{h&&(g.target.closest(".worktab__close, .worktab__dot")||h())},children:[a.jsx("button",{className:"worktab__name",title:m.path,onClick:()=>c(m.path),children:V1(m.path)}),si(m)?a.jsx("button",{className:"worktab__dot",title:"Не сохранено — закрыть","aria-label":`Закрыть ${m.path}`,onClick:()=>o(m.path)}):a.jsx("button",{className:"worktab__close",title:"Закрыть","aria-label":`Закрыть ${m.path}`,onClick:()=>o(m.path),children:"✕"})]},m.path)),a.jsx("div",{className:"worktabs__spacer"}),h&&a.jsx("button",{className:"worktabs__zoom",title:d?"Свернуть — то же самое, что двойной клик по вкладке":"Развернуть на весь экран — то же самое, что двойной клик по вкладке","aria-label":d?"Свернуть колонку разговора":"Развернуть колонку разговора на весь экран","aria-pressed":d,onClick:h,children:a.jsx(to,{active:d})})]})}function vl(n){return n.claudeSessionId??n.id}function Fd(n,l,r,c){if(!l||l.length===0)return n;const o=new Map(l.map((m,g)=>[m,g])),d=[],h=[];for(const m of n)(o.has(r(m))?d:h).push(m);return d.sort((m,g)=>o.get(r(m))-o.get(r(g))),c==="top"?[...h,...d]:[...d,...h]}function $b(n){return n.state!=="closed"}function xy(n){return[...n.filter($b),...n.filter(l=>!$b(l))]}function Ud(n,l,r,c){if(l===r||!n.includes(l)||!n.includes(r))return null;const o=n.filter(m=>m!==l),d=o.indexOf(r)+(c==="after"?1:0),h=[...o.slice(0,d),l,...o.slice(d)];return h.every((m,g)=>m===n[g])?null:h}function em(n,l,r,c){const o=n%10,d=n%100;return o===1&&d!==11?l:o>=2&&o<=4&&(d<12||d>14)?r:c}function by(n){return`${n} ${em(n,"агент","агента","агентов")}`}function EN(n){const l=n.filter(o=>o.kind==="agent").length,r=n.length-l,c=[];return l>0&&c.push(by(l)),r>0&&c.push(`${r} ${em(r,"задача","задачи","задач")} в фоне`),c.join(" · ")}function TN(n){switch(n.kind){case"agent":return n.agentType??"агент";case"shell":return"команда";case"workflow":return"сценарий";default:return"задача"}}function CN(n){const l=Math.max(0,Math.floor(n/1e3)),r=Math.floor(l/3600),c=Math.floor(l%3600/60),o=l%60,d=String(o).padStart(2,"0");return r>0?`${r}:${String(c).padStart(2,"0")}:${d}`:`${c}:${d}`}function AN(n){return n<1e3?`${n} ток.`:`${(n/1e3).toFixed(1).replace(".",",")} k ток.`}function MN({tasks:n,onStop:l}){const[r,c]=b.useState(!1),[o,d]=b.useState(()=>Date.now()),[h,m]=b.useState(()=>new Set);b.useEffect(()=>{const x=window.setInterval(()=>d(Date.now()),1e3);return()=>window.clearInterval(x)},[]),b.useEffect(()=>{m(x=>{const y=new Set(n.map(v=>v.id)),j=new Set([...x].filter(v=>y.has(v)));return j.size===x.size?x:j})},[n]);const g=x=>{m(y=>new Set(y).add(x)),l(x),window.setTimeout(()=>{m(y=>{if(!y.has(x))return y;const j=new Set(y);return j.delete(x),j})},1e4)};return a.jsxs("div",{className:r?"tasks is-open":"tasks",children:[a.jsxs("button",{type:"button",className:"tasks__toggle","aria-expanded":r,"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:EN(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"})})]}),r&&a.jsx("ul",{className:"tasks__list",id:"tasks-list",children:n.map(x=>{const y=h.has(x.id);return a.jsxs("li",{className:y?"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:TN(x)}),x.background&&a.jsx("span",{className:"task__bg",children:"фон"}),a.jsx("span",{className:"task__time",children:CN(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:[AN(x.tokens)," · ",x.toolUses," ",em(x.toolUses,"вызов","вызова","вызовов")]})]}),a.jsx("button",{type:"button",className:"btn btn--sm btn--danger task__stop",disabled:y,"aria-label":`Остановить: ${x.description}`,onClick:()=>g(x.id),children:y?"Останавливается":"Стоп"})]},x.id)})})]})}const RN=""+new URL("antigravity-logo-DRKQga2U.png",import.meta.url).href;function tm({className:n}){return a.jsx("img",{src:RN,alt:"","aria-hidden":"true",className:n,style:{aspectRatio:"200 / 184"}})}const DN=450,ON=6,LN={claude:{label:"Claude",hint:"Claude Code — как обычно"},antigravity:{label:"Antigravity",hint:"Google agy, отдельная палитра и права"}};function zN({disabled:n,providers:l,lastAccountId:r,onStart:c,onSignIn:o}){var $;const{accounts:d,auth:h,multi:m}=Ip(),g=["claude","antigravity"].filter(Y=>l.includes(Y)).flatMap(Y=>Y==="claude"&&m?d.map(W=>{const he=h[W.id],Se=R_(he);return{key:`claude:${W.id}`,id:"claude",label:W.name,hint:Se?`Claude Code, ${Se}`:"Claude Code",account:W,isDefault:W.id===r,needsLogin:W.id!==Ki&&he!=null&&!he.loggedIn}}):[{key:Y,id:Y,...LN[Y]}]),x=g.length>1,y=g.find(Y=>Y.isDefault)??g[0],j=Math.max(0,g.indexOf(y)),[v,T]=b.useState(!1),[w,A]=b.useState(0),[C,F]=b.useState({left:0,top:0}),Q=b.useRef(null),I=b.useRef(null),L=b.useRef(null);function G(){L.current&&window.clearTimeout(L.current.timer),L.current=null}function M(){G(),A(j),T(!0)}function z(Y){var W;T(!1),Y&&((W=Q.current)==null||W.focus())}function O(Y){if(n||!x||Y.button!==0)return;const W={timer:0,x:Y.clientX,y:Y.clientY,fired:!1};W.timer=window.setTimeout(()=>{W.fired=!0,M()},DN),L.current=W}function P(Y){const W=L.current;!W||W.fired||Math.hypot(Y.clientX-W.x,Y.clientY-W.y)>ON&&G()}function U(){L.current&&!L.current.fired&&G()}function B(Y){var W;if((W=L.current)!=null&&W.fired){L.current=null,Y.preventDefault();return}n||y&&we(y)}function J(Y){x&&(Y.preventDefault(),!n&&M())}function me(Y){if(n||!x)return;(Y.key==="ArrowDown"||Y.key==="ArrowUp"||Y.key==="Enter"&&Y.shiftKey)&&(Y.preventDefault(),M())}b.useLayoutEffect(()=>{if(!v)return;const Y=Q.current,W=I.current;if(!Y||!W)return;const he=Y.getBoundingClientRect(),Se=W.getBoundingClientRect(),k=8,se=Math.max(k,Math.min(he.right-Se.width,window.innerWidth-Se.width-k));let q=he.top-Se.height-8;q<k&&(q=Math.min(he.bottom+8,window.innerHeight-Se.height-k)),F({left:se,top:q})},[v]),b.useLayoutEffect(()=>{var Y;v&&((Y=I.current)==null||Y.focus())},[v]),b.useLayoutEffect(()=>{if(!v)return;function Y(W){var Se,k;const he=W.target;!((Se=I.current)!=null&&Se.contains(he))&&!((k=Q.current)!=null&&k.contains(he))&&z(!1)}return document.addEventListener("mousedown",Y),()=>document.removeEventListener("mousedown",Y)},[v]);function we(Y){var W;if(z(!1),Y.needsLogin&&Y.account){o(Y.account.id);return}c(Y.id,(W=Y.account)==null?void 0:W.id)}function ve(Y){if(Y.key==="Escape"){Y.preventDefault(),Y.stopPropagation(),z(!0);return}if(Y.key==="ArrowDown"||Y.key==="ArrowUp"){Y.preventDefault();const W=Y.key==="ArrowDown"?1:-1;A(he=>(he+W+g.length)%g.length);return}if(Y.key==="Enter"||Y.key===" "){Y.preventDefault();const W=g[w];W&&we(W);return}Y.key==="Tab"&&z(!1)}return a.jsxs("div",{className:"newsession",children:[a.jsxs("button",{ref:Q,type:"button",className:"btn btn--primary newsession__btn",disabled:n,title:x?m?`Новая сессия под «${(($=y==null?void 0:y.account)==null?void 0:$.name)??""}». Удерживайте, чтобы выбрать агента или аккаунт`:"Удерживайте, чтобы выбрать агента":void 0,"aria-label":m&&(y!=null&&y.account)?`Новая сессия, аккаунт «${y.account.name}»`:void 0,"aria-haspopup":x?"menu":void 0,"aria-expanded":x?v:void 0,onClick:B,onContextMenu:J,onPointerDown:O,onPointerMove:P,onPointerUp:U,onPointerCancel:U,onPointerLeave:U,onKeyDown:me,children:["+ Сессия",m&&(y==null?void 0:y.account)&&a.jsx("span",{className:`newsession__acct acct--${y.account.color}`,"aria-hidden":"true"}),x&&a.jsx(UN,{})]}),v&&x&&a.jsx("div",{ref:I,className:"newsession__menu",style:{left:C.left,top:C.top},role:"menu","aria-label":m?"Выбрать агента и аккаунт для новой сессии":"Выбрать агента для новой сессии",tabIndex:-1,onKeyDown:ve,children:g.map((Y,W)=>{var he;return a.jsxs("button",{type:"button",role:"menuitem",className:"newsession__item"+(W===w?" is-cursor":"")+(W>0&&((he=g[W-1])==null?void 0:he.id)!==Y.id?" newsession__item--sep":""),onMouseEnter:()=>A(W),onClick:()=>we(Y),children:[Y.account?a.jsx("span",{className:"newsession__mark newsession__mark--account",children:a.jsx(wa,{account:Y.account,size:"md"})}):a.jsx("span",{className:`newsession__mark newsession__mark--${Y.id}`,"aria-hidden":"true",children:Y.id==="antigravity"?a.jsx(tm,{className:"newsession__mark-logo"}):a.jsx(HN,{})}),a.jsxs("span",{className:"newsession__text",children:[a.jsx("span",{className:"newsession__label",children:Y.label}),a.jsx("span",{className:"newsession__hint",children:Y.hint})]}),Y.needsLogin?a.jsx("span",{className:"newsession__tag newsession__tag--login",children:"Войти"}):Y.isDefault&&a.jsx("span",{className:"newsession__tag",children:"по клику"})]},Y.key)})})]})}function UN(){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 HN(){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 _y="ccv:sidebar.collapsed",yy="ccv:sidebar.mode",vy="ccv:sidebar.foldersCollapsed",qb="ccv:sidebar.expandedProjects",Gb="ccv:sidebar.expandedProjectArchives",BN=500,Rp="транскрипт остаётся на диске — сессию можно вернуть из архива в любой момент.";function IN({open:n,connected:l,status:r,workspaces:c,archivedWorkspaces:o,workspaceFolders:d,sessionFolders:h,pinnedFolders:m,projectSessions:g,onRequestSessions:x,pinned:y,live:j,listOrder:v,liveSessionsFirst:T,onReorder:w,activeWorkspaceId:A,activeSessionId:C,onSelectWorkspace:F,onRenameSession:Q,onStopSession:I,onPinSessions:L,onSelectPinned:G,onCloseWorkspaces:M,onRestoreWorkspaces:z,onArchiveSessions:O,onUnarchiveSessions:P,onCreateFolder:U,onRenameFolder:B,onSetFolderColor:J,onDeleteFolder:me,onAssignToFolder:we,onOpenWorkspace:ve,onNewSession:$,enabledProviders:Y,lastAccountId:W,onSignInAccount:he,onOpenExtensions:Se,account:k,onOpenAccount:se,relay:q,onOpenRelay:je,onOpenSettings:te,themeMode:ke,onCycleTheme:De}){var kl;const Ge=Ip(),[He,bt]=b.useState(null),[Ve,fn]=b.useState(null),[We,at]=b.useState(null);function ct(E){return(We==null?void 0:We.folderId)===E.id?We.color??void 0:E.color}function jt(E){const oe=E&&ct(E);return oe?{"--folder-color":oe}:void 0}const ut=b.useRef(void 0),[$t,wt]=b.useState(null),[Ce,Pe]=b.useState(null),[Rt,dt]=b.useState(""),[Fe,bn]=b.useState(ew),[ts,Lt]=b.useState(tw),[kt,hs]=b.useState(nw),[hn,tn]=b.useState(()=>Xb(qb)),[ps,_n]=b.useState(()=>Xb(Gb)),[Ft,Cn]=b.useState([]);function zt(E){hs(E);try{localStorage.setItem(yy,E)}catch{}}const Tt=Rt.trim().toLowerCase(),re=Tt!=="",ye=b.useMemo(()=>Fd(c,v==null?void 0:v.workspaces,E=>E.id,"bottom"),[c,v]),Xe=b.useMemo(()=>{const E=Fd(y,v==null?void 0:v.pinned,vl,"bottom");return T?xy(E):E},[y,v,T]),it=b.useMemo(()=>Fd(j,v==null?void 0:v.live,vl,"bottom"),[j,v]),Je=b.useMemo(()=>{const E=new Map,oe=new Map,Te=new Map,Qe=new Map(c.map(ot=>[ot.id,ot.folderId]));for(const ot of j){const Zt=ky(ot);fp(E,ot.workspaceId,Zt),ot.folderId&&fp(oe,ot.folderId,Zt);const Yn=Qe.get(ot.workspaceId);Yn&&fp(Te,Yn,Zt)}return{byWorkspace:E,bySessionFolder:oe,byWorkspaceFolder:Te}},[j,c]),nn=E=>E.name.toLowerCase().includes(Tt)||E.path.toLowerCase().includes(Tt),Z=b.useMemo(()=>re?ye.filter(E=>{if(nn(E))return!0;const oe=g[E.id];return!!oe&&(oe.sessions.some(Te=>hu(Te,Tt))||oe.archived.some(Te=>hu(Te,Tt)))}):ye,[ye,g,Tt,re]),fe=b.useMemo(()=>re?o.filter(nn):o,[o,Tt,re]),Me=E=>{var oe;return((oe=c.find(Te=>Te.id===E))==null?void 0:oe.name)??"—"},$e=E=>{var oe;return(oe=c.find(Te=>Te.id===E))==null?void 0:oe.path},Dt=b.useMemo(()=>re?Xe.filter(E=>(E.title??"").toLowerCase().includes(Tt)||Me(E.workspaceId).toLowerCase().includes(Tt)):Xe,[Xe,c,Tt,re]),pn=b.useMemo(()=>re?it.filter(E=>(E.title??"").toLowerCase().includes(Tt)||Me(E.workspaceId).toLowerCase().includes(Tt)):it,[it,c,Tt,re]),An=!re;function Fs(E){bn(oe=>{const Te=oe.includes(E)?oe.filter(Qe=>Qe!==E):[...oe,E];try{localStorage.setItem(_y,JSON.stringify(Te))}catch{}return Te})}const yn=E=>!Fe.includes(E);function cl(E){Lt(oe=>{const Te=oe.includes(E)?oe.filter(Qe=>Qe!==E):[...oe,E];try{localStorage.setItem(vy,JSON.stringify(Te))}catch{}return Te})}const ws=E=>!ts.includes(E);function ns(E,oe){tn(Te=>{if(Te.includes(E)===oe)return Te;const Qe=oe?[...Te,E]:Te.filter(ot=>ot!==E);return Vb(qb,Qe),Qe})}function Vl(E){_n(oe=>{const Te=oe.includes(E)?oe.filter(Qe=>Qe!==E):[...oe,E];return Vb(Gb,Te),Te})}b.useEffect(()=>{A&&ns(A,!0)},[A]),b.useEffect(()=>Cn(E=>E.length?[]:E),[Tt]);const ks=b.useRef(new Set);b.useEffect(()=>{if(!l){ks.current.clear();return}for(const E of hn)ks.current.has(E)||!c.some(oe=>oe.id===E)||(ks.current.add(E),E!==A&&x(E))},[l,hn,c,A]);function Us(E){const oe=g[E.id],Te=!re||nn(E),Qe=!Te,ot=Qe?!Ft.includes(E.id):hn.includes(E.id),Zt=oe?Te?oe.sessions.length:oe.sessions.filter(Yn=>hu(Yn,Tt)).length:void 0;return{entry:oe,showAll:Te,forced:Qe,open:ot,count:Zt}}function sn(E,oe){if(oe.forced){Cn(Te=>Te.includes(E.id)?Te.filter(Qe=>Qe!==E.id):[...Te,E.id]);return}ns(E.id,!oe.open)}const et=b.useMemo(()=>mu(Z,d,void 0,!re),[Z,d,re]),$n=b.useMemo(()=>mu(fe,d),[fe,d]),ol=b.useMemo(()=>mu(Dt,m,E=>E.pinnedFolderId,!re),[Dt,m,re]),Js=b.useMemo(()=>({groups:[],ungrouped:pn}),[pn]),Mn=((v==null?void 0:v.workspaces.length)??0)>0,ka=((v==null?void 0:v.pinned.length)??0)>0,ss=((v==null?void 0:v.live.length)??0)>0,ms=Wd({enabled:An,scope:"workspaces",itemKey:E=>E.id,groups:et.groups,ungrouped:et.ungrouped,onReorder:w,onMoveToGroup:(E,oe)=>{we("workspace",E,oe.folderId),oe.order&&w("workspaces",oe.order)}}),Ss=Wd({enabled:An,scope:"pinned",itemKey:vl,groups:ol.groups,ungrouped:ol.ungrouped,onReorder:w}),Rn=Wd({enabled:An,scope:"live",itemKey:vl,groups:Js.groups,ungrouped:Js.ungrouped,onReorder:w});b.useEffect(()=>{if(!We)return;const E=[...m,...d,...h].find(oe=>oe.id===We.folderId);E&&E.color===(We.color??void 0)&&at(null)},[We,m,d,h]),b.useEffect(()=>()=>window.clearTimeout(ut.current),[]);const gs=Dp(Z),ln=Dp(fe),[tt,Kn]=b.useState(null),[vn,ls]=b.useState(null),[_t,wl]=b.useState(null),[qn,Ws]=b.useState(null),as=b.useRef(null);function Zn(E,oe){const Te=E.touches[0];if(!Te)return;const Qe={timer:0,x:Te.clientX,y:Te.clientY,el:E.currentTarget,fired:!1};Qe.timer=window.setTimeout(()=>{Qe.fired=!0,oe(Qe.x,Qe.y,Qe.el)},BN),as.current=Qe}function Gn(E){const oe=as.current,Te=E.touches[0];!oe||!Te||Math.hypot(Te.clientX-oe.x,Te.clientY-oe.y)>10&&(window.clearTimeout(oe.timer),as.current=null)}function ft(E){const oe=as.current;oe&&(window.clearTimeout(oe.timer),oe.fired&&E.preventDefault())}function Nt(){var E;return(E=as.current)!=null&&E.fired?(as.current=null,!0):!1}function jn(){const E=tt==null?void 0:tt.opener;Kn(null),E!=null&&E.isConnected&&E.focus()}function ri(){const E=vn==null?void 0:vn.opener;ls(null),E!=null&&E.isConnected&&E.focus()}function Es(){const E=_t==null?void 0:_t.opener;wl(null),E!=null&&E.isConnected&&E.focus()}function ul(){const E=qn==null?void 0:qn.opener;Ws(null),E!=null&&E.isConnected&&E.focus()}function Ql(E){return{onContextMenu:oe=>{oe.preventDefault(),Kn({x:oe.clientX,y:oe.clientY,opener:oe.currentTarget,ids:gs.targetsFor(E)})},onTouchStart:oe=>Zn(oe,(Te,Qe,ot)=>Kn({x:Te,y:Qe,opener:ot,ids:gs.targetsFor(E)})),onTouchMove:Gn,onTouchEnd:ft,onTouchCancel:ft}}function ci(E){return{onContextMenu:oe=>{oe.preventDefault(),ls({x:oe.clientX,y:oe.clientY,opener:oe.currentTarget,ids:ln.targetsFor(E)})},onTouchStart:oe=>Zn(oe,(Te,Qe,ot)=>ls({x:Te,y:Qe,opener:ot,ids:ln.targetsFor(E)})),onTouchMove:Gn,onTouchEnd:ft,onTouchCancel:ft}}function Dn(E){return{onContextMenu:oe=>{oe.preventDefault(),wl({x:oe.clientX,y:oe.clientY,opener:oe.currentTarget,ids:[E.id]})},onTouchStart:oe=>Zn(oe,(Te,Qe,ot)=>wl({x:Te,y:Qe,opener:ot,ids:[E.id]})),onTouchMove:Gn,onTouchEnd:ft,onTouchCancel:ft}}function is(E){return{onContextMenu:oe=>{oe.preventDefault(),Ws({x:oe.clientX,y:oe.clientY,opener:oe.currentTarget,ids:[E.id]})},onTouchStart:oe=>Zn(oe,(Te,Qe,ot)=>Ws({x:Te,y:Qe,opener:ot,ids:[E.id]})),onTouchMove:Gn,onTouchEnd:ft,onTouchCancel:ft}}const Hs=((A?(kl=g[A])==null?void 0:kl.sessions:void 0)??[]).filter(E=>E.state!=="closed").length,qt=tt?Z.find(E=>E.id===tt.ids[0]):void 0,Ts=tt?[{id:"close",label:tt.ids.length>1?`Закрыть проекты (${tt.ids.length})`:"Закрыть проект",onSelect:()=>{M(tt.ids),gs.clear()}},...tt.ids.length===1?[{id:"new-session-folder",label:"Новая папка сессий",onSelect:()=>{const E=tt.ids[0];ns(E,!0),Pe(E)}}]:[],...uu({folders:d,ids:tt.ids,hasFolder:(qt==null?void 0:qt.folderId)!=null,assign:(E,oe)=>we("workspace",E,oe),onClear:()=>gs.clear(),onNewFolder:()=>wt("workspace")}),...tt.ids.length===1&&An?ms.menuItems(tt.ids[0],Mn):[]]:[],Ne=tt?"закрытие не удаляет проект: каталог и история сессий остаются на диске — открыть его снова можно кнопкой «+ Проект»."+(A&&tt.ids.includes(A)&&Hs>0?` в нём сейчас незавершённых сессий: ${Hs} — при закрытии они остановятся на хосте.`:""):void 0,S=vn?fe.find(E=>E.id===vn.ids[0]):void 0,ee=vn?[{id:"restore",label:vn.ids.length>1?`Вернуть проекты (${vn.ids.length})`:"Вернуть проект",onSelect:()=>{z(vn.ids),ln.clear()}},...uu({folders:d,ids:vn.ids,hasFolder:(S==null?void 0:S.folderId)!=null,assign:(E,oe)=>we("workspace",E,oe),onClear:()=>ln.clear(),onNewFolder:()=>wt("workspace")})]:[],ge=vn?"каталог и история сессий всё это время оставались на диске — восстановление их не трогает.":void 0,Ee=_t?Dt.find(E=>E.id===_t.ids[0]):void 0,Le=_t?[{id:"rename",label:"Переименовать",onSelect:()=>bt(_t.ids[0])},{id:"unpin",label:"Открепить",onSelect:()=>{Ee&&L(Ee.workspaceId,[Ee.id],!1)}},{id:"archive",label:"Убрать в архив",onSelect:()=>{Ee&&O(Ee.workspaceId,[Ee.id])}},...Ee&&Ee.workspaceId===A?uu({folders:h.filter(E=>E.workspaceId===Ee.workspaceId),ids:[Ee.id],hasFolder:Ee.folderId!=null,assign:(E,oe)=>we("session",E,oe,Ee.workspaceId),onClear:()=>{},onNewFolder:()=>{ns(Ee.workspaceId,!0),Pe(Ee.workspaceId)}}):[],...XN(Ee?uu({folders:m,ids:[Ee.id],hasFolder:Ee.pinnedFolderId!=null,assign:(E,oe)=>we("pinned",E,oe),onClear:()=>{},onNewFolder:()=>wt("pinned")}):[]),...An&&Ee?Ss.menuItems(vl(Ee),ka):[]]:[],Oe=qn?pn.find(E=>E.id===qn.ids[0]):void 0,Ct=qn?[{id:"stop",label:"Остановить",onSelect:()=>{Oe&&I(Oe)}},{id:"rename",label:"Переименовать",onSelect:()=>bt(qn.ids[0])},{id:"pin",label:(Oe==null?void 0:Oe.pinned)===!0?"Открепить":"Закрепить",onSelect:()=>{Oe&&L(Oe.workspaceId,[Oe.id],Oe.pinned!==!0)}},{id:"archive",label:"Убрать в архив",onSelect:()=>{Oe&&O(Oe.workspaceId,[Oe.id])}},...An&&Oe?Rn.menuItems(vl(Oe),ss):[]]:[],an={start:Zn,move:Gn,end:ft,consumed:Nt};function Nn(E,oe){var Zt,Yn;const Te=Us(E),Qe=`ws-branch-${E.id}`,ot=oe?1:0;return a.jsxs(b.Fragment,{children:[a.jsxs("div",{"data-row-key":E.id,"data-row-scope":"workspaces",className:Hc(E.id===A,gs.selected.includes(E.id),!1,!!oe)+" row--project"+ms.dropClass(E.id),style:Ji(ot,jt(oe)),...Ql(E),children:[pu(oe),An&&a.jsx("button",{type:"button",className:"row__grip",title:"Перетащить в другую папку или изменить порядок","aria-label":"Перетащить проект: в папку или на другое место в списке",...ms.gripHandlers(E.id),children:a.jsx(Pd,{})}),a.jsx("button",{type:"button",className:"row__chev","aria-expanded":Te.open,"aria-controls":Qe,"aria-label":`${Te.open?"Свернуть":"Развернуть"} проект «${E.name}»`,title:Te.open?"Свернуть сессии проекта":"Показать сессии проекта",onClick:()=>{Nt()||sn(E,Te)},children:a.jsx(gf,{open:Te.open})}),a.jsxs("button",{className:"row__main",onClick:wn=>{Nt()||gs.click(wn,E,()=>{F(E.id),ns(E.id,!0)})},onKeyDown:wn=>ms.onKeyDown(E.id,wn),children:[a.jsxs("span",{className:"row__title",children:[E.name,E.hasClaudeMd&&" ·"]}),a.jsx("span",{className:"row__meta",title:E.path,children:E.path})]}),a.jsx(Sy,{agg:Je.byWorkspace.get(E.id)}),Te.count!==void 0&&a.jsx("span",{className:"sidebar__count row__count",title:"Всего сессий в проекте, запущенных и нет",children:Te.count})]}),Te.open&&a.jsx("div",{id:Qe,role:"group","aria-label":`Сессии проекта «${E.name}»`,className:oe?"tree__branch tree__branch--railed":"tree__branch",style:Ji(ot,jt(oe)),children:a.jsx($N,{workspace:E,baseDepth:ot+1,loaded:Te.entry!==void 0,sessions:((Zt=Te.entry)==null?void 0:Zt.sessions)??Yb,archived:((Yn=Te.entry)==null?void 0:Yn.archived)??Yb,folders:h.filter(wn=>wn.workspaceId===E.id),needle:Tt,showAll:Te.showAll,reorderEnabled:An,listOrder:v,liveSessionsFirst:T,activeSessionId:C,archiveExpanded:ps.includes(E.id),onToggleArchive:()=>Vl(E.id),creatingFolder:Ce===E.id,onStartCreateFolder:()=>Pe(E.id),onFinishCreateFolder:()=>Pe(null),renamingId:He,setRenamingId:bt,renderFolderHead:Ps,liveInFolder:Je.bySessionFolder,isFolderOpen:ws,folderRowStyle:jt,longPress:an,onOpenSession:G,onRenameSession:Q,onPinSessions:L,onArchiveSessions:O,onUnarchiveSessions:P,onCreateFolder:U,onAssignToFolder:we,onReorder:w})})]},E.id)}function Ut(E,oe){return a.jsxs("div",{className:Hc(E.id===A,ln.selected.includes(E.id),!1,!!oe),style:jt(oe),...ci(E),children:[pu(oe),a.jsxs("button",{className:"row__main",onClick:Te=>{Nt()||ln.click(Te,E,()=>F(E.id))},children:[a.jsxs("span",{className:"row__title",children:[E.name,E.hasClaudeMd&&" ·"]}),a.jsx("span",{className:"row__meta",children:ow(E)})]}),a.jsx("button",{className:"row__restore",title:"Вернуть проект из архива",onClick:()=>z([E.id]),children:"Вернуть"})]},E.id)}function zn(E,oe){const Te=vl(E);return a.jsxs("div",{"data-row-key":Te,"data-row-scope":"pinned",className:Hc(E.id===C,!1,E.provider==="antigravity",!!oe,!0)+Ss.dropClass(Te),style:jt(oe),...He===E.id?{}:{title:"Действия со строкой — правый клик или долгое нажатие",...Dn(E)},children:[pu(oe),He===E.id?a.jsx("div",{className:"row__main",children:a.jsx(ja,{value:E.title??"",onCommit:Qe=>{Q(E,Qe),bt(null)},onCancel:()=>bt(null)})}):a.jsxs(a.Fragment,{children:[An&&a.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...Ss.gripHandlers(Te),children:a.jsx(Pd,{})}),a.jsx("button",{className:"row__main row__main--session",onClick:()=>{Nt()||G(E)},onKeyDown:Qe=>Ss.onKeyDown(Te,Qe),children:a.jsx(of,{session:E,pinned:!1,projectName:Me(E.workspaceId),projectPath:$e(E.workspaceId)})})]})]},E.id)}function mn(E){const oe=vl(E);return a.jsx("div",{"data-row-key":oe,"data-row-scope":"live",className:Hc(E.id===C,!1,E.provider==="antigravity",!1,!0)+Rn.dropClass(oe),...He===E.id?{}:{title:"Действия со строкой — правый клик или долгое нажатие",...is(E)},children:He===E.id?a.jsx("div",{className:"row__main",children:a.jsx(ja,{value:E.title??"",onCommit:Te=>{Q(E,Te),bt(null)},onCancel:()=>bt(null)})}):a.jsxs(a.Fragment,{children:[An&&a.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...Rn.gripHandlers(oe),children:a.jsx(Pd,{})}),a.jsx("button",{className:"row__main row__main--session",onClick:()=>{Nt()||G(E)},onKeyDown:Te=>Rn.onKeyDown(oe,Te),children:a.jsx(of,{session:E,pinned:E.pinned===!0,projectName:Me(E.workspaceId),projectPath:$e(E.workspaceId)})}),a.jsx("button",{type:"button",className:"row__stop",title:"Остановить сессию","aria-label":"Остановить сессию",onClick:Te=>{Te.stopPropagation(),!Nt()&&I(E)},children:a.jsx(FN,{})})]})},E.id)}function Ps(E,oe,Te={}){return a.jsx(KN,{folder:E,count:oe,live:Te.live,depth:Te.depth??0,droppable:Te.droppable===!0,dropActive:Te.droppable===!0&&ms.isDropFolder(E.id),open:ws(E.id),renaming:Ve===E.id,onToggle:()=>cl(E.id),onStartRename:()=>fn(E.id),onCommitRename:Qe=>{B(E.id,Qe),fn(null)},onCancelRename:()=>fn(null),onDelete:()=>me(E.id),color:ct(E),onPreviewColor:Qe=>{window.clearTimeout(ut.current),at({folderId:E.id,color:Qe})},onCommitColor:Qe=>{at({folderId:E.id,color:Qe}),J(E.id,Qe),window.clearTimeout(ut.current),ut.current=window.setTimeout(()=>at(null),4e3)},onResetColor:()=>{window.clearTimeout(ut.current),at(null),J(E.id,null)}},E.id)}return a.jsxs("aside",{className:n?"sidebar sidebar--open":"sidebar",children:[a.jsxs("div",{className:"sidebar__head",children:[a.jsx("span",{className:l?"dot dot--on":"dot",title:r}),a.jsx("span",{className:"brand",children:"Claude Code Visual"}),a.jsx("button",{className:"theme-btn",title:`Тема: ${Qb[ke]}`,"aria-label":`Тема: ${Qb[ke]}. Переключить`,onClick:De,children:a.jsx(sw,{mode:ke})})]}),a.jsxs("div",{className:"sidebar__tabs",role:"tablist","aria-label":"Что показывать в списке",children:[a.jsx("button",{type:"button",role:"tab","aria-selected":kt==="default",className:kt==="default"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>zt("default"),children:a.jsx("span",{className:"sidebar__tab-label",children:"Все"})}),a.jsx("button",{type:"button",role:"tab","aria-selected":kt==="pinned",className:kt==="pinned"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>zt("pinned"),children:a.jsx("span",{className:"sidebar__tab-label",children:"Закреплённые"})}),a.jsxs("button",{type:"button",role:"tab","aria-selected":kt==="live",className:kt==="live"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>zt("live"),children:[a.jsx("span",{className:"sidebar__tab-label",children:"Запущенные"}),j.length>0&&a.jsx("span",{className:"sidebar__tab-count",children:j.length})]})]}),a.jsxs("div",{className:"fssearch fssearch--sidebar",children:[a.jsx(WN,{}),a.jsx("input",{className:"fssearch__input",type:"text",value:Rt,spellCheck:!1,placeholder:"Проект или сессия…","aria-label":"Поиск по проектам и сессиям",onChange:E=>dt(E.target.value),onKeyDown:E=>{E.stopPropagation(),E.key==="Escape"&&(E.preventDefault(),Rt?dt(""):E.currentTarget.blur())}}),Rt&&a.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>dt(""),children:"✕"})]}),a.jsx("div",{className:"sidebar__scroll",children:kt==="pinned"?a.jsxs(a.Fragment,{children:[a.jsx(Hd,{title:"Закреплённые",count:Dt.length,open:yn("pinned"),onToggle:()=>Fs("pinned"),action:{label:"Новая папка закреплённых",onClick:()=>{wt("pinned"),yn("pinned")||Fs("pinned")}}}),yn("pinned")&&a.jsxs(a.Fragment,{children:[$t==="pinned"&&a.jsx("div",{className:"row",children:a.jsx("div",{className:"row__main",children:a.jsx(ja,{value:"",placeholder:"Название папки",onCommit:E=>{U("pinned",E),wt(null)},onCancel:()=>wt(null)})})}),Dt.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:re?"Ничего не найдено":"закрепите сессию через её меню (правый клик или долгое нажатие) — она останется под рукой из любого проекта"})}),ol.groups.map(E=>a.jsxs(b.Fragment,{children:[Ps(E.folder,E.items.length),ws(E.folder.id)&&E.items.map(oe=>zn(oe,E.folder))]},E.folder.id)),ol.ungrouped.map(E=>zn(E))]})]}):kt==="live"?a.jsxs(a.Fragment,{children:[a.jsx(Hd,{title:"Запущенные",count:pn.length,open:yn("live"),onToggle:()=>Fs("live")}),yn("live")&&a.jsxs(a.Fragment,{children:[pn.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:re?"Ничего не найдено":"Нет запущенных сессий"})}),pn.map(E=>mn(E))]})]}):a.jsxs(a.Fragment,{children:[a.jsx(Hd,{title:"Проекты",count:Z.length,open:yn("workspaces"),onToggle:()=>Fs("workspaces"),action:{label:"Новая папка проектов",onClick:()=>{wt("workspace"),yn("workspaces")||Fs("workspaces")}}}),yn("workspaces")&&a.jsxs(a.Fragment,{children:[$t==="workspace"&&a.jsx("div",{className:"row",children:a.jsx("div",{className:"row__main",children:a.jsx(ja,{value:"",placeholder:"Название папки",onCommit:E=>{U("workspace",E),wt(null)},onCancel:()=>wt(null)})})}),Z.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:re?"Ничего не найдено":"Пока ни одного"})}),et.groups.map(E=>a.jsxs(b.Fragment,{children:[Ps(E.folder,E.items.length,{droppable:An,live:Je.byWorkspaceFolder.get(E.folder.id)}),ws(E.folder.id)&&E.items.map(oe=>Nn(oe,E.folder))]},E.folder.id)),et.ungrouped.map(E=>Nn(E)),ms.canUngroup&&a.jsx("div",{className:ms.zoneActive?"tree__zone tree__zone--active":"tree__zone","data-drop-zone":"ungrouped",children:"Без папки"})]}),o.length>0&&a.jsxs(a.Fragment,{children:[a.jsx(Hd,{title:"Архив проектов",count:fe.length,open:yn("workspacesArchive"),onToggle:()=>Fs("workspacesArchive"),hint:"проект закрывают вручную; каталог и история сессий остаются на диске и открываются заново отсюда или через «+ Проект»"}),yn("workspacesArchive")&&a.jsxs(a.Fragment,{children:[fe.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:re?"Ничего не найдено":"Пока пусто"})}),$n.groups.map(E=>a.jsxs(b.Fragment,{children:[Ps(E.folder,E.items.length),ws(E.folder.id)&&E.items.map(oe=>Ut(oe,E.folder))]},E.folder.id)),$n.ungrouped.map(E=>Ut(E))]})]})]})}),a.jsxs("div",{className:"sidebar__foot",children:[Ge.multi?a.jsxs("button",{className:"account-btn",title:"Аккаунты Claude",onClick:se,children:[a.jsx("span",{className:"account-btn__marks",children:Ge.accounts.map(E=>{var Te;const oe=((Te=Ge.auth[E.id])==null?void 0:Te.loggedIn)===!1;return a.jsx("span",{className:oe?"account-btn__mark is-out":"account-btn__mark",children:a.jsx(wa,{account:E})},E.id)})}),a.jsx("span",{className:"account-btn__id",children:"Аккаунты Claude"}),Ge.accounts.some(E=>{var oe;return((oe=Ge.auth[E.id])==null?void 0:oe.loggedIn)===!1})&&a.jsx("span",{className:"chip chip--warn",children:"нет входа"})]}):a.jsxs("button",{className:"account-btn",title:"Аккаунт Claude",onClick:se,children:[a.jsx("span",{className:k!=null&&k.loggedIn?"dot dot--on":"dot"}),a.jsx("span",{className:"account-btn__id",children:k===null?"Аккаунт":k.loggedIn?k.email||"Вход выполнен":"Войти в аккаунт"}),(k==null?void 0:k.plan)&&a.jsx("span",{className:"chip",children:k.plan})]}),je&&a.jsxs("button",{className:"account-btn",title:"Доступ с телефона и из браузера",onClick:je,children:[a.jsx("span",{className:q!=null&&q.connected?"dot dot--on":"dot"}),a.jsx("span",{className:"account-btn__id",children:q===null?"Удалённый доступ":q.paired?q.connected?q.name||"Удалённый доступ включён":"Удалённый доступ · нет связи":"Удалённый доступ"}),(q==null?void 0:q.connected)&&q.clients>0&&a.jsx("span",{className:"chip",children:q.clients})]}),a.jsxs("div",{className:"sidebar__foot-row",children:[a.jsx("button",{className:"btn btn--ghost",disabled:!Se,title:"MCP-серверы и плагины",onClick:()=>Se==null?void 0:Se(),children:"Расширения"}),a.jsx("button",{className:"btn btn--ghost",title:"Настройки приложения",onClick:te,children:"Настройки"})]}),a.jsxs("div",{className:"sidebar__foot-row",children:[a.jsx("button",{className:"btn btn--ghost",onClick:ve,children:"+ Проект"}),a.jsx(zN,{disabled:!A,providers:Y,lastAccountId:W,onStart:$,onSignIn:he})]})]}),tt&&a.jsx(tr,{x:tt.x,y:tt.y,items:Ts,note:Ne,onClose:jn}),vn&&a.jsx(tr,{x:vn.x,y:vn.y,items:ee,note:ge,onClose:ri}),_t&&a.jsx(tr,{x:_t.x,y:_t.y,items:Le,note:Rp,onClose:Es}),qn&&a.jsx(tr,{x:qn.x,y:qn.y,items:Ct,note:Rp,onClose:ul})]})}const Yb=[];function hu(n,l){return(n.title??"").toLowerCase().includes(l)}function pu(n){return n?a.jsx("span",{className:"row__stripe","aria-hidden":"true"}):null}function Ji(n,l){return{"--depth":n,...l}}function $N({workspace:n,baseDepth:l,loaded:r,sessions:c,archived:o,folders:d,needle:h,showAll:m,reorderEnabled:g,listOrder:x,liveSessionsFirst:y,activeSessionId:j,archiveExpanded:v,onToggleArchive:T,creatingFolder:w,onStartCreateFolder:A,onFinishCreateFolder:C,renamingId:F,setRenamingId:Q,renderFolderHead:I,liveInFolder:L,isFolderOpen:G,folderRowStyle:M,longPress:z,onOpenSession:O,onRenameSession:P,onPinSessions:U,onArchiveSessions:B,onUnarchiveSessions:J,onCreateFolder:me,onAssignToFolder:we,onReorder:ve}){var wt;const $=n.id,Y=h!=="",W=b.useMemo(()=>{const Ce=Fd(c,x==null?void 0:x.sessions[$],vl,"top");return y?xy(Ce):Ce},[c,x,$,y]),he=b.useMemo(()=>m?W:W.filter(Ce=>hu(Ce,h)),[W,m,h]),Se=b.useMemo(()=>m?o:o.filter(Ce=>hu(Ce,h)),[o,m,h]),k=b.useMemo(()=>mu(he,d,void 0,!Y),[he,d,Y]),se=b.useMemo(()=>mu(Se,d),[Se,d]),q=(((wt=x==null?void 0:x.sessions[$])==null?void 0:wt.length)??0)>0,je=Wd({enabled:g,scope:"sessions",workspaceId:$,itemKey:vl,groups:k.groups,ungrouped:k.ungrouped,onReorder:ve}),te=Dp(he),[ke,De]=b.useState(null),[Ge,He]=b.useState(!1);b.useEffect(()=>He(!1),[h]);const bt=Y&&Se.length>0,Ve=bt?!Ge:v;function fn(){const Ce=ke==null?void 0:ke.opener;De(null),Ce!=null&&Ce.isConnected&&Ce.focus()}function We(Ce){return{onContextMenu:Pe=>{Pe.preventDefault(),De({x:Pe.clientX,y:Pe.clientY,opener:Pe.currentTarget,ids:te.targetsFor(Ce)})},onTouchStart:Pe=>z.start(Pe,(Rt,dt,Fe)=>De({x:Rt,y:dt,opener:Fe,ids:te.targetsFor(Ce)})),onTouchMove:z.move,onTouchEnd:z.end,onTouchCancel:z.end}}const at=ke?he.find(Ce=>Ce.id===ke.ids[0]):void 0,ct=(at==null?void 0:at.pinned)!==!0,jt=ke?[...ke.ids.length===1?[{id:"rename",label:"Переименовать",onSelect:()=>Q(ke.ids[0])}]:[],{id:"pin",label:ct?ke.ids.length>1?`Закрепить (${ke.ids.length})`:"Закрепить":ke.ids.length>1?`Открепить (${ke.ids.length})`:"Открепить",onSelect:()=>{U($,ke.ids,ct),te.clear()}},{id:"archive",label:ke.ids.length>1?`Убрать в архив (${ke.ids.length})`:"Убрать в архив",onSelect:()=>{B($,ke.ids),te.clear()}},...uu({folders:d,ids:ke.ids,hasFolder:(at==null?void 0:at.folderId)!=null,assign:(Ce,Pe)=>we("session",Ce,Pe,$),onClear:()=>te.clear(),onNewFolder:A}),...ke.ids.length===1&&g&&at?je.menuItems(vl(at),q):[]]:[];function ut(Ce,Pe,Rt){const dt=vl(Ce);return a.jsxs("div",{"data-row-key":dt,"data-row-scope":"sessions",className:Hc(Ce.id===j,te.selected.includes(Ce.id),Ce.provider==="antigravity",!!Rt,!0)+je.dropClass(dt),style:Ji(Pe,M(Rt)),...F===Ce.id?{}:We(Ce),children:[pu(Rt),F===Ce.id?a.jsx("div",{className:"row__main",children:a.jsx(ja,{value:Ce.title??"",onCommit:Fe=>{P(Ce,Fe),Q(null)},onCancel:()=>Q(null)})}):a.jsxs(a.Fragment,{children:[g&&a.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...je.gripHandlers(dt),children:a.jsx(Pd,{})}),a.jsx("button",{className:"row__main row__main--session",onClick:Fe=>{z.consumed()||te.click(Fe,Ce,()=>O(Ce))},onKeyDown:Fe=>je.onKeyDown(dt,Fe),children:a.jsx(of,{session:Ce,pinned:Ce.pinned===!0})}),a.jsx("button",{className:"row__edit",title:"Переименовать","aria-label":"Переименовать сессию",onClick:()=>{z.consumed()||Q(Ce.id)},children:"✎"})]})]},Ce.id)}function $t(Ce,Pe,Rt){return a.jsxs("div",{className:Hc(Ce.id===j,!1,Ce.provider==="antigravity",!!Rt,!0),style:Ji(Pe,M(Rt)),children:[pu(Rt),a.jsx("button",{className:"row__main row__main--session",onClick:()=>O(Ce),children:a.jsx(of,{session:Ce,pinned:!1,archived:!0})}),a.jsx("button",{className:"row__restore",title:"Вернуть сессию из архива",onClick:()=>J($,[Ce.id]),children:"Вернуть"})]},Ce.id)}return a.jsxs(a.Fragment,{children:[w&&a.jsx("div",{className:"row row--hint",style:Ji(l,void 0),children:a.jsx("div",{className:"row__main",children:a.jsx(ja,{value:"",placeholder:"Название папки",onCommit:Ce=>{me("session",Ce,$),C()},onCancel:C})})}),r?he.length===0&&a.jsx("div",{className:"row row--hint",style:Ji(l,void 0),children:a.jsx("span",{className:"row__meta",children:"Пока ни одной"})}):a.jsx("div",{className:"row row--hint",style:Ji(l,void 0),"aria-busy":"true",children:a.jsx("span",{className:"row__meta",children:"Загрузка…"})}),k.groups.map(Ce=>a.jsxs(b.Fragment,{children:[I(Ce.folder,Ce.items.length,{depth:l,live:L.get(Ce.folder.id)}),G(Ce.folder.id)&&Ce.items.map(Pe=>ut(Pe,l+1,Ce.folder))]},Ce.folder.id)),k.ungrouped.map(Ce=>ut(Ce,l)),r&&o.length>0&&(!Y||Se.length>0)&&a.jsxs(a.Fragment,{children:[a.jsx(qN,{title:"Архив",count:Se.length,open:Ve,depth:l,hint:"сессии без обращения дольше двух суток уезжают сюда сами; ничего не удаляется",onToggle:()=>bt?He(Ce=>!Ce):T()}),Ve&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"row row--hint",style:Ji(l,void 0),children:a.jsx("span",{className:"row__meta",children:"сюда сами уезжают сессии без обращения дольше двух суток; транскрипт остаётся на диске, ничего не удаляется"})}),se.groups.map(Ce=>a.jsxs(b.Fragment,{children:[I(Ce.folder,Ce.items.length,{depth:l}),G(Ce.folder.id)&&Ce.items.map(Pe=>$t(Pe,l+1,Ce.folder))]},Ce.folder.id)),se.ungrouped.map(Ce=>$t(Ce,l))]})]}),ke&&a.jsx(tr,{x:ke.x,y:ke.y,items:jt,note:Rp,onClose:fn})]})}function qN({title:n,count:l,open:r,depth:c,hint:o,onToggle:d}){const h=r?`Свернуть «${n}»`:`Развернуть «${n}»`;return a.jsx("div",{className:"row",style:Op(c),children:a.jsxs("button",{className:"row__main",style:jy,"aria-expanded":r,title:`${h} — ${o}`,onClick:d,children:[a.jsx(gf,{open:r}),a.jsx("span",{style:wy,children:n}),a.jsx("span",{className:"sidebar__count",children:l})]})})}function Hc(n,l,r,c,o){const d=["row"];return o&&d.push("row--session"),c&&d.push("row--foldered"),n&&d.push("row--active"),l&&d.push("row--selected"),r&&d.push("row--antigravity"),d.join(" ")}function mu(n,l,r=o=>o.folderId,c=!1){const o=new Map(l.map(g=>[g.id,g])),d=new Map,h=[];for(const g of n){const x=r(g),y=x?o.get(x):void 0;if(!y){h.push(g);continue}const j=d.get(y.id);j?j.push(g):d.set(y.id,[g])}if(c)for(const g of l)d.has(g.id)||d.set(g.id,[]);return{groups:[...d.entries()].map(([g,x])=>({folder:o.get(g),items:x})).sort((g,x)=>g.folder.name.localeCompare(x.folder.name,"ru")),ungrouped:h}}function GN(n,l,r){return[...n.flatMap(c=>c.items.map(r)),...l.map(r)]}const Jd="\0ungrouped";function YN(n,l,r){const c=new Map;for(const o of n)for(const d of o.items)c.set(r(d),o.folder.id);for(const o of l)c.set(r(o),Jd);return c}function dp(n,l,r,c,o){const d=[...l.map(m=>m.items),r].find(m=>m.some(g=>c(g)===n));if(!d)return null;const h=d.findIndex(m=>c(m)===n);return o==="up"?h<=0?null:{target:c(d[h-1]),position:"before"}:h===-1||h>=d.length-1?null:{target:c(d[h+1]),position:"after"}}function Wd(n){const[l,r]=b.useState(null),[c,o]=b.useState(null),[d,h]=b.useState(null),m=n.onMoveToGroup,g=b.useMemo(()=>GN(n.groups,n.ungrouped,n.itemKey),[n.groups,n.ungrouped,n.itemKey]),x=b.useMemo(()=>YN(n.groups,n.ungrouped,n.itemKey),[n.groups,n.ungrouped,n.itemKey]),y=b.useRef({raf:0,el:null,x:0,y:0}),j=b.useRef(()=>{});function v(){window.cancelAnimationFrame(y.current.raf),y.current.raf=0,y.current.el=null}function T(B){v();const J=y.current;if(J.el=B.closest(".sidebar__scroll"),!J.el)return;const me=56,we=16,ve=()=>{const $=J.el;if(!$)return;const Y=$.getBoundingClientRect();let W=0;if(J.y<Y.top+me?W=-we*Math.min(1,(Y.top+me-J.y)/me):J.y>Y.bottom-me&&(W=we*Math.min(1,(J.y-(Y.bottom-me))/me)),W!==0){const he=$.scrollTop;$.scrollTop=he+W,$.scrollTop!==he&&j.current(J.x,J.y)}J.raf=window.requestAnimationFrame(ve)};J.raf=window.requestAnimationFrame(ve)}b.useEffect(()=>v,[]);function w(){v(),r(null),o(null),h(null)}function A(B,J){n.enabled&&(J.preventDefault(),J.currentTarget.setPointerCapture(J.pointerId),y.current.x=J.clientX,y.current.y=J.clientY,T(J.currentTarget),r(B),o(null),h(null))}function C(B,J){if(!l)return;const me=document.elementFromPoint(B,J),we=x.get(l);if(m){const Se=me==null?void 0:me.closest("[data-drop-folder]"),k=Se?null:me==null?void 0:me.closest("[data-drop-zone]");if(Se||k){const se=Se?Se.dataset.dropFolder:null,q=se??Jd;o(null),h(q===we?null:{folderId:se});return}}const ve=me==null?void 0:me.closest("[data-row-key]"),$=(ve==null?void 0:ve.dataset.rowScope)===n.scope?ve.dataset.rowKey:void 0,Y=$?x.get($):void 0;if(h(null),!$||$===l||Y===void 0||!m&&Y!==we){o(null);return}const W=ve.getBoundingClientRect(),he=J-W.top<W.height/2?"before":"after";o(Se=>(Se==null?void 0:Se.key)===$&&Se.position===he?Se:{key:$,position:he})}j.current=C;function F(B){y.current.x=B.clientX,y.current.y=B.clientY,C(B.clientX,B.clientY)}function Q(){if(l&&d&&m)m(l,{folderId:d.folderId,order:null});else if(l&&c){const B=Ud(g,l,c.key,c.position),J=x.get(c.key);m&&J!==x.get(l)?m(l,{folderId:J===Jd?null:J??null,order:B}):B&&n.onReorder(n.scope,B,n.workspaceId)}w()}function I(B,J){if(!n.enabled)return;const me=dp(B,n.groups,n.ungrouped,n.itemKey,J);if(!me)return;const we=Ud(g,B,me.target,me.position);we&&n.onReorder(n.scope,we,n.workspaceId)}function L(B,J){const me=dp(B,n.groups,n.ungrouped,n.itemKey,"up"),we=dp(B,n.groups,n.ungrouped,n.itemKey,"down"),ve=[{id:"move-up",label:"Переместить выше",disabled:!me,onSelect:()=>{if(!me)return;const $=Ud(g,B,me.target,me.position);$&&n.onReorder(n.scope,$,n.workspaceId)}},{id:"move-down",label:"Переместить ниже",disabled:!we,onSelect:()=>{if(!we)return;const $=Ud(g,B,we.target,we.position);$&&n.onReorder(n.scope,$,n.workspaceId)}}];return J&&ve.push({id:"reset-order",label:"Сбросить порядок",onSelect:()=>n.onReorder(n.scope,null,n.workspaceId)}),ve}function G(B){return l===B?" row--dragging":(c==null?void 0:c.key)===B?c.position==="before"?" row--drop-before":" row--drop-after":""}function M(B){return{onPointerDown:J=>A(B,J),onPointerMove:F,onPointerUp:Q,onPointerCancel:w,onLostPointerCapture:w}}function z(B,J){!J.altKey||J.key!=="ArrowUp"&&J.key!=="ArrowDown"||(J.preventDefault(),I(B,J.key==="ArrowUp"?"up":"down"))}const O=B=>(d==null?void 0:d.folderId)===B,P=!!m&&l!==null&&x.get(l)!==Jd,U=d!==null&&d.folderId===null;return{dragging:l!==null,dropClass:G,gripHandlers:M,onKeyDown:z,menuItems:L,isDropFolder:O,canUngroup:P,zoneActive:U}}function uu(n){return[...[...n.folders].sort((r,c)=>r.name.localeCompare(c.name,"ru")).map(r=>({id:`folder:${r.id}`,label:`В папку «${r.name}»`,onSelect:()=>{n.ids.forEach(c=>n.assign(c,r.id)),n.onClear()}})),...n.hasFolder?[{id:"folder:none",label:"Без папки",onSelect:()=>{n.ids.forEach(r=>n.assign(r,null)),n.onClear()}}]:[],{id:"folder:new",label:"Новая папка…",onSelect:n.onNewFolder}]}function XN(n){return n.map(l=>({...l,id:`pinned:${l.id}`,label:l.id==="folder:new"?"Новая папка закреплённых…":l.id==="folder:none"?"Без папки закреплённых":l.label}))}function Dp(n){const[l,r]=b.useState([]),c=b.useRef(null);function o(){r([]),c.current=null}function d(m,g,x){if(m.ctrlKey||m.metaKey){r(y=>y.includes(g.id)?y.filter(j=>j!==g.id):[...y,g.id]),c.current=g.id;return}if(m.shiftKey&&c.current){const y=n.findIndex(v=>v.id===c.current),j=n.findIndex(v=>v.id===g.id);if(y!==-1&&j!==-1){const[v,T]=y<j?[y,j]:[j,y];r(n.slice(v,T+1).map(w=>w.id));return}}o(),c.current=g.id,x()}function h(m){return l.includes(m.id)?l:(r([m.id]),c.current=m.id,[m.id])}return{selected:l,click:d,targetsFor:h,clear:o}}const VN={display:"flex",alignItems:"center",gap:6,flex:1,minWidth:0,textAlign:"left"},QN={width:22,height:22,borderRadius:6};function Hd({title:n,count:l,open:r,onToggle:c,hint:o,action:d}){const h=r?`Свернуть «${n}»`:`Развернуть «${n}»`;return a.jsxs("div",{className:"sidebar__section",children:[a.jsxs("button",{className:"sidebar__section--btn",style:VN,"aria-expanded":r,title:o?`${h} — ${o}`:h,onClick:c,children:[a.jsx(gf,{open:r}),a.jsx("span",{className:"sidebar__section-name",children:n}),a.jsx("span",{className:"sidebar__count",children:l})]}),d&&a.jsx("button",{className:"theme-btn",style:QN,title:d.label,"aria-label":d.label,onClick:d.onClick,children:a.jsx(PN,{})})]})}function Op(n){return{paddingLeft:`calc(37px + ${n} * var(--tree-indent, 24px))`}}const jy={display:"flex",alignItems:"center",gap:6,width:"100%"},Ny={flex:1,minWidth:0,color:"var(--text-2)",fontWeight:500},wy={...Ny,color:"var(--muted)",fontSize:12.5};function KN({folder:n,count:l,live:r,open:c,renaming:o,onToggle:d,onStartRename:h,onCommitRename:m,onCancelRename:g,onDelete:x,color:y,onPreviewColor:j,onCommitColor:v,onResetColor:T,depth:w,droppable:A,dropActive:C}){const F=b.useRef(null),Q=b.useRef(v);return Q.current=v,b.useEffect(()=>{const I=F.current;if(!I)return;const L=()=>Q.current(I.value);return I.addEventListener("change",L),()=>I.removeEventListener("change",L)},[o]),o?a.jsx("div",{className:"row",style:Op(w),children:a.jsx("div",{className:"row__main",children:a.jsx(ja,{value:n.name,placeholder:"Название папки",onCommit:m,onCancel:g})})}):a.jsxs("div",{className:C?"row row--drop-target":"row",style:Op(w),"data-drop-folder":A?n.id:void 0,children:[a.jsxs("button",{className:"row__main",style:jy,"aria-expanded":c,title:c?`Свернуть папку «${n.name}»`:`Развернуть папку «${n.name}»`,onClick:d,children:[a.jsx(gf,{open:c}),a.jsx("span",{style:w>0?wy:Ny,children:n.name}),!c&&a.jsx(Sy,{agg:r}),a.jsx("span",{className:"sidebar__count",children:l})]}),a.jsx("button",{className:"row__edit",title:"Переименовать папку","aria-label":`Переименовать папку «${n.name}»`,onClick:h,children:"✎"}),a.jsxs("label",{className:y?"row__swatch row__swatch--set":"row__swatch",title:`Цвет папки «${n.name}»`,children:[a.jsx("span",{className:"row__swatch-dot",style:y?{background:y}:void 0}),a.jsx("input",{ref:F,type:"color",value:y??ZN(),"aria-label":`Цвет папки «${n.name}»`,onChange:I=>j(I.target.value)})]}),n.color&&a.jsx("button",{className:"row__edit",title:"Сбросить цвет папки","aria-label":`Сбросить цвет папки «${n.name}»`,onClick:T,children:"↺"}),a.jsx("button",{className:"row__edit",title:"Удалить папку — содержимое останется, просто станет без папки","aria-label":`Удалить папку «${n.name}»`,onClick:x,children:"✕"})]})}function ZN(){const n=getComputedStyle(document.documentElement).getPropertyValue("--folder-default").trim();return/^#[0-9a-f]{6}$/i.test(n)?n.toLowerCase():"#9a978d"}function gf({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 Pd(){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 FN(){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 JN({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 WN(){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 PN(){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 ew(){try{const n=localStorage.getItem(_y);if(n===null)return["workspacesArchive"];const l=JSON.parse(n);return Array.isArray(l)?l.filter(r=>r==="workspaces"||r==="workspacesArchive"||r==="pinned"||r==="live"):["workspacesArchive"]}catch{return["workspacesArchive"]}}function Xb(n){try{const l=localStorage.getItem(n);if(l===null)return[];const r=JSON.parse(l);return Array.isArray(r)?r.filter(c=>typeof c=="string"):[]}catch{return[]}}function Vb(n,l){try{localStorage.setItem(n,JSON.stringify(l))}catch{}}function tw(){try{const n=localStorage.getItem(vy);if(n===null)return[];const l=JSON.parse(n);return Array.isArray(l)?l.filter(r=>typeof r=="string"):[]}catch{return[]}}function nw(){try{const n=localStorage.getItem(yy);return n==="pinned"||n==="live"?n:"default"}catch{return"default"}}const Qb={system:"как в системе",light:"светлая",dark:"тёмная"};function sw({mode:n}){const l={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",{...l,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",{...l,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",{...l,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 Kb(n){const l=lw(n),r=(n.tasks??[]).filter(c=>c.kind==="agent").length;return r>0?`${l} · ${by(r)}`:l}function lw(n){switch(n.state){case"running":return"работает";case"waiting_permission":return"ждёт разрешения";case"idle":return n.backgroundWork?"работает в фоне":aw(n.lastTurn);case"starting":return"запускается";case"reconnecting":return"переподключается";case"error":return"ошибка";case"closed":return"на диске"}}function aw(n){switch(n){case"interrupted":return"прервана";case"stopped":return"остановлена";case"failed":return"оборвалась";case"completed":return"готова";case null:return"ждёт задачу"}}function ky(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":iw(n.lastTurn);case"error":return"error";case"closed":return"closed"}}function iw(n){switch(n){case"interrupted":case"stopped":return"halted";case"failed":return"error";case"completed":return"ready";case null:return"fresh"}}function of({session:n,pinned:l,projectName:r,projectPath:c,archived:o}){const d=o?"closed":ky(n);return a.jsxs(a.Fragment,{children:[a.jsx("span",{className:`row__lead row__state--${d}`,"aria-hidden":"true",children:a.jsx("span",{className:"row__state-dot"})}),a.jsxs("span",{className:"row__body"+(r!==void 0?" row__body--with-project":"")+(o?" row__body--archived":""),title:o?cw(n):`${Kb(n)} · ${new Date(n.updatedAt).toLocaleString()}`,children:[a.jsx(rw,{title:n.title??"Без названия",pinned:l,provider:n.provider,accountId:n.accountId,projectName:r,projectPath:c}),o?a.jsxs("span",{className:"row__meta row__vh row__vh--wide",children:[a.jsx("span",{className:"row__state",children:n.archivedAuto?"по сроку":"вручную"}),n.archivedAt?a.jsx("span",{className:"row__time",children:` · ${hp(n.archivedAt)}`}):null]}):a.jsxs("span",{className:`row__meta${d==="closed"?` row__vh${r===void 0?" row__vh--time":""}`:""}`,children:[a.jsx("span",{className:`row__state row__state--${d}${d==="closed"?" row__vh":""}`,children:Kb(n)}),r===void 0&&a.jsx("span",{className:"row__time",children:d==="closed"?hp(n.updatedAt):` · ${hp(n.updatedAt)}`})]})]})]})}const Zb=["waiting","error","running","reconnecting","background","starting","halted","ready","fresh","closed"];function fp(n,l,r){const c=n.get(l);if(!c){n.set(l,{count:1,tone:r,waiting:r==="waiting"?1:0});return}c.count+=1,r==="waiting"&&(c.waiting+=1),Zb.indexOf(r)<Zb.indexOf(c.tone)&&(c.tone=r)}function Sy({agg:n}){if(!n)return null;const l=`Запущено сессий: ${n.count}`,r=n.waiting>0?`${l}, ждут решения: ${n.waiting}`:l;return a.jsxs("span",{className:`row__live row__state--${n.tone}`,role:"img","aria-label":r,title:r,children:[a.jsx("span",{className:"row__state-dot","aria-hidden":"true"}),a.jsx("span",{"aria-hidden":"true",children:n.count})]})}function rw({title:n,pinned:l,provider:r,accountId:c,projectName:o,projectPath:d}){const h=hv(c,r);return a.jsxs("span",{className:"row__head",children:[a.jsxs("span",{className:"row__title",children:[l&&a.jsx(JN,{className:"row__pin"}),h&&a.jsx(wa,{account:h,className:"row__acct"}),r==="antigravity"&&a.jsx(tm,{className:"row__provider"}),n]}),o!==void 0&&a.jsx("span",{className:"row__project",title:d,children:o})]})}function hp(n){const l=new Date(n);return l.toDateString()===new Date().toDateString()?l.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):l.toLocaleDateString(void 0,{day:"numeric",month:"short"})}function cw(n){const l=n.archivedAuto?"сама, по сроку молчания":"убрана вручную";return n.archivedAt?`${new Date(n.archivedAt).toLocaleString()} · ${l}`:l}function ow(n){return n.archivedAt?`закрыт ${new Date(n.archivedAt).toLocaleString()}`:"закрыт"}const Fb=3,uw=15e5;function Ey(n,l){if(!l||typeof l!="object")return null;const r=l,c=typeof r.file_path=="string"?r.file_path:"";if(!c)return null;if(n==="Write"){if(typeof r.content!="string")return null;const o=pp(r.content).map(d=>({type:"add",text:d}));return{kind:"create",filePath:c,rows:o,added:o.length,removed:0,note:"файл записывается целиком"}}if(n==="Edit"){if(typeof r.old_string!="string"||typeof r.new_string!="string")return null;const o=pw(dw(pp(r.old_string),pp(r.new_string)));return{kind:"edit",filePath:c,rows:o,added:o.filter(d=>d.type==="add").length,removed:o.filter(d=>d.type==="del").length,note:r.replace_all===!0?"все вхождения":null}}return null}function pp(n){if(n==="")return[];const l=n.split(/\r?\n/);return l.length>1&&l[l.length-1]===""&&l.pop(),l}function dw(n,l){let r=0;for(;r<n.length&&r<l.length&&n[r]===l[r];)r++;let c=n.length,o=l.length;for(;c>r&&o>r&&n[c-1]===l[o-1];)c--,o--;const d=h=>({type:"ctx",text:h});return[...n.slice(0,r).map(d),...fw(n.slice(r,c),l.slice(r,o)),...n.slice(c).map(d)]}function fw(n,l){if(n.length===0&&l.length===0)return[];if(n.length===0)return l.map(y=>({type:"add",text:y}));if(l.length===0)return n.map(y=>({type:"del",text:y}));if((n.length+1)*(l.length+1)>uw)return[...n.map(y=>({type:"del",text:y})),...l.map(y=>({type:"add",text:y}))];const r=n.length,c=l.length,o=c+1,d=new Uint32Array((r+1)*o),h=(y,j)=>d[y*o+j]??0;for(let y=r-1;y>=0;y--)for(let j=c-1;j>=0;j--)d[y*o+j]=n[y]===l[j]?h(y+1,j+1)+1:Math.max(h(y+1,j),h(y,j+1));const m=[];let g=0,x=0;for(;g<r&&x<c;){const y=n[g],j=l[x];y===j?(m.push({type:"ctx",text:y}),g++,x++):h(g+1,x)>=h(g,x+1)?(m.push({type:"del",text:y}),g++):(m.push({type:"add",text:j}),x++)}for(;g<r;)m.push({type:"del",text:n[g++]});for(;x<c;)m.push({type:"add",text:l[x++]});return hw(m)}function hw(n){const l=[];let r=[];function c(){l.push(...r.filter(o=>o.type==="del")),l.push(...r.filter(o=>o.type==="add")),r=[]}for(const o of n)o.type==="ctx"?(c(),l.push(o)):r.push(o);return c(),l}function pw(n){if(!n.some(d=>d.type!=="ctx"))return n;const l=n.map(()=>!1);n.forEach((d,h)=>{if(d.type!=="ctx")for(let m=Math.max(0,h-Fb);m<=Math.min(n.length-1,h+Fb);m++)l[m]=!0});const r=[];let c=[];function o(){c.length===1?r.push(...c):c.length>1&&r.push({type:"gap",text:`⋯ ${c.length} ${mw(c.length)} без изменений`}),c=[]}return n.forEach((d,h)=>{l[h]?(o(),r.push(d)):c.push(d)}),o(),r}function mw(n){const l=n%100;if(l>=11&&l<=14)return"строк";switch(n%10){case 1:return"строка";case 2:case 3:case 4:return"строки";default:return"строк"}}async function Na(n){try{return await navigator.clipboard.writeText(n),!0}catch{}const l=document.createElement("textarea");l.value=n,l.setAttribute("readonly",""),l.style.position="fixed",l.style.opacity="0",document.body.appendChild(l);try{return l.select(),document.execCommand("copy")}catch{return!1}finally{l.remove()}}async function Lp(){try{return await navigator.clipboard.readText()}catch{return null}}const nm=1600,qr="Копировать",Gc="Скопировано";function Pc({text:n,hint:l,className:r}){const[c,o]=b.useState(!1);return b.useEffect(()=>{if(!c)return;const d=setTimeout(()=>o(!1),nm);return()=>clearTimeout(d)},[c]),b.useEffect(()=>o(!1),[n]),a.jsx("button",{type:"button",className:"copybtn"+(c?" copybtn--done":"")+(r?` ${r}`:""),"aria-label":c?Gc:`${qr} ${l}`,title:c?Gc:`${qr} ${l}`,onClick:()=>{Na(n).then(d=>{d&&o(!0)})},children:c?Gc:qr})}function sm({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((l,r)=>a.jsxs("div",{className:`diff__row diff__row--${l.type}`,children:[a.jsx("span",{className:"diff__mark","aria-hidden":"true",children:l.type==="add"?"+":l.type==="del"?"−":""}),a.jsx("span",{className:"diff__text",children:l.text===""?" ":l.text})]},r))})]})}function gw({waiting:n}){const[l,r]=b.useState(0);return b.useEffect(()=>{const c=window.setInterval(()=>r(o=>o+1),1e3);return()=>window.clearInterval(c)},[]),a.jsxs("div",{className:n?"work work--wait":"work",children:[a.jsxs("span",{className:"work__dots","aria-hidden":"true",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:n?"ждёт разрешения":"думает"}),!n&&a.jsxs("span",{className:"work__time",children:[l," с"]})]})}function lm({items:n,busy:l,waiting:r,history:c=[],historyHasMore:o=!1,historyLoading:d=!1,onLoadHistory:h,sessionId:m,onEditMessage:g,empty:x="Сессия пуста. Опишите задачу — Claude Code работает в каталоге проекта с полным набором инструментов."}){const y=b.useRef(null),j=b.useRef(null),v=b.useRef(!0),T=b.useRef(null),w=b.useRef(null),A=b.useRef(!1);b.useEffect(()=>{v.current=!0,T.current=null,A.current=!1,w.current!==null&&(clearTimeout(w.current),w.current=null)},[m]),b.useEffect(()=>{const L=y.current,G=j.current;if(!L||!G)return;function M(P){!L||P===L.scrollTop||(A.current=!0,L.scrollTop=P)}function z(){if(!L)return;const P=T.current;if(P){const U=Wb(L,P.id);if(U){const B=U.getBoundingClientRect().top-L.getBoundingClientRect().top;M(L.scrollTop+(B-P.top))}w.current!==null&&clearTimeout(w.current),w.current=setTimeout(()=>{T.current=null},500);return}v.current&&M(L.scrollHeight)}const O=new ResizeObserver(z);return O.observe(G),()=>{O.disconnect(),w.current!==null&&clearTimeout(w.current)}},[]);function C(){const L=y.current;if(L){if(A.current){A.current=!1;return}v.current=L.scrollHeight-L.scrollTop-L.clientHeight<80}}function F(){if(d)return;const L=y.current,G=c[0];if(L&&G){const M=Wb(L,G.id);M&&(T.current={id:G.id,top:M.getBoundingClientRect().top-L.getBoundingClientRect().top})}h==null||h()}let Q=0;function I(L){return L.kind==="user"?Q++:-1}return a.jsx("div",{className:"transcript",ref:y,onScroll:C,children:a.jsxs("div",{className:"stream",ref:j,children:[o&&a.jsx("button",{type:"button",className:"transcript__more",onClick:F,disabled:d,children:d?"Загружаем…":"Показать более раннее"}),c.map(L=>a.jsx(Jb,{item:L,userIndex:I(L),onEditMessage:g},L.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(L=>a.jsx(Jb,{item:L,userIndex:I(L),onEditMessage:g},L.id)),l&&a.jsx(gw,{waiting:r})]})})}function Jb({item:n,userIndex:l,onEditMessage:r}){switch(n.kind){case"user":return a.jsx(bw,{item:n,userIndex:l,onEditMessage:r});case"assistant":return a.jsxs("div",{className:"msg--assistant","data-item-id":n.id,children:[a.jsx(_w,{text:n.text}),n.streaming&&a.jsx("span",{className:"caret"}),n.text.trim()!==""&&a.jsx("div",{className:"msg--assistant__foot",children:a.jsx(Pc,{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(vw,{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:["↑",e_(n.inputTokens)," ↓",e_(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 xw=500;function bw({item:n,userIndex:l,onEditMessage:r}){const[c,o]=b.useState(null),[d,h]=b.useState(!1),[m,g]=b.useState(n.text),x=b.useRef(null),y=b.useRef(!1),j=ff("(max-width: 860px)"),v=b.useRef(null);function T(O,P){o({x:O,y:P})}function w(O){O.preventDefault(),T(O.clientX,O.clientY)}function A(O){const P=O.touches[0];if(!P)return;const U={timer:0,x:P.clientX,y:P.clientY,fired:!1};U.timer=window.setTimeout(()=>{U.fired=!0,T(U.x,U.y)},xw),v.current=U}function C(O){const P=v.current,U=O.touches[0];!P||!U||Math.hypot(U.clientX-P.x,U.clientY-P.y)>10&&(window.clearTimeout(P.timer),v.current=null)}function F(O){const P=v.current;P&&(window.clearTimeout(P.timer),P.fired&&O.preventDefault())}function Q(){g(n.text),h(!0)}function I(){h(!1)}function L(){const O=m.trim();if(O===""&&!(n.images&&n.images.length>0))return;const P=r==null?void 0:r(l,O,n.images);if(P instanceof Promise){if(y.current)return;y.current=!0,P.then(U=>{y.current=!1,U&&h(!1)},()=>{y.current=!1});return}P!==!1&&h(!1)}b.useEffect(()=>{const O=x.current;!O||!d||(O.style.height="auto",O.style.height=`${O.scrollHeight}px`)},[m,d]),b.useEffect(()=>{if(!d)return;const O=x.current;O&&(O.focus(),O.setSelectionRange(O.value.length,O.value.length))},[d]);function G(O){if(O.key==="Escape"){O.preventDefault(),O.stopPropagation(),I();return}O.key==="Enter"&&!O.shiftKey&&!j&&(O.preventDefault(),L())}const M=n.images&&n.images.length>0&&a.jsx("div",{className:"msg--user__images",children:n.images.map((O,P)=>a.jsx("img",{className:"msg--user__image",src:`data:${O.mediaType};base64,${O.data}`,alt:"Вложение"},P))});if(d){const O=m.trim()!==""||!!(n.images&&n.images.length>0);return a.jsxs("div",{className:"msg--user msg--user--editing","data-item-id":n.id,children:[M,a.jsxs("div",{className:"msg--user__edit",children:[a.jsx("textarea",{ref:x,className:"msg--user__edit-field",value:m,onChange:P=>g(P.target.value),onKeyDown:G,rows:1}),a.jsxs("div",{className:"msg--user__edit-actions",children:[a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:I,children:"Отмена"}),a.jsx("button",{type:"button",className:"btn btn--sm btn--primary",onClick:L,disabled:!O,children:"Сохранить"})]})]})]})}const z=[{id:"copy",label:"Копировать",onSelect:()=>void Na(n.text)},...r?[{id:"edit",label:"Изменить",onSelect:Q}]:[]];return a.jsxs("div",{className:"msg--user","data-item-id":n.id,onContextMenu:w,onTouchStart:A,onTouchMove:C,onTouchEnd:F,onTouchCancel:F,children:[M,n.text,c&&a.jsx(tr,{x:c.x,y:c.y,items:z,onClose:()=>o(null)})]})}function Wb(n,l){const r=n.querySelectorAll("[data-item-id]");for(const c of r)if(c.dataset.itemId===l)return c;return null}function _w({text:n}){const[l,r]=b.useState(""),c=b.useRef([]);b.useEffect(()=>{let d=!1;return mf(n).then(h=>{d||r(yw(h))}),()=>{d=!0}},[n]),b.useEffect(()=>{const d=c.current;return()=>d.forEach(h=>clearTimeout(h))},[]);function o(d){var g,x;const h=d.target.closest(".codeblock__copy");if(!(h instanceof HTMLElement))return;const m=((x=(g=h.parentElement)==null?void 0:g.querySelector("pre"))==null?void 0:x.textContent)??"";m!==""&&Na(m).then(y=>{if(!y)return;h.textContent=Gc,h.setAttribute("aria-label",Gc),h.classList.add("copybtn--done");const j=window.setTimeout(()=>{h.isConnected&&(h.textContent=qr,h.setAttribute("aria-label",zp),h.classList.remove("copybtn--done"))},nm);c.current.push(j)})}return a.jsx("div",{className:"markdown-preview msg--assistant__body",onClick:o,dangerouslySetInnerHTML:{__html:l}})}const zp=`${qr} блок кода`;function yw(n){if(!n.includes("<pre"))return n;const l=new DOMParser().parseFromString(n,"text/html");for(const r of l.body.querySelectorAll("pre")){const c=l.createElement("div");c.className="codeblock",r.replaceWith(c),c.append(r);const o=l.createElement("button");o.type="button",o.className="copybtn codeblock__copy",o.setAttribute("aria-label",zp),o.title=zp,o.textContent=qr,c.append(o)}return l.body.innerHTML}function vw({item:n}){const[l,r]=b.useState(!1),c=n.result===null,o=Ey(n.name,n.input),d=n.name==="AskUserQuestion"?ww(n.input):null;return a.jsxs("div",{className:"tool"+(n.isError?" tool--error":"")+(n.awaitingPermission?" tool--wait":""),"data-item-id":n.id,children:[a.jsxs("button",{className:"tool__head",onClick:()=>r(h=>!h),children:[a.jsx("span",{className:"tool__name",children:n.name}),a.jsx("span",{className:"tool__arg",children:d?Nw(d):jw(n.input)}),a.jsx("span",{className:"tool__status",children:c?"…":n.isError?"ошибка":l?"▴":"▾"})]}),l&&a.jsxs("div",{className:"tool__body",children:[d?a.jsx(kw,{questions:d,answers:n.answers}):o?a.jsx(sm,{diff:o}):a.jsx(Pb,{text:JSON.stringify(n.input,null,2),hint:"аргументы вызова"}),n.result!==null&&(!d||n.isError)&&a.jsx(Pb,{text:n.result,hint:"результат вызова",style:{marginTop:10}})]})]})}function Pb({text:n,hint:l,style:r}){return a.jsxs("div",{className:"codeblock",style:r,children:[a.jsx("pre",{className:"code",children:n}),a.jsx(Pc,{text:n,hint:l,className:"codeblock__copy"})]})}function jw(n){if(!n||typeof n!="object")return"";const l=n;for(const r of["file_path","command","pattern","path","url","prompt"]){const c=l[r];if(typeof c=="string")return c.replace(/\s+/g," ").slice(0,160)}return JSON.stringify(l).slice(0,160)}function Nw(n){var r;const l=n.map(c=>c.header).filter(c=>c.length>0);return l.length===n.length?l.join(" · "):((r=n[0])==null?void 0:r.question.replace(/\s+/g," ").slice(0,160))??""}function ww(n){if(typeof n!="object"||n===null)return null;const l=n.questions;if(!Array.isArray(l)||l.length===0)return null;const r=[];for(const c of l){if(typeof c!="object"||c===null)return null;const{question:o,header:d,options:h,multiSelect:m}=c;if(typeof o!="string"||!Array.isArray(h)||h.length===0)return null;const g=[];for(const x of h){if(typeof x!="object"||x===null)return null;const{label:y,description:j,preview:v}=x;if(typeof y!="string"||typeof j!="string")return null;g.push({label:y,description:j,...typeof v=="string"?{preview:v}:{}})}r.push({question:o,header:typeof d=="string"?d:"",options:g,multiSelect:m===!0})}return r}function kw({questions:n,answers:l}){return a.jsx("div",{className:"tool__questions",children:n.map((r,c)=>a.jsxs("div",{className:"tool__question",children:[a.jsxs("div",{className:"tool__question-head",children:[r.header&&a.jsx("span",{className:"chip chip--accent",children:r.header}),a.jsx("span",{className:"tool__question-text",children:r.question})]}),a.jsx("div",{className:"tool__question-answer",children:l!=null&&l[r.question]?a.jsx("span",{className:"tool__answer-value",children:l[r.question]}):a.jsx("span",{className:"tool__answer-empty",children:"не отвечено"})})]},c))})}function e_(n){return n>=1e3?`${(n/1e3).toFixed(1)}k`:String(n)}const Sw="ccv.dictation.lang",t_="ru-RU";function Ew(n){try{return Function.prototype.toString.call(n).includes("[native code]")}catch{return!1}}function n_(){const n=window,l=[n.SpeechRecognition,n.webkitSpeechRecognition].filter(c=>typeof c=="function"),r=l.find(Ew);return!r&&l.length>0&&$l("распознавание подменено: родной реализации в странице нет"),r??l[0]??null}function Ty(){var n;try{return((n=localStorage.getItem(Sw))==null?void 0:n.trim())||t_}catch{return t_}}function $l(n,l){l===void 0?console.debug(`[dictation] ${n}`):console.debug(`[dictation] ${n}`,l)}const Tw=3,Cw=400,Aw=5,Mw=250,Rw=2e3,Dw=2e4;async function Ow(){try{return(await navigator.permissions.query({name:"microphone"})).state==="granted"}catch{return!1}}const Lw={"not-allowed":"Браузер не дал доступ к микрофону","service-not-allowed":"Браузер не дал доступ к микрофону","audio-capture":"Микрофон не найден",network:"Сервис распознавания недоступен","language-not-supported":`Распознавание не знает языка ${Ty()}`};function zw(n){const[l]=b.useState(()=>n_()!==null),[r,c]=b.useState(!1),[o,d]=b.useState(null),h=b.useRef(null),m=b.useRef(!1),g=b.useRef(!1),x=b.useRef(n),y=b.useRef({openedAt:0,audio:!1,heard:!1,everHeard:!1,silent:0,dead:0,lastError:"",warned:!1}),j=b.useRef(null),v=b.useRef(!1),T=b.useRef(null),w=b.useCallback(()=>{T.current&&clearTimeout(T.current),T.current=null},[]),A=b.useCallback(()=>{w();const L=async G=>{if(T.current=null,!(!m.current||v.current)){if(!G&&!await Ow()){if($l("ждём ответа на запрос доступа к микрофону"),!m.current||v.current)return;T.current=setTimeout(()=>void L(!0),Dw);return}$l("движок не ответил на start()"),m.current=!1,c(!1),d("Распознавание не отвечает — проверьте расширения браузера и доступ к микрофону")}};T.current=setTimeout(()=>void L(!1),Rw)},[w]);b.useEffect(()=>{x.current=n}),b.useEffect(()=>{const L=n_();if(!L)return;const G=new L;return G.lang=Ty(),G.continuous=!0,G.interimResults=!0,G.onstart=()=>{$l("сессия открыта"),v.current=!0,w(),c(!0)},G.onaudiostart=()=>{$l("пошёл звук с микрофона"),y.current.audio=!0},G.onresult=M=>{var U;if(g.current)return;let z="",O="";for(let B=M.resultIndex;B<M.results.length;B++){const J=M.results[B];if(!J)continue;const me=((U=J[0])==null?void 0:U.transcript)??"";J.isFinal?z+=me:O+=me}const P=y.current;P.heard=!0,P.everHeard=!0,$l("распознано",{final:z,interim:O}),x.current(z,O)},G.onerror=M=>{y.current.lastError=M.error,$l("ошибка движка",M.error),!(M.error==="no-speech"||M.error==="aborted")&&(m.current=!1,c(!1),d(Lw[M.error]??`Распознавание не работает: ${M.error}`))},G.onend=()=>{g.current=!1,v.current=!1;const M=y.current,z=Date.now()-M.openedAt;if($l("сессия закрыта",{мс:z,звук:M.audio,слова:M.heard,ошибка:M.lastError||null}),!m.current){c(!1);return}if(M.dead=!M.audio&&z<Cw?M.dead+1:0,M.dead>=Aw){m.current=!1,c(!1),d(M.lastError?`Распознавание не работает: ${M.lastError}`:"Распознавание закрывается сразу после запуска — проверьте доступ к микрофону в настройках сайта");return}M.silent=M.heard?0:M.silent+1,!M.everHeard&&!M.warned&&M.silent>=Tw&&(M.warned=!0,d(M.audio?"Микрофон слушает, но речь не распознаётся — проверьте язык диктовки и уровень звука":"С микрофона не идёт звук — проверьте устройство ввода в настройках сайта в браузере")),j.current=setTimeout(()=>{if(j.current=null,!!m.current){M.openedAt=Date.now(),M.audio=!1,M.heard=!1,M.lastError="",A();try{G.start()}catch{}}},Mw)},h.current=G,()=>{m.current=!1,j.current&&clearTimeout(j.current),j.current=null,w(),G.onend=null,G.onresult=null,G.onerror=null,G.onstart=null,G.onaudiostart=null,G.abort(),h.current=null}},[]);const C=b.useCallback(()=>{var L;if(m.current){if(m.current=!1,$l("выключение микрофона"),j.current&&clearTimeout(j.current),j.current=null,w(),!v.current){c(!1);return}(L=h.current)==null||L.stop()}},[]),F=b.useCallback(()=>{const L=h.current;if(L){if(!window.isSecureContext){d("Микрофон доступен только по https или с localhost");return}d(null),m.current=!0,g.current=!1,j.current&&clearTimeout(j.current),j.current=null,y.current={openedAt:Date.now(),audio:!1,heard:!1,everHeard:!1,silent:0,dead:0,lastError:"",warned:!1},c(!0),$l("включение микрофона",{язык:L.lang}),A();try{L.start()}catch(G){$l("start() не прошёл",G)}}},[A]),Q=b.useCallback(()=>{m.current?C():F()},[F,C]),I=b.useCallback(()=>{var L;m.current&&v.current&&(g.current=!0,(L=h.current)==null||L.abort())},[]);return{supported:l,listening:r,error:o,toggle:Q,stop:C,drop:I}}const Uw="(max-width: 860px)",s_=/^\/(\S*)$/,Hw=new Set(["model","permissions"]);function Bw(n){return Hw.has(n.name)||n.name.startsWith("__")}const Iw=new Set(["clear","rename"]),l_=/(?:^|\s)@([^\s@]*)$/,$w=200,qw=100,Gw=190,Yw=5,Xw=20*1024*1024,Vw=1568,Qw=.85;let a_=0;async function Kw(n){var j,v;if(!n.type.startsWith("image/")||n.size>Xw)return null;const l=await Zw(n);if(!l)return null;const{width:r,height:c}=l;if(r<=0||c<=0)return null;const o=Math.min(1,Vw/Math.max(r,c)),d=document.createElement("canvas");d.width=Math.max(1,Math.round(r*o)),d.height=Math.max(1,Math.round(c*o));const h=d.getContext("2d");if(!h)return null;h.drawImage(l.image,0,0,d.width,d.height),(v=(j=l.image).close)==null||v.call(j);const m=n.type==="image/png",g=m?"image/png":"image/jpeg",x=d.toDataURL(g,m?void 0:Qw),y=x.slice(x.indexOf(",")+1);return y?(a_+=1,{id:`att${a_}`,mediaType:g,data:y,previewUrl:x}):null}async function Zw(n){if(typeof createImageBitmap=="function")try{const l=await createImageBitmap(n);return{image:l,width:l.width,height:l.height}}catch{}return new Promise(l=>{const r=URL.createObjectURL(n),c=new Image;c.onload=()=>{URL.revokeObjectURL(r),l({image:c,width:c.naturalWidth,height:c.naturalHeight})},c.onerror=()=>{URL.revokeObjectURL(r),l(null)},c.src=r})}function Cy({disabled:n,busy:l,commands:r,sessionTitle:c,contextResult:o,className:d,placeholder:h,draftKey:m,sendLabel:g="Отправить",autoFocus:x=!1,attachmentsEnabled:y=!0,sendBlocked:j=!1,onContextSearch:v,onCommand:T,onSend:w,onInterrupt:A,onEscape:C}){var nn;const F=ff(Uw),[Q,I]=b.useState(()=>m?tp(m):""),[L,G]=b.useState(!1),[M,z]=b.useState(0),O=b.useRef(null),P=b.useRef(null),U=b.useRef(!1),B=b.useRef(null),[J,me]=b.useState(()=>m?tp(m).length:0),[we,ve]=b.useState([]),$=b.useRef(null),Y=b.useCallback(Z=>{!y||Z.length===0||Promise.all(Z.map(Kw)).then(fe=>{const Me=fe.filter($e=>$e!==null);Me.length!==0&&ve($e=>[...$e,...Me].slice(0,Yw))})},[y]);function W(Z){ve(fe=>fe.filter(Me=>Me.id!==Z))}function he(Z){var $e;if(!y)return;const fe=($e=Z.clipboardData)==null?void 0:$e.items;if(!fe)return;const Me=[];for(const Dt of fe){if(!Dt.type.startsWith("image/"))continue;const pn=Dt.getAsFile();pn&&Me.push(pn)}Me.length!==0&&(Z.preventDefault(),Y(Me))}function Se(Z){const fe=Z.target.files?Array.from(Z.target.files):[];Z.target.value="",Y(fe)}b.useEffect(()=>{y||ve([])},[y]);const[k,se]=b.useState([]),[q,je]=b.useState(-1),te=b.useRef(""),[ke,De]=b.useState(""),Ge=zw(b.useCallback((Z,fe)=>{Z&&I(Me=>mp(Me,Z)),De(fe.trim())},[])),He=ke?mp(Q,ke):Q;b.useEffect(()=>{Ge.listening||ke===""||(I(Z=>mp(Z,ke)),De(""))},[Ge.listening,ke]),b.useEffect(()=>{var Z;x&&((Z=O.current)==null||Z.focus())},[x]);const bt=b.useRef(new Map),Ve=b.useRef(new Map),fn=b.useRef(m),We=b.useRef({text:Q,caret:J});We.current={text:Q,caret:J};const at=b.useCallback((Z,fe,Me)=>{fe===""?(bt.current.delete(Z),Ve.current.delete(Z)):(bt.current.set(Z,fe),Ve.current.set(Z,Me)),B_(Z,fe)},[]),ct=Ge.drop;b.useLayoutEffect(()=>{const Z=fn.current;if(Z===m)return;fn.current=m,Z&&at(Z,We.current.text,We.current.caret);const fe=m?bt.current.get(m)??tp(m):"",Me=m?Ve.current.get(m):void 0,$e=Math.min(Me??fe.length,fe.length);I(fe),me($e),B.current=[$e,$e],De(""),z(0),G(!1),je(-1),te.current="",ve([]),ct()},[m,at,ct]),b.useEffect(()=>{m&&at(m,Q,J)},[m,Q,J,at]);const jt=n?"Выберите сессию":j?"Нет VPN — отправка остановлена":h??"Опишите задачу… («/» — команды, «@» — файлы)",ut=b.useRef(0),$t=b.useCallback(Z=>{const fe=parseFloat(getComputedStyle(Z).maxHeight),Me=Number.isFinite(fe)&&fe>0?fe:Gw;Z.style.height="auto";const $e=Z.scrollHeight;Z.style.height=`${Math.min($e,Me)}px`,Z.style.overflowY=$e>Me?"auto":"hidden"},[]);b.useEffect(()=>{const Z=O.current;Z&&$t(Z)},[He,jt,n,$t]),b.useLayoutEffect(()=>{const Z=O.current,fe=B.current;!Z||!fe||(B.current=null,Z.setSelectionRange(fe[0],fe[1]))}),b.useEffect(()=>{const Z=O.current;if(!Z)return;const fe=new ResizeObserver(([Me])=>{const $e=Me==null?void 0:Me.contentRect.width;$e===void 0||Math.abs($e-ut.current)<1||(ut.current=$e,$t(Z))});return fe.observe(Z),()=>fe.disconnect()},[$t]);const wt=Ge.stop;b.useEffect(()=>{n&&wt()},[n,wt]);const Ce=b.useMemo(()=>Ge.error?{ok:!1,message:Ge.error}:null,[Ge.error]),Pe=b.useMemo(()=>{var Me;const Z=(Me=s_.exec(Q))==null?void 0:Me[1];if(Z===void 0)return[];const fe=Z.toLowerCase();return r.filter($e=>!Bw($e)&&gp($e,fe)<Ay).sort(($e,Dt)=>gp($e,fe)-gp(Dt,fe))},[Q,r]),Rt=!L&&Pe.length>0,dt=Math.min(M,Pe.length-1),Fe=L?null:((nn=l_.exec(He.slice(0,J)))==null?void 0:nn[1])??null,bn=b.useRef(v);bn.current=v,b.useEffect(()=>{if(Fe===null||Fe===""||Fe.endsWith("/")){bn.current(Fe);return}const Z=setTimeout(()=>bn.current(Fe),$w);return()=>clearTimeout(Z)},[Fe]);const ts=Fe!==null&&(o==null?void 0:o.query)===Fe,Lt=ts?o.entries:[],kt=Fe!==null,hs=kt&&!ts,hn=Math.min(M,Math.max(Lt.length-1,0));b.useEffect(()=>{var fe,Me;if(!Rt&&!kt)return;const Z=Rt?dt:hn;(Me=(fe=P.current)==null?void 0:fe.children[Z])==null||Me.scrollIntoView({block:"nearest"})},[Rt,kt,dt,hn]);function tn(Z,fe){var Me;I(Z),me(fe),B.current=[fe,fe],z(0),G(!1),ke!==""&&(De(""),Ge.drop()),(Me=O.current)==null||Me.focus()}function ps(){I(""),De(""),z(0),me(0),G(!1),je(-1),te.current="",ve([]),Ge.drop(),m&&at(m,"",0)}function _n(Z){const fe=Z.trim();if(fe===""&&we.length===0||n||j||U.current)return;const Me=w(fe,we.length>0?we.map($e=>({mediaType:$e.mediaType,data:$e.data})):void 0);if(Me instanceof Promise){U.current=!0,Me.then($e=>{U.current=!1,$e&&Ft(fe)},()=>{U.current=!1});return}Me!==!1&&Ft(fe)}function Ft(Z){Z!==""&&se(fe=>[Z,...fe.filter(Me=>Me!==Z)].slice(0,qw)),ps()}function Cn(Z){if(Z<-1||Z>=k.length)return;q===-1&&(te.current=Q);const fe=Z===-1?te.current:k[Z]??"";je(Z),tn(fe,fe.length)}function zt(){var $e;const Z=(($e=O.current)==null?void 0:$e.selectionStart)??He.length,Me=`${Z>0&&!/\s$/.test(He.slice(0,Z))?" ":""}@`;tn(He.slice(0,Z)+Me+He.slice(Z),Z+Me.length)}function Tt(Z){var Dt;const fe=(Dt=l_.exec(He.slice(0,J)))==null?void 0:Dt[1];if(fe===void 0)return;const Me=J-fe.length-1,$e=Z.kind==="dir"?`@${Z.path}/`:`@${Z.path} `;tn(He.slice(0,Me)+$e+He.slice(J),Me+$e.length)}function re(){var fe;if(j)return;const Z=(fe=s_.exec(He.trim()))==null?void 0:fe[1];if(Z&&T(Z)){ps();return}_n(He)}function ye(Z,fe){I(Z),me(fe),z(0),G(!1),je(-1),ke!==""&&(De(""),Ge.drop())}function Xe(Z){var $e;const fe=Iw.has(Z.name)?c:null,Me=`/${Z.name} `;I(Me+(fe??"")),me(Me.length+((fe==null?void 0:fe.length)??0)),fe&&(B.current=[Me.length,Me.length+fe.length]),z(0),($e=O.current)==null||$e.focus()}function it(Z){if(T(Z.name)){I(""),z(0),G(!1);return}Z.argumentHint?Xe(Z):_n(`/${Z.name}`)}function Je(Z){if(Rt){if(Z.key==="ArrowDown")return Z.preventDefault(),z(fe=>(Math.min(fe,Pe.length-1)+1)%Pe.length);if(Z.key==="ArrowUp"){Z.preventDefault();const fe=Pe.length-1;return z(Me=>(Math.min(Me,fe)+fe)%Pe.length)}if(Z.key==="Enter"&&!Z.shiftKey){Z.preventDefault();const fe=Pe[dt];fe&&it(fe);return}if(Z.key==="Tab"){Z.preventDefault();const fe=Pe[dt];fe&&Xe(fe);return}if(Z.key==="Escape"){Z.preventDefault(),Z.stopPropagation(),G(!0);return}}if(kt){if(Z.key==="ArrowDown"&&Lt.length>0)return Z.preventDefault(),z(fe=>(Math.min(fe,Lt.length-1)+1)%Lt.length);if(Z.key==="ArrowUp"&&Lt.length>0){Z.preventDefault();const fe=Lt.length-1;return z(Me=>(Math.min(Me,fe)+fe)%Lt.length)}if(Z.key==="Enter"&&!Z.shiftKey||Z.key==="Tab"){const fe=Lt[hn];if(fe){Z.preventDefault(),Tt(fe);return}if(Z.key==="Tab")return}if(Z.key==="Escape"){Z.preventDefault(),Z.stopPropagation(),G(!0);return}}if((Z.key==="ArrowUp"||Z.key==="ArrowDown")&&!Z.shiftKey){const fe=Z.currentTarget,Me=fe.selectionStart;if(fe.selectionEnd===Me){const Dt=Z.key==="ArrowUp"?q+1:q-1;Dt>=-1&&Dt<k.length&&requestAnimationFrame(()=>{fe.selectionStart===Me&&fe.selectionEnd===Me&&Cn(Dt)})}}if(Z.key==="Escape"&&C){Z.preventDefault(),Z.stopPropagation(),C();return}Z.key==="Enter"&&!Z.shiftKey&&!F&&(Z.preventDefault(),re())}return a.jsx("div",{className:d?`composer ${d}`:"composer",children:a.jsxs("div",{className:"composer__inner",children:[a.jsx(Xr,{result:Ce}),kt&&!Rt&&a.jsxs("div",{className:"cmdmenu",role:"listbox",ref:P,children:[Lt.map((Z,fe)=>a.jsxs("button",{role:"option","aria-selected":fe===hn,className:fe===hn?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>z(fe),onMouseDown:Me=>{Me.preventDefault(),Tt(Z)},children:[a.jsxs("span",{className:"cmdmenu__name",children:[Z.name,Z.kind==="dir"?"/":""]}),a.jsx("span",{className:"cmdmenu__desc",children:Z.path}),Z.ignored&&a.jsx("span",{className:"cmdmenu__tag",children:"git-ignore"})]},Z.path)),Lt.length===0&&a.jsx("div",{className:"cmdmenu__empty",children:hs?"ищем…":Fe?"Ничего не нашлось":"Наберите имя файла или каталога"})]}),Rt&&a.jsx("div",{className:"cmdmenu",role:"listbox",ref:P,children:Pe.map((Z,fe)=>a.jsxs("button",{role:"option","aria-selected":fe===dt,className:fe===dt?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>z(fe),onMouseDown:Me=>{Me.preventDefault(),it(Z)},children:[a.jsxs("span",{className:"cmdmenu__name",children:["/",Z.name]}),Z.argumentHint&&a.jsx("span",{className:"cmdmenu__hint",children:Z.argumentHint}),a.jsx("span",{className:"cmdmenu__desc",children:Z.description})]},Z.name))}),we.length>0&&a.jsx("div",{className:"composer__attachments",children:we.map(Z=>a.jsxs("div",{className:"composer__thumb",children:[a.jsx("img",{src:Z.previewUrl,alt:"Вложение"}),a.jsx("button",{type:"button",className:"composer__thumb-remove","aria-label":"Удалить вложение",onClick:()=>W(Z.id),children:a.jsx(tk,{})})]},Z.id))}),a.jsxs("div",{className:"composer__field",children:[a.jsx("button",{type:"button",className:"addbtn",title:"Добавить контекст — файл проекта («@»)","aria-label":"Добавить контекст",disabled:n,onClick:zt,children:a.jsx(Ww,{})}),y&&a.jsxs(a.Fragment,{children:[a.jsx("input",{ref:$,type:"file",accept:"image/*",multiple:!0,className:"composer__fileinput",tabIndex:-1,"aria-hidden":"true",onChange:Se}),a.jsx("button",{type:"button",className:"attachbtn",title:"Прикрепить изображение","aria-label":"Прикрепить изображение",disabled:n,onClick:()=>{var Z;return(Z=$.current)==null?void 0:Z.click()},children:a.jsx(ek,{})})]}),a.jsx("textarea",{ref:O,value:He,disabled:n,placeholder:jt,onChange:Z=>ye(Z.target.value,Z.target.selectionStart),onSelect:Z=>me(Z.currentTarget.selectionStart),onKeyDown:Je,onPaste:he}),Ge.supported&&a.jsx("button",{type:"button",className:Ge.listening?"micbtn is-on":"micbtn",title:Ge.listening?"Остановить диктовку":"Продиктовать промпт","aria-label":Ge.listening?"Остановить диктовку":"Продиктовать промпт","aria-pressed":Ge.listening,disabled:n,onClick:Ge.toggle,children:a.jsx(nk,{on:Ge.listening})}),l?a.jsx("button",{className:"btn",onClick:A,title:"Прервать (Esc)",children:"Стоп"}):a.jsxs("button",{className:"btn btn--primary sendbtn",onClick:re,disabled:n||j||He.trim()===""&&we.length===0,"aria-label":g,title:j?"Нет VPN — отправка остановлена":g,children:[a.jsx("span",{className:"sendbtn__label",children:g}),a.jsx(Pw,{})]})]})]})})}function mp(n,l){const r=l.trim();if(r==="")return n;const c=Up(r).slice(Fw(n,r)).join(" ");return c===""?n:n===""||/\s$/.test(n)?n+c:`${n} ${c}`}function Fw(n,l){const r=Up(n),c=Up(l);for(let o=Math.min(r.length,c.length);o>0;o--)if(r.slice(r.length-o).every((d,h)=>Jw(d,c[h]??"")))return o;return 0}function Up(n){return n.split(/\s+/).filter(l=>l!=="")}function Jw(n,l){const r=c=>c.toLowerCase().replace(/[.,!?;:…]+$/u,"");return r(n)===r(l)}function Ww(){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 Pw(){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 ek(){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 tk(){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 nk({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 Ay=4;function gp(n,l){const r=n.name.toLowerCase();return r===l?0:r.startsWith(l)?1:n.aliases.some(c=>c.toLowerCase().startsWith(l))?2:r.includes(l)?3:Ay}function sk({request:n,plan:l,queued:r,collapsed:c,onCollapse:o,onAccept:d,onDecline:h}){const[m,g]=b.useState(l),[x,y]=b.useState("preview");b.useEffect(()=>{g(l),y("preview")},[n.requestId,l]);const j=m.trim().length>0;function v(){j&&d(n.requestId,m)}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(My,{})}),a.jsxs("span",{className:"plansheet__head-text",children:["План на согласование",r>0&&` — ещё ${r} в очереди`]}),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:()=>y("preview"),children:"Просмотр"}),a.jsx("button",{className:"btn btn--sm"+(x==="source"?" is-on":""),role:"tab","aria-selected":x==="source",onClick:()=>y("source"),children:"Код"})]}),a.jsx(am,{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(lk,{text:m}):a.jsx("textarea",{className:"plansheet__source",value:m,onChange:T=>g(T.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:!j,autoFocus:!0,onClick:v,children:"Одобрить план"})]})]})})}function lk({text:n}){const[l,r]=b.useState("");return b.useEffect(()=>{let c=!1;return mf(n).then(o=>{c||r(o)}),()=>{c=!0}},[n]),a.jsx("div",{className:"markdown-preview plansheet__preview",dangerouslySetInnerHTML:{__html:l}})}function My(){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 ak({kind:n,toolName:l,queued:r,onExpand:c}){const o=n==="question"?"Уточняющий вопрос":n==="plan"?"План на согласование":`Разрешить действие: ${l}`;return a.jsxs("button",{type:"button",className:`decision-bar decision-bar--${n}`,onClick:c,children:[a.jsx("span",{className:"decision-bar__icon","aria-hidden":"true",children:n==="question"?"?":n==="plan"?a.jsx(My,{}):"!"}),a.jsxs("span",{className:"decision-bar__text",children:[a.jsx("span",{className:"decision-bar__title",children:o}),a.jsxs("span",{className:"decision-bar__sub",children:["ждёт вашего решения",r>0&&` — ещё ${r} в очереди`]})]}),a.jsxs("span",{className:"decision-bar__action",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 10 4-4 4 4"})})]})]})}function am({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 ik({request:n,queued:l,collapsed:r,onCollapse:c,onDecide:o}){const d=Ey(n.toolName,n.input);return a.jsx("div",{className:"modal-backdrop modal-backdrop--sheet",hidden:r,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:["Разрешить действие?",l>0&&` (ещё ${l} в очереди)`]}),a.jsx(am,{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}),d?a.jsx(sm,{diff:d}):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 rk({request:n,queued:l,collapsed:r,onCollapse:c,onAnswer:o,onDecline:d}){const{questions:h}=n,[m,g]=b.useState(()=>h.map(()=>new Set)),[x,y]=b.useState(()=>h.map(()=>"")),[j,v]=b.useState(()=>i_(h));b.useEffect(()=>{g(h.map(()=>new Set)),y(h.map(()=>"")),v(i_(h))},[n.requestId]);const T=b.useMemo(()=>ok(h,m,x),[h,m,x]),w=T!==null;function A(G,M){var z,O;(O=(z=h[G])==null?void 0:z.options[M])!=null&&O.preview&&v(P=>{const U=P.slice();return U[G]=M,U})}function C(G,M,z){g(O=>{const P=O.slice(),U=new Set(P[G]);return z?U.has(M)?U.delete(M):U.add(M):U.has(M)||(U.clear(),U.add(M)),P[G]=U,P}),M!=="other"&&A(G,M)}function F(G,M){y(z=>{const O=z.slice();return O[G]=M,O})}function Q(){T&&o(n.requestId,T)}function I(G){G.key==="Enter"&&(G.target.closest("button")||w&&(G.preventDefault(),Q()))}function L(G){var P;if(!["ArrowDown","ArrowUp","ArrowRight","ArrowLeft"].includes(G.key))return;const M=Array.from(G.currentTarget.querySelectorAll("button.qsheet__option")),z=M.indexOf(document.activeElement);if(z===-1)return;G.preventDefault();const O=G.key==="ArrowDown"||G.key==="ArrowRight"?1:-1;(P=M[(z+O+M.length)%M.length])==null||P.focus()}return a.jsx("div",{className:"modal-backdrop modal-backdrop--sheet",hidden:r,children:a.jsxs("div",{className:"qsheet",role:"dialog","aria-modal":"true","aria-label":"Вопрос от Claude",onKeyDown:I,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})`,l>0&&` — ещё ${l} в очереди`]}),a.jsx(am,{onClick:c})]}),a.jsxs("div",{className:"qsheet__body",children:[n.reason&&a.jsx("p",{className:"qsheet__reason",children:n.reason}),h.map((G,M)=>a.jsx(ck,{q:G,qi:M,selected:m[M]??new Set,otherText:x[M]??"",previewIndex:j[M]??null,onToggle:C,onFocusOption:A,onOtherText:F,onOptionsKeyDown:L},M))]}),a.jsxs("div",{className:"qsheet__actions",children:[a.jsx("button",{className:"btn",onClick:()=>d(n.requestId),children:"Не отвечать"}),a.jsx("button",{className:"btn btn--primary",disabled:!w,onClick:Q,children:"Ответить"})]})]})})}function ck({q:n,qi:l,selected:r,otherText:c,previewIndex:o,onToggle:d,onFocusOption:h,onOtherText:m,onOptionsKeyDown:g}){var T;const x=n.options.some(w=>w.preview),y=o!==null?(T=n.options[o])==null?void 0:T.preview:void 0,j=r.has("other"),v=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:g,children:[n.options.map((w,A)=>{const C=r.has(A);return a.jsxs("button",{type:"button",role:v,"aria-checked":C,className:"qsheet__option"+(C?" is-selected":""),onClick:()=>d(l,A,n.multiSelect),onFocus:()=>h(l,A),onMouseEnter:()=>h(l,A),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:w.label}),a.jsx("span",{className:"qsheet__opt-desc",children:w.description})]})]},A)}),a.jsxs("div",{className:"qsheet__other",children:[a.jsxs("button",{type:"button",role:v,"aria-checked":j,className:"qsheet__option qsheet__option--other"+(j?" is-selected":""),onClick:()=>d(l,"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:"Свой вариант ответа"})]})]}),j&&a.jsx("input",{type:"text",className:"qsheet__other-input",placeholder:"Впишите свой вариант…","aria-label":`Свой вариант ответа на вопрос «${n.question}»`,value:c,onChange:w=>m(l,w.target.value),autoFocus:!0})]})]}),x&&a.jsx("pre",{className:"qsheet__preview",children:y??""})]})}function i_(n){return n.map(l=>{const r=l.options.findIndex(c=>c.preview);return r===-1?null:r})}function ok(n,l,r){const c={};for(let o=0;o<n.length;o++){const d=n[o];if(!d)continue;const h=l[o]??new Set,m=[];for(let g=0;g<d.options.length;g++){const x=d.options[g];x&&h.has(g)&&m.push(x.label)}if(h.has("other")){const g=(r[o]??"").trim();g&&m.push(g)}if(m.length===0)return null;c[d.question]=m.join(", ")}return c}function uk(n,l){if(n!=="ExitPlanMode"||!l||typeof l!="object")return null;const r=l.plan;return typeof r=="string"?r:null}function Ry({path:n}){const[l,r]=b.useState(!1),[c,o]=b.useState(!1),d=b.useRef(null);b.useEffect(()=>{if(!l)return;function m(g){var x;(x=d.current)!=null&&x.contains(g.target)||r(!1)}return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[l]),b.useEffect(()=>{if(!c)return;const m=setTimeout(()=>o(!1),nm);return()=>clearTimeout(m)},[c]),b.useEffect(()=>r(!1),[n]);async function h(){await Na(n)&&o(!0)}return a.jsxs("div",{ref:d,className:"cwd",children:[a.jsxs("button",{type:"button",className:"cwd__toggle","aria-expanded":l,title:l?"Свернуть путь":`Полный путь: ${n}`,onClick:()=>r(m=>!m),onKeyDown:m=>{m.key!=="Escape"||!l||(m.preventDefault(),m.stopPropagation(),r(!1))},children:[a.jsx(dk,{open:l}),a.jsx("span",{className:"cwd__short",children:n})]}),l&&a.jsxs("div",{className:"cwd__pop",children:[a.jsx("span",{className:"cwd__full",children:n}),a.jsx("button",{type:"button",className:"btn btn--ghost cwd__copy",onClick:()=>void h(),children:c?Gc:qr})]})]})}function dk({open:n}){return a.jsx("svg",{className:n?"cwd__chev cwd__chev--open":"cwd__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"})})}const fk=["low","medium","high"];function Dy({models:n,value:l,effort:r,ultracode:c,thinking:o,switchOnFlag:d,showSwitchOnFlag:h=!0,className:m,onModel:g,onEffort:x,onUltracode:y,onThinking:j,onSwitchOnFlag:v}){const[T,w]=b.useState(!1),[A,C]=b.useState(0),F=b.useRef(null),Q=b.useRef(null),I=n.find(O=>O.value===l)??null,L=I&&I.supportsEffort?I.effortLevels.length>0?I.effortLevels:fk:[],G=L.includes("xhigh");b.useEffect(()=>{if(!T)return;const O=n.findIndex(P=>P.value===l);C(O===-1?0:O)},[T]),b.useEffect(()=>{if(!T)return;function O(P){var U;(U=F.current)!=null&&U.contains(P.target)||w(!1)}return document.addEventListener("mousedown",O),()=>document.removeEventListener("mousedown",O)},[T]),b.useEffect(()=>{var O,P;T&&((P=(O=Q.current)==null?void 0:O.querySelector(".is-cursor"))==null||P.scrollIntoView({block:"nearest"}))},[T,A]);function M(O){w(!1),O.value!==l&&g(O.value)}function z(O){if(O.key==="Escape"){if(!T)return;O.preventDefault(),O.stopPropagation(),w(!1);return}if(O.key==="ArrowDown"||O.key==="ArrowUp"){if(O.preventDefault(),!T)return w(!0);if(n.length===0)return;const P=O.key==="ArrowDown"?1:n.length-1;return C(U=>(U+P)%n.length)}if(O.key==="Enter"||O.key===" "){if(O.preventDefault(),!T)return w(!0);const P=n[A];P&&M(P)}}return a.jsxs("div",{ref:F,className:"select"+(T?" select--open":"")+(m?` ${m}`:""),children:[a.jsxs("button",{type:"button",className:"select__trigger",title:"Модель, усилие и размышления","aria-label":"Модель, усилие и размышления","aria-haspopup":"menu","aria-expanded":T,onClick:()=>w(O=>!O),onKeyDown:z,children:[(I==null?void 0:I.displayName)??l?a.jsx("span",{className:"select__value",children:(I==null?void 0:I.displayName)??l}):a.jsx("span",{className:"select__value select__value--muted",children:"по умолчанию"}),c?a.jsx("span",{className:"select__suffix select__suffix--hot",children:"ultracode"}):L.length>0&&r&&a.jsx("span",{className:"select__suffix",children:r}),a.jsx(hk,{})]}),T&&a.jsxs("div",{ref:Q,className:"select__menu modelmenu",role:"menu",children:[a.jsx("div",{className:"modelmenu__head",children:"Модель"}),n.map((O,P)=>a.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":O.value===l,className:"select__option"+(P===A?" is-cursor":"")+(O.value===l?" is-on":""),onMouseEnter:()=>C(P),onClick:()=>M(O),children:[a.jsx("span",{className:"select__check","aria-hidden":"true",children:O.value===l?"✓":""}),a.jsx("span",{className:"select__label",children:O.displayName}),O.description&&a.jsx("span",{className:"select__hint",children:O.description})]},O.value)),L.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:L.map(O=>a.jsx("button",{type:"button",role:"menuitemradio","aria-checked":O===r,className:O===r?"modelmenu__level is-on":"modelmenu__level",onClick:()=>x(O),children:O},O))})]}),G&&a.jsx(xp,{label:"Ultracode",desc:"xhigh и постоянная оркестрация подагентами",on:c,onToggle:()=>y(!c)})]}),a.jsx("div",{className:"modelmenu__sep",role:"separator"}),(I==null?void 0:I.supportsThinking)!==!1&&a.jsx(xp,{label:"Размышления",desc:"расширенное обдумывание перед ответом",on:o,onToggle:()=>j(!o)}),h&&a.jsx(xp,{label:"Менять модель по флагу",desc:"иначе помеченный ход встаёт на паузу",on:d,onToggle:()=>v(!d)})]})]})}function xp({label:n,desc:l,on:r,onToggle:c}){return a.jsxs("button",{type:"button",role:"menuitemcheckbox","aria-checked":r,className:"modelmenu__row modelmenu__row--btn",onClick:c,children:[a.jsxs("span",{className:"modelmenu__label",children:[n,a.jsx("span",{className:"modelmenu__desc",children:l})]}),a.jsx("span",{className:r?"switch is-on":"switch","aria-hidden":"true",children:a.jsx("span",{className:"switch__knob"})})]})}function hk(){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 vs({title:n,children:l,actions:r,className:c,sheet:o=!1,onClose:d}){const h=b.useRef(null);return b.useEffect(()=>{function m(g){if(g.key==="Escape"){g.preventDefault(),g.stopPropagation(),d();return}if(g.key!=="Tab")return;const x=h.current;if(!x)return;const y=x.querySelectorAll('button, input, textarea, select, a[href], [tabindex]:not([tabindex="-1"])'),j=y[0],v=y[y.length-1];!j||!v||(g.shiftKey&&document.activeElement===j?(g.preventDefault(),v.focus()):!g.shiftKey&&document.activeElement===v&&(g.preventDefault(),j.focus()))}return document.addEventListener("keydown",m,!0),()=>document.removeEventListener("keydown",m,!0)},[d]),a.jsx("div",{className:o?"modal-backdrop modal-backdrop--sheet":"modal-backdrop",onMouseDown:m=>{m.target===m.currentTarget&&d()},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:d,children:"✕"})]}),a.jsx("div",{className:"modal__body",children:l}),r&&a.jsx("div",{className:"modal__actions",children:r})]})})}function pk({candidates:n,searching:l,agentItems:r,agentBusy:c,error:o,roots:d,created:h,onSearch:m,onAskAgent:g,onInterrupt:x,onSubmit:y,onCreate:j,onClose:v}){const[T,w]=b.useState("open"),[A,C]=b.useState(""),[F,Q]=b.useState(!1),[I,L]=b.useState(""),[G,M]=b.useState(""),[z,O]=b.useState({git:!0,claudeMd:!0,readme:!0}),P=A.trim(),U=P!=="",B=I.trim(),J=G.trim(),me=B!==""&&J!=="";b.useEffect(()=>{I===""&&d.length>0&&L(d[0])},[d]);const we=b.useRef(m);we.current=m,b.useEffect(()=>{if(T!=="open")return;const W=A.trim(),he=setTimeout(()=>we.current(W),200);return()=>clearTimeout(he)},[A,T]);function ve(){U&&y(P)}function $(){me&&j(B,J,z)}function Y(){U&&(Q(!0),g(P))}return h?a.jsxs(vs,{title:"Новый проект",onClose:v,actions:a.jsx("button",{className:"btn btn--primary",onClick:v,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(W=>a.jsx("li",{children:W},W))})}),a.jsx("p",{className:"modal__text modal__text--dim",children:"Проект открыт и работает — недостающее можно добавить руками, в дереве файлов или из терминала."})]}):a.jsxs(vs,{title:"Новый проект",className:F&&T==="open"?"modal--wide":void 0,onClose:v,actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:v,children:"Отмена"}),T==="open"?a.jsxs(a.Fragment,{children:[c?a.jsx("button",{className:"btn",onClick:x,children:"Остановить"}):a.jsx("button",{className:"btn",disabled:!U,onClick:Y,title:"Найти по описанию",children:"Попросить агента"}),a.jsx("button",{className:"btn btn--primary",disabled:!U,onClick:ve,children:"Открыть"})]}):a.jsx("button",{className:"btn btn--primary",disabled:!me,onClick:$,children:"Создать"})]}),children:[a.jsxs("div",{className:"tabs",children:[a.jsx(r_,{label:"Открыть",on:T==="open",onClick:()=>w("open")}),a.jsx(r_,{label:"Создать",on:T==="create",onClick:()=>w("create")})]}),T==="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:A,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"C:\\Projects\\my-app",onChange:W=>C(W.target.value),onKeyDown:W=>{W.key==="Enter"&&(W.preventDefault(),ve())}}),o&&a.jsx("p",{className:"modal__error",children:o}),n.length>0&&a.jsx("ul",{className:"finds",children:n.map(W=>a.jsx("li",{children:a.jsxs("button",{className:"find",disabled:W.open,title:W.open?"Этот проект уже открыт":W.path,onClick:()=>C(W.path),onDoubleClick:()=>y(W.path),children:[a.jsx("span",{className:"find__name",children:W.name}),a.jsx("span",{className:"find__path",children:W.path}),a.jsx("span",{className:"find__note",children:xk(W)})]})},W.path))}),n.length===0&&U&&!l&&!F&&a.jsx("p",{className:"modal__text modal__text--dim",children:"Ничего похожего среди каталогов, где вы работали. Если помните не имя, а суть проекта — опишите его и нажмите «Попросить агента». Проекта ещё нет вовсе — рядом вкладка «Создать»."}),F&&a.jsx("div",{className:"finds__agent",children:a.jsx(lm,{items:r,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:I,spellCheck:!1,autoComplete:"off",placeholder:"C:\\Projects",onChange:W=>L(W.target.value)}),d.length>0&&a.jsx("div",{className:"newproj__roots",children:d.map(W=>a.jsx("button",{type:"button",className:W===B?"newproj__root is-on":"newproj__root",title:W,onClick:()=>L(W),children:gk(W)},W))}),a.jsx("label",{className:"field newproj__field",htmlFor:"workspace-name",children:"Имя проекта"}),a.jsx("input",{id:"workspace-name",className:"input input--mono",value:G,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"my-app",onChange:W=>M(W.target.value),onKeyDown:W=>{W.key==="Enter"&&(W.preventDefault(),$())}}),a.jsx("p",{className:"newproj__preview",children:me?mk(B,J):"Каталог появится здесь"}),o&&a.jsx("p",{className:"modal__error",children:o}),a.jsxs("div",{className:"newproj__opts",children:[a.jsx(bp,{label:"git init",desc:"панель истории работает сразу",on:z.git,onToggle:()=>O(W=>({...W,git:!W.git}))}),a.jsx(bp,{label:"CLAUDE.md",desc:"заготовка инструкций для агента",on:z.claudeMd,onToggle:()=>O(W=>({...W,claudeMd:!W.claudeMd}))}),a.jsx(bp,{label:"README.md",desc:"по нему проект потом узнаёт поиск",on:z.readme,onToggle:()=>O(W=>({...W,readme:!W.readme}))})]})]})]})}function r_({label:n,on:l,onClick:r}){return a.jsx("button",{type:"button",className:l?"tabs__tab is-on":"tabs__tab","aria-pressed":l,onClick:r,children:n})}function bp({label:n,desc:l,on:r,onToggle:c}){return a.jsxs("button",{type:"button",role:"checkbox","aria-checked":r,className:"newproj__opt",onClick:c,children:[a.jsxs("span",{className:"newproj__optlabel",children:[n,a.jsx("span",{className:"newproj__optdesc",children:l})]}),a.jsx("span",{className:r?"switch is-on":"switch","aria-hidden":"true",children:a.jsx("span",{className:"switch__knob"})})]})}function mk(n,l){const r=n.includes("\\")?"\\":"/";return n.replace(/[\\/]+$/,"")+r+l}function gk(n){const l=n.includes("\\")?"\\":"/",r=n.split(/[\\/]/).filter(Boolean);return r.length<=2?n:`…${l}${r.slice(-2).join(l)}`}function xk(n){return n.open?"уже открыт":n.why?n.why:n.sessions===0?"рядом с вашими проектами":`${bk(n.sessions)}${_k(n.lastUsedAt)}`}function bk(n){const l=n%10,r=n%100;return r>=11&&r<=14?`${n} сессий`:l===1?`${n} сессия`:l>=2&&l<=4?`${n} сессии`:`${n} сессий`}function _k(n){if(!n)return"";const l=Math.floor((Date.now()-n)/864e5);return l<=0?" · сегодня":l===1?" · вчера":l<30?` · ${l} дн. назад`:` · ${new Date(n).toLocaleDateString("ru-RU")}`}const im=7;function yk(n){const l=[],r=[];let c=1;for(const o of n){const d=l.slice();let h=l.indexOf(o.hash);h===-1&&(h=c_(l),l[h]=o.hash);const[m,...g]=o.parents;l[h]=m??null;const x=[];m!==void 0&&x.push({from:h,to:h});for(const v of g){let T=l.indexOf(v);T===-1&&(T=c_(l),l[T]=v),x.push({from:h,to:T})}const y=[];for(let v=0;v<d.length;v++)d[v]===o.hash&&(y.push({from:v,to:h}),v!==h&&(l[v]=null));const j=[];for(let v=0;v<d.length;v++){const T=d[v];!T||T===o.hash||v===h||l[v]===T&&j.push(v)}vk(l),c=Math.max(c,l.length,h+1),r.push({commit:o,col:h,up:y,down:x,through:j})}return{rows:r,columns:Math.min(c,im)}}function c_(n){const l=n.indexOf(null);return l!==-1?l:(n.push(null),n.length-1)}function vk(n){for(;n.length>0&&n[n.length-1]===null;)n.pop()}const Oy=1500;function jk(n){const l=[];let r=!1;for(const c of n.patch.split(`
|
|
119
|
-
`)){if(l.length>=Oy){r=!0;break}if(c.startsWith("@@"))l.push({type:"gap",text:Nk(c)});else if(c.startsWith("+"))l.push({type:"add",text:c.slice(1)});else if(c.startsWith("-"))l.push({type:"del",text:c.slice(1)});else{if(c.startsWith("\\"))continue;(c!==""||l.length>0)&&l.push({type:"ctx",text:c.startsWith(" ")?c.slice(1):c})}}return{kind:"patch",filePath:n.path||n.oldPath,rows:l,added:n.added,removed:n.removed,note:wk(n,r)}}function Nk(n){const l=/^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@ ?(.*)$/.exec(n);if(!l)return n;const r=Number(l[1]),c=l[2]===void 0?1:Number(l[2]),o=(l[3]??"").trim(),d=c>1?`строки ${r}–${r+c-1}`:`строка ${r}`;return o?`⋯ ${d} · ${o}`:`⋯ ${d}`}function wk(n,l){const r=[];return n.status==="added"&&r.push("новый файл"),n.status==="deleted"&&r.push("файл удалён"),n.status==="renamed"&&r.push(`переименован из ${n.oldPath}`),n.binary?r.push("двоичный файл"):n.patch===""&&r.push("содержимое не показано"),l&&r.push(`показаны первые ${Oy} строк`),r.length>0?r.join(" · "):null}function kk({open:n,state:l,result:r,selected:c,busy:o,onRefresh:d,onShow:h,onCheckout:m,onPush:g,onPull:x,onPublish:y,onConnectRemote:j,onDismissResult:v,onClose:T,zoomed:w,onToggleZoom:A}){const C=yk((l==null?void 0:l.commits)??[]),F=[...l!=null&&l.detached?[{value:"",label:`отделён · ${l.head.slice(0,8)}`}]:[],...((l==null?void 0:l.branches)??[]).map(Q=>({value:Q.name,label:Q.name,hint:Q.hash.slice(0,8)}))];return a.jsxs("aside",{className:(n?"sidepane sidepane--git sidepane--open":"sidepane sidepane--git")+(w?" sidepane--zoomed":""),"aria-label":"История git",children:[a.jsxs("div",{className:"sidepane__head",onDoubleClick:Q=>{A&&(Q.target.closest("button")||A())},children:[a.jsx(Mk,{}),a.jsx("span",{className:"sidepane__title",children:"История"}),a.jsx("button",{className:"sidepane__btn",title:"Обновить","aria-label":"Обновить историю",onClick:d,children:"↻"}),A&&a.jsx("button",{className:"sidepane__btn",title:w?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":w?"Свернуть панель истории":"Развернуть панель истории на весь экран","aria-pressed":w,onClick:A,children:a.jsx(to,{active:w})}),a.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель истории",onClick:T,children:"✕"})]}),l===null?a.jsx("p",{className:"sidepane__empty",children:"Читаем репозиторий…"}):l.available?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"gitbar",children:[a.jsx(Yl,{className:"gitbar__branch",title:"Ветка — выбрать значит переключиться",value:l.detached?"":l.branch,options:F,onChange:Q=>{Q&&m(Q,`ветку ${Q}`)}}),a.jsx(Pc,{text:l.detached?l.head:l.branch,hint:l.detached?"хеш HEAD":"имя ветки"})]}),l.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(Lk,{}),o]}):l.hasRemote?a.jsxs(a.Fragment,{children:[a.jsxs("button",{type:"button",className:"btn btn--sm",title:"Отправить текущую ветку в origin",onClick:g,children:[a.jsx(Rk,{}),"Отправить",l.ahead>0&&a.jsx("span",{className:"gitbar__count",children:l.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(Dk,{}),"Забрать",l.behind>0&&a.jsx("span",{className:"gitbar__count",children:l.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(Ok,{})})]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("button",{type:"button",className:"btn btn--sm btn--primary",title:"Создать репозиторий на GitHub и отправить в него ветку",onClick:y,children:[a.jsx(u_,{}),"Опубликовать на GitHub"]}),a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",title:"Прописать origin на уже существующий репозиторий",onClick:j,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:l.changed.length>0?`Рабочее дерево · ${l.changed.length} ${Bk(l.changed.length)}`:"Рабочее дерево чистое"}),a.jsx("span",{className:"gitrow__meta",children:l.changed.length>0?l.changed.slice(0,4).map(Q=>Hk(Q.path)).join(", "):"незакоммиченных изменений нет"})]})}),C.rows.map(Q=>a.jsx(Ek,{row:Q,columns:C.columns,head:Q.commit.hash===l.head,local:l.hasRemote&&!Q.commit.pushed,active:c===Q.commit.hash,onOpen:()=>h(Q.commit.hash)},Q.commit.hash)),C.rows.length===0&&a.jsx("p",{className:"sidepane__empty",children:"В репозитории ещё нет коммитов"})]})]}):a.jsxs("div",{className:"gitempty",children:[a.jsx("p",{className:"gitempty__text",children:l.message||"Это не git-репозиторий"}),l.noRepo&&a.jsxs(a.Fragment,{children:[a.jsxs("button",{type:"button",className:"btn btn--sm btn--primary gitempty__btn",onClick:y,children:[a.jsx(u_,{}),"Опубликовать на GitHub"]}),a.jsx("p",{className:"gitempty__hint",children:"Заведёт репозиторий, сделает первый коммит и отправит его на GitHub."})]})]}),a.jsx(Xr,{result:r,onDismiss:v})]})}const iu=50,o_=13,Sk=500;function Ek({row:n,columns:l,head:r,local:c,active:o,onOpen:d}){const{commit:h}=n,m=h.refs.map(zk).filter(Boolean),[g,x]=b.useState(null),y=b.useRef(null);function j(A){const C=A.touches[0];if(!C)return;const F={timer:0,x:C.clientX,y:C.clientY,fired:!1};F.timer=window.setTimeout(()=>{F.fired=!0,x({x:F.x,y:F.y})},Sk),y.current=F}function v(A){const C=y.current,F=A.touches[0];!C||!F||Math.hypot(F.clientX-C.x,F.clientY-C.y)>10&&(window.clearTimeout(C.timer),y.current=null)}function T(A){const C=y.current;C&&(window.clearTimeout(C.timer),C.fired&&A.preventDefault())}function w(){const A=[{id:"hash",label:"Копировать хеш",hint:h.shortHash,onSelect:()=>void Na(h.hash)},{id:"short",label:"Копировать короткий хеш",onSelect:()=>void Na(h.shortHash)},{id:"subject",label:"Копировать сообщение",onSelect:()=>void Na(h.subject)}],C=new Set;for(const F of h.refs){const Q=F.startsWith("tag: "),I=Uk(F);!I||C.has(I)||(C.add(I),A.push({id:`ref:${I}`,label:Q?"Копировать тег":"Копировать ветку",hint:I,onSelect:()=>void Na(I)}))}return A}return a.jsxs(a.Fragment,{children:[a.jsxs("button",{className:"gitrow"+(o?" is-on":""),title:c?"Коммит ещё не отправлен на удалённый репозиторий":void 0,onClick:()=>{var A;if((A=y.current)!=null&&A.fired){y.current=null;return}d()},onContextMenu:A=>{A.preventDefault(),x({x:A.clientX,y:A.clientY})},onTouchStart:j,onTouchMove:v,onTouchEnd:T,onTouchCancel:T,children:[a.jsx(Tk,{row:n,columns:l,head:r,local:c}),a.jsxs("span",{className:"gitrow__body",children:[a.jsxs("span",{className:"gitrow__subject",children:[m.map(A=>a.jsx("span",{className:"gitrow__ref",children:A},A)),h.subject]}),a.jsxs("span",{className:"gitrow__meta",children:[h.shortHash," · ",h.author," · ",Ik(h.date),c&&a.jsx("span",{className:"gitrow__local",children:"· не отправлен"})]})]})]}),g&&a.jsx(tr,{x:g.x,y:g.y,items:w(),onClose:()=>x(null)})]})}function Tk({row:n,columns:l,head:r,local:c}){const o=l*o_+6,d=iu/2,h=x=>8+Math.min(x,im-1)*o_,m=c?"3.5 2.5":void 0,g=Bd(n.col);return a.jsxs("svg",{className:"gitgraph",width:o,height:iu,viewBox:`0 0 ${o} ${iu}`,"aria-hidden":"true",children:[n.through.map(x=>a.jsx("line",{x1:h(x),y1:0,x2:h(x),y2:iu,style:{stroke:Bd(x)}},`t${x}`)),n.up.map((x,y)=>a.jsx("path",{d:`M${h(x.from)} 0 L${h(x.from)} ${d-12} L${h(x.to)} ${d}`,fill:"none",style:{stroke:Bd(x.from),strokeDasharray:m}},`u${y}`)),n.down.map((x,y)=>a.jsx("path",{d:`M${h(x.from)} ${d} L${h(x.to)} ${d+12} L${h(x.to)} ${iu}`,fill:"none",style:{stroke:Bd(x.to),strokeDasharray:m}},`d${y}`)),r&&a.jsx("circle",{className:"gitgraph__head",cx:h(n.col),cy:d,r:n.commit.parents.length>1?7.4:6.6}),a.jsx("circle",{className:"gitgraph__dot",cx:h(n.col),cy:d,r:n.commit.parents.length>1?4.6:3.6,style:{stroke:g,fill:c?void 0:g}})]})}function Bd(n){return`var(--lane-${n%im})`}function Ck({detail:n,local:l,onCheckout:r,onClose:c}){const o=n.hash==="";return a.jsxs(vs,{className:"modal--wide",title:o?"Незакоммиченные изменения":`Коммит ${n.shortHash}`,onClose:c,actions:a.jsxs(a.Fragment,{children:[!o&&a.jsx("button",{className:"btn",onClick:()=>r(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(Pc,{text:n.subject,hint:"сообщение коммита"})]}),a.jsxs("p",{className:"commit__meta",children:[n.author,n.email&&` <${n.email}>`," · ",$k(n.date)]}),a.jsxs("div",{className:"commit__line commit__line--hash",children:[a.jsx("span",{className:"commit__hash",children:n.hash}),a.jsx(Pc,{text:n.hash,hint:"хеш коммита"})]}),l&&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(d=>d.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(d=>a.jsx(Ak,{file:d,defaultOpen:n.files.length<=3},d.path+d.oldPath))]})}function Ak({file:n,defaultOpen:l}){const[r,c]=b.useState(l);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:r?"▴":"▾"})]}),r&&a.jsx(sm,{diff:jk(n)})]})}function Mk(){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 Rk(){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 Dk(){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 Ok(){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 u_(){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 Lk(){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 zk(n){return n.replace(/^HEAD -> /,"").replace(/^tag: /,"⌂ ").trim()}function Uk(n){const l=n.replace(/^HEAD -> /,"").replace(/^tag: /,"").trim();return l==="HEAD"?"":l}function Hk(n){const l=n.split("/");return l[l.length-1]??n}function Bk(n){const l=n%100;if(l>=11&&l<=14)return"файлов";switch(n%10){case 1:return"файл";case 2:case 3:case 4:return"файла";default:return"файлов"}}function Ik(n){const l=Date.parse(n);if(Number.isNaN(l))return n;const r=Math.round((Date.now()-l)/6e4);if(r<1)return"только что";if(r<60)return`${r} мин назад`;const c=Math.round(r/60);if(c<24)return`${c} ч назад`;const o=Math.round(c/24);return o<30?`${o} дн назад`:new Date(l).toLocaleDateString()}function $k(n){const l=Date.parse(n);return Number.isNaN(l)?n:new Date(l).toLocaleString()}function d_(n){return n.replace(/[^A-Za-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")}function qk({status:n,owners:l,files:r,defaultName:c,hasCommits:o,busy:d,result:h,onRefreshStatus:m,onSaveToken:g,onPublish:x,onDismissResult:y,onClose:j}){var W;const[v,T]=b.useState(()=>d_(c)),[w,A]=b.useState(""),[C,F]=b.useState(""),[Q,I]=b.useState(!0),[L,G]=b.useState("Первый коммит"),[M,z]=b.useState(null),[O,P]=b.useState("");b.useEffect(()=>{!w&&l.length>0&&A(l[0].login)},[w,l]),b.useEffect(()=>{r&&M===null&&z(new Set(r.files))},[r,M]);const U=(n==null?void 0:n.connected)===!0,B=l.map(he=>({value:he.login,label:he.login,hint:he.kind==="org"?"организация":void 0})),J=b.useMemo(()=>{if(!r)return[];const he=O.trim().toLowerCase();return he?r.files.filter(Se=>Se.toLowerCase().includes(he)):r.files},[r,O]),me=(M==null?void 0:M.size)??0,we=U&&v.trim()!==""&&w!==""&&d===""&&(o||me>0);function ve(he){z(Se=>{const k=new Set(Se??[]);return k.has(he)?k.delete(he):k.add(he),k})}function $(he){z(Se=>{const k=new Set(Se??[]);for(const se of J)he?k.add(se):k.delete(se);return k})}function Y(){if(!we)return;const he=(r==null?void 0:r.files)??[];x({owner:w,name:v.trim(),description:C.trim(),private:Q,include:o?[]:he.filter(Se=>M==null?void 0:M.has(Se)),ignore:o?[]:he.filter(Se=>!(M!=null&&M.has(Se))),message:o?"":L.trim()||"Первый коммит"})}return a.jsxs(vs,{className:"modal--wide",title:"Опубликовать на GitHub",onClose:j,actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:"btn",onClick:j,children:"Отмена"}),a.jsx("button",{type:"button",className:"btn btn--primary",disabled:!we,onClick:Y,children:d||"Опубликовать"})]}),children:[a.jsx(Gk,{status:n,onRefreshStatus:m,onSaveToken:g}),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:v,spellCheck:!1,autoComplete:"off",onChange:he=>T(d_(he.target.value))})]}),v.trim()===""&&a.jsx("p",{className:"modal__error",children:"Имя репозитория не может быть пустым."}),a.jsxs("label",{className:"field publish__field",children:[a.jsx("span",{children:"Владелец"}),l.length>1?a.jsx(Yl,{className:"settings__select",value:w,options:B,onChange:A,placeholder:"выберите владельца",ariaLabel:"Владелец репозитория"}):a.jsx("p",{className:"publish__static",children:((W=l[0])==null?void 0:W.login)??"—"})]}),a.jsxs("label",{className:"field publish__field",children:[a.jsx("span",{children:"Описание (необязательно)"}),a.jsx("input",{className:"input",value:C,placeholder:"о чём проект — одной строкой",onChange:he=>F(he.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(f_,{title:"Приватный",desc:"Виден только вам и тем, кого вы пригласите. Стоит по умолчанию: репозиторий с чужим кодом, случайно ставший публичным, потом не отозвать.",on:Q,onClick:()=>I(!0)}),a.jsx(f_,{title:"Публичный",desc:"Виден всем в интернете — код, история коммитов, всё содержимое.",risky:!0,on:!Q,onClick:()=>I(!1)})]})]})]}),!o&&a.jsxs("div",{className:"publish__section",children:[a.jsx("h3",{className:"publish__heading",children:"Файлы первого коммита"}),r===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:[me," из ",r.files.length," файлов"]}),a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>$(!0),children:"Отметить все"}),a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>$(!1),children:"Снять все"})]}),r.files.length>8&&a.jsx("input",{className:"input publish__filter",value:O,placeholder:"Фильтр по пути…",spellCheck:!1,onChange:he=>P(he.target.value)}),a.jsx("div",{className:"publish__filelist",children:J.length===0?a.jsx("p",{className:"modal__text publish__filesempty",children:"Ничего не найдено по фильтру."}):J.map(he=>a.jsxs("button",{type:"button",role:"checkbox","aria-checked":(M==null?void 0:M.has(he))===!0,className:"publish__file",onClick:()=>ve(he),children:[a.jsx("span",{className:"publish__box"+(M!=null&&M.has(he)?" is-on":""),"aria-hidden":"true",children:(M==null?void 0:M.has(he))&&"✓"}),a.jsx("span",{className:"publish__filepath",children:he})]},he))}),r.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:he=>G(he.target.value)})]})]})]}),a.jsx(Xr,{result:h,onDismiss:y})]})}function f_({title:n,desc:l,on:r,risky:c,onClick:o}){return a.jsxs("button",{type:"button",role:"radio","aria-checked":r,className:"access__card"+(r?" 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:l})]})]})}function Gk({status:n,onRefreshStatus:l,onSaveToken:r}){const[c,o]=b.useState(""),[d,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:()=>r(""),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(Yk,{value:c,onChange:o,visible:d,onToggleVisible:()=>h(m=>!m),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:l,children:"Проверить снова"}),a.jsx("button",{type:"button",className:"btn btn--sm btn--primary",disabled:c.trim()==="",onClick:()=>r(c.trim()),children:"Сохранить токен"})]})]})]})}function Yk({value:n,onChange:l,visible:r,onToggleVisible:c,placeholder:o,autoFocus:d}){return a.jsxs("div",{className:"pwfield",children:[a.jsx("input",{className:"input input--mono pwfield__input",type:r?"text":"password",value:n,placeholder:o,spellCheck:!1,autoComplete:"off",autoFocus:d,onChange:h=>l(h.target.value)}),a.jsx("button",{type:"button",className:"pwfield__toggle","aria-label":r?"Скрыть токен":"Показать токен","aria-pressed":r,onClick:c,children:r?a.jsx(Vk,{}):a.jsx(Xk,{})})]})}function Xk(){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 Vk(){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 Qk({busy:n,result:l,onSubmit:r,onDismissResult:c,onClose:o}){const[d,h]=b.useState(""),m=/^(https?|ssh|git):\/\/\S+/i.test(d.trim())||/^[\w.-]+@[\w.-]+:.+/.test(d.trim());return a.jsxs(vs,{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:!m||n!=="",onClick:()=>r(d.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:d,placeholder:"https://github.com/owner/name.git",spellCheck:!1,autoComplete:"off",autoFocus:!0,onChange:g=>h(g.target.value),onKeyDown:g=>{g.key==="Enter"&&m&&n===""&&r(d.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(Xr,{result:l,onDismiss:c})]})}function Kk({open:n,items:l,busy:r,ready:c,sendBlocked:o,commands:d,contextResult:h,draftKey:m,models:g,model:x,effort:y,ultracode:j,thinking:v,switchOnFlag:T,onContextSearch:w,onCommand:A,onModel:C,onEffort:F,onUltracode:Q,onThinking:I,onSwitchOnFlag:L,onAsk:G,onInterrupt:M,onReset:z,onClose:O,zoomed:P,onToggleZoom:U}){return a.jsxs("aside",{className:(n?"sidepane sidepane--ask sidepane--open":"sidepane sidepane--ask")+(P?" sidepane--zoomed":""),"aria-label":"Вопрос на полях",children:[a.jsxs("div",{className:"sidepane__head",onDoubleClick:B=>{U&&(B.target.closest("button")||U())},children:[a.jsx(Zk,{}),a.jsx("span",{className:"sidepane__title",children:"Вопрос на полях"}),a.jsx("button",{className:"sidepane__btn",title:"Начать заново — следующий вопрос возьмёт свежий контекст","aria-label":"Начать боковой разговор заново",disabled:l.length===0,onClick:z,children:"↻"}),U&&a.jsx("button",{className:"sidepane__btn",title:P?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":P?"Свернуть панель вопроса":"Развернуть панель вопроса на весь экран","aria-pressed":P,onClick:U,children:a.jsx(to,{active:P})}),a.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель вопроса",onClick:O,children:"✕"})]}),g.length>0&&a.jsxs("div",{className:"sidepane__tools",children:[a.jsx(Dy,{className:"select--compact",models:g,value:x,effort:y,ultracode:j,thinking:v,switchOnFlag:T,onModel:C,onEffort:F,onUltracode:Q,onThinking:I,onSwitchOnFlag:L}),a.jsx("span",{className:"sidepane__note",title:"Боковой вопрос работает только на чтение",children:"только чтение"})]}),a.jsx(lm,{items:l,busy:r,waiting:!1,empty:c?"Спросите о том, что происходит: вопрос уйдёт в сторону от основного разговора и не попадёт в его контекст. Отвечающий видит сессию и проект, но ничего не меняет.":"Откройте сессию — вопрос задаётся о ней."}),a.jsx(Cy,{className:"composer--side",disabled:!c,busy:r,commands:d,sessionTitle:null,contextResult:h,draftKey:m?`side:${m}`:null,placeholder:"Спросить, не мешая работе…",sendLabel:"Спросить",autoFocus:n,attachmentsEnabled:!1,sendBlocked:o,onContextSearch:w,onCommand:A,onSend:G,onInterrupt:M,onEscape:r?M:O})]})}function Zk(){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"})]})}const Fk=75,Jk=90;function Ly({usage:n}){if(!(n!=null&&n.available))return null;const l=n.buckets??[],r=l.length>0?l.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(r.length===0)return null;const c=l.length>0?"Квота Antigravity":`Расход лимитов плана${n.plan?` ${n.plan}`:""}`;return a.jsx("div",{className:"usage",title:eS(n,l),"aria-label":c,children:r.map(o=>a.jsx(Wk,{label:o.label,window:o.window},o.key))})}function Wk({label:n,window:l}){const r=Math.round(l.utilization),c=nS(l.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":r,"aria-valuemin":0,"aria-valuemax":100,children:a.jsx("span",{className:`usage__fill${Pk(r)}`,style:{width:`${r}%`}})}),a.jsxs("span",{className:"usage__pct",children:[r,"%"]}),a.jsx("span",{className:"usage__reset",title:rm(l.resetsAt)||void 0,children:c&&`↻ ${c}`})]})}function Pk(n){return n>=Jk?" usage__fill--over":n>=Fk?" usage__fill--warn":""}function eS(n,l){if(l.length>0)return tS(l);const r=[n.plan?`Лимиты плана ${n.plan}`:"Лимиты плана"],c=(o,d)=>{if(!d)return;const h=rm(d.resetsAt);r.push(`${o}: ${Math.round(d.utilization)}%${h?`, ${h}`:""}`)};return c("5 часов",n.fiveHour),c("Неделя",n.sevenDay),c("Неделя, Opus",n.sevenDayOpus),r.join(`
|
|
120
|
-
`)}function tS(n){const l=["Квота Antigravity"];for(const r of n){const c=rm(r.window.resetsAt),o=Math.round(r.window.utilization);l.push(`${r.title}: ${o}%${c?`, ${c}`:""}`),r.description&&l.push(r.description)}return l.join(`
|
|
121
|
-
`)}function zy(n){if(!n)return null;const l=new Date(n);return Number.isNaN(l.getTime())?null:l}function Uy(n){return n.getTime()-Date.now()<1440*60*1e3}function nS(n){const l=zy(n);return l?Uy(l)?l.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):l.toLocaleDateString(void 0,{day:"numeric",month:"short"}):""}function rm(n){const l=zy(n);return l?`обнулится ${Uy(l)?`в ${l.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:l.toLocaleDateString(void 0,{day:"numeric",month:"long"})}`:""}function Hy(){const[n,l]=b.useState(()=>new Date);return b.useEffect(()=>{let r=0;const c=()=>{const d=new Date;l(d),r=window.setTimeout(c,6e4-(d.getSeconds()*1e3+d.getMilliseconds()))};c();const o=()=>{document.hidden||(window.clearTimeout(r),c())};return document.addEventListener("visibilitychange",o),()=>{window.clearTimeout(r),document.removeEventListener("visibilitychange",o)}},[]),a.jsxs("time",{className:"clock",dateTime:n.toISOString(),title:sS(n),children:[a.jsx("span",{className:"clock__time",children:n.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}),a.jsx("span",{className:"clock__date",children:n.toLocaleDateString(void 0,{weekday:"short",day:"numeric",month:"short"})})]})}function sS(n){return n.toLocaleDateString(void 0,{weekday:"long",day:"numeric",month:"long",year:"numeric"})}function lS({onClose:n,permission:l,model:r,account:c,usage:o,cwd:d,costLabel:h,onRefresh:m,refreshing:g,metersFetchedAt:x,onRename:y,onHandoff:j,onFreshSession:v,handoffWriting:T,handoffAccount:w,onStop:A}){const C=Q_({onLongPress:()=>v==null?void 0:v(),onClick:()=>j==null?void 0:j(),disabled:T});return a.jsx(vs,{title:"Настройки сессии",className:"modal--sheet",sheet:!0,onClose:n,children:a.jsxs("div",{className:"sessionmenu",children:[l&&a.jsx(Rr,{label:"Режим прав",children:l}),a.jsx(Rr,{label:"Модель",children:r}),c&&a.jsx(Rr,{label:"Аккаунт",children:c}),(o==null?void 0:o.available)&&(o.fiveHour||o.sevenDay||o.buckets&&o.buckets.length>0)&&a.jsx(Rr,{label:"Лимиты плана",children:a.jsx(Ly,{usage:o})}),a.jsxs("button",{type:"button",className:g?"sessionmenu__refresh is-busy":"sessionmenu__refresh","aria-busy":g,disabled:g,onClick:m,children:[a.jsx(aS,{}),a.jsxs("span",{className:"sessionmenu__refresh-text",children:["Обновить показания",x&&a.jsxs("span",{className:"sessionmenu__refresh-time",children:["обновлено в"," ",new Date(x).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})]})]})]}),a.jsx(Rr,{label:"Время",children:a.jsx(Hy,{})}),h&&a.jsx(Rr,{label:"Стоимость хода",children:a.jsx("span",{className:"badge badge--cost",children:h})}),d&&a.jsx(Rr,{label:"Каталог проекта",children:a.jsx(Ry,{path:d})}),y&&a.jsx("button",{type:"button",className:"sessionmenu__rename",onClick:y,children:"Переименовать сессию"}),j&&a.jsxs("button",{type:"button",className:T?"sessionmenu__handoff is-busy":C.holding?"sessionmenu__handoff is-holding":"sessionmenu__handoff",style:{"--hold-ms":`${C.thresholdMs}ms`},"aria-busy":T,disabled:T,...C.handlers,children:[a.jsx("span",{className:"sessionmenu__handoff-hold","aria-hidden":"true"}),a.jsxs("span",{className:"sessionmenu__handoff-text",children:[T?"Пишется хэндофф…":"Хэндофф и новая сессия",!T&&a.jsx("span",{className:"sessionmenu__handoff-hint",children:"Зажмите — новая сессия без хэндоффа"})]})]}),j&&w,A&&a.jsx("button",{type:"button",className:"sessionmenu__stop",onClick:A,children:"Остановить сессию"})]})})}function Rr({label:n,children:l}){return a.jsxs("div",{className:"sessionmenu__row",children:[a.jsx("span",{className:"sessionmenu__label",children:n}),l]})}function aS(){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"})]})}function iS({tab:n,servers:l,plugins:r,marketplaces:c,catalog:o,result:d,auth:h,remote:m,actions:g,onTab:x,onClose:y}){const j=[{id:"mcp",label:"MCP-серверы",count:l.length},{id:"plugins",label:"Плагины",count:r.length},{id:"catalog",label:"Каталог",count:o.length}];return a.jsxs(vs,{title:"Расширения",className:"modal--wide",onClose:y,children:[a.jsx("div",{className:"tabs",role:"tablist",children:j.map(v=>a.jsxs("button",{role:"tab","aria-selected":n===v.id,className:n===v.id?"tabs__tab is-on":"tabs__tab",onClick:()=>x(v.id),children:[v.label,a.jsx("span",{className:"tabs__count",children:v.count})]},v.id))}),n==="mcp"&&a.jsx(rS,{servers:l,auth:h,remote:m,actions:g}),n==="plugins"&&a.jsx(hS,{plugins:r,marketplaces:c,actions:g}),n==="catalog"&&a.jsx(pS,{catalog:o,hasMarketplaces:c.length>0,actions:g,onMarketplaces:()=>x("plugins")}),a.jsx(Xr,{result:d})]})}function rS({servers:n,auth:l,remote:r,actions:c}){const[o,d]=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 m=(l==null?void 0:l.name)===h.name?l:null,g=m!==null&&m.active&&m.url==="",x=m!==null&&m.active&&m.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--${uS(h.status)}`,children:oS[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:g,onClick:()=>c.mcpAuth(h.name),children:g?"Запускаем вход…":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:"Удалить"})]}),m&&a.jsx(cS,{auth:m,remote:r,actions:c})]},h.name)})}),o?a.jsx(dS,{onCancel:()=>d(!1),onSubmit:(h,m)=>{c.mcpAdd(h,m),d(!1)}}):a.jsx("div",{className:"extbar",children:a.jsx("button",{className:"btn btn--primary",onClick:()=>d(!0),children:"+ Сервер"})})]})}function cS({auth:n,remote:l,actions:r}){const[c,o]=b.useState("");function d(){const g=c.trim();g!==""&&(r.mcpAuthCallback(n.name,g),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:[l&&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:g=>o(g.target.value),onKeyDown:g=>{g.key==="Enter"&&(g.preventDefault(),d())}}),a.jsx("button",{className:c.trim()===""?"btn btn--ghost btn--sm":"btn btn--primary btn--sm",disabled:c.trim()==="",onClick:d,children:"Отправить"})]}),a.jsx("p",{className:"extauth__hint",children:l?"Браузер покажет ошибку на localhost — это нормально. Скопируйте адрес из его строки и вставьте сюда.":"Скопируйте адрес из строки браузера и вставьте сюда."})]}),m=n.callbackExpected&&(l?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:"Открыть страницу входа"}),!l&&a.jsx("p",{className:"extauth__hint",children:"На этом компьютере окно обновится само, как только вы войдёте."})]}),m,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 oS={connected:"подключён",failed:"ошибка","needs-auth":"нужна авторизация",pending:"подключается",disabled:"выключен",unknown:"неизвестно"};function uS(n){return n==="connected"?"ok":n==="failed"?"bad":n==="needs-auth"?"warn":"mute"}function dS({onSubmit:n,onCancel:l}){const[r,c]=b.useState(""),[o,d]=b.useState("stdio"),[h,m]=b.useState(""),[g,x]=b.useState(""),[y,j]=b.useState(""),v=o==="stdio",T=r.trim()!==""&&(v?h.trim()!=="":g.trim()!=="");function w(){if(T)if(v){const[A,...C]=fS(h);n(r.trim(),{transport:"stdio",command:A??"",args:C,env:h_(y)})}else n(r.trim(),{transport:o,url:g.trim(),headers:h_(y)})}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:r,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"context7",onChange:A=>c(A.target.value)}),a.jsx("label",{className:"field",children:"Транспорт"}),a.jsx(Yl,{title:"Транспорт",value:o,options:[{value:"stdio",label:"stdio",hint:"локальный процесс"},{value:"http",label:"http",hint:"удалённый сервер"},{value:"sse",label:"sse",hint:"удалённый, поток событий"}],onChange:A=>d(A)}),v?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:A=>m(A.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:g,spellCheck:!1,autoComplete:"off",placeholder:"https://mcp.example.dev/mcp",onChange:A=>x(A.target.value)})]}),a.jsxs("label",{className:"field",htmlFor:"mcp-pairs",children:[v?"Переменные окружения":"Заголовки"," — по одной на строку, необязательно"]}),a.jsx("textarea",{id:"mcp-pairs",className:"input input--mono input--area",value:y,spellCheck:!1,placeholder:v?"API_KEY=xxx":"Authorization: Bearer xxx",onChange:A=>j(A.target.value)}),a.jsxs("div",{className:"extbar",children:[a.jsx("button",{className:"btn",onClick:l,children:"Отмена"}),a.jsx("button",{className:"btn btn--primary",disabled:!T,onClick:w,children:"Подключить"})]})]})}function h_(n){const l={};for(const r of n.split(`
|
|
122
|
-
`)){const c=r.trim();if(!c)continue;const o=c.indexOf("="),d=c.indexOf(":"),h=o===-1?d:d===-1?o:Math.min(o,d);h<=0||(l[c.slice(0,h).trim()]=c.slice(h+1).trim())}return l}function fS(n){return(n.trim().match(/"[^"]*"|'[^']*'|\S+/g)??[]).map(l=>l.replace(/^["']|["']$/g,""))}function hS({plugins:n,marketplaces:l,actions:r}){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(d=>a.jsxs("li",{className:"extlist__row",children:[a.jsxs("div",{className:"extlist__head",children:[a.jsx("span",{className:"extlist__name",children:d.name}),a.jsx("span",{className:d.enabled?"chip chip--ok":"chip chip--mute",children:d.enabled?"включён":"выключен"}),d.version&&d.version!=="unknown"&&a.jsx("span",{className:"chip",children:d.version}),d.scope&&a.jsx("span",{className:"chip",children:d.scope})]}),d.marketplace&&a.jsx("div",{className:"extlist__meta",children:d.marketplace}),d.mcpServers.length>0&&a.jsxs("div",{className:"extlist__meta",children:["MCP-серверы: ",d.mcpServers.join(", ")]}),a.jsxs("div",{className:"extlist__actions",children:[a.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>r.pluginToggle(d.id,!d.enabled),children:d.enabled?"Выключить":"Включить"}),a.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>r.pluginUninstall(d.id),children:"Удалить"})]})]},d.id))}),a.jsx("div",{className:"sidebar__section",children:"Маркетплейсы"}),a.jsx("ul",{className:"extlist",children:l.map(d=>a.jsxs("li",{className:"extlist__row",children:[a.jsx("div",{className:"extlist__head",children:a.jsx("span",{className:"extlist__name",children:d.name})}),d.source&&a.jsx("div",{className:"extlist__meta",children:d.source}),a.jsx("div",{className:"extlist__actions",children:a.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>r.marketplaceRemove(d.name),children:"Отключить"})})]},d.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:d=>o(d.target.value),onKeyDown:d=>{d.key!=="Enter"||c.trim()===""||(d.preventDefault(),r.marketplaceAdd(c.trim()),o(""))}}),a.jsx("button",{className:"btn",disabled:c.trim()==="",onClick:()=>{r.marketplaceAdd(c.trim()),o("")},children:"Добавить"})]})]})}const ru=30;function pS({catalog:n,hasMarketplaces:l,actions:r,onMarketplaces:c}){const[o,d]=b.useState(""),[h,m]=b.useState(""),[g,x]=b.useState(ru),[y,j]=b.useState(""),v=b.useMemo(()=>[...new Set(n.map(A=>A.category).filter(Boolean))].sort(),[n]),T=b.useMemo(()=>{const w=o.trim().toLowerCase();return n.filter(A=>h&&A.category!==h?!1:w?`${A.name} ${A.displayName} ${A.description} ${A.author}`.toLowerCase().includes(w):!0)},[n,o,h]);return n.length===0?a.jsxs("p",{className:"modal__text",children:[l?"Маркетплейсы подключены, но их каталог ещё не выкачан. Попробуйте открыть окно ещё раз через минуту.":"Ни одного маркетплейса — ставить нечего."," ",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:w=>{d(w.target.value),x(ru)}}),a.jsx(Yl,{title:"Категория",value:h,options:[{value:"",label:"все категории"},...v.map(w=>({value:w,label:w}))],onChange:w=>{m(w),x(ru)}})]}),T.length===0?a.jsx("p",{className:"modal__text",children:"Ничего не нашлось."}):a.jsx("ul",{className:"extlist",children:T.slice(0,g).map(w=>a.jsxs("li",{className:"extlist__row",children:[a.jsxs("div",{className:"extlist__head",children:[a.jsx("span",{className:"extlist__name",children:w.name}),w.installed&&a.jsx("span",{className:"chip chip--ok",children:"установлен"}),w.version&&a.jsx("span",{className:"chip",children:w.version}),w.category&&a.jsx("span",{className:"chip",children:w.category})]}),w.description&&a.jsx("div",{className:"catalog__desc",children:w.description}),a.jsxs("div",{className:"extlist__meta",children:[w.author&&`${w.author} · `,w.marketplace]}),a.jsxs("div",{className:"extlist__actions",children:[a.jsx("button",{className:"btn btn--ghost btn--sm",disabled:w.installed,onClick:()=>r.pluginInstall(w.id),children:w.installed?"Уже стоит":"Установить"}),w.homepage&&a.jsx("a",{className:"btn btn--ghost btn--sm",href:w.homepage,target:"_blank",rel:"noreferrer",children:"Страница"})]})]},w.id))}),T.length>g&&a.jsx("div",{className:"extbar",children:a.jsxs("button",{className:"btn",onClick:()=>x(w=>w+ru),children:["Ещё ",Math.min(ru,T.length-g)," из ",T.length-g]})}),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:y,spellCheck:!1,autoComplete:"off",placeholder:"имя или имя@маркетплейс",onChange:w=>j(w.target.value),onKeyDown:w=>{w.key!=="Enter"||y.trim()===""||(w.preventDefault(),r.pluginInstall(y.trim()),j(""))}}),a.jsx("button",{className:"btn",disabled:y.trim()==="",onClick:()=>{r.pluginInstall(y.trim()),j("")},children:"Установить"})]})]})]})}function mS({accounts:n,auth:l,logins:r,candidates:c,actions:o,activeAccountId:d,error:h,onReconnect:m,reconnectBlocked:g,reconnectHint:x,onOpenLogin:y,onClose:j}){const v=n.length>1,[T,w]=b.useState(!1),A=n.find(L=>L.main)??n[0],C=b.useRef(n.length);b.useEffect(()=>{n.length>C.current&&w(!1),C.current=n.length},[n.length]);const F=n.map(L=>`${L.id}:${L.dir}`).join("|"),Q=b.useRef(o.discover);Q.current=o.discover,b.useEffect(()=>{Q.current()},[F]);const I=(c??[]).filter(L=>L.accountId===null&&!n.some(G=>G.dir===L.configDir));return a.jsxs(vs,{title:v?"Аккаунты":"Аккаунт",className:"modal--accounts",onClose:j,children:[n.map(L=>{var G;return a.jsx(vS,{account:L,multi:v,status:l[L.id]??null,main:A,loginActive:((G=r[L.id])==null?void 0:G.active)===!0,actions:o,takenColors:n.filter(M=>M.id!==L.id).map(M=>M.color),onReconnect:L.id===d?m:null,reconnectBlocked:g,reconnectHint:x,onOpenLogin:()=>y(L.id)},L.id)}),h&&a.jsx("p",{className:"account__warn",role:"alert",children:h}),I.length>0&&A&&a.jsx(bS,{found:I,accounts:n,main:A,onConnect:(L,G,M,z)=>o.add(G,M,L.configDir,z),onMakeMain:L=>o.update(A.id,{configDir:L.configDir})}),T?a.jsx(kS,{accounts:n,onAdd:o.add,onCancel:()=>w(!1)}):a.jsx("button",{type:"button",className:"btn account__add",onClick:()=>w(!0),children:"+ Добавить аккаунт"})]})}function gS(n){const l=n.split(/[\\/]+/).filter(Boolean),r=l[l.length-1];return r&&(/^(users|home)$/i.test(l[0]??"")||/^(users|home)$/i.test(l[1]??""))&&l.length<=4?`~/${r}`:n}function xS(n){const l=n.split(/[\\/]+/).filter(Boolean);return(l[l.length-1]??"").replace(/^\.+/,"").slice(0,xf)}function bS({found:n,accounts:l,main:r,onConnect:c,onMakeMain:o}){return a.jsxs("section",{className:"found","aria-labelledby":"found-title",children:[a.jsx("h3",{className:"found__title",id:"found-title",children:"Найдено на этом компьютере"}),a.jsx("p",{className:"account__step found__lead",children:"Здесь уже есть вход Claude Code. Ничего не копируется: аккаунт просто указывает на эту папку, а вход остаётся у Claude Code."}),a.jsx("ul",{className:"found__list",children:n.map(d=>a.jsx(_S,{candidate:d,accounts:l,main:r,onConnect:c,onMakeMain:o},d.configDir))})]})}function _S({candidate:n,accounts:l,main:r,onConnect:c,onMakeMain:o}){const[d,h]=b.useState(!1),[m,g]=b.useState(!1),[x,y]=b.useState(()=>xS(n.configDir)),[j,v]=b.useState(!0),T=x.trim(),w=l.some(I=>I.name.toLowerCase()===T.toLowerCase()),A=ii.find(I=>!l.some(L=>L.color===I))??ii[1],C=`found-${n.configDir.replace(/[^a-z0-9]/gi,"-")}`,F=r.liveSessions>0;function Q(I){I.preventDefault(),T!==""&&c(n,T,A,j)}return a.jsxs("li",{className:"found__row",children:[a.jsxs("div",{className:"found__id",children:[a.jsx("span",{className:"found__email",children:n.email||"Вход выполнен"}),n.plan&&a.jsx("span",{className:"chip",children:n.plan})]}),n.organization&&a.jsx("div",{className:"extlist__meta",children:n.organization}),a.jsx("div",{className:"acctcard__dir found__dir",title:n.configDir,children:gS(n.configDir)}),d?a.jsxs("form",{className:"found__form",onSubmit:Q,children:[a.jsx("label",{className:"field",htmlFor:`${C}-name`,children:"Название аккаунта"}),a.jsx("input",{id:`${C}-name`,className:"input",value:x,maxLength:xf,autoFocus:!0,autoComplete:"off","aria-describedby":w?`${C}-taken`:void 0,onChange:I=>y(I.target.value)}),w&&a.jsx("p",{className:"account__note",id:`${C}-taken`,children:"Такое имя уже есть — хост откажет. Выберите другое."}),a.jsxs("label",{className:"acctform__check",children:[a.jsx("input",{type:"checkbox",checked:j,onChange:I=>v(I.target.checked)}),a.jsxs("span",{children:["Общая конфигурация (ссылки на ",a.jsx("code",{children:"~/.claude-shared"}),")",a.jsx("span",{className:"account__step acctform__checkhint",children:"Что именно делится, задаётся в Настройках. Файлы, которые уже лежат в подключаемой папке, не перезаписываются. Если часть настроек и данных плагинов включена в общие, они станут общими с другими аккаунтами."})]})]}),a.jsxs("div",{className:"extbar",children:[a.jsx("button",{type:"button",className:"btn",onClick:()=>h(!1),children:"Отмена"}),a.jsx("button",{type:"submit",className:"btn btn--primary",disabled:T==="",children:"Подключить"})]})]}):a.jsxs("div",{className:"found__actions",children:[a.jsx("button",{type:"button",className:"btn btn--primary btn--sm",onClick:()=>h(!0),children:"Подключить"}),a.jsxs("button",{type:"button",className:"btn btn--ghost btn--sm found__more","aria-expanded":m,"aria-controls":`${C}-more`,onClick:()=>g(I=>!I),children:["Ещё",a.jsx("svg",{viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",className:m?"is-open":"",children:a.jsx("path",{d:"m3 4.5 3 3 3-3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]})]}),m&&!d&&a.jsxs("div",{className:"found__menu",id:`${C}-more`,children:[a.jsx("button",{type:"button",className:"btn btn--sm",disabled:F,onClick:()=>o(n),children:"Сделать основным"}),a.jsx("span",{className:"account__note found__why",children:F?`Сначала закройте сессии основного аккаунта (${r.liveSessions}).`:`Основной аккаунт «${r.name}» будет брать вход из этой папки.`})]})]})}const yS="Вход выполняется в Настройках → Вход и выход Claude Code.";function vS({account:n,multi:l,status:r,main:c,loginActive:o,actions:d,takenColors:h,onReconnect:m,reconnectBlocked:g,reconnectHint:x,onOpenLogin:y}){const[j,v]=b.useState(!1),[T,w]=b.useState(!1),[A,C]=b.useState(!1),[F,Q]=b.useState(!1),I=n.id,L=m!==null&&(r==null?void 0:r.loggedIn)===!0,G=!l,M=!n.main,z=n.liveSessions>0,O=n.liveSessions>0||((c==null?void 0:c.liveSessions)??0)>0;return a.jsxs("section",{className:`acctcard acct--${n.color}${G?" acctcard--single":""}`,"aria-label":l?`Аккаунт «${n.name}»`:void 0,children:[l&&a.jsxs("header",{className:"acctcard__head",children:[a.jsx(wa,{account:n,size:"md"}),a.jsxs("div",{className:"acctcard__name",children:[a.jsx("span",{className:"acctcard__title",children:n.name}),n.main&&a.jsx("span",{className:"chip chip--mute",children:"основной"})]}),!T&&a.jsx("button",{type:"button",className:"btn btn--ghost btn--sm",onClick:()=>w(!0),"aria-label":`Изменить имя и цвет аккаунта «${n.name}»`,children:"Изменить"})]}),T?a.jsx(wS,{account:n,takenColors:h,onSave:P=>{d.update(I,P),w(!1)},onCancel:()=>w(!1)}):r===null?a.jsx("p",{className:"modal__text",children:"Спрашиваем у хоста…"}):r.loggedIn?a.jsxs("div",{className:"account",children:[a.jsx("div",{className:"account__id",children:r.email||"Вход выполнен"}),a.jsxs("div",{className:"account__chips",children:[a.jsx("span",{className:"chip chip--ok",children:NS[r.method]??r.method}),r.plan&&a.jsx("span",{className:"chip",children:r.plan})]}),r.organization&&a.jsx("div",{className:"extlist__meta",children:r.organization})]}):a.jsxs("div",{className:"account__signedout",children:[a.jsx("p",{className:"modal__text",children:l?"Вход не выполнен. Сессии этого аккаунта не запустятся, пока вы в него не войдёте.":"Вход не выполнен. Сессии не запустятся, пока аккаунт не подключён."}),a.jsx("p",{className:"account__note",children:o?"Вход идёт — продолжите в Настройках.":yS}),a.jsx("button",{type:"button",className:"btn btn--sm",onClick:y,children:o?"Продолжить вход":"Открыть вход в Настройках"})]}),!T&&a.jsxs(a.Fragment,{children:[n.dir!==""&&a.jsxs("div",{className:"acctdir",children:[a.jsx("div",{className:"acctcard__dir",title:"Каталог конфигурации: вход, тариф, лимиты и транскрипты этого аккаунта",children:n.dir}),n.main&&n.configDir===null&&a.jsx("span",{className:"account__step",children:"унаследован из окружения"})]}),n.main&&a.jsx(jS,{account:n,onApply:P=>d.update(I,{configDir:P})})]}),L&&!T&&a.jsxs(a.Fragment,{children:[g&&a.jsx("p",{className:"account__note",children:x}),a.jsx("div",{className:"extbar account__bar",children:a.jsxs("button",{type:"button",className:"btn account__relink",title:`Переподключить сессию
|
|
123
|
-
${x}`,"aria-label":"Переподключить сессию",disabled:g,onClick:m??void 0,children:[a.jsx(SS,{}),"Переподключить"]})})]}),M&&!T&&c&&a.jsxs("div",{className:"acctcard__more",children:[a.jsxs("button",{type:"button",className:"btn btn--ghost btn--sm found__more","aria-expanded":A,"aria-controls":`acct-more-${I}`,onClick:()=>{C(P=>!P),Q(!1)},children:["Ещё",a.jsx("svg",{viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",className:A?"is-open":"",children:a.jsx("path",{d:"m3 4.5 3 3 3-3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]}),A&&a.jsx("div",{className:"found__menu",id:`acct-more-${I}`,children:O?a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:"btn btn--sm",disabled:!0,children:"Сделать основным"}),a.jsx("span",{className:"account__note found__why",children:n.liveSessions>0&&c.liveSessions>0?`Сначала закройте сессии обоих аккаунтов: этого (${n.liveSessions}) и основного (${c.liveSessions}).`:n.liveSessions>0?`Сначала закройте сессии этого аккаунта (${n.liveSessions}).`:`Сначала закройте сессии основного аккаунта (${c.liveSessions}).`})]}):F?a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:"btn btn--sm",onClick:()=>Q(!1),children:"Отмена"}),a.jsx("button",{type:"button",className:"btn btn--primary btn--sm",autoFocus:!0,onClick:()=>{Q(!1),C(!1),d.makeMain(I)},children:"Поменять местами"}),a.jsx("span",{className:"account__note found__why",children:`Аккаунты поменяются местами: «Основной» станет «${n.name}» и наоборот. Файлы не переносятся.`})]}):a.jsx("button",{type:"button",className:"btn btn--sm",onClick:()=>Q(!0),children:"Сделать основным"})})]}),M&&!T&&a.jsx("div",{className:"acctcard__remove",children:z?a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:"btn btn--danger btn--sm",disabled:!0,children:"Удалить аккаунт"}),a.jsx("span",{className:"account__note acctcard__why",children:`Сначала закройте сессии этого аккаунта (${n.liveSessions}).`})]}):j?a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:"btn btn--sm",onClick:()=>v(!1),children:"Отмена"}),a.jsx("button",{type:"button",className:"btn btn--danger btn--sm",autoFocus:!0,onClick:()=>d.remove(I),children:"Точно удалить?"}),a.jsx("span",{className:"account__note acctcard__why",children:"Из списка пропадёт только аккаунт — каталог с его данными останется на диске."})]}):a.jsx("button",{type:"button",className:"btn btn--danger btn--sm",onClick:()=>v(!0),children:"Удалить аккаунт"})})]})}function jS({account:n,onApply:l}){const[r,c]=b.useState(!1),[o,d]=b.useState(n.configDir??""),h=n.liveSessions>0,m=o.trim(),g=m!==""&&m!==(n.configDir??n.dir),x=`main-dir-${n.id}`;function y(j){j.preventDefault(),!(h||!g)&&(l(m),c(!1))}return a.jsxs("div",{className:"maindir",children:[a.jsxs("button",{type:"button",className:"btn btn--ghost btn--sm maindir__toggle","aria-expanded":r,"aria-controls":`${x}-panel`,onClick:()=>c(j=>!j),children:["Изменить каталог",a.jsx("svg",{viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",className:r?"is-open":"",children:a.jsx("path",{d:"m3 4.5 3 3 3-3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]}),r&&a.jsxs("form",{className:"maindir__panel",id:`${x}-panel`,onSubmit:y,children:[a.jsx("label",{className:"field",htmlFor:x,children:"Путь к каталогу конфигурации"}),a.jsx("input",{id:x,className:"input input--mono",value:o,disabled:h,spellCheck:!1,autoComplete:"off",placeholder:"~/.claude",onChange:j=>d(j.target.value)}),h&&a.jsx("p",{className:"account__note",children:`Каталог нельзя менять, пока у аккаунта есть живые сессии (${n.liveSessions}) — сначала закройте их.`}),a.jsxs("div",{className:"extbar",children:[n.configDir!==null&&a.jsx("button",{type:"button",className:"btn",disabled:h,onClick:()=>{l(null),d(""),c(!1)},children:"Вернуть унаследованный"}),a.jsx("button",{type:"submit",className:"btn btn--primary",disabled:h||!g,children:"Применить"})]})]})]})}const NS={"claude.ai":"подписка Claude",console:"Anthropic Console",apiKey:"API-ключ",none:"нет"};function By({value:n,taken:l,onChange:r}){function c(o){const d=o.key==="ArrowRight"||o.key==="ArrowDown"?1:o.key==="ArrowLeft"||o.key==="ArrowUp"?-1:0;if(d===0)return;o.preventDefault();const h=ii.indexOf(n),m=ii[(h+d+ii.length)%ii.length];if(m){r(m);const g=o.currentTarget;window.requestAnimationFrame(()=>{var x;return(x=g.querySelector(`[data-color="${m}"]`))==null?void 0:x.focus()})}}return a.jsx("div",{className:"colorpick",role:"radiogroup","aria-label":"Цвет аккаунта",onKeyDown:c,children:ii.map(o=>{const d=o===n;return a.jsx("button",{type:"button",role:"radio","aria-checked":d,"aria-label":Yd[o],title:l.includes(o)?`${Yd[o]} — уже у другого аккаунта`:Yd[o],"data-color":o,tabIndex:d?0:-1,className:`colorpick__item acct--${o}${d?" is-selected":""}`,onClick:()=>r(o),children:d&&a.jsx("svg",{viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M2.6 6.3 5 8.6l4.4-5",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})},o)})})}const xf=40;function wS({account:n,takenColors:l,onSave:r,onCancel:c}){const[o,d]=b.useState(n.name),[h,m]=b.useState(n.color),g=o.trim(),x=g!==n.name||h!==n.color;function y(j){j.preventDefault(),!(g===""||!x)&&r({...g!==n.name?{name:g}:{},...h!==n.color?{color:h}:{}})}return a.jsxs("form",{className:"extform acctform",onSubmit:y,children:[a.jsx("label",{className:"field",htmlFor:`acct-name-${n.id}`,children:"Имя"}),a.jsx("input",{id:`acct-name-${n.id}`,className:"input",value:o,maxLength:xf,autoFocus:!0,autoComplete:"off",onChange:j=>d(j.target.value)}),a.jsx("span",{className:"field",children:"Цвет"}),a.jsx(By,{value:h,taken:l,onChange:m}),a.jsxs("div",{className:"extbar",children:[a.jsx("button",{type:"button",className:"btn",onClick:c,children:"Отмена"}),a.jsx("button",{type:"submit",className:"btn btn--primary",disabled:g===""||!x,children:"Сохранить"})]})]})}function kS({accounts:n,onAdd:l,onCancel:r}){const c=n.map(w=>w.color),[o,d]=b.useState(""),[h,m]=b.useState(()=>ii.find(w=>!c.includes(w))??ii[1]),[g,x]=b.useState(""),[y,j]=b.useState(!0),v=o.trim();function T(w){w.preventDefault(),v!==""&&l(v,h,g.trim()===""?null:g.trim(),y)}return a.jsxs("form",{className:"extform extform--card acctform",onSubmit:T,children:[a.jsx("label",{className:"field",htmlFor:"acct-new-name",children:"Название аккаунта"}),a.jsx("input",{id:"acct-new-name",className:"input",value:o,maxLength:xf,placeholder:"Например, Работа",autoFocus:!0,autoComplete:"off",onChange:w=>d(w.target.value)}),a.jsx("span",{className:"field",children:"Цвет"}),a.jsx(By,{value:h,taken:c,onChange:m}),a.jsxs("details",{className:"account__fallback acctform__dir",children:[a.jsx("summary",{children:"Каталог конфигурации"}),a.jsx("label",{className:"field",htmlFor:"acct-new-dir",children:"Путь к каталогу"}),a.jsx("input",{id:"acct-new-dir",className:"input input--mono",value:g,spellCheck:!1,autoComplete:"off",placeholder:"~/.claude-ccv-…",onChange:w=>x(w.target.value)}),a.jsxs("p",{className:"account__step",children:["Если оставить пустым, хост создаст отдельный каталог ",a.jsx("code",{children:"~/.claude-ccv-…"})," сам."]})]}),a.jsxs("label",{className:"acctform__check",children:[a.jsx("input",{type:"checkbox",checked:y,onChange:w=>j(w.target.checked)}),a.jsxs("span",{children:["Общая конфигурация (ссылки на ",a.jsx("code",{children:"~/.claude-shared"}),")",a.jsxs("span",{className:"account__step acctform__checkhint",children:["Аккаунт получит ссылки на общую папку, а не копии. Что именно делится, задаётся в Настройках. Вход, лимиты, переписка и ",a.jsx("code",{children:".claude.json"})," остаются отдельными. Если в общие включены настройки и плагины, их данные (в том числе токены плагинов) станут общими с другими аккаунтами."]})]})]}),a.jsxs("p",{className:"account__step",children:[y?"Новый аккаунт начнётся с общей конфигурации из Настроек.":"Новый аккаунт начнётся с чистого листа: своя конфигурация, плагины и CLAUDE.md."," ","Если в папке ещё нет входа, войдите в него отдельно — в Настройках, в разделе «Вход и выход Claude Code»."]}),a.jsxs("div",{className:"extbar",children:[a.jsx("button",{type:"button",className:"btn",onClick:r,children:"Отмена"}),a.jsx("button",{type:"submit",className:"btn btn--primary",disabled:v==="",children:"Добавить"})]})]})}function SS(){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"})]})}function ES({state:n,onPair:l,onUnpair:r,onClose:c}){const[o,d]=b.useState(""),[h,m]=b.useState(""),[g,x]=b.useState(!1),y=b.useRef(null),j=(n==null?void 0:n.paired)===!0;b.useEffect(()=>{var T;j||(T=y.current)==null||T.focus()},[j]),b.useEffect(()=>{x(!1),j&&d("")},[j,n==null?void 0:n.error]);const v=(n==null?void 0:n.url)??"https://claudevisual.com";return a.jsx(vs,{title:"Удалённый доступ",onClose:c,children:j?a.jsxs("div",{className:"relay",children:[a.jsxs("p",{className:"relay__lede",children:["Компьютер связан с аккаунтом на ",a.jsx("b",{children:p_(v)}),". Открывайте его оттуда с любого устройства — с телефона в том числе."]}),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:r,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:p_(v)})," и войдите (или зарегистрируйтесь)."]}),a.jsxs("li",{children:["Нажмите ",a.jsx("b",{children:"«Подключить ПК»"})," — появится код из восьми знаков."]}),a.jsx("li",{children:"Введите его сюда."})]}),a.jsxs("form",{className:"relay__form",onSubmit:T=>{T.preventDefault(),o.trim()&&(x(!0),l(o.trim(),h.trim()))},children:[a.jsxs("label",{className:"field",children:[a.jsx("span",{children:"Код сопряжения"}),a.jsx("input",{ref:y,className:"input relay__code",value:o,onChange:T=>d(T.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:T=>m(T.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()||g,children:g?"Связываем…":"Связать"})]})]})})}function p_(n){try{return new URL(n).host}catch{return n}}const TS={active:!1,url:"",awaitingCode:!1,output:"",error:null},CS={"claude.ai":"подписка Claude",console:"Anthropic Console",apiKey:"API-ключ",none:"нет"};function AS({accounts:n,auth:l,logins:r,actions:c,remote:o,runningByAccount:d,focusAccountId:h}){return a.jsx("div",{className:"loginlist",children:n.map(m=>a.jsx(MS,{account:m,status:l[m.id]??null,login:r[m.id]??TS,actions:c,remote:o,running:d[m.id]??0,focused:m.id===h},m.id))})}function MS({account:n,status:l,login:r,actions:c,remote:o,running:d,focused:h}){const[m,g]=b.useState(""),[x,y]=b.useState(!1),[j,v]=b.useState(!1),T=b.useRef(null),w=n.id;b.useEffect(()=>{var I;h&&((I=T.current)==null||I.scrollIntoView({block:"nearest"}))},[h]);const A=b.useMemo(()=>{if(r.error)return{ok:!1,message:r.error};const I=r.output.trim();return I===""?null:{ok:!0,message:I}},[r.error,r.output]);function C(I=m){const L=I.trim();L!==""&&(c.submitCode(w,L),g(""))}function F(){if(d>0){y(!1),v(!0);return}c.login(w,"claudeai",!0)}const Q=(l==null?void 0:l.loggedIn)===!0;return a.jsxs("section",{ref:T,className:`acctcard logincard acct--${n.color}${h?" is-focused":""}`,"aria-label":`Вход аккаунта «${n.name}»`,children:[a.jsxs("header",{className:"acctcard__head",children:[a.jsx(wa,{account:n,size:"md"}),a.jsxs("div",{className:"acctcard__name",children:[a.jsx("span",{className:"acctcard__title",children:n.name}),n.main&&a.jsx("span",{className:"chip chip--mute",children:"основной"})]}),a.jsx("span",{className:`chip ${l===null?"chip--mute":Q?"chip--ok":"chip--warn"}`,children:l===null?"проверяем":Q?"вошёл":"не вошёл"})]}),Q&&a.jsx("div",{className:"logincard__who",children:[l.email||"Вход выполнен",l.plan,CS[l.method]??l.method].filter(Boolean).join(" · ")}),r.active?a.jsx(DS,{login:r,remote:o,code:m,onCode:g,onSubmit:C,onCancel:()=>c.cancel(w),inputId:`auth-code-${w}`}):a.jsxs(a.Fragment,{children:[a.jsx(Xr,{result:A}),(j||x)&&d>0&&a.jsx("p",{className:"account__warn",role:"alert",children:RS(d)}),a.jsx("div",{className:"extbar logincard__bar",children:Q?a.jsxs(a.Fragment,{children:[j?a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:"btn",onClick:()=>v(!1),children:"Отмена"}),a.jsx("button",{type:"button",className:"btn btn--warn",autoFocus:!0,onClick:()=>{v(!1),c.login(w,"claudeai",!0)},children:"Всё равно сменить"})]}):a.jsx("button",{type:"button",className:"btn",onClick:F,children:"Сменить аккаунт"}),x?a.jsx("button",{type:"button",className:"btn btn--danger",autoFocus:!0,onClick:()=>{y(!1),c.logout(w)},children:"Точно выйти?"}):a.jsx("button",{type:"button",className:"btn",onClick:()=>{v(!1),y(!0)},children:"Выйти"})]}):a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:"btn",onClick:()=>c.login(w,"console",!1),children:"Через Console"}),a.jsx("button",{type:"button",className:"btn btn--primary",onClick:()=>c.login(w,"claudeai",!1),children:"Войти"})]})})]})]})}function RS(n){const l=n%10,r=n%100,c=l===1&&r!==11,o=c?"сессия":l>=2&&l<=4&&(r<12||r>14)?"сессии":"сессий";return`${n} ${o} сейчас ${c?"работает":"работают"} — смена аккаунта может ${c?"её":"их"} прервать.`}function DS({login:n,remote:l,code:r,onCode:c,onSubmit:o,onCancel:d,inputId:h}){var A;const[m,g]=b.useState(null),x=b.useRef(""),y=b.useRef({code:r,onCode:c,onSubmit:o});y.current={code:r,onCode:c,onSubmit:o};const j=b.useCallback(async C=>{const{code:F,onCode:Q,onSubmit:I}=y.current;if(C&&F.trim()!=="")return;const L=await Lp();if(L===null){C||g("Не получилось прочитать буфер — вставьте код в поле руками.");return}const G=L.trim();if(!m_(G)){C||g("В буфере не похоже на код: нужен он целиком, вместе с частью после «#». Подойдёт и адрес страницы, на которую увёл браузер, — его тоже разберём.");return}if(C){if(x.current===G)return;x.current=G}g(null),Q(G),I(G)},[]);b.useEffect(()=>{if(!n.awaitingCode)return;const C=()=>{document.visibilityState==="visible"&&j(!0)};return document.addEventListener("visibilitychange",C),()=>document.removeEventListener("visibilitychange",C)},[n.awaitingCode,j]);const v=typeof((A=navigator.clipboard)==null?void 0:A.readText)=="function",T=r.trim()!==""&&!m_(r),w=m??(T?"Похоже, скопирована только часть кода — нужен он целиком, вместе с частью после «#».":null);return a.jsxs("div",{className:"account__flow",children:[n.url?l?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(Pc,{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:h,children:"Код со страницы авторизации"}),a.jsxs("div",{className:"extform__row account__coderow",children:[a.jsx("input",{id:h,className:"input input--mono",value:r,autoFocus:!l,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 j(!1),children:"Вставить код"}),a.jsx("button",{type:"button",className:"btn btn--primary",disabled:r.trim()==="",onClick:()=>o(),children:"Готово"})]}),w&&a.jsx("p",{className:"account__note account__note--code",children:w})]}),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:d,children:"Отменить вход"})})]})}function m_(n){const l=n.trim();if(/^https?:\/\//i.test(l))return/[?#&]code=/.test(l);const[r,c]=l.split("#");return!!r&&!!c&&!/\s/.test(l)}const g_=[{id:"claude",label:"Claude",hint:"Claude Code"},{id:"antigravity",label:"Antigravity",hint:"Google agy"}],OS=[{id:"skills",label:"Скиллы",hint:"Читаются Claude Code, безопасно делить."},{id:"agents",label:"Агенты",hint:"Читаются Claude Code, безопасно делить."},{id:"commands",label:"Команды",hint:"Читаются Claude Code, безопасно делить."},{id:"hooks",label:"Хуки",hint:"Читаются Claude Code, безопасно делить."},{id:"output-styles",label:"Стили вывода",hint:"Читаются Claude Code, безопасно делить."},{id:"plugins",label:"Плагины",hint:"Вместе с данными плагинов — в них могут лежать токены."},{id:"CLAUDE.md",label:"CLAUDE.md",hint:"Общие инструкции."},{id:"settings.json",label:"settings.json",hint:"Модель, права, хуки, список плагинов: изменение в одном аккаунте сразу видно в другом. Ссылку Claude Code может заменить обычным файлом."},{id:"keybindings.json",label:"keybindings.json",hint:"Сочетания клавиш."}],LS=[{label:"Вход и токены (.credentials.json)",why:"У каждого аккаунта свой."},{label:".claude.json",why:"В нём личность вошедшего и пользовательские MCP-серверы: общий файл смешал бы аккаунты."},{label:"История сессий и лимиты",why:"У каждого аккаунта своя."}],_p="",zS=[{value:"opus",label:"Opus",hint:"полный список моделей виден, когда открыта сессия"},{value:"sonnet",label:"Sonnet",hint:"полный список моделей виден, когда открыта сессия"},{value:"haiku",label:"Haiku",hint:"полный список моделей виден, когда открыта сессия"}],US=G_.map(n=>({value:n.value,label:n.value,hint:n.hint})),Id=3600*1e3,HS=[{value:"6h",label:"6 часов"},{value:"24h",label:"Сутки"},{value:"48h",label:"Двое суток"},{value:"168h",label:"Неделя"},{value:"never",label:"Никогда"}],Bc={"6h":6*Id,"24h":24*Id,"48h":48*Id,"168h":168*Id,never:0};function BS(n){return Bc[n]??Bc["48h"]}const IS=[{value:"5m",label:"5 минут"},{value:"10m",label:"10 минут"},{value:"30m",label:"30 минут"},{value:"60m",label:"Час"},{value:"never",label:"Никогда"}],$d=60*1e3,Ic={"5m":5*$d,"10m":10*$d,"30m":30*$d,"60m":60*$d,never:0};function $S(n){return Ic[n]??Ic["10m"]}function qS(n){const l=Object.entries(Ic).find(([,r])=>r===n);return l?l[0]:Object.keys(Ic).reduce((r,c)=>Math.abs(Ic[c]-n)<Math.abs(Ic[r]-n)?c:r)}function GS(n){const l=Object.entries(Bc).find(([,r])=>r===n);return l?l[0]:Object.keys(Bc).reduce((r,c)=>Math.abs(Bc[c]-n)<Math.abs(Bc[r]-n)?c:r)}const YS=[{value:"off",label:"Выключено"},{value:"500",label:"0.5 с"},{value:"1500",label:"1.5 с"},{value:"3000",label:"3 с"},{value:"10000",label:"10 с"}],$c={off:0,500:500,1500:1500,3e3:3e3,1e4:1e4};function XS(n){return $c[n]??$c.off}function x_(n){return Number.isFinite(n)?Math.min(100,Math.max(0,Math.round(n))):0}function VS(n){const l=Object.entries($c).find(([,r])=>r===n);return l?l[0]:Object.keys($c).reduce((r,c)=>Math.abs($c[c]-n)<Math.abs($c[r]-n)?c:r)}const QS=[{value:"project",title:"Только текущий проект",description:"Агент молча пишет файлы в открытом проекте и в ~/.claude — настройках самого Claude Code. Чужой проект и любая новая папка — только с явного разрешения."},{value:"projects",title:"Папка с проектами",description:"То же плюс каталог, где лежат открытые проекты, — то есть и соседний проект тоже. Всё остальное — с разрешения."},{value:"all",title:"Все папки на компьютере",description:"Агент пишет файлы куда угодно на диске — вопросов про место записи не будет.",risky:!0}];function KS({settings:n,models:l,relayState:r,networkState:c,local:o,onChange:d,onEnableShell:h,onDisableShell:m,onOpenRelay:g,claudeLogin:x,onClose:y}){const j=b.useRef(null),v=n===null,T=x.focusAccountId!==null;b.useEffect(()=>{var U;T&&((U=j.current)==null||U.scrollIntoView({block:"start"}))},[T]);const[w,A]=b.useState(""),[C,F]=b.useState(null),Q=!v&&n.networkGuardEnabled,I=(n==null?void 0:n.networkGuardBlockedCountries)??[];function L(){const U=w.trim().toUpperCase();if(U!==""){if(!/^[A-Z]{2}$/.test(U)){F("Нужен код из двух латинских букв, например RU или CN.");return}if(I.includes(U)){F(`Код ${U} уже в списке.`);return}F(null),A(""),d({networkGuardBlockedCountries:[...I,U]})}}const G=!v&&n.terminalEnabled===!0,M=!v&&n.liveSessionsFirst===!0,z=!G,O=b.useMemo(()=>{const U=[{value:_p,label:"Как в Claude Code",hint:"модель определят настройки самого Claude Code"},...l.length>0?l.map(B=>({value:B.value,label:B.displayName,hint:B.description})):zS];return n&&n.startModel!==null&&!U.some(B=>B.value===n.startModel)&&U.push({value:n.startModel,label:n.startModel}),U},[l,n]);function P(){var U,B;return(r==null?void 0:r.paired)!==!0?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"settings__hint",children:"Компьютер не связан с аккаунтом — включать удалённый доступ пока не к чему: без пары ни телефон, ни другое устройство этот компьютер вообще не видят."}),a.jsx("button",{type:"button",className:"btn",disabled:z,onClick:g,children:"Связать компьютер"})]}):(U=r.shell)!=null&&U.enabled?a.jsxs(a.Fragment,{children:[a.jsxs("p",{className:"settings__hint",children:["Разрешён: с телефона и любого другого устройства этого аккаунта можно открыть терминал и выполнить на этом компьютере что угодно — как если бы сидели за ним.",r.shell.confirmedAt&&` Включено ${new Date(r.shell.confirmedAt).toLocaleString()}.`]}),a.jsx("button",{type:"button",className:"btn btn--danger",disabled:z,onClick:m,children:"Запретить"})]}):(B=r.shell)!=null&&B.pending?a.jsxs(a.Fragment,{children:[a.jsxs("p",{className:"settings__hint",children:["Письмо ушло на ",a.jsx("b",{children:r.shell.email}),". Перейдите по ссылке из него — терминал заработает удалённо."]}),a.jsx("p",{className:"settings__hint",children:"Повторная отправка ограничена раз в минуту — если жали кнопку только что, письмо не придёт и от повторного нажатия тоже. Если сейчас доберётесь до самого компьютера, там разрешение включится сразу, без письма."}),a.jsx("button",{type:"button",className:"btn",disabled:z,onClick:h,children:"Отправить письмо ещё раз"})]}):a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"settings__hint",children:"Сейчас с телефона можно смотреть разговоры и файлы, но не запускать команды. Разрешение даёт полный доступ к терминалу этого компьютера: с телефона станет можно выполнить любую команду, как в обычной консоли за этой машиной."}),o?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"settings__hint",children:"Включится сразу — вы уже за этим компьютером, подтверждать доступ к нему нечем и незачем."}),a.jsx("button",{type:"button",className:"btn",disabled:z,onClick:h,children:"Разрешить с телефона"})]}):a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"settings__hint",children:"Отсюда мгновенно не включится: на почту аккаунта уйдёт письмо, и терминал заработает только после перехода по ссылке из него."}),a.jsx("button",{type:"button",className:"btn",disabled:z,onClick:h,children:"Прислать письмо"})]})]})}return a.jsx(vs,{title:"Настройки",onClose:y,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:"Сессия, к которой долго не возвращались, сама уезжает в архив — на диске ничего не удаляется, транскрипт остаётся, и её можно вернуть обратно в любой момент."}),v?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(Yl,{className:"settings__select",value:GS(n.autoArchiveAfterMs),options:HS,onChange:U=>d({autoArchiveAfterMs:BS(U)}),ariaLabel:"Через сколько молчащая сессия уезжает в архив"})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Останавливать простаивающие сессии через"}),a.jsx("p",{className:"settings__hint",children:"Простаивающая живая сессия сама отпускает процесс CLI — освобождает память компьютера, на котором стоит хост. Простой — это когда сессия ничего не делает (не работает, не ждёт разрешения, фоновых задач нет), в ней ничего не происходит и ни в одном открытом окне не висит недописанный черновик для неё. Разговор при этом никуда не девается: открытая заново сессия, как и отправленное в неё сообщение, продолжают с того же места."}),v?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(Yl,{className:"settings__select",value:qS(n.autoStopAfterMs),options:IS,onChange:U=>d({autoStopAfterMs:$S(U)}),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-часового лимита, %"}),v?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:n.limitStopFiveHourPct,onChange:U=>d({limitStopFiveHourPct:x_(U.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:"Остановка у недельного лимита, %"}),v?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:n.limitStopSevenDayPct,onChange:U=>d({limitStopSevenDayPct:x_(U.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-клиента это не заменяет — его тоже стоит включить."})]}),v?a.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):a.jsx("button",{type:"button",role:"switch","aria-checked":Q,"aria-label":"Kill switch: останавливать агентов, если упал VPN",className:Q?"switch is-on":"switch",onClick:()=>d({networkGuardEnabled:!Q}),children:a.jsx("span",{className:"switch__knob"})})]}),Q&&c&&a.jsx("p",{className:c.status==="blocked"?"settings__hint settings__netstatus is-bad":"settings__hint settings__netstatus",children:c.status==="blocked"?c.reason??"Маршрут не прошёл проверку.":c.country?`Сейчас: ${c.country} — всё в порядке.`:"Сейчас всё в порядке."}),a.jsxs("div",{className:Q?"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:[I.map(U=>a.jsxs("li",{className:"countries__chip",children:[a.jsx("span",{children:U}),a.jsx("button",{type:"button",className:"countries__remove","aria-label":`Убрать ${U} из списка`,disabled:!Q,onClick:()=>d({networkGuardBlockedCountries:I.filter(B=>B!==U)}),children:"×"})]},U)),I.length===0&&a.jsx("li",{className:"settings__hint",children:"Список пуст: блокировать будет только сбой проверки."})]}),a.jsxs("form",{className:"countries__add",onSubmit:U=>{U.preventDefault(),L()},children:[a.jsx("input",{type:"text",className:"input countries__input",value:w,maxLength:2,placeholder:"RU",autoCapitalize:"characters",spellCheck:!1,disabled:!Q,"aria-label":"Код страны, две буквы","aria-invalid":C!==null,onChange:U=>{A(U.target.value.toUpperCase()),F(null)}}),a.jsx("button",{type:"submit",className:"btn",disabled:!Q||w.trim()==="",children:"Добавить"})]}),C&&a.jsx("p",{className:"settings__hint countries__error",role:"alert",children:C})]})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Автосохранение"}),a.jsx("p",{className:"settings__hint",children:"Открытый файл сам уезжает на диск, если немного постоять без ввода — ручное сохранение, кнопкой или Ctrl+S, при этом всегда работает как обычно, независимо от этой настройки."}),v?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(Yl,{className:"settings__select",value:VS(n.autoSaveAfterPauseMs),options:YS,onChange:U=>d({autoSaveAfterPauseMs:XS(U)}),ariaLabel:"Пауза перед автосохранением открытого файла"})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Агенты"}),a.jsx("p",{className:"settings__hint",children:"Выключенный агент не предлагается при создании новой сессии. Уже открытые сессии с ним продолжают работать."}),g_.map(U=>{const B=(n==null?void 0:n.enabledProviders)??["claude","antigravity"],J=!v&&B.includes(U.id),me=J&&B.length<=1;return a.jsxs("div",{className:"settings__switch-row settings__agent",children:[a.jsx("span",{className:`newsession__mark newsession__mark--${U.id}`,"aria-hidden":"true",children:U.id==="antigravity"?a.jsx(tm,{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:U.label}),a.jsx("span",{className:"settings__hint",children:me?"Хотя бы один агент должен остаться включённым":U.hint})]}),v?a.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):a.jsx("button",{type:"button",role:"switch","aria-checked":J,"aria-label":U.label,disabled:me,title:me?"Хотя бы один агент должен остаться включённым":void 0,className:J?"switch is-on":"switch",onClick:()=>{const we=g_.map(ve=>ve.id).filter(ve=>ve===U.id?!J:B.includes(ve));d({enabledProviders:we})},children:a.jsx("span",{className:"switch__knob"})})]},U.id)})]}),a.jsxs("section",{className:"settings__section","aria-labelledby":"settings-shared-title",children:[a.jsx("h3",{className:"settings__heading",id:"settings-shared-title",children:"Общая конфигурация аккаунтов"}),a.jsx("p",{className:"settings__hint",children:"Выбор действует, когда аккаунт добавляется или подключается с включённым общим доступом. Уже существующие аккаунты не меняются, ссылки не удаляются."}),OS.map(U=>{const B=(n==null?void 0:n.sharedConfigItems)??Jx,J=!v&&B.includes(U.id);return a.jsxs("div",{className:"settings__switch-row",children:[a.jsxs("div",{className:"settings__switch-copy",children:[a.jsx("span",{className:"settings__field-label",children:U.label}),a.jsx("span",{className:"settings__hint",children:U.hint})]}),v?a.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):a.jsx("button",{type:"button",role:"switch","aria-checked":J,"aria-label":U.label,className:J?"switch is-on":"switch",onClick:()=>d({sharedConfigItems:Jx.filter(me=>me===U.id?!J:B.includes(me))}),children:a.jsx("span",{className:"switch__knob"})})]},U.id)}),a.jsx("h4",{className:"settings__subheading",children:"Никогда не делится"}),a.jsx("ul",{className:"settings__never",children:LS.map(U=>a.jsxs("li",{children:[a.jsx("span",{className:"settings__never-name",children:U.label}),a.jsx("span",{className:"settings__hint",children:U.why})]},U.label))})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Старт новой сессии"}),a.jsx("p",{className:"settings__hint",children:"Модель и режим прав, с которыми поднимается новая сессия. Уже открытую это не меняет — у неё свои переключатели в шапке."}),a.jsxs("div",{className:"settings__field",children:[a.jsx("span",{className:"settings__field-label",children:"Модель"}),v?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(Yl,{className:"settings__select",value:n.startModel??_p,options:O,onChange:U=>d({startModel:U===_p?null:U}),ariaLabel:"Модель, с которой поднимается новая сессия"})]}),a.jsxs("div",{className:"settings__field",children:[a.jsx("span",{className:"settings__field-label",children:"Режим прав при старте"}),v?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(Yl,{className:"settings__select",value:n.startPermissionMode,options:US,onChange:U=>d({startPermissionMode:U}),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:"Сессии, поднятые в хосте прямо сейчас — работают, готовы, ждут разрешения, работают в фоне, переподключаются, — показываются выше остальных в списке сессий проекта и в панели закреплённых. Порядок внутри каждой из двух частей остаётся тем, что задан руками."})]}),v?a.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):a.jsx("button",{type:"button",role:"switch","aria-checked":M,"aria-label":"Запущенные сессии сверху",className:M?"switch is-on":"switch",onClick:()=>d({liveSessionsFirst:!M}),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(U=>{const B=!v&&n.folderAccess===U.value;return a.jsxs("button",{type:"button",role:"radio","aria-checked":B,disabled:v,className:"access__card"+(B?" is-on":"")+(U.risky?" access__card--risky":""),onClick:()=>d({folderAccess:U.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:[U.title,U.risky&&a.jsx("span",{className:"access__risk",children:"самое широкое"})]}),a.jsx("span",{className:"access__desc",children:U.description})]})]},U.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-инструмент в разговоре. Выключите — и все открытые вкладки терминала закроются, а процессы в них не переживут закрытия."})]}),v?a.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):a.jsx("button",{type:"button",role:"switch","aria-checked":G,"aria-label":"Терминал",className:G?"switch is-on":"switch",onClick:()=>d({terminalEnabled:!G}),children:a.jsx("span",{className:"switch__knob"})})]}),a.jsxs("div",{className:"settings__nested"+(z?" is-disabled":""),children:[a.jsx("h4",{className:"settings__nested-heading",children:"Удалённый доступ к терминалу"}),v?a.jsx("p",{className:"settings__hint",children:"Загрузка…"}):a.jsxs(a.Fragment,{children:[z&&a.jsx("p",{className:"settings__hint",children:"Сначала включите терминал выше — удалённый доступ выдаётся к тому, что на этой машине уже разрешено, а не поверх выключенного рубильника."}),P()]})]})]}),a.jsxs("details",{ref:j,className:"settings__section settings__advanced",open:T||void 0,children:[a.jsxs("summary",{className:"settings__advanced-summary",children:[a.jsx("h3",{className:"settings__heading",children:"Вход и выход Claude Code (расширенное)"}),a.jsx("svg",{viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",className:"settings__advanced-chev",children:a.jsx("path",{d:"m3 4.5 3 3 3-3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]}),a.jsxs("div",{className:"settings__advanced-body",children:[a.jsxs("p",{className:"settings__hint",children:["ccv не хранит ни паролей, ни токенов. Эти кнопки запускают собственные команды Claude Code — ",a.jsx("code",{children:"claude auth login"})," и ",a.jsx("code",{children:"claude auth logout"})," — для папки выбранного аккаунта."]}),a.jsxs("ul",{className:"settings__hint settings__advanced-list",children:[a.jsxs("li",{children:[a.jsx("strong",{children:"Войти"})," — входит в эту папку: откроется ссылка в браузере, и Claude Code попросит код."]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Выйти"})," — убирает вход из этой папки для всех сессий аккаунта."]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Сменить аккаунт"})," — выйти и войти заново."]})]}),a.jsx(AS,{...x})]})]})]})})}const bf="Новая сессия начнётся с нуля: на другой аккаунт переходит только текст хэндоффа, прежний разговор под ним не открыть.";function Iy({targets:n,selectedId:l,sourceId:r,onSelect:c,variant:o,className:d,disabled:h}){const{auth:m}=Ip(),g=n.find(M=>M.id===l)??n[0],[x,y]=b.useState(!1),[j,v]=b.useState(0),[T,w]=b.useState({left:0,top:0}),A=b.useRef(null),C=b.useRef(null);function F(){v(Math.max(0,n.findIndex(M=>M.id===l))),y(!0)}function Q(M){var z;y(!1),M&&((z=A.current)==null||z.focus())}function I(M){c(M.id),Q(!0)}b.useLayoutEffect(()=>{if(!x)return;const M=A.current,z=C.current;if(!M||!z)return;const O=M.getBoundingClientRect(),P=z.getBoundingClientRect(),U=8,B=Math.max(U,Math.min(O.right-P.width,window.innerWidth-P.width-U));let J=O.bottom+6;J+P.height>window.innerHeight-U&&(J=Math.max(U,O.top-P.height-6)),w({left:B,top:J}),z.focus()},[x]),b.useLayoutEffect(()=>{if(!x)return;function M(z){var P,U;const O=z.target;!((P=C.current)!=null&&P.contains(O))&&!((U=A.current)!=null&&U.contains(O))&&Q(!1)}return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[x]);function L(M){if(M.key==="Escape")M.preventDefault(),M.stopPropagation(),Q(!0);else if(M.key==="ArrowDown"||M.key==="ArrowUp"){M.preventDefault();const z=M.key==="ArrowDown"?1:-1;v(O=>(O+z+n.length)%n.length)}else if(M.key==="Enter"||M.key===" "){M.preventDefault();const z=n[j];z&&I(z)}else M.key==="Tab"&&Q(!1)}if(!g)return null;const G=`Аккаунт новой сессии: «${g.name}». Сменить`;return a.jsxs(a.Fragment,{children:[a.jsxs("button",{ref:A,type:"button",className:`${o==="split"?"splitbtn__caret":"pane-btn pane-btn--target"}${d?` ${d}`:""}`,title:G,"aria-label":G,"aria-haspopup":"menu","aria-expanded":x,disabled:h,onClick:()=>x?Q(!1):F(),onKeyDown:M=>{(M.key==="ArrowDown"||M.key==="ArrowUp")&&(M.preventDefault(),F())},children:[o==="mark"&&a.jsx(wa,{account:g,size:"sm",className:"pane-btn__mark"}),a.jsx("svg",{className:"splitbtn__icon",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"})})]}),x&&a.jsxs("div",{ref:C,className:"newsession__menu targetmenu",style:{left:T.left,top:T.top},role:"menu","aria-label":"Аккаунт новой сессии",tabIndex:-1,onKeyDown:L,children:[a.jsx("p",{className:"targetmenu__note",children:bf}),n.map((M,z)=>{const O=R_(m[M.id]);return a.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":M.id===l,className:"newsession__item"+(z===j?" is-cursor":""),onMouseEnter:()=>v(z),onClick:()=>I(M),children:[a.jsx("span",{className:"newsession__mark newsession__mark--account",children:a.jsx(wa,{account:M,size:"md"})}),a.jsxs("span",{className:"newsession__text",children:[a.jsx("span",{className:"newsession__label",children:M.name}),O&&a.jsx("span",{className:"newsession__hint",children:O})]}),M.id===r&&a.jsx("span",{className:"newsession__tag",children:"прежняя"}),M.id===l&&a.jsx("svg",{className:"targetmenu__check",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m2.5 6.4 2.4 2.4 4.6-5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})]},M.id)})]})]})}function ZS({targets:n,selectedId:l,onSelect:r}){return a.jsxs("div",{className:"targetchips",role:"radiogroup","aria-label":"Аккаунт новой сессии",children:[a.jsx("span",{className:"targetchips__label",children:"Новая сессия на аккаунте"}),a.jsx("div",{className:"targetchips__row",children:n.map(c=>a.jsxs("button",{type:"button",role:"radio","aria-checked":c.id===l,className:`targetchips__chip acct--${c.color}${c.id===l?" is-on":""}`,onClick:()=>r(c.id),children:[a.jsx(wa,{account:c,size:"sm"}),a.jsx("span",{className:"targetchips__name",children:c.name})]},c.id))}),a.jsx("span",{className:"targetchips__note",children:bf})]})}const b_={fiveHour:"5-часовой лимит",sevenDay:"недельный лимит"};function FS(n){if(!n)return"срок неизвестен";const l=new Date(n);return Number.isNaN(l.getTime())?"срок неизвестен":l.toLocaleString()}function __({label:n,primary:l,choice:r,onContinue:c}){const o=`btn btn--sm${l?" btn--primary":""}`,d=r==null?void 0:r.targets.find(m=>m.id===r.selectedId);if(!r||!d)return a.jsx("button",{type:"button",className:o,onClick:c,children:n});const h=d.id!==r.sourceId;return a.jsxs("span",{className:`splitbtn${l?" splitbtn--primary":""}`,children:[a.jsxs("button",{type:"button",className:`${o} splitbtn__main`,title:h?bf:`Новая сессия на том же аккаунте «${d.name}»`,onClick:c,children:[a.jsx("span",{className:`newsession__acct acct--${d.color}`,"aria-hidden":"true"}),n," на «",d.name,"»"]}),a.jsx(Iy,{variant:"split",className:o,targets:r.targets,selectedId:r.selectedId,sourceId:r.sourceId,onSelect:r.onSelect})]})}function JS({handoff:n,onContinue:l,onShow:r,onDismiss:c,sourceAccount:o=null,accountChoice:d=null}){if(n.continuedAt!==void 0){const h=n.limit===null?`Хэндофф записан вручную ${new Date(n.stoppedAt).toLocaleString()}`:`${b_[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(),"."]})," ",h,".",n.source==="journal"&&" Хэндофф собран автоматически из журнала."]})]}),a.jsxs("div",{className:"handoff__actions",children:[a.jsx("button",{type:"button",className:"btn btn--sm",onClick:r,children:"Показать хэндофф"}),a.jsx("button",{type:"button",className:"btn btn--sm",onClick:c,children:"Скрыть"}),a.jsx(__,{label:"Продолжить ещё раз",primary:!1,choice:d,onContinue:l})]})]})}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:[o&&a.jsxs(a.Fragment,{children:[a.jsx(wa,{account:o,size:"sm",className:"handoff__acct"})," ",a.jsxs("strong",{className:"handoff__acctname",children:["«",o.name,"»"]}),":"," "]}),b_[n.limit]," (",Math.round(n.utilization)," %) — работа прервана"," ",new Date(n.stoppedAt).toLocaleString(),". Окно сбросится: ",FS(n.resetsAt),"."]}),n.source==="journal"&&" Хэндофф собран автоматически из журнала."]})]}),d&&d.selectedId!==d.sourceId&&a.jsx("p",{className:"handoff__hint",children:bf}),a.jsxs("div",{className:"handoff__actions",children:[a.jsx(__,{label:d?"Продолжить":"Продолжить в новой сессии",primary:!0,choice:d,onContinue:l}),a.jsx("button",{type:"button",className:"btn btn--sm",onClick:r,children:"Показать хэндофф"}),a.jsx("button",{type:"button",className:"btn btn--sm",onClick:c,children:"Скрыть"})]})]})}function WS({handoff:n,onClose:l}){const[r,c]=b.useState("");return b.useEffect(()=>{let o=!1;return mf(n.text).then(d=>{o||c(d)}),()=>{o=!0}},[n.text]),a.jsx(vs,{title:"Хэндофф",className:"modal--wide",onClose:l,children:a.jsx("div",{className:"markdown-preview",dangerouslySetInnerHTML:{__html:r}})})}function PS({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 uf={fiveHour:"5-часовой лимит",sevenDay:"недельный лимит"},eE=12e3;function tE(n){const l=n%10,r=n%100;return l===1&&r!==11?"сессии":"сессиях"}function nE({notices:n,onDismiss:l}){return n.length===0?null:a.jsx("div",{className:"limittoasts",children:n.map(r=>a.jsx(sE,{notice:r,onDismiss:()=>l(r.id)},r.id))})}function sE({notice:n,onDismiss:l}){return b.useEffect(()=>{const r=window.setTimeout(l,eE);return()=>window.clearTimeout(r)},[l]),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:["Достигнут ",uf[n.limit]," (",Math.round(n.utilization)," %): работа прервана в ",n.stopped," ",tE(n.stopped),", хэндоффов —"," ",n.handoffs,". Сессии остаются запущенными."]}):a.jsxs(a.Fragment,{children:["Достигнут ",uf[n.limit]," (",Math.round(n.utilization)," %): занятых сессий не было — ничего не прервано."]})}),a.jsx("button",{type:"button",className:"limittoast__dismiss","aria-label":"Закрыть уведомление",onClick:l,children:"✕"})]})}function lE(n,l,r=Date.now()){if(!n||!n.available||!l)return null;const c=[["fiveHour",n.fiveHour,l.limitStopFiveHourPct],["sevenDay",n.sevenDay,l.limitStopSevenDayPct]];for(const[o,d,h]of c){if(!d||h<=0||d.utilization<h)continue;const m=Date.parse(d.resetsAt);if(!(!Number.isFinite(m)||m<=r))return{limit:o,utilization:d.utilization,resetsAt:m}}return null}function aE(n,l=Date.now()){const r=new Date(n),c=r.toLocaleTimeString("ru-RU",{hour:"2-digit",minute:"2-digit"});return r.toDateString()===new Date(l).toDateString()?c:`${r.toLocaleDateString("ru-RU",{day:"numeric",month:"short"})}, ${c}`}const iE=16;function rE({pane:n,width:l,onResize:r,onReset:c}){const o=Ir[n],d=b.useRef(null);function h(y){if(y.button!==0)return;const j=document.querySelector(".main"),v=j?Math.max(0,j.getBoundingClientRect().width-Uv):0;d.current={x:y.clientX,width:l,max:Math.min(o.max,l+v)},y.currentTarget.setPointerCapture(y.pointerId),document.body.classList.add("is-resizing"),y.preventDefault()}function m(y){const j=d.current;if(!j)return;const v=o.side==="left"?y.clientX-j.x:j.x-y.clientX;r(Math.min(j.max,j.width+v))}function g(y){d.current&&(d.current=null,y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),document.body.classList.remove("is-resizing"))}function x(y){const j=y.key==="ArrowRight"?1:y.key==="ArrowLeft"?-1:0;j!==0&&(y.preventDefault(),r(l+j*iE*(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":l,"aria-valuemin":o.min,"aria-valuemax":o.max,tabIndex:0,title:"Потяните, чтобы изменить ширину; двойной щелчок — ширина по умолчанию",onPointerDown:h,onPointerMove:m,onPointerUp:g,onPointerCancel:g,onDoubleClick:c,onKeyDown:x,children:a.jsx("span",{className:"pane-resizer__line","aria-hidden":"true"})})}const cE=16;function oE({height:n,onResize:l,onReset:r}){const c=b.useRef(null);function o(){const x=document.querySelector(".main .transcript, .main .editor");if(!x)return 1/0;const y=x.getBoundingClientRect().height-$v;return Math.round(n+Math.max(0,y))}function d(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 y=c.current;if(!y)return;const j=y.y-x.clientY;l(y.height+j,y.max)}function m(x){c.current&&(c.current=null,x.currentTarget.hasPointerCapture(x.pointerId)&&x.currentTarget.releasePointerCapture(x.pointerId),document.body.classList.remove("is-resizing-row"))}function g(x){const y=x.key==="ArrowUp"?1:x.key==="ArrowDown"?-1:0;y!==0&&(x.preventDefault(),l(n+y*cE,o()))}return a.jsx("div",{className:"term-resizer",role:"separator","aria-orientation":"horizontal","aria-label":"Высота панели терминала","aria-valuenow":n,"aria-valuemin":V_,tabIndex:0,title:"Потяните, чтобы изменить высоту; двойной щелчок — высота по умолчанию",onPointerDown:d,onPointerMove:h,onPointerUp:m,onPointerCancel:m,onDoubleClick:r,onKeyDown:g,children:a.jsx("span",{className:"term-resizer__line","aria-hidden":"true"})})}function y_(){const n=document.documentElement,l=getComputedStyle(n),r=Q=>l.getPropertyValue(Q).trim(),c=r("--surface"),o=r("--text"),d=r("--text-2"),h=r("--muted"),m=r("--accent"),g=r("--accent-fg"),x=r("--select"),y=r("--danger"),j=r("--ok"),v=r("--warn"),T=r("--cm-fn"),w=r("--cm-key"),A=r("--cm-type"),C=v_(o,c,55),F=Q=>v_(Q,"#ffffff",25);return{background:c,foreground:o,cursor:m,cursorAccent:g,selectionBackground:x,black:C,brightBlack:h,red:y,brightRed:F(y),green:j,brightGreen:F(j),yellow:v,brightYellow:F(v),blue:T,brightBlue:F(T),magenta:w,brightMagenta:F(w),cyan:A,brightCyan:F(A),white:d,brightWhite:o}}function uE(){return getComputedStyle(document.documentElement).getPropertyValue("--mono").trim()}let ma=null;function dE(n){return ma||(ma=document.createElement("span"),ma.style.position="fixed",ma.style.width="0",ma.style.height="0",ma.style.opacity="0",ma.style.pointerEvents="none",document.body.appendChild(ma)),ma.style.color=n,getComputedStyle(ma).color}function v_(n,l,r){return dE(`color-mix(in srgb, ${n} ${100-r}%, ${l} ${r}%)`)}let qd=null;function fE(){return qd||(qd=Promise.all([lt(()=>import("./xterm-D6Mng-DB.js").then(n=>n.x),__vite__mapDeps([22,23]),import.meta.url),lt(()=>import("./addon-fit-CevVMrUA.js").then(n=>n.a),__vite__mapDeps([24,23]),import.meta.url),lt(()=>import("./addon-web-links-CnB65OV_.js").then(n=>n.a),__vite__mapDeps([25,23]),import.meta.url),lt(()=>Promise.resolve({}),__vite__mapDeps([26]),import.meta.url)]).then(([n,l,r])=>({Terminal:n.Terminal,FitAddon:l.FitAddon,WebLinksAddon:r.WebLinksAddon})).catch(n=>{throw qd=null,n})),qd}function hE({terminals:n,activeId:l,blocked:r,error:c,onDismissError:o,height:d,offset:h,mobile:m=!1,zoomed:g,onToggleZoom:x,onSelect:y,onOpen:j,onClose:v,onInput:T,onResize:w,onAttach:A,onHide:C,registerSink:F}){const[Q,I]=b.useState(()=>y_());return b.useEffect(()=>{const L=new MutationObserver(()=>I(y_()));return L.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>L.disconnect()},[]),a.jsxs("div",{className:"termpanel"+(m?" termpanel--mobile":"")+(!m&&g?" termpanel--zoomed":""),style:m?{height:d,top:(h==null?void 0:h.top)??0,left:(h==null?void 0:h.left)??0}:g?void 0:{height:d},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===l,className:"termtab"+(L.id===l?" is-on":"")+(L.exitCode!==null?" termtab--exited":""),onDoubleClick:G=>{x&&(G.target.closest(".termtab__close")||x())},children:[a.jsx("button",{className:"termtab__name",title:L.cwd,onClick:()=>y(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:()=>v(L.id),children:"✕"})]},L.id))}),a.jsx("button",{className:"termpanel__add",title:"Новый терминал","aria-label":"Новый терминал",disabled:r,onClick:j,children:"+"}),a.jsx("div",{className:"termpanel__spacer"}),x&&a.jsx("button",{className:"termpanel__zoom",title:g?"Свернуть терминал — то же самое, что двойной клик по вкладке":"Развернуть терминал на весь экран — то же самое, что двойной клик по вкладке","aria-label":g?"Свернуть терминал":"Развернуть терминал на весь экран","aria-pressed":g,onClick:x,children:a.jsx(to,{active:g})}),a.jsx("button",{className:"termpanel__hide",title:"Скрыть панель","aria-label":"Скрыть панель терминала",onClick:C,children:"✕"})]}),c&&n.length>0&&a.jsx(j_,{message:c,strip:!0,onRetry:null,onDismiss:o}),a.jsxs("div",{className:"termpanel__body",children:[c&&n.length===0?a.jsx(j_,{message:c,onRetry:r?null:j,onDismiss:o}):r?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:j,children:"Открыть терминал"})]}),n.map(L=>a.jsx(mE,{id:L.id,exitCode:L.exitCode,active:L.id===l,theme:Q,mobile:m,onInput:T,onResize:w,onAttach:A,registerSink:F},L.id))]})]})}function j_({message:n,strip:l=!1,onRetry:r,onDismiss:c}){const{lede:o,hint:d,details:h}=pE(n);return a.jsxs("div",{className:l?"termfail termfail--strip":"termfail",role:"alert",children:[a.jsxs("div",{className:"termfail__text",children:[a.jsx("p",{className:"termfail__lede",children:o}),d&&a.jsx("p",{className:"termfail__hint",children:d}),h&&a.jsxs("details",{className:"termfail__details",children:[a.jsx("summary",{children:"Подробности"}),a.jsx("pre",{children:h})]})]}),a.jsxs("div",{className:"termfail__bar",children:[r&&a.jsx("button",{className:"btn btn--primary",onClick:r,children:"Открыть терминал"}),a.jsx("button",{className:"btn",onClick:c,children:"Понятно"})]})]})}function pE(n){const[l="",...r]=n.trim().split(`
|
|
124
|
-
|
|
125
|
-
`),c=l.split(`
|
|
126
|
-
`).map(o=>o.trim()).filter(o=>o!=="");return{lede:c[0]??n.trim(),hint:c.slice(1).join(" "),details:r.join(`
|
|
127
|
-
|
|
128
|
-
`).trim()}}function mE({id:n,exitCode:l,active:r,theme:c,mobile:o,onInput:d,onResize:h,onAttach:m,registerSink:g}){const x=b.useRef(null),y=b.useRef(null),j=b.useRef(!1),v=b.useRef(o);v.current=o;const T=b.useRef(c),w=b.useRef(l),[A,C]=b.useState("loading"),[F,Q]=b.useState(!1);return b.useEffect(()=>{if(!x.current)return;let L=!1,G=null;C("loading"),Q(!1);const M=window.setTimeout(()=>{L||Q(!0)},200);return(async()=>{var Se;let z;try{z=await fE()}catch{window.clearTimeout(M),L||C("error");return}if(L||!x.current)return;window.clearTimeout(M);const{Terminal:O,FitAddon:P,WebLinksAddon:U}=z,B=new O({fontFamily:uE()||"monospace",fontSize:13,lineHeight:1.2,cursorBlink:!0,cursorStyle:"bar",scrollback:5e3,theme:T.current}),J=new P;B.loadAddon(J),B.loadAddon(new U),B.open(x.current),y.current=B,B.attachCustomKeyEventHandler(k=>{if(k.type!=="keydown"||!(k.ctrlKey||k.metaKey))return!0;if(k.key==="`")return k.preventDefault(),!1;if(k.key==="c"||k.key==="C"){const q=B.getSelection();return q?(k.preventDefault(),Na(q),!1):!k.shiftKey}return k.key==="v"||k.key==="V"?(k.preventDefault(),Lp().then(q=>{q&&B.paste(q)}),!1):!0});const me=k=>{k.preventDefault();const se=B.getSelection();if(se){Na(se),B.clearSelection();return}Lp().then(q=>{q&&B.paste(q)})};(Se=B.element)==null||Se.addEventListener("contextmenu",me);const we=B.onData(k=>d(n,k));let ve={cols:B.cols,rows:B.rows},$=null;const Y=B.onResize(({cols:k,rows:se})=>{$!==null&&window.clearTimeout($),$=window.setTimeout(()=>{$=null,!(k===ve.cols&&se===ve.rows)&&(ve={cols:k,rows:se},h(n,k,se))},100)}),W=new ResizeObserver(()=>{try{J.fit()}catch{return}v.current&&B.scrollToBottom()});W.observe(x.current);const he=g(n,k=>{k.kind==="buffer"&&B.reset(),B.write(k.data)});m(n),w.current!==null&&!j.current&&(j.current=!0,B.write(`\r
|
|
129
|
-
\x1B[2m— Процесс завершён (код ${w.current}) —\x1B[0m\r
|
|
130
|
-
`)),r&&B.focus(),G=()=>{var k;$!==null&&window.clearTimeout($),W.disconnect(),(k=B.element)==null||k.removeEventListener("contextmenu",me),we.dispose(),Y.dispose(),he(),B.dispose(),y.current=null},C("ready")})(),()=>{L=!0,window.clearTimeout(M),G==null||G(),G=null}},[n]),b.useEffect(()=>{if(!o)return;const I=x.current;if(!I)return;let L=null,G=0,M=!1;const z=B=>{B.pointerType==="mouse"||L!==null||(L=B.pointerId,G=B.clientY,M=!1)},O=B=>{if(B.pointerId!==L)return;const J=G-B.clientY;if(!M){if(Math.abs(J)<4)return;M=!0,I.setPointerCapture(B.pointerId)}G=B.clientY;const me=I.querySelector(".xterm-viewport");me&&(me.scrollTop+=J)},P=B=>{B.pointerId===L&&(I.hasPointerCapture(B.pointerId)&&I.releasePointerCapture(B.pointerId),L=null,M=!1)},U=B=>B.stopPropagation();return I.addEventListener("pointerdown",z),I.addEventListener("pointermove",O),I.addEventListener("pointerup",P),I.addEventListener("pointercancel",P),I.addEventListener("touchmove",U,{capture:!0}),()=>{I.removeEventListener("pointerdown",z),I.removeEventListener("pointermove",O),I.removeEventListener("pointerup",P),I.removeEventListener("pointercancel",P),I.removeEventListener("touchmove",U,{capture:!0}),L!==null&&I.hasPointerCapture(L)&&I.releasePointerCapture(L)}},[o]),b.useEffect(()=>{T.current=c,y.current&&(y.current.options.theme=c)},[c]),b.useEffect(()=>{var I;r&&((I=y.current)==null||I.focus())},[r]),b.useEffect(()=>{if(w.current=l,l===null){j.current=!1;return}if(j.current)return;const I=y.current;I&&(j.current=!0,I.write(`\r
|
|
131
|
-
\x1B[2m— Процесс завершён (код ${l}) —\x1B[0m\r
|
|
132
|
-
`))},[l]),a.jsxs("div",{className:"termview"+(r?" is-active":""),children:[a.jsx("div",{ref:x,className:"termview__surface"+(A==="ready"?"":" is-hidden")}),A==="loading"&&F&&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:"Загружается терминал…"})]}),A==="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 gE=2e5,xE=75,bE=90;function _E({tokens:n,maxTokens:l,fetchedAt:r}){if(n===null)return null;const c=l??gE,o=Math.min(100,Math.round(n/c*100)),d=`${n.toLocaleString()} из ${c.toLocaleString()} токенов${r?`
|
|
133
|
-
обновлено в ${new Date(r).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:""}`;return a.jsxs("div",{className:"contextbar","aria-label":`Занято контекста: ${o}%`,title:d,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${yE(o)}`,style:{width:`${o}%`}})}),a.jsxs("span",{className:"contextbar__pct",children:[o,"%"]})]})}function yE(n){return n>=bE?" contextbar__fill--over":n>=xE?" contextbar__fill--warn":""}const $y="ccv:last-session",vE=300*1e3,jE=1e4;function NE(){try{const n=localStorage.getItem($y);if(!n)return null;const l=JSON.parse(n);if(typeof l!="object"||l===null)return null;const{workspaceId:r,sessionId:c,claudeSessionId:o}=l;return typeof r!="string"||typeof c!="string"?null:{workspaceId:r,sessionId:c,claudeSessionId:typeof o=="string"?o:null}}catch{return null}}function wE(n,l){const r=n.find(o=>o.id===l);if(r)return r;const c=n.filter(o=>dv(o.path).includes(l));return c.length===1?c[0]:void 0}function kE(n,l){return n.id===l.sessionId?!0:l.claudeSessionId?n.id===l.claudeSessionId||n.claudeSessionId===l.claudeSessionId:!1}const SE={mcp:"mcp",plugins:"plugins",plugin:"plugins"},N_=[{name:"login",description:"Войти в аккаунт Claude — Настройки, раздел входа",argumentHint:"",aliases:["signin","вход"]},{name:"switch-account",description:"Сменить аккаунт: выйти и войти заново (Настройки)",argumentHint:"",aliases:["account","аккаунт"]},{name:"logout",description:"Выйти из аккаунта Claude (Настройки)",argumentHint:"",aliases:["signout","выход"]}],w_=[{id:Ki,name:"Основной",color:"orange",configDir:null,dir:"",main:!0,liveSessions:0}];function k_(n,l,r){if(n===null)return null;const c=n.lastIndexOf("/");if(c===-1&&n!=="")return l;const o=r[c===-1?"":n.slice(0,c)];if(!o)return null;const d=n.slice(c+1).toLowerCase();return d===""?{query:n,entries:o}:{query:n,entries:o.filter(h=>h.name.toLowerCase().includes(d)).sort((h,m)=>S_(h.name,d)-S_(m.name,d))}}function S_(n,l){return n.toLowerCase().startsWith(l)?0:1}function E_(n,l){const r=n.find(o=>o.value===l)??n.find(o=>o.resolvedModel===l),c=l&&!r?l:null;return{rows:[...c?[{value:c,resolvedModel:c,displayName:c,description:"задана в настройках",supportsEffort:!1,effortLevels:[],supportsThinking:!0,supportsAutoMode:!1}]:[],...n],selected:(r==null?void 0:r.value)??c??(n.some(o=>o.value==="default")?"default":"")}}function EE(){var _s,on;const n=b.useRef(null),[l,r]=b.useState(!1),[c,o]=b.useState("Нет связи с хостом"),[d,h]=b.useState(null),[m,g]=b.useState(null),x=(m==null?void 0:m.status)==="blocked",[y,j]=b.useState(!1),v=b.useMemo(()=>Vd()==="relay",[]),[T,w]=b.useState([]),[A,C]=b.useState([]),[F,Q]=b.useState([]),[I,L]=b.useState([]),[G,M]=b.useState([]),[z,O]=b.useState([]),[P,U]=b.useState([]),[B,J]=b.useState({}),[me,we]=b.useState([]),[ve,$]=b.useState([]),[Y,W]=b.useState(null),[he,Se]=b.useState(null),[k,se]=b.useState(null),[q,je]=b.useState(null),[te,ke]=b.useState(null),[De,Ge]=b.useState(null),[He,bt]=b.useState(Ls),[Ve,fn]=b.useState(np),[We,at]=b.useState(!1),[ct,jt]=b.useState(!1),ut=ff("(max-width: 860px)"),[$t,wt]=b.useState(!1);b.useEffect(()=>{ut||wt(!1)},[ut]);const[Ce,Pe]=b.useState(!1),[Rt,dt]=b.useState([]),[Fe,bn]=b.useState(!1),[ts,Lt]=b.useState(Ls),[kt,hs]=b.useState(null),[hn,tn]=b.useState(null),[ps,_n]=b.useState([]),[Ft,Cn]=b.useState(null),[zt,Tt]=b.useState(null),[re,ye]=b.useState([]),[Xe,it]=b.useState([]),[Je,nn]=b.useState([]),[Z,fe]=b.useState([]),[Me,$e]=b.useState(null),[Dt,pn]=b.useState(null),[An,Fs]=b.useState({}),[yn,cl]=b.useState(null),[ws,ns]=b.useState({}),[Vl,ks]=b.useState(null),[Us,sn]=b.useState({}),[et,$n]=b.useState([]),[ol,Js]=b.useState(!1),[Mn,ka]=b.useState(w_),[ss,ms]=b.useState({}),[Ss,Rn]=b.useState(null),[gs,ln]=b.useState(null),[tt,Kn]=b.useState(null),[vn,ls]=b.useState(()=>pv()??Ki),[_t,wl]=b.useState(null),qn=(_t==null?void 0:_t.enabledProviders)??["claude","antigravity"],[Ws,as]=b.useState(!1),[Zn,Gn]=b.useState({}),[ft,Nt]=b.useState(null),[jn,ri]=b.useState(null),[Es,ul]=b.useState(!1),[Ql,,ci]=Ov(),Dn=Iv(),[is,Hs]=b.useState(!1),[qt,Ts]=b.useState(null),[Ne,S]=b.useState(null),[ee,ge]=b.useState(null),[Ee,Le]=b.useState(null),[Oe,Ct]=b.useState(null),[an,Nn]=b.useState(""),[Ut,zn]=b.useState(null),[mn,Ps]=b.useState([]),[kl,E]=b.useState(!1),[oe,Te]=b.useState(null),[Qe,ot]=b.useState(!1),[Zt,Yn]=b.useState(!1),[wn,Sa]=b.useState({}),[Ea,sr]=b.useState([""]),[dl,xs]=b.useState([]),[lr,kn]=b.useState(null),[Ta,el]=b.useState(null),[Sl,Vr]=b.useState(null),[Ca,oi]=b.useState(null),[ar,ui]=b.useState(null),[ir,vu]=b.useState({}),[Qr,ju]=b.useState({}),[El,rr]=b.useState(!1),[_f,no]=b.useState(null),[Kr,so]=b.useState(null),lo=b.useRef(0),Zr=b.useRef(null),[di,ao]=b.useState(!1),[Fr,Aa]=b.useState([]),[yf,Jr]=b.useState(null),[vf,cr]=b.useState(null),Wr=qv(),io=Vv(ut&&di),or=b.useRef(new Map),Ma=(_t==null?void 0:_t.terminalEnabled)===!0,Pr=Vd()==="relay"&&((_s=d==null?void 0:d.shell)==null?void 0:_s.enabled)!==!0,ro=b.useRef(!1),jf=b.useCallback((p,R)=>(or.current.set(p,R),()=>{or.current.get(p)===R&&or.current.delete(p)}),[]),[Ra,ec]=b.useState(!1),[tc,Kl]=b.useState(null),[Nu,ur]=b.useState(Ls),[fl,dr]=b.useState(null),[fi,Zl]=b.useState({}),hl=b.useRef([]),[rn,co]=b.useState(null);function Nf(p){co(R=>R===p?null:p)}b.useEffect(()=>{(ut||rn==="terminal"&&!di||rn==="files"&&!Zt||rn==="search"&&!El||rn==="git"&&!is||rn==="ask"&&!Ra||rn==="main"&&dl.length===0)&&co(null)},[rn,ut,di,Zt,El,is,Ra,dl.length]);const[wu]=b.useState(NE),nc=b.useRef(wu),Fl=b.useRef(!1),cn=b.useRef(null),fr=b.useRef(null),Jl=b.useRef(null),oo=b.useRef(0),On=b.useRef(null),sc=b.useRef(0);cn.current=te,On.current=q,sc.current=He.lastSeq;const lc=b.useRef(Ve);lc.current=Ve;const pl=b.useRef(null),uo=b.useRef(0);uo.current=Nu.lastSeq;const hr=b.useRef(null),ac=b.useRef(""),pr=b.useRef(null),Da=b.useRef([]),ku=b.useRef([""]);Da.current=dl,ku.current=Ea;const mr=b.useRef(new Map),Fn=b.useRef(new Set),Tl=b.useRef(null),hi=b.useRef(null),fo=b.useRef(0),pi=b.useRef(new Set);b.useEffect(()=>{const p=jv();if(!p)return;n.current=p;const R=()=>{r(p.connected),o(p.statusText)};p.onStatus(R),p.onReconnect(()=>{R(),ns({});const Ie=cn.current;Ie&&p.send({type:"session.sync",sessionId:Ie,sinceSeq:sc.current});const Yt=pl.current;Yt&&p.send({type:"session.sync",sessionId:Yt,sinceSeq:uo.current})});const X=p.on(Ie=>Su(Ie));p.connect();const xe=window.setInterval(()=>{R(),p.connected&&p.send({type:"ping",nonce:Date.now()})},15e3);return()=>{X(),window.clearInterval(xe),p.close()}},[]);const Su=b.useCallback(p=>{var R,X,xe,Ie,Yt,un,cs,Va,oa,Hl;switch(p.type){case"hello.ok":r(!0);break;case"workspace.list":{w(p.workspaces),C(p.archived),je(Ue=>{var Vn;if(Ue)return Ue;const qe=nc.current,nt=qe&&wE(p.workspaces,qe.workspaceId);return qe&&nt&&nt.id!==qe.workspaceId&&(nc.current={...qe,workspaceId:nt.id}),(nt==null?void 0:nt.id)??((Vn=p.workspaces[0])==null?void 0:Vn.id)??null});const _e=pr.current;if(!_e)break;const be=p.workspaces.find(Ue=>DE(Ue.path,_e));if(!be)break;pr.current=null,Pe(!1),je(be.id);break}case"workspace.candidates":if(p.query.trim()!==ac.current)break;dt(p.candidates),p.source==="host"&&bn(!1);break;case"finder.opened":hr.current=p.sessionId;break;case"workspace.roots":_n(p.roots);break;case"workspace.created":if(je(p.workspace.id),p.warnings.length===0){Pe(!1),tn(null);break}Cn({path:p.workspace.path,warnings:p.warnings});break;case"session.list":if(J(_e=>({..._e,[p.workspaceId]:{sessions:p.sessions??[],archived:p.archived??[]}})),p.workspaceId!==On.current)break;O(p.sessions),U(p.archived);break;case"folder.list":Q(p.workspaceFolders),L(p.sessionFolders),M(p.pinnedFolders??[]);break;case"session.pinned":we(p.sessions);break;case"session.live":$(p.sessions);break;case"order.state":se(p.order);break;case"session.summary":if(p.session.id===hr.current){hs(p.session);break}if(p.session.parentSessionId){p.session.id===pl.current&&dr(p.session);break}if($(_e=>{const be=_e.findIndex(qe=>qe.id===p.session.id);if(p.session.state==="closed")return be===-1?_e:_e.filter(qe=>qe.id!==p.session.id);if(be===-1)return[..._e,p.session];const Ue=_e.slice();return Ue[be]=p.session,Ue}),O(_e=>{const be=_e.findIndex(qe=>qe.id===p.session.id);if(be===-1)return[p.session,..._e];const Ue=_e.slice();return Ue[be]=p.session,Ue}),J(_e=>{const be=_e[p.session.workspaceId];if(!be)return _e;const Ue=be.sessions.findIndex(nt=>nt.id===p.session.id);let qe;if(Ue!==-1)qe=be.sessions.slice(),qe[Ue]=p.session;else{if(be.archived.some(nt=>nt.id===p.session.id))return _e;qe=[p.session,...be.sessions]}return{..._e,[p.session.workspaceId]:{...be,sessions:qe}}}),we(_e=>{const be=_e.findIndex(qe=>qe.id===p.session.id);if(be===-1)return _e;const Ue=_e.slice();return Ue[be]={...p.session,pinned:!0,..._e[be].pinnedAt?{pinnedAt:_e[be].pinnedAt}:{}},Ue}),cn.current===null&&Jl.current&&Jl.current.workspaceId===p.session.workspaceId&&(B_(p.session.id,Jl.current.text),Jl.current=null),ke(_e=>_e??p.session.id),((R=fr.current)==null?void 0:R.sessionId)===p.session.id){const _e=fr.current;p.session.state==="error"?fr.current=null:p.session.state!=="closed"&&(fr.current=null,(X=n.current)==null||X.send({type:"prompt.send",sessionId:_e.sessionId,text:_e.text,images:_e.images}))}break;case"usage.state":p.sessionId===cn.current&&(Nt(p.usage),ul(!1));break;case"context.state":p.sessionId===cn.current&&(ri(p.context),ul(!1));break;case"session.capabilities":p.sessionId===cn.current&&Ge(p.capabilities);break;case"session.events":if(p.sessionId===pl.current){ur(_e=>Qd(_e,p.entries));break}if(p.sessionId===hr.current){Lt(_e=>Qd(_e,p.entries));break}if(p.sessionId!==cn.current)break;for(const _e of p.entries){if(_e.event.kind!=="rewound")continue;const be=_e.event.toUserIndex,Ue=Rv(lc.current.entries,be),qe=Ue.reduce((nt,Vn)=>Vn.event.kind==="user.message"?nt+1:nt,0);fn(nt=>({...nt,entries:Ue})),bt(nt=>({...nt,items:Dv(nt.items,be,qe)}))}bt(_e=>Qd(_e,p.entries));break;case"session.history":if(p.sessionId!==cn.current)break;fn(_e=>Cv(_e,p));break;case"side.opened":{if(p.parentSessionId!==cn.current)break;pl.current=p.sessionId,Kl(p.sessionId);const _e=hl.current;hl.current=[];for(const be of _e)be(p.sessionId);break}case"side.closed":if(p.parentSessionId!==cn.current)break;pl.current=null,Kl(null),ur(Ls),dr(null);break;case"git.state":if(p.workspaceId!==On.current)break;Ts(p.state);break;case"git.commit":if(p.workspaceId!==On.current)break;S(p.detail);break;case"git.result":if(p.workspaceId!==On.current)break;Le({ok:p.ok,message:p.message,url:p.url}),p.ok&&(S(null),ge(null),E(!1),ot(!1));break;case"git.busy":if(p.workspaceId!==On.current)break;Nn(p.label);break;case"git.files":if(p.workspaceId!==On.current)break;Te({files:p.files,truncated:p.truncated});break;case"github.status":zn(p.status);break;case"github.owners":Ps(p.owners);break;case"fs.dir":if(p.workspaceId!==On.current)break;Sa(_e=>({..._e,[p.path]:p.entries}));break;case"fs.search":if(p.workspaceId!==On.current)break;if(p.scope!=="tree"){const _e=p.scope;ju(be=>({...be,[_e]:{query:p.query,entries:p.entries}}));break}ui({query:p.query,entries:p.entries,truncated:p.truncated});break;case"fs.grep":if(p.workspaceId!==On.current)break;no({query:p.query,matches:p.matches,truncated:p.truncated});break;case"fs.file":{if(p.workspaceId!==On.current)break;const _e=Fn.current.delete(p.file.path);xs(Ue=>{const qe=Ue.findIndex(Rf=>Rf.path===p.file.path);if(qe===-1)return[...Ue,Hb(p.file,++fo.current)];const nt=Ue[qe],Vn=Ue.slice();return Vn[qe]=nt.saved===p.file.content&&!si(nt)?{...nt,mtime:p.file.mtime,size:p.file.size,stale:!1}:Hb(p.file,++fo.current),Vn}),_e&&kn(p.file.path);const be=Zr.current;be&&be.path===p.file.path&&(Zr.current=null,so({...be,token:++lo.current}));break}case"fs.media":{if(p.workspaceId!==On.current)break;pi.current.delete(p.path),xs(_e=>_e.map(be=>be.path===p.path?{...be,mediaBase64:p.base64,mediaError:void 0}:be));break}case"fs.mediaFailed":{if(p.workspaceId!==On.current)break;pi.current.delete(p.path),xs(_e=>_e.map(be=>be.path===p.path?{...be,mediaError:p.message}:be));break}case"fs.saved":{if(p.workspaceId!==On.current)break;const _e=mr.current.get(p.path);mr.current.delete(p.path);const be=_e!==void 0;xs(qe=>qe.map(nt=>nt.path!==p.path?nt:be?{...nt,saved:_e,mtime:p.mtime,size:p.size,stale:!1}:{...nt,stale:!0}));const Ue=Da.current.find(qe=>qe.path===p.path);!be&&Ue&&!si(Ue)&&((xe=n.current)==null||xe.send({type:"fs.read",workspaceId:p.workspaceId,path:p.path})),(Ie=n.current)==null||Ie.send({type:"git.state",workspaceId:p.workspaceId});break}case"fs.result":{if(p.workspaceId!==On.current)break;if(el({ok:p.ok,message:p.message}),p.ok||mr.current.delete(p.path),p.conflict&&xs(be=>be.map(Ue=>Ue.path===p.path?{...Ue,stale:!0}:Ue)),hi.current===p.path){const be=hi.current;hi.current=null,p.ok&&(Fn.current.add(be),(Yt=n.current)==null||Yt.send({type:"fs.read",workspaceId:p.workspaceId,path:be}))}const _e=Tl.current;if(p.ok&&_e&&_e.to===p.path){Tl.current=null;const be=Ue=>Ue===_e.from?_e.to:Ue.startsWith(`${_e.from}/`)?_e.to+Ue.slice(_e.from.length):Ue;xs(Ue=>Ue.map(qe=>({...qe,path:be(qe.path)}))),kn(Ue=>Ue===null?null:be(Ue)),sr(Ue=>Ue.map(be)),Sa(Ue=>{const qe={};for(const[nt,Vn]of Object.entries(Ue))nt===_e.from||nt.startsWith(`${_e.from}/`)||(qe[nt]=Vn);return qe})}p.ok&&((un=n.current)==null||un.send({type:"git.state",workspaceId:p.workspaceId}));break}case"term.list":if(p.workspaceId!==On.current)break;Aa(p.terminals);break;case"term.opened":if(p.terminal.workspaceId!==On.current)break;cr(null),Aa(_e=>{const be=_e.findIndex(qe=>qe.id===p.terminal.id);if(be===-1)return[..._e,p.terminal];const Ue=_e.slice();return Ue[be]=p.terminal,Ue}),ro.current&&(ro.current=!1,Jr(p.terminal.id));break;case"term.buffer":(cs=or.current.get(p.id))==null||cs({kind:"buffer",data:p.data});break;case"term.data":(Va=or.current.get(p.id))==null||Va({kind:"data",data:p.data});break;case"term.exit":Aa(_e=>_e.map(be=>be.id===p.id?{...be,exitCode:p.exitCode}:be));break;case"term.closed":Aa(_e=>_e.filter(be=>be.id!==p.id));break;case"mcp.list":p.sessionId===cn.current&&ye(p.servers);break;case"mcp.auth":p.sessionId===cn.current&&pn(p.state);break;case"plugin.list":if(p.sessionId!==cn.current)break;it(p.plugins),nn(p.marketplaces),fe(p.catalog);break;case"operation.result":p.sessionId===cn.current&&$e(p.result);break;case"auth.status":ms(_e=>({..._e,[p.accountId]:p.status}));break;case"accounts.candidates":ln(p.candidates);break;case"accounts.state":ka(p.accounts.length>0?p.accounts:w_),Rn(null),ms(_e=>{const be={};for(const Ue of p.accounts)be[Ue.id]=p.auth[Ue.id]??_e[Ue.id]??null;return be});break;case"relay.state":h(p.state);break;case"network.state":g(p.state);break;case"settings.state":wl(p.settings);break;case"handoff.state":Fs(_e=>{if(!p.handoff){if(!(p.sessionId in _e))return _e;const be={..._e};return delete be[p.sessionId],be}return{..._e,[p.sessionId]:p.handoff}});break;case"handoff.written":ns(_e=>{if(!(p.sessionId in _e))return _e;const be={..._e};return delete be[p.sessionId],be}),p.handoff&&cn.current===p.sessionId?ks(p.handoff):p.handoff||console.warn("[handoff] хост не смог записать хэндофф",p.sessionId);break;case"limit.stopped":oo.current+=1,$n(_e=>[..._e,{id:oo.current,limit:p.limit,utilization:p.utilization,stopped:p.stopped,handoffs:p.handoffs}]);break;case"auth.login":Gn(_e=>({..._e,[p.accountId]:p.state})),p.state.active&&Js(!0);break;case"session.closed":$(_e=>_e.filter(be=>be.id!==p.sessionId)),O(_e=>_e.map(be=>be.id===p.sessionId?{...be,state:"closed"}:be)),J(_e=>{let be=!1;const Ue={};for(const[qe,nt]of Object.entries(_e))nt.sessions.some(Vn=>Vn.id===p.sessionId&&Vn.state!=="closed")?(be=!0,Ue[qe]={...nt,sessions:nt.sessions.map(Vn=>Vn.id===p.sessionId?{...Vn,state:"closed"}:Vn)}):Ue[qe]=nt;return be?Ue:_e});break;case"error":console.error("[host]",p.message,p.context??""),(p.context==="workspace.open"||p.context==="workspace.create")&&(pr.current=null,tn(p.message)),(oa=p.context)!=null&&oa.startsWith("term.")&&cr(p.message),(Hl=p.context)!=null&&Hl.startsWith("accounts.")&&Rn(p.message);break}},[]),ae=b.useCallback(p=>{var R;(R=n.current)==null||R.send(p)},[]);b.useEffect(()=>{q&&ae({type:"session.list",workspaceId:q})},[q,ae]),b.useEffect(()=>{l&&ae({type:"session.pins"})},[l,ae]),b.useEffect(()=>{l&&ae({type:"settings.get"})},[l,ae]),b.useEffect(()=>{if(l)return ae({type:"session.drafts",sessionIds:I_()}),Sv(p=>ae({type:"session.drafts",sessionIds:p}))},[l,ae]),b.useEffect(()=>{if(Fl.current)return;const p=nc.current;if(!p||!q)return;if(q!==p.workspaceId){Fl.current=!0;return}if(te){Fl.current=!0;return}if(z.length===0)return;const R=z.find(X=>kE(X,p));Fl.current=!0,R&&R.state!=="closed"&&_i(R)},[z,q,te]),b.useEffect(()=>{!q||Pr||!Ma||ae({type:"term.list",workspaceId:q})},[q,Pr,Ma,ae]),b.useEffect(()=>{Jr(p=>{var R;return p&&Fr.some(X=>X.id===p)?p:((R=Fr[0])==null?void 0:R.id)??null})},[Fr]),b.useEffect(()=>{Ce&&ae({type:"workspace.roots"})},[Ce,ae]);const mi=b.useCallback(()=>{const p=cn.current;p&&(ul(!0),ae({type:"usage.get",sessionId:p}),ae({type:"context.get",sessionId:p}))},[ae]);b.useEffect(()=>{if(!Es)return;const p=window.setTimeout(()=>ul(!1),jE);return()=>window.clearTimeout(p)},[Es]);const Wl=b.useMemo(()=>{const p=Math.max((ft==null?void 0:ft.fetchedAt)??0,(jn==null?void 0:jn.fetchedAt)??0);return p>0?p:null},[ft==null?void 0:ft.fetchedAt,jn==null?void 0:jn.fetchedAt]);b.useEffect(()=>{if(ri(null),!te)return;mi();const p=()=>{document.hidden||mi()},R=window.setInterval(p,vE),X=()=>{document.hidden||mi()};return document.addEventListener("visibilitychange",X),()=>{window.clearInterval(R),document.removeEventListener("visibilitychange",X)}},[te,mi]),b.useEffect(()=>{if(!te){fn(np);return}fn({...np,loading:!0}),ae({type:"session.history",sessionId:te})},[te,ae]);const ho=b.useCallback(()=>{!te||Ve.loading||!eb(Ve)||(fn(p=>({...p,loading:!0})),ae({type:"session.history",sessionId:te,before:q_(Ve)}))},[te,Ve,ae]),gr=b.useMemo(()=>Av(Ve.entries),[Ve.entries]),K=b.useMemo(()=>z.find(p=>p.id===te)??null,[z,te]),ml=te?(K==null?void 0:K.claudeSessionId)??te:null,Xn=ml?An[ml]??null:null;b.useEffect(()=>{ml&&ae({type:"handoff.get",sessionId:ml})},[ml,ae]),b.useEffect(()=>{yn&&!(yn.sessionId in An)&&cl(null)},[An,yn]);const Oa=b.useMemo(()=>{var X;if(!ft)return null;const p=(((X=ft.buckets)==null?void 0:X.length)??0)>0,R=(K==null?void 0:K.provider)==="antigravity";return p===R?ft:null},[ft,K==null?void 0:K.provider]),gi=Mn.length>1;function po(p){return Mn.some(R=>R.id===p)?p:Ki}const La=b.useMemo(()=>({accounts:Mn,auth:ss,multi:Mn.length>1}),[Mn,ss]),Bs=gi&&K&&K.provider!=="antigravity"?Mn.find(p=>p.id===K.accountId)??null:null,Eu=b.useMemo(()=>{const p={};for(const R of z)R.provider!=="antigravity"&&(R.state!=="running"&&R.state!=="waiting_permission"||(p[R.accountId]=(p[R.accountId]??0)+1));return p},[z]),mo="Обновить лимиты и контекст",wf=mo+(Wl?`
|
|
134
|
-
обновлено в ${new Date(Wl).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:"");b.useEffect(()=>{document.documentElement.dataset.provider=(K==null?void 0:K.provider)??"claude"},[K==null?void 0:K.provider]),b.useEffect(()=>{(K==null?void 0:K.provider)==="antigravity"&&ec(!1)},[K==null?void 0:K.provider]);const xi=T.find(p=>p.id===q)??A.find(p=>p.id===q)??null;b.useEffect(()=>{if(!q||!te)return;const p={workspaceId:q,sessionId:te,claudeSessionId:(K==null?void 0:K.claudeSessionId)??null};try{localStorage.setItem($y,JSON.stringify(p))}catch{}},[q,te,K==null?void 0:K.claudeSessionId]);function kf(p){pr.current=p,tn(null),ae({type:"workspace.open",path:p})}function Tu(p,R,X){tn(null),ae({type:"workspace.create",parent:p,name:R,init:X})}function Cu(p){if(ac.current=p,!p){dt([]),bn(!1);return}bn(!0),ae({type:"workspace.find",query:p})}function go(p){ac.current=p,Lt(Ls),ae({type:"workspace.find.agent",query:p})}function tl(){Pe(!1),tn(null),Cn(null),dt([]),Lt(Ls),hs(null),ac.current="",pr.current=null}function Cl(){const p=cn.current;p&&pl.current&&ae({type:"side.reset",sessionId:p}),pl.current=null,Kl(null),ur(Ls),dr(null),Zl({}),hl.current=[]}function Is(p){ae({type:"workspace.close",workspaceIds:p}),!(!q||!p.includes(q))&&(Cl(),je(null),ke(null),O([]),U([]),bt(Ls),Ge(null),jt(!1))}function bi(p,R){ae({type:"session.archive",workspaceId:p,sessionIds:R}),te&&(R.includes(te)||K!=null&&K.claudeSessionId&&R.includes(K.claudeSessionId))&&(Cl(),ke(null),bt(Ls),Ge(null),jt(!1))}function xo(p){ae({type:"workspace.restore",workspaceIds:p})}function ic(p,R,X){ae({type:"folder.create",scope:p,name:R,workspaceId:X})}function rc(p,R){ae({type:"folder.rename",folderId:p,name:R})}function bo(p,R){ae({type:"folder.setColor",folderId:p,color:R})}function za(p){ae({type:"folder.delete",folderId:p})}function Au(p,R,X,xe){ae({type:"folder.assign",scope:p,itemId:R,folderId:X,workspaceId:xe})}function cc(p=qn[0]??"claude",R){if(!q)return;let X;p==="claude"&&gi&&(X=R??po(vn),ls(X),mv(X)),Cl(),ke(null),Ge(null),bt(Ls),jt(!1),ae({type:"session.start",workspaceId:q,provider:p,...X?{accountId:X}:{}}),at(!1)}function Pl(p){Cl(),Eo(),je(p),ke(null),bt(Ls),Ge(null),jt(!1),Ts(null),S(null),ge(null),Le(null),Nn(""),E(!1),Te(null),ot(!1),Aa([]),Jr(null)}function Sf(p,R,X){ae({type:"session.pin",workspaceId:p,sessionIds:R,pinned:X})}function Cs(p){return p.state==="running"||p.state==="waiting_permission"||p.state==="reconnecting"||p.backgroundWork}function xr(p){if(Cs(p)){W(p);return}ae({type:"session.close",sessionId:p.id})}function Al(p,R,X){se(xe=>{const Ie=xe??{workspaces:[],sessions:{},pinned:[],live:[]};if(p==="sessions"){if(!X)return xe;const Yt={...Ie.sessions};return R&&R.length>0?Yt[X]=R:delete Yt[X],{...Ie,sessions:Yt}}return{...Ie,[p]:R??[]}}),ae({type:"order.set",scope:p,ids:R,...X?{workspaceId:X}:{}})}function Mu(p){p.workspaceId!==q&&Pl(p.workspaceId),_i(p)}function _i(p){if(at(!1),Cl(),bt(Ls),Ge(null),jt(!1),p.state==="closed"){ke(null),ae({type:"session.start",workspaceId:p.workspaceId,resume:p.id});return}ke(p.id),ae({type:"session.sync",sessionId:p.id,sinceSeq:0})}function Ua(p,R){if(!te||x)return!1;const X=te,xe=K;return oc(()=>{if((xe==null?void 0:xe.state)==="closed"){fr.current={sessionId:xe.id,text:p,images:R},_i(xe);return}ae({type:"prompt.send",sessionId:X,text:p,images:R})})}function oc(p){const R=(K==null?void 0:K.provider)==="antigravity"?null:lE(ft,_t);return R?new Promise(X=>{Se(xe=>(xe==null||xe.resolve(!1),{warning:R,resolve:X}))}).then(X=>(X&&p(),X)):(p(),!0)}function uc(p){he&&(he.resolve(p),Se(null))}function dc(p){const R=ve.find(Ie=>(Ie.claudeSessionId??Ie.id)===p.sessionId&&Ie.state!=="closed"),X=fc(p.sessionId,p.workspaceId,p.limit!==null),xe=X!=null&&X.canChoose?X.selectedId:(X==null?void 0:X.sourceId)??(R==null?void 0:R.accountId);Ha(p.workspaceId,p.sessionId,p.text,xe),R&&ae({type:"session.close",sessionId:R.id})}function fc(p,R,X){var _e,be,Ue;if(!gi)return null;const xe=qe=>qe.id===p||qe.claudeSessionId===p,Ie=ve.find(xe)??z.find(xe)??((_e=B[R])==null?void 0:_e.sessions.find(xe));if((Ie==null?void 0:Ie.provider)==="antigravity")return null;const Yt=Ie==null?void 0:Ie.accountId,un=Mn.filter(qe=>{var nt;return((nt=ss[qe.id])==null?void 0:nt.loggedIn)!==!1}),cs=qe=>qe&&un.some(nt=>nt.id===qe)?qe:void 0,Va=cs(Us[p]),oa=Yt?(be=un.find(qe=>qe.id!==Yt))==null?void 0:be.id:void 0,Hl=Va??(X?oa:void 0)??cs(Yt)??cs(Ki)??((Ue=un[0])==null?void 0:Ue.id)??Ki;return{source:Mn.find(qe=>qe.id===Yt)??null,sourceId:Yt,targets:un,selectedId:Hl,canChoose:un.length>1}}function As(p){Ha(p.workspaceId,p.claudeSessionId??p.id,null,p.accountId)}function Ha(p,R,X,xe){Jl.current=X===null?null:{workspaceId:p,text:X},p!==q?Pl(p):(Cl(),ke(null),Ge(null),bt(Ls),jt(!1)),ae({type:"session.start",workspaceId:p,provider:"claude",...gi&&xe?{accountId:xe}:{},continuesFrom:R,...X===null?{}:{fromHandoff:!0}}),at(!1)}b.useEffect(()=>{Vl&&(ks(null),dc(Vl))},[Vl]);function Ba(p){ws[p.id]||(ns(R=>({...R,[p.id]:!0})),ae({type:"session.handoff",sessionId:p.id}))}function hc(p){ae({type:"handoff.dismiss",sessionId:p})}function yi(p,R){ae({type:"session.rename",sessionId:p.id,title:R,workspaceId:p.workspaceId}),O(X=>X.map(xe=>xe.id===p.id?{...xe,title:R}:xe)),J(X=>{const xe=X[p.workspaceId];return xe?{...X,[p.workspaceId]:{...xe,sessions:xe.sessions.map(Ie=>Ie.id===p.id?{...Ie,title:R}:Ie)}}:X})}function Ms(p){te&&(at(!1),$e(null),pn(null),Tt(p),ae({type:"mcp.list",sessionId:te}),ae({type:"plugin.list",sessionId:te}))}const $s={mcpAction:(p,R)=>{te&&($e(null),ae({type:"mcp.action",sessionId:te,name:p,action:R}))},mcpAuth:p=>{te&&($e(null),pn({name:p,active:!0,url:"",callbackExpected:!1,done:!1,error:null}),ae({type:"mcp.auth",sessionId:te,name:p}))},mcpAuthCallback:(p,R)=>{te&&ae({type:"mcp.auth_callback",sessionId:te,name:p,callbackUrl:R})},mcpAdd:(p,R)=>{te&&ae({type:"mcp.add",sessionId:te,name:p,draft:R})},mcpRemove:p=>{te&&ae({type:"mcp.remove",sessionId:te,name:p})},pluginInstall:p=>{te&&ae({type:"plugin.install",sessionId:te,spec:p})},pluginUninstall:p=>{te&&ae({type:"plugin.uninstall",sessionId:te,id:p})},pluginToggle:(p,R)=>{te&&ae({type:"plugin.toggle",sessionId:te,id:p,enabled:R})},marketplaceAdd:p=>{te&&ae({type:"marketplace.add",sessionId:te,source:p})},marketplaceRemove:p=>{te&&ae({type:"marketplace.remove",sessionId:te,name:p})}};function Ml(){at(!1),Js(!0),Rn(null);for(const p of Mn)ae({type:"auth.status",accountId:p.id})}const qs={login:(p,R,X)=>ae({type:"auth.login",mode:R,switchAccount:X,accountId:p}),submitCode:(p,R)=>ae({type:"auth.code",code:R,accountId:p}),cancel:p=>ae({type:"auth.cancel",accountId:p}),logout:p=>ae({type:"auth.logout",accountId:p})},gl={discover:()=>ae({type:"accounts.discover"}),add:(p,R,X,xe)=>{Rn(null),ae({type:"accounts.add",name:p,color:R,...X?{configDir:X}:{},...xe?{shareConfig:!0}:{}})},update:(p,R)=>{Rn(null),ae({type:"accounts.update",accountId:p,...R})},remove:p=>{Rn(null),ae({type:"accounts.remove",accountId:p})},makeMain:p=>{Rn(null),ae({type:"accounts.makeMain",accountId:p})}};function nl(p){Js(!1),at(!1),Kn(p),as(!0),ae({type:"settings.get"});for(const R of Mn)ae({type:"auth.status",accountId:R.id})}function Ru(){at(!1),Kn(null),as(!0),ae({type:"settings.get"});for(const p of Mn)ae({type:"auth.status",accountId:p.id})}function _o(p){wl(R=>R&&{...R,...p}),ae({type:"settings.update",settings:p})}function yo(p){!te||x||ae({type:"side.ask",sessionId:te,text:p})}function Du(){te&&(ae({type:"side.reset",sessionId:te}),pl.current=null,Kl(null),ur(Ls),dr(null),Zl({}),hl.current=[])}function gn(p){const R=pl.current;if(R){p(R);return}const X=cn.current;X&&(hl.current.push(p),ae({type:"side.open",sessionId:X}))}function Gt(){q&&ae({type:"git.state",workspaceId:q})}function ht(p){q&&(ge(p),ae({type:"git.show",workspaceId:q,ref:p}))}function Rl(p,R){Le(null),Ct({target:p,label:R})}function Gs(){!q||!Oe||(ae({type:"git.checkout",workspaceId:q,target:Oe.target}),Ct(null))}function vo(){q&&(Le(null),ae({type:"git.push",workspaceId:q}))}function ea(p){q&&(Le(null),ae({type:"git.pull",workspaceId:q,merge:p}))}function Ou(){q&&(Le(null),Te(null),E(!0),ae({type:"github.status"}),ae({type:"github.owners"}),ae({type:"git.files",workspaceId:q}))}function Lu(p){q&&(Le(null),ae({type:"git.publish",workspaceId:q,...p}))}function vi(p){q&&(Le(null),ae({type:"git.remote",workspaceId:q,url:p}))}function Ia(){Le(null),ot(!0)}function jo(p){ae({type:"github.token",token:p}),ae({type:"github.owners"})}function br(){ae({type:"github.status"}),ae({type:"github.owners"})}b.useEffect(()=>{if(!(!Zt||!q))for(const p of Ea)p in wn||ae({type:"fs.list",workspaceId:q,path:p})},[Zt,Ea,wn,q,ae]);function No(p){sr(R=>R.includes(p)?R.filter(X=>X!==p):[...R,p])}function $a(p){if(!p){ui(null);return}q&&ae({type:"fs.search",workspaceId:q,query:p})}function Dl(p){if(!p){no(null);return}q&&ae({type:"fs.grep",workspaceId:q,query:p})}const Ol=b.useCallback((p,R)=>{vu(Ie=>({...Ie,[p]:R}));const X=On.current;if(R===null||!X)return;const xe=R.lastIndexOf("/");if(xe!==-1){ae({type:"fs.list",workspaceId:X,path:R.slice(0,xe)});return}if(R===""){ae({type:"fs.list",workspaceId:X,path:""});return}ae({type:"fs.search",workspaceId:X,query:R,scope:p})},[ae]),Ll=b.useMemo(()=>k_(ir.mention??null,Qr.mention??null,wn),[ir.mention,Qr.mention,wn]),wo=b.useMemo(()=>k_(ir.side??null,Qr.side??null,wn),[ir.side,Qr.side,wn]);function ko(p){Ni(p.path,{line:p.line,column:p.column})}function ji(p){const R=[];let X=$r(p.path);for(;R.push(X),!!X;)X=$r(X);sr(xe=>{const Ie=new Set(xe);for(const Yt of R)Ie.add(Yt);return p.kind==="dir"&&Ie.add(p.path),[...Ie]}),p.kind==="file"&&Ni(p.path)}function Ni(p,R){if(Da.current.find(xe=>xe.path===p)){kn(p),R&&so({path:p,...R,token:++lo.current});return}q&&(R&&(Zr.current={path:p,...R}),Fn.current.add(p),ae({type:"fs.read",workspaceId:q,path:p}))}function zl(p,R=!1){const X=Da.current,xe=X.find(un=>un.path===p);if(xe&&si(xe)&&!R){oi(p);return}oi(null);const Ie=X.findIndex(un=>un.path===p),Yt=X.filter(un=>un.path!==p);xs(Yt),kn(un=>{var cs;return un===p?((cs=Yt[Math.min(Ie,Yt.length-1)])==null?void 0:cs.path)??null:un})}function Sn(p,R=!1){const X=Da.current.find(xe=>xe.path===p);!X||!q||!R&&!si(X)||(mr.current.set(p,X.text),ae({type:"fs.write",workspaceId:q,path:p,content:X.text,eol:X.eol,encoding:X.encoding,baseMtime:X.mtime,...R?{force:!0}:{}}))}function pc(p){q&&ae({type:"fs.read",workspaceId:q,path:p})}function zu(p){q&&(pi.current.has(p)||(pi.current.add(p),ae({type:"fs.readMedia",workspaceId:q,path:p})))}const Ef=b.useRef(new Map);function Tf(p){const R=Ef.current,X=R.get(p);X&&clearTimeout(X);const xe=(_t==null?void 0:_t.autoSaveAfterPauseMs)??0;xe<=0||R.set(p,setTimeout(()=>{R.delete(p);const Ie=Da.current.find(Yt=>Yt.path===p);Ie&&si(Ie)&&!Ie.stale&&Sn(p)},xe))}function Cf(p,R,X){if(!q)return;const xe=p?`${p}/${X}`:X;el(null),R==="file"&&(hi.current=xe),ae({type:"fs.create",workspaceId:q,path:xe,kind:R})}function En(p,R){if(!q)return;const X=$r(p),xe=X?`${X}/${R}`:R;el(null),Tl.current={from:p,to:xe},ae({type:"fs.rename",workspaceId:q,path:p,to:xe})}function So(p,R){if(!q)return;const X=p.slice(p.lastIndexOf("/")+1),xe=R?`${R}/${X}`:X;xe!==p&&(el(null),Tl.current={from:p,to:xe},ae({type:"fs.rename",workspaceId:q,path:p,to:xe}))}function _r(p,R){q&&(el(null),ae({type:"fs.copy",workspaceId:q,path:p,toDir:R}))}function yr(p){q&&(el(null),Vr(null),ae({type:"fs.delete",workspaceId:q,path:p.path}),xs(R=>R.filter(X=>X.path!==p.path&&!X.path.startsWith(`${p.path}/`))),kn(R=>R&&(R===p.path||R.startsWith(`${p.path}/`))?null:R))}function Eo(){Sa({}),sr([""]),xs([]),kn(null),el(null),ui(null),no(null),vu({}),ju({}),so(null),Fn.current.clear(),mr.current.clear(),pi.current.clear(),Zr.current=null,Tl.current=null,hi.current=null}function wi(){!q||Pr||!Ma||(cr(null),ro.current=!0,ae({type:"term.open",workspaceId:q,cols:80,rows:24}))}function ki(p){ae({type:"term.close",id:p})}function Af(p,R){te&&ae({type:"permission.respond",sessionId:te,requestId:p,decision:R})}function Uu(p,R){te&&ae({type:"permission.respond",sessionId:te,requestId:p,decision:"allow",answers:R})}function Mf(p){te&&ae({type:"permission.respond",sessionId:te,requestId:p,decision:"deny",reason:"Пользователь не стал отвечать на вопросы"})}function Hu(p,R){te&&ae({type:"permission.respond",sessionId:te,requestId:p,decision:"allow",plan:R})}function qa(p){te&&ae({type:"permission.respond",sessionId:te,requestId:p,decision:"deny",reason:"Пользователь просит продолжить планирование"})}b.useEffect(()=>{function p(R){if(R.key!=="Escape")return;if(rn!==null){const xe=R.target;if(!(xe instanceof HTMLElement&&xe.closest(".termview, .editor, .sidepane"))){co(null);return}}if(!te||He.pending.length>0)return;const X=R.target;X instanceof HTMLElement&&X.closest(".sidepane, .editor")||ae({type:"control.interrupt",sessionId:te})}return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[te,He.pending.length,ae,rn]),b.useEffect(()=>{function p(R){R.key!=="`"||!(R.ctrlKey||R.metaKey)||Ma&&(R.preventDefault(),ao(X=>!X))}return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[Ma]);const mc=b.useMemo(()=>{const p=(De==null?void 0:De.commands)??[];return p.length===0||(K==null?void 0:K.provider)==="antigravity"?p:[...p,{name:"plugins",description:"Плагины и маркетплейсы — окно приложения",argumentHint:"",aliases:["plugin"]},...N_]},[De,K==null?void 0:K.provider]);function vr(p){const R=SE[p];if(R&&(K==null?void 0:K.provider)!=="antigravity")return Ms(R),!0;if((K==null?void 0:K.provider)==="antigravity"||!N_.some(xe=>xe.name===p))return!1;const X=(K==null?void 0:K.accountId)??Ki;return nl(X),p==="logout"&&qs.logout(X),p==="switch-account"&&qs.login(X,"claudeai",!0),!0}const jr=(K==null?void 0:K.state)==="waiting_permission",Jn=(K==null?void 0:K.state)==="reconnecting",Rs=(K==null?void 0:K.state)==="running"||Jn||jr,Ht=He.pending[0]??null,Si=Ht?uk(Ht.toolName,Ht.input):null,[Bu,Iu]=b.useState(()=>new Set),xl=Ht?Bu.has(Ht.requestId):!1,ta=Ht?Ht.questions&&Ht.questions.length>0?"question":Si!==null?"plan":"permission":null;function Nr(p,R){Iu(X=>{if(X.has(p)===R)return X;const xe=new Set(X);return R?xe.add(p):xe.delete(p),xe})}b.useEffect(()=>{!is&&!Zt||!q||Rs||ae({type:"git.state",workspaceId:q})},[is,Zt,q,Rs,ae]),b.useEffect(()=>{if(!(Rs||!q)){Zt&&Sa(p=>{const R={};for(const[X,xe]of Object.entries(p))ku.current.includes(X)||(R[X]=xe);return R});for(const p of Da.current)si(p)||ae({type:"fs.read",workspaceId:q,path:p.path})}},[Rs,q,Zt,ae]);const gc=(K==null?void 0:K.cwd)??(De==null?void 0:De.cwd)??null,Ga=(De==null?void 0:De.models)??[],na=(K==null?void 0:K.model)??(De==null?void 0:De.model)??null,{rows:wr,selected:kr}=E_(Ga,na),sa=fl?{model:fl.model,effort:fl.effort,ultracode:fl.ultracode,thinking:fl.thinking,switchOnFlag:fl.switchModelsOnFlag}:{model:fi.model??na,effort:fi.effort??(K==null?void 0:K.effort)??null,ultracode:fi.ultracode??(K==null?void 0:K.ultracode)??!1,thinking:fi.thinking??(K==null?void 0:K.thinking)??!0,switchOnFlag:fi.switchOnFlag??(K==null?void 0:K.switchModelsOnFlag)??!0},To=E_(Ga,sa.model),Ya=(fl==null?void 0:fl.state)==="running",xc=lr?dl.find(p=>p.path===lr)??null:null,la=new Set(dl.filter(si).map(p=>p.path)),Xa=p=>a.jsx(rE,{pane:p,width:Dn.widths[p],onResize:R=>Dn.setWidth(p,R),onReset:()=>Dn.reset(p)}),aa=p=>ut?null:()=>Nf(p),ia=(K==null?void 0:K.provider)==="antigravity"?zv:G_,Ul=De&&a.jsx(Yl,{title:"Режим прав",value:(K==null?void 0:K.permissionMode)??"default",options:ia.map(p=>({value:p.value,label:p.value,hint:p.hint})),onChange:p=>{te&&ae({type:"control.set_mode",sessionId:te,mode:p})}}),Ei=wr.length>0?a.jsx(Dy,{models:wr,value:kr,effort:(K==null?void 0:K.effort)??null,ultracode:(K==null?void 0:K.ultracode)??!1,thinking:(K==null?void 0:K.thinking)??!0,switchOnFlag:(K==null?void 0:K.switchModelsOnFlag)??!0,showSwitchOnFlag:(K==null?void 0:K.provider)!=="antigravity",onModel:p=>{!te||!p||ae({type:"control.set_model",sessionId:te,model:p})},onEffort:p=>{te&&ae({type:"control.set_effort",sessionId:te,effort:p})},onUltracode:p=>{te&&ae({type:"control.set_ultracode",sessionId:te,enabled:p})},onThinking:p=>{te&&ae({type:"control.set_thinking",sessionId:te,enabled:p})},onSwitchOnFlag:p=>{te&&ae({type:"control.set_flag_switch",sessionId:te,enabled:p})}}):na&&a.jsx("span",{className:"badge",children:na}),Co=Rs&&a.jsx("span",{className:jr?"badge badge--wait":"badge badge--live",children:jr?"ждёт":Jn?"переподключается":"работает"}),Ao=(K==null?void 0:K.state)==="closed"&&a.jsx("span",{className:"badge",title:"Разговор сохранён — сессия поднимется заново, как только вы отправите сообщение",children:"остановлена"}),Ti=Co||Ao,Ci=()=>{te&&ae({type:"session.reconnect",sessionId:te})},$u=Jn?"Сессия уже поднимает новый процесс":Rs?"Недоступно, пока идёт ход":"Поднять сессии новый процесс — разговор сохранён",qu=te&&(Jn||(K==null?void 0:K.state)==="error")?a.jsxs("div",{className:Jn?"relink":"relink relink--error",role:"status",children:[a.jsxs("span",{className:"relink__msg",children:[a.jsx("span",{className:"relink__dot","aria-hidden":"true"}),Jn?"Связь оборвалась. Сессия поднимает новый процесс — разговор сохранён.":"Переподключиться не удалось. Разговор сохранён — сессия продолжит с этого места."]}),a.jsx("button",{className:"btn btn--sm",title:Jn?"Не ждать паузы между попытками — попробовать сейчас":"Поднять сессии новый процесс и продолжить разговор",onClick:Ci,children:Jn?"Переподключить сейчас":"Переподключить"})]}):null,bs=Xn?fc(Xn.sessionId,Xn.workspaceId,Xn.limit!==null):null,bc=Xn&&(bs!=null&&bs.canChoose)?{targets:bs.targets,selectedId:bs.selectedId,sourceId:bs.sourceId,onSelect:p=>sn(R=>({...R,[Xn.sessionId]:p}))}:null,sl=K&&K.state!=="closed"&&K.provider!=="antigravity"&&ml?fc(ml,K.workspaceId,!1):null,Ai=sl!=null&&sl.canChoose&&ml?p=>sn(R=>({...R,[ml]:p})):null,Mo=Xn?a.jsx(JS,{handoff:Xn,sourceAccount:(bs==null?void 0:bs.source)??null,accountChoice:bc,onContinue:()=>dc(Xn),onShow:()=>cl(Xn),onDismiss:()=>hc(Xn.sessionId)}):null,rs=K&&K.totalCostUsd>0?`$${K.totalCostUsd.toFixed(3)}`:null,Ds=(K==null?void 0:K.provider)!=="antigravity"&&a.jsx("button",{className:Ra?"pane-btn is-on":"pane-btn",title:"Вопрос на полях — спросить, не мешая работе","aria-label":"Вопрос на полях","aria-pressed":Ra,onClick:()=>ec(p=>!p),children:a.jsx(LE,{})}),ra=K&&K.state!=="closed"&&a.jsx("button",{type:"button",className:"pane-btn pane-btn--stop",title:"Остановить сессию — освобождает память хоста, разговор остаётся на диске","aria-label":"Остановить сессию",onClick:()=>xr(K),children:a.jsx(ME,{})}),bl=K?ws[K.id]===!0:!1,_c=Q_({onLongPress:()=>{K&&As(K)},onClick:()=>{K&&Ba(K)},disabled:bl}),ca=K&&K.state!=="closed"&&K.provider!=="antigravity"&&a.jsxs("button",{type:"button",className:bl?"pane-btn pane-btn--handoff is-busy":_c.holding?"pane-btn pane-btn--handoff is-holding":"pane-btn pane-btn--handoff",style:{"--hold-ms":`${_c.thresholdMs}ms`},title:bl?"Пишется хэндофф…":"Клик — хэндофф и новая сессия: агент запишет сводку, сессия остановится, работа продолжится в новой. Зажать (или Shift+клик) — новая пустая сессия без хэндоффа: закрепление переходит, старая сессия продолжает работать.","aria-label":"Хэндофф и новая сессия","aria-busy":bl,disabled:bl,..._c.handlers,children:[a.jsx("span",{className:"pane-btn__hold","aria-hidden":"true"}),a.jsx(RE,{})]});return a.jsx(Bp.Provider,{value:La,children:a.jsxs("div",{className:"app",style:Dn.style,children:[a.jsx(IN,{open:We,connected:l,status:c,workspaces:T,archivedWorkspaces:A,workspaceFolders:F,sessionFolders:I,pinnedFolders:G,projectSessions:B,onRequestSessions:p=>ae({type:"session.list",workspaceId:p}),pinned:me,live:ve,listOrder:k,liveSessionsFirst:(_t==null?void 0:_t.liveSessionsFirst)===!0,onReorder:Al,activeWorkspaceId:q,activeSessionId:te,onPinSessions:Sf,onSelectPinned:Mu,onCloseWorkspaces:Is,onRestoreWorkspaces:xo,onArchiveSessions:bi,onUnarchiveSessions:(p,R)=>{ae({type:"session.unarchive",workspaceId:p,sessionIds:R})},onCreateFolder:ic,onRenameFolder:rc,onSetFolderColor:bo,onDeleteFolder:za,onAssignToFolder:Au,onSelectWorkspace:Pl,onRenameSession:yi,onStopSession:xr,onOpenWorkspace:()=>Pe(!0),onNewSession:cc,enabledProviders:qn,lastAccountId:po(vn),onSignInAccount:nl,onOpenExtensions:te&&(K==null?void 0:K.provider)!=="antigravity"?()=>Ms("mcp"):null,account:ss[Ki]??null,onOpenAccount:Ml,relay:d,onOpenRelay:v?null:()=>j(!0),onOpenSettings:Ru,themeMode:Ql,onCycleTheme:ci}),Xa("sidebar"),We&&a.jsx("div",{className:"scrim",onClick:()=>at(!1)}),a.jsx(J1,{open:Zt,tree:wn,expanded:new Set(Ea),activePath:lr,dirty:la,gitChanges:(qt==null?void 0:qt.changed)??[],result:Ta,searchResult:ar,onSearch:$a,onReveal:ji,onToggle:No,onOpen:Ni,onCreate:Cf,onRename:En,onMove:So,onCopy:_r,onDelete:Vr,onRefresh:()=>{el(null),Sa({}),Gt()},onClose:()=>Yn(!1),zoomed:rn==="files",onToggleZoom:aa("files")}),Zt&&rn!=="files"&&Xa("files"),a.jsx(rN,{open:El,result:_f,onSearch:Dl,onOpenMatch:ko,onClose:()=>rr(!1),zoomed:rn==="search",onToggleZoom:aa("search")}),El&&rn!=="search"&&Xa("search"),a.jsx(kk,{open:is,state:qt,result:Ee,selected:ee,busy:an,onRefresh:Gt,onShow:ht,onCheckout:Rl,onPush:vo,onPull:ea,onPublish:Ou,onConnectRemote:Ia,onDismissResult:()=>Le(null),onClose:()=>Hs(!1),zoomed:rn==="git",onToggleZoom:aa("git")}),is&&rn!=="git"&&Xa("git"),a.jsxs("main",{className:(rn==="main"||rn==="terminal"?"main main--zoomed":"main")+(Bs?` main--acct acct--${Bs.color}`:""),children:[m&&x&&a.jsx(PS,{state:m}),a.jsxs("header",{className:"topbar",children:[a.jsx("button",{className:"btn btn--ghost menu-btn",onClick:()=>at(!0),children:"☰"}),a.jsx("button",{className:Zt?"pane-btn is-on":"pane-btn",title:"Файлы проекта","aria-label":"Файлы проекта","aria-pressed":Zt,onClick:()=>{Yn(p=>!p),Hs(!1),rr(!1)},children:a.jsx(TE,{})}),a.jsx("button",{className:El?"pane-btn is-on":"pane-btn",title:"Поиск по тексту в проекте","aria-label":"Поиск по тексту в проекте","aria-pressed":El,onClick:()=>{rr(p=>!p),Yn(!1),Hs(!1)},children:a.jsx(CE,{})}),a.jsx("button",{className:is?"pane-btn is-on":"pane-btn",title:"История git","aria-label":"История git","aria-pressed":is,onClick:()=>{Hs(p=>!p),Yn(!1),rr(!1)},children:a.jsx(AE,{})}),Ma&&a.jsx("button",{className:di?"pane-btn is-on":"pane-btn",title:"Терминал (Ctrl+`)","aria-label":"Терминал","aria-pressed":di,onClick:()=>ao(p=>!p),children:a.jsx(OE,{})}),ut&&Ds,ut&&a.jsx("button",{className:$t?"pane-btn is-on":"pane-btn",title:"Ещё","aria-label":"Ещё","aria-haspopup":"menu","aria-pressed":$t,onClick:()=>wt(!0),children:a.jsx(zE,{})}),a.jsxs("div",{className:"topbar__id",children:[ct&&K?a.jsx(ja,{className:"rename--title",value:K.title??"",onCommit:p=>{yi(K,p),jt(!1)},onCancel:()=>jt(!1)}):a.jsxs("div",{className:"topbar__head",children:[ut&&Bs&&a.jsx(wa,{account:Bs}),a.jsx("button",{className:"topbar__title",disabled:!K||ut,title:K&&!ut?"Переименовать сессию":void 0,onClick:()=>jt(!0),children:(K==null?void 0:K.title)??"Claude Code Visual"}),xi&&a.jsx("span",{className:"topbar__project",title:xi.path,children:xi.name})]}),ut?Ti:gc&&a.jsx(Ry,{path:gc})]}),!ut&&a.jsxs("div",{className:"topbar__tools",children:[a.jsx("button",{type:"button",className:Es?"meters-refresh is-busy":"meters-refresh",title:wf,"aria-label":mo,"aria-busy":Es,disabled:!te||Es,onClick:mi,children:a.jsx(UE,{})}),Bs&&a.jsx(Wx,{account:Bs,onClick:Ml}),a.jsx(Ly,{usage:Oa}),a.jsx(Hy,{}),Ul,Ei,Ti,rs&&a.jsx("span",{className:"badge badge--cost",children:rs}),ca,sl&&Ai&&!bl&&a.jsx(Iy,{variant:"mark",targets:sl.targets,selectedId:sl.selectedId,sourceId:sl.sourceId,onSelect:Ai}),ra,Ds]})]}),a.jsx(_E,{tokens:(jn==null?void 0:jn.tokens)??He.contextTokens,maxTokens:(jn==null?void 0:jn.maxTokens)??null,fetchedAt:(jn==null?void 0:jn.fetchedAt)??null}),ut&&$t&&a.jsx(lS,{onClose:()=>wt(!1),permission:Ul,model:Ei,account:Bs&&a.jsx(Wx,{account:Bs}),usage:Oa,cwd:gc,costLabel:rs,onRefresh:mi,refreshing:Es,metersFetchedAt:Wl,onRename:K?()=>{jt(!0),wt(!1)}:null,onHandoff:K&&K.state!=="closed"&&K.provider!=="antigravity"?()=>{Ba(K),wt(!1)}:null,onFreshSession:K&&K.state!=="closed"&&K.provider!=="antigravity"?()=>{As(K),wt(!1)}:null,handoffWriting:bl,handoffAccount:sl&&Ai&&!bl?a.jsx(ZS,{targets:sl.targets,selectedId:sl.selectedId,onSelect:Ai}):null,onStop:K&&K.state!=="closed"?()=>{xr(K),wt(!1)}:null}),dl.length>0&&a.jsx(SN,{files:dl,activePath:lr,busy:Rs,onSelect:kn,onClose:p=>zl(p),zoomed:rn==="main",onToggleZoom:aa("main")}),xc?a.jsx(wN,{file:xc,goto:(Kr==null?void 0:Kr.path)===xc.path?Kr:null,onChange:(p,R)=>{xs(X=>X.map(xe=>xe.path===p?{...xe,text:R}:xe)),Tf(p)},onSave:p=>Sn(p),onReload:pc,onOverwrite:p=>Sn(p,!0),onRequestMedia:zu,onTogglePreview:p=>xs(R=>R.map(X=>X.path===p?{...X,previewMode:!X.previewMode}:X))}):a.jsxs(a.Fragment,{children:[a.jsx(lm,{items:He.items,busy:Rs&&!Jn,waiting:jr,empty:(K==null?void 0:K.provider)==="antigravity"?"Сессия пуста. Опишите задачу — Antigravity работает в каталоге проекта.":void 0,history:gr,historyHasMore:eb(Ve),historyLoading:Ve.loading,onLoadHistory:ho,sessionId:te??void 0,onEditMessage:(K==null?void 0:K.provider)==="antigravity"?void 0:(p,R,X)=>{if(!te||x)return!1;const xe=te;return oc(()=>ae({type:"prompt.edit",sessionId:xe,userIndex:p,text:R,images:X}))}}),qu,Mo,te&&((on=K==null?void 0:K.tasks)!=null&&on.length)?a.jsx(MN,{tasks:K.tasks,onStop:p=>ae({type:"task.stop",sessionId:te,taskId:p})}):null,Ht&&ta&&xl&&a.jsx(ak,{kind:ta,toolName:Ht.toolName,queued:He.pending.length-1,onExpand:()=>Nr(Ht.requestId,!1)}),a.jsx(Cy,{disabled:!te,busy:Rs&&!Jn,sendBlocked:x,placeholder:Jn?"Промпт уйдёт, как только связь вернётся":(K==null?void 0:K.state)==="closed"?"Остановлена — отправьте сообщение, чтобы продолжить":void 0,commands:mc,sessionTitle:(K==null?void 0:K.title)??null,contextResult:Ll,draftKey:te,onContextSearch:p=>Ol("mention",p),onCommand:vr,onSend:Ua,onInterrupt:()=>{te&&ae({type:"control.interrupt",sessionId:te})}})]}),di&&Ma&&a.jsxs(a.Fragment,{children:[!ut&&rn!=="terminal"&&a.jsx(oE,{height:Wr.height,onResize:Wr.setHeight,onReset:Wr.reset}),a.jsx(hE,{mobile:ut,zoomed:rn==="terminal",onToggleZoom:aa("terminal"),terminals:Fr,activeId:yf,blocked:Pr,error:vf,onDismissError:()=>cr(null),height:ut?io.height:Wr.height,offset:ut?{top:io.offsetTop,left:io.offsetLeft}:void 0,onSelect:Jr,onOpen:wi,onClose:ki,onInput:(p,R)=>ae({type:"term.input",id:p,data:R}),onResize:(p,R,X)=>ae({type:"term.resize",id:p,cols:R,rows:X}),onAttach:p=>ae({type:"term.attach",id:p}),onHide:()=>ao(!1),registerSink:jf})]})]}),a.jsx(Kk,{open:Ra,items:Nu.items,busy:Ya,ready:te!==null,sendBlocked:x,commands:mc,contextResult:wo,draftKey:te,models:To.rows,model:To.selected,effort:sa.effort,ultracode:sa.ultracode,thinking:sa.thinking,switchOnFlag:sa.switchOnFlag,onContextSearch:p=>Ol("side",p),onCommand:vr,onModel:p=>{p&&(Zl(R=>({...R,model:p})),gn(R=>ae({type:"control.set_model",sessionId:R,model:p})))},onEffort:p=>{Zl(R=>({...R,effort:p,ultracode:!1})),gn(R=>ae({type:"control.set_effort",sessionId:R,effort:p}))},onUltracode:p=>{Zl(R=>({...R,ultracode:p,...p?{effort:"xhigh"}:{}})),gn(R=>ae({type:"control.set_ultracode",sessionId:R,enabled:p}))},onThinking:p=>{Zl(R=>({...R,thinking:p})),gn(R=>ae({type:"control.set_thinking",sessionId:R,enabled:p}))},onSwitchOnFlag:p=>{Zl(R=>({...R,switchOnFlag:p})),gn(R=>ae({type:"control.set_flag_switch",sessionId:R,enabled:p}))},onAsk:yo,onInterrupt:()=>{tc&&ae({type:"control.interrupt",sessionId:tc})},onReset:Du,onClose:()=>ec(!1),zoomed:rn==="ask",onToggleZoom:aa("ask")}),Ra&&rn!=="ask"&&Xa("ask"),(is||Ra||Zt||El)&&a.jsx("div",{className:"scrim scrim--pane",onClick:()=>{Hs(!1),ec(!1),Yn(!1),rr(!1)}}),Ne&&a.jsx(Ck,{detail:Ne,local:((qt==null?void 0:qt.hasRemote)??!1)&&(qt==null?void 0:qt.commits.some(p=>p.hash===Ne.hash&&!p.pushed))===!0,onCheckout:Rl,onClose:()=>{S(null),ge(null)}}),he&&a.jsxs(vs,{title:"Лимит плана почти исчерпан",onClose:()=>uc(!1),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",autoFocus:!0,onClick:()=>uc(!1),children:"Отмена"}),a.jsx("button",{className:"btn btn--primary",onClick:()=>uc(!0),children:"Отправить всё равно"})]}),children:[a.jsxs("p",{className:"modal__text",children:[uf[he.warning.limit][0].toUpperCase(),uf[he.warning.limit].slice(1)," использован на"," ",Math.round(he.warning.utilization)," %, сброс в"," ",aE(he.warning.resetsAt),". Сообщение может оборваться на полуслове, когда лимит дойдёт до 100 %."]}),a.jsx("p",{className:"modal__text modal__text--dim",children:"До сброса сессию повторно останавливать не будем."})]}),Y&&a.jsx(vs,{title:"Остановить сессию?",onClose:()=>W(null),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>W(null),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",onClick:()=>{ae({type:"session.close",sessionId:Y.id}),W(null)},children:"Остановить"})]}),children:a.jsx("p",{className:"modal__text",children:"Сессия сейчас работает — остановка прервёт текущий ход. Разговор останется на диске: открыть сессию заново или просто написать в неё снова можно в любой момент."})}),Oe&&a.jsxs(vs,{title:"Переключить рабочее дерево?",onClose:()=>Ct(null),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>Ct(null),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",onClick:Gs,children:"Переключиться"})]}),children:[a.jsxs("p",{className:"modal__text",children:["git переключится на ",Oe.label,". Файлы в каталоге проекта изменятся — это тот же каталог, в котором работает агент."]}),Rs&&a.jsx("p",{className:"modal__text",children:"Сейчас идёт ход агента: он читает и правит файлы прямо сейчас."}),qt&&qt.changed.length>0&&a.jsxs("p",{className:"modal__text",children:["Незакоммиченных изменений: ",qt.changed.length,". Git откажется переключаться, если они будут затёрты."]})]}),kl&&a.jsx(qk,{status:Ut,owners:mn,files:oe,defaultName:(xi==null?void 0:xi.name)??"",hasCommits:qt===null||qt.head!=="",busy:an,result:Ee,onRefreshStatus:br,onSaveToken:jo,onPublish:Lu,onDismissResult:()=>Le(null),onClose:()=>E(!1)}),Qe&&a.jsx(Qk,{busy:an,result:Ee,onSubmit:vi,onDismissResult:()=>Le(null),onClose:()=>ot(!1)}),Sl&&a.jsx(vs,{title:Sl.kind==="dir"?"Удалить каталог?":"Удалить файл?",onClose:()=>Vr(null),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>Vr(null),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",onClick:()=>yr(Sl),children:"Удалить"})]}),children:a.jsxs("p",{className:"modal__text",children:[Sl.path," будет удалён с диска",Sl.kind==="dir"?" вместе со всем содержимым":"",". Корзины здесь нет: это тот же каталог, в котором работает агент."]})}),Ca&&a.jsx(vs,{title:"Закрыть без сохранения?",onClose:()=>oi(null),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>oi(null),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",onClick:()=>zl(Ca,!0),children:"Закрыть"}),a.jsx("button",{className:"btn btn--primary",onClick:()=>{Sn(Ca),zl(Ca,!0)},children:"Сохранить и закрыть"})]}),children:a.jsxs("p",{className:"modal__text",children:["В ",Ca," есть несохранённые правки."]})}),zt&&a.jsx(iS,{tab:zt,servers:re,plugins:Xe,marketplaces:Je,catalog:Z,result:Me,auth:Dt,remote:v,actions:$s,onTab:Tt,onClose:()=>Tt(null)}),ol&&a.jsx(mS,{accounts:Mn,auth:ss,logins:Zn,candidates:gs,actions:gl,onOpenLogin:nl,activeAccountId:(Bs==null?void 0:Bs.id)??null,error:Ss,onReconnect:te?()=>{Ci(),Js(!1)}:null,reconnectBlocked:Rs,reconnectHint:$u,onClose:()=>Js(!1)}),y&&a.jsx(ES,{state:d,onPair:(p,R)=>ae({type:"relay.pair",code:p,...R?{name:R}:{}}),onUnpair:()=>ae({type:"relay.unpair"}),onClose:()=>j(!1)}),Ws&&a.jsx(KS,{settings:_t,models:(De==null?void 0:De.models)??[],relayState:d,networkState:m,local:Vd()==="local",onChange:_o,onEnableShell:()=>ae({type:"relay.shell.enable"}),onDisableShell:()=>ae({type:"relay.shell.disable"}),onOpenRelay:()=>{as(!1),j(!0)},claudeLogin:{accounts:Mn,auth:ss,logins:Zn,actions:qs,remote:v,runningByAccount:Eu,focusAccountId:tt},onClose:()=>{as(!1),Kn(null)}}),Ce&&a.jsx(pk,{candidates:Rt,searching:Fe,agentItems:ts.items,agentBusy:(kt==null?void 0:kt.state)==="running",error:hn,roots:ps,created:Ft,onSearch:Cu,onAskAgent:go,onInterrupt:()=>{const p=hr.current;p&&ae({type:"control.interrupt",sessionId:p})},onSubmit:kf,onCreate:Tu,onClose:tl}),Ht!=null&&Ht.questions&&Ht.questions.length>0?a.jsx(rk,{request:{...Ht,questions:Ht.questions},queued:He.pending.length-1,collapsed:xl,onCollapse:()=>Nr(Ht.requestId,!0),onAnswer:Uu,onDecline:Mf}):Ht&&Si!==null?a.jsx(sk,{request:Ht,plan:Si,queued:He.pending.length-1,collapsed:xl,onCollapse:()=>Nr(Ht.requestId,!0),onAccept:Hu,onDecline:qa}):Ht&&a.jsx(ik,{request:Ht,queued:He.pending.length-1,collapsed:xl,onCollapse:()=>Nr(Ht.requestId,!0),onDecide:Af}),yn&&a.jsx(WS,{handoff:yn,onClose:()=>cl(null)}),a.jsx(nE,{notices:et,onDismiss:p=>$n(R=>R.filter(X=>X.id!==p))})]})})}function TE(){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:"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 CE(){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 AE(){return a.jsxs("svg",{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 ME(){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 RE(){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 DE(n,l){return T_(n)===T_(l)}function T_(n){return n.replace(/[\\/]+/g,"/").replace(/\/+$/,"").toLowerCase()}function OE(){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.6",y:"2.6",width:"12.8",height:"10.8",rx:"1.7"}),a.jsx("path",{d:"M4.3 6 6.6 8l-2.3 2"}),a.jsx("path",{d:"M8.2 10h3.1"})]})}function LE(){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"})]})}function zE(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:[a.jsx("circle",{cx:"3.2",cy:"8",r:"1.5"}),a.jsx("circle",{cx:"8",cy:"8",r:"1.5"}),a.jsx("circle",{cx:"12.8",cy:"8",r:"1.5"})]})}function UE(){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 qy=document.getElementById("root");if(!qy)throw new Error("#root not found");ov.createRoot(qy).render(a.jsx(b.StrictMode,{children:a.jsx(EE,{})}));export{m1 as D,Wt as I,en as N,IE as P,jl as T,Xl as a,ry as b,Zs as c,BE as d,fy as e,xu as f,O1 as h,$E as p,qE as s,Re as t};
|