@i14ks/ccv 0.25.0 → 0.27.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.
Files changed (28) hide show
  1. package/README.md +18 -1
  2. package/bundle/ccv.mjs +1127 -186
  3. package/package.json +4 -2
  4. package/web/assets/{codemirror-BdKpW4CC.js → codemirror-E1z6J01e.js} +1 -1
  5. package/web/assets/{index-DXHZO0ym.js → index--avrDony.js} +1 -1
  6. package/web/assets/{index-yXtesgZ4.js → index-7U1ohiLA.js} +1 -1
  7. package/web/assets/{index-Si6no75_.js → index-B2AsV6mq.js} +1 -1
  8. package/web/assets/{index-DqnCWDLh.js → index-BBZwZyBc.js} +1 -1
  9. package/web/assets/{index-D83he8x-.js → index-BcerQq_T.js} +1 -1
  10. package/web/assets/{index-DPrfFlZq.js → index-BecRt4W_.js} +1 -1
  11. package/web/assets/{index-ChyP1fTD.js → index-Bz64IIeo.js} +1 -1
  12. package/web/assets/{index-C59b0_Vk.js → index-Bz_OD4bi.js} +1 -1
  13. package/web/assets/{index-Dd7rh20x.js → index-C9SmMjLJ.js} +1 -1
  14. package/web/assets/{index-CZuUjzhP.js → index-CAFnMkkM.js} +1 -1
  15. package/web/assets/{index-BroMLvyS.js → index-CBwg0nNm.js} +1 -1
  16. package/web/assets/index-CcP9R_-q.js +134 -0
  17. package/web/assets/{index-CRsndRFc.js → index-CsM3FfDT.js} +1 -1
  18. package/web/assets/index-D-zxmJYV.css +1 -0
  19. package/web/assets/{index-CWTFMuFd.js → index-DAXylny5.js} +1 -1
  20. package/web/assets/{index-UxKgaDrj.js → index-DKAqAv7f.js} +1 -1
  21. package/web/assets/{index-B2BGvdag.js → index-DiTx3nWx.js} +1 -1
  22. package/web/assets/{index-BrkwvvWk.js → index-DkLckATt.js} +1 -1
  23. package/web/assets/{index-YCUybqa_.js → index-DzHtRLVh.js} +1 -1
  24. package/web/assets/{index-D6DYiY6f.js → index-NY2_ZMtt.js} +1 -1
  25. package/web/assets/{index-wsSNo9PM.js → index-wDZtpqBZ.js} +1 -1
  26. package/web/index.html +3 -3
  27. package/web/assets/index-BCLbqlhA.js +0 -134
  28. package/web/assets/index-C6Y6TadO.css +0 -1
@@ -0,0 +1,134 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-CAFnMkkM.js","./index-NY2_ZMtt.js","./index-wDZtpqBZ.js","./index-BHot-lnj.js","./index-891wE-Rj.js","./index-C9SmMjLJ.js","./index-DKAqAv7f.js","./index--avrDony.js","./index-BecRt4W_.js","./index-DiTx3nWx.js","./index-B2AsV6mq.js","./index-DkLckATt.js","./index-Bz64IIeo.js","./index-CsM3FfDT.js","./index-BcerQq_T.js","./index-Bz_OD4bi.js","./index-DAXylny5.js","./index-CBwg0nNm.js","./index-DzHtRLVh.js","./index-7U1ohiLA.js","./index-BBZwZyBc.js","./codemirror-E1z6J01e.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 $t=(l,s,r)=>_0(l,typeof s!="symbol"?s+"":s,r),Dh=(l,s,r)=>s.has(l)||wx("Cannot "+r);var Qe=(l,s,r)=>(Dh(l,s,"read from private field"),r?r.call(l):s.get(l)),xn=(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),kt=(l,s,r,c)=>(Dh(l,s,"write to private field"),c?c.call(l,r):s.set(l,r),r),qn=(l,s,r)=>(Dh(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 Oh={exports:{}},Bo={};/**
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 Bo;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 Bo.Fragment=s,Bo.jsx=r,Bo.jsxs=r,Bo}var Nx;function v0(){return Nx||(Nx=1,Oh.exports=y0()),Oh.exports}var a=v0(),Lh={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 C(w){return w===null||typeof w!="object"?null:(w=v&&w[v]||w["@@iterator"],typeof w=="function"?w:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,M={};function I(w,Z,z){this.props=w,this.context=Z,this.refs=M,this.updater=z||T}I.prototype.isReactComponent={},I.prototype.setState=function(w,Z){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,Z,"setState")},I.prototype.forceUpdate=function(w){this.updater.enqueueForceUpdate(this,w,"forceUpdate")};function F(){}F.prototype=I.prototype;function J(w,Z,z){this.props=w,this.context=Z,this.refs=M,this.updater=z||T}var H=J.prototype=new F;H.constructor=J,E(H,I.prototype),H.isPureReactComponent=!0;var B=Array.isArray;function D(){}var V={H:null,A:null,T:null,S:null},X=Object.prototype.hasOwnProperty;function A(w,Z,z){var me=z.ref;return{$$typeof:l,type:w,key:Z,ref:me!==void 0?me:null,props:z}}function L(w,Z){return A(w.type,Z,w.props)}function Y(w){return typeof w=="object"&&w!==null&&w.$$typeof===l}function ie(w){var Z={"=":"=0",":":"=2"};return"$"+w.replace(/[=:]/g,function(z){return Z[z]})}var xe=/\/+/g;function Se(w,Z){return typeof w=="object"&&w!==null&&w.key!=null?ie(""+w.key):Z.toString(36)}function ve(w){switch(w.status){case"fulfilled":return w.value;case"rejected":throw w.reason;default:switch(typeof w.status=="string"?w.then(D,D):(w.status="pending",w.then(function(Z){w.status==="pending"&&(w.status="fulfilled",w.value=Z)},function(Z){w.status==="pending"&&(w.status="rejected",w.reason=Z)})),w.status){case"fulfilled":return w.value;case"rejected":throw w.reason}}throw w}function Q(w,Z,z,me,ye){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,Q(Oe(w._payload),Z,z,me,ye)}}if(Oe)return ye=ye(w),Oe=me===""?"."+Se(w,0):me,B(ye)?(z="",Oe!=null&&(z=Oe.replace(xe,"$&/")+"/"),Q(ye,Z,z,"",function(on){return on})):ye!=null&&(Y(ye)&&(ye=L(ye,z+(ye.key==null||w&&w.key===ye.key?"":(""+ye.key).replace(xe,"$&/")+"/")+Oe)),Z.push(ye)),1;Oe=0;var Ue=me===""?".":me+":";if(B(w))for(var Be=0;Be<w.length;Be++)me=w[Be],Re=Ue+Se(me,Be),Oe+=Q(me,Z,z,Re,ye);else if(Be=C(w),typeof Be=="function")for(w=Be.call(w),Be=0;!(me=w.next()).done;)me=me.value,Re=Ue+Se(me,Be++),Oe+=Q(me,Z,z,Re,ye);else if(Re==="object"){if(typeof w.then=="function")return Q(ve(w),Z,z,me,ye);throw Z=String(w),Error("Objects are not valid as a React child (found: "+(Z==="[object Object]"?"object with keys {"+Object.keys(w).join(", ")+"}":Z)+"). If you meant to render a collection of children, use an array instead.")}return Oe}function fe(w,Z,z){if(w==null)return w;var me=[],ye=0;return Q(w,me,"","",function(Re){return Z.call(z,Re,ye++)}),me}function ue(w){if(w._status===-1){var Z=w._result;Z=Z(),Z.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=Z)}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 Z=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(Z))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",w);return}console.error(w)},Me={map:fe,forEach:function(w,Z,z){fe(w,function(){Z.apply(this,arguments)},z)},count:function(w){var Z=0;return fe(w,function(){Z++}),Z},toArray:function(w){return fe(w,function(Z){return Z})||[]},only:function(w){if(!Y(w))throw Error("React.Children.only expected to receive a single React element child.");return w}};return Je.Activity=j,Je.Children=Me,Je.Component=I,Je.Fragment=r,Je.Profiler=o,Je.PureComponent=J,Je.StrictMode=c,Je.Suspense=g,Je.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=V,Je.__COMPILER_RUNTIME={__proto__:null,c:function(w){return V.H.useMemoCache(w)}},Je.cache=function(w){return function(){return w.apply(null,arguments)}},Je.cacheSignal=function(){return null},Je.cloneElement=function(w,Z,z){if(w==null)throw Error("The argument must be a React element, but you passed "+w+".");var me=E({},w.props),ye=w.key;if(Z!=null)for(Re in Z.key!==void 0&&(ye=""+Z.key),Z)!X.call(Z,Re)||Re==="key"||Re==="__self"||Re==="__source"||Re==="ref"&&Z.ref===void 0||(me[Re]=Z[Re]);var Re=arguments.length-2;if(Re===1)me.children=z;else if(1<Re){for(var Oe=Array(Re),Ue=0;Ue<Re;Ue++)Oe[Ue]=arguments[Ue+2];me.children=Oe}return A(w.type,ye,me)},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,Z,z){var me,ye={},Re=null;if(Z!=null)for(me in Z.key!==void 0&&(Re=""+Z.key),Z)X.call(Z,me)&&me!=="key"&&me!=="__self"&&me!=="__source"&&(ye[me]=Z[me]);var Oe=arguments.length-2;if(Oe===1)ye.children=z;else if(1<Oe){for(var Ue=Array(Oe),Be=0;Be<Oe;Be++)Ue[Be]=arguments[Be+2];ye.children=Ue}if(w&&w.defaultProps)for(me in Oe=w.defaultProps,Oe)ye[me]===void 0&&(ye[me]=Oe[me]);return A(w,Re,ye)},Je.createRef=function(){return{current:null}},Je.forwardRef=function(w){return{$$typeof:m,render:w}},Je.isValidElement=Y,Je.lazy=function(w){return{$$typeof:y,_payload:{_status:-1,_result:w},_init:ue}},Je.memo=function(w,Z){return{$$typeof:x,type:w,compare:Z===void 0?null:Z}},Je.startTransition=function(w){var Z=V.T,z={};V.T=z;try{var me=w(),ye=V.S;ye!==null&&ye(z,me),typeof me=="object"&&me!==null&&typeof me.then=="function"&&me.then(D,_e)}catch(Re){_e(Re)}finally{Z!==null&&z.types!==null&&(Z.types=z.types),V.T=Z}},Je.unstable_useCacheRefresh=function(){return V.H.useCacheRefresh()},Je.use=function(w){return V.H.use(w)},Je.useActionState=function(w,Z,z){return V.H.useActionState(w,Z,z)},Je.useCallback=function(w,Z){return V.H.useCallback(w,Z)},Je.useContext=function(w){return V.H.useContext(w)},Je.useDebugValue=function(){},Je.useDeferredValue=function(w,Z){return V.H.useDeferredValue(w,Z)},Je.useEffect=function(w,Z){return V.H.useEffect(w,Z)},Je.useEffectEvent=function(w){return V.H.useEffectEvent(w)},Je.useId=function(){return V.H.useId()},Je.useImperativeHandle=function(w,Z,z){return V.H.useImperativeHandle(w,Z,z)},Je.useInsertionEffect=function(w,Z){return V.H.useInsertionEffect(w,Z)},Je.useLayoutEffect=function(w,Z){return V.H.useLayoutEffect(w,Z)},Je.useMemo=function(w,Z){return V.H.useMemo(w,Z)},Je.useOptimistic=function(w,Z){return V.H.useOptimistic(w,Z)},Je.useReducer=function(w,Z,z){return V.H.useReducer(w,Z,z)},Je.useRef=function(w){return V.H.useRef(w)},Je.useState=function(w){return V.H.useState(w)},Je.useSyncExternalStore=function(w,Z,z){return V.H.useSyncExternalStore(w,Z,z)},Je.useTransition=function(){return V.H.useTransition()},Je.version="19.2.8",Je}var Tx;function yp(){return Tx||(Tx=1,Lh.exports=j0()),Lh.exports}var _=yp(),zh={exports:{}},Io={},Uh={exports:{}},Hh={};/**
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(Q,fe){var ue=Q.length;Q.push(fe);e:for(;0<ue;){var _e=ue-1>>>1,Me=Q[_e];if(0<o(Me,fe))Q[_e]=fe,Q[ue]=Me,ue=_e;else break e}}function r(Q){return Q.length===0?null:Q[0]}function c(Q){if(Q.length===0)return null;var fe=Q[0],ue=Q.pop();if(ue!==fe){Q[0]=ue;e:for(var _e=0,Me=Q.length,w=Me>>>1;_e<w;){var Z=2*(_e+1)-1,z=Q[Z],me=Z+1,ye=Q[me];if(0>o(z,ue))me<Me&&0>o(ye,z)?(Q[_e]=ye,Q[me]=ue,_e=me):(Q[_e]=z,Q[Z]=ue,_e=Z);else if(me<Me&&0>o(ye,ue))Q[_e]=ye,Q[me]=ue,_e=me;else break e}}return fe}function o(Q,fe){var ue=Q.sortIndex-fe.sortIndex;return ue!==0?ue:Q.id-fe.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,C=!1,T=!1,E=!1,M=!1,I=typeof setTimeout=="function"?setTimeout:null,F=typeof clearTimeout=="function"?clearTimeout:null,J=typeof setImmediate<"u"?setImmediate:null;function H(Q){for(var fe=r(x);fe!==null;){if(fe.callback===null)c(x);else if(fe.startTime<=Q)c(x),fe.sortIndex=fe.expirationTime,s(g,fe);else break;fe=r(x)}}function B(Q){if(E=!1,H(Q),!T)if(r(g)!==null)T=!0,D||(D=!0,ie());else{var fe=r(x);fe!==null&&ve(B,fe.startTime-Q)}}var D=!1,V=-1,X=5,A=-1;function L(){return M?!0:!(l.unstable_now()-A<X)}function Y(){if(M=!1,D){var Q=l.unstable_now();A=Q;var fe=!0;try{e:{T=!1,E&&(E=!1,F(V),V=-1),C=!0;var ue=v;try{t:{for(H(Q),j=r(g);j!==null&&!(j.expirationTime>Q&&L());){var _e=j.callback;if(typeof _e=="function"){j.callback=null,v=j.priorityLevel;var Me=_e(j.expirationTime<=Q);if(Q=l.unstable_now(),typeof Me=="function"){j.callback=Me,H(Q),fe=!0;break t}j===r(g)&&c(g),H(Q)}else c(g);j=r(g)}if(j!==null)fe=!0;else{var w=r(x);w!==null&&ve(B,w.startTime-Q),fe=!1}}break e}finally{j=null,v=ue,C=!1}fe=void 0}}finally{fe?ie():D=!1}}}var ie;if(typeof J=="function")ie=function(){J(Y)};else if(typeof MessageChannel<"u"){var xe=new MessageChannel,Se=xe.port2;xe.port1.onmessage=Y,ie=function(){Se.postMessage(null)}}else ie=function(){I(Y,0)};function ve(Q,fe){V=I(function(){Q(l.unstable_now())},fe)}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(Q){Q.callback=null},l.unstable_forceFrameRate=function(Q){0>Q||125<Q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):X=0<Q?Math.floor(1e3/Q):5},l.unstable_getCurrentPriorityLevel=function(){return v},l.unstable_next=function(Q){switch(v){case 1:case 2:case 3:var fe=3;break;default:fe=v}var ue=v;v=fe;try{return Q()}finally{v=ue}},l.unstable_requestPaint=function(){M=!0},l.unstable_runWithPriority=function(Q,fe){switch(Q){case 1:case 2:case 3:case 4:case 5:break;default:Q=3}var ue=v;v=Q;try{return fe()}finally{v=ue}},l.unstable_scheduleCallback=function(Q,fe,ue){var _e=l.unstable_now();switch(typeof ue=="object"&&ue!==null?(ue=ue.delay,ue=typeof ue=="number"&&0<ue?_e+ue:_e):ue=_e,Q){case 1:var Me=-1;break;case 2:Me=250;break;case 5:Me=1073741823;break;case 4:Me=1e4;break;default:Me=5e3}return Me=ue+Me,Q={id:y++,callback:fe,priorityLevel:Q,startTime:ue,expirationTime:Me,sortIndex:-1},ue>_e?(Q.sortIndex=ue,s(x,Q),r(g)===null&&Q===r(x)&&(E?(F(V),V=-1):E=!0,ve(B,ue-_e))):(Q.sortIndex=Me,s(g,Q),T||C||(T=!0,D||(D=!0,ie()))),Q},l.unstable_shouldYield=L,l.unstable_wrapCallback=function(Q){var fe=v;return function(){var ue=v;v=fe;try{return Q.apply(this,arguments)}finally{v=ue}}}})(Hh)),Hh}var Cx;function S0(){return Cx||(Cx=1,Uh.exports=w0()),Uh.exports}var Bh={exports:{}},hl={};/**
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 hl;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 hl.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,hl.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)},hl.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()}},hl.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))},hl.prefetchDNS=function(g){typeof g=="string"&&c.d.D(g)},hl.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,C=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:C}):y==="script"&&c.d.X(g,{crossOrigin:j,integrity:v,fetchPriority:C,nonce:typeof x.nonce=="string"?x.nonce:void 0})}},hl.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)},hl.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})}},hl.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)},hl.requestFormReset=function(g){c.d.r(g)},hl.unstable_batchedUpdates=function(g,x){return g(x)},hl.useFormState=function(g,x,y){return h.H.useFormState(g,x,y)},hl.useFormStatus=function(){return h.H.useHostTransitionStatus()},hl.version="19.2.8",hl}var Mx;function k0(){if(Mx)return Bh.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(),Bh.exports=N0(),Bh.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 Io;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"),C=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),M=Symbol.for("react.strict_mode"),I=Symbol.for("react.profiler"),F=Symbol.for("react.consumer"),J=Symbol.for("react.context"),H=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),X=Symbol.for("react.lazy"),A=Symbol.for("react.activity"),L=Symbol.for("react.memo_cache_sentinel"),Y=Symbol.iterator;function ie(e){return e===null||typeof e!="object"?null:(e=Y&&e[Y]||e["@@iterator"],typeof e=="function"?e:null)}var xe=Symbol.for("react.client.reference");function Se(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===xe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case E:return"Fragment";case I:return"Profiler";case M:return"StrictMode";case B:return"Suspense";case D:return"SuspenseList";case A:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case T:return"Portal";case J:return e.displayName||"Context";case F: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 V:return t=e.displayName||null,t!==null?t:Se(e.type)||"Memo";case X:t=e._payload,e=e._init;try{return Se(e(t))}catch{}}return null}var ve=Array.isArray,Q=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,fe=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue={pending:!1,data:null,method:null,action:null},_e=[],Me=-1;function w(e){return{current:e}}function Z(e){0>Me||(e.current=_e[Me],_e[Me]=null,Me--)}function z(e,t){Me++,_e[Me]=e.current,e.current=t}var me=w(null),ye=w(null),Re=w(null),Oe=w(null);function Ue(e,t){switch(z(Re,t),z(ye,e),z(me,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}}Z(me),z(me,e)}function Be(){Z(me),Z(ye),Z(Re)}function on(e){e.memoizedState!==null&&z(Oe,e);var t=me.current,n=Qg(t,e.type);t!==n&&(z(ye,e),z(me,n))}function Ke(e){ye.current===e&&(Z(me),Z(ye)),Oe.current===e&&(Z(Oe),Lo._currentValue=ue)}var Jt,ft;function mt(e){if(Jt===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Jt=t&&t[1]||"",ft=-1<n.stack.indexOf(`
43
+ at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
44
+ `+Jt+e+ft}var Ie=!1;function un(e,t){if(!e||Ie)return"";Ie=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var de=function(){throw Error()};if(Object.defineProperty(de.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(de,[])}catch(ne){var ee=ne}Reflect.construct(e,[],de)}else{try{de.call()}catch(ne){ee=ne}e.call(de.prototype)}}else{try{throw Error()}catch(ne){ee=ne}(de=e())&&typeof de.catch=="function"&&de.catch(function(){})}}catch(ne){if(ne&&ee&&typeof ne.stack=="string")return[ne.stack,ee.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 R=b.split(`
45
+ `),W=S.split(`
46
+ `);for(u=i=0;i<R.length&&!R[i].includes("DetermineComponentFrameRoot");)i++;for(;u<W.length&&!W[u].includes("DetermineComponentFrameRoot");)u++;if(i===R.length||u===W.length)for(i=R.length-1,u=W.length-1;1<=i&&0<=u&&R[i]!==W[u];)u--;for(;1<=i&&0<=u;i--,u--)if(R[i]!==W[u]){if(i!==1||u!==1)do if(i--,u--,0>u||R[i]!==W[u]){var re=`
47
+ `+R[i].replace(" at new "," at ");return e.displayName&&re.includes("<anonymous>")&&(re=re.replace("<anonymous>",e.displayName)),re}while(1<=i&&0<=u);break}}}finally{Ie=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?mt(n):""}function Sn(e,t){switch(e.tag){case 26:case 27:case 5:return mt(e.type);case 16:return mt("Lazy");case 13:return e.child!==t&&t!==null?mt("Suspense Fallback"):mt("Suspense");case 19:return mt("SuspenseList");case 0:case 15:return un(e.type,!1);case 11:return un(e.type.render,!1);case 1:return un(e.type,!0);case 31:return mt("Activity");default:return""}}function ct(e){try{var t="",n=null;do t+=Sn(e,n),n=e,e=e.return;while(e);return t}catch(i){return`
48
+ Error generating stack: `+i.message+`
49
+ `+i.stack}}var Nn=Object.prototype.hasOwnProperty,Wn=l.unstable_scheduleCallback,fn=l.unstable_cancelCallback,el=l.unstable_shouldYield,Bt=l.unstable_requestPaint,at=l.unstable_now,Rt=l.unstable_getCurrentPriorityLevel,Yn=l.unstable_ImmediatePriority,Tt=l.unstable_UserBlockingPriority,et=l.unstable_NormalPriority,rt=l.unstable_LowPriority,pn=l.unstable_IdlePriority,bn=l.log,Kn=l.unstable_setDisableYieldValue,en=null,St=null;function Pt(e){if(typeof bn=="function"&&Kn(e),St&&typeof St.setStrictMode=="function")try{St.setStrictMode(en,e)}catch{}}var Dt=Math.clz32?Math.clz32:pe,$n=Math.log,le=Math.LN2;function pe(e){return e>>>=0,e===0?32:31-($n(e)/le|0)|0}var qe=256,Fe=262144,Ve=4194304;function bt(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 $(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=bt(i):(b&=S,b!==0?u=bt(b):n||(n=S&~e,n!==0&&(u=bt(n))))):(S=i&~f,S!==0?u=bt(S):b!==0?u=bt(b):n||(n=i&~e,n!==0&&(u=bt(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 se(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ce(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=Ve;return Ve<<=1,(Ve&62914560)===0&&(Ve=4194304),e}function _t(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Xn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Zn(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,R=e.expirationTimes,W=e.hiddenUpdates;for(n=b&~n;0<n;){var re=31-Dt(n),de=1<<re;S[re]=0,R[re]=-1;var ee=W[re];if(ee!==null)for(W[re]=null,re=0;re<ee.length;re++){var ne=ee[re];ne!==null&&(ne.lane&=-536870913)}n&=~de}i!==0&&Hl(e,i,0),f!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=f&~(b&~t))}function Hl(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-Dt(t);e.entangledLanes|=t,e.entanglements[i]=e.entanglements[i]|1073741824|n&261930}function bl(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var i=31-Dt(n),u=1<<i;u&t|e[i]&t&&(e[i]|=t),n&=~u}}function Bl(e,t){var n=t&-t;return n=(n&42)!==0?1:ls(n),(n&(e.suspendedLanes|t))!==0?0:n}function ls(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 ss(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Ka(){var e=fe.p;return e!==0?e:(e=window.event,e===void 0?32:gx(e.type))}function Il(e,t){var n=fe.p;try{return fe.p=e,t()}finally{fe.p=n}}var tl=Math.random().toString(36).slice(2),Ot="__reactFiber$"+tl,Ze="__reactProps$"+tl,On="__reactContainer$"+tl,Xt="__reactEvents$"+tl,wl="__reactListeners$"+tl,cl="__reactHandles$"+tl,tn="__reactResources$"+tl,ol="__reactMarker$"+tl;function _n(e){delete e[Ot],delete e[Ze],delete e[Xt],delete e[wl],delete e[cl]}function Sl(e){var t=e[Ot];if(t)return t;for(var n=e.parentNode;n;){if(t=n[On]||n[Ot]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ex(e);e!==null;){if(n=e[Ot])return n;e=ex(e)}return t}e=n,n=e.parentNode}return null}function We(e){if(e=e[Ot]||e[On]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ql(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function tt(e){var t=e[tn];return t||(t=e[tn]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Et(e){e[ol]=!0}var It=new Set,Gl={};function kn(e,t){ul(e,t),ul(e+"Capture",t)}function ul(e,t){for(Gl[e]=t,e=0;e<t.length;e++)It.add(t[e])}var as=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]*$"),Tn={},nn={};function Yl(e){return Nn.call(nn,e)?!0:Nn.call(Tn,e)?!1:as.test(e)?nn[e]=!0:(Tn[e]=!0,!1)}function Vt(e,t,n){if(Yl(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 fl(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 En(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 Ct(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Za(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ls(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 is(e){if(!e._valueTracker){var t=Za(e)?"checked":"value";e._valueTracker=Ls(e,t,""+e[t])}}function Ln(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),i="";return e&&(i=Za(e)?e.checked?"true":"false":e.value),e=i,e!==n?(t.setValue(e),!0):!1}function $l(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 rs=/[\n"\\]/g;function yn(e){return e.replace(rs,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function zs(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=""+Ct(t)):e.value!==""+Ct(t)&&(e.value=""+Ct(t)):b!=="submit"&&b!=="reset"||e.removeAttribute("value"),t!=null?Nl(e,b,Ct(t)):n!=null?Nl(e,b,Ct(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=""+Ct(S):e.removeAttribute("name")}function da(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)){is(e);return}n=n!=null?""+Ct(n):"",t=t!=null?""+Ct(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),is(e)}function Nl(e,t,n){t==="number"&&$l(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function kl(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=""+Ct(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 ge(e,t,n){if(t!=null&&(t=""+Ct(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Ct(n):""}function k(e,t,n,i){if(t==null){if(i!=null){if(n!=null)throw Error(c(92));if(ve(i)){if(1<i.length)throw Error(c(93));i=i[0]}n=i}n==null&&(n=""),t=n}n=Ct(t),e.defaultValue=n,i=e.textContent,i===n&&i!==""&&i!==null&&(e.value=i),is(e)}function K(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 Te(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 Ee(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&&Te(e,u,i)}else for(var f in t)t.hasOwnProperty(f)&&Te(e,f,t[f])}function He(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 Ye=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"]]),Wt=/^[\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 Qt(e){return Wt.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function yt(){}var mn=null;function Kt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var nl=null,zn=null;function Xl(e){var t=We(e);if(t&&(e=t.stateNode)){var n=e[Ze]||null;e:switch(e=t.stateNode,t.type){case"input":if(zs(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="'+yn(""+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));zs(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&&Ln(i)}break e;case"textarea":ge(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&kl(e,!!n.multiple,t,!1)}}}var Tl=!1;function N(e,t,n){if(Tl)return e(t,n);Tl=!0;try{var i=e(t);return i}finally{if(Tl=!1,(nl!==null||zn!==null)&&(Ku(),nl&&(t=nl,e=zn,zn=nl=null,Xl(t),e)))for(t=0;t<e.length;t++)Xl(e[t])}}function ae(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 we=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),lt=!1;if(we)try{var Cn={};Object.defineProperty(Cn,"passive",{get:function(){lt=!0}}),window.addEventListener("test",Cn,Cn),window.removeEventListener("test",Cn,Cn)}catch{lt=!1}var Vl=null,zc=null,Fa=null;function $i(){if(Fa)return Fa;var e,t=zc,n=t.length,i,u="value"in Vl?Vl.value:Vl.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 Fa=u.slice(e,1<i?1-i:void 0)}function Xi(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 ha(){return!0}function Uc(){return!1}function vn(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)?ha:Uc,this.isPropagationStopped=Uc,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=ha)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ha)},persist:function(){},isPersistent:ha}),t}var Ql={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Cr=vn(Ql),pa=j({},Ql,{view:0,detail:0}),Ar=vn(pa),Vi,Mr,Us,vs=j({},pa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Pa,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!==Us&&(Us&&e.type==="mousemove"?(Vi=e.screenX-Us.screenX,Mr=e.screenY-Us.screenY):Mr=Vi=0,Us=e),Vi)},movementY:function(e){return"movementY"in e?e.movementY:Mr}}),Rr=vn(vs),Dr=j({},vs,{dataTransfer:0}),Qi=vn(Dr),nd=j({},pa,{relatedTarget:0}),Ja=vn(nd),ld=j({},Ql,{animationName:0,elapsedTime:0,pseudoElement:0}),Or=vn(ld),Lr=j({},Ql,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Hc=vn(Lr),Ki=j({},Ql,{data:0}),Hs=vn(Ki),zr={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Bc={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"},sd={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ma(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=sd[e])?!!t[e]:!1}function Pa(){return ma}var su=j({},pa,{key:function(e){if(e.key){var t=zr[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Xi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Bc[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Pa,charCode:function(e){return e.type==="keypress"?Xi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Xi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Ur=vn(su),au=j({},vs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Zi=vn(au),js=j({},pa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Pa}),Hr=vn(js),Fi=j({},Ql,{propertyName:0,elapsedTime:0,pseudoElement:0}),ga=vn(Fi),Ji=j({},vs,{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}),dn=vn(Ji),Ic=j({},Ql,{newState:0,oldState:0}),ad=vn(Ic),id=[9,13,27,32],Pi=we&&"CompositionEvent"in window,Bs=null;we&&"documentMode"in document&&(Bs=document.documentMode);var Un=we&&"TextEvent"in window&&!Bs,Wa=we&&(!Pi||Bs&&8<Bs&&11>=Bs),ei=" ",qc=!1;function An(e,t){switch(e){case"keyup":return id.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Gc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var xa=!1;function ws(e,t){switch(e){case"compositionend":return Gc(t);case"keypress":return t.which!==32?null:(qc=!0,ei);case"textInput":return e=t.data,e===ei&&qc?null:e;default:return null}}function iu(e,t){if(xa)return e==="compositionend"||!Pi&&An(e,t)?(e=$i(),Fa=zc=Vl=null,xa=!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 Br={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 Wi(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Br[e.type]:t==="textarea"}function ti(e,t,n,i){nl?zn?zn.push(i):zn=[i]:nl=i,t=tf(t,"onChange"),0<t.length&&(n=new Cr("onChange","change",null,n,i),e.push({event:n,listeners:t}))}var Kl=null,ni=null;function er(e){Ig(e,0)}function ba(e){var t=ql(e);if(Ln(t))return e}function li(e,t){if(e==="change")return t}var si=!1;if(we){var Ir;if(we){var _a="oninput"in document;if(!_a){var ru=document.createElement("div");ru.setAttribute("oninput","return;"),_a=typeof ru.oninput=="function"}Ir=_a}else Ir=!1;si=Ir&&(!document.documentMode||9<document.documentMode)}function te(){Kl&&(Kl.detachEvent("onpropertychange",ya),ni=Kl=null)}function ya(e){if(e.propertyName==="value"&&ba(ni)){var t=[];ti(t,ni,e,Kt(e)),N(er,t)}}function Yc(e,t,n){e==="focusin"?(te(),Kl=t,ni=n,Kl.attachEvent("onpropertychange",ya)):e==="focusout"&&te()}function rd(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ba(ni)}function cd(e,t){if(e==="click")return ba(t)}function q(e,t){if(e==="input"||e==="change")return ba(t)}function tr(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Vn=typeof Object.is=="function"?Object.is:tr;function ai(e,t){if(Vn(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(!Nn.call(t,u)||!Vn(e[u],t[u]))return!1}return!0}function $c(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function cu(e,t){var n=$c(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=$c(n)}}function va(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?va(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ou(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=$l(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=$l(e.document)}return t}function Xc(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 od=we&&"documentMode"in document&&11>=document.documentMode,ii=null,Vc=null,cs=null,Qc=!1;function uu(e,t,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Qc||ii==null||ii!==$l(i)||(i=ii,"selectionStart"in i&&Xc(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}),cs&&ai(cs,i)||(cs=i,i=tf(Vc,"onSelect"),0<i.length&&(t=new Cr("onSelect","select",null,t,n),e.push({event:t,listeners:i}),t.target=ii)))}function ja(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ri={animationend:ja("Animation","AnimationEnd"),animationiteration:ja("Animation","AnimationIteration"),animationstart:ja("Animation","AnimationStart"),transitionrun:ja("Transition","TransitionRun"),transitionstart:ja("Transition","TransitionStart"),transitioncancel:ja("Transition","TransitionCancel"),transitionend:ja("Transition","TransitionEnd")},Kc={},fu={};we&&(fu=document.createElement("div").style,"AnimationEvent"in window||(delete ri.animationend.animation,delete ri.animationiteration.animation,delete ri.animationstart.animation),"TransitionEvent"in window||delete ri.transitionend.transition);function wa(e){if(Kc[e])return Kc[e];if(!ri[e])return e;var t=ri[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in fu)return Kc[e]=t[n];return e}var du=wa("animationend"),hu=wa("animationiteration"),qr=wa("animationstart"),ud=wa("transitionrun"),fd=wa("transitionstart"),Zc=wa("transitioncancel"),pu=wa("transitionend"),mu=new Map,ci="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(" ");ci.push("scrollEnd");function Zl(e,t){mu.set(e,t),kn(t,[e])}var nr=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)},dl=[],Sa=0,Gr=0;function lr(){for(var e=Sa,t=Gr=Sa=0;t<e;){var n=dl[t];dl[t++]=null;var i=dl[t];dl[t++]=null;var u=dl[t];dl[t++]=null;var f=dl[t];if(dl[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&&Jc(n,u,f)}}function sr(e,t,n,i){dl[Sa++]=e,dl[Sa++]=t,dl[Sa++]=n,dl[Sa++]=i,Gr|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function Fc(e,t,n,i){return sr(e,t,n,i),Yr(e)}function Is(e,t){return sr(e,null,null,t),Yr(e)}function Jc(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-Dt(n),e=f.hiddenUpdates,i=e[u],i===null?e[u]=[t]:i.push(t),t.lane=n|536870912),f):null}function Yr(e){if(50<Eo)throw Eo=0,lh=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Na={};function Pc(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 _l(e,t,n,i){return new Pc(e,t,n,i)}function Wc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ss(e,t){var n=e.alternate;return n===null?(n=_l(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 gu(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 qs(e,t,n,i,u,f){var b=0;if(i=e,typeof e=="function")Wc(e)&&(b=1);else if(typeof e=="string")b=i0(e,n,me.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case A:return e=_l(31,n,t,u),e.elementType=A,e.lanes=f,e;case E:return Gs(n.children,u,f,t);case M:b=8,u|=24;break;case I:return e=_l(12,n,t,u|2),e.elementType=I,e.lanes=f,e;case B:return e=_l(13,n,t,u),e.elementType=B,e.lanes=f,e;case D:return e=_l(19,n,t,u),e.elementType=D,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case J:b=10;break e;case F:b=9;break e;case H:b=11;break e;case V:b=14;break e;case X:b=16,i=null;break e}b=29,n=Error(c(130,e===null?"null":typeof e,"")),i=null}return t=_l(b,n,t,u),t.elementType=e,t.type=i,t.lanes=f,t}function Gs(e,t,n,i){return e=_l(7,e,i,t),e.lanes=n,e}function eo(e,t,n){return e=_l(6,e,null,t),e.lanes=n,e}function to(e){var t=_l(18,null,null,0);return t.stateNode=e,t}function no(e,t,n){return t=_l(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var xu=new WeakMap;function El(e,t){if(typeof e=="object"&&e!==null){var n=xu.get(e);return n!==void 0?n:(t={value:e,source:t,stack:ct(t)},xu.set(e,t),t)}return{value:e,source:t,stack:ct(t)}}var oi=[],ui=0,$r=null,ar=0,Cl=[],Al=0,Ys=null,os=1,us="";function fs(e,t){oi[ui++]=ar,oi[ui++]=$r,$r=e,ar=t}function bu(e,t,n){Cl[Al++]=os,Cl[Al++]=us,Cl[Al++]=Ys,Ys=e;var i=os;e=us;var u=32-Dt(i)-1;i&=~(1<<u),n+=1;var f=32-Dt(t)+u;if(30<f){var b=u-u%5;f=(i&(1<<b)-1).toString(32),i>>=b,u-=b,os=1<<32-Dt(t)+u|n<<u|i,us=f+e}else os=1<<f|n<<u|i,us=e}function lo(e){e.return!==null&&(fs(e,1),bu(e,1,0))}function so(e){for(;e===$r;)$r=oi[--ui],oi[ui]=null,ar=oi[--ui],oi[ui]=null;for(;e===Ys;)Ys=Cl[--Al],Cl[Al]=null,us=Cl[--Al],Cl[Al]=null,os=Cl[--Al],Cl[Al]=null}function _u(e,t){Cl[Al++]=os,Cl[Al++]=us,Cl[Al++]=Ys,os=t.id,us=t.overflow,Ys=e}var Mn=null,Lt=null,it=!1,$s=null,Ml=!1,ao=Error(c(519));function Xs(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ir(El(t,e)),ao}function yu(e){var t=e.stateNode,n=e.type,i=e.memoizedProps;switch(t[Ot]=e,t[Ze]=i,n){case"dialog":ut("cancel",t),ut("close",t);break;case"iframe":case"object":case"embed":ut("load",t);break;case"video":case"audio":for(n=0;n<Ao.length;n++)ut(Ao[n],t);break;case"source":ut("error",t);break;case"img":case"image":case"link":ut("error",t),ut("load",t);break;case"details":ut("toggle",t);break;case"input":ut("invalid",t),da(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":ut("invalid",t);break;case"textarea":ut("invalid",t),k(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&&(ut("beforetoggle",t),ut("toggle",t)),i.onScroll!=null&&ut("scroll",t),i.onScrollEnd!=null&&ut("scrollend",t),i.onClick!=null&&(t.onclick=yt),t=!0):t=!1,t||Xs(e,!0)}function vu(e){for(Mn=e.return;Mn;)switch(Mn.tag){case 5:case 31:case 13:Ml=!1;return;case 27:case 3:Ml=!0;return;default:Mn=Mn.return}}function fi(e){if(e!==Mn)return!1;if(!it)return vu(e),it=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||bh(e.type,e.memoizedProps)),n=!n),n&&Lt&&Xs(e),vu(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));Lt=Wg(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));Lt=Wg(e)}else t===27?(t=Lt,Ti(e.type)?(e=wh,wh=null,Lt=e):Lt=t):Lt=Mn?ms(e.stateNode.nextSibling):null;return!0}function ka(){Lt=Mn=null,it=!1}function io(){var e=$s;return e!==null&&(Ll===null?Ll=e:Ll.push.apply(Ll,e),$s=null),e}function ir(e){$s===null?$s=[e]:$s.push(e)}var ro=w(null),Ta=null,Ns=null;function Vs(e,t,n){z(ro,t._currentValue),t._currentValue=n}function ks(e){e._currentValue=ro.current,Z(ro)}function co(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 oo(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 R=0;R<t.length;R++)if(S.context===t[R]){f.lanes|=n,S=f.alternate,S!==null&&(S.lanes|=n),co(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),co(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 Ea(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;Vn(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(Lo):e=[Lo])}u=u.return}e!==null&&oo(t,e,n,i),t.flags|=262144}function rr(e){for(e=e.firstContext;e!==null;){if(!Vn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ds(e){Ta=e,Ns=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function zt(e){return Zt(Ta,e)}function ll(e,t){return Ta===null&&ds(e),Zt(e,t)}function Zt(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Ns===null){if(e===null)throw Error(c(308));Ns=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ns=Ns.next=t;return n}var uo=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()})}},dd=l.unstable_scheduleCallback,hd=l.unstable_NormalPriority,ln={$$typeof:J,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Xr(){return{controller:new uo,data:new Map,refCount:0}}function Qs(e){e.refCount--,e.refCount===0&&dd(hd,function(){e.controller.abort()})}var Ca=null,Vr=0,Ts=0,Aa=null;function pd(e,t){if(Ca===null){var n=Ca=[];Vr=0,Ts=oh(),Aa={status:"pending",value:void 0,then:function(i){n.push(i)}}}return Vr++,t.then(di,di),t}function di(){if(--Vr===0&&Ca!==null){Aa!==null&&(Aa.status="fulfilled");var e=Ca;Ca=null,Ts=0,Aa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ju(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 wu=Q.S;Q.S=function(e,t){pg=at(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&pd(e,t),wu!==null&&wu(e,t)};var Es=w(null);function fo(){var e=Es.current;return e!==null?e:Ft.pooledCache}function Ks(e,t){t===null?z(Es,Es.current):z(Es,t.pool)}function Ma(){var e=fo();return e===null?null:{parent:ln._currentValue,pool:e}}var hi=Error(c(460)),Qr=Error(c(474)),cr=Error(c(542)),Kr={then:function(){}};function Su(e){return e=e.status,e==="fulfilled"||e==="rejected"}function ho(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,ku(e),e;default:if(typeof t.status=="string")t.then(yt,yt);else{if(e=Ft,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,ku(e),e}throw Ra=t,hi}}function Zs(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Ra=n,hi):n}}var Ra=null;function Nu(){if(Ra===null)throw Error(c(459));var e=Ra;return Ra=null,e}function ku(e){if(e===hi||e===cr)throw Error(c(483))}var Fs=null,pi=0;function Zr(e){var t=pi;return pi+=1,Fs===null&&(Fs=[]),ho(Fs,e,t)}function hs(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function mi(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 Tu(e){function t(G,O){if(e){var P=G.deletions;P===null?(G.deletions=[O],G.flags|=16):P.push(O)}}function n(G,O){if(!e)return null;for(;O!==null;)t(G,O),O=O.sibling;return null}function i(G){for(var O=new Map;G!==null;)G.key!==null?O.set(G.key,G):O.set(G.index,G),G=G.sibling;return O}function u(G,O){return G=Ss(G,O),G.index=0,G.sibling=null,G}function f(G,O,P){return G.index=P,e?(P=G.alternate,P!==null?(P=P.index,P<O?(G.flags|=67108866,O):P):(G.flags|=67108866,O)):(G.flags|=1048576,O)}function b(G){return e&&G.alternate===null&&(G.flags|=67108866),G}function S(G,O,P,oe){return O===null||O.tag!==6?(O=eo(P,G.mode,oe),O.return=G,O):(O=u(O,P),O.return=G,O)}function R(G,O,P,oe){var Ge=P.type;return Ge===E?re(G,O,P.props.children,oe,P.key):O!==null&&(O.elementType===Ge||typeof Ge=="object"&&Ge!==null&&Ge.$$typeof===X&&Zs(Ge)===O.type)?(O=u(O,P.props),hs(O,P),O.return=G,O):(O=qs(P.type,P.key,P.props,null,G.mode,oe),hs(O,P),O.return=G,O)}function W(G,O,P,oe){return O===null||O.tag!==4||O.stateNode.containerInfo!==P.containerInfo||O.stateNode.implementation!==P.implementation?(O=no(P,G.mode,oe),O.return=G,O):(O=u(O,P.children||[]),O.return=G,O)}function re(G,O,P,oe,Ge){return O===null||O.tag!==7?(O=Gs(P,G.mode,oe,Ge),O.return=G,O):(O=u(O,P),O.return=G,O)}function de(G,O,P){if(typeof O=="string"&&O!==""||typeof O=="number"||typeof O=="bigint")return O=eo(""+O,G.mode,P),O.return=G,O;if(typeof O=="object"&&O!==null){switch(O.$$typeof){case C:return P=qs(O.type,O.key,O.props,null,G.mode,P),hs(P,O),P.return=G,P;case T:return O=no(O,G.mode,P),O.return=G,O;case X:return O=Zs(O),de(G,O,P)}if(ve(O)||ie(O))return O=Gs(O,G.mode,P,null),O.return=G,O;if(typeof O.then=="function")return de(G,Zr(O),P);if(O.$$typeof===J)return de(G,ll(G,O),P);mi(G,O)}return null}function ee(G,O,P,oe){var Ge=O!==null?O.key:null;if(typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint")return Ge!==null?null:S(G,O,""+P,oe);if(typeof P=="object"&&P!==null){switch(P.$$typeof){case C:return P.key===Ge?R(G,O,P,oe):null;case T:return P.key===Ge?W(G,O,P,oe):null;case X:return P=Zs(P),ee(G,O,P,oe)}if(ve(P)||ie(P))return Ge!==null?null:re(G,O,P,oe,null);if(typeof P.then=="function")return ee(G,O,Zr(P),oe);if(P.$$typeof===J)return ee(G,O,ll(G,P),oe);mi(G,P)}return null}function ne(G,O,P,oe,Ge){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return G=G.get(P)||null,S(O,G,""+oe,Ge);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case C:return G=G.get(oe.key===null?P:oe.key)||null,R(O,G,oe,Ge);case T:return G=G.get(oe.key===null?P:oe.key)||null,W(O,G,oe,Ge);case X:return oe=Zs(oe),ne(G,O,P,oe,Ge)}if(ve(oe)||ie(oe))return G=G.get(P)||null,re(O,G,oe,Ge,null);if(typeof oe.then=="function")return ne(G,O,P,Zr(oe),Ge);if(oe.$$typeof===J)return ne(G,O,P,ll(O,oe),Ge);mi(O,oe)}return null}function De(G,O,P,oe){for(var Ge=null,jt=null,ze=O,st=O=0,pt=null;ze!==null&&st<P.length;st++){ze.index>st?(pt=ze,ze=null):pt=ze.sibling;var wt=ee(G,ze,P[st],oe);if(wt===null){ze===null&&(ze=pt);break}e&&ze&&wt.alternate===null&&t(G,ze),O=f(wt,O,st),jt===null?Ge=wt:jt.sibling=wt,jt=wt,ze=pt}if(st===P.length)return n(G,ze),it&&fs(G,st),Ge;if(ze===null){for(;st<P.length;st++)ze=de(G,P[st],oe),ze!==null&&(O=f(ze,O,st),jt===null?Ge=ze:jt.sibling=ze,jt=ze);return it&&fs(G,st),Ge}for(ze=i(ze);st<P.length;st++)pt=ne(ze,G,st,P[st],oe),pt!==null&&(e&&pt.alternate!==null&&ze.delete(pt.key===null?st:pt.key),O=f(pt,O,st),jt===null?Ge=pt:jt.sibling=pt,jt=pt);return e&&ze.forEach(function(Ri){return t(G,Ri)}),it&&fs(G,st),Ge}function Xe(G,O,P,oe){if(P==null)throw Error(c(151));for(var Ge=null,jt=null,ze=O,st=O=0,pt=null,wt=P.next();ze!==null&&!wt.done;st++,wt=P.next()){ze.index>st?(pt=ze,ze=null):pt=ze.sibling;var Ri=ee(G,ze,wt.value,oe);if(Ri===null){ze===null&&(ze=pt);break}e&&ze&&Ri.alternate===null&&t(G,ze),O=f(Ri,O,st),jt===null?Ge=Ri:jt.sibling=Ri,jt=Ri,ze=pt}if(wt.done)return n(G,ze),it&&fs(G,st),Ge;if(ze===null){for(;!wt.done;st++,wt=P.next())wt=de(G,wt.value,oe),wt!==null&&(O=f(wt,O,st),jt===null?Ge=wt:jt.sibling=wt,jt=wt);return it&&fs(G,st),Ge}for(ze=i(ze);!wt.done;st++,wt=P.next())wt=ne(ze,G,st,wt.value,oe),wt!==null&&(e&&wt.alternate!==null&&ze.delete(wt.key===null?st:wt.key),O=f(wt,O,st),jt===null?Ge=wt:jt.sibling=wt,jt=wt);return e&&ze.forEach(function(x0){return t(G,x0)}),it&&fs(G,st),Ge}function Yt(G,O,P,oe){if(typeof P=="object"&&P!==null&&P.type===E&&P.key===null&&(P=P.props.children),typeof P=="object"&&P!==null){switch(P.$$typeof){case C:e:{for(var Ge=P.key;O!==null;){if(O.key===Ge){if(Ge=P.type,Ge===E){if(O.tag===7){n(G,O.sibling),oe=u(O,P.props.children),oe.return=G,G=oe;break e}}else if(O.elementType===Ge||typeof Ge=="object"&&Ge!==null&&Ge.$$typeof===X&&Zs(Ge)===O.type){n(G,O.sibling),oe=u(O,P.props),hs(oe,P),oe.return=G,G=oe;break e}n(G,O);break}else t(G,O);O=O.sibling}P.type===E?(oe=Gs(P.props.children,G.mode,oe,P.key),oe.return=G,G=oe):(oe=qs(P.type,P.key,P.props,null,G.mode,oe),hs(oe,P),oe.return=G,G=oe)}return b(G);case T:e:{for(Ge=P.key;O!==null;){if(O.key===Ge)if(O.tag===4&&O.stateNode.containerInfo===P.containerInfo&&O.stateNode.implementation===P.implementation){n(G,O.sibling),oe=u(O,P.children||[]),oe.return=G,G=oe;break e}else{n(G,O);break}else t(G,O);O=O.sibling}oe=no(P,G.mode,oe),oe.return=G,G=oe}return b(G);case X:return P=Zs(P),Yt(G,O,P,oe)}if(ve(P))return De(G,O,P,oe);if(ie(P)){if(Ge=ie(P),typeof Ge!="function")throw Error(c(150));return P=Ge.call(P),Xe(G,O,P,oe)}if(typeof P.then=="function")return Yt(G,O,Zr(P),oe);if(P.$$typeof===J)return Yt(G,O,ll(G,P),oe);mi(G,P)}return typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint"?(P=""+P,O!==null&&O.tag===6?(n(G,O.sibling),oe=u(O,P),oe.return=G,G=oe):(n(G,O),oe=eo(P,G.mode,oe),oe.return=G,G=oe),b(G)):n(G,O)}return function(G,O,P,oe){try{pi=0;var Ge=Yt(G,O,P,oe);return Fs=null,Ge}catch(ze){if(ze===hi||ze===cr)throw ze;var jt=_l(29,ze,null,G.mode);return jt.lanes=oe,jt.return=G,jt}finally{}}}var Js=Tu(!0),po=Tu(!1),p=!1;function U(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ce(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 Ne(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function vt(e,t,n){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(Nt&2)!==0){var u=i.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),i.pending=t,t=Yr(e),Jc(e,null,n),t}return sr(e,i,t,n),Yr(e)}function gn(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,bl(e,n)}}function yl(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 Da=!1;function gi(){if(Da){var e=Aa;if(e!==null)throw e}}function xi(e,t,n,i){Da=!1;var u=e.updateQueue;p=!1;var f=u.firstBaseUpdate,b=u.lastBaseUpdate,S=u.shared.pending;if(S!==null){u.shared.pending=null;var R=S,W=R.next;R.next=null,b===null?f=W:b.next=W,b=R;var re=e.alternate;re!==null&&(re=re.updateQueue,S=re.lastBaseUpdate,S!==b&&(S===null?re.firstBaseUpdate=W:S.next=W,re.lastBaseUpdate=R))}if(f!==null){var de=u.baseState;b=0,re=W=R=null,S=f;do{var ee=S.lane&-536870913,ne=ee!==S.lane;if(ne?(ht&ee)===ee:(i&ee)===ee){ee!==0&&ee===Ts&&(Da=!0),re!==null&&(re=re.next={lane:0,tag:S.tag,payload:S.payload,callback:null,next:null});e:{var De=e,Xe=S;ee=t;var Yt=n;switch(Xe.tag){case 1:if(De=Xe.payload,typeof De=="function"){de=De.call(Yt,de,ee);break e}de=De;break e;case 3:De.flags=De.flags&-65537|128;case 0:if(De=Xe.payload,ee=typeof De=="function"?De.call(Yt,de,ee):De,ee==null)break e;de=j({},de,ee);break e;case 2:p=!0}}ee=S.callback,ee!==null&&(e.flags|=64,ne&&(e.flags|=8192),ne=u.callbacks,ne===null?u.callbacks=[ee]:ne.push(ee))}else ne={lane:ee,tag:S.tag,payload:S.payload,callback:S.callback,next:null},re===null?(W=re=ne,R=de):re=re.next=ne,b|=ee;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);re===null&&(R=de),u.baseState=R,u.firstBaseUpdate=W,u.lastBaseUpdate=re,f===null&&(u.shared.lanes=0),ji|=b,e.lanes=b,e.memoizedState=de}}function be(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function Ae(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)be(n[e],t)}var $e=w(null),dt=w(0);function At(e,t){e=Ga,z(dt,e),z($e,t),Ga=e|t.baseLanes}function Fl(){z(dt,Ga),z($e,$e.current)}function mo(){Ga=dt.current,Z($e),Z(dt)}var Jl=w(null),ps=null;function bi(e){var t=e.alternate;z(Rn,Rn.current&1),z(Jl,e),ps===null&&(t===null||$e.current!==null||t.memoizedState!==null)&&(ps=e)}function md(e){z(Rn,Rn.current),z(Jl,e),ps===null&&(ps=e)}function Gp(e){e.tag===22?(z(Rn,Rn.current),z(Jl,e),ps===null&&(ps=e)):_i()}function _i(){z(Rn,Rn.current),z(Jl,Jl.current)}function Pl(e){Z(Jl),ps===e&&(ps=null),Z(Rn)}var Rn=w(0);function Eu(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||vh(n)||jh(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,nt=null,qt=null,Hn=null,Cu=!1,Fr=!1,or=!1,Au=0,go=0,Jr=null,ry=0;function jn(){throw Error(c(321))}function gd(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Vn(e[n],t[n]))return!1;return!0}function xd(e,t,n,i,u,f){return Oa=f,nt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Q.H=e===null||e.memoizedState===null?Nm:Rd,or=!1,f=n(i,u),or=!1,Fr&&(f=$p(t,n,i,u)),Yp(e),f}function Yp(e){Q.H=_o;var t=qt!==null&&qt.next!==null;if(Oa=0,Hn=qt=nt=null,Cu=!1,go=0,Jr=null,t)throw Error(c(300));e===null||Bn||(e=e.dependencies,e!==null&&rr(e)&&(Bn=!0))}function $p(e,t,n,i){nt=e;var u=0;do{if(Fr&&(Jr=null),go=0,Fr=!1,25<=u)throw Error(c(301));if(u+=1,Hn=qt=null,e.updateQueue!=null){var f=e.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}Q.H=km,f=t(n,i)}while(Fr);return f}function cy(){var e=Q.H,t=e.useState()[0];return t=typeof t.then=="function"?xo(t):t,e=e.useState()[0],(qt!==null?qt.memoizedState:null)!==e&&(nt.flags|=1024),t}function bd(){var e=Au!==0;return Au=0,e}function _d(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function yd(e){if(Cu){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Cu=!1}Oa=0,Hn=qt=nt=null,Fr=!1,go=Au=0,Jr=null}function vl(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Hn===null?nt.memoizedState=Hn=e:Hn=Hn.next=e,Hn}function Dn(){if(qt===null){var e=nt.alternate;e=e!==null?e.memoizedState:null}else e=qt.next;var t=Hn===null?nt.memoizedState:Hn.next;if(t!==null)Hn=t,qt=e;else{if(e===null)throw nt.alternate===null?Error(c(467)):Error(c(310));qt=e,e={memoizedState:qt.memoizedState,baseState:qt.baseState,baseQueue:qt.baseQueue,queue:qt.queue,next:null},Hn===null?nt.memoizedState=Hn=e:Hn=Hn.next=e}return Hn}function Mu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function xo(e){var t=go;return go+=1,Jr===null&&(Jr=[]),e=ho(Jr,e,t),t=nt,(Hn===null?t.memoizedState:Hn.next)===null&&(t=t.alternate,Q.H=t===null||t.memoizedState===null?Nm:Rd),e}function Ru(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return xo(e);if(e.$$typeof===J)return zt(e)}throw Error(c(438,String(e)))}function vd(e){var t=null,n=nt.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var i=nt.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=Mu(),nt.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]=L;return t.index++,n}function La(e,t){return typeof t=="function"?t(e):t}function Du(e){var t=Dn();return jd(t,qt,e)}function jd(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,R=null,W=t,re=!1;do{var de=W.lane&-536870913;if(de!==W.lane?(ht&de)===de:(Oa&de)===de){var ee=W.revertLane;if(ee===0)R!==null&&(R=R.next={lane:0,revertLane:0,gesture:null,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null}),de===Ts&&(re=!0);else if((Oa&ee)===ee){W=W.next,ee===Ts&&(re=!0);continue}else de={lane:0,revertLane:W.revertLane,gesture:null,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},R===null?(S=R=de,b=f):R=R.next=de,nt.lanes|=ee,ji|=ee;de=W.action,or&&n(f,de),f=W.hasEagerState?W.eagerState:n(f,de)}else ee={lane:de,revertLane:W.revertLane,gesture:W.gesture,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},R===null?(S=R=ee,b=f):R=R.next=ee,nt.lanes|=de,ji|=de;W=W.next}while(W!==null&&W!==t);if(R===null?b=f:R.next=S,!Vn(f,e.memoizedState)&&(Bn=!0,re&&(n=Aa,n!==null)))throw n;e.memoizedState=f,e.baseState=b,e.baseQueue=R,i.lastRenderedState=f}return u===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function wd(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);Vn(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=nt,u=Dn(),f=it;if(f){if(n===void 0)throw Error(c(407));n=n()}else n=t();var b=!Vn((qt||u).memoizedState,n);if(b&&(u.memoizedState=n,Bn=!0),u=u.queue,kd(Kp.bind(null,i,u,e),[e]),u.getSnapshot!==t||b||Hn!==null&&Hn.memoizedState.tag&1){if(i.flags|=2048,Pr(9,{destroy:void 0},Qp.bind(null,i,u,n,t),null),Ft===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=nt.updateQueue,t===null?(t=Mu(),nt.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!Vn(e,n)}catch{return!0}}function Fp(e){var t=Is(e,2);t!==null&&zl(t,e,2)}function Sd(e){var t=vl();if(typeof e=="function"){var n=e;if(e=n(),or){Pt(!0);try{n()}finally{Pt(!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,jd(e,qt,typeof i=="function"?i:La)}function oy(e,t,n,i,u){if(zu(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)}};Q.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=Q.T,b={};Q.T=b;try{var S=n(u,i),R=Q.S;R!==null&&R(b,S),Wp(e,t,S)}catch(W){Nd(e,t,W)}finally{f!==null&&b.types!==null&&(f.types=b.types),Q.T=f}}else try{f=n(u,i),Wp(e,t,f)}catch(W){Nd(e,t,W)}}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 Nd(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 Nd(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(it){var n=Ft.formState;if(n!==null){e:{var i=nt;if(it){if(Lt){t:{for(var u=Lt,f=Ml;u.nodeType!==8;){if(!f){u=null;break t}if(u=ms(u.nextSibling),u===null){u=null;break t}}f=u.data,u=f==="F!"||f==="F"?u:null}if(u){Lt=ms(u.nextSibling),i=u.data==="F!";break e}}Xs(i)}i=!1}i&&(t=n[0])}}return n=vl(),n.memoizedState=n.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:nm,lastRenderedState:t},n.queue=i,n=jm.bind(null,nt,i),i.dispatch=n,i=Sd(!1),f=Md.bind(null,nt,!1,i.queue),i=vl(),u={state:t,dispatch:null,action:e,pending:null},i.queue=u,n=oy.bind(null,nt,u,f,n),u.dispatch=n,i.memoizedState=e,[t,n,!1]}function sm(e){var t=Dn();return am(t,qt,e)}function am(e,t,n){if(t=jd(e,t,nm)[0],e=Du(La)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var i=xo(t)}catch(b){throw b===hi?cr:b}else i=t;t=Dn();var u=t.queue,f=u.dispatch;return n!==t.memoizedState&&(nt.flags|=2048,Pr(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=qt;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 Pr(e,t,n,i){return e={tag:e,create:n,deps:i,inst:t,next:null},t=nt.updateQueue,t===null&&(t=Mu(),nt.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 Ou(e,t,n,i){var u=vl();nt.flags|=e,u.memoizedState=Pr(1|t,{destroy:void 0},n,i===void 0?null:i)}function Lu(e,t,n,i){var u=Dn();i=i===void 0?null:i;var f=u.memoizedState.inst;qt!==null&&i!==null&&gd(i,qt.memoizedState.deps)?u.memoizedState=Pr(t,f,n,i):(nt.flags|=e,u.memoizedState=Pr(1|t,f,n,i))}function cm(e,t){Ou(8390656,8,e,t)}function kd(e,t){Lu(2048,8,e,t)}function fy(e){nt.flags|=4;var t=nt.updateQueue;if(t===null)t=Mu(),nt.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((Nt&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function um(e,t){return Lu(4,2,e,t)}function fm(e,t){return Lu(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,Lu(4,4,dm.bind(null,t,e),n)}function Td(){}function pm(e,t){var n=Dn();t=t===void 0?null:t;var i=n.memoizedState;return t!==null&&gd(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&&gd(t,i[1]))return i[0];if(i=e(),or){Pt(!0);try{e()}finally{Pt(!1)}}return n.memoizedState=[i,t],i}function Ed(e,t,n){return n===void 0||(Oa&1073741824)!==0&&(ht&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=gg(),nt.lanes|=e,ji|=e,n)}function gm(e,t,n,i){return Vn(n,t)?n:$e.current!==null?(e=Ed(e,n,i),Vn(e,t)||(Bn=!0),e):(Oa&42)===0||(Oa&1073741824)!==0&&(ht&261930)===0?(Bn=!0,e.memoizedState=n):(e=gg(),nt.lanes|=e,ji|=e,t)}function xm(e,t,n,i,u){var f=fe.p;fe.p=f!==0&&8>f?f:8;var b=Q.T,S={};Q.T=S,Md(e,!1,t,n);try{var R=u(),W=Q.S;if(W!==null&&W(S,R),R!==null&&typeof R=="object"&&typeof R.then=="function"){var re=ju(R,i);bo(e,t,re,ts(e))}else bo(e,t,i,ts(e))}catch(de){bo(e,t,{then:function(){},status:"rejected",reason:de},ts())}finally{fe.p=f,b!==null&&S.types!==null&&(b.types=S.types),Q.T=b}}function dy(){}function Cd(e,t,n,i){if(e.tag!==5)throw Error(c(476));var u=bm(e).queue;xm(e,u,t,ue,n===null?dy:function(){return _m(e),n(i)})}function bm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ue,baseState:ue,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:La,lastRenderedState:ue},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),bo(e,t.next.queue,{},ts())}function Ad(){return zt(Lo)}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=ts();e=Ne(n);var i=vt(t,e,n);i!==null&&(zl(i,t,n),gn(i,t,n)),t={cache:Xr()},e.payload=t;return}t=t.return}}function py(e,t,n){var i=ts();n={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},zu(e)?wm(t,n):(n=Fc(e,t,n,i),n!==null&&(zl(n,e,i),Sm(n,t,i)))}function jm(e,t,n){var i=ts();bo(e,t,n,i)}function bo(e,t,n,i){var u={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(zu(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,Vn(S,b))return sr(e,t,u,0),Ft===null&&lr(),!1}catch{}finally{}if(n=Fc(e,t,u,i),n!==null)return zl(n,e,i),Sm(n,t,i),!0}return!1}function Md(e,t,n,i){if(i={lane:2,revertLane:oh(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},zu(e)){if(t)throw Error(c(479))}else t=Fc(e,n,i,2),t!==null&&zl(t,e,2)}function zu(e){var t=e.alternate;return e===nt||t!==null&&t===nt}function wm(e,t){Fr=Cu=!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,bl(e,n)}}var _o={readContext:zt,use:Ru,useCallback:jn,useContext:jn,useEffect:jn,useImperativeHandle:jn,useLayoutEffect:jn,useInsertionEffect:jn,useMemo:jn,useReducer:jn,useRef:jn,useState:jn,useDebugValue:jn,useDeferredValue:jn,useTransition:jn,useSyncExternalStore:jn,useId:jn,useHostTransitionStatus:jn,useFormState:jn,useActionState:jn,useOptimistic:jn,useMemoCache:jn,useCacheRefresh:jn};_o.useEffectEvent=jn;var Nm={readContext:zt,use:Ru,useCallback:function(e,t){return vl().memoizedState=[e,t===void 0?null:t],e},useContext:zt,useEffect:cm,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Ou(4194308,4,dm.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ou(4194308,4,e,t)},useInsertionEffect:function(e,t){Ou(4,2,e,t)},useMemo:function(e,t){var n=vl();t=t===void 0?null:t;var i=e();if(or){Pt(!0);try{e()}finally{Pt(!1)}}return n.memoizedState=[i,t],i},useReducer:function(e,t,n){var i=vl();if(n!==void 0){var u=n(t);if(or){Pt(!0);try{n(t)}finally{Pt(!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,nt,e),[i.memoizedState,e]},useRef:function(e){var t=vl();return e={current:e},t.memoizedState=e},useState:function(e){e=Sd(e);var t=e.queue,n=jm.bind(null,nt,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Td,useDeferredValue:function(e,t){var n=vl();return Ed(n,e,t)},useTransition:function(){var e=Sd(!1);return e=xm.bind(null,nt,e.queue,!0,!1),vl().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var i=nt,u=vl();if(it){if(n===void 0)throw Error(c(407));n=n()}else{if(n=t(),Ft===null)throw Error(c(349));(ht&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,Pr(9,{destroy:void 0},Qp.bind(null,i,f,n,t),null),n},useId:function(){var e=vl(),t=Ft.identifierPrefix;if(it){var n=us,i=os;n=(i&~(1<<32-Dt(i)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Au++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=ry++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Ad,useFormState:lm,useActionState:lm,useOptimistic:function(e){var t=vl();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Md.bind(null,nt,!0,n),n.dispatch=t,[e,t]},useMemoCache:vd,useCacheRefresh:function(){return vl().memoizedState=hy.bind(null,nt)},useEffectEvent:function(e){var t=vl(),n={impl:e};return t.memoizedState=n,function(){if((Nt&2)!==0)throw Error(c(440));return n.impl.apply(void 0,arguments)}}},Rd={readContext:zt,use:Ru,useCallback:pm,useContext:zt,useEffect:kd,useImperativeHandle:hm,useInsertionEffect:um,useLayoutEffect:fm,useMemo:mm,useReducer:Du,useRef:rm,useState:function(){return Du(La)},useDebugValue:Td,useDeferredValue:function(e,t){var n=Dn();return gm(n,qt.memoizedState,e,t)},useTransition:function(){var e=Du(La)[0],t=Dn().memoizedState;return[typeof e=="boolean"?e:xo(e),t]},useSyncExternalStore:Xp,useId:ym,useHostTransitionStatus:Ad,useFormState:sm,useActionState:sm,useOptimistic:function(e,t){var n=Dn();return Jp(n,qt,e,t)},useMemoCache:vd,useCacheRefresh:vm};Rd.useEffectEvent=om;var km={readContext:zt,use:Ru,useCallback:pm,useContext:zt,useEffect:kd,useImperativeHandle:hm,useInsertionEffect:um,useLayoutEffect:fm,useMemo:mm,useReducer:wd,useRef:rm,useState:function(){return wd(La)},useDebugValue:Td,useDeferredValue:function(e,t){var n=Dn();return qt===null?Ed(n,e,t):gm(n,qt.memoizedState,e,t)},useTransition:function(){var e=wd(La)[0],t=Dn().memoizedState;return[typeof e=="boolean"?e:xo(e),t]},useSyncExternalStore:Xp,useId:ym,useHostTransitionStatus:Ad,useFormState:im,useActionState:im,useOptimistic:function(e,t){var n=Dn();return qt!==null?Jp(n,qt,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:vd,useCacheRefresh:vm};km.useEffectEvent=om;function Dd(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 Od={enqueueSetState:function(e,t,n){e=e._reactInternals;var i=ts(),u=Ne(i);u.payload=t,n!=null&&(u.callback=n),t=vt(e,u,i),t!==null&&(zl(t,e,i),gn(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var i=ts(),u=Ne(i);u.tag=1,u.payload=t,n!=null&&(u.callback=n),t=vt(e,u,i),t!==null&&(zl(t,e,i),gn(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=ts(),i=Ne(n);i.tag=2,t!=null&&(i.callback=t),t=vt(e,i,n),t!==null&&(zl(t,e,n),gn(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?!ai(n,i)||!ai(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&&Od.enqueueReplaceState(t,t.state,null)}function ur(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){nr(e)}function Am(e){console.error(e)}function Mm(e){nr(e)}function Uu(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 Ld(e,t,n){return n=Ne(n),n.tag=3,n.payload={element:null},n.callback=function(){Uu(e,t)},n}function Dm(e){return e=Ne(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"&&(wi===null?wi=new Set([this]):wi.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&&Ea(t,n,u,!0),n=Jl.current,n!==null){switch(n.tag){case 31:case 13:return ps===null?Zu():n.alternate===null&&wn===0&&(wn=3),n.flags&=-257,n.flags|=65536,n.lanes=u,i===Kr?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([i]):t.add(i),ih(e,i,u)),!1;case 22:return n.flags|=65536,i===Kr?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)),ih(e,i,u)),!1}throw Error(c(435,n.tag))}return ih(e,i,u),Zu(),!1}if(it)return t=Jl.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,i!==ao&&(e=Error(c(422),{cause:i}),ir(El(e,n)))):(i!==ao&&(t=Error(c(423),{cause:i}),ir(El(t,n))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,i=El(i,n),u=Ld(e.stateNode,i,u),yl(e,u),wn!==4&&(wn=2)),!1;var f=Error(c(520),{cause:i});if(f=El(f,n),To===null?To=[f]:To.push(f),wn!==4&&(wn=2),t===null)return!0;i=El(i,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=u&-u,n.lanes|=e,e=Ld(n.stateNode,i,e),yl(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"&&(wi===null||!wi.has(f))))return n.flags|=65536,u&=-u,n.lanes|=u,u=Dm(u),Om(u,e,n,i),yl(n,u),!1}n=n.return}while(n!==null);return!1}var zd=Error(c(461)),Bn=!1;function sl(e,t,n,i){t.child=e===null?po(t,null,n,i):Js(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 ds(t),i=xd(e,t,n,b,f,u),S=bd(),e!==null&&!Bn?(_d(e,t,u),za(e,t,u)):(it&&S&&lo(t),t.flags|=1,sl(e,t,i,u),t.child)}function zm(e,t,n,i,u){if(e===null){var f=n.type;return typeof f=="function"&&!Wc(f)&&f.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=f,Um(e,t,f,i,u)):(e=qs(n.type,null,i,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!$d(e,u)){var b=f.memoizedProps;if(n=n.compare,n=n!==null?n:ai,n(b,i)&&e.ref===t.ref)return za(e,t,u)}return t.flags|=1,e=Ss(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(ai(f,i)&&e.ref===t.ref)if(Bn=!1,t.pendingProps=i=f,$d(e,u))(e.flags&131072)!==0&&(Bn=!0);else return t.lanes=e.lanes,za(e,t,u)}return Ud(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&&Ks(t,f!==null?f.cachePool:null),f!==null?At(t,f):Fl(),Gp(t);else return i=t.lanes=536870912,Bm(e,t,f!==null?f.baseLanes|n:n,n,i)}else f!==null?(Ks(t,f.cachePool),At(t,f),_i(),t.memoizedState=null):(e!==null&&Ks(t,null),Fl(),_i());return sl(e,t,u,n),t.child}function yo(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=fo();return f=f===null?null:{parent:ln._currentValue,pool:f},t.memoizedState={baseLanes:n,cachePool:f},e!==null&&Ks(t,null),Fl(),Gp(t),e!==null&&Ea(e,t,i,!0),t.childLanes=u,null}function Hu(e,t){return t=Iu({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 Js(t,e.child,null,n),e=Hu(t,t.pendingProps),e.flags|=2,Pl(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(it){if(i.mode==="hidden")return e=Hu(t,i),t.lanes=536870912,yo(null,e);if(md(t),(e=Lt)?(e=Pg(e,Ml),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ys!==null?{id:os,overflow:us}:null,retryLane:536870912,hydrationErrors:null},n=to(e),n.return=t,t.child=n,Mn=t,Lt=null)):e=null,e===null)throw Xs(t);return t.lanes=536870912,null}return Hu(t,i)}var f=e.memoizedState;if(f!==null){var b=f.dehydrated;if(md(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||Ea(e,t,n,!1),u=(n&e.childLanes)!==0,Bn||u){if(i=Ft,i!==null&&(b=Bl(i,n),b!==0&&b!==f.retryLane))throw f.retryLane=b,Is(e,b),zl(i,e,b),zd;Zu(),t=Im(e,t,n)}else e=f.treeContext,Lt=ms(b.nextSibling),Mn=t,it=!0,$s=null,Ml=!1,e!==null&&_u(t,e),t=Hu(t,i),t.flags|=4096;return t}return e=Ss(e.child,{mode:i.mode,children:i.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Bu(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 Ud(e,t,n,i,u){return ds(t),n=xd(e,t,n,i,void 0,u),i=bd(),e!==null&&!Bn?(_d(e,t,u),za(e,t,u)):(it&&i&&lo(t),t.flags|=1,sl(e,t,n,u),t.child)}function qm(e,t,n,i,u,f){return ds(t),t.updateQueue=null,n=$p(t,i,n,u),Yp(e),i=bd(),e!==null&&!Bn?(_d(e,t,f),za(e,t,f)):(it&&i&&lo(t),t.flags|=1,sl(e,t,n,f),t.child)}function Gm(e,t,n,i,u){if(ds(t),t.stateNode===null){var f=Na,b=n.contextType;typeof b=="object"&&b!==null&&(f=zt(b)),f=new n(i,f),t.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=Od,t.stateNode=f,f._reactInternals=t,f=t.stateNode,f.props=i,f.state=t.memoizedState,f.refs={},U(t),b=n.contextType,f.context=typeof b=="object"&&b!==null?zt(b):Na,f.state=t.memoizedState,b=n.getDerivedStateFromProps,typeof b=="function"&&(Dd(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&&Od.enqueueReplaceState(f,f.state,null),xi(t,i,f,u),gi(),f.state=t.memoizedState),typeof f.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){f=t.stateNode;var S=t.memoizedProps,R=ur(n,S);f.props=R;var W=f.context,re=n.contextType;b=Na,typeof re=="object"&&re!==null&&(b=zt(re));var de=n.getDerivedStateFromProps;re=typeof de=="function"||typeof f.getSnapshotBeforeUpdate=="function",S=t.pendingProps!==S,re||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(S||W!==b)&&Em(t,f,i,b),p=!1;var ee=t.memoizedState;f.state=ee,xi(t,i,f,u),gi(),W=t.memoizedState,S||ee!==W||p?(typeof de=="function"&&(Dd(t,n,de,i),W=t.memoizedState),(R=p||Tm(t,n,R,i,ee,W,b))?(re||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=W),f.props=i,f.state=W,f.context=b,i=R):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{f=t.stateNode,ce(e,t),b=t.memoizedProps,re=ur(n,b),f.props=re,de=t.pendingProps,ee=f.context,W=n.contextType,R=Na,typeof W=="object"&&W!==null&&(R=zt(W)),S=n.getDerivedStateFromProps,(W=typeof S=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(b!==de||ee!==R)&&Em(t,f,i,R),p=!1,ee=t.memoizedState,f.state=ee,xi(t,i,f,u),gi();var ne=t.memoizedState;b!==de||ee!==ne||p||e!==null&&e.dependencies!==null&&rr(e.dependencies)?(typeof S=="function"&&(Dd(t,n,S,i),ne=t.memoizedState),(re=p||Tm(t,n,re,i,ee,ne,R)||e!==null&&e.dependencies!==null&&rr(e.dependencies))?(W||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(i,ne,R),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(i,ne,R)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||b===e.memoizedProps&&ee===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&ee===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=ne),f.props=i,f.state=ne,f.context=R,i=re):(typeof f.componentDidUpdate!="function"||b===e.memoizedProps&&ee===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&ee===e.memoizedState||(t.flags|=1024),i=!1)}return f=i,Bu(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=Js(t,e.child,null,u),t.child=Js(t,null,n,u)):sl(e,t,n,u),t.memoizedState=f.state,e=t.child):e=za(e,t,u),e}function Ym(e,t,n,i){return ka(),t.flags|=256,sl(e,t,n,i),t.child}var Hd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Bd(e){return{baseLanes:e,cachePool:Ma()}}function Id(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=es),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(it){if(u?bi(t):_i(),(e=Lt)?(e=Pg(e,Ml),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ys!==null?{id:os,overflow:us}:null,retryLane:536870912,hydrationErrors:null},n=to(e),n.return=t,t.child=n,Mn=t,Lt=null)):e=null,e===null)throw Xs(t);return jh(e)?t.lanes=32:t.lanes=536870912,null}var S=i.children;return i=i.fallback,u?(_i(),u=t.mode,S=Iu({mode:"hidden",children:S},u),i=Gs(i,u,n,null),S.return=t,i.return=t,S.sibling=i,t.child=S,i=t.child,i.memoizedState=Bd(n),i.childLanes=Id(e,b,n),t.memoizedState=Hd,yo(null,i)):(bi(t),qd(t,S))}var R=e.memoizedState;if(R!==null&&(S=R.dehydrated,S!==null)){if(f)t.flags&256?(bi(t),t.flags&=-257,t=Gd(e,t,n)):t.memoizedState!==null?(_i(),t.child=e.child,t.flags|=128,t=null):(_i(),S=i.fallback,u=t.mode,i=Iu({mode:"visible",children:i.children},u),S=Gs(S,u,n,null),S.flags|=2,i.return=t,S.return=t,i.sibling=S,t.child=i,Js(t,e.child,null,n),i=t.child,i.memoizedState=Bd(n),i.childLanes=Id(e,b,n),t.memoizedState=Hd,t=yo(null,i));else if(bi(t),jh(S)){if(b=S.nextSibling&&S.nextSibling.dataset,b)var W=b.dgst;b=W,i=Error(c(419)),i.stack="",i.digest=b,ir({value:i,source:null,stack:null}),t=Gd(e,t,n)}else if(Bn||Ea(e,t,n,!1),b=(n&e.childLanes)!==0,Bn||b){if(b=Ft,b!==null&&(i=Bl(b,n),i!==0&&i!==R.retryLane))throw R.retryLane=i,Is(e,i),zl(b,e,i),zd;vh(S)||Zu(),t=Gd(e,t,n)}else vh(S)?(t.flags|=192,t.child=e.child,t=null):(e=R.treeContext,Lt=ms(S.nextSibling),Mn=t,it=!0,$s=null,Ml=!1,e!==null&&_u(t,e),t=qd(t,i.children),t.flags|=4096);return t}return u?(_i(),S=i.fallback,u=t.mode,R=e.child,W=R.sibling,i=Ss(R,{mode:"hidden",children:i.children}),i.subtreeFlags=R.subtreeFlags&65011712,W!==null?S=Ss(W,S):(S=Gs(S,u,n,null),S.flags|=2),S.return=t,i.return=t,i.sibling=S,t.child=i,yo(null,i),i=t.child,S=e.child.memoizedState,S===null?S=Bd(n):(u=S.cachePool,u!==null?(R=ln._currentValue,u=u.parent!==R?{parent:R,pool:R}:u):u=Ma(),S={baseLanes:S.baseLanes|n,cachePool:u}),i.memoizedState=S,i.childLanes=Id(e,b,n),t.memoizedState=Hd,yo(e.child,i)):(bi(t),n=e.child,e=n.sibling,n=Ss(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 qd(e,t){return t=Iu({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Iu(e,t){return e=_l(22,e,null,t),e.lanes=0,e}function Gd(e,t,n){return Js(t,e.child,null,n),e=qd(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),co(e.return,t,n)}function Yd(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),sl(e,t,i,n),i=it?ar: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&&Eu(e)===null&&(u=n),n=n.sibling;n=u,n===null?(u=t.child,t.child=null):(u=n.sibling,n.sibling=null),Yd(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&&Eu(e)===null){t.child=u;break}e=u.sibling,u.sibling=n,n=u,u=e}Yd(t,!0,n,null,f,i);break;case"together":Yd(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),ji|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Ea(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=Ss(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ss(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function $d(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&rr(e)))}function xy(e,t,n){switch(t.tag){case 3:Ue(t,t.stateNode.containerInfo),Vs(t,ln,e.memoizedState.cache),ka();break;case 27:case 5:on(t);break;case 4:Ue(t,t.stateNode.containerInfo);break;case 10:Vs(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,md(t),null;break;case 13:var i=t.memoizedState;if(i!==null)return i.dehydrated!==null?(bi(t),t.flags|=128,null):(n&t.child.childLanes)!==0?$m(e,t,n):(bi(t),e=za(e,t,n),e!==null?e.sibling:null);bi(t);break;case 19:var u=(e.flags&128)!==0;if(i=(n&t.childLanes)!==0,i||(Ea(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:Vs(t,ln,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(!$d(e,n)&&(t.flags&128)===0)return Bn=!1,xy(e,t,n);Bn=(e.flags&131072)!==0}else Bn=!1,it&&(t.flags&1048576)!==0&&bu(t,ar,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=Zs(t.elementType),t.type=e,typeof e=="function")Wc(e)?(i=ur(e,i),t.tag=1,t=Gm(null,t,e,i,n)):(t.tag=0,t=Ud(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===V){t.tag=14,t=zm(null,t,e,i,n);break e}}throw t=Se(e)||e,Error(c(306,t,""))}}return t;case 0:return Ud(e,t,t.type,t.pendingProps,n);case 1:return i=t.type,u=ur(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,ce(e,t),xi(t,i,null,n);var b=t.memoizedState;if(i=b.cache,Vs(t,ln,i),i!==f.cache&&oo(t,[ln],n,!0),gi(),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=El(Error(c(424)),t),ir(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(Lt=ms(e.firstChild),Mn=t,it=!0,$s=null,Ml=!0,n=po(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(ka(),i===u){t=za(e,t,n);break e}sl(e,t,i,n)}t=t.child}return t;case 26:return Bu(e,t),e===null?(n=sx(t.type,null,t.pendingProps,null))?t.memoizedState=n:it||(n=t.type,e=t.pendingProps,i=nf(Re.current).createElement(n),i[Ot]=t,i[Ze]=e,al(i,n,e),Et(i),t.stateNode=i):t.memoizedState=sx(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return on(t),e===null&&it&&(i=t.stateNode=tx(t.type,t.pendingProps,Re.current),Mn=t,Ml=!0,u=Lt,Ti(t.type)?(wh=u,Lt=ms(i.firstChild)):Lt=u),sl(e,t,t.pendingProps.children,n),Bu(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&it&&((u=i=Lt)&&(i=Qy(i,t.type,t.pendingProps,Ml),i!==null?(t.stateNode=i,Mn=t,Lt=ms(i.firstChild),Ml=!1,u=!0):u=!1),u||Xs(t)),on(t),u=t.type,f=t.pendingProps,b=e!==null?e.memoizedProps:null,i=f.children,bh(u,f)?i=null:b!==null&&bh(u,b)&&(t.flags|=32),t.memoizedState!==null&&(u=xd(e,t,cy,null,null,n),Lo._currentValue=u),Bu(e,t),sl(e,t,i,n),t.child;case 6:return e===null&&it&&((e=n=Lt)&&(n=Ky(n,t.pendingProps,Ml),n!==null?(t.stateNode=n,Mn=t,Lt=null,e=!0):e=!1),e||Xs(t)),null;case 13:return $m(e,t,n);case 4:return Ue(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Js(t,null,i,n):sl(e,t,i,n),t.child;case 11:return Lm(e,t,t.type,t.pendingProps,n);case 7:return sl(e,t,t.pendingProps,n),t.child;case 8:return sl(e,t,t.pendingProps.children,n),t.child;case 12:return sl(e,t,t.pendingProps.children,n),t.child;case 10:return i=t.pendingProps,Vs(t,t.type,i.value),sl(e,t,i.children,n),t.child;case 9:return u=t.type._context,i=t.pendingProps.children,ds(t),u=zt(u),i=i(u),t.flags|=1,sl(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 ds(t),i=zt(ln),e===null?(u=fo(),u===null&&(u=Ft,f=Xr(),u.pooledCache=f,f.refCount++,f!==null&&(u.pooledCacheLanes|=n),u=f),t.memoizedState={parent:i,cache:u},U(t),Vs(t,ln,u)):((e.lanes&n)!==0&&(ce(e,t),xi(t,null,null,n),gi()),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),Vs(t,ln,i)):(i=f.cache,Vs(t,ln,i),i!==u.cache&&oo(t,[ln],n,!0))),sl(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 Xd(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 Ra=Kr,Qr}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 Ra=Kr,Qr}function qu(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Le():536870912,e.lanes|=t,nc|=t)}function vo(e,t){if(!it)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 sn(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(so(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return sn(t),null;case 1:return sn(t),null;case 3:return n=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),ks(ln),Be(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(fi(t)?Ua(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,io())),sn(t),null;case 26:var u=t.type,f=t.memoizedState;return e===null?(Ua(t),f!==null?(sn(t),Km(t,f)):(sn(t),Xd(t,u,null,i,n))):f?f!==e.memoizedState?(Ua(t),sn(t),Km(t,f)):(sn(t),t.flags&=-16777217):(e=e.memoizedProps,e!==i&&Ua(t),sn(t),Xd(t,u,e,i,n)),null;case 27:if(Ke(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 sn(t),null}e=me.current,fi(t)?yu(t):(e=tx(u,i,n),t.stateNode=e,Ua(t))}return sn(t),null;case 5:if(Ke(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 sn(t),null}if(f=me.current,fi(t))yu(t);else{var b=nf(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[Ot]=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(al(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 sn(t),Xd(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,fi(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[Ot]=t,e=!!(e.nodeValue===n||i!==null&&i.suppressHydrationWarning===!0||$g(e.nodeValue,n)),e||Xs(t,!0)}else e=nf(e).createTextNode(i),e[Ot]=t,t.stateNode=e}return sn(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(i=fi(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[Ot]=t}else ka(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;sn(t),e=!1}else n=io(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Pl(t),t):(Pl(t),null);if((t.flags&128)!==0)throw Error(c(558))}return sn(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=fi(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[Ot]=t}else ka(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;sn(t),u=!1}else u=io(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(Pl(t),t):(Pl(t),null)}return Pl(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),qu(t,t.updateQueue),sn(t),null);case 4:return Be(),e===null&&hh(t.stateNode.containerInfo),sn(t),null;case 10:return ks(t.type),sn(t),null;case 19:if(Z(Rn),i=t.memoizedState,i===null)return sn(t),null;if(u=(t.flags&128)!==0,f=i.rendering,f===null)if(u)vo(i,!1);else{if(wn!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=Eu(e),f!==null){for(t.flags|=128,vo(i,!1),e=f.updateQueue,t.updateQueue=e,qu(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)gu(n,e),n=n.sibling;return z(Rn,Rn.current&1|2),it&&fs(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&at()>Vu&&(t.flags|=128,u=!0,vo(i,!1),t.lanes=4194304)}else{if(!u)if(e=Eu(f),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,qu(t,e),vo(i,!0),i.tail===null&&i.tailMode==="hidden"&&!f.alternate&&!it)return sn(t),null}else 2*at()-i.renderingStartTime>Vu&&n!==536870912&&(t.flags|=128,u=!0,vo(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=at(),e.sibling=null,n=Rn.current,z(Rn,u?n&1|2:n&1),it&&fs(t,i.treeForkCount),e):(sn(t),null);case 22:case 23:return Pl(t),mo(),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&&(sn(t),t.subtreeFlags&6&&(t.flags|=8192)):sn(t),n=t.updateQueue,n!==null&&qu(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&&Z(Es),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ks(ln),sn(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function _y(e,t){switch(so(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ks(ln),Be(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ke(t),null;case 31:if(t.memoizedState!==null){if(Pl(t),t.alternate===null)throw Error(c(340));ka()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Pl(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));ka()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Z(Rn),null;case 4:return Be(),null;case 10:return ks(t.type),null;case 22:case 23:return Pl(t),mo(),e!==null&&Z(Es),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ks(ln),null;case 25:return null;default:return null}}function Zm(e,t){switch(so(t),t.tag){case 3:ks(ln),Be();break;case 26:case 27:case 5:Ke(t);break;case 4:Be();break;case 31:t.memoizedState!==null&&Pl(t);break;case 13:Pl(t);break;case 19:Z(Rn);break;case 10:ks(t.type);break;case 22:case 23:Pl(t),mo(),e!==null&&Z(Es);break;case 24:ks(ln)}}function jo(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){Ht(t,t.return,S)}}function yi(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 R=n,W=S;try{W()}catch(re){Ht(u,R,re)}}}i=i.next}while(i!==f)}}catch(re){Ht(t,t.return,re)}}function Fm(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ae(t,n)}catch(i){Ht(e,e.return,i)}}}function Jm(e,t,n){n.props=ur(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(i){Ht(e,t,i)}}function wo(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){Ht(e,t,u)}}function Ps(e,t){var n=e.ref,i=e.refCleanup;if(n!==null)if(typeof i=="function")try{i()}catch(u){Ht(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){Ht(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){Ht(e,e.return,u)}}function Vd(e,t,n){try{var i=e.stateNode;qy(i,e.type,n,t),i[Ze]=t}catch(u){Ht(e,e.return,u)}}function Wm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ti(e.type)||e.tag===4}function Qd(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&&Ti(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 Kd(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&&Ti(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Kd(e,t,n),e=e.sibling;e!==null;)Kd(e,t,n),e=e.sibling}function Gu(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&&Ti(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Gu(e,t,n),e=e.sibling;e!==null;)Gu(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]);al(t,i,n),t[Ot]=e,t[Ze]=n}catch(f){Ht(e,e.return,f)}}var Ha=!1,In=!1,Zd=!1,tg=typeof WeakSet=="function"?WeakSet:Set,Fn=null;function yy(e,t){if(e=e.containerInfo,gh=uf,e=ou(e),Xc(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,R=-1,W=0,re=0,de=e,ee=null;t:for(;;){for(var ne;de!==n||u!==0&&de.nodeType!==3||(S=b+u),de!==f||i!==0&&de.nodeType!==3||(R=b+i),de.nodeType===3&&(b+=de.nodeValue.length),(ne=de.firstChild)!==null;)ee=de,de=ne;for(;;){if(de===e)break t;if(ee===n&&++W===u&&(S=b),ee===f&&++re===i&&(R=b),(ne=de.nextSibling)!==null)break;de=ee,ee=de.parentNode}de=ne}n=S===-1||R===-1?null:{start:S,end:R}}else n=null}n=n||{start:0,end:0}}else n=null;for(xh={focusedElem:e,selectionRange:n},uf=!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=ur(n.type,u);e=i.getSnapshotBeforeUpdate(De,f),i.__reactInternalSnapshotBeforeUpdate=e}catch(Xe){Ht(n,n.return,Xe)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)yh(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":yh(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&&jo(5,n);break;case 1:if(Ia(e,n),i&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(b){Ht(n,n.return,b)}else{var u=ur(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(b){Ht(n,n.return,b)}}i&64&&Fm(n),i&512&&wo(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{Ae(e,t)}catch(b){Ht(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&&wo(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&&_n(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,Rl=!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||Ps(n,t),Ba(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:In||Ps(n,t);var i=hn,u=Rl;Ti(n.type)&&(hn=n.stateNode,Rl=!1),Ba(e,t,n),Ro(n.stateNode),hn=i,Rl=u;break;case 5:In||Ps(n,t);case 6:if(i=hn,u=Rl,hn=null,Ba(e,t,n),hn=i,Rl=u,hn!==null)if(Rl)try{(hn.nodeType===9?hn.body:hn.nodeName==="HTML"?hn.ownerDocument.body:hn).removeChild(n.stateNode)}catch(f){Ht(n,t,f)}else try{hn.removeChild(n.stateNode)}catch(f){Ht(n,t,f)}break;case 18:hn!==null&&(Rl?(e=hn,Fg(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),uc(e)):Fg(hn,n.stateNode));break;case 4:i=hn,u=Rl,hn=n.stateNode.containerInfo,Rl=!0,Ba(e,t,n),hn=i,Rl=u;break;case 0:case 11:case 14:case 15:yi(2,n,t),In||yi(4,n,t),Ba(e,t,n);break;case 1:In||(Ps(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{uc(e)}catch(n){Ht(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{uc(e)}catch(n){Ht(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 Yu(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 Dl(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(Ti(S.type)){hn=S.stateNode,Rl=!1;break e}break;case 5:hn=S.stateNode,Rl=!1;break e;case 3:case 4:hn=S.stateNode.containerInfo,Rl=!0;break e}S=S.return}if(hn===null)throw Error(c(160));sg(f,b,u),hn=null,Rl=!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 Cs=null;function rg(e,t){var n=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Dl(t,e),Ol(e),i&4&&(yi(3,e,e.return),jo(3,e),yi(5,e,e.return));break;case 1:Dl(t,e),Ol(e),i&512&&(In||n===null||Ps(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=Cs;if(Dl(t,e),Ol(e),i&512&&(In||n===null||Ps(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[ol]||f[Ot]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=u.createElement(i),u.head.insertBefore(f,u.querySelector("head > title"))),al(f,i,n),f[Ot]=e,Et(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),al(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),al(f,i,n),u.head.appendChild(f);break;default:throw Error(c(468,i))}f[Ot]=e,Et(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&&Vd(e,e.memoizedProps,n.memoizedProps)}break;case 27:Dl(t,e),Ol(e),i&512&&(In||n===null||Ps(n,n.return)),n!==null&&i&4&&Vd(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Dl(t,e),Ol(e),i&512&&(In||n===null||Ps(n,n.return)),e.flags&32){u=e.stateNode;try{K(u,"")}catch(De){Ht(e,e.return,De)}}i&4&&e.stateNode!=null&&(u=e.memoizedProps,Vd(e,u,n!==null?n.memoizedProps:u)),i&1024&&(Zd=!0);break;case 6:if(Dl(t,e),Ol(e),i&4){if(e.stateNode===null)throw Error(c(162));i=e.memoizedProps,n=e.stateNode;try{n.nodeValue=i}catch(De){Ht(e,e.return,De)}}break;case 3:if(af=null,u=Cs,Cs=lf(t.containerInfo),Dl(t,e),Cs=u,Ol(e),i&4&&n!==null&&n.memoizedState.isDehydrated)try{uc(t.containerInfo)}catch(De){Ht(e,e.return,De)}Zd&&(Zd=!1,cg(e));break;case 4:i=Cs,Cs=lf(e.stateNode.containerInfo),Dl(t,e),Ol(e),Cs=i;break;case 12:Dl(t,e),Ol(e);break;case 31:Dl(t,e),Ol(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Yu(e,i)));break;case 13:Dl(t,e),Ol(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Xu=at()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Yu(e,i)));break;case 22:u=e.memoizedState!==null;var R=n!==null&&n.memoizedState!==null,W=Ha,re=In;if(Ha=W||u,In=re||R,Dl(t,e),In=re,Ha=W,Ol(e),i&8192)e:for(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,u&&(n===null||R||Ha||In||fr(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){R=n=t;try{if(f=R.stateNode,u)b=f.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{S=R.stateNode;var de=R.memoizedProps.style,ee=de!=null&&de.hasOwnProperty("display")?de.display:null;S.style.display=ee==null||typeof ee=="boolean"?"":(""+ee).trim()}}catch(De){Ht(R,R.return,De)}}}else if(t.tag===6){if(n===null){R=t;try{R.stateNode.nodeValue=u?"":R.memoizedProps}catch(De){Ht(R,R.return,De)}}}else if(t.tag===18){if(n===null){R=t;try{var ne=R.stateNode;u?Jg(ne,!0):Jg(R.stateNode,!1)}catch(De){Ht(R,R.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,Yu(e,n))));break;case 19:Dl(t,e),Ol(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Yu(e,i)));break;case 30:break;case 21:break;default:Dl(t,e),Ol(e)}}function Ol(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=Qd(e);Gu(e,f,u);break;case 5:var b=n.stateNode;n.flags&32&&(K(b,""),n.flags&=-33);var S=Qd(e);Gu(e,S,b);break;case 3:case 4:var R=n.stateNode.containerInfo,W=Qd(e);Kd(e,W,R);break;default:throw Error(c(161))}}catch(re){Ht(e,e.return,re)}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 fr(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:yi(4,t,t.return),fr(t);break;case 1:Ps(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Jm(t,t.return,n),fr(t);break;case 27:Ro(t.stateNode);case 26:case 5:Ps(t,t.return),fr(t);break;case 22:t.memoizedState===null&&fr(t);break;case 30:fr(t);break;default:fr(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),jo(4,f);break;case 1:if(qa(u,f,n),i=f,u=i.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(W){Ht(i,i.return,W)}if(i=f,u=i.updateQueue,u!==null){var S=i.stateNode;try{var R=u.shared.hiddenCallbacks;if(R!==null)for(u.shared.hiddenCallbacks=null,u=0;u<R.length;u++)be(R[u],S)}catch(W){Ht(i,i.return,W)}}n&&b&64&&Fm(f),wo(f,f.return);break;case 27:eg(f);case 26:case 5:qa(u,f,n),n&&i===null&&b&4&&Pm(f),wo(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),wo(f,f.return);break;case 30:break;default:qa(u,f,n)}t=t.sibling}}function Fd(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&&Qs(n))}function Jd(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Qs(e))}function As(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:As(e,t,n,i),u&2048&&jo(9,t);break;case 1:As(e,t,n,i);break;case 3:As(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&&Qs(e)));break;case 12:if(u&2048){As(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(R){Ht(t,t.return,R)}}else As(e,t,n,i);break;case 31:As(e,t,n,i);break;case 13:As(e,t,n,i);break;case 23:break;case 22:f=t.stateNode,b=t.alternate,t.memoizedState!==null?f._visibility&2?As(e,t,n,i):So(e,t):f._visibility&2?As(e,t,n,i):(f._visibility|=2,Wr(e,t,n,i,(t.subtreeFlags&10256)!==0||!1)),u&2048&&Fd(b,t);break;case 24:As(e,t,n,i),u&2048&&Jd(t.alternate,t);break;default:As(e,t,n,i)}}function Wr(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,R=i,W=b.flags;switch(b.tag){case 0:case 11:case 15:Wr(f,b,S,R,u),jo(8,b);break;case 23:break;case 22:var re=b.stateNode;b.memoizedState!==null?re._visibility&2?Wr(f,b,S,R,u):So(f,b):(re._visibility|=2,Wr(f,b,S,R,u)),u&&W&2048&&Fd(b.alternate,b);break;case 24:Wr(f,b,S,R,u),u&&W&2048&&Jd(b.alternate,b);break;default:Wr(f,b,S,R,u)}t=t.sibling}}function So(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:So(n,i),u&2048&&Fd(i.alternate,i);break;case 24:So(n,i),u&2048&&Jd(i.alternate,i);break;default:So(n,i)}t=t.sibling}}var No=8192;function ec(e,t,n){if(e.subtreeFlags&No)for(e=e.child;e!==null;)ug(e,t,n),e=e.sibling}function ug(e,t,n){switch(e.tag){case 26:ec(e,t,n),e.flags&No&&e.memoizedState!==null&&r0(n,Cs,e.memoizedState,e.memoizedProps);break;case 5:ec(e,t,n);break;case 3:case 4:var i=Cs;Cs=lf(e.stateNode.containerInfo),ec(e,t,n),Cs=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=No,No=16777216,ec(e,t,n),No=i):ec(e,t,n));break;default:ec(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 ko(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:ko(e),e.flags&2048&&yi(9,e,e.return);break;case 3:ko(e);break;case 12:ko(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,$u(e)):ko(e);break;default:ko(e)}}function $u(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:yi(8,t,t.return),$u(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,$u(t));break;default:$u(t)}e=e.sibling}}function hg(e,t){for(;Fn!==null;){var n=Fn;switch(n.tag){case 0:case 11:case 15:yi(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:Qs(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=zt(ln),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return zt(ln).controller.signal}},wy=typeof WeakMap=="function"?WeakMap:Map,Nt=0,Ft=null,ot=null,ht=0,Ut=0,Wl=null,vi=!1,tc=!1,Pd=!1,Ga=0,wn=0,ji=0,dr=0,Wd=0,es=0,nc=0,To=null,Ll=null,eh=!1,Xu=0,pg=0,Vu=1/0,Qu=null,wi=null,Qn=0,Si=null,lc=null,Ya=0,th=0,nh=null,mg=null,Eo=0,lh=null;function ts(){return(Nt&2)!==0&&ht!==0?ht&-ht:Q.T!==null?oh():Ka()}function gg(){if(es===0)if((ht&536870912)===0||it){var e=Fe;Fe<<=1,(Fe&3932160)===0&&(Fe=262144),es=e}else es=536870912;return e=Jl.current,e!==null&&(e.flags|=32),es}function zl(e,t,n){(e===Ft&&(Ut===2||Ut===9)||e.cancelPendingCommit!==null)&&(sc(e,0),Ni(e,ht,es,!1)),Xn(e,n),((Nt&2)===0||e!==Ft)&&(e===Ft&&((Nt&2)===0&&(dr|=n),wn===4&&Ni(e,ht,es,!1)),Ws(e))}function xg(e,t,n){if((Nt&6)!==0)throw Error(c(327));var i=!n&&(t&127)===0&&(t&e.expiredLanes)===0||se(e,t),u=i?ky(e,t):ah(e,t,!0),f=i;do{if(u===0){tc&&!i&&Ni(e,t,0,!1);break}else{if(n=e.current.alternate,f&&!Sy(n)){u=ah(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=To;var R=S.current.memoizedState.isDehydrated;if(R&&(sc(S,b).flags|=256),b=ah(S,b,!1),b!==2){if(Pd&&!R){S.errorRecoveryDisabledLanes|=f,dr|=f,u=4;break e}f=Ll,Ll=u,f!==null&&(Ll===null?Ll=f:Ll.push.apply(Ll,f))}u=b}if(f=!1,u!==2)continue}}if(u===1){sc(e,0),Ni(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:Ni(i,t,es,!vi);break e;case 2:Ll=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(u=Xu+300-at(),10<u)){if(Ni(i,t,es,!vi),$(i,0,!0)!==0)break e;Ya=t,i.timeoutHandle=Kg(bg.bind(null,i,n,Ll,Qu,eh,t,es,dr,nc,vi,f,"Throttled",-0,0),u);break e}bg(i,n,Ll,Qu,eh,t,es,dr,nc,vi,f,null,-0,0)}}break}while(!0);Ws(e)}function bg(e,t,n,i,u,f,b,S,R,W,re,de,ee,ne){if(e.timeoutHandle=-1,de=t.subtreeFlags,de&8192||(de&16785408)===16785408){de={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:yt},ug(t,f,de);var De=(f&62914560)===f?Xu-at():(f&4194048)===f?pg-at():0;if(De=c0(de,De),De!==null){Ya=f,e.cancelPendingCommit=De(kg.bind(null,e,t,f,n,i,u,b,S,R,re,de,null,ee,ne)),Ni(e,f,b,!W);return}}kg(e,t,f,n,i,u,b,S,R)}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(!Vn(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 Ni(e,t,n,i){t&=~Wd,t&=~dr,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var u=t;0<u;){var f=31-Dt(u),b=1<<f;i[f]=-1,u&=~b}n!==0&&Hl(e,n,t)}function Ku(){return(Nt&6)===0?(Co(0),!1):!0}function sh(){if(ot!==null){if(Ut===0)var e=ot.return;else e=ot,Ns=Ta=null,yd(e),Fs=null,pi=0,e=ot;for(;e!==null;)Zm(e.alternate,e),e=e.return;ot=null}}function sc(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,$y(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Ya=0,sh(),Ft=e,ot=n=Ss(e.current,null),ht=t,Ut=0,Wl=null,vi=!1,tc=se(e,t),Pd=!1,nc=es=Wd=dr=ji=wn=0,Ll=To=null,eh=!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-Dt(i),f=1<<u;t|=e[u],i&=~f}return Ga=t,lr(),n}function _g(e,t){nt=null,Q.H=_o,t===hi||t===cr?(t=Nu(),Ut=3):t===Qr?(t=Nu(),Ut=4):Ut=t===zd?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Wl=t,ot===null&&(wn=1,Uu(e,El(t,e.current)))}function yg(){var e=Jl.current;return e===null?!0:(ht&4194048)===ht?ps===null:(ht&62914560)===ht||(ht&536870912)!==0?e===ps:!1}function vg(){var e=Q.H;return Q.H=_o,e===null?_o:e}function jg(){var e=Q.A;return Q.A=jy,e}function Zu(){wn=4,vi||(ht&4194048)!==ht&&Jl.current!==null||(tc=!0),(ji&134217727)===0&&(dr&134217727)===0||Ft===null||Ni(Ft,ht,es,!1)}function ah(e,t,n){var i=Nt;Nt|=2;var u=vg(),f=jg();(Ft!==e||ht!==t)&&(Qu=null,sc(e,t)),t=!1;var b=wn;e:do try{if(Ut!==0&&ot!==null){var S=ot,R=Wl;switch(Ut){case 8:sh(),b=6;break e;case 3:case 2:case 9:case 6:Jl.current===null&&(t=!0);var W=Ut;if(Ut=0,Wl=null,ac(e,S,R,W),n&&tc){b=0;break e}break;default:W=Ut,Ut=0,Wl=null,ac(e,S,R,W)}}Ny(),b=wn;break}catch(re){_g(e,re)}while(!0);return t&&e.shellSuspendCounter++,Ns=Ta=null,Nt=i,Q.H=u,Q.A=f,ot===null&&(Ft=null,ht=0,lr()),b}function Ny(){for(;ot!==null;)wg(ot)}function ky(e,t){var n=Nt;Nt|=2;var i=vg(),u=jg();Ft!==e||ht!==t?(Qu=null,Vu=at()+500,sc(e,t)):tc=se(e,t);e:do try{if(Ut!==0&&ot!==null){t=ot;var f=Wl;t:switch(Ut){case 1:Ut=0,Wl=null,ac(e,t,f,1);break;case 2:case 9:if(Su(f)){Ut=0,Wl=null,Sg(t);break}t=function(){Ut!==2&&Ut!==9||Ft!==e||(Ut=7),Ws(e)},f.then(t,t);break e;case 3:Ut=7;break e;case 4:Ut=5;break e;case 7:Su(f)?(Ut=0,Wl=null,Sg(t)):(Ut=0,Wl=null,ac(e,t,f,7));break;case 5:var b=null;switch(ot.tag){case 26:b=ot.memoizedState;case 5:case 27:var S=ot;if(b?ox(b):S.stateNode.complete){Ut=0,Wl=null;var R=S.sibling;if(R!==null)ot=R;else{var W=S.return;W!==null?(ot=W,Fu(W)):ot=null}break t}}Ut=0,Wl=null,ac(e,t,f,5);break;case 6:Ut=0,Wl=null,ac(e,t,f,6);break;case 8:sh(),wn=6;break e;default:throw Error(c(462))}}Ty();break}catch(re){_g(e,re)}while(!0);return Ns=Ta=null,Q.H=i,Q.A=u,Nt=n,ot!==null?0:(Ft=null,ht=0,lr(),wn)}function Ty(){for(;ot!==null&&!el();)wg(ot)}function wg(e){var t=Qm(e.alternate,e,Ga);e.memoizedProps=e.pendingProps,t===null?Fu(e):ot=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,ht);break;case 11:t=qm(n,t,t.pendingProps,t.type.render,t.ref,ht);break;case 5:yd(t);default:Zm(n,t),t=ot=gu(t,Ga),t=Qm(n,t,Ga)}e.memoizedProps=e.pendingProps,t===null?Fu(e):ot=t}function ac(e,t,n,i){Ns=Ta=null,yd(t),Fs=null,pi=0;var u=t.return;try{if(my(e,u,t,n,ht)){wn=1,Uu(e,El(n,e.current)),ot=null;return}}catch(f){if(u!==null)throw ot=u,f;wn=1,Uu(e,El(n,e.current)),ot=null;return}t.flags&32768?(it||i===1?e=!0:tc||(ht&536870912)!==0?e=!1:(vi=e=!0,(i===2||i===9||i===3||i===6)&&(i=Jl.current,i!==null&&i.tag===13&&(i.flags|=16384))),Ng(t,e)):Fu(t)}function Fu(e){var t=e;do{if((t.flags&32768)!==0){Ng(t,vi);return}e=t.return;var n=by(t.alternate,t,Ga);if(n!==null){ot=n;return}if(t=t.sibling,t!==null){ot=t;return}ot=t=e}while(t!==null);wn===0&&(wn=5)}function Ng(e,t){do{var n=_y(e.alternate,e);if(n!==null){n.flags&=32767,ot=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){ot=e;return}ot=e=n}while(e!==null);wn=6,ot=null}function kg(e,t,n,i,u,f,b,S,R){e.cancelPendingCommit=null;do Ju();while(Qn!==0);if((Nt&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,Zn(e,n,f,b,S,R),e===Ft&&(ot=Ft=null,ht=0),lc=t,Si=e,Ya=n,th=f,nh=u,mg=i,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,My(et,function(){return Mg(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||i){i=Q.T,Q.T=null,u=fe.p,fe.p=2,b=Nt,Nt|=4;try{yy(e,t,n)}finally{Nt=b,fe.p=u,Q.T=i}}Qn=1,Tg(),Eg(),Cg()}}function Tg(){if(Qn===1){Qn=0;var e=Si,t=lc,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=Q.T,Q.T=null;var i=fe.p;fe.p=2;var u=Nt;Nt|=4;try{rg(t,e);var f=xh,b=ou(e.containerInfo),S=f.focusedElem,R=f.selectionRange;if(b!==S&&S&&S.ownerDocument&&va(S.ownerDocument.documentElement,S)){if(R!==null&&Xc(S)){var W=R.start,re=R.end;if(re===void 0&&(re=W),"selectionStart"in S)S.selectionStart=W,S.selectionEnd=Math.min(re,S.value.length);else{var de=S.ownerDocument||document,ee=de&&de.defaultView||window;if(ee.getSelection){var ne=ee.getSelection(),De=S.textContent.length,Xe=Math.min(R.start,De),Yt=R.end===void 0?Xe:Math.min(R.end,De);!ne.extend&&Xe>Yt&&(b=Yt,Yt=Xe,Xe=b);var G=cu(S,Xe),O=cu(S,Yt);if(G&&O&&(ne.rangeCount!==1||ne.anchorNode!==G.node||ne.anchorOffset!==G.offset||ne.focusNode!==O.node||ne.focusOffset!==O.offset)){var P=de.createRange();P.setStart(G.node,G.offset),ne.removeAllRanges(),Xe>Yt?(ne.addRange(P),ne.extend(O.node,O.offset)):(P.setEnd(O.node,O.offset),ne.addRange(P))}}}}for(de=[],ne=S;ne=ne.parentNode;)ne.nodeType===1&&de.push({element:ne,left:ne.scrollLeft,top:ne.scrollTop});for(typeof S.focus=="function"&&S.focus(),S=0;S<de.length;S++){var oe=de[S];oe.element.scrollLeft=oe.left,oe.element.scrollTop=oe.top}}uf=!!gh,xh=gh=null}finally{Nt=u,fe.p=i,Q.T=n}}e.current=t,Qn=2}}function Eg(){if(Qn===2){Qn=0;var e=Si,t=lc,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=Q.T,Q.T=null;var i=fe.p;fe.p=2;var u=Nt;Nt|=4;try{ng(e,t.alternate,t)}finally{Nt=u,fe.p=i,Q.T=n}}Qn=3}}function Cg(){if(Qn===4||Qn===3){Qn=0,Bt();var e=Si,t=lc,n=Ya,i=mg;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Qn=5:(Qn=0,lc=Si=null,Ag(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(wi=null),ss(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=Q.T,u=fe.p,fe.p=2,Q.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{Q.T=t,fe.p=u}}(Ya&3)!==0&&Ju(),Ws(e),u=e.pendingLanes,(n&261930)!==0&&(u&42)!==0?e===lh?Eo++:(Eo=0,lh=e):Eo=0,Co(0)}}function Ag(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Qs(t)))}function Ju(){return Tg(),Eg(),Cg(),Mg()}function Mg(){if(Qn!==5)return!1;var e=Si,t=th;th=0;var n=ss(Ya),i=Q.T,u=fe.p;try{fe.p=32>n?32:n,Q.T=null,n=nh,nh=null;var f=Si,b=Ya;if(Qn=0,lc=Si=null,Ya=0,(Nt&6)!==0)throw Error(c(331));var S=Nt;if(Nt|=4,dg(f.current),og(f,f.current,b,n),Nt=S,Co(0,!1),St&&typeof St.onPostCommitFiberRoot=="function")try{St.onPostCommitFiberRoot(en,f)}catch{}return!0}finally{fe.p=u,Q.T=i,Ag(e,t)}}function Rg(e,t,n){t=El(n,t),t=Ld(e.stateNode,t,2),e=vt(e,t,2),e!==null&&(Xn(e,2),Ws(e))}function Ht(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"&&(wi===null||!wi.has(i))){e=El(n,e),n=Dm(2),i=vt(t,n,2),i!==null&&(Om(n,i,t,e),Xn(i,2),Ws(i));break}}t=t.return}}function ih(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)||(Pd=!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,Ft===e&&(ht&n)===n&&(wn===4||wn===3&&(ht&62914560)===ht&&300>at()-Xu?(Nt&2)===0&&sc(e,0):Wd|=n,nc===ht&&(nc=0)),Ws(e)}function Dg(e,t){t===0&&(t=Le()),e=Is(e,t),e!==null&&(Xn(e,t),Ws(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 Pu=null,ic=null,rh=!1,Wu=!1,ch=!1,ki=0;function Ws(e){e!==ic&&e.next===null&&(ic===null?Pu=ic=e:ic=ic.next=e),Wu=!0,rh||(rh=!0,Dy())}function Co(e,t){if(!ch&&Wu){ch=!0;do for(var n=!1,i=Pu;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-Dt(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=ht,f=$(i,i===Ft?f:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(f&3)===0||se(i,f)||(n=!0,Ug(i,f));i=i.next}while(n);ch=!1}}function Ry(){Og()}function Og(){Wu=rh=!1;var e=0;ki!==0&&Yy()&&(e=ki);for(var t=at(),n=null,i=Pu;i!==null;){var u=i.next,f=Lg(i,t);f===0?(i.next=null,n===null?Pu=u:n.next=u,u===null&&(ic=n)):(n=i,(e!==0||(f&3)!==0)&&(Wu=!0)),i=u}Qn!==0&&Qn!==5||Co(e),ki!==0&&(ki=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-Dt(f),S=1<<b,R=u[b];R===-1?((S&n)===0||(S&i)!==0)&&(u[b]=Ce(S,t)):R<=t&&(e.expiredLanes|=S),f&=~S}if(t=Ft,n=ht,n=$(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,n===0||e===t&&(Ut===2||Ut===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&fn(i),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||se(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(i!==null&&fn(i),ss(n)){case 2:case 8:n=Tt;break;case 32:n=et;break;case 268435456:n=pn;break;default:n=et}return i=zg.bind(null,e),n=Wn(n,i),e.callbackPriority=t,e.callbackNode=n,t}return i!==null&&i!==null&&fn(i),e.callbackPriority=2,e.callbackNode=null,2}function zg(e,t){if(Qn!==0&&Qn!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Ju()&&e.callbackNode!==n)return null;var i=ht;return i=$(e,e===Ft?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(xg(e,i,t),Lg(e,at()),e.callbackNode!=null&&e.callbackNode===n?zg.bind(null,e):null)}function Ug(e,t){if(Ju())return null;xg(e,t,!0)}function Dy(){Xy(function(){(Nt&6)!==0?Wn(Yn,Ry):Og()})}function oh(){if(ki===0){var e=Ts;e===0&&(e=qe,qe<<=1,(qe&261888)===0&&(qe=256)),ki=e}return ki}function Hg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Qt(""+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 Cr("action","action",null,i,u);e.push({event:S,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(ki!==0){var R=b?Bg(u,b):new FormData(u);Cd(n,{pending:!0,data:R,method:u.method,action:f},null,R)}}else typeof f=="function"&&(S.preventDefault(),R=b?Bg(u,b):new FormData(u),Cd(n,{pending:!0,data:R,method:u.method,action:f},f,R))},currentTarget:u}]})}}for(var uh=0;uh<ci.length;uh++){var fh=ci[uh],Ly=fh.toLowerCase(),zy=fh[0].toUpperCase()+fh.slice(1);Zl(Ly,"on"+zy)}Zl(du,"onAnimationEnd"),Zl(hu,"onAnimationIteration"),Zl(qr,"onAnimationStart"),Zl("dblclick","onDoubleClick"),Zl("focusin","onFocus"),Zl("focusout","onBlur"),Zl(ud,"onTransitionRun"),Zl(fd,"onTransitionStart"),Zl(Zc,"onTransitionCancel"),Zl(pu,"onTransitionEnd"),ul("onMouseEnter",["mouseout","mouseover"]),ul("onMouseLeave",["mouseout","mouseover"]),ul("onPointerEnter",["pointerout","pointerover"]),ul("onPointerLeave",["pointerout","pointerover"]),kn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),kn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),kn("onBeforeInput",["compositionend","keypress","textInput","paste"]),kn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),kn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),kn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ao="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(Ao));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],R=S.instance,W=S.currentTarget;if(S=S.listener,R!==f&&u.isPropagationStopped())break e;f=S,u.currentTarget=W;try{f(u)}catch(re){nr(re)}u.currentTarget=null,f=R}else for(b=0;b<i.length;b++){if(S=i[b],R=S.instance,W=S.currentTarget,S=S.listener,R!==f&&u.isPropagationStopped())break e;f=S,u.currentTarget=W;try{f(u)}catch(re){nr(re)}u.currentTarget=null,f=R}}}}function ut(e,t){var n=t[Xt];n===void 0&&(n=t[Xt]=new Set);var i=e+"__bubble";n.has(i)||(qg(t,e,2,!1),n.add(i))}function dh(e,t,n){var i=0;t&&(i|=4),qg(n,e,i,t)}var ef="_reactListening"+Math.random().toString(36).slice(2);function hh(e){if(!e[ef]){e[ef]=!0,It.forEach(function(n){n!=="selectionchange"&&(Uy.has(n)||dh(n,!1,e),dh(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ef]||(t[ef]=!0,dh("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=Eh}n=u.bind(null,t,n,e),u=void 0,!lt||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 ph(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 R=b.tag;if((R===3||R===4)&&b.stateNode.containerInfo===u)return;b=b.return}for(;S!==null;){if(b=Sl(S),b===null)return;if(R=b.tag,R===5||R===6||R===26||R===27){i=f=b;continue e}S=S.parentNode}}i=i.return}N(function(){var W=f,re=Kt(n),de=[];e:{var ee=mu.get(e);if(ee!==void 0){var ne=Cr,De=e;switch(e){case"keypress":if(Xi(n)===0)break e;case"keydown":case"keyup":ne=Ur;break;case"focusin":De="focus",ne=Ja;break;case"focusout":De="blur",ne=Ja;break;case"beforeblur":case"afterblur":ne=Ja;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=Rr;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ne=Qi;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ne=Hr;break;case du:case hu:case qr:ne=Or;break;case pu:ne=ga;break;case"scroll":case"scrollend":ne=Ar;break;case"wheel":ne=dn;break;case"copy":case"cut":case"paste":ne=Hc;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ne=Zi;break;case"toggle":case"beforetoggle":ne=ad}var Xe=(t&4)!==0,Yt=!Xe&&(e==="scroll"||e==="scrollend"),G=Xe?ee!==null?ee+"Capture":null:ee;Xe=[];for(var O=W,P;O!==null;){var oe=O;if(P=oe.stateNode,oe=oe.tag,oe!==5&&oe!==26&&oe!==27||P===null||G===null||(oe=ae(O,G),oe!=null&&Xe.push(Mo(O,oe,P))),Yt)break;O=O.return}0<Xe.length&&(ee=new ne(ee,De,null,n,re),de.push({event:ee,listeners:Xe}))}}if((t&7)===0){e:{if(ee=e==="mouseover"||e==="pointerover",ne=e==="mouseout"||e==="pointerout",ee&&n!==mn&&(De=n.relatedTarget||n.fromElement)&&(Sl(De)||De[On]))break e;if((ne||ee)&&(ee=re.window===re?re:(ee=re.ownerDocument)?ee.defaultView||ee.parentWindow:window,ne?(De=n.relatedTarget||n.toElement,ne=W,De=De?Sl(De):null,De!==null&&(Yt=d(De),Xe=De.tag,De!==Yt||Xe!==5&&Xe!==27&&Xe!==6)&&(De=null)):(ne=null,De=W),ne!==De)){if(Xe=Rr,oe="onMouseLeave",G="onMouseEnter",O="mouse",(e==="pointerout"||e==="pointerover")&&(Xe=Zi,oe="onPointerLeave",G="onPointerEnter",O="pointer"),Yt=ne==null?ee:ql(ne),P=De==null?ee:ql(De),ee=new Xe(oe,O+"leave",ne,n,re),ee.target=Yt,ee.relatedTarget=P,oe=null,Sl(re)===W&&(Xe=new Xe(G,O+"enter",De,n,re),Xe.target=P,Xe.relatedTarget=Yt,oe=Xe),Yt=oe,ne&&De)t:{for(Xe=Hy,G=ne,O=De,P=0,oe=G;oe;oe=Xe(oe))P++;oe=0;for(var Ge=O;Ge;Ge=Xe(Ge))oe++;for(;0<P-oe;)G=Xe(G),P--;for(;0<oe-P;)O=Xe(O),oe--;for(;P--;){if(G===O||O!==null&&G===O.alternate){Xe=G;break t}G=Xe(G),O=Xe(O)}Xe=null}else Xe=null;ne!==null&&Gg(de,ee,ne,Xe,!1),De!==null&&Yt!==null&&Gg(de,Yt,De,Xe,!0)}}e:{if(ee=W?ql(W):window,ne=ee.nodeName&&ee.nodeName.toLowerCase(),ne==="select"||ne==="input"&&ee.type==="file")var jt=li;else if(Wi(ee))if(si)jt=q;else{jt=rd;var ze=Yc}else ne=ee.nodeName,!ne||ne.toLowerCase()!=="input"||ee.type!=="checkbox"&&ee.type!=="radio"?W&&He(W.elementType)&&(jt=li):jt=cd;if(jt&&(jt=jt(e,W))){ti(de,jt,n,re);break e}ze&&ze(e,ee,W),e==="focusout"&&W&&ee.type==="number"&&W.memoizedProps.value!=null&&Nl(ee,"number",ee.value)}switch(ze=W?ql(W):window,e){case"focusin":(Wi(ze)||ze.contentEditable==="true")&&(ii=ze,Vc=W,cs=null);break;case"focusout":cs=Vc=ii=null;break;case"mousedown":Qc=!0;break;case"contextmenu":case"mouseup":case"dragend":Qc=!1,uu(de,n,re);break;case"selectionchange":if(od)break;case"keydown":case"keyup":uu(de,n,re)}var st;if(Pi)e:{switch(e){case"compositionstart":var pt="onCompositionStart";break e;case"compositionend":pt="onCompositionEnd";break e;case"compositionupdate":pt="onCompositionUpdate";break e}pt=void 0}else xa?An(e,n)&&(pt="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(pt="onCompositionStart");pt&&(Wa&&n.locale!=="ko"&&(xa||pt!=="onCompositionStart"?pt==="onCompositionEnd"&&xa&&(st=$i()):(Vl=re,zc="value"in Vl?Vl.value:Vl.textContent,xa=!0)),ze=tf(W,pt),0<ze.length&&(pt=new Hs(pt,e,null,n,re),de.push({event:pt,listeners:ze}),st?pt.data=st:(st=Gc(n),st!==null&&(pt.data=st)))),(st=Un?ws(e,n):iu(e,n))&&(pt=tf(W,"onBeforeInput"),0<pt.length&&(ze=new Hs("onBeforeInput","beforeinput",null,n,re),de.push({event:ze,listeners:pt}),ze.data=st)),Oy(de,e,W,n,re)}Ig(de,t)})}function Mo(e,t,n){return{instance:e,listener:t,currentTarget:n}}function tf(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=ae(e,n),u!=null&&i.unshift(Mo(e,u,f)),u=ae(e,t),u!=null&&i.push(Mo(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,R=S.alternate,W=S.stateNode;if(S=S.tag,R!==null&&R===i)break;S!==5&&S!==26&&S!==27||W===null||(R=W,u?(W=ae(n,f),W!=null&&b.unshift(Mo(n,W,R))):u||(W=ae(n,f),W!=null&&b.push(Mo(n,W,R)))),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 Gt(e,t,n,i,u,f){switch(n){case"children":typeof i=="string"?t==="body"||t==="textarea"&&i===""||K(e,i):(typeof i=="number"||typeof i=="bigint")&&t!=="body"&&K(e,""+i);break;case"className":fl(e,"class",i);break;case"tabIndex":fl(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":fl(e,n,i);break;case"style":Ee(e,i,f);break;case"data":if(t!=="object"){fl(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=Qt(""+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"&&Gt(e,t,"name",u.name,u,null),Gt(e,t,"formEncType",u.formEncType,u,null),Gt(e,t,"formMethod",u.formMethod,u,null),Gt(e,t,"formTarget",u.formTarget,u,null)):(Gt(e,t,"encType",u.encType,u,null),Gt(e,t,"method",u.method,u,null),Gt(e,t,"target",u.target,u,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(n);break}i=Qt(""+i),e.setAttribute(n,i);break;case"onClick":i!=null&&(e.onclick=yt);break;case"onScroll":i!=null&&ut("scroll",e);break;case"onScrollEnd":i!=null&&ut("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=Qt(""+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":ut("beforetoggle",e),ut("toggle",e),Vt(e,"popover",i);break;case"xlinkActuate":En(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":En(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":En(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":En(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":En(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":En(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":En(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":En(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":En(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":Vt(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=Ye.get(n)||n,Vt(e,n,i))}}function mh(e,t,n,i,u,f){switch(n){case"style":Ee(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"?K(e,i):(typeof i=="number"||typeof i=="bigint")&&K(e,""+i);break;case"onScroll":i!=null&&ut("scroll",e);break;case"onScrollEnd":i!=null&&ut("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(!Gl.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,""):Vt(e,n,i)}}}function al(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ut("error",e),ut("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:Gt(e,t,f,b,n,null)}}u&&Gt(e,t,"srcSet",n.srcSet,n,null),i&&Gt(e,t,"src",n.src,n,null);return;case"input":ut("invalid",e);var S=f=b=u=null,R=null,W=null;for(i in n)if(n.hasOwnProperty(i)){var re=n[i];if(re!=null)switch(i){case"name":u=re;break;case"type":b=re;break;case"checked":R=re;break;case"defaultChecked":W=re;break;case"value":f=re;break;case"defaultValue":S=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(c(137,t));break;default:Gt(e,t,i,re,n,null)}}da(e,f,S,R,W,b,u,!1);return;case"select":ut("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:Gt(e,t,u,S,n,null)}t=f,n=b,e.multiple=!!i,t!=null?kl(e,!!i,t,!1):n!=null&&kl(e,!!i,n,!0);return;case"textarea":ut("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:Gt(e,t,b,S,n,null)}k(e,i,u,f);return;case"option":for(R in n)if(n.hasOwnProperty(R)&&(i=n[R],i!=null))switch(R){case"selected":e.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:Gt(e,t,R,i,n,null)}return;case"dialog":ut("beforetoggle",e),ut("toggle",e),ut("cancel",e),ut("close",e);break;case"iframe":case"object":ut("load",e);break;case"video":case"audio":for(i=0;i<Ao.length;i++)ut(Ao[i],e);break;case"image":ut("error",e),ut("load",e);break;case"details":ut("toggle",e);break;case"embed":case"source":case"link":ut("error",e),ut("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(W in n)if(n.hasOwnProperty(W)&&(i=n[W],i!=null))switch(W){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Gt(e,t,W,i,n,null)}return;default:if(He(t)){for(re in n)n.hasOwnProperty(re)&&(i=n[re],i!==void 0&&mh(e,t,re,i,n,void 0));return}}for(S in n)n.hasOwnProperty(S)&&(i=n[S],i!=null&&Gt(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,R=null,W=null,re=null;for(ne in n){var de=n[ne];if(n.hasOwnProperty(ne)&&de!=null)switch(ne){case"checked":break;case"value":break;case"defaultValue":R=de;default:i.hasOwnProperty(ne)||Gt(e,t,ne,null,i,de)}}for(var ee in i){var ne=i[ee];if(de=n[ee],i.hasOwnProperty(ee)&&(ne!=null||de!=null))switch(ee){case"type":f=ne;break;case"name":u=ne;break;case"checked":W=ne;break;case"defaultChecked":re=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!==de&&Gt(e,t,ee,ne,i,de)}}zs(e,b,S,R,W,re,f,u);return;case"select":ne=b=S=ee=null;for(f in n)if(R=n[f],n.hasOwnProperty(f)&&R!=null)switch(f){case"value":break;case"multiple":ne=R;default:i.hasOwnProperty(f)||Gt(e,t,f,null,i,R)}for(u in i)if(f=i[u],R=n[u],i.hasOwnProperty(u)&&(f!=null||R!=null))switch(u){case"value":ee=f;break;case"defaultValue":S=f;break;case"multiple":b=f;default:f!==R&&Gt(e,t,u,f,i,R)}t=S,n=b,i=ne,ee!=null?kl(e,!!n,ee,!1):!!i!=!!n&&(t!=null?kl(e,!!n,t,!0):kl(e,!!n,n?[]:"",!1));return;case"textarea":ne=ee=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:Gt(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":ee=u;break;case"defaultValue":ne=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(c(91));break;default:u!==f&&Gt(e,t,b,u,i,f)}ge(e,ee,ne);return;case"option":for(var De in n)if(ee=n[De],n.hasOwnProperty(De)&&ee!=null&&!i.hasOwnProperty(De))switch(De){case"selected":e.selected=!1;break;default:Gt(e,t,De,null,i,ee)}for(R in i)if(ee=i[R],ne=n[R],i.hasOwnProperty(R)&&ee!==ne&&(ee!=null||ne!=null))switch(R){case"selected":e.selected=ee&&typeof ee!="function"&&typeof ee!="symbol";break;default:Gt(e,t,R,ee,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 Xe in n)ee=n[Xe],n.hasOwnProperty(Xe)&&ee!=null&&!i.hasOwnProperty(Xe)&&Gt(e,t,Xe,null,i,ee);for(W in i)if(ee=i[W],ne=n[W],i.hasOwnProperty(W)&&ee!==ne&&(ee!=null||ne!=null))switch(W){case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(c(137,t));break;default:Gt(e,t,W,ee,i,ne)}return;default:if(He(t)){for(var Yt in n)ee=n[Yt],n.hasOwnProperty(Yt)&&ee!==void 0&&!i.hasOwnProperty(Yt)&&mh(e,t,Yt,void 0,i,ee);for(re in i)ee=i[re],ne=n[re],!i.hasOwnProperty(re)||ee===ne||ee===void 0&&ne===void 0||mh(e,t,re,ee,i,ne);return}}for(var G in n)ee=n[G],n.hasOwnProperty(G)&&ee!=null&&!i.hasOwnProperty(G)&&Gt(e,t,G,null,i,ee);for(de in i)ee=i[de],ne=n[de],!i.hasOwnProperty(de)||ee===ne||ee==null&&ne==null||Gt(e,t,de,ee,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 R=n[i],W=R.startTime;if(W>S)break;var re=R.transferSize,de=R.initiatorType;re&&Xg(de)&&(R=R.responseEnd,b+=re*(R<S?1:(S-W)/(R-W)))}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 gh=null,xh=null;function nf(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 bh(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 _h=null;function Yy(){var e=window.event;return e&&e.type==="popstate"?e===_h?!1:(_h=e,!0):(_h=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 Ti(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),uc(t);return}i--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")i++;else if(n==="html")Ro(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Ro(n);for(var f=n.firstChild;f;){var b=f.nextSibling,S=f.nodeName;f[ol]||S==="SCRIPT"||S==="STYLE"||S==="LINK"&&f.rel.toLowerCase()==="stylesheet"||n.removeChild(f),f=b}}else n==="body"&&Ro(e.ownerDocument.body);n=u}while(n);uc(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 yh(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":yh(n),_n(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[ol])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=ms(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=ms(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=ms(e.nextSibling),e===null))return null;return e}function vh(e){return e.data==="$?"||e.data==="$~"}function jh(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 ms(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 wh=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 ms(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=nf(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 Ro(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);_n(e)}var gs=new Map,nx=new Set;function lf(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var $a=fe.d;fe.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=Ku();return e||t}function Jy(e){var t=We(e);t!==null&&t.tag===5&&t.type==="form"?_m(t):$a.r(e)}var rc=typeof document>"u"?null:document;function lx(e,t,n){var i=rc;if(i&&typeof t=="string"&&t){var u=yn(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"),al(t,"link",e),Et(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=rc;if(i&&e&&t){var u='link[rel="preload"][as="'+yn(t)+'"]';t==="image"&&n&&n.imageSrcSet?(u+='[imagesrcset="'+yn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(u+='[imagesizes="'+yn(n.imageSizes)+'"]')):u+='[href="'+yn(e)+'"]';var f=u;switch(t){case"style":f=cc(e);break;case"script":f=oc(e)}gs.has(f)||(e=j({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),gs.set(f,e),i.querySelector(u)!==null||t==="style"&&i.querySelector(Do(f))||t==="script"&&i.querySelector(Oo(f))||(t=i.createElement("link"),al(t,"link",e),Et(t),i.head.appendChild(t)))}}function t0(e,t){$a.m(e,t);var n=rc;if(n&&e){var i=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+yn(i)+'"][href="'+yn(e)+'"]',f=u;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=oc(e)}if(!gs.has(f)&&(e=j({rel:"modulepreload",href:e},t),gs.set(f,e),n.querySelector(u)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Oo(f)))return}i=n.createElement("link"),al(i,"link",e),Et(i),n.head.appendChild(i)}}}function n0(e,t,n){$a.S(e,t,n);var i=rc;if(i&&e){var u=tt(i).hoistableStyles,f=cc(e);t=t||"default";var b=u.get(f);if(!b){var S={loading:0,preload:null};if(b=i.querySelector(Do(f)))S.loading=5;else{e=j({rel:"stylesheet",href:e,"data-precedence":t},n),(n=gs.get(f))&&Sh(e,n);var R=b=i.createElement("link");Et(R),al(R,"link",e),R._p=new Promise(function(W,re){R.onload=W,R.onerror=re}),R.addEventListener("load",function(){S.loading|=1}),R.addEventListener("error",function(){S.loading|=2}),S.loading|=4,sf(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=rc;if(n&&e){var i=tt(n).hoistableScripts,u=oc(e),f=i.get(u);f||(f=n.querySelector(Oo(u)),f||(e=j({src:e,async:!0},t),(t=gs.get(u))&&Nh(e,t),f=n.createElement("script"),Et(f),al(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=rc;if(n&&e){var i=tt(n).hoistableScripts,u=oc(e),f=i.get(u);f||(f=n.querySelector(Oo(u)),f||(e=j({src:e,async:!0,type:"module"},t),(t=gs.get(u))&&Nh(e,t),f=n.createElement("script"),Et(f),al(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)?lf(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=cc(n.href),n=tt(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=cc(n.href);var f=tt(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(Do(e)))&&!f._p&&(b.instance=f,b.state.loading=5),gs.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},gs.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=oc(n),n=tt(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 cc(e){return'href="'+yn(e)+'"'}function Do(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}),al(t,"link",n),Et(t),e.head.appendChild(t))}function oc(e){return'[src="'+yn(e)+'"]'}function Oo(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~="'+yn(n.href)+'"]');if(i)return t.instance=i,Et(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"),Et(i),al(i,"style",u),sf(i,n.precedence,e),t.instance=i;case"stylesheet":u=cc(n.href);var f=e.querySelector(Do(u));if(f)return t.state.loading|=4,t.instance=f,Et(f),f;i=ax(n),(u=gs.get(u))&&Sh(i,u),f=(e.ownerDocument||e).createElement("link"),Et(f);var b=f;return b._p=new Promise(function(S,R){b.onload=S,b.onerror=R}),al(f,"link",i),t.state.loading|=4,sf(f,n.precedence,e),t.instance=f;case"script":return f=oc(n.src),(u=e.querySelector(Oo(f)))?(t.instance=u,Et(u),u):(i=n,(u=gs.get(f))&&(i=j({},n),Nh(i,u)),e=e.ownerDocument||e,u=e.createElement("script"),Et(u),al(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,sf(i,n.precedence,e));return t.instance}function sf(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 Sh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Nh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var af=null;function rx(e,t,n){if(af===null){var i=new Map,u=af=new Map;u.set(n,i)}else u=af,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[ol]||f[Ot]||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=cc(i.href),f=t.querySelector(Do(u));if(f){t=f._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=rf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=f,Et(f);return}f=t.ownerDocument||t,i=ax(i),(u=gs.get(u))&&Sh(i,u),f=f.createElement("link"),Et(f);var b=f;b._p=new Promise(function(S,R){b.onload=S,b.onerror=R}),al(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=rf.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var kh=0;function c0(e,t){return e.stylesheets&&e.count===0&&of(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var i=setTimeout(function(){if(e.stylesheets&&of(e,e.stylesheets),e.unsuspend){var f=e.unsuspend;e.unsuspend=null,f()}},6e4+t);0<e.imgBytes&&kh===0&&(kh=62500*Gy());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&of(e,e.stylesheets),e.unsuspend)){var f=e.unsuspend;e.unsuspend=null,f()}},(e.imgBytes>kh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(u)}}:null}function rf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)of(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var cf=null;function of(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,cf=new Map,t.forEach(o0,e),cf=null,rf.call(e))}function o0(e,t){if(!(t.state.loading&4)){var n=cf.get(e);if(n)var i=n.get(null);else{n=new Map,cf.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=rf.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 Lo={$$typeof:J,Provider:null,Consumer:null,_currentValue:ue,_currentValue2:ue,_threadCount:0};function u0(e,t,n,i,u,f,b,S,R){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=_t(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_t(0),this.hiddenUpdates=_t(null),this.identifierPrefix=i,this.onUncaughtError=u,this.onCaughtError=f,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=R,this.incompleteTransitions=new Map}function ux(e,t,n,i,u,f,b,S,R,W,re,de){return e=new u0(e,t,n,b,R,W,re,de,S),t=1,f===!0&&(t|=24),f=_l(3,null,null,t),e.current=f,f.stateNode=e,t=Xr(),t.refCount++,e.pooledCache=t,t.refCount++,f.memoizedState={element:i,isDehydrated:n,cache:t},U(f),e}function fx(e){return e?(e=Na,e):Na}function dx(e,t,n,i,u,f){u=fx(u),i.context===null?i.context=u:i.pendingContext=u,i=Ne(t),i.payload={element:n},f=f===void 0?null:f,f!==null&&(i.callback=f),n=vt(e,i,t),n!==null&&(zl(n,e,t),gn(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 Th(e,t){hx(e,t),(e=e.alternate)&&hx(e,t)}function px(e){if(e.tag===13||e.tag===31){var t=Is(e,67108864);t!==null&&zl(t,e,67108864),Th(e,67108864)}}function mx(e){if(e.tag===13||e.tag===31){var t=ts();t=ls(t);var n=Is(e,t);n!==null&&zl(n,e,t),Th(e,t)}}var uf=!0;function f0(e,t,n,i){var u=Q.T;Q.T=null;var f=fe.p;try{fe.p=2,Eh(e,t,n,i)}finally{fe.p=f,Q.T=u}}function d0(e,t,n,i){var u=Q.T;Q.T=null;var f=fe.p;try{fe.p=8,Eh(e,t,n,i)}finally{fe.p=f,Q.T=u}}function Eh(e,t,n,i){if(uf){var u=Ch(i);if(u===null)ph(e,t,i,ff,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=We(u);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var b=bt(f.pendingLanes);if(b!==0){var S=f;for(S.pendingLanes|=2,S.entangledLanes|=2;b;){var R=1<<31-Dt(b);S.entanglements[1]|=R,b&=~R}Ws(f),(Nt&6)===0&&(Vu=at()+500,Co(0))}}break;case 31:case 13:S=Is(f,2),S!==null&&zl(S,f,2),Ku(),Th(f,2)}if(f=Ch(i),f===null&&ph(e,t,i,ff,n),f===u)break;u=f}u!==null&&i.stopPropagation()}else ph(e,t,i,null,n)}}function Ch(e){return e=Kt(e),Ah(e)}var ff=null;function Ah(e){if(ff=null,e=Sl(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 ff=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(Rt()){case Yn:return 2;case Tt:return 8;case et:case rt:return 32;case pn:return 268435456;default:return 32}default:return 32}}var Mh=!1,Ei=null,Ci=null,Ai=null,zo=new Map,Uo=new Map,Mi=[],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":Ei=null;break;case"dragenter":case"dragleave":Ci=null;break;case"mouseover":case"mouseout":Ai=null;break;case"pointerover":case"pointerout":zo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Uo.delete(t.pointerId)}}function Ho(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=We(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 Ei=Ho(Ei,e,t,n,i,u),!0;case"dragenter":return Ci=Ho(Ci,e,t,n,i,u),!0;case"mouseover":return Ai=Ho(Ai,e,t,n,i,u),!0;case"pointerover":var f=u.pointerId;return zo.set(f,Ho(zo.get(f)||null,e,t,n,i,u)),!0;case"gotpointercapture":return f=u.pointerId,Uo.set(f,Ho(Uo.get(f)||null,e,t,n,i,u)),!0}return!1}function bx(e){var t=Sl(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,Il(e.priority,function(){mx(n)});return}}else if(t===31){if(t=m(n),t!==null){e.blockedOn=t,Il(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 df(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Ch(e.nativeEvent);if(n===null){n=e.nativeEvent;var i=new n.constructor(n.type,n);mn=i,n.target.dispatchEvent(i),mn=null}else return t=We(n),t!==null&&px(t),e.blockedOn=n,!1;t.shift()}return!0}function _x(e,t,n){df(e)&&n.delete(t)}function m0(){Mh=!1,Ei!==null&&df(Ei)&&(Ei=null),Ci!==null&&df(Ci)&&(Ci=null),Ai!==null&&df(Ai)&&(Ai=null),zo.forEach(_x),Uo.forEach(_x)}function hf(e,t){e.blockedOn===t&&(e.blockedOn=null,Mh||(Mh=!0,l.unstable_scheduleCallback(l.unstable_NormalPriority,m0)))}var pf=null;function yx(e){pf!==e&&(pf=e,l.unstable_scheduleCallback(l.unstable_NormalPriority,function(){pf===e&&(pf=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(Ah(i||n)===null)continue;break}var f=We(n);f!==null&&(e.splice(t,3),t-=3,Cd(f,{pending:!0,data:u,method:n.method,action:i},i,u))}}))}function uc(e){function t(R){return hf(R,e)}Ei!==null&&hf(Ei,e),Ci!==null&&hf(Ci,e),Ai!==null&&hf(Ai,e),zo.forEach(t),Uo.forEach(t);for(var n=0;n<Mi.length;n++){var i=Mi[n];i.blockedOn===e&&(i.blockedOn=null)}for(;0<Mi.length&&(n=Mi[0],n.blockedOn===null);)bx(n),n.blockedOn===null&&Mi.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(Ah(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 Rh(e){this._internalRoot=e}mf.prototype.render=Rh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var n=t.current,i=ts();dx(n,i,e,t,null,null)},mf.prototype.unmount=Rh.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),Ku(),t[On]=null}};function mf(e){this._internalRoot=e}mf.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ka();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Mi.length&&t!==0&&t<Mi[n].priority;n++);Mi.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"));fe.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:Q,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var gf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!gf.isDisabled&&gf.supportsFiber)try{en=gf.inject(g0),St=gf}catch{}}return Io.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[On]=t.current,hh(e),new Rh(t)},Io.hydrateRoot=function(e,t,n){if(!o(e))throw Error(c(299));var i=!1,u="",f=Cm,b=Am,S=Mm,R=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&&(R=n.formState)),t=ux(e,1,!0,t,n??null,i,u,R,f,b,S,vx),t.context=fx(null),n=t.current,i=ts(),i=ls(i),u=Ne(i),u.callback=null,vt(n,u,i),n=i,t.current.lanes=n,Xn(t,n),Ws(t),e[On]=t.current,hh(e),new mf(t)},Io.version="19.2.8",Io}var Dx;function E0(){if(Dx)return zh.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(),zh.exports=T0(),zh.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,Sc,Nc,kc,Tc,nu,Ec,Jf,a_;class D0{constructor(s){xn(this,Jf);xn(this,Qa,null);xn(this,Sc,new Set);xn(this,Nc,500);xn(this,kc,null);xn(this,Tc,!1);xn(this,nu,null);xn(this,Ec,null);this.url=s}get statusText(){return this.connected?"Хост на связи":"Нет связи с хостом"}onStatus(s){kt(this,Ec,s)}connect(){if(Qe(this,Tc))return;const s=new WebSocket(this.url);kt(this,Qa,s),s.addEventListener("open",()=>{var r,c;kt(this,Nc,500),this.send({type:"hello",protocol:l_,clientName:"ccv-web"}),(r=Qe(this,nu))==null||r.call(this),(c=Qe(this,Ec))==null||c.call(this)}),s.addEventListener("message",r=>{let c;try{c=JSON.parse(String(r.data))}catch{return}for(const o of Qe(this,Sc))o(c)}),s.addEventListener("close",()=>{var r;kt(this,Qa,null),(r=Qe(this,Ec))==null||r.call(this),qn(this,Jf,a_).call(this)}),s.addEventListener("error",()=>s.close())}onReconnect(s){kt(this,nu,s)}on(s){return Qe(this,Sc).add(s),()=>Qe(this,Sc).delete(s)}send(s){var r;((r=Qe(this,Qa))==null?void 0:r.readyState)===WebSocket.OPEN&&Qe(this,Qa).send(JSON.stringify(s))}get connected(){var s;return((s=Qe(this,Qa))==null?void 0:s.readyState)===WebSocket.OPEN}close(){var s;kt(this,Tc,!0),(s=Qe(this,Qa))==null||s.close()}}Qa=new WeakMap,Sc=new WeakMap,Nc=new WeakMap,kc=new WeakMap,Tc=new WeakMap,nu=new WeakMap,Ec=new WeakMap,Jf=new WeakSet,a_=function(){if(Qe(this,Tc)||Qe(this,kc)!==null)return;const s=Qe(this,Nc);kt(this,Nc,Math.min(s*2,1e4)),kt(this,kc,window.setTimeout(()=>{kt(this,kc,null),this.connect()},s))};const O0=1,i_="ccv:relay",Uf="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 ra,Cc,ca,Ac,Mc,qi,br,_r,Gi,yr,Rc,vr,jr,rn,Li,ap,c_,gr,ip;class z0{constructor(s){xn(this,rn);xn(this,ra,null);xn(this,Cc,new Set);xn(this,ca,null);xn(this,Ac,null);xn(this,Mc,500);xn(this,qi,null);xn(this,br,!1);xn(this,_r,!1);xn(this,Gi,!1);xn(this,yr,null);xn(this,Rc,"Подключаемся…");xn(this,vr,0);xn(this,jr,[]);this.session=s}get connected(){return Qe(this,_r)&&Qe(this,Gi)}get statusText(){return Qe(this,Rc)}get hostId(){return Qe(this,yr)}on(s){return Qe(this,Cc).add(s),()=>Qe(this,Cc).delete(s)}onReconnect(s){kt(this,Ac,s)}onStatus(s){kt(this,ca,s)}connect(){Qe(this,br)||qn(this,rn,ap).call(this)}send(s){if(!Qe(this,_r)){Qe(this,jr).length<64&&Qe(this,jr).push(s);return}qn(this,rn,gr).call(this,{t:"client.frame",body:s})}close(){var s;kt(this,br,!0),Qe(this,qi)!==null&&window.clearTimeout(Qe(this,qi)),(s=Qe(this,ra))==null||s.close()}}ra=new WeakMap,Cc=new WeakMap,ca=new WeakMap,Ac=new WeakMap,Mc=new WeakMap,qi=new WeakMap,br=new WeakMap,_r=new WeakMap,Gi=new WeakMap,yr=new WeakMap,Rc=new WeakMap,vr=new WeakMap,jr=new WeakMap,rn=new WeakSet,Li=function(s){var r;Qe(this,Rc)!==s&&(kt(this,Rc,s),(r=Qe(this,ca))==null||r.call(this))},ap=async function(){if(Qe(this,ra))return;if(!Qe(this,yr))try{kt(this,yr,await U0(this.session.token))}catch(c){qn(this,rn,Li).call(this,c instanceof Error?c.message:String(c)),qn(this,rn,ip).call(this);return}const s=location.protocol==="https:"?"wss":"ws",r=new WebSocket(`${s}://${location.host}/relay/client`);kt(this,ra,r),r.addEventListener("open",()=>{qn(this,rn,gr).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,rn,c_).call(this,o)}),r.addEventListener("close",()=>{var c;kt(this,ra,null),kt(this,_r,!1),kt(this,Gi,!1),qn(this,rn,Li).call(this,"Нет связи с сервером"),(c=Qe(this,ca))==null||c.call(this),qn(this,rn,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":kt(this,Mc,500),qn(this,rn,gr).call(this,{t:"client.attach",hostId:Qe(this,yr)??"",...Qe(this,vr)>0?{sinceRseq:Qe(this,vr)}:{}});return;case"client.attached":kt(this,_r,!0),kt(this,Gi,s.online),kt(this,vr,s.rseq),qn(this,rn,Li).call(this,s.online?"Хост на связи":"Компьютер не на связи"),qn(this,rn,gr).call(this,{t:"client.frame",body:{type:"hello",protocol:l_,clientName:"ccv-web-relay"}});const x=Qe(this,jr);kt(this,jr,[]);for(const y of x)qn(this,rn,gr).call(this,{t:"client.frame",body:y});(r=Qe(this,Ac))==null||r.call(this),(c=Qe(this,ca))==null||c.call(this);return;case"host.frame":{s.rseq>0&&kt(this,vr,s.rseq);const y=s.body;for(const j of Qe(this,Cc))j(y);return}case"host.online":kt(this,Gi,!0),qn(this,rn,Li).call(this,"Хост на связи"),(o=Qe(this,Ac))==null||o.call(this),(d=Qe(this,ca))==null||d.call(this);return;case"host.offline":kt(this,Gi,!1),qn(this,rn,Li).call(this,"Компьютер не на связи"),(h=Qe(this,ca))==null||h.call(this);return;case"ping":qn(this,rn,gr).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(Uf),qn(this,rn,Li).call(this,"Этот компьютер отвязан от аккаунта"),kt(this,br,!0),(m=Qe(this,ra))==null||m.close();return}s.code!=="offline"&&qn(this,rn,Li).call(this,s.message),(g=Qe(this,ca))==null||g.call(this);return}},gr=function(s){var r;((r=Qe(this,ra))==null?void 0:r.readyState)===WebSocket.OPEN&&Qe(this,ra).send(JSON.stringify(s))},ip=function(){if(Qe(this,br)||Qe(this,qi)!==null)return;const s=Qe(this,Mc);kt(this,Mc,Math.min(s*2,1e4)),kt(this,qi,window.setTimeout(()=>{kt(this,qi,null),qn(this,rn,ap).call(this)},s))};async function U0(l){const s=new URLSearchParams(location.search).get("host");if(s)return localStorage.setItem(Uf,s),s;const r=localStorage.getItem(Uf);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(Uf,d[0].id),d[0].id;throw location.href="/hosts",new Error("выберите компьютер")}function Hf(){return location.pathname==="/app"||location.pathname.startsWith("/app/")?"relay":"local"}const H0=`${location.protocol==="https:"?"wss":"ws"}://${location.host}/ws`;function B0(){if(Hf()==="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 Jo=null,Po=null;function vp(){if(Jo)return Jo;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 Jo=l,window.addEventListener("pagehide",d_),l}function Ih(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(){Po===null&&(Po=window.setTimeout(d_,G0))}function d_(){if(Po!==null&&window.clearTimeout(Po),Po=null,!!Jo)try{localStorage.setItem(o_,JSON.stringify(Object.fromEntries(Jo)))}catch{}}const pl={items:[],pending:[],lastSeq:0,contextTokens:null},qh={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 Bf(pl,l).items.map(s=>({...s,id:`h:${s.id}`}))}function Bf(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 ea(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 ea(l,{id:s.blockId,kind:"assistant",text:s.text,streaming:!0});const m=c[h];return fc(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?ea(l,m):fc(l,h,m)}case"thinking.delta":{const h=c.findIndex(g=>g.id===s.blockId);if(h===-1)return ea(l,{id:s.blockId,kind:"thinking",text:s.text});const m=c[h];return fc(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?ea(l,m):fc(l,h,m)}case"tool.use":return ea(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 fc(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 fc({...l,pending:m},g,{...x,answers:s.answers})}}return s.decision==="allow"?{...l,pending:m}:ea({...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 ea({...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:ea(l,{id:`s${r}`,kind:"notice",tone:"info",text:"Контекст сжат"});case"error":return ea(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 ea(l,s){return{...l,items:[...l.items,s]}}function fc(l,s,r){const c=l.items.slice();return c[s]=r,{...l,items:c}}const cp="ccv:theme",Gh=["system","light","dark","gpt"];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=l==="gpt"?"gpt":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=Gh[(Gh.indexOf(o)+1)%Gh.length];try{localStorage.setItem(cp,d)}catch{}return d})},[]);return[l,r,c]}function P0(){try{const l=localStorage.getItem(cp);if(l==="gpt"||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:"чтение свободно, изменения и выход из песочницы — с разрешения"},{value:"acceptEdits",hint:"работа внутри проекта, выход за границы — с разрешения"},{value:"plan",hint:"песочница только для чтения; изменения требуют разрешения"},{value:"bypassPermissions",hint:"полный доступ без подтверждений"}],ev=[{value:"default",hint:"рискованное agy отклоняет сам: спросить он не может"},{value:"acceptEdits",hint:"правки файлов без подтверждения, команды — нет"},{value:"plan",hint:"только план, без изменений"},{value:"bypassPermissions",hint:"разрешено всё, включая команды"}],wr={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:"вопроса"}},tv=320,m_="ccv:panes";function nv(l){return`--${l}-w`}function g_(l,s){const r=wr[l];return Math.round(Math.min(r.max,Math.max(r.min,s)))}function lv(){const l={};for(const s of Object.keys(wr))l[s]=wr[s].width;try{const s=localStorage.getItem(m_);if(s){const r=JSON.parse(s);for(const c of Object.keys(wr)){const o=r[c];typeof o=="number"&&Number.isFinite(o)&&(l[c]=g_(c,o))}}}catch{}return l}function sv(){const[l,s]=_.useState(lv),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]:wr[h].width};return r(g),g})},[r]),d={};for(const h of Object.keys(wr))d[nv(h)]=`${l[h]}px`;return{widths:l,style:d,setWidth:c,reset:o}}const Yh=260,x_=120,av=200,zx="ccv:terminal-h";function Ux(l,s){return Math.round(Math.min(s,Math.max(x_,l)))}function iv(){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 Yh}),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(Yh),r(Yh)},[r]);return{height:l,setHeight:c,reset:o}}function Pf(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 rv=500,cv=6;function b_({onLongPress:l,onClick:s,disabled:r=!1,thresholdMs:c=rv,moveCancelPx:o=cv}){const d=_.useRef(null),[h,m]=_.useState(!1),g=_.useCallback(()=>{d.current&&window.clearTimeout(d.current.timer),d.current=null,m(!1)},[]),x=_.useCallback(E=>{if(r||E.button!==0)return;const M={timer:0,x:E.clientX,y:E.clientY,fired:!1};M.timer=window.setTimeout(()=>{M.fired=!0,m(!1),l()},c),d.current=M,m(!0)},[r,c,l]),y=_.useCallback(E=>{const M=d.current;!M||M.fired||Math.hypot(E.clientX-M.x,E.clientY-M.y)>o&&g()},[o,g]),j=_.useCallback(()=>{d.current&&!d.current.fired?g():m(!1)},[g]),v=_.useCallback(E=>{var M;if((M=d.current)!=null&&M.fired){d.current=null,E.preventDefault();return}if(!r){if(E.shiftKey){l();return}s()}},[r,s,l]),C=_.useCallback(E=>{E.preventDefault()},[]),T=_.useCallback(E=>{r||E.shiftKey&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),l())},[r,l]);return{holding:h,thresholdMs:c,handlers:{onPointerDown:x,onPointerMove:y,onPointerUp:j,onPointerCancel:j,onPointerLeave:j,onClick:v,onContextMenu:C,onKeyDown:T}}}const ov={height:0,offsetTop:0,offsetLeft:0};function Hx(){if(typeof window>"u")return ov;const l=window.visualViewport;return l?{height:l.height,offsetTop:l.offsetTop,offsetLeft:l.offsetLeft}:{height:window.innerHeight,offsetTop:0,offsetLeft:0}}function uv(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 Tr=jp();function __(l){Tr=l}var xr={exec:()=>null};function dc(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 xt(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(gl.caret,"$1"),r=r.replace(o,h),c},getRegex:()=>new RegExp(r,s)};return c}var fv=((l="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+l)}catch{return!1}})(),gl={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:dc(l=>new RegExp(`^ {0,${l}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:dc(l=>new RegExp(`^ {0,${l}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:dc(l=>new RegExp(`^ {0,${l}}(?:\`\`\`|~~~)`)),headingBeginRegex:dc(l=>new RegExp(`^ {0,${l}}#`)),htmlBeginRegex:dc(l=>new RegExp(`^ {0,${l}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:dc(l=>new RegExp(`^ {0,${l}}>`))},dv=/^(?:[ \t]*(?:\n|$))+/,hv=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,pv=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,lu=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,mv=/^ {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_=xt(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(),gv=xt(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]+)*)/,xv=/^[^\n]+/,Np=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,bv=xt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Np).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),_v=xt(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,wp).getRegex(),Wf="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]*?(?:-->|$))/,yv=xt("^ {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",Wf).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),j_=l=>xt(Sp).replace("hr",lu).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",Wf).getRegex(),vv=j_(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),jv=j_(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),wv=xt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",jv).getRegex(),Tp={blockquote:wv,code:hv,def:bv,fences:pv,heading:mv,hr:lu,html:yv,lheading:v_,list:_v,newline:dv,paragraph:vv,table:xr,text:xv},Bx=xt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",lu).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",Wf).getRegex(),Sv={...Tp,lheading:gv,table:Bx,paragraph:xt(Sp).replace("hr",lu).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",Wf).getRegex()},Nv={...Tp,html:xt(`^ *(?: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:xr,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:xt(Sp).replace("hr",lu).replace("heading",` *#{1,6} *[^
52
+ ]`).replace("lheading",v_).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},kv=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Tv=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,w_=/^( {2,}|\\)\n(?!\s*$)/,Ev=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Oc=/[\p{P}\p{S}]/u,ed=/[\s\p{P}\p{S}]/u,Ep=/[^\s\p{P}\p{S}]/u,Cv=xt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ed).getRegex(),S_=/(?!~)[\p{P}\p{S}]/u,Av=/(?!~)[\s\p{P}\p{S}]/u,Mv=/(?:[^\s\p{P}\p{S}]|~)/u,Rv=xt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",fv?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),N_=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Dv=xt(N_,"u").replace(/punct/g,Oc).getRegex(),Ov=xt(N_,"u").replace(/punct/g,S_).getRegex(),k_="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Lv=xt(k_,"gu").replace(/notPunctSpace/g,Ep).replace(/punctSpace/g,ed).replace(/punct/g,Oc).getRegex(),zv=xt(k_,"gu").replace(/notPunctSpace/g,Mv).replace(/punctSpace/g,Av).replace(/punct/g,S_).getRegex(),Uv=xt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ep).replace(/punctSpace/g,ed).replace(/punct/g,Oc).getRegex(),Hv=xt(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Oc).getRegex(),Bv="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Iv=xt(Bv,"gu").replace(/notPunctSpace/g,Ep).replace(/punctSpace/g,ed).replace(/punct/g,Oc).getRegex(),qv=xt(/\\(punct)/,"gu").replace(/punct/g,Oc).getRegex(),Gv=xt(/^<(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(),Yv=xt(kp).replace("(?:-->|$)","-->").getRegex(),$v=xt("^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",Yv).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Gf=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Xv=xt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Gf).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),T_=xt(/^!?\[(label)\]\[(ref)\]/).replace("label",Gf).replace("ref",Np).getRegex(),E_=xt(/^!?\[(ref)\](?:\[\])?/).replace("ref",Np).getRegex(),Vv=xt("reflink|nolink(?!\\()","g").replace("reflink",T_).replace("nolink",E_).getRegex(),Ix=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Cp={_backpedal:xr,anyPunctuation:qv,autolink:Gv,blockSkip:Rv,br:w_,code:Tv,del:xr,delLDelim:xr,delRDelim:xr,emStrongLDelim:Dv,emStrongRDelimAst:Lv,emStrongRDelimUnd:Uv,escape:kv,link:Xv,nolink:E_,punctuation:Cv,reflink:T_,reflinkSearch:Vv,tag:$v,text:Ev,url:xr},Qv={...Cp,link:xt(/^!?\[(label)\]\((.*?)\)/).replace("label",Gf).getRegex(),reflink:xt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Gf).getRegex()},op={...Cp,emStrongRDelimAst:zv,emStrongLDelim:Ov,delLDelim:Hv,delRDelim:Iv,url:xt(/^((?: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:xt(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {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()},Kv={...op,br:xt(w_).replace("{2,}","*").getRegex(),text:xt(op.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},xf={normal:Tp,gfm:Sv,pedantic:Nv},qo={normal:Cp,gfm:op,breaks:Kv,pedantic:Qv},Zv={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},qx=l=>Zv[l];function sa(l,s){if(s){if(gl.escapeTest.test(l))return l.replace(gl.escapeReplace,qx)}else if(gl.escapeTestNoEncode.test(l))return l.replace(gl.escapeReplaceNoEncode,qx);return l}function Gx(l){try{l=encodeURI(l).replace(gl.percentDecode,"%")}catch{return null}return l}function Yx(l,s){var d;let r=l.replace(gl.findPipe,(h,m,g)=>{let x=!1,y=m;for(;--y>=0&&g[y]==="\\";)x=!x;return x?"|":" |"}),c=r.split(gl.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(gl.slashPipe,"|");return c}function Di(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&&gl.blankLine.test(s[r]);)r--;return s.length-r<=2?l:s.slice(0,r+1).join(`
54
+ `)}function Fv(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 Jv(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 Pv(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 Yf=class{constructor(l){$t(this,"options");$t(this,"rules");$t(this,"lexer");this.options=l||Tr}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=Pv(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=Di(r,"#");(this.options.pedantic||!c||this.rules.other.endingSpaceChar.test(c))&&(r=c.trim())}return{type:"heading",raw:Di(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:Di(s[0],`
58
+ `)}}blockquote(l){let s=this.rules.block.blockquote.exec(l);if(s){let r=Di(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 C=v,T=C.raw+`
65
+ `+r.join(`
66
+ `),E=this.blockquote(T);d[d.length-1]=E,c=c.substring(0,c.length-C.raw.length)+E.raw,o=o.substring(0,o.length-C.text.length)+E.text;break}else if((v==null?void 0:v.type)==="list"){let C=v,T=C.raw+`
67
+ `+r.join(`
68
+ `),E=this.list(T);d[d.length-1]=E,c=c.substring(0,c.length-v.raw.length)+E.raw,o=o.substring(0,o.length-C.raw.length)+E.raw,r=T.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=Jv(s[2].split(`
70
+ `,1)[0],s[1].length),v=l.split(`
71
+ `,1)[0],C=!j.trim(),T=0;if(this.options.pedantic?(T=2,y=j.trimStart()):C?T=s[1].length+1:(T=j.search(this.rules.other.nonSpaceChar),T=T>4?1:T,y=j.slice(T),T+=s[1].length),C&&this.rules.other.blankLine.test(v)&&(x+=v+`
72
+ `,l=l.substring(v.length+1),g=!0),!g){let E=this.rules.other.nextBulletRegex(T),M=this.rules.other.hrRegex(T),I=this.rules.other.fencesBeginRegex(T),F=this.rules.other.headingBeginRegex(T),J=this.rules.other.htmlBeginRegex(T),H=this.rules.other.blockquoteBeginRegex(T);for(;l;){let B=l.split(`
73
+ `,1)[0],D;if(v=B,this.options.pedantic?(v=v.replace(this.rules.other.listReplaceNesting," "),D=v):D=v.replace(this.rules.other.tabCharGlobal," "),I.test(v)||F.test(v)||J.test(v)||H.test(v)||E.test(v)||M.test(v))break;if(D.search(this.rules.other.nonSpaceChar)>=T||!v.trim())y+=`
74
+ `+D.slice(T);else{if(C||j.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||I.test(j)||F.test(j)||M.test(j))break;y+=`
75
+ `+v}C=!v.trim(),x+=B+`
76
+ `,l=l.substring(B.length+1),j=D.slice(T)}}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:Di(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:Di(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:Di(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=Di(r.slice(0,-1),"\\");if((r.length-d.length)%2===0)return}else{let d=Fv(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 C=j.slice(1,-1);return{type:"em",raw:j,text:C,tokens:this.lexer.inlineTokens(C)}}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}}}},Rs=class up{constructor(s){$t(this,"tokens");$t(this,"options");$t(this,"state");$t(this,"inlineQueue");$t(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=s||Tr,this.options.tokenizer=this.options.tokenizer||new Yf,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:gl,block:xf.normal,inline:qo.normal};this.options.pedantic?(r.block=xf.pedantic,r.inline=qo.pedantic):this.options.gfm&&(r.block=xf.gfm,this.options.breaks?r.inline=qo.breaks:r.inline=qo.gfm),this.tokenizer.rules=r}static get rules(){return{block:xf,inline:qo}}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(gl.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(gl.tabCharGlobal," ").replace(gl.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(C=>{v=C.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,C=>v.includes(C.slice(C.lastIndexOf("[")+1,-1))?"["+"a".repeat(C.length-2)+"]":C))}c=c.replace(this.tokenizer.rules.inline.anyPunctuation,"++"),c=c.replace(this.tokenizer.rules.inline.blockSkip,(v,C,T)=>{let E=T?T.length:0;return v.slice(0,E)+"["+"a".repeat(v.length-E-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(T=>(v=T.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 T=r.at(-1);v.type==="text"&&(T==null?void 0:T.type)==="text"?(T.raw+=v.raw,T.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 C=s;if((j=this.options.extensions)!=null&&j.startInline){let T=1/0,E=s.slice(1),M;this.options.extensions.startInline.forEach(I=>{M=I.call({lexer:this},E),typeof M=="number"&&M>=0&&(T=Math.min(T,M))}),T<1/0&&T>=0&&(C=s.substring(0,T+1))}if(v=this.tokenizer.inlineText(C)){s=s.substring(v.raw.length),v.raw.slice(-1)!=="_"&&(d=v.raw.slice(-1)),o=!0;let T=r.at(-1);(T==null?void 0:T.type)==="text"?(T.raw+=v.raw,T.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)}},$f=class{constructor(l){$t(this,"options");$t(this,"parser");this.options=l||Tr}space(l){return""}code({text:l,lang:s,escaped:r}){var d;let c=(d=(s||"").match(gl.notSpaceStart))==null?void 0:d[0],o=l.replace(gl.endingNewline,"")+`
96
+ `;return c?'<pre><code class="language-'+sa(c)+'">'+(r?o:sa(o,!0))+`</code></pre>
97
+ `:"<pre><code>"+(r?o:sa(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>${sa(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="'+sa(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 sa(r);l=o;let d=`<img src="${l}" alt="${sa(r)}"`;return s&&(d+=` title="${sa(s)}"`),d+=">",d}text(l){return"tokens"in l&&l.tokens?this.parser.parseInline(l.tokens):"escaped"in l&&l.escaped?l.text:sa(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}},Ds=class fp{constructor(s){$t(this,"options");$t(this,"renderer");$t(this,"textRenderer");this.options=s||Tr,this.options.renderer=this.options.renderer||new $f,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}},zf,Zo=(zf=class{constructor(l){$t(this,"options");$t(this,"block");this.options=l||Tr}preprocess(l){return l}postprocess(l){return l}processAllTokens(l){return l}emStrongMask(l){return l}provideLexer(l=this.block){return l?Rs.lex:Rs.lexInline}provideParser(l=this.block){return l?Ds.parse:Ds.parseInline}},$t(zf,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),$t(zf,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),zf),Wv=class{constructor(...l){$t(this,"defaults",jp());$t(this,"options",this.setOptions);$t(this,"parse",this.parseMarkdown(!0));$t(this,"parseInline",this.parseMarkdown(!1));$t(this,"Parser",Ds);$t(this,"Renderer",$f);$t(this,"TextRenderer",Ap);$t(this,"Lexer",Rs);$t(this,"Tokenizer",Yf);$t(this,"Hooks",Zo);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 $f(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 Yf(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 Zo;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];Zo.passThroughHooks.has(d)?o[h]=x=>{if(this.defaults.async&&Zo.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 Rs.lex(l,s??this.defaults)}parser(l,s){return Ds.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?Rs.lex:Rs.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?Ds.parse:Ds.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?Rs.lex:Rs.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?Ds.parse:Ds.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>"+sa(r.message+"",!0)+"</pre>";return s?Promise.resolve(c):c}if(s)return Promise.reject(r);throw r}}},kr=new Wv;function Mt(l,s){return kr.parse(l,s)}Mt.options=Mt.setOptions=function(l){return kr.setOptions(l),Mt.defaults=kr.defaults,__(Mt.defaults),Mt};Mt.getDefaults=jp;Mt.defaults=Tr;Mt.use=function(...l){return kr.use(...l),Mt.defaults=kr.defaults,__(Mt.defaults),Mt};Mt.walkTokens=function(l,s){return kr.walkTokens(l,s)};Mt.parseInline=kr.parseInline;Mt.Parser=Ds;Mt.parser=Ds.parse;Mt.Renderer=$f;Mt.TextRenderer=Ap;Mt.Lexer=Rs;Mt.lexer=Rs.lex;Mt.Tokenizer=Yf;Mt.Hooks=Zo;Mt.parse=Mt;Mt.options;Mt.setOptions;Mt.use;Mt.walkTokens;Mt.parseInline;Ds.parse;Rs.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 e1(l){if(Array.isArray(l))return l}function t1(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 n1(){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 l1(l,s){return e1(l)||t1(l,s)||s1(l,s)||n1()}function s1(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,a1=Object.isFrozen,i1=Object.getPrototypeOf,r1=Object.getOwnPropertyDescriptor;let il=Object.freeze,rl=Object.seal,bc=Object.create,A_=typeof Reflect<"u"&&Reflect,dp=A_.apply,hp=A_.construct;il||(il=function(s){return s});rl||(rl=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 hc=Gn(Array.prototype.forEach),c1=Gn(Array.prototype.lastIndexOf),Kx=Gn(Array.prototype.pop),pc=Gn(Array.prototype.push),o1=Gn(Array.prototype.splice),Bi=Array.isArray,Fo=Gn(String.prototype.toLowerCase),$h=Gn(String.prototype.toString),Zx=Gn(String.prototype.match),Go=Gn(String.prototype.replace),Fx=Gn(String.prototype.indexOf),u1=Gn(String.prototype.trim),f1=Gn(Number.prototype.toString),d1=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),Yo=Gn(Object.prototype.toString),Jn=Gn(RegExp.prototype.test),hr=h1(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 h1(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 gt(l,s){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Fo;if(Qx&&Qx(l,null),!Bi(s))return l;let c=s.length;for(;c--;){let o=s[c];if(typeof o=="string"){const d=r(o);d!==o&&(a1(s)||(s[c]=d),o=d)}l[o]=!0}return l}function p1(l){for(let s=0;s<l.length;s++)Pn(l,s)||(l[s]=null);return l}function jl(l){const s=bc(null);for(const c of C_(l)){var r=l1(c,2);const o=r[0],d=r[1];Pn(l,o)&&(Bi(d)?s[o]=p1(d):d&&typeof d=="object"&&d.constructor===Object?s[o]=jl(d):s[o]=d)}return s}function m1(l){switch(typeof l){case"string":return l;case"number":return f1(l);case"boolean":return d1(l);case"bigint":return Jx?Jx(l):"0";case"symbol":return Px?Px(l):"Symbol()";case"undefined":return Yo(l);case"function":case"object":{if(l===null)return Yo(l);const s=l,r=aa(s,"toString");if(typeof r=="function"){const c=r(s);return typeof c=="string"?c:Yo(c)}return Yo(l)}default:return Yo(l)}}function aa(l,s){for(;l!==null;){const c=r1(l,s);if(c){if(c.get)return Gn(c.get);if(typeof c.value=="function")return Gn(c.value)}l=i1(l)}function r(){return null}return r}function g1(l){try{return Jn(l,""),!0}catch{return!1}}const Wx=il(["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"]),Xh=il(["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"]),Vh=il(["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"]),x1=il(["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"]),Qh=il(["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"]),b1=il(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),eb=il(["#text"]),tb=il(["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"]),Kh=il(["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=il(["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"]),bf=il(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),_1=rl(/{{[\w\W]*|^[\w\W]*}}/g),y1=rl(/<%[\w\W]*|^[\w\W]*%>/g),v1=rl(/\${[\w\W]*/g),j1=rl(/^data-[\-\w.\u00B7-\uFFFF]+$/),w1=rl(/^aria-[\-\w]+$/),lb=rl(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),S1=rl(/^(?:\w+script|data):/i),N1=rl(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),k1=rl(/^html$/i),T1=rl(/^[a-z][.\w]*(-[.\w]+)+$/i),sb=rl(/<[/\w!]/g),ab=rl(/<[/\w]/g),E1=rl(/<\/no(script|embed|frames)/i),C1=rl(/\/>/i),ns={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},A1=function(){return typeof window>"u"?null:window},M1=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:[]}},Oi=function(s,r,c,o){return Pn(s,r)&&Bi(s[r])?gt(o.base?jl(o.base):{},s[r],o.transform):c};function M_(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:A1();const s=ge=>M_(ge);if(s.version="3.4.12",s.removed=[],!l||!l.document||l.document.nodeType!==ns.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,C=aa(v,"cloneNode"),T=aa(v,"remove"),E=aa(v,"nextSibling"),M=aa(v,"childNodes"),I=aa(v,"parentNode"),F=aa(v,"shadowRoot"),J=aa(v,"attributes"),H=h&&h.prototype?aa(h.prototype,"nodeType"):null,B=h&&h.prototype?aa(h.prototype,"nodeName"):null;if(typeof d=="function"){const ge=r.createElement("template");ge.content&&ge.content.ownerDocument&&(r=ge.content.ownerDocument)}let D,V="",X,A=!1,L=0;const Y=function(){if(L>0)throw hr('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.')},ie=function(k){Y(),L++;try{return D.createHTML(k)}finally{L--}},xe=function(k){Y(),L++;try{return D.createScriptURL(k)}finally{L--}},Se=function(){return A||(X=M1(j,o),A=!0),X},ve=r,Q=ve.implementation,fe=ve.createNodeIterator,ue=ve.createDocumentFragment,_e=ve.getElementsByTagName,Me=c.importNode;let w=ib();s.isSupported=typeof C_=="function"&&typeof I=="function"&&Q&&Q.createHTMLDocument!==void 0;const Z=_1,z=y1,me=v1,ye=j1,Re=w1,Oe=S1,Ue=N1,Be=T1;let on=lb,Ke=null;const Jt=gt({},[...Wx,...Xh,...Vh,...Qh,...eb]);let ft=null;const mt=gt({},[...tb,...Kh,...nb,...bf]);let Ie=Object.seal(bc(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}})),un=null,Sn=null;const ct=Object.seal(bc(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Nn=!0,Wn=!0,fn=!1,el=!0,Bt=!1,at=!0,Rt=!1,Yn=!1,Tt=null,et=null,rt=!1,pn=!1,bn=!1,Kn=!1,en=!0,St=!1;const Pt="user-content-";let Dt=!0,$n=!1,le={},pe=null;const qe=gt({},["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 Ve=gt({},["audio","video","img","source","image","track"]);let bt=null;const $=gt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),se="http://www.w3.org/1998/Math/MathML",Ce="http://www.w3.org/2000/svg",Le="http://www.w3.org/1999/xhtml";let _t=Le,Xn=!1,Zn=null;const Hl=gt({},[se,Ce,Le],$h),bl=il(["mi","mo","mn","ms","mtext"]);let Bl=gt({},bl);const ls=il(["annotation-xml"]);let ss=gt({},ls);const Ka=gt({},["title","style","font","a","script"]);let Il=null;const tl=["application/xhtml+xml","text/html"],Ot="text/html";let Ze=null,On=null;const Xt=r.createElement("form"),wl=function(k){return k instanceof RegExp||k instanceof Function},cl=function(){let k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(On&&On===k)return;(!k||typeof k!="object")&&(k={}),k=jl(k),Il=tl.indexOf(k.PARSER_MEDIA_TYPE)===-1?Ot:k.PARSER_MEDIA_TYPE,Ze=Il==="application/xhtml+xml"?$h:Fo,Ke=Oi(k,"ALLOWED_TAGS",Jt,{transform:Ze}),ft=Oi(k,"ALLOWED_ATTR",mt,{transform:Ze}),Zn=Oi(k,"ALLOWED_NAMESPACES",Hl,{transform:$h}),bt=Oi(k,"ADD_URI_SAFE_ATTR",$,{transform:Ze,base:$}),Fe=Oi(k,"ADD_DATA_URI_TAGS",Ve,{transform:Ze,base:Ve}),pe=Oi(k,"FORBID_CONTENTS",qe,{transform:Ze}),un=Oi(k,"FORBID_TAGS",jl({}),{transform:Ze}),Sn=Oi(k,"FORBID_ATTR",jl({}),{transform:Ze}),le=Pn(k,"USE_PROFILES")?k.USE_PROFILES&&typeof k.USE_PROFILES=="object"?jl(k.USE_PROFILES):k.USE_PROFILES:!1,Nn=k.ALLOW_ARIA_ATTR!==!1,Wn=k.ALLOW_DATA_ATTR!==!1,fn=k.ALLOW_UNKNOWN_PROTOCOLS||!1,el=k.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Bt=k.SAFE_FOR_TEMPLATES||!1,at=k.SAFE_FOR_XML!==!1,Rt=k.WHOLE_DOCUMENT||!1,pn=k.RETURN_DOM||!1,bn=k.RETURN_DOM_FRAGMENT||!1,Kn=k.RETURN_TRUSTED_TYPE||!1,rt=k.FORCE_BODY||!1,en=k.SANITIZE_DOM!==!1,St=k.SANITIZE_NAMED_PROPS||!1,Dt=k.KEEP_CONTENT!==!1,$n=k.IN_PLACE||!1,on=g1(k.ALLOWED_URI_REGEXP)?k.ALLOWED_URI_REGEXP:lb,_t=typeof k.NAMESPACE=="string"?k.NAMESPACE:Le,Bl=Pn(k,"MATHML_TEXT_INTEGRATION_POINTS")&&k.MATHML_TEXT_INTEGRATION_POINTS&&typeof k.MATHML_TEXT_INTEGRATION_POINTS=="object"?jl(k.MATHML_TEXT_INTEGRATION_POINTS):gt({},bl),ss=Pn(k,"HTML_INTEGRATION_POINTS")&&k.HTML_INTEGRATION_POINTS&&typeof k.HTML_INTEGRATION_POINTS=="object"?jl(k.HTML_INTEGRATION_POINTS):gt({},ls);const K=Pn(k,"CUSTOM_ELEMENT_HANDLING")&&k.CUSTOM_ELEMENT_HANDLING&&typeof k.CUSTOM_ELEMENT_HANDLING=="object"?jl(k.CUSTOM_ELEMENT_HANDLING):bc(null);if(Ie=bc(null),Pn(K,"tagNameCheck")&&wl(K.tagNameCheck)&&(Ie.tagNameCheck=K.tagNameCheck),Pn(K,"attributeNameCheck")&&wl(K.attributeNameCheck)&&(Ie.attributeNameCheck=K.attributeNameCheck),Pn(K,"allowCustomizedBuiltInElements")&&typeof K.allowCustomizedBuiltInElements=="boolean"&&(Ie.allowCustomizedBuiltInElements=K.allowCustomizedBuiltInElements),rl(Ie),Bt&&(Wn=!1),bn&&(pn=!0),le&&(Ke=gt({},eb),ft=bc(null),le.html===!0&&(gt(Ke,Wx),gt(ft,tb)),le.svg===!0&&(gt(Ke,Xh),gt(ft,Kh),gt(ft,bf)),le.svgFilters===!0&&(gt(Ke,Vh),gt(ft,Kh),gt(ft,bf)),le.mathMl===!0&&(gt(Ke,Qh),gt(ft,nb),gt(ft,bf))),ct.tagCheck=null,ct.attributeCheck=null,Pn(k,"ADD_TAGS")&&(typeof k.ADD_TAGS=="function"?ct.tagCheck=k.ADD_TAGS:Bi(k.ADD_TAGS)&&(Ke===Jt&&(Ke=jl(Ke)),gt(Ke,k.ADD_TAGS,Ze))),Pn(k,"ADD_ATTR")&&(typeof k.ADD_ATTR=="function"?ct.attributeCheck=k.ADD_ATTR:Bi(k.ADD_ATTR)&&(ft===mt&&(ft=jl(ft)),gt(ft,k.ADD_ATTR,Ze))),Pn(k,"ADD_URI_SAFE_ATTR")&&Bi(k.ADD_URI_SAFE_ATTR)&&gt(bt,k.ADD_URI_SAFE_ATTR,Ze),Pn(k,"FORBID_CONTENTS")&&Bi(k.FORBID_CONTENTS)&&(pe===qe&&(pe=jl(pe)),gt(pe,k.FORBID_CONTENTS,Ze)),Pn(k,"ADD_FORBID_CONTENTS")&&Bi(k.ADD_FORBID_CONTENTS)&&(pe===qe&&(pe=jl(pe)),gt(pe,k.ADD_FORBID_CONTENTS,Ze)),Dt&&(Ke["#text"]=!0),Rt&&gt(Ke,["html","head","body"]),Ke.table&&(gt(Ke,["tbody"]),delete un.tbody),k.TRUSTED_TYPES_POLICY){if(typeof k.TRUSTED_TYPES_POLICY.createHTML!="function")throw hr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof k.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw hr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const he=D;D=k.TRUSTED_TYPES_POLICY;try{V=ie("")}catch(Te){throw D=he,Te}}else k.TRUSTED_TYPES_POLICY===null?(D=void 0,V=""):(D===void 0&&(D=Se()),D&&typeof V=="string"&&(V=ie("")));il&&il(k),On=k},tn=gt({},[...Xh,...Vh,...x1]),ol=gt({},[...Qh,...b1]),_n=function(k,K,he){return K.namespaceURI===Le?k==="svg":K.namespaceURI===se?k==="svg"&&(he==="annotation-xml"||Bl[he]):!!tn[k]},Sl=function(k,K,he){return K.namespaceURI===Le?k==="math":K.namespaceURI===Ce?k==="math"&&ss[he]:!!ol[k]},We=function(k,K,he){return K.namespaceURI===Ce&&!ss[he]||K.namespaceURI===se&&!Bl[he]?!1:!ol[k]&&(Ka[k]||!tn[k])},ql=function(k){let K=I(k);(!K||!K.tagName)&&(K={namespaceURI:_t,tagName:"template"});const he=Fo(k.tagName),Te=Fo(K.tagName);return Zn[k.namespaceURI]?k.namespaceURI===Ce?_n(he,K,Te):k.namespaceURI===se?Sl(he,K,Te):k.namespaceURI===Le?We(he,K,Te):!!(Il==="application/xhtml+xml"&&Zn[k.namespaceURI]):!1},tt=function(k){pc(s.removed,{element:k});try{I(k).removeChild(k)}catch{if(T(k),!I(k))throw hr("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Et=function(k){kn(k);const K=M(k);if(K){const Te=[];hc(K,Ee=>{pc(Te,Ee)}),hc(Te,Ee=>{try{T(Ee)}catch{}})}const he=J(k);if(he)for(let Te=he.length-1;Te>=0;--Te){const Ee=he[Te],He=Ee&&Ee.name;if(typeof He=="string")try{k.removeAttribute(He)}catch{}}},It=function(k,K){try{pc(s.removed,{attribute:K.getAttributeNode(k),from:K})}catch{pc(s.removed,{attribute:null,from:K})}if(K.removeAttribute(k),k==="is")if(pn||bn)try{tt(K)}catch{}else try{K.setAttribute(k,"")}catch{}},Gl=function(k){const K=J(k);if(K)for(let he=K.length-1;he>=0;--he){const Te=K[he],Ee=Te&&Te.name;if(!(typeof Ee!="string"||ft[Ze(Ee)]))try{k.removeAttribute(Ee)}catch{}}},kn=function(k){const K=[k];for(;K.length>0;){const he=K.pop();(H?H(he):he.nodeType)===ns.element&&Gl(he);const Ee=M(he);if(Ee)for(let He=Ee.length-1;He>=0;--He)K.push(Ee[He])}},ul=function(k){if(!at)return;const K=[k];for(;K.length>0;){const he=K.pop(),Te=H?H(he):he.nodeType;if(Te===ns.processingInstruction||Te===ns.comment&&Jn(ab,he.data)){try{T(he)}catch{}continue}if(Te===ns.element){const He=he,Ye=Ze(B?B(he):he.nodeName);try{He.hasAttribute&&He.hasAttribute("patchsrc")&&He.removeAttribute("patchsrc"),He.hasAttribute&&He.hasAttribute("for")&&Ye!=="label"&&Ye!=="output"&&He.removeAttribute("for")}catch{}}const Ee=M(he);if(Ee)for(let He=Ee.length-1;He>=0;--He)K.push(Ee[He])}},as=function(k){let K=null,he=null;if(rt)k="<remove></remove>"+k;else{const He=Zx(k,/^[\r\n\t ]+/);he=He&&He[0]}Il==="application/xhtml+xml"&&_t===Le&&(k='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+k+"</body></html>");const Te=D?ie(k):k;if(_t===Le)try{K=new y().parseFromString(Te,Il)}catch{}if(!K||!K.documentElement){K=Q.createDocument(_t,"template",null);try{K.documentElement.innerHTML=Xn?V:Te}catch{}}const Ee=K.body||K.documentElement;return k&&he&&Ee.insertBefore(r.createTextNode(he),Ee.childNodes[0]||null),_t===Le?_e.call(K,Rt?"html":"body")[0]:Rt?K.documentElement:Ee},Tn=function(k){return fe.call(k.ownerDocument||k,k,g.SHOW_ELEMENT|g.SHOW_COMMENT|g.SHOW_TEXT|g.SHOW_PROCESSING_INSTRUCTION|g.SHOW_CDATA_SECTION,null)},nn=function(k){return k=Go(k,Z," "),k=Go(k,z," "),k=Go(k,me," "),k},Yl=function(k){var K;k.normalize();const he=fe.call(k.ownerDocument||k,k,g.SHOW_TEXT|g.SHOW_COMMENT|g.SHOW_CDATA_SECTION|g.SHOW_PROCESSING_INSTRUCTION,null);let Te=he.nextNode();for(;Te;)Te.data=nn(Te.data),Te=he.nextNode();const Ee=(K=k.querySelectorAll)===null||K===void 0?void 0:K.call(k,"template");Ee&&hc(Ee,He=>{fl(He.content)&&Yl(He.content)})},Vt=function(k){const K=B?B(k):null;return typeof K!="string"||Ze(K)!=="form"?!1:typeof k.nodeName!="string"||typeof k.textContent!="string"||typeof k.removeChild!="function"||k.attributes!==J(k)||typeof k.removeAttribute!="function"||typeof k.setAttribute!="function"||typeof k.namespaceURI!="string"||typeof k.insertBefore!="function"||typeof k.hasChildNodes!="function"||k.nodeType!==H(k)||k.childNodes!==M(k)},fl=function(k){if(!H||typeof k!="object"||k===null)return!1;try{return H(k)===ns.documentFragment}catch{return!1}},En=function(k){if(!H||typeof k!="object"||k===null)return!1;try{return typeof H(k)=="number"}catch{return!1}};function Ct(ge,k,K){ge.length!==0&&hc(ge,he=>{he.call(s,k,K,On)})}const Za=function(k,K){return!!(at&&k.hasChildNodes()&&!En(k.firstElementChild)&&Jn(sb,k.textContent)&&Jn(sb,k.innerHTML)||at&&k.namespaceURI===Le&&K==="style"&&En(k.firstElementChild)||k.nodeType===ns.processingInstruction||at&&k.nodeType===ns.comment&&Jn(ab,k.data))},Ls=function(k,K){if(!un[K]&&rs(K)&&(Ie.tagNameCheck instanceof RegExp&&Jn(Ie.tagNameCheck,K)||Ie.tagNameCheck instanceof Function&&Ie.tagNameCheck(K)))return!1;if(Dt&&!pe[K]){const he=I(k),Te=M(k);if(Te&&he){const Ee=Te.length;for(let He=Ee-1;He>=0;--He){const Ye=$n?Te[He]:C(Te[He],!0);he.insertBefore(Ye,E(k))}}}return tt(k),!0},is=function(k,K){if(Ct(w.beforeSanitizeElements,k,null),k!==K&&I(k)===null)return!0;if(Vt(k))return tt(k),!0;const he=Ze(B?B(k):k.nodeName);if(Ct(w.uponSanitizeElement,k,{tagName:he,allowedTags:Ke}),k!==K&&I(k)===null)return!0;if(Za(k,he))return tt(k),!0;if(un[he]||!(ct.tagCheck instanceof Function&&ct.tagCheck(he))&&!Ke[he]){const Ee=Ls(k,he);return Ee===!1&&Ct(w.afterSanitizeElements,k,null),Ee}if((H?H(k):k.nodeType)===ns.element&&!ql(k)||(he==="noscript"||he==="noembed"||he==="noframes")&&Jn(E1,k.innerHTML))return tt(k),!0;if(Bt&&k.nodeType===ns.text){const Ee=nn(k.textContent);k.textContent!==Ee&&(pc(s.removed,{element:k.cloneNode()}),k.textContent=Ee)}return Ct(w.afterSanitizeElements,k,null),!1},Ln=function(k,K,he){if(Sn[K]||at&&K==="patchsrc"||at&&K==="for"&&k!=="label"&&k!=="output"||en&&(K==="id"||K==="name")&&(he in r||he in Xt))return!1;const Te=ft[K]||ct.attributeCheck instanceof Function&&ct.attributeCheck(K,k);if(!(Wn&&Jn(ye,K))){if(!(Nn&&Jn(Re,K))){if(Te){if(!bt[K]){if(!Jn(on,Go(he,Ue,""))){if(!((K==="src"||K==="xlink:href"||K==="href")&&k!=="script"&&Fx(he,"data:")===0&&Fe[k])){if(!(fn&&!Jn(Oe,Go(he,Ue,"")))){if(he)return!1}}}}}else if(!(rs(k)&&(Ie.tagNameCheck instanceof RegExp&&Jn(Ie.tagNameCheck,k)||Ie.tagNameCheck instanceof Function&&Ie.tagNameCheck(k))&&(Ie.attributeNameCheck instanceof RegExp&&Jn(Ie.attributeNameCheck,K)||Ie.attributeNameCheck instanceof Function&&Ie.attributeNameCheck(K,k))||K==="is"&&Ie.allowCustomizedBuiltInElements&&(Ie.tagNameCheck instanceof RegExp&&Jn(Ie.tagNameCheck,he)||Ie.tagNameCheck instanceof Function&&Ie.tagNameCheck(he))))return!1}}return!0},$l=gt({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),rs=function(k){return!$l[Fo(k)]&&Jn(Be,k)},yn=function(k,K,he,Te){if(D&&typeof j=="object"&&typeof j.getAttributeType=="function"&&!he)switch(j.getAttributeType(k,K)){case"TrustedHTML":return ie(Te);case"TrustedScriptURL":return xe(Te)}return Te},zs=function(k,K,he,Te){try{he?k.setAttributeNS(he,K,Te):k.setAttribute(K,Te),Vt(k)?tt(k):Kx(s.removed)}catch{It(K,k)}},da=function(k){Ct(w.beforeSanitizeAttributes,k,null);const K=k.attributes;if(!K||Vt(k))return;const he={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ft,forceKeepAttr:void 0};let Te=K.length;const Ee=Ze(k.nodeName);for(;Te--;){const He=K[Te],Ye=He.name,Wt=He.namespaceURI,Qt=He.value,yt=Ze(Ye),mn=Qt;let Kt=Ye==="value"?mn:u1(mn);if(he.attrName=yt,he.attrValue=Kt,he.keepAttr=!0,he.forceKeepAttr=void 0,Ct(w.uponSanitizeAttribute,k,he),Kt=he.attrValue,St&&(yt==="id"||yt==="name")&&Fx(Kt,Pt)!==0&&(It(Ye,k),Kt=Pt+Kt),at&&Jn(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Kt)){It(Ye,k);continue}if(yt==="attributename"&&Zx(Kt,"href")){It(Ye,k);continue}if(!he.forceKeepAttr){if(!he.keepAttr){It(Ye,k);continue}if(!el&&Jn(C1,Kt)){It(Ye,k);continue}if(Bt&&(Kt=nn(Kt)),!Ln(Ee,yt,Kt)){It(Ye,k);continue}Kt=yn(Ee,yt,Wt,Kt),Kt!==mn&&zs(k,Ye,Wt,Kt)}}Ct(w.afterSanitizeAttributes,k,null)},Nl=function(k){let K=null;const he=Tn(k);for(Ct(w.beforeSanitizeShadowDOM,k,null);K=he.nextNode();)if(Ct(w.uponSanitizeShadowNode,K,null),is(K,k),da(K),fl(K.content)&&Nl(K.content),(H?H(K):K.nodeType)===ns.element){const Ee=F(K);fl(Ee)&&(kl(Ee),Nl(Ee))}Ct(w.afterSanitizeShadowDOM,k,null)},kl=function(k){const K=[{node:k,shadow:null}];for(;K.length>0;){const he=K.pop();if(he.shadow){Nl(he.shadow);continue}const Te=he.node,He=(H?H(Te):Te.nodeType)===ns.element,Ye=M(Te);if(Ye)for(let Wt=Ye.length-1;Wt>=0;--Wt)K.push({node:Ye[Wt],shadow:null});if(He){const Wt=B?B(Te):null;if(typeof Wt=="string"&&Ze(Wt)==="template"){const Qt=Te.content;fl(Qt)&&K.push({node:Qt,shadow:null})}}if(He){const Wt=F(Te);fl(Wt)&&K.push({node:null,shadow:Wt},{node:Wt,shadow:null})}}};return s.sanitize=function(ge){let k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},K=null,he=null,Te=null,Ee=null;if(Xn=!ge,Xn&&(ge="<!-->"),typeof ge!="string"&&!En(ge)&&(ge=m1(ge),typeof ge!="string"))throw hr("dirty is not a string, aborting");if(!s.isSupported)return ge;Yn?(Ke=Tt,ft=et):cl(k),(w.uponSanitizeElement.length>0||w.uponSanitizeAttribute.length>0)&&(Ke=jl(Ke)),w.uponSanitizeAttribute.length>0&&(ft=jl(ft)),s.removed=[];const He=$n&&typeof ge!="string"&&En(ge);if(He){ul(ge);const yt=B?B(ge):ge.nodeName;if(typeof yt=="string"){const mn=Ze(yt);if(!Ke[mn]||un[mn])throw Et(ge),hr("root node is forbidden and cannot be sanitized in-place")}if(Vt(ge))throw Et(ge),hr("root node is clobbered and cannot be sanitized in-place");try{kl(ge)}catch(mn){throw Et(ge),mn}}else if(En(ge))K=as("<!---->"),he=K.ownerDocument.importNode(ge,!0),he.nodeType===ns.element&&he.nodeName==="BODY"||he.nodeName==="HTML"?K=he:K.appendChild(he),kl(he);else{if(!pn&&!Bt&&!Rt&&ge.indexOf("<")===-1)return D&&Kn?ie(ge):ge;if(K=as(ge),!K)return pn?null:Kn?V:""}K&&rt&&tt(K.firstChild);const Ye=He?ge:K,Wt=Tn(Ye);try{for(;Te=Wt.nextNode();)is(Te,Ye),da(Te),fl(Te.content)&&Nl(Te.content)}catch(yt){throw He&&(Et(ge),hc(s.removed,mn=>{mn.element&&kn(mn.element)})),yt}if(He)return hc(s.removed,yt=>{yt.element&&kn(yt.element)}),Bt&&Yl(ge),ge;if(pn){if(Bt&&Yl(K),bn)for(Ee=ue.call(K.ownerDocument);K.firstChild;)Ee.appendChild(K.firstChild);else Ee=K;return(ft.shadowroot||ft.shadowrootmode)&&(Ee=Me.call(c,Ee,!0)),Ee}let Qt=Rt?K.outerHTML:K.innerHTML;return Rt&&Ke["!doctype"]&&K.ownerDocument&&K.ownerDocument.doctype&&K.ownerDocument.doctype.name&&Jn(k1,K.ownerDocument.doctype.name)&&(Qt="<!DOCTYPE "+K.ownerDocument.doctype.name+`>
116
+ `+Qt),Bt&&(Qt=nn(Qt)),D&&Kn?ie(Qt):Qt},s.setConfig=function(){let ge=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};cl(ge),Yn=!0,Tt=Ke,et=ft},s.clearConfig=function(){On=null,Yn=!1,Tt=null,et=null,D=X,V=""},s.isValidAttribute=function(ge,k,K){On||cl({});const he=Ze(ge),Te=Ze(k);return Ln(he,Te,K)},s.addHook=function(ge,k){typeof k=="function"&&Pn(w,ge)&&pc(w[ge],k)},s.removeHook=function(ge,k){if(Pn(w,ge)){if(k!==void 0){const K=c1(w[ge],k);return K===-1?void 0:o1(w[ge],K,1)[0]}return Kx(w[ge])}},s.removeHooks=function(ge){Pn(w,ge)&&(w[ge]=[])},s.removeAllHooks=function(){w=ib()},s}var R1=M_();const D1=1024;let O1=0;class ys{constructor(s,r){this.from=s,this.to=r}}class cn{constructor(s={}){this.id=O1++,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=Os.match(s)),r=>{let c=s(r);return c===void 0?null:[this,c]}}}cn.closedBy=new cn({deserialize:l=>l.split(" ")});cn.openedBy=new cn({deserialize:l=>l.split(" ")});cn.group=new cn({deserialize:l=>l.split(" ")});cn.isolate=new cn({deserialize:l=>{if(l&&l!="rtl"&&l!="ltr"&&l!="auto")throw new RangeError("Invalid value for isolate: "+l);return l||"auto"}});cn.contextHash=new cn({perNode:!0});cn.lookAhead=new cn({perNode:!0});cn.mounted=new cn({perNode:!0});class jc{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[cn.mounted.id]}}const L1=Object.create(null);class Os{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):L1,c=(s.top?1:0)|(s.skipped?2:0)|(s.error?4:0)|(s.name==null?8:0),o=new Os(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(cn.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(cn.group),d=-1;d<(o?o.length:0);d++){let h=r[d<0?c.name:o[d]];if(h)return h}}}}Os.none=new Os("",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 Os(c.name,o,c.id,c.flags):c)}return new R_(r)}}const _f=new WeakMap,rb=new WeakMap;var an;(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"})(an||(an={}));class Ul{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=jc.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 Xf(this.topNode,s)}cursorAt(s,r=0,c=0){let o=_f.get(this)||this.topNode,d=new Xf(o);return d.moveTo(s,r),_f.set(this,d._tree),d}get topNode(){return new xl(this,0,0,null)}resolve(s,r=0){let c=Wo(_f.get(this)||this.topNode,s,r,!1);return _f.set(this,c),c}resolveInner(s,r=0){let c=Wo(rb.get(this)||this.topNode,s,r,!0);return rb.set(this,c),c}resolveStack(s,r=0){return H1(this,s,r)}iterate(s){let{enter:r,leave:c,from:o=0,to:d=this.length}=s,h=s.mode||0,m=(h&an.IncludeAnonymous)>0;for(let g=this.cursor(h|an.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(Os.none,this.children,this.positions,0,this.children.length,0,this.length,(r,c,o)=>new Ul(this.type,r,c,o,this.propValues),s.makeTree||((r,c,o)=>new Ul(Os.none,r,c,o)))}static build(s){return B1(s)}}Ul.empty=new Ul(Os.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 Yi{constructor(s,r,c){this.buffer=s,this.length=r,this.set=c}get type(){return Os.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 Yi(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 Wo(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 xl&&l.index<0?null:l.parent;if(!h)return l;l=h}let d=c?0:an.IgnoreOverlays;if(c)for(let h=l,m=h.parent;m;h=m,m=h.parent)h instanceof xl&&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 Xf(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 Wo(this,s,r,!1)}resolveInner(s,r=0){return Wo(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 xl 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&an.EnterBracketed&&y instanceof Ul&&(v=jc.get(y))&&!v.overlay&&v.bracketed&&c>=j&&c<=j+y.length)&&!D_(o,c,j,j+y.length))){if(y instanceof Yi){if(d&an.ExcludeBuffers)continue;let C=y.findChild(0,y.buffer.length,r,c-j,o);if(C>-1)return new ua(new z1(h,y,s,j),null,C)}else if(d&an.IncludeAnonymous||!y.type.isAnonymous||Rp(y)){let C;if(!(d&an.IgnoreMounts)&&(C=jc.get(y))&&!C.overlay)return new xl(C.tree,j,s,h);let T=new xl(y,j,s,h);return d&an.IncludeAnonymous||!T.type.isAnonymous?T:T.nextChild(r<0?y.children.length-1:0,r,c,o,d)}}}if(d&an.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&an.IgnoreOverlays)&&(o=jc.get(this._tree))&&o.overlay){let d=s-this.from,h=c&an.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 xl(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 z1{constructor(s,r,c,o){this.parent=s,this.buffer=r,this.index=c,this.start=o}}class ua 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 ua(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&an.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 ua(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 ua(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 ua(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 Ul(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 xl&&r.index<0?null:r.parent,o=l.slice();return c?o[s]=c:o.splice(s,1),new U1(o,r)}class U1{constructor(s,r){this.heads=s,this.node=r}get next(){return L_(this.heads)}}function H1(l,s,r){let c=l.resolveInner(s,r),o=null;for(let d=c instanceof xl?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=jc.get(d.tree);if(h&&h.overlay&&h.overlay[0].from<=s&&h.overlay[h.overlay.length-1].to>=s){let m=new xl(h.tree,h.overlay[0].from+d.from,-1,d);(o||(o=[c])).push(Wo(m,s,r,!1))}}return o?L_(o):c}class Xf{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&~an.EnterBracketed,s instanceof xl)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 xl?(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&an.ExcludeBuffers?!1:this.enterChild(1,s,r):this.yield(this._tree.enter(s,r,c))}parent(){if(!this.buffer)return this.yieldNode(this.mode&an.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let s=this.mode&an.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&an.IncludeAnonymous||m instanceof Yi||!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 ua(this.buffer,r,this.stack[o]);return this.bufferNode=new ua(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 Yi||!s.type.isAnonymous||Rp(s))}function B1(l){var s;let{buffer:r,nodeSet:c,maxBufferLength:o=D1,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,V,X,A,L){let{id:Y,start:ie,end:xe,size:Se}=m,ve=y,Q=x;if(Se<0)if(m.next(),Se==-1){let w=d[Y];V.push(w),X.push(ie-B);return}else if(Se==-3){x=Y;return}else if(Se==-4){y=Y;return}else throw new RangeError(`Unrecognized record size: ${Se}`);let fe=g[Y],ue,_e,Me=ie-B;if(xe-ie<=o&&(_e=M(m.pos-D,A))){let w=new Uint16Array(_e.size-_e.skip),Z=m.pos-_e.size,z=w.length;for(;m.pos>Z;)z=I(_e.start,w,z);ue=new Yi(w,xe-_e.start,c),Me=_e.start-B}else{let w=m.pos-Se;m.next();let Z=[],z=[],me=Y>=h?Y:-1,ye=0,Re=xe;for(;m.pos>w;)me>=0&&m.id==me&&m.size>=0?(m.end<=Re-o&&(T(Z,z,ie,ye,m.end,Re,me,ve,Q),ye=Z.length,Re=m.end),m.next()):L>2500?v(ie,w,Z,z):j(ie,w,Z,z,me,L+1);if(me>=0&&ye>0&&ye<Z.length&&T(Z,z,ie,ye,ie,Re,me,ve,Q),Z.reverse(),z.reverse(),me>-1&&ye>0){let Oe=C(fe,Q);ue=Dp(fe,Z,z,0,Z.length,0,xe-ie,Oe,Oe)}else ue=E(fe,Z,z,xe-ie,ve-xe,Q)}V.push(ue),X.push(Me)}function v(B,D,V,X){let A=[],L=0,Y=-1;for(;m.pos>D;){let{id:ie,start:xe,end:Se,size:ve}=m;if(ve>4)m.next();else{if(Y>-1&&xe<Y)break;Y<0&&(Y=Se-o),A.push(ie,xe,Se),L++,m.next()}}if(L){let ie=new Uint16Array(L*4),xe=A[A.length-2];for(let Se=A.length-3,ve=0;Se>=0;Se-=3)ie[ve++]=A[Se],ie[ve++]=A[Se+1]-xe,ie[ve++]=A[Se+2]-xe,ie[ve++]=ve;V.push(new Yi(ie,A[2]-xe,c)),X.push(xe-B)}}function C(B,D){return(V,X,A)=>{let L=0,Y=V.length-1,ie,xe;if(Y>=0&&(ie=V[Y])instanceof Ul){if(!Y&&ie.type==B&&ie.length==A)return ie;(xe=ie.prop(cn.lookAhead))&&(L=X[Y]+ie.length+xe)}return E(B,V,X,A,L,D)}}function T(B,D,V,X,A,L,Y,ie,xe){let Se=[],ve=[];for(;B.length>X;)Se.push(B.pop()),ve.push(D.pop()+V-A);B.push(E(c.types[Y],Se,ve,L-A,ie-L,xe)),D.push(A-V)}function E(B,D,V,X,A,L,Y){if(L){let ie=[cn.contextHash,L];Y=Y?[ie].concat(Y):[ie]}if(A>25){let ie=[cn.lookAhead,A];Y=Y?[ie].concat(Y):[ie]}return new Ul(B,D,V,X,Y)}function M(B,D){let V=m.fork(),X=0,A=0,L=0,Y=V.end-o,ie={size:0,start:0,skip:0};e:for(let xe=V.pos-B;V.pos>xe;){let Se=V.size;if(V.id==D&&Se>=0){ie.size=X,ie.start=A,ie.skip=L,L+=4,X+=4,V.next();continue}let ve=V.pos-Se;if(Se<0||ve<xe||V.start<Y)break;let Q=V.id>=h?4:0,fe=V.start;for(V.next();V.pos>ve;){if(V.size<0)if(V.size==-3||V.size==-4)Q+=4;else break e;else V.id>=h&&(Q+=4);V.next()}A=fe,X+=Se,L+=Q}return(D<0||X==B)&&(ie.size=X,ie.start=A,ie.skip=L),ie.size>4?ie:void 0}function I(B,D,V){let{id:X,start:A,end:L,size:Y}=m;if(m.next(),Y>=0&&X<h){let ie=V;if(Y>4){let xe=m.pos-(Y-4);for(;m.pos>xe;)V=I(B,D,V)}D[--V]=ie,D[--V]=L-B,D[--V]=A-B,D[--V]=X}else Y==-3?x=X:Y==-4&&(y=X);return V}let F=[],J=[];for(;m.pos>0;)j(l.start||0,l.bufferStart||0,F,J,-1,0);let H=(s=l.length)!==null&&s!==void 0?s:F.length?J[0]+F[0].length:0;return new Ul(g[l.topID],F.reverse(),J.reverse(),H)}const ob=new WeakMap;function If(l,s){if(!l.isAnonymous||s instanceof Yi||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 Ul)){r=1;break}r+=If(l,c)}ob.set(s,r)}return r}function Dp(l,s,r,c,o,d,h,m,g){let x=0;for(let T=c;T<o;T++)x+=If(l,s[T]);let y=Math.ceil(x*1.5/8),j=[],v=[];function C(T,E,M,I,F){for(let J=M;J<I;){let H=J,B=E[J],D=If(l,T[J]);for(J++;J<I;J++){let V=If(l,T[J]);if(D+V>=y)break;D+=V}if(J==H+1){if(D>y){let V=T[H];C(V.children,V.positions,0,V.children.length,E[H]+F);continue}j.push(T[H])}else{let V=E[J-1]+T[J-1].length-B;j.push(Dp(l,T,E,H,J,B,V,null,g))}v.push(B+F-d)}}return C(s,r,c,o,0),(m||g)(j,v,h)}class $k{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 ua?this.setBuffer(s.context.buffer,s.index,r):s instanceof xl&&this.map.set(s.tree,r)}get(s){return s instanceof ua?this.getBuffer(s.context.buffer,s.index):s instanceof xl?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 eu{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 eu(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 C=Math.max(v.from,g)-x,T=Math.min(v.to,j)-x;v=C>=T?null:new eu(C,T,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 Xk{startParse(s,r,c){return typeof s=="string"&&(s=new I1(s)),c=c?c.length?c.map(o=>new ys(o.from,o.to)):[new ys(0,0)]:[new ys(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 I1{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 Vk(l){return(s,r,c,o)=>new G1(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 q1{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 cn({perNode:!0});class G1{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 Ul(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[cn.mounted.id]=new jc(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 X1(this.fragments),r=null,c=null,o=new Xf(new xl(this.baseTree,this.ranges[0].from,0,null),an.IncludeAnonymous|an.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(C=>C.from<v&&C.to>j)&&r.ranges.push({from:j,to:v})}}m=!1}else if(c&&(h=Y1(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||($1(o),r&&r.depth++,c&&c.depth++);let x=s.findMounts(o.from,d.parser);if(typeof d.overlay=="function")r=new q1(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 ys(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 ys(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 ys(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 ys(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 Y1(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 $1(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,C,T,E){let M=r[E],I=[],F=[];db(h,y,M,I,F,C);let J=m[M+1],H=m[M+2];g.push(I.length);let B=E?x(M+4,m[M+3],h.set.types[m[M]],J,H-J,E-1):s.toTree();return I.push(B),F.push(J-C),db(h,m[M+3],j,I,F,C),new Ul(v,I,F,T)}o.children[d]=x(0,m.length,Os.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 xl(j,v+l.from,y,l._tree))}}class hb{constructor(s,r){this.offset=r,this.done=!1,this.cursor=s.cursor(an.IncludeAnonymous|an.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,an.IgnoreOverlays|an.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 Ul)r=r.children[0];else break}return!1}}class X1{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(cn.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 ys(g.from,h),g.to>m&&r.splice(d+1,0,new ys(m,g.to))):g.to>m?r[d--]=new ys(m,g.to):r.splice(d--,1))}}return c}function V1(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),C=Math.min(y,j,c);v<C&&x.push(new ys(v,C))}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 ys(v.from+c,v.to+c)),j=V1(s,y,g,x);for(let v=0,C=g;;v++){let T=v==j.length,E=T?x:j[v].from;if(E>C&&r.push(new eu(C,E,o.tree,-h,d.from>=C||d.openStart,d.to<=E||d.openEnd)),T)break;C=j[v].to}}else r.push(new eu(g,x,o.tree,-h,d.from>=h||d.openStart,d.to<=m||d.openEnd))}return r}let Q1=0;class bs{constructor(s,r,c,o){this.name=s,this.set=r,this.base=c,this.modified=o,this.id=Q1++}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 bs&&(r=s),r!=null&&r.base)throw new Error("Can not derive from a modified tag");let o=new bs(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 Vf(s);return c=>c.modified.indexOf(r)>-1?c:Vf.get(c.base||c,c.modified.concat(r).sort((o,d)=>o.id-d.id))}}let K1=0;class Vf{constructor(s){this.name=s,this.instances=[],this.id=K1++}static get(s,r){if(!r.length)return s;let c=r[0].instances.find(m=>m.base==s&&Z1(r,m.modified));if(c)return c;let o=[],d=new bs(s.name,o,s,r);for(let m of r)m.instances.push(d);let h=F1(r);for(let m of s.set)if(!m.modified.length)for(let g of h)o.push(Vf.get(m,g));return d}}function Z1(l,s){return l.length==s.length&&l.every((r,c)=>r==s[c])}function F1(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 Qk(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 C=o[j++];if(j==o.length&&C=="!"){h=0;break}if(C!="/")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 tu(c,h,g>0?d.slice(0,g):null);s[x]=y.sort(s[x])}}return z_.add(s)}const z_=new cn({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 tu(o.tags,o.mode,o.context);r?r.next=d:c=d,r=d}return c}});class tu{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}}tu.empty=new tu([],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 J1(l,s){let r=null;for(let c of l){let o=c.style(s);o&&(r=r?r+" "+o:o)}return r}function P1(l,s,r,c=0,o=l.length){let d=new ej(c,Array.isArray(s)?s:[s],r);d.highlightRange(l.cursor(),c,o,"",d.highlighters),d.flush(o)}function W1(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 C=j.indexOf(`
117
+ `,v),T=C<0?j.length:C;if(T>v&&c(j.slice(v,T),y),C<0)break;o(),v=C+1}m=x}}P1(s,r,(x,y,j)=>{g(x,""),g(y,j)},d,h),g(h,"")}class ej{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(C=>!C.scope||C.scope(h)));let x=o,y=tj(s)||tu.empty,j=J1(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(cn.mounted);if(v&&v.overlay){let C=s.node.enter(v.overlay[0].from+m,1),T=this.highlighters.filter(M=>!M.scope||M.scope(v.tree.type)),E=s.firstChild();for(let M=0,I=m;;M++){let F=M<v.overlay.length?v.overlay[M]:null,J=F?F.from+m:g,H=Math.max(r,I),B=Math.min(c,J);if(H<B&&E)for(;s.from<B&&(this.highlightRange(s,H,B,o,d),this.startSpan(Math.min(B,s.to),x),!(s.to>=J||!s.nextSibling())););if(!F||J>c)break;I=F.to+m,I>r&&(this.highlightRange(C.cursor(),Math.max(r,F.from+m),Math.min(c,I),"",T),this.startSpan(Math.min(c,I),x))}E&&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 tj(l){let s=l.type.prop(z_);for(;s&&s.context&&!l.matchContext(s.context);)s=s.next;return s||null}const je=bs.define,yf=je(),Ui=je(),gb=je(Ui),xb=je(Ui),Hi=je(),vf=je(Hi),Zh=je(Hi),ia=je(),pr=je(ia),ta=je(),na=je(),gp=je(),$o=je(gp),jf=je(),ke={comment:yf,lineComment:je(yf),blockComment:je(yf),docComment:je(yf),name:Ui,variableName:je(Ui),typeName:gb,tagName:je(gb),propertyName:xb,attributeName:je(xb),className:je(Ui),labelName:je(Ui),namespace:je(Ui),macroName:je(Ui),literal:Hi,string:vf,docString:je(vf),character:je(vf),attributeValue:je(vf),number:Zh,integer:je(Zh),float:je(Zh),bool:je(Hi),regexp:je(Hi),escape:je(Hi),color:je(Hi),url:je(Hi),keyword:ta,self:je(ta),null:je(ta),atom:je(ta),unit:je(ta),modifier:je(ta),operatorKeyword:je(ta),controlKeyword:je(ta),definitionKeyword:je(ta),moduleKeyword:je(ta),operator:na,derefOperator:je(na),arithmeticOperator:je(na),logicOperator:je(na),bitwiseOperator:je(na),compareOperator:je(na),updateOperator:je(na),definitionOperator:je(na),typeOperator:je(na),controlOperator:je(na),punctuation:gp,separator:je(gp),bracket:$o,angleBracket:je($o),squareBracket:je($o),paren:je($o),brace:je($o),content:ia,heading:pr,heading1:je(pr),heading2:je(pr),heading3:je(pr),heading4:je(pr),heading5:je(pr),heading6:je(pr),contentSeparator:je(ia),list:je(ia),quote:je(ia),emphasis:je(ia),strong:je(ia),link:je(ia),monospace:je(ia),strikethrough:je(ia),inserted:je(),deleted:je(),changed:je(),invalid:je(),meta:jf,documentMeta:je(jf),annotation:je(jf),processingInstruction:je(jf),definition:bs.defineModifier("definition"),constant:bs.defineModifier("constant"),function:bs.defineModifier("function"),standard:bs.defineModifier("standard"),local:bs.defineModifier("local"),special:bs.defineModifier("special")};for(let l in ke){let s=ke[l];s instanceof bs&&(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 nj="modulepreload",lj=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=lj(y,c),y in bb)return;bb[y]=!0;const j=y.endsWith(".css"),v=j?'[rel="stylesheet"]':"";if(!!c)for(let E=m.length-1;E>=0;E--){const M=m[E];if(M.href===y&&(!j||M.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${y}"]${v}`))return;const T=document.createElement("link");if(T.rel=j?"stylesheet":nj,j||(T.as="script"),T.crossOrigin="",T.href=y,x&&T.setAttribute("nonce",x),document.head.appendChild(T),j)return new Promise((E,M)=>{T.addEventListener("load",E),T.addEventListener("error",()=>M(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-CAFnMkkM.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-CAFnMkkM.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-CAFnMkkM.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-CAFnMkkM.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-CAFnMkkM.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-CAFnMkkM.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-CAFnMkkM.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-CAFnMkkM.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-DKAqAv7f.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-DKAqAv7f.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--avrDony.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--avrDony.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--avrDony.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-BecRt4W_.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-BecRt4W_.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-BecRt4W_.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-BecRt4W_.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-DiTx3nWx.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-DiTx3nWx.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-B2AsV6mq.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-B2AsV6mq.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-DkLckATt.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-DkLckATt.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-Bz64IIeo.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-CsM3FfDT.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-CsM3FfDT.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-CsM3FfDT.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-CsM3FfDT.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-CsM3FfDT.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-BcerQq_T.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-Bz_OD4bi.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-DAXylny5.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-CBwg0nNm.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-DzHtRLVh.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-DzHtRLVh.js");return{xml:l}},__vite__mapDeps([18,1,2,3,4]),import.meta.url)).xml()},sj={".mcp.json":"json",dockerfile:"yaml",makefile:"yaml"},aj={javascript:"js",node:"js",typescript:"ts",python:"py",python3:"py",yml:"yaml",rust:"rs",golang:"go","c++":"cpp",cplusplus:"cpp"};async function ij(l){const s=aj[l.toLowerCase()]??l.toLowerCase(),r=H_[s];return r?r().catch(()=>null):null}async function rj(l){const s=(l.split("/").pop()??"").toLowerCase(),r=sj[s]??s.split(".").pop()??"",c=H_[r];return c?c().catch(()=>null):null}const cj=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 wf(l){return l.replace(/[&<>]/g,s=>s==="&"?"&amp;":s==="<"?"&lt;":"&gt;")}async function oj(l,s){const r=s?await ij(s):null;if(!r)return wf(l);try{const c=r.language.parser.parse(l);let o="";return W1(l,c,cj,(d,h)=>{o+=h?`<span class="${h}">${wf(d)}</span>`:wf(d)},()=>{o+=`
118
+ `}),o}catch{return wf(l)}}Mt.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 td(l){const s=await Mt.parse(l,{async:!0,walkTokens:async r=>{if(r.type!=="code")return;const c=r;c.text=await oj(c.text,c.lang??""),c.escaped=!0}});return R1.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 uj(l){return l.split("/").pop()??l}function Sr(l){const s=l.lastIndexOf("/");return s===-1?"":l.slice(0,s)}function qf(l){return l<1024?`${l} Б`:l<1024*1024?`${(l/1024).toFixed(1)} КБ`:`${(l/1024/1024).toFixed(1)} МБ`}function Ii({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(C=>!C.disabled);return v===-1?0:v});_.useLayoutEffect(()=>{const v=d.current;if(!v)return;const C=v.getBoundingClientRect(),T=8,E=Math.max(T,Math.min(l,window.innerWidth-C.width-T)),M=Math.max(T,Math.min(s,window.innerHeight-C.height-T));m({left:E,top:M})},[l,s]),_.useLayoutEffect(()=>{var v;(v=d.current)==null||v.focus()},[]),_.useLayoutEffect(()=>{function v(T){var E;(E=d.current)!=null&&E.contains(T.target)||o()}function C(){o()}return document.addEventListener("mousedown",v),document.addEventListener("scroll",C,!0),()=>{document.removeEventListener("mousedown",v),document.removeEventListener("scroll",C,!0)}},[o]);function y(v){v.disabled||(v.onSelect(),o())}function j(v){if(v.key==="Escape"){v.preventDefault(),v.stopPropagation(),o();return}const C=r.map((T,E)=>({item:T,index:E})).filter(T=>!T.item.disabled);if(C.length!==0){if(v.key==="ArrowDown"||v.key==="ArrowUp"){v.preventDefault();const T=v.key==="ArrowDown"?1:-1,E=C.findIndex(I=>I.index===g),M=C[(((E===-1?0:E)+T)%C.length+C.length)%C.length];M&&x(M.index);return}if(v.key==="Enter"||v.key===" "){v.preventDefault();const T=r[g];T&&y(T)}}}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,C)=>a.jsxs("button",{type:"button",role:"menuitem","aria-disabled":v.disabled,className:"ctxmenu__item"+(C===g?" is-cursor":""),onMouseEnter:()=>x(C),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 fj=3500,dj=9e3,yb=220;function Er({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?fj:dj,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 oa({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 Lc({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 hj=500,mr="application/x-ccv-fs-path",pj=200;function mj({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:C,onMove:T,onCopy:E,onDelete:M,onRefresh:I,onClose:F,zoomed:J,onToggleZoom:H}){const[B,D]=_.useState(""),[V,X]=_.useState(null),[A,L]=_.useState(null),[Y,ie]=_.useState(null),[xe,Se]=_.useState(null),[ve,Q]=_.useState(null),[fe,ue]=_.useState(null),_e=Pf("(hover: hover)"),Me=_.useRef(null),w=_.useMemo(()=>bj(d),[d]);function Z(le){return!(!Y||le===Y.path||Y.kind==="dir"&&le.startsWith(`${Y.path}/`)||le===Sr(Y.path))}function z(le){return!(!ve||le===ve.path||ve.kind==="dir"&&le.startsWith(`${ve.path}/`)||ve.mode==="cut"&&le===Sr(ve.path))}function me(le){Q({path:le.path,kind:le.kind,mode:"copy"})}function ye(le){Q({path:le.path,kind:le.kind,mode:"cut"})}function Re(le){!ve||!z(le)||(le&&!r.has(le)&&y(le),ve.mode==="cut"?(T(ve.path,le),Q(null)):E(ve.path,le))}function Oe(le,pe){const qe=le.touches[0];if(!qe)return;const Fe={timer:0,x:qe.clientX,y:qe.clientY,el:le.currentTarget,fired:!1};Fe.timer=window.setTimeout(()=>{Fe.fired=!0,pe(Fe.x,Fe.y,Fe.el)},hj),Me.current=Fe}function Ue(le){const pe=Me.current,qe=le.touches[0];!pe||!qe||Math.hypot(qe.clientX-pe.x,qe.clientY-pe.y)>10&&(window.clearTimeout(pe.timer),Me.current=null)}function Be(le){const pe=Me.current;pe&&(window.clearTimeout(pe.timer),pe.fired&&le.preventDefault())}function on(){var le;return(le=Me.current)!=null&&le.fired?(Me.current=null,!0):!1}function Ke(le,pe,qe,Fe){D((Fe==null?void 0:Fe.path)??""),ue({x:le,y:pe,opener:qe,entry:Fe})}function Jt(){const le=fe==null?void 0:fe.opener;ue(null),le!=null&&le.isConnected&&le.focus()}function ft(le){return{onContextMenu:pe=>{pe.preventDefault(),Ke(pe.clientX,pe.clientY,pe.currentTarget,le)},onTouchStart:pe=>Oe(pe,(qe,Fe,Ve)=>Ke(qe,Fe,Ve,le)),onTouchMove:Ue,onTouchEnd:Be,onTouchCancel:Be}}function mt(le){le.target===le.currentTarget&&(le.preventDefault(),Ke(le.clientX,le.clientY,le.currentTarget,null))}function Ie(le){le.target===le.currentTarget&&Oe(le,(pe,qe,Fe)=>Ke(pe,qe,Fe,null))}function un(le){if(!(le.ctrlKey||le.metaKey)||le.target instanceof HTMLInputElement)return;const pe=le.key.toLowerCase();if(pe==="v"){le.preventDefault(),Re(Kn());return}if(!B)return;const qe=vb(s,B);qe&&(pe==="c"?(le.preventDefault(),me(qe)):pe==="x"&&(le.preventDefault(),ye(qe)))}function Sn(le){return pe=>{pe.dataTransfer.effectAllowed="move",pe.dataTransfer.setData(mr,le.path),ie({path:le.path,kind:le.kind})}}function ct(){ie(null),Se(null)}function Nn(le){return pe=>{pe.dataTransfer.types.includes(mr)&&(pe.stopPropagation(),!(le.kind!=="dir"||!Z(le.path))&&(pe.preventDefault(),Se(le.path)))}}function Wn(le){return pe=>{if(!pe.dataTransfer.types.includes(mr)||(pe.stopPropagation(),le.kind!=="dir"||!Z(le.path)))return;pe.preventDefault();const qe=pe.dataTransfer.getData(mr);Se(null),qe&&T(qe,le.path)}}function fn(le){!le.dataTransfer.types.includes(mr)||!Z("")||(le.preventDefault(),Se(""))}function el(le){if(!le.dataTransfer.types.includes(mr)||!Z(""))return;le.preventDefault();const pe=le.dataTransfer.getData(mr);Se(null),pe&&T(pe,"")}const[Bt,at]=_.useState(""),Rt=Bt.trim(),Yn=Rt.length>0,Tt=_.useRef(null),et=_.useRef(g);et.current=g;function rt(le){at(le),Tt.current&&clearTimeout(Tt.current);const pe=le.trim();if(!pe){et.current("");return}Tt.current=setTimeout(()=>et.current(pe),pj)}function pn(le){Tt.current&&clearTimeout(Tt.current),at(""),et.current(""),D(le.path),x(le)}const bn=Yn&&(m==null?void 0:m.query)===Rt?m:null;function Kn(){if(B==="")return"";const le=vb(s,B);if((le==null?void 0:le.kind)==="dir")return B;const pe=B.lastIndexOf("/");return pe===-1?"":B.slice(0,pe)}function en(le,pe){const qe=pe??Kn();qe&&!r.has(qe)&&y(qe),L({parent:qe,kind:le})}function St(){if(!fe)return[];const le=Fe=>_e?Fe:void 0;if(!fe.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 pe=fe.entry,qe=[pe.kind==="file"?{id:"open",label:"Открыть",onSelect:()=>j(pe.path)}:{id:"toggle",label:r.has(pe.path)?"Свернуть":"Развернуть",onSelect:()=>y(pe.path)},{id:"copy",label:"Копировать",hint:le("Ctrl+C"),onSelect:()=>me(pe)},{id:"cut",label:"Вырезать",hint:le("Ctrl+X"),onSelect:()=>ye(pe)}];return pe.kind==="dir"&&(qe.push({id:"paste",label:"Вставить",hint:le("Ctrl+V"),disabled:!z(pe.path),onSelect:()=>Re(pe.path)}),qe.push({id:"new-file",label:"Создать файл",onSelect:()=>en("file",pe.path)}),qe.push({id:"new-dir",label:"Создать каталог",onSelect:()=>en("dir",pe.path)})),qe.push({id:"rename",label:"Переименовать",onSelect:()=>X(pe.path)}),qe.push({id:"delete",label:"Удалить",onSelect:()=>M(pe)}),qe}const Pt=Yn?[]:Dt("",0);function Dt(le,pe){const qe=s[le],Fe=[];if(A&&A.parent===le&&Fe.push(a.jsxs("div",{className:"fsrow fsrow--draft",style:Va(pe),children:[a.jsx("span",{className:"fsrow__icon",children:A.kind==="dir"?a.jsx(Kf,{}):a.jsx(Zf,{})}),a.jsx(oa,{className:"rename--file",value:"",placeholder:A.kind==="dir"?"имя каталога":"имя файла",onCommit:Ve=>{L(null),v(le,A.kind,Ve)},onCancel:()=>L(null)})]},`draft:${le}`)),!qe)return Fe.push(a.jsx("p",{className:"fsrow__pending",style:Va(pe),children:"читаем…"},`wait:${le}`)),Fe;qe.length===0&&!A&&Fe.push(a.jsx("p",{className:"fsrow__pending",style:Va(pe),children:"пусто"},`empty:${le}`));for(const Ve of qe){const bt=Ve.kind==="dir"&&r.has(Ve.path);Fe.push(V===Ve.path?a.jsxs("div",{className:"fsrow fsrow--draft",style:Va(pe),children:[a.jsx("span",{className:"fsrow__icon",children:Ve.kind==="dir"?a.jsx(Kf,{open:bt}):a.jsx(Zf,{})}),a.jsx(oa,{className:"rename--file",value:Ve.name,placeholder:"новое имя",onCommit:$=>{X(null),C(Ve.path,$)},onCancel:()=>X(null)})]},Ve.path):a.jsx(gj,{entry:Ve,depth:pe,open:bt,active:Ve.path===c,selected:Ve.path===B,dirty:o.has(Ve.path),gitStatus:w.get(Ve.path),dragging:(Y==null?void 0:Y.path)===Ve.path,dropTarget:xe===Ve.path,cut:(ve==null?void 0:ve.mode)==="cut"&&ve.path===Ve.path,onClick:()=>{on()||(D(Ve.path),Ve.kind==="dir"?y(Ve.path):j(Ve.path))},onRename:()=>X(Ve.path),onDelete:()=>M(Ve),onDragStart:Sn(Ve),onDragEnd:ct,onDragOver:Nn(Ve),onDrop:Wn(Ve),...ft(Ve)},Ve.path)),bt&&Fe.push(...Dt(Ve.path,pe+1))}return Fe}function $n(){if(!bn)return[a.jsx("p",{className:"fsrow__pending",style:Va(0),children:"ищем…"},"search:wait")];if(bn.entries.length===0)return[a.jsx("p",{className:"fsrow__pending",style:Va(0),children:"ничего не найдено"},"search:empty")];const le=bn.entries.map(pe=>a.jsx(xj,{entry:pe,gitStatus:w.get(pe.path),onClick:()=>pn(pe)},pe.path));return bn.truncated&&le.push(a.jsxs("p",{className:"fsrow__pending",style:Va(0),children:["показаны первые ",bn.entries.length," — уточните запрос"]},"search:truncated")),le}return a.jsxs("aside",{className:(l?"sidepane sidepane--files sidepane--open":"sidepane sidepane--files")+(J?" sidepane--zoomed":""),"aria-label":"Файлы проекта",onKeyDown:un,children:[a.jsxs("div",{className:"sidepane__head",onDoubleClick:le=>{H&&(le.target.closest("button")||H())},children:[a.jsx(jj,{}),a.jsx("span",{className:"sidepane__title",children:"Файлы"}),a.jsx("button",{className:"sidepane__btn",title:"Новый файл","aria-label":"Новый файл",onClick:()=>en("file"),children:a.jsx(yj,{})}),a.jsx("button",{className:"sidepane__btn",title:"Новый каталог","aria-label":"Новый каталог",onClick:()=>en("dir"),children:a.jsx(vj,{})}),a.jsx("button",{className:"sidepane__btn",title:"Перечитать дерево","aria-label":"Перечитать дерево",onClick:I,children:"↻"}),H&&a.jsx("button",{className:"sidepane__btn",title:J?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":J?"Свернуть панель файлов":"Развернуть панель файлов на весь экран","aria-pressed":J,onClick:H,children:a.jsx(Lc,{active:J})}),a.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель файлов",onClick:F,children:"✕"})]}),a.jsxs("div",{className:"fssearch",children:[a.jsx(wj,{}),a.jsx("input",{className:"fssearch__input",type:"text",value:Bt,spellCheck:!1,placeholder:"Поиск файлов и папок…","aria-label":"Поиск файлов и папок",onChange:le=>rt(le.target.value),onKeyDown:le=>{le.stopPropagation(),le.key==="Escape"&&(le.preventDefault(),Bt?rt(""):le.currentTarget.blur())}}),Bt&&a.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>rt(""),children:"✕"})]}),a.jsx("div",{className:"sidepane__scroll fstree"+(xe===""?" fstree--drop-target":""),tabIndex:-1,onDragOver:fn,onDrop:el,onContextMenu:mt,onTouchStart:Ie,onTouchMove:Ue,onTouchEnd:Be,onTouchCancel:Be,children:Yn?$n():Pt}),a.jsx(Er,{result:h}),fe&&a.jsx(Ii,{x:fe.x,y:fe.y,items:St(),onClose:Jt})]})}function gj({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:C,onDragEnd:T,onDragOver:E,onDrop:M,onContextMenu:I,onTouchStart:F,onTouchMove:J,onTouchEnd:H,onTouchCancel:B}){const D="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:D,style:Va(s),draggable:!0,onDragStart:C,onDragEnd:T,onDragOver:E,onDrop:M,onContextMenu:I,onTouchStart:F,onTouchMove:J,onTouchEnd:H,onTouchCancel:B,children:[a.jsxs("button",{className:"fsrow__main",onClick:y,title:I_(l),children:[a.jsx("span",{className:"fsrow__icon"+Qf("fsrow__icon",h),children:l.kind==="dir"?a.jsx(Kf,{open:r}):a.jsx(Zf,{})}),a.jsx("span",{className:"fsrow__name"+Qf("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 xj({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"+Qf("fsrow__icon",s),children:l.kind==="dir"?a.jsx(Kf,{}):a.jsx(Zf,{})}),a.jsx("span",{className:"fsrow__name"+Qf("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 bj(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=_j(o.status);if(!d)continue;c(o.path,d);let h=Sr(o.path);for(;c(h,d),!!h;)h=Sr(h)}return s}function _j(l){if(l==="??")return"added";const[s="",r=""]=l;return s==="A"||s==="R"||s==="C"?"added":s==="M"||r==="M"?"modified":null}function Qf(l,s){return s?` ${l}--git-${s}`:""}function Kf({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 Zf(){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 yj(){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 vj(){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 jj(){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 wj(){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 Sj=200;function Nj({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 C(M){g(M),j.current&&clearTimeout(j.current);const I=M.trim();if(!I){v.current("");return}j.current=setTimeout(()=>v.current(I),Sj)}const T=y&&(s==null?void 0:s.query)===x?s:null;function E(){if(!T)return[a.jsx("p",{className:"fsrow__pending",children:"ищем…"},"grep:wait")];if(T.matches.length===0)return[a.jsx("p",{className:"fsrow__pending",children:"ничего не найдено"},"grep:empty")];const M=[];let I="";for(const F of T.matches)F.path!==I&&(I=F.path,M.push(a.jsx("p",{className:"searchgroup__path",title:F.path,children:F.path},`path:${F.path}`))),M.push(a.jsx(kj,{match:F,onClick:()=>c(F)},`${F.path}:${F.line}:${F.column}`));return T.truncated&&M.push(a.jsxs("p",{className:"fsrow__pending",children:["показаны первые ",T.matches.length," — уточните запрос"]},"grep:truncated")),M}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:M=>{h&&(M.target.closest("button")||h())},children:[a.jsx(Tj,{}),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(Lc,{active:d})}),a.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель поиска",onClick:o,children:"✕"})]}),a.jsxs("div",{className:"fssearch",children:[a.jsx(Ej,{}),a.jsx("input",{className:"fssearch__input",type:"text",value:m,spellCheck:!1,placeholder:"Поиск по тексту во всех файлах…","aria-label":"Поиск по тексту во всех файлах",onChange:M=>C(M.target.value),onKeyDown:M=>{M.stopPropagation(),M.key==="Escape"&&(M.preventDefault(),m?C(""):M.currentTarget.blur())}}),m&&a.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>C(""),children:"✕"})]}),a.jsx("div",{className:"sidepane__scroll fstree",children:y?E():a.jsx("p",{className:"sidepane__empty",children:"Введите текст, чтобы найти его во всех файлах проекта."})})]})}function kj({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 Tj(){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 Ej(){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 Sf=null;function Cj(){return Sf||(Sf=Promise.all([Pe(()=>import("./index-7U1ohiLA.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-BBZwZyBc.js"),__vite__mapDeps([20,3,4,2]),import.meta.url),Pe(()=>import("./codemirror-E1z6J01e.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 Sf=null,l})),Sf}function Aj({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),C=_.useRef(o),T=_.useRef(d),E=_.useRef(l),M=_.useRef(r),I=_.useRef(s);C.current=o,T.current=d,E.current=l,M.current=r,I.current=s;const[F,J]=_.useState("loading"),[H,B]=_.useState(!1);function D(X,A,L,Y,ie){const xe=x.current.get(Y),Se=y.current.get(Y)===ie;if(xe&&Se)L.setState(xe);else{const Q=X.EditorState.create({doc:I.current,extensions:[X.basicSetup,X.Prec.highest(X.keymap.of([{key:"Mod-s",preventDefault:!0,run:()=>(T.current(E.current),!0)}])),X.keymap.of([X.indentWithTab]),A.of([]),X.editorTheme,X.editorHighlight,X.EditorView.updateListener.of(fe=>{fe.docChanged&&C.current(E.current,fe.state.doc.toString())})]});x.current.set(Y,Q),y.current.set(Y,ie),L.setState(Q),j.current.delete(Y)}if(j.current.has(Y))return()=>{};let ve=!1;return rj(Y).then(Q=>{ve||!Q||E.current!==Y||(L.dispatch({effects:A.reconfigure(Q)}),x.current.set(Y,L.state),j.current.add(Y))}),()=>{ve=!0}}_.useEffect(()=>{if(!h.current)return;let A=!1,L=null,Y=null;J("loading"),B(!1);const ie=window.setTimeout(()=>{A||B(!0)},200);return(async()=>{let xe;try{xe=await Cj()}catch{window.clearTimeout(ie),A||J("error");return}if(A||!h.current)return;window.clearTimeout(ie);const Se=new xe.Compartment;v.current=Se,g.current=xe,Y=new xe.EditorView({parent:h.current}),m.current=Y,L=D(xe,Se,Y,E.current,M.current),J("ready")})(),()=>{A=!0,window.clearTimeout(ie),L==null||L(),Y==null||Y.destroy(),m.current===Y&&(m.current=null),g.current=null,v.current=null}},[]),_.useEffect(()=>{const X=g.current,A=m.current,L=v.current;if(!(!X||!A||!L))return D(X,L,A,l,r)},[l,r]);const V=_.useRef(0);return _.useEffect(()=>{const X=m.current,A=g.current;if(!X||!A||!c||c.token===V.current)return;V.current=c.token;const L=X.state.doc.lines,Y=Math.min(Math.max(c.line,1),L),ie=X.state.doc.line(Y),xe=Math.min(ie.from+Math.max(c.column-1,0),ie.to);X.dispatch({selection:A.EditorSelection.cursor(xe),effects:A.EditorView.scrollIntoView(xe,{y:"center"})}),X.focus()},[c]),_.useEffect(()=>()=>{const X=m.current;X&&x.current.set(l,X.state)},[l]),a.jsxs("div",{className:"editor__code",children:[a.jsx("div",{ref:h,className:"editor__code-surface"+(F==="ready"?"":" is-hidden")}),F==="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:"Загружается редактор…"})]}),F==="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 _s({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),C=s.find(M=>M.value===l)??null;_.useEffect(()=>{if(!m)return;const M=s.findIndex(I=>I.value===l);y(M===-1?0:M)},[m]),_.useEffect(()=>{if(!m)return;function M(I){var F;(F=j.current)!=null&&F.contains(I.target)||g(!1)}return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[m]),_.useEffect(()=>{var M,I;m&&((I=(M=v.current)==null?void 0:M.querySelector(".is-cursor"))==null||I.scrollIntoView({block:"nearest"}))},[m,x]),_.useEffect(()=>{if(!m)return;const M=v.current,I=Mj(j.current);if(!M||!I)return;const F=M.getBoundingClientRect().bottom-I.getBoundingClientRect().bottom;F>0&&(I.scrollTop+=Math.min(F+8,M.offsetHeight))},[m]);function T(M){g(!1),M.value!==l&&r(M.value)}function E(M){if(M.key==="Escape"){if(!m)return;M.preventDefault(),M.stopPropagation(),g(!1);return}if(M.key==="ArrowDown"||M.key==="ArrowUp"){if(M.preventDefault(),!m)return g(!0);const I=M.key==="ArrowDown"?1:s.length-1;return y(F=>(F+I)%s.length)}if(M.key==="Enter"||M.key===" "){if(M.preventDefault(),!m)return g(!0);const I=s[x];I&&T(I)}}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(M=>!M),onKeyDown:E,children:[a.jsx("span",{className:"select__value",children:(C==null?void 0:C.label)??h}),a.jsx(Rj,{})]}),m&&a.jsx("div",{ref:v,className:"select__menu",role:"listbox","aria-label":d??o,children:s.map((M,I)=>a.jsxs("button",{type:"button",role:"option","aria-selected":M.value===l,className:"select__option"+(I===x?" is-cursor":"")+(M.value===l?" is-on":""),onMouseEnter:()=>y(I),onClick:()=>T(M),children:[a.jsx("span",{className:"select__check","aria-hidden":"true",children:M.value===l?"✓":""}),a.jsx("span",{className:"select__label",children:M.label}),M.hint&&a.jsx("span",{className:"select__hint",children:M.hint})]},M.value))})]})}function Mj(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 Rj(){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 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:"M6.6 4.6v4M4.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("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 Lj(){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 zj({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=Uj(r,s);return o?a.jsx("div",{className:"mediaview mediaview--message",children:a.jsxs("p",{className:"mediaview__error",children:["Файл слишком велик для просмотра (",qf(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(Bj,{url:m}):s.startsWith("video/")?a.jsx(qj,{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 Uj(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 zi=1,q_=8,Nf=1.25;function Hj(l){return Math.min(q_,Math.max(zi,l))}function Bj({url:l}){const[s,r]=_.useState({scale:zi,x:0,y:0}),[c,o]=_.useState(!1),d=_.useRef(null),h=_.useRef(null);function m(C,T,E){r(M=>{const I=Hj(M.scale*C);if(I===M.scale)return M;if(I<=zi)return{scale:zi,x:0,y:0};const F=(T-M.x)/M.scale,J=(E-M.y)/M.scale;return{scale:I,x:T-I*F,y:E-I*J}})}_.useEffect(()=>{const C=d.current;if(!C)return;function T(E){E.preventDefault();const M=C.getBoundingClientRect(),I=E.clientX-M.left-M.width/2,F=E.clientY-M.top-M.height/2;m(E.deltaY<0?Nf:1/Nf,I,F)}return C.addEventListener("wheel",T,{passive:!1}),()=>C.removeEventListener("wheel",T)},[]);function g(C){s.scale<=zi||(C.currentTarget.setPointerCapture(C.pointerId),h.current={pointerId:C.pointerId,startX:C.clientX,startY:C.clientY,origX:s.x,origY:s.y},o(!0))}function x(C){const T=h.current;!T||T.pointerId!==C.pointerId||r(E=>({...E,x:T.origX+(C.clientX-T.startX),y:T.origY+(C.clientY-T.startY)}))}function y(){h.current=null,o(!1)}const j=s.scale>zi,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<=zi,title:"Уменьшить","aria-label":"Уменьшить",onClick:()=>m(1/Nf,0,0),children:a.jsx(Oj,{})}),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(Nf,0,0),children:a.jsx(Dj,{})}),a.jsx("button",{className:"btn btn--sm",disabled:v,title:"Вписать в окно","aria-label":"Сбросить масштаб — вписать в окно",onClick:()=>r({scale:zi,x:0,y:0}),children:a.jsx(Lj,{})})]})]})}const Ij=[{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 qj({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(_s,{className:"mediaview__speedselect",value:r,onChange:c,ariaLabel:"Скорость воспроизведения",options:Ij})]})]})}function Gj({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:[qf(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(zj,{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:["Это не текстовый файл — редактировать его здесь нечем. ",qf(l.size)," на диске."]}):l.tooLarge?a.jsxs("p",{className:"editor__empty",children:["Файл слишком велик для редактора (",qf(l.size),"). Такие правит агент, а не браузер."]}):x&&l.previewMode?a.jsx(Yj,{text:l.text}):a.jsx(Aj,{path:l.path,doc:l.text,revision:l.revision,goto:s,onChange:r,onSave:c})]})}function Yj({text:l}){const[s,r]=_.useState("");return _.useEffect(()=>{let c=!1;return td(l).then(o=>{c||r(o)}),()=>{c=!0}},[l]),a.jsx("div",{className:"markdown-preview",dangerouslySetInnerHTML:{__html:s}})}function $j({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:uj(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(Lc,{active:d})})]})}function xs(l){return l.claudeSessionId??l.id}function kf(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 Tf(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 Xj(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 Vj(l){switch(l.kind){case"agent":return l.agentType??"агент";case"shell":return"команда";case"workflow":return"сценарий";default:return"задача"}}function Qj(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 Kj(l){return l<1e3?`${l} ток.`:`${(l/1e3).toFixed(1).replace(".",",")} k ток.`}function Zj({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:Xj(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:Vj(x)}),x.background&&a.jsx("span",{className:"task__bg",children:"фон"}),a.jsx("span",{className:"task__time",children:Qj(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:[Kj(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 Fj=""+new URL("antigravity-logo-DRKQga2U.png",import.meta.url).href;function Lp({className:l}){return a.jsx("img",{src:Fj,alt:"","aria-hidden":"true",className:l,style:{aspectRatio:"200 / 184"}})}const Jj=450,Pj=6,Wj=[{id:"claude",label:"Claude",hint:"Claude Code — как обычно"},{id:"antigravity",label:"Antigravity",hint:"Google agy, отдельная палитра и права"},{id:"codex",label:"Codex",hint:"OpenAI · сессии, инструменты и разрешения"}];function ew({disabled:l,providers:s,onStart:r}){const c=Wj.filter(A=>s.includes(A.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),C=_.useRef(null);function T(){C.current&&window.clearTimeout(C.current.timer),C.current=null}function E(){T(),g(0),h(!0)}function M(A){var L;h(!1),A&&((L=j.current)==null||L.focus())}function I(A){if(l||!o||A.button!==0)return;const L={timer:0,x:A.clientX,y:A.clientY,fired:!1};L.timer=window.setTimeout(()=>{L.fired=!0,E()},Jj),C.current=L}function F(A){const L=C.current;!L||L.fired||Math.hypot(A.clientX-L.x,A.clientY-L.y)>Pj&&T()}function J(){C.current&&!C.current.fired&&T()}function H(A){var Y;if((Y=C.current)!=null&&Y.fired){C.current=null,A.preventDefault();return}if(l)return;const L=c[0];L&&r(L.id)}function B(A){o&&(A.preventDefault(),!l&&E())}function D(A){if(l||!o)return;(A.key==="ArrowDown"||A.key==="ArrowUp"||A.key==="Enter"&&A.shiftKey)&&(A.preventDefault(),E())}_.useLayoutEffect(()=>{if(!d)return;const A=j.current,L=v.current;if(!A||!L)return;const Y=A.getBoundingClientRect(),ie=L.getBoundingClientRect(),xe=8,Se=Math.max(xe,Math.min(Y.right-ie.width,window.innerWidth-ie.width-xe));let ve=Y.top-ie.height-8;ve<xe&&(ve=Math.min(Y.bottom+8,window.innerHeight-ie.height-xe)),y({left:Se,top:ve})},[d]),_.useLayoutEffect(()=>{var A;d&&((A=v.current)==null||A.focus())},[d]),_.useLayoutEffect(()=>{if(!d)return;function A(L){var ie,xe;const Y=L.target;!((ie=v.current)!=null&&ie.contains(Y))&&!((xe=j.current)!=null&&xe.contains(Y))&&M(!1)}return document.addEventListener("mousedown",A),()=>document.removeEventListener("mousedown",A)},[d]);function V(A){M(!1),r(A.id)}function X(A){if(A.key==="Escape"){A.preventDefault(),A.stopPropagation(),M(!0);return}if(A.key==="ArrowDown"||A.key==="ArrowUp"){A.preventDefault();const L=A.key==="ArrowDown"?1:-1;g(Y=>(Y+L+c.length)%c.length);return}if(A.key==="Enter"||A.key===" "){A.preventDefault();const L=c[m];L&&V(L);return}A.key==="Tab"&&M(!1)}return a.jsxs("div",{className:"newsession",children:[a.jsx("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:B,onPointerDown:I,onPointerMove:F,onPointerUp:J,onPointerCancel:J,onPointerLeave:J,onKeyDown:D,children:"+ Сессия"}),o&&a.jsx("button",{type:"button",className:"btn btn--primary newsession__choose","aria-label":"Выбрать агента","aria-haspopup":"menu","aria-expanded":d,disabled:l,onClick:()=>d?M(!0):E(),children:a.jsx(tw,{})}),d&&o&&a.jsx("div",{ref:v,className:"newsession__menu",style:{left:x.left,top:x.top},role:"menu","aria-label":"Выбрать агента для новой сессии",tabIndex:-1,onKeyDown:X,children:c.map((A,L)=>a.jsxs("button",{type:"button",role:"menuitem",className:"newsession__item"+(L===m?" is-cursor":""),onMouseEnter:()=>g(L),onClick:()=>V(A),children:[a.jsx("span",{className:`newsession__mark newsession__mark--${A.id}`,"aria-hidden":"true",children:A.id==="codex"?a.jsx("span",{className:"codex-mark",children:"C"}):A.id==="antigravity"?a.jsx(Lp,{className:"newsession__mark-logo"}):a.jsx(nw,{})}),a.jsxs("span",{className:"newsession__text",children:[a.jsx("span",{className:"newsession__label",children:A.label}),a.jsx("span",{className:"newsession__hint",children:A.hint})]})]},A.id))})]})}function tw(){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 nw(){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",lw=500,Fh="транскрипт остаётся на диске — сессию можно вернуть из архива в любой момент.";function sw({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:C,onReorder:T,activeWorkspaceId:E,activeSessionId:M,onSelectWorkspace:I,onSelectSession:F,onRenameSession:J,onStopSession:H,onPinSessions:B,onSelectPinned:D,onCloseWorkspaces:V,onRestoreWorkspaces:X,onArchiveSessions:A,onUnarchiveSessions:L,onCreateFolder:Y,onRenameFolder:ie,onSetFolderColor:xe,onDeleteFolder:Se,onAssignToFolder:ve,onOpenWorkspace:Q,onNewSession:fe,enabledProviders:ue,onOpenExtensions:_e,account:Me,onOpenAccount:w,relay:Z,onOpenRelay:z,onOpenSettings:me,themeMode:ye,onCycleTheme:Re}){var Tl;const[Oe,Ue]=_.useState(null),[Be,on]=_.useState(null),[Ke,Jt]=_.useState(null);function ft(N){return(Ke==null?void 0:Ke.folderId)===N.id?Ke.color??void 0:N.color}function mt(N){const ae=N&&ft(N);return ae?{"--folder-color":ae}:void 0}function Ie(N){return N?a.jsx("span",{className:"row__stripe","aria-hidden":"true"}):null}const un=_.useRef(void 0),[Sn,ct]=_.useState(null),[Nn,Wn]=_.useState(""),[fn,el]=_.useState(_w),[Bt,at]=_.useState(yw),[Rt,Yn]=_.useState(vw);function Tt(N){Yn(N);try{localStorage.setItem($_,N)}catch{}}const et=Nn.trim().toLowerCase(),rt=et!=="",pn=_.useMemo(()=>kf(c,v==null?void 0:v.workspaces,N=>N.id,"bottom"),[c,v]),bn=_.useMemo(()=>{const N=kf(g,E?v==null?void 0:v.sessions[E]:void 0,xs,"top");return C?wb(N):N},[g,v,E,C]),Kn=_.useMemo(()=>{const N=kf(y,v==null?void 0:v.pinned,xs,"bottom");return C?wb(N):N},[y,v,C]),en=_.useMemo(()=>kf(j,v==null?void 0:v.live,xs,"bottom"),[j,v]),St=_.useMemo(()=>rt?pn.filter(N=>N.name.toLowerCase().includes(et)||N.path.toLowerCase().includes(et)):pn,[pn,et,rt]),Pt=_.useMemo(()=>rt?o.filter(N=>N.name.toLowerCase().includes(et)||N.path.toLowerCase().includes(et)):o,[o,et,rt]),Dt=_.useMemo(()=>{if(!rt)return!1;const N=c.find(ae=>ae.id===E);return!!N&&(N.name.toLowerCase().includes(et)||N.path.toLowerCase().includes(et))},[c,E,et,rt]),$n=_.useMemo(()=>rt&&!Dt?bn.filter(N=>(N.title??"").toLowerCase().includes(et)):bn,[bn,et,rt,Dt]),le=_.useMemo(()=>rt&&!Dt?x.filter(N=>(N.title??"").toLowerCase().includes(et)):x,[x,et,rt,Dt]),pe=N=>{var ae;return((ae=c.find(we=>we.id===N))==null?void 0:ae.name)??"—"},qe=N=>{var ae;return(ae=c.find(we=>we.id===N))==null?void 0:ae.path},Fe=_.useMemo(()=>rt?Kn.filter(N=>(N.title??"").toLowerCase().includes(et)||pe(N.workspaceId).toLowerCase().includes(et)):Kn,[Kn,c,et,rt]),Ve=_.useMemo(()=>rt?en.filter(N=>(N.title??"").toLowerCase().includes(et)||pe(N.workspaceId).toLowerCase().includes(et)):en,[en,c,et,rt]),bt=!rt;function $(N){el(ae=>{const we=ae.includes(N)?ae.filter(lt=>lt!==N):[...ae,N];try{localStorage.setItem(Y_,JSON.stringify(we))}catch{}return we})}const se=N=>!fn.includes(N);function Ce(N){at(ae=>{const we=ae.includes(N)?ae.filter(lt=>lt!==N):[...ae,N];try{localStorage.setItem(X_,JSON.stringify(we))}catch{}return we})}const Le=N=>!Bt.includes(N),_t=_.useMemo(()=>Xo(St,d),[St,d]),Xn=_.useMemo(()=>Xo(Pt,d),[Pt,d]),Zn=_.useMemo(()=>Xo($n,h),[$n,h]),Hl=_.useMemo(()=>Xo(le,h),[le,h]),bl=_.useMemo(()=>Xo(Fe,m,N=>N.pinnedFolderId),[Fe,m]),Bl=_.useMemo(()=>({groups:[],ungrouped:Ve}),[Ve]),ls=((v==null?void 0:v.workspaces.length)??0)>0,ss=E?(((Tl=v==null?void 0:v.sessions[E])==null?void 0:Tl.length)??0)>0:!1,Ka=((v==null?void 0:v.pinned.length)??0)>0,Il=((v==null?void 0:v.live.length)??0)>0,tl=Ef({enabled:bt,scope:"workspaces",itemKey:N=>N.id,groups:_t.groups,ungrouped:_t.ungrouped,onReorder:T}),Ot=Ef({enabled:bt,scope:"sessions",workspaceId:E??void 0,itemKey:xs,groups:Zn.groups,ungrouped:Zn.ungrouped,onReorder:T}),Ze=Ef({enabled:bt,scope:"pinned",itemKey:xs,groups:bl.groups,ungrouped:bl.ungrouped,onReorder:T}),On=Ef({enabled:bt,scope:"live",itemKey:xs,groups:Bl.groups,ungrouped:Bl.ungrouped,onReorder:T});_.useEffect(()=>{var we;if(!Ke)return;const ae=(we=[...bl.groups,..._t.groups,...Xn.groups,...Zn.groups,...Hl.groups].find(lt=>lt.folder.id===Ke.folderId))==null?void 0:we.folder;ae&&ae.color===(Ke.color??void 0)&&Jt(null)},[Ke,bl,_t,Xn,Zn,Hl]),_.useEffect(()=>()=>window.clearTimeout(un.current),[]);const Xt=Ph(St),wl=Ph(Pt),cl=Ph($n),[tn,ol]=_.useState(null),[_n,Sl]=_.useState(null),[We,ql]=_.useState(null),[tt,Et]=_.useState(null),[It,Gl]=_.useState(null),kn=_.useRef(null);function ul(N,ae){const we=N.touches[0];if(!we)return;const lt={timer:0,x:we.clientX,y:we.clientY,el:N.currentTarget,fired:!1};lt.timer=window.setTimeout(()=>{lt.fired=!0,ae(lt.x,lt.y,lt.el)},lw),kn.current=lt}function as(N){const ae=kn.current,we=N.touches[0];!ae||!we||Math.hypot(we.clientX-ae.x,we.clientY-ae.y)>10&&(window.clearTimeout(ae.timer),kn.current=null)}function Tn(N){const ae=kn.current;ae&&(window.clearTimeout(ae.timer),ae.fired&&N.preventDefault())}function nn(){var N;return(N=kn.current)!=null&&N.fired?(kn.current=null,!0):!1}function Yl(){const N=tn==null?void 0:tn.opener;ol(null),N!=null&&N.isConnected&&N.focus()}function Vt(){const N=_n==null?void 0:_n.opener;Sl(null),N!=null&&N.isConnected&&N.focus()}function fl(){const N=We==null?void 0:We.opener;ql(null),N!=null&&N.isConnected&&N.focus()}function En(){const N=tt==null?void 0:tt.opener;Et(null),N!=null&&N.isConnected&&N.focus()}function Ct(){const N=It==null?void 0:It.opener;Gl(null),N!=null&&N.isConnected&&N.focus()}function Za(N){return{onContextMenu:ae=>{ae.preventDefault(),ol({x:ae.clientX,y:ae.clientY,opener:ae.currentTarget,ids:Xt.targetsFor(N)})},onTouchStart:ae=>ul(ae,(we,lt,Cn)=>ol({x:we,y:lt,opener:Cn,ids:Xt.targetsFor(N)})),onTouchMove:as,onTouchEnd:Tn,onTouchCancel:Tn}}function Ls(N){return{onContextMenu:ae=>{ae.preventDefault(),Sl({x:ae.clientX,y:ae.clientY,opener:ae.currentTarget,ids:wl.targetsFor(N)})},onTouchStart:ae=>ul(ae,(we,lt,Cn)=>Sl({x:we,y:lt,opener:Cn,ids:wl.targetsFor(N)})),onTouchMove:as,onTouchEnd:Tn,onTouchCancel:Tn}}function is(N){return{onContextMenu:ae=>{ae.preventDefault(),ql({x:ae.clientX,y:ae.clientY,opener:ae.currentTarget,ids:cl.targetsFor(N)})},onTouchStart:ae=>ul(ae,(we,lt,Cn)=>ql({x:we,y:lt,opener:Cn,ids:cl.targetsFor(N)})),onTouchMove:as,onTouchEnd:Tn,onTouchCancel:Tn}}function Ln(N){return{onContextMenu:ae=>{ae.preventDefault(),Et({x:ae.clientX,y:ae.clientY,opener:ae.currentTarget,ids:[N.id]})},onTouchStart:ae=>ul(ae,(we,lt,Cn)=>Et({x:we,y:lt,opener:Cn,ids:[N.id]})),onTouchMove:as,onTouchEnd:Tn,onTouchCancel:Tn}}function $l(N){return{onContextMenu:ae=>{ae.preventDefault(),Gl({x:ae.clientX,y:ae.clientY,opener:ae.currentTarget,ids:[N.id]})},onTouchStart:ae=>ul(ae,(we,lt,Cn)=>Gl({x:we,y:lt,opener:Cn,ids:[N.id]})),onTouchMove:as,onTouchEnd:Tn,onTouchCancel:Tn}}const rs=g.filter(N=>N.state!=="closed").length,yn=tn?St.find(N=>N.id===tn.ids[0]):void 0,zs=tn?[{id:"close",label:tn.ids.length>1?`Закрыть проекты (${tn.ids.length})`:"Закрыть проект",onSelect:()=>{V(tn.ids),Xt.clear()}},...Vo({folders:d,ids:tn.ids,hasFolder:(yn==null?void 0:yn.folderId)!=null,assign:(N,ae)=>ve("workspace",N,ae),onClear:()=>Xt.clear(),onNewFolder:()=>ct("workspace")}),...tn.ids.length===1&&bt?tl.menuItems(tn.ids[0],ls):[]]:[],da=tn?"закрытие не удаляет проект: каталог и история сессий остаются на диске — открыть его снова можно кнопкой «+ Проект»."+(E&&tn.ids.includes(E)&&rs>0?` в нём сейчас незавершённых сессий: ${rs} — при закрытии они остановятся на хосте.`:""):void 0,Nl=_n?Pt.find(N=>N.id===_n.ids[0]):void 0,kl=_n?[{id:"restore",label:_n.ids.length>1?`Вернуть проекты (${_n.ids.length})`:"Вернуть проект",onSelect:()=>{X(_n.ids),wl.clear()}},...Vo({folders:d,ids:_n.ids,hasFolder:(Nl==null?void 0:Nl.folderId)!=null,assign:(N,ae)=>ve("workspace",N,ae),onClear:()=>wl.clear(),onNewFolder:()=>ct("workspace")})]:[],ge=_n?"каталог и история сессий всё это время оставались на диске — восстановление их не трогает.":void 0,k=We?$n.find(N=>N.id===We.ids[0]):void 0,K=(k==null?void 0:k.pinned)!==!0,he=We?[...We.ids.length===1?[{id:"rename",label:"Переименовать",onSelect:()=>Ue(We.ids[0])}]:[],{id:"pin",label:K?We.ids.length>1?`Закрепить (${We.ids.length})`:"Закрепить":We.ids.length>1?`Открепить (${We.ids.length})`:"Открепить",onSelect:()=>{k&&B(k.workspaceId,We.ids,K),cl.clear()}},{id:"archive",label:We.ids.length>1?`Убрать в архив (${We.ids.length})`:"Убрать в архив",onSelect:()=>{A(E,We.ids),cl.clear()}},...Vo({folders:h,ids:We.ids,hasFolder:(k==null?void 0:k.folderId)!=null,assign:(N,ae)=>ve("session",N,ae,E),onClear:()=>cl.clear(),onNewFolder:()=>ct("session")}),...We.ids.length===1&&bt&&k?Ot.menuItems(xs(k),ss):[]]:[],Te=We?Fh:void 0,Ee=tt?Fe.find(N=>N.id===tt.ids[0]):void 0,He=tt?[{id:"rename",label:"Переименовать",onSelect:()=>Ue(tt.ids[0])},{id:"unpin",label:"Открепить",onSelect:()=>{Ee&&B(Ee.workspaceId,[Ee.id],!1)}},{id:"archive",label:"Убрать в архив",onSelect:()=>{Ee&&A(Ee.workspaceId,[Ee.id])}},...Ee&&Ee.workspaceId===E?Vo({folders:h,ids:[Ee.id],hasFolder:Ee.folderId!=null,assign:(N,ae)=>ve("session",N,ae,Ee.workspaceId),onClear:()=>{},onNewFolder:()=>ct("session")}):[],...cw(Ee?Vo({folders:m,ids:[Ee.id],hasFolder:Ee.pinnedFolderId!=null,assign:(N,ae)=>ve("pinned",N,ae),onClear:()=>{},onNewFolder:()=>ct("pinned")}):[]),...bt&&Ee?Ze.menuItems(xs(Ee),Ka):[]]:[],Ye=It?Ve.find(N=>N.id===It.ids[0]):void 0,Wt=It?[{id:"stop",label:"Остановить",onSelect:()=>{Ye&&H(Ye)}},{id:"rename",label:"Переименовать",onSelect:()=>Ue(It.ids[0])},{id:"pin",label:(Ye==null?void 0:Ye.pinned)===!0?"Открепить":"Закрепить",onSelect:()=>{Ye&&B(Ye.workspaceId,[Ye.id],Ye.pinned!==!0)}},{id:"archive",label:"Убрать в архив",onSelect:()=>{Ye&&A(Ye.workspaceId,[Ye.id])}},...bt&&Ye?On.menuItems(xs(Ye),Il):[]]:[];function Qt(N,ae){return a.jsxs("div",{"data-row-key":N.id,className:mc(N.id===E,Xt.selected.includes(N.id),!1,!!ae)+tl.dropClass(N.id),style:mt(ae),...Za(N),children:[Ie(ae),bt&&a.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить проект, чтобы изменить порядок в списке",...tl.gripHandlers(N.id),children:a.jsx(Cf,{})}),a.jsxs("button",{className:"row__main",onClick:we=>{nn()||Xt.click(we,N,()=>I(N.id))},onKeyDown:we=>tl.onKeyDown(N.id,we),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 yt(N,ae){return a.jsxs("div",{className:mc(N.id===E,wl.selected.includes(N.id),!1,!!ae),style:mt(ae),...Ls(N),children:[Ie(ae),a.jsxs("button",{className:"row__main",onClick:we=>{nn()||wl.click(we,N,()=>I(N.id))},children:[a.jsxs("span",{className:"row__title",children:[N.name,N.hasClaudeMd&&" ·"]}),a.jsx("span",{className:"row__meta",children:Cw(N)})]}),a.jsx("button",{className:"row__restore",title:"Вернуть проект из архива",onClick:()=>X([N.id]),children:"Вернуть"})]},N.id)}function mn(N,ae){const we=xs(N);return a.jsxs("div",{"data-row-key":we,className:mc(N.id===M,cl.selected.includes(N.id),N.provider==="antigravity",!!ae)+Ot.dropClass(we),style:mt(ae),...Oe===N.id?{}:is(N),children:[Ie(ae),Oe===N.id?a.jsx("div",{className:"row__main",children:a.jsx(oa,{value:N.title??"",onCommit:lt=>{J(N,lt),Ue(null)},onCancel:()=>Ue(null)})}):a.jsxs(a.Fragment,{children:[bt&&a.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...Ot.gripHandlers(we),children:a.jsx(Cf,{})}),a.jsxs("button",{className:"row__main",onClick:lt=>{nn()||cl.click(lt,N,()=>F(N))},onKeyDown:lt=>Ot.onKeyDown(we,lt),children:[a.jsx(Af,{title:N.title??"Без названия",pinned:N.pinned===!0,provider:N.provider,projectName:pe(N.workspaceId),projectPath:qe(N.workspaceId)}),a.jsx(Wh,{session:N,tail:new Date(N.updatedAt).toLocaleString()})]}),a.jsx("button",{className:"row__edit",title:"Переименовать","aria-label":"Переименовать сессию",onClick:()=>{nn()||Ue(N.id)},children:"✎"})]})]},N.id)}function Kt(N,ae){return a.jsxs("div",{className:mc(N.id===M,!1,N.provider==="antigravity",!!ae),style:mt(ae),children:[Ie(ae),a.jsxs("button",{className:"row__main",onClick:()=>F(N),children:[a.jsx(Af,{title:N.title??"Без названия",pinned:!1,provider:N.provider,projectName:pe(N.workspaceId),projectPath:qe(N.workspaceId)}),a.jsx("span",{className:"row__meta",children:Ew(N)})]}),a.jsx("button",{className:"row__restore",title:"Вернуть сессию из архива",onClick:()=>L([N.id]),children:"Вернуть"})]},N.id)}function nl(N,ae){const we=xs(N);return a.jsxs("div",{"data-row-key":we,className:mc(N.id===M,!1,N.provider==="antigravity",!!ae)+Ze.dropClass(we),style:mt(ae),...Oe===N.id?{}:{title:"Действия со строкой — правый клик или долгое нажатие",...Ln(N)},children:[Ie(ae),Oe===N.id?a.jsx("div",{className:"row__main",children:a.jsx(oa,{value:N.title??"",onCommit:lt=>{J(N,lt),Ue(null)},onCancel:()=>Ue(null)})}):a.jsxs(a.Fragment,{children:[bt&&a.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...Ze.gripHandlers(we),children:a.jsx(Cf,{})}),a.jsxs("button",{className:"row__main",onClick:()=>{nn()||D(N)},onKeyDown:lt=>Ze.onKeyDown(we,lt),children:[a.jsx(Af,{title:N.title??"Без названия",pinned:!1,provider:N.provider,projectName:pe(N.workspaceId),projectPath:qe(N.workspaceId)}),a.jsx(Wh,{session:N,tail:new Date(N.updatedAt).toLocaleString()})]})]})]},N.id)}function zn(N){const ae=xs(N);return a.jsx("div",{"data-row-key":ae,className:mc(N.id===M,!1,N.provider==="antigravity")+On.dropClass(ae),...Oe===N.id?{}:{title:"Действия со строкой — правый клик или долгое нажатие",...$l(N)},children:Oe===N.id?a.jsx("div",{className:"row__main",children:a.jsx(oa,{value:N.title??"",onCommit:we=>{J(N,we),Ue(null)},onCancel:()=>Ue(null)})}):a.jsxs(a.Fragment,{children:[bt&&a.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...On.gripHandlers(ae),children:a.jsx(Cf,{})}),a.jsxs("button",{className:"row__main",onClick:()=>{nn()||D(N)},onKeyDown:we=>On.onKeyDown(ae,we),children:[a.jsx(Af,{title:N.title??"Без названия",pinned:N.pinned===!0,provider:N.provider,projectName:pe(N.workspaceId),projectPath:qe(N.workspaceId)}),a.jsx(Wh,{session:N,tail:new Date(N.updatedAt).toLocaleString()})]}),a.jsx("button",{type:"button",className:"row__stop",title:"Остановить сессию","aria-label":"Остановить сессию",onClick:we=>{we.stopPropagation(),!nn()&&H(N)},children:a.jsx(mw,{})})]})},N.id)}function Xl(N,ae){return a.jsx(hw,{folder:N,count:ae,open:Le(N.id),renaming:Be===N.id,onToggle:()=>Ce(N.id),onStartRename:()=>on(N.id),onCommitRename:we=>{ie(N.id,we),on(null)},onCancelRename:()=>on(null),onDelete:()=>Se(N.id),color:ft(N),onPreviewColor:we=>{window.clearTimeout(un.current),Jt({folderId:N.id,color:we})},onCommitColor:we=>{Jt({folderId:N.id,color:we}),xe(N.id,we),window.clearTimeout(un.current),un.current=window.setTimeout(()=>Jt(null),4e3)},onResetColor:()=>{window.clearTimeout(un.current),Jt(null),xe(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[ye]}`,"aria-label":`Тема: ${Nb[ye]}. Переключить`,onClick:Re,children:a.jsx(jw,{mode:ye})})]}),a.jsxs("div",{className:"sidebar__tabs",role:"tablist","aria-label":"Что показывать в списке",children:[a.jsx("button",{type:"button",role:"tab","aria-selected":Rt==="default",className:Rt==="default"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>Tt("default"),children:a.jsx("span",{className:"sidebar__tab-label",children:"Все"})}),a.jsx("button",{type:"button",role:"tab","aria-selected":Rt==="pinned",className:Rt==="pinned"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>Tt("pinned"),children:a.jsx("span",{className:"sidebar__tab-label",children:"Закреплённые"})}),a.jsxs("button",{type:"button",role:"tab","aria-selected":Rt==="live",className:Rt==="live"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>Tt("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(xw,{}),a.jsx("input",{className:"fssearch__input",type:"text",value:Nn,spellCheck:!1,placeholder:"Проект или сессия…","aria-label":"Поиск по проектам и сессиям",onChange:N=>Wn(N.target.value),onKeyDown:N=>{N.stopPropagation(),N.key==="Escape"&&(N.preventDefault(),Nn?Wn(""):N.currentTarget.blur())}}),Nn&&a.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>Wn(""),children:"✕"})]}),a.jsx("div",{className:"sidebar__scroll",children:Rt==="pinned"?a.jsxs(a.Fragment,{children:[a.jsx(gc,{title:"Закреплённые",count:Fe.length,open:se("pinned"),onToggle:()=>$("pinned"),action:{label:"Новая папка закреплённых",onClick:()=>{ct("pinned"),se("pinned")||$("pinned")}}}),se("pinned")&&a.jsxs(a.Fragment,{children:[Sn==="pinned"&&a.jsx("div",{className:"row",children:a.jsx("div",{className:"row__main",children:a.jsx(oa,{value:"",placeholder:"Название папки",onCommit:N=>{Y("pinned",N),ct(null)},onCancel:()=>ct(null)})})}),Fe.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:rt?"Ничего не найдено":"закрепите сессию через её меню (правый клик или долгое нажатие) — она останется под рукой из любого проекта"})}),bl.groups.map(N=>a.jsxs(_.Fragment,{children:[Xl(N.folder,N.items.length),Le(N.folder.id)&&N.items.map(ae=>nl(ae,N.folder))]},N.folder.id)),bl.ungrouped.map(N=>nl(N))]})]}):Rt==="live"?a.jsxs(a.Fragment,{children:[a.jsx(gc,{title:"Запущенные",count:Ve.length,open:se("live"),onToggle:()=>$("live")}),se("live")&&a.jsxs(a.Fragment,{children:[Ve.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:rt?"Ничего не найдено":"Нет запущенных сессий"})}),Ve.map(N=>zn(N))]})]}):a.jsxs(a.Fragment,{children:[a.jsx(gc,{title:"Проекты",count:St.length,open:se("workspaces"),onToggle:()=>$("workspaces"),action:{label:"Новая папка проектов",onClick:()=>{ct("workspace"),se("workspaces")||$("workspaces")}}}),se("workspaces")&&a.jsxs(a.Fragment,{children:[Sn==="workspace"&&a.jsx("div",{className:"row",children:a.jsx("div",{className:"row__main",children:a.jsx(oa,{value:"",placeholder:"Название папки",onCommit:N=>{Y("workspace",N),ct(null)},onCancel:()=>ct(null)})})}),St.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:rt?"Ничего не найдено":"Пока ни одного"})}),_t.groups.map(N=>a.jsxs(_.Fragment,{children:[Xl(N.folder,N.items.length),Le(N.folder.id)&&N.items.map(ae=>Qt(ae,N.folder))]},N.folder.id)),_t.ungrouped.map(N=>Qt(N))]}),o.length>0&&a.jsxs(a.Fragment,{children:[a.jsx(gc,{title:"Архив проектов",count:Pt.length,open:se("workspacesArchive"),onToggle:()=>$("workspacesArchive"),hint:"проект закрывают вручную; каталог и история сессий остаются на диске и открываются заново отсюда или через «+ Проект»"}),se("workspacesArchive")&&a.jsxs(a.Fragment,{children:[Pt.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:rt?"Ничего не найдено":"Пока пусто"})}),Xn.groups.map(N=>a.jsxs(_.Fragment,{children:[Xl(N.folder,N.items.length),Le(N.folder.id)&&N.items.map(ae=>yt(ae,N.folder))]},N.folder.id)),Xn.ungrouped.map(N=>yt(N))]})]}),E&&a.jsxs(a.Fragment,{children:[a.jsx(gc,{title:"Сессии",count:$n.length,open:se("sessions"),onToggle:()=>$("sessions"),action:{label:"Новая папка сессий",onClick:()=>{ct("session"),se("sessions")||$("sessions")}}}),se("sessions")&&a.jsxs(a.Fragment,{children:[Sn==="session"&&a.jsx("div",{className:"row",children:a.jsx("div",{className:"row__main",children:a.jsx(oa,{value:"",placeholder:"Название папки",onCommit:N=>{Y("session",N,E),ct(null)},onCancel:()=>ct(null)})})}),$n.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:rt?"Ничего не найдено":"Пока ни одной"})}),Zn.groups.map(N=>a.jsxs(_.Fragment,{children:[Xl(N.folder,N.items.length),Le(N.folder.id)&&N.items.map(ae=>mn(ae,N.folder))]},N.folder.id)),Zn.ungrouped.map(N=>mn(N))]}),x.length>0&&a.jsxs(a.Fragment,{children:[a.jsx(gc,{title:"Архив",count:le.length,open:se("archive"),onToggle:()=>$("archive"),hint:"сессии без обращения дольше двух суток уезжают сюда сами; ничего не удаляется"}),se("archive")&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:"сюда сами уезжают сессии без обращения дольше двух суток; транскрипт остаётся на диске, ничего не удаляется"})}),le.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:rt?"Ничего не найдено":"Пока пусто"})}),Hl.groups.map(N=>a.jsxs(_.Fragment,{children:[Xl(N.folder,N.items.length),Le(N.folder.id)&&N.items.map(ae=>Kt(ae,N.folder))]},N.folder.id)),Hl.ungrouped.map(N=>Kt(N))]})]})]})]})}),a.jsxs("div",{className:"sidebar__foot",children:[a.jsxs("button",{className:"account-btn",title:"Аккаунт Claude",onClick:w,children:[a.jsx("span",{className:Me!=null&&Me.loggedIn?"dot dot--on":"dot"}),a.jsx("span",{className:"account-btn__id",children:Me===null?"Аккаунт":Me.loggedIn?Me.email||"Вход выполнен":"Войти в аккаунт"}),(Me==null?void 0:Me.plan)&&a.jsx("span",{className:"chip",children:Me.plan})]}),z&&a.jsxs("button",{className:"account-btn",title:"Доступ с телефона и из браузера",onClick:z,children:[a.jsx("span",{className:Z!=null&&Z.connected?"dot dot--on":"dot"}),a.jsx("span",{className:"account-btn__id",children:Z===null?"Удалённый доступ":Z.paired?Z.connected?Z.name||"Удалённый доступ включён":"Удалённый доступ · нет связи":"Удалённый доступ"}),(Z==null?void 0:Z.connected)&&Z.clients>0&&a.jsx("span",{className:"chip",children:Z.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:me,children:"Настройки"})]}),a.jsxs("div",{className:"sidebar__foot-row",children:[a.jsx("button",{className:"btn btn--ghost",onClick:Q,children:"+ Проект"}),a.jsx(ew,{disabled:!E,providers:ue,onStart:fe})]})]}),tn&&a.jsx(Ii,{x:tn.x,y:tn.y,items:zs,note:da,onClose:Yl}),_n&&a.jsx(Ii,{x:_n.x,y:_n.y,items:kl,note:ge,onClose:Vt}),We&&a.jsx(Ii,{x:We.x,y:We.y,items:he,note:Te,onClose:fl}),tt&&a.jsx(Ii,{x:tt.x,y:tt.y,items:He,note:Fh,onClose:En}),It&&a.jsx(Ii,{x:It.x,y:It.y,items:Wt,note:Fh,onClose:Ct})]})}function mc(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 Xo(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 aw(l,s,r){return[...l.flatMap(c=>c.items.map(r)),...s.map(r)]}const iw="\0ungrouped";function rw(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),iw);return c}function Jh(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 Ef(l){const[s,r]=_.useState(null),[c,o]=_.useState(null),d=_.useMemo(()=>aw(l.groups,l.ungrouped,l.itemKey),[l.groups,l.ungrouped,l.itemKey]),h=_.useMemo(()=>rw(l.groups,l.ungrouped,l.itemKey),[l.groups,l.ungrouped,l.itemKey]);function m(){r(null),o(null)}function g(I,F){l.enabled&&(F.preventDefault(),F.currentTarget.setPointerCapture(F.pointerId),r(I),o(null))}function x(I,F){var V;if(!s)return;const J=(V=document.elementFromPoint(I,F))==null?void 0:V.closest("[data-row-key]"),H=J==null?void 0:J.dataset.rowKey;if(!H||H===s||h.get(H)!==h.get(s)){o(null);return}const B=J.getBoundingClientRect(),D=F-B.top<B.height/2?"before":"after";o(X=>(X==null?void 0:X.key)===H&&X.position===D?X:{key:H,position:D})}function y(I){x(I.clientX,I.clientY)}function j(){if(s&&c){const I=Tf(d,s,c.key,c.position);I&&l.onReorder(l.scope,I,l.workspaceId)}m()}function v(I,F){if(!l.enabled)return;const J=Jh(I,l.groups,l.ungrouped,l.itemKey,F);if(!J)return;const H=Tf(d,I,J.target,J.position);H&&l.onReorder(l.scope,H,l.workspaceId)}function C(I,F){const J=Jh(I,l.groups,l.ungrouped,l.itemKey,"up"),H=Jh(I,l.groups,l.ungrouped,l.itemKey,"down"),B=[{id:"move-up",label:"Переместить выше",disabled:!J,onSelect:()=>{if(!J)return;const D=Tf(d,I,J.target,J.position);D&&l.onReorder(l.scope,D,l.workspaceId)}},{id:"move-down",label:"Переместить ниже",disabled:!H,onSelect:()=>{if(!H)return;const D=Tf(d,I,H.target,H.position);D&&l.onReorder(l.scope,D,l.workspaceId)}}];return F&&B.push({id:"reset-order",label:"Сбросить порядок",onSelect:()=>l.onReorder(l.scope,null,l.workspaceId)}),B}function T(I){return s===I?" row--dragging":(c==null?void 0:c.key)===I?c.position==="before"?" row--drop-before":" row--drop-after":""}function E(I){return{onPointerDown:F=>g(I,F),onPointerMove:y,onPointerUp:j,onPointerCancel:m}}function M(I,F){!F.altKey||F.key!=="ArrowUp"&&F.key!=="ArrowDown"||(F.preventDefault(),v(I,F.key==="ArrowUp"?"up":"down"))}return{dragging:s!==null,dropClass:T,gripHandlers:E,onKeyDown:M,menuItems:C}}function Vo(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 cw(l){return l.map(s=>({...s,id:`pinned:${s.id}`,label:s.id==="folder:new"?"Новая папка закреплённых…":s.id==="folder:none"?"Без папки закреплённых":s.label}))}function Ph(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,C]=y<j?[y,j]:[j,y];r(l.slice(v,C+1).map(T=>T.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 ow={display:"flex",alignItems:"center",gap:6,flex:1,minWidth:0,textAlign:"left"},uw={width:22,height:22,borderRadius:6};function gc({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:ow,"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:uw,title:d.label,"aria-label":d.label,onClick:d.onClick,children:a.jsx(bw,{})})]})}const Sb={paddingLeft:22},fw={display:"flex",alignItems:"center",gap:6,width:"100%"},dw={flex:1,minWidth:0,color:"var(--text-2)",fontWeight:500};function hw({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 C=_.useRef(null),T=_.useRef(j);return T.current=j,_.useEffect(()=>{const E=C.current;if(!E)return;const M=()=>T.current(E.value);return E.addEventListener("change",M),()=>E.removeEventListener("change",M)},[c]),c?a.jsx("div",{className:"row",style:Sb,children:a.jsx("div",{className:"row__main",children:a.jsx(oa,{value:l.name,placeholder:"Название папки",onCommit:h,onCancel:m})})}):a.jsxs("div",{className:"row",style:Sb,children:[a.jsxs("button",{className:"row__main",style:fw,"aria-expanded":r,title:r?`Свернуть папку «${l.name}»`:`Развернуть папку «${l.name}»`,onClick:o,children:[a.jsx(V_,{open:r}),a.jsx("span",{style:dw,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:C,type:"color",value:x??pw(),"aria-label":`Цвет папки «${l.name}»`,onChange:E=>y(E.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 pw(){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 Cf(){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 mw(){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 gw({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 xw(){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 bw(){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 _w(){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 yw(){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 vw(){try{const l=localStorage.getItem($_);return l==="pinned"||l==="live"?l:"default"}catch{return"default"}}const Nb={system:"как в системе",light:"светлая",dark:"тёмная",gpt:"GPT — чёрная и красная"};function jw({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"||l==="gpt"?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 ww(l){const s=Sw(l),r=(l.tasks??[]).filter(c=>c.kind==="agent").length;return r>0?`${s} · ${G_(r)}`:s}function Sw(l){switch(l.state){case"running":return"работает";case"waiting_permission":return"ждёт разрешения";case"idle":return l.backgroundWork?"работает в фоне":Nw(l.lastTurn);case"starting":return"запускается";case"reconnecting":return"переподключается";case"error":return"ошибка";case"closed":return"на диске"}}function Nw(l){switch(l){case"interrupted":return"прервана";case"stopped":return"остановлена";case"failed":return"оборвалась";case"completed":return"готова";case null:return"ждёт задачу"}}function kw(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":Tw(l.lastTurn);case"error":return"error";case"closed":return"closed"}}function Tw(l){switch(l){case"interrupted":case"stopped":return"halted";case"failed":return"error";case"completed":return"ready";case null:return"fresh"}}function Wh({session:l,tail:s}){return a.jsxs("span",{className:"row__meta",children:[a.jsxs("span",{className:`row__state row__state--${kw(l)}`,children:[a.jsx("span",{className:"row__state-dot","aria-hidden":"true"}),ww(l)]})," · ",s]})}function Af({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(gw,{className:"row__pin"}),r==="codex"&&a.jsx("span",{className:"row__provider codex-mark",title:"Codex",children:"C"}),r==="antigravity"&&a.jsx(Lp,{className:"row__provider"}),l]}),a.jsx("span",{className:"row__project",title:o,children:c})]})}function Ew(l){const s=l.archivedAuto?"сама, по сроку молчания":"убрана вручную";return l.archivedAt?`${new Date(l.archivedAt).toLocaleString()} · ${s}`:s}function Cw(l){return l.archivedAt?`закрыт ${new Date(l.archivedAt).toLocaleString()}`:"закрыт"}const kb=3,Aw=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=ep(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=Ow(Mw(ep(r.old_string),ep(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 ep(l){if(l==="")return[];const s=l.split(/\r?\n/);return s.length>1&&s[s.length-1]===""&&s.pop(),s}function Mw(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),...Rw(l.slice(r,c),s.slice(r,o)),...l.slice(c).map(d)]}function Rw(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)>Aw)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 Dw(m)}function Dw(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 Ow(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} ${Lw(c.length)} без изменений`}),c=[]}return l.forEach((d,h)=>{s[h]?(o(),r.push(d)):c.push(d)}),o(),r}function Lw(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 fa(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,Nr="Копировать",wc="Скопировано";function Dc({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?wc:`${Nr} ${s}`,title:c?wc:`${Nr} ${s}`,onClick:()=>{fa(l).then(d=>{d&&o(!0)})},children:c?wc:Nr})}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 zw({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),C=_.useRef(null),T=_.useRef(null),E=_.useRef(!1);_.useEffect(()=>{v.current=!0,C.current=null,E.current=!1,T.current!==null&&(clearTimeout(T.current),T.current=null)},[m]),_.useEffect(()=>{const H=y.current,B=j.current;if(!H||!B)return;function D(A){!H||A===H.scrollTop||(E.current=!0,H.scrollTop=A)}function V(){if(!H)return;const A=C.current;if(A){const L=Eb(H,A.id);if(L){const Y=L.getBoundingClientRect().top-H.getBoundingClientRect().top;D(H.scrollTop+(Y-A.top))}T.current!==null&&clearTimeout(T.current),T.current=setTimeout(()=>{C.current=null},500);return}v.current&&D(H.scrollHeight)}const X=new ResizeObserver(V);return X.observe(B),()=>{X.disconnect(),T.current!==null&&clearTimeout(T.current)}},[]);function M(){const H=y.current;if(H){if(E.current){E.current=!1;return}v.current=H.scrollHeight-H.scrollTop-H.clientHeight<80}}function I(){if(d)return;const H=y.current,B=c[0];if(H&&B){const D=Eb(H,B.id);D&&(C.current={id:B.id,top:D.getBoundingClientRect().top-H.getBoundingClientRect().top})}h==null||h()}let F=0;function J(H){return H.kind==="user"?F++:-1}return a.jsx("div",{className:"transcript",ref:y,onScroll:M,children:a.jsxs("div",{className:"stream",ref:j,children:[o&&a.jsx("button",{type:"button",className:"transcript__more",onClick:I,disabled:d,children:d?"Загружаем…":"Показать более раннее"}),c.map(H=>a.jsx(Tb,{item:H,userIndex:J(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:J(H),onEditMessage:g},H.id)),s&&a.jsx(zw,{waiting:r})]})})}function Tb({item:l,userIndex:s,onEditMessage:r}){switch(l.kind){case"user":return a.jsx(Hw,{item:l,userIndex:s,onEditMessage:r});case"assistant":return a.jsxs("div",{className:"msg--assistant","data-item-id":l.id,children:[a.jsx(Bw,{text:l.text}),l.streaming&&a.jsx("span",{className:"caret"}),l.text.trim()!==""&&a.jsx("div",{className:"msg--assistant__foot",children:a.jsx(Dc,{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(qw,{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 Uw=500;function Hw({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=Pf("(max-width: 860px)"),v=_.useRef(null);function C(X,A){o({x:X,y:A})}function T(X){X.preventDefault(),C(X.clientX,X.clientY)}function E(X){const A=X.touches[0];if(!A)return;const L={timer:0,x:A.clientX,y:A.clientY,fired:!1};L.timer=window.setTimeout(()=>{L.fired=!0,C(L.x,L.y)},Uw),v.current=L}function M(X){const A=v.current,L=X.touches[0];!A||!L||Math.hypot(L.clientX-A.x,L.clientY-A.y)>10&&(window.clearTimeout(A.timer),v.current=null)}function I(X){const A=v.current;A&&(window.clearTimeout(A.timer),A.fired&&X.preventDefault())}function F(){g(l.text),h(!0)}function J(){h(!1)}function H(){const X=m.trim();if(X===""&&!(l.images&&l.images.length>0))return;const A=r==null?void 0:r(s,X,l.images);if(A instanceof Promise){if(y.current)return;y.current=!0,A.then(L=>{y.current=!1,L&&h(!1)},()=>{y.current=!1});return}A!==!1&&h(!1)}_.useEffect(()=>{const X=x.current;!X||!d||(X.style.height="auto",X.style.height=`${X.scrollHeight}px`)},[m,d]),_.useEffect(()=>{if(!d)return;const X=x.current;X&&(X.focus(),X.setSelectionRange(X.value.length,X.value.length))},[d]);function B(X){if(X.key==="Escape"){X.preventDefault(),X.stopPropagation(),J();return}X.key==="Enter"&&!X.shiftKey&&!j&&(X.preventDefault(),H())}const D=l.images&&l.images.length>0&&a.jsx("div",{className:"msg--user__images",children:l.images.map((X,A)=>a.jsx("img",{className:"msg--user__image",src:`data:${X.mediaType};base64,${X.data}`,alt:"Вложение"},A))});if(d){const X=m.trim()!==""||!!(l.images&&l.images.length>0);return a.jsxs("div",{className:"msg--user msg--user--editing","data-item-id":l.id,children:[D,a.jsxs("div",{className:"msg--user__edit",children:[a.jsx("textarea",{ref:x,className:"msg--user__edit-field",value:m,onChange:A=>g(A.target.value),onKeyDown:B,rows:1}),a.jsxs("div",{className:"msg--user__edit-actions",children:[a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:J,children:"Отмена"}),a.jsx("button",{type:"button",className:"btn btn--sm btn--primary",onClick:H,disabled:!X,children:"Сохранить"})]})]})]})}const V=[{id:"copy",label:"Копировать",onSelect:()=>void fa(l.text)},...r?[{id:"edit",label:"Изменить",onSelect:F}]:[]];return a.jsxs("div",{className:"msg--user","data-item-id":l.id,onContextMenu:T,onTouchStart:E,onTouchMove:M,onTouchEnd:I,onTouchCancel:I,children:[D,l.text,c&&a.jsx(Ii,{x:c.x,y:c.y,items:V,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 Bw({text:l}){const[s,r]=_.useState(""),c=_.useRef([]);_.useEffect(()=>{let d=!1;return td(l).then(h=>{d||r(Iw(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!==""&&fa(m).then(y=>{if(!y)return;h.textContent=wc,h.setAttribute("aria-label",wc),h.classList.add("copybtn--done");const j=window.setTimeout(()=>{h.isConnected&&(h.textContent=Nr,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=`${Nr} блок кода`;function Iw(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=Nr,c.append(o)}return s.body.innerHTML}function qw({item:l}){const[s,r]=_.useState(!1),c=l.result===null,o=Q_(l.name,l.input),d=l.name==="AskUserQuestion"?$w(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?Yw(d):Gw(l.input)}),a.jsx("span",{className:"tool__status",children:c?"…":l.isError?"ошибка":s?"▴":"▾"})]}),s&&a.jsxs("div",{className:"tool__body",children:[d?a.jsx(Xw,{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(Dc,{text:l,hint:s,className:"codeblock__copy"})]})}function Gw(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 Yw(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 $w(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 Xw({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 Vw="ccv.dictation.lang",Mb="ru-RU";function Qw(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(Qw);return!r&&s.length>0&&Ms("распознавание подменено: родной реализации в странице нет"),r??s[0]??null}function K_(){var l;try{return((l=localStorage.getItem(Vw))==null?void 0:l.trim())||Mb}catch{return Mb}}function Ms(l,s){s===void 0?console.debug(`[dictation] ${l}`):console.debug(`[dictation] ${l}`,s)}const Kw=3,Zw=400,Fw=5,Jw=250,Pw=2e3,Ww=2e4;async function eS(){try{return(await navigator.permissions.query({name:"microphone"})).state==="granted"}catch{return!1}}const tS={"not-allowed":"Браузер не дал доступ к микрофону","service-not-allowed":"Браузер не дал доступ к микрофону","audio-capture":"Микрофон не найден",network:"Сервис распознавания недоступен","language-not-supported":`Распознавание не знает языка ${K_()}`};function nS(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),C=_.useRef(null),T=_.useCallback(()=>{C.current&&clearTimeout(C.current),C.current=null},[]),E=_.useCallback(()=>{T();const H=async B=>{if(C.current=null,!(!m.current||v.current)){if(!B&&!await eS()){if(Ms("ждём ответа на запрос доступа к микрофону"),!m.current||v.current)return;C.current=setTimeout(()=>void H(!0),Ww);return}Ms("движок не ответил на start()"),m.current=!1,c(!1),d("Распознавание не отвечает — проверьте расширения браузера и доступ к микрофону")}};C.current=setTimeout(()=>void H(!1),Pw)},[T]);_.useEffect(()=>{x.current=l}),_.useEffect(()=>{const H=Rb();if(!H)return;const B=new H;return B.lang=K_(),B.continuous=!0,B.interimResults=!0,B.onstart=()=>{Ms("сессия открыта"),v.current=!0,T(),c(!0)},B.onaudiostart=()=>{Ms("пошёл звук с микрофона"),y.current.audio=!0},B.onresult=D=>{var L;if(g.current)return;let V="",X="";for(let Y=D.resultIndex;Y<D.results.length;Y++){const ie=D.results[Y];if(!ie)continue;const xe=((L=ie[0])==null?void 0:L.transcript)??"";ie.isFinal?V+=xe:X+=xe}const A=y.current;A.heard=!0,A.everHeard=!0,Ms("распознано",{final:V,interim:X}),x.current(V,X)},B.onerror=D=>{y.current.lastError=D.error,Ms("ошибка движка",D.error),!(D.error==="no-speech"||D.error==="aborted")&&(m.current=!1,c(!1),d(tS[D.error]??`Распознавание не работает: ${D.error}`))},B.onend=()=>{g.current=!1,v.current=!1;const D=y.current,V=Date.now()-D.openedAt;if(Ms("сессия закрыта",{мс:V,звук:D.audio,слова:D.heard,ошибка:D.lastError||null}),!m.current){c(!1);return}if(D.dead=!D.audio&&V<Zw?D.dead+1:0,D.dead>=Fw){m.current=!1,c(!1),d(D.lastError?`Распознавание не работает: ${D.lastError}`:"Распознавание закрывается сразу после запуска — проверьте доступ к микрофону в настройках сайта");return}D.silent=D.heard?0:D.silent+1,!D.everHeard&&!D.warned&&D.silent>=Kw&&(D.warned=!0,d(D.audio?"Микрофон слушает, но речь не распознаётся — проверьте язык диктовки и уровень звука":"С микрофона не идёт звук — проверьте устройство ввода в настройках сайта в браузере")),j.current=setTimeout(()=>{if(j.current=null,!!m.current){D.openedAt=Date.now(),D.audio=!1,D.heard=!1,D.lastError="",E();try{B.start()}catch{}}},Jw)},h.current=B,()=>{m.current=!1,j.current&&clearTimeout(j.current),j.current=null,T(),B.onend=null,B.onresult=null,B.onerror=null,B.onstart=null,B.onaudiostart=null,B.abort(),h.current=null}},[]);const M=_.useCallback(()=>{var H;if(m.current){if(m.current=!1,Ms("выключение микрофона"),j.current&&clearTimeout(j.current),j.current=null,T(),!v.current){c(!1);return}(H=h.current)==null||H.stop()}},[]),I=_.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),Ms("включение микрофона",{язык:H.lang}),E();try{H.start()}catch(B){Ms("start() не прошёл",B)}}},[E]),F=_.useCallback(()=>{m.current?M():I()},[I,M]),J=_.useCallback(()=>{var H;m.current&&v.current&&(g.current=!0,(H=h.current)==null||H.abort())},[]);return{supported:s,listening:r,error:o,toggle:F,stop:M,drop:J}}const lS="(max-width: 860px)",Db=/^\/(\S*)$/,sS=new Set(["model","permissions"]);function aS(l){return sS.has(l.name)||l.name.startsWith("__")}const iS=new Set(["clear","rename"]),Ob=/(?:^|\s)@([^\s@]*)$/,rS=200,cS=100,oS=190,uS=5,fS=20*1024*1024,dS=1568,hS=.85;let Lb=0;async function pS(l){var j,v;if(!l.type.startsWith("image/")||l.size>fS)return null;const s=await mS(l);if(!s)return null;const{width:r,height:c}=s;if(r<=0||c<=0)return null;const o=Math.min(1,dS/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:hS),y=x.slice(x.indexOf(",")+1);return y?(Lb+=1,{id:`att${Lb}`,mediaType:g,data:y,previewUrl:x}):null}async function mS(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:C,onSend:T,onInterrupt:E,onEscape:M}){var bt;const I=Pf(lS),[F,J]=_.useState(()=>m?Ih(m):""),[H,B]=_.useState(!1),[D,V]=_.useState(0),X=_.useRef(null),A=_.useRef(null),L=_.useRef(!1),Y=_.useRef(null),[ie,xe]=_.useState(()=>m?Ih(m).length:0),[Se,ve]=_.useState([]),Q=_.useRef(null),fe=_.useCallback($=>{!y||$.length===0||Promise.all($.map(pS)).then(se=>{const Ce=se.filter(Le=>Le!==null);Ce.length!==0&&ve(Le=>[...Le,...Ce].slice(0,uS))})},[y]);function ue($){ve(se=>se.filter(Ce=>Ce.id!==$))}function _e($){var Le;if(!y)return;const se=(Le=$.clipboardData)==null?void 0:Le.items;if(!se)return;const Ce=[];for(const _t of se){if(!_t.type.startsWith("image/"))continue;const Xn=_t.getAsFile();Xn&&Ce.push(Xn)}Ce.length!==0&&($.preventDefault(),fe(Ce))}function Me($){const se=$.target.files?Array.from($.target.files):[];$.target.value="",fe(se)}_.useEffect(()=>{y||ve([])},[y]);const[w,Z]=_.useState([]),[z,me]=_.useState(-1),ye=_.useRef(""),[Re,Oe]=_.useState(""),Ue=nS(_.useCallback(($,se)=>{$&&J(Ce=>tp(Ce,$)),Oe(se.trim())},[])),Be=Re?tp(F,Re):F;_.useEffect(()=>{Ue.listening||Re===""||(J($=>tp($,Re)),Oe(""))},[Ue.listening,Re]),_.useEffect(()=>{var $;x&&(($=X.current)==null||$.focus())},[x]);const on=_.useRef(new Map),Ke=_.useRef(new Map),Jt=_.useRef(m),ft=_.useRef({text:F,caret:ie});ft.current={text:F,caret:ie};const mt=_.useCallback(($,se,Ce)=>{se===""?(on.current.delete($),Ke.current.delete($)):(on.current.set($,se),Ke.current.set($,Ce)),u_($,se)},[]),Ie=Ue.drop;_.useLayoutEffect(()=>{const $=Jt.current;if($===m)return;Jt.current=m,$&&mt($,ft.current.text,ft.current.caret);const se=m?on.current.get(m)??Ih(m):"",Ce=m?Ke.current.get(m):void 0,Le=Math.min(Ce??se.length,se.length);J(se),xe(Le),Y.current=[Le,Le],Oe(""),V(0),B(!1),me(-1),ye.current="",ve([]),Ie()},[m,mt,Ie]),_.useEffect(()=>{m&&mt(m,F,ie)},[m,F,ie,mt]);const un=l?"Выберите сессию":j?"Нет VPN — отправка остановлена":h??"Опишите задачу… («/» — команды, «@» — файлы)",Sn=_.useRef(0),ct=_.useCallback($=>{const se=parseFloat(getComputedStyle($).maxHeight),Ce=Number.isFinite(se)&&se>0?se:oS;$.style.height="auto";const Le=$.scrollHeight;$.style.height=`${Math.min(Le,Ce)}px`,$.style.overflowY=Le>Ce?"auto":"hidden"},[]);_.useEffect(()=>{const $=X.current;$&&ct($)},[Be,un,l,ct]),_.useLayoutEffect(()=>{const $=X.current,se=Y.current;!$||!se||(Y.current=null,$.setSelectionRange(se[0],se[1]))}),_.useEffect(()=>{const $=X.current;if(!$)return;const se=new ResizeObserver(([Ce])=>{const Le=Ce==null?void 0:Ce.contentRect.width;Le===void 0||Math.abs(Le-Sn.current)<1||(Sn.current=Le,ct($))});return se.observe($),()=>se.disconnect()},[ct]);const Nn=Ue.stop;_.useEffect(()=>{l&&Nn()},[l,Nn]);const Wn=_.useMemo(()=>Ue.error?{ok:!1,message:Ue.error}:null,[Ue.error]),fn=_.useMemo(()=>{var Ce;const $=(Ce=Db.exec(F))==null?void 0:Ce[1];if($===void 0)return[];const se=$.toLowerCase();return r.filter(Le=>!aS(Le)&&np(Le,se)<F_).sort((Le,_t)=>np(Le,se)-np(_t,se))},[F,r]),el=!H&&fn.length>0,Bt=Math.min(D,fn.length-1),at=H?null:((bt=Ob.exec(Be.slice(0,ie)))==null?void 0:bt[1])??null,Rt=_.useRef(v);Rt.current=v,_.useEffect(()=>{if(at===null||at===""||at.endsWith("/")){Rt.current(at);return}const $=setTimeout(()=>Rt.current(at),rS);return()=>clearTimeout($)},[at]);const Yn=at!==null&&(o==null?void 0:o.query)===at,Tt=Yn?o.entries:[],et=at!==null,rt=et&&!Yn,pn=Math.min(D,Math.max(Tt.length-1,0));_.useEffect(()=>{var se,Ce;if(!el&&!et)return;const $=el?Bt:pn;(Ce=(se=A.current)==null?void 0:se.children[$])==null||Ce.scrollIntoView({block:"nearest"})},[el,et,Bt,pn]);function bn($,se){var Ce;J($),xe(se),Y.current=[se,se],V(0),B(!1),Re!==""&&(Oe(""),Ue.drop()),(Ce=X.current)==null||Ce.focus()}function Kn(){J(""),Oe(""),V(0),xe(0),B(!1),me(-1),ye.current="",ve([]),Ue.drop(),m&&mt(m,"",0)}function en($){const se=$.trim();if(se===""&&Se.length===0||l||j||L.current)return;const Ce=T(se,Se.length>0?Se.map(Le=>({mediaType:Le.mediaType,data:Le.data})):void 0);if(Ce instanceof Promise){L.current=!0,Ce.then(Le=>{L.current=!1,Le&&St(se)},()=>{L.current=!1});return}Ce!==!1&&St(se)}function St($){$!==""&&Z(se=>[$,...se.filter(Ce=>Ce!==$)].slice(0,cS)),Kn()}function Pt($){if($<-1||$>=w.length)return;z===-1&&(ye.current=F);const se=$===-1?ye.current:w[$]??"";me($),bn(se,se.length)}function Dt(){var Le;const $=((Le=X.current)==null?void 0:Le.selectionStart)??Be.length,Ce=`${$>0&&!/\s$/.test(Be.slice(0,$))?" ":""}@`;bn(Be.slice(0,$)+Ce+Be.slice($),$+Ce.length)}function $n($){var _t;const se=(_t=Ob.exec(Be.slice(0,ie)))==null?void 0:_t[1];if(se===void 0)return;const Ce=ie-se.length-1,Le=$.kind==="dir"?`@${$.path}/`:`@${$.path} `;bn(Be.slice(0,Ce)+Le+Be.slice(ie),Ce+Le.length)}function le(){var se;if(j)return;const $=(se=Db.exec(Be.trim()))==null?void 0:se[1];if($&&C($)){Kn();return}en(Be)}function pe($,se){J($),xe(se),V(0),B(!1),me(-1),Re!==""&&(Oe(""),Ue.drop())}function qe($){var Le;const se=iS.has($.name)?c:null,Ce=`/${$.name} `;J(Ce+(se??"")),xe(Ce.length+((se==null?void 0:se.length)??0)),se&&(Y.current=[Ce.length,Ce.length+se.length]),V(0),(Le=X.current)==null||Le.focus()}function Fe($){if(C($.name)){J(""),V(0),B(!1);return}$.argumentHint?qe($):en(`/${$.name}`)}function Ve($){if(el){if($.key==="ArrowDown")return $.preventDefault(),V(se=>(Math.min(se,fn.length-1)+1)%fn.length);if($.key==="ArrowUp"){$.preventDefault();const se=fn.length-1;return V(Ce=>(Math.min(Ce,se)+se)%fn.length)}if($.key==="Enter"&&!$.shiftKey){$.preventDefault();const se=fn[Bt];se&&Fe(se);return}if($.key==="Tab"){$.preventDefault();const se=fn[Bt];se&&qe(se);return}if($.key==="Escape"){$.preventDefault(),$.stopPropagation(),B(!0);return}}if(et){if($.key==="ArrowDown"&&Tt.length>0)return $.preventDefault(),V(se=>(Math.min(se,Tt.length-1)+1)%Tt.length);if($.key==="ArrowUp"&&Tt.length>0){$.preventDefault();const se=Tt.length-1;return V(Ce=>(Math.min(Ce,se)+se)%Tt.length)}if($.key==="Enter"&&!$.shiftKey||$.key==="Tab"){const se=Tt[pn];if(se){$.preventDefault(),$n(se);return}if($.key==="Tab")return}if($.key==="Escape"){$.preventDefault(),$.stopPropagation(),B(!0);return}}if(($.key==="ArrowUp"||$.key==="ArrowDown")&&!$.shiftKey){const se=$.currentTarget,Ce=se.selectionStart;if(se.selectionEnd===Ce){const _t=$.key==="ArrowUp"?z+1:z-1;_t>=-1&&_t<w.length&&requestAnimationFrame(()=>{se.selectionStart===Ce&&se.selectionEnd===Ce&&Pt(_t)})}}if($.key==="Escape"&&M){$.preventDefault(),$.stopPropagation(),M();return}$.key==="Enter"&&!$.shiftKey&&!I&&($.preventDefault(),le())}return a.jsx("div",{className:d?`composer ${d}`:"composer",children:a.jsxs("div",{className:"composer__inner",children:[a.jsx(Er,{result:Wn}),et&&!el&&a.jsxs("div",{className:"cmdmenu",role:"listbox",ref:A,children:[Tt.map(($,se)=>a.jsxs("button",{role:"option","aria-selected":se===pn,className:se===pn?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>V(se),onMouseDown:Ce=>{Ce.preventDefault(),$n($)},children:[a.jsxs("span",{className:"cmdmenu__name",children:[$.name,$.kind==="dir"?"/":""]}),a.jsx("span",{className:"cmdmenu__desc",children:$.path}),$.ignored&&a.jsx("span",{className:"cmdmenu__tag",children:"git-ignore"})]},$.path)),Tt.length===0&&a.jsx("div",{className:"cmdmenu__empty",children:rt?"ищем…":at?"Ничего не нашлось":"Наберите имя файла или каталога"})]}),el&&a.jsx("div",{className:"cmdmenu",role:"listbox",ref:A,children:fn.map(($,se)=>a.jsxs("button",{role:"option","aria-selected":se===Bt,className:se===Bt?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>V(se),onMouseDown:Ce=>{Ce.preventDefault(),Fe($)},children:[a.jsxs("span",{className:"cmdmenu__name",children:["/",$.name]}),$.argumentHint&&a.jsx("span",{className:"cmdmenu__hint",children:$.argumentHint}),a.jsx("span",{className:"cmdmenu__desc",children:$.description})]},$.name))}),Se.length>0&&a.jsx("div",{className:"composer__attachments",children:Se.map($=>a.jsxs("div",{className:"composer__thumb",children:[a.jsx("img",{src:$.previewUrl,alt:"Вложение"}),a.jsx("button",{type:"button",className:"composer__thumb-remove","aria-label":"Удалить вложение",onClick:()=>ue($.id),children:a.jsx(vS,{})})]},$.id))}),a.jsxs("div",{className:"composer__field",children:[a.jsx("button",{type:"button",className:"addbtn",title:"Добавить контекст — файл проекта («@»)","aria-label":"Добавить контекст",disabled:l,onClick:Dt,children:a.jsx(bS,{})}),y&&a.jsxs(a.Fragment,{children:[a.jsx("input",{ref:Q,type:"file",accept:"image/*",multiple:!0,className:"composer__fileinput",tabIndex:-1,"aria-hidden":"true",onChange:Me}),a.jsx("button",{type:"button",className:"attachbtn",title:"Прикрепить изображение","aria-label":"Прикрепить изображение",disabled:l,onClick:()=>{var $;return($=Q.current)==null?void 0:$.click()},children:a.jsx(yS,{})})]}),a.jsx("textarea",{ref:X,value:Be,disabled:l,placeholder:un,onChange:$=>pe($.target.value,$.target.selectionStart),onSelect:$=>xe($.currentTarget.selectionStart),onKeyDown:Ve,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(jS,{on:Ue.listening})}),s?a.jsx("button",{className:"btn",onClick:E,title:"Прервать (Esc)",children:"Стоп"}):a.jsxs("button",{className:"btn btn--primary sendbtn",onClick:le,disabled:l||j||Be.trim()===""&&Se.length===0,"aria-label":g,title:j?"Нет VPN — отправка остановлена":g,children:[a.jsx("span",{className:"sendbtn__label",children:g}),a.jsx(_S,{})]})]})]})})}function tp(l,s){const r=s.trim();if(r==="")return l;const c=_p(r).slice(gS(l,r)).join(" ");return c===""?l:l===""||/\s$/.test(l)?l+c:`${l} ${c}`}function gS(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)=>xS(d,c[h]??"")))return o;return 0}function _p(l){return l.split(/\s+/).filter(s=>s!=="")}function xS(l,s){const r=c=>c.toLowerCase().replace(/[.,!?;:…]+$/u,"");return r(l)===r(s)}function bS(){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 _S(){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 yS(){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 vS(){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 jS({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 np(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 wS({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(SS,{text:m}):a.jsx("textarea",{className:"plansheet__source",value:m,onChange:C=>g(C.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 SS({text:l}){const[s,r]=_.useState("");return _.useEffect(()=>{let c=!1;return td(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 NS({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 kS({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 TS({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 C=_.useMemo(()=>CS(h,m,x),[h,m,x]),T=C!==null;function E(B,D){var V,X;(X=(V=h[B])==null?void 0:V.options[D])!=null&&X.preview&&v(A=>{const L=A.slice();return L[B]=D,L})}function M(B,D,V){g(X=>{const A=X.slice(),L=new Set(A[B]);return V?L.has(D)?L.delete(D):L.add(D):L.has(D)||(L.clear(),L.add(D)),A[B]=L,A}),D!=="other"&&E(B,D)}function I(B,D){y(V=>{const X=V.slice();return X[B]=D,X})}function F(){C&&o(l.requestId,C)}function J(B){B.key==="Enter"&&(B.target.closest("button")||T&&(B.preventDefault(),F()))}function H(B){var A;if(!["ArrowDown","ArrowUp","ArrowRight","ArrowLeft"].includes(B.key))return;const D=Array.from(B.currentTarget.querySelectorAll("button.qsheet__option")),V=D.indexOf(document.activeElement);if(V===-1)return;B.preventDefault();const X=B.key==="ArrowDown"||B.key==="ArrowRight"?1:-1;(A=D[(V+X+D.length)%D.length])==null||A.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":"Вопрос от агента",onKeyDown:J,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,D)=>a.jsx(ES,{q:B,qi:D,selected:m[D]??new Set,otherText:x[D]??"",previewIndex:j[D]??null,onToggle:M,onFocusOption:E,onOtherText:I,onOptionsKeyDown:H},D))]}),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:!T,onClick:F,children:"Ответить"})]})]})})}function ES({q:l,qi:s,selected:r,otherText:c,previewIndex:o,onToggle:d,onFocusOption:h,onOtherText:m,onOptionsKeyDown:g}){var C;const x=l.options.some(T=>T.preview),y=o!==null?(C=l.options[o])==null?void 0:C.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((T,E)=>{const M=r.has(E);return a.jsxs("button",{type:"button",role:v,"aria-checked":M,className:"qsheet__option"+(M?" is-selected":""),onClick:()=>d(s,E,l.multiSelect),onFocus:()=>h(s,E),onMouseEnter:()=>h(s,E),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:T.label}),a.jsx("span",{className:"qsheet__opt-desc",children:T.description})]})]},E)}),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:T=>m(s,T.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 CS(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 AS(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 fa(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(MS,{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?wc:Nr})]})]})}function MS({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 RS=["low","medium","high"];function W_({models:l,value:s,effort:r,ultracode:c,thinking:o,switchOnFlag:d,showSwitchOnFlag:h=!0,showUltracode:m=!0,showThinking:g=!0,className:x,onModel:y,onEffort:j,onUltracode:v,onThinking:C,onSwitchOnFlag:T}){const[E,M]=_.useState(!1),[I,F]=_.useState(0),J=_.useRef(null),H=_.useRef(null),B=l.find(L=>L.value===s)??null,D=B&&B.supportsEffort?B.effortLevels.length>0?B.effortLevels:RS:[],V=D.includes("xhigh");_.useEffect(()=>{if(!E)return;const L=l.findIndex(Y=>Y.value===s);F(L===-1?0:L)},[E]),_.useEffect(()=>{if(!E)return;function L(Y){var ie;(ie=J.current)!=null&&ie.contains(Y.target)||M(!1)}return document.addEventListener("mousedown",L),()=>document.removeEventListener("mousedown",L)},[E]),_.useEffect(()=>{var L,Y;E&&((Y=(L=H.current)==null?void 0:L.querySelector(".is-cursor"))==null||Y.scrollIntoView({block:"nearest"}))},[E,I]);function X(L){M(!1),L.value!==s&&y(L.value)}function A(L){if(L.key==="Escape"){if(!E)return;L.preventDefault(),L.stopPropagation(),M(!1);return}if(L.key==="ArrowDown"||L.key==="ArrowUp"){if(L.preventDefault(),!E)return M(!0);if(l.length===0)return;const Y=L.key==="ArrowDown"?1:l.length-1;return F(ie=>(ie+Y)%l.length)}if(L.key==="Enter"||L.key===" "){if(L.preventDefault(),!E)return M(!0);const Y=l[I];Y&&X(Y)}}return a.jsxs("div",{ref:J,className:"select"+(E?" select--open":"")+(x?` ${x}`:""),children:[a.jsxs("button",{type:"button",className:"select__trigger",title:"Модель, усилие и размышления","aria-label":"Модель, усилие и размышления","aria-haspopup":"menu","aria-expanded":E,onClick:()=>M(L=>!L),onKeyDown:A,children:[(B==null?void 0:B.displayName)??s?a.jsx("span",{className:"select__value",children:(B==null?void 0:B.displayName)??s}):a.jsx("span",{className:"select__value select__value--muted",children:"по умолчанию"}),c?a.jsx("span",{className:"select__suffix select__suffix--hot",children:"ultracode"}):D.length>0&&r&&a.jsx("span",{className:"select__suffix",children:r}),a.jsx(DS,{})]}),E&&a.jsxs("div",{ref:H,className:"select__menu modelmenu",role:"menu",children:[a.jsx("div",{className:"modelmenu__head",children:"Модель"}),l.map((L,Y)=>a.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":L.value===s,className:"select__option"+(Y===I?" is-cursor":"")+(L.value===s?" is-on":""),onMouseEnter:()=>F(Y),onClick:()=>X(L),children:[a.jsx("span",{className:"select__check","aria-hidden":"true",children:L.value===s?"✓":""}),a.jsx("span",{className:"select__label",children:L.displayName}),L.description&&a.jsx("span",{className:"select__hint",children:L.description})]},L.value)),D.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:D.map(L=>a.jsx("button",{type:"button",role:"menuitemradio","aria-checked":L===r,className:L===r?"modelmenu__level is-on":"modelmenu__level",onClick:()=>j(L),children:L},L))})]}),V&&m&&a.jsx(lp,{label:"Ultracode",desc:"xhigh и постоянная оркестрация подагентами",on:c,onToggle:()=>v(!c)})]}),a.jsx("div",{className:"modelmenu__sep",role:"separator"}),g&&(B==null?void 0:B.supportsThinking)!==!1&&a.jsx(lp,{label:"Размышления",desc:"расширенное обдумывание перед ответом",on:o,onToggle:()=>C(!o)}),h&&a.jsx(lp,{label:"Менять модель по флагу",desc:"иначе помеченный ход встаёт на паузу",on:d,onToggle:()=>T(!d)})]})]})}function lp({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 DS(){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 ml({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 OS({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[C,T]=_.useState("open"),[E,M]=_.useState(""),[I,F]=_.useState(!1),[J,H]=_.useState(""),[B,D]=_.useState(""),[V,X]=_.useState({git:!0,claudeMd:!0,agentsMd:!0,readme:!0}),A=E.trim(),L=A!=="",Y=J.trim(),ie=B.trim(),xe=Y!==""&&ie!=="";_.useEffect(()=>{J===""&&d.length>0&&H(d[0])},[d]);const Se=_.useRef(m);Se.current=m,_.useEffect(()=>{if(C!=="open")return;const ue=E.trim(),_e=setTimeout(()=>Se.current(ue),200);return()=>clearTimeout(_e)},[E,C]);function ve(){L&&y(A)}function Q(){xe&&j(Y,ie,V)}function fe(){L&&(F(!0),g(A))}return h?a.jsxs(ml,{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(ue=>a.jsx("li",{children:ue},ue))})}),a.jsx("p",{className:"modal__text modal__text--dim",children:"Проект открыт и работает — недостающее можно добавить руками, в дереве файлов или из терминала."})]}):a.jsxs(ml,{title:"Новый проект",className:I&&C==="open"?"modal--wide":void 0,onClose:v,actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:v,children:"Отмена"}),C==="open"?a.jsxs(a.Fragment,{children:[c?a.jsx("button",{className:"btn",onClick:x,children:"Остановить"}):a.jsx("button",{className:"btn",disabled:!L,onClick:fe,title:"Найти по описанию",children:"Попросить агента"}),a.jsx("button",{className:"btn btn--primary",disabled:!L,onClick:ve,children:"Открыть"})]}):a.jsx("button",{className:"btn btn--primary",disabled:!xe,onClick:Q,children:"Создать"})]}),children:[a.jsxs("div",{className:"tabs",children:[a.jsx(Ub,{label:"Открыть",on:C==="open",onClick:()=>T("open")}),a.jsx(Ub,{label:"Создать",on:C==="create",onClick:()=>T("create")})]}),C==="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:E,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"C:\\Projects\\my-app",onChange:ue=>M(ue.target.value),onKeyDown:ue=>{ue.key==="Enter"&&(ue.preventDefault(),ve())}}),o&&a.jsx("p",{className:"modal__error",children:o}),l.length>0&&a.jsx("ul",{className:"finds",children:l.map(ue=>a.jsx("li",{children:a.jsxs("button",{className:"find",disabled:ue.open,title:ue.open?"Этот проект уже открыт":ue.path,onClick:()=>M(ue.path),onDoubleClick:()=>y(ue.path),children:[a.jsx("span",{className:"find__name",children:ue.name}),a.jsx("span",{className:"find__path",children:ue.path}),a.jsx("span",{className:"find__note",children:US(ue)})]})},ue.path))}),l.length===0&&L&&!s&&!I&&a.jsx("p",{className:"modal__text modal__text--dim",children:"Ничего похожего среди каталогов, где вы работали. Если помните не имя, а суть проекта — опишите его и нажмите «Попросить агента». Проекта ещё нет вовсе — рядом вкладка «Создать»."}),I&&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:J,spellCheck:!1,autoComplete:"off",placeholder:"C:\\Projects",onChange:ue=>H(ue.target.value)}),d.length>0&&a.jsx("div",{className:"newproj__roots",children:d.map(ue=>a.jsx("button",{type:"button",className:ue===Y?"newproj__root is-on":"newproj__root",title:ue,onClick:()=>H(ue),children:zS(ue)},ue))}),a.jsx("label",{className:"field newproj__field",htmlFor:"workspace-name",children:"Имя проекта"}),a.jsx("input",{id:"workspace-name",className:"input input--mono",value:B,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"my-app",onChange:ue=>D(ue.target.value),onKeyDown:ue=>{ue.key==="Enter"&&(ue.preventDefault(),Q())}}),a.jsx("p",{className:"newproj__preview",children:xe?LS(Y,ie):"Каталог появится здесь"}),o&&a.jsx("p",{className:"modal__error",children:o}),a.jsxs("div",{className:"newproj__opts",children:[a.jsx(Mf,{label:"AGENTS.md",desc:"инструкции проекта для Codex",on:V.agentsMd??!1,onToggle:()=>X(ue=>({...ue,agentsMd:!ue.agentsMd}))}),a.jsx(Mf,{label:"git init",desc:"панель истории работает сразу",on:V.git,onToggle:()=>X(ue=>({...ue,git:!ue.git}))}),a.jsx(Mf,{label:"CLAUDE.md",desc:"заготовка инструкций для агента",on:V.claudeMd,onToggle:()=>X(ue=>({...ue,claudeMd:!ue.claudeMd}))}),a.jsx(Mf,{label:"README.md",desc:"по нему проект потом узнаёт поиск",on:V.readme,onToggle:()=>X(ue=>({...ue,readme:!ue.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 Mf({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 LS(l,s){const r=l.includes("\\")?"\\":"/";return l.replace(/[\\/]+$/,"")+r+s}function zS(l){const s=l.includes("\\")?"\\":"/",r=l.split(/[\\/]/).filter(Boolean);return r.length<=2?l:`…${s}${r.slice(-2).join(s)}`}function US(l){return l.open?"уже открыт":l.why?l.why:l.sessions===0?"рядом с вашими проектами":`${HS(l.sessions)}${BS(l.lastUsedAt)}`}function HS(l){const s=l%10,r=l%100;return r>=11&&r<=14?`${l} сессий`:s===1?`${l} сессия`:s>=2&&s<=4?`${l} сессии`:`${l} сессий`}function BS(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 IS(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 C=s.indexOf(v);C===-1&&(C=Hb(s),s[C]=v),x.push({from:h,to:C})}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 C=d[v];!C||C===o.hash||v===h||s[v]===C&&j.push(v)}qS(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 qS(l){for(;l.length>0&&l[l.length-1]===null;)l.pop()}const ey=1500;function GS(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:YS(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:$S(l,r)}}function YS(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 $S(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 XS({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:C,zoomed:T,onToggleZoom:E}){const M=IS((s==null?void 0:s.commits)??[]),I=[...s!=null&&s.detached?[{value:"",label:`отделён · ${s.head.slice(0,8)}`}]:[],...((s==null?void 0:s.branches)??[]).map(F=>({value:F.name,label:F.name,hint:F.hash.slice(0,8)}))];return a.jsxs("aside",{className:(l?"sidepane sidepane--git sidepane--open":"sidepane sidepane--git")+(T?" sidepane--zoomed":""),"aria-label":"История git",children:[a.jsxs("div",{className:"sidepane__head",onDoubleClick:F=>{E&&(F.target.closest("button")||E())},children:[a.jsx(JS,{}),a.jsx("span",{className:"sidepane__title",children:"История"}),a.jsx("button",{className:"sidepane__btn",title:"Обновить","aria-label":"Обновить историю",onClick:d,children:"↻"}),E&&a.jsx("button",{className:"sidepane__btn",title:T?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":T?"Свернуть панель истории":"Развернуть панель истории на весь экран","aria-pressed":T,onClick:E,children:a.jsx(Lc,{active:T})}),a.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель истории",onClick:C,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(_s,{className:"gitbar__branch",title:"Ветка — выбрать значит переключиться",value:s.detached?"":s.branch,options:I,onChange:F=>{F&&m(F,`ветку ${F}`)}}),a.jsx(Dc,{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(tN,{}),o]}):s.hasRemote?a.jsxs(a.Fragment,{children:[a.jsxs("button",{type:"button",className:"btn btn--sm",title:"Отправить текущую ветку в origin",onClick:g,children:[a.jsx(PS,{}),"Отправить",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(WS,{}),"Забрать",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(eN,{})})]})]}):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} ${aN(s.changed.length)}`:"Рабочее дерево чистое"}),a.jsx("span",{className:"gitrow__meta",children:s.changed.length>0?s.changed.slice(0,4).map(F=>sN(F.path)).join(", "):"незакоммиченных изменений нет"})]})}),M.rows.map(F=>a.jsx(QS,{row:F,columns:M.columns,head:F.commit.hash===s.head,local:s.hasRemote&&!F.commit.pushed,active:c===F.commit.hash,onOpen:()=>h(F.commit.hash)},F.commit.hash)),M.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(Er,{result:r,onDismiss:v})]})}const Qo=50,Bb=13,VS=500;function QS({row:l,columns:s,head:r,local:c,active:o,onOpen:d}){const{commit:h}=l,m=h.refs.map(nN).filter(Boolean),[g,x]=_.useState(null),y=_.useRef(null);function j(E){const M=E.touches[0];if(!M)return;const I={timer:0,x:M.clientX,y:M.clientY,fired:!1};I.timer=window.setTimeout(()=>{I.fired=!0,x({x:I.x,y:I.y})},VS),y.current=I}function v(E){const M=y.current,I=E.touches[0];!M||!I||Math.hypot(I.clientX-M.x,I.clientY-M.y)>10&&(window.clearTimeout(M.timer),y.current=null)}function C(E){const M=y.current;M&&(window.clearTimeout(M.timer),M.fired&&E.preventDefault())}function T(){const E=[{id:"hash",label:"Копировать хеш",hint:h.shortHash,onSelect:()=>void fa(h.hash)},{id:"short",label:"Копировать короткий хеш",onSelect:()=>void fa(h.shortHash)},{id:"subject",label:"Копировать сообщение",onSelect:()=>void fa(h.subject)}],M=new Set;for(const I of h.refs){const F=I.startsWith("tag: "),J=lN(I);!J||M.has(J)||(M.add(J),E.push({id:`ref:${J}`,label:F?"Копировать тег":"Копировать ветку",hint:J,onSelect:()=>void fa(J)}))}return E}return a.jsxs(a.Fragment,{children:[a.jsxs("button",{className:"gitrow"+(o?" is-on":""),title:c?"Коммит ещё не отправлен на удалённый репозиторий":void 0,onClick:()=>{var E;if((E=y.current)!=null&&E.fired){y.current=null;return}d()},onContextMenu:E=>{E.preventDefault(),x({x:E.clientX,y:E.clientY})},onTouchStart:j,onTouchMove:v,onTouchEnd:C,onTouchCancel:C,children:[a.jsx(KS,{row:l,columns:s,head:r,local:c}),a.jsxs("span",{className:"gitrow__body",children:[a.jsxs("span",{className:"gitrow__subject",children:[m.map(E=>a.jsx("span",{className:"gitrow__ref",children:E},E)),h.subject]}),a.jsxs("span",{className:"gitrow__meta",children:[h.shortHash," · ",h.author," · ",iN(h.date),c&&a.jsx("span",{className:"gitrow__local",children:"· не отправлен"})]})]})]}),g&&a.jsx(Ii,{x:g.x,y:g.y,items:T(),onClose:()=>x(null)})]})}function KS({row:l,columns:s,head:r,local:c}){const o=s*Bb+6,d=Qo/2,h=x=>8+Math.min(x,Ip-1)*Bb,m=c?"3.5 2.5":void 0,g=Rf(l.col);return a.jsxs("svg",{className:"gitgraph",width:o,height:Qo,viewBox:`0 0 ${o} ${Qo}`,"aria-hidden":"true",children:[l.through.map(x=>a.jsx("line",{x1:h(x),y1:0,x2:h(x),y2:Qo,style:{stroke:Rf(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:Rf(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)} ${Qo}`,fill:"none",style:{stroke:Rf(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 Rf(l){return`var(--lane-${l%Ip})`}function ZS({detail:l,local:s,onCheckout:r,onClose:c}){const o=l.hash==="";return a.jsxs(ml,{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(Dc,{text:l.subject,hint:"сообщение коммита"})]}),a.jsxs("p",{className:"commit__meta",children:[l.author,l.email&&` <${l.email}>`," · ",rN(l.date)]}),a.jsxs("div",{className:"commit__line commit__line--hash",children:[a.jsx("span",{className:"commit__hash",children:l.hash}),a.jsx(Dc,{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(FS,{file:d,defaultOpen:l.files.length<=3},d.path+d.oldPath))]})}function FS({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:GS(l)})]})}function JS(){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 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 13V3M4.5 6.5 8 3l3.5 3.5"})})}function WS(){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 eN(){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 tN(){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 nN(l){return l.replace(/^HEAD -> /,"").replace(/^tag: /,"⌂ ").trim()}function lN(l){const s=l.replace(/^HEAD -> /,"").replace(/^tag: /,"").trim();return s==="HEAD"?"":s}function sN(l){const s=l.split("/");return s[s.length-1]??l}function aN(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 iN(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 rN(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 cN({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 ue;const[v,C]=_.useState(()=>qb(c)),[T,E]=_.useState(""),[M,I]=_.useState(""),[F,J]=_.useState(!0),[H,B]=_.useState("Первый коммит"),[D,V]=_.useState(null),[X,A]=_.useState("");_.useEffect(()=>{!T&&s.length>0&&E(s[0].login)},[T,s]),_.useEffect(()=>{r&&D===null&&V(new Set(r.files))},[r,D]);const L=(l==null?void 0:l.connected)===!0,Y=s.map(_e=>({value:_e.login,label:_e.login,hint:_e.kind==="org"?"организация":void 0})),ie=_.useMemo(()=>{if(!r)return[];const _e=X.trim().toLowerCase();return _e?r.files.filter(Me=>Me.toLowerCase().includes(_e)):r.files},[r,X]),xe=(D==null?void 0:D.size)??0,Se=L&&v.trim()!==""&&T!==""&&d===""&&(o||xe>0);function ve(_e){V(Me=>{const w=new Set(Me??[]);return w.has(_e)?w.delete(_e):w.add(_e),w})}function Q(_e){V(Me=>{const w=new Set(Me??[]);for(const Z of ie)_e?w.add(Z):w.delete(Z);return w})}function fe(){if(!Se)return;const _e=(r==null?void 0:r.files)??[];x({owner:T,name:v.trim(),description:M.trim(),private:F,include:o?[]:_e.filter(Me=>D==null?void 0:D.has(Me)),ignore:o?[]:_e.filter(Me=>!(D!=null&&D.has(Me))),message:o?"":H.trim()||"Первый коммит"})}return a.jsxs(ml,{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:!Se,onClick:fe,children:d||"Опубликовать"})]}),children:[a.jsx(oN,{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=>C(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(_s,{className:"settings__select",value:T,options:Y,onChange:E,placeholder:"выберите владельца",ariaLabel:"Владелец репозитория"}):a.jsx("p",{className:"publish__static",children:((ue=s[0])==null?void 0:ue.login)??"—"})]}),a.jsxs("label",{className:"field publish__field",children:[a.jsx("span",{children:"Описание (необязательно)"}),a.jsx("input",{className:"input",value:M,placeholder:"о чём проект — одной строкой",onChange:_e=>I(_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:F,onClick:()=>J(!0)}),a.jsx(Gb,{title:"Публичный",desc:"Виден всем в интернете — код, история коммитов, всё содержимое.",risky:!0,on:!F,onClick:()=>J(!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:[xe," из ",r.files.length," файлов"]}),a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>Q(!0),children:"Отметить все"}),a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>Q(!1),children:"Снять все"})]}),r.files.length>8&&a.jsx("input",{className:"input publish__filter",value:X,placeholder:"Фильтр по пути…",spellCheck:!1,onChange:_e=>A(_e.target.value)}),a.jsx("div",{className:"publish__filelist",children:ie.length===0?a.jsx("p",{className:"modal__text publish__filesempty",children:"Ничего не найдено по фильтру."}):ie.map(_e=>a.jsxs("button",{type:"button",role:"checkbox","aria-checked":(D==null?void 0:D.has(_e))===!0,className:"publish__file",onClick:()=>ve(_e),children:[a.jsx("span",{className:"publish__box"+(D!=null&&D.has(_e)?" is-on":""),"aria-hidden":"true",children:(D==null?void 0:D.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=>B(_e.target.value)})]})]})]}),a.jsx(Er,{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 oN({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(uN,{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 uN({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(dN,{}):a.jsx(fN,{})})]})}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"})]})}function dN(){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 hN({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(ml,{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(Er,{result:s,onDismiss:c})]})}function pN({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:C,onContextSearch:T,onCommand:E,onModel:M,onEffort:I,onUltracode:F,onThinking:J,onSwitchOnFlag:H,onAsk:B,onInterrupt:D,onReset:V,onClose:X,zoomed:A,onToggleZoom:L}){return a.jsxs("aside",{className:(l?"sidepane sidepane--ask sidepane--open":"sidepane sidepane--ask")+(A?" sidepane--zoomed":""),"aria-label":"Вопрос на полях",children:[a.jsxs("div",{className:"sidepane__head",onDoubleClick:Y=>{L&&(Y.target.closest("button")||L())},children:[a.jsx(mN,{}),a.jsx("span",{className:"sidepane__title",children:"Вопрос на полях"}),a.jsx("button",{className:"sidepane__btn",title:"Начать заново — следующий вопрос возьмёт свежий контекст","aria-label":"Начать боковой разговор заново",disabled:s.length===0,onClick:V,children:"↻"}),L&&a.jsx("button",{className:"sidepane__btn",title:A?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":A?"Свернуть панель вопроса":"Развернуть панель вопроса на весь экран","aria-pressed":A,onClick:L,children:a.jsx(Lc,{active:A})}),a.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель вопроса",onClick:X,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:C,onModel:M,onEffort:I,onUltracode:F,onThinking:J,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:T,onCommand:E,onSend:B,onInterrupt:D,onEscape:r?D:X})]})}function mN(){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 gN=75,xN=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:yN(l,s),"aria-label":c,children:r.map(o=>a.jsx(bN,{label:o.label,window:o.window},o.key))})}function bN({label:l,window:s}){const r=Math.round(s.utilization),c=jN(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${_N(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 _N(l){return l>=xN?" usage__fill--over":l>=gN?" usage__fill--warn":""}function yN(l,s){if(s.length>0)return vN(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 vN(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 jN(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:wN(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 wN(l){return l.toLocaleDateString(void 0,{weekday:"long",day:"numeric",month:"long",year:"numeric"})}function SN({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:C}){const T=b_({onLongPress:()=>j==null?void 0:j(),onClick:()=>y==null?void 0:y(),disabled:v});return a.jsx(ml,{title:"Настройки сессии",className:"modal--sheet",sheet:!0,onClose:l,children:a.jsxs("div",{className:"sessionmenu",children:[s&&a.jsx(xc,{label:"Режим прав",children:s}),a.jsx(xc,{label:"Модель",children:r}),(c==null?void 0:c.available)&&(c.fiveHour||c.sevenDay||c.buckets&&c.buckets.length>0)&&a.jsx(xc,{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(NN,{}),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(xc,{label:"Время",children:a.jsx(sy,{})}),d&&a.jsx(xc,{label:"Стоимость хода",children:a.jsx("span",{className:"badge badge--cost",children:d})}),o&&a.jsx(xc,{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":T.holding?"sessionmenu__handoff is-holding":"sessionmenu__handoff",style:{"--hold-ms":`${T.thresholdMs}ms`},"aria-busy":v,disabled:v,...T.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:"Зажмите — новая сессия без хэндоффа"})]})]}),C&&a.jsx("button",{type:"button",className:"sessionmenu__stop",onClick:C,children:"Остановить сессию"})]})})}function xc({label:l,children:s}){return a.jsxs("div",{className:"sessionmenu__row",children:[a.jsx("span",{className:"sessionmenu__label",children:l}),s]})}function NN(){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 kN({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(ml,{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(TN,{servers:s,auth:h,remote:m,actions:g}),l==="plugins"&&a.jsx(DN,{plugins:r,marketplaces:c,actions:g}),l==="catalog"&&a.jsx(ON,{catalog:o,hasMarketplaces:c.length>0,actions:g,onMarketplaces:()=>x("plugins")}),a.jsx(Er,{result:d})]})}function TN({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--${AN(h.status)}`,children:CN[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(EN,{auth:m,remote:r,actions:c})]},h.name)})}),o?a.jsx(MN,{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 EN({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 CN={connected:"подключён",failed:"ошибка","needs-auth":"нужна авторизация",pending:"подключается",disabled:"выключен",unknown:"неизвестно"};function AN(l){return l==="connected"?"ok":l==="failed"?"bad":l==="needs-auth"?"warn":"mute"}function MN({onSubmit:l,onCancel:s}){const[r,c]=_.useState(""),[o,d]=_.useState("stdio"),[h,m]=_.useState(""),[g,x]=_.useState(""),[y,j]=_.useState(""),v=o==="stdio",C=r.trim()!==""&&(v?h.trim()!=="":g.trim()!=="");function T(){if(C)if(v){const[E,...M]=RN(h);l(r.trim(),{transport:"stdio",command:E??"",args:M,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:E=>c(E.target.value)}),a.jsx("label",{className:"field",children:"Транспорт"}),a.jsx(_s,{title:"Транспорт",value:o,options:[{value:"stdio",label:"stdio",hint:"локальный процесс"},{value:"http",label:"http",hint:"удалённый сервер"},{value:"sse",label:"sse",hint:"удалённый, поток событий"}],onChange:E=>d(E)}),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:E=>m(E.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:E=>x(E.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:E=>j(E.target.value)}),a.jsxs("div",{className:"extbar",children:[a.jsx("button",{className:"btn",onClick:s,children:"Отмена"}),a.jsx("button",{className:"btn btn--primary",disabled:!C,onClick:T,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 RN(l){return(l.trim().match(/"[^"]*"|'[^']*'|\S+/g)??[]).map(s=>s.replace(/^["']|["']$/g,""))}function DN({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 Ko=30;function ON({catalog:l,hasMarketplaces:s,actions:r,onMarketplaces:c}){const[o,d]=_.useState(""),[h,m]=_.useState(""),[g,x]=_.useState(Ko),[y,j]=_.useState(""),v=_.useMemo(()=>[...new Set(l.map(E=>E.category).filter(Boolean))].sort(),[l]),C=_.useMemo(()=>{const T=o.trim().toLowerCase();return l.filter(E=>h&&E.category!==h?!1:T?`${E.name} ${E.displayName} ${E.description} ${E.author}`.toLowerCase().includes(T):!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:T=>{d(T.target.value),x(Ko)}}),a.jsx(_s,{title:"Категория",value:h,options:[{value:"",label:"все категории"},...v.map(T=>({value:T,label:T}))],onChange:T=>{m(T),x(Ko)}})]}),C.length===0?a.jsx("p",{className:"modal__text",children:"Ничего не нашлось."}):a.jsx("ul",{className:"extlist",children:C.slice(0,g).map(T=>a.jsxs("li",{className:"extlist__row",children:[a.jsxs("div",{className:"extlist__head",children:[a.jsx("span",{className:"extlist__name",children:T.name}),T.installed&&a.jsx("span",{className:"chip chip--ok",children:"установлен"}),T.version&&a.jsx("span",{className:"chip",children:T.version}),T.category&&a.jsx("span",{className:"chip",children:T.category})]}),T.description&&a.jsx("div",{className:"catalog__desc",children:T.description}),a.jsxs("div",{className:"extlist__meta",children:[T.author&&`${T.author} · `,T.marketplace]}),a.jsxs("div",{className:"extlist__actions",children:[a.jsx("button",{className:"btn btn--ghost btn--sm",disabled:T.installed,onClick:()=>r.pluginInstall(T.id),children:T.installed?"Уже стоит":"Установить"}),T.homepage&&a.jsx("a",{className:"btn btn--ghost btn--sm",href:T.homepage,target:"_blank",rel:"noreferrer",children:"Страница"})]})]},T.id))}),C.length>g&&a.jsx("div",{className:"extbar",children:a.jsxs("button",{className:"btn",onClick:()=>x(T=>T+Ko),children:["Ещё ",Math.min(Ko,C.length-g)," из ",C.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:T=>j(T.target.value),onKeyDown:T=>{T.key!=="Enter"||y.trim()===""||(T.preventDefault(),r.pluginInstall(y.trim()),j(""))}}),a.jsx("button",{className:"btn",disabled:y.trim()==="",onClick:()=>{r.pluginInstall(y.trim()),j("")},children:"Установить"})]})]})]})}function LN({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),[C,T]=_.useState(!1),E=d!==null&&(l==null?void 0:l.loggedIn)===!0&&!C&&!j,M=_.useMemo(()=>{if(s.error)return{ok:!1,message:s.error};const J=s.output.trim();return J===""?null:{ok:!0,message:J}},[s.error,s.output]);function I(J=x){const H=J.trim();H!==""&&(r.submitCode(H),y(""))}function F(){if(o>0){v(!1),T(!0);return}r.login("claudeai",!0)}return a.jsxs(ml,{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:HN[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(BN,{login:s,remote:c,code:x,onCode:y,onSubmit:I,onCancel:r.cancel}):a.jsxs(a.Fragment,{children:[a.jsx(Er,{result:M}),C&&a.jsx("p",{className:"account__warn",role:"alert",children:zN(o)}),E&&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:[E&&a.jsxs("button",{type:"button",className:"btn account__relink",title:`Переподключить сессию
123
+ ${m}`,"aria-label":"Переподключить сессию",disabled:h,onClick:d,children:[a.jsx(UN,{}),"Переподключить"]}),C?a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>T(!1),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",autoFocus:!0,onClick:()=>{T(!1),r.login("claudeai",!0)},children:"Всё равно сменить"})]}):a.jsx("button",{className:"btn",onClick:F,children:"Сменить аккаунт"}),j?a.jsx("button",{className:"btn btn--danger",autoFocus:!0,onClick:()=>{v(!1),r.logout()},children:"Точно выйти?"}):a.jsx("button",{className:"btn",onClick:()=>{T(!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 zN(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 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:"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 HN={"claude.ai":"подписка Claude",console:"Anthropic Console",apiKey:"API-ключ",none:"нет"};function BN({login:l,remote:s,code:r,onCode:c,onSubmit:o,onCancel:d}){var T;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 E=>{const{code:M,onCode:I,onSubmit:F}=x.current;if(E&&M.trim()!=="")return;const J=await xp();if(J===null){E||m("Не получилось прочитать буфер — вставьте код в поле руками.");return}const H=J.trim();if(!$b(H)){E||m("В буфере не похоже на код: нужен он целиком, вместе с частью после «#». Подойдёт и адрес страницы, на которую увёл браузер, — его тоже разберём.");return}if(E){if(g.current===H)return;g.current=H}m(null),I(H),F(H)},[]);_.useEffect(()=>{if(!l.awaitingCode)return;const E=()=>{document.visibilityState==="visible"&&y(!0)};return document.addEventListener("visibilitychange",E),()=>document.removeEventListener("visibilitychange",E)},[l.awaitingCode,y]);const j=typeof((T=navigator.clipboard)==null?void 0:T.readText)=="function",v=r.trim()!==""&&!$b(r),C=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(Dc,{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:E=>{m(null),c(E.target.value)},onKeyDown:E=>{E.key==="Enter"&&(E.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:"Готово"})]}),C&&a.jsx("p",{className:"account__note account__note--code",children:C})]}),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 IN({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 C;j||(C=y.current)==null||C.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(ml,{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:C=>{C.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:C=>d(C.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:C=>m(C.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:"codex",label:"Codex",hint:"OpenAI Codex CLI · вход через /login или codex login"},{id:"claude",label:"Claude",hint:"Claude Code"},{id:"antigravity",label:"Antigravity",hint:"Google agy"}],sp="",qN=[{value:"opus",label:"Opus",hint:"полный список моделей виден, когда открыта сессия"},{value:"sonnet",label:"Sonnet",hint:"полный список моделей виден, когда открыта сессия"},{value:"haiku",label:"Haiku",hint:"полный список моделей виден, когда открыта сессия"}],GN=p_.map(l=>({value:l.value,label:l.value,hint:l.hint})),Df=3600*1e3,YN=[{value:"6h",label:"6 часов"},{value:"24h",label:"Сутки"},{value:"48h",label:"Двое суток"},{value:"168h",label:"Неделя"},{value:"never",label:"Никогда"}],_c={"6h":6*Df,"24h":24*Df,"48h":48*Df,"168h":168*Df,never:0};function $N(l){return _c[l]??_c["48h"]}const XN=[{value:"5m",label:"5 минут"},{value:"10m",label:"10 минут"},{value:"30m",label:"30 минут"},{value:"60m",label:"Час"},{value:"never",label:"Никогда"}],Of=60*1e3,yc={"5m":5*Of,"10m":10*Of,"30m":30*Of,"60m":60*Of,never:0};function VN(l){return yc[l]??yc["10m"]}function QN(l){const s=Object.entries(yc).find(([,r])=>r===l);return s?s[0]:Object.keys(yc).reduce((r,c)=>Math.abs(yc[c]-l)<Math.abs(yc[r]-l)?c:r)}function KN(l){const s=Object.entries(_c).find(([,r])=>r===l);return s?s[0]:Object.keys(_c).reduce((r,c)=>Math.abs(_c[c]-l)<Math.abs(_c[r]-l)?c:r)}const ZN=[{value:"off",label:"Выключено"},{value:"500",label:"0.5 с"},{value:"1500",label:"1.5 с"},{value:"3000",label:"3 с"},{value:"10000",label:"10 с"}],vc={off:0,500:500,1500:1500,3e3:3e3,1e4:1e4};function FN(l){return vc[l]??vc.off}function Qb(l){return Number.isFinite(l)?Math.min(100,Math.max(0,Math.round(l))):0}function JN(l){const s=Object.entries(vc).find(([,r])=>r===l);return s?s[0]:Object.keys(vc).reduce((r,c)=>Math.abs(vc[c]-l)<Math.abs(vc[r]-l)?c:r)}const PN=[{value:"project",title:"Только текущий проект",description:"Агент молча пишет файлы в открытом проекте и в ~/.claude — настройках самого Claude Code. Чужой проект и любая новая папка — только с явного разрешения."},{value:"projects",title:"Папка с проектами",description:"То же плюс каталог, где лежат открытые проекты, — то есть и соседний проект тоже. Всё остальное — с разрешения."},{value:"all",title:"Все папки на компьютере",description:"Агент пишет файлы куда угодно на диске — вопросов про место записи не будет.",risky:!0}];function WN({themeMode:l,onThemeChange:s,settings:r,models:c,relayState:o,networkState:d,local:h,onChange:m,onEnableShell:g,onDisableShell:x,onOpenRelay:y,onClose:j}){const v=r===null,[C,T]=_.useState(""),[E,M]=_.useState(null),I=!v&&r.networkGuardEnabled,F=(r==null?void 0:r.networkGuardBlockedCountries)??[];function J(){const A=C.trim().toUpperCase();if(A!==""){if(!/^[A-Z]{2}$/.test(A)){M("Нужен код из двух латинских букв, например RU или CN.");return}if(F.includes(A)){M(`Код ${A} уже в списке.`);return}M(null),T(""),m({networkGuardBlockedCountries:[...F,A]})}}const H=!v&&r.terminalEnabled===!0,B=!v&&r.liveSessionsFirst===!0,D=!H,V=_.useMemo(()=>{const A=[{value:sp,label:"Как в Claude Code",hint:"модель определят настройки самого Claude Code"},...c.length>0?c.map(L=>({value:L.value,label:L.displayName,hint:L.description})):qN];return r&&r.startModel!==null&&!A.some(L=>L.value===r.startModel)&&A.push({value:r.startModel,label:r.startModel}),A},[c,r]);function X(){var A,L;return(o==null?void 0:o.paired)!==!0?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"settings__hint",children:"Компьютер не связан с аккаунтом — включать удалённый доступ пока не к чему: без пары ни телефон, ни другое устройство этот компьютер вообще не видят."}),a.jsx("button",{type:"button",className:"btn",disabled:D,onClick:y,children:"Связать компьютер"})]}):(A=o.shell)!=null&&A.enabled?a.jsxs(a.Fragment,{children:[a.jsxs("p",{className:"settings__hint",children:["Разрешён: с телефона и любого другого устройства этого аккаунта можно открыть терминал и выполнить на этом компьютере что угодно — как если бы сидели за ним.",o.shell.confirmedAt&&` Включено ${new Date(o.shell.confirmedAt).toLocaleString()}.`]}),a.jsx("button",{type:"button",className:"btn btn--danger",disabled:D,onClick:x,children:"Запретить"})]}):(L=o.shell)!=null&&L.pending?a.jsxs(a.Fragment,{children:[a.jsxs("p",{className:"settings__hint",children:["Письмо ушло на ",a.jsx("b",{children:o.shell.email}),". Перейдите по ссылке из него — терминал заработает удалённо."]}),a.jsx("p",{className:"settings__hint",children:"Повторная отправка ограничена раз в минуту — если жали кнопку только что, письмо не придёт и от повторного нажатия тоже. Если сейчас доберётесь до самого компьютера, там разрешение включится сразу, без письма."}),a.jsx("button",{type:"button",className:"btn",disabled:D,onClick:g,children:"Отправить письмо ещё раз"})]}):a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"settings__hint",children:"Сейчас с телефона можно смотреть разговоры и файлы, но не запускать команды. Разрешение даёт полный доступ к терминалу этого компьютера: с телефона станет можно выполнить любую команду, как в обычной консоли за этой машиной."}),h?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"settings__hint",children:"Включится сразу — вы уже за этим компьютером, подтверждать доступ к нему нечем и незачем."}),a.jsx("button",{type:"button",className:"btn",disabled:D,onClick:g,children:"Разрешить с телефона"})]}):a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"settings__hint",children:"Отсюда мгновенно не включится: на почту аккаунта уйдёт письмо, и терминал заработает только после перехода по ссылке из него."}),a.jsx("button",{type:"button",className:"btn",disabled:D,onClick:g,children:"Прислать письмо"})]})]})}return a.jsx(ml,{title:"Настройки",onClose:j,children:a.jsxs("div",{className:"settings",children:[a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Тема оформления"}),a.jsx(_s,{title:"Тема оформления",value:l,options:[{value:"system",label:"Как в системе"},{value:"light",label:"Светлая"},{value:"dark",label:"Тёмная"},{value:"gpt",label:"GPT",hint:"чёрный фон и красные акценты"}],onChange:A=>s(A)})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Архивация молчащих сессий"}),a.jsx("p",{className:"settings__hint",children:"Сессия, к которой долго не возвращались, сама уезжает в архив — на диске ничего не удаляется, транскрипт остаётся, и её можно вернуть обратно в любой момент."}),v?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(_s,{className:"settings__select",value:KN(r.autoArchiveAfterMs),options:YN,onChange:A=>m({autoArchiveAfterMs:$N(A)}),ariaLabel:"Через сколько молчащая сессия уезжает в архив"})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Останавливать простаивающие сессии через"}),a.jsx("p",{className:"settings__hint",children:"Простаивающая живая сессия сама отпускает процесс CLI — освобождает память компьютера, на котором стоит хост. Простой — это когда сессия ничего не делает (не работает, не ждёт разрешения, фоновых задач нет), в ней ничего не происходит и ни в одном открытом окне не висит недописанный черновик для неё. Разговор при этом никуда не девается: открытая заново сессия, как и отправленное в неё сообщение, продолжают с того же места."}),v?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(_s,{className:"settings__select",value:QN(r.autoStopAfterMs),options:XN,onChange:A=>m({autoStopAfterMs:VN(A)}),ariaLabel:"Останавливать простаивающие сессии через"})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Остановка у лимита плана"}),a.jsx("p",{className:"settings__hint",children:"Когда расход окна лимита доходит до этого порога, хост прерывает все живые сессии Claude, сохраняет хэндофф у занятых и останавливает их — разговор остаётся на диске, а хэндофф показывается баннером в открытой сессии. Antigravity эта настройка не касается."}),a.jsxs("div",{className:"settings__field",children:[a.jsx("span",{className:"settings__field-label",children:"Остановка у 5-часового лимита, %"}),v?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsxs("div",{className:"settings__pct",children:[a.jsx("input",{type:"number",className:"input settings__pct-input",min:0,max:100,step:1,value:r.limitStopFiveHourPct,onChange:A=>m({limitStopFiveHourPct:Qb(A.target.valueAsNumber)}),"aria-label":"Остановка у 5-часового лимита, %"}),a.jsx("span",{className:"settings__pct-suffix",children:"%"})]}),a.jsx("p",{className:"settings__hint",children:"0 — не останавливать."})]}),a.jsxs("div",{className:"settings__field",children:[a.jsx("span",{className:"settings__field-label",children:"Остановка у недельного лимита, %"}),v?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsxs("div",{className:"settings__pct",children:[a.jsx("input",{type:"number",className:"input settings__pct-input",min:0,max:100,step:1,value:r.limitStopSevenDayPct,onChange:A=>m({limitStopSevenDayPct:Qb(A.target.valueAsNumber)}),"aria-label":"Остановка у недельного лимита, %"}),a.jsx("span",{className:"settings__pct-suffix",children:"%"})]}),a.jsx("p",{className:"settings__hint",children:"0 — не останавливать."})]})]}),a.jsxs("section",{className:"settings__section",children:[a.jsxs("div",{className:"settings__switch-row",children:[a.jsxs("div",{className:"settings__switch-copy",children:[a.jsx("h3",{className:"settings__heading",children:"Kill switch: останавливать агентов, если упал VPN"}),a.jsx("p",{className:"settings__hint",children:"Если VPN отключился, ccv сразу останавливает всех агентов и не даёт отправлять сообщения, пока VPN не вернётся. Как определяем: смотрим, из какой страны Anthropic видит запросы — страна из списка ниже или неудачная проверка считаются падением VPN. Сессии остаются открытыми и продолжатся после возврата VPN. Kill switch самого VPN-клиента это не заменяет — его тоже стоит включить."})]}),v?a.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):a.jsx("button",{type:"button",role:"switch","aria-checked":I,"aria-label":"Kill switch: останавливать агентов, если упал VPN",className:I?"switch is-on":"switch",onClick:()=>m({networkGuardEnabled:!I}),children:a.jsx("span",{className:"switch__knob"})})]}),I&&d&&a.jsx("p",{className:d.status==="blocked"?"settings__hint settings__netstatus is-bad":"settings__hint settings__netstatus",children:d.status==="blocked"?d.reason??"Маршрут не прошёл проверку.":d.country?`Сейчас: ${d.country} — всё в порядке.`:"Сейчас всё в порядке."}),a.jsxs("div",{className:I?"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:[F.map(A=>a.jsxs("li",{className:"countries__chip",children:[a.jsx("span",{children:A}),a.jsx("button",{type:"button",className:"countries__remove","aria-label":`Убрать ${A} из списка`,disabled:!I,onClick:()=>m({networkGuardBlockedCountries:F.filter(L=>L!==A)}),children:"×"})]},A)),F.length===0&&a.jsx("li",{className:"settings__hint",children:"Список пуст: блокировать будет только сбой проверки."})]}),a.jsxs("form",{className:"countries__add",onSubmit:A=>{A.preventDefault(),J()},children:[a.jsx("input",{type:"text",className:"input countries__input",value:C,maxLength:2,placeholder:"RU",autoCapitalize:"characters",spellCheck:!1,disabled:!I,"aria-label":"Код страны, две буквы","aria-invalid":E!==null,onChange:A=>{T(A.target.value.toUpperCase()),M(null)}}),a.jsx("button",{type:"submit",className:"btn",disabled:!I||C.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, при этом всегда работает как обычно, независимо от этой настройки."}),v?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(_s,{className:"settings__select",value:JN(r.autoSaveAfterPauseMs),options:ZN,onChange:A=>m({autoSaveAfterPauseMs:FN(A)}),ariaLabel:"Пауза перед автосохранением открытого файла"})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Агенты"}),a.jsx("p",{className:"settings__hint",children:"Выключенный агент не предлагается при создании новой сессии. Уже открытые сессии с ним продолжают работать."}),Vb.map(A=>{const L=(r==null?void 0:r.enabledProviders)??["claude","antigravity","codex"],Y=!v&&L.includes(A.id),ie=Y&&L.length<=1;return a.jsxs("div",{className:"settings__switch-row settings__agent",children:[a.jsx("span",{className:`newsession__mark newsession__mark--${A.id}`,"aria-hidden":"true",children:A.id==="codex"?a.jsx("span",{className:"codex-mark",children:"C"}):A.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:A.label}),a.jsx("span",{className:"settings__hint",children:ie?"Хотя бы один агент должен остаться включённым":A.hint})]}),v?a.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):a.jsx("button",{type:"button",role:"switch","aria-checked":Y,"aria-label":A.label,disabled:ie,title:ie?"Хотя бы один агент должен остаться включённым":void 0,className:Y?"switch is-on":"switch",onClick:()=>{const xe=Vb.map(Se=>Se.id).filter(Se=>Se===A.id?!Y:L.includes(Se));m({enabledProviders:xe})},children:a.jsx("span",{className:"switch__knob"})})]},A.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:"Модель"}),v?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(_s,{className:"settings__select",value:r.startModel??sp,options:V,onChange:A=>m({startModel:A===sp?null:A}),ariaLabel:"Модель, с которой поднимается новая сессия"})]}),a.jsxs("div",{className:"settings__field",children:[a.jsx("span",{className:"settings__field-label",children:"Режим прав при старте"}),v?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(_s,{className:"settings__select",value:r.startPermissionMode,options:GN,onChange:A=>m({startPermissionMode:A}),ariaLabel:"Режим прав, с которым поднимается новая сессия"})]})]}),a.jsx("section",{className:"settings__section",children:a.jsxs("div",{className:"settings__switch-row",children:[a.jsxs("div",{className:"settings__switch-copy",children:[a.jsx("h3",{className:"settings__heading",children:"Запущенные сессии сверху"}),a.jsx("p",{className:"settings__hint",children:"Сессии, поднятые в хосте прямо сейчас — работают, готовы, ждут разрешения, работают в фоне, переподключаются, — показываются выше остальных в списке сессий проекта и в панели закреплённых. Порядок внутри каждой из двух частей остаётся тем, что задан руками."})]}),v?a.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):a.jsx("button",{type:"button",role:"switch","aria-checked":B,"aria-label":"Запущенные сессии сверху",className:B?"switch is-on":"switch",onClick:()=>m({liveSessionsFirst:!B}),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:PN.map(A=>{const L=!v&&r.folderAccess===A.value;return a.jsxs("button",{type:"button",role:"radio","aria-checked":L,disabled:v,className:"access__card"+(L?" is-on":"")+(A.risky?" access__card--risky":""),onClick:()=>m({folderAccess:A.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:[A.title,A.risky&&a.jsx("span",{className:"access__risk",children:"самое широкое"})]}),a.jsx("span",{className:"access__desc",children:A.description})]})]},A.value)})})]}),a.jsxs("section",{className:"settings__section",children:[a.jsxs("div",{className:"settings__switch-row",children:[a.jsxs("div",{className:"settings__switch-copy",children:[a.jsx("h3",{className:"settings__heading",children:"Терминал"}),a.jsx("p",{className:"settings__hint",children:"Панель терминала под лентой разговора: команда, которую там набрали, выполняется прямо на этом компьютере с правами вашего пользователя — не в песочнице агента, как Bash-инструмент в разговоре. Выключите — и все открытые вкладки терминала закроются, а процессы в них не переживут закрытия."})]}),v?a.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):a.jsx("button",{type:"button",role:"switch","aria-checked":H,"aria-label":"Терминал",className:H?"switch is-on":"switch",onClick:()=>m({terminalEnabled:!H}),children:a.jsx("span",{className:"switch__knob"})})]}),a.jsxs("div",{className:"settings__nested"+(D?" is-disabled":""),children:[a.jsx("h4",{className:"settings__nested-heading",children:"Удалённый доступ к терминалу"}),v?a.jsx("p",{className:"settings__hint",children:"Загрузка…"}):a.jsxs(a.Fragment,{children:[D&&a.jsx("p",{className:"settings__hint",children:"Сначала включите терминал выше — удалённый доступ выдаётся к тому, что на этой машине уже разрешено, а не поверх выключенного рубильника."}),X()]})]})]})]})})}const Kb={fiveHour:"5-часовой лимит",sevenDay:"недельный лимит"};function ek(l){if(!l)return"срок неизвестен";const s=new Date(l);return Number.isNaN(s.getTime())?"срок неизвестен":s.toLocaleString()}function tk({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(),". Окно сбросится: ",ek(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 nk({handoff:l,onClose:s}){const[r,c]=_.useState("");return _.useEffect(()=>{let o=!1;return td(l.text).then(d=>{o||c(d)}),()=>{o=!0}},[l.text]),a.jsx(ml,{title:"Хэндофф",className:"modal--wide",onClose:s,children:a.jsx("div",{className:"markdown-preview",dangerouslySetInnerHTML:{__html:r}})})}function lk({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 Ff={fiveHour:"5-часовой лимит",sevenDay:"недельный лимит"},sk=12e3;function ak(l){const s=l%10,r=l%100;return s===1&&r!==11?"сессии":"сессиях"}function ik({notices:l,onDismiss:s}){return l.length===0?null:a.jsx("div",{className:"limittoasts",children:l.map(r=>a.jsx(rk,{notice:r,onDismiss:()=>s(r.id)},r.id))})}function rk({notice:l,onDismiss:s}){return _.useEffect(()=>{const r=window.setTimeout(s,sk);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:["Достигнут ",Ff[l.limit]," (",Math.round(l.utilization)," %): работа прервана в ",l.stopped," ",ak(l.stopped),", хэндоффов —"," ",l.handoffs,". Сессии остаются запущенными."]}):a.jsxs(a.Fragment,{children:["Достигнут ",Ff[l.limit]," (",Math.round(l.utilization)," %): занятых сессий не было — ничего не прервано."]})}),a.jsx("button",{type:"button",className:"limittoast__dismiss","aria-label":"Закрыть уведомление",onClick:s,children:"✕"})]})}function ck(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 ok(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 uk=16;function fk({pane:l,width:s,onResize:r,onReset:c}){const o=wr[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-tv):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*uk*(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 dk=16;function hk({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-av;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*dk,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=F=>s.getPropertyValue(F).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"),C=r("--cm-fn"),T=r("--cm-key"),E=r("--cm-type"),M=Fb(o,c,55),I=F=>Fb(F,"#ffffff",25);return{background:c,foreground:o,cursor:m,cursorAccent:g,selectionBackground:x,black:M,brightBlack:h,red:y,brightRed:I(y),green:j,brightGreen:I(j),yellow:v,brightYellow:I(v),blue:C,brightBlue:I(C),magenta:T,brightMagenta:I(T),cyan:E,brightCyan:I(E),white:d,brightWhite:o}}function pk(){return getComputedStyle(document.documentElement).getPropertyValue("--mono").trim()}let la=null;function mk(l){return la||(la=document.createElement("span"),la.style.position="fixed",la.style.width="0",la.style.height="0",la.style.opacity="0",la.style.pointerEvents="none",document.body.appendChild(la)),la.style.color=l,getComputedStyle(la).color}function Fb(l,s,r){return mk(`color-mix(in srgb, ${l} ${100-r}%, ${s} ${r}%)`)}let Lf=null;function gk(){return Lf||(Lf=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 Lf=null,l})),Lf}function xk({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:C,onResize:T,onAttach:E,onHide:M,registerSink:I}){const[F,J]=_.useState(()=>Zb());return _.useEffect(()=>{const H=new MutationObserver(()=>J(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:B=>{x&&(B.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(Lc,{active:g})}),a.jsx("button",{className:"termpanel__hide",title:"Скрыть панель","aria-label":"Скрыть панель терминала",onClick:M,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(_k,{id:H.id,exitCode:H.exitCode,active:H.id===s,theme:F,mobile:m,onInput:C,onResize:T,onAttach:E,registerSink:I},H.id))]})]})}function Jb({message:l,strip:s=!1,onRetry:r,onDismiss:c}){const{lede:o,hint:d,details:h}=bk(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 bk(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 _k({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 C=_.useRef(c),T=_.useRef(s),[E,M]=_.useState("loading"),[I,F]=_.useState(!1);return _.useEffect(()=>{if(!x.current)return;let H=!1,B=null;M("loading"),F(!1);const D=window.setTimeout(()=>{H||F(!0)},200);return(async()=>{var Me;let V;try{V=await gk()}catch{window.clearTimeout(D),H||M("error");return}if(H||!x.current)return;window.clearTimeout(D);const{Terminal:X,FitAddon:A,WebLinksAddon:L}=V,Y=new X({fontFamily:pk()||"monospace",fontSize:13,lineHeight:1.2,cursorBlink:!0,cursorStyle:"bar",scrollback:5e3,theme:C.current}),ie=new A;Y.loadAddon(ie),Y.loadAddon(new L),Y.open(x.current),y.current=Y,Y.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=Y.getSelection();return z?(w.preventDefault(),fa(z),!1):!w.shiftKey}return w.key==="v"||w.key==="V"?(w.preventDefault(),xp().then(z=>{z&&Y.paste(z)}),!1):!0});const xe=w=>{w.preventDefault();const Z=Y.getSelection();if(Z){fa(Z),Y.clearSelection();return}xp().then(z=>{z&&Y.paste(z)})};(Me=Y.element)==null||Me.addEventListener("contextmenu",xe);const Se=Y.onData(w=>d(l,w));let ve={cols:Y.cols,rows:Y.rows},Q=null;const fe=Y.onResize(({cols:w,rows:Z})=>{Q!==null&&window.clearTimeout(Q),Q=window.setTimeout(()=>{Q=null,!(w===ve.cols&&Z===ve.rows)&&(ve={cols:w,rows:Z},h(l,w,Z))},100)}),ue=new ResizeObserver(()=>{try{ie.fit()}catch{return}v.current&&Y.scrollToBottom()});ue.observe(x.current);const _e=g(l,w=>{w.kind==="buffer"&&Y.reset(),Y.write(w.data)});m(l),T.current!==null&&!j.current&&(j.current=!0,Y.write(`\r
129
+ \x1B[2m— Процесс завершён (код ${T.current}) —\x1B[0m\r
130
+ `)),r&&Y.focus(),B=()=>{var w;Q!==null&&window.clearTimeout(Q),ue.disconnect(),(w=Y.element)==null||w.removeEventListener("contextmenu",xe),Se.dispose(),fe.dispose(),_e(),Y.dispose(),y.current=null},M("ready")})(),()=>{H=!0,window.clearTimeout(D),B==null||B(),B=null}},[l]),_.useEffect(()=>{if(!o)return;const J=x.current;if(!J)return;let H=null,B=0,D=!1;const V=Y=>{Y.pointerType==="mouse"||H!==null||(H=Y.pointerId,B=Y.clientY,D=!1)},X=Y=>{if(Y.pointerId!==H)return;const ie=B-Y.clientY;if(!D){if(Math.abs(ie)<4)return;D=!0,J.setPointerCapture(Y.pointerId)}B=Y.clientY;const xe=J.querySelector(".xterm-viewport");xe&&(xe.scrollTop+=ie)},A=Y=>{Y.pointerId===H&&(J.hasPointerCapture(Y.pointerId)&&J.releasePointerCapture(Y.pointerId),H=null,D=!1)},L=Y=>Y.stopPropagation();return J.addEventListener("pointerdown",V),J.addEventListener("pointermove",X),J.addEventListener("pointerup",A),J.addEventListener("pointercancel",A),J.addEventListener("touchmove",L,{capture:!0}),()=>{J.removeEventListener("pointerdown",V),J.removeEventListener("pointermove",X),J.removeEventListener("pointerup",A),J.removeEventListener("pointercancel",A),J.removeEventListener("touchmove",L,{capture:!0}),H!==null&&J.hasPointerCapture(H)&&J.releasePointerCapture(H)}},[o]),_.useEffect(()=>{C.current=c,y.current&&(y.current.options.theme=c)},[c]),_.useEffect(()=>{var J;r&&((J=y.current)==null||J.focus())},[r]),_.useEffect(()=>{if(T.current=s,s===null){j.current=!1;return}if(j.current)return;const J=y.current;J&&(j.current=!0,J.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"+(E==="ready"?"":" is-hidden")}),E==="loading"&&I&&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:"Загружается терминал…"})]}),E==="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 yk=2e5,vk=75,jk=90;function wk({tokens:l,maxTokens:s,fetchedAt:r}){if(l===null)return null;const c=s??yk,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${Sk(o)}`,style:{width:`${o}%`}})}),a.jsxs("span",{className:"contextbar__pct",children:[o,"%"]})]})}function Sk(l){return l>=jk?" contextbar__fill--over":l>=vk?" contextbar__fill--warn":""}const ay="ccv:last-session",Nk=300*1e3,kk=1e4;function Tk(){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 Ek(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 Ck(l,s){return l.id===s.sessionId?!0:s.claudeSessionId?l.id===s.claudeSessionId||l.claudeSessionId===s.claudeSessionId:!1}const Ak={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","выход"]}],Mk={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 Rk(){var Js,po;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(()=>Hf()==="relay",[]),[C,T]=_.useState([]),[E,M]=_.useState([]),[I,F]=_.useState([]),[J,H]=_.useState([]),[B,D]=_.useState([]),[V,X]=_.useState([]),[A,L]=_.useState([]),[Y,ie]=_.useState([]),[xe,Se]=_.useState([]),[ve,Q]=_.useState(null),[fe,ue]=_.useState(null),[_e,Me]=_.useState(null),[w,Z]=_.useState(null),[z,me]=_.useState(null),[ye,Re]=_.useState(null),[Oe,Ue]=_.useState(pl),[Be,on]=_.useState(qh),[Ke,Jt]=_.useState(!1),[ft,mt]=_.useState(!1),Ie=Pf("(max-width: 860px)"),[un,Sn]=_.useState(!1);_.useEffect(()=>{Ie||Sn(!1)},[Ie]);const[ct,Nn]=_.useState(!1),[Wn,fn]=_.useState([]),[el,Bt]=_.useState(!1),[at,Rt]=_.useState(pl),[Yn,Tt]=_.useState(null),[et,rt]=_.useState(null),[pn,bn]=_.useState([]),[Kn,en]=_.useState(null),[St,Pt]=_.useState(null),[Dt,$n]=_.useState([]),[le,pe]=_.useState([]),[qe,Fe]=_.useState([]),[Ve,bt]=_.useState([]),[$,se]=_.useState(null),[Ce,Le]=_.useState(null),[_t,Xn]=_.useState({}),[Zn,Hl]=_.useState(null),[bl,Bl]=_.useState({}),[ls,ss]=_.useState(null),[Ka,Il]=_.useState([]),[tl,Ot]=_.useState(!1),[Ze,On]=_.useState(null),[Xt,wl]=_.useState(null),cl=(Xt==null?void 0:Xt.enabledProviders)??["claude","antigravity","codex"],[tn,ol]=_.useState(!1),[_n,Sl]=_.useState(Mk),[We,ql]=_.useState(null),[tt,Et]=_.useState(null),[It,Gl]=_.useState(!1),[kn,ul,as]=J0(),Tn=sv(),[nn,Yl]=_.useState(!1),[Vt,fl]=_.useState(null),[En,Ct]=_.useState(null),[Za,Ls]=_.useState(null),[is,Ln]=_.useState(null),[$l,rs]=_.useState(null),[yn,zs]=_.useState(""),[da,Nl]=_.useState(null),[kl,ge]=_.useState([]),[k,K]=_.useState(!1),[he,Te]=_.useState(null),[Ee,He]=_.useState(!1),[Ye,Wt]=_.useState(!1),[Qt,yt]=_.useState({}),[mn,Kt]=_.useState([""]),[nl,zn]=_.useState([]),[Xl,Tl]=_.useState(null),[N,ae]=_.useState(null),[we,lt]=_.useState(null),[Cn,Vl]=_.useState(null),[zc,Fa]=_.useState(null),[$i,Xi]=_.useState({}),[ha,Uc]=_.useState({}),[vn,Ql]=_.useState(!1),[Cr,pa]=_.useState(null),[Ar,Vi]=_.useState(null),Mr=_.useRef(0),Us=_.useRef(null),[vs,Rr]=_.useState(!1),[Dr,Qi]=_.useState([]),[nd,Ja]=_.useState(null),[ld,Or]=_.useState(null),Lr=iv(),Hc=uv(Ie&&vs),Ki=_.useRef(new Map),Hs=(Xt==null?void 0:Xt.terminalEnabled)===!0,zr=Hf()==="relay"&&((Js=d==null?void 0:d.shell)==null?void 0:Js.enabled)!==!0,Bc=_.useRef(!1),sd=_.useCallback((p,U)=>(Ki.current.set(p,U),()=>{Ki.current.get(p)===U&&Ki.current.delete(p)}),[]),[ma,Pa]=_.useState(!1),[su,Ur]=_.useState(null),[au,Zi]=_.useState(pl),[js,Hr]=_.useState(null),[Fi,ga]=_.useState({}),Ji=_.useRef([]),[dn,Ic]=_.useState(null);function ad(p){Ic(U=>U===p?null:p)}_.useEffect(()=>{(Ie||dn==="terminal"&&!vs||dn==="files"&&!Ye||dn==="search"&&!vn||dn==="git"&&!nn||dn==="ask"&&!ma||dn==="main"&&nl.length===0)&&Ic(null)},[dn,Ie,vs,Ye,vn,nn,ma,nl.length]);const[id]=_.useState(Tk),Pi=_.useRef(id),Bs=_.useRef(!1),Un=_.useRef(null),Wa=_.useRef(null),ei=_.useRef(null),qc=_.useRef(0),An=_.useRef(null),Gc=_.useRef(0);Un.current=z,An.current=w,Gc.current=Oe.lastSeq;const xa=_.useRef(Be);xa.current=Be;const ws=_.useRef(null),iu=_.useRef(0);iu.current=au.lastSeq;const Br=_.useRef(null),Wi=_.useRef(""),ti=_.useRef(null),Kl=_.useRef([]),ni=_.useRef([""]);Kl.current=nl,ni.current=mn;const er=_.useRef(new Map),ba=_.useRef(new Set),li=_.useRef(null),si=_.useRef(null),Ir=_.useRef(0),_a=_.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(),Bl({});const vt=Un.current;vt&&p.send({type:"session.sync",sessionId:vt,sinceSeq:Gc.current});const gn=ws.current;gn&&p.send({type:"session.sync",sessionId:gn,sinceSeq:iu.current})});const ce=p.on(vt=>ru(vt));p.connect();const Ne=window.setInterval(()=>{U(),p.connected&&p.send({type:"ping",nonce:Date.now()})},15e3);return()=>{ce(),window.clearInterval(Ne),p.close()}},[]);const ru=_.useCallback(p=>{var U,ce,Ne,vt,gn,yl,Da,gi,xi;switch(p.type){case"hello.ok":r(!0);break;case"workspace.list":{T(p.workspaces),M(p.archived),Z($e=>{var Fl;if($e)return $e;const dt=Pi.current,At=dt&&Ek(p.workspaces,dt.workspaceId);return dt&&At&&At.id!==dt.workspaceId&&(Pi.current={...dt,workspaceId:At.id}),(At==null?void 0:At.id)??((Fl=p.workspaces[0])==null?void 0:Fl.id)??null});const be=ti.current;if(!be)break;const Ae=p.workspaces.find($e=>Hk($e.path,be));if(!Ae)break;ti.current=null,Nn(!1),Z(Ae.id);break}case"workspace.candidates":if(p.query.trim()!==Wi.current)break;fn(p.candidates),p.source==="host"&&Bt(!1);break;case"finder.opened":Br.current=p.sessionId;break;case"workspace.roots":bn(p.roots);break;case"workspace.created":if(Z(p.workspace.id),p.warnings.length===0){Nn(!1),rt(null);break}en({path:p.workspace.path,warnings:p.warnings});break;case"session.list":if(p.workspaceId!==An.current)break;X(p.sessions),L(p.archived);break;case"folder.list":F(p.workspaceFolders),H(p.sessionFolders),D(p.pinnedFolders??[]);break;case"session.pinned":ie(p.sessions);break;case"session.live":Se(p.sessions);break;case"order.state":Me(p.order);break;case"session.summary":if(p.session.id===Br.current){Tt(p.session);break}if(p.session.parentSessionId){p.session.id===ws.current&&Hr(p.session);break}if(Se(be=>{const Ae=be.findIndex(dt=>dt.id===p.session.id);if(p.session.state==="closed")return Ae===-1?be:be.filter(dt=>dt.id!==p.session.id);if(Ae===-1)return[...be,p.session];const $e=be.slice();return $e[Ae]=p.session,$e}),X(be=>{const Ae=be.findIndex(dt=>dt.id===p.session.id);if(Ae===-1)return[p.session,...be];const $e=be.slice();return $e[Ae]=p.session,$e}),ie(be=>{const Ae=be.findIndex(dt=>dt.id===p.session.id);if(Ae===-1)return be;const $e=be.slice();return $e[Ae]={...p.session,pinned:!0,...be[Ae].pinnedAt?{pinnedAt:be[Ae].pinnedAt}:{}},$e}),Un.current===null&&ei.current&&ei.current.workspaceId===p.session.workspaceId&&(u_(p.session.id,ei.current.text),ei.current=null),me(be=>be??p.session.id),((U=Wa.current)==null?void 0:U.sessionId)===p.session.id){const be=Wa.current;p.session.state==="error"?Wa.current=null:p.session.state!=="closed"&&(Wa.current=null,(ce=l.current)==null||ce.send({type:"prompt.send",sessionId:be.sessionId,text:be.text,images:be.images}))}break;case"usage.state":p.sessionId===Un.current&&(ql(p.usage),Gl(!1));break;case"context.state":p.sessionId===Un.current&&(Et(p.context),Gl(!1));break;case"session.capabilities":p.sessionId===Un.current&&Re(p.capabilities);break;case"session.events":if(p.sessionId===ws.current){Zi(be=>Bf(be,p.entries));break}if(p.sessionId===Br.current){Rt(be=>Bf(be,p.entries));break}if(p.sessionId!==Un.current)break;for(const be of p.entries){if(be.event.kind!=="rewound")continue;const Ae=be.event.toUserIndex,$e=Z0(xa.current.entries,Ae),dt=$e.reduce((At,Fl)=>Fl.event.kind==="user.message"?At+1:At,0);on(At=>({...At,entries:$e})),Ue(At=>({...At,items:F0(At.items,Ae,dt)}))}Ue(be=>Bf(be,p.entries));break;case"session.history":if(p.sessionId!==Un.current)break;on(be=>V0(be,p));break;case"side.opened":{if(p.parentSessionId!==Un.current)break;ws.current=p.sessionId,Ur(p.sessionId);const be=Ji.current;Ji.current=[];for(const Ae of be)Ae(p.sessionId);break}case"side.closed":if(p.parentSessionId!==Un.current)break;ws.current=null,Ur(null),Zi(pl),Hr(null);break;case"git.state":if(p.workspaceId!==An.current)break;fl(p.state);break;case"git.commit":if(p.workspaceId!==An.current)break;Ct(p.detail);break;case"git.result":if(p.workspaceId!==An.current)break;Ln({ok:p.ok,message:p.message,url:p.url}),p.ok&&(Ct(null),Ls(null),K(!1),He(!1));break;case"git.busy":if(p.workspaceId!==An.current)break;zs(p.label);break;case"git.files":if(p.workspaceId!==An.current)break;Te({files:p.files,truncated:p.truncated});break;case"github.status":Nl(p.status);break;case"github.owners":ge(p.owners);break;case"fs.dir":if(p.workspaceId!==An.current)break;yt(be=>({...be,[p.path]:p.entries}));break;case"fs.search":if(p.workspaceId!==An.current)break;if(p.scope!=="tree"){const be=p.scope;Uc(Ae=>({...Ae,[be]:{query:p.query,entries:p.entries}}));break}Fa({query:p.query,entries:p.entries,truncated:p.truncated});break;case"fs.grep":if(p.workspaceId!==An.current)break;pa({query:p.query,matches:p.matches,truncated:p.truncated});break;case"fs.file":{if(p.workspaceId!==An.current)break;const be=ba.current.delete(p.file.path);zn($e=>{const dt=$e.findIndex(mo=>mo.path===p.file.path);if(dt===-1)return[...$e,_b(p.file,++Ir.current)];const At=$e[dt],Fl=$e.slice();return Fl[dt]=At.saved===p.file.content&&!Xa(At)?{...At,mtime:p.file.mtime,size:p.file.size,stale:!1}:_b(p.file,++Ir.current),Fl}),be&&Tl(p.file.path);const Ae=Us.current;Ae&&Ae.path===p.file.path&&(Us.current=null,Vi({...Ae,token:++Mr.current}));break}case"fs.media":{if(p.workspaceId!==An.current)break;_a.current.delete(p.path),zn(be=>be.map(Ae=>Ae.path===p.path?{...Ae,mediaBase64:p.base64,mediaError:void 0}:Ae));break}case"fs.mediaFailed":{if(p.workspaceId!==An.current)break;_a.current.delete(p.path),zn(be=>be.map(Ae=>Ae.path===p.path?{...Ae,mediaError:p.message}:Ae));break}case"fs.saved":{if(p.workspaceId!==An.current)break;const be=er.current.get(p.path);er.current.delete(p.path);const Ae=be!==void 0;zn(dt=>dt.map(At=>At.path!==p.path?At:Ae?{...At,saved:be,mtime:p.mtime,size:p.size,stale:!1}:{...At,stale:!0}));const $e=Kl.current.find(dt=>dt.path===p.path);!Ae&&$e&&!Xa($e)&&((Ne=l.current)==null||Ne.send({type:"fs.read",workspaceId:p.workspaceId,path:p.path})),(vt=l.current)==null||vt.send({type:"git.state",workspaceId:p.workspaceId});break}case"fs.result":{if(p.workspaceId!==An.current)break;if(ae({ok:p.ok,message:p.message}),p.ok||er.current.delete(p.path),p.conflict&&zn(Ae=>Ae.map($e=>$e.path===p.path?{...$e,stale:!0}:$e)),si.current===p.path){const Ae=si.current;si.current=null,p.ok&&(ba.current.add(Ae),(gn=l.current)==null||gn.send({type:"fs.read",workspaceId:p.workspaceId,path:Ae}))}const be=li.current;if(p.ok&&be&&be.to===p.path){li.current=null;const Ae=$e=>$e===be.from?be.to:$e.startsWith(`${be.from}/`)?be.to+$e.slice(be.from.length):$e;zn($e=>$e.map(dt=>({...dt,path:Ae(dt.path)}))),Tl($e=>$e===null?null:Ae($e)),Kt($e=>$e.map(Ae)),yt($e=>{const dt={};for(const[At,Fl]of Object.entries($e))At===be.from||At.startsWith(`${be.from}/`)||(dt[At]=Fl);return dt})}p.ok&&((yl=l.current)==null||yl.send({type:"git.state",workspaceId:p.workspaceId}));break}case"term.list":if(p.workspaceId!==An.current)break;Qi(p.terminals);break;case"term.opened":if(p.terminal.workspaceId!==An.current)break;Or(null),Qi(be=>{const Ae=be.findIndex(dt=>dt.id===p.terminal.id);if(Ae===-1)return[...be,p.terminal];const $e=be.slice();return $e[Ae]=p.terminal,$e}),Bc.current&&(Bc.current=!1,Ja(p.terminal.id));break;case"term.buffer":(Da=Ki.current.get(p.id))==null||Da({kind:"buffer",data:p.data});break;case"term.data":(gi=Ki.current.get(p.id))==null||gi({kind:"data",data:p.data});break;case"term.exit":Qi(be=>be.map(Ae=>Ae.id===p.id?{...Ae,exitCode:p.exitCode}:Ae));break;case"term.closed":Qi(be=>be.filter(Ae=>Ae.id!==p.id));break;case"mcp.list":p.sessionId===Un.current&&$n(p.servers);break;case"mcp.auth":p.sessionId===Un.current&&Le(p.state);break;case"plugin.list":if(p.sessionId!==Un.current)break;pe(p.plugins),Fe(p.marketplaces),bt(p.catalog);break;case"operation.result":p.sessionId===Un.current&&se(p.result);break;case"auth.status":On(p.status);break;case"relay.state":h(p.state);break;case"network.state":g(p.state);break;case"settings.state":wl(p.settings);break;case"handoff.state":Xn(be=>{if(!p.handoff){if(!(p.sessionId in be))return be;const Ae={...be};return delete Ae[p.sessionId],Ae}return{...be,[p.sessionId]:p.handoff}});break;case"handoff.written":Bl(be=>{if(!(p.sessionId in be))return be;const Ae={...be};return delete Ae[p.sessionId],Ae}),p.handoff&&Un.current===p.sessionId?ss(p.handoff):p.handoff||console.warn("[handoff] хост не смог записать хэндофф",p.sessionId);break;case"limit.stopped":qc.current+=1,Il(be=>[...be,{id:qc.current,limit:p.limit,utilization:p.utilization,stopped:p.stopped,handoffs:p.handoffs}]);break;case"auth.login":Sl(p.state),p.state.active&&Ot(!0);break;case"session.closed":Se(be=>be.filter(Ae=>Ae.id!==p.sessionId)),X(be=>be.map(Ae=>Ae.id===p.sessionId?{...Ae,state:"closed"}:Ae));break;case"error":console.error("[host]",p.message,p.context??""),(p.context==="workspace.open"||p.context==="workspace.create")&&(ti.current=null,rt(p.message)),(xi=p.context)!=null&&xi.startsWith("term.")&&Or(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(Bs.current)return;const p=Pi.current;if(!p||!w)return;if(w!==p.workspaceId){Bs.current=!0;return}if(z){Bs.current=!0;return}if(V.length===0)return;const U=V.find(ce=>Ck(ce,p));Bs.current=!0,U&&U.state!=="closed"&&ci(U)},[V,w,z]),_.useEffect(()=>{!w||zr||!Hs||te({type:"term.list",workspaceId:w})},[w,zr,Hs,te]),_.useEffect(()=>{Ja(p=>{var U;return p&&Dr.some(ce=>ce.id===p)?p:((U=Dr[0])==null?void 0:U.id)??null})},[Dr]),_.useEffect(()=>{ct&&te({type:"workspace.roots"})},[ct,te]);const ya=_.useCallback(()=>{const p=Un.current;p&&(Gl(!0),te({type:"usage.get",sessionId:p}),te({type:"context.get",sessionId:p}))},[te]);_.useEffect(()=>{if(!It)return;const p=window.setTimeout(()=>Gl(!1),kk);return()=>window.clearTimeout(p)},[It]);const Yc=_.useMemo(()=>{const p=Math.max((We==null?void 0:We.fetchedAt)??0,(tt==null?void 0:tt.fetchedAt)??0);return p>0?p:null},[We==null?void 0:We.fetchedAt,tt==null?void 0:tt.fetchedAt]);_.useEffect(()=>{if(Et(null),!z)return;ya();const p=()=>{document.hidden||ya()},U=window.setInterval(p,Nk),ce=()=>{document.hidden||ya()};return document.addEventListener("visibilitychange",ce),()=>{window.clearInterval(U),document.removeEventListener("visibilitychange",ce)}},[z,ya]),_.useEffect(()=>{if(!z){on(qh);return}on({...qh,loading:!0}),te({type:"session.history",sessionId:z})},[z,te]);const rd=_.useCallback(()=>{!z||Be.loading||!Lx(Be)||(on(p=>({...p,loading:!0})),te({type:"session.history",sessionId:z,before:h_(Be)}))},[z,Be,te]),cd=_.useMemo(()=>Q0(Be.entries),[Be.entries]),q=_.useMemo(()=>V.find(p=>p.id===z)??null,[V,z]),tr=z?(q==null?void 0:q.claudeSessionId)??z:null,Vn=tr?_t[tr]??null:null;_.useEffect(()=>{tr&&te({type:"handoff.get",sessionId:tr})},[tr,te]),_.useEffect(()=>{Zn&&!(Zn.sessionId in _t)&&Hl(null)},[_t,Zn]);const ai=_.useMemo(()=>{var ce;if(!We)return null;const p=(((ce=We.buckets)==null?void 0:ce.length)??0)>0,U=(q==null?void 0:q.provider)!=="claude";return p===U?We:null},[We,q==null?void 0:q.provider]),$c="Обновить лимиты и контекст",cu=$c+(Yc?`
134
+ обновлено в ${new Date(Yc).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:"");_.useEffect(()=>{document.documentElement.dataset.provider=(q==null?void 0:q.provider)??"claude"},[q==null?void 0:q.provider]),_.useEffect(()=>{(q==null?void 0:q.provider)!=="claude"&&Pa(!1)},[q==null?void 0:q.provider]);const va=C.find(p=>p.id===w)??E.find(p=>p.id===w)??null;_.useEffect(()=>{if(!w||!z)return;const p={workspaceId:w,sessionId:z,claudeSessionId:(q==null?void 0:q.claudeSessionId)??null};try{localStorage.setItem(ay,JSON.stringify(p))}catch{}},[w,z,q==null?void 0:q.claudeSessionId]);function ou(p){ti.current=p,rt(null),te({type:"workspace.open",path:p})}function Xc(p,U,ce){rt(null),te({type:"workspace.create",parent:p,name:U,init:ce})}function od(p){if(Wi.current=p,!p){fn([]),Bt(!1);return}Bt(!0),te({type:"workspace.find",query:p})}function ii(p){Wi.current=p,Rt(pl),te({type:"workspace.find.agent",query:p})}function Vc(){Nn(!1),rt(null),en(null),fn([]),Rt(pl),Tt(null),Wi.current="",ti.current=null}function cs(){const p=Un.current;p&&ws.current&&te({type:"side.reset",sessionId:p}),ws.current=null,Ur(null),Zi(pl),Hr(null),ga({}),Ji.current=[]}function Qc(p){te({type:"workspace.close",workspaceIds:p}),!(!w||!p.includes(w))&&(cs(),Z(null),me(null),X([]),L([]),Ue(pl),Re(null),mt(!1))}function uu(p,U){te({type:"session.archive",workspaceId:p,sessionIds:U}),z&&(U.includes(z)||q!=null&&q.claudeSessionId&&U.includes(q.claudeSessionId))&&(cs(),me(null),Ue(pl),Re(null),mt(!1))}function ja(p){te({type:"workspace.restore",workspaceIds:p})}function ri(p,U,ce){te({type:"folder.create",scope:p,name:U,workspaceId:ce})}function Kc(p,U){te({type:"folder.rename",folderId:p,name:U})}function fu(p,U){te({type:"folder.setColor",folderId:p,color:U})}function wa(p){te({type:"folder.delete",folderId:p})}function du(p,U,ce,Ne){te({type:"folder.assign",scope:p,itemId:U,folderId:ce,workspaceId:Ne})}function hu(p=cl[0]??"claude"){w&&(cs(),me(null),Re(null),Ue(pl),mt(!1),te({type:"session.start",workspaceId:w,provider:p}),Jt(!1))}function qr(p){cs(),ir(),Z(p),me(null),Ue(pl),Re(null),mt(!1),fl(null),Ct(null),Ls(null),Ln(null),zs(""),K(!1),Te(null),He(!1),Qi([]),Ja(null)}function ud(p,U,ce){te({type:"session.pin",workspaceId:p,sessionIds:U,pinned:ce})}function fd(p){return p.state==="running"||p.state==="waiting_permission"||p.state==="reconnecting"||p.backgroundWork}function Zc(p){if(fd(p)){Q(p);return}te({type:"session.close",sessionId:p.id})}function pu(p,U,ce){Me(Ne=>{const vt=Ne??{workspaces:[],sessions:{},pinned:[],live:[]};if(p==="sessions"){if(!ce)return Ne;const gn={...vt.sessions};return U&&U.length>0?gn[ce]=U:delete gn[ce],{...vt,sessions:gn}}return{...vt,[p]:U??[]}}),te({type:"order.set",scope:p,ids:U,...ce?{workspaceId:ce}:{}})}function mu(p){p.workspaceId!==w&&qr(p.workspaceId),ci(p)}function ci(p){if(Jt(!1),cs(),Ue(pl),Re(null),mt(!1),p.state==="closed"){me(null),te({type:"session.start",workspaceId:p.workspaceId,resume:p.id,provider:p.provider});return}me(p.id),te({type:"session.sync",sessionId:p.id,sinceSeq:0})}function Zl(p,U){if(!z||x)return!1;const ce=z,Ne=q;return nr(()=>{if((Ne==null?void 0:Ne.state)==="closed"){Wa.current={sessionId:Ne.id,text:p,images:U},ci(Ne);return}te({type:"prompt.send",sessionId:ce,text:p,images:U})})}function nr(p){const U=(q==null?void 0:q.provider)!=="claude"?null:ck(We,Xt);return U?new Promise(ce=>{ue(Ne=>(Ne==null||Ne.resolve(!1),{warning:U,resolve:ce}))}).then(ce=>(ce&&p(),ce)):(p(),!0)}function dl(p){fe&&(fe.resolve(p),ue(null))}function Sa(p){const U=xe.find(ce=>(ce.claudeSessionId??ce.id)===p.sessionId&&ce.state!=="closed");lr(p.workspaceId,p.sessionId,p.text),U&&te({type:"session.close",sessionId:U.id})}function Gr(p){lr(p.workspaceId,p.claudeSessionId??p.id,null)}function lr(p,U,ce){ei.current=ce===null?null:{workspaceId:p,text:ce},p!==w?qr(p):(cs(),me(null),Re(null),Ue(pl),mt(!1)),te({type:"session.start",workspaceId:p,provider:"claude",continuesFrom:U,...ce===null?{}:{fromHandoff:!0}}),Jt(!1)}_.useEffect(()=>{ls&&(ss(null),Sa(ls))},[ls]);function sr(p){bl[p.id]||(Bl(U=>({...U,[p.id]:!0})),te({type:"session.handoff",sessionId:p.id}))}function Fc(p){te({type:"handoff.dismiss",sessionId:p})}function Is(p,U){te({type:"session.rename",sessionId:p.id,title:U,workspaceId:p.workspaceId}),X(ce=>ce.map(Ne=>Ne.id===p.id?{...Ne,title:U}:Ne))}function Jc(p){z&&(Jt(!1),se(null),Le(null),Pt(p),te({type:"mcp.list",sessionId:z}),te({type:"plugin.list",sessionId:z}))}const Yr={mcpAction:(p,U)=>{z&&(se(null),te({type:"mcp.action",sessionId:z,name:p,action:U}))},mcpAuth:p=>{z&&(se(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 Na(){Jt(!1),Ot(!0),te({type:"auth.status"})}const Pc={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 _l(){Jt(!1),ol(!0),te({type:"settings.get"})}function Wc(p){wl(U=>U&&{...U,...p}),te({type:"settings.update",settings:p})}function Ss(p){!z||x||te({type:"side.ask",sessionId:z,text:p})}function gu(){z&&(te({type:"side.reset",sessionId:z}),ws.current=null,Ur(null),Zi(pl),Hr(null),ga({}),Ji.current=[])}function qs(p){const U=ws.current;if(U){p(U);return}const ce=Un.current;ce&&(Ji.current.push(p),te({type:"side.open",sessionId:ce}))}function Gs(){w&&te({type:"git.state",workspaceId:w})}function eo(p){w&&(Ls(p),te({type:"git.show",workspaceId:w,ref:p}))}function to(p,U){Ln(null),rs({target:p,label:U})}function no(){!w||!$l||(te({type:"git.checkout",workspaceId:w,target:$l.target}),rs(null))}function xu(){w&&(Ln(null),te({type:"git.push",workspaceId:w}))}function El(p){w&&(Ln(null),te({type:"git.pull",workspaceId:w,merge:p}))}function oi(){w&&(Ln(null),Te(null),K(!0),te({type:"github.status"}),te({type:"github.owners"}),te({type:"git.files",workspaceId:w}))}function ui(p){w&&(Ln(null),te({type:"git.publish",workspaceId:w,...p}))}function $r(p){w&&(Ln(null),te({type:"git.remote",workspaceId:w,url:p}))}function ar(){Ln(null),He(!0)}function Cl(p){te({type:"github.token",token:p}),te({type:"github.owners"})}function Al(){te({type:"github.status"}),te({type:"github.owners"})}_.useEffect(()=>{if(!(!Ye||!w))for(const p of mn)p in Qt||te({type:"fs.list",workspaceId:w,path:p})},[Ye,mn,Qt,w,te]);function Ys(p){Kt(U=>U.includes(p)?U.filter(ce=>ce!==p):[...U,p])}function os(p){if(!p){Fa(null);return}w&&te({type:"fs.search",workspaceId:w,query:p})}function us(p){if(!p){pa(null);return}w&&te({type:"fs.grep",workspaceId:w,query:p})}const fs=_.useCallback((p,U)=>{Xi(vt=>({...vt,[p]:U}));const ce=An.current;if(U===null||!ce)return;const Ne=U.lastIndexOf("/");if(Ne!==-1){te({type:"fs.list",workspaceId:ce,path:U.slice(0,Ne)});return}if(U===""){te({type:"fs.list",workspaceId:ce,path:""});return}te({type:"fs.search",workspaceId:ce,query:U,scope:p})},[te]),bu=_.useMemo(()=>Wb($i.mention??null,ha.mention??null,Qt),[$i.mention,ha.mention,Qt]),lo=_.useMemo(()=>Wb($i.side??null,ha.side??null,Qt),[$i.side,ha.side,Qt]);function so(p){Mn(p.path,{line:p.line,column:p.column})}function _u(p){const U=[];let ce=Sr(p.path);for(;U.push(ce),!!ce;)ce=Sr(ce);Kt(Ne=>{const vt=new Set(Ne);for(const gn of U)vt.add(gn);return p.kind==="dir"&&vt.add(p.path),[...vt]}),p.kind==="file"&&Mn(p.path)}function Mn(p,U){if(Kl.current.find(Ne=>Ne.path===p)){Tl(p),U&&Vi({path:p,...U,token:++Mr.current});return}w&&(U&&(Us.current={path:p,...U}),ba.current.add(p),te({type:"fs.read",workspaceId:w,path:p}))}function Lt(p,U=!1){const ce=Kl.current,Ne=ce.find(yl=>yl.path===p);if(Ne&&Xa(Ne)&&!U){Vl(p);return}Vl(null);const vt=ce.findIndex(yl=>yl.path===p),gn=ce.filter(yl=>yl.path!==p);zn(gn),Tl(yl=>{var Da;return yl===p?((Da=gn[Math.min(vt,gn.length-1)])==null?void 0:Da.path)??null:yl})}function it(p,U=!1){const ce=Kl.current.find(Ne=>Ne.path===p);!ce||!w||!U&&!Xa(ce)||(er.current.set(p,ce.text),te({type:"fs.write",workspaceId:w,path:p,content:ce.text,eol:ce.eol,encoding:ce.encoding,baseMtime:ce.mtime,...U?{force:!0}:{}}))}function $s(p){w&&te({type:"fs.read",workspaceId:w,path:p})}function Ml(p){w&&(_a.current.has(p)||(_a.current.add(p),te({type:"fs.readMedia",workspaceId:w,path:p})))}const ao=_.useRef(new Map);function Xs(p){const U=ao.current,ce=U.get(p);ce&&clearTimeout(ce);const Ne=(Xt==null?void 0:Xt.autoSaveAfterPauseMs)??0;Ne<=0||U.set(p,setTimeout(()=>{U.delete(p);const vt=Kl.current.find(gn=>gn.path===p);vt&&Xa(vt)&&!vt.stale&&it(p)},Ne))}function yu(p,U,ce){if(!w)return;const Ne=p?`${p}/${ce}`:ce;ae(null),U==="file"&&(si.current=Ne),te({type:"fs.create",workspaceId:w,path:Ne,kind:U})}function vu(p,U){if(!w)return;const ce=Sr(p),Ne=ce?`${ce}/${U}`:U;ae(null),li.current={from:p,to:Ne},te({type:"fs.rename",workspaceId:w,path:p,to:Ne})}function fi(p,U){if(!w)return;const ce=p.slice(p.lastIndexOf("/")+1),Ne=U?`${U}/${ce}`:ce;Ne!==p&&(ae(null),li.current={from:p,to:Ne},te({type:"fs.rename",workspaceId:w,path:p,to:Ne}))}function ka(p,U){w&&(ae(null),te({type:"fs.copy",workspaceId:w,path:p,toDir:U}))}function io(p){w&&(ae(null),lt(null),te({type:"fs.delete",workspaceId:w,path:p.path}),zn(U=>U.filter(ce=>ce.path!==p.path&&!ce.path.startsWith(`${p.path}/`))),Tl(U=>U&&(U===p.path||U.startsWith(`${p.path}/`))?null:U))}function ir(){yt({}),Kt([""]),zn([]),Tl(null),ae(null),Fa(null),pa(null),Xi({}),Uc({}),Vi(null),ba.current.clear(),er.current.clear(),_a.current.clear(),Us.current=null,li.current=null,si.current=null}function ro(){!w||zr||!Hs||(Or(null),Bc.current=!0,te({type:"term.open",workspaceId:w,cols:80,rows:24}))}function Ta(p){te({type:"term.close",id:p})}function Ns(p,U){z&&te({type:"permission.respond",sessionId:z,requestId:p,decision:U})}function Vs(p,U){z&&te({type:"permission.respond",sessionId:z,requestId:p,decision:"allow",answers:U})}function ks(p){z&&te({type:"permission.respond",sessionId:z,requestId:p,decision:"deny",reason:"Пользователь не стал отвечать на вопросы"})}function co(p,U){z&&te({type:"permission.respond",sessionId:z,requestId:p,decision:"allow",plan:U})}function oo(p){z&&te({type:"permission.respond",sessionId:z,requestId:p,decision:"deny",reason:"Пользователь просит продолжить планирование"})}_.useEffect(()=>{function p(U){if(U.key!=="Escape")return;if(dn!==null){const Ne=U.target;if(!(Ne instanceof HTMLElement&&Ne.closest(".termview, .editor, .sidepane"))){Ic(null);return}}if(!z||Oe.pending.length>0)return;const ce=U.target;ce instanceof HTMLElement&&ce.closest(".sidepane, .editor")||te({type:"control.interrupt",sessionId:z})}return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[z,Oe.pending.length,te,dn]),_.useEffect(()=>{function p(U){U.key!=="`"||!(U.ctrlKey||U.metaKey)||Hs&&(U.preventDefault(),Rr(ce=>!ce))}return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[Hs]);const Ea=_.useMemo(()=>{const p=(ye==null?void 0:ye.commands)??[];return p.length===0||(q==null?void 0:q.provider)!=="claude"?p:[...p,{name:"plugins",description:"Плагины и маркетплейсы — окно приложения",argumentHint:"",aliases:["plugin"]},...Pb]},[ye,q==null?void 0:q.provider]);function rr(p){if(p==="fork"&&(q==null?void 0:q.provider)==="codex"&&z&&!ll){const ce=q;return me(null),Re(null),Ue(pl),te({type:"session.start",workspaceId:ce.workspaceId,provider:"codex",resume:ce.id,fork:!0}),!0}const U=Ak[p];return U&&(q==null?void 0:q.provider)==="claude"?(Jc(U),!0):(q==null?void 0:q.provider)!=="claude"||!Pb.some(ce=>ce.name===p)?!1:(Na(),p==="logout"&&Pc.logout(),p==="switch-account"&&Pc.login("claudeai",!0),!0)}const ds=(q==null?void 0:q.state)==="waiting_permission",zt=(q==null?void 0:q.state)==="reconnecting",ll=(q==null?void 0:q.state)==="running"||zt||ds,Zt=Oe.pending[0]??null,uo=Zt?AS(Zt.toolName,Zt.input):null,[dd,hd]=_.useState(()=>new Set),ln=Zt?dd.has(Zt.requestId):!1,Xr=Zt?Zt.questions&&Zt.questions.length>0?"question":uo!==null?"plan":"permission":null;function Qs(p,U){hd(ce=>{if(ce.has(p)===U)return ce;const Ne=new Set(ce);return U?Ne.add(p):Ne.delete(p),Ne})}_.useEffect(()=>{!nn&&!Ye||!w||ll||te({type:"git.state",workspaceId:w})},[nn,Ye,w,ll,te]),_.useEffect(()=>{if(!(ll||!w)){Ye&&yt(p=>{const U={};for(const[ce,Ne]of Object.entries(p))ni.current.includes(ce)||(U[ce]=Ne);return U});for(const p of Kl.current)Xa(p)||te({type:"fs.read",workspaceId:w,path:p.path})}},[ll,w,Ye,te]);const Ca=(q==null?void 0:q.cwd)??(ye==null?void 0:ye.cwd)??null,Vr=(ye==null?void 0:ye.models)??[],Ts=(q==null?void 0:q.model)??(ye==null?void 0:ye.model)??null,{rows:Aa,selected:pd}=t_(Vr,Ts),di=js?{model:js.model,effort:js.effort,ultracode:js.ultracode,thinking:js.thinking,switchOnFlag:js.switchModelsOnFlag}:{model:Fi.model??Ts,effort:Fi.effort??(q==null?void 0:q.effort)??null,ultracode:Fi.ultracode??(q==null?void 0:q.ultracode)??!1,thinking:Fi.thinking??(q==null?void 0:q.thinking)??!0,switchOnFlag:Fi.switchOnFlag??(q==null?void 0:q.switchModelsOnFlag)??!0},ju=t_(Vr,di.model),wu=(js==null?void 0:js.state)==="running",Es=Xl?nl.find(p=>p.path===Xl)??null:null,fo=new Set(nl.filter(Xa).map(p=>p.path)),Ks=p=>a.jsx(fk,{pane:p,width:Tn.widths[p],onResize:U=>Tn.setWidth(p,U),onReset:()=>Tn.reset(p)}),Ma=p=>Ie?null:()=>ad(p),hi=(q==null?void 0:q.provider)==="codex"?W0:(q==null?void 0:q.provider)==="antigravity"?ev:p_,Qr=ye&&a.jsx(_s,{title:"Режим прав",value:(q==null?void 0:q.permissionMode)??"default",options:hi.map(p=>({value:p.value,label:p.value,hint:p.hint})),onChange:p=>{z&&te({type:"control.set_mode",sessionId:z,mode:p})}}),cr=Aa.length>0?a.jsx(W_,{models:Aa,value:pd,effort:(q==null?void 0:q.effort)??null,ultracode:(q==null?void 0:q.ultracode)??!1,thinking:(q==null?void 0:q.thinking)??!0,switchOnFlag:(q==null?void 0:q.switchModelsOnFlag)??!0,showSwitchOnFlag:(q==null?void 0:q.provider)==="claude",showUltracode:(q==null?void 0:q.provider)==="claude",showThinking:(q==null?void 0:q.provider)==="claude",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})}}):Ts&&a.jsx("span",{className:"badge",children:Ts}),Kr=ll&&a.jsx("span",{className:ds?"badge badge--wait":"badge badge--live",children:ds?"ждёт":zt?"переподключается":"работает"}),Su=(q==null?void 0:q.state)==="closed"&&a.jsx("span",{className:"badge",title:"Разговор сохранён — сессия поднимется заново, как только вы отправите сообщение",children:"остановлена"}),ho=Kr||Su,Zs=()=>{z&&te({type:"session.reconnect",sessionId:z})},Ra=zt?"Сессия уже поднимает новый процесс":ll?"Недоступно, пока идёт ход":"Поднять сессии новый процесс — разговор сохранён",Nu=z&&(zt||(q==null?void 0:q.state)==="error")?a.jsxs("div",{className:zt?"relink":"relink relink--error",role:"status",children:[a.jsxs("span",{className:"relink__msg",children:[a.jsx("span",{className:"relink__dot","aria-hidden":"true"}),zt?"Связь оборвалась. Сессия поднимает новый процесс — разговор сохранён.":"Переподключиться не удалось. Разговор сохранён — сессия продолжит с этого места."]}),a.jsx("button",{className:"btn btn--sm",title:zt?"Не ждать паузы между попытками — попробовать сейчас":"Поднять сессии новый процесс и продолжить разговор",onClick:Zs,children:zt?"Переподключить сейчас":"Переподключить"})]}):null,ku=Vn?a.jsx(tk,{handoff:Vn,onContinue:()=>Sa(Vn),onShow:()=>Hl(Vn),onDismiss:()=>Fc(Vn.sessionId)}):null,Fs=q&&q.totalCostUsd>0?`$${q.totalCostUsd.toFixed(3)}`:null,pi=(q==null?void 0:q.provider)==="claude"&&a.jsx("button",{className:ma?"pane-btn is-on":"pane-btn",title:"Вопрос на полях — спросить, не мешая работе","aria-label":"Вопрос на полях","aria-pressed":ma,onClick:()=>Pa(p=>!p),children:a.jsx(Ik,{})}),Zr=q&&q.state!=="closed"&&a.jsx("button",{type:"button",className:"pane-btn pane-btn--stop",title:"Остановить сессию — освобождает память хоста, разговор остаётся на диске","aria-label":"Остановить сессию",onClick:()=>Zc(q),children:a.jsx(zk,{})}),hs=q?bl[q.id]===!0:!1,mi=b_({onLongPress:()=>{q&&Gr(q)},onClick:()=>{q&&sr(q)},disabled:hs}),Tu=q&&q.state!=="closed"&&q.provider==="claude"&&a.jsxs("button",{type:"button",className:hs?"pane-btn pane-btn--handoff is-busy":mi.holding?"pane-btn pane-btn--handoff is-holding":"pane-btn pane-btn--handoff",style:{"--hold-ms":`${mi.thresholdMs}ms`},title:hs?"Пишется хэндофф…":"Клик — хэндофф и новая сессия: агент запишет сводку, сессия остановится, работа продолжится в новой. Зажать (или Shift+клик) — новая пустая сессия без хэндоффа: закрепление переходит, старая сессия продолжает работать.","aria-label":"Хэндофф и новая сессия","aria-busy":hs,disabled:hs,...mi.handlers,children:[a.jsx("span",{className:"pane-btn__hold","aria-hidden":"true"}),a.jsx(Uk,{})]});return a.jsxs("div",{className:"app",style:Tn.style,children:[a.jsx(sw,{open:Ke,connected:s,status:c,workspaces:C,archivedWorkspaces:E,workspaceFolders:I,sessionFolders:J.filter(p=>p.workspaceId===w),pinnedFolders:B,sessions:V.filter(p=>p.workspaceId===w),archived:A.filter(p=>p.workspaceId===w),pinned:Y,live:xe,listOrder:_e,liveSessionsFirst:(Xt==null?void 0:Xt.liveSessionsFirst)===!0,onReorder:pu,activeWorkspaceId:w,activeSessionId:z,onPinSessions:ud,onSelectPinned:mu,onCloseWorkspaces:Qc,onRestoreWorkspaces:ja,onArchiveSessions:uu,onUnarchiveSessions:p=>{w&&te({type:"session.unarchive",workspaceId:w,sessionIds:p})},onCreateFolder:ri,onRenameFolder:Kc,onSetFolderColor:fu,onDeleteFolder:wa,onAssignToFolder:du,onSelectWorkspace:qr,onSelectSession:ci,onRenameSession:Is,onStopSession:Zc,onOpenWorkspace:()=>Nn(!0),onNewSession:hu,enabledProviders:cl,onOpenExtensions:z&&(q==null?void 0:q.provider)==="claude"?()=>Jc("mcp"):null,account:Ze,onOpenAccount:Na,relay:d,onOpenRelay:v?null:()=>j(!0),onOpenSettings:_l,themeMode:kn,onCycleTheme:as}),Ks("sidebar"),Ke&&a.jsx("div",{className:"scrim",onClick:()=>Jt(!1)}),a.jsx(mj,{open:Ye,tree:Qt,expanded:new Set(mn),activePath:Xl,dirty:fo,gitChanges:(Vt==null?void 0:Vt.changed)??[],result:N,searchResult:zc,onSearch:os,onReveal:_u,onToggle:Ys,onOpen:Mn,onCreate:yu,onRename:vu,onMove:fi,onCopy:ka,onDelete:lt,onRefresh:()=>{ae(null),yt({}),Gs()},onClose:()=>Wt(!1),zoomed:dn==="files",onToggleZoom:Ma("files")}),Ye&&dn!=="files"&&Ks("files"),a.jsx(Nj,{open:vn,result:Cr,onSearch:us,onOpenMatch:so,onClose:()=>Ql(!1),zoomed:dn==="search",onToggleZoom:Ma("search")}),vn&&dn!=="search"&&Ks("search"),a.jsx(XS,{open:nn,state:Vt,result:is,selected:Za,busy:yn,onRefresh:Gs,onShow:eo,onCheckout:to,onPush:xu,onPull:El,onPublish:oi,onConnectRemote:ar,onDismissResult:()=>Ln(null),onClose:()=>Yl(!1),zoomed:dn==="git",onToggleZoom:Ma("git")}),nn&&dn!=="git"&&Ks("git"),a.jsxs("main",{className:dn==="main"||dn==="terminal"?"main main--zoomed":"main",children:[m&&x&&a.jsx(lk,{state:m}),a.jsxs("header",{className:"topbar",children:[a.jsx("button",{className:"btn btn--ghost menu-btn",onClick:()=>Jt(!0),children:"☰"}),a.jsx("button",{className:Ye?"pane-btn is-on":"pane-btn",title:"Файлы проекта","aria-label":"Файлы проекта","aria-pressed":Ye,onClick:()=>{Wt(p=>!p),Yl(!1),Ql(!1)},children:a.jsx(Dk,{})}),a.jsx("button",{className:vn?"pane-btn is-on":"pane-btn",title:"Поиск по тексту в проекте","aria-label":"Поиск по тексту в проекте","aria-pressed":vn,onClick:()=>{Ql(p=>!p),Wt(!1),Yl(!1)},children:a.jsx(Ok,{})}),a.jsx("button",{className:nn?"pane-btn is-on":"pane-btn",title:"История git","aria-label":"История git","aria-pressed":nn,onClick:()=>{Yl(p=>!p),Wt(!1),Ql(!1)},children:a.jsx(Lk,{})}),Hs&&a.jsx("button",{className:vs?"pane-btn is-on":"pane-btn",title:"Терминал (Ctrl+`)","aria-label":"Терминал","aria-pressed":vs,onClick:()=>Rr(p=>!p),children:a.jsx(Bk,{})}),Ie&&pi,Ie&&a.jsx("button",{className:un?"pane-btn is-on":"pane-btn",title:"Ещё","aria-label":"Ещё","aria-haspopup":"menu","aria-pressed":un,onClick:()=>Sn(!0),children:a.jsx(qk,{})}),a.jsxs("div",{className:"topbar__id",children:[ft&&q?a.jsx(oa,{className:"rename--title",value:q.title??"",onCommit:p=>{Is(q,p),mt(!1)},onCancel:()=>mt(!1)}):a.jsxs("div",{className:"topbar__head",children:[a.jsx("button",{className:"topbar__title",disabled:!q||Ie,title:q&&!Ie?"Переименовать сессию":void 0,onClick:()=>mt(!0),children:(q==null?void 0:q.title)??"Claude Code Visual"}),va&&a.jsx("span",{className:"topbar__project",title:va.path,children:va.name})]}),Ie?ho:Ca&&a.jsx(P_,{path:Ca})]}),!Ie&&a.jsxs("div",{className:"topbar__tools",children:[a.jsx("button",{type:"button",className:It?"meters-refresh is-busy":"meters-refresh",title:cu,"aria-label":$c,"aria-busy":It,disabled:!z||It,onClick:ya,children:a.jsx(Gk,{})}),a.jsx(ty,{usage:ai}),a.jsx(sy,{}),Qr,cr,ho,Fs&&a.jsx("span",{className:"badge badge--cost",children:Fs}),Tu,Zr,pi]})]}),a.jsx(wk,{tokens:(tt==null?void 0:tt.tokens)??Oe.contextTokens,maxTokens:(tt==null?void 0:tt.maxTokens)??null,fetchedAt:(tt==null?void 0:tt.fetchedAt)??null}),Ie&&un&&a.jsx(SN,{onClose:()=>Sn(!1),permission:Qr,model:cr,usage:ai,cwd:Ca,costLabel:Fs,onRefresh:ya,refreshing:It,metersFetchedAt:Yc,onRename:q?()=>{mt(!0),Sn(!1)}:null,onHandoff:q&&q.state!=="closed"&&q.provider==="claude"?()=>{sr(q),Sn(!1)}:null,onFreshSession:q&&q.state!=="closed"&&q.provider==="claude"?()=>{Gr(q),Sn(!1)}:null,handoffWriting:hs,onStop:q&&q.state!=="closed"?()=>{Zc(q),Sn(!1)}:null}),nl.length>0&&a.jsx($j,{files:nl,activePath:Xl,busy:ll,onSelect:Tl,onClose:p=>Lt(p),zoomed:dn==="main",onToggleZoom:Ma("main")}),Es?a.jsx(Gj,{file:Es,goto:(Ar==null?void 0:Ar.path)===Es.path?Ar:null,onChange:(p,U)=>{zn(ce=>ce.map(Ne=>Ne.path===p?{...Ne,text:U}:Ne)),Xs(p)},onSave:p=>it(p),onReload:$s,onOverwrite:p=>it(p,!0),onRequestMedia:Ml,onTogglePreview:p=>zn(U=>U.map(ce=>ce.path===p?{...ce,previewMode:!ce.previewMode}:ce))}):a.jsxs(a.Fragment,{children:[a.jsx(Hp,{items:Oe.items,busy:ll&&!zt,waiting:ds,empty:(q==null?void 0:q.provider)==="codex"?"Опишите задачу — Codex работает на вашем ПК в каталоге проекта. /login — вход с телефона, /help — команды.":(q==null?void 0:q.provider)==="antigravity"?"Сессия пуста. Опишите задачу — Antigravity работает в каталоге проекта.":void 0,history:cd,historyHasMore:Lx(Be),historyLoading:Be.loading,onLoadHistory:rd,sessionId:z??void 0,onEditMessage:(q==null?void 0:q.provider)==="antigravity"?void 0:(p,U,ce)=>{if(!z||x)return!1;const Ne=z;return nr(()=>te({type:"prompt.edit",sessionId:Ne,userIndex:p,text:U,images:ce}))}}),Nu,ku,z&&((po=q==null?void 0:q.tasks)!=null&&po.length)?a.jsx(Zj,{tasks:q.tasks,onStop:p=>te({type:"task.stop",sessionId:z,taskId:p})}):null,Zt&&Xr&&ln&&a.jsx(NS,{kind:Xr,toolName:Zt.toolName,queued:Oe.pending.length-1,onExpand:()=>Qs(Zt.requestId,!1)}),a.jsx(Z_,{disabled:!z,busy:ll&&!zt,sendBlocked:x,placeholder:zt?"Промпт уйдёт, как только связь вернётся":(q==null?void 0:q.state)==="closed"?"Остановлена — отправьте сообщение, чтобы продолжить":void 0,commands:Ea,sessionTitle:(q==null?void 0:q.title)??null,contextResult:bu,draftKey:z,onContextSearch:p=>fs("mention",p),onCommand:rr,onSend:Zl,onInterrupt:()=>{z&&te({type:"control.interrupt",sessionId:z})}})]}),vs&&Hs&&a.jsxs(a.Fragment,{children:[!Ie&&dn!=="terminal"&&a.jsx(hk,{height:Lr.height,onResize:Lr.setHeight,onReset:Lr.reset}),a.jsx(xk,{mobile:Ie,zoomed:dn==="terminal",onToggleZoom:Ma("terminal"),terminals:Dr,activeId:nd,blocked:zr,error:ld,onDismissError:()=>Or(null),height:Ie?Hc.height:Lr.height,offset:Ie?{top:Hc.offsetTop,left:Hc.offsetLeft}:void 0,onSelect:Ja,onOpen:ro,onClose:Ta,onInput:(p,U)=>te({type:"term.input",id:p,data:U}),onResize:(p,U,ce)=>te({type:"term.resize",id:p,cols:U,rows:ce}),onAttach:p=>te({type:"term.attach",id:p}),onHide:()=>Rr(!1),registerSink:sd})]})]}),a.jsx(pN,{open:ma,items:au.items,busy:wu,ready:z!==null,sendBlocked:x,commands:Ea,contextResult:lo,draftKey:z,models:ju.rows,model:ju.selected,effort:di.effort,ultracode:di.ultracode,thinking:di.thinking,switchOnFlag:di.switchOnFlag,onContextSearch:p=>fs("side",p),onCommand:rr,onModel:p=>{p&&(ga(U=>({...U,model:p})),qs(U=>te({type:"control.set_model",sessionId:U,model:p})))},onEffort:p=>{ga(U=>({...U,effort:p,ultracode:!1})),qs(U=>te({type:"control.set_effort",sessionId:U,effort:p}))},onUltracode:p=>{ga(U=>({...U,ultracode:p,...p?{effort:"xhigh"}:{}})),qs(U=>te({type:"control.set_ultracode",sessionId:U,enabled:p}))},onThinking:p=>{ga(U=>({...U,thinking:p})),qs(U=>te({type:"control.set_thinking",sessionId:U,enabled:p}))},onSwitchOnFlag:p=>{ga(U=>({...U,switchOnFlag:p})),qs(U=>te({type:"control.set_flag_switch",sessionId:U,enabled:p}))},onAsk:Ss,onInterrupt:()=>{su&&te({type:"control.interrupt",sessionId:su})},onReset:gu,onClose:()=>Pa(!1),zoomed:dn==="ask",onToggleZoom:Ma("ask")}),ma&&dn!=="ask"&&Ks("ask"),(nn||ma||Ye||vn)&&a.jsx("div",{className:"scrim scrim--pane",onClick:()=>{Yl(!1),Pa(!1),Wt(!1),Ql(!1)}}),En&&a.jsx(ZS,{detail:En,local:((Vt==null?void 0:Vt.hasRemote)??!1)&&(Vt==null?void 0:Vt.commits.some(p=>p.hash===En.hash&&!p.pushed))===!0,onCheckout:to,onClose:()=>{Ct(null),Ls(null)}}),fe&&a.jsxs(ml,{title:"Лимит плана почти исчерпан",onClose:()=>dl(!1),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",autoFocus:!0,onClick:()=>dl(!1),children:"Отмена"}),a.jsx("button",{className:"btn btn--primary",onClick:()=>dl(!0),children:"Отправить всё равно"})]}),children:[a.jsxs("p",{className:"modal__text",children:[Ff[fe.warning.limit][0].toUpperCase(),Ff[fe.warning.limit].slice(1)," использован на"," ",Math.round(fe.warning.utilization)," %, сброс в"," ",ok(fe.warning.resetsAt),". Сообщение может оборваться на полуслове, когда лимит дойдёт до 100 %."]}),a.jsx("p",{className:"modal__text modal__text--dim",children:"До сброса сессию повторно останавливать не будем."})]}),ve&&a.jsx(ml,{title:"Остановить сессию?",onClose:()=>Q(null),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>Q(null),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",onClick:()=>{te({type:"session.close",sessionId:ve.id}),Q(null)},children:"Остановить"})]}),children:a.jsx("p",{className:"modal__text",children:"Сессия сейчас работает — остановка прервёт текущий ход. Разговор останется на диске: открыть сессию заново или просто написать в неё снова можно в любой момент."})}),$l&&a.jsxs(ml,{title:"Переключить рабочее дерево?",onClose:()=>rs(null),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>rs(null),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",onClick:no,children:"Переключиться"})]}),children:[a.jsxs("p",{className:"modal__text",children:["git переключится на ",$l.label,". Файлы в каталоге проекта изменятся — это тот же каталог, в котором работает агент."]}),ll&&a.jsx("p",{className:"modal__text",children:"Сейчас идёт ход агента: он читает и правит файлы прямо сейчас."}),Vt&&Vt.changed.length>0&&a.jsxs("p",{className:"modal__text",children:["Незакоммиченных изменений: ",Vt.changed.length,". Git откажется переключаться, если они будут затёрты."]})]}),k&&a.jsx(cN,{status:da,owners:kl,files:he,defaultName:(va==null?void 0:va.name)??"",hasCommits:Vt===null||Vt.head!=="",busy:yn,result:is,onRefreshStatus:Al,onSaveToken:Cl,onPublish:ui,onDismissResult:()=>Ln(null),onClose:()=>K(!1)}),Ee&&a.jsx(hN,{busy:yn,result:is,onSubmit:$r,onDismissResult:()=>Ln(null),onClose:()=>He(!1)}),we&&a.jsx(ml,{title:we.kind==="dir"?"Удалить каталог?":"Удалить файл?",onClose:()=>lt(null),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>lt(null),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",onClick:()=>io(we),children:"Удалить"})]}),children:a.jsxs("p",{className:"modal__text",children:[we.path," будет удалён с диска",we.kind==="dir"?" вместе со всем содержимым":"",". Корзины здесь нет: это тот же каталог, в котором работает агент."]})}),Cn&&a.jsx(ml,{title:"Закрыть без сохранения?",onClose:()=>Vl(null),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>Vl(null),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",onClick:()=>Lt(Cn,!0),children:"Закрыть"}),a.jsx("button",{className:"btn btn--primary",onClick:()=>{it(Cn),Lt(Cn,!0)},children:"Сохранить и закрыть"})]}),children:a.jsxs("p",{className:"modal__text",children:["В ",Cn," есть несохранённые правки."]})}),St&&a.jsx(kN,{tab:St,servers:Dt,plugins:le,marketplaces:qe,catalog:Ve,result:$,auth:Ce,remote:v,actions:Yr,onTab:Pt,onClose:()=>Pt(null)}),tl&&a.jsx(LN,{status:Ze,login:_n,actions:Pc,remote:v,runningSessions:V.filter(p=>p.state==="running"||p.state==="waiting_permission").length,onReconnect:z?()=>{Zs(),Ot(!1)}:null,reconnectBlocked:ll,reconnectHint:Ra,onClose:()=>Ot(!1)}),y&&a.jsx(IN,{state:d,onPair:(p,U)=>te({type:"relay.pair",code:p,...U?{name:U}:{}}),onUnpair:()=>te({type:"relay.unpair"}),onClose:()=>j(!1)}),tn&&a.jsx(WN,{themeMode:kn,onThemeChange:ul,settings:Xt,models:(q==null?void 0:q.provider)==="claude"?(ye==null?void 0:ye.models)??[]:[],relayState:d,networkState:m,local:Hf()==="local",onChange:Wc,onEnableShell:()=>te({type:"relay.shell.enable"}),onDisableShell:()=>te({type:"relay.shell.disable"}),onOpenRelay:()=>{ol(!1),j(!0)},onClose:()=>ol(!1)}),ct&&a.jsx(OS,{candidates:Wn,searching:el,agentItems:at.items,agentBusy:(Yn==null?void 0:Yn.state)==="running",error:et,roots:pn,created:Kn,onSearch:od,onAskAgent:ii,onInterrupt:()=>{const p=Br.current;p&&te({type:"control.interrupt",sessionId:p})},onSubmit:ou,onCreate:Xc,onClose:Vc}),Zt!=null&&Zt.questions&&Zt.questions.length>0?a.jsx(TS,{request:{...Zt,questions:Zt.questions},queued:Oe.pending.length-1,collapsed:ln,onCollapse:()=>Qs(Zt.requestId,!0),onAnswer:Vs,onDecline:ks}):Zt&&uo!==null?a.jsx(wS,{request:Zt,plan:uo,queued:Oe.pending.length-1,collapsed:ln,onCollapse:()=>Qs(Zt.requestId,!0),onAccept:co,onDecline:oo}):Zt&&a.jsx(kS,{request:Zt,queued:Oe.pending.length-1,collapsed:ln,onCollapse:()=>Qs(Zt.requestId,!0),onDecide:Ns}),Zn&&a.jsx(nk,{handoff:Zn,onClose:()=>Hl(null)}),a.jsx(ik,{notices:Ka,onDismiss:p=>Il(U=>U.filter(ce=>ce.id!==p))})]})}function Dk(){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 Ok(){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 Lk(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[a.jsx("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 zk(){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 Uk(){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 Hk(l,s){return n_(l)===n_(s)}function n_(l){return l.replace(/[\\/]+/g,"/").replace(/\/+$/,"").toLowerCase()}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("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 Ik(){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 qk(){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 Gk(){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(Rk,{})}));export{D1 as D,an as I,cn as N,Xk as P,bs as T,Os as a,R_ as b,Ul as c,$k as d,U_ as e,eu as f,P1 as h,Vk as p,Qk as s,ke as t};