@i14ks/ccv 0.24.1 → 0.25.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/README.md +2 -10
- package/bundle/ccv.mjs +139 -1033
- package/package.json +50 -53
- package/web/assets/{codemirror-CVe_WI3e.js → codemirror-BdKpW4CC.js} +1 -1
- package/web/assets/{index-EFEGjfDS.js → index-B2BGvdag.js} +1 -1
- package/web/assets/index-BCLbqlhA.js +134 -0
- package/web/assets/{index-COgGuYuk.js → index-BrkwvvWk.js} +1 -1
- package/web/assets/{index-BvJsiicf.js → index-BroMLvyS.js} +1 -1
- package/web/assets/{index-zhxDV4zv.js → index-C59b0_Vk.js} +1 -1
- package/web/assets/{index--b7aPip2.css → index-C6Y6TadO.css} +1 -1
- package/web/assets/{index-CaQnLaP1.js → index-CRsndRFc.js} +1 -1
- package/web/assets/{index-dESUNfha.js → index-CWTFMuFd.js} +1 -1
- package/web/assets/{index-BENS1Et2.js → index-CZuUjzhP.js} +1 -1
- package/web/assets/{index-DaeDM5ye.js → index-ChyP1fTD.js} +1 -1
- package/web/assets/{index-DVlOSKL1.js → index-D6DYiY6f.js} +1 -1
- package/web/assets/{index-BVTKBCk1.js → index-D83he8x-.js} +1 -1
- package/web/assets/{index-CQpgnjUL.js → index-DPrfFlZq.js} +1 -1
- package/web/assets/{index-ChH2BaGk.js → index-DXHZO0ym.js} +1 -1
- package/web/assets/{index-BTat2cjy.js → index-Dd7rh20x.js} +1 -1
- package/web/assets/{index-Bt4DUbpM.js → index-DqnCWDLh.js} +1 -1
- package/web/assets/{index-ClcgV2Ok.js → index-Si6no75_.js} +1 -1
- package/web/assets/{index-BS_AsIEi.js → index-UxKgaDrj.js} +1 -1
- package/web/assets/{index-CdS9TWKz.js → index-YCUybqa_.js} +1 -1
- package/web/assets/{index-BnDGCTVR.js → index-wsSNo9PM.js} +1 -1
- package/web/assets/{index-D3s6YlZz.js → index-yXtesgZ4.js} +1 -1
- package/web/index.html +2 -2
- package/web/assets/index-BfpRxrlX.js +0 -136
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-CZuUjzhP.js","./index-D6DYiY6f.js","./index-wsSNo9PM.js","./index-BHot-lnj.js","./index-891wE-Rj.js","./index-Dd7rh20x.js","./index-UxKgaDrj.js","./index-DXHZO0ym.js","./index-DPrfFlZq.js","./index-B2BGvdag.js","./index-Si6no75_.js","./index-BrkwvvWk.js","./index-ChyP1fTD.js","./index-CRsndRFc.js","./index-D83he8x-.js","./index-C59b0_Vk.js","./index-CWTFMuFd.js","./index-BroMLvyS.js","./index-YCUybqa_.js","./index-yXtesgZ4.js","./index-DqnCWDLh.js","./codemirror-BdKpW4CC.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 b0=Object.defineProperty;var wx=l=>{throw TypeError(l)};var _0=(l,s,r)=>s in l?b0(l,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):l[s]=r;var Xt=(l,s,r)=>_0(l,typeof s!="symbol"?s+"":s,r),Rh=(l,s,r)=>s.has(l)||wx("Cannot "+r);var Xe=(l,s,r)=>(Rh(l,s,"read from private field"),r?r.call(l):s.get(l)),_n=(l,s,r)=>s.has(l)?wx("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(l):s.set(l,r),Et=(l,s,r,c)=>(Rh(l,s,"write to private field"),c?c.call(l,r):s.set(l,r),r),qn=(l,s,r)=>(Rh(l,s,"access private method"),r);(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))c(o);new MutationObserver(o=>{for(const 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 Dh={exports:{}},$o={};/**
|
|
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 Sx;function y0(){if(Sx)return $o;Sx=1;var l=Symbol.for("react.transitional.element"),s=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:l,type:c,key:h,ref:o!==void 0?o:null,props:d}}return $o.Fragment=s,$o.jsx=r,$o.jsxs=r,$o}var Nx;function v0(){return Nx||(Nx=1,Dh.exports=y0()),Dh.exports}var a=v0(),Oh={exports:{}},Je={};/**
|
|
11
|
+
* @license React
|
|
12
|
+
* react.production.js
|
|
13
|
+
*
|
|
14
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
15
|
+
*
|
|
16
|
+
* This source code is licensed under the MIT license found in the
|
|
17
|
+
* LICENSE file in the root directory of this source tree.
|
|
18
|
+
*/var kx;function j0(){if(kx)return Je;kx=1;var l=Symbol.for("react.transitional.element"),s=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 E(w){return w===null||typeof w!="object"?null:(w=v&&w[v]||w["@@iterator"],typeof w=="function"?w:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,A={};function G(w,V,z){this.props=w,this.context=V,this.refs=A,this.updater=z||k}G.prototype.isReactComponent={},G.prototype.setState=function(w,V){if(typeof w!="object"&&typeof w!="function"&&w!=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,w,V,"setState")},G.prototype.forceUpdate=function(w){this.updater.enqueueForceUpdate(this,w,"forceUpdate")};function Z(){}Z.prototype=G.prototype;function Y(w,V,z){this.props=w,this.context=V,this.refs=A,this.updater=z||k}var H=Y.prototype=new Z;H.constructor=Y,C(H,G.prototype),H.isPureReactComponent=!0;var $=Array.isArray;function B(){}var D={H:null,A:null,T:null,S:null},R=Object.prototype.hasOwnProperty;function O(w,V,z){var ge=z.ref;return{$$typeof:l,type:w,key:V,ref:ge!==void 0?ge:null,props:z}}function ee(w,V){return O(w.type,V,w.props)}function P(w){return typeof w=="object"&&w!==null&&w.$$typeof===l}function ae(w){var V={"=":"=0",":":"=2"};return"$"+w.replace(/[=:]/g,function(z){return V[z]})}var be=/\/+/g;function Ee(w,V){return typeof w=="object"&&w!==null&&w.key!=null?ae(""+w.key):V.toString(36)}function je(w){switch(w.status){case"fulfilled":return w.value;case"rejected":throw w.reason;default:switch(typeof w.status=="string"?w.then(B,B):(w.status="pending",w.then(function(V){w.status==="pending"&&(w.status="fulfilled",w.value=V)},function(V){w.status==="pending"&&(w.status="rejected",w.reason=V)})),w.status){case"fulfilled":return w.value;case"rejected":throw w.reason}}throw w}function X(w,V,z,ge,ve){var Re=typeof w;(Re==="undefined"||Re==="boolean")&&(w=null);var Oe=!1;if(w===null)Oe=!0;else switch(Re){case"bigint":case"string":case"number":Oe=!0;break;case"object":switch(w.$$typeof){case l:case s:Oe=!0;break;case y:return Oe=w._init,X(Oe(w._payload),V,z,ge,ve)}}if(Oe)return ve=ve(w),Oe=ge===""?"."+Ee(w,0):ge,$(ve)?(z="",Oe!=null&&(z=Oe.replace(be,"$&/")+"/"),X(ve,V,z,"",function(rn){return rn})):ve!=null&&(P(ve)&&(ve=ee(ve,z+(ve.key==null||w&&w.key===ve.key?"":(""+ve.key).replace(be,"$&/")+"/")+Oe)),V.push(ve)),1;Oe=0;var Ue=ge===""?".":ge+":";if($(w))for(var qe=0;qe<w.length;qe++)ge=w[qe],Re=Ue+Ee(ge,qe),Oe+=X(ge,V,z,Re,ve);else if(qe=E(w),typeof qe=="function")for(w=qe.call(w),qe=0;!(ge=w.next()).done;)ge=ge.value,Re=Ue+Ee(ge,qe++),Oe+=X(ge,V,z,Re,ve);else if(Re==="object"){if(typeof w.then=="function")return X(je(w),V,z,ge,ve);throw V=String(w),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(w).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.")}return Oe}function ue(w,V,z){if(w==null)return w;var ge=[],ve=0;return X(w,ge,"","",function(Re){return V.call(z,Re,ve++)}),ge}function de(w){if(w._status===-1){var V=w._result;V=V(),V.then(function(z){(w._status===0||w._status===-1)&&(w._status=1,w._result=z)},function(z){(w._status===0||w._status===-1)&&(w._status=2,w._result=z)}),w._status===-1&&(w._status=0,w._result=V)}if(w._status===1)return w._result.default;throw w._result}var _e=typeof reportError=="function"?reportError:function(w){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var V=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof w=="object"&&w!==null&&typeof w.message=="string"?String(w.message):String(w),error:w});if(!window.dispatchEvent(V))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",w);return}console.error(w)},Ae={map:ue,forEach:function(w,V,z){ue(w,function(){V.apply(this,arguments)},z)},count:function(w){var V=0;return ue(w,function(){V++}),V},toArray:function(w){return ue(w,function(V){return V})||[]},only:function(w){if(!P(w))throw Error("React.Children.only expected to receive a single React element child.");return w}};return Je.Activity=j,Je.Children=Ae,Je.Component=G,Je.Fragment=r,Je.Profiler=o,Je.PureComponent=Y,Je.StrictMode=c,Je.Suspense=g,Je.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,Je.__COMPILER_RUNTIME={__proto__:null,c:function(w){return D.H.useMemoCache(w)}},Je.cache=function(w){return function(){return w.apply(null,arguments)}},Je.cacheSignal=function(){return null},Je.cloneElement=function(w,V,z){if(w==null)throw Error("The argument must be a React element, but you passed "+w+".");var ge=C({},w.props),ve=w.key;if(V!=null)for(Re in V.key!==void 0&&(ve=""+V.key),V)!R.call(V,Re)||Re==="key"||Re==="__self"||Re==="__source"||Re==="ref"&&V.ref===void 0||(ge[Re]=V[Re]);var Re=arguments.length-2;if(Re===1)ge.children=z;else if(1<Re){for(var Oe=Array(Re),Ue=0;Ue<Re;Ue++)Oe[Ue]=arguments[Ue+2];ge.children=Oe}return O(w.type,ve,ge)},Je.createContext=function(w){return w={$$typeof:h,_currentValue:w,_currentValue2:w,_threadCount:0,Provider:null,Consumer:null},w.Provider=w,w.Consumer={$$typeof:d,_context:w},w},Je.createElement=function(w,V,z){var ge,ve={},Re=null;if(V!=null)for(ge in V.key!==void 0&&(Re=""+V.key),V)R.call(V,ge)&&ge!=="key"&&ge!=="__self"&&ge!=="__source"&&(ve[ge]=V[ge]);var Oe=arguments.length-2;if(Oe===1)ve.children=z;else if(1<Oe){for(var Ue=Array(Oe),qe=0;qe<Oe;qe++)Ue[qe]=arguments[qe+2];ve.children=Ue}if(w&&w.defaultProps)for(ge in Oe=w.defaultProps,Oe)ve[ge]===void 0&&(ve[ge]=Oe[ge]);return O(w,Re,ve)},Je.createRef=function(){return{current:null}},Je.forwardRef=function(w){return{$$typeof:m,render:w}},Je.isValidElement=P,Je.lazy=function(w){return{$$typeof:y,_payload:{_status:-1,_result:w},_init:de}},Je.memo=function(w,V){return{$$typeof:x,type:w,compare:V===void 0?null:V}},Je.startTransition=function(w){var V=D.T,z={};D.T=z;try{var ge=w(),ve=D.S;ve!==null&&ve(z,ge),typeof ge=="object"&&ge!==null&&typeof ge.then=="function"&&ge.then(B,_e)}catch(Re){_e(Re)}finally{V!==null&&z.types!==null&&(V.types=z.types),D.T=V}},Je.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},Je.use=function(w){return D.H.use(w)},Je.useActionState=function(w,V,z){return D.H.useActionState(w,V,z)},Je.useCallback=function(w,V){return D.H.useCallback(w,V)},Je.useContext=function(w){return D.H.useContext(w)},Je.useDebugValue=function(){},Je.useDeferredValue=function(w,V){return D.H.useDeferredValue(w,V)},Je.useEffect=function(w,V){return D.H.useEffect(w,V)},Je.useEffectEvent=function(w){return D.H.useEffectEvent(w)},Je.useId=function(){return D.H.useId()},Je.useImperativeHandle=function(w,V,z){return D.H.useImperativeHandle(w,V,z)},Je.useInsertionEffect=function(w,V){return D.H.useInsertionEffect(w,V)},Je.useLayoutEffect=function(w,V){return D.H.useLayoutEffect(w,V)},Je.useMemo=function(w,V){return D.H.useMemo(w,V)},Je.useOptimistic=function(w,V){return D.H.useOptimistic(w,V)},Je.useReducer=function(w,V,z){return D.H.useReducer(w,V,z)},Je.useRef=function(w){return D.H.useRef(w)},Je.useState=function(w){return D.H.useState(w)},Je.useSyncExternalStore=function(w,V,z){return D.H.useSyncExternalStore(w,V,z)},Je.useTransition=function(){return D.H.useTransition()},Je.version="19.2.8",Je}var Tx;function yp(){return Tx||(Tx=1,Oh.exports=j0()),Oh.exports}var _=yp(),Lh={exports:{}},Xo={},zh={exports:{}},Uh={};/**
|
|
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 Ex;function w0(){return Ex||(Ex=1,(function(l){function s(X,ue){var de=X.length;X.push(ue);e:for(;0<de;){var _e=de-1>>>1,Ae=X[_e];if(0<o(Ae,ue))X[_e]=ue,X[de]=Ae,de=_e;else break e}}function r(X){return X.length===0?null:X[0]}function c(X){if(X.length===0)return null;var ue=X[0],de=X.pop();if(de!==ue){X[0]=de;e:for(var _e=0,Ae=X.length,w=Ae>>>1;_e<w;){var V=2*(_e+1)-1,z=X[V],ge=V+1,ve=X[ge];if(0>o(z,de))ge<Ae&&0>o(ve,z)?(X[_e]=ve,X[ge]=de,_e=ge):(X[_e]=z,X[V]=de,_e=V);else if(ge<Ae&&0>o(ve,de))X[_e]=ve,X[ge]=de,_e=ge;else break e}}return ue}function o(X,ue){var de=X.sortIndex-ue.sortIndex;return de!==0?de:X.id-ue.id}if(l.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;l.unstable_now=function(){return d.now()}}else{var h=Date,m=h.now();l.unstable_now=function(){return h.now()-m}}var g=[],x=[],y=1,j=null,v=3,E=!1,k=!1,C=!1,A=!1,G=typeof setTimeout=="function"?setTimeout:null,Z=typeof clearTimeout=="function"?clearTimeout:null,Y=typeof setImmediate<"u"?setImmediate:null;function H(X){for(var ue=r(x);ue!==null;){if(ue.callback===null)c(x);else if(ue.startTime<=X)c(x),ue.sortIndex=ue.expirationTime,s(g,ue);else break;ue=r(x)}}function $(X){if(C=!1,H(X),!k)if(r(g)!==null)k=!0,B||(B=!0,ae());else{var ue=r(x);ue!==null&&je($,ue.startTime-X)}}var B=!1,D=-1,R=5,O=-1;function ee(){return A?!0:!(l.unstable_now()-O<R)}function P(){if(A=!1,B){var X=l.unstable_now();O=X;var ue=!0;try{e:{k=!1,C&&(C=!1,Z(D),D=-1),E=!0;var de=v;try{t:{for(H(X),j=r(g);j!==null&&!(j.expirationTime>X&&ee());){var _e=j.callback;if(typeof _e=="function"){j.callback=null,v=j.priorityLevel;var Ae=_e(j.expirationTime<=X);if(X=l.unstable_now(),typeof Ae=="function"){j.callback=Ae,H(X),ue=!0;break t}j===r(g)&&c(g),H(X)}else c(g);j=r(g)}if(j!==null)ue=!0;else{var w=r(x);w!==null&&je($,w.startTime-X),ue=!1}}break e}finally{j=null,v=de,E=!1}ue=void 0}}finally{ue?ae():B=!1}}}var ae;if(typeof Y=="function")ae=function(){Y(P)};else if(typeof MessageChannel<"u"){var be=new MessageChannel,Ee=be.port2;be.port1.onmessage=P,ae=function(){Ee.postMessage(null)}}else ae=function(){G(P,0)};function je(X,ue){D=G(function(){X(l.unstable_now())},ue)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(X){X.callback=null},l.unstable_forceFrameRate=function(X){0>X||125<X?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<X?Math.floor(1e3/X):5},l.unstable_getCurrentPriorityLevel=function(){return v},l.unstable_next=function(X){switch(v){case 1:case 2:case 3:var ue=3;break;default:ue=v}var de=v;v=ue;try{return X()}finally{v=de}},l.unstable_requestPaint=function(){A=!0},l.unstable_runWithPriority=function(X,ue){switch(X){case 1:case 2:case 3:case 4:case 5:break;default:X=3}var de=v;v=X;try{return ue()}finally{v=de}},l.unstable_scheduleCallback=function(X,ue,de){var _e=l.unstable_now();switch(typeof de=="object"&&de!==null?(de=de.delay,de=typeof de=="number"&&0<de?_e+de:_e):de=_e,X){case 1:var Ae=-1;break;case 2:Ae=250;break;case 5:Ae=1073741823;break;case 4:Ae=1e4;break;default:Ae=5e3}return Ae=de+Ae,X={id:y++,callback:ue,priorityLevel:X,startTime:de,expirationTime:Ae,sortIndex:-1},de>_e?(X.sortIndex=de,s(x,X),r(g)===null&&X===r(x)&&(C?(Z(D),D=-1):C=!0,je($,de-_e))):(X.sortIndex=Ae,s(g,X),k||E||(k=!0,B||(B=!0,ae()))),X},l.unstable_shouldYield=ee,l.unstable_wrapCallback=function(X){var ue=v;return function(){var de=v;v=ue;try{return X.apply(this,arguments)}finally{v=de}}}})(Uh)),Uh}var Cx;function S0(){return Cx||(Cx=1,zh.exports=w0()),zh.exports}var Hh={exports:{}},gl={};/**
|
|
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 Ax;function N0(){if(Ax)return gl;Ax=1;var l=yp();function s(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(s(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=l.__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 gl.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,gl.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(s(299));return d(g,x,null,y)},gl.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()}},gl.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))},gl.prefetchDNS=function(g){typeof g=="string"&&c.d.D(g)},gl.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,E=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:E}):y==="script"&&c.d.X(g,{crossOrigin:j,integrity:v,fetchPriority:E,nonce:typeof x.nonce=="string"?x.nonce:void 0})}},gl.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)},gl.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})}},gl.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)},gl.requestFormReset=function(g){c.d.r(g)},gl.unstable_batchedUpdates=function(g,x){return g(x)},gl.useFormState=function(g,x,y){return h.H.useFormState(g,x,y)},gl.useFormStatus=function(){return h.H.useHostTransitionStatus()},gl.version="19.2.8",gl}var Mx;function k0(){if(Mx)return Hh.exports;Mx=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(s){console.error(s)}}return l(),Hh.exports=N0(),Hh.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 Rx;function T0(){if(Rx)return Xo;Rx=1;var l=S0(),s=yp(),r=k0();function c(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function d(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function 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 n=e,i=t;;){var u=n.return;if(u===null)break;var f=u.alternate;if(f===null){if(i=u.return,i!==null){n=i;continue}break}if(u.child===f.child){for(f=u.child;f;){if(f===n)return g(u),e;if(f===i)return g(u),t;f=f.sibling}throw Error(c(188))}if(n.return!==i.return)n=u,i=f;else{for(var b=!1,S=u.child;S;){if(S===n){b=!0,n=u,i=f;break}if(S===i){b=!0,i=u,n=f;break}S=S.sibling}if(!b){for(S=f.child;S;){if(S===n){b=!0,n=f,i=u;break}if(S===i){b=!0,i=f,n=u;break}S=S.sibling}if(!b)throw Error(c(189))}}if(n.alternate!==i)throw Error(c(190))}if(n.tag!==3)throw Error(c(188));return n.stateNode.current===n?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"),E=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),G=Symbol.for("react.profiler"),Z=Symbol.for("react.consumer"),Y=Symbol.for("react.context"),H=Symbol.for("react.forward_ref"),$=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),O=Symbol.for("react.activity"),ee=Symbol.for("react.memo_cache_sentinel"),P=Symbol.iterator;function ae(e){return e===null||typeof e!="object"?null:(e=P&&e[P]||e["@@iterator"],typeof e=="function"?e:null)}var be=Symbol.for("react.client.reference");function Ee(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===be?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case C:return"Fragment";case G:return"Profiler";case A:return"StrictMode";case $:return"Suspense";case B:return"SuspenseList";case O:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case k:return"Portal";case Y:return e.displayName||"Context";case Z:return(e._context.displayName||"Context")+".Consumer";case H:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case D:return t=e.displayName||null,t!==null?t:Ee(e.type)||"Memo";case R:t=e._payload,e=e._init;try{return Ee(e(t))}catch{}}return null}var je=Array.isArray,X=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,de={pending:!1,data:null,method:null,action:null},_e=[],Ae=-1;function w(e){return{current:e}}function V(e){0>Ae||(e.current=_e[Ae],_e[Ae]=null,Ae--)}function z(e,t){Ae++,_e[Ae]=e.current,e.current=t}var ge=w(null),ve=w(null),Re=w(null),Oe=w(null);function Ue(e,t){switch(z(Re,t),z(ve,e),z(ge,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vg(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vg(t),e=Qg(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}V(ge),z(ge,e)}function qe(){V(ge),V(ve),V(Re)}function rn(e){e.memoizedState!==null&&z(Oe,e);var t=ge.current,n=Qg(t,e.type);t!==n&&(z(ve,e),z(ge,n))}function Ve(e){ve.current===e&&(V(ge),V(ve)),Oe.current===e&&(V(Oe),Io._currentValue=de)}var Ft,ut;function ht(e){if(Ft===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Ft=t&&t[1]||"",ut=-1<n.stack.indexOf(`
|
|
43
|
+
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
44
|
+
`+Ft+e+ut}var Ge=!1;function cn(e,t){if(!e||Ge)return"";Ge=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var fe=function(){throw Error()};if(Object.defineProperty(fe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(fe,[])}catch(ne){var W=ne}Reflect.construct(e,[],fe)}else{try{fe.call()}catch(ne){W=ne}e.call(fe.prototype)}}else{try{throw Error()}catch(ne){W=ne}(fe=e())&&typeof fe.catch=="function"&&fe.catch(function(){})}}catch(ne){if(ne&&W&&typeof ne.stack=="string")return[ne.stack,W.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(),b=f[0],S=f[1];if(b&&S){var M=b.split(`
|
|
45
|
+
`),J=S.split(`
|
|
46
|
+
`);for(u=i=0;i<M.length&&!M[i].includes("DetermineComponentFrameRoot");)i++;for(;u<J.length&&!J[u].includes("DetermineComponentFrameRoot");)u++;if(i===M.length||u===J.length)for(i=M.length-1,u=J.length-1;1<=i&&0<=u&&M[i]!==J[u];)u--;for(;1<=i&&0<=u;i--,u--)if(M[i]!==J[u]){if(i!==1||u!==1)do if(i--,u--,0>u||M[i]!==J[u]){var se=`
|
|
47
|
+
`+M[i].replace(" at new "," at ");return e.displayName&&se.includes("<anonymous>")&&(se=se.replace("<anonymous>",e.displayName)),se}while(1<=i&&0<=u);break}}}finally{Ge=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?ht(n):""}function Nn(e,t){switch(e.tag){case 26:case 27:case 5:return ht(e.type);case 16:return ht("Lazy");case 13:return e.child!==t&&t!==null?ht("Suspense Fallback"):ht("Suspense");case 19:return ht("SuspenseList");case 0:case 15:return cn(e.type,!1);case 11:return cn(e.type.render,!1);case 1:return cn(e.type,!0);case 31:return ht("Activity");default:return""}}function st(e){try{var t="",n=null;do t+=Nn(e,n),n=e,e=e.return;while(e);return t}catch(i){return`
|
|
48
|
+
Error generating stack: `+i.message+`
|
|
49
|
+
`+i.stack}}var kn=Object.prototype.hasOwnProperty,Wn=l.unstable_scheduleCallback,on=l.unstable_cancelCallback,el=l.unstable_shouldYield,qt=l.unstable_requestPaint,tt=l.unstable_now,Ot=l.unstable_getCurrentPriorityLevel,Yn=l.unstable_ImmediatePriority,Ct=l.unstable_UserBlockingPriority,nt=l.unstable_NormalPriority,at=l.unstable_LowPriority,pn=l.unstable_IdlePriority,yn=l.log,Zn=l.unstable_setDisableYieldValue,en=null,St=null;function Jt(e){if(typeof yn=="function"&&Zn(e),St&&typeof St.setStrictMode=="function")try{St.setStrictMode(en,e)}catch{}}var Nt=Math.clz32?Math.clz32:me,tl=Math.log,le=Math.LN2;function me(e){return e>>>=0,e===0?32:31-(tl(e)/le|0)|0}var Be=256,Fe=262144,Ie=4194304;function At(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 I(e,t,n){var i=e.pendingLanes;if(i===0)return 0;var u=0,f=e.suspendedLanes,b=e.pingedLanes;e=e.warmLanes;var S=i&134217727;return S!==0?(i=S&~f,i!==0?u=At(i):(b&=S,b!==0?u=At(b):n||(n=S&~e,n!==0&&(u=At(n))))):(S=i&~f,S!==0?u=At(S):b!==0?u=At(b):n||(n=i&~e,n!==0&&(u=At(n)))),u===0?0:t!==0&&t!==u&&(t&f)===0&&(f=u&-u,n=t&-t,f>=n||f===32&&(n&4194048)!==0)?t:u}function oe(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ne(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 Le(){var e=Ie;return Ie<<=1,(Ie&62914560)===0&&(Ie=4194304),e}function kt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Tn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ul(e,t,n,i,u,f){var b=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var S=e.entanglements,M=e.expirationTimes,J=e.hiddenUpdates;for(n=b&~n;0<n;){var se=31-Nt(n),fe=1<<se;S[se]=0,M[se]=-1;var W=J[se];if(W!==null)for(J[se]=null,se=0;se<W.length;se++){var ne=W[se];ne!==null&&(ne.lane&=-536870913)}n&=~fe}i!==0&&yl(e,i,0),f!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=f&~(b&~t))}function yl(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-Nt(t);e.entangledLanes|=t,e.entanglements[i]=e.entanglements[i]|1073741824|n&261930}function ds(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var i=31-Nt(n),u=1<<i;u&t|e[i]&t&&(e[i]|=t),n&=~u}}function Fl(e,t){var n=t&-t;return n=(n&42)!==0?1:Jl(n),(n&(e.suspendedLanes|t))!==0?0:n}function Jl(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 Pl(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Ka(){var e=ue.p;return e!==0?e:(e=window.event,e===void 0?32:gx(e.type))}function fl(e,t){var n=ue.p;try{return ue.p=e,t()}finally{ue.p=n}}var nl=Math.random().toString(36).slice(2),Lt="__reactFiber$"+nl,Ze="__reactProps$"+nl,vn="__reactContainer$"+nl,Vt="__reactEvents$"+nl,vl="__reactListeners$"+nl,Pt="__reactHandles$"+nl,hs="__reactResources$"+nl,Qt="__reactMarker$"+nl;function ps(e){delete e[Lt],delete e[Ze],delete e[Vt],delete e[vl],delete e[Pt]}function xt(e){var t=e[Lt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[vn]||n[Lt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ex(e);e!==null;){if(n=e[Lt])return n;e=ex(e)}return t}e=n,n=e.parentNode}return null}function un(e){if(e=e[Lt]||e[vn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function On(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function pt(e){var t=e[hs];return t||(t=e[hs]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function it(e){e[Qt]=!0}var En=new Set,dl={};function $n(e,t){hl(e,t),hl(e+"Capture",t)}function hl(e,t){for(dl[e]=t,e=0;e<t.length;e++)En.add(t[e])}var Ln=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]*$"),mn={},jl={};function gn(e){return kn.call(jl,e)?!0:kn.call(mn,e)?!1:Ln.test(e)?jl[e]=!0:(mn[e]=!0,!1)}function El(e,t,n){if(gn(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){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,""+n)}}function ll(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function jn(e,t,n,i){if(i===null)e.removeAttribute(n);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+i)}}function Kt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ms(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function aa(e,t,n){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(b){n=""+b,f.call(this,b)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return n},setValue:function(b){n=""+b},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Cn(e){if(!e._valueTracker){var t=ms(e)?"checked":"value";e._valueTracker=aa(e,t,""+e[t])}}function Wl(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),i="";return e&&(i=ms(e)?e.checked?"true":"false":e.value),e=i,e!==n?(t.setValue(e),!0):!1}function Cl(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 es=/[\n"\\]/g;function Xn(e){return e.replace(es,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ia(e,t,n,i,u,f,b,S){e.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.type=b:e.removeAttribute("type"),t!=null?b==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Kt(t)):e.value!==""+Kt(t)&&(e.value=""+Kt(t)):b!=="submit"&&b!=="reset"||e.removeAttribute("value"),t!=null?ts(e,b,Kt(t)):n!=null?ts(e,b,Kt(n)):i!=null&&e.removeAttribute("value"),u==null&&f!=null&&(e.defaultChecked=!!f),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?e.name=""+Kt(S):e.removeAttribute("name")}function gs(e,t,n,i,u,f,b,S){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.type=f),t!=null||n!=null){if(!(f!=="submit"&&f!=="reset"||t!=null)){Cn(e);return}n=n!=null?""+Kt(n):"",t=t!=null?""+Kt(t):n,S||t===e.value||(e.value=t),e.defaultValue=t}i=i??u,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=S?e.checked:!!i,e.defaultChecked=!!i,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(e.name=b),Cn(e)}function ts(e,t,n){t==="number"&&Cl(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Al(e,t,n,i){if(e=e.options,t){t={};for(var u=0;u<n.length;u++)t["$"+n[u]]=!0;for(n=0;n<e.length;n++)u=t.hasOwnProperty("$"+e[n].value),e[n].selected!==u&&(e[n].selected=u),u&&i&&(e[n].defaultSelected=!0)}else{for(n=""+Kt(n),t=null,u=0;u<e.length;u++){if(e[u].value===n){e[u].selected=!0,i&&(e[u].defaultSelected=!0);return}t!==null||e[u].disabled||(t=e[u])}t!==null&&(t.selected=!0)}}function pe(e,t,n){if(t!=null&&(t=""+Kt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Kt(n):""}function T(e,t,n,i){if(t==null){if(i!=null){if(n!=null)throw Error(c(92));if(je(i)){if(1<i.length)throw Error(c(93));i=i[0]}n=i}n==null&&(n=""),t=n}n=Kt(t),e.defaultValue=n,i=e.textContent,i===n&&i!==""&&i!==null&&(e.value=i),Cn(e)}function Q(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var he=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 ye(e,t,n){var i=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?i?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":i?e.setProperty(t,n):typeof n!="number"||n===0||he.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function He(e,t,n){if(t!=null&&typeof t!="object")throw Error(c(62));if(e=e.style,n!=null){for(var i in n)!n.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)&&n[u]!==i&&ye(e,u,i)}else for(var f in t)t.hasOwnProperty(f)&&ye(e,f,t[f])}function we(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 _t=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"]]),zt=/^[\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 tn(e){return zt.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function yt(){}var xn=null;function Mt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var zn=null,sl=null;function Gl(e){var t=un(e);if(t&&(e=t.stateNode)){var n=e[Ze]||null;e:switch(e=t.stateNode,t.type){case"input":if(ia(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+Xn(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var u=i[Ze]||null;if(!u)throw Error(c(90));ia(i,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(t=0;t<n.length;t++)i=n[t],i.form===e.form&&Wl(i)}break e;case"textarea":pe(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Al(e,!!n.multiple,t,!1)}}}var N=!1;function ie(e,t,n){if(N)return e(t,n);N=!0;try{var i=e(t);return i}finally{if(N=!1,(zn!==null||sl!==null)&&(Qu(),zn&&(t=zn,e=sl,sl=zn=null,Gl(t),e)))for(t=0;t<e.length;t++)Gl(e[t])}}function Te(e,t){var n=e.stateNode;if(n===null)return null;var i=n[Ze]||null;if(i===null)return null;n=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(n&&typeof n!="function")throw Error(c(231,t,typeof n));return n}var Ke=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vn=!1;if(Ke)try{var Ms={};Object.defineProperty(Ms,"passive",{get:function(){Vn=!0}}),window.addEventListener("test",Ms,Ms),window.removeEventListener("test",Ms,Ms)}catch{Vn=!1}var Rs=null,Gi=null,ra=null;function $c(){if(ra)return ra;var e,t=Gi,n=t.length,i,u="value"in Rs?Rs.value:Rs.textContent,f=u.length;for(e=0;e<n&&t[e]===u[e];e++);var b=n-e;for(i=1;i<=b&&t[n-i]===u[f-i];i++);return ra=u.slice(e,1<i?1-i:void 0)}function ca(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 Yi(){return!0}function Ds(){return!1}function Un(e){function t(n,i,u,f,b){this._reactName=n,this._targetInst=u,this.type=i,this.nativeEvent=f,this.target=b,this.currentTarget=null;for(var S in e)e.hasOwnProperty(S)&&(n=e[S],this[S]=n?n(f):f[S]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?Yi:Ds,this.isPropagationStopped=Ds,this}return j(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Yi)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Yi)},persist:function(){},isPersistent:Yi}),t}var oa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Za=Un(oa),Os=j({},oa,{view:0,detail:0}),Xc=Un(Os),Er,Fa,ns,Ja=j({},Os,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Dr,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!==ns&&(ns&&e.type==="mousemove"?(Er=e.screenX-ns.screenX,Fa=e.screenY-ns.screenY):Fa=Er=0,ns=e),Er)},movementY:function(e){return"movementY"in e?e.movementY:Fa}}),$i=Un(Ja),Xi=j({},Ja,{dataTransfer:0}),ed=Un(Xi),Cr=j({},Os,{relatedTarget:0}),Vc=Un(Cr),Ar=j({},oa,{animationName:0,elapsedTime:0,pseudoElement:0}),Mr=Un(Ar),Qc=j({},oa,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Vi=Un(Qc),ua=j({},oa,{data:0}),Qi=Un(ua),Kc={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},td={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"},fa={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Rr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=fa[e])?!!t[e]:!1}function Dr(){return Rr}var Or=j({},Os,{key:function(e){if(e.key){var t=Kc[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ca(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?td[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Dr,charCode:function(e){return e.type==="keypress"?ca(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ca(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),ou=Un(Or),Lr=j({},Ja,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ls=Un(Lr),zr=j({},Os,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Dr}),Ki=Un(zr),da=j({},oa,{propertyName:0,elapsedTime:0,pseudoElement:0}),Zi=Un(da),fn=j({},Ja,{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}),Zc=Un(fn),nd=j({},oa,{newState:0,oldState:0}),ld=Un(nd),Fc=[9,13,27,32],Pa=Ke&&"CompositionEvent"in window,dn=null;Ke&&"documentMode"in document&&(dn=document.documentMode);var Fi=Ke&&"TextEvent"in window&&!dn,Wa=Ke&&(!Pa||dn&&8<dn&&11>=dn),Jc=" ",An=!1;function Pc(e,t){switch(e){case"keyup":return Fc.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Wc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var pl=!1;function uu(e,t){switch(e){case"compositionend":return Wc(t);case"keypress":return t.which!==32?null:(An=!0,Jc);case"textInput":return e=t.data,e===Jc&&An?null:e;default:return null}}function Ur(e,t){if(pl)return e==="compositionend"||!Pa&&Pc(e,t)?(e=$c(),ra=Gi=Rs=null,pl=!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 Wa&&t.locale!=="ko"?null:t.data;default:return null}}var Hr={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 ei(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Hr[e.type]:t==="textarea"}function Ls(e,t,n,i){zn?sl?sl.push(i):sl=[i]:zn=i,t=ef(t,"onChange"),0<t.length&&(n=new Za("onChange","change",null,n,i),e.push({event:n,listeners:t}))}var ti=null,xs=null;function Br(e){Ig(e,0)}function zs(e){var t=On(e);if(Wl(t))return e}function ni(e,t){if(e==="change")return t}var eo=!1;if(Ke){var ha;if(Ke){var to="oninput"in document;if(!to){var te=document.createElement("div");te.setAttribute("oninput","return;"),to=typeof te.oninput=="function"}ha=to}else ha=!1;eo=ha&&(!document.documentMode||9<document.documentMode)}function pa(){ti&&(ti.detachEvent("onpropertychange",Ir),xs=ti=null)}function Ir(e){if(e.propertyName==="value"&&zs(xs)){var t=[];Ls(t,xs,e,Mt(e)),ie(Br,t)}}function sd(e,t,n){e==="focusin"?(pa(),ti=t,xs=n,ti.attachEvent("onpropertychange",Ir)):e==="focusout"&&pa()}function ad(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return zs(xs)}function K(e,t){if(e==="click")return zs(t)}function Ji(e,t){if(e==="input"||e==="change")return zs(t)}function Pi(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ml=typeof Object.is=="function"?Object.is:Pi;function li(e,t){if(ml(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(i=0;i<n.length;i++){var u=n[i];if(!kn.call(t,u)||!ml(e[u],t[u]))return!1}return!0}function fu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ma(e,t){var n=fu(e);e=0;for(var i;n;){if(n.nodeType===3){if(i=e+n.textContent.length,e<=t&&i>=t)return{node:n,offset:t-e};e=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=fu(n)}}function du(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?du(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function hu(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Cl(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Cl(e.document)}return t}function no(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 id=Ke&&"documentMode"in document&&11>=document.documentMode,si=null,Us=null,Wi=null,lo=!1;function pu(e,t,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;lo||si==null||si!==Cl(i)||(i=si,"selectionStart"in i&&no(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}),Wi&&li(Wi,i)||(Wi=i,i=ef(Us,"onSelect"),0<i.length&&(t=new Za("onSelect","select",null,t,n),e.push({event:t,listeners:i}),t.target=si)))}function ga(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ai={animationend:ga("Animation","AnimationEnd"),animationiteration:ga("Animation","AnimationIteration"),animationstart:ga("Animation","AnimationStart"),transitionrun:ga("Transition","TransitionRun"),transitionstart:ga("Transition","TransitionStart"),transitioncancel:ga("Transition","TransitionCancel"),transitionend:ga("Transition","TransitionEnd")},so={},mu={};Ke&&(mu=document.createElement("div").style,"AnimationEvent"in window||(delete ai.animationend.animation,delete ai.animationiteration.animation,delete ai.animationstart.animation),"TransitionEvent"in window||delete ai.transitionend.transition);function xa(e){if(so[e])return so[e];if(!ai[e])return e;var t=ai[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in mu)return so[e]=t[n];return e}var gu=xa("animationend"),qr=xa("animationiteration"),xu=xa("animationstart"),rd=xa("transitionrun"),ao=xa("transitionstart"),cd=xa("transitioncancel"),bu=xa("transitionend"),er=new Map,io="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(" ");io.push("scrollEnd");function Ml(e,t){er.set(e,t),$n(t,[e])}var ii=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)},wl=[],ba=0,Gr=0;function tr(){for(var e=ba,t=Gr=ba=0;t<e;){var n=wl[t];wl[t++]=null;var i=wl[t];wl[t++]=null;var u=wl[t];wl[t++]=null;var f=wl[t];if(wl[t++]=null,i!==null&&u!==null){var b=i.pending;b===null?u.next=u:(u.next=b.next,b.next=u),i.pending=u}f!==0&&_u(n,u,f)}}function Yr(e,t,n,i){wl[ba++]=e,wl[ba++]=t,wl[ba++]=n,wl[ba++]=i,Gr|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function $r(e,t,n,i){return Yr(e,t,n,i),nr(e)}function Hs(e,t){return Yr(e,null,null,t),nr(e)}function _u(e,t,n){e.lanes|=n;var i=e.alternate;i!==null&&(i.lanes|=n);for(var u=!1,f=e.return;f!==null;)f.childLanes|=n,i=f.alternate,i!==null&&(i.childLanes|=n),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-Nt(n),e=f.hiddenUpdates,i=e[u],i===null?e[u]=[t]:i.push(t),t.lane=n|536870912),f):null}function nr(e){if(50<Do)throw Do=0,nh=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Bs={};function od(e,t,n,i){this.tag=e,this.key=n,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 Sl(e,t,n,i){return new od(e,t,n,i)}function ro(e){return e=e.prototype,!(!e||!e.isReactComponent)}function bs(e,t){var n=e.alternate;return n===null?(n=Sl(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function ri(e,t){e.flags&=65011714;var n=e.alternate;return n===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=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function lr(e,t,n,i,u,f){var b=0;if(i=e,typeof e=="function")ro(e)&&(b=1);else if(typeof e=="string")b=i0(e,n,ge.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case O:return e=Sl(31,n,t,u),e.elementType=O,e.lanes=f,e;case C:return _a(n.children,u,f,t);case A:b=8,u|=24;break;case G:return e=Sl(12,n,t,u|2),e.elementType=G,e.lanes=f,e;case $:return e=Sl(13,n,t,u),e.elementType=$,e.lanes=f,e;case B:return e=Sl(19,n,t,u),e.elementType=B,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Y:b=10;break e;case Z:b=9;break e;case H:b=11;break e;case D:b=14;break e;case R:b=16,i=null;break e}b=29,n=Error(c(130,e===null?"null":typeof e,"")),i=null}return t=Sl(b,n,t,u),t.elementType=e,t.type=i,t.lanes=f,t}function _a(e,t,n,i){return e=Sl(7,e,i,t),e.lanes=n,e}function Xr(e,t,n){return e=Sl(6,e,null,t),e.lanes=n,e}function yu(e){var t=Sl(18,null,null,0);return t.stateNode=e,t}function co(e,t,n){return t=Sl(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var vu=new WeakMap;function Rl(e,t){if(typeof e=="object"&&e!==null){var n=vu.get(e);return n!==void 0?n:(t={value:e,source:t,stack:st(t)},vu.set(e,t),t)}return{value:e,source:t,stack:st(t)}}var ci=[],oi=0,Vr=null,sr=0,Dl=[],Ol=0,Is=null,ss=1,Yl="";function _s(e,t){ci[oi++]=sr,ci[oi++]=Vr,Vr=e,sr=t}function ju(e,t,n){Dl[Ol++]=ss,Dl[Ol++]=Yl,Dl[Ol++]=Is,Is=e;var i=ss;e=Yl;var u=32-Nt(i)-1;i&=~(1<<u),n+=1;var f=32-Nt(t)+u;if(30<f){var b=u-u%5;f=(i&(1<<b)-1).toString(32),i>>=b,u-=b,ss=1<<32-Nt(t)+u|n<<u|i,Yl=f+e}else ss=1<<f|n<<u|i,Yl=e}function oo(e){e.return!==null&&(_s(e,1),ju(e,1,0))}function uo(e){for(;e===Vr;)Vr=ci[--oi],ci[oi]=null,sr=ci[--oi],ci[oi]=null;for(;e===Is;)Is=Dl[--Ol],Dl[Ol]=null,Yl=Dl[--Ol],Dl[Ol]=null,ss=Dl[--Ol],Dl[Ol]=null}function Qr(e,t){Dl[Ol++]=ss,Dl[Ol++]=Yl,Dl[Ol++]=Is,ss=t.id,Yl=t.overflow,Is=e}var Mn=null,Rt=null,rt=!1,qs=null,Ll=!1,fo=Error(c(519));function Gs(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ar(Rl(t,e)),fo}function wu(e){var t=e.stateNode,n=e.type,i=e.memoizedProps;switch(t[Lt]=e,t[Ze]=i,n){case"dialog":ot("cancel",t),ot("close",t);break;case"iframe":case"object":case"embed":ot("load",t);break;case"video":case"audio":for(n=0;n<Lo.length;n++)ot(Lo[n],t);break;case"source":ot("error",t);break;case"img":case"image":case"link":ot("error",t),ot("load",t);break;case"details":ot("toggle",t);break;case"input":ot("invalid",t),gs(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":ot("invalid",t);break;case"textarea":ot("invalid",t),T(t,i.value,i.defaultValue,i.children)}n=i.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||i.suppressHydrationWarning===!0||$g(t.textContent,n)?(i.popover!=null&&(ot("beforetoggle",t),ot("toggle",t)),i.onScroll!=null&&ot("scroll",t),i.onScrollEnd!=null&&ot("scrollend",t),i.onClick!=null&&(t.onclick=yt),t=!0):t=!1,t||Gs(e,!0)}function Su(e){for(Mn=e.return;Mn;)switch(Mn.tag){case 5:case 31:case 13:Ll=!1;return;case 27:case 3:Ll=!0;return;default:Mn=Mn.return}}function ui(e){if(e!==Mn)return!1;if(!rt)return Su(e),rt=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||xh(e.type,e.memoizedProps)),n=!n),n&&Rt&&Gs(e),Su(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));Rt=Wg(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));Rt=Wg(e)}else t===27?(t=Rt,Ni(e.type)?(e=jh,jh=null,Rt=e):Rt=t):Rt=Mn?rs(e.stateNode.nextSibling):null;return!0}function ya(){Rt=Mn=null,rt=!1}function ho(){var e=qs;return e!==null&&(Bl===null?Bl=e:Bl.push.apply(Bl,e),qs=null),e}function ar(e){qs===null?qs=[e]:qs.push(e)}var po=w(null),va=null,ys=null;function Ys(e,t,n){z(po,t._currentValue),t._currentValue=n}function vs(e){e._currentValue=po.current,V(po)}function mo(e,t,n){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===n)break;e=e.return}}function Kr(e,t,n,i){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var f=u.dependencies;if(f!==null){var b=u.child;f=f.firstContext;e:for(;f!==null;){var S=f;f=u;for(var M=0;M<t.length;M++)if(S.context===t[M]){f.lanes|=n,S=f.alternate,S!==null&&(S.lanes|=n),mo(f.return,n,e),i||(b=null);break e}f=S.next}}else if(u.tag===18){if(b=u.return,b===null)throw Error(c(341));b.lanes|=n,f=b.alternate,f!==null&&(f.lanes|=n),mo(b,n,e),b=null}else b=u.child;if(b!==null)b.return=u;else for(b=u;b!==null;){if(b===e){b=null;break}if(u=b.sibling,u!==null){u.return=b.return,b=u;break}b=b.return}u=b}}function ja(e,t,n,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 b=u.alternate;if(b===null)throw Error(c(387));if(b=b.memoizedProps,b!==null){var S=u.type;ml(u.pendingProps.value,b.value)||(e!==null?e.push(S):e=[S])}}else if(u===Oe.current){if(b=u.alternate,b===null)throw Error(c(387));b.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(Io):e=[Io])}u=u.return}e!==null&&Kr(t,e,n,i),t.flags|=262144}function wa(e){for(e=e.firstContext;e!==null;){if(!ml(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Qn(e){va=e,ys=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ut(e){return Zr(va,e)}function Ht(e,t){return va===null&&Qn(e),Zr(e,t)}function Zr(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ys===null){if(e===null)throw Error(c(308));ys=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ys=ys.next=t;return n}var ud=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,i){e.push(i)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},fd=l.unstable_scheduleCallback,Fr=l.unstable_NormalPriority,bn={$$typeof:Y,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function fi(){return{controller:new ud,data:new Map,refCount:0}}function Sa(e){e.refCount--,e.refCount===0&&fd(Fr,function(){e.controller.abort()})}var di=null,hi=0,Na=0,pi=null;function ir(e,t){if(di===null){var n=di=[];hi=0,Na=ch(),pi={status:"pending",value:void 0,then:function(i){n.push(i)}}}return hi++,t.then(go,go),t}function go(){if(--hi===0&&di!==null){pi!==null&&(pi.status="fulfilled");var e=di;di=null,Na=0,pi=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function dd(e,t){var n=[],i={status:"pending",value:null,reason:null,then:function(u){n.push(u)}};return e.then(function(){i.status="fulfilled",i.value=t;for(var u=0;u<n.length;u++)(0,n[u])(t)},function(u){for(i.status="rejected",i.reason=u,u=0;u<n.length;u++)(0,n[u])(void 0)}),i}var Jr=X.S;X.S=function(e,t){pg=tt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&ir(e,t),Jr!==null&&Jr(e,t)};var ka=w(null);function Ta(){var e=ka.current;return e!==null?e:Zt.pooledCache}function js(e,t){t===null?z(ka,ka.current):z(ka,t.pool)}function Nu(){var e=Ta();return e===null?null:{parent:bn._currentValue,pool:e}}var Ea=Error(c(460)),Pr=Error(c(474)),Wr=Error(c(542)),ec={then:function(){}};function xo(e){return e=e.status,e==="fulfilled"||e==="rejected"}function bo(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(yt,yt),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,tc(e),e;default:if(typeof t.status=="string")t.then(yt,yt);else{if(e=Zt,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,tc(e),e}throw Aa=t,Ea}}function Ca(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Aa=n,Ea):n}}var Aa=null;function ku(){if(Aa===null)throw Error(c(459));var e=Aa;return Aa=null,e}function tc(e){if(e===Ea||e===Wr)throw Error(c(483))}var Ma=null,rr=0;function ws(e){var t=rr;return rr+=1,Ma===null&&(Ma=[]),bo(Ma,e,t)}function Ra(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function nc(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 _o(e){function t(q,L){if(e){var F=q.deletions;F===null?(q.deletions=[L],q.flags|=16):F.push(L)}}function n(q,L){if(!e)return null;for(;L!==null;)t(q,L),L=L.sibling;return null}function i(q){for(var L=new Map;q!==null;)q.key!==null?L.set(q.key,q):L.set(q.index,q),q=q.sibling;return L}function u(q,L){return q=bs(q,L),q.index=0,q.sibling=null,q}function f(q,L,F){return q.index=F,e?(F=q.alternate,F!==null?(F=F.index,F<L?(q.flags|=67108866,L):F):(q.flags|=67108866,L)):(q.flags|=1048576,L)}function b(q){return e&&q.alternate===null&&(q.flags|=67108866),q}function S(q,L,F,ce){return L===null||L.tag!==6?(L=Xr(F,q.mode,ce),L.return=q,L):(L=u(L,F),L.return=q,L)}function M(q,L,F,ce){var Ye=F.type;return Ye===C?se(q,L,F.props.children,ce,F.key):L!==null&&(L.elementType===Ye||typeof Ye=="object"&&Ye!==null&&Ye.$$typeof===R&&Ca(Ye)===L.type)?(L=u(L,F.props),Ra(L,F),L.return=q,L):(L=lr(F.type,F.key,F.props,null,q.mode,ce),Ra(L,F),L.return=q,L)}function J(q,L,F,ce){return L===null||L.tag!==4||L.stateNode.containerInfo!==F.containerInfo||L.stateNode.implementation!==F.implementation?(L=co(F,q.mode,ce),L.return=q,L):(L=u(L,F.children||[]),L.return=q,L)}function se(q,L,F,ce,Ye){return L===null||L.tag!==7?(L=_a(F,q.mode,ce,Ye),L.return=q,L):(L=u(L,F),L.return=q,L)}function fe(q,L,F){if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return L=Xr(""+L,q.mode,F),L.return=q,L;if(typeof L=="object"&&L!==null){switch(L.$$typeof){case E:return F=lr(L.type,L.key,L.props,null,q.mode,F),Ra(F,L),F.return=q,F;case k:return L=co(L,q.mode,F),L.return=q,L;case R:return L=Ca(L),fe(q,L,F)}if(je(L)||ae(L))return L=_a(L,q.mode,F,null),L.return=q,L;if(typeof L.then=="function")return fe(q,ws(L),F);if(L.$$typeof===Y)return fe(q,Ht(q,L),F);nc(q,L)}return null}function W(q,L,F,ce){var Ye=L!==null?L.key:null;if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return Ye!==null?null:S(q,L,""+F,ce);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case E:return F.key===Ye?M(q,L,F,ce):null;case k:return F.key===Ye?J(q,L,F,ce):null;case R:return F=Ca(F),W(q,L,F,ce)}if(je(F)||ae(F))return Ye!==null?null:se(q,L,F,ce,null);if(typeof F.then=="function")return W(q,L,ws(F),ce);if(F.$$typeof===Y)return W(q,L,Ht(q,F),ce);nc(q,F)}return null}function ne(q,L,F,ce,Ye){if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return q=q.get(F)||null,S(L,q,""+ce,Ye);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case E:return q=q.get(ce.key===null?F:ce.key)||null,M(L,q,ce,Ye);case k:return q=q.get(ce.key===null?F:ce.key)||null,J(L,q,ce,Ye);case R:return ce=Ca(ce),ne(q,L,F,ce,Ye)}if(je(ce)||ae(ce))return q=q.get(F)||null,se(L,q,ce,Ye,null);if(typeof ce.then=="function")return ne(q,L,F,ws(ce),Ye);if(ce.$$typeof===Y)return ne(q,L,F,Ht(L,ce),Ye);nc(L,ce)}return null}function De(q,L,F,ce){for(var Ye=null,jt=null,ze=L,et=L=0,dt=null;ze!==null&&et<F.length;et++){ze.index>et?(dt=ze,ze=null):dt=ze.sibling;var wt=W(q,ze,F[et],ce);if(wt===null){ze===null&&(ze=dt);break}e&&ze&&wt.alternate===null&&t(q,ze),L=f(wt,L,et),jt===null?Ye=wt:jt.sibling=wt,jt=wt,ze=dt}if(et===F.length)return n(q,ze),rt&&_s(q,et),Ye;if(ze===null){for(;et<F.length;et++)ze=fe(q,F[et],ce),ze!==null&&(L=f(ze,L,et),jt===null?Ye=ze:jt.sibling=ze,jt=ze);return rt&&_s(q,et),Ye}for(ze=i(ze);et<F.length;et++)dt=ne(ze,q,et,F[et],ce),dt!==null&&(e&&dt.alternate!==null&&ze.delete(dt.key===null?et:dt.key),L=f(dt,L,et),jt===null?Ye=dt:jt.sibling=dt,jt=dt);return e&&ze.forEach(function(Ai){return t(q,Ai)}),rt&&_s(q,et),Ye}function $e(q,L,F,ce){if(F==null)throw Error(c(151));for(var Ye=null,jt=null,ze=L,et=L=0,dt=null,wt=F.next();ze!==null&&!wt.done;et++,wt=F.next()){ze.index>et?(dt=ze,ze=null):dt=ze.sibling;var Ai=W(q,ze,wt.value,ce);if(Ai===null){ze===null&&(ze=dt);break}e&&ze&&Ai.alternate===null&&t(q,ze),L=f(Ai,L,et),jt===null?Ye=Ai:jt.sibling=Ai,jt=Ai,ze=dt}if(wt.done)return n(q,ze),rt&&_s(q,et),Ye;if(ze===null){for(;!wt.done;et++,wt=F.next())wt=fe(q,wt.value,ce),wt!==null&&(L=f(wt,L,et),jt===null?Ye=wt:jt.sibling=wt,jt=wt);return rt&&_s(q,et),Ye}for(ze=i(ze);!wt.done;et++,wt=F.next())wt=ne(ze,q,et,wt.value,ce),wt!==null&&(e&&wt.alternate!==null&&ze.delete(wt.key===null?et:wt.key),L=f(wt,L,et),jt===null?Ye=wt:jt.sibling=wt,jt=wt);return e&&ze.forEach(function(x0){return t(q,x0)}),rt&&_s(q,et),Ye}function $t(q,L,F,ce){if(typeof F=="object"&&F!==null&&F.type===C&&F.key===null&&(F=F.props.children),typeof F=="object"&&F!==null){switch(F.$$typeof){case E:e:{for(var Ye=F.key;L!==null;){if(L.key===Ye){if(Ye=F.type,Ye===C){if(L.tag===7){n(q,L.sibling),ce=u(L,F.props.children),ce.return=q,q=ce;break e}}else if(L.elementType===Ye||typeof Ye=="object"&&Ye!==null&&Ye.$$typeof===R&&Ca(Ye)===L.type){n(q,L.sibling),ce=u(L,F.props),Ra(ce,F),ce.return=q,q=ce;break e}n(q,L);break}else t(q,L);L=L.sibling}F.type===C?(ce=_a(F.props.children,q.mode,ce,F.key),ce.return=q,q=ce):(ce=lr(F.type,F.key,F.props,null,q.mode,ce),Ra(ce,F),ce.return=q,q=ce)}return b(q);case k:e:{for(Ye=F.key;L!==null;){if(L.key===Ye)if(L.tag===4&&L.stateNode.containerInfo===F.containerInfo&&L.stateNode.implementation===F.implementation){n(q,L.sibling),ce=u(L,F.children||[]),ce.return=q,q=ce;break e}else{n(q,L);break}else t(q,L);L=L.sibling}ce=co(F,q.mode,ce),ce.return=q,q=ce}return b(q);case R:return F=Ca(F),$t(q,L,F,ce)}if(je(F))return De(q,L,F,ce);if(ae(F)){if(Ye=ae(F),typeof Ye!="function")throw Error(c(150));return F=Ye.call(F),$e(q,L,F,ce)}if(typeof F.then=="function")return $t(q,L,ws(F),ce);if(F.$$typeof===Y)return $t(q,L,Ht(q,F),ce);nc(q,F)}return typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint"?(F=""+F,L!==null&&L.tag===6?(n(q,L.sibling),ce=u(L,F),ce.return=q,q=ce):(n(q,L),ce=Xr(F,q.mode,ce),ce.return=q,q=ce),b(q)):n(q,L)}return function(q,L,F,ce){try{rr=0;var Ye=$t(q,L,F,ce);return Ma=null,Ye}catch(ze){if(ze===Ea||ze===Wr)throw ze;var jt=Sl(29,ze,null,q.mode);return jt.lanes=ce,jt.return=q,jt}finally{}}}var $s=_o(!0),p=_o(!1),U=!1;function re(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Me(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 bt(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Wt(e,t,n){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(Tt&2)!==0){var u=i.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),i.pending=t,t=nr(e),_u(e,null,n),t}return Yr(e,i,t,n),nr(e)}function al(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,ds(e,n)}}function Da(e,t){var n=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var u=null,f=null;if(n=n.firstBaseUpdate,n!==null){do{var b={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};f===null?u=f=b:f=f.next=b,n=n.next}while(n!==null);f===null?u=f=t:f=f.next=t}else u=f=t;n={baseState:i.baseState,firstBaseUpdate:u,lastBaseUpdate:f,shared:i.shared,callbacks:i.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var lc=!1;function mi(){if(lc){var e=pi;if(e!==null)throw e}}function xe(e,t,n,i){lc=!1;var u=e.updateQueue;U=!1;var f=u.firstBaseUpdate,b=u.lastBaseUpdate,S=u.shared.pending;if(S!==null){u.shared.pending=null;var M=S,J=M.next;M.next=null,b===null?f=J:b.next=J,b=M;var se=e.alternate;se!==null&&(se=se.updateQueue,S=se.lastBaseUpdate,S!==b&&(S===null?se.firstBaseUpdate=J:S.next=J,se.lastBaseUpdate=M))}if(f!==null){var fe=u.baseState;b=0,se=J=M=null,S=f;do{var W=S.lane&-536870913,ne=W!==S.lane;if(ne?(ft&W)===W:(i&W)===W){W!==0&&W===Na&&(lc=!0),se!==null&&(se=se.next={lane:0,tag:S.tag,payload:S.payload,callback:null,next:null});e:{var De=e,$e=S;W=t;var $t=n;switch($e.tag){case 1:if(De=$e.payload,typeof De=="function"){fe=De.call($t,fe,W);break e}fe=De;break e;case 3:De.flags=De.flags&-65537|128;case 0:if(De=$e.payload,W=typeof De=="function"?De.call($t,fe,W):De,W==null)break e;fe=j({},fe,W);break e;case 2:U=!0}}W=S.callback,W!==null&&(e.flags|=64,ne&&(e.flags|=8192),ne=u.callbacks,ne===null?u.callbacks=[W]:ne.push(W))}else ne={lane:W,tag:S.tag,payload:S.payload,callback:S.callback,next:null},se===null?(J=se=ne,M=fe):se=se.next=ne,b|=W;if(S=S.next,S===null){if(S=u.shared.pending,S===null)break;ne=S,S=ne.next,ne.next=null,u.lastBaseUpdate=ne,u.shared.pending=null}}while(!0);se===null&&(M=fe),u.baseState=M,u.firstBaseUpdate=J,u.lastBaseUpdate=se,f===null&&(u.shared.lanes=0),yi|=b,e.lanes=b,e.memoizedState=fe}}function Ce(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function Qe(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ce(n[e],t)}var lt=w(null),vt=w(0);function as(e,t){e=Ga,z(vt,e),z(lt,t),Ga=e|t.baseLanes}function yo(){z(vt,Ga),z(lt,lt.current)}function hd(){Ga=vt.current,V(lt),V(vt)}var $l=w(null),is=null;function gi(e){var t=e.alternate;z(Rn,Rn.current&1),z($l,e),is===null&&(t===null||lt.current!==null||t.memoizedState!==null)&&(is=e)}function pd(e){z(Rn,Rn.current),z($l,e),is===null&&(is=e)}function Gp(e){e.tag===22?(z(Rn,Rn.current),z($l,e),is===null&&(is=e)):xi()}function xi(){z(Rn,Rn.current),z($l,$l.current)}function Xl(e){V($l),is===e&&(is=null),V(Rn)}var Rn=w(0);function Tu(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||yh(n)||vh(n)))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 Oa=0,We=null,Gt=null,Hn=null,Eu=!1,sc=!1,cr=!1,Cu=0,vo=0,ac=null,ry=0;function wn(){throw Error(c(321))}function md(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!ml(e[n],t[n]))return!1;return!0}function gd(e,t,n,i,u,f){return Oa=f,We=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,X.H=e===null||e.memoizedState===null?Nm:Md,cr=!1,f=n(i,u),cr=!1,sc&&(f=$p(t,n,i,u)),Yp(e),f}function Yp(e){X.H=So;var t=Gt!==null&&Gt.next!==null;if(Oa=0,Hn=Gt=We=null,Eu=!1,vo=0,ac=null,t)throw Error(c(300));e===null||Bn||(e=e.dependencies,e!==null&&wa(e)&&(Bn=!0))}function $p(e,t,n,i){We=e;var u=0;do{if(sc&&(ac=null),vo=0,sc=!1,25<=u)throw Error(c(301));if(u+=1,Hn=Gt=null,e.updateQueue!=null){var f=e.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}X.H=km,f=t(n,i)}while(sc);return f}function cy(){var e=X.H,t=e.useState()[0];return t=typeof t.then=="function"?jo(t):t,e=e.useState()[0],(Gt!==null?Gt.memoizedState:null)!==e&&(We.flags|=1024),t}function xd(){var e=Cu!==0;return Cu=0,e}function bd(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function _d(e){if(Eu){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Eu=!1}Oa=0,Hn=Gt=We=null,sc=!1,vo=Cu=0,ac=null}function Nl(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Hn===null?We.memoizedState=Hn=e:Hn=Hn.next=e,Hn}function Dn(){if(Gt===null){var e=We.alternate;e=e!==null?e.memoizedState:null}else e=Gt.next;var t=Hn===null?We.memoizedState:Hn.next;if(t!==null)Hn=t,Gt=e;else{if(e===null)throw We.alternate===null?Error(c(467)):Error(c(310));Gt=e,e={memoizedState:Gt.memoizedState,baseState:Gt.baseState,baseQueue:Gt.baseQueue,queue:Gt.queue,next:null},Hn===null?We.memoizedState=Hn=e:Hn=Hn.next=e}return Hn}function Au(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function jo(e){var t=vo;return vo+=1,ac===null&&(ac=[]),e=bo(ac,e,t),t=We,(Hn===null?t.memoizedState:Hn.next)===null&&(t=t.alternate,X.H=t===null||t.memoizedState===null?Nm:Md),e}function Mu(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return jo(e);if(e.$$typeof===Y)return Ut(e)}throw Error(c(438,String(e)))}function yd(e){var t=null,n=We.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var i=We.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}),n===null&&(n=Au(),We.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),i=0;i<e;i++)n[i]=ee;return t.index++,n}function La(e,t){return typeof t=="function"?t(e):t}function Ru(e){var t=Dn();return vd(t,Gt,e)}function vd(e,t,n){var i=e.queue;if(i===null)throw Error(c(311));i.lastRenderedReducer=n;var u=e.baseQueue,f=i.pending;if(f!==null){if(u!==null){var b=u.next;u.next=f.next,f.next=b}t.baseQueue=u=f,i.pending=null}if(f=e.baseState,u===null)e.memoizedState=f;else{t=u.next;var S=b=null,M=null,J=t,se=!1;do{var fe=J.lane&-536870913;if(fe!==J.lane?(ft&fe)===fe:(Oa&fe)===fe){var W=J.revertLane;if(W===0)M!==null&&(M=M.next={lane:0,revertLane:0,gesture:null,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null}),fe===Na&&(se=!0);else if((Oa&W)===W){J=J.next,W===Na&&(se=!0);continue}else fe={lane:0,revertLane:J.revertLane,gesture:null,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},M===null?(S=M=fe,b=f):M=M.next=fe,We.lanes|=W,yi|=W;fe=J.action,cr&&n(f,fe),f=J.hasEagerState?J.eagerState:n(f,fe)}else W={lane:fe,revertLane:J.revertLane,gesture:J.gesture,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},M===null?(S=M=W,b=f):M=M.next=W,We.lanes|=fe,yi|=fe;J=J.next}while(J!==null&&J!==t);if(M===null?b=f:M.next=S,!ml(f,e.memoizedState)&&(Bn=!0,se&&(n=pi,n!==null)))throw n;e.memoizedState=f,e.baseState=b,e.baseQueue=M,i.lastRenderedState=f}return u===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function jd(e){var t=Dn(),n=t.queue;if(n===null)throw Error(c(311));n.lastRenderedReducer=e;var i=n.dispatch,u=n.pending,f=t.memoizedState;if(u!==null){n.pending=null;var b=u=u.next;do f=e(f,b.action),b=b.next;while(b!==u);ml(f,t.memoizedState)||(Bn=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),n.lastRenderedState=f}return[f,i]}function Xp(e,t,n){var i=We,u=Dn(),f=rt;if(f){if(n===void 0)throw Error(c(407));n=n()}else n=t();var b=!ml((Gt||u).memoizedState,n);if(b&&(u.memoizedState=n,Bn=!0),u=u.queue,Nd(Kp.bind(null,i,u,e),[e]),u.getSnapshot!==t||b||Hn!==null&&Hn.memoizedState.tag&1){if(i.flags|=2048,ic(9,{destroy:void 0},Qp.bind(null,i,u,n,t),null),Zt===null)throw Error(c(349));f||(Oa&127)!==0||Vp(i,t,n)}return n}function Vp(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=We.updateQueue,t===null?(t=Au(),We.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Qp(e,t,n,i){t.value=n,t.getSnapshot=i,Zp(t)&&Fp(e)}function Kp(e,t,n){return n(function(){Zp(t)&&Fp(e)})}function Zp(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!ml(e,n)}catch{return!0}}function Fp(e){var t=Hs(e,2);t!==null&&Il(t,e,2)}function wd(e){var t=Nl();if(typeof e=="function"){var n=e;if(e=n(),cr){Jt(!0);try{n()}finally{Jt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:La,lastRenderedState:e},t}function Jp(e,t,n,i){return e.baseState=n,vd(e,Gt,typeof i=="function"?i:La)}function oy(e,t,n,i,u){if(Lu(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(b){f.listeners.push(b)}};X.T!==null?n(!0):f.isTransition=!1,i(f),n=t.pending,n===null?(f.next=t.pending=f,Pp(t,f)):(f.next=n.next,t.pending=n.next=f)}}function Pp(e,t){var n=t.action,i=t.payload,u=e.state;if(t.isTransition){var f=X.T,b={};X.T=b;try{var S=n(u,i),M=X.S;M!==null&&M(b,S),Wp(e,t,S)}catch(J){Sd(e,t,J)}finally{f!==null&&b.types!==null&&(f.types=b.types),X.T=f}}else try{f=n(u,i),Wp(e,t,f)}catch(J){Sd(e,t,J)}}function Wp(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(i){em(e,t,i)},function(i){return Sd(e,t,i)}):em(e,t,n)}function em(e,t,n){t.status="fulfilled",t.value=n,tm(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Pp(e,n)))}function Sd(e,t,n){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do t.status="rejected",t.reason=n,tm(t),t=t.next;while(t!==i)}e.action=null}function tm(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function nm(e,t){return t}function lm(e,t){if(rt){var n=Zt.formState;if(n!==null){e:{var i=We;if(rt){if(Rt){t:{for(var u=Rt,f=Ll;u.nodeType!==8;){if(!f){u=null;break t}if(u=rs(u.nextSibling),u===null){u=null;break t}}f=u.data,u=f==="F!"||f==="F"?u:null}if(u){Rt=rs(u.nextSibling),i=u.data==="F!";break e}}Gs(i)}i=!1}i&&(t=n[0])}}return n=Nl(),n.memoizedState=n.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:nm,lastRenderedState:t},n.queue=i,n=jm.bind(null,We,i),i.dispatch=n,i=wd(!1),f=Ad.bind(null,We,!1,i.queue),i=Nl(),u={state:t,dispatch:null,action:e,pending:null},i.queue=u,n=oy.bind(null,We,u,f,n),u.dispatch=n,i.memoizedState=e,[t,n,!1]}function sm(e){var t=Dn();return am(t,Gt,e)}function am(e,t,n){if(t=vd(e,t,nm)[0],e=Ru(La)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var i=jo(t)}catch(b){throw b===Ea?Wr:b}else i=t;t=Dn();var u=t.queue,f=u.dispatch;return n!==t.memoizedState&&(We.flags|=2048,ic(9,{destroy:void 0},uy.bind(null,u,n),null)),[i,f,e]}function uy(e,t){e.action=t}function im(e){var t=Dn(),n=Gt;if(n!==null)return am(t,n,e);Dn(),t=t.memoizedState,n=Dn();var i=n.queue.dispatch;return n.memoizedState=e,[t,i,!1]}function ic(e,t,n,i){return e={tag:e,create:n,deps:i,inst:t,next:null},t=We.updateQueue,t===null&&(t=Au(),We.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(i=n.next,n.next=e,e.next=i,t.lastEffect=e),e}function rm(){return Dn().memoizedState}function Du(e,t,n,i){var u=Nl();We.flags|=e,u.memoizedState=ic(1|t,{destroy:void 0},n,i===void 0?null:i)}function Ou(e,t,n,i){var u=Dn();i=i===void 0?null:i;var f=u.memoizedState.inst;Gt!==null&&i!==null&&md(i,Gt.memoizedState.deps)?u.memoizedState=ic(t,f,n,i):(We.flags|=e,u.memoizedState=ic(1|t,f,n,i))}function cm(e,t){Du(8390656,8,e,t)}function Nd(e,t){Ou(2048,8,e,t)}function fy(e){We.flags|=4;var t=We.updateQueue;if(t===null)t=Au(),We.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function om(e){var t=Dn().memoizedState;return fy({ref:t,nextImpl:e}),function(){if((Tt&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function um(e,t){return Ou(4,2,e,t)}function fm(e,t){return Ou(4,4,e,t)}function dm(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function hm(e,t,n){n=n!=null?n.concat([e]):null,Ou(4,4,dm.bind(null,t,e),n)}function kd(){}function pm(e,t){var n=Dn();t=t===void 0?null:t;var i=n.memoizedState;return t!==null&&md(t,i[1])?i[0]:(n.memoizedState=[e,t],e)}function mm(e,t){var n=Dn();t=t===void 0?null:t;var i=n.memoizedState;if(t!==null&&md(t,i[1]))return i[0];if(i=e(),cr){Jt(!0);try{e()}finally{Jt(!1)}}return n.memoizedState=[i,t],i}function Td(e,t,n){return n===void 0||(Oa&1073741824)!==0&&(ft&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=gg(),We.lanes|=e,yi|=e,n)}function gm(e,t,n,i){return ml(n,t)?n:lt.current!==null?(e=Td(e,n,i),ml(e,t)||(Bn=!0),e):(Oa&42)===0||(Oa&1073741824)!==0&&(ft&261930)===0?(Bn=!0,e.memoizedState=n):(e=gg(),We.lanes|=e,yi|=e,t)}function xm(e,t,n,i,u){var f=ue.p;ue.p=f!==0&&8>f?f:8;var b=X.T,S={};X.T=S,Ad(e,!1,t,n);try{var M=u(),J=X.S;if(J!==null&&J(S,M),M!==null&&typeof M=="object"&&typeof M.then=="function"){var se=dd(M,i);wo(e,t,se,Kl(e))}else wo(e,t,i,Kl(e))}catch(fe){wo(e,t,{then:function(){},status:"rejected",reason:fe},Kl())}finally{ue.p=f,b!==null&&S.types!==null&&(b.types=S.types),X.T=b}}function dy(){}function Ed(e,t,n,i){if(e.tag!==5)throw Error(c(476));var u=bm(e).queue;xm(e,u,t,de,n===null?dy:function(){return _m(e),n(i)})}function bm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:de,baseState:de,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:La,lastRenderedState:de},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:La,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function _m(e){var t=bm(e);t.next===null&&(t=e.alternate.memoizedState),wo(e,t.next.queue,{},Kl())}function Cd(){return Ut(Io)}function ym(){return Dn().memoizedState}function vm(){return Dn().memoizedState}function hy(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Kl();e=bt(n);var i=Wt(t,e,n);i!==null&&(Il(i,t,n),al(i,t,n)),t={cache:fi()},e.payload=t;return}t=t.return}}function py(e,t,n){var i=Kl();n={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Lu(e)?wm(t,n):(n=$r(e,t,n,i),n!==null&&(Il(n,e,i),Sm(n,t,i)))}function jm(e,t,n){var i=Kl();wo(e,t,n,i)}function wo(e,t,n,i){var u={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Lu(e))wm(t,u);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var b=t.lastRenderedState,S=f(b,n);if(u.hasEagerState=!0,u.eagerState=S,ml(S,b))return Yr(e,t,u,0),Zt===null&&tr(),!1}catch{}finally{}if(n=$r(e,t,u,i),n!==null)return Il(n,e,i),Sm(n,t,i),!0}return!1}function Ad(e,t,n,i){if(i={lane:2,revertLane:ch(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Lu(e)){if(t)throw Error(c(479))}else t=$r(e,n,i,2),t!==null&&Il(t,e,2)}function Lu(e){var t=e.alternate;return e===We||t!==null&&t===We}function wm(e,t){sc=Eu=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Sm(e,t,n){if((n&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,ds(e,n)}}var So={readContext:Ut,use:Mu,useCallback:wn,useContext:wn,useEffect:wn,useImperativeHandle:wn,useLayoutEffect:wn,useInsertionEffect:wn,useMemo:wn,useReducer:wn,useRef:wn,useState:wn,useDebugValue:wn,useDeferredValue:wn,useTransition:wn,useSyncExternalStore:wn,useId:wn,useHostTransitionStatus:wn,useFormState:wn,useActionState:wn,useOptimistic:wn,useMemoCache:wn,useCacheRefresh:wn};So.useEffectEvent=wn;var Nm={readContext:Ut,use:Mu,useCallback:function(e,t){return Nl().memoizedState=[e,t===void 0?null:t],e},useContext:Ut,useEffect:cm,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Du(4194308,4,dm.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Du(4194308,4,e,t)},useInsertionEffect:function(e,t){Du(4,2,e,t)},useMemo:function(e,t){var n=Nl();t=t===void 0?null:t;var i=e();if(cr){Jt(!0);try{e()}finally{Jt(!1)}}return n.memoizedState=[i,t],i},useReducer:function(e,t,n){var i=Nl();if(n!==void 0){var u=n(t);if(cr){Jt(!0);try{n(t)}finally{Jt(!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=py.bind(null,We,e),[i.memoizedState,e]},useRef:function(e){var t=Nl();return e={current:e},t.memoizedState=e},useState:function(e){e=wd(e);var t=e.queue,n=jm.bind(null,We,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:kd,useDeferredValue:function(e,t){var n=Nl();return Td(n,e,t)},useTransition:function(){var e=wd(!1);return e=xm.bind(null,We,e.queue,!0,!1),Nl().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var i=We,u=Nl();if(rt){if(n===void 0)throw Error(c(407));n=n()}else{if(n=t(),Zt===null)throw Error(c(349));(ft&127)!==0||Vp(i,t,n)}u.memoizedState=n;var f={value:n,getSnapshot:t};return u.queue=f,cm(Kp.bind(null,i,f,e),[e]),i.flags|=2048,ic(9,{destroy:void 0},Qp.bind(null,i,f,n,t),null),n},useId:function(){var e=Nl(),t=Zt.identifierPrefix;if(rt){var n=Yl,i=ss;n=(i&~(1<<32-Nt(i)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Cu++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=ry++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Cd,useFormState:lm,useActionState:lm,useOptimistic:function(e){var t=Nl();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ad.bind(null,We,!0,n),n.dispatch=t,[e,t]},useMemoCache:yd,useCacheRefresh:function(){return Nl().memoizedState=hy.bind(null,We)},useEffectEvent:function(e){var t=Nl(),n={impl:e};return t.memoizedState=n,function(){if((Tt&2)!==0)throw Error(c(440));return n.impl.apply(void 0,arguments)}}},Md={readContext:Ut,use:Mu,useCallback:pm,useContext:Ut,useEffect:Nd,useImperativeHandle:hm,useInsertionEffect:um,useLayoutEffect:fm,useMemo:mm,useReducer:Ru,useRef:rm,useState:function(){return Ru(La)},useDebugValue:kd,useDeferredValue:function(e,t){var n=Dn();return gm(n,Gt.memoizedState,e,t)},useTransition:function(){var e=Ru(La)[0],t=Dn().memoizedState;return[typeof e=="boolean"?e:jo(e),t]},useSyncExternalStore:Xp,useId:ym,useHostTransitionStatus:Cd,useFormState:sm,useActionState:sm,useOptimistic:function(e,t){var n=Dn();return Jp(n,Gt,e,t)},useMemoCache:yd,useCacheRefresh:vm};Md.useEffectEvent=om;var km={readContext:Ut,use:Mu,useCallback:pm,useContext:Ut,useEffect:Nd,useImperativeHandle:hm,useInsertionEffect:um,useLayoutEffect:fm,useMemo:mm,useReducer:jd,useRef:rm,useState:function(){return jd(La)},useDebugValue:kd,useDeferredValue:function(e,t){var n=Dn();return Gt===null?Td(n,e,t):gm(n,Gt.memoizedState,e,t)},useTransition:function(){var e=jd(La)[0],t=Dn().memoizedState;return[typeof e=="boolean"?e:jo(e),t]},useSyncExternalStore:Xp,useId:ym,useHostTransitionStatus:Cd,useFormState:im,useActionState:im,useOptimistic:function(e,t){var n=Dn();return Gt!==null?Jp(n,Gt,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:yd,useCacheRefresh:vm};km.useEffectEvent=om;function Rd(e,t,n,i){t=e.memoizedState,n=n(i,t),n=n==null?t:j({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Dd={enqueueSetState:function(e,t,n){e=e._reactInternals;var i=Kl(),u=bt(i);u.payload=t,n!=null&&(u.callback=n),t=Wt(e,u,i),t!==null&&(Il(t,e,i),al(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var i=Kl(),u=bt(i);u.tag=1,u.payload=t,n!=null&&(u.callback=n),t=Wt(e,u,i),t!==null&&(Il(t,e,i),al(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Kl(),i=bt(n);i.tag=2,t!=null&&(i.callback=t),t=Wt(e,i,n),t!==null&&(Il(t,e,n),al(t,e,n))}};function Tm(e,t,n,i,u,f,b){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,f,b):t.prototype&&t.prototype.isPureReactComponent?!li(n,i)||!li(u,f):!0}function Em(e,t,n,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,i),t.state!==e&&Dd.enqueueReplaceState(t,t.state,null)}function or(e,t){var n=t;if("ref"in t){n={};for(var i in t)i!=="ref"&&(n[i]=t[i])}if(e=e.defaultProps){n===t&&(n=j({},n));for(var u in e)n[u]===void 0&&(n[u]=e[u])}return n}function Cm(e){ii(e)}function Am(e){console.error(e)}function Mm(e){ii(e)}function zu(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function Rm(e,t,n){try{var i=e.onCaughtError;i(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function Od(e,t,n){return n=bt(n),n.tag=3,n.payload={element:null},n.callback=function(){zu(e,t)},n}function Dm(e){return e=bt(e),e.tag=3,e}function Om(e,t,n,i){var u=n.type.getDerivedStateFromError;if(typeof u=="function"){var f=i.value;e.payload=function(){return u(f)},e.callback=function(){Rm(t,n,i)}}var b=n.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(e.callback=function(){Rm(t,n,i),typeof u!="function"&&(vi===null?vi=new Set([this]):vi.add(this));var S=i.stack;this.componentDidCatch(i.value,{componentStack:S!==null?S:""})})}function my(e,t,n,i,u){if(n.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=n.alternate,t!==null&&ja(t,n,u,!0),n=$l.current,n!==null){switch(n.tag){case 31:case 13:return is===null?Ku():n.alternate===null&&Sn===0&&(Sn=3),n.flags&=-257,n.flags|=65536,n.lanes=u,i===ec?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([i]):t.add(i),ah(e,i,u)),!1;case 22:return n.flags|=65536,i===ec?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([i]):n.add(i)),ah(e,i,u)),!1}throw Error(c(435,n.tag))}return ah(e,i,u),Ku(),!1}if(rt)return t=$l.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,i!==fo&&(e=Error(c(422),{cause:i}),ar(Rl(e,n)))):(i!==fo&&(t=Error(c(423),{cause:i}),ar(Rl(t,n))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,i=Rl(i,n),u=Od(e.stateNode,i,u),Da(e,u),Sn!==4&&(Sn=2)),!1;var f=Error(c(520),{cause:i});if(f=Rl(f,n),Ro===null?Ro=[f]:Ro.push(f),Sn!==4&&(Sn=2),t===null)return!0;i=Rl(i,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=u&-u,n.lanes|=e,e=Od(n.stateNode,i,e),Da(n,e),!1;case 1:if(t=n.type,f=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(vi===null||!vi.has(f))))return n.flags|=65536,u&=-u,n.lanes|=u,u=Dm(u),Om(u,e,n,i),Da(n,u),!1}n=n.return}while(n!==null);return!1}var Ld=Error(c(461)),Bn=!1;function il(e,t,n,i){t.child=e===null?p(t,null,n,i):$s(t,e.child,n,i)}function Lm(e,t,n,i,u){n=n.render;var f=t.ref;if("ref"in i){var b={};for(var S in i)S!=="ref"&&(b[S]=i[S])}else b=i;return Qn(t),i=gd(e,t,n,b,f,u),S=xd(),e!==null&&!Bn?(bd(e,t,u),za(e,t,u)):(rt&&S&&oo(t),t.flags|=1,il(e,t,i,u),t.child)}function zm(e,t,n,i,u){if(e===null){var f=n.type;return typeof f=="function"&&!ro(f)&&f.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=f,Um(e,t,f,i,u)):(e=lr(n.type,null,i,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!Yd(e,u)){var b=f.memoizedProps;if(n=n.compare,n=n!==null?n:li,n(b,i)&&e.ref===t.ref)return za(e,t,u)}return t.flags|=1,e=bs(f,i),e.ref=t.ref,e.return=t,t.child=e}function Um(e,t,n,i,u){if(e!==null){var f=e.memoizedProps;if(li(f,i)&&e.ref===t.ref)if(Bn=!1,t.pendingProps=i=f,Yd(e,u))(e.flags&131072)!==0&&(Bn=!0);else return t.lanes=e.lanes,za(e,t,u)}return zd(e,t,n,i,u)}function Hm(e,t,n,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|n:n,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 Bm(e,t,f,n,i)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&js(t,f!==null?f.cachePool:null),f!==null?as(t,f):yo(),Gp(t);else return i=t.lanes=536870912,Bm(e,t,f!==null?f.baseLanes|n:n,n,i)}else f!==null?(js(t,f.cachePool),as(t,f),xi(),t.memoizedState=null):(e!==null&&js(t,null),yo(),xi());return il(e,t,u,n),t.child}function No(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Bm(e,t,n,i,u){var f=Ta();return f=f===null?null:{parent:bn._currentValue,pool:f},t.memoizedState={baseLanes:n,cachePool:f},e!==null&&js(t,null),yo(),Gp(t),e!==null&&ja(e,t,i,!0),t.childLanes=u,null}function Uu(e,t){return t=Bu({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Im(e,t,n){return $s(t,e.child,null,n),e=Uu(t,t.pendingProps),e.flags|=2,Xl(t),t.memoizedState=null,e}function gy(e,t,n){var i=t.pendingProps,u=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(rt){if(i.mode==="hidden")return e=Uu(t,i),t.lanes=536870912,No(null,e);if(pd(t),(e=Rt)?(e=Pg(e,Ll),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Is!==null?{id:ss,overflow:Yl}:null,retryLane:536870912,hydrationErrors:null},n=yu(e),n.return=t,t.child=n,Mn=t,Rt=null)):e=null,e===null)throw Gs(t);return t.lanes=536870912,null}return Uu(t,i)}var f=e.memoizedState;if(f!==null){var b=f.dehydrated;if(pd(t),u)if(t.flags&256)t.flags&=-257,t=Im(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(c(558));else if(Bn||ja(e,t,n,!1),u=(n&e.childLanes)!==0,Bn||u){if(i=Zt,i!==null&&(b=Fl(i,n),b!==0&&b!==f.retryLane))throw f.retryLane=b,Hs(e,b),Il(i,e,b),Ld;Ku(),t=Im(e,t,n)}else e=f.treeContext,Rt=rs(b.nextSibling),Mn=t,rt=!0,qs=null,Ll=!1,e!==null&&Qr(t,e),t=Uu(t,i),t.flags|=4096;return t}return e=bs(e.child,{mode:i.mode,children:i.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Hu(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(c(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function zd(e,t,n,i,u){return Qn(t),n=gd(e,t,n,i,void 0,u),i=xd(),e!==null&&!Bn?(bd(e,t,u),za(e,t,u)):(rt&&i&&oo(t),t.flags|=1,il(e,t,n,u),t.child)}function qm(e,t,n,i,u,f){return Qn(t),t.updateQueue=null,n=$p(t,i,n,u),Yp(e),i=xd(),e!==null&&!Bn?(bd(e,t,f),za(e,t,f)):(rt&&i&&oo(t),t.flags|=1,il(e,t,n,f),t.child)}function Gm(e,t,n,i,u){if(Qn(t),t.stateNode===null){var f=Bs,b=n.contextType;typeof b=="object"&&b!==null&&(f=Ut(b)),f=new n(i,f),t.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=Dd,t.stateNode=f,f._reactInternals=t,f=t.stateNode,f.props=i,f.state=t.memoizedState,f.refs={},re(t),b=n.contextType,f.context=typeof b=="object"&&b!==null?Ut(b):Bs,f.state=t.memoizedState,b=n.getDerivedStateFromProps,typeof b=="function"&&(Rd(t,n,b,i),f.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(b=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),b!==f.state&&Dd.enqueueReplaceState(f,f.state,null),xe(t,i,f,u),mi(),f.state=t.memoizedState),typeof f.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){f=t.stateNode;var S=t.memoizedProps,M=or(n,S);f.props=M;var J=f.context,se=n.contextType;b=Bs,typeof se=="object"&&se!==null&&(b=Ut(se));var fe=n.getDerivedStateFromProps;se=typeof fe=="function"||typeof f.getSnapshotBeforeUpdate=="function",S=t.pendingProps!==S,se||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(S||J!==b)&&Em(t,f,i,b),U=!1;var W=t.memoizedState;f.state=W,xe(t,i,f,u),mi(),J=t.memoizedState,S||W!==J||U?(typeof fe=="function"&&(Rd(t,n,fe,i),J=t.memoizedState),(M=U||Tm(t,n,M,i,W,J,b))?(se||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=J),f.props=i,f.state=J,f.context=b,i=M):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{f=t.stateNode,Me(e,t),b=t.memoizedProps,se=or(n,b),f.props=se,fe=t.pendingProps,W=f.context,J=n.contextType,M=Bs,typeof J=="object"&&J!==null&&(M=Ut(J)),S=n.getDerivedStateFromProps,(J=typeof S=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(b!==fe||W!==M)&&Em(t,f,i,M),U=!1,W=t.memoizedState,f.state=W,xe(t,i,f,u),mi();var ne=t.memoizedState;b!==fe||W!==ne||U||e!==null&&e.dependencies!==null&&wa(e.dependencies)?(typeof S=="function"&&(Rd(t,n,S,i),ne=t.memoizedState),(se=U||Tm(t,n,se,i,W,ne,M)||e!==null&&e.dependencies!==null&&wa(e.dependencies))?(J||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(i,ne,M),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(i,ne,M)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||b===e.memoizedProps&&W===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&W===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=ne),f.props=i,f.state=ne,f.context=M,i=se):(typeof f.componentDidUpdate!="function"||b===e.memoizedProps&&W===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&W===e.memoizedState||(t.flags|=1024),i=!1)}return f=i,Hu(e,t),i=(t.flags&128)!==0,f||i?(f=t.stateNode,n=i&&typeof n.getDerivedStateFromError!="function"?null:f.render(),t.flags|=1,e!==null&&i?(t.child=$s(t,e.child,null,u),t.child=$s(t,null,n,u)):il(e,t,n,u),t.memoizedState=f.state,e=t.child):e=za(e,t,u),e}function Ym(e,t,n,i){return ya(),t.flags|=256,il(e,t,n,i),t.child}var Ud={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Hd(e){return{baseLanes:e,cachePool:Nu()}}function Bd(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Ql),e}function $m(e,t,n){var i=t.pendingProps,u=!1,f=(t.flags&128)!==0,b;if((b=f)||(b=e!==null&&e.memoizedState===null?!1:(Rn.current&2)!==0),b&&(u=!0,t.flags&=-129),b=(t.flags&32)!==0,t.flags&=-33,e===null){if(rt){if(u?gi(t):xi(),(e=Rt)?(e=Pg(e,Ll),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Is!==null?{id:ss,overflow:Yl}:null,retryLane:536870912,hydrationErrors:null},n=yu(e),n.return=t,t.child=n,Mn=t,Rt=null)):e=null,e===null)throw Gs(t);return vh(e)?t.lanes=32:t.lanes=536870912,null}var S=i.children;return i=i.fallback,u?(xi(),u=t.mode,S=Bu({mode:"hidden",children:S},u),i=_a(i,u,n,null),S.return=t,i.return=t,S.sibling=i,t.child=S,i=t.child,i.memoizedState=Hd(n),i.childLanes=Bd(e,b,n),t.memoizedState=Ud,No(null,i)):(gi(t),Id(t,S))}var M=e.memoizedState;if(M!==null&&(S=M.dehydrated,S!==null)){if(f)t.flags&256?(gi(t),t.flags&=-257,t=qd(e,t,n)):t.memoizedState!==null?(xi(),t.child=e.child,t.flags|=128,t=null):(xi(),S=i.fallback,u=t.mode,i=Bu({mode:"visible",children:i.children},u),S=_a(S,u,n,null),S.flags|=2,i.return=t,S.return=t,i.sibling=S,t.child=i,$s(t,e.child,null,n),i=t.child,i.memoizedState=Hd(n),i.childLanes=Bd(e,b,n),t.memoizedState=Ud,t=No(null,i));else if(gi(t),vh(S)){if(b=S.nextSibling&&S.nextSibling.dataset,b)var J=b.dgst;b=J,i=Error(c(419)),i.stack="",i.digest=b,ar({value:i,source:null,stack:null}),t=qd(e,t,n)}else if(Bn||ja(e,t,n,!1),b=(n&e.childLanes)!==0,Bn||b){if(b=Zt,b!==null&&(i=Fl(b,n),i!==0&&i!==M.retryLane))throw M.retryLane=i,Hs(e,i),Il(b,e,i),Ld;yh(S)||Ku(),t=qd(e,t,n)}else yh(S)?(t.flags|=192,t.child=e.child,t=null):(e=M.treeContext,Rt=rs(S.nextSibling),Mn=t,rt=!0,qs=null,Ll=!1,e!==null&&Qr(t,e),t=Id(t,i.children),t.flags|=4096);return t}return u?(xi(),S=i.fallback,u=t.mode,M=e.child,J=M.sibling,i=bs(M,{mode:"hidden",children:i.children}),i.subtreeFlags=M.subtreeFlags&65011712,J!==null?S=bs(J,S):(S=_a(S,u,n,null),S.flags|=2),S.return=t,i.return=t,i.sibling=S,t.child=i,No(null,i),i=t.child,S=e.child.memoizedState,S===null?S=Hd(n):(u=S.cachePool,u!==null?(M=bn._currentValue,u=u.parent!==M?{parent:M,pool:M}:u):u=Nu(),S={baseLanes:S.baseLanes|n,cachePool:u}),i.memoizedState=S,i.childLanes=Bd(e,b,n),t.memoizedState=Ud,No(e.child,i)):(gi(t),n=e.child,e=n.sibling,n=bs(n,{mode:"visible",children:i.children}),n.return=t,n.sibling=null,e!==null&&(b=t.deletions,b===null?(t.deletions=[e],t.flags|=16):b.push(e)),t.child=n,t.memoizedState=null,n)}function Id(e,t){return t=Bu({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Bu(e,t){return e=Sl(22,e,null,t),e.lanes=0,e}function qd(e,t,n){return $s(t,e.child,null,n),e=Id(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Xm(e,t,n){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),mo(e.return,t,n)}function Gd(e,t,n,i,u,f){var b=e.memoizedState;b===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:u,treeForkCount:f}:(b.isBackwards=t,b.rendering=null,b.renderingStartTime=0,b.last=i,b.tail=n,b.tailMode=u,b.treeForkCount=f)}function Vm(e,t,n){var i=t.pendingProps,u=i.revealOrder,f=i.tail;i=i.children;var b=Rn.current,S=(b&2)!==0;if(S?(b=b&1|2,t.flags|=128):b&=1,z(Rn,b),il(e,t,i,n),i=rt?sr:0,!S&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Xm(e,n,t);else if(e.tag===19)Xm(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(u){case"forwards":for(n=t.child,u=null;n!==null;)e=n.alternate,e!==null&&Tu(e)===null&&(u=n),n=n.sibling;n=u,n===null?(u=t.child,t.child=null):(u=n.sibling,n.sibling=null),Gd(t,!1,u,n,f,i);break;case"backwards":case"unstable_legacy-backwards":for(n=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&Tu(e)===null){t.child=u;break}e=u.sibling,u.sibling=n,n=u,u=e}Gd(t,!0,n,null,f,i);break;case"together":Gd(t,!1,null,null,void 0,i);break;default:t.memoizedState=null}return t.child}function za(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),yi|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(ja(e,t,n,!1),(n&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,n=bs(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=bs(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Yd(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&wa(e)))}function xy(e,t,n){switch(t.tag){case 3:Ue(t,t.stateNode.containerInfo),Ys(t,bn,e.memoizedState.cache),ya();break;case 27:case 5:rn(t);break;case 4:Ue(t,t.stateNode.containerInfo);break;case 10:Ys(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,pd(t),null;break;case 13:var i=t.memoizedState;if(i!==null)return i.dehydrated!==null?(gi(t),t.flags|=128,null):(n&t.child.childLanes)!==0?$m(e,t,n):(gi(t),e=za(e,t,n),e!==null?e.sibling:null);gi(t);break;case 19:var u=(e.flags&128)!==0;if(i=(n&t.childLanes)!==0,i||(ja(e,t,n,!1),i=(n&t.childLanes)!==0),u){if(i)return Vm(e,t,n);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),z(Rn,Rn.current),i)break;return null;case 22:return t.lanes=0,Hm(e,t,n,t.pendingProps);case 24:Ys(t,bn,e.memoizedState.cache)}return za(e,t,n)}function Qm(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Bn=!0;else{if(!Yd(e,n)&&(t.flags&128)===0)return Bn=!1,xy(e,t,n);Bn=(e.flags&131072)!==0}else Bn=!1,rt&&(t.flags&1048576)!==0&&ju(t,sr,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=Ca(t.elementType),t.type=e,typeof e=="function")ro(e)?(i=or(e,i),t.tag=1,t=Gm(null,t,e,i,n)):(t.tag=0,t=zd(null,t,e,i,n));else{if(e!=null){var u=e.$$typeof;if(u===H){t.tag=11,t=Lm(null,t,e,i,n);break e}else if(u===D){t.tag=14,t=zm(null,t,e,i,n);break e}}throw t=Ee(e)||e,Error(c(306,t,""))}}return t;case 0:return zd(e,t,t.type,t.pendingProps,n);case 1:return i=t.type,u=or(i,t.pendingProps),Gm(e,t,i,u,n);case 3:e:{if(Ue(t,t.stateNode.containerInfo),e===null)throw Error(c(387));i=t.pendingProps;var f=t.memoizedState;u=f.element,Me(e,t),xe(t,i,null,n);var b=t.memoizedState;if(i=b.cache,Ys(t,bn,i),i!==f.cache&&Kr(t,[bn],n,!0),mi(),i=b.element,f.isDehydrated)if(f={element:i,isDehydrated:!1,cache:b.cache},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){t=Ym(e,t,i,n);break e}else if(i!==u){u=Rl(Error(c(424)),t),ar(u),t=Ym(e,t,i,n);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(Rt=rs(e.firstChild),Mn=t,rt=!0,qs=null,Ll=!0,n=p(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(ya(),i===u){t=za(e,t,n);break e}il(e,t,i,n)}t=t.child}return t;case 26:return Hu(e,t),e===null?(n=sx(t.type,null,t.pendingProps,null))?t.memoizedState=n:rt||(n=t.type,e=t.pendingProps,i=tf(Re.current).createElement(n),i[Lt]=t,i[Ze]=e,rl(i,n,e),it(i),t.stateNode=i):t.memoizedState=sx(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return rn(t),e===null&&rt&&(i=t.stateNode=tx(t.type,t.pendingProps,Re.current),Mn=t,Ll=!0,u=Rt,Ni(t.type)?(jh=u,Rt=rs(i.firstChild)):Rt=u),il(e,t,t.pendingProps.children,n),Hu(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&rt&&((u=i=Rt)&&(i=Qy(i,t.type,t.pendingProps,Ll),i!==null?(t.stateNode=i,Mn=t,Rt=rs(i.firstChild),Ll=!1,u=!0):u=!1),u||Gs(t)),rn(t),u=t.type,f=t.pendingProps,b=e!==null?e.memoizedProps:null,i=f.children,xh(u,f)?i=null:b!==null&&xh(u,b)&&(t.flags|=32),t.memoizedState!==null&&(u=gd(e,t,cy,null,null,n),Io._currentValue=u),Hu(e,t),il(e,t,i,n),t.child;case 6:return e===null&&rt&&((e=n=Rt)&&(n=Ky(n,t.pendingProps,Ll),n!==null?(t.stateNode=n,Mn=t,Rt=null,e=!0):e=!1),e||Gs(t)),null;case 13:return $m(e,t,n);case 4:return Ue(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=$s(t,null,i,n):il(e,t,i,n),t.child;case 11:return Lm(e,t,t.type,t.pendingProps,n);case 7:return il(e,t,t.pendingProps,n),t.child;case 8:return il(e,t,t.pendingProps.children,n),t.child;case 12:return il(e,t,t.pendingProps.children,n),t.child;case 10:return i=t.pendingProps,Ys(t,t.type,i.value),il(e,t,i.children,n),t.child;case 9:return u=t.type._context,i=t.pendingProps.children,Qn(t),u=Ut(u),i=i(u),t.flags|=1,il(e,t,i,n),t.child;case 14:return zm(e,t,t.type,t.pendingProps,n);case 15:return Um(e,t,t.type,t.pendingProps,n);case 19:return Vm(e,t,n);case 31:return gy(e,t,n);case 22:return Hm(e,t,n,t.pendingProps);case 24:return Qn(t),i=Ut(bn),e===null?(u=Ta(),u===null&&(u=Zt,f=fi(),u.pooledCache=f,f.refCount++,f!==null&&(u.pooledCacheLanes|=n),u=f),t.memoizedState={parent:i,cache:u},re(t),Ys(t,bn,u)):((e.lanes&n)!==0&&(Me(e,t),xe(t,null,null,n),mi()),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),Ys(t,bn,i)):(i=f.cache,Ys(t,bn,i),i!==u.cache&&Kr(t,[bn],n,!0))),il(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function Ua(e){e.flags|=4}function $d(e,t,n,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(yg())e.flags|=8192;else throw Aa=ec,Pr}else e.flags&=-16777217}function Km(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!ox(t))if(yg())e.flags|=8192;else throw Aa=ec,Pr}function Iu(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Le():536870912,e.lanes|=t,uc|=t)}function ko(e,t){if(!rt)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function nn(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,i=0;if(t)for(var u=e.child;u!==null;)n|=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;)n|=u.lanes|u.childLanes,i|=u.subtreeFlags,i|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=i,e.childLanes=n,t}function by(e,t,n){var i=t.pendingProps;switch(uo(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return nn(t),null;case 1:return nn(t),null;case 3:return n=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),vs(bn),qe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ui(t)?Ua(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,ho())),nn(t),null;case 26:var u=t.type,f=t.memoizedState;return e===null?(Ua(t),f!==null?(nn(t),Km(t,f)):(nn(t),$d(t,u,null,i,n))):f?f!==e.memoizedState?(Ua(t),nn(t),Km(t,f)):(nn(t),t.flags&=-16777217):(e=e.memoizedProps,e!==i&&Ua(t),nn(t),$d(t,u,e,i,n)),null;case 27:if(Ve(t),n=Re.current,u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&Ua(t);else{if(!i){if(t.stateNode===null)throw Error(c(166));return nn(t),null}e=ge.current,ui(t)?wu(t):(e=tx(u,i,n),t.stateNode=e,Ua(t))}return nn(t),null;case 5:if(Ve(t),u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&Ua(t);else{if(!i){if(t.stateNode===null)throw Error(c(166));return nn(t),null}if(f=ge.current,ui(t))wu(t);else{var b=tf(Re.current);switch(f){case 1:f=b.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:f=b.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":f=b.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":f=b.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":f=b.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof i.is=="string"?b.createElement("select",{is:i.is}):b.createElement("select"),i.multiple?f.multiple=!0:i.size&&(f.size=i.size);break;default:f=typeof i.is=="string"?b.createElement(u,{is:i.is}):b.createElement(u)}}f[Lt]=t,f[Ze]=i;e:for(b=t.child;b!==null;){if(b.tag===5||b.tag===6)f.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===t)break e;for(;b.sibling===null;){if(b.return===null||b.return===t)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}t.stateNode=f;e:switch(rl(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&&Ua(t)}}return nn(t),$d(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&Ua(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(c(166));if(e=Re.current,ui(t)){if(e=t.stateNode,n=t.memoizedProps,i=null,u=Mn,u!==null)switch(u.tag){case 27:case 5:i=u.memoizedProps}e[Lt]=t,e=!!(e.nodeValue===n||i!==null&&i.suppressHydrationWarning===!0||$g(e.nodeValue,n)),e||Gs(t,!0)}else e=tf(e).createTextNode(i),e[Lt]=t,t.stateNode=e}return nn(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(i=ui(t),n!==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[Lt]=t}else ya(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;nn(t),e=!1}else n=ho(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Xl(t),t):(Xl(t),null);if((t.flags&128)!==0)throw Error(c(558))}return nn(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=ui(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[Lt]=t}else ya(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;nn(t),u=!1}else u=ho(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(Xl(t),t):(Xl(t),null)}return Xl(t),(t.flags&128)!==0?(t.lanes=n,t):(n=i!==null,e=e!==null&&e.memoizedState!==null,n&&(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)),n!==e&&n&&(t.child.flags|=8192),Iu(t,t.updateQueue),nn(t),null);case 4:return qe(),e===null&&dh(t.stateNode.containerInfo),nn(t),null;case 10:return vs(t.type),nn(t),null;case 19:if(V(Rn),i=t.memoizedState,i===null)return nn(t),null;if(u=(t.flags&128)!==0,f=i.rendering,f===null)if(u)ko(i,!1);else{if(Sn!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=Tu(e),f!==null){for(t.flags|=128,ko(i,!1),e=f.updateQueue,t.updateQueue=e,Iu(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ri(n,e),n=n.sibling;return z(Rn,Rn.current&1|2),rt&&_s(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&tt()>Xu&&(t.flags|=128,u=!0,ko(i,!1),t.lanes=4194304)}else{if(!u)if(e=Tu(f),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,Iu(t,e),ko(i,!0),i.tail===null&&i.tailMode==="hidden"&&!f.alternate&&!rt)return nn(t),null}else 2*tt()-i.renderingStartTime>Xu&&n!==536870912&&(t.flags|=128,u=!0,ko(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=tt(),e.sibling=null,n=Rn.current,z(Rn,u?n&1|2:n&1),rt&&_s(t,i.treeForkCount),e):(nn(t),null);case 22:case 23:return Xl(t),hd(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?(n&536870912)!==0&&(t.flags&128)===0&&(nn(t),t.subtreeFlags&6&&(t.flags|=8192)):nn(t),n=t.updateQueue,n!==null&&Iu(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==n&&(t.flags|=2048),e!==null&&V(ka),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),vs(bn),nn(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function _y(e,t){switch(uo(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return vs(bn),qe(),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(Xl(t),t.alternate===null)throw Error(c(340));ya()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Xl(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));ya()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return V(Rn),null;case 4:return qe(),null;case 10:return vs(t.type),null;case 22:case 23:return Xl(t),hd(),e!==null&&V(ka),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return vs(bn),null;case 25:return null;default:return null}}function Zm(e,t){switch(uo(t),t.tag){case 3:vs(bn),qe();break;case 26:case 27:case 5:Ve(t);break;case 4:qe();break;case 31:t.memoizedState!==null&&Xl(t);break;case 13:Xl(t);break;case 19:V(Rn);break;case 10:vs(t.type);break;case 22:case 23:Xl(t),hd(),e!==null&&V(ka);break;case 24:vs(bn)}}function To(e,t){try{var n=t.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var u=i.next;n=u;do{if((n.tag&e)===e){i=void 0;var f=n.create,b=n.inst;i=f(),b.destroy=i}n=n.next}while(n!==u)}}catch(S){It(t,t.return,S)}}function bi(e,t,n){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 b=i.inst,S=b.destroy;if(S!==void 0){b.destroy=void 0,u=t;var M=n,J=S;try{J()}catch(se){It(u,M,se)}}}i=i.next}while(i!==f)}}catch(se){It(t,t.return,se)}}function Fm(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Qe(t,n)}catch(i){It(e,e.return,i)}}}function Jm(e,t,n){n.props=or(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(i){It(e,t,i)}}function Eo(e,t){try{var n=e.ref;if(n!==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 n=="function"?e.refCleanup=n(i):n.current=i}}catch(u){It(e,t,u)}}function Xs(e,t){var n=e.ref,i=e.refCleanup;if(n!==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 n=="function")try{n(null)}catch(u){It(e,t,u)}else n.current=null}function Pm(e){var t=e.type,n=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&i.focus();break e;case"img":n.src?i.src=n.src:n.srcSet&&(i.srcset=n.srcSet)}}catch(u){It(e,e.return,u)}}function Xd(e,t,n){try{var i=e.stateNode;qy(i,e.type,n,t),i[Ze]=t}catch(u){It(e,e.return,u)}}function Wm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ni(e.type)||e.tag===4}function Vd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Wm(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&&Ni(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 Qd(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=yt));else if(i!==4&&(i===27&&Ni(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Qd(e,t,n),e=e.sibling;e!==null;)Qd(e,t,n),e=e.sibling}function qu(e,t,n){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(i!==4&&(i===27&&Ni(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(qu(e,t,n),e=e.sibling;e!==null;)qu(e,t,n),e=e.sibling}function eg(e){var t=e.stateNode,n=e.memoizedProps;try{for(var i=e.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);rl(t,i,n),t[Lt]=e,t[Ze]=n}catch(f){It(e,e.return,f)}}var Ha=!1,In=!1,Kd=!1,tg=typeof WeakSet=="function"?WeakSet:Set,Fn=null;function yy(e,t){if(e=e.containerInfo,mh=of,e=hu(e),no(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var u=i.anchorOffset,f=i.focusNode;i=i.focusOffset;try{n.nodeType,f.nodeType}catch{n=null;break e}var b=0,S=-1,M=-1,J=0,se=0,fe=e,W=null;t:for(;;){for(var ne;fe!==n||u!==0&&fe.nodeType!==3||(S=b+u),fe!==f||i!==0&&fe.nodeType!==3||(M=b+i),fe.nodeType===3&&(b+=fe.nodeValue.length),(ne=fe.firstChild)!==null;)W=fe,fe=ne;for(;;){if(fe===e)break t;if(W===n&&++J===u&&(S=b),W===f&&++se===i&&(M=b),(ne=fe.nextSibling)!==null)break;fe=W,W=fe.parentNode}fe=ne}n=S===-1||M===-1?null:{start:S,end:M}}else n=null}n=n||{start:0,end:0}}else n=null;for(gh={focusedElem:e,selectionRange:n},of=!1,Fn=t;Fn!==null;)if(t=Fn,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Fn=e;else for(;Fn!==null;){switch(t=Fn,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(n=0;n<e.length;n++)u=e[n],u.ref.impl=u.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&f!==null){e=void 0,n=t,u=f.memoizedProps,f=f.memoizedState,i=n.stateNode;try{var De=or(n.type,u);e=i.getSnapshotBeforeUpdate(De,f),i.__reactInternalSnapshotBeforeUpdate=e}catch($e){It(n,n.return,$e)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)_h(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":_h(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,Fn=e;break}Fn=t.return}}function ng(e,t,n){var i=n.flags;switch(n.tag){case 0:case 11:case 15:Ia(e,n),i&4&&To(5,n);break;case 1:if(Ia(e,n),i&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(b){It(n,n.return,b)}else{var u=or(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(b){It(n,n.return,b)}}i&64&&Fm(n),i&512&&Eo(n,n.return);break;case 3:if(Ia(e,n),i&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Qe(e,t)}catch(b){It(n,n.return,b)}}break;case 27:t===null&&i&4&&eg(n);case 26:case 5:Ia(e,n),t===null&&i&4&&Pm(n),i&512&&Eo(n,n.return);break;case 12:Ia(e,n);break;case 31:Ia(e,n),i&4&&ag(e,n);break;case 13:Ia(e,n),i&4&&ig(e,n),i&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Cy.bind(null,n),Zy(e,n))));break;case 22:if(i=n.memoizedState!==null||Ha,!i){t=t!==null&&t.memoizedState!==null||In,u=Ha;var f=In;Ha=i,(In=t)&&!f?qa(e,n,(n.subtreeFlags&8772)!==0):Ia(e,n),Ha=u,In=f}break;case 30:break;default:Ia(e,n)}}function lg(e){var t=e.alternate;t!==null&&(e.alternate=null,lg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ps(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 hn=null,zl=!1;function Ba(e,t,n){for(n=n.child;n!==null;)sg(e,t,n),n=n.sibling}function sg(e,t,n){if(St&&typeof St.onCommitFiberUnmount=="function")try{St.onCommitFiberUnmount(en,n)}catch{}switch(n.tag){case 26:In||Xs(n,t),Ba(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:In||Xs(n,t);var i=hn,u=zl;Ni(n.type)&&(hn=n.stateNode,zl=!1),Ba(e,t,n),Uo(n.stateNode),hn=i,zl=u;break;case 5:In||Xs(n,t);case 6:if(i=hn,u=zl,hn=null,Ba(e,t,n),hn=i,zl=u,hn!==null)if(zl)try{(hn.nodeType===9?hn.body:hn.nodeName==="HTML"?hn.ownerDocument.body:hn).removeChild(n.stateNode)}catch(f){It(n,t,f)}else try{hn.removeChild(n.stateNode)}catch(f){It(n,t,f)}break;case 18:hn!==null&&(zl?(e=hn,Fg(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),bc(e)):Fg(hn,n.stateNode));break;case 4:i=hn,u=zl,hn=n.stateNode.containerInfo,zl=!0,Ba(e,t,n),hn=i,zl=u;break;case 0:case 11:case 14:case 15:bi(2,n,t),In||bi(4,n,t),Ba(e,t,n);break;case 1:In||(Xs(n,t),i=n.stateNode,typeof i.componentWillUnmount=="function"&&Jm(n,t,i)),Ba(e,t,n);break;case 21:Ba(e,t,n);break;case 22:In=(i=In)||n.memoizedState!==null,Ba(e,t,n),In=i;break;default:Ba(e,t,n)}}function ag(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{bc(e)}catch(n){It(t,t.return,n)}}}function ig(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{bc(e)}catch(n){It(t,t.return,n)}}function vy(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new tg),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new tg),t;default:throw Error(c(435,e.tag))}}function Gu(e,t){var n=vy(e);t.forEach(function(i){if(!n.has(i)){n.add(i);var u=Ay.bind(null,e,i);i.then(u,u)}})}function Ul(e,t){var n=t.deletions;if(n!==null)for(var i=0;i<n.length;i++){var u=n[i],f=e,b=t,S=b;e:for(;S!==null;){switch(S.tag){case 27:if(Ni(S.type)){hn=S.stateNode,zl=!1;break e}break;case 5:hn=S.stateNode,zl=!1;break e;case 3:case 4:hn=S.stateNode.containerInfo,zl=!0;break e}S=S.return}if(hn===null)throw Error(c(160));sg(f,b,u),hn=null,zl=!1,f=u.alternate,f!==null&&(f.return=null),u.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)rg(t,e),t=t.sibling}var Ss=null;function rg(e,t){var n=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ul(t,e),Hl(e),i&4&&(bi(3,e,e.return),To(3,e),bi(5,e,e.return));break;case 1:Ul(t,e),Hl(e),i&512&&(In||n===null||Xs(n,n.return)),i&64&&Ha&&(e=e.updateQueue,e!==null&&(i=e.callbacks,i!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?i:n.concat(i))));break;case 26:var u=Ss;if(Ul(t,e),Hl(e),i&512&&(In||n===null||Xs(n,n.return)),i&4){var f=n!==null?n.memoizedState:null;if(i=e.memoizedState,n===null)if(i===null)if(e.stateNode===null){e:{i=e.type,n=e.memoizedProps,u=u.ownerDocument||u;t:switch(i){case"title":f=u.getElementsByTagName("title")[0],(!f||f[Qt]||f[Lt]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=u.createElement(i),u.head.insertBefore(f,u.querySelector("head > title"))),rl(f,i,n),f[Lt]=e,it(f),i=f;break e;case"link":var b=rx("link","href",u).get(i+(n.href||""));if(b){for(var S=0;S<b.length;S++)if(f=b[S],f.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&f.getAttribute("rel")===(n.rel==null?null:n.rel)&&f.getAttribute("title")===(n.title==null?null:n.title)&&f.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){b.splice(S,1);break t}}f=u.createElement(i),rl(f,i,n),u.head.appendChild(f);break;case"meta":if(b=rx("meta","content",u).get(i+(n.content||""))){for(S=0;S<b.length;S++)if(f=b[S],f.getAttribute("content")===(n.content==null?null:""+n.content)&&f.getAttribute("name")===(n.name==null?null:n.name)&&f.getAttribute("property")===(n.property==null?null:n.property)&&f.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&f.getAttribute("charset")===(n.charSet==null?null:n.charSet)){b.splice(S,1);break t}}f=u.createElement(i),rl(f,i,n),u.head.appendChild(f);break;default:throw Error(c(468,i))}f[Lt]=e,it(f),i=f}e.stateNode=i}else cx(u,e.type,e.stateNode);else e.stateNode=ix(u,i,e.memoizedProps);else f!==i?(f===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):f.count--,i===null?cx(u,e.type,e.stateNode):ix(u,i,e.memoizedProps)):i===null&&e.stateNode!==null&&Xd(e,e.memoizedProps,n.memoizedProps)}break;case 27:Ul(t,e),Hl(e),i&512&&(In||n===null||Xs(n,n.return)),n!==null&&i&4&&Xd(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Ul(t,e),Hl(e),i&512&&(In||n===null||Xs(n,n.return)),e.flags&32){u=e.stateNode;try{Q(u,"")}catch(De){It(e,e.return,De)}}i&4&&e.stateNode!=null&&(u=e.memoizedProps,Xd(e,u,n!==null?n.memoizedProps:u)),i&1024&&(Kd=!0);break;case 6:if(Ul(t,e),Hl(e),i&4){if(e.stateNode===null)throw Error(c(162));i=e.memoizedProps,n=e.stateNode;try{n.nodeValue=i}catch(De){It(e,e.return,De)}}break;case 3:if(sf=null,u=Ss,Ss=nf(t.containerInfo),Ul(t,e),Ss=u,Hl(e),i&4&&n!==null&&n.memoizedState.isDehydrated)try{bc(t.containerInfo)}catch(De){It(e,e.return,De)}Kd&&(Kd=!1,cg(e));break;case 4:i=Ss,Ss=nf(e.stateNode.containerInfo),Ul(t,e),Hl(e),Ss=i;break;case 12:Ul(t,e),Hl(e);break;case 31:Ul(t,e),Hl(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Gu(e,i)));break;case 13:Ul(t,e),Hl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&($u=tt()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Gu(e,i)));break;case 22:u=e.memoizedState!==null;var M=n!==null&&n.memoizedState!==null,J=Ha,se=In;if(Ha=J||u,In=se||M,Ul(t,e),In=se,Ha=J,Hl(e),i&8192)e:for(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,u&&(n===null||M||Ha||In||ur(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){M=n=t;try{if(f=M.stateNode,u)b=f.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{S=M.stateNode;var fe=M.memoizedProps.style,W=fe!=null&&fe.hasOwnProperty("display")?fe.display:null;S.style.display=W==null||typeof W=="boolean"?"":(""+W).trim()}}catch(De){It(M,M.return,De)}}}else if(t.tag===6){if(n===null){M=t;try{M.stateNode.nodeValue=u?"":M.memoizedProps}catch(De){It(M,M.return,De)}}}else if(t.tag===18){if(n===null){M=t;try{var ne=M.stateNode;u?Jg(ne,!0):Jg(M.stateNode,!1)}catch(De){It(M,M.return,De)}}}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;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}i&4&&(i=e.updateQueue,i!==null&&(n=i.retryQueue,n!==null&&(i.retryQueue=null,Gu(e,n))));break;case 19:Ul(t,e),Hl(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Gu(e,i)));break;case 30:break;case 21:break;default:Ul(t,e),Hl(e)}}function Hl(e){var t=e.flags;if(t&2){try{for(var n,i=e.return;i!==null;){if(Wm(i)){n=i;break}i=i.return}if(n==null)throw Error(c(160));switch(n.tag){case 27:var u=n.stateNode,f=Vd(e);qu(e,f,u);break;case 5:var b=n.stateNode;n.flags&32&&(Q(b,""),n.flags&=-33);var S=Vd(e);qu(e,S,b);break;case 3:case 4:var M=n.stateNode.containerInfo,J=Vd(e);Qd(e,J,M);break;default:throw Error(c(161))}}catch(se){It(e,e.return,se)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function cg(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;cg(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Ia(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)ng(e,t.alternate,t),t=t.sibling}function ur(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:bi(4,t,t.return),ur(t);break;case 1:Xs(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Jm(t,t.return,n),ur(t);break;case 27:Uo(t.stateNode);case 26:case 5:Xs(t,t.return),ur(t);break;case 22:t.memoizedState===null&&ur(t);break;case 30:ur(t);break;default:ur(t)}e=e.sibling}}function qa(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var i=t.alternate,u=e,f=t,b=f.flags;switch(f.tag){case 0:case 11:case 15:qa(u,f,n),To(4,f);break;case 1:if(qa(u,f,n),i=f,u=i.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(J){It(i,i.return,J)}if(i=f,u=i.updateQueue,u!==null){var S=i.stateNode;try{var M=u.shared.hiddenCallbacks;if(M!==null)for(u.shared.hiddenCallbacks=null,u=0;u<M.length;u++)Ce(M[u],S)}catch(J){It(i,i.return,J)}}n&&b&64&&Fm(f),Eo(f,f.return);break;case 27:eg(f);case 26:case 5:qa(u,f,n),n&&i===null&&b&4&&Pm(f),Eo(f,f.return);break;case 12:qa(u,f,n);break;case 31:qa(u,f,n),n&&b&4&&ag(u,f);break;case 13:qa(u,f,n),n&&b&4&&ig(u,f);break;case 22:f.memoizedState===null&&qa(u,f,n),Eo(f,f.return);break;case 30:break;default:qa(u,f,n)}t=t.sibling}}function Zd(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Sa(n))}function Fd(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Sa(e))}function Ns(e,t,n,i){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)og(e,t,n,i),t=t.sibling}function og(e,t,n,i){var u=t.flags;switch(t.tag){case 0:case 11:case 15:Ns(e,t,n,i),u&2048&&To(9,t);break;case 1:Ns(e,t,n,i);break;case 3:Ns(e,t,n,i),u&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Sa(e)));break;case 12:if(u&2048){Ns(e,t,n,i),e=t.stateNode;try{var f=t.memoizedProps,b=f.id,S=f.onPostCommit;typeof S=="function"&&S(b,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(M){It(t,t.return,M)}}else Ns(e,t,n,i);break;case 31:Ns(e,t,n,i);break;case 13:Ns(e,t,n,i);break;case 23:break;case 22:f=t.stateNode,b=t.alternate,t.memoizedState!==null?f._visibility&2?Ns(e,t,n,i):Co(e,t):f._visibility&2?Ns(e,t,n,i):(f._visibility|=2,rc(e,t,n,i,(t.subtreeFlags&10256)!==0||!1)),u&2048&&Zd(b,t);break;case 24:Ns(e,t,n,i),u&2048&&Fd(t.alternate,t);break;default:Ns(e,t,n,i)}}function rc(e,t,n,i,u){for(u=u&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var f=e,b=t,S=n,M=i,J=b.flags;switch(b.tag){case 0:case 11:case 15:rc(f,b,S,M,u),To(8,b);break;case 23:break;case 22:var se=b.stateNode;b.memoizedState!==null?se._visibility&2?rc(f,b,S,M,u):Co(f,b):(se._visibility|=2,rc(f,b,S,M,u)),u&&J&2048&&Zd(b.alternate,b);break;case 24:rc(f,b,S,M,u),u&&J&2048&&Fd(b.alternate,b);break;default:rc(f,b,S,M,u)}t=t.sibling}}function Co(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,i=t,u=i.flags;switch(i.tag){case 22:Co(n,i),u&2048&&Zd(i.alternate,i);break;case 24:Co(n,i),u&2048&&Fd(i.alternate,i);break;default:Co(n,i)}t=t.sibling}}var Ao=8192;function cc(e,t,n){if(e.subtreeFlags&Ao)for(e=e.child;e!==null;)ug(e,t,n),e=e.sibling}function ug(e,t,n){switch(e.tag){case 26:cc(e,t,n),e.flags&Ao&&e.memoizedState!==null&&r0(n,Ss,e.memoizedState,e.memoizedProps);break;case 5:cc(e,t,n);break;case 3:case 4:var i=Ss;Ss=nf(e.stateNode.containerInfo),cc(e,t,n),Ss=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=Ao,Ao=16777216,cc(e,t,n),Ao=i):cc(e,t,n));break;default:cc(e,t,n)}}function fg(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 Mo(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var i=t[n];Fn=i,hg(i,e)}fg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)dg(e),e=e.sibling}function dg(e){switch(e.tag){case 0:case 11:case 15:Mo(e),e.flags&2048&&bi(9,e,e.return);break;case 3:Mo(e);break;case 12:Mo(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Yu(e)):Mo(e);break;default:Mo(e)}}function Yu(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var i=t[n];Fn=i,hg(i,e)}fg(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:bi(8,t,t.return),Yu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Yu(t));break;default:Yu(t)}e=e.sibling}}function hg(e,t){for(;Fn!==null;){var n=Fn;switch(n.tag){case 0:case 11:case 15:bi(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var i=n.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:Sa(n.memoizedState.cache)}if(i=n.child,i!==null)i.return=n,Fn=i;else e:for(n=e;Fn!==null;){i=Fn;var u=i.sibling,f=i.return;if(lg(i),i===n){Fn=null;break e}if(u!==null){u.return=f,Fn=u;break e}Fn=f}}}var jy={getCacheForType:function(e){var t=Ut(bn),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Ut(bn).controller.signal}},wy=typeof WeakMap=="function"?WeakMap:Map,Tt=0,Zt=null,ct=null,ft=0,Bt=0,Vl=null,_i=!1,oc=!1,Jd=!1,Ga=0,Sn=0,yi=0,fr=0,Pd=0,Ql=0,uc=0,Ro=null,Bl=null,Wd=!1,$u=0,pg=0,Xu=1/0,Vu=null,vi=null,Kn=0,ji=null,fc=null,Ya=0,eh=0,th=null,mg=null,Do=0,nh=null;function Kl(){return(Tt&2)!==0&&ft!==0?ft&-ft:X.T!==null?ch():Ka()}function gg(){if(Ql===0)if((ft&536870912)===0||rt){var e=Fe;Fe<<=1,(Fe&3932160)===0&&(Fe=262144),Ql=e}else Ql=536870912;return e=$l.current,e!==null&&(e.flags|=32),Ql}function Il(e,t,n){(e===Zt&&(Bt===2||Bt===9)||e.cancelPendingCommit!==null)&&(dc(e,0),wi(e,ft,Ql,!1)),Tn(e,n),((Tt&2)===0||e!==Zt)&&(e===Zt&&((Tt&2)===0&&(fr|=n),Sn===4&&wi(e,ft,Ql,!1)),Vs(e))}function xg(e,t,n){if((Tt&6)!==0)throw Error(c(327));var i=!n&&(t&127)===0&&(t&e.expiredLanes)===0||oe(e,t),u=i?ky(e,t):sh(e,t,!0),f=i;do{if(u===0){oc&&!i&&wi(e,t,0,!1);break}else{if(n=e.current.alternate,f&&!Sy(n)){u=sh(e,t,!1),f=!1;continue}if(u===2){if(f=t,e.errorRecoveryDisabledLanes&f)var b=0;else b=e.pendingLanes&-536870913,b=b!==0?b:b&536870912?536870912:0;if(b!==0){t=b;e:{var S=e;u=Ro;var M=S.current.memoizedState.isDehydrated;if(M&&(dc(S,b).flags|=256),b=sh(S,b,!1),b!==2){if(Jd&&!M){S.errorRecoveryDisabledLanes|=f,fr|=f,u=4;break e}f=Bl,Bl=u,f!==null&&(Bl===null?Bl=f:Bl.push.apply(Bl,f))}u=b}if(f=!1,u!==2)continue}}if(u===1){dc(e,0),wi(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:wi(i,t,Ql,!_i);break e;case 2:Bl=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(u=$u+300-tt(),10<u)){if(wi(i,t,Ql,!_i),I(i,0,!0)!==0)break e;Ya=t,i.timeoutHandle=Kg(bg.bind(null,i,n,Bl,Vu,Wd,t,Ql,fr,uc,_i,f,"Throttled",-0,0),u);break e}bg(i,n,Bl,Vu,Wd,t,Ql,fr,uc,_i,f,null,-0,0)}}break}while(!0);Vs(e)}function bg(e,t,n,i,u,f,b,S,M,J,se,fe,W,ne){if(e.timeoutHandle=-1,fe=t.subtreeFlags,fe&8192||(fe&16785408)===16785408){fe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:yt},ug(t,f,fe);var De=(f&62914560)===f?$u-tt():(f&4194048)===f?pg-tt():0;if(De=c0(fe,De),De!==null){Ya=f,e.cancelPendingCommit=De(kg.bind(null,e,t,f,n,i,u,b,S,M,se,fe,null,W,ne)),wi(e,f,b,!J);return}}kg(e,t,f,n,i,u,b,S,M)}function Sy(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var i=0;i<n.length;i++){var u=n[i],f=u.getSnapshot;u=u.value;try{if(!ml(f(),u))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function wi(e,t,n,i){t&=~Pd,t&=~fr,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var u=t;0<u;){var f=31-Nt(u),b=1<<f;i[f]=-1,u&=~b}n!==0&&yl(e,n,t)}function Qu(){return(Tt&6)===0?(Oo(0),!1):!0}function lh(){if(ct!==null){if(Bt===0)var e=ct.return;else e=ct,ys=va=null,_d(e),Ma=null,rr=0,e=ct;for(;e!==null;)Zm(e.alternate,e),e=e.return;ct=null}}function dc(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,$y(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Ya=0,lh(),Zt=e,ct=n=bs(e.current,null),ft=t,Bt=0,Vl=null,_i=!1,oc=oe(e,t),Jd=!1,uc=Ql=Pd=fr=yi=Sn=0,Bl=Ro=null,Wd=!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-Nt(i),f=1<<u;t|=e[u],i&=~f}return Ga=t,tr(),n}function _g(e,t){We=null,X.H=So,t===Ea||t===Wr?(t=ku(),Bt=3):t===Pr?(t=ku(),Bt=4):Bt=t===Ld?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Vl=t,ct===null&&(Sn=1,zu(e,Rl(t,e.current)))}function yg(){var e=$l.current;return e===null?!0:(ft&4194048)===ft?is===null:(ft&62914560)===ft||(ft&536870912)!==0?e===is:!1}function vg(){var e=X.H;return X.H=So,e===null?So:e}function jg(){var e=X.A;return X.A=jy,e}function Ku(){Sn=4,_i||(ft&4194048)!==ft&&$l.current!==null||(oc=!0),(yi&134217727)===0&&(fr&134217727)===0||Zt===null||wi(Zt,ft,Ql,!1)}function sh(e,t,n){var i=Tt;Tt|=2;var u=vg(),f=jg();(Zt!==e||ft!==t)&&(Vu=null,dc(e,t)),t=!1;var b=Sn;e:do try{if(Bt!==0&&ct!==null){var S=ct,M=Vl;switch(Bt){case 8:lh(),b=6;break e;case 3:case 2:case 9:case 6:$l.current===null&&(t=!0);var J=Bt;if(Bt=0,Vl=null,hc(e,S,M,J),n&&oc){b=0;break e}break;default:J=Bt,Bt=0,Vl=null,hc(e,S,M,J)}}Ny(),b=Sn;break}catch(se){_g(e,se)}while(!0);return t&&e.shellSuspendCounter++,ys=va=null,Tt=i,X.H=u,X.A=f,ct===null&&(Zt=null,ft=0,tr()),b}function Ny(){for(;ct!==null;)wg(ct)}function ky(e,t){var n=Tt;Tt|=2;var i=vg(),u=jg();Zt!==e||ft!==t?(Vu=null,Xu=tt()+500,dc(e,t)):oc=oe(e,t);e:do try{if(Bt!==0&&ct!==null){t=ct;var f=Vl;t:switch(Bt){case 1:Bt=0,Vl=null,hc(e,t,f,1);break;case 2:case 9:if(xo(f)){Bt=0,Vl=null,Sg(t);break}t=function(){Bt!==2&&Bt!==9||Zt!==e||(Bt=7),Vs(e)},f.then(t,t);break e;case 3:Bt=7;break e;case 4:Bt=5;break e;case 7:xo(f)?(Bt=0,Vl=null,Sg(t)):(Bt=0,Vl=null,hc(e,t,f,7));break;case 5:var b=null;switch(ct.tag){case 26:b=ct.memoizedState;case 5:case 27:var S=ct;if(b?ox(b):S.stateNode.complete){Bt=0,Vl=null;var M=S.sibling;if(M!==null)ct=M;else{var J=S.return;J!==null?(ct=J,Zu(J)):ct=null}break t}}Bt=0,Vl=null,hc(e,t,f,5);break;case 6:Bt=0,Vl=null,hc(e,t,f,6);break;case 8:lh(),Sn=6;break e;default:throw Error(c(462))}}Ty();break}catch(se){_g(e,se)}while(!0);return ys=va=null,X.H=i,X.A=u,Tt=n,ct!==null?0:(Zt=null,ft=0,tr(),Sn)}function Ty(){for(;ct!==null&&!el();)wg(ct)}function wg(e){var t=Qm(e.alternate,e,Ga);e.memoizedProps=e.pendingProps,t===null?Zu(e):ct=t}function Sg(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=qm(n,t,t.pendingProps,t.type,void 0,ft);break;case 11:t=qm(n,t,t.pendingProps,t.type.render,t.ref,ft);break;case 5:_d(t);default:Zm(n,t),t=ct=ri(t,Ga),t=Qm(n,t,Ga)}e.memoizedProps=e.pendingProps,t===null?Zu(e):ct=t}function hc(e,t,n,i){ys=va=null,_d(t),Ma=null,rr=0;var u=t.return;try{if(my(e,u,t,n,ft)){Sn=1,zu(e,Rl(n,e.current)),ct=null;return}}catch(f){if(u!==null)throw ct=u,f;Sn=1,zu(e,Rl(n,e.current)),ct=null;return}t.flags&32768?(rt||i===1?e=!0:oc||(ft&536870912)!==0?e=!1:(_i=e=!0,(i===2||i===9||i===3||i===6)&&(i=$l.current,i!==null&&i.tag===13&&(i.flags|=16384))),Ng(t,e)):Zu(t)}function Zu(e){var t=e;do{if((t.flags&32768)!==0){Ng(t,_i);return}e=t.return;var n=by(t.alternate,t,Ga);if(n!==null){ct=n;return}if(t=t.sibling,t!==null){ct=t;return}ct=t=e}while(t!==null);Sn===0&&(Sn=5)}function Ng(e,t){do{var n=_y(e.alternate,e);if(n!==null){n.flags&=32767,ct=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){ct=e;return}ct=e=n}while(e!==null);Sn=6,ct=null}function kg(e,t,n,i,u,f,b,S,M){e.cancelPendingCommit=null;do Fu();while(Kn!==0);if((Tt&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));if(f=t.lanes|t.childLanes,f|=Gr,ul(e,n,f,b,S,M),e===Zt&&(ct=Zt=null,ft=0),fc=t,ji=e,Ya=n,eh=f,th=u,mg=i,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,My(nt,function(){return Mg(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||i){i=X.T,X.T=null,u=ue.p,ue.p=2,b=Tt,Tt|=4;try{yy(e,t,n)}finally{Tt=b,ue.p=u,X.T=i}}Kn=1,Tg(),Eg(),Cg()}}function Tg(){if(Kn===1){Kn=0;var e=ji,t=fc,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=X.T,X.T=null;var i=ue.p;ue.p=2;var u=Tt;Tt|=4;try{rg(t,e);var f=gh,b=hu(e.containerInfo),S=f.focusedElem,M=f.selectionRange;if(b!==S&&S&&S.ownerDocument&&du(S.ownerDocument.documentElement,S)){if(M!==null&&no(S)){var J=M.start,se=M.end;if(se===void 0&&(se=J),"selectionStart"in S)S.selectionStart=J,S.selectionEnd=Math.min(se,S.value.length);else{var fe=S.ownerDocument||document,W=fe&&fe.defaultView||window;if(W.getSelection){var ne=W.getSelection(),De=S.textContent.length,$e=Math.min(M.start,De),$t=M.end===void 0?$e:Math.min(M.end,De);!ne.extend&&$e>$t&&(b=$t,$t=$e,$e=b);var q=ma(S,$e),L=ma(S,$t);if(q&&L&&(ne.rangeCount!==1||ne.anchorNode!==q.node||ne.anchorOffset!==q.offset||ne.focusNode!==L.node||ne.focusOffset!==L.offset)){var F=fe.createRange();F.setStart(q.node,q.offset),ne.removeAllRanges(),$e>$t?(ne.addRange(F),ne.extend(L.node,L.offset)):(F.setEnd(L.node,L.offset),ne.addRange(F))}}}}for(fe=[],ne=S;ne=ne.parentNode;)ne.nodeType===1&&fe.push({element:ne,left:ne.scrollLeft,top:ne.scrollTop});for(typeof S.focus=="function"&&S.focus(),S=0;S<fe.length;S++){var ce=fe[S];ce.element.scrollLeft=ce.left,ce.element.scrollTop=ce.top}}of=!!mh,gh=mh=null}finally{Tt=u,ue.p=i,X.T=n}}e.current=t,Kn=2}}function Eg(){if(Kn===2){Kn=0;var e=ji,t=fc,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=X.T,X.T=null;var i=ue.p;ue.p=2;var u=Tt;Tt|=4;try{ng(e,t.alternate,t)}finally{Tt=u,ue.p=i,X.T=n}}Kn=3}}function Cg(){if(Kn===4||Kn===3){Kn=0,qt();var e=ji,t=fc,n=Ya,i=mg;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Kn=5:(Kn=0,fc=ji=null,Ag(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(vi=null),Pl(n),t=t.stateNode,St&&typeof St.onCommitFiberRoot=="function")try{St.onCommitFiberRoot(en,t,void 0,(t.current.flags&128)===128)}catch{}if(i!==null){t=X.T,u=ue.p,ue.p=2,X.T=null;try{for(var f=e.onRecoverableError,b=0;b<i.length;b++){var S=i[b];f(S.value,{componentStack:S.stack})}}finally{X.T=t,ue.p=u}}(Ya&3)!==0&&Fu(),Vs(e),u=e.pendingLanes,(n&261930)!==0&&(u&42)!==0?e===nh?Do++:(Do=0,nh=e):Do=0,Oo(0)}}function Ag(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Sa(t)))}function Fu(){return Tg(),Eg(),Cg(),Mg()}function Mg(){if(Kn!==5)return!1;var e=ji,t=eh;eh=0;var n=Pl(Ya),i=X.T,u=ue.p;try{ue.p=32>n?32:n,X.T=null,n=th,th=null;var f=ji,b=Ya;if(Kn=0,fc=ji=null,Ya=0,(Tt&6)!==0)throw Error(c(331));var S=Tt;if(Tt|=4,dg(f.current),og(f,f.current,b,n),Tt=S,Oo(0,!1),St&&typeof St.onPostCommitFiberRoot=="function")try{St.onPostCommitFiberRoot(en,f)}catch{}return!0}finally{ue.p=u,X.T=i,Ag(e,t)}}function Rg(e,t,n){t=Rl(n,t),t=Od(e.stateNode,t,2),e=Wt(e,t,2),e!==null&&(Tn(e,2),Vs(e))}function It(e,t,n){if(e.tag===3)Rg(e,e,n);else for(;t!==null;){if(t.tag===3){Rg(t,e,n);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(vi===null||!vi.has(i))){e=Rl(n,e),n=Dm(2),i=Wt(t,n,2),i!==null&&(Om(n,i,t,e),Tn(i,2),Vs(i));break}}t=t.return}}function ah(e,t,n){var i=e.pingCache;if(i===null){i=e.pingCache=new wy;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(n)||(Jd=!0,u.add(n),e=Ey.bind(null,e,t,n),t.then(e,e))}function Ey(e,t,n){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Zt===e&&(ft&n)===n&&(Sn===4||Sn===3&&(ft&62914560)===ft&&300>tt()-$u?(Tt&2)===0&&dc(e,0):Pd|=n,uc===ft&&(uc=0)),Vs(e)}function Dg(e,t){t===0&&(t=Le()),e=Hs(e,t),e!==null&&(Tn(e,t),Vs(e))}function Cy(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Dg(e,n)}function Ay(e,t){var n=0;switch(e.tag){case 31:case 13:var i=e.stateNode,u=e.memoizedState;u!==null&&(n=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),Dg(e,n)}function My(e,t){return Wn(e,t)}var Ju=null,pc=null,ih=!1,Pu=!1,rh=!1,Si=0;function Vs(e){e!==pc&&e.next===null&&(pc===null?Ju=pc=e:pc=pc.next=e),Pu=!0,ih||(ih=!0,Dy())}function Oo(e,t){if(!rh&&Pu){rh=!0;do for(var n=!1,i=Ju;i!==null;){if(e!==0){var u=i.pendingLanes;if(u===0)var f=0;else{var b=i.suspendedLanes,S=i.pingedLanes;f=(1<<31-Nt(42|e)+1)-1,f&=u&~(b&~S),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(n=!0,Ug(i,f))}else f=ft,f=I(i,i===Zt?f:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(f&3)===0||oe(i,f)||(n=!0,Ug(i,f));i=i.next}while(n);rh=!1}}function Ry(){Og()}function Og(){Pu=ih=!1;var e=0;Si!==0&&Yy()&&(e=Si);for(var t=tt(),n=null,i=Ju;i!==null;){var u=i.next,f=Lg(i,t);f===0?(i.next=null,n===null?Ju=u:n.next=u,u===null&&(pc=n)):(n=i,(e!==0||(f&3)!==0)&&(Pu=!0)),i=u}Kn!==0&&Kn!==5||Oo(e),Si!==0&&(Si=0)}function Lg(e,t){for(var n=e.suspendedLanes,i=e.pingedLanes,u=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var b=31-Nt(f),S=1<<b,M=u[b];M===-1?((S&n)===0||(S&i)!==0)&&(u[b]=Ne(S,t)):M<=t&&(e.expiredLanes|=S),f&=~S}if(t=Zt,n=ft,n=I(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,n===0||e===t&&(Bt===2||Bt===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&on(i),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||oe(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(i!==null&&on(i),Pl(n)){case 2:case 8:n=Ct;break;case 32:n=nt;break;case 268435456:n=pn;break;default:n=nt}return i=zg.bind(null,e),n=Wn(n,i),e.callbackPriority=t,e.callbackNode=n,t}return i!==null&&i!==null&&on(i),e.callbackPriority=2,e.callbackNode=null,2}function zg(e,t){if(Kn!==0&&Kn!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Fu()&&e.callbackNode!==n)return null;var i=ft;return i=I(e,e===Zt?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(xg(e,i,t),Lg(e,tt()),e.callbackNode!=null&&e.callbackNode===n?zg.bind(null,e):null)}function Ug(e,t){if(Fu())return null;xg(e,t,!0)}function Dy(){Xy(function(){(Tt&6)!==0?Wn(Yn,Ry):Og()})}function ch(){if(Si===0){var e=Na;e===0&&(e=Be,Be<<=1,(Be&261888)===0&&(Be=256)),Si=e}return Si}function Hg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:tn(""+e)}function Bg(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function Oy(e,t,n,i,u){if(t==="submit"&&n&&n.stateNode===u){var f=Hg((u[Ze]||null).action),b=i.submitter;b&&(t=(t=b[Ze]||null)?Hg(t.formAction):b.getAttribute("formAction"),t!==null&&(f=t,b=null));var S=new Za("action","action",null,i,u);e.push({event:S,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(Si!==0){var M=b?Bg(u,b):new FormData(u);Ed(n,{pending:!0,data:M,method:u.method,action:f},null,M)}}else typeof f=="function"&&(S.preventDefault(),M=b?Bg(u,b):new FormData(u),Ed(n,{pending:!0,data:M,method:u.method,action:f},f,M))},currentTarget:u}]})}}for(var oh=0;oh<io.length;oh++){var uh=io[oh],Ly=uh.toLowerCase(),zy=uh[0].toUpperCase()+uh.slice(1);Ml(Ly,"on"+zy)}Ml(gu,"onAnimationEnd"),Ml(qr,"onAnimationIteration"),Ml(xu,"onAnimationStart"),Ml("dblclick","onDoubleClick"),Ml("focusin","onFocus"),Ml("focusout","onBlur"),Ml(rd,"onTransitionRun"),Ml(ao,"onTransitionStart"),Ml(cd,"onTransitionCancel"),Ml(bu,"onTransitionEnd"),hl("onMouseEnter",["mouseout","mouseover"]),hl("onMouseLeave",["mouseout","mouseover"]),hl("onPointerEnter",["pointerout","pointerover"]),hl("onPointerLeave",["pointerout","pointerover"]),$n("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),$n("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),$n("onBeforeInput",["compositionend","keypress","textInput","paste"]),$n("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),$n("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),$n("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Lo="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(" "),Uy=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Lo));function Ig(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var i=e[n],u=i.event;i=i.listeners;e:{var f=void 0;if(t)for(var b=i.length-1;0<=b;b--){var S=i[b],M=S.instance,J=S.currentTarget;if(S=S.listener,M!==f&&u.isPropagationStopped())break e;f=S,u.currentTarget=J;try{f(u)}catch(se){ii(se)}u.currentTarget=null,f=M}else for(b=0;b<i.length;b++){if(S=i[b],M=S.instance,J=S.currentTarget,S=S.listener,M!==f&&u.isPropagationStopped())break e;f=S,u.currentTarget=J;try{f(u)}catch(se){ii(se)}u.currentTarget=null,f=M}}}}function ot(e,t){var n=t[Vt];n===void 0&&(n=t[Vt]=new Set);var i=e+"__bubble";n.has(i)||(qg(t,e,2,!1),n.add(i))}function fh(e,t,n){var i=0;t&&(i|=4),qg(n,e,i,t)}var Wu="_reactListening"+Math.random().toString(36).slice(2);function dh(e){if(!e[Wu]){e[Wu]=!0,En.forEach(function(n){n!=="selectionchange"&&(Uy.has(n)||fh(n,!1,e),fh(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Wu]||(t[Wu]=!0,fh("selectionchange",!1,t))}}function qg(e,t,n,i){switch(gx(t)){case 2:var u=f0;break;case 8:u=d0;break;default:u=Th}n=u.bind(null,t,n,e),u=void 0,!Vn||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(u=!0),i?u!==void 0?e.addEventListener(t,n,{capture:!0,passive:u}):e.addEventListener(t,n,!0):u!==void 0?e.addEventListener(t,n,{passive:u}):e.addEventListener(t,n,!1)}function hh(e,t,n,i,u){var f=i;if((t&1)===0&&(t&2)===0&&i!==null)e:for(;;){if(i===null)return;var b=i.tag;if(b===3||b===4){var S=i.stateNode.containerInfo;if(S===u)break;if(b===4)for(b=i.return;b!==null;){var M=b.tag;if((M===3||M===4)&&b.stateNode.containerInfo===u)return;b=b.return}for(;S!==null;){if(b=xt(S),b===null)return;if(M=b.tag,M===5||M===6||M===26||M===27){i=f=b;continue e}S=S.parentNode}}i=i.return}ie(function(){var J=f,se=Mt(n),fe=[];e:{var W=er.get(e);if(W!==void 0){var ne=Za,De=e;switch(e){case"keypress":if(ca(n)===0)break e;case"keydown":case"keyup":ne=ou;break;case"focusin":De="focus",ne=Vc;break;case"focusout":De="blur",ne=Vc;break;case"beforeblur":case"afterblur":ne=Vc;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ne=$i;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ne=ed;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ne=Ki;break;case gu:case qr:case xu:ne=Mr;break;case bu:ne=Zi;break;case"scroll":case"scrollend":ne=Xc;break;case"wheel":ne=Zc;break;case"copy":case"cut":case"paste":ne=Vi;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ne=ls;break;case"toggle":case"beforetoggle":ne=ld}var $e=(t&4)!==0,$t=!$e&&(e==="scroll"||e==="scrollend"),q=$e?W!==null?W+"Capture":null:W;$e=[];for(var L=J,F;L!==null;){var ce=L;if(F=ce.stateNode,ce=ce.tag,ce!==5&&ce!==26&&ce!==27||F===null||q===null||(ce=Te(L,q),ce!=null&&$e.push(zo(L,ce,F))),$t)break;L=L.return}0<$e.length&&(W=new ne(W,De,null,n,se),fe.push({event:W,listeners:$e}))}}if((t&7)===0){e:{if(W=e==="mouseover"||e==="pointerover",ne=e==="mouseout"||e==="pointerout",W&&n!==xn&&(De=n.relatedTarget||n.fromElement)&&(xt(De)||De[vn]))break e;if((ne||W)&&(W=se.window===se?se:(W=se.ownerDocument)?W.defaultView||W.parentWindow:window,ne?(De=n.relatedTarget||n.toElement,ne=J,De=De?xt(De):null,De!==null&&($t=d(De),$e=De.tag,De!==$t||$e!==5&&$e!==27&&$e!==6)&&(De=null)):(ne=null,De=J),ne!==De)){if($e=$i,ce="onMouseLeave",q="onMouseEnter",L="mouse",(e==="pointerout"||e==="pointerover")&&($e=ls,ce="onPointerLeave",q="onPointerEnter",L="pointer"),$t=ne==null?W:On(ne),F=De==null?W:On(De),W=new $e(ce,L+"leave",ne,n,se),W.target=$t,W.relatedTarget=F,ce=null,xt(se)===J&&($e=new $e(q,L+"enter",De,n,se),$e.target=F,$e.relatedTarget=$t,ce=$e),$t=ce,ne&&De)t:{for($e=Hy,q=ne,L=De,F=0,ce=q;ce;ce=$e(ce))F++;ce=0;for(var Ye=L;Ye;Ye=$e(Ye))ce++;for(;0<F-ce;)q=$e(q),F--;for(;0<ce-F;)L=$e(L),ce--;for(;F--;){if(q===L||L!==null&&q===L.alternate){$e=q;break t}q=$e(q),L=$e(L)}$e=null}else $e=null;ne!==null&&Gg(fe,W,ne,$e,!1),De!==null&&$t!==null&&Gg(fe,$t,De,$e,!0)}}e:{if(W=J?On(J):window,ne=W.nodeName&&W.nodeName.toLowerCase(),ne==="select"||ne==="input"&&W.type==="file")var jt=ni;else if(ei(W))if(eo)jt=Ji;else{jt=ad;var ze=sd}else ne=W.nodeName,!ne||ne.toLowerCase()!=="input"||W.type!=="checkbox"&&W.type!=="radio"?J&&we(J.elementType)&&(jt=ni):jt=K;if(jt&&(jt=jt(e,J))){Ls(fe,jt,n,se);break e}ze&&ze(e,W,J),e==="focusout"&&J&&W.type==="number"&&J.memoizedProps.value!=null&&ts(W,"number",W.value)}switch(ze=J?On(J):window,e){case"focusin":(ei(ze)||ze.contentEditable==="true")&&(si=ze,Us=J,Wi=null);break;case"focusout":Wi=Us=si=null;break;case"mousedown":lo=!0;break;case"contextmenu":case"mouseup":case"dragend":lo=!1,pu(fe,n,se);break;case"selectionchange":if(id)break;case"keydown":case"keyup":pu(fe,n,se)}var et;if(Pa)e:{switch(e){case"compositionstart":var dt="onCompositionStart";break e;case"compositionend":dt="onCompositionEnd";break e;case"compositionupdate":dt="onCompositionUpdate";break e}dt=void 0}else pl?Pc(e,n)&&(dt="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(dt="onCompositionStart");dt&&(Wa&&n.locale!=="ko"&&(pl||dt!=="onCompositionStart"?dt==="onCompositionEnd"&&pl&&(et=$c()):(Rs=se,Gi="value"in Rs?Rs.value:Rs.textContent,pl=!0)),ze=ef(J,dt),0<ze.length&&(dt=new Qi(dt,e,null,n,se),fe.push({event:dt,listeners:ze}),et?dt.data=et:(et=Wc(n),et!==null&&(dt.data=et)))),(et=Fi?uu(e,n):Ur(e,n))&&(dt=ef(J,"onBeforeInput"),0<dt.length&&(ze=new Qi("onBeforeInput","beforeinput",null,n,se),fe.push({event:ze,listeners:dt}),ze.data=et)),Oy(fe,e,J,n,se)}Ig(fe,t)})}function zo(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ef(e,t){for(var n=t+"Capture",i=[];e!==null;){var u=e,f=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||f===null||(u=Te(e,n),u!=null&&i.unshift(zo(e,u,f)),u=Te(e,t),u!=null&&i.push(zo(e,u,f))),e.tag===3)return i;e=e.return}return[]}function Hy(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Gg(e,t,n,i,u){for(var f=t._reactName,b=[];n!==null&&n!==i;){var S=n,M=S.alternate,J=S.stateNode;if(S=S.tag,M!==null&&M===i)break;S!==5&&S!==26&&S!==27||J===null||(M=J,u?(J=Te(n,f),J!=null&&b.unshift(zo(n,J,M))):u||(J=Te(n,f),J!=null&&b.push(zo(n,J,M)))),n=n.return}b.length!==0&&e.push({event:t,listeners:b})}var By=/\r\n?/g,Iy=/\u0000|\uFFFD/g;function Yg(e){return(typeof e=="string"?e:""+e).replace(By,`
|
|
50
|
+
`).replace(Iy,"")}function $g(e,t){return t=Yg(t),Yg(e)===t}function Yt(e,t,n,i,u,f){switch(n){case"children":typeof i=="string"?t==="body"||t==="textarea"&&i===""||Q(e,i):(typeof i=="number"||typeof i=="bigint")&&t!=="body"&&Q(e,""+i);break;case"className":ll(e,"class",i);break;case"tabIndex":ll(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":ll(e,n,i);break;case"style":He(e,i,f);break;case"data":if(t!=="object"){ll(e,"data",i);break}case"src":case"href":if(i===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(n);break}i=tn(""+i),e.setAttribute(n,i);break;case"action":case"formAction":if(typeof i=="function"){e.setAttribute(n,"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"&&(n==="formAction"?(t!=="input"&&Yt(e,t,"name",u.name,u,null),Yt(e,t,"formEncType",u.formEncType,u,null),Yt(e,t,"formMethod",u.formMethod,u,null),Yt(e,t,"formTarget",u.formTarget,u,null)):(Yt(e,t,"encType",u.encType,u,null),Yt(e,t,"method",u.method,u,null),Yt(e,t,"target",u.target,u,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(n);break}i=tn(""+i),e.setAttribute(n,i);break;case"onClick":i!=null&&(e.onclick=yt);break;case"onScroll":i!=null&&ot("scroll",e);break;case"onScrollEnd":i!=null&&ot("scrollend",e);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(c(61));if(n=i.__html,n!=null){if(u.children!=null)throw Error(c(60));e.innerHTML=n}}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}n=tn(""+i),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);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(n,""+i):e.removeAttribute(n);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(n,""):e.removeAttribute(n);break;case"capture":case"download":i===!0?e.setAttribute(n,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(n,i):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(n,i):e.removeAttribute(n);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?e.removeAttribute(n):e.setAttribute(n,i);break;case"popover":ot("beforetoggle",e),ot("toggle",e),El(e,"popover",i);break;case"xlinkActuate":jn(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":jn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":jn(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":jn(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":jn(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":jn(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":jn(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":jn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":jn(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":El(e,"is",i);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=_t.get(n)||n,El(e,n,i))}}function ph(e,t,n,i,u,f){switch(n){case"style":He(e,i,f);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(c(61));if(n=i.__html,n!=null){if(u.children!=null)throw Error(c(60));e.innerHTML=n}}break;case"children":typeof i=="string"?Q(e,i):(typeof i=="number"||typeof i=="bigint")&&Q(e,""+i);break;case"onScroll":i!=null&&ot("scroll",e);break;case"onScrollEnd":i!=null&&ot("scrollend",e);break;case"onClick":i!=null&&(e.onclick=yt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!dl.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(u=n.endsWith("Capture"),t=n.slice(2,u?n.length-7:void 0),f=e[Ze]||null,f=f!=null?f[n]:null,typeof f=="function"&&e.removeEventListener(t,f,u),typeof i=="function")){typeof f!="function"&&f!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,i,u);break e}n in e?e[n]=i:i===!0?e.setAttribute(n,""):El(e,n,i)}}}function rl(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ot("error",e),ot("load",e);var i=!1,u=!1,f;for(f in n)if(n.hasOwnProperty(f)){var b=n[f];if(b!=null)switch(f){case"src":i=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Yt(e,t,f,b,n,null)}}u&&Yt(e,t,"srcSet",n.srcSet,n,null),i&&Yt(e,t,"src",n.src,n,null);return;case"input":ot("invalid",e);var S=f=b=u=null,M=null,J=null;for(i in n)if(n.hasOwnProperty(i)){var se=n[i];if(se!=null)switch(i){case"name":u=se;break;case"type":b=se;break;case"checked":M=se;break;case"defaultChecked":J=se;break;case"value":f=se;break;case"defaultValue":S=se;break;case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(c(137,t));break;default:Yt(e,t,i,se,n,null)}}gs(e,f,S,M,J,b,u,!1);return;case"select":ot("invalid",e),i=b=f=null;for(u in n)if(n.hasOwnProperty(u)&&(S=n[u],S!=null))switch(u){case"value":f=S;break;case"defaultValue":b=S;break;case"multiple":i=S;default:Yt(e,t,u,S,n,null)}t=f,n=b,e.multiple=!!i,t!=null?Al(e,!!i,t,!1):n!=null&&Al(e,!!i,n,!0);return;case"textarea":ot("invalid",e),f=u=i=null;for(b in n)if(n.hasOwnProperty(b)&&(S=n[b],S!=null))switch(b){case"value":i=S;break;case"defaultValue":u=S;break;case"children":f=S;break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(c(91));break;default:Yt(e,t,b,S,n,null)}T(e,i,u,f);return;case"option":for(M in n)if(n.hasOwnProperty(M)&&(i=n[M],i!=null))switch(M){case"selected":e.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:Yt(e,t,M,i,n,null)}return;case"dialog":ot("beforetoggle",e),ot("toggle",e),ot("cancel",e),ot("close",e);break;case"iframe":case"object":ot("load",e);break;case"video":case"audio":for(i=0;i<Lo.length;i++)ot(Lo[i],e);break;case"image":ot("error",e),ot("load",e);break;case"details":ot("toggle",e);break;case"embed":case"source":case"link":ot("error",e),ot("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(J in n)if(n.hasOwnProperty(J)&&(i=n[J],i!=null))switch(J){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Yt(e,t,J,i,n,null)}return;default:if(we(t)){for(se in n)n.hasOwnProperty(se)&&(i=n[se],i!==void 0&&ph(e,t,se,i,n,void 0));return}}for(S in n)n.hasOwnProperty(S)&&(i=n[S],i!=null&&Yt(e,t,S,i,n,null))}function qy(e,t,n,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,b=null,S=null,M=null,J=null,se=null;for(ne in n){var fe=n[ne];if(n.hasOwnProperty(ne)&&fe!=null)switch(ne){case"checked":break;case"value":break;case"defaultValue":M=fe;default:i.hasOwnProperty(ne)||Yt(e,t,ne,null,i,fe)}}for(var W in i){var ne=i[W];if(fe=n[W],i.hasOwnProperty(W)&&(ne!=null||fe!=null))switch(W){case"type":f=ne;break;case"name":u=ne;break;case"checked":J=ne;break;case"defaultChecked":se=ne;break;case"value":b=ne;break;case"defaultValue":S=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(c(137,t));break;default:ne!==fe&&Yt(e,t,W,ne,i,fe)}}ia(e,b,S,M,J,se,f,u);return;case"select":ne=b=S=W=null;for(f in n)if(M=n[f],n.hasOwnProperty(f)&&M!=null)switch(f){case"value":break;case"multiple":ne=M;default:i.hasOwnProperty(f)||Yt(e,t,f,null,i,M)}for(u in i)if(f=i[u],M=n[u],i.hasOwnProperty(u)&&(f!=null||M!=null))switch(u){case"value":W=f;break;case"defaultValue":S=f;break;case"multiple":b=f;default:f!==M&&Yt(e,t,u,f,i,M)}t=S,n=b,i=ne,W!=null?Al(e,!!n,W,!1):!!i!=!!n&&(t!=null?Al(e,!!n,t,!0):Al(e,!!n,n?[]:"",!1));return;case"textarea":ne=W=null;for(S in n)if(u=n[S],n.hasOwnProperty(S)&&u!=null&&!i.hasOwnProperty(S))switch(S){case"value":break;case"children":break;default:Yt(e,t,S,null,i,u)}for(b in i)if(u=i[b],f=n[b],i.hasOwnProperty(b)&&(u!=null||f!=null))switch(b){case"value":W=u;break;case"defaultValue":ne=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(c(91));break;default:u!==f&&Yt(e,t,b,u,i,f)}pe(e,W,ne);return;case"option":for(var De in n)if(W=n[De],n.hasOwnProperty(De)&&W!=null&&!i.hasOwnProperty(De))switch(De){case"selected":e.selected=!1;break;default:Yt(e,t,De,null,i,W)}for(M in i)if(W=i[M],ne=n[M],i.hasOwnProperty(M)&&W!==ne&&(W!=null||ne!=null))switch(M){case"selected":e.selected=W&&typeof W!="function"&&typeof W!="symbol";break;default:Yt(e,t,M,W,i,ne)}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 $e in n)W=n[$e],n.hasOwnProperty($e)&&W!=null&&!i.hasOwnProperty($e)&&Yt(e,t,$e,null,i,W);for(J in i)if(W=i[J],ne=n[J],i.hasOwnProperty(J)&&W!==ne&&(W!=null||ne!=null))switch(J){case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(c(137,t));break;default:Yt(e,t,J,W,i,ne)}return;default:if(we(t)){for(var $t in n)W=n[$t],n.hasOwnProperty($t)&&W!==void 0&&!i.hasOwnProperty($t)&&ph(e,t,$t,void 0,i,W);for(se in i)W=i[se],ne=n[se],!i.hasOwnProperty(se)||W===ne||W===void 0&&ne===void 0||ph(e,t,se,W,i,ne);return}}for(var q in n)W=n[q],n.hasOwnProperty(q)&&W!=null&&!i.hasOwnProperty(q)&&Yt(e,t,q,null,i,W);for(fe in i)W=i[fe],ne=n[fe],!i.hasOwnProperty(fe)||W===ne||W==null&&ne==null||Yt(e,t,fe,W,i,ne)}function Xg(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Gy(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),i=0;i<n.length;i++){var u=n[i],f=u.transferSize,b=u.initiatorType,S=u.duration;if(f&&S&&Xg(b)){for(b=0,S=u.responseEnd,i+=1;i<n.length;i++){var M=n[i],J=M.startTime;if(J>S)break;var se=M.transferSize,fe=M.initiatorType;se&&Xg(fe)&&(M=M.responseEnd,b+=se*(M<S?1:(S-J)/(M-J)))}if(--i,t+=8*(f+b)/(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,gh=null;function tf(e){return e.nodeType===9?e:e.ownerDocument}function Vg(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 Qg(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 xh(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 bh=null;function Yy(){var e=window.event;return e&&e.type==="popstate"?e===bh?!1:(bh=e,!0):(bh=null,!1)}var Kg=typeof setTimeout=="function"?setTimeout:void 0,$y=typeof clearTimeout=="function"?clearTimeout:void 0,Zg=typeof Promise=="function"?Promise:void 0,Xy=typeof queueMicrotask=="function"?queueMicrotask:typeof Zg<"u"?function(e){return Zg.resolve(null).then(e).catch(Vy)}:Kg;function Vy(e){setTimeout(function(){throw e})}function Ni(e){return e==="head"}function Fg(e,t){var n=t,i=0;do{var u=n.nextSibling;if(e.removeChild(n),u&&u.nodeType===8)if(n=u.data,n==="/$"||n==="/&"){if(i===0){e.removeChild(u),bc(t);return}i--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")i++;else if(n==="html")Uo(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Uo(n);for(var f=n.firstChild;f;){var b=f.nextSibling,S=f.nodeName;f[Qt]||S==="SCRIPT"||S==="STYLE"||S==="LINK"&&f.rel.toLowerCase()==="stylesheet"||n.removeChild(f),f=b}}else n==="body"&&Uo(e.ownerDocument.body);n=u}while(n);bc(t)}function Jg(e,t){var n=e;e=0;do{var i=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=i}while(n)}function _h(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":_h(n),ps(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function Qy(e,t,n,i){for(;e.nodeType===1;){var u=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[Qt])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=rs(e.nextSibling),e===null)break}return null}function Ky(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=rs(e.nextSibling),e===null))return null;return e}function Pg(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=rs(e.nextSibling),e===null))return null;return e}function yh(e){return e.data==="$?"||e.data==="$~"}function vh(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Zy(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var i=function(){t(),n.removeEventListener("DOMContentLoaded",i)};n.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}function rs(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 jh=null;function Wg(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return rs(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function ex(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function tx(e,t,n){switch(t=tf(n),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 Uo(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ps(e)}var cs=new Map,nx=new Set;function nf(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var $a=ue.d;ue.d={f:Fy,r:Jy,D:Py,C:Wy,L:e0,m:t0,X:l0,S:n0,M:s0};function Fy(){var e=$a.f(),t=Qu();return e||t}function Jy(e){var t=un(e);t!==null&&t.tag===5&&t.type==="form"?_m(t):$a.r(e)}var mc=typeof document>"u"?null:document;function lx(e,t,n){var i=mc;if(i&&typeof t=="string"&&t){var u=Xn(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof n=="string"&&(u+='[crossorigin="'+n+'"]'),nx.has(u)||(nx.add(u),e={rel:e,crossOrigin:n,href:t},i.querySelector(u)===null&&(t=i.createElement("link"),rl(t,"link",e),it(t),i.head.appendChild(t)))}}function Py(e){$a.D(e),lx("dns-prefetch",e,null)}function Wy(e,t){$a.C(e,t),lx("preconnect",e,t)}function e0(e,t,n){$a.L(e,t,n);var i=mc;if(i&&e&&t){var u='link[rel="preload"][as="'+Xn(t)+'"]';t==="image"&&n&&n.imageSrcSet?(u+='[imagesrcset="'+Xn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(u+='[imagesizes="'+Xn(n.imageSizes)+'"]')):u+='[href="'+Xn(e)+'"]';var f=u;switch(t){case"style":f=gc(e);break;case"script":f=xc(e)}cs.has(f)||(e=j({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),cs.set(f,e),i.querySelector(u)!==null||t==="style"&&i.querySelector(Ho(f))||t==="script"&&i.querySelector(Bo(f))||(t=i.createElement("link"),rl(t,"link",e),it(t),i.head.appendChild(t)))}}function t0(e,t){$a.m(e,t);var n=mc;if(n&&e){var i=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+Xn(i)+'"][href="'+Xn(e)+'"]',f=u;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=xc(e)}if(!cs.has(f)&&(e=j({rel:"modulepreload",href:e},t),cs.set(f,e),n.querySelector(u)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Bo(f)))return}i=n.createElement("link"),rl(i,"link",e),it(i),n.head.appendChild(i)}}}function n0(e,t,n){$a.S(e,t,n);var i=mc;if(i&&e){var u=pt(i).hoistableStyles,f=gc(e);t=t||"default";var b=u.get(f);if(!b){var S={loading:0,preload:null};if(b=i.querySelector(Ho(f)))S.loading=5;else{e=j({rel:"stylesheet",href:e,"data-precedence":t},n),(n=cs.get(f))&&wh(e,n);var M=b=i.createElement("link");it(M),rl(M,"link",e),M._p=new Promise(function(J,se){M.onload=J,M.onerror=se}),M.addEventListener("load",function(){S.loading|=1}),M.addEventListener("error",function(){S.loading|=2}),S.loading|=4,lf(b,t,i)}b={type:"stylesheet",instance:b,count:1,state:S},u.set(f,b)}}}function l0(e,t){$a.X(e,t);var n=mc;if(n&&e){var i=pt(n).hoistableScripts,u=xc(e),f=i.get(u);f||(f=n.querySelector(Bo(u)),f||(e=j({src:e,async:!0},t),(t=cs.get(u))&&Sh(e,t),f=n.createElement("script"),it(f),rl(f,"link",e),n.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},i.set(u,f))}}function s0(e,t){$a.M(e,t);var n=mc;if(n&&e){var i=pt(n).hoistableScripts,u=xc(e),f=i.get(u);f||(f=n.querySelector(Bo(u)),f||(e=j({src:e,async:!0,type:"module"},t),(t=cs.get(u))&&Sh(e,t),f=n.createElement("script"),it(f),rl(f,"link",e),n.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},i.set(u,f))}}function sx(e,t,n,i){var u=(u=Re.current)?nf(u):null;if(!u)throw Error(c(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=gc(n.href),n=pt(u).hoistableStyles,i=n.get(t),i||(i={type:"style",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=gc(n.href);var f=pt(u).hoistableStyles,b=f.get(e);if(b||(u=u.ownerDocument||u,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,b),(f=u.querySelector(Ho(e)))&&!f._p&&(b.instance=f,b.state.loading=5),cs.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},cs.set(e,n),f||a0(u,e,n,b.state))),t&&i===null)throw Error(c(528,""));return b}if(t&&i!==null)throw Error(c(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=xc(n),n=pt(u).hoistableScripts,i=n.get(t),i||(i={type:"script",instance:null,count:0,state:null},n.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,e))}}function gc(e){return'href="'+Xn(e)+'"'}function Ho(e){return'link[rel="stylesheet"]['+e+"]"}function ax(e){return j({},e,{"data-precedence":e.precedence,precedence:null})}function a0(e,t,n,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}),rl(t,"link",n),it(t),e.head.appendChild(t))}function xc(e){return'[src="'+Xn(e)+'"]'}function Bo(e){return"script[async]"+e}function ix(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+Xn(n.href)+'"]');if(i)return t.instance=i,it(i),i;var u=j({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),it(i),rl(i,"style",u),lf(i,n.precedence,e),t.instance=i;case"stylesheet":u=gc(n.href);var f=e.querySelector(Ho(u));if(f)return t.state.loading|=4,t.instance=f,it(f),f;i=ax(n),(u=cs.get(u))&&wh(i,u),f=(e.ownerDocument||e).createElement("link"),it(f);var b=f;return b._p=new Promise(function(S,M){b.onload=S,b.onerror=M}),rl(f,"link",i),t.state.loading|=4,lf(f,n.precedence,e),t.instance=f;case"script":return f=xc(n.src),(u=e.querySelector(Bo(f)))?(t.instance=u,it(u),u):(i=n,(u=cs.get(f))&&(i=j({},n),Sh(i,u)),e=e.ownerDocument||e,u=e.createElement("script"),it(u),rl(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,lf(i,n.precedence,e));return t.instance}function lf(e,t,n){for(var i=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=i.length?i[i.length-1]:null,f=u,b=0;b<i.length;b++){var S=i[b];if(S.dataset.precedence===t)f=S;else if(f!==u)break}f?f.parentNode.insertBefore(e,f.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function wh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Sh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var sf=null;function rx(e,t,n){if(sf===null){var i=new Map,u=sf=new Map;u.set(n,i)}else u=sf,i=u.get(n),i||(i=new Map,u.set(n,i));if(i.has(e))return i;for(i.set(e,null),n=n.getElementsByTagName(e),u=0;u<n.length;u++){var f=n[u];if(!(f[Qt]||f[Lt]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var b=f.getAttribute(t)||"";b=e+b;var S=i.get(b);S?S.push(f):i.set(b,[f])}}return i}function cx(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function i0(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function ox(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function r0(e,t,n,i){if(n.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var u=gc(i.href),f=t.querySelector(Ho(u));if(f){t=f._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=af.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=f,it(f);return}f=t.ownerDocument||t,i=ax(i),(u=cs.get(u))&&wh(i,u),f=f.createElement("link"),it(f);var b=f;b._p=new Promise(function(S,M){b.onload=S,b.onerror=M}),rl(f,"link",i),n.instance=f}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=af.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Nh=0;function c0(e,t){return e.stylesheets&&e.count===0&&cf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var i=setTimeout(function(){if(e.stylesheets&&cf(e,e.stylesheets),e.unsuspend){var f=e.unsuspend;e.unsuspend=null,f()}},6e4+t);0<e.imgBytes&&Nh===0&&(Nh=62500*Gy());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&cf(e,e.stylesheets),e.unsuspend)){var f=e.unsuspend;e.unsuspend=null,f()}},(e.imgBytes>Nh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(u)}}:null}function af(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)cf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var rf=null;function cf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,rf=new Map,t.forEach(o0,e),rf=null,af.call(e))}function o0(e,t){if(!(t.state.loading&4)){var n=rf.get(e);if(n)var i=n.get(null);else{n=new Map,rf.set(e,n);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<u.length;f++){var b=u[f];(b.nodeName==="LINK"||b.getAttribute("media")!=="not all")&&(n.set(b.dataset.precedence,b),i=b)}i&&n.set(null,i)}u=t.instance,b=u.getAttribute("data-precedence"),f=n.get(b)||i,f===i&&n.set(null,u),n.set(b,u),this.count++,i=af.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 Io={$$typeof:Y,Provider:null,Consumer:null,_currentValue:de,_currentValue2:de,_threadCount:0};function u0(e,t,n,i,u,f,b,S,M){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=kt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=kt(0),this.hiddenUpdates=kt(null),this.identifierPrefix=i,this.onUncaughtError=u,this.onCaughtError=f,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=M,this.incompleteTransitions=new Map}function ux(e,t,n,i,u,f,b,S,M,J,se,fe){return e=new u0(e,t,n,b,M,J,se,fe,S),t=1,f===!0&&(t|=24),f=Sl(3,null,null,t),e.current=f,f.stateNode=e,t=fi(),t.refCount++,e.pooledCache=t,t.refCount++,f.memoizedState={element:i,isDehydrated:n,cache:t},re(f),e}function fx(e){return e?(e=Bs,e):Bs}function dx(e,t,n,i,u,f){u=fx(u),i.context===null?i.context=u:i.pendingContext=u,i=bt(t),i.payload={element:n},f=f===void 0?null:f,f!==null&&(i.callback=f),n=Wt(e,i,t),n!==null&&(Il(n,e,t),al(n,e,t))}function hx(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function kh(e,t){hx(e,t),(e=e.alternate)&&hx(e,t)}function px(e){if(e.tag===13||e.tag===31){var t=Hs(e,67108864);t!==null&&Il(t,e,67108864),kh(e,67108864)}}function mx(e){if(e.tag===13||e.tag===31){var t=Kl();t=Jl(t);var n=Hs(e,t);n!==null&&Il(n,e,t),kh(e,t)}}var of=!0;function f0(e,t,n,i){var u=X.T;X.T=null;var f=ue.p;try{ue.p=2,Th(e,t,n,i)}finally{ue.p=f,X.T=u}}function d0(e,t,n,i){var u=X.T;X.T=null;var f=ue.p;try{ue.p=8,Th(e,t,n,i)}finally{ue.p=f,X.T=u}}function Th(e,t,n,i){if(of){var u=Eh(i);if(u===null)hh(e,t,i,uf,n),xx(e,i);else if(p0(u,e,t,n,i))i.stopPropagation();else if(xx(e,i),t&4&&-1<h0.indexOf(e)){for(;u!==null;){var f=un(u);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var b=At(f.pendingLanes);if(b!==0){var S=f;for(S.pendingLanes|=2,S.entangledLanes|=2;b;){var M=1<<31-Nt(b);S.entanglements[1]|=M,b&=~M}Vs(f),(Tt&6)===0&&(Xu=tt()+500,Oo(0))}}break;case 31:case 13:S=Hs(f,2),S!==null&&Il(S,f,2),Qu(),kh(f,2)}if(f=Eh(i),f===null&&hh(e,t,i,uf,n),f===u)break;u=f}u!==null&&i.stopPropagation()}else hh(e,t,i,null,n)}}function Eh(e){return e=Mt(e),Ch(e)}var uf=null;function Ch(e){if(uf=null,e=xt(e),e!==null){var t=d(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=h(t),e!==null)return e;e=null}else if(n===31){if(e=m(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return uf=e,null}function gx(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(Ot()){case Yn:return 2;case Ct:return 8;case nt:case at:return 32;case pn:return 268435456;default:return 32}default:return 32}}var Ah=!1,ki=null,Ti=null,Ei=null,qo=new Map,Go=new Map,Ci=[],h0="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 xx(e,t){switch(e){case"focusin":case"focusout":ki=null;break;case"dragenter":case"dragleave":Ti=null;break;case"mouseover":case"mouseout":Ei=null;break;case"pointerover":case"pointerout":qo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Go.delete(t.pointerId)}}function Yo(e,t,n,i,u,f){return e===null||e.nativeEvent!==f?(e={blockedOn:t,domEventName:n,eventSystemFlags:i,nativeEvent:f,targetContainers:[u]},t!==null&&(t=un(t),t!==null&&px(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function p0(e,t,n,i,u){switch(t){case"focusin":return ki=Yo(ki,e,t,n,i,u),!0;case"dragenter":return Ti=Yo(Ti,e,t,n,i,u),!0;case"mouseover":return Ei=Yo(Ei,e,t,n,i,u),!0;case"pointerover":var f=u.pointerId;return qo.set(f,Yo(qo.get(f)||null,e,t,n,i,u)),!0;case"gotpointercapture":return f=u.pointerId,Go.set(f,Yo(Go.get(f)||null,e,t,n,i,u)),!0}return!1}function bx(e){var t=xt(e.target);if(t!==null){var n=d(t);if(n!==null){if(t=n.tag,t===13){if(t=h(n),t!==null){e.blockedOn=t,fl(e.priority,function(){mx(n)});return}}else if(t===31){if(t=m(n),t!==null){e.blockedOn=t,fl(e.priority,function(){mx(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ff(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Eh(e.nativeEvent);if(n===null){n=e.nativeEvent;var i=new n.constructor(n.type,n);xn=i,n.target.dispatchEvent(i),xn=null}else return t=un(n),t!==null&&px(t),e.blockedOn=n,!1;t.shift()}return!0}function _x(e,t,n){ff(e)&&n.delete(t)}function m0(){Ah=!1,ki!==null&&ff(ki)&&(ki=null),Ti!==null&&ff(Ti)&&(Ti=null),Ei!==null&&ff(Ei)&&(Ei=null),qo.forEach(_x),Go.forEach(_x)}function df(e,t){e.blockedOn===t&&(e.blockedOn=null,Ah||(Ah=!0,l.unstable_scheduleCallback(l.unstable_NormalPriority,m0)))}var hf=null;function yx(e){hf!==e&&(hf=e,l.unstable_scheduleCallback(l.unstable_NormalPriority,function(){hf===e&&(hf=null);for(var t=0;t<e.length;t+=3){var n=e[t],i=e[t+1],u=e[t+2];if(typeof i!="function"){if(Ch(i||n)===null)continue;break}var f=un(n);f!==null&&(e.splice(t,3),t-=3,Ed(f,{pending:!0,data:u,method:n.method,action:i},i,u))}}))}function bc(e){function t(M){return df(M,e)}ki!==null&&df(ki,e),Ti!==null&&df(Ti,e),Ei!==null&&df(Ei,e),qo.forEach(t),Go.forEach(t);for(var n=0;n<Ci.length;n++){var i=Ci[n];i.blockedOn===e&&(i.blockedOn=null)}for(;0<Ci.length&&(n=Ci[0],n.blockedOn===null);)bx(n),n.blockedOn===null&&Ci.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(i=0;i<n.length;i+=3){var u=n[i],f=n[i+1],b=u[Ze]||null;if(typeof f=="function")b||yx(n);else if(b){var S=null;if(f&&f.hasAttribute("formAction")){if(u=f,b=f[Ze]||null)S=b.formAction;else if(Ch(u)!==null)continue}else S=b.action;typeof S=="function"?n[i+1]=S:(n.splice(i,3),i-=3),yx(n)}}}function vx(){function e(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(b){return u=b})},focusReset:"manual",scroll:"manual"})}function t(){u!==null&&(u(),u=null),i||setTimeout(n,20)}function n(){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(n,100),function(){i=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),u!==null&&(u(),u=null)}}}function Mh(e){this._internalRoot=e}pf.prototype.render=Mh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var n=t.current,i=Kl();dx(n,i,e,t,null,null)},pf.prototype.unmount=Mh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;dx(e.current,2,null,e,null,null),Qu(),t[vn]=null}};function pf(e){this._internalRoot=e}pf.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ka();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ci.length&&t!==0&&t<Ci[n].priority;n++);Ci.splice(n,0,e),n===0&&bx(e)}};var jx=s.version;if(jx!=="19.2.8")throw Error(c(527,jx,"19.2.8"));ue.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 g0={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:X,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var mf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!mf.isDisabled&&mf.supportsFiber)try{en=mf.inject(g0),St=mf}catch{}}return Xo.createRoot=function(e,t){if(!o(e))throw Error(c(299));var n=!1,i="",u=Cm,f=Am,b=Mm;return t!=null&&(t.unstable_strictMode===!0&&(n=!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&&(b=t.onRecoverableError)),t=ux(e,1,!1,null,null,n,i,null,u,f,b,vx),e[vn]=t.current,dh(e),new Mh(t)},Xo.hydrateRoot=function(e,t,n){if(!o(e))throw Error(c(299));var i=!1,u="",f=Cm,b=Am,S=Mm,M=null;return n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(u=n.identifierPrefix),n.onUncaughtError!==void 0&&(f=n.onUncaughtError),n.onCaughtError!==void 0&&(b=n.onCaughtError),n.onRecoverableError!==void 0&&(S=n.onRecoverableError),n.formState!==void 0&&(M=n.formState)),t=ux(e,1,!0,t,n??null,i,u,M,f,b,S,vx),t.context=fx(null),n=t.current,i=Kl(),i=Jl(i),u=bt(i),u.callback=null,Wt(n,u,i),n=i,t.current.lanes=n,Tn(t,n),Vs(t),e[vn]=t.current,dh(e),new pf(t)},Xo.version="19.2.8",Xo}var Dx;function E0(){if(Dx)return Lh.exports;Dx=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(s){console.error(s)}}return l(),Lh.exports=T0(),Lh.exports}var C0=E0();const l_=1;function A0(l){return`${l.replace(/[^\p{L}\p{N}\p{M}]/gu,"-").replace(/-+/g,"-").toLowerCase().replace(/^-|-$/g,"")||"project"}-${s_(l)}`}function M0(l){const s=l.replace(/[^a-zA-Z0-9]/g,"-").replace(/-+/g,"-").toLowerCase(),r=`${s.replace(/^-+|-+$/g,"")||"project"}-${s_(l)}`,c=A0(l);return[s,r].filter(o=>o!==c)}function s_(l){const s=/^[a-zA-Z]:[\\/]|^\\\\/.test(l);return R0(s?l.toLowerCase():l)}function R0(l){let s=3735928559,r=1103547991;for(let c=0;c<l.length;c++){const o=l.charCodeAt(c);s=Math.imul(s^o,2654435761),r=Math.imul(r^o,1597334677)}return s=Math.imul(s^s>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507)^Math.imul(s^s>>>13,3266489909),(4294967296*(2097151&r)+(s>>>0)).toString(36)}var Qa,Rc,Dc,Oc,Lc,ru,zc,Zf,a_;class D0{constructor(s){_n(this,Zf);_n(this,Qa,null);_n(this,Rc,new Set);_n(this,Dc,500);_n(this,Oc,null);_n(this,Lc,!1);_n(this,ru,null);_n(this,zc,null);this.url=s}get statusText(){return this.connected?"Хост на связи":"Нет связи с хостом"}onStatus(s){Et(this,zc,s)}connect(){if(Xe(this,Lc))return;const s=new WebSocket(this.url);Et(this,Qa,s),s.addEventListener("open",()=>{var r,c;Et(this,Dc,500),this.send({type:"hello",protocol:l_,clientName:"ccv-web"}),(r=Xe(this,ru))==null||r.call(this),(c=Xe(this,zc))==null||c.call(this)}),s.addEventListener("message",r=>{let c;try{c=JSON.parse(String(r.data))}catch{return}for(const o of Xe(this,Rc))o(c)}),s.addEventListener("close",()=>{var r;Et(this,Qa,null),(r=Xe(this,zc))==null||r.call(this),qn(this,Zf,a_).call(this)}),s.addEventListener("error",()=>s.close())}onReconnect(s){Et(this,ru,s)}on(s){return Xe(this,Rc).add(s),()=>Xe(this,Rc).delete(s)}send(s){var r;((r=Xe(this,Qa))==null?void 0:r.readyState)===WebSocket.OPEN&&Xe(this,Qa).send(JSON.stringify(s))}get connected(){var s;return((s=Xe(this,Qa))==null?void 0:s.readyState)===WebSocket.OPEN}close(){var s;Et(this,Lc,!0),(s=Xe(this,Qa))==null||s.close()}}Qa=new WeakMap,Rc=new WeakMap,Dc=new WeakMap,Oc=new WeakMap,Lc=new WeakMap,ru=new WeakMap,zc=new WeakMap,Zf=new WeakSet,a_=function(){if(Xe(this,Lc)||Xe(this,Oc)!==null)return;const s=Xe(this,Dc);Et(this,Dc,Math.min(s*2,1e4)),Et(this,Oc,window.setTimeout(()=>{Et(this,Oc,null),this.connect()},s))};const O0=1,i_="ccv:relay",Lf="ccv:relay.host";function L0(){try{const l=localStorage.getItem(i_);if(!l)return null;const s=JSON.parse(l);return typeof(s==null?void 0:s.token)!="string"||typeof s.expiresAt=="number"&&s.expiresAt<=Date.now()?null:s}catch{return null}}function r_(){localStorage.removeItem(i_)}var ea,Uc,ta,Hc,Bc,Bi,xr,br,Ii,_r,Ic,yr,vr,sn,Di,ap,c_,mr,ip;class z0{constructor(s){_n(this,sn);_n(this,ea,null);_n(this,Uc,new Set);_n(this,ta,null);_n(this,Hc,null);_n(this,Bc,500);_n(this,Bi,null);_n(this,xr,!1);_n(this,br,!1);_n(this,Ii,!1);_n(this,_r,null);_n(this,Ic,"Подключаемся…");_n(this,yr,0);_n(this,vr,[]);this.session=s}get connected(){return Xe(this,br)&&Xe(this,Ii)}get statusText(){return Xe(this,Ic)}get hostId(){return Xe(this,_r)}on(s){return Xe(this,Uc).add(s),()=>Xe(this,Uc).delete(s)}onReconnect(s){Et(this,Hc,s)}onStatus(s){Et(this,ta,s)}connect(){Xe(this,xr)||qn(this,sn,ap).call(this)}send(s){if(!Xe(this,br)){Xe(this,vr).length<64&&Xe(this,vr).push(s);return}qn(this,sn,mr).call(this,{t:"client.frame",body:s})}close(){var s;Et(this,xr,!0),Xe(this,Bi)!==null&&window.clearTimeout(Xe(this,Bi)),(s=Xe(this,ea))==null||s.close()}}ea=new WeakMap,Uc=new WeakMap,ta=new WeakMap,Hc=new WeakMap,Bc=new WeakMap,Bi=new WeakMap,xr=new WeakMap,br=new WeakMap,Ii=new WeakMap,_r=new WeakMap,Ic=new WeakMap,yr=new WeakMap,vr=new WeakMap,sn=new WeakSet,Di=function(s){var r;Xe(this,Ic)!==s&&(Et(this,Ic,s),(r=Xe(this,ta))==null||r.call(this))},ap=async function(){if(Xe(this,ea))return;if(!Xe(this,_r))try{Et(this,_r,await U0(this.session.token))}catch(c){qn(this,sn,Di).call(this,c instanceof Error?c.message:String(c)),qn(this,sn,ip).call(this);return}const s=location.protocol==="https:"?"wss":"ws",r=new WebSocket(`${s}://${location.host}/relay/client`);Et(this,ea,r),r.addEventListener("open",()=>{qn(this,sn,mr).call(this,{t:"client.hello",protocol:O0,token:this.session.token})}),r.addEventListener("message",c=>{let o;try{o=JSON.parse(String(c.data))}catch{return}qn(this,sn,c_).call(this,o)}),r.addEventListener("close",()=>{var c;Et(this,ea,null),Et(this,br,!1),Et(this,Ii,!1),qn(this,sn,Di).call(this,"Нет связи с сервером"),(c=Xe(this,ta))==null||c.call(this),qn(this,sn,ip).call(this)}),r.addEventListener("error",()=>r.close())},c_=function(s){var r,c,o,d,h,m,g;switch(s.t){case"client.ok":Et(this,Bc,500),qn(this,sn,mr).call(this,{t:"client.attach",hostId:Xe(this,_r)??"",...Xe(this,yr)>0?{sinceRseq:Xe(this,yr)}:{}});return;case"client.attached":Et(this,br,!0),Et(this,Ii,s.online),Et(this,yr,s.rseq),qn(this,sn,Di).call(this,s.online?"Хост на связи":"Компьютер не на связи"),qn(this,sn,mr).call(this,{t:"client.frame",body:{type:"hello",protocol:l_,clientName:"ccv-web-relay"}});const x=Xe(this,vr);Et(this,vr,[]);for(const y of x)qn(this,sn,mr).call(this,{t:"client.frame",body:y});(r=Xe(this,Hc))==null||r.call(this),(c=Xe(this,ta))==null||c.call(this);return;case"host.frame":{s.rseq>0&&Et(this,yr,s.rseq);const y=s.body;for(const j of Xe(this,Uc))j(y);return}case"host.online":Et(this,Ii,!0),qn(this,sn,Di).call(this,"Хост на связи"),(o=Xe(this,Hc))==null||o.call(this),(d=Xe(this,ta))==null||d.call(this);return;case"host.offline":Et(this,Ii,!1),qn(this,sn,Di).call(this,"Компьютер не на связи"),(h=Xe(this,ta))==null||h.call(this);return;case"ping":qn(this,sn,mr).call(this,{t:"pong",nonce:s.nonce});return;case"error":if(s.code==="auth"){r_(),location.href="/login";return}if(s.code==="not_found"){localStorage.removeItem(Lf),qn(this,sn,Di).call(this,"Этот компьютер отвязан от аккаунта"),Et(this,xr,!0),(m=Xe(this,ea))==null||m.close();return}s.code!=="offline"&&qn(this,sn,Di).call(this,s.message),(g=Xe(this,ta))==null||g.call(this);return}},mr=function(s){var r;((r=Xe(this,ea))==null?void 0:r.readyState)===WebSocket.OPEN&&Xe(this,ea).send(JSON.stringify(s))},ip=function(){if(Xe(this,xr)||Xe(this,Bi)!==null)return;const s=Xe(this,Bc);Et(this,Bc,Math.min(s*2,1e4)),Et(this,Bi,window.setTimeout(()=>{Et(this,Bi,null),qn(this,sn,ap).call(this)},s))};async function U0(l){const s=new URLSearchParams(location.search).get("host");if(s)return localStorage.setItem(Lf,s),s;const r=localStorage.getItem(Lf);if(r)return r;const c=await fetch("/api/hosts",{headers:{authorization:`Bearer ${l}`}});if(c.status===401)throw r_(),location.href="/login",new Error("нужен вход");const d=(await c.json()).hosts??[];if(d.length===1&&d[0])return localStorage.setItem(Lf,d[0].id),d[0].id;throw location.href="/hosts",new Error("выберите компьютер")}function zf(){return location.pathname==="/app"||location.pathname.startsWith("/app/")?"relay":"local"}const H0=`${location.protocol==="https:"?"wss":"ws"}://${location.host}/ws`;function B0(){if(zf()==="local")return new D0(H0);const l=L0();return l?new z0(l):(location.replace(`/login?next=${encodeURIComponent(location.pathname+location.search)}`),null)}const o_="ccv:drafts",I0=40,q0=2e4,G0=500;let nu=null,lu=null;function vp(){if(nu)return nu;const l=new Map;try{const s=localStorage.getItem(o_);if(s){const r=JSON.parse(s);if(typeof r=="object"&&r!==null)for(const[c,o]of Object.entries(r))typeof o=="string"&&o!==""&&l.set(c,o)}}catch{}return nu=l,window.addEventListener("pagehide",d_),l}function Bh(l){return vp().get(l)??""}function u_(l,s){const r=vp(),c=s.slice(0,q0),o=r.has(l);if(o&&r.delete(l),c!=="")r.set(l,c);else if(!o)return;for(;r.size>I0;){const d=r.keys().next();if(d.done)break;r.delete(d.value)}X0(),$0()}function f_(){const l=new Set;for(const s of vp().keys())l.add(s.startsWith("side:")?s.slice(5):s);return[...l].sort()}const rp=new Set;let Ox="";function Y0(l){return rp.add(l),()=>rp.delete(l)}function $0(){const l=f_(),s=l.join(`
|
|
51
|
+
`);if(s!==Ox){Ox=s;for(const r of rp)r(l)}}function X0(){lu===null&&(lu=window.setTimeout(d_,G0))}function d_(){if(lu!==null&&window.clearTimeout(lu),lu=null,!!nu)try{localStorage.setItem(o_,JSON.stringify(Object.fromEntries(nu)))}catch{}}const kl={items:[],pending:[],lastSeq:0,contextTokens:null},Ih={entries:[],total:0,loading:!1};function h_(l){var s;return((s=l.entries[0])==null?void 0:s.seq)??1}function Lx(l){return l.total>0&&h_(l)>1}function V0(l,s){const r=new Set(l.entries.map(o=>o.seq));return{entries:[...l.entries,...s.entries.filter(o=>!r.has(o.seq))].sort((o,d)=>o.seq-d.seq),total:s.total,loading:!1}}function Q0(l){return Uf(kl,l).items.map(s=>({...s,id:`h:${s.id}`}))}function Uf(l,s){let r=l;for(const c of s)c.seq<=r.lastSeq||(r={...K0(r,c.event,c.seq),lastSeq:c.seq});return r}function K0(l,s,r){var o,d;const c=l.items;switch(s.kind){case"user.message":return Qs(l,{id:`u${r}`,kind:"user",text:s.text,images:s.images});case"assistant.delta":{const h=c.findIndex(g=>g.id===s.blockId);if(h===-1)return Qs(l,{id:s.blockId,kind:"assistant",text:s.text,streaming:!0});const m=c[h];return _c(l,h,{...m,text:m.text+s.text})}case"assistant.text":{const h=c.findIndex(g=>g.id===s.blockId),m={id:s.blockId,kind:"assistant",text:s.text,streaming:!1};return h===-1?Qs(l,m):_c(l,h,m)}case"thinking.delta":{const h=c.findIndex(g=>g.id===s.blockId);if(h===-1)return Qs(l,{id:s.blockId,kind:"thinking",text:s.text});const m=c[h];return _c(l,h,{...m,text:m.text+s.text})}case"assistant.thinking":{const h=c.findIndex(g=>g.id===s.blockId),m={id:s.blockId,kind:"thinking",text:s.text};return h===-1?Qs(l,m):_c(l,h,m)}case"tool.use":return Qs(l,{id:`t${s.toolUseId}`,kind:"tool",toolUseId:s.toolUseId,name:s.name,input:s.input,result:null,isError:!1,awaitingPermission:!1});case"tool.result":{const h=c.findIndex(g=>g.kind==="tool"&&g.toolUseId===s.toolUseId);if(h===-1)return l;const m=c[h];return _c(l,h,{...m,result:s.content,isError:s.isError,awaitingPermission:!1})}case"permission.request":return{...l,pending:[...l.pending,{requestId:s.requestId,toolName:s.toolName,input:s.input,...s.reason?{reason:s.reason}:{},...s.questions?{questions:s.questions}:{},...s.toolUseId?{toolUseId:s.toolUseId}:{}}]};case"permission.resolved":{const h=l.pending.find(g=>g.requestId===s.requestId),m=l.pending.filter(g=>g.requestId!==s.requestId);if(s.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 _c({...l,pending:m},g,{...x,answers:s.answers})}}return s.decision==="allow"?{...l,pending:m}:Qs({...l,pending:m},{id:`p${r}`,kind:"notice",tone:"info",text:`Отклонено${s.reason?`: ${s.reason}`:""}`})}case"result":{const h=l.items.map(g=>g.kind==="assistant"&&g.streaming?{...g,streaming:!1}:g),m=s.contextTokens??l.contextTokens;return Qs({...l,items:h,contextTokens:m},{id:`r${r}`,kind:"result",subtype:s.subtype,isError:s.isError,durationMs:s.durationMs,costUsd:s.costUsd,inputTokens:((o=s.usage)==null?void 0:o.inputTokens)??0,outputTokens:((d=s.usage)==null?void 0:d.outputTokens)??0})}case"system":return s.subtype!=="compact_boundary"?l:Qs(l,{id:`s${r}`,kind:"notice",tone:"info",text:"Контекст сжат"});case"error":return Qs(l,{id:`e${r}`,kind:"notice",tone:"error",text:s.message});case"state":return l;case"rewound":return l;default:return l}}function Z0(l,s){let r=0;for(let c=0;c<l.length;c++)if(l[c].event.kind==="user.message"){if(r===s)return l.slice(0,c);r++}return l}function F0(l,s,r){const c=s-r;if(c<=0)return[];let o=0;for(let d=0;d<l.length;d++)if(l[d].kind==="user"){if(o===c)return l.slice(0,d);o++}return l}function Qs(l,s){return{...l,items:[...l.items,s]}}function _c(l,s,r){const c=l.items.slice();return c[s]=r,{...l,items:c}}const cp="ccv:theme",qh=["system","light","dark"];function J0(){const[l,s]=_.useState(P0);_.useEffect(()=>{const o=window.matchMedia("(prefers-color-scheme: dark)"),d=()=>{const h=l==="dark"||l==="system"&&o.matches;document.documentElement.dataset.theme=h?"dark":"light"};return d(),o.addEventListener("change",d),()=>o.removeEventListener("change",d)},[l]);const r=_.useCallback(o=>{try{localStorage.setItem(cp,o)}catch{}s(o)},[]),c=_.useCallback(()=>{s(o=>{const d=qh[(qh.indexOf(o)+1)%qh.length];try{localStorage.setItem(cp,d)}catch{}return d})},[]);return[l,r,c]}function P0(){try{const l=localStorage.getItem(cp);if(l==="light"||l==="dark"||l==="system")return l}catch{}return"system"}const p_=[{value:"default",hint:"спрашивать перед каждым действием"},{value:"acceptEdits",hint:"правки файлов без подтверждения"},{value:"plan",hint:"только чтение и план, без изменений"},{value:"auto",hint:"спрашивать только о рискованном — решает сам"},{value:"bypassPermissions",hint:"ничего не спрашивать"}],W0=[{value:"default",hint:"рискованное agy отклоняет сам: спросить он не может"},{value:"acceptEdits",hint:"правки файлов без подтверждения, команды — нет"},{value:"plan",hint:"только план, без изменений"},{value:"bypassPermissions",hint:"разрешено всё, включая команды"}],jr={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:"вопроса"}},ev=320,m_="ccv:panes";function tv(l){return`--${l}-w`}function g_(l,s){const r=jr[l];return Math.round(Math.min(r.max,Math.max(r.min,s)))}function nv(){const l={};for(const s of Object.keys(jr))l[s]=jr[s].width;try{const s=localStorage.getItem(m_);if(s){const r=JSON.parse(s);for(const c of Object.keys(jr)){const o=r[c];typeof o=="number"&&Number.isFinite(o)&&(l[c]=g_(c,o))}}}catch{}return l}function lv(){const[l,s]=_.useState(nv),r=_.useCallback(h=>{try{localStorage.setItem(m_,JSON.stringify(h))}catch{}},[]),c=_.useCallback((h,m)=>{s(g=>{const x=g_(h,m);if(g[h]===x)return g;const y={...g,[h]:x};return r(y),y})},[r]),o=_.useCallback(h=>{s(m=>{const g={...m,[h]:jr[h].width};return r(g),g})},[r]),d={};for(const h of Object.keys(jr))d[tv(h)]=`${l[h]}px`;return{widths:l,style:d,setWidth:c,reset:o}}const Gh=260,x_=120,sv=200,zx="ccv:terminal-h";function Ux(l,s){return Math.round(Math.min(s,Math.max(x_,l)))}function av(){const[l,s]=_.useState(()=>{try{const d=localStorage.getItem(zx);if(d){const h=Number(d);if(Number.isFinite(h))return Ux(h,1/0)}}catch{}return Gh}),r=_.useCallback(d=>{try{localStorage.setItem(zx,String(d))}catch{}},[]),c=_.useCallback((d,h)=>{const m=Ux(d,h);s(g=>g===m?g:(r(m),m))},[r]),o=_.useCallback(()=>{s(Gh),r(Gh)},[r]);return{height:l,setHeight:c,reset:o}}function Ff(l){const[s,r]=_.useState(()=>typeof window>"u"?!1:window.matchMedia(l).matches);return _.useEffect(()=>{const c=window.matchMedia(l),o=()=>r(c.matches);return o(),c.addEventListener("change",o),()=>c.removeEventListener("change",o)},[l]),s}const iv=500,rv=6;function b_({onLongPress:l,onClick:s,disabled:r=!1,thresholdMs:c=iv,moveCancelPx:o=rv}){const d=_.useRef(null),[h,m]=_.useState(!1),g=_.useCallback(()=>{d.current&&window.clearTimeout(d.current.timer),d.current=null,m(!1)},[]),x=_.useCallback(C=>{if(r||C.button!==0)return;const A={timer:0,x:C.clientX,y:C.clientY,fired:!1};A.timer=window.setTimeout(()=>{A.fired=!0,m(!1),l()},c),d.current=A,m(!0)},[r,c,l]),y=_.useCallback(C=>{const A=d.current;!A||A.fired||Math.hypot(C.clientX-A.x,C.clientY-A.y)>o&&g()},[o,g]),j=_.useCallback(()=>{d.current&&!d.current.fired?g():m(!1)},[g]),v=_.useCallback(C=>{var A;if((A=d.current)!=null&&A.fired){d.current=null,C.preventDefault();return}if(!r){if(C.shiftKey){l();return}s()}},[r,s,l]),E=_.useCallback(C=>{C.preventDefault()},[]),k=_.useCallback(C=>{r||C.shiftKey&&(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),l())},[r,l]);return{holding:h,thresholdMs:c,handlers:{onPointerDown:x,onPointerMove:y,onPointerUp:j,onPointerCancel:j,onPointerLeave:j,onClick:v,onContextMenu:E,onKeyDown:k}}}const cv={height:0,offsetTop:0,offsetLeft:0};function Hx(){if(typeof window>"u")return cv;const l=window.visualViewport;return l?{height:l.height,offsetTop:l.offsetTop,offsetLeft:l.offsetLeft}:{height:window.innerHeight,offsetTop:0,offsetLeft:0}}function ov(l){const[s,r]=_.useState(Hx);return _.useEffect(()=>{if(!l)return;const c=window.visualViewport,o=()=>{const d=Hx();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))},[l]),s}function jp(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var kr=jp();function __(l){kr=l}var gr={exec:()=>null};function yc(l){let s=[];return r=>{let c=Math.max(0,Math.min(3,r-1)),o=s[c];return o||(o=l(c),s[c]=o),o}}function gt(l,s=""){let r=typeof l=="string"?l:l.source,c={replace:(o,d)=>{let h=typeof d=="string"?d:d.source;return h=h.replace(bl.caret,"$1"),r=r.replace(o,h),c},getRegex:()=>new RegExp(r,s)};return c}var uv=((l="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+l)}catch{return!1}})(),bl={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:l=>new RegExp(`^( {0,3}${l})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:yc(l=>new RegExp(`^ {0,${l}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:yc(l=>new RegExp(`^ {0,${l}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:yc(l=>new RegExp(`^ {0,${l}}(?:\`\`\`|~~~)`)),headingBeginRegex:yc(l=>new RegExp(`^ {0,${l}}#`)),htmlBeginRegex:yc(l=>new RegExp(`^ {0,${l}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:yc(l=>new RegExp(`^ {0,${l}}>`))},fv=/^(?:[ \t]*(?:\n|$))+/,dv=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,hv=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,cu=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,pv=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,wp=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,y_=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,v_=gt(y_).replace(/bull/g,wp).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(),mv=gt(y_).replace(/bull/g,wp).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(),Sp=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,gv=/^[^\n]+/,Np=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,xv=gt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Np).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),bv=gt(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,wp).getRegex(),Jf="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",kp=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,_v=gt("^ {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",kp).replace("tag",Jf).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),j_=l=>gt(Sp).replace("hr",cu).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",l).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Jf).getRegex(),yv=j_(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),vv=j_(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),jv=gt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",vv).getRegex(),Tp={blockquote:jv,code:dv,def:xv,fences:hv,heading:pv,hr:cu,html:_v,lheading:v_,list:bv,newline:fv,paragraph:yv,table:gr,text:gv},Bx=gt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",cu).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",Jf).getRegex(),wv={...Tp,lheading:mv,table:Bx,paragraph:gt(Sp).replace("hr",cu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Bx).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",Jf).getRegex()},Sv={...Tp,html:gt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",kp).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:gr,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:gt(Sp).replace("hr",cu).replace("heading",` *#{1,6} *[^
|
|
52
|
+
]`).replace("lheading",v_).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Nv=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,kv=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,w_=/^( {2,}|\\)\n(?!\s*$)/,Tv=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Gc=/[\p{P}\p{S}]/u,Pf=/[\s\p{P}\p{S}]/u,Ep=/[^\s\p{P}\p{S}]/u,Ev=gt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Pf).getRegex(),S_=/(?!~)[\p{P}\p{S}]/u,Cv=/(?!~)[\s\p{P}\p{S}]/u,Av=/(?:[^\s\p{P}\p{S}]|~)/u,Mv=gt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",uv?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),N_=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Rv=gt(N_,"u").replace(/punct/g,Gc).getRegex(),Dv=gt(N_,"u").replace(/punct/g,S_).getRegex(),k_="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Ov=gt(k_,"gu").replace(/notPunctSpace/g,Ep).replace(/punctSpace/g,Pf).replace(/punct/g,Gc).getRegex(),Lv=gt(k_,"gu").replace(/notPunctSpace/g,Av).replace(/punctSpace/g,Cv).replace(/punct/g,S_).getRegex(),zv=gt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ep).replace(/punctSpace/g,Pf).replace(/punct/g,Gc).getRegex(),Uv=gt(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Gc).getRegex(),Hv="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Bv=gt(Hv,"gu").replace(/notPunctSpace/g,Ep).replace(/punctSpace/g,Pf).replace(/punct/g,Gc).getRegex(),Iv=gt(/\\(punct)/,"gu").replace(/punct/g,Gc).getRegex(),qv=gt(/^<(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(),Gv=gt(kp).replace("(?:-->|$)","-->").getRegex(),Yv=gt("^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",Gv).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),If=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,$v=gt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",If).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),T_=gt(/^!?\[(label)\]\[(ref)\]/).replace("label",If).replace("ref",Np).getRegex(),E_=gt(/^!?\[(ref)\](?:\[\])?/).replace("ref",Np).getRegex(),Xv=gt("reflink|nolink(?!\\()","g").replace("reflink",T_).replace("nolink",E_).getRegex(),Ix=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Cp={_backpedal:gr,anyPunctuation:Iv,autolink:qv,blockSkip:Mv,br:w_,code:kv,del:gr,delLDelim:gr,delRDelim:gr,emStrongLDelim:Rv,emStrongRDelimAst:Ov,emStrongRDelimUnd:zv,escape:Nv,link:$v,nolink:E_,punctuation:Ev,reflink:T_,reflinkSearch:Xv,tag:Yv,text:Tv,url:gr},Vv={...Cp,link:gt(/^!?\[(label)\]\((.*?)\)/).replace("label",If).getRegex(),reflink:gt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",If).getRegex()},op={...Cp,emStrongRDelimAst:Lv,emStrongLDelim:Dv,delLDelim:Uv,delRDelim:Bv,url:gt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Ix).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:gt(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Ix).getRegex()},Qv={...op,br:gt(w_).replace("{2,}","*").getRegex(),text:gt(op.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},gf={normal:Tp,gfm:wv,pedantic:Sv},Vo={normal:Cp,gfm:op,breaks:Qv,pedantic:Vv},Kv={"&":"&","<":"<",">":">",'"':""","'":"'"},qx=l=>Kv[l];function Js(l,s){if(s){if(bl.escapeTest.test(l))return l.replace(bl.escapeReplace,qx)}else if(bl.escapeTestNoEncode.test(l))return l.replace(bl.escapeReplaceNoEncode,qx);return l}function Gx(l){try{l=encodeURI(l).replace(bl.percentDecode,"%")}catch{return null}return l}function Yx(l,s){var d;let r=l.replace(bl.findPipe,(h,m,g)=>{let x=!1,y=m;for(;--y>=0&&g[y]==="\\";)x=!x;return x?"|":" |"}),c=r.split(bl.splitPipe),o=0;if(c[0].trim()||c.shift(),c.length>0&&!((d=c.at(-1))!=null&&d.trim())&&c.pop(),s)if(c.length>s)c.splice(s);else for(;c.length<s;)c.push("");for(;o<c.length;o++)c[o]=c[o].trim().replace(bl.slashPipe,"|");return c}function Mi(l,s,r){let c=l.length;if(c===0)return"";let o=0;for(;o<c&&l.charAt(c-o-1)===s;)o++;return l.slice(0,c-o)}function $x(l){let s=l.split(`
|
|
53
|
+
`),r=s.length-1;for(;r>=0&&bl.blankLine.test(s[r]);)r--;return s.length-r<=2?l:s.slice(0,r+1).join(`
|
|
54
|
+
`)}function Zv(l,s){if(l.indexOf(s[1])===-1)return-1;let r=0;for(let c=0;c<l.length;c++)if(l[c]==="\\")c++;else if(l[c]===s[0])r++;else if(l[c]===s[1]&&(r--,r<0))return c;return r>0?-2:-1}function Fv(l,s=0){let r=s,c="";for(let o of l)if(o===" "){let d=4-r%4;c+=" ".repeat(d),r+=d}else c+=o,r++;return c}function Xx(l,s,r,c,o){let d=s.href,h=s.title||null,m=l[1].replace(o.other.outputLinkReplace,"$1");c.state.inLink=!0;let g={type:l[0].charAt(0)==="!"?"image":"link",raw:r,href:d,title:h,text:m,tokens:c.inlineTokens(m)};return c.state.inLink=!1,g}function Jv(l,s,r){let c=l.match(r.other.indentCodeCompensation);if(c===null)return s;let o=c[1];return s.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 qf=class{constructor(l){Xt(this,"options");Xt(this,"rules");Xt(this,"lexer");this.options=l||kr}space(l){let s=this.rules.block.newline.exec(l);if(s&&s[0].length>0)return{type:"space",raw:s[0]}}code(l){let s=this.rules.block.code.exec(l);if(s){let r=this.options.pedantic?s[0]:$x(s[0]),c=r.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r,codeBlockStyle:"indented",text:c}}}fences(l){let s=this.rules.block.fences.exec(l);if(s){let r=s[0],c=Jv(r,s[3]||"",this.rules);return{type:"code",raw:r,lang:s[2]?s[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):s[2],text:c}}}heading(l){let s=this.rules.block.heading.exec(l);if(s){let r=s[2].trim();if(this.rules.other.endingHash.test(r)){let c=Mi(r,"#");(this.options.pedantic||!c||this.rules.other.endingSpaceChar.test(c))&&(r=c.trim())}return{type:"heading",raw:Mi(s[0],`
|
|
57
|
+
`),depth:s[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(l){let s=this.rules.block.hr.exec(l);if(s)return{type:"hr",raw:Mi(s[0],`
|
|
58
|
+
`)}}blockquote(l){let s=this.rules.block.blockquote.exec(l);if(s){let r=Mi(s[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 E=v,k=E.raw+`
|
|
65
|
+
`+r.join(`
|
|
66
|
+
`),C=this.blockquote(k);d[d.length-1]=C,c=c.substring(0,c.length-E.raw.length)+C.raw,o=o.substring(0,o.length-E.text.length)+C.text;break}else if((v==null?void 0:v.type)==="list"){let E=v,k=E.raw+`
|
|
67
|
+
`+r.join(`
|
|
68
|
+
`),C=this.list(k);d[d.length-1]=C,c=c.substring(0,c.length-v.raw.length)+C.raw,o=o.substring(0,o.length-E.raw.length)+C.raw,r=k.substring(d.at(-1).raw.length).split(`
|
|
69
|
+
`);continue}}return{type:"blockquote",raw:c,tokens:d,text:o}}}list(l){let s=this.rules.block.list.exec(l);if(s){let r=s[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(;l;){let g=!1,x="",y="";if(!(s=d.exec(l))||this.rules.block.hr.test(l))break;x=s[0],l=l.substring(x.length);let j=Fv(s[2].split(`
|
|
70
|
+
`,1)[0],s[1].length),v=l.split(`
|
|
71
|
+
`,1)[0],E=!j.trim(),k=0;if(this.options.pedantic?(k=2,y=j.trimStart()):E?k=s[1].length+1:(k=j.search(this.rules.other.nonSpaceChar),k=k>4?1:k,y=j.slice(k),k+=s[1].length),E&&this.rules.other.blankLine.test(v)&&(x+=v+`
|
|
72
|
+
`,l=l.substring(v.length+1),g=!0),!g){let C=this.rules.other.nextBulletRegex(k),A=this.rules.other.hrRegex(k),G=this.rules.other.fencesBeginRegex(k),Z=this.rules.other.headingBeginRegex(k),Y=this.rules.other.htmlBeginRegex(k),H=this.rules.other.blockquoteBeginRegex(k);for(;l;){let $=l.split(`
|
|
73
|
+
`,1)[0],B;if(v=$,this.options.pedantic?(v=v.replace(this.rules.other.listReplaceNesting," "),B=v):B=v.replace(this.rules.other.tabCharGlobal," "),G.test(v)||Z.test(v)||Y.test(v)||H.test(v)||C.test(v)||A.test(v))break;if(B.search(this.rules.other.nonSpaceChar)>=k||!v.trim())y+=`
|
|
74
|
+
`+B.slice(k);else{if(E||j.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||G.test(j)||Z.test(j)||A.test(j))break;y+=`
|
|
75
|
+
`+v}E=!v.trim(),x+=$+`
|
|
76
|
+
`,l=l.substring($.length+1),j=B.slice(k)}}o.loose||(h?o.loose=!0:this.rules.other.doubleBlankLine.test(x)&&(h=!0)),o.items.push({type:"list_item",raw:x,task:!!this.options.gfm&&this.rules.other.listIsTask.test(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(l){let s=this.rules.block.html.exec(l);if(s){let r=$x(s[0]);return{type:"html",block:!0,raw:r,pre:s[1]==="pre"||s[1]==="script"||s[1]==="style",text:r}}}def(l){let s=this.rules.block.def.exec(l);if(s){let r=s[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),c=s[2]?s[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=s[3]?s[3].substring(1,s[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):s[3];return{type:"def",tag:r,raw:Mi(s[0],`
|
|
77
|
+
`),href:c,title:o}}}table(l){var h;let s=this.rules.block.table.exec(l);if(!s||!this.rules.other.tableDelimiter.test(s[2]))return;let r=Yx(s[1]),c=s[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=(h=s[3])!=null&&h.trim()?s[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
78
|
+
`):[],d={type:"table",raw:Mi(s[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(Yx(m,d.header.length).map((g,x)=>({text:g,tokens:this.lexer.inline(g),header:!1,align:d.align[x]})));return d}}lheading(l){let s=this.rules.block.lheading.exec(l);if(s){let r=s[1].trim();return{type:"heading",raw:Mi(s[0],`
|
|
80
|
+
`),depth:s[2].charAt(0)==="="?1:2,text:r,tokens:this.lexer.inline(r)}}}paragraph(l){let s=this.rules.block.paragraph.exec(l);if(s){let r=s[1].charAt(s[1].length-1)===`
|
|
81
|
+
`?s[1].slice(0,-1):s[1];return{type:"paragraph",raw:s[0],text:r,tokens:this.lexer.inline(r)}}}text(l){let s=this.rules.block.text.exec(l);if(s)return{type:"text",raw:s[0],text:s[0],tokens:this.lexer.inline(s[0])}}escape(l){let s=this.rules.inline.escape.exec(l);if(s)return{type:"escape",raw:s[0],text:s[1]}}tag(l){let s=this.rules.inline.tag.exec(l);if(s)return!this.lexer.state.inLink&&this.rules.other.startATag.test(s[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(s[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(s[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(s[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:s[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:s[0]}}link(l){let s=this.rules.inline.link.exec(l);if(s){let r=s[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let d=Mi(r.slice(0,-1),"\\");if((r.length-d.length)%2===0)return}else{let d=Zv(s[2],"()");if(d===-2)return;if(d>-1){let h=(s[0].indexOf("!")===0?5:4)+s[1].length+d;s[2]=s[2].substring(0,d),s[0]=s[0].substring(0,h).trim(),s[3]=""}}let c=s[2],o="";if(this.options.pedantic){let d=this.rules.other.pedanticHrefTitle.exec(c);d&&(c=d[1],o=d[3])}else o=s[3]?s[3].slice(1,-1):"";return c=c.trim(),this.rules.other.startAngleBracket.test(c)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?c=c.slice(1):c=c.slice(1,-1)),Xx(s,{href:c&&c.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},s[0],this.lexer,this.rules)}}reflink(l,s){let r;if((r=this.rules.inline.reflink.exec(l))||(r=this.rules.inline.nolink.exec(l))){let c=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=s[c.toLowerCase()];if(!o){let d=r[0].charAt(0);return{type:"text",raw:d,text:d}}return Xx(r,o,r[0],this.lexer,this.rules)}}emStrong(l,s,r=""){let c=this.rules.inline.emStrongLDelim.exec(l);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,s=s.slice(-1*l.length+o);(c=x.exec(s))!==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=l.slice(0,o+c.index+y+h);if(Math.min(o,h)%2){let E=j.slice(1,-1);return{type:"em",raw:j,text:E,tokens:this.lexer.inlineTokens(E)}}let v=j.slice(2,-2);return{type:"strong",raw:j,text:v,tokens:this.lexer.inlineTokens(v)}}}}codespan(l){let s=this.rules.inline.code.exec(l);if(s){let r=s[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:s[0],text:r}}}br(l){let s=this.rules.inline.br.exec(l);if(s)return{type:"br",raw:s[0]}}del(l,s,r=""){let c=this.rules.inline.delLDelim.exec(l);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,s=s.slice(-1*l.length+o);(c=g.exec(s))!==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=l.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(l){let s=this.rules.inline.autolink.exec(l);if(s){let r,c;return s[2]==="@"?(r=s[1],c="mailto:"+r):(r=s[1],c=r),{type:"link",raw:s[0],text:r,href:c,tokens:[{type:"text",raw:r,text:r}]}}}url(l){var r;let s;if(s=this.rules.inline.url.exec(l)){let c,o;if(s[2]==="@")c=s[0],o="mailto:"+c;else{let d;do d=s[0],s[0]=((r=this.rules.inline._backpedal.exec(s[0]))==null?void 0:r[0])??"";while(d!==s[0]);c=s[0],s[1]==="www."?o="http://"+s[0]:o=s[0]}return{type:"link",raw:s[0],text:c,href:o,tokens:[{type:"text",raw:c,text:c}]}}}inlineText(l){let s=this.rules.inline.text.exec(l);if(s){let r=this.lexer.state.inRawBlock;return{type:"text",raw:s[0],text:s[0],escaped:r}}}},Ts=class up{constructor(s){Xt(this,"tokens");Xt(this,"options");Xt(this,"state");Xt(this,"inlineQueue");Xt(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=s||kr,this.options.tokenizer=this.options.tokenizer||new qf,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:bl,block:gf.normal,inline:Vo.normal};this.options.pedantic?(r.block=gf.pedantic,r.inline=Vo.pedantic):this.options.gfm&&(r.block=gf.gfm,this.options.breaks?r.inline=Vo.breaks:r.inline=Vo.gfm),this.tokenizer.rules=r}static get rules(){return{block:gf,inline:Vo}}static lex(s,r){return new up(r).lex(s)}static lexInline(s,r){return new up(r).inlineTokens(s)}lex(s){s=s.replace(bl.carriageReturn,`
|
|
82
|
+
`),this.blockTokens(s,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(s,r=[],c=!1){var d,h,m;this.tokenizer.lexer=this,this.options.pedantic&&(s=s.replace(bl.tabCharGlobal," ").replace(bl.spaceLine,""));let o=1/0;for(;s;){if(s.length<o)o=s.length;else{this.infiniteLoopError(s.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},s,r))?(s=s.substring(g.raw.length),r.push(g),!0):!1))continue;if(g=this.tokenizer.space(s)){s=s.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(s)){s=s.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(s)){s=s.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.heading(s)){s=s.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.hr(s)){s=s.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.blockquote(s)){s=s.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.list(s)){s=s.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.html(s)){s=s.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.def(s)){s=s.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(s)){s=s.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.lheading(s)){s=s.substring(g.raw.length),r.push(g);continue}let x=s;if((m=this.options.extensions)!=null&&m.startBlock){let y=1/0,j=s.slice(1),v;this.options.extensions.startBlock.forEach(E=>{v=E.call({lexer:this},j),typeof v=="number"&&v>=0&&(y=Math.min(y,v))}),y<1/0&&y>=0&&(x=s.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!==s.length,s=s.substring(g.raw.length);continue}if(g=this.tokenizer.text(s)){s=s.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(s){this.infiniteLoopError(s.charCodeAt(0));break}}return this.state.top=!0,r}inline(s,r=[]){return this.inlineQueue.push({src:s,tokens:r}),r}inlineTokens(s,r=[]){var m,g,x,y,j;this.tokenizer.lexer=this;let c=s;if(this.tokens.links){let v=Object.keys(this.tokens.links);v.length>0&&(c=c.replace(this.tokenizer.rules.inline.reflinkSearch,E=>v.includes(E.slice(E.lastIndexOf("[")+1,-1))?"["+"a".repeat(E.length-2)+"]":E))}c=c.replace(this.tokenizer.rules.inline.anyPunctuation,"++"),c=c.replace(this.tokenizer.rules.inline.blockSkip,(v,E,k)=>{let C=k?k.length:0;return v.slice(0,C)+"["+"a".repeat(v.length-C-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(;s;){if(s.length<h)h=s.length;else{this.infiniteLoopError(s.charCodeAt(0));break}o||(d=""),o=!1;let v;if((y=(x=this.options.extensions)==null?void 0:x.inline)!=null&&y.some(k=>(v=k.call({lexer:this},s,r))?(s=s.substring(v.raw.length),r.push(v),!0):!1))continue;if(v=this.tokenizer.escape(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.tag(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.link(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.reflink(s,this.tokens.links)){s=s.substring(v.raw.length);let k=r.at(-1);v.type==="text"&&(k==null?void 0:k.type)==="text"?(k.raw+=v.raw,k.text+=v.text):r.push(v);continue}if(v=this.tokenizer.emStrong(s,c,d)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.codespan(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.br(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.del(s,c,d)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.autolink(s)){s=s.substring(v.raw.length),r.push(v);continue}if(!this.state.inLink&&(v=this.tokenizer.url(s))){s=s.substring(v.raw.length),r.push(v);continue}let E=s;if((j=this.options.extensions)!=null&&j.startInline){let k=1/0,C=s.slice(1),A;this.options.extensions.startInline.forEach(G=>{A=G.call({lexer:this},C),typeof A=="number"&&A>=0&&(k=Math.min(k,A))}),k<1/0&&k>=0&&(E=s.substring(0,k+1))}if(v=this.tokenizer.inlineText(E)){s=s.substring(v.raw.length),v.raw.slice(-1)!=="_"&&(d=v.raw.slice(-1)),o=!0;let k=r.at(-1);(k==null?void 0:k.type)==="text"?(k.raw+=v.raw,k.text+=v.text):r.push(v);continue}if(s){this.infiniteLoopError(s.charCodeAt(0));break}}return r}infiniteLoopError(s){let r="Infinite loop on byte: "+s;if(this.options.silent)console.error(r);else throw new Error(r)}},Gf=class{constructor(l){Xt(this,"options");Xt(this,"parser");this.options=l||kr}space(l){return""}code({text:l,lang:s,escaped:r}){var d;let c=(d=(s||"").match(bl.notSpaceStart))==null?void 0:d[0],o=l.replace(bl.endingNewline,"")+`
|
|
96
|
+
`;return c?'<pre><code class="language-'+Js(c)+'">'+(r?o:Js(o,!0))+`</code></pre>
|
|
97
|
+
`:"<pre><code>"+(r?o:Js(o,!0))+`</code></pre>
|
|
98
|
+
`}blockquote({tokens:l}){return`<blockquote>
|
|
99
|
+
${this.parser.parse(l)}</blockquote>
|
|
100
|
+
`}html({text:l}){return l}def(l){return""}heading({tokens:l,depth:s}){return`<h${s}>${this.parser.parseInline(l)}</h${s}>
|
|
101
|
+
`}hr(l){return`<hr>
|
|
102
|
+
`}list(l){let s=l.ordered,r=l.start,c="";for(let h=0;h<l.items.length;h++){let m=l.items[h];c+=this.listitem(m)}let o=s?"ol":"ul",d=s&&r!==1?' start="'+r+'"':"";return"<"+o+d+`>
|
|
103
|
+
`+c+"</"+o+`>
|
|
104
|
+
`}listitem(l){return`<li>${this.parser.parse(l.tokens)}</li>
|
|
105
|
+
`}checkbox({checked:l}){return"<input "+(l?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:l}){return`<p>${this.parser.parseInline(l)}</p>
|
|
106
|
+
`}table(l){let s="",r="";for(let o=0;o<l.header.length;o++)r+=this.tablecell(l.header[o]);s+=this.tablerow({text:r});let c="";for(let o=0;o<l.rows.length;o++){let d=l.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
|
+
`+s+`</thead>
|
|
109
|
+
`+c+`</table>
|
|
110
|
+
`}tablerow({text:l}){return`<tr>
|
|
111
|
+
${l}</tr>
|
|
112
|
+
`}tablecell(l){let s=this.parser.parseInline(l.tokens),r=l.header?"th":"td";return(l.align?`<${r} align="${l.align}">`:`<${r}>`)+s+`</${r}>
|
|
113
|
+
`}strong({tokens:l}){return`<strong>${this.parser.parseInline(l)}</strong>`}em({tokens:l}){return`<em>${this.parser.parseInline(l)}</em>`}codespan({text:l}){return`<code>${Js(l,!0)}</code>`}br(l){return"<br>"}del({tokens:l}){return`<del>${this.parser.parseInline(l)}</del>`}link({href:l,title:s,tokens:r}){let c=this.parser.parseInline(r),o=Gx(l);if(o===null)return c;l=o;let d='<a href="'+l+'"';return s&&(d+=' title="'+Js(s)+'"'),d+=">"+c+"</a>",d}image({href:l,title:s,text:r,tokens:c}){c&&(r=this.parser.parseInline(c,this.parser.textRenderer));let o=Gx(l);if(o===null)return Js(r);l=o;let d=`<img src="${l}" alt="${Js(r)}"`;return s&&(d+=` title="${Js(s)}"`),d+=">",d}text(l){return"tokens"in l&&l.tokens?this.parser.parseInline(l.tokens):"escaped"in l&&l.escaped?l.text:Js(l.text)}},Ap=class{strong({text:l}){return l}em({text:l}){return l}codespan({text:l}){return l}del({text:l}){return l}html({text:l}){return l}text({text:l}){return l}link({text:l}){return""+l}image({text:l}){return""+l}br(){return""}checkbox({raw:l}){return l}},Es=class fp{constructor(s){Xt(this,"options");Xt(this,"renderer");Xt(this,"textRenderer");this.options=s||kr,this.options.renderer=this.options.renderer||new Gf,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ap}static parse(s,r){return new fp(r).parse(s)}static parseInline(s,r){return new fp(r).parseInline(s)}parse(s){var c,o;this.renderer.parser=this;let r="";for(let d=0;d<s.length;d++){let h=s[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(s,r=this.renderer){var o,d;this.renderer.parser=this;let c="";for(let h=0;h<s.length;h++){let m=s[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}},Of,eu=(Of=class{constructor(l){Xt(this,"options");Xt(this,"block");this.options=l||kr}preprocess(l){return l}postprocess(l){return l}processAllTokens(l){return l}emStrongMask(l){return l}provideLexer(l=this.block){return l?Ts.lex:Ts.lexInline}provideParser(l=this.block){return l?Es.parse:Es.parseInline}},Xt(Of,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),Xt(Of,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Of),Pv=class{constructor(...l){Xt(this,"defaults",jp());Xt(this,"options",this.setOptions);Xt(this,"parse",this.parseMarkdown(!0));Xt(this,"parseInline",this.parseMarkdown(!1));Xt(this,"Parser",Es);Xt(this,"Renderer",Gf);Xt(this,"TextRenderer",Ap);Xt(this,"Lexer",Ts);Xt(this,"Tokenizer",qf);Xt(this,"Hooks",eu);this.use(...l)}walkTokens(l,s){var c,o;let r=[];for(let d of l)switch(r=r.concat(s.call(this,d)),d.type){case"table":{let h=d;for(let m of h.header)r=r.concat(this.walkTokens(m.tokens,s));for(let m of h.rows)for(let g of m)r=r.concat(this.walkTokens(g.tokens,s));break}case"list":{let h=d;r=r.concat(this.walkTokens(h.items,s));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,s))}):h.tokens&&(r=r.concat(this.walkTokens(h.tokens,s)))}}return r}use(...l){let s=this.defaults.extensions||{renderers:{},childTokens:{}};return l.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=s.renderers[o.name];d?s.renderers[o.name]=function(...h){let m=o.renderer.apply(this,h);return m===!1&&(m=d.apply(this,h)),m}:s.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let d=s[o.level];d?d.unshift(o.tokenizer):s[o.level]=[o.tokenizer],o.start&&(o.level==="block"?s.startBlock?s.startBlock.push(o.start):s.startBlock=[o.start]:o.level==="inline"&&(s.startInline?s.startInline.push(o.start):s.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(s.childTokens[o.name]=o.childTokens)}),c.extensions=s),r.renderer){let o=this.defaults.renderer||new Gf(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 qf(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 eu;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];eu.passThroughHooks.has(d)?o[h]=x=>{if(this.defaults.async&&eu.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(l){return this.defaults={...this.defaults,...l},this}lexer(l,s){return Ts.lex(l,s??this.defaults)}parser(l,s){return Es.parse(l,s??this.defaults)}parseMarkdown(l){return(s,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 s>"u"||s===null)return d(new Error("marked(): input parameter is undefined or null"));if(typeof s!="string")return d(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(s)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=l),o.async)return(async()=>{let h=o.hooks?await o.hooks.preprocess(s):s,m=await(o.hooks?await o.hooks.provideLexer(l):l?Ts.lex:Ts.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(l):l?Es.parse:Es.parseInline)(g,o);return o.hooks?await o.hooks.postprocess(x):x})().catch(d);try{o.hooks&&(s=o.hooks.preprocess(s));let h=(o.hooks?o.hooks.provideLexer(l):l?Ts.lex:Ts.lexInline)(s,o);o.hooks&&(h=o.hooks.processAllTokens(h)),o.walkTokens&&this.walkTokens(h,o.walkTokens);let m=(o.hooks?o.hooks.provideParser(l):l?Es.parse:Es.parseInline)(h,o);return o.hooks&&(m=o.hooks.postprocess(m)),m}catch(h){return d(h)}}}onError(l,s){return r=>{if(r.message+=`
|
|
114
|
+
Please report this to https://github.com/markedjs/marked.`,l){let c="<p>An error occurred:</p><pre>"+Js(r.message+"",!0)+"</pre>";return s?Promise.resolve(c):c}if(s)return Promise.reject(r);throw r}}},Nr=new Pv;function Dt(l,s){return Nr.parse(l,s)}Dt.options=Dt.setOptions=function(l){return Nr.setOptions(l),Dt.defaults=Nr.defaults,__(Dt.defaults),Dt};Dt.getDefaults=jp;Dt.defaults=kr;Dt.use=function(...l){return Nr.use(...l),Dt.defaults=Nr.defaults,__(Dt.defaults),Dt};Dt.walkTokens=function(l,s){return Nr.walkTokens(l,s)};Dt.parseInline=Nr.parseInline;Dt.Parser=Es;Dt.parser=Es.parse;Dt.Renderer=Gf;Dt.TextRenderer=Ap;Dt.Lexer=Ts;Dt.lexer=Ts.lex;Dt.Tokenizer=qf;Dt.Hooks=eu;Dt.parse=Dt;Dt.options;Dt.setOptions;Dt.use;Dt.walkTokens;Dt.parseInline;Es.parse;Ts.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 Vx(l,s){(s==null||s>l.length)&&(s=l.length);for(var r=0,c=Array(s);r<s;r++)c[r]=l[r];return c}function Wv(l){if(Array.isArray(l))return l}function e1(l,s){var r=l==null?null:typeof Symbol<"u"&&l[Symbol.iterator]||l["@@iterator"];if(r!=null){var c,o,d,h,m=[],g=!0,x=!1;try{if(d=(r=r.call(l)).next,s!==0)for(;!(g=(c=d.call(r)).done)&&(m.push(c.value),m.length!==s);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 t1(){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 n1(l,s){return Wv(l)||e1(l,s)||l1(l,s)||t1()}function l1(l,s){if(l){if(typeof l=="string")return Vx(l,s);var r={}.toString.call(l).slice(8,-1);return r==="Object"&&l.constructor&&(r=l.constructor.name),r==="Map"||r==="Set"?Array.from(l):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Vx(l,s):void 0}}const C_=Object.entries,Qx=Object.setPrototypeOf,s1=Object.isFrozen,a1=Object.getPrototypeOf,i1=Object.getOwnPropertyDescriptor;let cl=Object.freeze,ol=Object.seal,kc=Object.create,A_=typeof Reflect<"u"&&Reflect,dp=A_.apply,hp=A_.construct;cl||(cl=function(s){return s});ol||(ol=function(s){return s});dp||(dp=function(s,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 s.apply(r,o)});hp||(hp=function(s){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 s(...c)});const vc=Gn(Array.prototype.forEach),r1=Gn(Array.prototype.lastIndexOf),Kx=Gn(Array.prototype.pop),jc=Gn(Array.prototype.push),c1=Gn(Array.prototype.splice),Ui=Array.isArray,tu=Gn(String.prototype.toLowerCase),Yh=Gn(String.prototype.toString),Zx=Gn(String.prototype.match),Qo=Gn(String.prototype.replace),Fx=Gn(String.prototype.indexOf),o1=Gn(String.prototype.trim),u1=Gn(Number.prototype.toString),f1=Gn(Boolean.prototype.toString),Jx=typeof BigInt>"u"?null:Gn(BigInt.prototype.toString),Px=typeof Symbol>"u"?null:Gn(Symbol.prototype.toString),Pn=Gn(Object.prototype.hasOwnProperty),Ko=Gn(Object.prototype.toString),Jn=Gn(RegExp.prototype.test),dr=d1(TypeError);function Gn(l){return function(s){s instanceof RegExp&&(s.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 dp(l,s,c)}}function d1(l){return function(){for(var s=arguments.length,r=new Array(s),c=0;c<s;c++)r[c]=arguments[c];return hp(l,r)}}function mt(l,s){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:tu;if(Qx&&Qx(l,null),!Ui(s))return l;let c=s.length;for(;c--;){let o=s[c];if(typeof o=="string"){const d=r(o);d!==o&&(s1(s)||(s[c]=d),o=d)}l[o]=!0}return l}function h1(l){for(let s=0;s<l.length;s++)Pn(l,s)||(l[s]=null);return l}function Tl(l){const s=kc(null);for(const c of C_(l)){var r=n1(c,2);const o=r[0],d=r[1];Pn(l,o)&&(Ui(d)?s[o]=h1(d):d&&typeof d=="object"&&d.constructor===Object?s[o]=Tl(d):s[o]=d)}return s}function p1(l){switch(typeof l){case"string":return l;case"number":return u1(l);case"boolean":return f1(l);case"bigint":return Jx?Jx(l):"0";case"symbol":return Px?Px(l):"Symbol()";case"undefined":return Ko(l);case"function":case"object":{if(l===null)return Ko(l);const s=l,r=Ps(s,"toString");if(typeof r=="function"){const c=r(s);return typeof c=="string"?c:Ko(c)}return Ko(l)}default:return Ko(l)}}function Ps(l,s){for(;l!==null;){const c=i1(l,s);if(c){if(c.get)return Gn(c.get);if(typeof c.value=="function")return Gn(c.value)}l=a1(l)}function r(){return null}return r}function m1(l){try{return Jn(l,""),!0}catch{return!1}}const Wx=cl(["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"]),$h=cl(["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"]),Xh=cl(["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"]),g1=cl(["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"]),Vh=cl(["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"]),x1=cl(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),eb=cl(["#text"]),tb=cl(["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"]),Qh=cl(["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"]),nb=cl(["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"]),xf=cl(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),b1=ol(/{{[\w\W]*|^[\w\W]*}}/g),_1=ol(/<%[\w\W]*|^[\w\W]*%>/g),y1=ol(/\${[\w\W]*/g),v1=ol(/^data-[\-\w.\u00B7-\uFFFF]+$/),j1=ol(/^aria-[\-\w]+$/),lb=ol(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),w1=ol(/^(?:\w+script|data):/i),S1=ol(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),N1=ol(/^html$/i),k1=ol(/^[a-z][.\w]*(-[.\w]+)+$/i),sb=ol(/<[/\w!]/g),ab=ol(/<[/\w]/g),T1=ol(/<\/no(script|embed|frames)/i),E1=ol(/\/>/i),Zl={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},C1=function(){return typeof window>"u"?null:window},A1=function(s,r){if(typeof s!="object"||typeof s.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 s.createPolicy(d,{createHTML(h){return h},createScriptURL(h){return h}})}catch{return console.warn("TrustedTypes policy "+d+" could not be created."),null}},ib=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Ri=function(s,r,c,o){return Pn(s,r)&&Ui(s[r])?mt(o.base?Tl(o.base):{},s[r],o.transform):c};function M_(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:C1();const s=pe=>M_(pe);if(s.version="3.4.12",s.removed=[],!l||!l.document||l.document.nodeType!==Zl.document||!l.Element)return s.isSupported=!1,s;let r=l.document;const c=r,o=c.currentScript;l.DocumentFragment;const d=l.HTMLTemplateElement,h=l.Node,m=l.Element,g=l.NodeFilter,x=l.NamedNodeMap;x===void 0&&(l.NamedNodeMap||l.MozNamedAttrMap),l.HTMLFormElement;const y=l.DOMParser,j=l.trustedTypes,v=m.prototype,E=Ps(v,"cloneNode"),k=Ps(v,"remove"),C=Ps(v,"nextSibling"),A=Ps(v,"childNodes"),G=Ps(v,"parentNode"),Z=Ps(v,"shadowRoot"),Y=Ps(v,"attributes"),H=h&&h.prototype?Ps(h.prototype,"nodeType"):null,$=h&&h.prototype?Ps(h.prototype,"nodeName"):null;if(typeof d=="function"){const pe=r.createElement("template");pe.content&&pe.content.ownerDocument&&(r=pe.content.ownerDocument)}let B,D="",R,O=!1,ee=0;const P=function(){if(ee>0)throw dr('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.')},ae=function(T){P(),ee++;try{return B.createHTML(T)}finally{ee--}},be=function(T){P(),ee++;try{return B.createScriptURL(T)}finally{ee--}},Ee=function(){return O||(R=A1(j,o),O=!0),R},je=r,X=je.implementation,ue=je.createNodeIterator,de=je.createDocumentFragment,_e=je.getElementsByTagName,Ae=c.importNode;let w=ib();s.isSupported=typeof C_=="function"&&typeof G=="function"&&X&&X.createHTMLDocument!==void 0;const V=b1,z=_1,ge=y1,ve=v1,Re=j1,Oe=w1,Ue=S1,qe=k1;let rn=lb,Ve=null;const Ft=mt({},[...Wx,...$h,...Xh,...Vh,...eb]);let ut=null;const ht=mt({},[...tb,...Qh,...nb,...xf]);let Ge=Object.seal(kc(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}})),cn=null,Nn=null;const st=Object.seal(kc(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let kn=!0,Wn=!0,on=!1,el=!0,qt=!1,tt=!0,Ot=!1,Yn=!1,Ct=null,nt=null,at=!1,pn=!1,yn=!1,Zn=!1,en=!0,St=!1;const Jt="user-content-";let Nt=!0,tl=!1,le={},me=null;const Be=mt({},["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 Fe=null;const Ie=mt({},["audio","video","img","source","image","track"]);let At=null;const I=mt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),oe="http://www.w3.org/1998/Math/MathML",Ne="http://www.w3.org/2000/svg",Le="http://www.w3.org/1999/xhtml";let kt=Le,Tn=!1,ul=null;const yl=mt({},[oe,Ne,Le],Yh),ds=cl(["mi","mo","mn","ms","mtext"]);let Fl=mt({},ds);const Jl=cl(["annotation-xml"]);let Pl=mt({},Jl);const Ka=mt({},["title","style","font","a","script"]);let fl=null;const nl=["application/xhtml+xml","text/html"],Lt="text/html";let Ze=null,vn=null;const Vt=r.createElement("form"),vl=function(T){return T instanceof RegExp||T instanceof Function},Pt=function(){let T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(vn&&vn===T)return;(!T||typeof T!="object")&&(T={}),T=Tl(T),fl=nl.indexOf(T.PARSER_MEDIA_TYPE)===-1?Lt:T.PARSER_MEDIA_TYPE,Ze=fl==="application/xhtml+xml"?Yh:tu,Ve=Ri(T,"ALLOWED_TAGS",Ft,{transform:Ze}),ut=Ri(T,"ALLOWED_ATTR",ht,{transform:Ze}),ul=Ri(T,"ALLOWED_NAMESPACES",yl,{transform:Yh}),At=Ri(T,"ADD_URI_SAFE_ATTR",I,{transform:Ze,base:I}),Fe=Ri(T,"ADD_DATA_URI_TAGS",Ie,{transform:Ze,base:Ie}),me=Ri(T,"FORBID_CONTENTS",Be,{transform:Ze}),cn=Ri(T,"FORBID_TAGS",Tl({}),{transform:Ze}),Nn=Ri(T,"FORBID_ATTR",Tl({}),{transform:Ze}),le=Pn(T,"USE_PROFILES")?T.USE_PROFILES&&typeof T.USE_PROFILES=="object"?Tl(T.USE_PROFILES):T.USE_PROFILES:!1,kn=T.ALLOW_ARIA_ATTR!==!1,Wn=T.ALLOW_DATA_ATTR!==!1,on=T.ALLOW_UNKNOWN_PROTOCOLS||!1,el=T.ALLOW_SELF_CLOSE_IN_ATTR!==!1,qt=T.SAFE_FOR_TEMPLATES||!1,tt=T.SAFE_FOR_XML!==!1,Ot=T.WHOLE_DOCUMENT||!1,pn=T.RETURN_DOM||!1,yn=T.RETURN_DOM_FRAGMENT||!1,Zn=T.RETURN_TRUSTED_TYPE||!1,at=T.FORCE_BODY||!1,en=T.SANITIZE_DOM!==!1,St=T.SANITIZE_NAMED_PROPS||!1,Nt=T.KEEP_CONTENT!==!1,tl=T.IN_PLACE||!1,rn=m1(T.ALLOWED_URI_REGEXP)?T.ALLOWED_URI_REGEXP:lb,kt=typeof T.NAMESPACE=="string"?T.NAMESPACE:Le,Fl=Pn(T,"MATHML_TEXT_INTEGRATION_POINTS")&&T.MATHML_TEXT_INTEGRATION_POINTS&&typeof T.MATHML_TEXT_INTEGRATION_POINTS=="object"?Tl(T.MATHML_TEXT_INTEGRATION_POINTS):mt({},ds),Pl=Pn(T,"HTML_INTEGRATION_POINTS")&&T.HTML_INTEGRATION_POINTS&&typeof T.HTML_INTEGRATION_POINTS=="object"?Tl(T.HTML_INTEGRATION_POINTS):mt({},Jl);const Q=Pn(T,"CUSTOM_ELEMENT_HANDLING")&&T.CUSTOM_ELEMENT_HANDLING&&typeof T.CUSTOM_ELEMENT_HANDLING=="object"?Tl(T.CUSTOM_ELEMENT_HANDLING):kc(null);if(Ge=kc(null),Pn(Q,"tagNameCheck")&&vl(Q.tagNameCheck)&&(Ge.tagNameCheck=Q.tagNameCheck),Pn(Q,"attributeNameCheck")&&vl(Q.attributeNameCheck)&&(Ge.attributeNameCheck=Q.attributeNameCheck),Pn(Q,"allowCustomizedBuiltInElements")&&typeof Q.allowCustomizedBuiltInElements=="boolean"&&(Ge.allowCustomizedBuiltInElements=Q.allowCustomizedBuiltInElements),ol(Ge),qt&&(Wn=!1),yn&&(pn=!0),le&&(Ve=mt({},eb),ut=kc(null),le.html===!0&&(mt(Ve,Wx),mt(ut,tb)),le.svg===!0&&(mt(Ve,$h),mt(ut,Qh),mt(ut,xf)),le.svgFilters===!0&&(mt(Ve,Xh),mt(ut,Qh),mt(ut,xf)),le.mathMl===!0&&(mt(Ve,Vh),mt(ut,nb),mt(ut,xf))),st.tagCheck=null,st.attributeCheck=null,Pn(T,"ADD_TAGS")&&(typeof T.ADD_TAGS=="function"?st.tagCheck=T.ADD_TAGS:Ui(T.ADD_TAGS)&&(Ve===Ft&&(Ve=Tl(Ve)),mt(Ve,T.ADD_TAGS,Ze))),Pn(T,"ADD_ATTR")&&(typeof T.ADD_ATTR=="function"?st.attributeCheck=T.ADD_ATTR:Ui(T.ADD_ATTR)&&(ut===ht&&(ut=Tl(ut)),mt(ut,T.ADD_ATTR,Ze))),Pn(T,"ADD_URI_SAFE_ATTR")&&Ui(T.ADD_URI_SAFE_ATTR)&&mt(At,T.ADD_URI_SAFE_ATTR,Ze),Pn(T,"FORBID_CONTENTS")&&Ui(T.FORBID_CONTENTS)&&(me===Be&&(me=Tl(me)),mt(me,T.FORBID_CONTENTS,Ze)),Pn(T,"ADD_FORBID_CONTENTS")&&Ui(T.ADD_FORBID_CONTENTS)&&(me===Be&&(me=Tl(me)),mt(me,T.ADD_FORBID_CONTENTS,Ze)),Nt&&(Ve["#text"]=!0),Ot&&mt(Ve,["html","head","body"]),Ve.table&&(mt(Ve,["tbody"]),delete cn.tbody),T.TRUSTED_TYPES_POLICY){if(typeof T.TRUSTED_TYPES_POLICY.createHTML!="function")throw dr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof T.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw dr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const he=B;B=T.TRUSTED_TYPES_POLICY;try{D=ae("")}catch(ye){throw B=he,ye}}else T.TRUSTED_TYPES_POLICY===null?(B=void 0,D=""):(B===void 0&&(B=Ee()),B&&typeof D=="string"&&(D=ae("")));cl&&cl(T),vn=T},hs=mt({},[...$h,...Xh,...g1]),Qt=mt({},[...Vh,...x1]),ps=function(T,Q,he){return Q.namespaceURI===Le?T==="svg":Q.namespaceURI===oe?T==="svg"&&(he==="annotation-xml"||Fl[he]):!!hs[T]},xt=function(T,Q,he){return Q.namespaceURI===Le?T==="math":Q.namespaceURI===Ne?T==="math"&&Pl[he]:!!Qt[T]},un=function(T,Q,he){return Q.namespaceURI===Ne&&!Pl[he]||Q.namespaceURI===oe&&!Fl[he]?!1:!Qt[T]&&(Ka[T]||!hs[T])},On=function(T){let Q=G(T);(!Q||!Q.tagName)&&(Q={namespaceURI:kt,tagName:"template"});const he=tu(T.tagName),ye=tu(Q.tagName);return ul[T.namespaceURI]?T.namespaceURI===Ne?ps(he,Q,ye):T.namespaceURI===oe?xt(he,Q,ye):T.namespaceURI===Le?un(he,Q,ye):!!(fl==="application/xhtml+xml"&&ul[T.namespaceURI]):!1},pt=function(T){jc(s.removed,{element:T});try{G(T).removeChild(T)}catch{if(k(T),!G(T))throw dr("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},it=function(T){$n(T);const Q=A(T);if(Q){const ye=[];vc(Q,He=>{jc(ye,He)}),vc(ye,He=>{try{k(He)}catch{}})}const he=Y(T);if(he)for(let ye=he.length-1;ye>=0;--ye){const He=he[ye],we=He&&He.name;if(typeof we=="string")try{T.removeAttribute(we)}catch{}}},En=function(T,Q){try{jc(s.removed,{attribute:Q.getAttributeNode(T),from:Q})}catch{jc(s.removed,{attribute:null,from:Q})}if(Q.removeAttribute(T),T==="is")if(pn||yn)try{pt(Q)}catch{}else try{Q.setAttribute(T,"")}catch{}},dl=function(T){const Q=Y(T);if(Q)for(let he=Q.length-1;he>=0;--he){const ye=Q[he],He=ye&&ye.name;if(!(typeof He!="string"||ut[Ze(He)]))try{T.removeAttribute(He)}catch{}}},$n=function(T){const Q=[T];for(;Q.length>0;){const he=Q.pop();(H?H(he):he.nodeType)===Zl.element&&dl(he);const He=A(he);if(He)for(let we=He.length-1;we>=0;--we)Q.push(He[we])}},hl=function(T){if(!tt)return;const Q=[T];for(;Q.length>0;){const he=Q.pop(),ye=H?H(he):he.nodeType;if(ye===Zl.processingInstruction||ye===Zl.comment&&Jn(ab,he.data)){try{k(he)}catch{}continue}if(ye===Zl.element){const we=he,_t=Ze($?$(he):he.nodeName);try{we.hasAttribute&&we.hasAttribute("patchsrc")&&we.removeAttribute("patchsrc"),we.hasAttribute&&we.hasAttribute("for")&&_t!=="label"&&_t!=="output"&&we.removeAttribute("for")}catch{}}const He=A(he);if(He)for(let we=He.length-1;we>=0;--we)Q.push(He[we])}},Ln=function(T){let Q=null,he=null;if(at)T="<remove></remove>"+T;else{const we=Zx(T,/^[\r\n\t ]+/);he=we&&we[0]}fl==="application/xhtml+xml"&&kt===Le&&(T='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+T+"</body></html>");const ye=B?ae(T):T;if(kt===Le)try{Q=new y().parseFromString(ye,fl)}catch{}if(!Q||!Q.documentElement){Q=X.createDocument(kt,"template",null);try{Q.documentElement.innerHTML=Tn?D:ye}catch{}}const He=Q.body||Q.documentElement;return T&&he&&He.insertBefore(r.createTextNode(he),He.childNodes[0]||null),kt===Le?_e.call(Q,Ot?"html":"body")[0]:Ot?Q.documentElement:He},mn=function(T){return ue.call(T.ownerDocument||T,T,g.SHOW_ELEMENT|g.SHOW_COMMENT|g.SHOW_TEXT|g.SHOW_PROCESSING_INSTRUCTION|g.SHOW_CDATA_SECTION,null)},jl=function(T){return T=Qo(T,V," "),T=Qo(T,z," "),T=Qo(T,ge," "),T},gn=function(T){var Q;T.normalize();const he=ue.call(T.ownerDocument||T,T,g.SHOW_TEXT|g.SHOW_COMMENT|g.SHOW_CDATA_SECTION|g.SHOW_PROCESSING_INSTRUCTION,null);let ye=he.nextNode();for(;ye;)ye.data=jl(ye.data),ye=he.nextNode();const He=(Q=T.querySelectorAll)===null||Q===void 0?void 0:Q.call(T,"template");He&&vc(He,we=>{ll(we.content)&&gn(we.content)})},El=function(T){const Q=$?$(T):null;return typeof Q!="string"||Ze(Q)!=="form"?!1:typeof T.nodeName!="string"||typeof T.textContent!="string"||typeof T.removeChild!="function"||T.attributes!==Y(T)||typeof T.removeAttribute!="function"||typeof T.setAttribute!="function"||typeof T.namespaceURI!="string"||typeof T.insertBefore!="function"||typeof T.hasChildNodes!="function"||T.nodeType!==H(T)||T.childNodes!==A(T)},ll=function(T){if(!H||typeof T!="object"||T===null)return!1;try{return H(T)===Zl.documentFragment}catch{return!1}},jn=function(T){if(!H||typeof T!="object"||T===null)return!1;try{return typeof H(T)=="number"}catch{return!1}};function Kt(pe,T,Q){pe.length!==0&&vc(pe,he=>{he.call(s,T,Q,vn)})}const ms=function(T,Q){return!!(tt&&T.hasChildNodes()&&!jn(T.firstElementChild)&&Jn(sb,T.textContent)&&Jn(sb,T.innerHTML)||tt&&T.namespaceURI===Le&&Q==="style"&&jn(T.firstElementChild)||T.nodeType===Zl.processingInstruction||tt&&T.nodeType===Zl.comment&&Jn(ab,T.data))},aa=function(T,Q){if(!cn[Q]&&es(Q)&&(Ge.tagNameCheck instanceof RegExp&&Jn(Ge.tagNameCheck,Q)||Ge.tagNameCheck instanceof Function&&Ge.tagNameCheck(Q)))return!1;if(Nt&&!me[Q]){const he=G(T),ye=A(T);if(ye&&he){const He=ye.length;for(let we=He-1;we>=0;--we){const _t=tl?ye[we]:E(ye[we],!0);he.insertBefore(_t,C(T))}}}return pt(T),!0},Cn=function(T,Q){if(Kt(w.beforeSanitizeElements,T,null),T!==Q&&G(T)===null)return!0;if(El(T))return pt(T),!0;const he=Ze($?$(T):T.nodeName);if(Kt(w.uponSanitizeElement,T,{tagName:he,allowedTags:Ve}),T!==Q&&G(T)===null)return!0;if(ms(T,he))return pt(T),!0;if(cn[he]||!(st.tagCheck instanceof Function&&st.tagCheck(he))&&!Ve[he]){const He=aa(T,he);return He===!1&&Kt(w.afterSanitizeElements,T,null),He}if((H?H(T):T.nodeType)===Zl.element&&!On(T)||(he==="noscript"||he==="noembed"||he==="noframes")&&Jn(T1,T.innerHTML))return pt(T),!0;if(qt&&T.nodeType===Zl.text){const He=jl(T.textContent);T.textContent!==He&&(jc(s.removed,{element:T.cloneNode()}),T.textContent=He)}return Kt(w.afterSanitizeElements,T,null),!1},Wl=function(T,Q,he){if(Nn[Q]||tt&&Q==="patchsrc"||tt&&Q==="for"&&T!=="label"&&T!=="output"||en&&(Q==="id"||Q==="name")&&(he in r||he in Vt))return!1;const ye=ut[Q]||st.attributeCheck instanceof Function&&st.attributeCheck(Q,T);if(!(Wn&&Jn(ve,Q))){if(!(kn&&Jn(Re,Q))){if(ye){if(!At[Q]){if(!Jn(rn,Qo(he,Ue,""))){if(!((Q==="src"||Q==="xlink:href"||Q==="href")&&T!=="script"&&Fx(he,"data:")===0&&Fe[T])){if(!(on&&!Jn(Oe,Qo(he,Ue,"")))){if(he)return!1}}}}}else if(!(es(T)&&(Ge.tagNameCheck instanceof RegExp&&Jn(Ge.tagNameCheck,T)||Ge.tagNameCheck instanceof Function&&Ge.tagNameCheck(T))&&(Ge.attributeNameCheck instanceof RegExp&&Jn(Ge.attributeNameCheck,Q)||Ge.attributeNameCheck instanceof Function&&Ge.attributeNameCheck(Q,T))||Q==="is"&&Ge.allowCustomizedBuiltInElements&&(Ge.tagNameCheck instanceof RegExp&&Jn(Ge.tagNameCheck,he)||Ge.tagNameCheck instanceof Function&&Ge.tagNameCheck(he))))return!1}}return!0},Cl=mt({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),es=function(T){return!Cl[tu(T)]&&Jn(qe,T)},Xn=function(T,Q,he,ye){if(B&&typeof j=="object"&&typeof j.getAttributeType=="function"&&!he)switch(j.getAttributeType(T,Q)){case"TrustedHTML":return ae(ye);case"TrustedScriptURL":return be(ye)}return ye},ia=function(T,Q,he,ye){try{he?T.setAttributeNS(he,Q,ye):T.setAttribute(Q,ye),El(T)?pt(T):Kx(s.removed)}catch{En(Q,T)}},gs=function(T){Kt(w.beforeSanitizeAttributes,T,null);const Q=T.attributes;if(!Q||El(T))return;const he={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ut,forceKeepAttr:void 0};let ye=Q.length;const He=Ze(T.nodeName);for(;ye--;){const we=Q[ye],_t=we.name,zt=we.namespaceURI,tn=we.value,yt=Ze(_t),xn=tn;let Mt=_t==="value"?xn:o1(xn);if(he.attrName=yt,he.attrValue=Mt,he.keepAttr=!0,he.forceKeepAttr=void 0,Kt(w.uponSanitizeAttribute,T,he),Mt=he.attrValue,St&&(yt==="id"||yt==="name")&&Fx(Mt,Jt)!==0&&(En(_t,T),Mt=Jt+Mt),tt&&Jn(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Mt)){En(_t,T);continue}if(yt==="attributename"&&Zx(Mt,"href")){En(_t,T);continue}if(!he.forceKeepAttr){if(!he.keepAttr){En(_t,T);continue}if(!el&&Jn(E1,Mt)){En(_t,T);continue}if(qt&&(Mt=jl(Mt)),!Wl(He,yt,Mt)){En(_t,T);continue}Mt=Xn(He,yt,zt,Mt),Mt!==xn&&ia(T,_t,zt,Mt)}}Kt(w.afterSanitizeAttributes,T,null)},ts=function(T){let Q=null;const he=mn(T);for(Kt(w.beforeSanitizeShadowDOM,T,null);Q=he.nextNode();)if(Kt(w.uponSanitizeShadowNode,Q,null),Cn(Q,T),gs(Q),ll(Q.content)&&ts(Q.content),(H?H(Q):Q.nodeType)===Zl.element){const He=Z(Q);ll(He)&&(Al(He),ts(He))}Kt(w.afterSanitizeShadowDOM,T,null)},Al=function(T){const Q=[{node:T,shadow:null}];for(;Q.length>0;){const he=Q.pop();if(he.shadow){ts(he.shadow);continue}const ye=he.node,we=(H?H(ye):ye.nodeType)===Zl.element,_t=A(ye);if(_t)for(let zt=_t.length-1;zt>=0;--zt)Q.push({node:_t[zt],shadow:null});if(we){const zt=$?$(ye):null;if(typeof zt=="string"&&Ze(zt)==="template"){const tn=ye.content;ll(tn)&&Q.push({node:tn,shadow:null})}}if(we){const zt=Z(ye);ll(zt)&&Q.push({node:null,shadow:zt},{node:zt,shadow:null})}}};return s.sanitize=function(pe){let T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Q=null,he=null,ye=null,He=null;if(Tn=!pe,Tn&&(pe="<!-->"),typeof pe!="string"&&!jn(pe)&&(pe=p1(pe),typeof pe!="string"))throw dr("dirty is not a string, aborting");if(!s.isSupported)return pe;Yn?(Ve=Ct,ut=nt):Pt(T),(w.uponSanitizeElement.length>0||w.uponSanitizeAttribute.length>0)&&(Ve=Tl(Ve)),w.uponSanitizeAttribute.length>0&&(ut=Tl(ut)),s.removed=[];const we=tl&&typeof pe!="string"&&jn(pe);if(we){hl(pe);const yt=$?$(pe):pe.nodeName;if(typeof yt=="string"){const xn=Ze(yt);if(!Ve[xn]||cn[xn])throw it(pe),dr("root node is forbidden and cannot be sanitized in-place")}if(El(pe))throw it(pe),dr("root node is clobbered and cannot be sanitized in-place");try{Al(pe)}catch(xn){throw it(pe),xn}}else if(jn(pe))Q=Ln("<!---->"),he=Q.ownerDocument.importNode(pe,!0),he.nodeType===Zl.element&&he.nodeName==="BODY"||he.nodeName==="HTML"?Q=he:Q.appendChild(he),Al(he);else{if(!pn&&!qt&&!Ot&&pe.indexOf("<")===-1)return B&&Zn?ae(pe):pe;if(Q=Ln(pe),!Q)return pn?null:Zn?D:""}Q&&at&&pt(Q.firstChild);const _t=we?pe:Q,zt=mn(_t);try{for(;ye=zt.nextNode();)Cn(ye,_t),gs(ye),ll(ye.content)&&ts(ye.content)}catch(yt){throw we&&(it(pe),vc(s.removed,xn=>{xn.element&&$n(xn.element)})),yt}if(we)return vc(s.removed,yt=>{yt.element&&$n(yt.element)}),qt&&gn(pe),pe;if(pn){if(qt&&gn(Q),yn)for(He=de.call(Q.ownerDocument);Q.firstChild;)He.appendChild(Q.firstChild);else He=Q;return(ut.shadowroot||ut.shadowrootmode)&&(He=Ae.call(c,He,!0)),He}let tn=Ot?Q.outerHTML:Q.innerHTML;return Ot&&Ve["!doctype"]&&Q.ownerDocument&&Q.ownerDocument.doctype&&Q.ownerDocument.doctype.name&&Jn(N1,Q.ownerDocument.doctype.name)&&(tn="<!DOCTYPE "+Q.ownerDocument.doctype.name+`>
|
|
116
|
+
`+tn),qt&&(tn=jl(tn)),B&&Zn?ae(tn):tn},s.setConfig=function(){let pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Pt(pe),Yn=!0,Ct=Ve,nt=ut},s.clearConfig=function(){vn=null,Yn=!1,Ct=null,nt=null,B=R,D=""},s.isValidAttribute=function(pe,T,Q){vn||Pt({});const he=Ze(pe),ye=Ze(T);return Wl(he,ye,Q)},s.addHook=function(pe,T){typeof T=="function"&&Pn(w,pe)&&jc(w[pe],T)},s.removeHook=function(pe,T){if(Pn(w,pe)){if(T!==void 0){const Q=r1(w[pe],T);return Q===-1?void 0:c1(w[pe],Q,1)[0]}return Kx(w[pe])}},s.removeHooks=function(pe){Pn(w,pe)&&(w[pe]=[])},s.removeAllHooks=function(){w=ib()},s}var M1=M_();const R1=1024;let D1=0;class fs{constructor(s,r){this.from=s,this.to=r}}class an{constructor(s={}){this.id=D1++,this.perNode=!!s.perNode,this.deserialize=s.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=s.combine||null}add(s){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof s!="function"&&(s=As.match(s)),r=>{let c=s(r);return c===void 0?null:[this,c]}}}an.closedBy=new an({deserialize:l=>l.split(" ")});an.openedBy=new an({deserialize:l=>l.split(" ")});an.group=new an({deserialize:l=>l.split(" ")});an.isolate=new an({deserialize:l=>{if(l&&l!="rtl"&&l!="ltr"&&l!="auto")throw new RangeError("Invalid value for isolate: "+l);return l||"auto"}});an.contextHash=new an({perNode:!0});an.lookAhead=new an({perNode:!0});an.mounted=new an({perNode:!0});class Ac{constructor(s,r,c,o=!1){this.tree=s,this.overlay=r,this.parser=c,this.bracketed=o}static get(s){return s&&s.props&&s.props[an.mounted.id]}}const O1=Object.create(null);class As{constructor(s,r,c,o=0){this.name=s,this.props=r,this.id=c,this.flags=o}static define(s){let r=s.props&&s.props.length?Object.create(null):O1,c=(s.top?1:0)|(s.skipped?2:0)|(s.error?4:0)|(s.name==null?8:0),o=new As(s.name||"",r,s.id,c);if(s.props){for(let d of s.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(s){return this.props[s.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(s){if(typeof s=="string"){if(this.name==s)return!0;let r=this.prop(an.group);return r?r.indexOf(s)>-1:!1}return this.id==s}static match(s){let r=Object.create(null);for(let c in s)for(let o of c.split(" "))r[o]=s[c];return c=>{for(let o=c.prop(an.group),d=-1;d<(o?o.length:0);d++){let h=r[d<0?c.name:o[d]];if(h)return h}}}}As.none=new As("",Object.create(null),0,8);class R_{constructor(s){this.types=s;for(let r=0;r<s.length;r++)if(s[r].id!=r)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...s){let r=[];for(let c of this.types){let o=null;for(let d of s){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 As(c.name,o,c.id,c.flags):c)}return new R_(r)}}const bf=new WeakMap,rb=new WeakMap;var ln;(function(l){l[l.ExcludeBuffers=1]="ExcludeBuffers",l[l.IncludeAnonymous=2]="IncludeAnonymous",l[l.IgnoreMounts=4]="IgnoreMounts",l[l.IgnoreOverlays=8]="IgnoreOverlays",l[l.EnterBracketed=16]="EnterBracketed"})(ln||(ln={}));class ql{constructor(s,r,c,o,d){if(this.type=s,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 s=Ac.get(this);if(s&&!s.overlay)return s.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(s=0){return new Yf(this.topNode,s)}cursorAt(s,r=0,c=0){let o=bf.get(this)||this.topNode,d=new Yf(o);return d.moveTo(s,r),bf.set(this,d._tree),d}get topNode(){return new _l(this,0,0,null)}resolve(s,r=0){let c=su(bf.get(this)||this.topNode,s,r,!1);return bf.set(this,c),c}resolveInner(s,r=0){let c=su(rb.get(this)||this.topNode,s,r,!0);return rb.set(this,c),c}resolveStack(s,r=0){return U1(this,s,r)}iterate(s){let{enter:r,leave:c,from:o=0,to:d=this.length}=s,h=s.mode||0,m=(h&ln.IncludeAnonymous)>0;for(let g=this.cursor(h|ln.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(s){return s.perNode?this.props?this.props[s.id]:void 0:this.type.prop(s)}get propValues(){let s=[];if(this.props)for(let r in this.props)s.push([+r,this.props[r]]);return s}balance(s={}){return this.children.length<=8?this:Dp(As.none,this.children,this.positions,0,this.children.length,0,this.length,(r,c,o)=>new ql(this.type,r,c,o,this.propValues),s.makeTree||((r,c,o)=>new ql(As.none,r,c,o)))}static build(s){return H1(s)}}ql.empty=new ql(As.none,[],[],0);class Mp{constructor(s,r){this.buffer=s,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 Mp(this.buffer,this.index)}}class qi{constructor(s,r,c){this.buffer=s,this.length=r,this.set=c}get type(){return As.none}toString(){let s=[];for(let r=0;r<this.buffer.length;)s.push(this.childString(r)),r=this.buffer[r+3];return s.join(",")}childString(s){let r=this.buffer[s],c=this.buffer[s+3],o=this.set.types[r],d=o.name;if(/\W/.test(d)&&!o.isError&&(d=JSON.stringify(d)),s+=4,c==s)return d;let h=[];for(;s<c;)h.push(this.childString(s)),s=this.buffer[s+3];return d+"("+h.join(",")+")"}findChild(s,r,c,o,d){let{buffer:h}=this,m=-1;for(let g=s;g!=r&&!(D_(d,o,h[g+1],h[g+2])&&(m=g,c>0));g=h[g+3]);return m}slice(s,r,c){let o=this.buffer,d=new Uint16Array(r-s),h=0;for(let m=s,g=0;m<r;){d[g++]=o[m++],d[g++]=o[m++]-c;let x=d[g++]=o[m++]-c;d[g++]=o[m++]-s,h=Math.max(h,x)}return new qi(d,h,this.set)}}function D_(l,s,r,c){switch(l){case-2:return r<s;case-1:return c>=s&&r<s;case 0:return r<s&&c>s;case 1:return r<=s&&c>s;case 2:return c>s;case 4:return!0}}function su(l,s,r,c){for(var o;l.from==l.to||(r<1?l.from>=s:l.from>s)||(r>-1?l.to<=s:l.to<s);){let h=!c&&l instanceof _l&&l.index<0?null:l.parent;if(!h)return l;l=h}let d=c?0:ln.IgnoreOverlays;if(c)for(let h=l,m=h.parent;m;h=m,m=h.parent)h instanceof _l&&h.index<0&&((o=m.enter(s,r,d))===null||o===void 0?void 0:o.from)!=h.from&&(l=m);for(;;){let h=l.enter(s,r,d);if(!h)return l;l=h}}class O_{cursor(s=0){return new Yf(this,s)}getChild(s,r=null,c=null){let o=cb(this,s,r,c);return o.length?o[0]:null}getChildren(s,r=null,c=null){return cb(this,s,r,c)}resolve(s,r=0){return su(this,s,r,!1)}resolveInner(s,r=0){return su(this,s,r,!0)}matchContext(s){return pp(this.parent,s)}enterUnfinishedNodesBefore(s){let r=this.childBefore(s),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 _l extends O_{constructor(s,r,c,o){super(),this._tree=s,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(s,r,c,o,d=0){for(let h=this;;){for(let{children:m,positions:g}=h._tree,x=r>0?m.length:-1;s!=x;s+=r){let y=m[s],j=g[s]+h.from,v;if(!(!(d&ln.EnterBracketed&&y instanceof ql&&(v=Ac.get(y))&&!v.overlay&&v.bracketed&&c>=j&&c<=j+y.length)&&!D_(o,c,j,j+y.length))){if(y instanceof qi){if(d&ln.ExcludeBuffers)continue;let E=y.findChild(0,y.buffer.length,r,c-j,o);if(E>-1)return new la(new L1(h,y,s,j),null,E)}else if(d&ln.IncludeAnonymous||!y.type.isAnonymous||Rp(y)){let E;if(!(d&ln.IgnoreMounts)&&(E=Ac.get(y))&&!E.overlay)return new _l(E.tree,j,s,h);let k=new _l(y,j,s,h);return d&ln.IncludeAnonymous||!k.type.isAnonymous?k:k.nextChild(r<0?y.children.length-1:0,r,c,o,d)}}}if(d&ln.IncludeAnonymous||!h.type.isAnonymous||(h.index>=0?s=h.index+r:s=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(s){return this.nextChild(0,1,s,2)}childBefore(s){return this.nextChild(this._tree.children.length-1,-1,s,-2)}prop(s){return this._tree.prop(s)}enter(s,r,c=0){let o;if(!(c&ln.IgnoreOverlays)&&(o=Ac.get(this._tree))&&o.overlay){let d=s-this.from,h=c&ln.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 _l(o.tree,o.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,s,r,c)}nextSignificantParent(){let s=this;for(;s.type.isAnonymous&&s._parent;)s=s._parent;return s}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function cb(l,s,r,c){let o=l.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(s)&&d.push(o.node),!o.nextSibling())return c==null?d:[]}}function pp(l,s,r=s.length-1){for(let c=l;r>=0;c=c.parent){if(!c)return!1;if(!c.type.isAnonymous){if(s[r]&&s[r]!=c.name)return!1;r--}}return!0}class L1{constructor(s,r,c,o){this.parent=s,this.buffer=r,this.index=c,this.start=o}}class la extends O_{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(s,r,c){super(),this.context=s,this._parent=r,this.index=c,this.type=s.buffer.set.types[s.buffer.buffer[c]]}child(s,r,c){let{buffer:o}=this.context,d=o.findChild(this.index+4,o.buffer[this.index+3],s,r-this.context.start,c);return d<0?null:new la(this.context,this,d)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(s){return this.child(1,s,2)}childBefore(s){return this.child(-1,s,-2)}prop(s){return this.type.prop(s)}enter(s,r,c=0){if(c&ln.ExcludeBuffers)return null;let{buffer:o}=this.context,d=o.findChild(this.index+4,o.buffer[this.index+3],r>0?1:-1,s-this.context.start,r);return d<0?null:new la(this.context,this,d)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(s){return this._parent?null:this.context.parent.nextChild(this.context.index+s,s,0,4)}get nextSibling(){let{buffer:s}=this.context,r=s.buffer[this.index+3];return r<(this._parent?s.buffer[this._parent.index+3]:s.buffer.length)?new la(this.context,this._parent,r):this.externalSibling(1)}get prevSibling(){let{buffer:s}=this.context,r=this._parent?this._parent.index+4:0;return this.index==r?this.externalSibling(-1):new la(this.context,this._parent,s.findChild(r,this.index,-1,0,4))}get tree(){return null}toTree(){let s=[],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];s.push(c.slice(o,d,h)),r.push(0)}return new ql(this.type,s,r,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function L_(l){if(!l.length)return null;let s=0,r=l[0];for(let d=1;d<l.length;d++){let h=l[d];(h.from>r.from||h.to<r.to)&&(r=h,s=d)}let c=r instanceof _l&&r.index<0?null:r.parent,o=l.slice();return c?o[s]=c:o.splice(s,1),new z1(o,r)}class z1{constructor(s,r){this.heads=s,this.node=r}get next(){return L_(this.heads)}}function U1(l,s,r){let c=l.resolveInner(s,r),o=null;for(let d=c instanceof _l?c:c.context.parent;d;d=d.parent)if(d.index<0){let h=d.parent;(o||(o=[c])).push(h.resolve(s,r)),d=h}else{let h=Ac.get(d.tree);if(h&&h.overlay&&h.overlay[0].from<=s&&h.overlay[h.overlay.length-1].to>=s){let m=new _l(h.tree,h.overlay[0].from+d.from,-1,d);(o||(o=[c])).push(su(m,s,r,!1))}}return o?L_(o):c}class Yf{get name(){return this.type.name}constructor(s,r=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=r&~ln.EnterBracketed,s instanceof _l)this.yieldNode(s);else{this._tree=s.context.parent,this.buffer=s.context;for(let c=s._parent;c;c=c._parent)this.stack.unshift(c.index);this.bufferNode=s,this.yieldBuf(s.index)}}yieldNode(s){return s?(this._tree=s,this.type=s.type,this.from=s.from,this.to=s.to,!0):!1}yieldBuf(s,r){this.index=s;let{start:c,buffer:o}=this.buffer;return this.type=r||o.set.types[o.buffer[s]],this.from=c+o.buffer[s+1],this.to=c+o.buffer[s+2],!0}yield(s){return s?s instanceof _l?(this.buffer=null,this.yieldNode(s)):(this.buffer=s.context,this.yieldBuf(s.index,s.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(s,r,c){if(!this.buffer)return this.yield(this._tree.nextChild(s<0?this._tree._tree.children.length-1:0,s,r,c,this.mode));let{buffer:o}=this.buffer,d=o.findChild(this.index+4,o.buffer[this.index+3],s,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(s){return this.enterChild(1,s,2)}childBefore(s){return this.enterChild(-1,s,-2)}enter(s,r,c=this.mode){return this.buffer?c&ln.ExcludeBuffers?!1:this.enterChild(1,s,r):this.yield(this._tree.enter(s,r,c))}parent(){if(!this.buffer)return this.yieldNode(this.mode&ln.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let s=this.mode&ln.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(s)}sibling(s){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+s,s,0,4,this.mode)):!1;let{buffer:r}=this.buffer,c=this.stack.length-1;if(s<0){let o=c<0?0:this.stack[c]+4;if(this.index!=o)return this.yieldBuf(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+s,s,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(s){let r,c,{buffer:o}=this;if(o){if(s>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+s,h=s<0?-1:c._tree.children.length;d!=h;d+=s){let m=c._tree.children[d];if(this.mode&ln.IncludeAnonymous||m instanceof qi||!m.type.isAnonymous||Rp(m))return!1}return!0}move(s,r){if(r&&this.enterChild(s,0,4))return!0;for(;;){if(this.sibling(s))return!0;if(this.atLastNode(s)||!this.parent())return!1}}next(s=!0){return this.move(1,s)}prev(s=!0){return this.move(-1,s)}moveTo(s,r=0){for(;(this.from==this.to||(r<1?this.from>=s:this.from>s)||(r>-1?this.to<=s:this.to<s))&&this.parent(););for(;this.enterChild(1,s,r););return this}get node(){if(!this.buffer)return this._tree;let s=this.bufferNode,r=null,c=0;if(s&&s.context==this.buffer)e:for(let o=this.index,d=this.stack.length;d>=0;){for(let h=s;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 la(this.buffer,r,this.stack[o]);return this.bufferNode=new la(this.buffer,r,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(s,r){for(let c=0;;){let o=!1;if(this.type.isAnonymous||s(this)!==!1){if(this.firstChild()){c++;continue}this.type.isAnonymous||(o=!0)}for(;;){if(o&&r&&r(this),o=this.type.isAnonymous,!c)return;if(this.nextSibling())break;this.parent(),c--,o=!0}}}matchContext(s){if(!this.buffer)return pp(this.node.parent,s);let{buffer:r}=this.buffer,{types:c}=r.set;for(let o=s.length-1,d=this.stack.length-1;o>=0;d--){if(d<0)return pp(this._tree,s,o);let h=c[r.buffer[this.stack[d]]];if(!h.isAnonymous){if(s[o]&&s[o]!=h.name)return!1;o--}}return!0}}function Rp(l){return l.children.some(s=>s instanceof qi||!s.type.isAnonymous||Rp(s))}function H1(l){var s;let{buffer:r,nodeSet:c,maxBufferLength:o=R1,reused:d=[],minRepeatType:h=c.types.length}=l,m=Array.isArray(r)?new Mp(r,r.length):r,g=c.types,x=0,y=0;function j($,B,D,R,O,ee){let{id:P,start:ae,end:be,size:Ee}=m,je=y,X=x;if(Ee<0)if(m.next(),Ee==-1){let w=d[P];D.push(w),R.push(ae-$);return}else if(Ee==-3){x=P;return}else if(Ee==-4){y=P;return}else throw new RangeError(`Unrecognized record size: ${Ee}`);let ue=g[P],de,_e,Ae=ae-$;if(be-ae<=o&&(_e=A(m.pos-B,O))){let w=new Uint16Array(_e.size-_e.skip),V=m.pos-_e.size,z=w.length;for(;m.pos>V;)z=G(_e.start,w,z);de=new qi(w,be-_e.start,c),Ae=_e.start-$}else{let w=m.pos-Ee;m.next();let V=[],z=[],ge=P>=h?P:-1,ve=0,Re=be;for(;m.pos>w;)ge>=0&&m.id==ge&&m.size>=0?(m.end<=Re-o&&(k(V,z,ae,ve,m.end,Re,ge,je,X),ve=V.length,Re=m.end),m.next()):ee>2500?v(ae,w,V,z):j(ae,w,V,z,ge,ee+1);if(ge>=0&&ve>0&&ve<V.length&&k(V,z,ae,ve,ae,Re,ge,je,X),V.reverse(),z.reverse(),ge>-1&&ve>0){let Oe=E(ue,X);de=Dp(ue,V,z,0,V.length,0,be-ae,Oe,Oe)}else de=C(ue,V,z,be-ae,je-be,X)}D.push(de),R.push(Ae)}function v($,B,D,R){let O=[],ee=0,P=-1;for(;m.pos>B;){let{id:ae,start:be,end:Ee,size:je}=m;if(je>4)m.next();else{if(P>-1&&be<P)break;P<0&&(P=Ee-o),O.push(ae,be,Ee),ee++,m.next()}}if(ee){let ae=new Uint16Array(ee*4),be=O[O.length-2];for(let Ee=O.length-3,je=0;Ee>=0;Ee-=3)ae[je++]=O[Ee],ae[je++]=O[Ee+1]-be,ae[je++]=O[Ee+2]-be,ae[je++]=je;D.push(new qi(ae,O[2]-be,c)),R.push(be-$)}}function E($,B){return(D,R,O)=>{let ee=0,P=D.length-1,ae,be;if(P>=0&&(ae=D[P])instanceof ql){if(!P&&ae.type==$&&ae.length==O)return ae;(be=ae.prop(an.lookAhead))&&(ee=R[P]+ae.length+be)}return C($,D,R,O,ee,B)}}function k($,B,D,R,O,ee,P,ae,be){let Ee=[],je=[];for(;$.length>R;)Ee.push($.pop()),je.push(B.pop()+D-O);$.push(C(c.types[P],Ee,je,ee-O,ae-ee,be)),B.push(O-D)}function C($,B,D,R,O,ee,P){if(ee){let ae=[an.contextHash,ee];P=P?[ae].concat(P):[ae]}if(O>25){let ae=[an.lookAhead,O];P=P?[ae].concat(P):[ae]}return new ql($,B,D,R,P)}function A($,B){let D=m.fork(),R=0,O=0,ee=0,P=D.end-o,ae={size:0,start:0,skip:0};e:for(let be=D.pos-$;D.pos>be;){let Ee=D.size;if(D.id==B&&Ee>=0){ae.size=R,ae.start=O,ae.skip=ee,ee+=4,R+=4,D.next();continue}let je=D.pos-Ee;if(Ee<0||je<be||D.start<P)break;let X=D.id>=h?4:0,ue=D.start;for(D.next();D.pos>je;){if(D.size<0)if(D.size==-3||D.size==-4)X+=4;else break e;else D.id>=h&&(X+=4);D.next()}O=ue,R+=Ee,ee+=X}return(B<0||R==$)&&(ae.size=R,ae.start=O,ae.skip=ee),ae.size>4?ae:void 0}function G($,B,D){let{id:R,start:O,end:ee,size:P}=m;if(m.next(),P>=0&&R<h){let ae=D;if(P>4){let be=m.pos-(P-4);for(;m.pos>be;)D=G($,B,D)}B[--D]=ae,B[--D]=ee-$,B[--D]=O-$,B[--D]=R}else P==-3?x=R:P==-4&&(y=R);return D}let Z=[],Y=[];for(;m.pos>0;)j(l.start||0,l.bufferStart||0,Z,Y,-1,0);let H=(s=l.length)!==null&&s!==void 0?s:Z.length?Y[0]+Z[0].length:0;return new ql(g[l.topID],Z.reverse(),Y.reverse(),H)}const ob=new WeakMap;function Hf(l,s){if(!l.isAnonymous||s instanceof qi||s.type!=l)return 1;let r=ob.get(s);if(r==null){r=1;for(let c of s.children){if(c.type!=l||!(c instanceof ql)){r=1;break}r+=Hf(l,c)}ob.set(s,r)}return r}function Dp(l,s,r,c,o,d,h,m,g){let x=0;for(let k=c;k<o;k++)x+=Hf(l,s[k]);let y=Math.ceil(x*1.5/8),j=[],v=[];function E(k,C,A,G,Z){for(let Y=A;Y<G;){let H=Y,$=C[Y],B=Hf(l,k[Y]);for(Y++;Y<G;Y++){let D=Hf(l,k[Y]);if(B+D>=y)break;B+=D}if(Y==H+1){if(B>y){let D=k[H];E(D.children,D.positions,0,D.children.length,C[H]+Z);continue}j.push(k[H])}else{let D=C[Y-1]+k[Y-1].length-$;j.push(Dp(l,k,C,H,Y,$,D,null,g))}v.push($+Z-d)}}return E(s,r,c,o,0),(m||g)(j,v,h)}class Yk{constructor(){this.map=new WeakMap}setBuffer(s,r,c){let o=this.map.get(s);o||this.map.set(s,o=new Map),o.set(r,c)}getBuffer(s,r){let c=this.map.get(s);return c&&c.get(r)}set(s,r){s instanceof la?this.setBuffer(s.context.buffer,s.index,r):s instanceof _l&&this.map.set(s.tree,r)}get(s){return s instanceof la?this.getBuffer(s.context.buffer,s.index):s instanceof _l?this.map.get(s.tree):void 0}cursorSet(s,r){s.buffer?this.setBuffer(s.buffer.buffer,s.index,r):this.map.set(s.tree,r)}cursorGet(s){return s.buffer?this.getBuffer(s.buffer.buffer,s.index):this.map.get(s.tree)}}class au{constructor(s,r,c,o,d=!1,h=!1){this.from=s,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(s,r=[],c=!1){let o=[new au(0,s.length,s,0,!1,c)];for(let d of r)d.to>s.length&&o.push(d);return o}static applyChanges(s,r,c=128){if(!r.length)return s;let o=[],d=1,h=s.length?s[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 E=Math.max(v.from,g)-x,k=Math.min(v.to,j)-x;v=E>=k?null:new au(E,k,v.tree,v.offset+x,m>0,!!y)}if(v&&o.push(v),h.to>j)break;h=d<s.length?s[d++]:null}if(!y)break;g=y.toA,x=y.toA-y.toB}return o}}class $k{startParse(s,r,c){return typeof s=="string"&&(s=new B1(s)),c=c?c.length?c.map(o=>new fs(o.from,o.to)):[new fs(0,0)]:[new fs(0,s.length)],this.createParse(s,r||[],c)}parse(s,r,c){let o=this.startParse(s,r,c);for(;;){let d=o.advance();if(d)return d}}}class B1{constructor(s){this.string=s}get length(){return this.string.length}chunk(s){return this.string.slice(s)}get lineChunks(){return!1}read(s,r){return this.string.slice(s,r)}}function Xk(l){return(s,r,c,o)=>new q1(s,l,r,c,o)}class ub{constructor(s,r,c,o,d,h){this.parser=s,this.parse=r,this.overlay=c,this.bracketed=o,this.target=d,this.from=h}}function fb(l){if(!l.length||l.some(s=>s.from>=s.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(l))}class I1{constructor(s,r,c,o,d,h,m,g){this.parser=s,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 mp=new an({perNode:!0});class q1{constructor(s,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=s}advance(){if(this.baseParse){let c=this.baseParse.advance();if(!c)return null;if(this.baseParse=null,this.baseTree=c,this.startInner(),this.stoppedAt!=null)for(let o of this.inner)o.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let c=this.baseTree;return this.stoppedAt!=null&&(c=new ql(c.type,c.children,c.positions,c.length,c.propValues.concat([[mp,this.stoppedAt]]))),c}let s=this.inner[this.innerDone],r=s.parse.advance();if(r){this.innerDone++;let c=Object.assign(Object.create(null),s.target.props);c[an.mounted.id]=new Ac(r,s.overlay,s.parser,s.bracketed),s.target.props=c}return null}get parsedPos(){if(this.baseParse)return 0;let s=this.input.length;for(let r=this.innerDone;r<this.inner.length;r++)this.inner[r].from<s&&(s=Math.min(s,this.inner[r].parse.parsedPos));return s}stopAt(s){if(this.stoppedAt=s,this.baseParse)this.baseParse.stopAt(s);else for(let r=this.innerDone;r<this.inner.length;r++)this.inner[r].parse.stopAt(s)}startInner(){let s=new $1(this.fragments),r=null,c=null,o=new Yf(new _l(this.baseTree,this.ranges[0].from,0,null),ln.IncludeAnonymous|ln.IgnoreMounts);e:for(let d,h;;){let m=!0,g;if(this.stoppedAt!=null&&o.from>=this.stoppedAt)m=!1;else if(s.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(E=>E.from<v&&E.to>j)&&r.ranges.push({from:j,to:v})}}m=!1}else if(c&&(h=G1(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||(Y1(o),r&&r.depth++,c&&c.depth++);let x=s.findMounts(o.from,d.parser);if(typeof d.overlay=="function")r=new I1(d.parser,d.overlay,x,this.inner.length,o.from,!!d.bracketed,o.tree,r);else{let y=pb(this.ranges,d.overlay||(o.from<o.to?[new fs(o.from,o.to)]:[]));y.length&&fb(y),(y.length||!d.overlay)&&this.inner.push(new ub(d.parser,y.length?d.parser.startParse(this.input,mb(x,y),y):d.parser.startParse(""),d.overlay?d.overlay.map(j=>new fs(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 fs(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=pb(this.ranges,r.ranges);x.length&&(fb(x),this.inner.splice(r.index,0,new ub(r.parser,r.parser.startParse(this.input,mb(r.mounts,x),x),r.ranges.map(y=>new fs(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 G1(l,s,r){for(let c of l){if(c.from>=r)break;if(c.to>s)return c.from<=s&&c.to>=r?2:1}return 0}function db(l,s,r,c,o,d){if(s<r){let h=l.buffer[s+1];c.push(l.slice(s,r,h)),o.push(h-d)}}function Y1(l){let{node:s}=l,r=[],c=s.context.buffer;do r.push(l.index),l.parent();while(!l.tree);let o=l.tree,d=o.children.indexOf(c),h=o.children[d],m=h.buffer,g=[d];function x(y,j,v,E,k,C){let A=r[C],G=[],Z=[];db(h,y,A,G,Z,E);let Y=m[A+1],H=m[A+2];g.push(G.length);let $=C?x(A+4,m[A+3],h.set.types[m[A]],Y,H-Y,C-1):s.toTree();return G.push($),Z.push(Y-E),db(h,m[A+3],j,G,Z,E),new ql(v,G,Z,k)}o.children[d]=x(0,m.length,As.none,0,h.length,r.length-1);for(let y of g){let j=l.tree.children[y],v=l.tree.positions[y];l.yield(new _l(j,v+l.from,y,l._tree))}}class hb{constructor(s,r){this.offset=r,this.done=!1,this.cursor=s.cursor(ln.IncludeAnonymous|ln.IgnoreMounts)}moveTo(s){let{cursor:r}=this,c=s-this.offset;for(;!this.done&&r.from<c;)if(!(r.to>=s&&r.enter(c,1,ln.IgnoreOverlays|ln.ExcludeBuffers)))if(r.to<=s)r.next(!1)||(this.done=!0);else break}hasNode(s){if(this.moveTo(s.from),!this.done&&this.cursor.from+this.offset==s.from&&this.cursor.tree)for(let r=this.cursor.tree;;){if(r==s.tree)return!0;if(r.children.length&&r.positions[0]==0&&r.children[0]instanceof ql)r=r.children[0];else break}return!1}}class $1{constructor(s){var r;if(this.fragments=s,this.curTo=0,this.fragI=0,s.length){let c=this.curFrag=s[0];this.curTo=(r=c.tree.prop(mp))!==null&&r!==void 0?r:c.to,this.inner=new hb(c.tree,-c.offset)}else this.curFrag=this.inner=null}hasNode(s){for(;this.curFrag&&s.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=s.from&&this.curTo>=s.to&&this.inner.hasNode(s)}nextFrag(){var s;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let r=this.curFrag=this.fragments[this.fragI];this.curTo=(s=r.tree.prop(mp))!==null&&s!==void 0?s:r.to,this.inner=new hb(r.tree,-r.offset)}}findMounts(s,r){var c;let o=[];if(this.inner){this.inner.cursor.moveTo(s,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(an.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 pb(l,s){let r=null,c=s;for(let o=1,d=0;o<l.length;o++){let h=l[o-1].to,m=l[o].from;for(;d<c.length;d++){let g=c[d];if(g.from>=m)break;g.to<=h||(r||(c=r=s.slice()),g.from<h?(r[d]=new fs(g.from,h),g.to>m&&r.splice(d+1,0,new fs(m,g.to))):g.to>m?r[d--]=new fs(m,g.to):r.splice(d--,1))}}return c}function X1(l,s,r,c){let o=0,d=0,h=!1,m=!1,g=-1e9,x=[];for(;;){let y=o==l.length?1e9:h?l[o].to:l[o].from,j=d==s.length?1e9:m?s[d].to:s[d].from;if(h!=m){let v=Math.max(g,r),E=Math.min(y,j,c);v<E&&x.push(new fs(v,E))}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 mb(l,s){let r=[];for(let{pos:c,mount:o,frag:d}of l){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 fs(v.from+c,v.to+c)),j=X1(s,y,g,x);for(let v=0,E=g;;v++){let k=v==j.length,C=k?x:j[v].from;if(C>E&&r.push(new au(E,C,o.tree,-h,d.from>=E||d.openStart,d.to<=C||d.openEnd)),k)break;E=j[v].to}}else r.push(new au(g,x,o.tree,-h,d.from>=h||d.openStart,d.to<=m||d.openEnd))}return r}let V1=0;class us{constructor(s,r,c,o){this.name=s,this.set=r,this.base=c,this.modified=o,this.id=V1++}toString(){let{name:s}=this;for(let r of this.modified)r.name&&(s=`${r.name}(${s})`);return s}static define(s,r){let c=typeof s=="string"?s:"?";if(s instanceof us&&(r=s),r!=null&&r.base)throw new Error("Can not derive from a modified tag");let o=new us(c,[],null,[]);if(o.set.push(o),r)for(let d of r.set)o.set.push(d);return o}static defineModifier(s){let r=new $f(s);return c=>c.modified.indexOf(r)>-1?c:$f.get(c.base||c,c.modified.concat(r).sort((o,d)=>o.id-d.id))}}let Q1=0;class $f{constructor(s){this.name=s,this.instances=[],this.id=Q1++}static get(s,r){if(!r.length)return s;let c=r[0].instances.find(m=>m.base==s&&K1(r,m.modified));if(c)return c;let o=[],d=new us(s.name,o,s,r);for(let m of r)m.instances.push(d);let h=Z1(r);for(let m of s.set)if(!m.modified.length)for(let g of h)o.push($f.get(m,g));return d}}function K1(l,s){return l.length==s.length&&l.every((r,c)=>r==s[c])}function Z1(l){let s=[[]];for(let r=0;r<l.length;r++)for(let c=0,o=s.length;c<o;c++)s.push(s[c].concat(l[r]));return s.sort((r,c)=>c.length-r.length)}function Vk(l){let s=Object.create(null);for(let r in l){let c=l[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 E=o[j++];if(j==o.length&&E=="!"){h=0;break}if(E!="/")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 iu(c,h,g>0?d.slice(0,g):null);s[x]=y.sort(s[x])}}return z_.add(s)}const z_=new an({combine(l,s){let r,c,o;for(;l||s;){if(!l||s&&l.depth>=s.depth?(o=s,s=s.next):(o=l,l=l.next),r&&r.mode==o.mode&&!o.context&&!r.context)continue;let d=new iu(o.tags,o.mode,o.context);r?r.next=d:c=d,r=d}return c}});class iu{constructor(s,r,c,o){this.tags=s,this.mode=r,this.context=c,this.next=o}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(s){return!s||s.depth<this.depth?(this.next=s,this):(s.next=this.sort(s.next),s)}get depth(){return this.context?this.context.length:0}}iu.empty=new iu([],2,null);function U_(l,s){let r=Object.create(null);for(let d of l)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}=s||{};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 F1(l,s){let r=null;for(let c of l){let o=c.style(s);o&&(r=r?r+" "+o:o)}return r}function J1(l,s,r,c=0,o=l.length){let d=new W1(c,Array.isArray(s)?s:[s],r);d.highlightRange(l.cursor(),c,o,"",d.highlighters),d.flush(o)}function P1(l,s,r,c,o,d=0,h=l.length){let m=d;function g(x,y){if(!(x<=m)){for(let j=l.slice(m,x),v=0;;){let E=j.indexOf(`
|
|
117
|
+
`,v),k=E<0?j.length:E;if(k>v&&c(j.slice(v,k),y),E<0)break;o(),v=E+1}m=x}}J1(s,r,(x,y,j)=>{g(x,""),g(y,j)},d,h),g(h,"")}class W1{constructor(s,r,c){this.at=s,this.highlighters=r,this.span=c,this.class=""}startSpan(s,r){r!=this.class&&(this.flush(s),s>this.at&&(this.at=s),this.class=r)}flush(s){s>this.at&&this.class&&this.span(this.at,s,this.class)}highlightRange(s,r,c,o,d){let{type:h,from:m,to:g}=s;if(m>=c||g<=r)return;h.isTop&&(d=this.highlighters.filter(E=>!E.scope||E.scope(h)));let x=o,y=ej(s)||iu.empty,j=F1(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=s.tree&&s.tree.prop(an.mounted);if(v&&v.overlay){let E=s.node.enter(v.overlay[0].from+m,1),k=this.highlighters.filter(A=>!A.scope||A.scope(v.tree.type)),C=s.firstChild();for(let A=0,G=m;;A++){let Z=A<v.overlay.length?v.overlay[A]:null,Y=Z?Z.from+m:g,H=Math.max(r,G),$=Math.min(c,Y);if(H<$&&C)for(;s.from<$&&(this.highlightRange(s,H,$,o,d),this.startSpan(Math.min($,s.to),x),!(s.to>=Y||!s.nextSibling())););if(!Z||Y>c)break;G=Z.to+m,G>r&&(this.highlightRange(E.cursor(),Math.max(r,Z.from+m),Math.min(c,G),"",k),this.startSpan(Math.min(c,G),x))}C&&s.parent()}else if(s.firstChild()){v&&(o="");do if(!(s.to<=r)){if(s.from>=c)break;this.highlightRange(s,r,c,o,d),this.startSpan(Math.min(c,s.to),x)}while(s.nextSibling());s.parent()}}}function ej(l){let s=l.type.prop(z_);for(;s&&s.context&&!l.matchContext(s.context);)s=s.next;return s||null}const Se=us.define,_f=Se(),Li=Se(),gb=Se(Li),xb=Se(Li),zi=Se(),yf=Se(zi),Kh=Se(zi),Ws=Se(),hr=Se(Ws),Ks=Se(),Zs=Se(),gp=Se(),Zo=Se(gp),vf=Se(),ke={comment:_f,lineComment:Se(_f),blockComment:Se(_f),docComment:Se(_f),name:Li,variableName:Se(Li),typeName:gb,tagName:Se(gb),propertyName:xb,attributeName:Se(xb),className:Se(Li),labelName:Se(Li),namespace:Se(Li),macroName:Se(Li),literal:zi,string:yf,docString:Se(yf),character:Se(yf),attributeValue:Se(yf),number:Kh,integer:Se(Kh),float:Se(Kh),bool:Se(zi),regexp:Se(zi),escape:Se(zi),color:Se(zi),url:Se(zi),keyword:Ks,self:Se(Ks),null:Se(Ks),atom:Se(Ks),unit:Se(Ks),modifier:Se(Ks),operatorKeyword:Se(Ks),controlKeyword:Se(Ks),definitionKeyword:Se(Ks),moduleKeyword:Se(Ks),operator:Zs,derefOperator:Se(Zs),arithmeticOperator:Se(Zs),logicOperator:Se(Zs),bitwiseOperator:Se(Zs),compareOperator:Se(Zs),updateOperator:Se(Zs),definitionOperator:Se(Zs),typeOperator:Se(Zs),controlOperator:Se(Zs),punctuation:gp,separator:Se(gp),bracket:Zo,angleBracket:Se(Zo),squareBracket:Se(Zo),paren:Se(Zo),brace:Se(Zo),content:Ws,heading:hr,heading1:Se(hr),heading2:Se(hr),heading3:Se(hr),heading4:Se(hr),heading5:Se(hr),heading6:Se(hr),contentSeparator:Se(Ws),list:Se(Ws),quote:Se(Ws),emphasis:Se(Ws),strong:Se(Ws),link:Se(Ws),monospace:Se(Ws),strikethrough:Se(Ws),inserted:Se(),deleted:Se(),changed:Se(),invalid:Se(),meta:vf,documentMeta:Se(vf),annotation:Se(vf),processingInstruction:Se(vf),definition:us.defineModifier("definition"),constant:us.defineModifier("constant"),function:us.defineModifier("function"),standard:us.defineModifier("standard"),local:us.defineModifier("local"),special:us.defineModifier("special")};for(let l in ke){let s=ke[l];s instanceof us&&(s.name=l)}U_([{tag:ke.link,class:"tok-link"},{tag:ke.heading,class:"tok-heading"},{tag:ke.emphasis,class:"tok-emphasis"},{tag:ke.strong,class:"tok-strong"},{tag:ke.keyword,class:"tok-keyword"},{tag:ke.atom,class:"tok-atom"},{tag:ke.bool,class:"tok-bool"},{tag:ke.url,class:"tok-url"},{tag:ke.labelName,class:"tok-labelName"},{tag:ke.inserted,class:"tok-inserted"},{tag:ke.deleted,class:"tok-deleted"},{tag:ke.literal,class:"tok-literal"},{tag:ke.string,class:"tok-string"},{tag:ke.number,class:"tok-number"},{tag:[ke.regexp,ke.escape,ke.special(ke.string)],class:"tok-string2"},{tag:ke.variableName,class:"tok-variableName"},{tag:ke.local(ke.variableName),class:"tok-variableName tok-local"},{tag:ke.definition(ke.variableName),class:"tok-variableName tok-definition"},{tag:ke.special(ke.variableName),class:"tok-variableName2"},{tag:ke.definition(ke.propertyName),class:"tok-propertyName tok-definition"},{tag:ke.typeName,class:"tok-typeName"},{tag:ke.namespace,class:"tok-namespace"},{tag:ke.className,class:"tok-className"},{tag:ke.macroName,class:"tok-macroName"},{tag:ke.propertyName,class:"tok-propertyName"},{tag:ke.operator,class:"tok-operator"},{tag:ke.comment,class:"tok-comment"},{tag:ke.meta,class:"tok-meta"},{tag:ke.invalid,class:"tok-invalid"},{tag:ke.punctuation,class:"tok-punctuation"}]);const tj="modulepreload",nj=function(l,s){return new URL(l,s).href},bb={},Pe=function(s,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=nj(y,c),y in bb)return;bb[y]=!0;const j=y.endsWith(".css"),v=j?'[rel="stylesheet"]':"";if(!!c)for(let C=m.length-1;C>=0;C--){const A=m[C];if(A.href===y&&(!j||A.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${y}"]${v}`))return;const k=document.createElement("link");if(k.rel=j?"stylesheet":tj,j||(k.as="script"),k.crossOrigin="",k.href=y,x&&k.setAttribute("nonce",x),document.head.appendChild(k),j)return new Promise((C,A)=>{k.addEventListener("load",C),k.addEventListener("error",()=>A(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 s().catch(d)})},H_={js:async()=>(await Pe(async()=>{const{javascript:l}=await import("./index-CZuUjzhP.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({jsx:!0}),cjs:async()=>(await Pe(async()=>{const{javascript:l}=await import("./index-CZuUjzhP.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript(),mjs:async()=>(await Pe(async()=>{const{javascript:l}=await import("./index-CZuUjzhP.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript(),jsx:async()=>(await Pe(async()=>{const{javascript:l}=await import("./index-CZuUjzhP.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({jsx:!0}),ts:async()=>(await Pe(async()=>{const{javascript:l}=await import("./index-CZuUjzhP.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),mts:async()=>(await Pe(async()=>{const{javascript:l}=await import("./index-CZuUjzhP.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),cts:async()=>(await Pe(async()=>{const{javascript:l}=await import("./index-CZuUjzhP.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),tsx:async()=>(await Pe(async()=>{const{javascript:l}=await import("./index-CZuUjzhP.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0,jsx:!0}),json:async()=>(await Pe(async()=>{const{json:l}=await import("./index-UxKgaDrj.js");return{json:l}},__vite__mapDeps([6,1,2,3,4]),import.meta.url)).json(),jsonc:async()=>(await Pe(async()=>{const{json:l}=await import("./index-UxKgaDrj.js");return{json:l}},__vite__mapDeps([6,1,2,3,4]),import.meta.url)).json(),css:async()=>(await Pe(async()=>{const{css:l}=await import("./index-DXHZO0ym.js");return{css:l}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),scss:async()=>(await Pe(async()=>{const{css:l}=await import("./index-DXHZO0ym.js");return{css:l}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),less:async()=>(await Pe(async()=>{const{css:l}=await import("./index-DXHZO0ym.js");return{css:l}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),html:async()=>(await Pe(async()=>{const{html:l}=await import("./index-DPrfFlZq.js");return{html:l}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),htm:async()=>(await Pe(async()=>{const{html:l}=await import("./index-DPrfFlZq.js");return{html:l}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),vue:async()=>(await Pe(async()=>{const{html:l}=await import("./index-DPrfFlZq.js");return{html:l}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),svelte:async()=>(await Pe(async()=>{const{html:l}=await import("./index-DPrfFlZq.js");return{html:l}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),md:async()=>(await Pe(async()=>{const{markdown:l}=await import("./index-B2BGvdag.js");return{markdown:l}},__vite__mapDeps([9,3,4,2,5,8,1,7,0]),import.meta.url)).markdown(),markdown:async()=>(await Pe(async()=>{const{markdown:l}=await import("./index-B2BGvdag.js");return{markdown:l}},__vite__mapDeps([9,3,4,2,5,8,1,7,0]),import.meta.url)).markdown(),py:async()=>(await Pe(async()=>{const{python:l}=await import("./index-Si6no75_.js");return{python:l}},__vite__mapDeps([10,1,2,3,4,5]),import.meta.url)).python(),pyi:async()=>(await Pe(async()=>{const{python:l}=await import("./index-Si6no75_.js");return{python:l}},__vite__mapDeps([10,1,2,3,4,5]),import.meta.url)).python(),yaml:async()=>(await Pe(async()=>{const{yaml:l}=await import("./index-BrkwvvWk.js");return{yaml:l}},__vite__mapDeps([11,1,2,3,4]),import.meta.url)).yaml(),yml:async()=>(await Pe(async()=>{const{yaml:l}=await import("./index-BrkwvvWk.js");return{yaml:l}},__vite__mapDeps([11,1,2,3,4]),import.meta.url)).yaml(),rs:async()=>(await Pe(async()=>{const{rust:l}=await import("./index-ChyP1fTD.js");return{rust:l}},__vite__mapDeps([12,1,2,3,4]),import.meta.url)).rust(),c:async()=>(await Pe(async()=>{const{cpp:l}=await import("./index-CRsndRFc.js");return{cpp:l}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),h:async()=>(await Pe(async()=>{const{cpp:l}=await import("./index-CRsndRFc.js");return{cpp:l}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),cc:async()=>(await Pe(async()=>{const{cpp:l}=await import("./index-CRsndRFc.js");return{cpp:l}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),cpp:async()=>(await Pe(async()=>{const{cpp:l}=await import("./index-CRsndRFc.js");return{cpp:l}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),hpp:async()=>(await Pe(async()=>{const{cpp:l}=await import("./index-CRsndRFc.js");return{cpp:l}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),java:async()=>(await Pe(async()=>{const{java:l}=await import("./index-D83he8x-.js");return{java:l}},__vite__mapDeps([14,1,2,3,4]),import.meta.url)).java(),go:async()=>(await Pe(async()=>{const{go:l}=await import("./index-C59b0_Vk.js");return{go:l}},__vite__mapDeps([15,1,2,3,4,5]),import.meta.url)).go(),php:async()=>(await Pe(async()=>{const{php:l}=await import("./index-CWTFMuFd.js");return{php:l}},__vite__mapDeps([16,1,8,7,2,3,4,0,5]),import.meta.url)).php(),sql:async()=>(await Pe(async()=>{const{sql:l}=await import("./index-BroMLvyS.js");return{sql:l}},__vite__mapDeps([17,2,3,4,1,5]),import.meta.url)).sql(),xml:async()=>(await Pe(async()=>{const{xml:l}=await import("./index-YCUybqa_.js");return{xml:l}},__vite__mapDeps([18,1,2,3,4]),import.meta.url)).xml(),svg:async()=>(await Pe(async()=>{const{xml:l}=await import("./index-YCUybqa_.js");return{xml:l}},__vite__mapDeps([18,1,2,3,4]),import.meta.url)).xml()},lj={".mcp.json":"json",dockerfile:"yaml",makefile:"yaml"},sj={javascript:"js",node:"js",typescript:"ts",python:"py",python3:"py",yml:"yaml",rust:"rs",golang:"go","c++":"cpp",cplusplus:"cpp"};async function aj(l){const s=sj[l.toLowerCase()]??l.toLowerCase(),r=H_[s];return r?r().catch(()=>null):null}async function ij(l){const s=(l.split("/").pop()??"").toLowerCase(),r=lj[s]??s.split(".").pop()??"",c=H_[r];return c?c().catch(()=>null):null}const rj=U_([{tag:[ke.keyword,ke.modifier,ke.controlKeyword,ke.moduleKeyword],class:"cmh-key"},{tag:[ke.propertyName],class:"cmh-prop"},{tag:[ke.function(ke.variableName),ke.labelName],class:"cmh-fn"},{tag:[ke.color,ke.constant(ke.name),ke.standard(ke.name),ke.bool],class:"cmh-const"},{tag:[ke.typeName,ke.className,ke.changed,ke.annotation,ke.self,ke.namespace],class:"cmh-type"},{tag:[ke.number,ke.integer,ke.float],class:"cmh-num"},{tag:[ke.string,ke.special(ke.string),ke.regexp],class:"cmh-str"},{tag:[ke.operator,ke.operatorKeyword,ke.escape],class:"cmh-op"},{tag:[ke.meta,ke.comment],class:"cmh-comment"},{tag:ke.invalid,class:"cmh-invalid"}]);function jf(l){return l.replace(/[&<>]/g,s=>s==="&"?"&":s==="<"?"<":">")}async function cj(l,s){const r=s?await aj(s):null;if(!r)return jf(l);try{const c=r.language.parser.parse(l);let o="";return P1(l,c,rj,(d,h)=>{o+=h?`<span class="${h}">${jf(d)}</span>`:jf(d)},()=>{o+=`
|
|
118
|
+
`}),o}catch{return jf(l)}}Dt.setOptions({gfm:!0,breaks:!1});function B_(l){var r;const s=(r=l.split(".").pop())==null?void 0:r.toLowerCase();return s==="md"||s==="markdown"}async function Wf(l){const s=await Dt.parse(l,{async:!0,walkTokens:async r=>{if(r.type!=="code")return;const c=r;c.text=await cj(c.text,c.lang??""),c.escaped=!0}});return M1.sanitize(s)}function _b(l,s){return{path:l.path,text:l.content,saved:l.content,eol:l.eol,encoding:l.encoding,mtime:l.mtime,size:l.size,binary:l.binary,tooLarge:l.tooLarge,mediaMime:l.mediaMime,mediaTooLarge:l.mediaTooLarge,stale:!1,revision:s,previewMode:B_(l.path)}}function Xa(l){return!l.binary&&!l.tooLarge&&l.text!==l.saved}function oj(l){return l.split("/").pop()??l}function wr(l){const s=l.lastIndexOf("/");return s===-1?"":l.slice(0,s)}function Bf(l){return l<1024?`${l} Б`:l<1024*1024?`${(l/1024).toFixed(1)} КБ`:`${(l/1024/1024).toFixed(1)} МБ`}function Hi({x:l,y:s,items:r,note:c,onClose:o}){const d=_.useRef(null),[h,m]=_.useState({left:l,top:s}),[g,x]=_.useState(()=>{const v=r.findIndex(E=>!E.disabled);return v===-1?0:v});_.useLayoutEffect(()=>{const v=d.current;if(!v)return;const E=v.getBoundingClientRect(),k=8,C=Math.max(k,Math.min(l,window.innerWidth-E.width-k)),A=Math.max(k,Math.min(s,window.innerHeight-E.height-k));m({left:C,top:A})},[l,s]),_.useLayoutEffect(()=>{var v;(v=d.current)==null||v.focus()},[]),_.useLayoutEffect(()=>{function v(k){var C;(C=d.current)!=null&&C.contains(k.target)||o()}function E(){o()}return document.addEventListener("mousedown",v),document.addEventListener("scroll",E,!0),()=>{document.removeEventListener("mousedown",v),document.removeEventListener("scroll",E,!0)}},[o]);function y(v){v.disabled||(v.onSelect(),o())}function j(v){if(v.key==="Escape"){v.preventDefault(),v.stopPropagation(),o();return}const E=r.map((k,C)=>({item:k,index:C})).filter(k=>!k.item.disabled);if(E.length!==0){if(v.key==="ArrowDown"||v.key==="ArrowUp"){v.preventDefault();const k=v.key==="ArrowDown"?1:-1,C=E.findIndex(G=>G.index===g),A=E[(((C===-1?0:C)+k)%E.length+E.length)%E.length];A&&x(A.index);return}if(v.key==="Enter"||v.key===" "){v.preventDefault();const k=r[g];k&&y(k)}}}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,E)=>a.jsxs("button",{type:"button",role:"menuitem","aria-disabled":v.disabled,className:"ctxmenu__item"+(E===g?" is-cursor":""),onMouseEnter:()=>x(E),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 uj=3500,fj=9e3,yb=220;function Tr({result:l,onDismiss:s}){const[r,c]=_.useState(l),[o,d]=_.useState(!1);if(_.useEffect(()=>{if(!l){c(null),d(!1);return}if(c(l),d(!1),l.url)return;const m=l.ok?uj:fj,g=setTimeout(()=>d(!0),m),x=setTimeout(()=>c(null),m+yb);return()=>{clearTimeout(g),clearTimeout(x)}},[l]),!r)return null;const h=()=>{d(!0),setTimeout(()=>{c(null),s==null||s()},yb)};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&&s&&a.jsx("button",{type:"button",className:"oplog__dismiss",title:"Закрыть","aria-label":"Закрыть сообщение",onClick:h,children:"✕"})]})}function na({value:l,className:s,placeholder:r="Название сессии",onCommit:c,onCancel:o}){const[d,h]=_.useState(l),m=_.useRef(null);_.useEffect(()=>{var x;(x=m.current)==null||x.select()},[]);function g(){const x=d.trim();if(!x||x===l)return o();c(x)}return a.jsx("input",{ref:m,className:s?`rename ${s}`:"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 Yc({active:l}){return l?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 dj=500,pr="application/x-ccv-fs-path",hj=200;function pj({open:l,tree:s,expanded:r,activePath:c,dirty:o,gitChanges:d,result:h,searchResult:m,onSearch:g,onReveal:x,onToggle:y,onOpen:j,onCreate:v,onRename:E,onMove:k,onCopy:C,onDelete:A,onRefresh:G,onClose:Z,zoomed:Y,onToggleZoom:H}){const[$,B]=_.useState(""),[D,R]=_.useState(null),[O,ee]=_.useState(null),[P,ae]=_.useState(null),[be,Ee]=_.useState(null),[je,X]=_.useState(null),[ue,de]=_.useState(null),_e=Ff("(hover: hover)"),Ae=_.useRef(null),w=_.useMemo(()=>xj(d),[d]);function V(le){return!(!P||le===P.path||P.kind==="dir"&&le.startsWith(`${P.path}/`)||le===wr(P.path))}function z(le){return!(!je||le===je.path||je.kind==="dir"&&le.startsWith(`${je.path}/`)||je.mode==="cut"&&le===wr(je.path))}function ge(le){X({path:le.path,kind:le.kind,mode:"copy"})}function ve(le){X({path:le.path,kind:le.kind,mode:"cut"})}function Re(le){!je||!z(le)||(le&&!r.has(le)&&y(le),je.mode==="cut"?(k(je.path,le),X(null)):C(je.path,le))}function Oe(le,me){const Be=le.touches[0];if(!Be)return;const Fe={timer:0,x:Be.clientX,y:Be.clientY,el:le.currentTarget,fired:!1};Fe.timer=window.setTimeout(()=>{Fe.fired=!0,me(Fe.x,Fe.y,Fe.el)},dj),Ae.current=Fe}function Ue(le){const me=Ae.current,Be=le.touches[0];!me||!Be||Math.hypot(Be.clientX-me.x,Be.clientY-me.y)>10&&(window.clearTimeout(me.timer),Ae.current=null)}function qe(le){const me=Ae.current;me&&(window.clearTimeout(me.timer),me.fired&&le.preventDefault())}function rn(){var le;return(le=Ae.current)!=null&&le.fired?(Ae.current=null,!0):!1}function Ve(le,me,Be,Fe){B((Fe==null?void 0:Fe.path)??""),de({x:le,y:me,opener:Be,entry:Fe})}function Ft(){const le=ue==null?void 0:ue.opener;de(null),le!=null&&le.isConnected&&le.focus()}function ut(le){return{onContextMenu:me=>{me.preventDefault(),Ve(me.clientX,me.clientY,me.currentTarget,le)},onTouchStart:me=>Oe(me,(Be,Fe,Ie)=>Ve(Be,Fe,Ie,le)),onTouchMove:Ue,onTouchEnd:qe,onTouchCancel:qe}}function ht(le){le.target===le.currentTarget&&(le.preventDefault(),Ve(le.clientX,le.clientY,le.currentTarget,null))}function Ge(le){le.target===le.currentTarget&&Oe(le,(me,Be,Fe)=>Ve(me,Be,Fe,null))}function cn(le){if(!(le.ctrlKey||le.metaKey)||le.target instanceof HTMLInputElement)return;const me=le.key.toLowerCase();if(me==="v"){le.preventDefault(),Re(Zn());return}if(!$)return;const Be=vb(s,$);Be&&(me==="c"?(le.preventDefault(),ge(Be)):me==="x"&&(le.preventDefault(),ve(Be)))}function Nn(le){return me=>{me.dataTransfer.effectAllowed="move",me.dataTransfer.setData(pr,le.path),ae({path:le.path,kind:le.kind})}}function st(){ae(null),Ee(null)}function kn(le){return me=>{me.dataTransfer.types.includes(pr)&&(me.stopPropagation(),!(le.kind!=="dir"||!V(le.path))&&(me.preventDefault(),Ee(le.path)))}}function Wn(le){return me=>{if(!me.dataTransfer.types.includes(pr)||(me.stopPropagation(),le.kind!=="dir"||!V(le.path)))return;me.preventDefault();const Be=me.dataTransfer.getData(pr);Ee(null),Be&&k(Be,le.path)}}function on(le){!le.dataTransfer.types.includes(pr)||!V("")||(le.preventDefault(),Ee(""))}function el(le){if(!le.dataTransfer.types.includes(pr)||!V(""))return;le.preventDefault();const me=le.dataTransfer.getData(pr);Ee(null),me&&k(me,"")}const[qt,tt]=_.useState(""),Ot=qt.trim(),Yn=Ot.length>0,Ct=_.useRef(null),nt=_.useRef(g);nt.current=g;function at(le){tt(le),Ct.current&&clearTimeout(Ct.current);const me=le.trim();if(!me){nt.current("");return}Ct.current=setTimeout(()=>nt.current(me),hj)}function pn(le){Ct.current&&clearTimeout(Ct.current),tt(""),nt.current(""),B(le.path),x(le)}const yn=Yn&&(m==null?void 0:m.query)===Ot?m:null;function Zn(){if($==="")return"";const le=vb(s,$);if((le==null?void 0:le.kind)==="dir")return $;const me=$.lastIndexOf("/");return me===-1?"":$.slice(0,me)}function en(le,me){const Be=me??Zn();Be&&!r.has(Be)&&y(Be),ee({parent:Be,kind:le})}function St(){if(!ue)return[];const le=Fe=>_e?Fe:void 0;if(!ue.entry)return[{id:"paste",label:"Вставить в корень проекта",hint:le("Ctrl+V"),disabled:!z(""),onSelect:()=>Re("")},{id:"new-file",label:"Создать файл",onSelect:()=>en("file","")},{id:"new-dir",label:"Создать каталог",onSelect:()=>en("dir","")}];const me=ue.entry,Be=[me.kind==="file"?{id:"open",label:"Открыть",onSelect:()=>j(me.path)}:{id:"toggle",label:r.has(me.path)?"Свернуть":"Развернуть",onSelect:()=>y(me.path)},{id:"copy",label:"Копировать",hint:le("Ctrl+C"),onSelect:()=>ge(me)},{id:"cut",label:"Вырезать",hint:le("Ctrl+X"),onSelect:()=>ve(me)}];return me.kind==="dir"&&(Be.push({id:"paste",label:"Вставить",hint:le("Ctrl+V"),disabled:!z(me.path),onSelect:()=>Re(me.path)}),Be.push({id:"new-file",label:"Создать файл",onSelect:()=>en("file",me.path)}),Be.push({id:"new-dir",label:"Создать каталог",onSelect:()=>en("dir",me.path)})),Be.push({id:"rename",label:"Переименовать",onSelect:()=>R(me.path)}),Be.push({id:"delete",label:"Удалить",onSelect:()=>A(me)}),Be}const Jt=Yn?[]:Nt("",0);function Nt(le,me){const Be=s[le],Fe=[];if(O&&O.parent===le&&Fe.push(a.jsxs("div",{className:"fsrow fsrow--draft",style:Va(me),children:[a.jsx("span",{className:"fsrow__icon",children:O.kind==="dir"?a.jsx(Vf,{}):a.jsx(Qf,{})}),a.jsx(na,{className:"rename--file",value:"",placeholder:O.kind==="dir"?"имя каталога":"имя файла",onCommit:Ie=>{ee(null),v(le,O.kind,Ie)},onCancel:()=>ee(null)})]},`draft:${le}`)),!Be)return Fe.push(a.jsx("p",{className:"fsrow__pending",style:Va(me),children:"читаем…"},`wait:${le}`)),Fe;Be.length===0&&!O&&Fe.push(a.jsx("p",{className:"fsrow__pending",style:Va(me),children:"пусто"},`empty:${le}`));for(const Ie of Be){const At=Ie.kind==="dir"&&r.has(Ie.path);Fe.push(D===Ie.path?a.jsxs("div",{className:"fsrow fsrow--draft",style:Va(me),children:[a.jsx("span",{className:"fsrow__icon",children:Ie.kind==="dir"?a.jsx(Vf,{open:At}):a.jsx(Qf,{})}),a.jsx(na,{className:"rename--file",value:Ie.name,placeholder:"новое имя",onCommit:I=>{R(null),E(Ie.path,I)},onCancel:()=>R(null)})]},Ie.path):a.jsx(mj,{entry:Ie,depth:me,open:At,active:Ie.path===c,selected:Ie.path===$,dirty:o.has(Ie.path),gitStatus:w.get(Ie.path),dragging:(P==null?void 0:P.path)===Ie.path,dropTarget:be===Ie.path,cut:(je==null?void 0:je.mode)==="cut"&&je.path===Ie.path,onClick:()=>{rn()||(B(Ie.path),Ie.kind==="dir"?y(Ie.path):j(Ie.path))},onRename:()=>R(Ie.path),onDelete:()=>A(Ie),onDragStart:Nn(Ie),onDragEnd:st,onDragOver:kn(Ie),onDrop:Wn(Ie),...ut(Ie)},Ie.path)),At&&Fe.push(...Nt(Ie.path,me+1))}return Fe}function tl(){if(!yn)return[a.jsx("p",{className:"fsrow__pending",style:Va(0),children:"ищем…"},"search:wait")];if(yn.entries.length===0)return[a.jsx("p",{className:"fsrow__pending",style:Va(0),children:"ничего не найдено"},"search:empty")];const le=yn.entries.map(me=>a.jsx(gj,{entry:me,gitStatus:w.get(me.path),onClick:()=>pn(me)},me.path));return yn.truncated&&le.push(a.jsxs("p",{className:"fsrow__pending",style:Va(0),children:["показаны первые ",yn.entries.length," — уточните запрос"]},"search:truncated")),le}return a.jsxs("aside",{className:(l?"sidepane sidepane--files sidepane--open":"sidepane sidepane--files")+(Y?" sidepane--zoomed":""),"aria-label":"Файлы проекта",onKeyDown:cn,children:[a.jsxs("div",{className:"sidepane__head",onDoubleClick:le=>{H&&(le.target.closest("button")||H())},children:[a.jsx(vj,{}),a.jsx("span",{className:"sidepane__title",children:"Файлы"}),a.jsx("button",{className:"sidepane__btn",title:"Новый файл","aria-label":"Новый файл",onClick:()=>en("file"),children:a.jsx(_j,{})}),a.jsx("button",{className:"sidepane__btn",title:"Новый каталог","aria-label":"Новый каталог",onClick:()=>en("dir"),children:a.jsx(yj,{})}),a.jsx("button",{className:"sidepane__btn",title:"Перечитать дерево","aria-label":"Перечитать дерево",onClick:G,children:"↻"}),H&&a.jsx("button",{className:"sidepane__btn",title:Y?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":Y?"Свернуть панель файлов":"Развернуть панель файлов на весь экран","aria-pressed":Y,onClick:H,children:a.jsx(Yc,{active:Y})}),a.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель файлов",onClick:Z,children:"✕"})]}),a.jsxs("div",{className:"fssearch",children:[a.jsx(jj,{}),a.jsx("input",{className:"fssearch__input",type:"text",value:qt,spellCheck:!1,placeholder:"Поиск файлов и папок…","aria-label":"Поиск файлов и папок",onChange:le=>at(le.target.value),onKeyDown:le=>{le.stopPropagation(),le.key==="Escape"&&(le.preventDefault(),qt?at(""):le.currentTarget.blur())}}),qt&&a.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>at(""),children:"✕"})]}),a.jsx("div",{className:"sidepane__scroll fstree"+(be===""?" fstree--drop-target":""),tabIndex:-1,onDragOver:on,onDrop:el,onContextMenu:ht,onTouchStart:Ge,onTouchMove:Ue,onTouchEnd:qe,onTouchCancel:qe,children:Yn?tl():Jt}),a.jsx(Tr,{result:h}),ue&&a.jsx(Hi,{x:ue.x,y:ue.y,items:St(),onClose:Ft})]})}function mj({entry:l,depth:s,open:r,active:c,selected:o,dirty:d,gitStatus:h,dragging:m,dropTarget:g,cut:x,onClick:y,onRename:j,onDelete:v,onDragStart:E,onDragEnd:k,onDragOver:C,onDrop:A,onContextMenu:G,onTouchStart:Z,onTouchMove:Y,onTouchEnd:H,onTouchCancel:$}){const B="fsrow"+(c?" is-open":"")+(o&&!c?" is-selected":"")+(l.ignored?" fsrow--ignored":"")+(m?" fsrow--dragging":"")+(g?" fsrow--drop-target":"")+(x?" fsrow--cut":"");return a.jsxs("div",{className:B,style:Va(s),draggable:!0,onDragStart:E,onDragEnd:k,onDragOver:C,onDrop:A,onContextMenu:G,onTouchStart:Z,onTouchMove:Y,onTouchEnd:H,onTouchCancel:$,children:[a.jsxs("button",{className:"fsrow__main",onClick:y,title:I_(l),children:[a.jsx("span",{className:"fsrow__icon"+Xf("fsrow__icon",h),children:l.kind==="dir"?a.jsx(Vf,{open:r}):a.jsx(Qf,{})}),a.jsx("span",{className:"fsrow__name"+Xf("fsrow__name",h),children:l.name}),l.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":`Переименовать ${l.name}`,onClick:j,children:"✎"}),a.jsx("button",{className:"fsrow__act",title:"Удалить","aria-label":`Удалить ${l.name}`,onClick:v,children:"✕"})]})}function gj({entry:l,gitStatus:s,onClick:r}){const c=l.path.slice(0,l.path.length-l.name.length-1);return a.jsxs("button",{className:"fsrow fsrow--search"+(l.ignored?" fsrow--ignored":""),style:Va(0),onClick:r,title:I_(l),children:[a.jsx("span",{className:"fsrow__icon"+Xf("fsrow__icon",s),children:l.kind==="dir"?a.jsx(Vf,{}):a.jsx(Qf,{})}),a.jsx("span",{className:"fsrow__name"+Xf("fsrow__name",s),children:l.name}),l.ignored&&a.jsx("span",{className:"fsrow__tag",children:"git-ignore"}),c&&a.jsx("span",{className:"fsrow__path",children:c})]})}function I_(l){return l.ignored?`${l.path} — игнорируется git (.gitignore)`:l.path}function Va(l){return{"--depth":l}}function vb(l,s){var o;const r=s.lastIndexOf("/"),c=r===-1?"":s.slice(0,r);return((o=l[c])==null?void 0:o.find(d=>d.path===s))??null}function xj(l){const s=new Map,r={added:1,modified:2},c=(o,d)=>{const h=s.get(o);(!h||r[d]>r[h])&&s.set(o,d)};for(const o of l){const d=bj(o.status);if(!d)continue;c(o.path,d);let h=wr(o.path);for(;c(h,d),!!h;)h=wr(h)}return s}function bj(l){if(l==="??")return"added";const[s="",r=""]=l;return s==="A"||s==="R"||s==="C"?"added":s==="M"||r==="M"?"modified":null}function Xf(l,s){return s?` ${l}--git-${s}`:""}function Vf({open:l=!1}){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,"aria-hidden":"true",children:l?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 Qf(){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 _j(){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 yj(){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 vj(){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 jj(){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 wj=200;function Sj({open:l,result:s,onSearch:r,onOpenMatch:c,onClose:o,zoomed:d,onToggleZoom:h}){const[m,g]=_.useState(""),x=m.trim(),y=x.length>0,j=_.useRef(null),v=_.useRef(r);v.current=r;function E(A){g(A),j.current&&clearTimeout(j.current);const G=A.trim();if(!G){v.current("");return}j.current=setTimeout(()=>v.current(G),wj)}const k=y&&(s==null?void 0:s.query)===x?s:null;function C(){if(!k)return[a.jsx("p",{className:"fsrow__pending",children:"ищем…"},"grep:wait")];if(k.matches.length===0)return[a.jsx("p",{className:"fsrow__pending",children:"ничего не найдено"},"grep:empty")];const A=[];let G="";for(const Z of k.matches)Z.path!==G&&(G=Z.path,A.push(a.jsx("p",{className:"searchgroup__path",title:Z.path,children:Z.path},`path:${Z.path}`))),A.push(a.jsx(Nj,{match:Z,onClick:()=>c(Z)},`${Z.path}:${Z.line}:${Z.column}`));return k.truncated&&A.push(a.jsxs("p",{className:"fsrow__pending",children:["показаны первые ",k.matches.length," — уточните запрос"]},"grep:truncated")),A}return a.jsxs("aside",{className:(l?"sidepane sidepane--search sidepane--open":"sidepane sidepane--search")+(d?" sidepane--zoomed":""),"aria-label":"Поиск по тексту в проекте",children:[a.jsxs("div",{className:"sidepane__head",onDoubleClick:A=>{h&&(A.target.closest("button")||h())},children:[a.jsx(kj,{}),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(Yc,{active:d})}),a.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель поиска",onClick:o,children:"✕"})]}),a.jsxs("div",{className:"fssearch",children:[a.jsx(Tj,{}),a.jsx("input",{className:"fssearch__input",type:"text",value:m,spellCheck:!1,placeholder:"Поиск по тексту во всех файлах…","aria-label":"Поиск по тексту во всех файлах",onChange:A=>E(A.target.value),onKeyDown:A=>{A.stopPropagation(),A.key==="Escape"&&(A.preventDefault(),m?E(""):A.currentTarget.blur())}}),m&&a.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>E(""),children:"✕"})]}),a.jsx("div",{className:"sidepane__scroll fstree",children:y?C():a.jsx("p",{className:"sidepane__empty",children:"Введите текст, чтобы найти его во всех файлах проекта."})})]})}function Nj({match:l,onClick:s}){const r=l.lineText.slice(0,l.column-1),c=l.lineText.slice(l.column-1,l.column-1+l.matchLength),o=l.lineText.slice(l.column-1+l.matchLength);return a.jsxs("button",{className:"searchmatch",onClick:s,title:`${l.path}:${l.line}`,children:[a.jsx("span",{className:"searchmatch__line",children:l.line}),a.jsxs("span",{className:"searchmatch__text",children:[r,a.jsx("mark",{children:c}),o]})]})}function kj(){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 Tj(){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 wf=null;function Ej(){return wf||(wf=Promise.all([Pe(()=>import("./index-yXtesgZ4.js"),__vite__mapDeps([19,4,3,2,20,5]),import.meta.url),Pe(()=>import("./index-891wE-Rj.js").then(l=>l.v),__vite__mapDeps([4,3]),import.meta.url),Pe(()=>import("./index-BHot-lnj.js"),[],import.meta.url),Pe(()=>import("./index-DqnCWDLh.js"),__vite__mapDeps([20,3,4,2]),import.meta.url),Pe(()=>import("./codemirror-BdKpW4CC.js"),__vite__mapDeps([21,2,3,4]),import.meta.url)]).then(([l,s,r,c,o])=>({EditorView:s.EditorView,EditorState:r.EditorState,Compartment:r.Compartment,EditorSelection:r.EditorSelection,Prec:r.Prec,keymap:s.keymap,indentWithTab:c.indentWithTab,basicSetup:l.basicSetup,editorTheme:o.editorTheme,editorHighlight:o.editorHighlight})).catch(l=>{throw wf=null,l})),wf}function Cj({path:l,doc:s,revision:r,goto:c,onChange:o,onSave:d}){const h=_.useRef(null),m=_.useRef(null),g=_.useRef(null),x=_.useRef(new Map),y=_.useRef(new Map),j=_.useRef(new Set),v=_.useRef(null),E=_.useRef(o),k=_.useRef(d),C=_.useRef(l),A=_.useRef(r),G=_.useRef(s);E.current=o,k.current=d,C.current=l,A.current=r,G.current=s;const[Z,Y]=_.useState("loading"),[H,$]=_.useState(!1);function B(R,O,ee,P,ae){const be=x.current.get(P),Ee=y.current.get(P)===ae;if(be&&Ee)ee.setState(be);else{const X=R.EditorState.create({doc:G.current,extensions:[R.basicSetup,R.Prec.highest(R.keymap.of([{key:"Mod-s",preventDefault:!0,run:()=>(k.current(C.current),!0)}])),R.keymap.of([R.indentWithTab]),O.of([]),R.editorTheme,R.editorHighlight,R.EditorView.updateListener.of(ue=>{ue.docChanged&&E.current(C.current,ue.state.doc.toString())})]});x.current.set(P,X),y.current.set(P,ae),ee.setState(X),j.current.delete(P)}if(j.current.has(P))return()=>{};let je=!1;return ij(P).then(X=>{je||!X||C.current!==P||(ee.dispatch({effects:O.reconfigure(X)}),x.current.set(P,ee.state),j.current.add(P))}),()=>{je=!0}}_.useEffect(()=>{if(!h.current)return;let O=!1,ee=null,P=null;Y("loading"),$(!1);const ae=window.setTimeout(()=>{O||$(!0)},200);return(async()=>{let be;try{be=await Ej()}catch{window.clearTimeout(ae),O||Y("error");return}if(O||!h.current)return;window.clearTimeout(ae);const Ee=new be.Compartment;v.current=Ee,g.current=be,P=new be.EditorView({parent:h.current}),m.current=P,ee=B(be,Ee,P,C.current,A.current),Y("ready")})(),()=>{O=!0,window.clearTimeout(ae),ee==null||ee(),P==null||P.destroy(),m.current===P&&(m.current=null),g.current=null,v.current=null}},[]),_.useEffect(()=>{const R=g.current,O=m.current,ee=v.current;if(!(!R||!O||!ee))return B(R,ee,O,l,r)},[l,r]);const D=_.useRef(0);return _.useEffect(()=>{const R=m.current,O=g.current;if(!R||!O||!c||c.token===D.current)return;D.current=c.token;const ee=R.state.doc.lines,P=Math.min(Math.max(c.line,1),ee),ae=R.state.doc.line(P),be=Math.min(ae.from+Math.max(c.column-1,0),ae.to);R.dispatch({selection:O.EditorSelection.cursor(be),effects:O.EditorView.scrollIntoView(be,{y:"center"})}),R.focus()},[c]),_.useEffect(()=>()=>{const R=m.current;R&&x.current.set(l,R.state)},[l]),a.jsxs("div",{className:"editor__code",children:[a.jsx("div",{ref:h,className:"editor__code-surface"+(Z==="ready"?"":" is-hidden")}),Z==="loading"&&H&&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:"Загружается редактор…"})]}),Z==="error"&&a.jsxs("div",{className:"editor__fallback",children:[a.jsxs("div",{className:"editor__fallback-banner",role:"alert",children:[a.jsx("span",{children:"Редактор не загрузился — ниже только просмотр, без сохранения правок."}),a.jsx("button",{className:"btn btn--sm btn--primary",onClick:()=>window.location.reload(),children:"Перезагрузить страницу"})]}),a.jsx("pre",{className:"editor__fallback-text",children:s})]})]})}function Cs({value:l,options:s,onChange:r,className:c,title:o,ariaLabel:d,placeholder:h="—"}){const[m,g]=_.useState(!1),[x,y]=_.useState(0),j=_.useRef(null),v=_.useRef(null),E=s.find(A=>A.value===l)??null;_.useEffect(()=>{if(!m)return;const A=s.findIndex(G=>G.value===l);y(A===-1?0:A)},[m]),_.useEffect(()=>{if(!m)return;function A(G){var Z;(Z=j.current)!=null&&Z.contains(G.target)||g(!1)}return document.addEventListener("mousedown",A),()=>document.removeEventListener("mousedown",A)},[m]),_.useEffect(()=>{var A,G;m&&((G=(A=v.current)==null?void 0:A.querySelector(".is-cursor"))==null||G.scrollIntoView({block:"nearest"}))},[m,x]),_.useEffect(()=>{if(!m)return;const A=v.current,G=Aj(j.current);if(!A||!G)return;const Z=A.getBoundingClientRect().bottom-G.getBoundingClientRect().bottom;Z>0&&(G.scrollTop+=Math.min(Z+8,A.offsetHeight))},[m]);function k(A){g(!1),A.value!==l&&r(A.value)}function C(A){if(A.key==="Escape"){if(!m)return;A.preventDefault(),A.stopPropagation(),g(!1);return}if(A.key==="ArrowDown"||A.key==="ArrowUp"){if(A.preventDefault(),!m)return g(!0);const G=A.key==="ArrowDown"?1:s.length-1;return y(Z=>(Z+G)%s.length)}if(A.key==="Enter"||A.key===" "){if(A.preventDefault(),!m)return g(!0);const G=s[x];G&&k(G)}}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(A=>!A),onKeyDown:C,children:[a.jsx("span",{className:"select__value",children:(E==null?void 0:E.label)??h}),a.jsx(Mj,{})]}),m&&a.jsx("div",{ref:v,className:"select__menu",role:"listbox","aria-label":d??o,children:s.map((A,G)=>a.jsxs("button",{type:"button",role:"option","aria-selected":A.value===l,className:"select__option"+(G===x?" is-cursor":"")+(A.value===l?" is-on":""),onMouseEnter:()=>y(G),onClick:()=>k(A),children:[a.jsx("span",{className:"select__check","aria-hidden":"true",children:A.value===l?"✓":""}),a.jsx("span",{className:"select__label",children:A.label}),A.hint&&a.jsx("span",{className:"select__hint",children:A.hint})]},A.value))})]})}function Aj(l){let s=(l==null?void 0:l.parentElement)??null;for(;s;){if(s.scrollHeight>s.clientHeight&&getComputedStyle(s).overflowY!=="visible")return s;s=s.parentElement}return null}function Mj(){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 Rj(){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 Dj(){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 Oj(){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 Lj({path:l,mime:s,base64:r,error:c,tooLarge:o,size:d,onRequestMedia:h}){_.useEffect(()=>{!o&&r===void 0&&c===void 0&&h(l)},[]);const m=zj(r,s);return o?a.jsx("div",{className:"mediaview mediaview--message",children:a.jsxs("p",{className:"mediaview__error",children:["Файл слишком велик для просмотра (",Bf(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(l),children:"Повторить"})]}):m?s.startsWith("image/")?a.jsx(Hj,{url:m}):s.startsWith("video/")?a.jsx(Ij,{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 zj(l,s){const[r,c]=_.useState(null);return _.useEffect(()=>{if(l===void 0){c(null);return}const o=atob(l),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:s}));return c(h),()=>URL.revokeObjectURL(h)},[l,s]),r}const Oi=1,q_=8,Sf=1.25;function Uj(l){return Math.min(q_,Math.max(Oi,l))}function Hj({url:l}){const[s,r]=_.useState({scale:Oi,x:0,y:0}),[c,o]=_.useState(!1),d=_.useRef(null),h=_.useRef(null);function m(E,k,C){r(A=>{const G=Uj(A.scale*E);if(G===A.scale)return A;if(G<=Oi)return{scale:Oi,x:0,y:0};const Z=(k-A.x)/A.scale,Y=(C-A.y)/A.scale;return{scale:G,x:k-G*Z,y:C-G*Y}})}_.useEffect(()=>{const E=d.current;if(!E)return;function k(C){C.preventDefault();const A=E.getBoundingClientRect(),G=C.clientX-A.left-A.width/2,Z=C.clientY-A.top-A.height/2;m(C.deltaY<0?Sf:1/Sf,G,Z)}return E.addEventListener("wheel",k,{passive:!1}),()=>E.removeEventListener("wheel",k)},[]);function g(E){s.scale<=Oi||(E.currentTarget.setPointerCapture(E.pointerId),h.current={pointerId:E.pointerId,startX:E.clientX,startY:E.clientY,origX:s.x,origY:s.y},o(!0))}function x(E){const k=h.current;!k||k.pointerId!==E.pointerId||r(C=>({...C,x:k.origX+(E.clientX-k.startX),y:k.origY+(E.clientY-k.startY)}))}function y(){h.current=null,o(!1)}const j=s.scale>Oi,v=!j&&s.x===0&&s.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:l,alt:"",className:"mediaview__image",draggable:!1,style:{transform:`translate(${s.x}px, ${s.y}px) scale(${s.scale})`}})}),a.jsxs("div",{className:"mediaview__toolbar",children:[a.jsx("button",{className:"btn btn--sm",disabled:s.scale<=Oi,title:"Уменьшить","aria-label":"Уменьшить",onClick:()=>m(1/Sf,0,0),children:a.jsx(Dj,{})}),a.jsxs("span",{className:"mediaview__zoomlabel",children:[Math.round(s.scale*100),"%"]}),a.jsx("button",{className:"btn btn--sm",disabled:s.scale>=q_,title:"Увеличить","aria-label":"Увеличить",onClick:()=>m(Sf,0,0),children:a.jsx(Rj,{})}),a.jsx("button",{className:"btn btn--sm",disabled:v,title:"Вписать в окно","aria-label":"Сбросить масштаб — вписать в окно",onClick:()=>r({scale:Oi,x:0,y:0}),children:a.jsx(Oj,{})})]})]})}const Bj=[{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 Ij({url:l}){const s=_.useRef(null),[r,c]=_.useState("1");return _.useEffect(()=>{s.current&&(s.current.playbackRate=Number(r))},[r]),a.jsxs("div",{className:"mediaview mediaview--video",children:[a.jsx("video",{ref:s,className:"mediaview__video",src:l,controls:!0}),a.jsxs("div",{className:"mediaview__speedbar",children:[a.jsx("span",{className:"mediaview__speedlabel",children:"Скорость"}),a.jsx(Cs,{className:"mediaview__speedselect",value:r,onChange:c,ariaLabel:"Скорость воспроизведения",options:Bj})]})]})}function qj({file:l,goto:s,onChange:r,onSave:c,onReload:o,onOverwrite:d,onRequestMedia:h,onTogglePreview:m}){const g=Xa(l),x=B_(l.path)&&!l.binary&&!l.tooLarge;return a.jsxs("div",{className:"editor",children:[a.jsxs("div",{className:"editor__bar",children:[a.jsx("span",{className:"editor__path",title:l.path,children:l.path}),a.jsxs("span",{className:"editor__meta",children:[Bf(l.size),l.eol==="crlf"&&" · CRLF"]}),x&&a.jsxs("div",{className:"editor__viewtoggle",role:"tablist","aria-label":"Режим просмотра",children:[a.jsx("button",{className:"btn btn--sm"+(l.previewMode?" is-on":""),role:"tab","aria-selected":l.previewMode,onClick:()=>!l.previewMode&&m(l.path),children:"Просмотр"}),a.jsx("button",{className:"btn btn--sm"+(l.previewMode?"":" is-on"),role:"tab","aria-selected":!l.previewMode,onClick:()=>l.previewMode&&m(l.path),children:"Код"})]}),a.jsx("button",{className:"btn btn--sm",disabled:!g,title:"Сохранить (Ctrl+S)",onClick:()=>c(l.path),children:g?"Сохранить":"Сохранено"})]}),l.stale&&a.jsxs("div",{className:"editor__warn",children:[a.jsxs("span",{children:["Файл изменился на диске",g?" — а здесь есть несохранённые правки.":"."]}),a.jsx("button",{className:"btn btn--sm",onClick:()=>o(l.path),children:"Взять с диска"}),g&&a.jsx("button",{className:"btn btn--sm btn--danger",onClick:()=>d(l.path),children:"Сохранить поверх"})]}),l.binary&&l.mediaMime?a.jsx(Lj,{path:l.path,mime:l.mediaMime,base64:l.mediaBase64,error:l.mediaError,tooLarge:l.mediaTooLarge,size:l.size,onRequestMedia:h},l.path):l.binary?a.jsxs("p",{className:"editor__empty",children:["Это не текстовый файл — редактировать его здесь нечем. ",Bf(l.size)," на диске."]}):l.tooLarge?a.jsxs("p",{className:"editor__empty",children:["Файл слишком велик для редактора (",Bf(l.size),"). Такие правит агент, а не браузер."]}):x&&l.previewMode?a.jsx(Gj,{text:l.text}):a.jsx(Cj,{path:l.path,doc:l.text,revision:l.revision,goto:s,onChange:r,onSave:c})]})}function Gj({text:l}){const[s,r]=_.useState("");return _.useEffect(()=>{let c=!1;return Wf(l).then(o=>{c||r(o)}),()=>{c=!0}},[l]),a.jsx("div",{className:"markdown-preview",dangerouslySetInnerHTML:{__html:s}})}function Yj({files:l,activePath:s,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"+(s===null?" is-on":""),role:"tab","aria-selected":s===null,onClick:()=>c(null),onDoubleClick:()=>h==null?void 0:h(),children:[a.jsx("span",{className:"worktab__name",children:"Разговор"}),r&&a.jsx("span",{className:"worktab__dot worktab__dot--busy",title:"Агент работает"})]}),l.map(m=>a.jsxs("div",{className:"worktab"+(m.path===s?" is-on":""),role:"tab","aria-selected":m.path===s,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:oj(m.path)}),Xa(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(Yc,{active:d})})]})}function os(l){return l.claudeSessionId??l.id}function Nf(l,s,r,c){if(!s||s.length===0)return l;const o=new Map(s.map((m,g)=>[m,g])),d=[],h=[];for(const m of l)(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 jb(l){return l.state!=="closed"}function wb(l){return[...l.filter(jb),...l.filter(s=>!jb(s))]}function kf(l,s,r,c){if(s===r||!l.includes(s)||!l.includes(r))return null;const o=l.filter(m=>m!==s),d=o.indexOf(r)+(c==="after"?1:0),h=[...o.slice(0,d),s,...o.slice(d)];return h.every((m,g)=>m===l[g])?null:h}function Op(l,s,r,c){const o=l%10,d=l%100;return o===1&&d!==11?s:o>=2&&o<=4&&(d<12||d>14)?r:c}function G_(l){return`${l} ${Op(l,"агент","агента","агентов")}`}function $j(l){const s=l.filter(o=>o.kind==="agent").length,r=l.length-s,c=[];return s>0&&c.push(G_(s)),r>0&&c.push(`${r} ${Op(r,"задача","задачи","задач")} в фоне`),c.join(" · ")}function Xj(l){switch(l.kind){case"agent":return l.agentType??"агент";case"shell":return"команда";case"workflow":return"сценарий";default:return"задача"}}function Vj(l){const s=Math.max(0,Math.floor(l/1e3)),r=Math.floor(s/3600),c=Math.floor(s%3600/60),o=s%60,d=String(o).padStart(2,"0");return r>0?`${r}:${String(c).padStart(2,"0")}:${d}`:`${c}:${d}`}function Qj(l){return l<1e3?`${l} ток.`:`${(l/1e3).toFixed(1).replace(".",",")} k ток.`}function Kj({tasks:l,onStop:s}){const[r,c]=_.useState(!1),[o,d]=_.useState(()=>Date.now()),[h,m]=_.useState(()=>new Set);_.useEffect(()=>{const x=window.setInterval(()=>d(Date.now()),1e3);return()=>window.clearInterval(x)},[]),_.useEffect(()=>{m(x=>{const y=new Set(l.map(v=>v.id)),j=new Set([...x].filter(v=>y.has(v)));return j.size===x.size?x:j})},[l]);const g=x=>{m(y=>new Set(y).add(x)),s(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:$j(l)}),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:l.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:Xj(x)}),x.background&&a.jsx("span",{className:"task__bg",children:"фон"}),a.jsx("span",{className:"task__time",children:Vj(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:[Qj(x.tokens)," · ",x.toolUses," ",Op(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 Zj=""+new URL("antigravity-logo-DRKQga2U.png",import.meta.url).href;function Lp({className:l}){return a.jsx("img",{src:Zj,alt:"","aria-hidden":"true",className:l,style:{aspectRatio:"200 / 184"}})}const Fj=450,Jj=6,Pj=[{id:"claude",label:"Claude",hint:"Claude Code — как обычно"},{id:"antigravity",label:"Antigravity",hint:"Google agy, отдельная палитра и права"}];function Wj({disabled:l,providers:s,onStart:r}){const c=Pj.filter(O=>s.includes(O.id)),o=c.length>1,[d,h]=_.useState(!1),[m,g]=_.useState(0),[x,y]=_.useState({left:0,top:0}),j=_.useRef(null),v=_.useRef(null),E=_.useRef(null);function k(){E.current&&window.clearTimeout(E.current.timer),E.current=null}function C(){k(),g(0),h(!0)}function A(O){var ee;h(!1),O&&((ee=j.current)==null||ee.focus())}function G(O){if(l||!o||O.button!==0)return;const ee={timer:0,x:O.clientX,y:O.clientY,fired:!1};ee.timer=window.setTimeout(()=>{ee.fired=!0,C()},Fj),E.current=ee}function Z(O){const ee=E.current;!ee||ee.fired||Math.hypot(O.clientX-ee.x,O.clientY-ee.y)>Jj&&k()}function Y(){E.current&&!E.current.fired&&k()}function H(O){var P;if((P=E.current)!=null&&P.fired){E.current=null,O.preventDefault();return}if(l)return;const ee=c[0];ee&&r(ee.id)}function $(O){o&&(O.preventDefault(),!l&&C())}function B(O){if(l||!o)return;(O.key==="ArrowDown"||O.key==="ArrowUp"||O.key==="Enter"&&O.shiftKey)&&(O.preventDefault(),C())}_.useLayoutEffect(()=>{if(!d)return;const O=j.current,ee=v.current;if(!O||!ee)return;const P=O.getBoundingClientRect(),ae=ee.getBoundingClientRect(),be=8,Ee=Math.max(be,Math.min(P.right-ae.width,window.innerWidth-ae.width-be));let je=P.top-ae.height-8;je<be&&(je=Math.min(P.bottom+8,window.innerHeight-ae.height-be)),y({left:Ee,top:je})},[d]),_.useLayoutEffect(()=>{var O;d&&((O=v.current)==null||O.focus())},[d]),_.useLayoutEffect(()=>{if(!d)return;function O(ee){var ae,be;const P=ee.target;!((ae=v.current)!=null&&ae.contains(P))&&!((be=j.current)!=null&&be.contains(P))&&A(!1)}return document.addEventListener("mousedown",O),()=>document.removeEventListener("mousedown",O)},[d]);function D(O){A(!1),r(O.id)}function R(O){if(O.key==="Escape"){O.preventDefault(),O.stopPropagation(),A(!0);return}if(O.key==="ArrowDown"||O.key==="ArrowUp"){O.preventDefault();const ee=O.key==="ArrowDown"?1:-1;g(P=>(P+ee+c.length)%c.length);return}if(O.key==="Enter"||O.key===" "){O.preventDefault();const ee=c[m];ee&&D(ee);return}O.key==="Tab"&&A(!1)}return a.jsxs("div",{className:"newsession",children:[a.jsxs("button",{ref:j,type:"button",className:"btn btn--primary newsession__btn",disabled:l,title:o?"Удерживайте, чтобы выбрать агента":void 0,"aria-haspopup":o?"menu":void 0,"aria-expanded":o?d:void 0,onClick:H,onContextMenu:$,onPointerDown:G,onPointerMove:Z,onPointerUp:Y,onPointerCancel:Y,onPointerLeave:Y,onKeyDown:B,children:["+ Сессия",o&&a.jsx(ew,{})]}),d&&o&&a.jsx("div",{ref:v,className:"newsession__menu",style:{left:x.left,top:x.top},role:"menu","aria-label":"Выбрать агента для новой сессии",tabIndex:-1,onKeyDown:R,children:c.map((O,ee)=>a.jsxs("button",{type:"button",role:"menuitem",className:"newsession__item"+(ee===m?" is-cursor":""),onMouseEnter:()=>g(ee),onClick:()=>D(O),children:[a.jsx("span",{className:`newsession__mark newsession__mark--${O.id}`,"aria-hidden":"true",children:O.id==="antigravity"?a.jsx(Lp,{className:"newsession__mark-logo"}):a.jsx(tw,{})}),a.jsxs("span",{className:"newsession__text",children:[a.jsx("span",{className:"newsession__label",children:O.label}),a.jsx("span",{className:"newsession__hint",children:O.hint})]})]},O.id))})]})}function ew(){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 tw(){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",$_="ccv:sidebar.mode",X_="ccv:sidebar.foldersCollapsed",nw=500,Zh="транскрипт остаётся на диске — сессию можно вернуть из архива в любой момент.";function lw({open:l,connected:s,status:r,workspaces:c,archivedWorkspaces:o,workspaceFolders:d,sessionFolders:h,pinnedFolders:m,sessions:g,archived:x,pinned:y,live:j,listOrder:v,liveSessionsFirst:E,onReorder:k,activeWorkspaceId:C,activeSessionId:A,onSelectWorkspace:G,onSelectSession:Z,onRenameSession:Y,onStopSession:H,onPinSessions:$,onSelectPinned:B,onCloseWorkspaces:D,onRestoreWorkspaces:R,onArchiveSessions:O,onUnarchiveSessions:ee,onCreateFolder:P,onRenameFolder:ae,onSetFolderColor:be,onDeleteFolder:Ee,onAssignToFolder:je,onOpenWorkspace:X,onNewSession:ue,enabledProviders:de,onOpenExtensions:_e,account:Ae,onOpenAccount:w,relay:V,onOpenRelay:z,onOpenSettings:ge,themeMode:ve,onCycleTheme:Re}){var Gl;const[Oe,Ue]=_.useState(null),[qe,rn]=_.useState(null),[Ve,Ft]=_.useState(null);function ut(N){return(Ve==null?void 0:Ve.folderId)===N.id?Ve.color??void 0:N.color}function ht(N){const ie=N&&ut(N);return ie?{"--folder-color":ie}:void 0}function Ge(N){return N?a.jsx("span",{className:"row__stripe","aria-hidden":"true"}):null}const cn=_.useRef(void 0),[Nn,st]=_.useState(null),[kn,Wn]=_.useState(""),[on,el]=_.useState(bw),[qt,tt]=_.useState(_w),[Ot,Yn]=_.useState(yw);function Ct(N){Yn(N);try{localStorage.setItem($_,N)}catch{}}const nt=kn.trim().toLowerCase(),at=nt!=="",pn=_.useMemo(()=>Nf(c,v==null?void 0:v.workspaces,N=>N.id,"bottom"),[c,v]),yn=_.useMemo(()=>{const N=Nf(g,C?v==null?void 0:v.sessions[C]:void 0,os,"top");return E?wb(N):N},[g,v,C,E]),Zn=_.useMemo(()=>{const N=Nf(y,v==null?void 0:v.pinned,os,"bottom");return E?wb(N):N},[y,v,E]),en=_.useMemo(()=>Nf(j,v==null?void 0:v.live,os,"bottom"),[j,v]),St=_.useMemo(()=>at?pn.filter(N=>N.name.toLowerCase().includes(nt)||N.path.toLowerCase().includes(nt)):pn,[pn,nt,at]),Jt=_.useMemo(()=>at?o.filter(N=>N.name.toLowerCase().includes(nt)||N.path.toLowerCase().includes(nt)):o,[o,nt,at]),Nt=_.useMemo(()=>at?yn.filter(N=>(N.title??"").toLowerCase().includes(nt)):yn,[yn,nt,at]),tl=_.useMemo(()=>at?x.filter(N=>(N.title??"").toLowerCase().includes(nt)):x,[x,nt,at]),le=N=>{var ie;return((ie=c.find(Te=>Te.id===N))==null?void 0:ie.name)??"—"},me=N=>{var ie;return(ie=c.find(Te=>Te.id===N))==null?void 0:ie.path},Be=_.useMemo(()=>at?Zn.filter(N=>(N.title??"").toLowerCase().includes(nt)||le(N.workspaceId).toLowerCase().includes(nt)):Zn,[Zn,c,nt,at]),Fe=_.useMemo(()=>at?en.filter(N=>(N.title??"").toLowerCase().includes(nt)||le(N.workspaceId).toLowerCase().includes(nt)):en,[en,c,nt,at]),Ie=!at;function At(N){el(ie=>{const Te=ie.includes(N)?ie.filter(Ke=>Ke!==N):[...ie,N];try{localStorage.setItem(Y_,JSON.stringify(Te))}catch{}return Te})}const I=N=>!on.includes(N);function oe(N){tt(ie=>{const Te=ie.includes(N)?ie.filter(Ke=>Ke!==N):[...ie,N];try{localStorage.setItem(X_,JSON.stringify(Te))}catch{}return Te})}const Ne=N=>!qt.includes(N),Le=_.useMemo(()=>Fo(St,d),[St,d]),kt=_.useMemo(()=>Fo(Jt,d),[Jt,d]),Tn=_.useMemo(()=>Fo(Nt,h),[Nt,h]),ul=_.useMemo(()=>Fo(tl,h),[tl,h]),yl=_.useMemo(()=>Fo(Be,m,N=>N.pinnedFolderId),[Be,m]),ds=_.useMemo(()=>({groups:[],ungrouped:Fe}),[Fe]),Fl=((v==null?void 0:v.workspaces.length)??0)>0,Jl=C?(((Gl=v==null?void 0:v.sessions[C])==null?void 0:Gl.length)??0)>0:!1,Pl=((v==null?void 0:v.pinned.length)??0)>0,Ka=((v==null?void 0:v.live.length)??0)>0,fl=Tf({enabled:Ie,scope:"workspaces",itemKey:N=>N.id,groups:Le.groups,ungrouped:Le.ungrouped,onReorder:k}),nl=Tf({enabled:Ie,scope:"sessions",workspaceId:C??void 0,itemKey:os,groups:Tn.groups,ungrouped:Tn.ungrouped,onReorder:k}),Lt=Tf({enabled:Ie,scope:"pinned",itemKey:os,groups:yl.groups,ungrouped:yl.ungrouped,onReorder:k}),Ze=Tf({enabled:Ie,scope:"live",itemKey:os,groups:ds.groups,ungrouped:ds.ungrouped,onReorder:k});_.useEffect(()=>{var Te;if(!Ve)return;const ie=(Te=[...yl.groups,...Le.groups,...kt.groups,...Tn.groups,...ul.groups].find(Ke=>Ke.folder.id===Ve.folderId))==null?void 0:Te.folder;ie&&ie.color===(Ve.color??void 0)&&Ft(null)},[Ve,yl,Le,kt,Tn,ul]),_.useEffect(()=>()=>window.clearTimeout(cn.current),[]);const vn=Jh(St),Vt=Jh(Jt),vl=Jh(Nt),[Pt,hs]=_.useState(null),[Qt,ps]=_.useState(null),[xt,un]=_.useState(null),[On,pt]=_.useState(null),[it,En]=_.useState(null),dl=_.useRef(null);function $n(N,ie){const Te=N.touches[0];if(!Te)return;const Ke={timer:0,x:Te.clientX,y:Te.clientY,el:N.currentTarget,fired:!1};Ke.timer=window.setTimeout(()=>{Ke.fired=!0,ie(Ke.x,Ke.y,Ke.el)},nw),dl.current=Ke}function hl(N){const ie=dl.current,Te=N.touches[0];!ie||!Te||Math.hypot(Te.clientX-ie.x,Te.clientY-ie.y)>10&&(window.clearTimeout(ie.timer),dl.current=null)}function Ln(N){const ie=dl.current;ie&&(window.clearTimeout(ie.timer),ie.fired&&N.preventDefault())}function mn(){var N;return(N=dl.current)!=null&&N.fired?(dl.current=null,!0):!1}function jl(){const N=Pt==null?void 0:Pt.opener;hs(null),N!=null&&N.isConnected&&N.focus()}function gn(){const N=Qt==null?void 0:Qt.opener;ps(null),N!=null&&N.isConnected&&N.focus()}function El(){const N=xt==null?void 0:xt.opener;un(null),N!=null&&N.isConnected&&N.focus()}function ll(){const N=On==null?void 0:On.opener;pt(null),N!=null&&N.isConnected&&N.focus()}function jn(){const N=it==null?void 0:it.opener;En(null),N!=null&&N.isConnected&&N.focus()}function Kt(N){return{onContextMenu:ie=>{ie.preventDefault(),hs({x:ie.clientX,y:ie.clientY,opener:ie.currentTarget,ids:vn.targetsFor(N)})},onTouchStart:ie=>$n(ie,(Te,Ke,Vn)=>hs({x:Te,y:Ke,opener:Vn,ids:vn.targetsFor(N)})),onTouchMove:hl,onTouchEnd:Ln,onTouchCancel:Ln}}function ms(N){return{onContextMenu:ie=>{ie.preventDefault(),ps({x:ie.clientX,y:ie.clientY,opener:ie.currentTarget,ids:Vt.targetsFor(N)})},onTouchStart:ie=>$n(ie,(Te,Ke,Vn)=>ps({x:Te,y:Ke,opener:Vn,ids:Vt.targetsFor(N)})),onTouchMove:hl,onTouchEnd:Ln,onTouchCancel:Ln}}function aa(N){return{onContextMenu:ie=>{ie.preventDefault(),un({x:ie.clientX,y:ie.clientY,opener:ie.currentTarget,ids:vl.targetsFor(N)})},onTouchStart:ie=>$n(ie,(Te,Ke,Vn)=>un({x:Te,y:Ke,opener:Vn,ids:vl.targetsFor(N)})),onTouchMove:hl,onTouchEnd:Ln,onTouchCancel:Ln}}function Cn(N){return{onContextMenu:ie=>{ie.preventDefault(),pt({x:ie.clientX,y:ie.clientY,opener:ie.currentTarget,ids:[N.id]})},onTouchStart:ie=>$n(ie,(Te,Ke,Vn)=>pt({x:Te,y:Ke,opener:Vn,ids:[N.id]})),onTouchMove:hl,onTouchEnd:Ln,onTouchCancel:Ln}}function Wl(N){return{onContextMenu:ie=>{ie.preventDefault(),En({x:ie.clientX,y:ie.clientY,opener:ie.currentTarget,ids:[N.id]})},onTouchStart:ie=>$n(ie,(Te,Ke,Vn)=>En({x:Te,y:Ke,opener:Vn,ids:[N.id]})),onTouchMove:hl,onTouchEnd:Ln,onTouchCancel:Ln}}const Cl=g.filter(N=>N.state!=="closed").length,es=Pt?St.find(N=>N.id===Pt.ids[0]):void 0,Xn=Pt?[{id:"close",label:Pt.ids.length>1?`Закрыть проекты (${Pt.ids.length})`:"Закрыть проект",onSelect:()=>{D(Pt.ids),vn.clear()}},...Jo({folders:d,ids:Pt.ids,hasFolder:(es==null?void 0:es.folderId)!=null,assign:(N,ie)=>je("workspace",N,ie),onClear:()=>vn.clear(),onNewFolder:()=>st("workspace")}),...Pt.ids.length===1&&Ie?fl.menuItems(Pt.ids[0],Fl):[]]:[],ia=Pt?"закрытие не удаляет проект: каталог и история сессий остаются на диске — открыть его снова можно кнопкой «+ Проект»."+(C&&Pt.ids.includes(C)&&Cl>0?` в нём сейчас незавершённых сессий: ${Cl} — при закрытии они остановятся на хосте.`:""):void 0,gs=Qt?Jt.find(N=>N.id===Qt.ids[0]):void 0,ts=Qt?[{id:"restore",label:Qt.ids.length>1?`Вернуть проекты (${Qt.ids.length})`:"Вернуть проект",onSelect:()=>{R(Qt.ids),Vt.clear()}},...Jo({folders:d,ids:Qt.ids,hasFolder:(gs==null?void 0:gs.folderId)!=null,assign:(N,ie)=>je("workspace",N,ie),onClear:()=>Vt.clear(),onNewFolder:()=>st("workspace")})]:[],Al=Qt?"каталог и история сессий всё это время оставались на диске — восстановление их не трогает.":void 0,pe=xt?Nt.find(N=>N.id===xt.ids[0]):void 0,T=(pe==null?void 0:pe.pinned)!==!0,Q=xt?[...xt.ids.length===1?[{id:"rename",label:"Переименовать",onSelect:()=>Ue(xt.ids[0])}]:[],{id:"pin",label:T?xt.ids.length>1?`Закрепить (${xt.ids.length})`:"Закрепить":xt.ids.length>1?`Открепить (${xt.ids.length})`:"Открепить",onSelect:()=>{pe&&$(pe.workspaceId,xt.ids,T),vl.clear()}},{id:"archive",label:xt.ids.length>1?`Убрать в архив (${xt.ids.length})`:"Убрать в архив",onSelect:()=>{O(C,xt.ids),vl.clear()}},...Jo({folders:h,ids:xt.ids,hasFolder:(pe==null?void 0:pe.folderId)!=null,assign:(N,ie)=>je("session",N,ie,C),onClear:()=>vl.clear(),onNewFolder:()=>st("session")}),...xt.ids.length===1&&Ie&&pe?nl.menuItems(os(pe),Jl):[]]:[],he=xt?Zh:void 0,ye=On?Be.find(N=>N.id===On.ids[0]):void 0,He=On?[{id:"rename",label:"Переименовать",onSelect:()=>Ue(On.ids[0])},{id:"unpin",label:"Открепить",onSelect:()=>{ye&&$(ye.workspaceId,[ye.id],!1)}},{id:"archive",label:"Убрать в архив",onSelect:()=>{ye&&O(ye.workspaceId,[ye.id])}},...ye&&ye.workspaceId===C?Jo({folders:h,ids:[ye.id],hasFolder:ye.folderId!=null,assign:(N,ie)=>je("session",N,ie,ye.workspaceId),onClear:()=>{},onNewFolder:()=>st("session")}):[],...rw(ye?Jo({folders:m,ids:[ye.id],hasFolder:ye.pinnedFolderId!=null,assign:(N,ie)=>je("pinned",N,ie),onClear:()=>{},onNewFolder:()=>st("pinned")}):[]),...Ie&&ye?Lt.menuItems(os(ye),Pl):[]]:[],we=it?Fe.find(N=>N.id===it.ids[0]):void 0,_t=it?[{id:"stop",label:"Остановить",onSelect:()=>{we&&H(we)}},{id:"rename",label:"Переименовать",onSelect:()=>Ue(it.ids[0])},{id:"pin",label:(we==null?void 0:we.pinned)===!0?"Открепить":"Закрепить",onSelect:()=>{we&&$(we.workspaceId,[we.id],we.pinned!==!0)}},{id:"archive",label:"Убрать в архив",onSelect:()=>{we&&O(we.workspaceId,[we.id])}},...Ie&&we?Ze.menuItems(os(we),Ka):[]]:[];function zt(N,ie){return a.jsxs("div",{"data-row-key":N.id,className:wc(N.id===C,vn.selected.includes(N.id),!1,!!ie)+fl.dropClass(N.id),style:ht(ie),...Kt(N),children:[Ge(ie),Ie&&a.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить проект, чтобы изменить порядок в списке",...fl.gripHandlers(N.id),children:a.jsx(Ef,{})}),a.jsxs("button",{className:"row__main",onClick:Te=>{mn()||vn.click(Te,N,()=>G(N.id))},onKeyDown:Te=>fl.onKeyDown(N.id,Te),children:[a.jsxs("span",{className:"row__title",children:[N.name,N.hasClaudeMd&&" ·"]}),a.jsx("span",{className:"row__meta",title:N.path,children:N.path})]})]},N.id)}function tn(N,ie){return a.jsxs("div",{className:wc(N.id===C,Vt.selected.includes(N.id),!1,!!ie),style:ht(ie),...ms(N),children:[Ge(ie),a.jsxs("button",{className:"row__main",onClick:Te=>{mn()||Vt.click(Te,N,()=>G(N.id))},children:[a.jsxs("span",{className:"row__title",children:[N.name,N.hasClaudeMd&&" ·"]}),a.jsx("span",{className:"row__meta",children:Ew(N)})]}),a.jsx("button",{className:"row__restore",title:"Вернуть проект из архива",onClick:()=>R([N.id]),children:"Вернуть"})]},N.id)}function yt(N,ie){const Te=os(N);return a.jsxs("div",{"data-row-key":Te,className:wc(N.id===A,vl.selected.includes(N.id),N.provider==="antigravity",!!ie)+nl.dropClass(Te),style:ht(ie),...Oe===N.id?{}:aa(N),children:[Ge(ie),Oe===N.id?a.jsx("div",{className:"row__main",children:a.jsx(na,{value:N.title??"",onCommit:Ke=>{Y(N,Ke),Ue(null)},onCancel:()=>Ue(null)})}):a.jsxs(a.Fragment,{children:[Ie&&a.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...nl.gripHandlers(Te),children:a.jsx(Ef,{})}),a.jsxs("button",{className:"row__main",onClick:Ke=>{mn()||vl.click(Ke,N,()=>Z(N))},onKeyDown:Ke=>nl.onKeyDown(Te,Ke),children:[a.jsx(Cf,{title:N.title??"Без названия",pinned:N.pinned===!0,provider:N.provider,projectName:le(N.workspaceId),projectPath:me(N.workspaceId)}),a.jsx(Ph,{session:N,tail:new Date(N.updatedAt).toLocaleString()})]}),a.jsx("button",{className:"row__edit",title:"Переименовать","aria-label":"Переименовать сессию",onClick:()=>{mn()||Ue(N.id)},children:"✎"})]})]},N.id)}function xn(N,ie){return a.jsxs("div",{className:wc(N.id===A,!1,N.provider==="antigravity",!!ie),style:ht(ie),children:[Ge(ie),a.jsxs("button",{className:"row__main",onClick:()=>Z(N),children:[a.jsx(Cf,{title:N.title??"Без названия",pinned:!1,provider:N.provider,projectName:le(N.workspaceId),projectPath:me(N.workspaceId)}),a.jsx("span",{className:"row__meta",children:Tw(N)})]}),a.jsx("button",{className:"row__restore",title:"Вернуть сессию из архива",onClick:()=>ee([N.id]),children:"Вернуть"})]},N.id)}function Mt(N,ie){const Te=os(N);return a.jsxs("div",{"data-row-key":Te,className:wc(N.id===A,!1,N.provider==="antigravity",!!ie)+Lt.dropClass(Te),style:ht(ie),...Oe===N.id?{}:{title:"Действия со строкой — правый клик или долгое нажатие",...Cn(N)},children:[Ge(ie),Oe===N.id?a.jsx("div",{className:"row__main",children:a.jsx(na,{value:N.title??"",onCommit:Ke=>{Y(N,Ke),Ue(null)},onCancel:()=>Ue(null)})}):a.jsxs(a.Fragment,{children:[Ie&&a.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...Lt.gripHandlers(Te),children:a.jsx(Ef,{})}),a.jsxs("button",{className:"row__main",onClick:()=>{mn()||B(N)},onKeyDown:Ke=>Lt.onKeyDown(Te,Ke),children:[a.jsx(Cf,{title:N.title??"Без названия",pinned:!1,provider:N.provider,projectName:le(N.workspaceId),projectPath:me(N.workspaceId)}),a.jsx(Ph,{session:N,tail:new Date(N.updatedAt).toLocaleString()})]})]})]},N.id)}function zn(N){const ie=os(N);return a.jsx("div",{"data-row-key":ie,className:wc(N.id===A,!1,N.provider==="antigravity")+Ze.dropClass(ie),...Oe===N.id?{}:{title:"Действия со строкой — правый клик или долгое нажатие",...Wl(N)},children:Oe===N.id?a.jsx("div",{className:"row__main",children:a.jsx(na,{value:N.title??"",onCommit:Te=>{Y(N,Te),Ue(null)},onCancel:()=>Ue(null)})}):a.jsxs(a.Fragment,{children:[Ie&&a.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...Ze.gripHandlers(ie),children:a.jsx(Ef,{})}),a.jsxs("button",{className:"row__main",onClick:()=>{mn()||B(N)},onKeyDown:Te=>Ze.onKeyDown(ie,Te),children:[a.jsx(Cf,{title:N.title??"Без названия",pinned:N.pinned===!0,provider:N.provider,projectName:le(N.workspaceId),projectPath:me(N.workspaceId)}),a.jsx(Ph,{session:N,tail:new Date(N.updatedAt).toLocaleString()})]}),a.jsx("button",{type:"button",className:"row__stop",title:"Остановить сессию","aria-label":"Остановить сессию",onClick:Te=>{Te.stopPropagation(),!mn()&&H(N)},children:a.jsx(pw,{})})]})},N.id)}function sl(N,ie){return a.jsx(dw,{folder:N,count:ie,open:Ne(N.id),renaming:qe===N.id,onToggle:()=>oe(N.id),onStartRename:()=>rn(N.id),onCommitRename:Te=>{ae(N.id,Te),rn(null)},onCancelRename:()=>rn(null),onDelete:()=>Ee(N.id),color:ut(N),onPreviewColor:Te=>{window.clearTimeout(cn.current),Ft({folderId:N.id,color:Te})},onCommitColor:Te=>{Ft({folderId:N.id,color:Te}),be(N.id,Te),window.clearTimeout(cn.current),cn.current=window.setTimeout(()=>Ft(null),4e3)},onResetColor:()=>{window.clearTimeout(cn.current),Ft(null),be(N.id,null)}},N.id)}return a.jsxs("aside",{className:l?"sidebar sidebar--open":"sidebar",children:[a.jsxs("div",{className:"sidebar__head",children:[a.jsx("span",{className:s?"dot dot--on":"dot",title:r}),a.jsx("span",{className:"brand",children:"Claude Code Visual"}),a.jsx("button",{className:"theme-btn",title:`Тема: ${Nb[ve]}`,"aria-label":`Тема: ${Nb[ve]}. Переключить`,onClick:Re,children:a.jsx(vw,{mode:ve})})]}),a.jsxs("div",{className:"sidebar__tabs",role:"tablist","aria-label":"Что показывать в списке",children:[a.jsx("button",{type:"button",role:"tab","aria-selected":Ot==="default",className:Ot==="default"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>Ct("default"),children:a.jsx("span",{className:"sidebar__tab-label",children:"Все"})}),a.jsx("button",{type:"button",role:"tab","aria-selected":Ot==="pinned",className:Ot==="pinned"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>Ct("pinned"),children:a.jsx("span",{className:"sidebar__tab-label",children:"Закреплённые"})}),a.jsxs("button",{type:"button",role:"tab","aria-selected":Ot==="live",className:Ot==="live"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>Ct("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(gw,{}),a.jsx("input",{className:"fssearch__input",type:"text",value:kn,spellCheck:!1,placeholder:"Проект или сессия…","aria-label":"Поиск по проектам и сессиям",onChange:N=>Wn(N.target.value),onKeyDown:N=>{N.stopPropagation(),N.key==="Escape"&&(N.preventDefault(),kn?Wn(""):N.currentTarget.blur())}}),kn&&a.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>Wn(""),children:"✕"})]}),a.jsx("div",{className:"sidebar__scroll",children:Ot==="pinned"?a.jsxs(a.Fragment,{children:[a.jsx(Sc,{title:"Закреплённые",count:Be.length,open:I("pinned"),onToggle:()=>At("pinned"),action:{label:"Новая папка закреплённых",onClick:()=>{st("pinned"),I("pinned")||At("pinned")}}}),I("pinned")&&a.jsxs(a.Fragment,{children:[Nn==="pinned"&&a.jsx("div",{className:"row",children:a.jsx("div",{className:"row__main",children:a.jsx(na,{value:"",placeholder:"Название папки",onCommit:N=>{P("pinned",N),st(null)},onCancel:()=>st(null)})})}),Be.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:at?"Ничего не найдено":"закрепите сессию через её меню (правый клик или долгое нажатие) — она останется под рукой из любого проекта"})}),yl.groups.map(N=>a.jsxs(_.Fragment,{children:[sl(N.folder,N.items.length),Ne(N.folder.id)&&N.items.map(ie=>Mt(ie,N.folder))]},N.folder.id)),yl.ungrouped.map(N=>Mt(N))]})]}):Ot==="live"?a.jsxs(a.Fragment,{children:[a.jsx(Sc,{title:"Запущенные",count:Fe.length,open:I("live"),onToggle:()=>At("live")}),I("live")&&a.jsxs(a.Fragment,{children:[Fe.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:at?"Ничего не найдено":"Нет запущенных сессий"})}),Fe.map(N=>zn(N))]})]}):a.jsxs(a.Fragment,{children:[a.jsx(Sc,{title:"Проекты",count:St.length,open:I("workspaces"),onToggle:()=>At("workspaces"),action:{label:"Новая папка проектов",onClick:()=>{st("workspace"),I("workspaces")||At("workspaces")}}}),I("workspaces")&&a.jsxs(a.Fragment,{children:[Nn==="workspace"&&a.jsx("div",{className:"row",children:a.jsx("div",{className:"row__main",children:a.jsx(na,{value:"",placeholder:"Название папки",onCommit:N=>{P("workspace",N),st(null)},onCancel:()=>st(null)})})}),St.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:at?"Ничего не найдено":"Пока ни одного"})}),Le.groups.map(N=>a.jsxs(_.Fragment,{children:[sl(N.folder,N.items.length),Ne(N.folder.id)&&N.items.map(ie=>zt(ie,N.folder))]},N.folder.id)),Le.ungrouped.map(N=>zt(N))]}),o.length>0&&a.jsxs(a.Fragment,{children:[a.jsx(Sc,{title:"Архив проектов",count:Jt.length,open:I("workspacesArchive"),onToggle:()=>At("workspacesArchive"),hint:"проект закрывают вручную; каталог и история сессий остаются на диске и открываются заново отсюда или через «+ Проект»"}),I("workspacesArchive")&&a.jsxs(a.Fragment,{children:[Jt.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:at?"Ничего не найдено":"Пока пусто"})}),kt.groups.map(N=>a.jsxs(_.Fragment,{children:[sl(N.folder,N.items.length),Ne(N.folder.id)&&N.items.map(ie=>tn(ie,N.folder))]},N.folder.id)),kt.ungrouped.map(N=>tn(N))]})]}),C&&a.jsxs(a.Fragment,{children:[a.jsx(Sc,{title:"Сессии",count:Nt.length,open:I("sessions"),onToggle:()=>At("sessions"),action:{label:"Новая папка сессий",onClick:()=>{st("session"),I("sessions")||At("sessions")}}}),I("sessions")&&a.jsxs(a.Fragment,{children:[Nn==="session"&&a.jsx("div",{className:"row",children:a.jsx("div",{className:"row__main",children:a.jsx(na,{value:"",placeholder:"Название папки",onCommit:N=>{P("session",N,C),st(null)},onCancel:()=>st(null)})})}),Nt.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:at?"Ничего не найдено":"Пока ни одной"})}),Tn.groups.map(N=>a.jsxs(_.Fragment,{children:[sl(N.folder,N.items.length),Ne(N.folder.id)&&N.items.map(ie=>yt(ie,N.folder))]},N.folder.id)),Tn.ungrouped.map(N=>yt(N))]}),x.length>0&&a.jsxs(a.Fragment,{children:[a.jsx(Sc,{title:"Архив",count:tl.length,open:I("archive"),onToggle:()=>At("archive"),hint:"сессии без обращения дольше двух суток уезжают сюда сами; ничего не удаляется"}),I("archive")&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:"сюда сами уезжают сессии без обращения дольше двух суток; транскрипт остаётся на диске, ничего не удаляется"})}),tl.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:at?"Ничего не найдено":"Пока пусто"})}),ul.groups.map(N=>a.jsxs(_.Fragment,{children:[sl(N.folder,N.items.length),Ne(N.folder.id)&&N.items.map(ie=>xn(ie,N.folder))]},N.folder.id)),ul.ungrouped.map(N=>xn(N))]})]})]})]})}),a.jsxs("div",{className:"sidebar__foot",children:[a.jsxs("button",{className:"account-btn",title:"Аккаунт Claude",onClick:w,children:[a.jsx("span",{className:Ae!=null&&Ae.loggedIn?"dot dot--on":"dot"}),a.jsx("span",{className:"account-btn__id",children:Ae===null?"Аккаунт":Ae.loggedIn?Ae.email||"Вход выполнен":"Войти в аккаунт"}),(Ae==null?void 0:Ae.plan)&&a.jsx("span",{className:"chip",children:Ae.plan})]}),z&&a.jsxs("button",{className:"account-btn",title:"Доступ с телефона и из браузера",onClick:z,children:[a.jsx("span",{className:V!=null&&V.connected?"dot dot--on":"dot"}),a.jsx("span",{className:"account-btn__id",children:V===null?"Удалённый доступ":V.paired?V.connected?V.name||"Удалённый доступ включён":"Удалённый доступ · нет связи":"Удалённый доступ"}),(V==null?void 0:V.connected)&&V.clients>0&&a.jsx("span",{className:"chip",children:V.clients})]}),a.jsxs("div",{className:"sidebar__foot-row",children:[a.jsx("button",{className:"btn btn--ghost",disabled:!_e,title:"MCP-серверы и плагины",onClick:()=>_e==null?void 0:_e(),children:"Расширения"}),a.jsx("button",{className:"btn btn--ghost",title:"Настройки приложения",onClick:ge,children:"Настройки"})]}),a.jsxs("div",{className:"sidebar__foot-row",children:[a.jsx("button",{className:"btn btn--ghost",onClick:X,children:"+ Проект"}),a.jsx(Wj,{disabled:!C,providers:de,onStart:ue})]})]}),Pt&&a.jsx(Hi,{x:Pt.x,y:Pt.y,items:Xn,note:ia,onClose:jl}),Qt&&a.jsx(Hi,{x:Qt.x,y:Qt.y,items:ts,note:Al,onClose:gn}),xt&&a.jsx(Hi,{x:xt.x,y:xt.y,items:Q,note:he,onClose:El}),On&&a.jsx(Hi,{x:On.x,y:On.y,items:He,note:Zh,onClose:ll}),it&&a.jsx(Hi,{x:it.x,y:it.y,items:_t,note:Zh,onClose:jn})]})}function wc(l,s,r,c){const o=["row"];return c&&o.push("row--foldered"),l&&o.push("row--active"),s&&o.push("row--selected"),r&&o.push("row--antigravity"),o.join(" ")}function Fo(l,s,r=c=>c.folderId){const c=new Map(s.map(m=>[m.id,m])),o=new Map,d=[];for(const m of l){const g=r(m),x=g?c.get(g):void 0;if(!x){d.push(m);continue}const y=o.get(x.id);y?y.push(m):o.set(x.id,[m])}return{groups:[...o.entries()].map(([m,g])=>({folder:c.get(m),items:g})).sort((m,g)=>m.folder.name.localeCompare(g.folder.name,"ru")),ungrouped:d}}function sw(l,s,r){return[...l.flatMap(c=>c.items.map(r)),...s.map(r)]}const aw="\0ungrouped";function iw(l,s,r){const c=new Map;for(const o of l)for(const d of o.items)c.set(r(d),o.folder.id);for(const o of s)c.set(r(o),aw);return c}function Fh(l,s,r,c,o){const d=[...s.map(m=>m.items),r].find(m=>m.some(g=>c(g)===l));if(!d)return null;const h=d.findIndex(m=>c(m)===l);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 Tf(l){const[s,r]=_.useState(null),[c,o]=_.useState(null),d=_.useMemo(()=>sw(l.groups,l.ungrouped,l.itemKey),[l.groups,l.ungrouped,l.itemKey]),h=_.useMemo(()=>iw(l.groups,l.ungrouped,l.itemKey),[l.groups,l.ungrouped,l.itemKey]);function m(){r(null),o(null)}function g(G,Z){l.enabled&&(Z.preventDefault(),Z.currentTarget.setPointerCapture(Z.pointerId),r(G),o(null))}function x(G,Z){var D;if(!s)return;const Y=(D=document.elementFromPoint(G,Z))==null?void 0:D.closest("[data-row-key]"),H=Y==null?void 0:Y.dataset.rowKey;if(!H||H===s||h.get(H)!==h.get(s)){o(null);return}const $=Y.getBoundingClientRect(),B=Z-$.top<$.height/2?"before":"after";o(R=>(R==null?void 0:R.key)===H&&R.position===B?R:{key:H,position:B})}function y(G){x(G.clientX,G.clientY)}function j(){if(s&&c){const G=kf(d,s,c.key,c.position);G&&l.onReorder(l.scope,G,l.workspaceId)}m()}function v(G,Z){if(!l.enabled)return;const Y=Fh(G,l.groups,l.ungrouped,l.itemKey,Z);if(!Y)return;const H=kf(d,G,Y.target,Y.position);H&&l.onReorder(l.scope,H,l.workspaceId)}function E(G,Z){const Y=Fh(G,l.groups,l.ungrouped,l.itemKey,"up"),H=Fh(G,l.groups,l.ungrouped,l.itemKey,"down"),$=[{id:"move-up",label:"Переместить выше",disabled:!Y,onSelect:()=>{if(!Y)return;const B=kf(d,G,Y.target,Y.position);B&&l.onReorder(l.scope,B,l.workspaceId)}},{id:"move-down",label:"Переместить ниже",disabled:!H,onSelect:()=>{if(!H)return;const B=kf(d,G,H.target,H.position);B&&l.onReorder(l.scope,B,l.workspaceId)}}];return Z&&$.push({id:"reset-order",label:"Сбросить порядок",onSelect:()=>l.onReorder(l.scope,null,l.workspaceId)}),$}function k(G){return s===G?" row--dragging":(c==null?void 0:c.key)===G?c.position==="before"?" row--drop-before":" row--drop-after":""}function C(G){return{onPointerDown:Z=>g(G,Z),onPointerMove:y,onPointerUp:j,onPointerCancel:m}}function A(G,Z){!Z.altKey||Z.key!=="ArrowUp"&&Z.key!=="ArrowDown"||(Z.preventDefault(),v(G,Z.key==="ArrowUp"?"up":"down"))}return{dragging:s!==null,dropClass:k,gripHandlers:C,onKeyDown:A,menuItems:E}}function Jo(l){return[...[...l.folders].sort((r,c)=>r.name.localeCompare(c.name,"ru")).map(r=>({id:`folder:${r.id}`,label:`В папку «${r.name}»`,onSelect:()=>{l.ids.forEach(c=>l.assign(c,r.id)),l.onClear()}})),...l.hasFolder?[{id:"folder:none",label:"Без папки",onSelect:()=>{l.ids.forEach(r=>l.assign(r,null)),l.onClear()}}]:[],{id:"folder:new",label:"Новая папка…",onSelect:l.onNewFolder}]}function rw(l){return l.map(s=>({...s,id:`pinned:${s.id}`,label:s.id==="folder:new"?"Новая папка закреплённых…":s.id==="folder:none"?"Без папки закреплённых":s.label}))}function Jh(l){const[s,r]=_.useState([]),c=_.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=l.findIndex(v=>v.id===c.current),j=l.findIndex(v=>v.id===g.id);if(y!==-1&&j!==-1){const[v,E]=y<j?[y,j]:[j,y];r(l.slice(v,E+1).map(k=>k.id));return}}o(),c.current=g.id,x()}function h(m){return s.includes(m.id)?s:(r([m.id]),c.current=m.id,[m.id])}return{selected:s,click:d,targetsFor:h,clear:o}}const cw={display:"flex",alignItems:"center",gap:6,flex:1,minWidth:0,textAlign:"left"},ow={width:22,height:22,borderRadius:6};function Sc({title:l,count:s,open:r,onToggle:c,hint:o,action:d}){const h=r?`Свернуть «${l}»`:`Развернуть «${l}»`;return a.jsxs("div",{className:"sidebar__section",children:[a.jsxs("button",{className:"sidebar__section--btn",style:cw,"aria-expanded":r,title:o?`${h} — ${o}`:h,onClick:c,children:[a.jsx(V_,{open:r}),a.jsx("span",{className:"sidebar__section-name",children:l}),a.jsx("span",{className:"sidebar__count",children:s})]}),d&&a.jsx("button",{className:"theme-btn",style:ow,title:d.label,"aria-label":d.label,onClick:d.onClick,children:a.jsx(xw,{})})]})}const Sb={paddingLeft:22},uw={display:"flex",alignItems:"center",gap:6,width:"100%"},fw={flex:1,minWidth:0,color:"var(--text-2)",fontWeight:500};function dw({folder:l,count:s,open:r,renaming:c,onToggle:o,onStartRename:d,onCommitRename:h,onCancelRename:m,onDelete:g,color:x,onPreviewColor:y,onCommitColor:j,onResetColor:v}){const E=_.useRef(null),k=_.useRef(j);return k.current=j,_.useEffect(()=>{const C=E.current;if(!C)return;const A=()=>k.current(C.value);return C.addEventListener("change",A),()=>C.removeEventListener("change",A)},[c]),c?a.jsx("div",{className:"row",style:Sb,children:a.jsx("div",{className:"row__main",children:a.jsx(na,{value:l.name,placeholder:"Название папки",onCommit:h,onCancel:m})})}):a.jsxs("div",{className:"row",style:Sb,children:[a.jsxs("button",{className:"row__main",style:uw,"aria-expanded":r,title:r?`Свернуть папку «${l.name}»`:`Развернуть папку «${l.name}»`,onClick:o,children:[a.jsx(V_,{open:r}),a.jsx("span",{style:fw,children:l.name}),a.jsx("span",{className:"sidebar__count",children:s})]}),a.jsx("button",{className:"row__edit",title:"Переименовать папку","aria-label":`Переименовать папку «${l.name}»`,onClick:d,children:"✎"}),a.jsxs("label",{className:x?"row__swatch row__swatch--set":"row__swatch",title:`Цвет папки «${l.name}»`,children:[a.jsx("span",{className:"row__swatch-dot",style:x?{background:x}:void 0}),a.jsx("input",{ref:E,type:"color",value:x??hw(),"aria-label":`Цвет папки «${l.name}»`,onChange:C=>y(C.target.value)})]}),l.color&&a.jsx("button",{className:"row__edit",title:"Сбросить цвет папки","aria-label":`Сбросить цвет папки «${l.name}»`,onClick:v,children:"↺"}),a.jsx("button",{className:"row__edit",title:"Удалить папку — содержимое останется, просто станет без папки","aria-label":`Удалить папку «${l.name}»`,onClick:g,children:"✕"})]})}function hw(){const l=getComputedStyle(document.documentElement).getPropertyValue("--folder-default").trim();return/^#[0-9a-f]{6}$/i.test(l)?l.toLowerCase():"#9a978d"}function V_({open:l}){return a.jsx("svg",{className:l?"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 Ef(){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 pw(){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 mw({className:l}){return a.jsxs("svg",{className:l,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 gw(){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 xw(){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 bw(){try{const l=localStorage.getItem(Y_);if(l===null)return["archive","workspacesArchive"];const s=JSON.parse(l);return Array.isArray(s)?s.filter(r=>r==="workspaces"||r==="workspacesArchive"||r==="sessions"||r==="archive"||r==="pinned"||r==="live"):["archive","workspacesArchive"]}catch{return["archive","workspacesArchive"]}}function _w(){try{const l=localStorage.getItem(X_);if(l===null)return[];const s=JSON.parse(l);return Array.isArray(s)?s.filter(r=>typeof r=="string"):[]}catch{return[]}}function yw(){try{const l=localStorage.getItem($_);return l==="pinned"||l==="live"?l:"default"}catch{return"default"}}const Nb={system:"как в системе",light:"светлая",dark:"тёмная"};function vw({mode:l}){const s={viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0};return l==="dark"?a.jsx("svg",{...s,children:a.jsx("path",{d:"M13.2 9.7A5.4 5.4 0 0 1 6.3 2.8a5.6 5.6 0 1 0 6.9 6.9Z"})}):l==="light"?a.jsxs("svg",{...s,children:[a.jsx("circle",{cx:"8",cy:"8",r:"3.1"}),a.jsx("path",{d:"M8 1.4v1.4M8 13.2v1.4M2.4 8H1M15 8h-1.4M4 4l-1-1M13 13l-1-1M12 4l1-1M3 13l1-1"})]}):a.jsxs("svg",{...s,children:[a.jsx("rect",{x:"1.8",y:"2.6",width:"12.4",height:"8.4",rx:"1.4"}),a.jsx("path",{d:"M5.6 13.4h4.8"})]})}function jw(l){const s=ww(l),r=(l.tasks??[]).filter(c=>c.kind==="agent").length;return r>0?`${s} · ${G_(r)}`:s}function ww(l){switch(l.state){case"running":return"работает";case"waiting_permission":return"ждёт разрешения";case"idle":return l.backgroundWork?"работает в фоне":Sw(l.lastTurn);case"starting":return"запускается";case"reconnecting":return"переподключается";case"error":return"ошибка";case"closed":return"на диске"}}function Sw(l){switch(l){case"interrupted":return"прервана";case"stopped":return"остановлена";case"failed":return"оборвалась";case"completed":return"готова";case null:return"ждёт задачу"}}function Nw(l){switch(l.state){case"running":return"running";case"starting":return"starting";case"reconnecting":return"reconnecting";case"waiting_permission":return"waiting";case"idle":return l.backgroundWork?"background":kw(l.lastTurn);case"error":return"error";case"closed":return"closed"}}function kw(l){switch(l){case"interrupted":case"stopped":return"halted";case"failed":return"error";case"completed":return"ready";case null:return"fresh"}}function Ph({session:l,tail:s}){return a.jsxs("span",{className:"row__meta",children:[a.jsxs("span",{className:`row__state row__state--${Nw(l)}`,children:[a.jsx("span",{className:"row__state-dot","aria-hidden":"true"}),jw(l)]})," · ",s]})}function Cf({title:l,pinned:s,provider:r,projectName:c,projectPath:o}){return a.jsxs("span",{className:"row__head",children:[a.jsxs("span",{className:"row__title",children:[s&&a.jsx(mw,{className:"row__pin"}),r==="antigravity"&&a.jsx(Lp,{className:"row__provider"}),l]}),a.jsx("span",{className:"row__project",title:o,children:c})]})}function Tw(l){const s=l.archivedAuto?"сама, по сроку молчания":"убрана вручную";return l.archivedAt?`${new Date(l.archivedAt).toLocaleString()} · ${s}`:s}function Ew(l){return l.archivedAt?`закрыт ${new Date(l.archivedAt).toLocaleString()}`:"закрыт"}const kb=3,Cw=15e5;function Q_(l,s){if(!s||typeof s!="object")return null;const r=s,c=typeof r.file_path=="string"?r.file_path:"";if(!c)return null;if(l==="Write"){if(typeof r.content!="string")return null;const o=Wh(r.content).map(d=>({type:"add",text:d}));return{kind:"create",filePath:c,rows:o,added:o.length,removed:0,note:"файл записывается целиком"}}if(l==="Edit"){if(typeof r.old_string!="string"||typeof r.new_string!="string")return null;const o=Dw(Aw(Wh(r.old_string),Wh(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 Wh(l){if(l==="")return[];const s=l.split(/\r?\n/);return s.length>1&&s[s.length-1]===""&&s.pop(),s}function Aw(l,s){let r=0;for(;r<l.length&&r<s.length&&l[r]===s[r];)r++;let c=l.length,o=s.length;for(;c>r&&o>r&&l[c-1]===s[o-1];)c--,o--;const d=h=>({type:"ctx",text:h});return[...l.slice(0,r).map(d),...Mw(l.slice(r,c),s.slice(r,o)),...l.slice(c).map(d)]}function Mw(l,s){if(l.length===0&&s.length===0)return[];if(l.length===0)return s.map(y=>({type:"add",text:y}));if(s.length===0)return l.map(y=>({type:"del",text:y}));if((l.length+1)*(s.length+1)>Cw)return[...l.map(y=>({type:"del",text:y})),...s.map(y=>({type:"add",text:y}))];const r=l.length,c=s.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]=l[y]===s[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=l[g],j=s[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:l[g++]});for(;x<c;)m.push({type:"add",text:s[x++]});return Rw(m)}function Rw(l){const s=[];let r=[];function c(){s.push(...r.filter(o=>o.type==="del")),s.push(...r.filter(o=>o.type==="add")),r=[]}for(const o of l)o.type==="ctx"?(c(),s.push(o)):r.push(o);return c(),s}function Dw(l){if(!l.some(d=>d.type!=="ctx"))return l;const s=l.map(()=>!1);l.forEach((d,h)=>{if(d.type!=="ctx")for(let m=Math.max(0,h-kb);m<=Math.min(l.length-1,h+kb);m++)s[m]=!0});const r=[];let c=[];function o(){c.length===1?r.push(...c):c.length>1&&r.push({type:"gap",text:`⋯ ${c.length} ${Ow(c.length)} без изменений`}),c=[]}return l.forEach((d,h)=>{s[h]?(o(),r.push(d)):c.push(d)}),o(),r}function Ow(l){const s=l%100;if(s>=11&&s<=14)return"строк";switch(l%10){case 1:return"строка";case 2:case 3:case 4:return"строки";default:return"строк"}}async function sa(l){try{return await navigator.clipboard.writeText(l),!0}catch{}const s=document.createElement("textarea");s.value=l,s.setAttribute("readonly",""),s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s);try{return s.select(),document.execCommand("copy")}catch{return!1}finally{s.remove()}}async function xp(){try{return await navigator.clipboard.readText()}catch{return null}}const zp=1600,Sr="Копировать",Mc="Скопировано";function qc({text:l,hint:s,className:r}){const[c,o]=_.useState(!1);return _.useEffect(()=>{if(!c)return;const d=setTimeout(()=>o(!1),zp);return()=>clearTimeout(d)},[c]),_.useEffect(()=>o(!1),[l]),a.jsx("button",{type:"button",className:"copybtn"+(c?" copybtn--done":"")+(r?` ${r}`:""),"aria-label":c?Mc:`${Sr} ${s}`,title:c?Mc:`${Sr} ${s}`,onClick:()=>{sa(l).then(d=>{d&&o(!0)})},children:c?Mc:Sr})}function Up({diff:l}){return a.jsxs("div",{className:"diff",children:[a.jsxs("div",{className:"diff__head",children:[a.jsx("span",{className:"diff__path",title:l.filePath,children:l.filePath}),a.jsxs("span",{className:"diff__stat",children:[l.added>0&&a.jsxs("span",{className:"diff__stat--add",children:["+",l.added]}),l.removed>0&&a.jsxs("span",{className:"diff__stat--del",children:["−",l.removed]})]})]}),l.note&&a.jsx("div",{className:"diff__note",children:l.note}),a.jsx("div",{className:"diff__body",children:l.rows.length===0?a.jsx("div",{className:"diff__row diff__row--gap",children:a.jsx("span",{className:"diff__text",children:"пустое содержимое"})}):l.rows.map((s,r)=>a.jsxs("div",{className:`diff__row diff__row--${s.type}`,children:[a.jsx("span",{className:"diff__mark","aria-hidden":"true",children:s.type==="add"?"+":s.type==="del"?"−":""}),a.jsx("span",{className:"diff__text",children:s.text===""?" ":s.text})]},r))})]})}function Lw({waiting:l}){const[s,r]=_.useState(0);return _.useEffect(()=>{const c=window.setInterval(()=>r(o=>o+1),1e3);return()=>window.clearInterval(c)},[]),a.jsxs("div",{className:l?"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:l?"ждёт разрешения":"думает"}),!l&&a.jsxs("span",{className:"work__time",children:[s," с"]})]})}function Hp({items:l,busy:s,waiting:r,history:c=[],historyHasMore:o=!1,historyLoading:d=!1,onLoadHistory:h,sessionId:m,onEditMessage:g,empty:x="Сессия пуста. Опишите задачу — Claude Code работает в каталоге проекта с полным набором инструментов."}){const y=_.useRef(null),j=_.useRef(null),v=_.useRef(!0),E=_.useRef(null),k=_.useRef(null),C=_.useRef(!1);_.useEffect(()=>{v.current=!0,E.current=null,C.current=!1,k.current!==null&&(clearTimeout(k.current),k.current=null)},[m]),_.useEffect(()=>{const H=y.current,$=j.current;if(!H||!$)return;function B(O){!H||O===H.scrollTop||(C.current=!0,H.scrollTop=O)}function D(){if(!H)return;const O=E.current;if(O){const ee=Eb(H,O.id);if(ee){const P=ee.getBoundingClientRect().top-H.getBoundingClientRect().top;B(H.scrollTop+(P-O.top))}k.current!==null&&clearTimeout(k.current),k.current=setTimeout(()=>{E.current=null},500);return}v.current&&B(H.scrollHeight)}const R=new ResizeObserver(D);return R.observe($),()=>{R.disconnect(),k.current!==null&&clearTimeout(k.current)}},[]);function A(){const H=y.current;if(H){if(C.current){C.current=!1;return}v.current=H.scrollHeight-H.scrollTop-H.clientHeight<80}}function G(){if(d)return;const H=y.current,$=c[0];if(H&&$){const B=Eb(H,$.id);B&&(E.current={id:$.id,top:B.getBoundingClientRect().top-H.getBoundingClientRect().top})}h==null||h()}let Z=0;function Y(H){return H.kind==="user"?Z++:-1}return a.jsx("div",{className:"transcript",ref:y,onScroll:A,children:a.jsxs("div",{className:"stream",ref:j,children:[o&&a.jsx("button",{type:"button",className:"transcript__more",onClick:G,disabled:d,children:d?"Загружаем…":"Показать более раннее"}),c.map(H=>a.jsx(Tb,{item:H,userIndex:Y(H),onEditMessage:g},H.id)),c.length>0&&l.length>0&&a.jsx("div",{className:"transcript__divider",children:a.jsx("span",{children:"дальше — сессия открыта заново"})}),c.length===0&&l.length===0&&a.jsx("p",{className:"empty",children:x}),l.map(H=>a.jsx(Tb,{item:H,userIndex:Y(H),onEditMessage:g},H.id)),s&&a.jsx(Lw,{waiting:r})]})})}function Tb({item:l,userIndex:s,onEditMessage:r}){switch(l.kind){case"user":return a.jsx(Uw,{item:l,userIndex:s,onEditMessage:r});case"assistant":return a.jsxs("div",{className:"msg--assistant","data-item-id":l.id,children:[a.jsx(Hw,{text:l.text}),l.streaming&&a.jsx("span",{className:"caret"}),l.text.trim()!==""&&a.jsx("div",{className:"msg--assistant__foot",children:a.jsx(qc,{text:l.text,hint:"ответ целиком"})})]});case"thinking":return a.jsx("div",{className:"thinking","data-item-id":l.id,children:l.text});case"tool":return a.jsx(Iw,{item:l});case"result":return a.jsxs("div",{className:"result-line","data-item-id":l.id,children:[a.jsx("span",{children:l.isError?"✗ "+l.subtype:"✓ готово"}),a.jsxs("span",{children:[(l.durationMs/1e3).toFixed(1)," с"]}),l.costUsd!==null&&a.jsxs("span",{children:["$",l.costUsd.toFixed(4)]}),a.jsxs("span",{children:["↑",Ab(l.inputTokens)," ↓",Ab(l.outputTokens)]})]});case"notice":return a.jsx("div",{className:l.tone==="error"?"notice notice--error":"notice","data-item-id":l.id,children:l.text})}}const zw=500;function Uw({item:l,userIndex:s,onEditMessage:r}){const[c,o]=_.useState(null),[d,h]=_.useState(!1),[m,g]=_.useState(l.text),x=_.useRef(null),y=_.useRef(!1),j=Ff("(max-width: 860px)"),v=_.useRef(null);function E(R,O){o({x:R,y:O})}function k(R){R.preventDefault(),E(R.clientX,R.clientY)}function C(R){const O=R.touches[0];if(!O)return;const ee={timer:0,x:O.clientX,y:O.clientY,fired:!1};ee.timer=window.setTimeout(()=>{ee.fired=!0,E(ee.x,ee.y)},zw),v.current=ee}function A(R){const O=v.current,ee=R.touches[0];!O||!ee||Math.hypot(ee.clientX-O.x,ee.clientY-O.y)>10&&(window.clearTimeout(O.timer),v.current=null)}function G(R){const O=v.current;O&&(window.clearTimeout(O.timer),O.fired&&R.preventDefault())}function Z(){g(l.text),h(!0)}function Y(){h(!1)}function H(){const R=m.trim();if(R===""&&!(l.images&&l.images.length>0))return;const O=r==null?void 0:r(s,R,l.images);if(O instanceof Promise){if(y.current)return;y.current=!0,O.then(ee=>{y.current=!1,ee&&h(!1)},()=>{y.current=!1});return}O!==!1&&h(!1)}_.useEffect(()=>{const R=x.current;!R||!d||(R.style.height="auto",R.style.height=`${R.scrollHeight}px`)},[m,d]),_.useEffect(()=>{if(!d)return;const R=x.current;R&&(R.focus(),R.setSelectionRange(R.value.length,R.value.length))},[d]);function $(R){if(R.key==="Escape"){R.preventDefault(),R.stopPropagation(),Y();return}R.key==="Enter"&&!R.shiftKey&&!j&&(R.preventDefault(),H())}const B=l.images&&l.images.length>0&&a.jsx("div",{className:"msg--user__images",children:l.images.map((R,O)=>a.jsx("img",{className:"msg--user__image",src:`data:${R.mediaType};base64,${R.data}`,alt:"Вложение"},O))});if(d){const R=m.trim()!==""||!!(l.images&&l.images.length>0);return a.jsxs("div",{className:"msg--user msg--user--editing","data-item-id":l.id,children:[B,a.jsxs("div",{className:"msg--user__edit",children:[a.jsx("textarea",{ref:x,className:"msg--user__edit-field",value:m,onChange:O=>g(O.target.value),onKeyDown:$,rows:1}),a.jsxs("div",{className:"msg--user__edit-actions",children:[a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:Y,children:"Отмена"}),a.jsx("button",{type:"button",className:"btn btn--sm btn--primary",onClick:H,disabled:!R,children:"Сохранить"})]})]})]})}const D=[{id:"copy",label:"Копировать",onSelect:()=>void sa(l.text)},...r?[{id:"edit",label:"Изменить",onSelect:Z}]:[]];return a.jsxs("div",{className:"msg--user","data-item-id":l.id,onContextMenu:k,onTouchStart:C,onTouchMove:A,onTouchEnd:G,onTouchCancel:G,children:[B,l.text,c&&a.jsx(Hi,{x:c.x,y:c.y,items:D,onClose:()=>o(null)})]})}function Eb(l,s){const r=l.querySelectorAll("[data-item-id]");for(const c of r)if(c.dataset.itemId===s)return c;return null}function Hw({text:l}){const[s,r]=_.useState(""),c=_.useRef([]);_.useEffect(()=>{let d=!1;return Wf(l).then(h=>{d||r(Bw(h))}),()=>{d=!0}},[l]),_.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!==""&&sa(m).then(y=>{if(!y)return;h.textContent=Mc,h.setAttribute("aria-label",Mc),h.classList.add("copybtn--done");const j=window.setTimeout(()=>{h.isConnected&&(h.textContent=Sr,h.setAttribute("aria-label",bp),h.classList.remove("copybtn--done"))},zp);c.current.push(j)})}return a.jsx("div",{className:"markdown-preview msg--assistant__body",onClick:o,dangerouslySetInnerHTML:{__html:s}})}const bp=`${Sr} блок кода`;function Bw(l){if(!l.includes("<pre"))return l;const s=new DOMParser().parseFromString(l,"text/html");for(const r of s.body.querySelectorAll("pre")){const c=s.createElement("div");c.className="codeblock",r.replaceWith(c),c.append(r);const o=s.createElement("button");o.type="button",o.className="copybtn codeblock__copy",o.setAttribute("aria-label",bp),o.title=bp,o.textContent=Sr,c.append(o)}return s.body.innerHTML}function Iw({item:l}){const[s,r]=_.useState(!1),c=l.result===null,o=Q_(l.name,l.input),d=l.name==="AskUserQuestion"?Yw(l.input):null;return a.jsxs("div",{className:"tool"+(l.isError?" tool--error":"")+(l.awaitingPermission?" tool--wait":""),"data-item-id":l.id,children:[a.jsxs("button",{className:"tool__head",onClick:()=>r(h=>!h),children:[a.jsx("span",{className:"tool__name",children:l.name}),a.jsx("span",{className:"tool__arg",children:d?Gw(d):qw(l.input)}),a.jsx("span",{className:"tool__status",children:c?"…":l.isError?"ошибка":s?"▴":"▾"})]}),s&&a.jsxs("div",{className:"tool__body",children:[d?a.jsx($w,{questions:d,answers:l.answers}):o?a.jsx(Up,{diff:o}):a.jsx(Cb,{text:JSON.stringify(l.input,null,2),hint:"аргументы вызова"}),l.result!==null&&(!d||l.isError)&&a.jsx(Cb,{text:l.result,hint:"результат вызова",style:{marginTop:10}})]})]})}function Cb({text:l,hint:s,style:r}){return a.jsxs("div",{className:"codeblock",style:r,children:[a.jsx("pre",{className:"code",children:l}),a.jsx(qc,{text:l,hint:s,className:"codeblock__copy"})]})}function qw(l){if(!l||typeof l!="object")return"";const s=l;for(const r of["file_path","command","pattern","path","url","prompt"]){const c=s[r];if(typeof c=="string")return c.replace(/\s+/g," ").slice(0,160)}return JSON.stringify(s).slice(0,160)}function Gw(l){var r;const s=l.map(c=>c.header).filter(c=>c.length>0);return s.length===l.length?s.join(" · "):((r=l[0])==null?void 0:r.question.replace(/\s+/g," ").slice(0,160))??""}function Yw(l){if(typeof l!="object"||l===null)return null;const s=l.questions;if(!Array.isArray(s)||s.length===0)return null;const r=[];for(const c of s){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 $w({questions:l,answers:s}){return a.jsx("div",{className:"tool__questions",children:l.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:s!=null&&s[r.question]?a.jsx("span",{className:"tool__answer-value",children:s[r.question]}):a.jsx("span",{className:"tool__answer-empty",children:"не отвечено"})})]},c))})}function Ab(l){return l>=1e3?`${(l/1e3).toFixed(1)}k`:String(l)}const Xw="ccv.dictation.lang",Mb="ru-RU";function Vw(l){try{return Function.prototype.toString.call(l).includes("[native code]")}catch{return!1}}function Rb(){const l=window,s=[l.SpeechRecognition,l.webkitSpeechRecognition].filter(c=>typeof c=="function"),r=s.find(Vw);return!r&&s.length>0&&ks("распознавание подменено: родной реализации в странице нет"),r??s[0]??null}function K_(){var l;try{return((l=localStorage.getItem(Xw))==null?void 0:l.trim())||Mb}catch{return Mb}}function ks(l,s){s===void 0?console.debug(`[dictation] ${l}`):console.debug(`[dictation] ${l}`,s)}const Qw=3,Kw=400,Zw=5,Fw=250,Jw=2e3,Pw=2e4;async function Ww(){try{return(await navigator.permissions.query({name:"microphone"})).state==="granted"}catch{return!1}}const eS={"not-allowed":"Браузер не дал доступ к микрофону","service-not-allowed":"Браузер не дал доступ к микрофону","audio-capture":"Микрофон не найден",network:"Сервис распознавания недоступен","language-not-supported":`Распознавание не знает языка ${K_()}`};function tS(l){const[s]=_.useState(()=>Rb()!==null),[r,c]=_.useState(!1),[o,d]=_.useState(null),h=_.useRef(null),m=_.useRef(!1),g=_.useRef(!1),x=_.useRef(l),y=_.useRef({openedAt:0,audio:!1,heard:!1,everHeard:!1,silent:0,dead:0,lastError:"",warned:!1}),j=_.useRef(null),v=_.useRef(!1),E=_.useRef(null),k=_.useCallback(()=>{E.current&&clearTimeout(E.current),E.current=null},[]),C=_.useCallback(()=>{k();const H=async $=>{if(E.current=null,!(!m.current||v.current)){if(!$&&!await Ww()){if(ks("ждём ответа на запрос доступа к микрофону"),!m.current||v.current)return;E.current=setTimeout(()=>void H(!0),Pw);return}ks("движок не ответил на start()"),m.current=!1,c(!1),d("Распознавание не отвечает — проверьте расширения браузера и доступ к микрофону")}};E.current=setTimeout(()=>void H(!1),Jw)},[k]);_.useEffect(()=>{x.current=l}),_.useEffect(()=>{const H=Rb();if(!H)return;const $=new H;return $.lang=K_(),$.continuous=!0,$.interimResults=!0,$.onstart=()=>{ks("сессия открыта"),v.current=!0,k(),c(!0)},$.onaudiostart=()=>{ks("пошёл звук с микрофона"),y.current.audio=!0},$.onresult=B=>{var ee;if(g.current)return;let D="",R="";for(let P=B.resultIndex;P<B.results.length;P++){const ae=B.results[P];if(!ae)continue;const be=((ee=ae[0])==null?void 0:ee.transcript)??"";ae.isFinal?D+=be:R+=be}const O=y.current;O.heard=!0,O.everHeard=!0,ks("распознано",{final:D,interim:R}),x.current(D,R)},$.onerror=B=>{y.current.lastError=B.error,ks("ошибка движка",B.error),!(B.error==="no-speech"||B.error==="aborted")&&(m.current=!1,c(!1),d(eS[B.error]??`Распознавание не работает: ${B.error}`))},$.onend=()=>{g.current=!1,v.current=!1;const B=y.current,D=Date.now()-B.openedAt;if(ks("сессия закрыта",{мс:D,звук:B.audio,слова:B.heard,ошибка:B.lastError||null}),!m.current){c(!1);return}if(B.dead=!B.audio&&D<Kw?B.dead+1:0,B.dead>=Zw){m.current=!1,c(!1),d(B.lastError?`Распознавание не работает: ${B.lastError}`:"Распознавание закрывается сразу после запуска — проверьте доступ к микрофону в настройках сайта");return}B.silent=B.heard?0:B.silent+1,!B.everHeard&&!B.warned&&B.silent>=Qw&&(B.warned=!0,d(B.audio?"Микрофон слушает, но речь не распознаётся — проверьте язык диктовки и уровень звука":"С микрофона не идёт звук — проверьте устройство ввода в настройках сайта в браузере")),j.current=setTimeout(()=>{if(j.current=null,!!m.current){B.openedAt=Date.now(),B.audio=!1,B.heard=!1,B.lastError="",C();try{$.start()}catch{}}},Fw)},h.current=$,()=>{m.current=!1,j.current&&clearTimeout(j.current),j.current=null,k(),$.onend=null,$.onresult=null,$.onerror=null,$.onstart=null,$.onaudiostart=null,$.abort(),h.current=null}},[]);const A=_.useCallback(()=>{var H;if(m.current){if(m.current=!1,ks("выключение микрофона"),j.current&&clearTimeout(j.current),j.current=null,k(),!v.current){c(!1);return}(H=h.current)==null||H.stop()}},[]),G=_.useCallback(()=>{const H=h.current;if(H){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),ks("включение микрофона",{язык:H.lang}),C();try{H.start()}catch($){ks("start() не прошёл",$)}}},[C]),Z=_.useCallback(()=>{m.current?A():G()},[G,A]),Y=_.useCallback(()=>{var H;m.current&&v.current&&(g.current=!0,(H=h.current)==null||H.abort())},[]);return{supported:s,listening:r,error:o,toggle:Z,stop:A,drop:Y}}const nS="(max-width: 860px)",Db=/^\/(\S*)$/,lS=new Set(["model","permissions"]);function sS(l){return lS.has(l.name)||l.name.startsWith("__")}const aS=new Set(["clear","rename"]),Ob=/(?:^|\s)@([^\s@]*)$/,iS=200,rS=100,cS=190,oS=5,uS=20*1024*1024,fS=1568,dS=.85;let Lb=0;async function hS(l){var j,v;if(!l.type.startsWith("image/")||l.size>uS)return null;const s=await pS(l);if(!s)return null;const{width:r,height:c}=s;if(r<=0||c<=0)return null;const o=Math.min(1,fS/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(s.image,0,0,d.width,d.height),(v=(j=s.image).close)==null||v.call(j);const m=l.type==="image/png",g=m?"image/png":"image/jpeg",x=d.toDataURL(g,m?void 0:dS),y=x.slice(x.indexOf(",")+1);return y?(Lb+=1,{id:`att${Lb}`,mediaType:g,data:y,previewUrl:x}):null}async function pS(l){if(typeof createImageBitmap=="function")try{const s=await createImageBitmap(l);return{image:s,width:s.width,height:s.height}}catch{}return new Promise(s=>{const r=URL.createObjectURL(l),c=new Image;c.onload=()=>{URL.revokeObjectURL(r),s({image:c,width:c.naturalWidth,height:c.naturalHeight})},c.onerror=()=>{URL.revokeObjectURL(r),s(null)},c.src=r})}function Z_({disabled:l,busy:s,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:E,onSend:k,onInterrupt:C,onEscape:A}){var At;const G=Ff(nS),[Z,Y]=_.useState(()=>m?Bh(m):""),[H,$]=_.useState(!1),[B,D]=_.useState(0),R=_.useRef(null),O=_.useRef(null),ee=_.useRef(!1),P=_.useRef(null),[ae,be]=_.useState(()=>m?Bh(m).length:0),[Ee,je]=_.useState([]),X=_.useRef(null),ue=_.useCallback(I=>{!y||I.length===0||Promise.all(I.map(hS)).then(oe=>{const Ne=oe.filter(Le=>Le!==null);Ne.length!==0&&je(Le=>[...Le,...Ne].slice(0,oS))})},[y]);function de(I){je(oe=>oe.filter(Ne=>Ne.id!==I))}function _e(I){var Le;if(!y)return;const oe=(Le=I.clipboardData)==null?void 0:Le.items;if(!oe)return;const Ne=[];for(const kt of oe){if(!kt.type.startsWith("image/"))continue;const Tn=kt.getAsFile();Tn&&Ne.push(Tn)}Ne.length!==0&&(I.preventDefault(),ue(Ne))}function Ae(I){const oe=I.target.files?Array.from(I.target.files):[];I.target.value="",ue(oe)}_.useEffect(()=>{y||je([])},[y]);const[w,V]=_.useState([]),[z,ge]=_.useState(-1),ve=_.useRef(""),[Re,Oe]=_.useState(""),Ue=tS(_.useCallback((I,oe)=>{I&&Y(Ne=>ep(Ne,I)),Oe(oe.trim())},[])),qe=Re?ep(Z,Re):Z;_.useEffect(()=>{Ue.listening||Re===""||(Y(I=>ep(I,Re)),Oe(""))},[Ue.listening,Re]),_.useEffect(()=>{var I;x&&((I=R.current)==null||I.focus())},[x]);const rn=_.useRef(new Map),Ve=_.useRef(new Map),Ft=_.useRef(m),ut=_.useRef({text:Z,caret:ae});ut.current={text:Z,caret:ae};const ht=_.useCallback((I,oe,Ne)=>{oe===""?(rn.current.delete(I),Ve.current.delete(I)):(rn.current.set(I,oe),Ve.current.set(I,Ne)),u_(I,oe)},[]),Ge=Ue.drop;_.useLayoutEffect(()=>{const I=Ft.current;if(I===m)return;Ft.current=m,I&&ht(I,ut.current.text,ut.current.caret);const oe=m?rn.current.get(m)??Bh(m):"",Ne=m?Ve.current.get(m):void 0,Le=Math.min(Ne??oe.length,oe.length);Y(oe),be(Le),P.current=[Le,Le],Oe(""),D(0),$(!1),ge(-1),ve.current="",je([]),Ge()},[m,ht,Ge]),_.useEffect(()=>{m&&ht(m,Z,ae)},[m,Z,ae,ht]);const cn=l?"Выберите сессию":j?"Нет VPN — отправка остановлена":h??"Опишите задачу… («/» — команды, «@» — файлы)",Nn=_.useRef(0),st=_.useCallback(I=>{const oe=parseFloat(getComputedStyle(I).maxHeight),Ne=Number.isFinite(oe)&&oe>0?oe:cS;I.style.height="auto";const Le=I.scrollHeight;I.style.height=`${Math.min(Le,Ne)}px`,I.style.overflowY=Le>Ne?"auto":"hidden"},[]);_.useEffect(()=>{const I=R.current;I&&st(I)},[qe,cn,l,st]),_.useLayoutEffect(()=>{const I=R.current,oe=P.current;!I||!oe||(P.current=null,I.setSelectionRange(oe[0],oe[1]))}),_.useEffect(()=>{const I=R.current;if(!I)return;const oe=new ResizeObserver(([Ne])=>{const Le=Ne==null?void 0:Ne.contentRect.width;Le===void 0||Math.abs(Le-Nn.current)<1||(Nn.current=Le,st(I))});return oe.observe(I),()=>oe.disconnect()},[st]);const kn=Ue.stop;_.useEffect(()=>{l&&kn()},[l,kn]);const Wn=_.useMemo(()=>Ue.error?{ok:!1,message:Ue.error}:null,[Ue.error]),on=_.useMemo(()=>{var Ne;const I=(Ne=Db.exec(Z))==null?void 0:Ne[1];if(I===void 0)return[];const oe=I.toLowerCase();return r.filter(Le=>!sS(Le)&&tp(Le,oe)<F_).sort((Le,kt)=>tp(Le,oe)-tp(kt,oe))},[Z,r]),el=!H&&on.length>0,qt=Math.min(B,on.length-1),tt=H?null:((At=Ob.exec(qe.slice(0,ae)))==null?void 0:At[1])??null,Ot=_.useRef(v);Ot.current=v,_.useEffect(()=>{if(tt===null||tt===""||tt.endsWith("/")){Ot.current(tt);return}const I=setTimeout(()=>Ot.current(tt),iS);return()=>clearTimeout(I)},[tt]);const Yn=tt!==null&&(o==null?void 0:o.query)===tt,Ct=Yn?o.entries:[],nt=tt!==null,at=nt&&!Yn,pn=Math.min(B,Math.max(Ct.length-1,0));_.useEffect(()=>{var oe,Ne;if(!el&&!nt)return;const I=el?qt:pn;(Ne=(oe=O.current)==null?void 0:oe.children[I])==null||Ne.scrollIntoView({block:"nearest"})},[el,nt,qt,pn]);function yn(I,oe){var Ne;Y(I),be(oe),P.current=[oe,oe],D(0),$(!1),Re!==""&&(Oe(""),Ue.drop()),(Ne=R.current)==null||Ne.focus()}function Zn(){Y(""),Oe(""),D(0),be(0),$(!1),ge(-1),ve.current="",je([]),Ue.drop(),m&&ht(m,"",0)}function en(I){const oe=I.trim();if(oe===""&&Ee.length===0||l||j||ee.current)return;const Ne=k(oe,Ee.length>0?Ee.map(Le=>({mediaType:Le.mediaType,data:Le.data})):void 0);if(Ne instanceof Promise){ee.current=!0,Ne.then(Le=>{ee.current=!1,Le&&St(oe)},()=>{ee.current=!1});return}Ne!==!1&&St(oe)}function St(I){I!==""&&V(oe=>[I,...oe.filter(Ne=>Ne!==I)].slice(0,rS)),Zn()}function Jt(I){if(I<-1||I>=w.length)return;z===-1&&(ve.current=Z);const oe=I===-1?ve.current:w[I]??"";ge(I),yn(oe,oe.length)}function Nt(){var Le;const I=((Le=R.current)==null?void 0:Le.selectionStart)??qe.length,Ne=`${I>0&&!/\s$/.test(qe.slice(0,I))?" ":""}@`;yn(qe.slice(0,I)+Ne+qe.slice(I),I+Ne.length)}function tl(I){var kt;const oe=(kt=Ob.exec(qe.slice(0,ae)))==null?void 0:kt[1];if(oe===void 0)return;const Ne=ae-oe.length-1,Le=I.kind==="dir"?`@${I.path}/`:`@${I.path} `;yn(qe.slice(0,Ne)+Le+qe.slice(ae),Ne+Le.length)}function le(){var oe;if(j)return;const I=(oe=Db.exec(qe.trim()))==null?void 0:oe[1];if(I&&E(I)){Zn();return}en(qe)}function me(I,oe){Y(I),be(oe),D(0),$(!1),ge(-1),Re!==""&&(Oe(""),Ue.drop())}function Be(I){var Le;const oe=aS.has(I.name)?c:null,Ne=`/${I.name} `;Y(Ne+(oe??"")),be(Ne.length+((oe==null?void 0:oe.length)??0)),oe&&(P.current=[Ne.length,Ne.length+oe.length]),D(0),(Le=R.current)==null||Le.focus()}function Fe(I){if(E(I.name)){Y(""),D(0),$(!1);return}I.argumentHint?Be(I):en(`/${I.name}`)}function Ie(I){if(el){if(I.key==="ArrowDown")return I.preventDefault(),D(oe=>(Math.min(oe,on.length-1)+1)%on.length);if(I.key==="ArrowUp"){I.preventDefault();const oe=on.length-1;return D(Ne=>(Math.min(Ne,oe)+oe)%on.length)}if(I.key==="Enter"&&!I.shiftKey){I.preventDefault();const oe=on[qt];oe&&Fe(oe);return}if(I.key==="Tab"){I.preventDefault();const oe=on[qt];oe&&Be(oe);return}if(I.key==="Escape"){I.preventDefault(),I.stopPropagation(),$(!0);return}}if(nt){if(I.key==="ArrowDown"&&Ct.length>0)return I.preventDefault(),D(oe=>(Math.min(oe,Ct.length-1)+1)%Ct.length);if(I.key==="ArrowUp"&&Ct.length>0){I.preventDefault();const oe=Ct.length-1;return D(Ne=>(Math.min(Ne,oe)+oe)%Ct.length)}if(I.key==="Enter"&&!I.shiftKey||I.key==="Tab"){const oe=Ct[pn];if(oe){I.preventDefault(),tl(oe);return}if(I.key==="Tab")return}if(I.key==="Escape"){I.preventDefault(),I.stopPropagation(),$(!0);return}}if((I.key==="ArrowUp"||I.key==="ArrowDown")&&!I.shiftKey){const oe=I.currentTarget,Ne=oe.selectionStart;if(oe.selectionEnd===Ne){const kt=I.key==="ArrowUp"?z+1:z-1;kt>=-1&&kt<w.length&&requestAnimationFrame(()=>{oe.selectionStart===Ne&&oe.selectionEnd===Ne&&Jt(kt)})}}if(I.key==="Escape"&&A){I.preventDefault(),I.stopPropagation(),A();return}I.key==="Enter"&&!I.shiftKey&&!G&&(I.preventDefault(),le())}return a.jsx("div",{className:d?`composer ${d}`:"composer",children:a.jsxs("div",{className:"composer__inner",children:[a.jsx(Tr,{result:Wn}),nt&&!el&&a.jsxs("div",{className:"cmdmenu",role:"listbox",ref:O,children:[Ct.map((I,oe)=>a.jsxs("button",{role:"option","aria-selected":oe===pn,className:oe===pn?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>D(oe),onMouseDown:Ne=>{Ne.preventDefault(),tl(I)},children:[a.jsxs("span",{className:"cmdmenu__name",children:[I.name,I.kind==="dir"?"/":""]}),a.jsx("span",{className:"cmdmenu__desc",children:I.path}),I.ignored&&a.jsx("span",{className:"cmdmenu__tag",children:"git-ignore"})]},I.path)),Ct.length===0&&a.jsx("div",{className:"cmdmenu__empty",children:at?"ищем…":tt?"Ничего не нашлось":"Наберите имя файла или каталога"})]}),el&&a.jsx("div",{className:"cmdmenu",role:"listbox",ref:O,children:on.map((I,oe)=>a.jsxs("button",{role:"option","aria-selected":oe===qt,className:oe===qt?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>D(oe),onMouseDown:Ne=>{Ne.preventDefault(),Fe(I)},children:[a.jsxs("span",{className:"cmdmenu__name",children:["/",I.name]}),I.argumentHint&&a.jsx("span",{className:"cmdmenu__hint",children:I.argumentHint}),a.jsx("span",{className:"cmdmenu__desc",children:I.description})]},I.name))}),Ee.length>0&&a.jsx("div",{className:"composer__attachments",children:Ee.map(I=>a.jsxs("div",{className:"composer__thumb",children:[a.jsx("img",{src:I.previewUrl,alt:"Вложение"}),a.jsx("button",{type:"button",className:"composer__thumb-remove","aria-label":"Удалить вложение",onClick:()=>de(I.id),children:a.jsx(yS,{})})]},I.id))}),a.jsxs("div",{className:"composer__field",children:[a.jsx("button",{type:"button",className:"addbtn",title:"Добавить контекст — файл проекта («@»)","aria-label":"Добавить контекст",disabled:l,onClick:Nt,children:a.jsx(xS,{})}),y&&a.jsxs(a.Fragment,{children:[a.jsx("input",{ref:X,type:"file",accept:"image/*",multiple:!0,className:"composer__fileinput",tabIndex:-1,"aria-hidden":"true",onChange:Ae}),a.jsx("button",{type:"button",className:"attachbtn",title:"Прикрепить изображение","aria-label":"Прикрепить изображение",disabled:l,onClick:()=>{var I;return(I=X.current)==null?void 0:I.click()},children:a.jsx(_S,{})})]}),a.jsx("textarea",{ref:R,value:qe,disabled:l,placeholder:cn,onChange:I=>me(I.target.value,I.target.selectionStart),onSelect:I=>be(I.currentTarget.selectionStart),onKeyDown:Ie,onPaste:_e}),Ue.supported&&a.jsx("button",{type:"button",className:Ue.listening?"micbtn is-on":"micbtn",title:Ue.listening?"Остановить диктовку":"Продиктовать промпт","aria-label":Ue.listening?"Остановить диктовку":"Продиктовать промпт","aria-pressed":Ue.listening,disabled:l,onClick:Ue.toggle,children:a.jsx(vS,{on:Ue.listening})}),s?a.jsx("button",{className:"btn",onClick:C,title:"Прервать (Esc)",children:"Стоп"}):a.jsxs("button",{className:"btn btn--primary sendbtn",onClick:le,disabled:l||j||qe.trim()===""&&Ee.length===0,"aria-label":g,title:j?"Нет VPN — отправка остановлена":g,children:[a.jsx("span",{className:"sendbtn__label",children:g}),a.jsx(bS,{})]})]})]})})}function ep(l,s){const r=s.trim();if(r==="")return l;const c=_p(r).slice(mS(l,r)).join(" ");return c===""?l:l===""||/\s$/.test(l)?l+c:`${l} ${c}`}function mS(l,s){const r=_p(l),c=_p(s);for(let o=Math.min(r.length,c.length);o>0;o--)if(r.slice(r.length-o).every((d,h)=>gS(d,c[h]??"")))return o;return 0}function _p(l){return l.split(/\s+/).filter(s=>s!=="")}function gS(l,s){const r=c=>c.toLowerCase().replace(/[.,!?;:…]+$/u,"");return r(l)===r(s)}function xS(){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 bS(){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 _S(){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 yS(){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 vS({on:l}){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:l?"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 F_=4;function tp(l,s){const r=l.name.toLowerCase();return r===s?0:r.startsWith(s)?1:l.aliases.some(c=>c.toLowerCase().startsWith(s))?2:r.includes(s)?3:F_}function jS({request:l,plan:s,queued:r,collapsed:c,onCollapse:o,onAccept:d,onDecline:h}){const[m,g]=_.useState(s),[x,y]=_.useState("preview");_.useEffect(()=>{g(s),y("preview")},[l.requestId,s]);const j=m.trim().length>0;function v(){j&&d(l.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(J_,{})}),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(Bp,{onClick:o})]}),a.jsxs("div",{className:"plansheet__body",children:[l.reason&&a.jsx("p",{className:"plansheet__reason",children:l.reason}),a.jsx("div",{className:"plansheet__content",children:x==="preview"?a.jsx(wS,{text:m}):a.jsx("textarea",{className:"plansheet__source",value:m,onChange:E=>g(E.target.value),spellCheck:!1,"aria-label":"Текст плана — можно отредактировать перед тем, как согласиться",autoFocus:!0})})]}),a.jsxs("div",{className:"plansheet__actions",children:[a.jsx("button",{className:"btn",onClick:()=>h(l.requestId),children:"Доработать"}),a.jsx("button",{className:"btn btn--ok",disabled:!j,autoFocus:!0,onClick:v,children:"Одобрить план"})]})]})})}function wS({text:l}){const[s,r]=_.useState("");return _.useEffect(()=>{let c=!1;return Wf(l).then(o=>{c||r(o)}),()=>{c=!0}},[l]),a.jsx("div",{className:"markdown-preview plansheet__preview",dangerouslySetInnerHTML:{__html:s}})}function J_(){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 SS({kind:l,toolName:s,queued:r,onExpand:c}){const o=l==="question"?"Уточняющий вопрос":l==="plan"?"План на согласование":`Разрешить действие: ${s}`;return a.jsxs("button",{type:"button",className:`decision-bar decision-bar--${l}`,onClick:c,children:[a.jsx("span",{className:"decision-bar__icon","aria-hidden":"true",children:l==="question"?"?":l==="plan"?a.jsx(J_,{}):"!"}),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 Bp({onClick:l}){return a.jsxs("button",{type:"button",className:"decision-collapse",onClick:l,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 NS({request:l,queued:s,collapsed:r,onCollapse:c,onDecide:o}){const d=Q_(l.toolName,l.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:["Разрешить действие?",s>0&&` (ещё ${s} в очереди)`]}),a.jsx(Bp,{onClick:c})]}),a.jsxs("div",{className:"sheet__body",children:[a.jsx("div",{className:"sheet__tool",children:l.toolName}),l.reason&&a.jsx("p",{className:"sheet__reason",children:l.reason}),d?a.jsx(Up,{diff:d}):a.jsx("pre",{className:"code",children:JSON.stringify(l.input,null,2)})]}),a.jsxs("div",{className:"sheet__actions",children:[a.jsx("button",{className:"btn",onClick:()=>o(l.requestId,"deny"),children:"Отклонить"}),a.jsx("button",{className:"btn btn--warn",autoFocus:!0,onClick:()=>o(l.requestId,"allow"),children:"Разрешить"})]})]})})}function kS({request:l,queued:s,collapsed:r,onCollapse:c,onAnswer:o,onDecline:d}){const{questions:h}=l,[m,g]=_.useState(()=>h.map(()=>new Set)),[x,y]=_.useState(()=>h.map(()=>"")),[j,v]=_.useState(()=>zb(h));_.useEffect(()=>{g(h.map(()=>new Set)),y(h.map(()=>"")),v(zb(h))},[l.requestId]);const E=_.useMemo(()=>ES(h,m,x),[h,m,x]),k=E!==null;function C($,B){var D,R;(R=(D=h[$])==null?void 0:D.options[B])!=null&&R.preview&&v(O=>{const ee=O.slice();return ee[$]=B,ee})}function A($,B,D){g(R=>{const O=R.slice(),ee=new Set(O[$]);return D?ee.has(B)?ee.delete(B):ee.add(B):ee.has(B)||(ee.clear(),ee.add(B)),O[$]=ee,O}),B!=="other"&&C($,B)}function G($,B){y(D=>{const R=D.slice();return R[$]=B,R})}function Z(){E&&o(l.requestId,E)}function Y($){$.key==="Enter"&&($.target.closest("button")||k&&($.preventDefault(),Z()))}function H($){var O;if(!["ArrowDown","ArrowUp","ArrowRight","ArrowLeft"].includes($.key))return;const B=Array.from($.currentTarget.querySelectorAll("button.qsheet__option")),D=B.indexOf(document.activeElement);if(D===-1)return;$.preventDefault();const R=$.key==="ArrowDown"||$.key==="ArrowRight"?1:-1;(O=B[(D+R+B.length)%B.length])==null||O.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:Y,children:[a.jsxs("div",{className:"qsheet__head",children:[a.jsx("span",{className:"qsheet__head-icon","aria-hidden":"true",children:"?"}),a.jsxs("span",{className:"qsheet__head-text",children:[h.length===1?"Уточняющий вопрос":`Уточняющие вопросы (${h.length})`,s>0&&` — ещё ${s} в очереди`]}),a.jsx(Bp,{onClick:c})]}),a.jsxs("div",{className:"qsheet__body",children:[l.reason&&a.jsx("p",{className:"qsheet__reason",children:l.reason}),h.map(($,B)=>a.jsx(TS,{q:$,qi:B,selected:m[B]??new Set,otherText:x[B]??"",previewIndex:j[B]??null,onToggle:A,onFocusOption:C,onOtherText:G,onOptionsKeyDown:H},B))]}),a.jsxs("div",{className:"qsheet__actions",children:[a.jsx("button",{className:"btn",onClick:()=>d(l.requestId),children:"Не отвечать"}),a.jsx("button",{className:"btn btn--primary",disabled:!k,onClick:Z,children:"Ответить"})]})]})})}function TS({q:l,qi:s,selected:r,otherText:c,previewIndex:o,onToggle:d,onFocusOption:h,onOtherText:m,onOptionsKeyDown:g}){var E;const x=l.options.some(k=>k.preview),y=o!==null?(E=l.options[o])==null?void 0:E.preview:void 0,j=r.has("other"),v=l.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:l.header}),a.jsx("span",{className:"qsheet__qtext",children:l.question})]}),a.jsxs("div",{className:"qsheet__options"+(l.multiSelect?"":" qsheet__options--radio"),role:l.multiSelect?"group":"radiogroup","aria-label":l.question,onKeyDown:g,children:[l.options.map((k,C)=>{const A=r.has(C);return a.jsxs("button",{type:"button",role:v,"aria-checked":A,className:"qsheet__option"+(A?" is-selected":""),onClick:()=>d(s,C,l.multiSelect),onFocus:()=>h(s,C),onMouseEnter:()=>h(s,C),children:[a.jsx("span",{className:"qsheet__opt-mark","aria-hidden":"true"}),a.jsxs("span",{className:"qsheet__opt-body",children:[a.jsx("span",{className:"qsheet__opt-label",children:k.label}),a.jsx("span",{className:"qsheet__opt-desc",children:k.description})]})]},C)}),a.jsxs("div",{className:"qsheet__other",children:[a.jsxs("button",{type:"button",role:v,"aria-checked":j,className:"qsheet__option qsheet__option--other"+(j?" is-selected":""),onClick:()=>d(s,"other",l.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":`Свой вариант ответа на вопрос «${l.question}»`,value:c,onChange:k=>m(s,k.target.value),autoFocus:!0})]})]}),x&&a.jsx("pre",{className:"qsheet__preview",children:y??""})]})}function zb(l){return l.map(s=>{const r=s.options.findIndex(c=>c.preview);return r===-1?null:r})}function ES(l,s,r){const c={};for(let o=0;o<l.length;o++){const d=l[o];if(!d)continue;const h=s[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 CS(l,s){if(l!=="ExitPlanMode"||!s||typeof s!="object")return null;const r=s.plan;return typeof r=="string"?r:null}function P_({path:l}){const[s,r]=_.useState(!1),[c,o]=_.useState(!1),d=_.useRef(null);_.useEffect(()=>{if(!s)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)},[s]),_.useEffect(()=>{if(!c)return;const m=setTimeout(()=>o(!1),zp);return()=>clearTimeout(m)},[c]),_.useEffect(()=>r(!1),[l]);async function h(){await sa(l)&&o(!0)}return a.jsxs("div",{ref:d,className:"cwd",children:[a.jsxs("button",{type:"button",className:"cwd__toggle","aria-expanded":s,title:s?"Свернуть путь":`Полный путь: ${l}`,onClick:()=>r(m=>!m),onKeyDown:m=>{m.key!=="Escape"||!s||(m.preventDefault(),m.stopPropagation(),r(!1))},children:[a.jsx(AS,{open:s}),a.jsx("span",{className:"cwd__short",children:l})]}),s&&a.jsxs("div",{className:"cwd__pop",children:[a.jsx("span",{className:"cwd__full",children:l}),a.jsx("button",{type:"button",className:"btn btn--ghost cwd__copy",onClick:()=>void h(),children:c?Mc:Sr})]})]})}function AS({open:l}){return a.jsx("svg",{className:l?"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 MS=["low","medium","high"];function W_({models:l,value:s,effort:r,ultracode:c,thinking:o,switchOnFlag:d,showSwitchOnFlag:h=!0,className:m,onModel:g,onEffort:x,onUltracode:y,onThinking:j,onSwitchOnFlag:v}){const[E,k]=_.useState(!1),[C,A]=_.useState(0),G=_.useRef(null),Z=_.useRef(null),Y=l.find(R=>R.value===s)??null,H=Y&&Y.supportsEffort?Y.effortLevels.length>0?Y.effortLevels:MS:[],$=H.includes("xhigh");_.useEffect(()=>{if(!E)return;const R=l.findIndex(O=>O.value===s);A(R===-1?0:R)},[E]),_.useEffect(()=>{if(!E)return;function R(O){var ee;(ee=G.current)!=null&&ee.contains(O.target)||k(!1)}return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[E]),_.useEffect(()=>{var R,O;E&&((O=(R=Z.current)==null?void 0:R.querySelector(".is-cursor"))==null||O.scrollIntoView({block:"nearest"}))},[E,C]);function B(R){k(!1),R.value!==s&&g(R.value)}function D(R){if(R.key==="Escape"){if(!E)return;R.preventDefault(),R.stopPropagation(),k(!1);return}if(R.key==="ArrowDown"||R.key==="ArrowUp"){if(R.preventDefault(),!E)return k(!0);if(l.length===0)return;const O=R.key==="ArrowDown"?1:l.length-1;return A(ee=>(ee+O)%l.length)}if(R.key==="Enter"||R.key===" "){if(R.preventDefault(),!E)return k(!0);const O=l[C];O&&B(O)}}return a.jsxs("div",{ref:G,className:"select"+(E?" select--open":"")+(m?` ${m}`:""),children:[a.jsxs("button",{type:"button",className:"select__trigger",title:"Модель, усилие и размышления","aria-label":"Модель, усилие и размышления","aria-haspopup":"menu","aria-expanded":E,onClick:()=>k(R=>!R),onKeyDown:D,children:[(Y==null?void 0:Y.displayName)??s?a.jsx("span",{className:"select__value",children:(Y==null?void 0:Y.displayName)??s}):a.jsx("span",{className:"select__value select__value--muted",children:"по умолчанию"}),c?a.jsx("span",{className:"select__suffix select__suffix--hot",children:"ultracode"}):H.length>0&&r&&a.jsx("span",{className:"select__suffix",children:r}),a.jsx(RS,{})]}),E&&a.jsxs("div",{ref:Z,className:"select__menu modelmenu",role:"menu",children:[a.jsx("div",{className:"modelmenu__head",children:"Модель"}),l.map((R,O)=>a.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":R.value===s,className:"select__option"+(O===C?" is-cursor":"")+(R.value===s?" is-on":""),onMouseEnter:()=>A(O),onClick:()=>B(R),children:[a.jsx("span",{className:"select__check","aria-hidden":"true",children:R.value===s?"✓":""}),a.jsx("span",{className:"select__label",children:R.displayName}),R.description&&a.jsx("span",{className:"select__hint",children:R.description})]},R.value)),H.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:H.map(R=>a.jsx("button",{type:"button",role:"menuitemradio","aria-checked":R===r,className:R===r?"modelmenu__level is-on":"modelmenu__level",onClick:()=>x(R),children:R},R))})]}),$&&a.jsx(np,{label:"Ultracode",desc:"xhigh и постоянная оркестрация подагентами",on:c,onToggle:()=>y(!c)})]}),a.jsx("div",{className:"modelmenu__sep",role:"separator"}),(Y==null?void 0:Y.supportsThinking)!==!1&&a.jsx(np,{label:"Размышления",desc:"расширенное обдумывание перед ответом",on:o,onToggle:()=>j(!o)}),h&&a.jsx(np,{label:"Менять модель по флагу",desc:"иначе помеченный ход встаёт на паузу",on:d,onToggle:()=>v(!d)})]})]})}function np({label:l,desc:s,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:[l,a.jsx("span",{className:"modelmenu__desc",children:s})]}),a.jsx("span",{className:r?"switch is-on":"switch","aria-hidden":"true",children:a.jsx("span",{className:"switch__knob"})})]})}function RS(){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 xl({title:l,children:s,actions:r,className:c,sheet:o=!1,onClose:d}){const h=_.useRef(null);return _.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":l,children:[a.jsxs("div",{className:"modal__head",children:[a.jsx("h2",{className:"modal__title",children:l}),a.jsx("button",{className:"modal__close","aria-label":"Закрыть",onClick:d,children:"✕"})]}),a.jsx("div",{className:"modal__body",children:s}),r&&a.jsx("div",{className:"modal__actions",children:r})]})})}function DS({candidates:l,searching:s,agentItems:r,agentBusy:c,error:o,roots:d,created:h,onSearch:m,onAskAgent:g,onInterrupt:x,onSubmit:y,onCreate:j,onClose:v}){const[E,k]=_.useState("open"),[C,A]=_.useState(""),[G,Z]=_.useState(!1),[Y,H]=_.useState(""),[$,B]=_.useState(""),[D,R]=_.useState({git:!0,claudeMd:!0,readme:!0}),O=C.trim(),ee=O!=="",P=Y.trim(),ae=$.trim(),be=P!==""&&ae!=="";_.useEffect(()=>{Y===""&&d.length>0&&H(d[0])},[d]);const Ee=_.useRef(m);Ee.current=m,_.useEffect(()=>{if(E!=="open")return;const de=C.trim(),_e=setTimeout(()=>Ee.current(de),200);return()=>clearTimeout(_e)},[C,E]);function je(){ee&&y(O)}function X(){be&&j(P,ae,D)}function ue(){ee&&(Z(!0),g(O))}return h?a.jsxs(xl,{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(de=>a.jsx("li",{children:de},de))})}),a.jsx("p",{className:"modal__text modal__text--dim",children:"Проект открыт и работает — недостающее можно добавить руками, в дереве файлов или из терминала."})]}):a.jsxs(xl,{title:"Новый проект",className:G&&E==="open"?"modal--wide":void 0,onClose:v,actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:v,children:"Отмена"}),E==="open"?a.jsxs(a.Fragment,{children:[c?a.jsx("button",{className:"btn",onClick:x,children:"Остановить"}):a.jsx("button",{className:"btn",disabled:!ee,onClick:ue,title:"Найти по описанию",children:"Попросить агента"}),a.jsx("button",{className:"btn btn--primary",disabled:!ee,onClick:je,children:"Открыть"})]}):a.jsx("button",{className:"btn btn--primary",disabled:!be,onClick:X,children:"Создать"})]}),children:[a.jsxs("div",{className:"tabs",children:[a.jsx(Ub,{label:"Открыть",on:E==="open",onClick:()=>k("open")}),a.jsx(Ub,{label:"Создать",on:E==="create",onClick:()=>k("create")})]}),E==="open"?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"modal__text",children:"Каталог, в котором будет работать агент. Введите путь или часть имени — подходящие каталоги появятся ниже."}),a.jsx("label",{className:"field",htmlFor:"workspace-path",children:"Путь или название"}),a.jsx("input",{id:"workspace-path",className:"input input--mono",value:C,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"C:\\Projects\\my-app",onChange:de=>A(de.target.value),onKeyDown:de=>{de.key==="Enter"&&(de.preventDefault(),je())}}),o&&a.jsx("p",{className:"modal__error",children:o}),l.length>0&&a.jsx("ul",{className:"finds",children:l.map(de=>a.jsx("li",{children:a.jsxs("button",{className:"find",disabled:de.open,title:de.open?"Этот проект уже открыт":de.path,onClick:()=>A(de.path),onDoubleClick:()=>y(de.path),children:[a.jsx("span",{className:"find__name",children:de.name}),a.jsx("span",{className:"find__path",children:de.path}),a.jsx("span",{className:"find__note",children:zS(de)})]})},de.path))}),l.length===0&&ee&&!s&&!G&&a.jsx("p",{className:"modal__text modal__text--dim",children:"Ничего похожего среди каталогов, где вы работали. Если помните не имя, а суть проекта — опишите его и нажмите «Попросить агента». Проекта ещё нет вовсе — рядом вкладка «Создать»."}),G&&a.jsx("div",{className:"finds__agent",children:a.jsx(Hp,{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:Y,spellCheck:!1,autoComplete:"off",placeholder:"C:\\Projects",onChange:de=>H(de.target.value)}),d.length>0&&a.jsx("div",{className:"newproj__roots",children:d.map(de=>a.jsx("button",{type:"button",className:de===P?"newproj__root is-on":"newproj__root",title:de,onClick:()=>H(de),children:LS(de)},de))}),a.jsx("label",{className:"field newproj__field",htmlFor:"workspace-name",children:"Имя проекта"}),a.jsx("input",{id:"workspace-name",className:"input input--mono",value:$,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"my-app",onChange:de=>B(de.target.value),onKeyDown:de=>{de.key==="Enter"&&(de.preventDefault(),X())}}),a.jsx("p",{className:"newproj__preview",children:be?OS(P,ae):"Каталог появится здесь"}),o&&a.jsx("p",{className:"modal__error",children:o}),a.jsxs("div",{className:"newproj__opts",children:[a.jsx(lp,{label:"git init",desc:"панель истории работает сразу",on:D.git,onToggle:()=>R(de=>({...de,git:!de.git}))}),a.jsx(lp,{label:"CLAUDE.md",desc:"заготовка инструкций для агента",on:D.claudeMd,onToggle:()=>R(de=>({...de,claudeMd:!de.claudeMd}))}),a.jsx(lp,{label:"README.md",desc:"по нему проект потом узнаёт поиск",on:D.readme,onToggle:()=>R(de=>({...de,readme:!de.readme}))})]})]})]})}function Ub({label:l,on:s,onClick:r}){return a.jsx("button",{type:"button",className:s?"tabs__tab is-on":"tabs__tab","aria-pressed":s,onClick:r,children:l})}function lp({label:l,desc:s,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:[l,a.jsx("span",{className:"newproj__optdesc",children:s})]}),a.jsx("span",{className:r?"switch is-on":"switch","aria-hidden":"true",children:a.jsx("span",{className:"switch__knob"})})]})}function OS(l,s){const r=l.includes("\\")?"\\":"/";return l.replace(/[\\/]+$/,"")+r+s}function LS(l){const s=l.includes("\\")?"\\":"/",r=l.split(/[\\/]/).filter(Boolean);return r.length<=2?l:`…${s}${r.slice(-2).join(s)}`}function zS(l){return l.open?"уже открыт":l.why?l.why:l.sessions===0?"рядом с вашими проектами":`${US(l.sessions)}${HS(l.lastUsedAt)}`}function US(l){const s=l%10,r=l%100;return r>=11&&r<=14?`${l} сессий`:s===1?`${l} сессия`:s>=2&&s<=4?`${l} сессии`:`${l} сессий`}function HS(l){if(!l)return"";const s=Math.floor((Date.now()-l)/864e5);return s<=0?" · сегодня":s===1?" · вчера":s<30?` · ${s} дн. назад`:` · ${new Date(l).toLocaleDateString("ru-RU")}`}const Ip=7;function BS(l){const s=[],r=[];let c=1;for(const o of l){const d=s.slice();let h=s.indexOf(o.hash);h===-1&&(h=Hb(s),s[h]=o.hash);const[m,...g]=o.parents;s[h]=m??null;const x=[];m!==void 0&&x.push({from:h,to:h});for(const v of g){let E=s.indexOf(v);E===-1&&(E=Hb(s),s[E]=v),x.push({from:h,to:E})}const y=[];for(let v=0;v<d.length;v++)d[v]===o.hash&&(y.push({from:v,to:h}),v!==h&&(s[v]=null));const j=[];for(let v=0;v<d.length;v++){const E=d[v];!E||E===o.hash||v===h||s[v]===E&&j.push(v)}IS(s),c=Math.max(c,s.length,h+1),r.push({commit:o,col:h,up:y,down:x,through:j})}return{rows:r,columns:Math.min(c,Ip)}}function Hb(l){const s=l.indexOf(null);return s!==-1?s:(l.push(null),l.length-1)}function IS(l){for(;l.length>0&&l[l.length-1]===null;)l.pop()}const ey=1500;function qS(l){const s=[];let r=!1;for(const c of l.patch.split(`
|
|
119
|
+
`)){if(s.length>=ey){r=!0;break}if(c.startsWith("@@"))s.push({type:"gap",text:GS(c)});else if(c.startsWith("+"))s.push({type:"add",text:c.slice(1)});else if(c.startsWith("-"))s.push({type:"del",text:c.slice(1)});else{if(c.startsWith("\\"))continue;(c!==""||s.length>0)&&s.push({type:"ctx",text:c.startsWith(" ")?c.slice(1):c})}}return{kind:"patch",filePath:l.path||l.oldPath,rows:s,added:l.added,removed:l.removed,note:YS(l,r)}}function GS(l){const s=/^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@ ?(.*)$/.exec(l);if(!s)return l;const r=Number(s[1]),c=s[2]===void 0?1:Number(s[2]),o=(s[3]??"").trim(),d=c>1?`строки ${r}–${r+c-1}`:`строка ${r}`;return o?`⋯ ${d} · ${o}`:`⋯ ${d}`}function YS(l,s){const r=[];return l.status==="added"&&r.push("новый файл"),l.status==="deleted"&&r.push("файл удалён"),l.status==="renamed"&&r.push(`переименован из ${l.oldPath}`),l.binary?r.push("двоичный файл"):l.patch===""&&r.push("содержимое не показано"),s&&r.push(`показаны первые ${ey} строк`),r.length>0?r.join(" · "):null}function $S({open:l,state:s,result:r,selected:c,busy:o,onRefresh:d,onShow:h,onCheckout:m,onPush:g,onPull:x,onPublish:y,onConnectRemote:j,onDismissResult:v,onClose:E,zoomed:k,onToggleZoom:C}){const A=BS((s==null?void 0:s.commits)??[]),G=[...s!=null&&s.detached?[{value:"",label:`отделён · ${s.head.slice(0,8)}`}]:[],...((s==null?void 0:s.branches)??[]).map(Z=>({value:Z.name,label:Z.name,hint:Z.hash.slice(0,8)}))];return a.jsxs("aside",{className:(l?"sidepane sidepane--git sidepane--open":"sidepane sidepane--git")+(k?" sidepane--zoomed":""),"aria-label":"История git",children:[a.jsxs("div",{className:"sidepane__head",onDoubleClick:Z=>{C&&(Z.target.closest("button")||C())},children:[a.jsx(FS,{}),a.jsx("span",{className:"sidepane__title",children:"История"}),a.jsx("button",{className:"sidepane__btn",title:"Обновить","aria-label":"Обновить историю",onClick:d,children:"↻"}),C&&a.jsx("button",{className:"sidepane__btn",title:k?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":k?"Свернуть панель истории":"Развернуть панель истории на весь экран","aria-pressed":k,onClick:C,children:a.jsx(Yc,{active:k})}),a.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель истории",onClick:E,children:"✕"})]}),s===null?a.jsx("p",{className:"sidepane__empty",children:"Читаем репозиторий…"}):s.available?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"gitbar",children:[a.jsx(Cs,{className:"gitbar__branch",title:"Ветка — выбрать значит переключиться",value:s.detached?"":s.branch,options:G,onChange:Z=>{Z&&m(Z,`ветку ${Z}`)}}),a.jsx(qc,{text:s.detached?s.head:s.branch,hint:s.detached?"хеш HEAD":"имя ветки"})]}),s.detached&&a.jsx("p",{className:"gitbar__note",children:"HEAD отделён от ветки. Выберите ветку в списке, чтобы вернуться."}),a.jsx("div",{className:"gitbar__actions",children:o?a.jsxs("p",{className:"gitbar__busy",children:[a.jsx(eN,{}),o]}):s.hasRemote?a.jsxs(a.Fragment,{children:[a.jsxs("button",{type:"button",className:"btn btn--sm",title:"Отправить текущую ветку в origin",onClick:g,children:[a.jsx(JS,{}),"Отправить",s.ahead>0&&a.jsx("span",{className:"gitbar__count",children:s.ahead})]}),a.jsxs("div",{className:"gitbar__group",children:[a.jsxs("button",{type:"button",className:"btn btn--sm",title:"Забрать с origin и перемотать вперёд (git pull --ff-only)",onClick:()=>x(!0),children:[a.jsx(PS,{}),"Забрать",s.behind>0&&a.jsx("span",{className:"gitbar__count",children:s.behind})]}),a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost gitbar__check",title:"Только проверить — git fetch, рабочее дерево не меняется","aria-label":"Проверить, что нового на origin, без изменений на диске",onClick:()=>x(!1),children:a.jsx(WS,{})})]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("button",{type:"button",className:"btn btn--sm btn--primary",title:"Создать репозиторий на GitHub и отправить в него ветку",onClick:y,children:[a.jsx(Ib,{}),"Опубликовать на 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:s.changed.length>0?`Рабочее дерево · ${s.changed.length} ${sN(s.changed.length)}`:"Рабочее дерево чистое"}),a.jsx("span",{className:"gitrow__meta",children:s.changed.length>0?s.changed.slice(0,4).map(Z=>lN(Z.path)).join(", "):"незакоммиченных изменений нет"})]})}),A.rows.map(Z=>a.jsx(VS,{row:Z,columns:A.columns,head:Z.commit.hash===s.head,local:s.hasRemote&&!Z.commit.pushed,active:c===Z.commit.hash,onOpen:()=>h(Z.commit.hash)},Z.commit.hash)),A.rows.length===0&&a.jsx("p",{className:"sidepane__empty",children:"В репозитории ещё нет коммитов"})]})]}):a.jsxs("div",{className:"gitempty",children:[a.jsx("p",{className:"gitempty__text",children:s.message||"Это не git-репозиторий"}),s.noRepo&&a.jsxs(a.Fragment,{children:[a.jsxs("button",{type:"button",className:"btn btn--sm btn--primary gitempty__btn",onClick:y,children:[a.jsx(Ib,{}),"Опубликовать на GitHub"]}),a.jsx("p",{className:"gitempty__hint",children:"Заведёт репозиторий, сделает первый коммит и отправит его на GitHub."})]})]}),a.jsx(Tr,{result:r,onDismiss:v})]})}const Po=50,Bb=13,XS=500;function VS({row:l,columns:s,head:r,local:c,active:o,onOpen:d}){const{commit:h}=l,m=h.refs.map(tN).filter(Boolean),[g,x]=_.useState(null),y=_.useRef(null);function j(C){const A=C.touches[0];if(!A)return;const G={timer:0,x:A.clientX,y:A.clientY,fired:!1};G.timer=window.setTimeout(()=>{G.fired=!0,x({x:G.x,y:G.y})},XS),y.current=G}function v(C){const A=y.current,G=C.touches[0];!A||!G||Math.hypot(G.clientX-A.x,G.clientY-A.y)>10&&(window.clearTimeout(A.timer),y.current=null)}function E(C){const A=y.current;A&&(window.clearTimeout(A.timer),A.fired&&C.preventDefault())}function k(){const C=[{id:"hash",label:"Копировать хеш",hint:h.shortHash,onSelect:()=>void sa(h.hash)},{id:"short",label:"Копировать короткий хеш",onSelect:()=>void sa(h.shortHash)},{id:"subject",label:"Копировать сообщение",onSelect:()=>void sa(h.subject)}],A=new Set;for(const G of h.refs){const Z=G.startsWith("tag: "),Y=nN(G);!Y||A.has(Y)||(A.add(Y),C.push({id:`ref:${Y}`,label:Z?"Копировать тег":"Копировать ветку",hint:Y,onSelect:()=>void sa(Y)}))}return C}return a.jsxs(a.Fragment,{children:[a.jsxs("button",{className:"gitrow"+(o?" is-on":""),title:c?"Коммит ещё не отправлен на удалённый репозиторий":void 0,onClick:()=>{var C;if((C=y.current)!=null&&C.fired){y.current=null;return}d()},onContextMenu:C=>{C.preventDefault(),x({x:C.clientX,y:C.clientY})},onTouchStart:j,onTouchMove:v,onTouchEnd:E,onTouchCancel:E,children:[a.jsx(QS,{row:l,columns:s,head:r,local:c}),a.jsxs("span",{className:"gitrow__body",children:[a.jsxs("span",{className:"gitrow__subject",children:[m.map(C=>a.jsx("span",{className:"gitrow__ref",children:C},C)),h.subject]}),a.jsxs("span",{className:"gitrow__meta",children:[h.shortHash," · ",h.author," · ",aN(h.date),c&&a.jsx("span",{className:"gitrow__local",children:"· не отправлен"})]})]})]}),g&&a.jsx(Hi,{x:g.x,y:g.y,items:k(),onClose:()=>x(null)})]})}function QS({row:l,columns:s,head:r,local:c}){const o=s*Bb+6,d=Po/2,h=x=>8+Math.min(x,Ip-1)*Bb,m=c?"3.5 2.5":void 0,g=Af(l.col);return a.jsxs("svg",{className:"gitgraph",width:o,height:Po,viewBox:`0 0 ${o} ${Po}`,"aria-hidden":"true",children:[l.through.map(x=>a.jsx("line",{x1:h(x),y1:0,x2:h(x),y2:Po,style:{stroke:Af(x)}},`t${x}`)),l.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:Af(x.from),strokeDasharray:m}},`u${y}`)),l.down.map((x,y)=>a.jsx("path",{d:`M${h(x.from)} ${d} L${h(x.to)} ${d+12} L${h(x.to)} ${Po}`,fill:"none",style:{stroke:Af(x.to),strokeDasharray:m}},`d${y}`)),r&&a.jsx("circle",{className:"gitgraph__head",cx:h(l.col),cy:d,r:l.commit.parents.length>1?7.4:6.6}),a.jsx("circle",{className:"gitgraph__dot",cx:h(l.col),cy:d,r:l.commit.parents.length>1?4.6:3.6,style:{stroke:g,fill:c?void 0:g}})]})}function Af(l){return`var(--lane-${l%Ip})`}function KS({detail:l,local:s,onCheckout:r,onClose:c}){const o=l.hash==="";return a.jsxs(xl,{className:"modal--wide",title:o?"Незакоммиченные изменения":`Коммит ${l.shortHash}`,onClose:c,actions:a.jsxs(a.Fragment,{children:[!o&&a.jsx("button",{className:"btn",onClick:()=>r(l.hash,`коммит ${l.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:l.subject}),a.jsx(qc,{text:l.subject,hint:"сообщение коммита"})]}),a.jsxs("p",{className:"commit__meta",children:[l.author,l.email&&` <${l.email}>`," · ",iN(l.date)]}),a.jsxs("div",{className:"commit__line commit__line--hash",children:[a.jsx("span",{className:"commit__hash",children:l.hash}),a.jsx(qc,{text:l.hash,hint:"хеш коммита"})]}),s&&a.jsx("p",{className:"commit__meta commit__meta--local",children:"Не отправлен: этого коммита нет ни в одной удалённой ветке."}),l.parents.length>0&&a.jsxs("p",{className:"commit__meta",children:[l.parents.length>1?"слияние: ":"родитель: ",l.parents.map(d=>d.slice(0,8)).join(", ")]}),l.body&&a.jsx("pre",{className:"commit__body",children:l.body})]}),l.truncated&&a.jsx("p",{className:"modal__text",children:"Изменения слишком велики — часть патча не показана."}),l.files.length===0?a.jsx("p",{className:"modal__text",children:"Изменений нет."}):l.files.map(d=>a.jsx(ZS,{file:d,defaultOpen:l.files.length<=3},d.path+d.oldPath))]})}function ZS({file:l,defaultOpen:s}){const[r,c]=_.useState(s);return a.jsxs("div",{className:"commit__file",children:[a.jsxs("button",{className:"commit__filehead",onClick:()=>c(o=>!o),children:[a.jsx("span",{className:"commit__filepath",children:l.path||l.oldPath}),a.jsxs("span",{className:"diff__stat",children:[l.added>0&&a.jsxs("span",{className:"diff__stat--add",children:["+",l.added]}),l.removed>0&&a.jsxs("span",{className:"diff__stat--del",children:["−",l.removed]})]}),a.jsx("span",{className:"tool__status",children:r?"▴":"▾"})]}),r&&a.jsx(Up,{diff:qS(l)})]})}function FS(){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 JS(){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 PS(){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 WS(){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 Ib(){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 eN(){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 tN(l){return l.replace(/^HEAD -> /,"").replace(/^tag: /,"⌂ ").trim()}function nN(l){const s=l.replace(/^HEAD -> /,"").replace(/^tag: /,"").trim();return s==="HEAD"?"":s}function lN(l){const s=l.split("/");return s[s.length-1]??l}function sN(l){const s=l%100;if(s>=11&&s<=14)return"файлов";switch(l%10){case 1:return"файл";case 2:case 3:case 4:return"файла";default:return"файлов"}}function aN(l){const s=Date.parse(l);if(Number.isNaN(s))return l;const r=Math.round((Date.now()-s)/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(s).toLocaleDateString()}function iN(l){const s=Date.parse(l);return Number.isNaN(s)?l:new Date(s).toLocaleString()}function qb(l){return l.replace(/[^A-Za-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")}function rN({status:l,owners:s,files:r,defaultName:c,hasCommits:o,busy:d,result:h,onRefreshStatus:m,onSaveToken:g,onPublish:x,onDismissResult:y,onClose:j}){var de;const[v,E]=_.useState(()=>qb(c)),[k,C]=_.useState(""),[A,G]=_.useState(""),[Z,Y]=_.useState(!0),[H,$]=_.useState("Первый коммит"),[B,D]=_.useState(null),[R,O]=_.useState("");_.useEffect(()=>{!k&&s.length>0&&C(s[0].login)},[k,s]),_.useEffect(()=>{r&&B===null&&D(new Set(r.files))},[r,B]);const ee=(l==null?void 0:l.connected)===!0,P=s.map(_e=>({value:_e.login,label:_e.login,hint:_e.kind==="org"?"организация":void 0})),ae=_.useMemo(()=>{if(!r)return[];const _e=R.trim().toLowerCase();return _e?r.files.filter(Ae=>Ae.toLowerCase().includes(_e)):r.files},[r,R]),be=(B==null?void 0:B.size)??0,Ee=ee&&v.trim()!==""&&k!==""&&d===""&&(o||be>0);function je(_e){D(Ae=>{const w=new Set(Ae??[]);return w.has(_e)?w.delete(_e):w.add(_e),w})}function X(_e){D(Ae=>{const w=new Set(Ae??[]);for(const V of ae)_e?w.add(V):w.delete(V);return w})}function ue(){if(!Ee)return;const _e=(r==null?void 0:r.files)??[];x({owner:k,name:v.trim(),description:A.trim(),private:Z,include:o?[]:_e.filter(Ae=>B==null?void 0:B.has(Ae)),ignore:o?[]:_e.filter(Ae=>!(B!=null&&B.has(Ae))),message:o?"":H.trim()||"Первый коммит"})}return a.jsxs(xl,{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:!Ee,onClick:ue,children:d||"Опубликовать"})]}),children:[a.jsx(cN,{status:l,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:_e=>E(qb(_e.target.value))})]}),v.trim()===""&&a.jsx("p",{className:"modal__error",children:"Имя репозитория не может быть пустым."}),a.jsxs("label",{className:"field publish__field",children:[a.jsx("span",{children:"Владелец"}),s.length>1?a.jsx(Cs,{className:"settings__select",value:k,options:P,onChange:C,placeholder:"выберите владельца",ariaLabel:"Владелец репозитория"}):a.jsx("p",{className:"publish__static",children:((de=s[0])==null?void 0:de.login)??"—"})]}),a.jsxs("label",{className:"field publish__field",children:[a.jsx("span",{children:"Описание (необязательно)"}),a.jsx("input",{className:"input",value:A,placeholder:"о чём проект — одной строкой",onChange:_e=>G(_e.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(Gb,{title:"Приватный",desc:"Виден только вам и тем, кого вы пригласите. Стоит по умолчанию: репозиторий с чужим кодом, случайно ставший публичным, потом не отозвать.",on:Z,onClick:()=>Y(!0)}),a.jsx(Gb,{title:"Публичный",desc:"Виден всем в интернете — код, история коммитов, всё содержимое.",risky:!0,on:!Z,onClick:()=>Y(!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:[be," из ",r.files.length," файлов"]}),a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>X(!0),children:"Отметить все"}),a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>X(!1),children:"Снять все"})]}),r.files.length>8&&a.jsx("input",{className:"input publish__filter",value:R,placeholder:"Фильтр по пути…",spellCheck:!1,onChange:_e=>O(_e.target.value)}),a.jsx("div",{className:"publish__filelist",children:ae.length===0?a.jsx("p",{className:"modal__text publish__filesempty",children:"Ничего не найдено по фильтру."}):ae.map(_e=>a.jsxs("button",{type:"button",role:"checkbox","aria-checked":(B==null?void 0:B.has(_e))===!0,className:"publish__file",onClick:()=>je(_e),children:[a.jsx("span",{className:"publish__box"+(B!=null&&B.has(_e)?" is-on":""),"aria-hidden":"true",children:(B==null?void 0:B.has(_e))&&"✓"}),a.jsx("span",{className:"publish__filepath",children:_e})]},_e))}),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:H,onChange:_e=>$(_e.target.value)})]})]})]}),a.jsx(Tr,{result:h,onDismiss:y})]})}function Gb({title:l,desc:s,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:[l,c&&a.jsx("span",{className:"access__risk",children:"видно всем"})]}),a.jsx("span",{className:"access__desc",children:s})]})]})}function cN({status:l,onRefreshStatus:s,onSaveToken:r}){const[c,o]=_.useState(""),[d,h]=_.useState(!1);return a.jsxs("div",{className:"publish__section publish__section--first",children:[a.jsx("h3",{className:"publish__heading",children:"Учётная запись GitHub"}),l===null?a.jsx("p",{className:"modal__text",children:"Проверяем подключение…"}):l.connected?a.jsxs("div",{className:"publish__account",children:[a.jsx("span",{className:"chip chip--ok",children:l.login}),a.jsx("span",{className:"publish__accountvia",children:l.source==="gh"?"через GitHub CLI":"по личному токену"}),l.source==="token"&&a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>r(""),children:"Отключить токен"})]}):a.jsxs("div",{className:"publish__connect",children:[l.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(oN,{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 ↗"})]}),l.message&&a.jsx("p",{className:"modal__error",children:l.message}),a.jsxs("div",{className:"extbar",children:[a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:s,children:"Проверить снова"}),a.jsx("button",{type:"button",className:"btn btn--sm btn--primary",disabled:c.trim()==="",onClick:()=>r(c.trim()),children:"Сохранить токен"})]})]})]})}function oN({value:l,onChange:s,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:l,placeholder:o,spellCheck:!1,autoComplete:"off",autoFocus:d,onChange:h=>s(h.target.value)}),a.jsx("button",{type:"button",className:"pwfield__toggle","aria-label":r?"Скрыть токен":"Показать токен","aria-pressed":r,onClick:c,children:r?a.jsx(fN,{}):a.jsx(uN,{})})]})}function uN(){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 fN(){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 dN({busy:l,result:s,onSubmit:r,onDismissResult:c,onClose:o}){const[d,h]=_.useState(""),m=/^(https?|ssh|git):\/\/\S+/i.test(d.trim())||/^[\w.-]+@[\w.-]+:.+/.test(d.trim());return a.jsxs(xl,{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||l!=="",onClick:()=>r(d.trim()),children:l||"Подключить"})]}),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&&l===""&&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(Tr,{result:s,onDismiss:c})]})}function hN({open:l,items:s,busy:r,ready:c,sendBlocked:o,commands:d,contextResult:h,draftKey:m,models:g,model:x,effort:y,ultracode:j,thinking:v,switchOnFlag:E,onContextSearch:k,onCommand:C,onModel:A,onEffort:G,onUltracode:Z,onThinking:Y,onSwitchOnFlag:H,onAsk:$,onInterrupt:B,onReset:D,onClose:R,zoomed:O,onToggleZoom:ee}){return a.jsxs("aside",{className:(l?"sidepane sidepane--ask sidepane--open":"sidepane sidepane--ask")+(O?" sidepane--zoomed":""),"aria-label":"Вопрос на полях",children:[a.jsxs("div",{className:"sidepane__head",onDoubleClick:P=>{ee&&(P.target.closest("button")||ee())},children:[a.jsx(pN,{}),a.jsx("span",{className:"sidepane__title",children:"Вопрос на полях"}),a.jsx("button",{className:"sidepane__btn",title:"Начать заново — следующий вопрос возьмёт свежий контекст","aria-label":"Начать боковой разговор заново",disabled:s.length===0,onClick:D,children:"↻"}),ee&&a.jsx("button",{className:"sidepane__btn",title:O?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":O?"Свернуть панель вопроса":"Развернуть панель вопроса на весь экран","aria-pressed":O,onClick:ee,children:a.jsx(Yc,{active:O})}),a.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель вопроса",onClick:R,children:"✕"})]}),g.length>0&&a.jsxs("div",{className:"sidepane__tools",children:[a.jsx(W_,{className:"select--compact",models:g,value:x,effort:y,ultracode:j,thinking:v,switchOnFlag:E,onModel:A,onEffort:G,onUltracode:Z,onThinking:Y,onSwitchOnFlag:H}),a.jsx("span",{className:"sidepane__note",title:"Боковой вопрос работает только на чтение",children:"только чтение"})]}),a.jsx(Hp,{items:s,busy:r,waiting:!1,empty:c?"Спросите о том, что происходит: вопрос уйдёт в сторону от основного разговора и не попадёт в его контекст. Отвечающий видит сессию и проект, но ничего не меняет.":"Откройте сессию — вопрос задаётся о ней."}),a.jsx(Z_,{className:"composer--side",disabled:!c,busy:r,commands:d,sessionTitle:null,contextResult:h,draftKey:m?`side:${m}`:null,placeholder:"Спросить, не мешая работе…",sendLabel:"Спросить",autoFocus:l,attachmentsEnabled:!1,sendBlocked:o,onContextSearch:k,onCommand:C,onSend:$,onInterrupt:B,onEscape:r?B:R})]})}function pN(){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 mN=75,gN=90;function ty({usage:l}){if(!(l!=null&&l.available))return null;const s=l.buckets??[],r=s.length>0?s.map(o=>({key:o.id,label:o.label,window:o.window})):[...l.fiveHour?[{key:"five",label:"5 ч",window:l.fiveHour}]:[],...l.sevenDay?[{key:"week",label:"нед",window:l.sevenDay}]:[]];if(r.length===0)return null;const c=s.length>0?"Квота Antigravity":`Расход лимитов плана${l.plan?` ${l.plan}`:""}`;return a.jsx("div",{className:"usage",title:_N(l,s),"aria-label":c,children:r.map(o=>a.jsx(xN,{label:o.label,window:o.window},o.key))})}function xN({label:l,window:s}){const r=Math.round(s.utilization),c=vN(s.resetsAt);return a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"usage__label",children:l}),a.jsx("span",{className:"usage__track",role:"progressbar","aria-label":l,"aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,children:a.jsx("span",{className:`usage__fill${bN(r)}`,style:{width:`${r}%`}})}),a.jsxs("span",{className:"usage__pct",children:[r,"%"]}),a.jsx("span",{className:"usage__reset",title:qp(s.resetsAt)||void 0,children:c&&`↻ ${c}`})]})}function bN(l){return l>=gN?" usage__fill--over":l>=mN?" usage__fill--warn":""}function _N(l,s){if(s.length>0)return yN(s);const r=[l.plan?`Лимиты плана ${l.plan}`:"Лимиты плана"],c=(o,d)=>{if(!d)return;const h=qp(d.resetsAt);r.push(`${o}: ${Math.round(d.utilization)}%${h?`, ${h}`:""}`)};return c("5 часов",l.fiveHour),c("Неделя",l.sevenDay),c("Неделя, Opus",l.sevenDayOpus),r.join(`
|
|
120
|
+
`)}function yN(l){const s=["Квота Antigravity"];for(const r of l){const c=qp(r.window.resetsAt),o=Math.round(r.window.utilization);s.push(`${r.title}: ${o}%${c?`, ${c}`:""}`),r.description&&s.push(r.description)}return s.join(`
|
|
121
|
+
`)}function ny(l){if(!l)return null;const s=new Date(l);return Number.isNaN(s.getTime())?null:s}function ly(l){return l.getTime()-Date.now()<1440*60*1e3}function vN(l){const s=ny(l);return s?ly(s)?s.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):s.toLocaleDateString(void 0,{day:"numeric",month:"short"}):""}function qp(l){const s=ny(l);return s?`обнулится ${ly(s)?`в ${s.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:s.toLocaleDateString(void 0,{day:"numeric",month:"long"})}`:""}function sy(){const[l,s]=_.useState(()=>new Date);return _.useEffect(()=>{let r=0;const c=()=>{const d=new Date;s(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:l.toISOString(),title:jN(l),children:[a.jsx("span",{className:"clock__time",children:l.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}),a.jsx("span",{className:"clock__date",children:l.toLocaleDateString(void 0,{weekday:"short",day:"numeric",month:"short"})})]})}function jN(l){return l.toLocaleDateString(void 0,{weekday:"long",day:"numeric",month:"long",year:"numeric"})}function wN({onClose:l,permission:s,model:r,usage:c,cwd:o,costLabel:d,onRefresh:h,refreshing:m,metersFetchedAt:g,onRename:x,onHandoff:y,onFreshSession:j,handoffWriting:v,onStop:E}){const k=b_({onLongPress:()=>j==null?void 0:j(),onClick:()=>y==null?void 0:y(),disabled:v});return a.jsx(xl,{title:"Настройки сессии",className:"modal--sheet",sheet:!0,onClose:l,children:a.jsxs("div",{className:"sessionmenu",children:[s&&a.jsx(Nc,{label:"Режим прав",children:s}),a.jsx(Nc,{label:"Модель",children:r}),(c==null?void 0:c.available)&&(c.fiveHour||c.sevenDay||c.buckets&&c.buckets.length>0)&&a.jsx(Nc,{label:"Лимиты плана",children:a.jsx(ty,{usage:c})}),a.jsxs("button",{type:"button",className:m?"sessionmenu__refresh is-busy":"sessionmenu__refresh","aria-busy":m,disabled:m,onClick:h,children:[a.jsx(SN,{}),a.jsxs("span",{className:"sessionmenu__refresh-text",children:["Обновить показания",g&&a.jsxs("span",{className:"sessionmenu__refresh-time",children:["обновлено в"," ",new Date(g).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})]})]})]}),a.jsx(Nc,{label:"Время",children:a.jsx(sy,{})}),d&&a.jsx(Nc,{label:"Стоимость хода",children:a.jsx("span",{className:"badge badge--cost",children:d})}),o&&a.jsx(Nc,{label:"Каталог проекта",children:a.jsx(P_,{path:o})}),x&&a.jsx("button",{type:"button",className:"sessionmenu__rename",onClick:x,children:"Переименовать сессию"}),y&&a.jsxs("button",{type:"button",className:v?"sessionmenu__handoff is-busy":k.holding?"sessionmenu__handoff is-holding":"sessionmenu__handoff",style:{"--hold-ms":`${k.thresholdMs}ms`},"aria-busy":v,disabled:v,...k.handlers,children:[a.jsx("span",{className:"sessionmenu__handoff-hold","aria-hidden":"true"}),a.jsxs("span",{className:"sessionmenu__handoff-text",children:[v?"Пишется хэндофф…":"Хэндофф и новая сессия",!v&&a.jsx("span",{className:"sessionmenu__handoff-hint",children:"Зажмите — новая сессия без хэндоффа"})]})]}),E&&a.jsx("button",{type:"button",className:"sessionmenu__stop",onClick:E,children:"Остановить сессию"})]})})}function Nc({label:l,children:s}){return a.jsxs("div",{className:"sessionmenu__row",children:[a.jsx("span",{className:"sessionmenu__label",children:l}),s]})}function SN(){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 NN({tab:l,servers:s,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:s.length},{id:"plugins",label:"Плагины",count:r.length},{id:"catalog",label:"Каталог",count:o.length}];return a.jsxs(xl,{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":l===v.id,className:l===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))}),l==="mcp"&&a.jsx(kN,{servers:s,auth:h,remote:m,actions:g}),l==="plugins"&&a.jsx(RN,{plugins:r,marketplaces:c,actions:g}),l==="catalog"&&a.jsx(DN,{catalog:o,hasMarketplaces:c.length>0,actions:g,onMarketplaces:()=>x("plugins")}),a.jsx(Tr,{result:d})]})}function kN({servers:l,auth:s,remote:r,actions:c}){const[o,d]=_.useState(!1);return a.jsxs(a.Fragment,{children:[l.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:l.map(h=>{const m=(s==null?void 0:s.name)===h.name?s: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--${CN(h.status)}`,children:EN[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(TN,{auth:m,remote:r,actions:c})]},h.name)})}),o?a.jsx(AN,{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 TN({auth:l,remote:s,actions:r}){const[c,o]=_.useState("");function d(){const g=c.trim();g!==""&&(r.mcpAuthCallback(l.name,g),o(""))}if(!l.active)return l.error?a.jsx("div",{className:"extlist__error",children:l.error}):l.done?a.jsxs("div",{className:"extauth extauth--done",role:"status",children:[a.jsx("span",{className:"extauth__tick","aria-hidden":"true",children:"✓"}),"Вход выполнен, сервер подключён."]}):null;const h=a.jsxs("div",{className:"extauth__paste",children:[s&&a.jsx("label",{className:"extauth__label",htmlFor:`mcp-cb-${l.name}`,children:"Адрес из строки браузера после входа"}),a.jsxs("div",{className:"extform__row",children:[a.jsx("input",{id:`mcp-cb-${l.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:s?"Браузер покажет ошибку на localhost — это нормально. Скопируйте адрес из его строки и вставьте сюда.":"Скопируйте адрес из строки браузера и вставьте сюда."})]}),m=l.callbackExpected&&(s?h:a.jsxs("details",{className:"extauth__more",children:[a.jsx("summary",{children:"Браузер показал ошибку на localhost?"}),h]}));return a.jsxs("div",{className:"extauth",role:"status",children:[l.url&&a.jsxs(a.Fragment,{children:[a.jsx("a",{className:"btn btn--primary extauth__go",href:l.url,target:"_blank",rel:"noopener noreferrer",children:"Открыть страницу входа"}),!s&&a.jsx("p",{className:"extauth__hint",children:"На этом компьютере окно обновится само, как только вы войдёте."})]}),m,l.error&&a.jsx("div",{className:"extlist__error",children:l.error}),a.jsxs("div",{className:"extauth__wait",children:[a.jsx("span",{className:"extauth__dot","aria-hidden":"true"}),"Ждём завершения входа…"]})]})}const EN={connected:"подключён",failed:"ошибка","needs-auth":"нужна авторизация",pending:"подключается",disabled:"выключен",unknown:"неизвестно"};function CN(l){return l==="connected"?"ok":l==="failed"?"bad":l==="needs-auth"?"warn":"mute"}function AN({onSubmit:l,onCancel:s}){const[r,c]=_.useState(""),[o,d]=_.useState("stdio"),[h,m]=_.useState(""),[g,x]=_.useState(""),[y,j]=_.useState(""),v=o==="stdio",E=r.trim()!==""&&(v?h.trim()!=="":g.trim()!=="");function k(){if(E)if(v){const[C,...A]=MN(h);l(r.trim(),{transport:"stdio",command:C??"",args:A,env:Yb(y)})}else l(r.trim(),{transport:o,url:g.trim(),headers:Yb(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:C=>c(C.target.value)}),a.jsx("label",{className:"field",children:"Транспорт"}),a.jsx(Cs,{title:"Транспорт",value:o,options:[{value:"stdio",label:"stdio",hint:"локальный процесс"},{value:"http",label:"http",hint:"удалённый сервер"},{value:"sse",label:"sse",hint:"удалённый, поток событий"}],onChange:C=>d(C)}),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:C=>m(C.target.value)})]}):a.jsxs(a.Fragment,{children:[a.jsx("label",{className:"field",htmlFor:"mcp-url",children:"URL"}),a.jsx("input",{id:"mcp-url",className:"input input--mono",value:g,spellCheck:!1,autoComplete:"off",placeholder:"https://mcp.example.dev/mcp",onChange:C=>x(C.target.value)})]}),a.jsxs("label",{className:"field",htmlFor:"mcp-pairs",children:[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:C=>j(C.target.value)}),a.jsxs("div",{className:"extbar",children:[a.jsx("button",{className:"btn",onClick:s,children:"Отмена"}),a.jsx("button",{className:"btn btn--primary",disabled:!E,onClick:k,children:"Подключить"})]})]})}function Yb(l){const s={};for(const r of l.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||(s[c.slice(0,h).trim()]=c.slice(h+1).trim())}return s}function MN(l){return(l.trim().match(/"[^"]*"|'[^']*'|\S+/g)??[]).map(s=>s.replace(/^["']|["']$/g,""))}function RN({plugins:l,marketplaces:s,actions:r}){const[c,o]=_.useState("");return a.jsxs(a.Fragment,{children:[l.length===0&&a.jsx("p",{className:"modal__text",children:"Ни одного установленного плагина. Что можно поставить — на вкладке «Каталог»."}),a.jsx("ul",{className:"extlist",children:l.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:s.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 Wo=30;function DN({catalog:l,hasMarketplaces:s,actions:r,onMarketplaces:c}){const[o,d]=_.useState(""),[h,m]=_.useState(""),[g,x]=_.useState(Wo),[y,j]=_.useState(""),v=_.useMemo(()=>[...new Set(l.map(C=>C.category).filter(Boolean))].sort(),[l]),E=_.useMemo(()=>{const k=o.trim().toLowerCase();return l.filter(C=>h&&C.category!==h?!1:k?`${C.name} ${C.displayName} ${C.description} ${C.author}`.toLowerCase().includes(k):!0)},[l,o,h]);return l.length===0?a.jsxs("p",{className:"modal__text",children:[s?"Маркетплейсы подключены, но их каталог ещё не выкачан. Попробуйте открыть окно ещё раз через минуту.":"Ни одного маркетплейса — ставить нечего."," ",a.jsx("button",{className:"linkish",onClick:c,children:"Подключить маркетплейс"})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"catalog__filters",children:[a.jsx("input",{className:"input",value:o,spellCheck:!1,autoComplete:"off","aria-label":"Поиск по каталогу",placeholder:"Поиск: имя, описание, автор",onChange:k=>{d(k.target.value),x(Wo)}}),a.jsx(Cs,{title:"Категория",value:h,options:[{value:"",label:"все категории"},...v.map(k=>({value:k,label:k}))],onChange:k=>{m(k),x(Wo)}})]}),E.length===0?a.jsx("p",{className:"modal__text",children:"Ничего не нашлось."}):a.jsx("ul",{className:"extlist",children:E.slice(0,g).map(k=>a.jsxs("li",{className:"extlist__row",children:[a.jsxs("div",{className:"extlist__head",children:[a.jsx("span",{className:"extlist__name",children:k.name}),k.installed&&a.jsx("span",{className:"chip chip--ok",children:"установлен"}),k.version&&a.jsx("span",{className:"chip",children:k.version}),k.category&&a.jsx("span",{className:"chip",children:k.category})]}),k.description&&a.jsx("div",{className:"catalog__desc",children:k.description}),a.jsxs("div",{className:"extlist__meta",children:[k.author&&`${k.author} · `,k.marketplace]}),a.jsxs("div",{className:"extlist__actions",children:[a.jsx("button",{className:"btn btn--ghost btn--sm",disabled:k.installed,onClick:()=>r.pluginInstall(k.id),children:k.installed?"Уже стоит":"Установить"}),k.homepage&&a.jsx("a",{className:"btn btn--ghost btn--sm",href:k.homepage,target:"_blank",rel:"noreferrer",children:"Страница"})]})]},k.id))}),E.length>g&&a.jsx("div",{className:"extbar",children:a.jsxs("button",{className:"btn",onClick:()=>x(k=>k+Wo),children:["Ещё ",Math.min(Wo,E.length-g)," из ",E.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:k=>j(k.target.value),onKeyDown:k=>{k.key!=="Enter"||y.trim()===""||(k.preventDefault(),r.pluginInstall(y.trim()),j(""))}}),a.jsx("button",{className:"btn",disabled:y.trim()==="",onClick:()=>{r.pluginInstall(y.trim()),j("")},children:"Установить"})]})]})]})}function ON({status:l,login:s,actions:r,remote:c,runningSessions:o,onReconnect:d,reconnectBlocked:h,reconnectHint:m,onClose:g}){const[x,y]=_.useState(""),[j,v]=_.useState(!1),[E,k]=_.useState(!1),C=d!==null&&(l==null?void 0:l.loggedIn)===!0&&!E&&!j,A=_.useMemo(()=>{if(s.error)return{ok:!1,message:s.error};const Y=s.output.trim();return Y===""?null:{ok:!0,message:Y}},[s.error,s.output]);function G(Y=x){const H=Y.trim();H!==""&&(r.submitCode(H),y(""))}function Z(){if(o>0){v(!1),k(!0);return}r.login("claudeai",!0)}return a.jsxs(xl,{title:"Аккаунт",onClose:g,children:[l===null?a.jsx("p",{className:"modal__text",children:"Спрашиваем у хоста…"}):l.loggedIn?a.jsxs("div",{className:"account",children:[a.jsx("div",{className:"account__id",children:l.email||"Вход выполнен"}),a.jsxs("div",{className:"account__chips",children:[a.jsx("span",{className:"chip chip--ok",children:UN[l.method]??l.method}),l.plan&&a.jsx("span",{className:"chip",children:l.plan})]}),l.organization&&a.jsx("div",{className:"extlist__meta",children:l.organization})]}):a.jsxs("p",{className:"modal__text",children:["Вход не выполнен. Сессии не запустятся, пока аккаунт не подключён — или пока в окружении хоста нет ",a.jsx("code",{children:"ANTHROPIC_API_KEY"}),"."]}),s.active?a.jsx(HN,{login:s,remote:c,code:x,onCode:y,onSubmit:G,onCancel:r.cancel}):a.jsxs(a.Fragment,{children:[a.jsx(Tr,{result:A}),E&&a.jsx("p",{className:"account__warn",role:"alert",children:LN(o)}),C&&h&&a.jsx("p",{className:"account__note",children:m}),a.jsx("div",{className:`extbar${l!=null&&l.loggedIn?" account__bar":""}`,children:l!=null&&l.loggedIn?a.jsxs(a.Fragment,{children:[C&&a.jsxs("button",{type:"button",className:"btn account__relink",title:`Переподключить сессию
|
|
123
|
+
${m}`,"aria-label":"Переподключить сессию",disabled:h,onClick:d,children:[a.jsx(zN,{}),"Переподключить"]}),E?a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>k(!1),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",autoFocus:!0,onClick:()=>{k(!1),r.login("claudeai",!0)},children:"Всё равно сменить"})]}):a.jsx("button",{className:"btn",onClick:Z,children:"Сменить аккаунт"}),j?a.jsx("button",{className:"btn btn--danger",autoFocus:!0,onClick:()=>{v(!1),r.logout()},children:"Точно выйти?"}):a.jsx("button",{className:"btn",onClick:()=>{k(!1),v(!0)},children:"Выйти"})]}):a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>r.login("console",!1),children:"Через Console"}),a.jsx("button",{className:"btn btn--primary",onClick:()=>r.login("claudeai",!1),children:"Войти"})]})})]})]})}function LN(l){const s=l%10,r=l%100,c=s===1&&r!==11,o=c?"сессия":s>=2&&s<=4&&(r<12||r>14)?"сессии":"сессий";return`${l} ${o} сейчас ${c?"работает":"работают"} — смена аккаунта может ${c?"её":"их"} прервать.`}function zN(){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 UN={"claude.ai":"подписка Claude",console:"Anthropic Console",apiKey:"API-ключ",none:"нет"};function HN({login:l,remote:s,code:r,onCode:c,onSubmit:o,onCancel:d}){var k;const[h,m]=_.useState(null),g=_.useRef(""),x=_.useRef({code:r,onCode:c,onSubmit:o});x.current={code:r,onCode:c,onSubmit:o};const y=_.useCallback(async C=>{const{code:A,onCode:G,onSubmit:Z}=x.current;if(C&&A.trim()!=="")return;const Y=await xp();if(Y===null){C||m("Не получилось прочитать буфер — вставьте код в поле руками.");return}const H=Y.trim();if(!$b(H)){C||m("В буфере не похоже на код: нужен он целиком, вместе с частью после «#». Подойдёт и адрес страницы, на которую увёл браузер, — его тоже разберём.");return}if(C){if(g.current===H)return;g.current=H}m(null),G(H),Z(H)},[]);_.useEffect(()=>{if(!l.awaitingCode)return;const C=()=>{document.visibilityState==="visible"&&y(!0)};return document.addEventListener("visibilitychange",C),()=>document.removeEventListener("visibilitychange",C)},[l.awaitingCode,y]);const j=typeof((k=navigator.clipboard)==null?void 0:k.readText)=="function",v=r.trim()!==""&&!$b(r),E=h??(v?"Похоже, скопирована только часть кода — нужен он целиком, вместе с частью после «#».":null);return a.jsxs("div",{className:"account__flow",children:[l.url?s?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"field",children:"Подтвердите вход на странице Anthropic"}),a.jsx("a",{className:"btn btn--primary account__go",href:l.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:l.url}),a.jsx(qc,{text:l.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:l.url,target:"_blank",rel:"noreferrer",children:l.url})]})]}):a.jsx("p",{className:"modal__text",children:"Запускаем вход…"}),l.awaitingCode&&a.jsxs(a.Fragment,{children:[a.jsx("label",{className:"field",htmlFor:"auth-code",children:"Код со страницы авторизации"}),a.jsxs("div",{className:"extform__row account__coderow",children:[a.jsx("input",{id:"auth-code",className:"input input--mono",value:r,autoFocus:!s,spellCheck:!1,autoComplete:"off",placeholder:"код#state",onChange:C=>{m(null),c(C.target.value)},onKeyDown:C=>{C.key==="Enter"&&(C.preventDefault(),o())}}),j&&a.jsx("button",{type:"button",className:"btn",onClick:()=>void y(!1),children:"Вставить код"}),a.jsx("button",{type:"button",className:"btn btn--primary",disabled:r.trim()==="",onClick:()=>o(),children:"Готово"})]}),E&&a.jsx("p",{className:"account__note account__note--code",children:E})]}),l.output.trim()!==""&&a.jsx("pre",{className:"account__log",children:l.output.trim()}),a.jsx("div",{className:"extbar",children:a.jsx("button",{className:"btn",onClick:d,children:"Отменить вход"})})]})}function $b(l){const s=l.trim();if(/^https?:\/\//i.test(s))return/[?#&]code=/.test(s);const[r,c]=s.split("#");return!!r&&!!c&&!/\s/.test(s)}function BN({state:l,onPair:s,onUnpair:r,onClose:c}){const[o,d]=_.useState(""),[h,m]=_.useState(""),[g,x]=_.useState(!1),y=_.useRef(null),j=(l==null?void 0:l.paired)===!0;_.useEffect(()=>{var E;j||(E=y.current)==null||E.focus()},[j]),_.useEffect(()=>{x(!1),j&&d("")},[j,l==null?void 0:l.error]);const v=(l==null?void 0:l.url)??"https://claudevisual.com";return a.jsx(xl,{title:"Удалённый доступ",onClose:c,children:j?a.jsxs("div",{className:"relay",children:[a.jsxs("p",{className:"relay__lede",children:["Компьютер связан с аккаунтом на ",a.jsx("b",{children:Xb(v)}),". Открывайте его оттуда с любого устройства — с телефона в том числе."]}),a.jsxs("dl",{className:"relay__facts",children:[a.jsxs("div",{children:[a.jsx("dt",{children:"Имя"}),a.jsx("dd",{children:(l==null?void 0:l.name)??"—"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:"Связь"}),a.jsxs("dd",{children:[a.jsx("span",{className:l!=null&&l.connected?"dot dot--on":"dot"})," ",l!=null&&l.connected?"на связи":"нет связи, пробуем переподключиться"]})]}),a.jsxs("div",{children:[a.jsx("dt",{children:"Подключено"}),a.jsxs("dd",{children:[(l==null?void 0:l.clients)??0," вкладок"]})]})]}),(l==null?void 0:l.error)&&a.jsx("p",{className:"relay__error",children:l.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:Xb(v)})," и войдите (или зарегистрируйтесь)."]}),a.jsxs("li",{children:["Нажмите ",a.jsx("b",{children:"«Подключить ПК»"})," — появится код из восьми знаков."]}),a.jsx("li",{children:"Введите его сюда."})]}),a.jsxs("form",{className:"relay__form",onSubmit:E=>{E.preventDefault(),o.trim()&&(x(!0),s(o.trim(),h.trim()))},children:[a.jsxs("label",{className:"field",children:[a.jsx("span",{children:"Код сопряжения"}),a.jsx("input",{ref:y,className:"input relay__code",value:o,onChange:E=>d(E.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:E=>m(E.target.value),placeholder:"имя машины",autoComplete:"off",maxLength:64})]}),(l==null?void 0:l.error)&&a.jsx("p",{className:"relay__error",children:l.error}),a.jsx("button",{className:"btn btn--primary",type:"submit",disabled:!o.trim()||g,children:g?"Связываем…":"Связать"})]})]})})}function Xb(l){try{return new URL(l).host}catch{return l}}const Vb=[{id:"claude",label:"Claude",hint:"Claude Code"},{id:"antigravity",label:"Antigravity",hint:"Google agy"}],sp="",IN=[{value:"opus",label:"Opus",hint:"полный список моделей виден, когда открыта сессия"},{value:"sonnet",label:"Sonnet",hint:"полный список моделей виден, когда открыта сессия"},{value:"haiku",label:"Haiku",hint:"полный список моделей виден, когда открыта сессия"}],qN=p_.map(l=>({value:l.value,label:l.value,hint:l.hint})),Mf=3600*1e3,GN=[{value:"6h",label:"6 часов"},{value:"24h",label:"Сутки"},{value:"48h",label:"Двое суток"},{value:"168h",label:"Неделя"},{value:"never",label:"Никогда"}],Tc={"6h":6*Mf,"24h":24*Mf,"48h":48*Mf,"168h":168*Mf,never:0};function YN(l){return Tc[l]??Tc["48h"]}const $N=[{value:"5m",label:"5 минут"},{value:"10m",label:"10 минут"},{value:"30m",label:"30 минут"},{value:"60m",label:"Час"},{value:"never",label:"Никогда"}],Rf=60*1e3,Ec={"5m":5*Rf,"10m":10*Rf,"30m":30*Rf,"60m":60*Rf,never:0};function XN(l){return Ec[l]??Ec["10m"]}function VN(l){const s=Object.entries(Ec).find(([,r])=>r===l);return s?s[0]:Object.keys(Ec).reduce((r,c)=>Math.abs(Ec[c]-l)<Math.abs(Ec[r]-l)?c:r)}function QN(l){const s=Object.entries(Tc).find(([,r])=>r===l);return s?s[0]:Object.keys(Tc).reduce((r,c)=>Math.abs(Tc[c]-l)<Math.abs(Tc[r]-l)?c:r)}const KN=[{value:"off",label:"Выключено"},{value:"500",label:"0.5 с"},{value:"1500",label:"1.5 с"},{value:"3000",label:"3 с"},{value:"10000",label:"10 с"}],Cc={off:0,500:500,1500:1500,3e3:3e3,1e4:1e4};function ZN(l){return Cc[l]??Cc.off}function Qb(l){return Number.isFinite(l)?Math.min(100,Math.max(0,Math.round(l))):0}function FN(l){const s=Object.entries(Cc).find(([,r])=>r===l);return s?s[0]:Object.keys(Cc).reduce((r,c)=>Math.abs(Cc[c]-l)<Math.abs(Cc[r]-l)?c:r)}const JN=[{value:"project",title:"Только текущий проект",description:"Агент молча пишет файлы в открытом проекте и в ~/.claude — настройках самого Claude Code. Чужой проект и любая новая папка — только с явного разрешения."},{value:"projects",title:"Папка с проектами",description:"То же плюс каталог, где лежат открытые проекты, — то есть и соседний проект тоже. Всё остальное — с разрешения."},{value:"all",title:"Все папки на компьютере",description:"Агент пишет файлы куда угодно на диске — вопросов про место записи не будет.",risky:!0}];function PN({settings:l,models:s,relayState:r,networkState:c,local:o,onChange:d,onEnableShell:h,onDisableShell:m,onOpenRelay:g,onClose:x}){const y=l===null,[j,v]=_.useState(""),[E,k]=_.useState(null),C=!y&&l.networkGuardEnabled,A=(l==null?void 0:l.networkGuardBlockedCountries)??[];function G(){const D=j.trim().toUpperCase();if(D!==""){if(!/^[A-Z]{2}$/.test(D)){k("Нужен код из двух латинских букв, например RU или CN.");return}if(A.includes(D)){k(`Код ${D} уже в списке.`);return}k(null),v(""),d({networkGuardBlockedCountries:[...A,D]})}}const Z=!y&&l.terminalEnabled===!0,Y=!y&&l.liveSessionsFirst===!0,H=!Z,$=_.useMemo(()=>{const D=[{value:sp,label:"Как в Claude Code",hint:"модель определят настройки самого Claude Code"},...s.length>0?s.map(R=>({value:R.value,label:R.displayName,hint:R.description})):IN];return l&&l.startModel!==null&&!D.some(R=>R.value===l.startModel)&&D.push({value:l.startModel,label:l.startModel}),D},[s,l]);function B(){var D,R;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:H,onClick:g,children:"Связать компьютер"})]}):(D=r.shell)!=null&&D.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:H,onClick:m,children:"Запретить"})]}):(R=r.shell)!=null&&R.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:H,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:H,onClick:h,children:"Разрешить с телефона"})]}):a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"settings__hint",children:"Отсюда мгновенно не включится: на почту аккаунта уйдёт письмо, и терминал заработает только после перехода по ссылке из него."}),a.jsx("button",{type:"button",className:"btn",disabled:H,onClick:h,children:"Прислать письмо"})]})]})}return a.jsx(xl,{title:"Настройки",onClose:x,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:"Сессия, к которой долго не возвращались, сама уезжает в архив — на диске ничего не удаляется, транскрипт остаётся, и её можно вернуть обратно в любой момент."}),y?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(Cs,{className:"settings__select",value:QN(l.autoArchiveAfterMs),options:GN,onChange:D=>d({autoArchiveAfterMs:YN(D)}),ariaLabel:"Через сколько молчащая сессия уезжает в архив"})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Останавливать простаивающие сессии через"}),a.jsx("p",{className:"settings__hint",children:"Простаивающая живая сессия сама отпускает процесс CLI — освобождает память компьютера, на котором стоит хост. Простой — это когда сессия ничего не делает (не работает, не ждёт разрешения, фоновых задач нет), в ней ничего не происходит и ни в одном открытом окне не висит недописанный черновик для неё. Разговор при этом никуда не девается: открытая заново сессия, как и отправленное в неё сообщение, продолжают с того же места."}),y?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(Cs,{className:"settings__select",value:VN(l.autoStopAfterMs),options:$N,onChange:D=>d({autoStopAfterMs:XN(D)}),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-часового лимита, %"}),y?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:l.limitStopFiveHourPct,onChange:D=>d({limitStopFiveHourPct:Qb(D.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:"Остановка у недельного лимита, %"}),y?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:l.limitStopSevenDayPct,onChange:D=>d({limitStopSevenDayPct:Qb(D.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-клиента это не заменяет — его тоже стоит включить."})]}),y?a.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):a.jsx("button",{type:"button",role:"switch","aria-checked":C,"aria-label":"Kill switch: останавливать агентов, если упал VPN",className:C?"switch is-on":"switch",onClick:()=>d({networkGuardEnabled:!C}),children:a.jsx("span",{className:"switch__knob"})})]}),C&&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:C?"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:[A.map(D=>a.jsxs("li",{className:"countries__chip",children:[a.jsx("span",{children:D}),a.jsx("button",{type:"button",className:"countries__remove","aria-label":`Убрать ${D} из списка`,disabled:!C,onClick:()=>d({networkGuardBlockedCountries:A.filter(R=>R!==D)}),children:"×"})]},D)),A.length===0&&a.jsx("li",{className:"settings__hint",children:"Список пуст: блокировать будет только сбой проверки."})]}),a.jsxs("form",{className:"countries__add",onSubmit:D=>{D.preventDefault(),G()},children:[a.jsx("input",{type:"text",className:"input countries__input",value:j,maxLength:2,placeholder:"RU",autoCapitalize:"characters",spellCheck:!1,disabled:!C,"aria-label":"Код страны, две буквы","aria-invalid":E!==null,onChange:D=>{v(D.target.value.toUpperCase()),k(null)}}),a.jsx("button",{type:"submit",className:"btn",disabled:!C||j.trim()==="",children:"Добавить"})]}),E&&a.jsx("p",{className:"settings__hint countries__error",role:"alert",children:E})]})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Автосохранение"}),a.jsx("p",{className:"settings__hint",children:"Открытый файл сам уезжает на диск, если немного постоять без ввода — ручное сохранение, кнопкой или Ctrl+S, при этом всегда работает как обычно, независимо от этой настройки."}),y?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(Cs,{className:"settings__select",value:FN(l.autoSaveAfterPauseMs),options:KN,onChange:D=>d({autoSaveAfterPauseMs:ZN(D)}),ariaLabel:"Пауза перед автосохранением открытого файла"})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Агенты"}),a.jsx("p",{className:"settings__hint",children:"Выключенный агент не предлагается при создании новой сессии. Уже открытые сессии с ним продолжают работать."}),Vb.map(D=>{const R=(l==null?void 0:l.enabledProviders)??["claude","antigravity"],O=!y&&R.includes(D.id),ee=O&&R.length<=1;return a.jsxs("div",{className:"settings__switch-row settings__agent",children:[a.jsx("span",{className:`newsession__mark newsession__mark--${D.id}`,"aria-hidden":"true",children:D.id==="antigravity"?a.jsx(Lp,{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:D.label}),a.jsx("span",{className:"settings__hint",children:ee?"Хотя бы один агент должен остаться включённым":D.hint})]}),y?a.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):a.jsx("button",{type:"button",role:"switch","aria-checked":O,"aria-label":D.label,disabled:ee,title:ee?"Хотя бы один агент должен остаться включённым":void 0,className:O?"switch is-on":"switch",onClick:()=>{const P=Vb.map(ae=>ae.id).filter(ae=>ae===D.id?!O:R.includes(ae));d({enabledProviders:P})},children:a.jsx("span",{className:"switch__knob"})})]},D.id)})]}),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:"Модель"}),y?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(Cs,{className:"settings__select",value:l.startModel??sp,options:$,onChange:D=>d({startModel:D===sp?null:D}),ariaLabel:"Модель, с которой поднимается новая сессия"})]}),a.jsxs("div",{className:"settings__field",children:[a.jsx("span",{className:"settings__field-label",children:"Режим прав при старте"}),y?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(Cs,{className:"settings__select",value:l.startPermissionMode,options:qN,onChange:D=>d({startPermissionMode:D}),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:"Сессии, поднятые в хосте прямо сейчас — работают, готовы, ждут разрешения, работают в фоне, переподключаются, — показываются выше остальных в списке сессий проекта и в панели закреплённых. Порядок внутри каждой из двух частей остаётся тем, что задан руками."})]}),y?a.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):a.jsx("button",{type:"button",role:"switch","aria-checked":Y,"aria-label":"Запущенные сессии сверху",className:Y?"switch is-on":"switch",onClick:()=>d({liveSessionsFirst:!Y}),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:JN.map(D=>{const R=!y&&l.folderAccess===D.value;return a.jsxs("button",{type:"button",role:"radio","aria-checked":R,disabled:y,className:"access__card"+(R?" is-on":"")+(D.risky?" access__card--risky":""),onClick:()=>d({folderAccess:D.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:[D.title,D.risky&&a.jsx("span",{className:"access__risk",children:"самое широкое"})]}),a.jsx("span",{className:"access__desc",children:D.description})]})]},D.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-инструмент в разговоре. Выключите — и все открытые вкладки терминала закроются, а процессы в них не переживут закрытия."})]}),y?a.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):a.jsx("button",{type:"button",role:"switch","aria-checked":Z,"aria-label":"Терминал",className:Z?"switch is-on":"switch",onClick:()=>d({terminalEnabled:!Z}),children:a.jsx("span",{className:"switch__knob"})})]}),a.jsxs("div",{className:"settings__nested"+(H?" is-disabled":""),children:[a.jsx("h4",{className:"settings__nested-heading",children:"Удалённый доступ к терминалу"}),y?a.jsx("p",{className:"settings__hint",children:"Загрузка…"}):a.jsxs(a.Fragment,{children:[H&&a.jsx("p",{className:"settings__hint",children:"Сначала включите терминал выше — удалённый доступ выдаётся к тому, что на этой машине уже разрешено, а не поверх выключенного рубильника."}),B()]})]})]})]})})}const Kb={fiveHour:"5-часовой лимит",sevenDay:"недельный лимит"};function WN(l){if(!l)return"срок неизвестен";const s=new Date(l);return Number.isNaN(s.getTime())?"срок неизвестен":s.toLocaleString()}function ek({handoff:l,onContinue:s,onShow:r,onDismiss:c}){if(l.continuedAt!==void 0){const o=l.limit===null?`Хэндофф записан вручную ${new Date(l.stoppedAt).toLocaleString()}`:`${Kb[l.limit]} (${Math.round(l.utilization)} %) — работа прервана ${new Date(l.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(l.continuedAt).toLocaleString(),"."]})," ",o,".",l.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("button",{type:"button",className:"btn btn--sm",onClick:s,children:"Продолжить ещё раз"})]})]})}return a.jsxs("div",{className:"handoff",role:"status",children:[a.jsxs("div",{className:"handoff__msg",children:[a.jsx("span",{className:"handoff__dot","aria-hidden":"true"}),a.jsxs("span",{children:[l.limit===null?a.jsxs(a.Fragment,{children:["Хэндофф записан вручную ",new Date(l.stoppedAt).toLocaleString()," — сессия остановлена."]}):a.jsxs(a.Fragment,{children:[Kb[l.limit]," (",Math.round(l.utilization)," %) — работа прервана"," ",new Date(l.stoppedAt).toLocaleString(),". Окно сбросится: ",WN(l.resetsAt),"."]}),l.source==="journal"&&" Хэндофф собран автоматически из журнала."]})]}),a.jsxs("div",{className:"handoff__actions",children:[a.jsx("button",{type:"button",className:"btn btn--sm btn--primary",onClick:s,children:"Продолжить в новой сессии"}),a.jsx("button",{type:"button",className:"btn btn--sm",onClick:r,children:"Показать хэндофф"}),a.jsx("button",{type:"button",className:"btn btn--sm",onClick:c,children:"Скрыть"})]})]})}function tk({handoff:l,onClose:s}){const[r,c]=_.useState("");return _.useEffect(()=>{let o=!1;return Wf(l.text).then(d=>{o||c(d)}),()=>{o=!0}},[l.text]),a.jsx(xl,{title:"Хэндофф",className:"modal--wide",onClose:s,children:a.jsx("div",{className:"markdown-preview",dangerouslySetInnerHTML:{__html:r}})})}function nk({state:l}){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:l.reason??"Не удалось убедиться, что запросы идут через VPN"}),a.jsx("span",{className:"netguard__note",children:"Запросы агента остановлены, отправка отключена. Когда VPN вернётся, сессии можно продолжить: следующее сообщение возобновит разговор."})]})]})}const Kf={fiveHour:"5-часовой лимит",sevenDay:"недельный лимит"},lk=12e3;function sk(l){const s=l%10,r=l%100;return s===1&&r!==11?"сессии":"сессиях"}function ak({notices:l,onDismiss:s}){return l.length===0?null:a.jsx("div",{className:"limittoasts",children:l.map(r=>a.jsx(ik,{notice:r,onDismiss:()=>s(r.id)},r.id))})}function ik({notice:l,onDismiss:s}){return _.useEffect(()=>{const r=window.setTimeout(s,lk);return()=>window.clearTimeout(r)},[s]),a.jsxs("div",{className:"limittoast",role:"status",children:[a.jsx("span",{className:"limittoast__dot","aria-hidden":"true"}),a.jsx("span",{className:"limittoast__body",children:l.stopped>0?a.jsxs(a.Fragment,{children:["Достигнут ",Kf[l.limit]," (",Math.round(l.utilization)," %): работа прервана в ",l.stopped," ",sk(l.stopped),", хэндоффов —"," ",l.handoffs,". Сессии остаются запущенными."]}):a.jsxs(a.Fragment,{children:["Достигнут ",Kf[l.limit]," (",Math.round(l.utilization)," %): занятых сессий не было — ничего не прервано."]})}),a.jsx("button",{type:"button",className:"limittoast__dismiss","aria-label":"Закрыть уведомление",onClick:s,children:"✕"})]})}function rk(l,s,r=Date.now()){if(!l||!l.available||!s)return null;const c=[["fiveHour",l.fiveHour,s.limitStopFiveHourPct],["sevenDay",l.sevenDay,s.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 ck(l,s=Date.now()){const r=new Date(l),c=r.toLocaleTimeString("ru-RU",{hour:"2-digit",minute:"2-digit"});return r.toDateString()===new Date(s).toDateString()?c:`${r.toLocaleDateString("ru-RU",{day:"numeric",month:"short"})}, ${c}`}const ok=16;function uk({pane:l,width:s,onResize:r,onReset:c}){const o=jr[l],d=_.useRef(null);function h(y){if(y.button!==0)return;const j=document.querySelector(".main"),v=j?Math.max(0,j.getBoundingClientRect().width-ev):0;d.current={x:y.clientX,width:s,max:Math.min(o.max,s+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(s+j*ok*(o.side==="left"?1:-1)))}return a.jsx("div",{className:`pane-resizer pane-resizer--${l} pane-resizer--${o.side}`,role:"separator","aria-orientation":"vertical","aria-label":`Ширина панели ${o.label}`,"aria-valuenow":s,"aria-valuemin":o.min,"aria-valuemax":o.max,tabIndex:0,title:"Потяните, чтобы изменить ширину; двойной щелчок — ширина по умолчанию",onPointerDown:h,onPointerMove:m,onPointerUp:g,onPointerCancel:g,onDoubleClick:c,onKeyDown:x,children:a.jsx("span",{className:"pane-resizer__line","aria-hidden":"true"})})}const fk=16;function dk({height:l,onResize:s,onReset:r}){const c=_.useRef(null);function o(){const x=document.querySelector(".main .transcript, .main .editor");if(!x)return 1/0;const y=x.getBoundingClientRect().height-sv;return Math.round(l+Math.max(0,y))}function d(x){x.button===0&&(c.current={y:x.clientY,height:l,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;s(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(),s(l+y*fk,o()))}return a.jsx("div",{className:"term-resizer",role:"separator","aria-orientation":"horizontal","aria-label":"Высота панели терминала","aria-valuenow":l,"aria-valuemin":x_,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 Zb(){const l=document.documentElement,s=getComputedStyle(l),r=Z=>s.getPropertyValue(Z).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"),E=r("--cm-fn"),k=r("--cm-key"),C=r("--cm-type"),A=Fb(o,c,55),G=Z=>Fb(Z,"#ffffff",25);return{background:c,foreground:o,cursor:m,cursorAccent:g,selectionBackground:x,black:A,brightBlack:h,red:y,brightRed:G(y),green:j,brightGreen:G(j),yellow:v,brightYellow:G(v),blue:E,brightBlue:G(E),magenta:k,brightMagenta:G(k),cyan:C,brightCyan:G(C),white:d,brightWhite:o}}function hk(){return getComputedStyle(document.documentElement).getPropertyValue("--mono").trim()}let Fs=null;function pk(l){return Fs||(Fs=document.createElement("span"),Fs.style.position="fixed",Fs.style.width="0",Fs.style.height="0",Fs.style.opacity="0",Fs.style.pointerEvents="none",document.body.appendChild(Fs)),Fs.style.color=l,getComputedStyle(Fs).color}function Fb(l,s,r){return pk(`color-mix(in srgb, ${l} ${100-r}%, ${s} ${r}%)`)}let Df=null;function mk(){return Df||(Df=Promise.all([Pe(()=>import("./xterm-D6Mng-DB.js").then(l=>l.x),__vite__mapDeps([22,23]),import.meta.url),Pe(()=>import("./addon-fit-CevVMrUA.js").then(l=>l.a),__vite__mapDeps([24,23]),import.meta.url),Pe(()=>import("./addon-web-links-CnB65OV_.js").then(l=>l.a),__vite__mapDeps([25,23]),import.meta.url),Pe(()=>Promise.resolve({}),__vite__mapDeps([26]),import.meta.url)]).then(([l,s,r])=>({Terminal:l.Terminal,FitAddon:s.FitAddon,WebLinksAddon:r.WebLinksAddon})).catch(l=>{throw Df=null,l})),Df}function gk({terminals:l,activeId:s,blocked:r,error:c,onDismissError:o,height:d,offset:h,mobile:m=!1,zoomed:g,onToggleZoom:x,onSelect:y,onOpen:j,onClose:v,onInput:E,onResize:k,onAttach:C,onHide:A,registerSink:G}){const[Z,Y]=_.useState(()=>Zb());return _.useEffect(()=>{const H=new MutationObserver(()=>Y(Zb()));return H.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>H.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:H=>{x&&(H.target.closest("button")||x())},children:[a.jsx("div",{className:"termpanel__tabs",role:"tablist","aria-label":"Открытые терминалы",children:l.map(H=>a.jsxs("div",{role:"tab","aria-selected":H.id===s,className:"termtab"+(H.id===s?" is-on":"")+(H.exitCode!==null?" termtab--exited":""),onDoubleClick:$=>{x&&($.target.closest(".termtab__close")||x())},children:[a.jsx("button",{className:"termtab__name",title:H.cwd,onClick:()=>y(H.id),children:H.title}),H.exitCode!==null&&a.jsx("span",{className:"termtab__code",title:`Оболочка завершилась с кодом ${H.exitCode}`,children:H.exitCode}),a.jsx("button",{className:"termtab__close",title:"Закрыть терминал","aria-label":`Закрыть терминал «${H.title}»`,onClick:()=>v(H.id),children:"✕"})]},H.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(Yc,{active:g})}),a.jsx("button",{className:"termpanel__hide",title:"Скрыть панель","aria-label":"Скрыть панель терминала",onClick:A,children:"✕"})]}),c&&l.length>0&&a.jsx(Jb,{message:c,strip:!0,onRetry:null,onDismiss:o}),a.jsxs("div",{className:"termpanel__body",children:[c&&l.length===0?a.jsx(Jb,{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:"Откройте «Удалённый доступ» → «Прислать письмо»: на почту аккаунта придёт ссылка, и после перехода по ней терминал заработает прямо здесь. Если сейчас доберётесь до самого компьютера — там разрешение включается сразу, без письма."})]}):l.length===0&&a.jsxs("div",{className:"termpanel__empty",children:[a.jsx("p",{children:"Терминалов не открыто"}),a.jsx("button",{className:"btn btn--primary",onClick:j,children:"Открыть терминал"})]}),l.map(H=>a.jsx(bk,{id:H.id,exitCode:H.exitCode,active:H.id===s,theme:Z,mobile:m,onInput:E,onResize:k,onAttach:C,registerSink:G},H.id))]})]})}function Jb({message:l,strip:s=!1,onRetry:r,onDismiss:c}){const{lede:o,hint:d,details:h}=xk(l);return a.jsxs("div",{className:s?"termfail termfail--strip":"termfail",role:"alert",children:[a.jsxs("div",{className:"termfail__text",children:[a.jsx("p",{className:"termfail__lede",children:o}),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 xk(l){const[s="",...r]=l.trim().split(`
|
|
124
|
+
|
|
125
|
+
`),c=s.split(`
|
|
126
|
+
`).map(o=>o.trim()).filter(o=>o!=="");return{lede:c[0]??l.trim(),hint:c.slice(1).join(" "),details:r.join(`
|
|
127
|
+
|
|
128
|
+
`).trim()}}function bk({id:l,exitCode:s,active:r,theme:c,mobile:o,onInput:d,onResize:h,onAttach:m,registerSink:g}){const x=_.useRef(null),y=_.useRef(null),j=_.useRef(!1),v=_.useRef(o);v.current=o;const E=_.useRef(c),k=_.useRef(s),[C,A]=_.useState("loading"),[G,Z]=_.useState(!1);return _.useEffect(()=>{if(!x.current)return;let H=!1,$=null;A("loading"),Z(!1);const B=window.setTimeout(()=>{H||Z(!0)},200);return(async()=>{var Ae;let D;try{D=await mk()}catch{window.clearTimeout(B),H||A("error");return}if(H||!x.current)return;window.clearTimeout(B);const{Terminal:R,FitAddon:O,WebLinksAddon:ee}=D,P=new R({fontFamily:hk()||"monospace",fontSize:13,lineHeight:1.2,cursorBlink:!0,cursorStyle:"bar",scrollback:5e3,theme:E.current}),ae=new O;P.loadAddon(ae),P.loadAddon(new ee),P.open(x.current),y.current=P,P.attachCustomKeyEventHandler(w=>{if(w.type!=="keydown"||!(w.ctrlKey||w.metaKey))return!0;if(w.key==="`")return w.preventDefault(),!1;if(w.key==="c"||w.key==="C"){const z=P.getSelection();return z?(w.preventDefault(),sa(z),!1):!w.shiftKey}return w.key==="v"||w.key==="V"?(w.preventDefault(),xp().then(z=>{z&&P.paste(z)}),!1):!0});const be=w=>{w.preventDefault();const V=P.getSelection();if(V){sa(V),P.clearSelection();return}xp().then(z=>{z&&P.paste(z)})};(Ae=P.element)==null||Ae.addEventListener("contextmenu",be);const Ee=P.onData(w=>d(l,w));let je={cols:P.cols,rows:P.rows},X=null;const ue=P.onResize(({cols:w,rows:V})=>{X!==null&&window.clearTimeout(X),X=window.setTimeout(()=>{X=null,!(w===je.cols&&V===je.rows)&&(je={cols:w,rows:V},h(l,w,V))},100)}),de=new ResizeObserver(()=>{try{ae.fit()}catch{return}v.current&&P.scrollToBottom()});de.observe(x.current);const _e=g(l,w=>{w.kind==="buffer"&&P.reset(),P.write(w.data)});m(l),k.current!==null&&!j.current&&(j.current=!0,P.write(`\r
|
|
129
|
+
\x1B[2m— Процесс завершён (код ${k.current}) —\x1B[0m\r
|
|
130
|
+
`)),r&&P.focus(),$=()=>{var w;X!==null&&window.clearTimeout(X),de.disconnect(),(w=P.element)==null||w.removeEventListener("contextmenu",be),Ee.dispose(),ue.dispose(),_e(),P.dispose(),y.current=null},A("ready")})(),()=>{H=!0,window.clearTimeout(B),$==null||$(),$=null}},[l]),_.useEffect(()=>{if(!o)return;const Y=x.current;if(!Y)return;let H=null,$=0,B=!1;const D=P=>{P.pointerType==="mouse"||H!==null||(H=P.pointerId,$=P.clientY,B=!1)},R=P=>{if(P.pointerId!==H)return;const ae=$-P.clientY;if(!B){if(Math.abs(ae)<4)return;B=!0,Y.setPointerCapture(P.pointerId)}$=P.clientY;const be=Y.querySelector(".xterm-viewport");be&&(be.scrollTop+=ae)},O=P=>{P.pointerId===H&&(Y.hasPointerCapture(P.pointerId)&&Y.releasePointerCapture(P.pointerId),H=null,B=!1)},ee=P=>P.stopPropagation();return Y.addEventListener("pointerdown",D),Y.addEventListener("pointermove",R),Y.addEventListener("pointerup",O),Y.addEventListener("pointercancel",O),Y.addEventListener("touchmove",ee,{capture:!0}),()=>{Y.removeEventListener("pointerdown",D),Y.removeEventListener("pointermove",R),Y.removeEventListener("pointerup",O),Y.removeEventListener("pointercancel",O),Y.removeEventListener("touchmove",ee,{capture:!0}),H!==null&&Y.hasPointerCapture(H)&&Y.releasePointerCapture(H)}},[o]),_.useEffect(()=>{E.current=c,y.current&&(y.current.options.theme=c)},[c]),_.useEffect(()=>{var Y;r&&((Y=y.current)==null||Y.focus())},[r]),_.useEffect(()=>{if(k.current=s,s===null){j.current=!1;return}if(j.current)return;const Y=y.current;Y&&(j.current=!0,Y.write(`\r
|
|
131
|
+
\x1B[2m— Процесс завершён (код ${s}) —\x1B[0m\r
|
|
132
|
+
`))},[s]),a.jsxs("div",{className:"termview"+(r?" is-active":""),children:[a.jsx("div",{ref:x,className:"termview__surface"+(C==="ready"?"":" is-hidden")}),C==="loading"&&G&&a.jsxs("div",{className:"termview__state work",role:"status",children:[a.jsxs("div",{className:"work__dots",children:[a.jsx("span",{className:"work__dot"}),a.jsx("span",{className:"work__dot"}),a.jsx("span",{className:"work__dot"})]}),a.jsx("span",{className:"work__label",children:"Загружается терминал…"})]}),C==="error"&&a.jsxs("div",{className:"termview__state termview__state--error",role:"alert",children:[a.jsx("p",{children:"Не удалось загрузить терминал"}),a.jsx("p",{className:"termpanel__hint",children:"Соединение оборвалось раньше, чем приехал нужный модуль — на мобильном relay это обычное дело на слабой сети. Ниже — перезагрузка страницы, а не тихий повтор: открытые терминалы и их содержимое приедут обратно с хоста, а вот черновик в поле ввода внизу — нет."}),a.jsx("button",{className:"btn btn--primary",onClick:()=>window.location.reload(),children:"Перезагрузить страницу"})]})]})}const _k=2e5,yk=75,vk=90;function jk({tokens:l,maxTokens:s,fetchedAt:r}){if(l===null)return null;const c=s??_k,o=Math.min(100,Math.round(l/c*100)),d=`${l.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${wk(o)}`,style:{width:`${o}%`}})}),a.jsxs("span",{className:"contextbar__pct",children:[o,"%"]})]})}function wk(l){return l>=vk?" contextbar__fill--over":l>=yk?" contextbar__fill--warn":""}const ay="ccv:last-session",Sk=300*1e3,Nk=1e4;function kk(){try{const l=localStorage.getItem(ay);if(!l)return null;const s=JSON.parse(l);if(typeof s!="object"||s===null)return null;const{workspaceId:r,sessionId:c,claudeSessionId:o}=s;return typeof r!="string"||typeof c!="string"?null:{workspaceId:r,sessionId:c,claudeSessionId:typeof o=="string"?o:null}}catch{return null}}function Tk(l,s){const r=l.find(o=>o.id===s);if(r)return r;const c=l.filter(o=>M0(o.path).includes(s));return c.length===1?c[0]:void 0}function Ek(l,s){return l.id===s.sessionId?!0:s.claudeSessionId?l.id===s.claudeSessionId||l.claudeSessionId===s.claudeSessionId:!1}const Ck={mcp:"mcp",plugins:"plugins",plugin:"plugins"},Pb=[{name:"login",description:"Войти в аккаунт Claude — окно приложения",argumentHint:"",aliases:["signin","вход"]},{name:"switch-account",description:"Сменить аккаунт: выйти и войти заново",argumentHint:"",aliases:["account","аккаунт"]},{name:"logout",description:"Выйти из аккаунта Claude",argumentHint:"",aliases:["signout","выход"]}],Ak={active:!1,url:"",awaitingCode:!1,output:"",error:null};function Wb(l,s,r){if(l===null)return null;const c=l.lastIndexOf("/");if(c===-1&&l!=="")return s;const o=r[c===-1?"":l.slice(0,c)];if(!o)return null;const d=l.slice(c+1).toLowerCase();return d===""?{query:l,entries:o}:{query:l,entries:o.filter(h=>h.name.toLowerCase().includes(d)).sort((h,m)=>e_(h.name,d)-e_(m.name,d))}}function e_(l,s){return l.toLowerCase().startsWith(s)?0:1}function t_(l,s){const r=l.find(o=>o.value===s)??l.find(o=>o.resolvedModel===s),c=s&&!r?s:null;return{rows:[...c?[{value:c,resolvedModel:c,displayName:c,description:"задана в настройках",supportsEffort:!1,effortLevels:[],supportsThinking:!0,supportsAutoMode:!1}]:[],...l],selected:(r==null?void 0:r.value)??c??(l.some(o=>o.value==="default")?"default":"")}}function Mk(){var _o,$s;const l=_.useRef(null),[s,r]=_.useState(!1),[c,o]=_.useState("Нет связи с хостом"),[d,h]=_.useState(null),[m,g]=_.useState(null),x=(m==null?void 0:m.status)==="blocked",[y,j]=_.useState(!1),v=_.useMemo(()=>zf()==="relay",[]),[E,k]=_.useState([]),[C,A]=_.useState([]),[G,Z]=_.useState([]),[Y,H]=_.useState([]),[$,B]=_.useState([]),[D,R]=_.useState([]),[O,ee]=_.useState([]),[P,ae]=_.useState([]),[be,Ee]=_.useState([]),[je,X]=_.useState(null),[ue,de]=_.useState(null),[_e,Ae]=_.useState(null),[w,V]=_.useState(null),[z,ge]=_.useState(null),[ve,Re]=_.useState(null),[Oe,Ue]=_.useState(kl),[qe,rn]=_.useState(Ih),[Ve,Ft]=_.useState(!1),[ut,ht]=_.useState(!1),Ge=Ff("(max-width: 860px)"),[cn,Nn]=_.useState(!1);_.useEffect(()=>{Ge||Nn(!1)},[Ge]);const[st,kn]=_.useState(!1),[Wn,on]=_.useState([]),[el,qt]=_.useState(!1),[tt,Ot]=_.useState(kl),[Yn,Ct]=_.useState(null),[nt,at]=_.useState(null),[pn,yn]=_.useState([]),[Zn,en]=_.useState(null),[St,Jt]=_.useState(null),[Nt,tl]=_.useState([]),[le,me]=_.useState([]),[Be,Fe]=_.useState([]),[Ie,At]=_.useState([]),[I,oe]=_.useState(null),[Ne,Le]=_.useState(null),[kt,Tn]=_.useState({}),[ul,yl]=_.useState(null),[ds,Fl]=_.useState({}),[Jl,Pl]=_.useState(null),[Ka,fl]=_.useState([]),[nl,Lt]=_.useState(!1),[Ze,vn]=_.useState(null),[Vt,vl]=_.useState(null),Pt=(Vt==null?void 0:Vt.enabledProviders)??["claude","antigravity"],[hs,Qt]=_.useState(!1),[ps,xt]=_.useState(Ak),[un,On]=_.useState(null),[pt,it]=_.useState(null),[En,dl]=_.useState(!1),[$n,,hl]=J0(),Ln=lv(),[mn,jl]=_.useState(!1),[gn,El]=_.useState(null),[ll,jn]=_.useState(null),[Kt,ms]=_.useState(null),[aa,Cn]=_.useState(null),[Wl,Cl]=_.useState(null),[es,Xn]=_.useState(""),[ia,gs]=_.useState(null),[ts,Al]=_.useState([]),[pe,T]=_.useState(!1),[Q,he]=_.useState(null),[ye,He]=_.useState(!1),[we,_t]=_.useState(!1),[zt,tn]=_.useState({}),[yt,xn]=_.useState([""]),[Mt,zn]=_.useState([]),[sl,Gl]=_.useState(null),[N,ie]=_.useState(null),[Te,Ke]=_.useState(null),[Vn,Ms]=_.useState(null),[Rs,Gi]=_.useState(null),[ra,$c]=_.useState({}),[ca,Yi]=_.useState({}),[Ds,Un]=_.useState(!1),[oa,Za]=_.useState(null),[Os,Xc]=_.useState(null),Er=_.useRef(0),Fa=_.useRef(null),[ns,Ja]=_.useState(!1),[$i,Xi]=_.useState([]),[ed,Cr]=_.useState(null),[Vc,Ar]=_.useState(null),Mr=av(),Qc=ov(Ge&&ns),Vi=_.useRef(new Map),ua=(Vt==null?void 0:Vt.terminalEnabled)===!0,Qi=zf()==="relay"&&((_o=d==null?void 0:d.shell)==null?void 0:_o.enabled)!==!0,Kc=_.useRef(!1),td=_.useCallback((p,U)=>(Vi.current.set(p,U),()=>{Vi.current.get(p)===U&&Vi.current.delete(p)}),[]),[fa,Rr]=_.useState(!1),[Dr,Or]=_.useState(null),[ou,Lr]=_.useState(kl),[ls,zr]=_.useState(null),[Ki,da]=_.useState({}),Zi=_.useRef([]),[fn,Zc]=_.useState(null);function nd(p){Zc(U=>U===p?null:p)}_.useEffect(()=>{(Ge||fn==="terminal"&&!ns||fn==="files"&&!we||fn==="search"&&!Ds||fn==="git"&&!mn||fn==="ask"&&!fa||fn==="main"&&Mt.length===0)&&Zc(null)},[fn,Ge,ns,we,Ds,mn,fa,Mt.length]);const[ld]=_.useState(kk),Fc=_.useRef(ld),Pa=_.useRef(!1),dn=_.useRef(null),Fi=_.useRef(null),Wa=_.useRef(null),Jc=_.useRef(0),An=_.useRef(null),Pc=_.useRef(0);dn.current=z,An.current=w,Pc.current=Oe.lastSeq;const Wc=_.useRef(qe);Wc.current=qe;const pl=_.useRef(null),uu=_.useRef(0);uu.current=ou.lastSeq;const Ur=_.useRef(null),Hr=_.useRef(""),ei=_.useRef(null),Ls=_.useRef([]),ti=_.useRef([""]);Ls.current=Mt,ti.current=yt;const xs=_.useRef(new Map),Br=_.useRef(new Set),zs=_.useRef(null),ni=_.useRef(null),eo=_.useRef(0),ha=_.useRef(new Set);_.useEffect(()=>{const p=B0();if(!p)return;l.current=p;const U=()=>{r(p.connected),o(p.statusText)};p.onStatus(U),p.onReconnect(()=>{U(),Fl({});const bt=dn.current;bt&&p.send({type:"session.sync",sessionId:bt,sinceSeq:Pc.current});const Wt=pl.current;Wt&&p.send({type:"session.sync",sessionId:Wt,sinceSeq:uu.current})});const re=p.on(bt=>to(bt));p.connect();const Me=window.setInterval(()=>{U(),p.connected&&p.send({type:"ping",nonce:Date.now()})},15e3);return()=>{re(),window.clearInterval(Me),p.close()}},[]);const to=_.useCallback(p=>{var U,re,Me,bt,Wt,al,Da,lc,mi;switch(p.type){case"hello.ok":r(!0);break;case"workspace.list":{k(p.workspaces),A(p.archived),V(Qe=>{var as;if(Qe)return Qe;const lt=Fc.current,vt=lt&&Tk(p.workspaces,lt.workspaceId);return lt&&vt&&vt.id!==lt.workspaceId&&(Fc.current={...lt,workspaceId:vt.id}),(vt==null?void 0:vt.id)??((as=p.workspaces[0])==null?void 0:as.id)??null});const xe=ei.current;if(!xe)break;const Ce=p.workspaces.find(Qe=>Uk(Qe.path,xe));if(!Ce)break;ei.current=null,kn(!1),V(Ce.id);break}case"workspace.candidates":if(p.query.trim()!==Hr.current)break;on(p.candidates),p.source==="host"&&qt(!1);break;case"finder.opened":Ur.current=p.sessionId;break;case"workspace.roots":yn(p.roots);break;case"workspace.created":if(V(p.workspace.id),p.warnings.length===0){kn(!1),at(null);break}en({path:p.workspace.path,warnings:p.warnings});break;case"session.list":if(p.workspaceId!==An.current)break;R(p.sessions),ee(p.archived);break;case"folder.list":Z(p.workspaceFolders),H(p.sessionFolders),B(p.pinnedFolders??[]);break;case"session.pinned":ae(p.sessions);break;case"session.live":Ee(p.sessions);break;case"order.state":Ae(p.order);break;case"session.summary":if(p.session.id===Ur.current){Ct(p.session);break}if(p.session.parentSessionId){p.session.id===pl.current&&zr(p.session);break}if(Ee(xe=>{const Ce=xe.findIndex(lt=>lt.id===p.session.id);if(p.session.state==="closed")return Ce===-1?xe:xe.filter(lt=>lt.id!==p.session.id);if(Ce===-1)return[...xe,p.session];const Qe=xe.slice();return Qe[Ce]=p.session,Qe}),R(xe=>{const Ce=xe.findIndex(lt=>lt.id===p.session.id);if(Ce===-1)return[p.session,...xe];const Qe=xe.slice();return Qe[Ce]=p.session,Qe}),ae(xe=>{const Ce=xe.findIndex(lt=>lt.id===p.session.id);if(Ce===-1)return xe;const Qe=xe.slice();return Qe[Ce]={...p.session,pinned:!0,...xe[Ce].pinnedAt?{pinnedAt:xe[Ce].pinnedAt}:{}},Qe}),dn.current===null&&Wa.current&&Wa.current.workspaceId===p.session.workspaceId&&(u_(p.session.id,Wa.current.text),Wa.current=null),ge(xe=>xe??p.session.id),((U=Fi.current)==null?void 0:U.sessionId)===p.session.id){const xe=Fi.current;p.session.state==="error"?Fi.current=null:p.session.state!=="closed"&&(Fi.current=null,(re=l.current)==null||re.send({type:"prompt.send",sessionId:xe.sessionId,text:xe.text,images:xe.images}))}break;case"usage.state":p.sessionId===dn.current&&(On(p.usage),dl(!1));break;case"context.state":p.sessionId===dn.current&&(it(p.context),dl(!1));break;case"session.capabilities":p.sessionId===dn.current&&Re(p.capabilities);break;case"session.events":if(p.sessionId===pl.current){Lr(xe=>Uf(xe,p.entries));break}if(p.sessionId===Ur.current){Ot(xe=>Uf(xe,p.entries));break}if(p.sessionId!==dn.current)break;for(const xe of p.entries){if(xe.event.kind!=="rewound")continue;const Ce=xe.event.toUserIndex,Qe=Z0(Wc.current.entries,Ce),lt=Qe.reduce((vt,as)=>as.event.kind==="user.message"?vt+1:vt,0);rn(vt=>({...vt,entries:Qe})),Ue(vt=>({...vt,items:F0(vt.items,Ce,lt)}))}Ue(xe=>Uf(xe,p.entries));break;case"session.history":if(p.sessionId!==dn.current)break;rn(xe=>V0(xe,p));break;case"side.opened":{if(p.parentSessionId!==dn.current)break;pl.current=p.sessionId,Or(p.sessionId);const xe=Zi.current;Zi.current=[];for(const Ce of xe)Ce(p.sessionId);break}case"side.closed":if(p.parentSessionId!==dn.current)break;pl.current=null,Or(null),Lr(kl),zr(null);break;case"git.state":if(p.workspaceId!==An.current)break;El(p.state);break;case"git.commit":if(p.workspaceId!==An.current)break;jn(p.detail);break;case"git.result":if(p.workspaceId!==An.current)break;Cn({ok:p.ok,message:p.message,url:p.url}),p.ok&&(jn(null),ms(null),T(!1),He(!1));break;case"git.busy":if(p.workspaceId!==An.current)break;Xn(p.label);break;case"git.files":if(p.workspaceId!==An.current)break;he({files:p.files,truncated:p.truncated});break;case"github.status":gs(p.status);break;case"github.owners":Al(p.owners);break;case"fs.dir":if(p.workspaceId!==An.current)break;tn(xe=>({...xe,[p.path]:p.entries}));break;case"fs.search":if(p.workspaceId!==An.current)break;if(p.scope!=="tree"){const xe=p.scope;Yi(Ce=>({...Ce,[xe]:{query:p.query,entries:p.entries}}));break}Gi({query:p.query,entries:p.entries,truncated:p.truncated});break;case"fs.grep":if(p.workspaceId!==An.current)break;Za({query:p.query,matches:p.matches,truncated:p.truncated});break;case"fs.file":{if(p.workspaceId!==An.current)break;const xe=Br.current.delete(p.file.path);zn(Qe=>{const lt=Qe.findIndex(yo=>yo.path===p.file.path);if(lt===-1)return[...Qe,_b(p.file,++eo.current)];const vt=Qe[lt],as=Qe.slice();return as[lt]=vt.saved===p.file.content&&!Xa(vt)?{...vt,mtime:p.file.mtime,size:p.file.size,stale:!1}:_b(p.file,++eo.current),as}),xe&&Gl(p.file.path);const Ce=Fa.current;Ce&&Ce.path===p.file.path&&(Fa.current=null,Xc({...Ce,token:++Er.current}));break}case"fs.media":{if(p.workspaceId!==An.current)break;ha.current.delete(p.path),zn(xe=>xe.map(Ce=>Ce.path===p.path?{...Ce,mediaBase64:p.base64,mediaError:void 0}:Ce));break}case"fs.mediaFailed":{if(p.workspaceId!==An.current)break;ha.current.delete(p.path),zn(xe=>xe.map(Ce=>Ce.path===p.path?{...Ce,mediaError:p.message}:Ce));break}case"fs.saved":{if(p.workspaceId!==An.current)break;const xe=xs.current.get(p.path);xs.current.delete(p.path);const Ce=xe!==void 0;zn(lt=>lt.map(vt=>vt.path!==p.path?vt:Ce?{...vt,saved:xe,mtime:p.mtime,size:p.size,stale:!1}:{...vt,stale:!0}));const Qe=Ls.current.find(lt=>lt.path===p.path);!Ce&&Qe&&!Xa(Qe)&&((Me=l.current)==null||Me.send({type:"fs.read",workspaceId:p.workspaceId,path:p.path})),(bt=l.current)==null||bt.send({type:"git.state",workspaceId:p.workspaceId});break}case"fs.result":{if(p.workspaceId!==An.current)break;if(ie({ok:p.ok,message:p.message}),p.ok||xs.current.delete(p.path),p.conflict&&zn(Ce=>Ce.map(Qe=>Qe.path===p.path?{...Qe,stale:!0}:Qe)),ni.current===p.path){const Ce=ni.current;ni.current=null,p.ok&&(Br.current.add(Ce),(Wt=l.current)==null||Wt.send({type:"fs.read",workspaceId:p.workspaceId,path:Ce}))}const xe=zs.current;if(p.ok&&xe&&xe.to===p.path){zs.current=null;const Ce=Qe=>Qe===xe.from?xe.to:Qe.startsWith(`${xe.from}/`)?xe.to+Qe.slice(xe.from.length):Qe;zn(Qe=>Qe.map(lt=>({...lt,path:Ce(lt.path)}))),Gl(Qe=>Qe===null?null:Ce(Qe)),xn(Qe=>Qe.map(Ce)),tn(Qe=>{const lt={};for(const[vt,as]of Object.entries(Qe))vt===xe.from||vt.startsWith(`${xe.from}/`)||(lt[vt]=as);return lt})}p.ok&&((al=l.current)==null||al.send({type:"git.state",workspaceId:p.workspaceId}));break}case"term.list":if(p.workspaceId!==An.current)break;Xi(p.terminals);break;case"term.opened":if(p.terminal.workspaceId!==An.current)break;Ar(null),Xi(xe=>{const Ce=xe.findIndex(lt=>lt.id===p.terminal.id);if(Ce===-1)return[...xe,p.terminal];const Qe=xe.slice();return Qe[Ce]=p.terminal,Qe}),Kc.current&&(Kc.current=!1,Cr(p.terminal.id));break;case"term.buffer":(Da=Vi.current.get(p.id))==null||Da({kind:"buffer",data:p.data});break;case"term.data":(lc=Vi.current.get(p.id))==null||lc({kind:"data",data:p.data});break;case"term.exit":Xi(xe=>xe.map(Ce=>Ce.id===p.id?{...Ce,exitCode:p.exitCode}:Ce));break;case"term.closed":Xi(xe=>xe.filter(Ce=>Ce.id!==p.id));break;case"mcp.list":p.sessionId===dn.current&&tl(p.servers);break;case"mcp.auth":p.sessionId===dn.current&&Le(p.state);break;case"plugin.list":if(p.sessionId!==dn.current)break;me(p.plugins),Fe(p.marketplaces),At(p.catalog);break;case"operation.result":p.sessionId===dn.current&&oe(p.result);break;case"auth.status":vn(p.status);break;case"relay.state":h(p.state);break;case"network.state":g(p.state);break;case"settings.state":vl(p.settings);break;case"handoff.state":Tn(xe=>{if(!p.handoff){if(!(p.sessionId in xe))return xe;const Ce={...xe};return delete Ce[p.sessionId],Ce}return{...xe,[p.sessionId]:p.handoff}});break;case"handoff.written":Fl(xe=>{if(!(p.sessionId in xe))return xe;const Ce={...xe};return delete Ce[p.sessionId],Ce}),p.handoff&&dn.current===p.sessionId?Pl(p.handoff):p.handoff||console.warn("[handoff] хост не смог записать хэндофф",p.sessionId);break;case"limit.stopped":Jc.current+=1,fl(xe=>[...xe,{id:Jc.current,limit:p.limit,utilization:p.utilization,stopped:p.stopped,handoffs:p.handoffs}]);break;case"auth.login":xt(p.state),p.state.active&&Lt(!0);break;case"session.closed":Ee(xe=>xe.filter(Ce=>Ce.id!==p.sessionId)),R(xe=>xe.map(Ce=>Ce.id===p.sessionId?{...Ce,state:"closed"}:Ce));break;case"error":console.error("[host]",p.message,p.context??""),(p.context==="workspace.open"||p.context==="workspace.create")&&(ei.current=null,at(p.message)),(mi=p.context)!=null&&mi.startsWith("term.")&&Ar(p.message);break}},[]),te=_.useCallback(p=>{var U;(U=l.current)==null||U.send(p)},[]);_.useEffect(()=>{w&&te({type:"session.list",workspaceId:w})},[w,te]),_.useEffect(()=>{s&&te({type:"session.pins"})},[s,te]),_.useEffect(()=>{s&&te({type:"settings.get"})},[s,te]),_.useEffect(()=>{if(s)return te({type:"session.drafts",sessionIds:f_()}),Y0(p=>te({type:"session.drafts",sessionIds:p}))},[s,te]),_.useEffect(()=>{if(Pa.current)return;const p=Fc.current;if(!p||!w)return;if(w!==p.workspaceId){Pa.current=!0;return}if(z){Pa.current=!0;return}if(D.length===0)return;const U=D.find(re=>Ek(re,p));Pa.current=!0,U&&U.state!=="closed"&&er(U)},[D,w,z]),_.useEffect(()=>{!w||Qi||!ua||te({type:"term.list",workspaceId:w})},[w,Qi,ua,te]),_.useEffect(()=>{Cr(p=>{var U;return p&&$i.some(re=>re.id===p)?p:((U=$i[0])==null?void 0:U.id)??null})},[$i]),_.useEffect(()=>{st&&te({type:"workspace.roots"})},[st,te]);const pa=_.useCallback(()=>{const p=dn.current;p&&(dl(!0),te({type:"usage.get",sessionId:p}),te({type:"context.get",sessionId:p}))},[te]);_.useEffect(()=>{if(!En)return;const p=window.setTimeout(()=>dl(!1),Nk);return()=>window.clearTimeout(p)},[En]);const Ir=_.useMemo(()=>{const p=Math.max((un==null?void 0:un.fetchedAt)??0,(pt==null?void 0:pt.fetchedAt)??0);return p>0?p:null},[un==null?void 0:un.fetchedAt,pt==null?void 0:pt.fetchedAt]);_.useEffect(()=>{if(it(null),!z)return;pa();const p=()=>{document.hidden||pa()},U=window.setInterval(p,Sk),re=()=>{document.hidden||pa()};return document.addEventListener("visibilitychange",re),()=>{window.clearInterval(U),document.removeEventListener("visibilitychange",re)}},[z,pa]),_.useEffect(()=>{if(!z){rn(Ih);return}rn({...Ih,loading:!0}),te({type:"session.history",sessionId:z})},[z,te]);const sd=_.useCallback(()=>{!z||qe.loading||!Lx(qe)||(rn(p=>({...p,loading:!0})),te({type:"session.history",sessionId:z,before:h_(qe)}))},[z,qe,te]),ad=_.useMemo(()=>Q0(qe.entries),[qe.entries]),K=_.useMemo(()=>D.find(p=>p.id===z)??null,[D,z]),Ji=z?(K==null?void 0:K.claudeSessionId)??z:null,Pi=Ji?kt[Ji]??null:null;_.useEffect(()=>{Ji&&te({type:"handoff.get",sessionId:Ji})},[Ji,te]),_.useEffect(()=>{ul&&!(ul.sessionId in kt)&&yl(null)},[kt,ul]);const ml=_.useMemo(()=>{var re;if(!un)return null;const p=(((re=un.buckets)==null?void 0:re.length)??0)>0,U=(K==null?void 0:K.provider)==="antigravity";return p===U?un:null},[un,K==null?void 0:K.provider]),li="Обновить лимиты и контекст",fu=li+(Ir?`
|
|
134
|
+
обновлено в ${new Date(Ir).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:"");_.useEffect(()=>{document.documentElement.dataset.provider=(K==null?void 0:K.provider)??"claude"},[K==null?void 0:K.provider]),_.useEffect(()=>{(K==null?void 0:K.provider)==="antigravity"&&Rr(!1)},[K==null?void 0:K.provider]);const ma=E.find(p=>p.id===w)??C.find(p=>p.id===w)??null;_.useEffect(()=>{if(!w||!z)return;const p={workspaceId:w,sessionId:z,claudeSessionId:(K==null?void 0:K.claudeSessionId)??null};try{localStorage.setItem(ay,JSON.stringify(p))}catch{}},[w,z,K==null?void 0:K.claudeSessionId]);function du(p){ei.current=p,at(null),te({type:"workspace.open",path:p})}function hu(p,U,re){at(null),te({type:"workspace.create",parent:p,name:U,init:re})}function no(p){if(Hr.current=p,!p){on([]),qt(!1);return}qt(!0),te({type:"workspace.find",query:p})}function id(p){Hr.current=p,Ot(kl),te({type:"workspace.find.agent",query:p})}function si(){kn(!1),at(null),en(null),on([]),Ot(kl),Ct(null),Hr.current="",ei.current=null}function Us(){const p=dn.current;p&&pl.current&&te({type:"side.reset",sessionId:p}),pl.current=null,Or(null),Lr(kl),zr(null),da({}),Zi.current=[]}function Wi(p){te({type:"workspace.close",workspaceIds:p}),!(!w||!p.includes(w))&&(Us(),V(null),ge(null),R([]),ee([]),Ue(kl),Re(null),ht(!1))}function lo(p,U){te({type:"session.archive",workspaceId:p,sessionIds:U}),z&&(U.includes(z)||K!=null&&K.claudeSessionId&&U.includes(K.claudeSessionId))&&(Us(),ge(null),Ue(kl),Re(null),ht(!1))}function pu(p){te({type:"workspace.restore",workspaceIds:p})}function ga(p,U,re){te({type:"folder.create",scope:p,name:U,workspaceId:re})}function ai(p,U){te({type:"folder.rename",folderId:p,name:U})}function so(p,U){te({type:"folder.setColor",folderId:p,color:U})}function mu(p){te({type:"folder.delete",folderId:p})}function xa(p,U,re,Me){te({type:"folder.assign",scope:p,itemId:U,folderId:re,workspaceId:Me})}function gu(p=Pt[0]??"claude"){w&&(Us(),ge(null),Re(null),Ue(kl),ht(!1),te({type:"session.start",workspaceId:w,provider:p}),Ft(!1))}function qr(p){Us(),ho(),V(p),ge(null),Ue(kl),Re(null),ht(!1),El(null),jn(null),ms(null),Cn(null),Xn(""),T(!1),he(null),He(!1),Xi([]),Cr(null)}function xu(p,U,re){te({type:"session.pin",workspaceId:p,sessionIds:U,pinned:re})}function rd(p){return p.state==="running"||p.state==="waiting_permission"||p.state==="reconnecting"||p.backgroundWork}function ao(p){if(rd(p)){X(p);return}te({type:"session.close",sessionId:p.id})}function cd(p,U,re){Ae(Me=>{const bt=Me??{workspaces:[],sessions:{},pinned:[],live:[]};if(p==="sessions"){if(!re)return Me;const Wt={...bt.sessions};return U&&U.length>0?Wt[re]=U:delete Wt[re],{...bt,sessions:Wt}}return{...bt,[p]:U??[]}}),te({type:"order.set",scope:p,ids:U,...re?{workspaceId:re}:{}})}function bu(p){p.workspaceId!==w&&qr(p.workspaceId),er(p)}function er(p){if(Ft(!1),Us(),Ue(kl),Re(null),ht(!1),p.state==="closed"){ge(null),te({type:"session.start",workspaceId:p.workspaceId,resume:p.id});return}ge(p.id),te({type:"session.sync",sessionId:p.id,sinceSeq:0})}function io(p,U){if(!z||x)return!1;const re=z,Me=K;return Ml(()=>{if((Me==null?void 0:Me.state)==="closed"){Fi.current={sessionId:Me.id,text:p,images:U},er(Me);return}te({type:"prompt.send",sessionId:re,text:p,images:U})})}function Ml(p){const U=(K==null?void 0:K.provider)==="antigravity"?null:rk(un,Vt);return U?new Promise(re=>{de(Me=>(Me==null||Me.resolve(!1),{warning:U,resolve:re}))}).then(re=>(re&&p(),re)):(p(),!0)}function ii(p){ue&&(ue.resolve(p),de(null))}function wl(p){const U=be.find(re=>(re.claudeSessionId??re.id)===p.sessionId&&re.state!=="closed");Gr(p.workspaceId,p.sessionId,p.text),U&&te({type:"session.close",sessionId:U.id})}function ba(p){Gr(p.workspaceId,p.claudeSessionId??p.id,null)}function Gr(p,U,re){Wa.current=re===null?null:{workspaceId:p,text:re},p!==w?qr(p):(Us(),ge(null),Re(null),Ue(kl),ht(!1)),te({type:"session.start",workspaceId:p,provider:"claude",continuesFrom:U,...re===null?{}:{fromHandoff:!0}}),Ft(!1)}_.useEffect(()=>{Jl&&(Pl(null),wl(Jl))},[Jl]);function tr(p){ds[p.id]||(Fl(U=>({...U,[p.id]:!0})),te({type:"session.handoff",sessionId:p.id}))}function Yr(p){te({type:"handoff.dismiss",sessionId:p})}function $r(p,U){te({type:"session.rename",sessionId:p.id,title:U,workspaceId:p.workspaceId}),R(re=>re.map(Me=>Me.id===p.id?{...Me,title:U}:Me))}function Hs(p){z&&(Ft(!1),oe(null),Le(null),Jt(p),te({type:"mcp.list",sessionId:z}),te({type:"plugin.list",sessionId:z}))}const _u={mcpAction:(p,U)=>{z&&(oe(null),te({type:"mcp.action",sessionId:z,name:p,action:U}))},mcpAuth:p=>{z&&(oe(null),Le({name:p,active:!0,url:"",callbackExpected:!1,done:!1,error:null}),te({type:"mcp.auth",sessionId:z,name:p}))},mcpAuthCallback:(p,U)=>{z&&te({type:"mcp.auth_callback",sessionId:z,name:p,callbackUrl:U})},mcpAdd:(p,U)=>{z&&te({type:"mcp.add",sessionId:z,name:p,draft:U})},mcpRemove:p=>{z&&te({type:"mcp.remove",sessionId:z,name:p})},pluginInstall:p=>{z&&te({type:"plugin.install",sessionId:z,spec:p})},pluginUninstall:p=>{z&&te({type:"plugin.uninstall",sessionId:z,id:p})},pluginToggle:(p,U)=>{z&&te({type:"plugin.toggle",sessionId:z,id:p,enabled:U})},marketplaceAdd:p=>{z&&te({type:"marketplace.add",sessionId:z,source:p})},marketplaceRemove:p=>{z&&te({type:"marketplace.remove",sessionId:z,name:p})}};function nr(){Ft(!1),Lt(!0),te({type:"auth.status"})}const Bs={login:(p,U)=>te({type:"auth.login",mode:p,switchAccount:U}),submitCode:p=>te({type:"auth.code",code:p}),cancel:()=>te({type:"auth.cancel"}),logout:()=>te({type:"auth.logout"})};function od(){Ft(!1),Qt(!0),te({type:"settings.get"})}function Sl(p){vl(U=>U&&{...U,...p}),te({type:"settings.update",settings:p})}function ro(p){!z||x||te({type:"side.ask",sessionId:z,text:p})}function bs(){z&&(te({type:"side.reset",sessionId:z}),pl.current=null,Or(null),Lr(kl),zr(null),da({}),Zi.current=[])}function ri(p){const U=pl.current;if(U){p(U);return}const re=dn.current;re&&(Zi.current.push(p),te({type:"side.open",sessionId:re}))}function lr(){w&&te({type:"git.state",workspaceId:w})}function _a(p){w&&(ms(p),te({type:"git.show",workspaceId:w,ref:p}))}function Xr(p,U){Cn(null),Cl({target:p,label:U})}function yu(){!w||!Wl||(te({type:"git.checkout",workspaceId:w,target:Wl.target}),Cl(null))}function co(){w&&(Cn(null),te({type:"git.push",workspaceId:w}))}function vu(p){w&&(Cn(null),te({type:"git.pull",workspaceId:w,merge:p}))}function Rl(){w&&(Cn(null),he(null),T(!0),te({type:"github.status"}),te({type:"github.owners"}),te({type:"git.files",workspaceId:w}))}function ci(p){w&&(Cn(null),te({type:"git.publish",workspaceId:w,...p}))}function oi(p){w&&(Cn(null),te({type:"git.remote",workspaceId:w,url:p}))}function Vr(){Cn(null),He(!0)}function sr(p){te({type:"github.token",token:p}),te({type:"github.owners"})}function Dl(){te({type:"github.status"}),te({type:"github.owners"})}_.useEffect(()=>{if(!(!we||!w))for(const p of yt)p in zt||te({type:"fs.list",workspaceId:w,path:p})},[we,yt,zt,w,te]);function Ol(p){xn(U=>U.includes(p)?U.filter(re=>re!==p):[...U,p])}function Is(p){if(!p){Gi(null);return}w&&te({type:"fs.search",workspaceId:w,query:p})}function ss(p){if(!p){Za(null);return}w&&te({type:"fs.grep",workspaceId:w,query:p})}const Yl=_.useCallback((p,U)=>{$c(bt=>({...bt,[p]:U}));const re=An.current;if(U===null||!re)return;const Me=U.lastIndexOf("/");if(Me!==-1){te({type:"fs.list",workspaceId:re,path:U.slice(0,Me)});return}if(U===""){te({type:"fs.list",workspaceId:re,path:""});return}te({type:"fs.search",workspaceId:re,query:U,scope:p})},[te]),_s=_.useMemo(()=>Wb(ra.mention??null,ca.mention??null,zt),[ra.mention,ca.mention,zt]),ju=_.useMemo(()=>Wb(ra.side??null,ca.side??null,zt),[ra.side,ca.side,zt]);function oo(p){Qr(p.path,{line:p.line,column:p.column})}function uo(p){const U=[];let re=wr(p.path);for(;U.push(re),!!re;)re=wr(re);xn(Me=>{const bt=new Set(Me);for(const Wt of U)bt.add(Wt);return p.kind==="dir"&&bt.add(p.path),[...bt]}),p.kind==="file"&&Qr(p.path)}function Qr(p,U){if(Ls.current.find(Me=>Me.path===p)){Gl(p),U&&Xc({path:p,...U,token:++Er.current});return}w&&(U&&(Fa.current={path:p,...U}),Br.current.add(p),te({type:"fs.read",workspaceId:w,path:p}))}function Mn(p,U=!1){const re=Ls.current,Me=re.find(al=>al.path===p);if(Me&&Xa(Me)&&!U){Ms(p);return}Ms(null);const bt=re.findIndex(al=>al.path===p),Wt=re.filter(al=>al.path!==p);zn(Wt),Gl(al=>{var Da;return al===p?((Da=Wt[Math.min(bt,Wt.length-1)])==null?void 0:Da.path)??null:al})}function Rt(p,U=!1){const re=Ls.current.find(Me=>Me.path===p);!re||!w||!U&&!Xa(re)||(xs.current.set(p,re.text),te({type:"fs.write",workspaceId:w,path:p,content:re.text,eol:re.eol,encoding:re.encoding,baseMtime:re.mtime,...U?{force:!0}:{}}))}function rt(p){w&&te({type:"fs.read",workspaceId:w,path:p})}function qs(p){w&&(ha.current.has(p)||(ha.current.add(p),te({type:"fs.readMedia",workspaceId:w,path:p})))}const Ll=_.useRef(new Map);function fo(p){const U=Ll.current,re=U.get(p);re&&clearTimeout(re);const Me=(Vt==null?void 0:Vt.autoSaveAfterPauseMs)??0;Me<=0||U.set(p,setTimeout(()=>{U.delete(p);const bt=Ls.current.find(Wt=>Wt.path===p);bt&&Xa(bt)&&!bt.stale&&Rt(p)},Me))}function Gs(p,U,re){if(!w)return;const Me=p?`${p}/${re}`:re;ie(null),U==="file"&&(ni.current=Me),te({type:"fs.create",workspaceId:w,path:Me,kind:U})}function wu(p,U){if(!w)return;const re=wr(p),Me=re?`${re}/${U}`:U;ie(null),zs.current={from:p,to:Me},te({type:"fs.rename",workspaceId:w,path:p,to:Me})}function Su(p,U){if(!w)return;const re=p.slice(p.lastIndexOf("/")+1),Me=U?`${U}/${re}`:re;Me!==p&&(ie(null),zs.current={from:p,to:Me},te({type:"fs.rename",workspaceId:w,path:p,to:Me}))}function ui(p,U){w&&(ie(null),te({type:"fs.copy",workspaceId:w,path:p,toDir:U}))}function ya(p){w&&(ie(null),Ke(null),te({type:"fs.delete",workspaceId:w,path:p.path}),zn(U=>U.filter(re=>re.path!==p.path&&!re.path.startsWith(`${p.path}/`))),Gl(U=>U&&(U===p.path||U.startsWith(`${p.path}/`))?null:U))}function ho(){tn({}),xn([""]),zn([]),Gl(null),ie(null),Gi(null),Za(null),$c({}),Yi({}),Xc(null),Br.current.clear(),xs.current.clear(),ha.current.clear(),Fa.current=null,zs.current=null,ni.current=null}function ar(){!w||Qi||!ua||(Ar(null),Kc.current=!0,te({type:"term.open",workspaceId:w,cols:80,rows:24}))}function po(p){te({type:"term.close",id:p})}function va(p,U){z&&te({type:"permission.respond",sessionId:z,requestId:p,decision:U})}function ys(p,U){z&&te({type:"permission.respond",sessionId:z,requestId:p,decision:"allow",answers:U})}function Ys(p){z&&te({type:"permission.respond",sessionId:z,requestId:p,decision:"deny",reason:"Пользователь не стал отвечать на вопросы"})}function vs(p,U){z&&te({type:"permission.respond",sessionId:z,requestId:p,decision:"allow",plan:U})}function mo(p){z&&te({type:"permission.respond",sessionId:z,requestId:p,decision:"deny",reason:"Пользователь просит продолжить планирование"})}_.useEffect(()=>{function p(U){if(U.key!=="Escape")return;if(fn!==null){const Me=U.target;if(!(Me instanceof HTMLElement&&Me.closest(".termview, .editor, .sidepane"))){Zc(null);return}}if(!z||Oe.pending.length>0)return;const re=U.target;re instanceof HTMLElement&&re.closest(".sidepane, .editor")||te({type:"control.interrupt",sessionId:z})}return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[z,Oe.pending.length,te,fn]),_.useEffect(()=>{function p(U){U.key!=="`"||!(U.ctrlKey||U.metaKey)||ua&&(U.preventDefault(),Ja(re=>!re))}return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[ua]);const Kr=_.useMemo(()=>{const p=(ve==null?void 0:ve.commands)??[];return p.length===0||(K==null?void 0:K.provider)==="antigravity"?p:[...p,{name:"plugins",description:"Плагины и маркетплейсы — окно приложения",argumentHint:"",aliases:["plugin"]},...Pb]},[ve,K==null?void 0:K.provider]);function ja(p){const U=Ck[p];return U&&(K==null?void 0:K.provider)!=="antigravity"?(Hs(U),!0):(K==null?void 0:K.provider)==="antigravity"||!Pb.some(re=>re.name===p)?!1:(nr(),p==="logout"&&Bs.logout(),p==="switch-account"&&Bs.login("claudeai",!0),!0)}const wa=(K==null?void 0:K.state)==="waiting_permission",Qn=(K==null?void 0:K.state)==="reconnecting",Ut=(K==null?void 0:K.state)==="running"||Qn||wa,Ht=Oe.pending[0]??null,Zr=Ht?CS(Ht.toolName,Ht.input):null,[ud,fd]=_.useState(()=>new Set),Fr=Ht?ud.has(Ht.requestId):!1,bn=Ht?Ht.questions&&Ht.questions.length>0?"question":Zr!==null?"plan":"permission":null;function fi(p,U){fd(re=>{if(re.has(p)===U)return re;const Me=new Set(re);return U?Me.add(p):Me.delete(p),Me})}_.useEffect(()=>{!mn&&!we||!w||Ut||te({type:"git.state",workspaceId:w})},[mn,we,w,Ut,te]),_.useEffect(()=>{if(!(Ut||!w)){we&&tn(p=>{const U={};for(const[re,Me]of Object.entries(p))ti.current.includes(re)||(U[re]=Me);return U});for(const p of Ls.current)Xa(p)||te({type:"fs.read",workspaceId:w,path:p.path})}},[Ut,w,we,te]);const Sa=(K==null?void 0:K.cwd)??(ve==null?void 0:ve.cwd)??null,di=(ve==null?void 0:ve.models)??[],hi=(K==null?void 0:K.model)??(ve==null?void 0:ve.model)??null,{rows:Na,selected:pi}=t_(di,hi),ir=ls?{model:ls.model,effort:ls.effort,ultracode:ls.ultracode,thinking:ls.thinking,switchOnFlag:ls.switchModelsOnFlag}:{model:Ki.model??hi,effort:Ki.effort??(K==null?void 0:K.effort)??null,ultracode:Ki.ultracode??(K==null?void 0:K.ultracode)??!1,thinking:Ki.thinking??(K==null?void 0:K.thinking)??!0,switchOnFlag:Ki.switchOnFlag??(K==null?void 0:K.switchModelsOnFlag)??!0},go=t_(di,ir.model),dd=(ls==null?void 0:ls.state)==="running",Jr=sl?Mt.find(p=>p.path===sl)??null:null,ka=new Set(Mt.filter(Xa).map(p=>p.path)),Ta=p=>a.jsx(uk,{pane:p,width:Ln.widths[p],onResize:U=>Ln.setWidth(p,U),onReset:()=>Ln.reset(p)}),js=p=>Ge?null:()=>nd(p),Nu=(K==null?void 0:K.provider)==="antigravity"?W0:p_,Ea=ve&&a.jsx(Cs,{title:"Режим прав",value:(K==null?void 0:K.permissionMode)??"default",options:Nu.map(p=>({value:p.value,label:p.value,hint:p.hint})),onChange:p=>{z&&te({type:"control.set_mode",sessionId:z,mode:p})}}),Pr=Na.length>0?a.jsx(W_,{models:Na,value:pi,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=>{!z||!p||te({type:"control.set_model",sessionId:z,model:p})},onEffort:p=>{z&&te({type:"control.set_effort",sessionId:z,effort:p})},onUltracode:p=>{z&&te({type:"control.set_ultracode",sessionId:z,enabled:p})},onThinking:p=>{z&&te({type:"control.set_thinking",sessionId:z,enabled:p})},onSwitchOnFlag:p=>{z&&te({type:"control.set_flag_switch",sessionId:z,enabled:p})}}):hi&&a.jsx("span",{className:"badge",children:hi}),Wr=Ut&&a.jsx("span",{className:wa?"badge badge--wait":"badge badge--live",children:wa?"ждёт":Qn?"переподключается":"работает"}),ec=(K==null?void 0:K.state)==="closed"&&a.jsx("span",{className:"badge",title:"Разговор сохранён — сессия поднимется заново, как только вы отправите сообщение",children:"остановлена"}),xo=Wr||ec,bo=()=>{z&&te({type:"session.reconnect",sessionId:z})},Ca=Qn?"Сессия уже поднимает новый процесс":Ut?"Недоступно, пока идёт ход":"Поднять сессии новый процесс — разговор сохранён",Aa=z&&(Qn||(K==null?void 0:K.state)==="error")?a.jsxs("div",{className:Qn?"relink":"relink relink--error",role:"status",children:[a.jsxs("span",{className:"relink__msg",children:[a.jsx("span",{className:"relink__dot","aria-hidden":"true"}),Qn?"Связь оборвалась. Сессия поднимает новый процесс — разговор сохранён.":"Переподключиться не удалось. Разговор сохранён — сессия продолжит с этого места."]}),a.jsx("button",{className:"btn btn--sm",title:Qn?"Не ждать паузы между попытками — попробовать сейчас":"Поднять сессии новый процесс и продолжить разговор",onClick:bo,children:Qn?"Переподключить сейчас":"Переподключить"})]}):null,ku=Pi?a.jsx(ek,{handoff:Pi,onContinue:()=>wl(Pi),onShow:()=>yl(Pi),onDismiss:()=>Yr(Pi.sessionId)}):null,tc=K&&K.totalCostUsd>0?`$${K.totalCostUsd.toFixed(3)}`:null,Ma=(K==null?void 0:K.provider)!=="antigravity"&&a.jsx("button",{className:fa?"pane-btn is-on":"pane-btn",title:"Вопрос на полях — спросить, не мешая работе","aria-label":"Вопрос на полях","aria-pressed":fa,onClick:()=>Rr(p=>!p),children:a.jsx(Bk,{})}),rr=K&&K.state!=="closed"&&a.jsx("button",{type:"button",className:"pane-btn pane-btn--stop",title:"Остановить сессию — освобождает память хоста, разговор остаётся на диске","aria-label":"Остановить сессию",onClick:()=>ao(K),children:a.jsx(Lk,{})}),ws=K?ds[K.id]===!0:!1,Ra=b_({onLongPress:()=>{K&&ba(K)},onClick:()=>{K&&tr(K)},disabled:ws}),nc=K&&K.state!=="closed"&&K.provider!=="antigravity"&&a.jsxs("button",{type:"button",className:ws?"pane-btn pane-btn--handoff is-busy":Ra.holding?"pane-btn pane-btn--handoff is-holding":"pane-btn pane-btn--handoff",style:{"--hold-ms":`${Ra.thresholdMs}ms`},title:ws?"Пишется хэндофф…":"Клик — хэндофф и новая сессия: агент запишет сводку, сессия остановится, работа продолжится в новой. Зажать (или Shift+клик) — новая пустая сессия без хэндоффа: закрепление переходит, старая сессия продолжает работать.","aria-label":"Хэндофф и новая сессия","aria-busy":ws,disabled:ws,...Ra.handlers,children:[a.jsx("span",{className:"pane-btn__hold","aria-hidden":"true"}),a.jsx(zk,{})]});return a.jsxs("div",{className:"app",style:Ln.style,children:[a.jsx(lw,{open:Ve,connected:s,status:c,workspaces:E,archivedWorkspaces:C,workspaceFolders:G,sessionFolders:Y.filter(p=>p.workspaceId===w),pinnedFolders:$,sessions:D.filter(p=>p.workspaceId===w),archived:O.filter(p=>p.workspaceId===w),pinned:P,live:be,listOrder:_e,liveSessionsFirst:(Vt==null?void 0:Vt.liveSessionsFirst)===!0,onReorder:cd,activeWorkspaceId:w,activeSessionId:z,onPinSessions:xu,onSelectPinned:bu,onCloseWorkspaces:Wi,onRestoreWorkspaces:pu,onArchiveSessions:lo,onUnarchiveSessions:p=>{w&&te({type:"session.unarchive",workspaceId:w,sessionIds:p})},onCreateFolder:ga,onRenameFolder:ai,onSetFolderColor:so,onDeleteFolder:mu,onAssignToFolder:xa,onSelectWorkspace:qr,onSelectSession:er,onRenameSession:$r,onStopSession:ao,onOpenWorkspace:()=>kn(!0),onNewSession:gu,enabledProviders:Pt,onOpenExtensions:z&&(K==null?void 0:K.provider)!=="antigravity"?()=>Hs("mcp"):null,account:Ze,onOpenAccount:nr,relay:d,onOpenRelay:v?null:()=>j(!0),onOpenSettings:od,themeMode:$n,onCycleTheme:hl}),Ta("sidebar"),Ve&&a.jsx("div",{className:"scrim",onClick:()=>Ft(!1)}),a.jsx(pj,{open:we,tree:zt,expanded:new Set(yt),activePath:sl,dirty:ka,gitChanges:(gn==null?void 0:gn.changed)??[],result:N,searchResult:Rs,onSearch:Is,onReveal:uo,onToggle:Ol,onOpen:Qr,onCreate:Gs,onRename:wu,onMove:Su,onCopy:ui,onDelete:Ke,onRefresh:()=>{ie(null),tn({}),lr()},onClose:()=>_t(!1),zoomed:fn==="files",onToggleZoom:js("files")}),we&&fn!=="files"&&Ta("files"),a.jsx(Sj,{open:Ds,result:oa,onSearch:ss,onOpenMatch:oo,onClose:()=>Un(!1),zoomed:fn==="search",onToggleZoom:js("search")}),Ds&&fn!=="search"&&Ta("search"),a.jsx($S,{open:mn,state:gn,result:aa,selected:Kt,busy:es,onRefresh:lr,onShow:_a,onCheckout:Xr,onPush:co,onPull:vu,onPublish:Rl,onConnectRemote:Vr,onDismissResult:()=>Cn(null),onClose:()=>jl(!1),zoomed:fn==="git",onToggleZoom:js("git")}),mn&&fn!=="git"&&Ta("git"),a.jsxs("main",{className:fn==="main"||fn==="terminal"?"main main--zoomed":"main",children:[m&&x&&a.jsx(nk,{state:m}),a.jsxs("header",{className:"topbar",children:[a.jsx("button",{className:"btn btn--ghost menu-btn",onClick:()=>Ft(!0),children:"☰"}),a.jsx("button",{className:we?"pane-btn is-on":"pane-btn",title:"Файлы проекта","aria-label":"Файлы проекта","aria-pressed":we,onClick:()=>{_t(p=>!p),jl(!1),Un(!1)},children:a.jsx(Rk,{})}),a.jsx("button",{className:Ds?"pane-btn is-on":"pane-btn",title:"Поиск по тексту в проекте","aria-label":"Поиск по тексту в проекте","aria-pressed":Ds,onClick:()=>{Un(p=>!p),_t(!1),jl(!1)},children:a.jsx(Dk,{})}),a.jsx("button",{className:mn?"pane-btn is-on":"pane-btn",title:"История git","aria-label":"История git","aria-pressed":mn,onClick:()=>{jl(p=>!p),_t(!1),Un(!1)},children:a.jsx(Ok,{})}),ua&&a.jsx("button",{className:ns?"pane-btn is-on":"pane-btn",title:"Терминал (Ctrl+`)","aria-label":"Терминал","aria-pressed":ns,onClick:()=>Ja(p=>!p),children:a.jsx(Hk,{})}),Ge&&Ma,Ge&&a.jsx("button",{className:cn?"pane-btn is-on":"pane-btn",title:"Ещё","aria-label":"Ещё","aria-haspopup":"menu","aria-pressed":cn,onClick:()=>Nn(!0),children:a.jsx(Ik,{})}),a.jsxs("div",{className:"topbar__id",children:[ut&&K?a.jsx(na,{className:"rename--title",value:K.title??"",onCommit:p=>{$r(K,p),ht(!1)},onCancel:()=>ht(!1)}):a.jsxs("div",{className:"topbar__head",children:[a.jsx("button",{className:"topbar__title",disabled:!K||Ge,title:K&&!Ge?"Переименовать сессию":void 0,onClick:()=>ht(!0),children:(K==null?void 0:K.title)??"Claude Code Visual"}),ma&&a.jsx("span",{className:"topbar__project",title:ma.path,children:ma.name})]}),Ge?xo:Sa&&a.jsx(P_,{path:Sa})]}),!Ge&&a.jsxs("div",{className:"topbar__tools",children:[a.jsx("button",{type:"button",className:En?"meters-refresh is-busy":"meters-refresh",title:fu,"aria-label":li,"aria-busy":En,disabled:!z||En,onClick:pa,children:a.jsx(qk,{})}),a.jsx(ty,{usage:ml}),a.jsx(sy,{}),Ea,Pr,xo,tc&&a.jsx("span",{className:"badge badge--cost",children:tc}),nc,rr,Ma]})]}),a.jsx(jk,{tokens:(pt==null?void 0:pt.tokens)??Oe.contextTokens,maxTokens:(pt==null?void 0:pt.maxTokens)??null,fetchedAt:(pt==null?void 0:pt.fetchedAt)??null}),Ge&&cn&&a.jsx(wN,{onClose:()=>Nn(!1),permission:Ea,model:Pr,usage:ml,cwd:Sa,costLabel:tc,onRefresh:pa,refreshing:En,metersFetchedAt:Ir,onRename:K?()=>{ht(!0),Nn(!1)}:null,onHandoff:K&&K.state!=="closed"&&K.provider!=="antigravity"?()=>{tr(K),Nn(!1)}:null,onFreshSession:K&&K.state!=="closed"&&K.provider!=="antigravity"?()=>{ba(K),Nn(!1)}:null,handoffWriting:ws,onStop:K&&K.state!=="closed"?()=>{ao(K),Nn(!1)}:null}),Mt.length>0&&a.jsx(Yj,{files:Mt,activePath:sl,busy:Ut,onSelect:Gl,onClose:p=>Mn(p),zoomed:fn==="main",onToggleZoom:js("main")}),Jr?a.jsx(qj,{file:Jr,goto:(Os==null?void 0:Os.path)===Jr.path?Os:null,onChange:(p,U)=>{zn(re=>re.map(Me=>Me.path===p?{...Me,text:U}:Me)),fo(p)},onSave:p=>Rt(p),onReload:rt,onOverwrite:p=>Rt(p,!0),onRequestMedia:qs,onTogglePreview:p=>zn(U=>U.map(re=>re.path===p?{...re,previewMode:!re.previewMode}:re))}):a.jsxs(a.Fragment,{children:[a.jsx(Hp,{items:Oe.items,busy:Ut&&!Qn,waiting:wa,empty:(K==null?void 0:K.provider)==="antigravity"?"Сессия пуста. Опишите задачу — Antigravity работает в каталоге проекта.":void 0,history:ad,historyHasMore:Lx(qe),historyLoading:qe.loading,onLoadHistory:sd,sessionId:z??void 0,onEditMessage:(K==null?void 0:K.provider)==="antigravity"?void 0:(p,U,re)=>{if(!z||x)return!1;const Me=z;return Ml(()=>te({type:"prompt.edit",sessionId:Me,userIndex:p,text:U,images:re}))}}),Aa,ku,z&&(($s=K==null?void 0:K.tasks)!=null&&$s.length)?a.jsx(Kj,{tasks:K.tasks,onStop:p=>te({type:"task.stop",sessionId:z,taskId:p})}):null,Ht&&bn&&Fr&&a.jsx(SS,{kind:bn,toolName:Ht.toolName,queued:Oe.pending.length-1,onExpand:()=>fi(Ht.requestId,!1)}),a.jsx(Z_,{disabled:!z,busy:Ut&&!Qn,sendBlocked:x,placeholder:Qn?"Промпт уйдёт, как только связь вернётся":(K==null?void 0:K.state)==="closed"?"Остановлена — отправьте сообщение, чтобы продолжить":void 0,commands:Kr,sessionTitle:(K==null?void 0:K.title)??null,contextResult:_s,draftKey:z,onContextSearch:p=>Yl("mention",p),onCommand:ja,onSend:io,onInterrupt:()=>{z&&te({type:"control.interrupt",sessionId:z})}})]}),ns&&ua&&a.jsxs(a.Fragment,{children:[!Ge&&fn!=="terminal"&&a.jsx(dk,{height:Mr.height,onResize:Mr.setHeight,onReset:Mr.reset}),a.jsx(gk,{mobile:Ge,zoomed:fn==="terminal",onToggleZoom:js("terminal"),terminals:$i,activeId:ed,blocked:Qi,error:Vc,onDismissError:()=>Ar(null),height:Ge?Qc.height:Mr.height,offset:Ge?{top:Qc.offsetTop,left:Qc.offsetLeft}:void 0,onSelect:Cr,onOpen:ar,onClose:po,onInput:(p,U)=>te({type:"term.input",id:p,data:U}),onResize:(p,U,re)=>te({type:"term.resize",id:p,cols:U,rows:re}),onAttach:p=>te({type:"term.attach",id:p}),onHide:()=>Ja(!1),registerSink:td})]})]}),a.jsx(hN,{open:fa,items:ou.items,busy:dd,ready:z!==null,sendBlocked:x,commands:Kr,contextResult:ju,draftKey:z,models:go.rows,model:go.selected,effort:ir.effort,ultracode:ir.ultracode,thinking:ir.thinking,switchOnFlag:ir.switchOnFlag,onContextSearch:p=>Yl("side",p),onCommand:ja,onModel:p=>{p&&(da(U=>({...U,model:p})),ri(U=>te({type:"control.set_model",sessionId:U,model:p})))},onEffort:p=>{da(U=>({...U,effort:p,ultracode:!1})),ri(U=>te({type:"control.set_effort",sessionId:U,effort:p}))},onUltracode:p=>{da(U=>({...U,ultracode:p,...p?{effort:"xhigh"}:{}})),ri(U=>te({type:"control.set_ultracode",sessionId:U,enabled:p}))},onThinking:p=>{da(U=>({...U,thinking:p})),ri(U=>te({type:"control.set_thinking",sessionId:U,enabled:p}))},onSwitchOnFlag:p=>{da(U=>({...U,switchOnFlag:p})),ri(U=>te({type:"control.set_flag_switch",sessionId:U,enabled:p}))},onAsk:ro,onInterrupt:()=>{Dr&&te({type:"control.interrupt",sessionId:Dr})},onReset:bs,onClose:()=>Rr(!1),zoomed:fn==="ask",onToggleZoom:js("ask")}),fa&&fn!=="ask"&&Ta("ask"),(mn||fa||we||Ds)&&a.jsx("div",{className:"scrim scrim--pane",onClick:()=>{jl(!1),Rr(!1),_t(!1),Un(!1)}}),ll&&a.jsx(KS,{detail:ll,local:((gn==null?void 0:gn.hasRemote)??!1)&&(gn==null?void 0:gn.commits.some(p=>p.hash===ll.hash&&!p.pushed))===!0,onCheckout:Xr,onClose:()=>{jn(null),ms(null)}}),ue&&a.jsxs(xl,{title:"Лимит плана почти исчерпан",onClose:()=>ii(!1),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",autoFocus:!0,onClick:()=>ii(!1),children:"Отмена"}),a.jsx("button",{className:"btn btn--primary",onClick:()=>ii(!0),children:"Отправить всё равно"})]}),children:[a.jsxs("p",{className:"modal__text",children:[Kf[ue.warning.limit][0].toUpperCase(),Kf[ue.warning.limit].slice(1)," использован на"," ",Math.round(ue.warning.utilization)," %, сброс в"," ",ck(ue.warning.resetsAt),". Сообщение может оборваться на полуслове, когда лимит дойдёт до 100 %."]}),a.jsx("p",{className:"modal__text modal__text--dim",children:"До сброса сессию повторно останавливать не будем."})]}),je&&a.jsx(xl,{title:"Остановить сессию?",onClose:()=>X(null),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>X(null),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",onClick:()=>{te({type:"session.close",sessionId:je.id}),X(null)},children:"Остановить"})]}),children:a.jsx("p",{className:"modal__text",children:"Сессия сейчас работает — остановка прервёт текущий ход. Разговор останется на диске: открыть сессию заново или просто написать в неё снова можно в любой момент."})}),Wl&&a.jsxs(xl,{title:"Переключить рабочее дерево?",onClose:()=>Cl(null),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>Cl(null),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",onClick:yu,children:"Переключиться"})]}),children:[a.jsxs("p",{className:"modal__text",children:["git переключится на ",Wl.label,". Файлы в каталоге проекта изменятся — это тот же каталог, в котором работает агент."]}),Ut&&a.jsx("p",{className:"modal__text",children:"Сейчас идёт ход агента: он читает и правит файлы прямо сейчас."}),gn&&gn.changed.length>0&&a.jsxs("p",{className:"modal__text",children:["Незакоммиченных изменений: ",gn.changed.length,". Git откажется переключаться, если они будут затёрты."]})]}),pe&&a.jsx(rN,{status:ia,owners:ts,files:Q,defaultName:(ma==null?void 0:ma.name)??"",hasCommits:gn===null||gn.head!=="",busy:es,result:aa,onRefreshStatus:Dl,onSaveToken:sr,onPublish:ci,onDismissResult:()=>Cn(null),onClose:()=>T(!1)}),ye&&a.jsx(dN,{busy:es,result:aa,onSubmit:oi,onDismissResult:()=>Cn(null),onClose:()=>He(!1)}),Te&&a.jsx(xl,{title:Te.kind==="dir"?"Удалить каталог?":"Удалить файл?",onClose:()=>Ke(null),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>Ke(null),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",onClick:()=>ya(Te),children:"Удалить"})]}),children:a.jsxs("p",{className:"modal__text",children:[Te.path," будет удалён с диска",Te.kind==="dir"?" вместе со всем содержимым":"",". Корзины здесь нет: это тот же каталог, в котором работает агент."]})}),Vn&&a.jsx(xl,{title:"Закрыть без сохранения?",onClose:()=>Ms(null),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>Ms(null),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",onClick:()=>Mn(Vn,!0),children:"Закрыть"}),a.jsx("button",{className:"btn btn--primary",onClick:()=>{Rt(Vn),Mn(Vn,!0)},children:"Сохранить и закрыть"})]}),children:a.jsxs("p",{className:"modal__text",children:["В ",Vn," есть несохранённые правки."]})}),St&&a.jsx(NN,{tab:St,servers:Nt,plugins:le,marketplaces:Be,catalog:Ie,result:I,auth:Ne,remote:v,actions:_u,onTab:Jt,onClose:()=>Jt(null)}),nl&&a.jsx(ON,{status:Ze,login:ps,actions:Bs,remote:v,runningSessions:D.filter(p=>p.state==="running"||p.state==="waiting_permission").length,onReconnect:z?()=>{bo(),Lt(!1)}:null,reconnectBlocked:Ut,reconnectHint:Ca,onClose:()=>Lt(!1)}),y&&a.jsx(BN,{state:d,onPair:(p,U)=>te({type:"relay.pair",code:p,...U?{name:U}:{}}),onUnpair:()=>te({type:"relay.unpair"}),onClose:()=>j(!1)}),hs&&a.jsx(PN,{settings:Vt,models:(ve==null?void 0:ve.models)??[],relayState:d,networkState:m,local:zf()==="local",onChange:Sl,onEnableShell:()=>te({type:"relay.shell.enable"}),onDisableShell:()=>te({type:"relay.shell.disable"}),onOpenRelay:()=>{Qt(!1),j(!0)},onClose:()=>Qt(!1)}),st&&a.jsx(DS,{candidates:Wn,searching:el,agentItems:tt.items,agentBusy:(Yn==null?void 0:Yn.state)==="running",error:nt,roots:pn,created:Zn,onSearch:no,onAskAgent:id,onInterrupt:()=>{const p=Ur.current;p&&te({type:"control.interrupt",sessionId:p})},onSubmit:du,onCreate:hu,onClose:si}),Ht!=null&&Ht.questions&&Ht.questions.length>0?a.jsx(kS,{request:{...Ht,questions:Ht.questions},queued:Oe.pending.length-1,collapsed:Fr,onCollapse:()=>fi(Ht.requestId,!0),onAnswer:ys,onDecline:Ys}):Ht&&Zr!==null?a.jsx(jS,{request:Ht,plan:Zr,queued:Oe.pending.length-1,collapsed:Fr,onCollapse:()=>fi(Ht.requestId,!0),onAccept:vs,onDecline:mo}):Ht&&a.jsx(NS,{request:Ht,queued:Oe.pending.length-1,collapsed:Fr,onCollapse:()=>fi(Ht.requestId,!0),onDecide:va}),ul&&a.jsx(tk,{handoff:ul,onClose:()=>yl(null)}),a.jsx(ak,{notices:Ka,onDismiss:p=>fl(U=>U.filter(re=>re.id!==p))})]})}function Rk(){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 Dk(){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 Ok(){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 Lk(){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 zk(){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 Uk(l,s){return n_(l)===n_(s)}function n_(l){return l.replace(/[\\/]+/g,"/").replace(/\/+$/,"").toLowerCase()}function Hk(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("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 Bk(){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 Ik(){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 qk(){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 iy=document.getElementById("root");if(!iy)throw new Error("#root not found");C0.createRoot(iy).render(a.jsx(_.StrictMode,{children:a.jsx(Mk,{})}));export{R1 as D,ln as I,an as N,$k as P,us as T,As as a,R_ as b,ql as c,Yk as d,U_ as e,au as f,J1 as h,Xk as p,Vk as s,ke as t};
|