@i14ks/ccv 0.22.0 → 0.24.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 +10 -2
  2. package/bundle/ccv.mjs +1455 -251
  3. package/package.json +5 -2
  4. package/web/assets/{codemirror-BVRIW86g.js → codemirror-BABguQzY.js} +1 -1
  5. package/web/assets/{index-BOTbHjsh.js → index-BHEVBqv1.js} +1 -1
  6. package/web/assets/{index-DiFzORZa.js → index-BJQdUP7a.js} +1 -1
  7. package/web/assets/{index-CwbKEdO4.js → index-BQiRpvdM.js} +1 -1
  8. package/web/assets/{index-DcOycRyY.js → index-BRzmWdWn.js} +1 -1
  9. package/web/assets/{index-Cj3tIh2i.js → index-BWAAro79.js} +1 -1
  10. package/web/assets/{index-DqNX5AfU.js → index-BaKf7c69.js} +1 -1
  11. package/web/assets/{index-BRDMJVs_.js → index-BmRYCxGv.js} +1 -1
  12. package/web/assets/{index-CftAsWDp.js → index-BnqCpVA0.js} +1 -1
  13. package/web/assets/{index-CHk-wT2e.js → index-Bqjj9q2W.js} +1 -1
  14. package/web/assets/{index-iBO43oLF.js → index-CIsgyM-R.js} +1 -1
  15. package/web/assets/{index-B54sB01B.js → index-CZppS1t2.js} +1 -1
  16. package/web/assets/{index-5z-WKiE2.js → index-Ck0zkLid.js} +1 -1
  17. package/web/assets/{index-CEtwcv2R.js → index-CxF-ndAb.js} +1 -1
  18. package/web/assets/{index-BUtKkXYx.js → index-DW1Fnc9x.js} +1 -1
  19. package/web/assets/index-DXMZoXqv.js +136 -0
  20. package/web/assets/index-DafZE925.css +1 -0
  21. package/web/assets/{index-BSbB9pNN.js → index-Di0Nghq9.js} +1 -1
  22. package/web/assets/{index-A6KnUhy4.js → index-DnlEeQVW.js} +1 -1
  23. package/web/assets/{index-BTHa3RWC.js → index-DogVeywh.js} +1 -1
  24. package/web/assets/{index-B5EnmuL9.js → index-U9tL3Foh.js} +1 -1
  25. package/web/assets/{index-C4RL1RRN.js → index-dSYnVYDn.js} +1 -1
  26. package/web/index.html +2 -2
  27. package/web/assets/index-L8M_w2e-.js +0 -134
  28. package/web/assets/index-xoxa8R94.css +0 -1
@@ -1,134 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-B5EnmuL9.js","./index-BSbB9pNN.js","./index-BTHa3RWC.js","./index-BHot-lnj.js","./index-891wE-Rj.js","./index-CwbKEdO4.js","./index-iBO43oLF.js","./index-C4RL1RRN.js","./index-BUtKkXYx.js","./index-BOTbHjsh.js","./index-Cj3tIh2i.js","./index-B54sB01B.js","./index-5z-WKiE2.js","./index-BRDMJVs_.js","./index-DiFzORZa.js","./index-DqNX5AfU.js","./index-A6KnUhy4.js","./index-DcOycRyY.js","./index-CEtwcv2R.js","./index-CHk-wT2e.js","./index-CftAsWDp.js","./codemirror-BVRIW86g.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 Sx=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 Yt=(l,s,r)=>_0(l,typeof s!="symbol"?s+"":s,r),Mh=(l,s,r)=>s.has(l)||Sx("Cannot "+r);var $e=(l,s,r)=>(Mh(l,s,"read from private field"),r?r.call(l):s.get(l)),pn=(l,s,r)=>s.has(l)?Sx("Cannot add the same private member more than once"):s instanceof WeakSet?s.add(l):s.set(l,r),At=(l,s,r,c)=>(Mh(l,s,"write to private field"),c?c.call(l,r):s.set(l,r),r),On=(l,s,r)=>(Mh(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 Rh={exports:{}},Lo={};/**
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 wx;function y0(){if(wx)return Lo;wx=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 Lo.Fragment=s,Lo.jsx=r,Lo.jsxs=r,Lo}var kx;function v0(){return kx||(kx=1,Rh.exports=y0()),Rh.exports}var a=v0(),Dh={exports:{}},Fe={};/**
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 Nx;function j0(){if(Nx)return Fe;Nx=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(E){return E===null||typeof E!="object"?null:(E=v&&E[v]||E["@@iterator"],typeof E=="function"?E:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,A={};function B(E,G,de){this.props=E,this.context=G,this.refs=A,this.updater=de||k}B.prototype.isReactComponent={},B.prototype.setState=function(E,G){if(typeof E!="object"&&typeof E!="function"&&E!=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,E,G,"setState")},B.prototype.forceUpdate=function(E){this.updater.enqueueForceUpdate(this,E,"forceUpdate")};function P(){}P.prototype=B.prototype;function X(E,G,de){this.props=E,this.context=G,this.refs=A,this.updater=de||k}var R=X.prototype=new P;R.constructor=X,N(R,B.prototype),R.isPureReactComponent=!0;var Y=Array.isArray;function L(){}var Z={H:null,A:null,T:null,S:null},D=Object.prototype.hasOwnProperty;function z(E,G,de){var xe=de.ref;return{$$typeof:l,type:E,key:G,ref:xe!==void 0?xe:null,props:de}}function te(E,G){return z(E.type,G,E.props)}function J(E){return typeof E=="object"&&E!==null&&E.$$typeof===l}function fe(E){var G={"=":"=0",":":"=2"};return"$"+E.replace(/[=:]/g,function(de){return G[de]})}var be=/\/+/g;function Ne(E,G){return typeof E=="object"&&E!==null&&E.key!=null?fe(""+E.key):G.toString(36)}function Se(E){switch(E.status){case"fulfilled":return E.value;case"rejected":throw E.reason;default:switch(typeof E.status=="string"?E.then(L,L):(E.status="pending",E.then(function(G){E.status==="pending"&&(E.status="fulfilled",E.value=G)},function(G){E.status==="pending"&&(E.status="rejected",E.reason=G)})),E.status){case"fulfilled":return E.value;case"rejected":throw E.reason}}throw E}function V(E,G,de,xe,ke){var Re=typeof E;(Re==="undefined"||Re==="boolean")&&(E=null);var Me=!1;if(E===null)Me=!0;else switch(Re){case"bigint":case"string":case"number":Me=!0;break;case"object":switch(E.$$typeof){case l:case s:Me=!0;break;case y:return Me=E._init,V(Me(E._payload),G,de,xe,ke)}}if(Me)return ke=ke(E),Me=xe===""?"."+Ne(E,0):xe,Y(ke)?(de="",Me!=null&&(de=Me.replace(be,"$&/")+"/"),V(ke,G,de,"",function(kn){return kn})):ke!=null&&(J(ke)&&(ke=te(ke,de+(ke.key==null||E&&E.key===ke.key?"":(""+ke.key).replace(be,"$&/")+"/")+Me)),G.push(ke)),1;Me=0;var Xe=xe===""?".":xe+":";if(Y(E))for(var We=0;We<E.length;We++)xe=E[We],Re=Xe+Ne(xe,We),Me+=V(xe,G,de,Re,ke);else if(We=C(E),typeof We=="function")for(E=We.call(E),We=0;!(xe=E.next()).done;)xe=xe.value,Re=Xe+Ne(xe,We++),Me+=V(xe,G,de,Re,ke);else if(Re==="object"){if(typeof E.then=="function")return V(Se(E),G,de,xe,ke);throw G=String(E),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(E).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return Me}function pe(E,G,de){if(E==null)return E;var xe=[],ke=0;return V(E,xe,"","",function(Re){return G.call(de,Re,ke++)}),xe}function H(E){if(E._status===-1){var G=E._result;G=G(),G.then(function(de){(E._status===0||E._status===-1)&&(E._status=1,E._result=de)},function(de){(E._status===0||E._status===-1)&&(E._status=2,E._result=de)}),E._status===-1&&(E._status=0,E._result=G)}if(E._status===1)return E._result.default;throw E._result}var _e=typeof reportError=="function"?reportError:function(E){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=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(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",E);return}console.error(E)},K={map:pe,forEach:function(E,G,de){pe(E,function(){G.apply(this,arguments)},de)},count:function(E){var G=0;return pe(E,function(){G++}),G},toArray:function(E){return pe(E,function(G){return G})||[]},only:function(E){if(!J(E))throw Error("React.Children.only expected to receive a single React element child.");return E}};return Fe.Activity=j,Fe.Children=K,Fe.Component=B,Fe.Fragment=r,Fe.Profiler=o,Fe.PureComponent=X,Fe.StrictMode=c,Fe.Suspense=g,Fe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Z,Fe.__COMPILER_RUNTIME={__proto__:null,c:function(E){return Z.H.useMemoCache(E)}},Fe.cache=function(E){return function(){return E.apply(null,arguments)}},Fe.cacheSignal=function(){return null},Fe.cloneElement=function(E,G,de){if(E==null)throw Error("The argument must be a React element, but you passed "+E+".");var xe=N({},E.props),ke=E.key;if(G!=null)for(Re in G.key!==void 0&&(ke=""+G.key),G)!D.call(G,Re)||Re==="key"||Re==="__self"||Re==="__source"||Re==="ref"&&G.ref===void 0||(xe[Re]=G[Re]);var Re=arguments.length-2;if(Re===1)xe.children=de;else if(1<Re){for(var Me=Array(Re),Xe=0;Xe<Re;Xe++)Me[Xe]=arguments[Xe+2];xe.children=Me}return z(E.type,ke,xe)},Fe.createContext=function(E){return E={$$typeof:h,_currentValue:E,_currentValue2:E,_threadCount:0,Provider:null,Consumer:null},E.Provider=E,E.Consumer={$$typeof:d,_context:E},E},Fe.createElement=function(E,G,de){var xe,ke={},Re=null;if(G!=null)for(xe in G.key!==void 0&&(Re=""+G.key),G)D.call(G,xe)&&xe!=="key"&&xe!=="__self"&&xe!=="__source"&&(ke[xe]=G[xe]);var Me=arguments.length-2;if(Me===1)ke.children=de;else if(1<Me){for(var Xe=Array(Me),We=0;We<Me;We++)Xe[We]=arguments[We+2];ke.children=Xe}if(E&&E.defaultProps)for(xe in Me=E.defaultProps,Me)ke[xe]===void 0&&(ke[xe]=Me[xe]);return z(E,Re,ke)},Fe.createRef=function(){return{current:null}},Fe.forwardRef=function(E){return{$$typeof:m,render:E}},Fe.isValidElement=J,Fe.lazy=function(E){return{$$typeof:y,_payload:{_status:-1,_result:E},_init:H}},Fe.memo=function(E,G){return{$$typeof:x,type:E,compare:G===void 0?null:G}},Fe.startTransition=function(E){var G=Z.T,de={};Z.T=de;try{var xe=E(),ke=Z.S;ke!==null&&ke(de,xe),typeof xe=="object"&&xe!==null&&typeof xe.then=="function"&&xe.then(L,_e)}catch(Re){_e(Re)}finally{G!==null&&de.types!==null&&(G.types=de.types),Z.T=G}},Fe.unstable_useCacheRefresh=function(){return Z.H.useCacheRefresh()},Fe.use=function(E){return Z.H.use(E)},Fe.useActionState=function(E,G,de){return Z.H.useActionState(E,G,de)},Fe.useCallback=function(E,G){return Z.H.useCallback(E,G)},Fe.useContext=function(E){return Z.H.useContext(E)},Fe.useDebugValue=function(){},Fe.useDeferredValue=function(E,G){return Z.H.useDeferredValue(E,G)},Fe.useEffect=function(E,G){return Z.H.useEffect(E,G)},Fe.useEffectEvent=function(E){return Z.H.useEffectEvent(E)},Fe.useId=function(){return Z.H.useId()},Fe.useImperativeHandle=function(E,G,de){return Z.H.useImperativeHandle(E,G,de)},Fe.useInsertionEffect=function(E,G){return Z.H.useInsertionEffect(E,G)},Fe.useLayoutEffect=function(E,G){return Z.H.useLayoutEffect(E,G)},Fe.useMemo=function(E,G){return Z.H.useMemo(E,G)},Fe.useOptimistic=function(E,G){return Z.H.useOptimistic(E,G)},Fe.useReducer=function(E,G,de){return Z.H.useReducer(E,G,de)},Fe.useRef=function(E){return Z.H.useRef(E)},Fe.useState=function(E){return Z.H.useState(E)},Fe.useSyncExternalStore=function(E,G,de){return Z.H.useSyncExternalStore(E,G,de)},Fe.useTransition=function(){return Z.H.useTransition()},Fe.version="19.2.8",Fe}var Tx;function _p(){return Tx||(Tx=1,Dh.exports=j0()),Dh.exports}var _=_p(),Oh={exports:{}},zo={},Lh={exports:{}},zh={};/**
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 S0(){return Ex||(Ex=1,(function(l){function s(V,pe){var H=V.length;V.push(pe);e:for(;0<H;){var _e=H-1>>>1,K=V[_e];if(0<o(K,pe))V[_e]=pe,V[H]=K,H=_e;else break e}}function r(V){return V.length===0?null:V[0]}function c(V){if(V.length===0)return null;var pe=V[0],H=V.pop();if(H!==pe){V[0]=H;e:for(var _e=0,K=V.length,E=K>>>1;_e<E;){var G=2*(_e+1)-1,de=V[G],xe=G+1,ke=V[xe];if(0>o(de,H))xe<K&&0>o(ke,de)?(V[_e]=ke,V[xe]=H,_e=xe):(V[_e]=de,V[G]=H,_e=G);else if(xe<K&&0>o(ke,H))V[_e]=ke,V[xe]=H,_e=xe;else break e}}return pe}function o(V,pe){var H=V.sortIndex-pe.sortIndex;return H!==0?H:V.id-pe.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,k=!1,N=!1,A=!1,B=typeof setTimeout=="function"?setTimeout:null,P=typeof clearTimeout=="function"?clearTimeout:null,X=typeof setImmediate<"u"?setImmediate:null;function R(V){for(var pe=r(x);pe!==null;){if(pe.callback===null)c(x);else if(pe.startTime<=V)c(x),pe.sortIndex=pe.expirationTime,s(g,pe);else break;pe=r(x)}}function Y(V){if(N=!1,R(V),!k)if(r(g)!==null)k=!0,L||(L=!0,fe());else{var pe=r(x);pe!==null&&Se(Y,pe.startTime-V)}}var L=!1,Z=-1,D=5,z=-1;function te(){return A?!0:!(l.unstable_now()-z<D)}function J(){if(A=!1,L){var V=l.unstable_now();z=V;var pe=!0;try{e:{k=!1,N&&(N=!1,P(Z),Z=-1),C=!0;var H=v;try{t:{for(R(V),j=r(g);j!==null&&!(j.expirationTime>V&&te());){var _e=j.callback;if(typeof _e=="function"){j.callback=null,v=j.priorityLevel;var K=_e(j.expirationTime<=V);if(V=l.unstable_now(),typeof K=="function"){j.callback=K,R(V),pe=!0;break t}j===r(g)&&c(g),R(V)}else c(g);j=r(g)}if(j!==null)pe=!0;else{var E=r(x);E!==null&&Se(Y,E.startTime-V),pe=!1}}break e}finally{j=null,v=H,C=!1}pe=void 0}}finally{pe?fe():L=!1}}}var fe;if(typeof X=="function")fe=function(){X(J)};else if(typeof MessageChannel<"u"){var be=new MessageChannel,Ne=be.port2;be.port1.onmessage=J,fe=function(){Ne.postMessage(null)}}else fe=function(){B(J,0)};function Se(V,pe){Z=B(function(){V(l.unstable_now())},pe)}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(V){V.callback=null},l.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<V?Math.floor(1e3/V):5},l.unstable_getCurrentPriorityLevel=function(){return v},l.unstable_next=function(V){switch(v){case 1:case 2:case 3:var pe=3;break;default:pe=v}var H=v;v=pe;try{return V()}finally{v=H}},l.unstable_requestPaint=function(){A=!0},l.unstable_runWithPriority=function(V,pe){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var H=v;v=V;try{return pe()}finally{v=H}},l.unstable_scheduleCallback=function(V,pe,H){var _e=l.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?_e+H:_e):H=_e,V){case 1:var K=-1;break;case 2:K=250;break;case 5:K=1073741823;break;case 4:K=1e4;break;default:K=5e3}return K=H+K,V={id:y++,callback:pe,priorityLevel:V,startTime:H,expirationTime:K,sortIndex:-1},H>_e?(V.sortIndex=H,s(x,V),r(g)===null&&V===r(x)&&(N?(P(Z),Z=-1):N=!0,Se(Y,H-_e))):(V.sortIndex=K,s(g,V),k||C||(k=!0,L||(L=!0,fe()))),V},l.unstable_shouldYield=te,l.unstable_wrapCallback=function(V){var pe=v;return function(){var H=v;v=pe;try{return V.apply(this,arguments)}finally{v=H}}}})(zh)),zh}var Cx;function w0(){return Cx||(Cx=1,Lh.exports=S0()),Lh.exports}var Uh={exports:{}},ul={};/**
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 k0(){if(Ax)return ul;Ax=1;var l=_p();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 ul.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,ul.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)},ul.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()}},ul.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))},ul.prefetchDNS=function(g){typeof g=="string"&&c.d.D(g)},ul.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})}},ul.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)},ul.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})}},ul.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)},ul.requestFormReset=function(g){c.d.r(g)},ul.unstable_batchedUpdates=function(g,x){return g(x)},ul.useFormState=function(g,x,y){return h.H.useFormState(g,x,y)},ul.useFormStatus=function(){return h.H.useHostTransitionStatus()},ul.version="19.2.8",ul}var Mx;function N0(){if(Mx)return Uh.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(),Uh.exports=k0(),Uh.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 zo;Rx=1;var l=w0(),s=_p(),r=N0();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"),k=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),B=Symbol.for("react.profiler"),P=Symbol.for("react.consumer"),X=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),Y=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),Z=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),z=Symbol.for("react.activity"),te=Symbol.for("react.memo_cache_sentinel"),J=Symbol.iterator;function fe(e){return e===null||typeof e!="object"?null:(e=J&&e[J]||e["@@iterator"],typeof e=="function"?e:null)}var be=Symbol.for("react.client.reference");function Ne(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===be?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case N:return"Fragment";case B:return"Profiler";case A:return"StrictMode";case Y:return"Suspense";case L:return"SuspenseList";case z:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case k:return"Portal";case X:return e.displayName||"Context";case P:return(e._context.displayName||"Context")+".Consumer";case R:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Z:return t=e.displayName||null,t!==null?t:Ne(e.type)||"Memo";case D:t=e._payload,e=e._init;try{return Ne(e(t))}catch{}}return null}var Se=Array.isArray,V=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,pe=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H={pending:!1,data:null,method:null,action:null},_e=[],K=-1;function E(e){return{current:e}}function G(e){0>K||(e.current=_e[K],_e[K]=null,K--)}function de(e,t){K++,_e[K]=e.current,e.current=t}var xe=E(null),ke=E(null),Re=E(null),Me=E(null);function Xe(e,t){switch(de(Re,t),de(ke,e),de(xe,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}}G(xe),de(xe,e)}function We(){G(xe),G(ke),G(Re)}function kn(e){e.memoizedState!==null&&de(Me,e);var t=xe.current,n=Qg(t,e.type);t!==n&&(de(ke,e),de(xe,n))}function Be(e){ke.current===e&&(G(xe),G(ke)),Me.current===e&&(G(Me),Mo._currentValue=H)}var dt,nt;function Ot(e){if(dt===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);dt=t&&t[1]||"",nt=-1<n.stack.indexOf(`
43
- at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
44
- `+dt+e+nt}var et=!1;function Jt(e,t){if(!e||et)return"";et=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var he=function(){throw Error()};if(Object.defineProperty(he.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(he,[])}catch(le){var ee=le}Reflect.construct(e,[],he)}else{try{he.call()}catch(le){ee=le}e.call(he.prototype)}}else{try{throw Error()}catch(le){ee=le}(he=e())&&typeof he.catch=="function"&&he.catch(function(){})}}catch(le){if(le&&ee&&typeof le.stack=="string")return[le.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 M=b.split(`
45
- `),W=S.split(`
46
- `);for(u=i=0;i<M.length&&!M[i].includes("DetermineComponentFrameRoot");)i++;for(;u<W.length&&!W[u].includes("DetermineComponentFrameRoot");)u++;if(i===M.length||u===W.length)for(i=M.length-1,u=W.length-1;1<=i&&0<=u&&M[i]!==W[u];)u--;for(;1<=i&&0<=u;i--,u--)if(M[i]!==W[u]){if(i!==1||u!==1)do if(i--,u--,0>u||M[i]!==W[u]){var ie=`
47
- `+M[i].replace(" at new "," at ");return e.displayName&&ie.includes("<anonymous>")&&(ie=ie.replace("<anonymous>",e.displayName)),ie}while(1<=i&&0<=u);break}}}finally{et=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Ot(n):""}function Fn(e,t){switch(e.tag){case 26:case 27:case 5:return Ot(e.type);case 16:return Ot("Lazy");case 13:return e.child!==t&&t!==null?Ot("Suspense Fallback"):Ot("Suspense");case 19:return Ot("SuspenseList");case 0:case 15:return Jt(e.type,!1);case 11:return Jt(e.type.render,!1);case 1:return Jt(e.type,!0);case 31:return Ot("Activity");default:return""}}function gt(e){try{var t="",n=null;do t+=Fn(e,n),n=e,e=e.return;while(e);return t}catch(i){return`
48
- Error generating stack: `+i.message+`
49
- `+i.stack}}var Jn=Object.prototype.hasOwnProperty,$t=l.unstable_scheduleCallback,zn=l.unstable_cancelCallback,Un=l.unstable_shouldYield,St=l.unstable_requestPaint,_t=l.unstable_now,Zt=l.unstable_getCurrentPriorityLevel,Lt=l.unstable_ImmediatePriority,sn=l.unstable_UserBlockingPriority,xt=l.unstable_NormalPriority,rt=l.unstable_LowPriority,mn=l.unstable_IdlePriority,gn=l.log,Nn=l.unstable_setDisableYieldValue,an=null,zt=null;function rn(e){if(typeof gn=="function"&&Nn(e),zt&&typeof zt.setStrictMode=="function")try{zt.setStrictMode(an,e)}catch{}}var wt=Math.clz32?Math.clz32:ge,Wn=Math.log,se=Math.LN2;function ge(e){return e>>>=0,e===0?32:31-(Wn(e)/se|0)|0}var He=256,Ke=262144,Ue=4194304;function I(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 ae(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=I(i):(b&=S,b!==0?u=I(b):n||(n=S&~e,n!==0&&(u=I(n))))):(S=i&~f,S!==0?u=I(S):b!==0?u=I(b):n||(n=i&~e,n!==0&&(u=I(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 we(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function qe(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 at(){var e=Ue;return Ue<<=1,(Ue&62914560)===0&&(Ue=4194304),e}function xn(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Hn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function wl(e,t,n,i,u,f){var b=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var S=e.entanglements,M=e.expirationTimes,W=e.hiddenUpdates;for(n=b&~n;0<n;){var ie=31-wt(n),he=1<<ie;S[ie]=0,M[ie]=-1;var ee=W[ie];if(ee!==null)for(W[ie]=null,ie=0;ie<ee.length;ie++){var le=ee[ie];le!==null&&(le.lane&=-536870913)}n&=~he}i!==0&&pl(e,i,0),f!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=f&~(b&~t))}function pl(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-wt(t);e.entangledLanes|=t,e.entanglements[i]=e.entanglements[i]|1073741824|n&261930}function as(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var i=31-wt(n),u=1<<i;u&t|e[i]&t&&(e[i]|=t),n&=~u}}function Us(e,t){var n=t&-t;return n=(n&42)!==0?1:is(n),(n&(e.suspendedLanes|t))!==0?0:n}function is(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 rs(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function cs(){var e=pe.p;return e!==0?e:(e=window.event,e===void 0?32:gx(e.type))}function al(e,t){var n=pe.p;try{return pe.p=e,t()}finally{pe.p=n}}var Pn=Math.random().toString(36).slice(2),lt="__reactFiber$"+Pn,Qe="__reactProps$"+Pn,fn="__reactContainer$"+Pn,kl="__reactEvents$"+Pn,il="__reactListeners$"+Pn,Wt="__reactHandles$"+Pn,os="__reactResources$"+Pn,bt="__reactMarker$"+Pn;function us(e){delete e[lt],delete e[Qe],delete e[kl],delete e[il],delete e[Wt]}function Ve(e){var t=e[lt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[fn]||n[lt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ex(e);e!==null;){if(n=e[lt])return n;e=ex(e)}return t}e=n,n=e.parentNode}return null}function ml(e){if(e=e[lt]||e[fn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Pt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function cn(e){var t=e[os];return t||(t=e[os]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function ht(e){e[bt]=!0}var rl=new Set,cl={};function Xt(e,t){Tn(e,t),Tn(e+"Capture",t)}function Tn(e,t){for(cl[e]=t,e=0;e<t.length;e++)rl.add(t[e])}var Tt=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]*$"),ol={},Hl={};function Vl(e){return Jn.call(Hl,e)?!0:Jn.call(ol,e)?!1:Tt.test(e)?Hl[e]=!0:(ol[e]=!0,!1)}function Bl(e,t,n){if(Vl(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 $n(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 yn(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 it(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function fs(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Hs(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 Ql(e){if(!e._valueTracker){var t=fs(e)?"checked":"value";e._valueTracker=Hs(e,t,""+e[t])}}function Bs(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),i="";return e&&(i=fs(e)?e.checked?"true":"false":e.value),e=i,e!==n?(t.setValue(e),!0):!1}function ds(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 Is=/[\n"\\]/g;function Xn(e){return e.replace(Is,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ga(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=""+it(t)):e.value!==""+it(t)&&(e.value=""+it(t)):b!=="submit"&&b!=="reset"||e.removeAttribute("value"),t!=null?gl(e,b,it(t)):n!=null?gl(e,b,it(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=""+it(S):e.removeAttribute("name")}function hs(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)){Ql(e);return}n=n!=null?""+it(n):"",t=t!=null?""+it(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),Ql(e)}function gl(e,t,n){t==="number"&&ds(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Nl(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=""+it(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 me(e,t,n){if(t!=null&&(t=""+it(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+it(n):""}function T(e,t,n,i){if(t==null){if(i!=null){if(n!=null)throw Error(c(92));if(Se(i)){if(1<i.length)throw Error(c(93));i=i[0]}n=i}n==null&&(n=""),t=n}n=it(t),e.defaultValue=n,i=e.textContent,i===n&&i!==""&&i!==null&&(e.value=i),Ql(e)}function $(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ue=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function ye(e,t,n){var i=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?i?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":i?e.setProperty(t,n):typeof n!="number"||n===0||ue.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Le(e,t,n){if(t!=null&&typeof t!="object")throw Error(c(62));if(e=e.style,n!=null){for(var i in n)!n.hasOwnProperty(i)||t!=null&&t.hasOwnProperty(i)||(i.indexOf("--")===0?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="");for(var u in t)i=t[u],t.hasOwnProperty(u)&&n[u]!==i&&ye(e,u,i)}else for(var f in t)t.hasOwnProperty(f)&&ye(e,f,t[f])}function Ee(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 Et=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"]]),Ft=/^[\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 Vt(e){return Ft.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function st(){}var dn=null;function Mt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var qs=null,vn=null;function ps(e){var t=ml(e);if(t&&(e=t.stateNode)){var n=e[Qe]||null;e:switch(e=t.stateNode,t.type){case"input":if(ga(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+Xn(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var u=i[Qe]||null;if(!u)throw Error(c(90));ga(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&&Bs(i)}break e;case"textarea":me(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Nl(e,!!n.multiple,t,!1)}}}var w=!1;function ce(e,t,n){if(w)return e(t,n);w=!0;try{var i=e(t);return i}finally{if(w=!1,(qs!==null||vn!==null)&&(Zu(),qs&&(t=qs,e=vn,vn=qs=null,ps(t),e)))for(t=0;t<e.length;t++)ps(e[t])}}function Ce(e,t){var n=e.stateNode;if(n===null)return null;var i=n[Qe]||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 Ze=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),el=!1;if(Ze)try{var Gs={};Object.defineProperty(Gs,"passive",{get:function(){el=!0}}),window.addEventListener("test",Gs,Gs),window.removeEventListener("test",Gs,Gs)}catch{el=!1}var ms=null,$a=null,Hi=null;function Ys(){if(Hi)return Hi;var e,t=$a,n=t.length,i,u="value"in ms?ms.value:ms.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 Hi=u.slice(e,1<i?1-i:void 0)}function $s(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 Dr(){return!0}function Or(){return!1}function Bn(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)?Dr:Or,this.isPropagationStopped=Or,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=Dr)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Dr)},persist:function(){},isPersistent:Dr}),t}var gs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bi=Bn(gs),Xs=j({},gs,{view:0,detail:0}),Xa=Bn(Xs),Ii,Va,xs,Lr=j({},Xs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Qa,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!==xs&&(xs&&e.type==="mousemove"?(Ii=e.screenX-xs.screenX,Va=e.screenY-xs.screenY):Va=Ii=0,xs=e),Ii)},movementY:function(e){return"movementY"in e?e.movementY:Va}}),qi=Bn(Lr),nd=j({},Lr,{dataTransfer:0}),zr=Bn(nd),Ur=j({},Xs,{relatedTarget:0}),Gi=Bn(Ur),Yi=j({},gs,{animationName:0,elapsedTime:0,pseudoElement:0}),xa=Bn(Yi),Hr=j({},gs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Qc=Bn(Hr),ld=j({},gs,{data:0}),Vs=Bn(ld),Br={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},eu={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"},Ir={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function tu(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Ir[e])?!!t[e]:!1}function Qa(){return tu}var bs=j({},Xs,{key:function(e){if(e.key){var t=Br[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=$s(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?eu[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Qa,charCode:function(e){return e.type==="keypress"?$s(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?$s(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),qr=Bn(bs),$i=j({},Lr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Qs=Bn($i),Xi=j({},Xs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Qa}),on=Bn(Xi),Kc=j({},gs,{propertyName:0,elapsedTime:0,pseudoElement:0}),sd=Bn(Kc),ad=j({},Lr,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Zc=Bn(ad),Gr=j({},gs,{newState:0,oldState:0}),En=Bn(Gr),Vi=[9,13,27,32],ba=Ze&&"CompositionEvent"in window,Ka=null;Ze&&"documentMode"in document&&(Ka=document.documentMode);var Cn=Ze&&"TextEvent"in window&&!Ka,Fc=Ze&&(!ba||Ka&&8<Ka&&11>=Ka),Jc=" ",Kl=!1;function Wc(e,t){switch(e){case"keyup":return Vi.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Qi(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var _s=!1;function Ki(e,t){switch(e){case"compositionend":return Qi(t);case"keypress":return t.which!==32?null:(Kl=!0,Jc);case"textInput":return e=t.data,e===Jc&&Kl?null:e;default:return null}}function _a(e,t){if(_s)return e==="compositionend"||!ba&&Wc(e,t)?(e=Ys(),Hi=$a=ms=null,_s=!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 Fc&&t.locale!=="ko"?null:t.data;default:return null}}var nu={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 Za(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!nu[e.type]:t==="textarea"}function Zi(e,t,n,i){qs?vn?vn.push(i):vn=[i]:qs=i,t=nf(t,"onChange"),0<t.length&&(n=new Bi("onChange","change",null,n,i),e.push({event:n,listeners:t}))}var ys=null,vs=null;function lu(e){Ig(e,0)}function Ks(e){var t=Pt(e);if(Bs(t))return e}function su(e,t){if(e==="change")return t}var ne=!1;if(Ze){var Zs;if(Ze){var Fi="oninput"in document;if(!Fi){var au=document.createElement("div");au.setAttribute("oninput","return;"),Fi=typeof au.oninput=="function"}Zs=Fi}else Zs=!1;ne=Zs&&(!document.documentMode||9<document.documentMode)}function iu(){ys&&(ys.detachEvent("onpropertychange",Q),vs=ys=null)}function Q(e){if(e.propertyName==="value"&&Ks(vs)){var t=[];Zi(t,vs,e,Mt(e)),ce(lu,t)}}function Ji(e,t,n){e==="focusin"?(iu(),ys=t,vs=n,ys.attachEvent("onpropertychange",Q)):e==="focusout"&&iu()}function Wi(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ks(vs)}function ru(e,t){if(e==="click")return Ks(t)}function cu(e,t){if(e==="input"||e==="change")return Ks(t)}function id(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var An=typeof Object.is=="function"?Object.is:id;function Pi(e,t){if(An(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(!Jn.call(t,u)||!An(e[u],t[u]))return!1}return!0}function ou(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function uu(e,t){var n=ou(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=ou(n)}}function fu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?fu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function du(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ds(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=ds(e.document)}return t}function Fs(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 rd=Ze&&"documentMode"in document&&11>=document.documentMode,Fa=null,Pc=null,er=null,eo=!1;function hu(e,t,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;eo||Fa==null||Fa!==ds(i)||(i=Fa,"selectionStart"in i&&Fs(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}),er&&Pi(er,i)||(er=i,i=nf(Pc,"onSelect"),0<i.length&&(t=new Bi("onSelect","select",null,t,n),e.push({event:t,listeners:i}),t.target=Fa)))}function ya(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ja={animationend:ya("Animation","AnimationEnd"),animationiteration:ya("Animation","AnimationIteration"),animationstart:ya("Animation","AnimationStart"),transitionrun:ya("Transition","TransitionRun"),transitionstart:ya("Transition","TransitionStart"),transitioncancel:ya("Transition","TransitionCancel"),transitionend:ya("Transition","TransitionEnd")},to={},Yr={};Ze&&(Yr=document.createElement("div").style,"AnimationEvent"in window||(delete Ja.animationend.animation,delete Ja.animationiteration.animation,delete Ja.animationstart.animation),"TransitionEvent"in window||delete Ja.transitionend.transition);function va(e){if(to[e])return to[e];if(!Ja[e])return e;var t=Ja[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Yr)return to[e]=t[n];return e}var pu=va("animationend"),$r=va("animationiteration"),mu=va("animationstart"),cd=va("transitionrun"),Xr=va("transitionstart"),od=va("transitioncancel"),no=va("transitionend"),Vr=new Map,Qr="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(" ");Qr.push("scrollEnd");function Tl(e,t){Vr.set(e,t),Xt(t,[e])}var tr=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)},xl=[],Wa=0,Kr=0;function nr(){for(var e=Wa,t=Kr=Wa=0;t<e;){var n=xl[t];xl[t++]=null;var i=xl[t];xl[t++]=null;var u=xl[t];xl[t++]=null;var f=xl[t];if(xl[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&&gu(n,u,f)}}function Zr(e,t,n,i){xl[Wa++]=e,xl[Wa++]=t,xl[Wa++]=n,xl[Wa++]=i,Kr|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function Fr(e,t,n,i){return Zr(e,t,n,i),Jr(e)}function js(e,t){return Zr(e,null,null,t),Jr(e)}function gu(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-wt(n),e=f.hiddenUpdates,i=e[u],i===null?e[u]=[t]:i.push(t),t.lane=n|536870912),f):null}function Jr(e){if(50<wo)throw wo=0,th=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Pa={};function ud(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 In(e,t,n,i){return new ud(e,t,n,i)}function Wr(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ss(e,t){var n=e.alternate;return n===null?(n=In(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 lo(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 Pr(e,t,n,i,u,f){var b=0;if(i=e,typeof e=="function")Wr(e)&&(b=1);else if(typeof e=="string")b=i0(e,n,xe.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case z:return e=In(31,n,t,u),e.elementType=z,e.lanes=f,e;case N:return ja(n.children,u,f,t);case A:b=8,u|=24;break;case B:return e=In(12,n,t,u|2),e.elementType=B,e.lanes=f,e;case Y:return e=In(13,n,t,u),e.elementType=Y,e.lanes=f,e;case L:return e=In(19,n,t,u),e.elementType=L,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case X:b=10;break e;case P:b=9;break e;case R:b=11;break e;case Z:b=14;break e;case D:b=16,i=null;break e}b=29,n=Error(c(130,e===null?"null":typeof e,"")),i=null}return t=In(b,n,t,u),t.elementType=e,t.type=i,t.lanes=f,t}function ja(e,t,n,i){return e=In(7,e,i,t),e.lanes=n,e}function so(e,t,n){return e=In(6,e,null,t),e.lanes=n,e}function xu(e){var t=In(18,null,null,0);return t.stateNode=e,t}function ao(e,t,n){return t=In(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var bu=new WeakMap;function El(e,t){if(typeof e=="object"&&e!==null){var n=bu.get(e);return n!==void 0?n:(t={value:e,source:t,stack:gt(t)},bu.set(e,t),t)}return{value:e,source:t,stack:gt(t)}}var ei=[],ti=0,ec=null,lr=0,Cl=[],bl=0,Js=null,Zl=1,Fl="";function ws(e,t){ei[ti++]=lr,ei[ti++]=ec,ec=e,lr=t}function tc(e,t,n){Cl[bl++]=Zl,Cl[bl++]=Fl,Cl[bl++]=Js,Js=e;var i=Zl;e=Fl;var u=32-wt(i)-1;i&=~(1<<u),n+=1;var f=32-wt(t)+u;if(30<f){var b=u-u%5;f=(i&(1<<b)-1).toString(32),i>>=b,u-=b,Zl=1<<32-wt(t)+u|n<<u|i,Fl=f+e}else Zl=1<<f|n<<u|i,Fl=e}function sr(e){e.return!==null&&(ws(e,1),tc(e,1,0))}function ni(e){for(;e===ec;)ec=ei[--ti],ei[ti]=null,lr=ei[--ti],ei[ti]=null;for(;e===Js;)Js=Cl[--bl],Cl[bl]=null,Fl=Cl[--bl],Cl[bl]=null,Zl=Cl[--bl],Cl[bl]=null}function _u(e,t){Cl[bl++]=Zl,Cl[bl++]=Fl,Cl[bl++]=Js,Zl=t.id,Fl=t.overflow,Js=e}var qn=null,Qt=null,ct=!1,Ws=null,Al=!1,io=Error(c(519));function Ps(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ar(El(t,e)),io}function yu(e){var t=e.stateNode,n=e.type,i=e.memoizedProps;switch(t[lt]=e,t[Qe]=i,n){case"dialog":ft("cancel",t),ft("close",t);break;case"iframe":case"object":case"embed":ft("load",t);break;case"video":case"audio":for(n=0;n<No.length;n++)ft(No[n],t);break;case"source":ft("error",t);break;case"img":case"image":case"link":ft("error",t),ft("load",t);break;case"details":ft("toggle",t);break;case"input":ft("invalid",t),hs(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":ft("invalid",t);break;case"textarea":ft("invalid",t),T(t,i.value,i.defaultValue,i.children)}n=i.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||i.suppressHydrationWarning===!0||$g(t.textContent,n)?(i.popover!=null&&(ft("beforetoggle",t),ft("toggle",t)),i.onScroll!=null&&ft("scroll",t),i.onScrollEnd!=null&&ft("scrollend",t),i.onClick!=null&&(t.onclick=st),t=!0):t=!1,t||Ps(e,!0)}function vu(e){for(qn=e.return;qn;)switch(qn.tag){case 5:case 31:case 13:Al=!1;return;case 27:case 3:Al=!0;return;default:qn=qn.return}}function li(e){if(e!==qn)return!1;if(!ct)return vu(e),ct=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||gh(e.type,e.memoizedProps)),n=!n),n&&Qt&&Ps(e),vu(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));Qt=Pg(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));Qt=Pg(e)}else t===27?(t=Qt,vi(e.type)?(e=vh,vh=null,Qt=e):Qt=t):Qt=qn?es(e.stateNode.nextSibling):null;return!0}function Sa(){Qt=qn=null,ct=!1}function ro(){var e=Ws;return e!==null&&(Ll===null?Ll=e:Ll.push.apply(Ll,e),Ws=null),e}function ar(e){Ws===null?Ws=[e]:Ws.push(e)}var co=E(null),wa=null,ks=null;function Ns(e,t,n){de(co,t._currentValue),t._currentValue=n}function Jl(e){e._currentValue=co.current,G(co)}function si(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 _l(e,t,n,i){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var f=u.dependencies;if(f!==null){var b=u.child;f=f.firstContext;e:for(;f!==null;){var S=f;f=u;for(var M=0;M<t.length;M++)if(S.context===t[M]){f.lanes|=n,S=f.alternate,S!==null&&(S.lanes|=n),si(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),si(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 Vn(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;An(u.pendingProps.value,b.value)||(e!==null?e.push(S):e=[S])}}else if(u===Me.current){if(b=u.alternate,b===null)throw Error(c(387));b.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(Mo):e=[Mo])}u=u.return}e!==null&&_l(t,e,n,i),t.flags|=262144}function Ut(e){for(e=e.firstContext;e!==null;){if(!An(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ts(e){wa=e,ks=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Gn(e){return ir(wa,e)}function nc(e,t){return wa===null&&Ts(e),ir(e,t)}function ir(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ks===null){if(e===null)throw Error(c(308));ks=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ks=ks.next=t;return n}var ju=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()})}},lc=l.unstable_scheduleCallback,oo=l.unstable_NormalPriority,hn={$$typeof:X,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ai(){return{controller:new ju,data:new Map,refCount:0}}function ii(e){e.refCount--,e.refCount===0&&lc(oo,function(){e.controller.abort()})}var rr=null,ka=0,Na=0,ri=null;function uo(e,t){if(rr===null){var n=rr=[];ka=0,Na=rh(),ri={status:"pending",value:void 0,then:function(i){n.push(i)}}}return ka++,t.then(Su,Su),t}function Su(){if(--ka===0&&rr!==null){ri!==null&&(ri.status="fulfilled");var e=rr;rr=null,Na=0,ri=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function cr(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 Ta=V.S;V.S=function(e,t){pg=_t(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&uo(e,t),Ta!==null&&Ta(e,t)};var Ea=E(null);function sc(){var e=Ea.current;return e!==null?e:Kt.pooledCache}function or(e,t){t===null?de(Ea,Ea.current):de(Ea,t.pool)}function wu(){var e=sc();return e===null?null:{parent:hn._currentValue,pool:e}}var ci=Error(c(460)),ac=Error(c(474)),ur=Error(c(542)),ic={then:function(){}};function ku(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Nu(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(st,st),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ca(e),e;default:if(typeof t.status=="string")t.then(st,st);else{if(e=Kt,e!==null&&100<e.shellSuspendCounter)throw Error(c(482));e=t,e.status="pending",e.then(function(i){if(t.status==="pending"){var u=t;u.status="fulfilled",u.value=i}},function(i){if(t.status==="pending"){var u=t;u.status="rejected",u.reason=i}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ca(e),e}throw ea=t,ci}}function Es(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(ea=n,ci):n}}var ea=null;function Tu(){if(ea===null)throw Error(c(459));var e=ea;return ea=null,e}function Ca(e){if(e===ci||e===ur)throw Error(c(483))}var ta=null,fr=0;function dr(e){var t=fr;return fr+=1,ta===null&&(ta=[]),Nu(ta,e,t)}function oi(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function p(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 U(e){function t(q,O){if(e){var F=q.deletions;F===null?(q.deletions=[O],q.flags|=16):F.push(O)}}function n(q,O){if(!e)return null;for(;O!==null;)t(q,O),O=O.sibling;return null}function i(q){for(var O=new Map;q!==null;)q.key!==null?O.set(q.key,q):O.set(q.index,q),q=q.sibling;return O}function u(q,O){return q=Ss(q,O),q.index=0,q.sibling=null,q}function f(q,O,F){return q.index=F,e?(F=q.alternate,F!==null?(F=F.index,F<O?(q.flags|=67108866,O):F):(q.flags|=67108866,O)):(q.flags|=1048576,O)}function b(q){return e&&q.alternate===null&&(q.flags|=67108866),q}function S(q,O,F,oe){return O===null||O.tag!==6?(O=so(F,q.mode,oe),O.return=q,O):(O=u(O,F),O.return=q,O)}function M(q,O,F,oe){var Ie=F.type;return Ie===N?ie(q,O,F.props.children,oe,F.key):O!==null&&(O.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===D&&Es(Ie)===O.type)?(O=u(O,F.props),oi(O,F),O.return=q,O):(O=Pr(F.type,F.key,F.props,null,q.mode,oe),oi(O,F),O.return=q,O)}function W(q,O,F,oe){return O===null||O.tag!==4||O.stateNode.containerInfo!==F.containerInfo||O.stateNode.implementation!==F.implementation?(O=ao(F,q.mode,oe),O.return=q,O):(O=u(O,F.children||[]),O.return=q,O)}function ie(q,O,F,oe,Ie){return O===null||O.tag!==7?(O=ja(F,q.mode,oe,Ie),O.return=q,O):(O=u(O,F),O.return=q,O)}function he(q,O,F){if(typeof O=="string"&&O!==""||typeof O=="number"||typeof O=="bigint")return O=so(""+O,q.mode,F),O.return=q,O;if(typeof O=="object"&&O!==null){switch(O.$$typeof){case C:return F=Pr(O.type,O.key,O.props,null,q.mode,F),oi(F,O),F.return=q,F;case k:return O=ao(O,q.mode,F),O.return=q,O;case D:return O=Es(O),he(q,O,F)}if(Se(O)||fe(O))return O=ja(O,q.mode,F,null),O.return=q,O;if(typeof O.then=="function")return he(q,dr(O),F);if(O.$$typeof===X)return he(q,nc(q,O),F);p(q,O)}return null}function ee(q,O,F,oe){var Ie=O!==null?O.key:null;if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return Ie!==null?null:S(q,O,""+F,oe);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case C:return F.key===Ie?M(q,O,F,oe):null;case k:return F.key===Ie?W(q,O,F,oe):null;case D:return F=Es(F),ee(q,O,F,oe)}if(Se(F)||fe(F))return Ie!==null?null:ie(q,O,F,oe,null);if(typeof F.then=="function")return ee(q,O,dr(F),oe);if(F.$$typeof===X)return ee(q,O,nc(q,F),oe);p(q,F)}return null}function le(q,O,F,oe,Ie){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return q=q.get(F)||null,S(O,q,""+oe,Ie);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case C:return q=q.get(oe.key===null?F:oe.key)||null,M(O,q,oe,Ie);case k:return q=q.get(oe.key===null?F:oe.key)||null,W(O,q,oe,Ie);case D:return oe=Es(oe),le(q,O,F,oe,Ie)}if(Se(oe)||fe(oe))return q=q.get(F)||null,ie(O,q,oe,Ie,null);if(typeof oe.then=="function")return le(q,O,F,dr(oe),Ie);if(oe.$$typeof===X)return le(q,O,F,nc(O,oe),Ie);p(O,oe)}return null}function Oe(q,O,F,oe){for(var Ie=null,kt=null,ze=O,tt=O=0,mt=null;ze!==null&&tt<F.length;tt++){ze.index>tt?(mt=ze,ze=null):mt=ze.sibling;var Nt=ee(q,ze,F[tt],oe);if(Nt===null){ze===null&&(ze=mt);break}e&&ze&&Nt.alternate===null&&t(q,ze),O=f(Nt,O,tt),kt===null?Ie=Nt:kt.sibling=Nt,kt=Nt,ze=mt}if(tt===F.length)return n(q,ze),ct&&ws(q,tt),Ie;if(ze===null){for(;tt<F.length;tt++)ze=he(q,F[tt],oe),ze!==null&&(O=f(ze,O,tt),kt===null?Ie=ze:kt.sibling=ze,kt=ze);return ct&&ws(q,tt),Ie}for(ze=i(ze);tt<F.length;tt++)mt=le(ze,q,tt,F[tt],oe),mt!==null&&(e&&mt.alternate!==null&&ze.delete(mt.key===null?tt:mt.key),O=f(mt,O,tt),kt===null?Ie=mt:kt.sibling=mt,kt=mt);return e&&ze.forEach(function(Ni){return t(q,Ni)}),ct&&ws(q,tt),Ie}function Ye(q,O,F,oe){if(F==null)throw Error(c(151));for(var Ie=null,kt=null,ze=O,tt=O=0,mt=null,Nt=F.next();ze!==null&&!Nt.done;tt++,Nt=F.next()){ze.index>tt?(mt=ze,ze=null):mt=ze.sibling;var Ni=ee(q,ze,Nt.value,oe);if(Ni===null){ze===null&&(ze=mt);break}e&&ze&&Ni.alternate===null&&t(q,ze),O=f(Ni,O,tt),kt===null?Ie=Ni:kt.sibling=Ni,kt=Ni,ze=mt}if(Nt.done)return n(q,ze),ct&&ws(q,tt),Ie;if(ze===null){for(;!Nt.done;tt++,Nt=F.next())Nt=he(q,Nt.value,oe),Nt!==null&&(O=f(Nt,O,tt),kt===null?Ie=Nt:kt.sibling=Nt,kt=Nt);return ct&&ws(q,tt),Ie}for(ze=i(ze);!Nt.done;tt++,Nt=F.next())Nt=le(ze,q,tt,Nt.value,oe),Nt!==null&&(e&&Nt.alternate!==null&&ze.delete(Nt.key===null?tt:Nt.key),O=f(Nt,O,tt),kt===null?Ie=Nt:kt.sibling=Nt,kt=Nt);return e&&ze.forEach(function(x0){return t(q,x0)}),ct&&ws(q,tt),Ie}function Gt(q,O,F,oe){if(typeof F=="object"&&F!==null&&F.type===N&&F.key===null&&(F=F.props.children),typeof F=="object"&&F!==null){switch(F.$$typeof){case C:e:{for(var Ie=F.key;O!==null;){if(O.key===Ie){if(Ie=F.type,Ie===N){if(O.tag===7){n(q,O.sibling),oe=u(O,F.props.children),oe.return=q,q=oe;break e}}else if(O.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===D&&Es(Ie)===O.type){n(q,O.sibling),oe=u(O,F.props),oi(oe,F),oe.return=q,q=oe;break e}n(q,O);break}else t(q,O);O=O.sibling}F.type===N?(oe=ja(F.props.children,q.mode,oe,F.key),oe.return=q,q=oe):(oe=Pr(F.type,F.key,F.props,null,q.mode,oe),oi(oe,F),oe.return=q,q=oe)}return b(q);case k:e:{for(Ie=F.key;O!==null;){if(O.key===Ie)if(O.tag===4&&O.stateNode.containerInfo===F.containerInfo&&O.stateNode.implementation===F.implementation){n(q,O.sibling),oe=u(O,F.children||[]),oe.return=q,q=oe;break e}else{n(q,O);break}else t(q,O);O=O.sibling}oe=ao(F,q.mode,oe),oe.return=q,q=oe}return b(q);case D:return F=Es(F),Gt(q,O,F,oe)}if(Se(F))return Oe(q,O,F,oe);if(fe(F)){if(Ie=fe(F),typeof Ie!="function")throw Error(c(150));return F=Ie.call(F),Ye(q,O,F,oe)}if(typeof F.then=="function")return Gt(q,O,dr(F),oe);if(F.$$typeof===X)return Gt(q,O,nc(q,F),oe);p(q,F)}return typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint"?(F=""+F,O!==null&&O.tag===6?(n(q,O.sibling),oe=u(O,F),oe.return=q,q=oe):(n(q,O),oe=so(F,q.mode,oe),oe.return=q,q=oe),b(q)):n(q,O)}return function(q,O,F,oe){try{fr=0;var Ie=Gt(q,O,F,oe);return ta=null,Ie}catch(ze){if(ze===ci||ze===ur)throw ze;var kt=In(29,ze,null,q.mode);return kt.lanes=oe,kt.return=q,kt}finally{}}}var re=U(!0),De=U(!1),jt=!1;function jn(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function yl(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 Ml(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Cs(e,t,n){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(Ct&2)!==0){var u=i.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),i.pending=t,t=Jr(e),gu(e,null,n),t}return Zr(e,i,t,n),Jr(e)}function ui(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,as(e,n)}}function ve(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 Ae=!1;function Ge(){if(Ae){var e=ri;if(e!==null)throw e}}function ot(e,t,n,i){Ae=!1;var u=e.updateQueue;jt=!1;var f=u.firstBaseUpdate,b=u.lastBaseUpdate,S=u.shared.pending;if(S!==null){u.shared.pending=null;var M=S,W=M.next;M.next=null,b===null?f=W:b.next=W,b=M;var ie=e.alternate;ie!==null&&(ie=ie.updateQueue,S=ie.lastBaseUpdate,S!==b&&(S===null?ie.firstBaseUpdate=W:S.next=W,ie.lastBaseUpdate=M))}if(f!==null){var he=u.baseState;b=0,ie=W=M=null,S=f;do{var ee=S.lane&-536870913,le=ee!==S.lane;if(le?(pt&ee)===ee:(i&ee)===ee){ee!==0&&ee===Na&&(Ae=!0),ie!==null&&(ie=ie.next={lane:0,tag:S.tag,payload:S.payload,callback:null,next:null});e:{var Oe=e,Ye=S;ee=t;var Gt=n;switch(Ye.tag){case 1:if(Oe=Ye.payload,typeof Oe=="function"){he=Oe.call(Gt,he,ee);break e}he=Oe;break e;case 3:Oe.flags=Oe.flags&-65537|128;case 0:if(Oe=Ye.payload,ee=typeof Oe=="function"?Oe.call(Gt,he,ee):Oe,ee==null)break e;he=j({},he,ee);break e;case 2:jt=!0}}ee=S.callback,ee!==null&&(e.flags|=64,le&&(e.flags|=8192),le=u.callbacks,le===null?u.callbacks=[ee]:le.push(ee))}else le={lane:ee,tag:S.tag,payload:S.payload,callback:S.callback,next:null},ie===null?(W=ie=le,M=he):ie=ie.next=le,b|=ee;if(S=S.next,S===null){if(S=u.shared.pending,S===null)break;le=S,S=le.next,le.next=null,u.lastBaseUpdate=le,u.shared.pending=null}}while(!0);ie===null&&(M=he),u.baseState=M,u.firstBaseUpdate=W,u.lastBaseUpdate=ie,f===null&&(u.shared.lanes=0),gi|=b,e.lanes=b,e.memoizedState=he}}function Rt(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function Wl(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Rt(n[e],t)}var fi=E(null),Eu=E(0);function qp(e,t){e=Ha,de(Eu,e),de(fi,t),Ha=e|t.baseLanes}function fd(){de(Eu,Ha),de(fi,fi.current)}function dd(){Ha=Eu.current,G(fi),G(Eu)}var Il=E(null),Pl=null;function di(e){var t=e.alternate;de(Sn,Sn.current&1),de(Il,e),Pl===null&&(t===null||fi.current!==null||t.memoizedState!==null)&&(Pl=e)}function hd(e){de(Sn,Sn.current),de(Il,e),Pl===null&&(Pl=e)}function Gp(e){e.tag===22?(de(Sn,Sn.current),de(Il,e),Pl===null&&(Pl=e)):hi()}function hi(){de(Sn,Sn.current),de(Il,Il.current)}function ql(e){G(Il),Pl===e&&(Pl=null),G(Sn)}var Sn=E(0);function Cu(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||_h(n)||yh(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 Aa=0,Pe=null,It=null,Mn=null,Au=!1,rc=!1,hr=!1,Mu=0,fo=0,cc=null,ry=0;function bn(){throw Error(c(321))}function pd(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!An(e[n],t[n]))return!1;return!0}function md(e,t,n,i,u,f){return Aa=f,Pe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,V.H=e===null||e.memoizedState===null?km:Ad,hr=!1,f=n(i,u),hr=!1,rc&&(f=$p(t,n,i,u)),Yp(e),f}function Yp(e){V.H=mo;var t=It!==null&&It.next!==null;if(Aa=0,Mn=It=Pe=null,Au=!1,fo=0,cc=null,t)throw Error(c(300));e===null||Rn||(e=e.dependencies,e!==null&&Ut(e)&&(Rn=!0))}function $p(e,t,n,i){Pe=e;var u=0;do{if(rc&&(cc=null),fo=0,rc=!1,25<=u)throw Error(c(301));if(u+=1,Mn=It=null,e.updateQueue!=null){var f=e.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}V.H=Nm,f=t(n,i)}while(rc);return f}function cy(){var e=V.H,t=e.useState()[0];return t=typeof t.then=="function"?ho(t):t,e=e.useState()[0],(It!==null?It.memoizedState:null)!==e&&(Pe.flags|=1024),t}function gd(){var e=Mu!==0;return Mu=0,e}function xd(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function bd(e){if(Au){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Au=!1}Aa=0,Mn=It=Pe=null,rc=!1,fo=Mu=0,cc=null}function vl(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Mn===null?Pe.memoizedState=Mn=e:Mn=Mn.next=e,Mn}function wn(){if(It===null){var e=Pe.alternate;e=e!==null?e.memoizedState:null}else e=It.next;var t=Mn===null?Pe.memoizedState:Mn.next;if(t!==null)Mn=t,It=e;else{if(e===null)throw Pe.alternate===null?Error(c(467)):Error(c(310));It=e,e={memoizedState:It.memoizedState,baseState:It.baseState,baseQueue:It.baseQueue,queue:It.queue,next:null},Mn===null?Pe.memoizedState=Mn=e:Mn=Mn.next=e}return Mn}function Ru(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ho(e){var t=fo;return fo+=1,cc===null&&(cc=[]),e=Nu(cc,e,t),t=Pe,(Mn===null?t.memoizedState:Mn.next)===null&&(t=t.alternate,V.H=t===null||t.memoizedState===null?km:Ad),e}function Du(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return ho(e);if(e.$$typeof===X)return Gn(e)}throw Error(c(438,String(e)))}function _d(e){var t=null,n=Pe.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var i=Pe.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=Ru(),Pe.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]=te;return t.index++,n}function Ma(e,t){return typeof t=="function"?t(e):t}function Ou(e){var t=wn();return yd(t,It,e)}function yd(e,t,n){var i=e.queue;if(i===null)throw Error(c(311));i.lastRenderedReducer=n;var u=e.baseQueue,f=i.pending;if(f!==null){if(u!==null){var b=u.next;u.next=f.next,f.next=b}t.baseQueue=u=f,i.pending=null}if(f=e.baseState,u===null)e.memoizedState=f;else{t=u.next;var S=b=null,M=null,W=t,ie=!1;do{var he=W.lane&-536870913;if(he!==W.lane?(pt&he)===he:(Aa&he)===he){var ee=W.revertLane;if(ee===0)M!==null&&(M=M.next={lane:0,revertLane:0,gesture:null,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null}),he===Na&&(ie=!0);else if((Aa&ee)===ee){W=W.next,ee===Na&&(ie=!0);continue}else he={lane:0,revertLane:W.revertLane,gesture:null,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},M===null?(S=M=he,b=f):M=M.next=he,Pe.lanes|=ee,gi|=ee;he=W.action,hr&&n(f,he),f=W.hasEagerState?W.eagerState:n(f,he)}else ee={lane:he,revertLane:W.revertLane,gesture:W.gesture,action:W.action,hasEagerState:W.hasEagerState,eagerState:W.eagerState,next:null},M===null?(S=M=ee,b=f):M=M.next=ee,Pe.lanes|=he,gi|=he;W=W.next}while(W!==null&&W!==t);if(M===null?b=f:M.next=S,!An(f,e.memoizedState)&&(Rn=!0,ie&&(n=ri,n!==null)))throw n;e.memoizedState=f,e.baseState=b,e.baseQueue=M,i.lastRenderedState=f}return u===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function vd(e){var t=wn(),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);An(f,t.memoizedState)||(Rn=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),n.lastRenderedState=f}return[f,i]}function Xp(e,t,n){var i=Pe,u=wn(),f=ct;if(f){if(n===void 0)throw Error(c(407));n=n()}else n=t();var b=!An((It||u).memoizedState,n);if(b&&(u.memoizedState=n,Rn=!0),u=u.queue,wd(Kp.bind(null,i,u,e),[e]),u.getSnapshot!==t||b||Mn!==null&&Mn.memoizedState.tag&1){if(i.flags|=2048,oc(9,{destroy:void 0},Qp.bind(null,i,u,n,t),null),Kt===null)throw Error(c(349));f||(Aa&127)!==0||Vp(i,t,n)}return n}function Vp(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Pe.updateQueue,t===null?(t=Ru(),Pe.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!An(e,n)}catch{return!0}}function Fp(e){var t=js(e,2);t!==null&&zl(t,e,2)}function jd(e){var t=vl();if(typeof e=="function"){var n=e;if(e=n(),hr){rn(!0);try{n()}finally{rn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ma,lastRenderedState:e},t}function Jp(e,t,n,i){return e.baseState=n,yd(e,It,typeof i=="function"?i:Ma)}function oy(e,t,n,i,u){if(Uu(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)}};V.T!==null?n(!0):f.isTransition=!1,i(f),n=t.pending,n===null?(f.next=t.pending=f,Wp(t,f)):(f.next=n.next,t.pending=n.next=f)}}function Wp(e,t){var n=t.action,i=t.payload,u=e.state;if(t.isTransition){var f=V.T,b={};V.T=b;try{var S=n(u,i),M=V.S;M!==null&&M(b,S),Pp(e,t,S)}catch(W){Sd(e,t,W)}finally{f!==null&&b.types!==null&&(f.types=b.types),V.T=f}}else try{f=n(u,i),Pp(e,t,f)}catch(W){Sd(e,t,W)}}function Pp(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(i){em(e,t,i)},function(i){return Sd(e,t,i)}):em(e,t,n)}function em(e,t,n){t.status="fulfilled",t.value=n,tm(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Wp(e,n)))}function Sd(e,t,n){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do t.status="rejected",t.reason=n,tm(t),t=t.next;while(t!==i)}e.action=null}function tm(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function nm(e,t){return t}function lm(e,t){if(ct){var n=Kt.formState;if(n!==null){e:{var i=Pe;if(ct){if(Qt){t:{for(var u=Qt,f=Al;u.nodeType!==8;){if(!f){u=null;break t}if(u=es(u.nextSibling),u===null){u=null;break t}}f=u.data,u=f==="F!"||f==="F"?u:null}if(u){Qt=es(u.nextSibling),i=u.data==="F!";break e}}Ps(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,Pe,i),i.dispatch=n,i=jd(!1),f=Cd.bind(null,Pe,!1,i.queue),i=vl(),u={state:t,dispatch:null,action:e,pending:null},i.queue=u,n=oy.bind(null,Pe,u,f,n),u.dispatch=n,i.memoizedState=e,[t,n,!1]}function sm(e){var t=wn();return am(t,It,e)}function am(e,t,n){if(t=yd(e,t,nm)[0],e=Ou(Ma)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var i=ho(t)}catch(b){throw b===ci?ur:b}else i=t;t=wn();var u=t.queue,f=u.dispatch;return n!==t.memoizedState&&(Pe.flags|=2048,oc(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=wn(),n=It;if(n!==null)return am(t,n,e);wn(),t=t.memoizedState,n=wn();var i=n.queue.dispatch;return n.memoizedState=e,[t,i,!1]}function oc(e,t,n,i){return e={tag:e,create:n,deps:i,inst:t,next:null},t=Pe.updateQueue,t===null&&(t=Ru(),Pe.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 wn().memoizedState}function Lu(e,t,n,i){var u=vl();Pe.flags|=e,u.memoizedState=oc(1|t,{destroy:void 0},n,i===void 0?null:i)}function zu(e,t,n,i){var u=wn();i=i===void 0?null:i;var f=u.memoizedState.inst;It!==null&&i!==null&&pd(i,It.memoizedState.deps)?u.memoizedState=oc(t,f,n,i):(Pe.flags|=e,u.memoizedState=oc(1|t,f,n,i))}function cm(e,t){Lu(8390656,8,e,t)}function wd(e,t){zu(2048,8,e,t)}function fy(e){Pe.flags|=4;var t=Pe.updateQueue;if(t===null)t=Ru(),Pe.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function om(e){var t=wn().memoizedState;return fy({ref:t,nextImpl:e}),function(){if((Ct&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function um(e,t){return zu(4,2,e,t)}function fm(e,t){return zu(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,zu(4,4,dm.bind(null,t,e),n)}function kd(){}function pm(e,t){var n=wn();t=t===void 0?null:t;var i=n.memoizedState;return t!==null&&pd(t,i[1])?i[0]:(n.memoizedState=[e,t],e)}function mm(e,t){var n=wn();t=t===void 0?null:t;var i=n.memoizedState;if(t!==null&&pd(t,i[1]))return i[0];if(i=e(),hr){rn(!0);try{e()}finally{rn(!1)}}return n.memoizedState=[i,t],i}function Nd(e,t,n){return n===void 0||(Aa&1073741824)!==0&&(pt&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=gg(),Pe.lanes|=e,gi|=e,n)}function gm(e,t,n,i){return An(n,t)?n:fi.current!==null?(e=Nd(e,n,i),An(e,t)||(Rn=!0),e):(Aa&42)===0||(Aa&1073741824)!==0&&(pt&261930)===0?(Rn=!0,e.memoizedState=n):(e=gg(),Pe.lanes|=e,gi|=e,t)}function xm(e,t,n,i,u){var f=pe.p;pe.p=f!==0&&8>f?f:8;var b=V.T,S={};V.T=S,Cd(e,!1,t,n);try{var M=u(),W=V.S;if(W!==null&&W(S,M),M!==null&&typeof M=="object"&&typeof M.then=="function"){var ie=cr(M,i);po(e,t,ie,$l(e))}else po(e,t,i,$l(e))}catch(he){po(e,t,{then:function(){},status:"rejected",reason:he},$l())}finally{pe.p=f,b!==null&&S.types!==null&&(b.types=S.types),V.T=b}}function dy(){}function Td(e,t,n,i){if(e.tag!==5)throw Error(c(476));var u=bm(e).queue;xm(e,u,t,H,n===null?dy:function(){return _m(e),n(i)})}function bm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:H,baseState:H,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ma,lastRenderedState:H},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ma,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),po(e,t.next.queue,{},$l())}function Ed(){return Gn(Mo)}function ym(){return wn().memoizedState}function vm(){return wn().memoizedState}function hy(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=$l();e=Ml(n);var i=Cs(t,e,n);i!==null&&(zl(i,t,n),ui(i,t,n)),t={cache:ai()},e.payload=t;return}t=t.return}}function py(e,t,n){var i=$l();n={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Uu(e)?Sm(t,n):(n=Fr(e,t,n,i),n!==null&&(zl(n,e,i),wm(n,t,i)))}function jm(e,t,n){var i=$l();po(e,t,n,i)}function po(e,t,n,i){var u={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Uu(e))Sm(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,An(S,b))return Zr(e,t,u,0),Kt===null&&nr(),!1}catch{}finally{}if(n=Fr(e,t,u,i),n!==null)return zl(n,e,i),wm(n,t,i),!0}return!1}function Cd(e,t,n,i){if(i={lane:2,revertLane:rh(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Uu(e)){if(t)throw Error(c(479))}else t=Fr(e,n,i,2),t!==null&&zl(t,e,2)}function Uu(e){var t=e.alternate;return e===Pe||t!==null&&t===Pe}function Sm(e,t){rc=Au=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function wm(e,t,n){if((n&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,as(e,n)}}var mo={readContext:Gn,use:Du,useCallback:bn,useContext:bn,useEffect:bn,useImperativeHandle:bn,useLayoutEffect:bn,useInsertionEffect:bn,useMemo:bn,useReducer:bn,useRef:bn,useState:bn,useDebugValue:bn,useDeferredValue:bn,useTransition:bn,useSyncExternalStore:bn,useId:bn,useHostTransitionStatus:bn,useFormState:bn,useActionState:bn,useOptimistic:bn,useMemoCache:bn,useCacheRefresh:bn};mo.useEffectEvent=bn;var km={readContext:Gn,use:Du,useCallback:function(e,t){return vl().memoizedState=[e,t===void 0?null:t],e},useContext:Gn,useEffect:cm,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Lu(4194308,4,dm.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Lu(4194308,4,e,t)},useInsertionEffect:function(e,t){Lu(4,2,e,t)},useMemo:function(e,t){var n=vl();t=t===void 0?null:t;var i=e();if(hr){rn(!0);try{e()}finally{rn(!1)}}return n.memoizedState=[i,t],i},useReducer:function(e,t,n){var i=vl();if(n!==void 0){var u=n(t);if(hr){rn(!0);try{n(t)}finally{rn(!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,Pe,e),[i.memoizedState,e]},useRef:function(e){var t=vl();return e={current:e},t.memoizedState=e},useState:function(e){e=jd(e);var t=e.queue,n=jm.bind(null,Pe,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:kd,useDeferredValue:function(e,t){var n=vl();return Nd(n,e,t)},useTransition:function(){var e=jd(!1);return e=xm.bind(null,Pe,e.queue,!0,!1),vl().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var i=Pe,u=vl();if(ct){if(n===void 0)throw Error(c(407));n=n()}else{if(n=t(),Kt===null)throw Error(c(349));(pt&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,oc(9,{destroy:void 0},Qp.bind(null,i,f,n,t),null),n},useId:function(){var e=vl(),t=Kt.identifierPrefix;if(ct){var n=Fl,i=Zl;n=(i&~(1<<32-wt(i)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Mu++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=ry++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Ed,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=Cd.bind(null,Pe,!0,n),n.dispatch=t,[e,t]},useMemoCache:_d,useCacheRefresh:function(){return vl().memoizedState=hy.bind(null,Pe)},useEffectEvent:function(e){var t=vl(),n={impl:e};return t.memoizedState=n,function(){if((Ct&2)!==0)throw Error(c(440));return n.impl.apply(void 0,arguments)}}},Ad={readContext:Gn,use:Du,useCallback:pm,useContext:Gn,useEffect:wd,useImperativeHandle:hm,useInsertionEffect:um,useLayoutEffect:fm,useMemo:mm,useReducer:Ou,useRef:rm,useState:function(){return Ou(Ma)},useDebugValue:kd,useDeferredValue:function(e,t){var n=wn();return gm(n,It.memoizedState,e,t)},useTransition:function(){var e=Ou(Ma)[0],t=wn().memoizedState;return[typeof e=="boolean"?e:ho(e),t]},useSyncExternalStore:Xp,useId:ym,useHostTransitionStatus:Ed,useFormState:sm,useActionState:sm,useOptimistic:function(e,t){var n=wn();return Jp(n,It,e,t)},useMemoCache:_d,useCacheRefresh:vm};Ad.useEffectEvent=om;var Nm={readContext:Gn,use:Du,useCallback:pm,useContext:Gn,useEffect:wd,useImperativeHandle:hm,useInsertionEffect:um,useLayoutEffect:fm,useMemo:mm,useReducer:vd,useRef:rm,useState:function(){return vd(Ma)},useDebugValue:kd,useDeferredValue:function(e,t){var n=wn();return It===null?Nd(n,e,t):gm(n,It.memoizedState,e,t)},useTransition:function(){var e=vd(Ma)[0],t=wn().memoizedState;return[typeof e=="boolean"?e:ho(e),t]},useSyncExternalStore:Xp,useId:ym,useHostTransitionStatus:Ed,useFormState:im,useActionState:im,useOptimistic:function(e,t){var n=wn();return It!==null?Jp(n,It,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:_d,useCacheRefresh:vm};Nm.useEffectEvent=om;function Md(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 Rd={enqueueSetState:function(e,t,n){e=e._reactInternals;var i=$l(),u=Ml(i);u.payload=t,n!=null&&(u.callback=n),t=Cs(e,u,i),t!==null&&(zl(t,e,i),ui(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var i=$l(),u=Ml(i);u.tag=1,u.payload=t,n!=null&&(u.callback=n),t=Cs(e,u,i),t!==null&&(zl(t,e,i),ui(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=$l(),i=Ml(n);i.tag=2,t!=null&&(i.callback=t),t=Cs(e,i,n),t!==null&&(zl(t,e,n),ui(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?!Pi(n,i)||!Pi(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&&Rd.enqueueReplaceState(t,t.state,null)}function pr(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){tr(e)}function Am(e){console.error(e)}function Mm(e){tr(e)}function Hu(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 Dd(e,t,n){return n=Ml(n),n.tag=3,n.payload={element:null},n.callback=function(){Hu(e,t)},n}function Dm(e){return e=Ml(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"&&(xi===null?xi=new Set([this]):xi.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&&Vn(t,n,u,!0),n=Il.current,n!==null){switch(n.tag){case 31:case 13:return Pl===null?Fu():n.alternate===null&&_n===0&&(_n=3),n.flags&=-257,n.flags|=65536,n.lanes=u,i===ic?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([i]):t.add(i),sh(e,i,u)),!1;case 22:return n.flags|=65536,i===ic?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)),sh(e,i,u)),!1}throw Error(c(435,n.tag))}return sh(e,i,u),Fu(),!1}if(ct)return t=Il.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,i!==io&&(e=Error(c(422),{cause:i}),ar(El(e,n)))):(i!==io&&(t=Error(c(423),{cause:i}),ar(El(t,n))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,i=El(i,n),u=Dd(e.stateNode,i,u),ve(e,u),_n!==4&&(_n=2)),!1;var f=Error(c(520),{cause:i});if(f=El(f,n),So===null?So=[f]:So.push(f),_n!==4&&(_n=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=Dd(n.stateNode,i,e),ve(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"&&(xi===null||!xi.has(f))))return n.flags|=65536,u&=-u,n.lanes|=u,u=Dm(u),Om(u,e,n,i),ve(n,u),!1}n=n.return}while(n!==null);return!1}var Od=Error(c(461)),Rn=!1;function tl(e,t,n,i){t.child=e===null?De(t,null,n,i):re(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 Ts(t),i=md(e,t,n,b,f,u),S=gd(),e!==null&&!Rn?(xd(e,t,u),Ra(e,t,u)):(ct&&S&&sr(t),t.flags|=1,tl(e,t,i,u),t.child)}function zm(e,t,n,i,u){if(e===null){var f=n.type;return typeof f=="function"&&!Wr(f)&&f.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=f,Um(e,t,f,i,u)):(e=Pr(n.type,null,i,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!Gd(e,u)){var b=f.memoizedProps;if(n=n.compare,n=n!==null?n:Pi,n(b,i)&&e.ref===t.ref)return Ra(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(Pi(f,i)&&e.ref===t.ref)if(Rn=!1,t.pendingProps=i=f,Gd(e,u))(e.flags&131072)!==0&&(Rn=!0);else return t.lanes=e.lanes,Ra(e,t,u)}return Ld(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&&or(t,f!==null?f.cachePool:null),f!==null?qp(t,f):fd(),Gp(t);else return i=t.lanes=536870912,Bm(e,t,f!==null?f.baseLanes|n:n,n,i)}else f!==null?(or(t,f.cachePool),qp(t,f),hi(),t.memoizedState=null):(e!==null&&or(t,null),fd(),hi());return tl(e,t,u,n),t.child}function go(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=sc();return f=f===null?null:{parent:hn._currentValue,pool:f},t.memoizedState={baseLanes:n,cachePool:f},e!==null&&or(t,null),fd(),Gp(t),e!==null&&Vn(e,t,i,!0),t.childLanes=u,null}function Bu(e,t){return t=qu({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 re(t,e.child,null,n),e=Bu(t,t.pendingProps),e.flags|=2,ql(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(ct){if(i.mode==="hidden")return e=Bu(t,i),t.lanes=536870912,go(null,e);if(hd(t),(e=Qt)?(e=Wg(e,Al),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Js!==null?{id:Zl,overflow:Fl}:null,retryLane:536870912,hydrationErrors:null},n=xu(e),n.return=t,t.child=n,qn=t,Qt=null)):e=null,e===null)throw Ps(t);return t.lanes=536870912,null}return Bu(t,i)}var f=e.memoizedState;if(f!==null){var b=f.dehydrated;if(hd(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(Rn||Vn(e,t,n,!1),u=(n&e.childLanes)!==0,Rn||u){if(i=Kt,i!==null&&(b=Us(i,n),b!==0&&b!==f.retryLane))throw f.retryLane=b,js(e,b),zl(i,e,b),Od;Fu(),t=Im(e,t,n)}else e=f.treeContext,Qt=es(b.nextSibling),qn=t,ct=!0,Ws=null,Al=!1,e!==null&&_u(t,e),t=Bu(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 Iu(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 Ld(e,t,n,i,u){return Ts(t),n=md(e,t,n,i,void 0,u),i=gd(),e!==null&&!Rn?(xd(e,t,u),Ra(e,t,u)):(ct&&i&&sr(t),t.flags|=1,tl(e,t,n,u),t.child)}function qm(e,t,n,i,u,f){return Ts(t),t.updateQueue=null,n=$p(t,i,n,u),Yp(e),i=gd(),e!==null&&!Rn?(xd(e,t,f),Ra(e,t,f)):(ct&&i&&sr(t),t.flags|=1,tl(e,t,n,f),t.child)}function Gm(e,t,n,i,u){if(Ts(t),t.stateNode===null){var f=Pa,b=n.contextType;typeof b=="object"&&b!==null&&(f=Gn(b)),f=new n(i,f),t.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=Rd,t.stateNode=f,f._reactInternals=t,f=t.stateNode,f.props=i,f.state=t.memoizedState,f.refs={},jn(t),b=n.contextType,f.context=typeof b=="object"&&b!==null?Gn(b):Pa,f.state=t.memoizedState,b=n.getDerivedStateFromProps,typeof b=="function"&&(Md(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&&Rd.enqueueReplaceState(f,f.state,null),ot(t,i,f,u),Ge(),f.state=t.memoizedState),typeof f.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){f=t.stateNode;var S=t.memoizedProps,M=pr(n,S);f.props=M;var W=f.context,ie=n.contextType;b=Pa,typeof ie=="object"&&ie!==null&&(b=Gn(ie));var he=n.getDerivedStateFromProps;ie=typeof he=="function"||typeof f.getSnapshotBeforeUpdate=="function",S=t.pendingProps!==S,ie||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(S||W!==b)&&Em(t,f,i,b),jt=!1;var ee=t.memoizedState;f.state=ee,ot(t,i,f,u),Ge(),W=t.memoizedState,S||ee!==W||jt?(typeof he=="function"&&(Md(t,n,he,i),W=t.memoizedState),(M=jt||Tm(t,n,M,i,ee,W,b))?(ie||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=M):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{f=t.stateNode,yl(e,t),b=t.memoizedProps,ie=pr(n,b),f.props=ie,he=t.pendingProps,ee=f.context,W=n.contextType,M=Pa,typeof W=="object"&&W!==null&&(M=Gn(W)),S=n.getDerivedStateFromProps,(W=typeof S=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(b!==he||ee!==M)&&Em(t,f,i,M),jt=!1,ee=t.memoizedState,f.state=ee,ot(t,i,f,u),Ge();var le=t.memoizedState;b!==he||ee!==le||jt||e!==null&&e.dependencies!==null&&Ut(e.dependencies)?(typeof S=="function"&&(Md(t,n,S,i),le=t.memoizedState),(ie=jt||Tm(t,n,ie,i,ee,le,M)||e!==null&&e.dependencies!==null&&Ut(e.dependencies))?(W||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(i,le,M),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(i,le,M)),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=le),f.props=i,f.state=le,f.context=M,i=ie):(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,Iu(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=re(t,e.child,null,u),t.child=re(t,null,n,u)):tl(e,t,n,u),t.memoizedState=f.state,e=t.child):e=Ra(e,t,u),e}function Ym(e,t,n,i){return Sa(),t.flags|=256,tl(e,t,n,i),t.child}var zd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ud(e){return{baseLanes:e,cachePool:wu()}}function Hd(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Yl),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:(Sn.current&2)!==0),b&&(u=!0,t.flags&=-129),b=(t.flags&32)!==0,t.flags&=-33,e===null){if(ct){if(u?di(t):hi(),(e=Qt)?(e=Wg(e,Al),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Js!==null?{id:Zl,overflow:Fl}:null,retryLane:536870912,hydrationErrors:null},n=xu(e),n.return=t,t.child=n,qn=t,Qt=null)):e=null,e===null)throw Ps(t);return yh(e)?t.lanes=32:t.lanes=536870912,null}var S=i.children;return i=i.fallback,u?(hi(),u=t.mode,S=qu({mode:"hidden",children:S},u),i=ja(i,u,n,null),S.return=t,i.return=t,S.sibling=i,t.child=S,i=t.child,i.memoizedState=Ud(n),i.childLanes=Hd(e,b,n),t.memoizedState=zd,go(null,i)):(di(t),Bd(t,S))}var M=e.memoizedState;if(M!==null&&(S=M.dehydrated,S!==null)){if(f)t.flags&256?(di(t),t.flags&=-257,t=Id(e,t,n)):t.memoizedState!==null?(hi(),t.child=e.child,t.flags|=128,t=null):(hi(),S=i.fallback,u=t.mode,i=qu({mode:"visible",children:i.children},u),S=ja(S,u,n,null),S.flags|=2,i.return=t,S.return=t,i.sibling=S,t.child=i,re(t,e.child,null,n),i=t.child,i.memoizedState=Ud(n),i.childLanes=Hd(e,b,n),t.memoizedState=zd,t=go(null,i));else if(di(t),yh(S)){if(b=S.nextSibling&&S.nextSibling.dataset,b)var W=b.dgst;b=W,i=Error(c(419)),i.stack="",i.digest=b,ar({value:i,source:null,stack:null}),t=Id(e,t,n)}else if(Rn||Vn(e,t,n,!1),b=(n&e.childLanes)!==0,Rn||b){if(b=Kt,b!==null&&(i=Us(b,n),i!==0&&i!==M.retryLane))throw M.retryLane=i,js(e,i),zl(b,e,i),Od;_h(S)||Fu(),t=Id(e,t,n)}else _h(S)?(t.flags|=192,t.child=e.child,t=null):(e=M.treeContext,Qt=es(S.nextSibling),qn=t,ct=!0,Ws=null,Al=!1,e!==null&&_u(t,e),t=Bd(t,i.children),t.flags|=4096);return t}return u?(hi(),S=i.fallback,u=t.mode,M=e.child,W=M.sibling,i=Ss(M,{mode:"hidden",children:i.children}),i.subtreeFlags=M.subtreeFlags&65011712,W!==null?S=Ss(W,S):(S=ja(S,u,n,null),S.flags|=2),S.return=t,i.return=t,i.sibling=S,t.child=i,go(null,i),i=t.child,S=e.child.memoizedState,S===null?S=Ud(n):(u=S.cachePool,u!==null?(M=hn._currentValue,u=u.parent!==M?{parent:M,pool:M}:u):u=wu(),S={baseLanes:S.baseLanes|n,cachePool:u}),i.memoizedState=S,i.childLanes=Hd(e,b,n),t.memoizedState=zd,go(e.child,i)):(di(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 Bd(e,t){return t=qu({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function qu(e,t){return e=In(22,e,null,t),e.lanes=0,e}function Id(e,t,n){return re(t,e.child,null,n),e=Bd(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),si(e.return,t,n)}function qd(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=Sn.current,S=(b&2)!==0;if(S?(b=b&1|2,t.flags|=128):b&=1,de(Sn,b),tl(e,t,i,n),i=ct?lr: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&&Cu(e)===null&&(u=n),n=n.sibling;n=u,n===null?(u=t.child,t.child=null):(u=n.sibling,n.sibling=null),qd(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&&Cu(e)===null){t.child=u;break}e=u.sibling,u.sibling=n,n=u,u=e}qd(t,!0,n,null,f,i);break;case"together":qd(t,!1,null,null,void 0,i);break;default:t.memoizedState=null}return t.child}function Ra(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),gi|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Vn(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 Gd(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Ut(e)))}function xy(e,t,n){switch(t.tag){case 3:Xe(t,t.stateNode.containerInfo),Ns(t,hn,e.memoizedState.cache),Sa();break;case 27:case 5:kn(t);break;case 4:Xe(t,t.stateNode.containerInfo);break;case 10:Ns(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,hd(t),null;break;case 13:var i=t.memoizedState;if(i!==null)return i.dehydrated!==null?(di(t),t.flags|=128,null):(n&t.child.childLanes)!==0?$m(e,t,n):(di(t),e=Ra(e,t,n),e!==null?e.sibling:null);di(t);break;case 19:var u=(e.flags&128)!==0;if(i=(n&t.childLanes)!==0,i||(Vn(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),de(Sn,Sn.current),i)break;return null;case 22:return t.lanes=0,Hm(e,t,n,t.pendingProps);case 24:Ns(t,hn,e.memoizedState.cache)}return Ra(e,t,n)}function Qm(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Rn=!0;else{if(!Gd(e,n)&&(t.flags&128)===0)return Rn=!1,xy(e,t,n);Rn=(e.flags&131072)!==0}else Rn=!1,ct&&(t.flags&1048576)!==0&&tc(t,lr,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=Es(t.elementType),t.type=e,typeof e=="function")Wr(e)?(i=pr(e,i),t.tag=1,t=Gm(null,t,e,i,n)):(t.tag=0,t=Ld(null,t,e,i,n));else{if(e!=null){var u=e.$$typeof;if(u===R){t.tag=11,t=Lm(null,t,e,i,n);break e}else if(u===Z){t.tag=14,t=zm(null,t,e,i,n);break e}}throw t=Ne(e)||e,Error(c(306,t,""))}}return t;case 0:return Ld(e,t,t.type,t.pendingProps,n);case 1:return i=t.type,u=pr(i,t.pendingProps),Gm(e,t,i,u,n);case 3:e:{if(Xe(t,t.stateNode.containerInfo),e===null)throw Error(c(387));i=t.pendingProps;var f=t.memoizedState;u=f.element,yl(e,t),ot(t,i,null,n);var b=t.memoizedState;if(i=b.cache,Ns(t,hn,i),i!==f.cache&&_l(t,[hn],n,!0),Ge(),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),ar(u),t=Ym(e,t,i,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Qt=es(e.firstChild),qn=t,ct=!0,Ws=null,Al=!0,n=De(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Sa(),i===u){t=Ra(e,t,n);break e}tl(e,t,i,n)}t=t.child}return t;case 26:return Iu(e,t),e===null?(n=sx(t.type,null,t.pendingProps,null))?t.memoizedState=n:ct||(n=t.type,e=t.pendingProps,i=lf(Re.current).createElement(n),i[lt]=t,i[Qe]=e,nl(i,n,e),ht(i),t.stateNode=i):t.memoizedState=sx(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return kn(t),e===null&&ct&&(i=t.stateNode=tx(t.type,t.pendingProps,Re.current),qn=t,Al=!0,u=Qt,vi(t.type)?(vh=u,Qt=es(i.firstChild)):Qt=u),tl(e,t,t.pendingProps.children,n),Iu(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ct&&((u=i=Qt)&&(i=Qy(i,t.type,t.pendingProps,Al),i!==null?(t.stateNode=i,qn=t,Qt=es(i.firstChild),Al=!1,u=!0):u=!1),u||Ps(t)),kn(t),u=t.type,f=t.pendingProps,b=e!==null?e.memoizedProps:null,i=f.children,gh(u,f)?i=null:b!==null&&gh(u,b)&&(t.flags|=32),t.memoizedState!==null&&(u=md(e,t,cy,null,null,n),Mo._currentValue=u),Iu(e,t),tl(e,t,i,n),t.child;case 6:return e===null&&ct&&((e=n=Qt)&&(n=Ky(n,t.pendingProps,Al),n!==null?(t.stateNode=n,qn=t,Qt=null,e=!0):e=!1),e||Ps(t)),null;case 13:return $m(e,t,n);case 4:return Xe(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=re(t,null,i,n):tl(e,t,i,n),t.child;case 11:return Lm(e,t,t.type,t.pendingProps,n);case 7:return tl(e,t,t.pendingProps,n),t.child;case 8:return tl(e,t,t.pendingProps.children,n),t.child;case 12:return tl(e,t,t.pendingProps.children,n),t.child;case 10:return i=t.pendingProps,Ns(t,t.type,i.value),tl(e,t,i.children,n),t.child;case 9:return u=t.type._context,i=t.pendingProps.children,Ts(t),u=Gn(u),i=i(u),t.flags|=1,tl(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 Ts(t),i=Gn(hn),e===null?(u=sc(),u===null&&(u=Kt,f=ai(),u.pooledCache=f,f.refCount++,f!==null&&(u.pooledCacheLanes|=n),u=f),t.memoizedState={parent:i,cache:u},jn(t),Ns(t,hn,u)):((e.lanes&n)!==0&&(yl(e,t),ot(t,null,null,n),Ge()),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),Ns(t,hn,i)):(i=f.cache,Ns(t,hn,i),i!==u.cache&&_l(t,[hn],n,!0))),tl(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function Da(e){e.flags|=4}function Yd(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 ea=ic,ac}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 ea=ic,ac}function Gu(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?at():536870912,e.lanes|=t,hc|=t)}function xo(e,t){if(!ct)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 en(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(ni(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return en(t),null;case 1:return en(t),null;case 3:return n=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Jl(hn),We(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(li(t)?Da(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,ro())),en(t),null;case 26:var u=t.type,f=t.memoizedState;return e===null?(Da(t),f!==null?(en(t),Km(t,f)):(en(t),Yd(t,u,null,i,n))):f?f!==e.memoizedState?(Da(t),en(t),Km(t,f)):(en(t),t.flags&=-16777217):(e=e.memoizedProps,e!==i&&Da(t),en(t),Yd(t,u,e,i,n)),null;case 27:if(Be(t),n=Re.current,u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&Da(t);else{if(!i){if(t.stateNode===null)throw Error(c(166));return en(t),null}e=xe.current,li(t)?yu(t):(e=tx(u,i,n),t.stateNode=e,Da(t))}return en(t),null;case 5:if(Be(t),u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&Da(t);else{if(!i){if(t.stateNode===null)throw Error(c(166));return en(t),null}if(f=xe.current,li(t))yu(t);else{var b=lf(Re.current);switch(f){case 1:f=b.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:f=b.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":f=b.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":f=b.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":f=b.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof i.is=="string"?b.createElement("select",{is:i.is}):b.createElement("select"),i.multiple?f.multiple=!0:i.size&&(f.size=i.size);break;default:f=typeof i.is=="string"?b.createElement(u,{is:i.is}):b.createElement(u)}}f[lt]=t,f[Qe]=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(nl(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&&Da(t)}}return en(t),Yd(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&Da(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(c(166));if(e=Re.current,li(t)){if(e=t.stateNode,n=t.memoizedProps,i=null,u=qn,u!==null)switch(u.tag){case 27:case 5:i=u.memoizedProps}e[lt]=t,e=!!(e.nodeValue===n||i!==null&&i.suppressHydrationWarning===!0||$g(e.nodeValue,n)),e||Ps(t,!0)}else e=lf(e).createTextNode(i),e[lt]=t,t.stateNode=e}return en(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(i=li(t),n!==null){if(e===null){if(!i)throw Error(c(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(557));e[lt]=t}else Sa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;en(t),e=!1}else n=ro(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ql(t),t):(ql(t),null);if((t.flags&128)!==0)throw Error(c(558))}return en(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=li(t),i!==null&&i.dehydrated!==null){if(e===null){if(!u)throw Error(c(318));if(u=t.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(c(317));u[lt]=t}else Sa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;en(t),u=!1}else u=ro(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(ql(t),t):(ql(t),null)}return ql(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),Gu(t,t.updateQueue),en(t),null);case 4:return We(),e===null&&fh(t.stateNode.containerInfo),en(t),null;case 10:return Jl(t.type),en(t),null;case 19:if(G(Sn),i=t.memoizedState,i===null)return en(t),null;if(u=(t.flags&128)!==0,f=i.rendering,f===null)if(u)xo(i,!1);else{if(_n!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=Cu(e),f!==null){for(t.flags|=128,xo(i,!1),e=f.updateQueue,t.updateQueue=e,Gu(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)lo(n,e),n=n.sibling;return de(Sn,Sn.current&1|2),ct&&ws(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&_t()>Qu&&(t.flags|=128,u=!0,xo(i,!1),t.lanes=4194304)}else{if(!u)if(e=Cu(f),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,Gu(t,e),xo(i,!0),i.tail===null&&i.tailMode==="hidden"&&!f.alternate&&!ct)return en(t),null}else 2*_t()-i.renderingStartTime>Qu&&n!==536870912&&(t.flags|=128,u=!0,xo(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=_t(),e.sibling=null,n=Sn.current,de(Sn,u?n&1|2:n&1),ct&&ws(t,i.treeForkCount),e):(en(t),null);case 22:case 23:return ql(t),dd(),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&&(en(t),t.subtreeFlags&6&&(t.flags|=8192)):en(t),n=t.updateQueue,n!==null&&Gu(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&&G(Ea),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Jl(hn),en(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function _y(e,t){switch(ni(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Jl(hn),We(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Be(t),null;case 31:if(t.memoizedState!==null){if(ql(t),t.alternate===null)throw Error(c(340));Sa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ql(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));Sa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return G(Sn),null;case 4:return We(),null;case 10:return Jl(t.type),null;case 22:case 23:return ql(t),dd(),e!==null&&G(Ea),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Jl(hn),null;case 25:return null;default:return null}}function Zm(e,t){switch(ni(t),t.tag){case 3:Jl(hn),We();break;case 26:case 27:case 5:Be(t);break;case 4:We();break;case 31:t.memoizedState!==null&&ql(t);break;case 13:ql(t);break;case 19:G(Sn);break;case 10:Jl(t.type);break;case 22:case 23:ql(t),dd(),e!==null&&G(Ea);break;case 24:Jl(hn)}}function bo(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){Bt(t,t.return,S)}}function pi(e,t,n){try{var i=t.updateQueue,u=i!==null?i.lastEffect:null;if(u!==null){var f=u.next;i=f;do{if((i.tag&e)===e){var b=i.inst,S=b.destroy;if(S!==void 0){b.destroy=void 0,u=t;var M=n,W=S;try{W()}catch(ie){Bt(u,M,ie)}}}i=i.next}while(i!==f)}}catch(ie){Bt(t,t.return,ie)}}function Fm(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Wl(t,n)}catch(i){Bt(e,e.return,i)}}}function Jm(e,t,n){n.props=pr(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(i){Bt(e,t,i)}}function _o(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){Bt(e,t,u)}}function na(e,t){var n=e.ref,i=e.refCleanup;if(n!==null)if(typeof i=="function")try{i()}catch(u){Bt(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){Bt(e,t,u)}else n.current=null}function Wm(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){Bt(e,e.return,u)}}function $d(e,t,n){try{var i=e.stateNode;qy(i,e.type,n,t),i[Qe]=t}catch(u){Bt(e,e.return,u)}}function Pm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&vi(e.type)||e.tag===4}function Xd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Pm(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&&vi(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 Vd(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=st));else if(i!==4&&(i===27&&vi(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Vd(e,t,n),e=e.sibling;e!==null;)Vd(e,t,n),e=e.sibling}function Yu(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&&vi(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Yu(e,t,n),e=e.sibling;e!==null;)Yu(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]);nl(t,i,n),t[lt]=e,t[Qe]=n}catch(f){Bt(e,e.return,f)}}var Oa=!1,Dn=!1,Qd=!1,tg=typeof WeakSet=="function"?WeakSet:Set,Qn=null;function yy(e,t){if(e=e.containerInfo,ph=ff,e=du(e),Fs(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var u=i.anchorOffset,f=i.focusNode;i=i.focusOffset;try{n.nodeType,f.nodeType}catch{n=null;break e}var b=0,S=-1,M=-1,W=0,ie=0,he=e,ee=null;t:for(;;){for(var le;he!==n||u!==0&&he.nodeType!==3||(S=b+u),he!==f||i!==0&&he.nodeType!==3||(M=b+i),he.nodeType===3&&(b+=he.nodeValue.length),(le=he.firstChild)!==null;)ee=he,he=le;for(;;){if(he===e)break t;if(ee===n&&++W===u&&(S=b),ee===f&&++ie===i&&(M=b),(le=he.nextSibling)!==null)break;he=ee,ee=he.parentNode}he=le}n=S===-1||M===-1?null:{start:S,end:M}}else n=null}n=n||{start:0,end:0}}else n=null;for(mh={focusedElem:e,selectionRange:n},ff=!1,Qn=t;Qn!==null;)if(t=Qn,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Qn=e;else for(;Qn!==null;){switch(t=Qn,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 Oe=pr(n.type,u);e=i.getSnapshotBeforeUpdate(Oe,f),i.__reactInternalSnapshotBeforeUpdate=e}catch(Ye){Bt(n,n.return,Ye)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)bh(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":bh(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,Qn=e;break}Qn=t.return}}function ng(e,t,n){var i=n.flags;switch(n.tag){case 0:case 11:case 15:za(e,n),i&4&&bo(5,n);break;case 1:if(za(e,n),i&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(b){Bt(n,n.return,b)}else{var u=pr(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(b){Bt(n,n.return,b)}}i&64&&Fm(n),i&512&&_o(n,n.return);break;case 3:if(za(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{Wl(e,t)}catch(b){Bt(n,n.return,b)}}break;case 27:t===null&&i&4&&eg(n);case 26:case 5:za(e,n),t===null&&i&4&&Wm(n),i&512&&_o(n,n.return);break;case 12:za(e,n);break;case 31:za(e,n),i&4&&ag(e,n);break;case 13:za(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||Oa,!i){t=t!==null&&t.memoizedState!==null||Dn,u=Oa;var f=Dn;Oa=i,(Dn=t)&&!f?Ua(e,n,(n.subtreeFlags&8772)!==0):za(e,n),Oa=u,Dn=f}break;case 30:break;default:za(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&&us(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 un=null,Rl=!1;function La(e,t,n){for(n=n.child;n!==null;)sg(e,t,n),n=n.sibling}function sg(e,t,n){if(zt&&typeof zt.onCommitFiberUnmount=="function")try{zt.onCommitFiberUnmount(an,n)}catch{}switch(n.tag){case 26:Dn||na(n,t),La(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Dn||na(n,t);var i=un,u=Rl;vi(n.type)&&(un=n.stateNode,Rl=!1),La(e,t,n),Eo(n.stateNode),un=i,Rl=u;break;case 5:Dn||na(n,t);case 6:if(i=un,u=Rl,un=null,La(e,t,n),un=i,Rl=u,un!==null)if(Rl)try{(un.nodeType===9?un.body:un.nodeName==="HTML"?un.ownerDocument.body:un).removeChild(n.stateNode)}catch(f){Bt(n,t,f)}else try{un.removeChild(n.stateNode)}catch(f){Bt(n,t,f)}break;case 18:un!==null&&(Rl?(e=un,Fg(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),vc(e)):Fg(un,n.stateNode));break;case 4:i=un,u=Rl,un=n.stateNode.containerInfo,Rl=!0,La(e,t,n),un=i,Rl=u;break;case 0:case 11:case 14:case 15:pi(2,n,t),Dn||pi(4,n,t),La(e,t,n);break;case 1:Dn||(na(n,t),i=n.stateNode,typeof i.componentWillUnmount=="function"&&Jm(n,t,i)),La(e,t,n);break;case 21:La(e,t,n);break;case 22:Dn=(i=Dn)||n.memoizedState!==null,La(e,t,n),Dn=i;break;default:La(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{vc(e)}catch(n){Bt(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{vc(e)}catch(n){Bt(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 $u(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(vi(S.type)){un=S.stateNode,Rl=!1;break e}break;case 5:un=S.stateNode,Rl=!1;break e;case 3:case 4:un=S.stateNode.containerInfo,Rl=!0;break e}S=S.return}if(un===null)throw Error(c(160));sg(f,b,u),un=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 As=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&&(pi(3,e,e.return),bo(3,e),pi(5,e,e.return));break;case 1:Dl(t,e),Ol(e),i&512&&(Dn||n===null||na(n,n.return)),i&64&&Oa&&(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=As;if(Dl(t,e),Ol(e),i&512&&(Dn||n===null||na(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[bt]||f[lt]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=u.createElement(i),u.head.insertBefore(f,u.querySelector("head > title"))),nl(f,i,n),f[lt]=e,ht(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),nl(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),nl(f,i,n),u.head.appendChild(f);break;default:throw Error(c(468,i))}f[lt]=e,ht(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&&$d(e,e.memoizedProps,n.memoizedProps)}break;case 27:Dl(t,e),Ol(e),i&512&&(Dn||n===null||na(n,n.return)),n!==null&&i&4&&$d(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Dl(t,e),Ol(e),i&512&&(Dn||n===null||na(n,n.return)),e.flags&32){u=e.stateNode;try{$(u,"")}catch(Oe){Bt(e,e.return,Oe)}}i&4&&e.stateNode!=null&&(u=e.memoizedProps,$d(e,u,n!==null?n.memoizedProps:u)),i&1024&&(Qd=!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(Oe){Bt(e,e.return,Oe)}}break;case 3:if(rf=null,u=As,As=sf(t.containerInfo),Dl(t,e),As=u,Ol(e),i&4&&n!==null&&n.memoizedState.isDehydrated)try{vc(t.containerInfo)}catch(Oe){Bt(e,e.return,Oe)}Qd&&(Qd=!1,cg(e));break;case 4:i=As,As=sf(e.stateNode.containerInfo),Dl(t,e),Ol(e),As=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,$u(e,i)));break;case 13:Dl(t,e),Ol(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Vu=_t()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,$u(e,i)));break;case 22:u=e.memoizedState!==null;var M=n!==null&&n.memoizedState!==null,W=Oa,ie=Dn;if(Oa=W||u,Dn=ie||M,Dl(t,e),Dn=ie,Oa=W,Ol(e),i&8192)e:for(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,u&&(n===null||M||Oa||Dn||mr(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){M=n=t;try{if(f=M.stateNode,u)b=f.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{S=M.stateNode;var he=M.memoizedProps.style,ee=he!=null&&he.hasOwnProperty("display")?he.display:null;S.style.display=ee==null||typeof ee=="boolean"?"":(""+ee).trim()}}catch(Oe){Bt(M,M.return,Oe)}}}else if(t.tag===6){if(n===null){M=t;try{M.stateNode.nodeValue=u?"":M.memoizedProps}catch(Oe){Bt(M,M.return,Oe)}}}else if(t.tag===18){if(n===null){M=t;try{var le=M.stateNode;u?Jg(le,!0):Jg(M.stateNode,!1)}catch(Oe){Bt(M,M.return,Oe)}}}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,$u(e,n))));break;case 19:Dl(t,e),Ol(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,$u(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(Pm(i)){n=i;break}i=i.return}if(n==null)throw Error(c(160));switch(n.tag){case 27:var u=n.stateNode,f=Xd(e);Yu(e,f,u);break;case 5:var b=n.stateNode;n.flags&32&&($(b,""),n.flags&=-33);var S=Xd(e);Yu(e,S,b);break;case 3:case 4:var M=n.stateNode.containerInfo,W=Xd(e);Vd(e,W,M);break;default:throw Error(c(161))}}catch(ie){Bt(e,e.return,ie)}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 za(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)ng(e,t.alternate,t),t=t.sibling}function mr(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:pi(4,t,t.return),mr(t);break;case 1:na(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Jm(t,t.return,n),mr(t);break;case 27:Eo(t.stateNode);case 26:case 5:na(t,t.return),mr(t);break;case 22:t.memoizedState===null&&mr(t);break;case 30:mr(t);break;default:mr(t)}e=e.sibling}}function Ua(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:Ua(u,f,n),bo(4,f);break;case 1:if(Ua(u,f,n),i=f,u=i.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(W){Bt(i,i.return,W)}if(i=f,u=i.updateQueue,u!==null){var S=i.stateNode;try{var M=u.shared.hiddenCallbacks;if(M!==null)for(u.shared.hiddenCallbacks=null,u=0;u<M.length;u++)Rt(M[u],S)}catch(W){Bt(i,i.return,W)}}n&&b&64&&Fm(f),_o(f,f.return);break;case 27:eg(f);case 26:case 5:Ua(u,f,n),n&&i===null&&b&4&&Wm(f),_o(f,f.return);break;case 12:Ua(u,f,n);break;case 31:Ua(u,f,n),n&&b&4&&ag(u,f);break;case 13:Ua(u,f,n),n&&b&4&&ig(u,f);break;case 22:f.memoizedState===null&&Ua(u,f,n),_o(f,f.return);break;case 30:break;default:Ua(u,f,n)}t=t.sibling}}function Kd(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&&ii(n))}function Zd(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ii(e))}function Ms(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:Ms(e,t,n,i),u&2048&&bo(9,t);break;case 1:Ms(e,t,n,i);break;case 3:Ms(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&&ii(e)));break;case 12:if(u&2048){Ms(e,t,n,i),e=t.stateNode;try{var f=t.memoizedProps,b=f.id,S=f.onPostCommit;typeof S=="function"&&S(b,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(M){Bt(t,t.return,M)}}else Ms(e,t,n,i);break;case 31:Ms(e,t,n,i);break;case 13:Ms(e,t,n,i);break;case 23:break;case 22:f=t.stateNode,b=t.alternate,t.memoizedState!==null?f._visibility&2?Ms(e,t,n,i):yo(e,t):f._visibility&2?Ms(e,t,n,i):(f._visibility|=2,uc(e,t,n,i,(t.subtreeFlags&10256)!==0||!1)),u&2048&&Kd(b,t);break;case 24:Ms(e,t,n,i),u&2048&&Zd(t.alternate,t);break;default:Ms(e,t,n,i)}}function uc(e,t,n,i,u){for(u=u&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var f=e,b=t,S=n,M=i,W=b.flags;switch(b.tag){case 0:case 11:case 15:uc(f,b,S,M,u),bo(8,b);break;case 23:break;case 22:var ie=b.stateNode;b.memoizedState!==null?ie._visibility&2?uc(f,b,S,M,u):yo(f,b):(ie._visibility|=2,uc(f,b,S,M,u)),u&&W&2048&&Kd(b.alternate,b);break;case 24:uc(f,b,S,M,u),u&&W&2048&&Zd(b.alternate,b);break;default:uc(f,b,S,M,u)}t=t.sibling}}function yo(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:yo(n,i),u&2048&&Kd(i.alternate,i);break;case 24:yo(n,i),u&2048&&Zd(i.alternate,i);break;default:yo(n,i)}t=t.sibling}}var vo=8192;function fc(e,t,n){if(e.subtreeFlags&vo)for(e=e.child;e!==null;)ug(e,t,n),e=e.sibling}function ug(e,t,n){switch(e.tag){case 26:fc(e,t,n),e.flags&vo&&e.memoizedState!==null&&r0(n,As,e.memoizedState,e.memoizedProps);break;case 5:fc(e,t,n);break;case 3:case 4:var i=As;As=sf(e.stateNode.containerInfo),fc(e,t,n),As=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=vo,vo=16777216,fc(e,t,n),vo=i):fc(e,t,n));break;default:fc(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 jo(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];Qn=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:jo(e),e.flags&2048&&pi(9,e,e.return);break;case 3:jo(e);break;case 12:jo(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Xu(e)):jo(e);break;default:jo(e)}}function Xu(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];Qn=i,hg(i,e)}fg(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:pi(8,t,t.return),Xu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Xu(t));break;default:Xu(t)}e=e.sibling}}function hg(e,t){for(;Qn!==null;){var n=Qn;switch(n.tag){case 0:case 11:case 15:pi(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:ii(n.memoizedState.cache)}if(i=n.child,i!==null)i.return=n,Qn=i;else e:for(n=e;Qn!==null;){i=Qn;var u=i.sibling,f=i.return;if(lg(i),i===n){Qn=null;break e}if(u!==null){u.return=f,Qn=u;break e}Qn=f}}}var jy={getCacheForType:function(e){var t=Gn(hn),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Gn(hn).controller.signal}},Sy=typeof WeakMap=="function"?WeakMap:Map,Ct=0,Kt=null,ut=null,pt=0,Ht=0,Gl=null,mi=!1,dc=!1,Fd=!1,Ha=0,_n=0,gi=0,gr=0,Jd=0,Yl=0,hc=0,So=null,Ll=null,Wd=!1,Vu=0,pg=0,Qu=1/0,Ku=null,xi=null,Yn=0,bi=null,pc=null,Ba=0,Pd=0,eh=null,mg=null,wo=0,th=null;function $l(){return(Ct&2)!==0&&pt!==0?pt&-pt:V.T!==null?rh():cs()}function gg(){if(Yl===0)if((pt&536870912)===0||ct){var e=Ke;Ke<<=1,(Ke&3932160)===0&&(Ke=262144),Yl=e}else Yl=536870912;return e=Il.current,e!==null&&(e.flags|=32),Yl}function zl(e,t,n){(e===Kt&&(Ht===2||Ht===9)||e.cancelPendingCommit!==null)&&(mc(e,0),_i(e,pt,Yl,!1)),Hn(e,n),((Ct&2)===0||e!==Kt)&&(e===Kt&&((Ct&2)===0&&(gr|=n),_n===4&&_i(e,pt,Yl,!1)),la(e))}function xg(e,t,n){if((Ct&6)!==0)throw Error(c(327));var i=!n&&(t&127)===0&&(t&e.expiredLanes)===0||we(e,t),u=i?Ny(e,t):lh(e,t,!0),f=i;do{if(u===0){dc&&!i&&_i(e,t,0,!1);break}else{if(n=e.current.alternate,f&&!wy(n)){u=lh(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=So;var M=S.current.memoizedState.isDehydrated;if(M&&(mc(S,b).flags|=256),b=lh(S,b,!1),b!==2){if(Fd&&!M){S.errorRecoveryDisabledLanes|=f,gr|=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){mc(e,0),_i(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:_i(i,t,Yl,!mi);break e;case 2:Ll=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(u=Vu+300-_t(),10<u)){if(_i(i,t,Yl,!mi),ae(i,0,!0)!==0)break e;Ba=t,i.timeoutHandle=Kg(bg.bind(null,i,n,Ll,Ku,Wd,t,Yl,gr,hc,mi,f,"Throttled",-0,0),u);break e}bg(i,n,Ll,Ku,Wd,t,Yl,gr,hc,mi,f,null,-0,0)}}break}while(!0);la(e)}function bg(e,t,n,i,u,f,b,S,M,W,ie,he,ee,le){if(e.timeoutHandle=-1,he=t.subtreeFlags,he&8192||(he&16785408)===16785408){he={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:st},ug(t,f,he);var Oe=(f&62914560)===f?Vu-_t():(f&4194048)===f?pg-_t():0;if(Oe=c0(he,Oe),Oe!==null){Ba=f,e.cancelPendingCommit=Oe(Ng.bind(null,e,t,f,n,i,u,b,S,M,ie,he,null,ee,le)),_i(e,f,b,!W);return}}Ng(e,t,f,n,i,u,b,S,M)}function wy(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(!An(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 _i(e,t,n,i){t&=~Jd,t&=~gr,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var u=t;0<u;){var f=31-wt(u),b=1<<f;i[f]=-1,u&=~b}n!==0&&pl(e,n,t)}function Zu(){return(Ct&6)===0?(ko(0),!1):!0}function nh(){if(ut!==null){if(Ht===0)var e=ut.return;else e=ut,ks=wa=null,bd(e),ta=null,fr=0,e=ut;for(;e!==null;)Zm(e.alternate,e),e=e.return;ut=null}}function mc(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,$y(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Ba=0,nh(),Kt=e,ut=n=Ss(e.current,null),pt=t,Ht=0,Gl=null,mi=!1,dc=we(e,t),Fd=!1,hc=Yl=Jd=gr=gi=_n=0,Ll=So=null,Wd=!1,(t&8)!==0&&(t|=t&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=t;0<i;){var u=31-wt(i),f=1<<u;t|=e[u],i&=~f}return Ha=t,nr(),n}function _g(e,t){Pe=null,V.H=mo,t===ci||t===ur?(t=Tu(),Ht=3):t===ac?(t=Tu(),Ht=4):Ht=t===Od?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Gl=t,ut===null&&(_n=1,Hu(e,El(t,e.current)))}function yg(){var e=Il.current;return e===null?!0:(pt&4194048)===pt?Pl===null:(pt&62914560)===pt||(pt&536870912)!==0?e===Pl:!1}function vg(){var e=V.H;return V.H=mo,e===null?mo:e}function jg(){var e=V.A;return V.A=jy,e}function Fu(){_n=4,mi||(pt&4194048)!==pt&&Il.current!==null||(dc=!0),(gi&134217727)===0&&(gr&134217727)===0||Kt===null||_i(Kt,pt,Yl,!1)}function lh(e,t,n){var i=Ct;Ct|=2;var u=vg(),f=jg();(Kt!==e||pt!==t)&&(Ku=null,mc(e,t)),t=!1;var b=_n;e:do try{if(Ht!==0&&ut!==null){var S=ut,M=Gl;switch(Ht){case 8:nh(),b=6;break e;case 3:case 2:case 9:case 6:Il.current===null&&(t=!0);var W=Ht;if(Ht=0,Gl=null,gc(e,S,M,W),n&&dc){b=0;break e}break;default:W=Ht,Ht=0,Gl=null,gc(e,S,M,W)}}ky(),b=_n;break}catch(ie){_g(e,ie)}while(!0);return t&&e.shellSuspendCounter++,ks=wa=null,Ct=i,V.H=u,V.A=f,ut===null&&(Kt=null,pt=0,nr()),b}function ky(){for(;ut!==null;)Sg(ut)}function Ny(e,t){var n=Ct;Ct|=2;var i=vg(),u=jg();Kt!==e||pt!==t?(Ku=null,Qu=_t()+500,mc(e,t)):dc=we(e,t);e:do try{if(Ht!==0&&ut!==null){t=ut;var f=Gl;t:switch(Ht){case 1:Ht=0,Gl=null,gc(e,t,f,1);break;case 2:case 9:if(ku(f)){Ht=0,Gl=null,wg(t);break}t=function(){Ht!==2&&Ht!==9||Kt!==e||(Ht=7),la(e)},f.then(t,t);break e;case 3:Ht=7;break e;case 4:Ht=5;break e;case 7:ku(f)?(Ht=0,Gl=null,wg(t)):(Ht=0,Gl=null,gc(e,t,f,7));break;case 5:var b=null;switch(ut.tag){case 26:b=ut.memoizedState;case 5:case 27:var S=ut;if(b?ox(b):S.stateNode.complete){Ht=0,Gl=null;var M=S.sibling;if(M!==null)ut=M;else{var W=S.return;W!==null?(ut=W,Ju(W)):ut=null}break t}}Ht=0,Gl=null,gc(e,t,f,5);break;case 6:Ht=0,Gl=null,gc(e,t,f,6);break;case 8:nh(),_n=6;break e;default:throw Error(c(462))}}Ty();break}catch(ie){_g(e,ie)}while(!0);return ks=wa=null,V.H=i,V.A=u,Ct=n,ut!==null?0:(Kt=null,pt=0,nr(),_n)}function Ty(){for(;ut!==null&&!Un();)Sg(ut)}function Sg(e){var t=Qm(e.alternate,e,Ha);e.memoizedProps=e.pendingProps,t===null?Ju(e):ut=t}function wg(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=qm(n,t,t.pendingProps,t.type,void 0,pt);break;case 11:t=qm(n,t,t.pendingProps,t.type.render,t.ref,pt);break;case 5:bd(t);default:Zm(n,t),t=ut=lo(t,Ha),t=Qm(n,t,Ha)}e.memoizedProps=e.pendingProps,t===null?Ju(e):ut=t}function gc(e,t,n,i){ks=wa=null,bd(t),ta=null,fr=0;var u=t.return;try{if(my(e,u,t,n,pt)){_n=1,Hu(e,El(n,e.current)),ut=null;return}}catch(f){if(u!==null)throw ut=u,f;_n=1,Hu(e,El(n,e.current)),ut=null;return}t.flags&32768?(ct||i===1?e=!0:dc||(pt&536870912)!==0?e=!1:(mi=e=!0,(i===2||i===9||i===3||i===6)&&(i=Il.current,i!==null&&i.tag===13&&(i.flags|=16384))),kg(t,e)):Ju(t)}function Ju(e){var t=e;do{if((t.flags&32768)!==0){kg(t,mi);return}e=t.return;var n=by(t.alternate,t,Ha);if(n!==null){ut=n;return}if(t=t.sibling,t!==null){ut=t;return}ut=t=e}while(t!==null);_n===0&&(_n=5)}function kg(e,t){do{var n=_y(e.alternate,e);if(n!==null){n.flags&=32767,ut=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){ut=e;return}ut=e=n}while(e!==null);_n=6,ut=null}function Ng(e,t,n,i,u,f,b,S,M){e.cancelPendingCommit=null;do Wu();while(Yn!==0);if((Ct&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));if(f=t.lanes|t.childLanes,f|=Kr,wl(e,n,f,b,S,M),e===Kt&&(ut=Kt=null,pt=0),pc=t,bi=e,Ba=n,Pd=f,eh=u,mg=i,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,My(xt,function(){return Mg(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||i){i=V.T,V.T=null,u=pe.p,pe.p=2,b=Ct,Ct|=4;try{yy(e,t,n)}finally{Ct=b,pe.p=u,V.T=i}}Yn=1,Tg(),Eg(),Cg()}}function Tg(){if(Yn===1){Yn=0;var e=bi,t=pc,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=V.T,V.T=null;var i=pe.p;pe.p=2;var u=Ct;Ct|=4;try{rg(t,e);var f=mh,b=du(e.containerInfo),S=f.focusedElem,M=f.selectionRange;if(b!==S&&S&&S.ownerDocument&&fu(S.ownerDocument.documentElement,S)){if(M!==null&&Fs(S)){var W=M.start,ie=M.end;if(ie===void 0&&(ie=W),"selectionStart"in S)S.selectionStart=W,S.selectionEnd=Math.min(ie,S.value.length);else{var he=S.ownerDocument||document,ee=he&&he.defaultView||window;if(ee.getSelection){var le=ee.getSelection(),Oe=S.textContent.length,Ye=Math.min(M.start,Oe),Gt=M.end===void 0?Ye:Math.min(M.end,Oe);!le.extend&&Ye>Gt&&(b=Gt,Gt=Ye,Ye=b);var q=uu(S,Ye),O=uu(S,Gt);if(q&&O&&(le.rangeCount!==1||le.anchorNode!==q.node||le.anchorOffset!==q.offset||le.focusNode!==O.node||le.focusOffset!==O.offset)){var F=he.createRange();F.setStart(q.node,q.offset),le.removeAllRanges(),Ye>Gt?(le.addRange(F),le.extend(O.node,O.offset)):(F.setEnd(O.node,O.offset),le.addRange(F))}}}}for(he=[],le=S;le=le.parentNode;)le.nodeType===1&&he.push({element:le,left:le.scrollLeft,top:le.scrollTop});for(typeof S.focus=="function"&&S.focus(),S=0;S<he.length;S++){var oe=he[S];oe.element.scrollLeft=oe.left,oe.element.scrollTop=oe.top}}ff=!!ph,mh=ph=null}finally{Ct=u,pe.p=i,V.T=n}}e.current=t,Yn=2}}function Eg(){if(Yn===2){Yn=0;var e=bi,t=pc,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=V.T,V.T=null;var i=pe.p;pe.p=2;var u=Ct;Ct|=4;try{ng(e,t.alternate,t)}finally{Ct=u,pe.p=i,V.T=n}}Yn=3}}function Cg(){if(Yn===4||Yn===3){Yn=0,St();var e=bi,t=pc,n=Ba,i=mg;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Yn=5:(Yn=0,pc=bi=null,Ag(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(xi=null),rs(n),t=t.stateNode,zt&&typeof zt.onCommitFiberRoot=="function")try{zt.onCommitFiberRoot(an,t,void 0,(t.current.flags&128)===128)}catch{}if(i!==null){t=V.T,u=pe.p,pe.p=2,V.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{V.T=t,pe.p=u}}(Ba&3)!==0&&Wu(),la(e),u=e.pendingLanes,(n&261930)!==0&&(u&42)!==0?e===th?wo++:(wo=0,th=e):wo=0,ko(0)}}function Ag(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ii(t)))}function Wu(){return Tg(),Eg(),Cg(),Mg()}function Mg(){if(Yn!==5)return!1;var e=bi,t=Pd;Pd=0;var n=rs(Ba),i=V.T,u=pe.p;try{pe.p=32>n?32:n,V.T=null,n=eh,eh=null;var f=bi,b=Ba;if(Yn=0,pc=bi=null,Ba=0,(Ct&6)!==0)throw Error(c(331));var S=Ct;if(Ct|=4,dg(f.current),og(f,f.current,b,n),Ct=S,ko(0,!1),zt&&typeof zt.onPostCommitFiberRoot=="function")try{zt.onPostCommitFiberRoot(an,f)}catch{}return!0}finally{pe.p=u,V.T=i,Ag(e,t)}}function Rg(e,t,n){t=El(n,t),t=Dd(e.stateNode,t,2),e=Cs(e,t,2),e!==null&&(Hn(e,2),la(e))}function Bt(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"&&(xi===null||!xi.has(i))){e=El(n,e),n=Dm(2),i=Cs(t,n,2),i!==null&&(Om(n,i,t,e),Hn(i,2),la(i));break}}t=t.return}}function sh(e,t,n){var i=e.pingCache;if(i===null){i=e.pingCache=new Sy;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)||(Fd=!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,Kt===e&&(pt&n)===n&&(_n===4||_n===3&&(pt&62914560)===pt&&300>_t()-Vu?(Ct&2)===0&&mc(e,0):Jd|=n,hc===pt&&(hc=0)),la(e)}function Dg(e,t){t===0&&(t=at()),e=js(e,t),e!==null&&(Hn(e,t),la(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 $t(e,t)}var Pu=null,xc=null,ah=!1,ef=!1,ih=!1,yi=0;function la(e){e!==xc&&e.next===null&&(xc===null?Pu=xc=e:xc=xc.next=e),ef=!0,ah||(ah=!0,Dy())}function ko(e,t){if(!ih&&ef){ih=!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-wt(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=pt,f=ae(i,i===Kt?f:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(f&3)===0||we(i,f)||(n=!0,Ug(i,f));i=i.next}while(n);ih=!1}}function Ry(){Og()}function Og(){ef=ah=!1;var e=0;yi!==0&&Yy()&&(e=yi);for(var t=_t(),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&&(xc=n)):(n=i,(e!==0||(f&3)!==0)&&(ef=!0)),i=u}Yn!==0&&Yn!==5||ko(e),yi!==0&&(yi=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-wt(f),S=1<<b,M=u[b];M===-1?((S&n)===0||(S&i)!==0)&&(u[b]=qe(S,t)):M<=t&&(e.expiredLanes|=S),f&=~S}if(t=Kt,n=pt,n=ae(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,n===0||e===t&&(Ht===2||Ht===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&zn(i),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||we(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(i!==null&&zn(i),rs(n)){case 2:case 8:n=sn;break;case 32:n=xt;break;case 268435456:n=mn;break;default:n=xt}return i=zg.bind(null,e),n=$t(n,i),e.callbackPriority=t,e.callbackNode=n,t}return i!==null&&i!==null&&zn(i),e.callbackPriority=2,e.callbackNode=null,2}function zg(e,t){if(Yn!==0&&Yn!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Wu()&&e.callbackNode!==n)return null;var i=pt;return i=ae(e,e===Kt?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(xg(e,i,t),Lg(e,_t()),e.callbackNode!=null&&e.callbackNode===n?zg.bind(null,e):null)}function Ug(e,t){if(Wu())return null;xg(e,t,!0)}function Dy(){Xy(function(){(Ct&6)!==0?$t(Lt,Ry):Og()})}function rh(){if(yi===0){var e=Na;e===0&&(e=He,He<<=1,(He&261888)===0&&(He=256)),yi=e}return yi}function Hg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Vt(""+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[Qe]||null).action),b=i.submitter;b&&(t=(t=b[Qe]||null)?Hg(t.formAction):b.getAttribute("formAction"),t!==null&&(f=t,b=null));var S=new Bi("action","action",null,i,u);e.push({event:S,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(yi!==0){var M=b?Bg(u,b):new FormData(u);Td(n,{pending:!0,data:M,method:u.method,action:f},null,M)}}else typeof f=="function"&&(S.preventDefault(),M=b?Bg(u,b):new FormData(u),Td(n,{pending:!0,data:M,method:u.method,action:f},f,M))},currentTarget:u}]})}}for(var ch=0;ch<Qr.length;ch++){var oh=Qr[ch],Ly=oh.toLowerCase(),zy=oh[0].toUpperCase()+oh.slice(1);Tl(Ly,"on"+zy)}Tl(pu,"onAnimationEnd"),Tl($r,"onAnimationIteration"),Tl(mu,"onAnimationStart"),Tl("dblclick","onDoubleClick"),Tl("focusin","onFocus"),Tl("focusout","onBlur"),Tl(cd,"onTransitionRun"),Tl(Xr,"onTransitionStart"),Tl(od,"onTransitionCancel"),Tl(no,"onTransitionEnd"),Tn("onMouseEnter",["mouseout","mouseover"]),Tn("onMouseLeave",["mouseout","mouseover"]),Tn("onPointerEnter",["pointerout","pointerover"]),Tn("onPointerLeave",["pointerout","pointerover"]),Xt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Xt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Xt("onBeforeInput",["compositionend","keypress","textInput","paste"]),Xt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Xt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Xt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var No="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(No));function Ig(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var i=e[n],u=i.event;i=i.listeners;e:{var f=void 0;if(t)for(var b=i.length-1;0<=b;b--){var S=i[b],M=S.instance,W=S.currentTarget;if(S=S.listener,M!==f&&u.isPropagationStopped())break e;f=S,u.currentTarget=W;try{f(u)}catch(ie){tr(ie)}u.currentTarget=null,f=M}else for(b=0;b<i.length;b++){if(S=i[b],M=S.instance,W=S.currentTarget,S=S.listener,M!==f&&u.isPropagationStopped())break e;f=S,u.currentTarget=W;try{f(u)}catch(ie){tr(ie)}u.currentTarget=null,f=M}}}}function ft(e,t){var n=t[kl];n===void 0&&(n=t[kl]=new Set);var i=e+"__bubble";n.has(i)||(qg(t,e,2,!1),n.add(i))}function uh(e,t,n){var i=0;t&&(i|=4),qg(n,e,i,t)}var tf="_reactListening"+Math.random().toString(36).slice(2);function fh(e){if(!e[tf]){e[tf]=!0,rl.forEach(function(n){n!=="selectionchange"&&(Uy.has(n)||uh(n,!1,e),uh(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[tf]||(t[tf]=!0,uh("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=Nh}n=u.bind(null,t,n,e),u=void 0,!el||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 dh(e,t,n,i,u){var f=i;if((t&1)===0&&(t&2)===0&&i!==null)e:for(;;){if(i===null)return;var b=i.tag;if(b===3||b===4){var S=i.stateNode.containerInfo;if(S===u)break;if(b===4)for(b=i.return;b!==null;){var M=b.tag;if((M===3||M===4)&&b.stateNode.containerInfo===u)return;b=b.return}for(;S!==null;){if(b=Ve(S),b===null)return;if(M=b.tag,M===5||M===6||M===26||M===27){i=f=b;continue e}S=S.parentNode}}i=i.return}ce(function(){var W=f,ie=Mt(n),he=[];e:{var ee=Vr.get(e);if(ee!==void 0){var le=Bi,Oe=e;switch(e){case"keypress":if($s(n)===0)break e;case"keydown":case"keyup":le=qr;break;case"focusin":Oe="focus",le=Gi;break;case"focusout":Oe="blur",le=Gi;break;case"beforeblur":case"afterblur":le=Gi;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":le=qi;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":le=zr;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":le=on;break;case pu:case $r:case mu:le=xa;break;case no:le=sd;break;case"scroll":case"scrollend":le=Xa;break;case"wheel":le=Zc;break;case"copy":case"cut":case"paste":le=Qc;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":le=Qs;break;case"toggle":case"beforetoggle":le=En}var Ye=(t&4)!==0,Gt=!Ye&&(e==="scroll"||e==="scrollend"),q=Ye?ee!==null?ee+"Capture":null:ee;Ye=[];for(var O=W,F;O!==null;){var oe=O;if(F=oe.stateNode,oe=oe.tag,oe!==5&&oe!==26&&oe!==27||F===null||q===null||(oe=Ce(O,q),oe!=null&&Ye.push(To(O,oe,F))),Gt)break;O=O.return}0<Ye.length&&(ee=new le(ee,Oe,null,n,ie),he.push({event:ee,listeners:Ye}))}}if((t&7)===0){e:{if(ee=e==="mouseover"||e==="pointerover",le=e==="mouseout"||e==="pointerout",ee&&n!==dn&&(Oe=n.relatedTarget||n.fromElement)&&(Ve(Oe)||Oe[fn]))break e;if((le||ee)&&(ee=ie.window===ie?ie:(ee=ie.ownerDocument)?ee.defaultView||ee.parentWindow:window,le?(Oe=n.relatedTarget||n.toElement,le=W,Oe=Oe?Ve(Oe):null,Oe!==null&&(Gt=d(Oe),Ye=Oe.tag,Oe!==Gt||Ye!==5&&Ye!==27&&Ye!==6)&&(Oe=null)):(le=null,Oe=W),le!==Oe)){if(Ye=qi,oe="onMouseLeave",q="onMouseEnter",O="mouse",(e==="pointerout"||e==="pointerover")&&(Ye=Qs,oe="onPointerLeave",q="onPointerEnter",O="pointer"),Gt=le==null?ee:Pt(le),F=Oe==null?ee:Pt(Oe),ee=new Ye(oe,O+"leave",le,n,ie),ee.target=Gt,ee.relatedTarget=F,oe=null,Ve(ie)===W&&(Ye=new Ye(q,O+"enter",Oe,n,ie),Ye.target=F,Ye.relatedTarget=Gt,oe=Ye),Gt=oe,le&&Oe)t:{for(Ye=Hy,q=le,O=Oe,F=0,oe=q;oe;oe=Ye(oe))F++;oe=0;for(var Ie=O;Ie;Ie=Ye(Ie))oe++;for(;0<F-oe;)q=Ye(q),F--;for(;0<oe-F;)O=Ye(O),oe--;for(;F--;){if(q===O||O!==null&&q===O.alternate){Ye=q;break t}q=Ye(q),O=Ye(O)}Ye=null}else Ye=null;le!==null&&Gg(he,ee,le,Ye,!1),Oe!==null&&Gt!==null&&Gg(he,Gt,Oe,Ye,!0)}}e:{if(ee=W?Pt(W):window,le=ee.nodeName&&ee.nodeName.toLowerCase(),le==="select"||le==="input"&&ee.type==="file")var kt=su;else if(Za(ee))if(ne)kt=cu;else{kt=Wi;var ze=Ji}else le=ee.nodeName,!le||le.toLowerCase()!=="input"||ee.type!=="checkbox"&&ee.type!=="radio"?W&&Ee(W.elementType)&&(kt=su):kt=ru;if(kt&&(kt=kt(e,W))){Zi(he,kt,n,ie);break e}ze&&ze(e,ee,W),e==="focusout"&&W&&ee.type==="number"&&W.memoizedProps.value!=null&&gl(ee,"number",ee.value)}switch(ze=W?Pt(W):window,e){case"focusin":(Za(ze)||ze.contentEditable==="true")&&(Fa=ze,Pc=W,er=null);break;case"focusout":er=Pc=Fa=null;break;case"mousedown":eo=!0;break;case"contextmenu":case"mouseup":case"dragend":eo=!1,hu(he,n,ie);break;case"selectionchange":if(rd)break;case"keydown":case"keyup":hu(he,n,ie)}var tt;if(ba)e:{switch(e){case"compositionstart":var mt="onCompositionStart";break e;case"compositionend":mt="onCompositionEnd";break e;case"compositionupdate":mt="onCompositionUpdate";break e}mt=void 0}else _s?Wc(e,n)&&(mt="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(mt="onCompositionStart");mt&&(Fc&&n.locale!=="ko"&&(_s||mt!=="onCompositionStart"?mt==="onCompositionEnd"&&_s&&(tt=Ys()):(ms=ie,$a="value"in ms?ms.value:ms.textContent,_s=!0)),ze=nf(W,mt),0<ze.length&&(mt=new Vs(mt,e,null,n,ie),he.push({event:mt,listeners:ze}),tt?mt.data=tt:(tt=Qi(n),tt!==null&&(mt.data=tt)))),(tt=Cn?Ki(e,n):_a(e,n))&&(mt=nf(W,"onBeforeInput"),0<mt.length&&(ze=new Vs("onBeforeInput","beforeinput",null,n,ie),he.push({event:ze,listeners:mt}),ze.data=tt)),Oy(he,e,W,n,ie)}Ig(he,t)})}function To(e,t,n){return{instance:e,listener:t,currentTarget:n}}function nf(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=Ce(e,n),u!=null&&i.unshift(To(e,u,f)),u=Ce(e,t),u!=null&&i.push(To(e,u,f))),e.tag===3)return i;e=e.return}return[]}function Hy(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Gg(e,t,n,i,u){for(var f=t._reactName,b=[];n!==null&&n!==i;){var S=n,M=S.alternate,W=S.stateNode;if(S=S.tag,M!==null&&M===i)break;S!==5&&S!==26&&S!==27||W===null||(M=W,u?(W=Ce(n,f),W!=null&&b.unshift(To(n,W,M))):u||(W=Ce(n,f),W!=null&&b.push(To(n,W,M)))),n=n.return}b.length!==0&&e.push({event:t,listeners:b})}var By=/\r\n?/g,Iy=/\u0000|\uFFFD/g;function Yg(e){return(typeof e=="string"?e:""+e).replace(By,`
50
- `).replace(Iy,"")}function $g(e,t){return t=Yg(t),Yg(e)===t}function qt(e,t,n,i,u,f){switch(n){case"children":typeof i=="string"?t==="body"||t==="textarea"&&i===""||$(e,i):(typeof i=="number"||typeof i=="bigint")&&t!=="body"&&$(e,""+i);break;case"className":$n(e,"class",i);break;case"tabIndex":$n(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":$n(e,n,i);break;case"style":Le(e,i,f);break;case"data":if(t!=="object"){$n(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=Vt(""+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"&&qt(e,t,"name",u.name,u,null),qt(e,t,"formEncType",u.formEncType,u,null),qt(e,t,"formMethod",u.formMethod,u,null),qt(e,t,"formTarget",u.formTarget,u,null)):(qt(e,t,"encType",u.encType,u,null),qt(e,t,"method",u.method,u,null),qt(e,t,"target",u.target,u,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(n);break}i=Vt(""+i),e.setAttribute(n,i);break;case"onClick":i!=null&&(e.onclick=st);break;case"onScroll":i!=null&&ft("scroll",e);break;case"onScrollEnd":i!=null&&ft("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=Vt(""+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":ft("beforetoggle",e),ft("toggle",e),Bl(e,"popover",i);break;case"xlinkActuate":yn(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":yn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":yn(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":yn(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":yn(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":yn(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":yn(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":yn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":yn(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":Bl(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=Et.get(n)||n,Bl(e,n,i))}}function hh(e,t,n,i,u,f){switch(n){case"style":Le(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"?$(e,i):(typeof i=="number"||typeof i=="bigint")&&$(e,""+i);break;case"onScroll":i!=null&&ft("scroll",e);break;case"onScrollEnd":i!=null&&ft("scrollend",e);break;case"onClick":i!=null&&(e.onclick=st);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!cl.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[Qe]||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,""):Bl(e,n,i)}}}function nl(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ft("error",e),ft("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:qt(e,t,f,b,n,null)}}u&&qt(e,t,"srcSet",n.srcSet,n,null),i&&qt(e,t,"src",n.src,n,null);return;case"input":ft("invalid",e);var S=f=b=u=null,M=null,W=null;for(i in n)if(n.hasOwnProperty(i)){var ie=n[i];if(ie!=null)switch(i){case"name":u=ie;break;case"type":b=ie;break;case"checked":M=ie;break;case"defaultChecked":W=ie;break;case"value":f=ie;break;case"defaultValue":S=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(c(137,t));break;default:qt(e,t,i,ie,n,null)}}hs(e,f,S,M,W,b,u,!1);return;case"select":ft("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:qt(e,t,u,S,n,null)}t=f,n=b,e.multiple=!!i,t!=null?Nl(e,!!i,t,!1):n!=null&&Nl(e,!!i,n,!0);return;case"textarea":ft("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:qt(e,t,b,S,n,null)}T(e,i,u,f);return;case"option":for(M in n)if(n.hasOwnProperty(M)&&(i=n[M],i!=null))switch(M){case"selected":e.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:qt(e,t,M,i,n,null)}return;case"dialog":ft("beforetoggle",e),ft("toggle",e),ft("cancel",e),ft("close",e);break;case"iframe":case"object":ft("load",e);break;case"video":case"audio":for(i=0;i<No.length;i++)ft(No[i],e);break;case"image":ft("error",e),ft("load",e);break;case"details":ft("toggle",e);break;case"embed":case"source":case"link":ft("error",e),ft("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:qt(e,t,W,i,n,null)}return;default:if(Ee(t)){for(ie in n)n.hasOwnProperty(ie)&&(i=n[ie],i!==void 0&&hh(e,t,ie,i,n,void 0));return}}for(S in n)n.hasOwnProperty(S)&&(i=n[S],i!=null&&qt(e,t,S,i,n,null))}function qy(e,t,n,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,f=null,b=null,S=null,M=null,W=null,ie=null;for(le in n){var he=n[le];if(n.hasOwnProperty(le)&&he!=null)switch(le){case"checked":break;case"value":break;case"defaultValue":M=he;default:i.hasOwnProperty(le)||qt(e,t,le,null,i,he)}}for(var ee in i){var le=i[ee];if(he=n[ee],i.hasOwnProperty(ee)&&(le!=null||he!=null))switch(ee){case"type":f=le;break;case"name":u=le;break;case"checked":W=le;break;case"defaultChecked":ie=le;break;case"value":b=le;break;case"defaultValue":S=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(c(137,t));break;default:le!==he&&qt(e,t,ee,le,i,he)}}ga(e,b,S,M,W,ie,f,u);return;case"select":le=b=S=ee=null;for(f in n)if(M=n[f],n.hasOwnProperty(f)&&M!=null)switch(f){case"value":break;case"multiple":le=M;default:i.hasOwnProperty(f)||qt(e,t,f,null,i,M)}for(u in i)if(f=i[u],M=n[u],i.hasOwnProperty(u)&&(f!=null||M!=null))switch(u){case"value":ee=f;break;case"defaultValue":S=f;break;case"multiple":b=f;default:f!==M&&qt(e,t,u,f,i,M)}t=S,n=b,i=le,ee!=null?Nl(e,!!n,ee,!1):!!i!=!!n&&(t!=null?Nl(e,!!n,t,!0):Nl(e,!!n,n?[]:"",!1));return;case"textarea":le=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:qt(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":le=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(c(91));break;default:u!==f&&qt(e,t,b,u,i,f)}me(e,ee,le);return;case"option":for(var Oe in n)if(ee=n[Oe],n.hasOwnProperty(Oe)&&ee!=null&&!i.hasOwnProperty(Oe))switch(Oe){case"selected":e.selected=!1;break;default:qt(e,t,Oe,null,i,ee)}for(M in i)if(ee=i[M],le=n[M],i.hasOwnProperty(M)&&ee!==le&&(ee!=null||le!=null))switch(M){case"selected":e.selected=ee&&typeof ee!="function"&&typeof ee!="symbol";break;default:qt(e,t,M,ee,i,le)}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 Ye in n)ee=n[Ye],n.hasOwnProperty(Ye)&&ee!=null&&!i.hasOwnProperty(Ye)&&qt(e,t,Ye,null,i,ee);for(W in i)if(ee=i[W],le=n[W],i.hasOwnProperty(W)&&ee!==le&&(ee!=null||le!=null))switch(W){case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(c(137,t));break;default:qt(e,t,W,ee,i,le)}return;default:if(Ee(t)){for(var Gt in n)ee=n[Gt],n.hasOwnProperty(Gt)&&ee!==void 0&&!i.hasOwnProperty(Gt)&&hh(e,t,Gt,void 0,i,ee);for(ie in i)ee=i[ie],le=n[ie],!i.hasOwnProperty(ie)||ee===le||ee===void 0&&le===void 0||hh(e,t,ie,ee,i,le);return}}for(var q in n)ee=n[q],n.hasOwnProperty(q)&&ee!=null&&!i.hasOwnProperty(q)&&qt(e,t,q,null,i,ee);for(he in i)ee=i[he],le=n[he],!i.hasOwnProperty(he)||ee===le||ee==null&&le==null||qt(e,t,he,ee,i,le)}function Xg(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Gy(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),i=0;i<n.length;i++){var u=n[i],f=u.transferSize,b=u.initiatorType,S=u.duration;if(f&&S&&Xg(b)){for(b=0,S=u.responseEnd,i+=1;i<n.length;i++){var M=n[i],W=M.startTime;if(W>S)break;var ie=M.transferSize,he=M.initiatorType;ie&&Xg(he)&&(M=M.responseEnd,b+=ie*(M<S?1:(S-W)/(M-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 ph=null,mh=null;function lf(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 gh(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 xh=null;function Yy(){var e=window.event;return e&&e.type==="popstate"?e===xh?!1:(xh=e,!0):(xh=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 vi(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),vc(t);return}i--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")i++;else if(n==="html")Eo(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Eo(n);for(var f=n.firstChild;f;){var b=f.nextSibling,S=f.nodeName;f[bt]||S==="SCRIPT"||S==="STYLE"||S==="LINK"&&f.rel.toLowerCase()==="stylesheet"||n.removeChild(f),f=b}}else n==="body"&&Eo(e.ownerDocument.body);n=u}while(n);vc(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 bh(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":bh(n),us(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[bt])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=es(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=es(e.nextSibling),e===null))return null;return e}function Wg(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=es(e.nextSibling),e===null))return null;return e}function _h(e){return e.data==="$?"||e.data==="$~"}function yh(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 es(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 vh=null;function Pg(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return es(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=lf(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 Eo(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);us(e)}var ts=new Map,nx=new Set;function sf(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ia=pe.d;pe.d={f:Fy,r:Jy,D:Wy,C:Py,L:e0,m:t0,X:l0,S:n0,M:s0};function Fy(){var e=Ia.f(),t=Zu();return e||t}function Jy(e){var t=ml(e);t!==null&&t.tag===5&&t.type==="form"?_m(t):Ia.r(e)}var bc=typeof document>"u"?null:document;function lx(e,t,n){var i=bc;if(i&&typeof t=="string"&&t){var u=Xn(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof n=="string"&&(u+='[crossorigin="'+n+'"]'),nx.has(u)||(nx.add(u),e={rel:e,crossOrigin:n,href:t},i.querySelector(u)===null&&(t=i.createElement("link"),nl(t,"link",e),ht(t),i.head.appendChild(t)))}}function Wy(e){Ia.D(e),lx("dns-prefetch",e,null)}function Py(e,t){Ia.C(e,t),lx("preconnect",e,t)}function e0(e,t,n){Ia.L(e,t,n);var i=bc;if(i&&e&&t){var u='link[rel="preload"][as="'+Xn(t)+'"]';t==="image"&&n&&n.imageSrcSet?(u+='[imagesrcset="'+Xn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(u+='[imagesizes="'+Xn(n.imageSizes)+'"]')):u+='[href="'+Xn(e)+'"]';var f=u;switch(t){case"style":f=_c(e);break;case"script":f=yc(e)}ts.has(f)||(e=j({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),ts.set(f,e),i.querySelector(u)!==null||t==="style"&&i.querySelector(Co(f))||t==="script"&&i.querySelector(Ao(f))||(t=i.createElement("link"),nl(t,"link",e),ht(t),i.head.appendChild(t)))}}function t0(e,t){Ia.m(e,t);var n=bc;if(n&&e){var i=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+Xn(i)+'"][href="'+Xn(e)+'"]',f=u;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=yc(e)}if(!ts.has(f)&&(e=j({rel:"modulepreload",href:e},t),ts.set(f,e),n.querySelector(u)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Ao(f)))return}i=n.createElement("link"),nl(i,"link",e),ht(i),n.head.appendChild(i)}}}function n0(e,t,n){Ia.S(e,t,n);var i=bc;if(i&&e){var u=cn(i).hoistableStyles,f=_c(e);t=t||"default";var b=u.get(f);if(!b){var S={loading:0,preload:null};if(b=i.querySelector(Co(f)))S.loading=5;else{e=j({rel:"stylesheet",href:e,"data-precedence":t},n),(n=ts.get(f))&&jh(e,n);var M=b=i.createElement("link");ht(M),nl(M,"link",e),M._p=new Promise(function(W,ie){M.onload=W,M.onerror=ie}),M.addEventListener("load",function(){S.loading|=1}),M.addEventListener("error",function(){S.loading|=2}),S.loading|=4,af(b,t,i)}b={type:"stylesheet",instance:b,count:1,state:S},u.set(f,b)}}}function l0(e,t){Ia.X(e,t);var n=bc;if(n&&e){var i=cn(n).hoistableScripts,u=yc(e),f=i.get(u);f||(f=n.querySelector(Ao(u)),f||(e=j({src:e,async:!0},t),(t=ts.get(u))&&Sh(e,t),f=n.createElement("script"),ht(f),nl(f,"link",e),n.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},i.set(u,f))}}function s0(e,t){Ia.M(e,t);var n=bc;if(n&&e){var i=cn(n).hoistableScripts,u=yc(e),f=i.get(u);f||(f=n.querySelector(Ao(u)),f||(e=j({src:e,async:!0,type:"module"},t),(t=ts.get(u))&&Sh(e,t),f=n.createElement("script"),ht(f),nl(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)?sf(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=_c(n.href),n=cn(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=_c(n.href);var f=cn(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(Co(e)))&&!f._p&&(b.instance=f,b.state.loading=5),ts.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},ts.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=yc(n),n=cn(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 _c(e){return'href="'+Xn(e)+'"'}function Co(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}),nl(t,"link",n),ht(t),e.head.appendChild(t))}function yc(e){return'[src="'+Xn(e)+'"]'}function Ao(e){return"script[async]"+e}function ix(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+Xn(n.href)+'"]');if(i)return t.instance=i,ht(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"),ht(i),nl(i,"style",u),af(i,n.precedence,e),t.instance=i;case"stylesheet":u=_c(n.href);var f=e.querySelector(Co(u));if(f)return t.state.loading|=4,t.instance=f,ht(f),f;i=ax(n),(u=ts.get(u))&&jh(i,u),f=(e.ownerDocument||e).createElement("link"),ht(f);var b=f;return b._p=new Promise(function(S,M){b.onload=S,b.onerror=M}),nl(f,"link",i),t.state.loading|=4,af(f,n.precedence,e),t.instance=f;case"script":return f=yc(n.src),(u=e.querySelector(Ao(f)))?(t.instance=u,ht(u),u):(i=n,(u=ts.get(f))&&(i=j({},n),Sh(i,u)),e=e.ownerDocument||e,u=e.createElement("script"),ht(u),nl(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,af(i,n.precedence,e));return t.instance}function af(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 jh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Sh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var rf=null;function rx(e,t,n){if(rf===null){var i=new Map,u=rf=new Map;u.set(n,i)}else u=rf,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[bt]||f[lt]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var b=f.getAttribute(t)||"";b=e+b;var S=i.get(b);S?S.push(f):i.set(b,[f])}}return i}function cx(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function i0(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function ox(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function r0(e,t,n,i){if(n.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var u=_c(i.href),f=t.querySelector(Co(u));if(f){t=f._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=cf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=f,ht(f);return}f=t.ownerDocument||t,i=ax(i),(u=ts.get(u))&&jh(i,u),f=f.createElement("link"),ht(f);var b=f;b._p=new Promise(function(S,M){b.onload=S,b.onerror=M}),nl(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=cf.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var wh=0;function c0(e,t){return e.stylesheets&&e.count===0&&uf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var i=setTimeout(function(){if(e.stylesheets&&uf(e,e.stylesheets),e.unsuspend){var f=e.unsuspend;e.unsuspend=null,f()}},6e4+t);0<e.imgBytes&&wh===0&&(wh=62500*Gy());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&uf(e,e.stylesheets),e.unsuspend)){var f=e.unsuspend;e.unsuspend=null,f()}},(e.imgBytes>wh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(u)}}:null}function cf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)uf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var of=null;function uf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,of=new Map,t.forEach(o0,e),of=null,cf.call(e))}function o0(e,t){if(!(t.state.loading&4)){var n=of.get(e);if(n)var i=n.get(null);else{n=new Map,of.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=cf.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 Mo={$$typeof:X,Provider:null,Consumer:null,_currentValue:H,_currentValue2:H,_threadCount:0};function u0(e,t,n,i,u,f,b,S,M){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=xn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xn(0),this.hiddenUpdates=xn(null),this.identifierPrefix=i,this.onUncaughtError=u,this.onCaughtError=f,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=M,this.incompleteTransitions=new Map}function ux(e,t,n,i,u,f,b,S,M,W,ie,he){return e=new u0(e,t,n,b,M,W,ie,he,S),t=1,f===!0&&(t|=24),f=In(3,null,null,t),e.current=f,f.stateNode=e,t=ai(),t.refCount++,e.pooledCache=t,t.refCount++,f.memoizedState={element:i,isDehydrated:n,cache:t},jn(f),e}function fx(e){return e?(e=Pa,e):Pa}function dx(e,t,n,i,u,f){u=fx(u),i.context===null?i.context=u:i.pendingContext=u,i=Ml(t),i.payload={element:n},f=f===void 0?null:f,f!==null&&(i.callback=f),n=Cs(e,i,t),n!==null&&(zl(n,e,t),ui(n,e,t))}function hx(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function kh(e,t){hx(e,t),(e=e.alternate)&&hx(e,t)}function px(e){if(e.tag===13||e.tag===31){var t=js(e,67108864);t!==null&&zl(t,e,67108864),kh(e,67108864)}}function mx(e){if(e.tag===13||e.tag===31){var t=$l();t=is(t);var n=js(e,t);n!==null&&zl(n,e,t),kh(e,t)}}var ff=!0;function f0(e,t,n,i){var u=V.T;V.T=null;var f=pe.p;try{pe.p=2,Nh(e,t,n,i)}finally{pe.p=f,V.T=u}}function d0(e,t,n,i){var u=V.T;V.T=null;var f=pe.p;try{pe.p=8,Nh(e,t,n,i)}finally{pe.p=f,V.T=u}}function Nh(e,t,n,i){if(ff){var u=Th(i);if(u===null)dh(e,t,i,df,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=ml(u);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var b=I(f.pendingLanes);if(b!==0){var S=f;for(S.pendingLanes|=2,S.entangledLanes|=2;b;){var M=1<<31-wt(b);S.entanglements[1]|=M,b&=~M}la(f),(Ct&6)===0&&(Qu=_t()+500,ko(0))}}break;case 31:case 13:S=js(f,2),S!==null&&zl(S,f,2),Zu(),kh(f,2)}if(f=Th(i),f===null&&dh(e,t,i,df,n),f===u)break;u=f}u!==null&&i.stopPropagation()}else dh(e,t,i,null,n)}}function Th(e){return e=Mt(e),Eh(e)}var df=null;function Eh(e){if(df=null,e=Ve(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 df=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(Zt()){case Lt:return 2;case sn:return 8;case xt:case rt:return 32;case mn:return 268435456;default:return 32}default:return 32}}var Ch=!1,ji=null,Si=null,wi=null,Ro=new Map,Do=new Map,ki=[],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":ji=null;break;case"dragenter":case"dragleave":Si=null;break;case"mouseover":case"mouseout":wi=null;break;case"pointerover":case"pointerout":Ro.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Do.delete(t.pointerId)}}function Oo(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=ml(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 ji=Oo(ji,e,t,n,i,u),!0;case"dragenter":return Si=Oo(Si,e,t,n,i,u),!0;case"mouseover":return wi=Oo(wi,e,t,n,i,u),!0;case"pointerover":var f=u.pointerId;return Ro.set(f,Oo(Ro.get(f)||null,e,t,n,i,u)),!0;case"gotpointercapture":return f=u.pointerId,Do.set(f,Oo(Do.get(f)||null,e,t,n,i,u)),!0}return!1}function bx(e){var t=Ve(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,al(e.priority,function(){mx(n)});return}}else if(t===31){if(t=m(n),t!==null){e.blockedOn=t,al(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 hf(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Th(e.nativeEvent);if(n===null){n=e.nativeEvent;var i=new n.constructor(n.type,n);dn=i,n.target.dispatchEvent(i),dn=null}else return t=ml(n),t!==null&&px(t),e.blockedOn=n,!1;t.shift()}return!0}function _x(e,t,n){hf(e)&&n.delete(t)}function m0(){Ch=!1,ji!==null&&hf(ji)&&(ji=null),Si!==null&&hf(Si)&&(Si=null),wi!==null&&hf(wi)&&(wi=null),Ro.forEach(_x),Do.forEach(_x)}function pf(e,t){e.blockedOn===t&&(e.blockedOn=null,Ch||(Ch=!0,l.unstable_scheduleCallback(l.unstable_NormalPriority,m0)))}var mf=null;function yx(e){mf!==e&&(mf=e,l.unstable_scheduleCallback(l.unstable_NormalPriority,function(){mf===e&&(mf=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(Eh(i||n)===null)continue;break}var f=ml(n);f!==null&&(e.splice(t,3),t-=3,Td(f,{pending:!0,data:u,method:n.method,action:i},i,u))}}))}function vc(e){function t(M){return pf(M,e)}ji!==null&&pf(ji,e),Si!==null&&pf(Si,e),wi!==null&&pf(wi,e),Ro.forEach(t),Do.forEach(t);for(var n=0;n<ki.length;n++){var i=ki[n];i.blockedOn===e&&(i.blockedOn=null)}for(;0<ki.length&&(n=ki[0],n.blockedOn===null);)bx(n),n.blockedOn===null&&ki.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[Qe]||null;if(typeof f=="function")b||yx(n);else if(b){var S=null;if(f&&f.hasAttribute("formAction")){if(u=f,b=f[Qe]||null)S=b.formAction;else if(Eh(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 Ah(e){this._internalRoot=e}gf.prototype.render=Ah.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var n=t.current,i=$l();dx(n,i,e,t,null,null)},gf.prototype.unmount=Ah.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),Zu(),t[fn]=null}};function gf(e){this._internalRoot=e}gf.prototype.unstable_scheduleHydration=function(e){if(e){var t=cs();e={blockedOn:null,target:e,priority:t};for(var n=0;n<ki.length&&t!==0&&t<ki[n].priority;n++);ki.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"));pe.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:V,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var xf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!xf.isDisabled&&xf.supportsFiber)try{an=xf.inject(g0),zt=xf}catch{}}return zo.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[fn]=t.current,fh(e),new Ah(t)},zo.hydrateRoot=function(e,t,n){if(!o(e))throw Error(c(299));var i=!1,u="",f=Cm,b=Am,S=Mm,M=null;return n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(u=n.identifierPrefix),n.onUncaughtError!==void 0&&(f=n.onUncaughtError),n.onCaughtError!==void 0&&(b=n.onCaughtError),n.onRecoverableError!==void 0&&(S=n.onRecoverableError),n.formState!==void 0&&(M=n.formState)),t=ux(e,1,!0,t,n??null,i,u,M,f,b,S,vx),t.context=fx(null),n=t.current,i=$l(),i=is(i),u=Ml(i),u.callback=null,Cs(n,u,i),n=i,t.current.lanes=n,Hn(t,n),la(t),e[fn]=t.current,fh(e),new gf(t)},zo.version="19.2.8",zo}var Dx;function E0(){if(Dx)return Oh.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(),Oh.exports=T0(),Oh.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 Ya,Lc,zc,Uc,Hc,Wo,Bc,Jf,a_;class D0{constructor(s){pn(this,Jf);pn(this,Ya,null);pn(this,Lc,new Set);pn(this,zc,500);pn(this,Uc,null);pn(this,Hc,!1);pn(this,Wo,null);pn(this,Bc,null);this.url=s}get statusText(){return this.connected?"Хост на связи":"Нет связи с хостом"}onStatus(s){At(this,Bc,s)}connect(){if($e(this,Hc))return;const s=new WebSocket(this.url);At(this,Ya,s),s.addEventListener("open",()=>{var r,c;At(this,zc,500),this.send({type:"hello",protocol:l_,clientName:"ccv-web"}),(r=$e(this,Wo))==null||r.call(this),(c=$e(this,Bc))==null||c.call(this)}),s.addEventListener("message",r=>{let c;try{c=JSON.parse(String(r.data))}catch{return}for(const o of $e(this,Lc))o(c)}),s.addEventListener("close",()=>{var r;At(this,Ya,null),(r=$e(this,Bc))==null||r.call(this),On(this,Jf,a_).call(this)}),s.addEventListener("error",()=>s.close())}onReconnect(s){At(this,Wo,s)}on(s){return $e(this,Lc).add(s),()=>$e(this,Lc).delete(s)}send(s){var r;((r=$e(this,Ya))==null?void 0:r.readyState)===WebSocket.OPEN&&$e(this,Ya).send(JSON.stringify(s))}get connected(){var s;return((s=$e(this,Ya))==null?void 0:s.readyState)===WebSocket.OPEN}close(){var s;At(this,Hc,!0),(s=$e(this,Ya))==null||s.close()}}Ya=new WeakMap,Lc=new WeakMap,zc=new WeakMap,Uc=new WeakMap,Hc=new WeakMap,Wo=new WeakMap,Bc=new WeakMap,Jf=new WeakSet,a_=function(){if($e(this,Hc)||$e(this,Uc)!==null)return;const s=$e(this,zc);At(this,zc,Math.min(s*2,1e4)),At(this,Uc,window.setTimeout(()=>{At(this,Uc,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 fa,Ic,da,qc,Gc,Li,jr,Sr,zi,wr,Yc,kr,Nr,nn,Ci,sp,c_,yr,ap;class z0{constructor(s){pn(this,nn);pn(this,fa,null);pn(this,Ic,new Set);pn(this,da,null);pn(this,qc,null);pn(this,Gc,500);pn(this,Li,null);pn(this,jr,!1);pn(this,Sr,!1);pn(this,zi,!1);pn(this,wr,null);pn(this,Yc,"Подключаемся…");pn(this,kr,0);pn(this,Nr,[]);this.session=s}get connected(){return $e(this,Sr)&&$e(this,zi)}get statusText(){return $e(this,Yc)}get hostId(){return $e(this,wr)}on(s){return $e(this,Ic).add(s),()=>$e(this,Ic).delete(s)}onReconnect(s){At(this,qc,s)}onStatus(s){At(this,da,s)}connect(){$e(this,jr)||On(this,nn,sp).call(this)}send(s){if(!$e(this,Sr)){$e(this,Nr).length<64&&$e(this,Nr).push(s);return}On(this,nn,yr).call(this,{t:"client.frame",body:s})}close(){var s;At(this,jr,!0),$e(this,Li)!==null&&window.clearTimeout($e(this,Li)),(s=$e(this,fa))==null||s.close()}}fa=new WeakMap,Ic=new WeakMap,da=new WeakMap,qc=new WeakMap,Gc=new WeakMap,Li=new WeakMap,jr=new WeakMap,Sr=new WeakMap,zi=new WeakMap,wr=new WeakMap,Yc=new WeakMap,kr=new WeakMap,Nr=new WeakMap,nn=new WeakSet,Ci=function(s){var r;$e(this,Yc)!==s&&(At(this,Yc,s),(r=$e(this,da))==null||r.call(this))},sp=async function(){if($e(this,fa))return;if(!$e(this,wr))try{At(this,wr,await U0(this.session.token))}catch(c){On(this,nn,Ci).call(this,c instanceof Error?c.message:String(c)),On(this,nn,ap).call(this);return}const s=location.protocol==="https:"?"wss":"ws",r=new WebSocket(`${s}://${location.host}/relay/client`);At(this,fa,r),r.addEventListener("open",()=>{On(this,nn,yr).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}On(this,nn,c_).call(this,o)}),r.addEventListener("close",()=>{var c;At(this,fa,null),At(this,Sr,!1),At(this,zi,!1),On(this,nn,Ci).call(this,"Нет связи с сервером"),(c=$e(this,da))==null||c.call(this),On(this,nn,ap).call(this)}),r.addEventListener("error",()=>r.close())},c_=function(s){var r,c,o,d,h,m,g;switch(s.t){case"client.ok":At(this,Gc,500),On(this,nn,yr).call(this,{t:"client.attach",hostId:$e(this,wr)??"",...$e(this,kr)>0?{sinceRseq:$e(this,kr)}:{}});return;case"client.attached":At(this,Sr,!0),At(this,zi,s.online),At(this,kr,s.rseq),On(this,nn,Ci).call(this,s.online?"Хост на связи":"Компьютер не на связи"),On(this,nn,yr).call(this,{t:"client.frame",body:{type:"hello",protocol:l_,clientName:"ccv-web-relay"}});const x=$e(this,Nr);At(this,Nr,[]);for(const y of x)On(this,nn,yr).call(this,{t:"client.frame",body:y});(r=$e(this,qc))==null||r.call(this),(c=$e(this,da))==null||c.call(this);return;case"host.frame":{s.rseq>0&&At(this,kr,s.rseq);const y=s.body;for(const j of $e(this,Ic))j(y);return}case"host.online":At(this,zi,!0),On(this,nn,Ci).call(this,"Хост на связи"),(o=$e(this,qc))==null||o.call(this),(d=$e(this,da))==null||d.call(this);return;case"host.offline":At(this,zi,!1),On(this,nn,Ci).call(this,"Компьютер не на связи"),(h=$e(this,da))==null||h.call(this);return;case"ping":On(this,nn,yr).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),On(this,nn,Ci).call(this,"Этот компьютер отвязан от аккаунта"),At(this,jr,!0),(m=$e(this,fa))==null||m.close();return}s.code!=="offline"&&On(this,nn,Ci).call(this,s.message),(g=$e(this,da))==null||g.call(this);return}},yr=function(s){var r;((r=$e(this,fa))==null?void 0:r.readyState)===WebSocket.OPEN&&$e(this,fa).send(JSON.stringify(s))},ap=function(){if($e(this,jr)||$e(this,Li)!==null)return;const s=$e(this,Gc);At(this,Gc,Math.min(s*2,1e4)),At(this,Li,window.setTimeout(()=>{At(this,Li,null),On(this,nn,sp).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 Qo=null,Ko=null;function yp(){if(Qo)return Qo;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 Qo=l,window.addEventListener("pagehide",d_),l}function Hh(l){return yp().get(l)??""}function u_(l,s){const r=yp(),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 yp().keys())l.add(s.startsWith("side:")?s.slice(5):s);return[...l].sort()}const ip=new Set;let Ox="";function Y0(l){return ip.add(l),()=>ip.delete(l)}function $0(){const l=f_(),s=l.join(`
51
- `);if(s!==Ox){Ox=s;for(const r of ip)r(l)}}function X0(){Ko===null&&(Ko=window.setTimeout(d_,G0))}function d_(){if(Ko!==null&&window.clearTimeout(Ko),Ko=null,!!Qo)try{localStorage.setItem(o_,JSON.stringify(Object.fromEntries(Qo)))}catch{}}const jl={items:[],pending:[],lastSeq:0,contextTokens:null},Bh={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(jl,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 sa(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 sa(l,{id:s.blockId,kind:"assistant",text:s.text,streaming:!0});const m=c[h];return jc(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?sa(l,m):jc(l,h,m)}case"thinking.delta":{const h=c.findIndex(g=>g.id===s.blockId);if(h===-1)return sa(l,{id:s.blockId,kind:"thinking",text:s.text});const m=c[h];return jc(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?sa(l,m):jc(l,h,m)}case"tool.use":return sa(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 jc(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 jc({...l,pending:m},g,{...x,answers:s.answers})}}return s.decision==="allow"?{...l,pending:m}:sa({...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 sa({...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:sa(l,{id:`s${r}`,kind:"notice",tone:"info",text:"Контекст сжат"});case"error":return sa(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 sa(l,s){return{...l,items:[...l.items,s]}}function jc(l,s,r){const c=l.items.slice();return c[s]=r,{...l,items:c}}const rp="ccv:theme",Ih=["system","light","dark"];function J0(){const[l,s]=_.useState(W0);_.useEffect(()=>{const o=window.matchMedia("(prefers-color-scheme: dark)"),d=()=>{const h=l==="dark"||l==="system"&&o.matches;document.documentElement.dataset.theme=h?"dark":"light"};return d(),o.addEventListener("change",d),()=>o.removeEventListener("change",d)},[l]);const r=_.useCallback(o=>{try{localStorage.setItem(rp,o)}catch{}s(o)},[]),c=_.useCallback(()=>{s(o=>{const d=Ih[(Ih.indexOf(o)+1)%Ih.length];try{localStorage.setItem(rp,d)}catch{}return d})},[]);return[l,r,c]}function W0(){try{const l=localStorage.getItem(rp);if(l==="light"||l==="dark"||l==="system")return l}catch{}return"system"}const p_=[{value:"default",hint:"спрашивать перед каждым действием"},{value:"acceptEdits",hint:"правки файлов без подтверждения"},{value:"plan",hint:"только чтение и план, без изменений"},{value:"auto",hint:"спрашивать только о рискованном — решает сам"},{value:"bypassPermissions",hint:"ничего не спрашивать"}],P0=[{value:"default",hint:"рискованное agy отклоняет сам: спросить он не может"},{value:"acceptEdits",hint:"правки файлов без подтверждения, команды — нет"},{value:"plan",hint:"только план, без изменений"},{value:"bypassPermissions",hint:"разрешено всё, включая команды"}],Tr={sidebar:{side:"left",min:200,max:520,width:276,label:"сессий"},files:{side:"left",min:180,max:560,width:260,label:"файлов"},search:{side:"left",min:220,max:640,width:320,label:"поиска"},git:{side:"left",min:220,max:640,width:320,label:"истории"},ask:{side:"right",min:260,max:720,width:380,label:"вопроса"}},ev=320,m_="ccv:panes";function tv(l){return`--${l}-w`}function g_(l,s){const r=Tr[l];return Math.round(Math.min(r.max,Math.max(r.min,s)))}function nv(){const l={};for(const s of Object.keys(Tr))l[s]=Tr[s].width;try{const s=localStorage.getItem(m_);if(s){const r=JSON.parse(s);for(const c of Object.keys(Tr)){const o=r[c];typeof o=="number"&&Number.isFinite(o)&&(l[c]=g_(c,o))}}}catch{}return l}function lv(){const[l,s]=_.useState(nv),r=_.useCallback(h=>{try{localStorage.setItem(m_,JSON.stringify(h))}catch{}},[]),c=_.useCallback((h,m)=>{s(g=>{const x=g_(h,m);if(g[h]===x)return g;const y={...g,[h]:x};return r(y),y})},[r]),o=_.useCallback(h=>{s(m=>{const g={...m,[h]:Tr[h].width};return r(g),g})},[r]),d={};for(const h of Object.keys(Tr))d[tv(h)]=`${l[h]}px`;return{widths:l,style:d,setWidth:c,reset:o}}const qh=260,x_=120,sv=200,zx="ccv:terminal-h";function Ux(l,s){return Math.round(Math.min(s,Math.max(x_,l)))}function av(){const[l,s]=_.useState(()=>{try{const d=localStorage.getItem(zx);if(d){const h=Number(d);if(Number.isFinite(h))return Ux(h,1/0)}}catch{}return qh}),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(qh),r(qh)},[r]);return{height:l,setHeight:c,reset:o}}function Wf(l){const[s,r]=_.useState(()=>typeof window>"u"?!1:window.matchMedia(l).matches);return _.useEffect(()=>{const c=window.matchMedia(l),o=()=>r(c.matches);return o(),c.addEventListener("change",o),()=>c.removeEventListener("change",o)},[l]),s}const iv=500,rv=6;function b_({onLongPress:l,onClick:s,disabled:r=!1,thresholdMs:c=iv,moveCancelPx:o=rv}){const d=_.useRef(null),[h,m]=_.useState(!1),g=_.useCallback(()=>{d.current&&window.clearTimeout(d.current.timer),d.current=null,m(!1)},[]),x=_.useCallback(N=>{if(r||N.button!==0)return;const A={timer:0,x:N.clientX,y:N.clientY,fired:!1};A.timer=window.setTimeout(()=>{A.fired=!0,m(!1),l()},c),d.current=A,m(!0)},[r,c,l]),y=_.useCallback(N=>{const A=d.current;!A||A.fired||Math.hypot(N.clientX-A.x,N.clientY-A.y)>o&&g()},[o,g]),j=_.useCallback(()=>{d.current&&!d.current.fired?g():m(!1)},[g]),v=_.useCallback(N=>{var A;if((A=d.current)!=null&&A.fired){d.current=null,N.preventDefault();return}if(!r){if(N.shiftKey){l();return}s()}},[r,s,l]),C=_.useCallback(N=>{N.preventDefault()},[]),k=_.useCallback(N=>{r||N.shiftKey&&(N.key==="Enter"||N.key===" ")&&(N.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:k}}}const cv={height:0,offsetTop:0,offsetLeft:0};function Hx(){if(typeof window>"u")return cv;const l=window.visualViewport;return l?{height:l.height,offsetTop:l.offsetTop,offsetLeft:l.offsetLeft}:{height:window.innerHeight,offsetTop:0,offsetLeft:0}}function ov(l){const[s,r]=_.useState(Hx);return _.useEffect(()=>{if(!l)return;const c=window.visualViewport,o=()=>{const d=Hx();r(h=>h.height===d.height&&h.offsetTop===d.offsetTop&&h.offsetLeft===d.offsetLeft?h:d)};return o(),c?(c.addEventListener("resize",o),c.addEventListener("scroll",o),()=>{c.removeEventListener("resize",o),c.removeEventListener("scroll",o)}):(window.addEventListener("resize",o),()=>window.removeEventListener("resize",o))},[l]),s}function vp(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Mr=vp();function __(l){Mr=l}var vr={exec:()=>null};function Sc(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 vt(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(dl.caret,"$1"),r=r.replace(o,h),c},getRegex:()=>new RegExp(r,s)};return c}var uv=((l="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+l)}catch{return!1}})(),dl={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:Sc(l=>new RegExp(`^ {0,${l}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Sc(l=>new RegExp(`^ {0,${l}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Sc(l=>new RegExp(`^ {0,${l}}(?:\`\`\`|~~~)`)),headingBeginRegex:Sc(l=>new RegExp(`^ {0,${l}}#`)),htmlBeginRegex:Sc(l=>new RegExp(`^ {0,${l}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:Sc(l=>new RegExp(`^ {0,${l}}>`))},fv=/^(?:[ \t]*(?:\n|$))+/,dv=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,hv=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Po=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,pv=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,jp=/ {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_=vt(y_).replace(/bull/g,jp).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),mv=vt(y_).replace(/bull/g,jp).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Sp=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,gv=/^[^\n]+/,wp=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,xv=vt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",wp).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),bv=vt(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,jp).getRegex(),Pf="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",kp=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,_v=vt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",kp).replace("tag",Pf).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),j_=l=>vt(Sp).replace("hr",Po).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",Pf).getRegex(),yv=j_(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),vv=j_(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),jv=vt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",vv).getRegex(),Np={blockquote:jv,code:dv,def:xv,fences:hv,heading:pv,hr:Po,html:_v,lheading:v_,list:bv,newline:fv,paragraph:yv,table:vr,text:gv},Bx=vt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Po).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",Pf).getRegex(),Sv={...Np,lheading:mv,table:Bx,paragraph:vt(Sp).replace("hr",Po).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",Pf).getRegex()},wv={...Np,html:vt(`^ *(?: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:vr,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:vt(Sp).replace("hr",Po).replace("heading",` *#{1,6} *[^
52
- ]`).replace("lheading",v_).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},kv=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Nv=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,S_=/^( {2,}|\\)\n(?!\s*$)/,Tv=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Xc=/[\p{P}\p{S}]/u,ed=/[\s\p{P}\p{S}]/u,Tp=/[^\s\p{P}\p{S}]/u,Ev=vt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ed).getRegex(),w_=/(?!~)[\p{P}\p{S}]/u,Cv=/(?!~)[\s\p{P}\p{S}]/u,Av=/(?:[^\s\p{P}\p{S}]|~)/u,Mv=vt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",uv?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),k_=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Rv=vt(k_,"u").replace(/punct/g,Xc).getRegex(),Dv=vt(k_,"u").replace(/punct/g,w_).getRegex(),N_="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Ov=vt(N_,"gu").replace(/notPunctSpace/g,Tp).replace(/punctSpace/g,ed).replace(/punct/g,Xc).getRegex(),Lv=vt(N_,"gu").replace(/notPunctSpace/g,Av).replace(/punctSpace/g,Cv).replace(/punct/g,w_).getRegex(),zv=vt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Tp).replace(/punctSpace/g,ed).replace(/punct/g,Xc).getRegex(),Uv=vt(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Xc).getRegex(),Hv="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Bv=vt(Hv,"gu").replace(/notPunctSpace/g,Tp).replace(/punctSpace/g,ed).replace(/punct/g,Xc).getRegex(),Iv=vt(/\\(punct)/,"gu").replace(/punct/g,Xc).getRegex(),qv=vt(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Gv=vt(kp).replace("(?:-->|$)","-->").getRegex(),Yv=vt("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Gv).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Gf=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,$v=vt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Gf).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),T_=vt(/^!?\[(label)\]\[(ref)\]/).replace("label",Gf).replace("ref",wp).getRegex(),E_=vt(/^!?\[(ref)\](?:\[\])?/).replace("ref",wp).getRegex(),Xv=vt("reflink|nolink(?!\\()","g").replace("reflink",T_).replace("nolink",E_).getRegex(),Ix=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Ep={_backpedal:vr,anyPunctuation:Iv,autolink:qv,blockSkip:Mv,br:S_,code:Nv,del:vr,delLDelim:vr,delRDelim:vr,emStrongLDelim:Rv,emStrongRDelimAst:Ov,emStrongRDelimUnd:zv,escape:kv,link:$v,nolink:E_,punctuation:Ev,reflink:T_,reflinkSearch:Xv,tag:Yv,text:Tv,url:vr},Vv={...Ep,link:vt(/^!?\[(label)\]\((.*?)\)/).replace("label",Gf).getRegex(),reflink:vt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Gf).getRegex()},cp={...Ep,emStrongRDelimAst:Lv,emStrongLDelim:Dv,delLDelim:Uv,delRDelim:Bv,url:vt(/^((?: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:vt(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Ix).getRegex()},Qv={...cp,br:vt(S_).replace("{2,}","*").getRegex(),text:vt(cp.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},bf={normal:Np,gfm:Sv,pedantic:wv},Uo={normal:Ep,gfm:cp,breaks:Qv,pedantic:Vv},Kv={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},qx=l=>Kv[l];function ca(l,s){if(s){if(dl.escapeTest.test(l))return l.replace(dl.escapeReplace,qx)}else if(dl.escapeTestNoEncode.test(l))return l.replace(dl.escapeReplaceNoEncode,qx);return l}function Gx(l){try{l=encodeURI(l).replace(dl.percentDecode,"%")}catch{return null}return l}function Yx(l,s){var d;let r=l.replace(dl.findPipe,(h,m,g)=>{let x=!1,y=m;for(;--y>=0&&g[y]==="\\";)x=!x;return x?"|":" |"}),c=r.split(dl.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(dl.slashPipe,"|");return c}function Ti(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&&dl.blankLine.test(s[r]);)r--;return s.length-r<=2?l:s.slice(0,r+1).join(`
54
- `)}function Zv(l,s){if(l.indexOf(s[1])===-1)return-1;let r=0;for(let c=0;c<l.length;c++)if(l[c]==="\\")c++;else if(l[c]===s[0])r++;else if(l[c]===s[1]&&(r--,r<0))return c;return r>0?-2:-1}function Fv(l,s=0){let r=s,c="";for(let o of l)if(o===" "){let d=4-r%4;c+=" ".repeat(d),r+=d}else c+=o,r++;return c}function Xx(l,s,r,c,o){let d=s.href,h=s.title||null,m=l[1].replace(o.other.outputLinkReplace,"$1");c.state.inLink=!0;let g={type:l[0].charAt(0)==="!"?"image":"link",raw:r,href:d,title:h,text:m,tokens:c.inlineTokens(m)};return c.state.inLink=!1,g}function Jv(l,s,r){let c=l.match(r.other.indentCodeCompensation);if(c===null)return s;let o=c[1];return s.split(`
55
- `).map(d=>{let h=d.match(r.other.beginningSpace);if(h===null)return d;let[m]=h;return m.length>=o.length?d.slice(o.length):d}).join(`
56
- `)}var Yf=class{constructor(l){Yt(this,"options");Yt(this,"rules");Yt(this,"lexer");this.options=l||Mr}space(l){let s=this.rules.block.newline.exec(l);if(s&&s[0].length>0)return{type:"space",raw:s[0]}}code(l){let s=this.rules.block.code.exec(l);if(s){let r=this.options.pedantic?s[0]:$x(s[0]),c=r.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r,codeBlockStyle:"indented",text:c}}}fences(l){let s=this.rules.block.fences.exec(l);if(s){let r=s[0],c=Jv(r,s[3]||"",this.rules);return{type:"code",raw:r,lang:s[2]?s[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):s[2],text:c}}}heading(l){let s=this.rules.block.heading.exec(l);if(s){let r=s[2].trim();if(this.rules.other.endingHash.test(r)){let c=Ti(r,"#");(this.options.pedantic||!c||this.rules.other.endingSpaceChar.test(c))&&(r=c.trim())}return{type:"heading",raw:Ti(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:Ti(s[0],`
58
- `)}}blockquote(l){let s=this.rules.block.blockquote.exec(l);if(s){let r=Ti(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,k=C.raw+`
65
- `+r.join(`
66
- `),N=this.blockquote(k);d[d.length-1]=N,c=c.substring(0,c.length-C.raw.length)+N.raw,o=o.substring(0,o.length-C.text.length)+N.text;break}else if((v==null?void 0:v.type)==="list"){let C=v,k=C.raw+`
67
- `+r.join(`
68
- `),N=this.list(k);d[d.length-1]=N,c=c.substring(0,c.length-v.raw.length)+N.raw,o=o.substring(0,o.length-C.raw.length)+N.raw,r=k.substring(d.at(-1).raw.length).split(`
69
- `);continue}}return{type:"blockquote",raw:c,tokens:d,text:o}}}list(l){let s=this.rules.block.list.exec(l);if(s){let r=s[1].trim(),c=r.length>1,o={type:"list",raw:"",ordered:c,start:c?+r.slice(0,-1):"",loose:!1,items:[]};r=c?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=c?r:"[*+-]");let d=this.rules.other.listItemRegex(r),h=!1;for(;l;){let g=!1,x="",y="";if(!(s=d.exec(l))||this.rules.block.hr.test(l))break;x=s[0],l=l.substring(x.length);let j=Fv(s[2].split(`
70
- `,1)[0],s[1].length),v=l.split(`
71
- `,1)[0],C=!j.trim(),k=0;if(this.options.pedantic?(k=2,y=j.trimStart()):C?k=s[1].length+1:(k=j.search(this.rules.other.nonSpaceChar),k=k>4?1:k,y=j.slice(k),k+=s[1].length),C&&this.rules.other.blankLine.test(v)&&(x+=v+`
72
- `,l=l.substring(v.length+1),g=!0),!g){let N=this.rules.other.nextBulletRegex(k),A=this.rules.other.hrRegex(k),B=this.rules.other.fencesBeginRegex(k),P=this.rules.other.headingBeginRegex(k),X=this.rules.other.htmlBeginRegex(k),R=this.rules.other.blockquoteBeginRegex(k);for(;l;){let Y=l.split(`
73
- `,1)[0],L;if(v=Y,this.options.pedantic?(v=v.replace(this.rules.other.listReplaceNesting," "),L=v):L=v.replace(this.rules.other.tabCharGlobal," "),B.test(v)||P.test(v)||X.test(v)||R.test(v)||N.test(v)||A.test(v))break;if(L.search(this.rules.other.nonSpaceChar)>=k||!v.trim())y+=`
74
- `+L.slice(k);else{if(C||j.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||B.test(j)||P.test(j)||A.test(j))break;y+=`
75
- `+v}C=!v.trim(),x+=Y+`
76
- `,l=l.substring(Y.length+1),j=L.slice(k)}}o.loose||(h?o.loose=!0:this.rules.other.doubleBlankLine.test(x)&&(h=!0)),o.items.push({type:"list_item",raw:x,task:!!this.options.gfm&&this.rules.other.listIsTask.test(y),loose:!1,text:y,tokens:[]}),o.raw+=x}let m=o.items.at(-1);if(m)m.raw=m.raw.trimEnd(),m.text=m.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let g of o.items){this.lexer.state.top=!1,g.tokens=this.lexer.blockTokens(g.text,[]);let x=g.tokens[0];if(g.task&&((x==null?void 0:x.type)==="text"||(x==null?void 0:x.type)==="paragraph")){g.text=g.text.replace(this.rules.other.listReplaceTask,""),x.raw=x.raw.replace(this.rules.other.listReplaceTask,""),x.text=x.text.replace(this.rules.other.listReplaceTask,"");for(let j=this.lexer.inlineQueue.length-1;j>=0;j--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[j].src)){this.lexer.inlineQueue[j].src=this.lexer.inlineQueue[j].src.replace(this.rules.other.listReplaceTask,"");break}let y=this.rules.other.listTaskCheckbox.exec(g.raw);if(y){let j={type:"checkbox",raw:y[0]+" ",checked:y[0]!=="[ ]"};g.checked=j.checked,o.loose?g.tokens[0]&&["paragraph","text"].includes(g.tokens[0].type)&&"tokens"in g.tokens[0]&&g.tokens[0].tokens?(g.tokens[0].raw=j.raw+g.tokens[0].raw,g.tokens[0].text=j.raw+g.tokens[0].text,g.tokens[0].tokens.unshift(j)):g.tokens.unshift({type:"paragraph",raw:j.raw,text:j.raw,tokens:[j]}):g.tokens.unshift(j)}}else g.task&&(g.task=!1);if(!o.loose){let y=g.tokens.filter(v=>v.type==="space"),j=y.length>0&&y.some(v=>this.rules.other.anyLine.test(v.raw));o.loose=j}}if(o.loose)for(let g of o.items){g.loose=!0;for(let x of g.tokens)x.type==="text"&&(x.type="paragraph")}return o}}html(l){let s=this.rules.block.html.exec(l);if(s){let r=$x(s[0]);return{type:"html",block:!0,raw:r,pre:s[1]==="pre"||s[1]==="script"||s[1]==="style",text:r}}}def(l){let s=this.rules.block.def.exec(l);if(s){let r=s[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),c=s[2]?s[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=s[3]?s[3].substring(1,s[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):s[3];return{type:"def",tag:r,raw:Ti(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:Ti(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:Ti(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=Ti(r.slice(0,-1),"\\");if((r.length-d.length)%2===0)return}else{let d=Zv(s[2],"()");if(d===-2)return;if(d>-1){let h=(s[0].indexOf("!")===0?5:4)+s[1].length+d;s[2]=s[2].substring(0,d),s[0]=s[0].substring(0,h).trim(),s[3]=""}}let c=s[2],o="";if(this.options.pedantic){let d=this.rules.other.pedanticHrefTitle.exec(c);d&&(c=d[1],o=d[3])}else o=s[3]?s[3].slice(1,-1):"";return c=c.trim(),this.rules.other.startAngleBracket.test(c)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?c=c.slice(1):c=c.slice(1,-1)),Xx(s,{href:c&&c.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},s[0],this.lexer,this.rules)}}reflink(l,s){let r;if((r=this.rules.inline.reflink.exec(l))||(r=this.rules.inline.nolink.exec(l))){let c=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=s[c.toLowerCase()];if(!o){let d=r[0].charAt(0);return{type:"text",raw:d,text:d}}return Xx(r,o,r[0],this.lexer,this.rules)}}emStrong(l,s,r=""){let c=this.rules.inline.emStrongLDelim.exec(l);if(!(!c||!c[1]&&!c[2]&&!c[3]&&!c[4]||c[4]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(c[1]||c[3])||!r||this.rules.inline.punctuation.exec(r))){let o=[...c[0]].length-1,d,h,m=o,g=0,x=c[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(x.lastIndex=0,s=s.slice(-1*l.length+o);(c=x.exec(s))!==null;){if(d=c[1]||c[2]||c[3]||c[4]||c[5]||c[6],!d)continue;if(h=[...d].length,c[3]||c[4]){m+=h;continue}else if((c[5]||c[6])&&o%3&&!((o+h)%3)){g+=h;continue}if(m-=h,m>0)continue;h=Math.min(h,h+m+g);let y=[...c[0]][0].length,j=l.slice(0,o+c.index+y+h);if(Math.min(o,h)%2){let 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}}}},Ds=class op{constructor(s){Yt(this,"tokens");Yt(this,"options");Yt(this,"state");Yt(this,"inlineQueue");Yt(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=s||Mr,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:dl,block:bf.normal,inline:Uo.normal};this.options.pedantic?(r.block=bf.pedantic,r.inline=Uo.pedantic):this.options.gfm&&(r.block=bf.gfm,this.options.breaks?r.inline=Uo.breaks:r.inline=Uo.gfm),this.tokenizer.rules=r}static get rules(){return{block:bf,inline:Uo}}static lex(s,r){return new op(r).lex(s)}static lexInline(s,r){return new op(r).inlineTokens(s)}lex(s){s=s.replace(dl.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(dl.tabCharGlobal," ").replace(dl.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,k)=>{let N=k?k.length:0;return v.slice(0,N)+"["+"a".repeat(v.length-N-2)+"]"}),c=((g=(m=this.options.hooks)==null?void 0:m.emStrongMask)==null?void 0:g.call({lexer:this},c))??c;let o=!1,d="",h=1/0;for(;s;){if(s.length<h)h=s.length;else{this.infiniteLoopError(s.charCodeAt(0));break}o||(d=""),o=!1;let v;if((y=(x=this.options.extensions)==null?void 0:x.inline)!=null&&y.some(k=>(v=k.call({lexer:this},s,r))?(s=s.substring(v.raw.length),r.push(v),!0):!1))continue;if(v=this.tokenizer.escape(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.tag(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.link(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.reflink(s,this.tokens.links)){s=s.substring(v.raw.length);let k=r.at(-1);v.type==="text"&&(k==null?void 0:k.type)==="text"?(k.raw+=v.raw,k.text+=v.text):r.push(v);continue}if(v=this.tokenizer.emStrong(s,c,d)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.codespan(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.br(s)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.del(s,c,d)){s=s.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.autolink(s)){s=s.substring(v.raw.length),r.push(v);continue}if(!this.state.inLink&&(v=this.tokenizer.url(s))){s=s.substring(v.raw.length),r.push(v);continue}let C=s;if((j=this.options.extensions)!=null&&j.startInline){let k=1/0,N=s.slice(1),A;this.options.extensions.startInline.forEach(B=>{A=B.call({lexer:this},N),typeof A=="number"&&A>=0&&(k=Math.min(k,A))}),k<1/0&&k>=0&&(C=s.substring(0,k+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 k=r.at(-1);(k==null?void 0:k.type)==="text"?(k.raw+=v.raw,k.text+=v.text):r.push(v);continue}if(s){this.infiniteLoopError(s.charCodeAt(0));break}}return r}infiniteLoopError(s){let r="Infinite loop on byte: "+s;if(this.options.silent)console.error(r);else throw new Error(r)}},$f=class{constructor(l){Yt(this,"options");Yt(this,"parser");this.options=l||Mr}space(l){return""}code({text:l,lang:s,escaped:r}){var d;let c=(d=(s||"").match(dl.notSpaceStart))==null?void 0:d[0],o=l.replace(dl.endingNewline,"")+`
96
- `;return c?'<pre><code class="language-'+ca(c)+'">'+(r?o:ca(o,!0))+`</code></pre>
97
- `:"<pre><code>"+(r?o:ca(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>${ca(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="'+ca(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 ca(r);l=o;let d=`<img src="${l}" alt="${ca(r)}"`;return s&&(d+=` title="${ca(s)}"`),d+=">",d}text(l){return"tokens"in l&&l.tokens?this.parser.parseInline(l.tokens):"escaped"in l&&l.escaped?l.text:ca(l.text)}},Cp=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}},Os=class up{constructor(s){Yt(this,"options");Yt(this,"renderer");Yt(this,"textRenderer");this.options=s||Mr,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 Cp}static parse(s,r){return new up(r).parse(s)}static parseInline(s,r){return new up(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,Xo=(zf=class{constructor(l){Yt(this,"options");Yt(this,"block");this.options=l||Mr}preprocess(l){return l}postprocess(l){return l}processAllTokens(l){return l}emStrongMask(l){return l}provideLexer(l=this.block){return l?Ds.lex:Ds.lexInline}provideParser(l=this.block){return l?Os.parse:Os.parseInline}},Yt(zf,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),Yt(zf,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),zf),Wv=class{constructor(...l){Yt(this,"defaults",vp());Yt(this,"options",this.setOptions);Yt(this,"parse",this.parseMarkdown(!0));Yt(this,"parseInline",this.parseMarkdown(!1));Yt(this,"Parser",Os);Yt(this,"Renderer",$f);Yt(this,"TextRenderer",Cp);Yt(this,"Lexer",Ds);Yt(this,"Tokenizer",Yf);Yt(this,"Hooks",Xo);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 Xo;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];Xo.passThroughHooks.has(d)?o[h]=x=>{if(this.defaults.async&&Xo.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 Ds.lex(l,s??this.defaults)}parser(l,s){return Os.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?Ds.lex:Ds.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?Os.parse:Os.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?Ds.lex:Ds.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?Os.parse:Os.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>"+ca(r.message+"",!0)+"</pre>";return s?Promise.resolve(c):c}if(s)return Promise.reject(r);throw r}}},Ar=new Wv;function Dt(l,s){return Ar.parse(l,s)}Dt.options=Dt.setOptions=function(l){return Ar.setOptions(l),Dt.defaults=Ar.defaults,__(Dt.defaults),Dt};Dt.getDefaults=vp;Dt.defaults=Mr;Dt.use=function(...l){return Ar.use(...l),Dt.defaults=Ar.defaults,__(Dt.defaults),Dt};Dt.walkTokens=function(l,s){return Ar.walkTokens(l,s)};Dt.parseInline=Ar.parseInline;Dt.Parser=Os;Dt.parser=Os.parse;Dt.Renderer=$f;Dt.TextRenderer=Cp;Dt.Lexer=Ds;Dt.lexer=Ds.lex;Dt.Tokenizer=Yf;Dt.Hooks=Xo;Dt.parse=Dt;Dt.options;Dt.setOptions;Dt.use;Dt.walkTokens;Dt.parseInline;Os.parse;Ds.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 Pv(l){if(Array.isArray(l))return l}function e1(l,s){var r=l==null?null:typeof Symbol<"u"&&l[Symbol.iterator]||l["@@iterator"];if(r!=null){var c,o,d,h,m=[],g=!0,x=!1;try{if(d=(r=r.call(l)).next,s!==0)for(;!(g=(c=d.call(r)).done)&&(m.push(c.value),m.length!==s);g=!0);}catch(y){x=!0,o=y}finally{try{if(!g&&r.return!=null&&(h=r.return(),Object(h)!==h))return}finally{if(x)throw o}}return m}}function t1(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
115
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function n1(l,s){return Pv(l)||e1(l,s)||l1(l,s)||t1()}function l1(l,s){if(l){if(typeof l=="string")return Vx(l,s);var r={}.toString.call(l).slice(8,-1);return r==="Object"&&l.constructor&&(r=l.constructor.name),r==="Map"||r==="Set"?Array.from(l):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Vx(l,s):void 0}}const C_=Object.entries,Qx=Object.setPrototypeOf,s1=Object.isFrozen,a1=Object.getPrototypeOf,i1=Object.getOwnPropertyDescriptor;let ll=Object.freeze,sl=Object.seal,Cc=Object.create,A_=typeof Reflect<"u"&&Reflect,fp=A_.apply,dp=A_.construct;ll||(ll=function(s){return s});sl||(sl=function(s){return s});fp||(fp=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)});dp||(dp=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 wc=Ln(Array.prototype.forEach),r1=Ln(Array.prototype.lastIndexOf),Kx=Ln(Array.prototype.pop),kc=Ln(Array.prototype.push),c1=Ln(Array.prototype.splice),Di=Array.isArray,Vo=Ln(String.prototype.toLowerCase),Gh=Ln(String.prototype.toString),Zx=Ln(String.prototype.match),Ho=Ln(String.prototype.replace),Fx=Ln(String.prototype.indexOf),o1=Ln(String.prototype.trim),u1=Ln(Number.prototype.toString),f1=Ln(Boolean.prototype.toString),Jx=typeof BigInt>"u"?null:Ln(BigInt.prototype.toString),Wx=typeof Symbol>"u"?null:Ln(Symbol.prototype.toString),Zn=Ln(Object.prototype.hasOwnProperty),Bo=Ln(Object.prototype.toString),Kn=Ln(RegExp.prototype.test),xr=d1(TypeError);function Ln(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 fp(l,s,c)}}function d1(l){return function(){for(var s=arguments.length,r=new Array(s),c=0;c<s;c++)r[c]=arguments[c];return dp(l,r)}}function yt(l,s){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Vo;if(Qx&&Qx(l,null),!Di(s))return l;let c=s.length;for(;c--;){let o=s[c];if(typeof o=="string"){const d=r(o);d!==o&&(s1(s)||(s[c]=d),o=d)}l[o]=!0}return l}function h1(l){for(let s=0;s<l.length;s++)Zn(l,s)||(l[s]=null);return l}function Sl(l){const s=Cc(null);for(const c of C_(l)){var r=n1(c,2);const o=r[0],d=r[1];Zn(l,o)&&(Di(d)?s[o]=h1(d):d&&typeof d=="object"&&d.constructor===Object?s[o]=Sl(d):s[o]=d)}return s}function p1(l){switch(typeof l){case"string":return l;case"number":return u1(l);case"boolean":return f1(l);case"bigint":return Jx?Jx(l):"0";case"symbol":return Wx?Wx(l):"Symbol()";case"undefined":return Bo(l);case"function":case"object":{if(l===null)return Bo(l);const s=l,r=oa(s,"toString");if(typeof r=="function"){const c=r(s);return typeof c=="string"?c:Bo(c)}return Bo(l)}default:return Bo(l)}}function oa(l,s){for(;l!==null;){const c=i1(l,s);if(c){if(c.get)return Ln(c.get);if(typeof c.value=="function")return Ln(c.value)}l=a1(l)}function r(){return null}return r}function m1(l){try{return Kn(l,""),!0}catch{return!1}}const Px=ll(["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"]),Yh=ll(["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"]),$h=ll(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),g1=ll(["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"]),Xh=ll(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),x1=ll(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),eb=ll(["#text"]),tb=ll(["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"]),Vh=ll(["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=ll(["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"]),_f=ll(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),b1=sl(/{{[\w\W]*|^[\w\W]*}}/g),_1=sl(/<%[\w\W]*|^[\w\W]*%>/g),y1=sl(/\${[\w\W]*/g),v1=sl(/^data-[\-\w.\u00B7-\uFFFF]+$/),j1=sl(/^aria-[\-\w]+$/),lb=sl(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),S1=sl(/^(?:\w+script|data):/i),w1=sl(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),k1=sl(/^html$/i),N1=sl(/^[a-z][.\w]*(-[.\w]+)+$/i),sb=sl(/<[/\w!]/g),ab=sl(/<[/\w]/g),T1=sl(/<\/no(script|embed|frames)/i),E1=sl(/\/>/i),Xl={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},C1=function(){return typeof window>"u"?null:window},A1=function(s,r){if(typeof s!="object"||typeof s.createPolicy!="function")return null;let c=null;const o="data-tt-policy-suffix";r&&r.hasAttribute(o)&&(c=r.getAttribute(o));const d="dompurify"+(c?"#"+c:"");try{return s.createPolicy(d,{createHTML(h){return h},createScriptURL(h){return h}})}catch{return console.warn("TrustedTypes policy "+d+" could not be created."),null}},ib=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Ei=function(s,r,c,o){return Zn(s,r)&&Di(s[r])?yt(o.base?Sl(o.base):{},s[r],o.transform):c};function M_(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:C1();const s=me=>M_(me);if(s.version="3.4.12",s.removed=[],!l||!l.document||l.document.nodeType!==Xl.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=oa(v,"cloneNode"),k=oa(v,"remove"),N=oa(v,"nextSibling"),A=oa(v,"childNodes"),B=oa(v,"parentNode"),P=oa(v,"shadowRoot"),X=oa(v,"attributes"),R=h&&h.prototype?oa(h.prototype,"nodeType"):null,Y=h&&h.prototype?oa(h.prototype,"nodeName"):null;if(typeof d=="function"){const me=r.createElement("template");me.content&&me.content.ownerDocument&&(r=me.content.ownerDocument)}let L,Z="",D,z=!1,te=0;const J=function(){if(te>0)throw xr('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.')},fe=function(T){J(),te++;try{return L.createHTML(T)}finally{te--}},be=function(T){J(),te++;try{return L.createScriptURL(T)}finally{te--}},Ne=function(){return z||(D=A1(j,o),z=!0),D},Se=r,V=Se.implementation,pe=Se.createNodeIterator,H=Se.createDocumentFragment,_e=Se.getElementsByTagName,K=c.importNode;let E=ib();s.isSupported=typeof C_=="function"&&typeof B=="function"&&V&&V.createHTMLDocument!==void 0;const G=b1,de=_1,xe=y1,ke=v1,Re=j1,Me=S1,Xe=w1,We=N1;let kn=lb,Be=null;const dt=yt({},[...Px,...Yh,...$h,...Xh,...eb]);let nt=null;const Ot=yt({},[...tb,...Vh,...nb,..._f]);let et=Object.seal(Cc(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Jt=null,Fn=null;const gt=Object.seal(Cc(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Jn=!0,$t=!0,zn=!1,Un=!0,St=!1,_t=!0,Zt=!1,Lt=!1,sn=null,xt=null,rt=!1,mn=!1,gn=!1,Nn=!1,an=!0,zt=!1;const rn="user-content-";let wt=!0,Wn=!1,se={},ge=null;const He=yt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Ke=null;const Ue=yt({},["audio","video","img","source","image","track"]);let I=null;const ae=yt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),we="http://www.w3.org/1998/Math/MathML",qe="http://www.w3.org/2000/svg",at="http://www.w3.org/1999/xhtml";let xn=at,Hn=!1,wl=null;const pl=yt({},[we,qe,at],Gh),as=ll(["mi","mo","mn","ms","mtext"]);let Us=yt({},as);const is=ll(["annotation-xml"]);let rs=yt({},is);const cs=yt({},["title","style","font","a","script"]);let al=null;const Pn=["application/xhtml+xml","text/html"],lt="text/html";let Qe=null,fn=null;const kl=r.createElement("form"),il=function(T){return T instanceof RegExp||T instanceof Function},Wt=function(){let T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(fn&&fn===T)return;(!T||typeof T!="object")&&(T={}),T=Sl(T),al=Pn.indexOf(T.PARSER_MEDIA_TYPE)===-1?lt:T.PARSER_MEDIA_TYPE,Qe=al==="application/xhtml+xml"?Gh:Vo,Be=Ei(T,"ALLOWED_TAGS",dt,{transform:Qe}),nt=Ei(T,"ALLOWED_ATTR",Ot,{transform:Qe}),wl=Ei(T,"ALLOWED_NAMESPACES",pl,{transform:Gh}),I=Ei(T,"ADD_URI_SAFE_ATTR",ae,{transform:Qe,base:ae}),Ke=Ei(T,"ADD_DATA_URI_TAGS",Ue,{transform:Qe,base:Ue}),ge=Ei(T,"FORBID_CONTENTS",He,{transform:Qe}),Jt=Ei(T,"FORBID_TAGS",Sl({}),{transform:Qe}),Fn=Ei(T,"FORBID_ATTR",Sl({}),{transform:Qe}),se=Zn(T,"USE_PROFILES")?T.USE_PROFILES&&typeof T.USE_PROFILES=="object"?Sl(T.USE_PROFILES):T.USE_PROFILES:!1,Jn=T.ALLOW_ARIA_ATTR!==!1,$t=T.ALLOW_DATA_ATTR!==!1,zn=T.ALLOW_UNKNOWN_PROTOCOLS||!1,Un=T.ALLOW_SELF_CLOSE_IN_ATTR!==!1,St=T.SAFE_FOR_TEMPLATES||!1,_t=T.SAFE_FOR_XML!==!1,Zt=T.WHOLE_DOCUMENT||!1,mn=T.RETURN_DOM||!1,gn=T.RETURN_DOM_FRAGMENT||!1,Nn=T.RETURN_TRUSTED_TYPE||!1,rt=T.FORCE_BODY||!1,an=T.SANITIZE_DOM!==!1,zt=T.SANITIZE_NAMED_PROPS||!1,wt=T.KEEP_CONTENT!==!1,Wn=T.IN_PLACE||!1,kn=m1(T.ALLOWED_URI_REGEXP)?T.ALLOWED_URI_REGEXP:lb,xn=typeof T.NAMESPACE=="string"?T.NAMESPACE:at,Us=Zn(T,"MATHML_TEXT_INTEGRATION_POINTS")&&T.MATHML_TEXT_INTEGRATION_POINTS&&typeof T.MATHML_TEXT_INTEGRATION_POINTS=="object"?Sl(T.MATHML_TEXT_INTEGRATION_POINTS):yt({},as),rs=Zn(T,"HTML_INTEGRATION_POINTS")&&T.HTML_INTEGRATION_POINTS&&typeof T.HTML_INTEGRATION_POINTS=="object"?Sl(T.HTML_INTEGRATION_POINTS):yt({},is);const $=Zn(T,"CUSTOM_ELEMENT_HANDLING")&&T.CUSTOM_ELEMENT_HANDLING&&typeof T.CUSTOM_ELEMENT_HANDLING=="object"?Sl(T.CUSTOM_ELEMENT_HANDLING):Cc(null);if(et=Cc(null),Zn($,"tagNameCheck")&&il($.tagNameCheck)&&(et.tagNameCheck=$.tagNameCheck),Zn($,"attributeNameCheck")&&il($.attributeNameCheck)&&(et.attributeNameCheck=$.attributeNameCheck),Zn($,"allowCustomizedBuiltInElements")&&typeof $.allowCustomizedBuiltInElements=="boolean"&&(et.allowCustomizedBuiltInElements=$.allowCustomizedBuiltInElements),sl(et),St&&($t=!1),gn&&(mn=!0),se&&(Be=yt({},eb),nt=Cc(null),se.html===!0&&(yt(Be,Px),yt(nt,tb)),se.svg===!0&&(yt(Be,Yh),yt(nt,Vh),yt(nt,_f)),se.svgFilters===!0&&(yt(Be,$h),yt(nt,Vh),yt(nt,_f)),se.mathMl===!0&&(yt(Be,Xh),yt(nt,nb),yt(nt,_f))),gt.tagCheck=null,gt.attributeCheck=null,Zn(T,"ADD_TAGS")&&(typeof T.ADD_TAGS=="function"?gt.tagCheck=T.ADD_TAGS:Di(T.ADD_TAGS)&&(Be===dt&&(Be=Sl(Be)),yt(Be,T.ADD_TAGS,Qe))),Zn(T,"ADD_ATTR")&&(typeof T.ADD_ATTR=="function"?gt.attributeCheck=T.ADD_ATTR:Di(T.ADD_ATTR)&&(nt===Ot&&(nt=Sl(nt)),yt(nt,T.ADD_ATTR,Qe))),Zn(T,"ADD_URI_SAFE_ATTR")&&Di(T.ADD_URI_SAFE_ATTR)&&yt(I,T.ADD_URI_SAFE_ATTR,Qe),Zn(T,"FORBID_CONTENTS")&&Di(T.FORBID_CONTENTS)&&(ge===He&&(ge=Sl(ge)),yt(ge,T.FORBID_CONTENTS,Qe)),Zn(T,"ADD_FORBID_CONTENTS")&&Di(T.ADD_FORBID_CONTENTS)&&(ge===He&&(ge=Sl(ge)),yt(ge,T.ADD_FORBID_CONTENTS,Qe)),wt&&(Be["#text"]=!0),Zt&&yt(Be,["html","head","body"]),Be.table&&(yt(Be,["tbody"]),delete Jt.tbody),T.TRUSTED_TYPES_POLICY){if(typeof T.TRUSTED_TYPES_POLICY.createHTML!="function")throw xr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof T.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw xr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const ue=L;L=T.TRUSTED_TYPES_POLICY;try{Z=fe("")}catch(ye){throw L=ue,ye}}else T.TRUSTED_TYPES_POLICY===null?(L=void 0,Z=""):(L===void 0&&(L=Ne()),L&&typeof Z=="string"&&(Z=fe("")));ll&&ll(T),fn=T},os=yt({},[...Yh,...$h,...g1]),bt=yt({},[...Xh,...x1]),us=function(T,$,ue){return $.namespaceURI===at?T==="svg":$.namespaceURI===we?T==="svg"&&(ue==="annotation-xml"||Us[ue]):!!os[T]},Ve=function(T,$,ue){return $.namespaceURI===at?T==="math":$.namespaceURI===qe?T==="math"&&rs[ue]:!!bt[T]},ml=function(T,$,ue){return $.namespaceURI===qe&&!rs[ue]||$.namespaceURI===we&&!Us[ue]?!1:!bt[T]&&(cs[T]||!os[T])},Pt=function(T){let $=B(T);(!$||!$.tagName)&&($={namespaceURI:xn,tagName:"template"});const ue=Vo(T.tagName),ye=Vo($.tagName);return wl[T.namespaceURI]?T.namespaceURI===qe?us(ue,$,ye):T.namespaceURI===we?Ve(ue,$,ye):T.namespaceURI===at?ml(ue,$,ye):!!(al==="application/xhtml+xml"&&wl[T.namespaceURI]):!1},cn=function(T){kc(s.removed,{element:T});try{B(T).removeChild(T)}catch{if(k(T),!B(T))throw xr("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},ht=function(T){Xt(T);const $=A(T);if($){const ye=[];wc($,Le=>{kc(ye,Le)}),wc(ye,Le=>{try{k(Le)}catch{}})}const ue=X(T);if(ue)for(let ye=ue.length-1;ye>=0;--ye){const Le=ue[ye],Ee=Le&&Le.name;if(typeof Ee=="string")try{T.removeAttribute(Ee)}catch{}}},rl=function(T,$){try{kc(s.removed,{attribute:$.getAttributeNode(T),from:$})}catch{kc(s.removed,{attribute:null,from:$})}if($.removeAttribute(T),T==="is")if(mn||gn)try{cn($)}catch{}else try{$.setAttribute(T,"")}catch{}},cl=function(T){const $=X(T);if($)for(let ue=$.length-1;ue>=0;--ue){const ye=$[ue],Le=ye&&ye.name;if(!(typeof Le!="string"||nt[Qe(Le)]))try{T.removeAttribute(Le)}catch{}}},Xt=function(T){const $=[T];for(;$.length>0;){const ue=$.pop();(R?R(ue):ue.nodeType)===Xl.element&&cl(ue);const Le=A(ue);if(Le)for(let Ee=Le.length-1;Ee>=0;--Ee)$.push(Le[Ee])}},Tn=function(T){if(!_t)return;const $=[T];for(;$.length>0;){const ue=$.pop(),ye=R?R(ue):ue.nodeType;if(ye===Xl.processingInstruction||ye===Xl.comment&&Kn(ab,ue.data)){try{k(ue)}catch{}continue}if(ye===Xl.element){const Ee=ue,Et=Qe(Y?Y(ue):ue.nodeName);try{Ee.hasAttribute&&Ee.hasAttribute("patchsrc")&&Ee.removeAttribute("patchsrc"),Ee.hasAttribute&&Ee.hasAttribute("for")&&Et!=="label"&&Et!=="output"&&Ee.removeAttribute("for")}catch{}}const Le=A(ue);if(Le)for(let Ee=Le.length-1;Ee>=0;--Ee)$.push(Le[Ee])}},Tt=function(T){let $=null,ue=null;if(rt)T="<remove></remove>"+T;else{const Ee=Zx(T,/^[\r\n\t ]+/);ue=Ee&&Ee[0]}al==="application/xhtml+xml"&&xn===at&&(T='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+T+"</body></html>");const ye=L?fe(T):T;if(xn===at)try{$=new y().parseFromString(ye,al)}catch{}if(!$||!$.documentElement){$=V.createDocument(xn,"template",null);try{$.documentElement.innerHTML=Hn?Z:ye}catch{}}const Le=$.body||$.documentElement;return T&&ue&&Le.insertBefore(r.createTextNode(ue),Le.childNodes[0]||null),xn===at?_e.call($,Zt?"html":"body")[0]:Zt?$.documentElement:Le},ol=function(T){return pe.call(T.ownerDocument||T,T,g.SHOW_ELEMENT|g.SHOW_COMMENT|g.SHOW_TEXT|g.SHOW_PROCESSING_INSTRUCTION|g.SHOW_CDATA_SECTION,null)},Hl=function(T){return T=Ho(T,G," "),T=Ho(T,de," "),T=Ho(T,xe," "),T},Vl=function(T){var $;T.normalize();const ue=pe.call(T.ownerDocument||T,T,g.SHOW_TEXT|g.SHOW_COMMENT|g.SHOW_CDATA_SECTION|g.SHOW_PROCESSING_INSTRUCTION,null);let ye=ue.nextNode();for(;ye;)ye.data=Hl(ye.data),ye=ue.nextNode();const Le=($=T.querySelectorAll)===null||$===void 0?void 0:$.call(T,"template");Le&&wc(Le,Ee=>{$n(Ee.content)&&Vl(Ee.content)})},Bl=function(T){const $=Y?Y(T):null;return typeof $!="string"||Qe($)!=="form"?!1:typeof T.nodeName!="string"||typeof T.textContent!="string"||typeof T.removeChild!="function"||T.attributes!==X(T)||typeof T.removeAttribute!="function"||typeof T.setAttribute!="function"||typeof T.namespaceURI!="string"||typeof T.insertBefore!="function"||typeof T.hasChildNodes!="function"||T.nodeType!==R(T)||T.childNodes!==A(T)},$n=function(T){if(!R||typeof T!="object"||T===null)return!1;try{return R(T)===Xl.documentFragment}catch{return!1}},yn=function(T){if(!R||typeof T!="object"||T===null)return!1;try{return typeof R(T)=="number"}catch{return!1}};function it(me,T,$){me.length!==0&&wc(me,ue=>{ue.call(s,T,$,fn)})}const fs=function(T,$){return!!(_t&&T.hasChildNodes()&&!yn(T.firstElementChild)&&Kn(sb,T.textContent)&&Kn(sb,T.innerHTML)||_t&&T.namespaceURI===at&&$==="style"&&yn(T.firstElementChild)||T.nodeType===Xl.processingInstruction||_t&&T.nodeType===Xl.comment&&Kn(ab,T.data))},Hs=function(T,$){if(!Jt[$]&&Is($)&&(et.tagNameCheck instanceof RegExp&&Kn(et.tagNameCheck,$)||et.tagNameCheck instanceof Function&&et.tagNameCheck($)))return!1;if(wt&&!ge[$]){const ue=B(T),ye=A(T);if(ye&&ue){const Le=ye.length;for(let Ee=Le-1;Ee>=0;--Ee){const Et=Wn?ye[Ee]:C(ye[Ee],!0);ue.insertBefore(Et,N(T))}}}return cn(T),!0},Ql=function(T,$){if(it(E.beforeSanitizeElements,T,null),T!==$&&B(T)===null)return!0;if(Bl(T))return cn(T),!0;const ue=Qe(Y?Y(T):T.nodeName);if(it(E.uponSanitizeElement,T,{tagName:ue,allowedTags:Be}),T!==$&&B(T)===null)return!0;if(fs(T,ue))return cn(T),!0;if(Jt[ue]||!(gt.tagCheck instanceof Function&&gt.tagCheck(ue))&&!Be[ue]){const Le=Hs(T,ue);return Le===!1&&it(E.afterSanitizeElements,T,null),Le}if((R?R(T):T.nodeType)===Xl.element&&!Pt(T)||(ue==="noscript"||ue==="noembed"||ue==="noframes")&&Kn(T1,T.innerHTML))return cn(T),!0;if(St&&T.nodeType===Xl.text){const Le=Hl(T.textContent);T.textContent!==Le&&(kc(s.removed,{element:T.cloneNode()}),T.textContent=Le)}return it(E.afterSanitizeElements,T,null),!1},Bs=function(T,$,ue){if(Fn[$]||_t&&$==="patchsrc"||_t&&$==="for"&&T!=="label"&&T!=="output"||an&&($==="id"||$==="name")&&(ue in r||ue in kl))return!1;const ye=nt[$]||gt.attributeCheck instanceof Function&&gt.attributeCheck($,T);if(!($t&&Kn(ke,$))){if(!(Jn&&Kn(Re,$))){if(ye){if(!I[$]){if(!Kn(kn,Ho(ue,Xe,""))){if(!(($==="src"||$==="xlink:href"||$==="href")&&T!=="script"&&Fx(ue,"data:")===0&&Ke[T])){if(!(zn&&!Kn(Me,Ho(ue,Xe,"")))){if(ue)return!1}}}}}else if(!(Is(T)&&(et.tagNameCheck instanceof RegExp&&Kn(et.tagNameCheck,T)||et.tagNameCheck instanceof Function&&et.tagNameCheck(T))&&(et.attributeNameCheck instanceof RegExp&&Kn(et.attributeNameCheck,$)||et.attributeNameCheck instanceof Function&&et.attributeNameCheck($,T))||$==="is"&&et.allowCustomizedBuiltInElements&&(et.tagNameCheck instanceof RegExp&&Kn(et.tagNameCheck,ue)||et.tagNameCheck instanceof Function&&et.tagNameCheck(ue))))return!1}}return!0},ds=yt({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Is=function(T){return!ds[Vo(T)]&&Kn(We,T)},Xn=function(T,$,ue,ye){if(L&&typeof j=="object"&&typeof j.getAttributeType=="function"&&!ue)switch(j.getAttributeType(T,$)){case"TrustedHTML":return fe(ye);case"TrustedScriptURL":return be(ye)}return ye},ga=function(T,$,ue,ye){try{ue?T.setAttributeNS(ue,$,ye):T.setAttribute($,ye),Bl(T)?cn(T):Kx(s.removed)}catch{rl($,T)}},hs=function(T){it(E.beforeSanitizeAttributes,T,null);const $=T.attributes;if(!$||Bl(T))return;const ue={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:nt,forceKeepAttr:void 0};let ye=$.length;const Le=Qe(T.nodeName);for(;ye--;){const Ee=$[ye],Et=Ee.name,Ft=Ee.namespaceURI,Vt=Ee.value,st=Qe(Et),dn=Vt;let Mt=Et==="value"?dn:o1(dn);if(ue.attrName=st,ue.attrValue=Mt,ue.keepAttr=!0,ue.forceKeepAttr=void 0,it(E.uponSanitizeAttribute,T,ue),Mt=ue.attrValue,zt&&(st==="id"||st==="name")&&Fx(Mt,rn)!==0&&(rl(Et,T),Mt=rn+Mt),_t&&Kn(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Mt)){rl(Et,T);continue}if(st==="attributename"&&Zx(Mt,"href")){rl(Et,T);continue}if(!ue.forceKeepAttr){if(!ue.keepAttr){rl(Et,T);continue}if(!Un&&Kn(E1,Mt)){rl(Et,T);continue}if(St&&(Mt=Hl(Mt)),!Bs(Le,st,Mt)){rl(Et,T);continue}Mt=Xn(Le,st,Ft,Mt),Mt!==dn&&ga(T,Et,Ft,Mt)}}it(E.afterSanitizeAttributes,T,null)},gl=function(T){let $=null;const ue=ol(T);for(it(E.beforeSanitizeShadowDOM,T,null);$=ue.nextNode();)if(it(E.uponSanitizeShadowNode,$,null),Ql($,T),hs($),$n($.content)&&gl($.content),(R?R($):$.nodeType)===Xl.element){const Le=P($);$n(Le)&&(Nl(Le),gl(Le))}it(E.afterSanitizeShadowDOM,T,null)},Nl=function(T){const $=[{node:T,shadow:null}];for(;$.length>0;){const ue=$.pop();if(ue.shadow){gl(ue.shadow);continue}const ye=ue.node,Ee=(R?R(ye):ye.nodeType)===Xl.element,Et=A(ye);if(Et)for(let Ft=Et.length-1;Ft>=0;--Ft)$.push({node:Et[Ft],shadow:null});if(Ee){const Ft=Y?Y(ye):null;if(typeof Ft=="string"&&Qe(Ft)==="template"){const Vt=ye.content;$n(Vt)&&$.push({node:Vt,shadow:null})}}if(Ee){const Ft=P(ye);$n(Ft)&&$.push({node:null,shadow:Ft},{node:Ft,shadow:null})}}};return s.sanitize=function(me){let T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},$=null,ue=null,ye=null,Le=null;if(Hn=!me,Hn&&(me="<!-->"),typeof me!="string"&&!yn(me)&&(me=p1(me),typeof me!="string"))throw xr("dirty is not a string, aborting");if(!s.isSupported)return me;Lt?(Be=sn,nt=xt):Wt(T),(E.uponSanitizeElement.length>0||E.uponSanitizeAttribute.length>0)&&(Be=Sl(Be)),E.uponSanitizeAttribute.length>0&&(nt=Sl(nt)),s.removed=[];const Ee=Wn&&typeof me!="string"&&yn(me);if(Ee){Tn(me);const st=Y?Y(me):me.nodeName;if(typeof st=="string"){const dn=Qe(st);if(!Be[dn]||Jt[dn])throw ht(me),xr("root node is forbidden and cannot be sanitized in-place")}if(Bl(me))throw ht(me),xr("root node is clobbered and cannot be sanitized in-place");try{Nl(me)}catch(dn){throw ht(me),dn}}else if(yn(me))$=Tt("<!---->"),ue=$.ownerDocument.importNode(me,!0),ue.nodeType===Xl.element&&ue.nodeName==="BODY"||ue.nodeName==="HTML"?$=ue:$.appendChild(ue),Nl(ue);else{if(!mn&&!St&&!Zt&&me.indexOf("<")===-1)return L&&Nn?fe(me):me;if($=Tt(me),!$)return mn?null:Nn?Z:""}$&&rt&&cn($.firstChild);const Et=Ee?me:$,Ft=ol(Et);try{for(;ye=Ft.nextNode();)Ql(ye,Et),hs(ye),$n(ye.content)&&gl(ye.content)}catch(st){throw Ee&&(ht(me),wc(s.removed,dn=>{dn.element&&Xt(dn.element)})),st}if(Ee)return wc(s.removed,st=>{st.element&&Xt(st.element)}),St&&Vl(me),me;if(mn){if(St&&Vl($),gn)for(Le=H.call($.ownerDocument);$.firstChild;)Le.appendChild($.firstChild);else Le=$;return(nt.shadowroot||nt.shadowrootmode)&&(Le=K.call(c,Le,!0)),Le}let Vt=Zt?$.outerHTML:$.innerHTML;return Zt&&Be["!doctype"]&&$.ownerDocument&&$.ownerDocument.doctype&&$.ownerDocument.doctype.name&&Kn(k1,$.ownerDocument.doctype.name)&&(Vt="<!DOCTYPE "+$.ownerDocument.doctype.name+`>
116
- `+Vt),St&&(Vt=Hl(Vt)),L&&Nn?fe(Vt):Vt},s.setConfig=function(){let me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Wt(me),Lt=!0,sn=Be,xt=nt},s.clearConfig=function(){fn=null,Lt=!1,sn=null,xt=null,L=D,Z=""},s.isValidAttribute=function(me,T,$){fn||Wt({});const ue=Qe(me),ye=Qe(T);return Bs(ue,ye,$)},s.addHook=function(me,T){typeof T=="function"&&Zn(E,me)&&kc(E[me],T)},s.removeHook=function(me,T){if(Zn(E,me)){if(T!==void 0){const $=r1(E[me],T);return $===-1?void 0:c1(E[me],$,1)[0]}return Kx(E[me])}},s.removeHooks=function(me){Zn(E,me)&&(E[me]=[])},s.removeAllHooks=function(){E=ib()},s}var M1=M_();const R1=1024;let D1=0;class ss{constructor(s,r){this.from=s,this.to=r}}class ln{constructor(s={}){this.id=D1++,this.perNode=!!s.perNode,this.deserialize=s.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=s.combine||null}add(s){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof s!="function"&&(s=zs.match(s)),r=>{let c=s(r);return c===void 0?null:[this,c]}}}ln.closedBy=new ln({deserialize:l=>l.split(" ")});ln.openedBy=new ln({deserialize:l=>l.split(" ")});ln.group=new ln({deserialize:l=>l.split(" ")});ln.isolate=new ln({deserialize:l=>{if(l&&l!="rtl"&&l!="ltr"&&l!="auto")throw new RangeError("Invalid value for isolate: "+l);return l||"auto"}});ln.contextHash=new ln({perNode:!0});ln.lookAhead=new ln({perNode:!0});ln.mounted=new ln({perNode:!0});class Dc{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[ln.mounted.id]}}const O1=Object.create(null);class zs{constructor(s,r,c,o=0){this.name=s,this.props=r,this.id=c,this.flags=o}static define(s){let r=s.props&&s.props.length?Object.create(null):O1,c=(s.top?1:0)|(s.skipped?2:0)|(s.error?4:0)|(s.name==null?8:0),o=new zs(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(ln.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(ln.group),d=-1;d<(o?o.length:0);d++){let h=r[d<0?c.name:o[d]];if(h)return h}}}}zs.none=new zs("",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 zs(c.name,o,c.id,c.flags):c)}return new R_(r)}}const yf=new WeakMap,rb=new WeakMap;var tn;(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"})(tn||(tn={}));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=Dc.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=yf.get(this)||this.topNode,d=new Xf(o);return d.moveTo(s,r),yf.set(this,d._tree),d}get topNode(){return new hl(this,0,0,null)}resolve(s,r=0){let c=Zo(yf.get(this)||this.topNode,s,r,!1);return yf.set(this,c),c}resolveInner(s,r=0){let c=Zo(rb.get(this)||this.topNode,s,r,!0);return rb.set(this,c),c}resolveStack(s,r=0){return U1(this,s,r)}iterate(s){let{enter:r,leave:c,from:o=0,to:d=this.length}=s,h=s.mode||0,m=(h&tn.IncludeAnonymous)>0;for(let g=this.cursor(h|tn.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:Rp(zs.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(zs.none,r,c,o)))}static build(s){return H1(s)}}Ul.empty=new Ul(zs.none,[],[],0);class Ap{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 Ap(this.buffer,this.index)}}class Ui{constructor(s,r,c){this.buffer=s,this.length=r,this.set=c}get type(){return zs.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 Ui(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 Zo(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 hl&&l.index<0?null:l.parent;if(!h)return l;l=h}let d=c?0:tn.IgnoreOverlays;if(c)for(let h=l,m=h.parent;m;h=m,m=h.parent)h instanceof hl&&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 Zo(this,s,r,!1)}resolveInner(s,r=0){return Zo(this,s,r,!0)}matchContext(s){return hp(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 hl 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&tn.EnterBracketed&&y instanceof Ul&&(v=Dc.get(y))&&!v.overlay&&v.bracketed&&c>=j&&c<=j+y.length)&&!D_(o,c,j,j+y.length))){if(y instanceof Ui){if(d&tn.ExcludeBuffers)continue;let C=y.findChild(0,y.buffer.length,r,c-j,o);if(C>-1)return new pa(new L1(h,y,s,j),null,C)}else if(d&tn.IncludeAnonymous||!y.type.isAnonymous||Mp(y)){let C;if(!(d&tn.IgnoreMounts)&&(C=Dc.get(y))&&!C.overlay)return new hl(C.tree,j,s,h);let k=new hl(y,j,s,h);return d&tn.IncludeAnonymous||!k.type.isAnonymous?k:k.nextChild(r<0?y.children.length-1:0,r,c,o,d)}}}if(d&tn.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&tn.IgnoreOverlays)&&(o=Dc.get(this._tree))&&o.overlay){let d=s-this.from,h=c&tn.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 hl(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 hp(l,s,r=s.length-1){for(let c=l;r>=0;c=c.parent){if(!c)return!1;if(!c.type.isAnonymous){if(s[r]&&s[r]!=c.name)return!1;r--}}return!0}class L1{constructor(s,r,c,o){this.parent=s,this.buffer=r,this.index=c,this.start=o}}class pa 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 pa(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&tn.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 pa(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 pa(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 pa(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 hl&&r.index<0?null:r.parent,o=l.slice();return c?o[s]=c:o.splice(s,1),new z1(o,r)}class z1{constructor(s,r){this.heads=s,this.node=r}get next(){return L_(this.heads)}}function U1(l,s,r){let c=l.resolveInner(s,r),o=null;for(let d=c instanceof hl?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=Dc.get(d.tree);if(h&&h.overlay&&h.overlay[0].from<=s&&h.overlay[h.overlay.length-1].to>=s){let m=new hl(h.tree,h.overlay[0].from+d.from,-1,d);(o||(o=[c])).push(Zo(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&~tn.EnterBracketed,s instanceof hl)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 hl?(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&tn.ExcludeBuffers?!1:this.enterChild(1,s,r):this.yield(this._tree.enter(s,r,c))}parent(){if(!this.buffer)return this.yieldNode(this.mode&tn.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let s=this.mode&tn.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&tn.IncludeAnonymous||m instanceof Ui||!m.type.isAnonymous||Mp(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 pa(this.buffer,r,this.stack[o]);return this.bufferNode=new pa(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 hp(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 hp(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 Mp(l){return l.children.some(s=>s instanceof Ui||!s.type.isAnonymous||Mp(s))}function H1(l){var s;let{buffer:r,nodeSet:c,maxBufferLength:o=R1,reused:d=[],minRepeatType:h=c.types.length}=l,m=Array.isArray(r)?new Ap(r,r.length):r,g=c.types,x=0,y=0;function j(Y,L,Z,D,z,te){let{id:J,start:fe,end:be,size:Ne}=m,Se=y,V=x;if(Ne<0)if(m.next(),Ne==-1){let E=d[J];Z.push(E),D.push(fe-Y);return}else if(Ne==-3){x=J;return}else if(Ne==-4){y=J;return}else throw new RangeError(`Unrecognized record size: ${Ne}`);let pe=g[J],H,_e,K=fe-Y;if(be-fe<=o&&(_e=A(m.pos-L,z))){let E=new Uint16Array(_e.size-_e.skip),G=m.pos-_e.size,de=E.length;for(;m.pos>G;)de=B(_e.start,E,de);H=new Ui(E,be-_e.start,c),K=_e.start-Y}else{let E=m.pos-Ne;m.next();let G=[],de=[],xe=J>=h?J:-1,ke=0,Re=be;for(;m.pos>E;)xe>=0&&m.id==xe&&m.size>=0?(m.end<=Re-o&&(k(G,de,fe,ke,m.end,Re,xe,Se,V),ke=G.length,Re=m.end),m.next()):te>2500?v(fe,E,G,de):j(fe,E,G,de,xe,te+1);if(xe>=0&&ke>0&&ke<G.length&&k(G,de,fe,ke,fe,Re,xe,Se,V),G.reverse(),de.reverse(),xe>-1&&ke>0){let Me=C(pe,V);H=Rp(pe,G,de,0,G.length,0,be-fe,Me,Me)}else H=N(pe,G,de,be-fe,Se-be,V)}Z.push(H),D.push(K)}function v(Y,L,Z,D){let z=[],te=0,J=-1;for(;m.pos>L;){let{id:fe,start:be,end:Ne,size:Se}=m;if(Se>4)m.next();else{if(J>-1&&be<J)break;J<0&&(J=Ne-o),z.push(fe,be,Ne),te++,m.next()}}if(te){let fe=new Uint16Array(te*4),be=z[z.length-2];for(let Ne=z.length-3,Se=0;Ne>=0;Ne-=3)fe[Se++]=z[Ne],fe[Se++]=z[Ne+1]-be,fe[Se++]=z[Ne+2]-be,fe[Se++]=Se;Z.push(new Ui(fe,z[2]-be,c)),D.push(be-Y)}}function C(Y,L){return(Z,D,z)=>{let te=0,J=Z.length-1,fe,be;if(J>=0&&(fe=Z[J])instanceof Ul){if(!J&&fe.type==Y&&fe.length==z)return fe;(be=fe.prop(ln.lookAhead))&&(te=D[J]+fe.length+be)}return N(Y,Z,D,z,te,L)}}function k(Y,L,Z,D,z,te,J,fe,be){let Ne=[],Se=[];for(;Y.length>D;)Ne.push(Y.pop()),Se.push(L.pop()+Z-z);Y.push(N(c.types[J],Ne,Se,te-z,fe-te,be)),L.push(z-Z)}function N(Y,L,Z,D,z,te,J){if(te){let fe=[ln.contextHash,te];J=J?[fe].concat(J):[fe]}if(z>25){let fe=[ln.lookAhead,z];J=J?[fe].concat(J):[fe]}return new Ul(Y,L,Z,D,J)}function A(Y,L){let Z=m.fork(),D=0,z=0,te=0,J=Z.end-o,fe={size:0,start:0,skip:0};e:for(let be=Z.pos-Y;Z.pos>be;){let Ne=Z.size;if(Z.id==L&&Ne>=0){fe.size=D,fe.start=z,fe.skip=te,te+=4,D+=4,Z.next();continue}let Se=Z.pos-Ne;if(Ne<0||Se<be||Z.start<J)break;let V=Z.id>=h?4:0,pe=Z.start;for(Z.next();Z.pos>Se;){if(Z.size<0)if(Z.size==-3||Z.size==-4)V+=4;else break e;else Z.id>=h&&(V+=4);Z.next()}z=pe,D+=Ne,te+=V}return(L<0||D==Y)&&(fe.size=D,fe.start=z,fe.skip=te),fe.size>4?fe:void 0}function B(Y,L,Z){let{id:D,start:z,end:te,size:J}=m;if(m.next(),J>=0&&D<h){let fe=Z;if(J>4){let be=m.pos-(J-4);for(;m.pos>be;)Z=B(Y,L,Z)}L[--Z]=fe,L[--Z]=te-Y,L[--Z]=z-Y,L[--Z]=D}else J==-3?x=D:J==-4&&(y=D);return Z}let P=[],X=[];for(;m.pos>0;)j(l.start||0,l.bufferStart||0,P,X,-1,0);let R=(s=l.length)!==null&&s!==void 0?s:P.length?X[0]+P[0].length:0;return new Ul(g[l.topID],P.reverse(),X.reverse(),R)}const ob=new WeakMap;function If(l,s){if(!l.isAnonymous||s instanceof Ui||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 Rp(l,s,r,c,o,d,h,m,g){let x=0;for(let k=c;k<o;k++)x+=If(l,s[k]);let y=Math.ceil(x*1.5/8),j=[],v=[];function C(k,N,A,B,P){for(let X=A;X<B;){let R=X,Y=N[X],L=If(l,k[X]);for(X++;X<B;X++){let Z=If(l,k[X]);if(L+Z>=y)break;L+=Z}if(X==R+1){if(L>y){let Z=k[R];C(Z.children,Z.positions,0,Z.children.length,N[R]+P);continue}j.push(k[R])}else{let Z=N[X-1]+k[X-1].length-Y;j.push(Rp(l,k,N,R,X,Y,Z,null,g))}v.push(Y+P-d)}}return C(s,r,c,o,0),(m||g)(j,v,h)}class GN{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 pa?this.setBuffer(s.context.buffer,s.index,r):s instanceof hl&&this.map.set(s.tree,r)}get(s){return s instanceof pa?this.getBuffer(s.context.buffer,s.index):s instanceof hl?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 Fo{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 Fo(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,k=Math.min(v.to,j)-x;v=C>=k?null:new Fo(C,k,v.tree,v.offset+x,m>0,!!y)}if(v&&o.push(v),h.to>j)break;h=d<s.length?s[d++]:null}if(!y)break;g=y.toA,x=y.toA-y.toB}return o}}class YN{startParse(s,r,c){return typeof s=="string"&&(s=new B1(s)),c=c?c.length?c.map(o=>new ss(o.from,o.to)):[new ss(0,0)]:[new ss(0,s.length)],this.createParse(s,r||[],c)}parse(s,r,c){let o=this.startParse(s,r,c);for(;;){let d=o.advance();if(d)return d}}}class B1{constructor(s){this.string=s}get length(){return this.string.length}chunk(s){return this.string.slice(s)}get lineChunks(){return!1}read(s,r){return this.string.slice(s,r)}}function $N(l){return(s,r,c,o)=>new q1(s,l,r,c,o)}class ub{constructor(s,r,c,o,d,h){this.parser=s,this.parse=r,this.overlay=c,this.bracketed=o,this.target=d,this.from=h}}function fb(l){if(!l.length||l.some(s=>s.from>=s.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(l))}class I1{constructor(s,r,c,o,d,h,m,g){this.parser=s,this.predicate=r,this.mounts=c,this.index=o,this.start=d,this.bracketed=h,this.target=m,this.prev=g,this.depth=0,this.ranges=[]}}const pp=new ln({perNode:!0});class q1{constructor(s,r,c,o,d){this.nest=r,this.input=c,this.fragments=o,this.ranges=d,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=s}advance(){if(this.baseParse){let c=this.baseParse.advance();if(!c)return null;if(this.baseParse=null,this.baseTree=c,this.startInner(),this.stoppedAt!=null)for(let o of this.inner)o.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let c=this.baseTree;return this.stoppedAt!=null&&(c=new Ul(c.type,c.children,c.positions,c.length,c.propValues.concat([[pp,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[ln.mounted.id]=new Dc(r,s.overlay,s.parser,s.bracketed),s.target.props=c}return null}get parsedPos(){if(this.baseParse)return 0;let s=this.input.length;for(let r=this.innerDone;r<this.inner.length;r++)this.inner[r].from<s&&(s=Math.min(s,this.inner[r].parse.parsedPos));return s}stopAt(s){if(this.stoppedAt=s,this.baseParse)this.baseParse.stopAt(s);else for(let r=this.innerDone;r<this.inner.length;r++)this.inner[r].parse.stopAt(s)}startInner(){let s=new $1(this.fragments),r=null,c=null,o=new Xf(new hl(this.baseTree,this.ranges[0].from,0,null),tn.IncludeAnonymous|tn.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=G1(c.ranges,o.from,o.to)))m=h!=2;else if(!o.type.isAnonymous&&(d=this.nest(o,this.input))&&(o.from<o.to||!d.overlay)){o.tree||(Y1(o),r&&r.depth++,c&&c.depth++);let x=s.findMounts(o.from,d.parser);if(typeof d.overlay=="function")r=new I1(d.parser,d.overlay,x,this.inner.length,o.from,!!d.bracketed,o.tree,r);else{let y=pb(this.ranges,d.overlay||(o.from<o.to?[new ss(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 ss(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 ss(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 ss(y.from-r.start,y.to-r.start)),r.bracketed,r.target,x[0].from))),r=r.prev}c&&!--c.depth&&(c=c.prev)}}}}function G1(l,s,r){for(let c of l){if(c.from>=r)break;if(c.to>s)return c.from<=s&&c.to>=r?2:1}return 0}function db(l,s,r,c,o,d){if(s<r){let h=l.buffer[s+1];c.push(l.slice(s,r,h)),o.push(h-d)}}function Y1(l){let{node:s}=l,r=[],c=s.context.buffer;do r.push(l.index),l.parent();while(!l.tree);let o=l.tree,d=o.children.indexOf(c),h=o.children[d],m=h.buffer,g=[d];function x(y,j,v,C,k,N){let A=r[N],B=[],P=[];db(h,y,A,B,P,C);let X=m[A+1],R=m[A+2];g.push(B.length);let Y=N?x(A+4,m[A+3],h.set.types[m[A]],X,R-X,N-1):s.toTree();return B.push(Y),P.push(X-C),db(h,m[A+3],j,B,P,C),new Ul(v,B,P,k)}o.children[d]=x(0,m.length,zs.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 hl(j,v+l.from,y,l._tree))}}class hb{constructor(s,r){this.offset=r,this.done=!1,this.cursor=s.cursor(tn.IncludeAnonymous|tn.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,tn.IgnoreOverlays|tn.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 $1{constructor(s){var r;if(this.fragments=s,this.curTo=0,this.fragI=0,s.length){let c=this.curFrag=s[0];this.curTo=(r=c.tree.prop(pp))!==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(pp))!==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(ln.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 ss(g.from,h),g.to>m&&r.splice(d+1,0,new ss(m,g.to))):g.to>m?r[d--]=new ss(m,g.to):r.splice(d--,1))}}return c}function X1(l,s,r,c){let o=0,d=0,h=!1,m=!1,g=-1e9,x=[];for(;;){let y=o==l.length?1e9:h?l[o].to:l[o].from,j=d==s.length?1e9:m?s[d].to:s[d].from;if(h!=m){let v=Math.max(g,r),C=Math.min(y,j,c);v<C&&x.push(new ss(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 ss(v.from+c,v.to+c)),j=X1(s,y,g,x);for(let v=0,C=g;;v++){let k=v==j.length,N=k?x:j[v].from;if(N>C&&r.push(new Fo(C,N,o.tree,-h,d.from>=C||d.openStart,d.to<=N||d.openEnd)),k)break;C=j[v].to}}else r.push(new Fo(g,x,o.tree,-h,d.from>=h||d.openStart,d.to<=m||d.openEnd))}return r}let V1=0;class ls{constructor(s,r,c,o){this.name=s,this.set=r,this.base=c,this.modified=o,this.id=V1++}toString(){let{name:s}=this;for(let r of this.modified)r.name&&(s=`${r.name}(${s})`);return s}static define(s,r){let c=typeof s=="string"?s:"?";if(s instanceof ls&&(r=s),r!=null&&r.base)throw new Error("Can not derive from a modified tag");let o=new ls(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 Q1=0;class Vf{constructor(s){this.name=s,this.instances=[],this.id=Q1++}static get(s,r){if(!r.length)return s;let c=r[0].instances.find(m=>m.base==s&&K1(r,m.modified));if(c)return c;let o=[],d=new ls(s.name,o,s,r);for(let m of r)m.instances.push(d);let h=Z1(r);for(let m of s.set)if(!m.modified.length)for(let g of h)o.push(Vf.get(m,g));return d}}function K1(l,s){return l.length==s.length&&l.every((r,c)=>r==s[c])}function Z1(l){let s=[[]];for(let r=0;r<l.length;r++)for(let c=0,o=s.length;c<o;c++)s.push(s[c].concat(l[r]));return s.sort((r,c)=>c.length-r.length)}function XN(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 Jo(c,h,g>0?d.slice(0,g):null);s[x]=y.sort(s[x])}}return z_.add(s)}const z_=new ln({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 Jo(o.tags,o.mode,o.context);r?r.next=d:c=d,r=d}return c}});class Jo{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}}Jo.empty=new Jo([],2,null);function U_(l,s){let r=Object.create(null);for(let d of l)if(!Array.isArray(d.tag))r[d.tag.id]=d.class;else for(let h of d.tag)r[h.id]=d.class;let{scope:c,all:o=null}=s||{};return{style:d=>{let h=o;for(let m of d)for(let g of m.set){let x=r[g.id];if(x){h=h?h+" "+x:x;break}}return h},scope:c}}function F1(l,s){let r=null;for(let c of l){let o=c.style(s);o&&(r=r?r+" "+o:o)}return r}function J1(l,s,r,c=0,o=l.length){let d=new P1(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),k=C<0?j.length:C;if(k>v&&c(j.slice(v,k),y),C<0)break;o(),v=C+1}m=x}}J1(s,r,(x,y,j)=>{g(x,""),g(y,j)},d,h),g(h,"")}class P1{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=ej(s)||Jo.empty,j=F1(d,y.tags);if(j&&(x&&(x+=" "),x+=j,y.mode==1&&(o+=(o?" ":"")+j)),this.startSpan(Math.max(r,m),x),y.opaque)return;let v=s.tree&&s.tree.prop(ln.mounted);if(v&&v.overlay){let C=s.node.enter(v.overlay[0].from+m,1),k=this.highlighters.filter(A=>!A.scope||A.scope(v.tree.type)),N=s.firstChild();for(let A=0,B=m;;A++){let P=A<v.overlay.length?v.overlay[A]:null,X=P?P.from+m:g,R=Math.max(r,B),Y=Math.min(c,X);if(R<Y&&N)for(;s.from<Y&&(this.highlightRange(s,R,Y,o,d),this.startSpan(Math.min(Y,s.to),x),!(s.to>=X||!s.nextSibling())););if(!P||X>c)break;B=P.to+m,B>r&&(this.highlightRange(C.cursor(),Math.max(r,P.from+m),Math.min(c,B),"",k),this.startSpan(Math.min(c,B),x))}N&&s.parent()}else if(s.firstChild()){v&&(o="");do if(!(s.to<=r)){if(s.from>=c)break;this.highlightRange(s,r,c,o,d),this.startSpan(Math.min(c,s.to),x)}while(s.nextSibling());s.parent()}}}function ej(l){let s=l.type.prop(z_);for(;s&&s.context&&!l.matchContext(s.context);)s=s.next;return s||null}const je=ls.define,vf=je(),Mi=je(),gb=je(Mi),xb=je(Mi),Ri=je(),jf=je(Ri),Qh=je(Ri),ua=je(),br=je(ua),aa=je(),ia=je(),mp=je(),Io=je(mp),Sf=je(),Te={comment:vf,lineComment:je(vf),blockComment:je(vf),docComment:je(vf),name:Mi,variableName:je(Mi),typeName:gb,tagName:je(gb),propertyName:xb,attributeName:je(xb),className:je(Mi),labelName:je(Mi),namespace:je(Mi),macroName:je(Mi),literal:Ri,string:jf,docString:je(jf),character:je(jf),attributeValue:je(jf),number:Qh,integer:je(Qh),float:je(Qh),bool:je(Ri),regexp:je(Ri),escape:je(Ri),color:je(Ri),url:je(Ri),keyword:aa,self:je(aa),null:je(aa),atom:je(aa),unit:je(aa),modifier:je(aa),operatorKeyword:je(aa),controlKeyword:je(aa),definitionKeyword:je(aa),moduleKeyword:je(aa),operator:ia,derefOperator:je(ia),arithmeticOperator:je(ia),logicOperator:je(ia),bitwiseOperator:je(ia),compareOperator:je(ia),updateOperator:je(ia),definitionOperator:je(ia),typeOperator:je(ia),controlOperator:je(ia),punctuation:mp,separator:je(mp),bracket:Io,angleBracket:je(Io),squareBracket:je(Io),paren:je(Io),brace:je(Io),content:ua,heading:br,heading1:je(br),heading2:je(br),heading3:je(br),heading4:je(br),heading5:je(br),heading6:je(br),contentSeparator:je(ua),list:je(ua),quote:je(ua),emphasis:je(ua),strong:je(ua),link:je(ua),monospace:je(ua),strikethrough:je(ua),inserted:je(),deleted:je(),changed:je(),invalid:je(),meta:Sf,documentMeta:je(Sf),annotation:je(Sf),processingInstruction:je(Sf),definition:ls.defineModifier("definition"),constant:ls.defineModifier("constant"),function:ls.defineModifier("function"),standard:ls.defineModifier("standard"),local:ls.defineModifier("local"),special:ls.defineModifier("special")};for(let l in Te){let s=Te[l];s instanceof ls&&(s.name=l)}U_([{tag:Te.link,class:"tok-link"},{tag:Te.heading,class:"tok-heading"},{tag:Te.emphasis,class:"tok-emphasis"},{tag:Te.strong,class:"tok-strong"},{tag:Te.keyword,class:"tok-keyword"},{tag:Te.atom,class:"tok-atom"},{tag:Te.bool,class:"tok-bool"},{tag:Te.url,class:"tok-url"},{tag:Te.labelName,class:"tok-labelName"},{tag:Te.inserted,class:"tok-inserted"},{tag:Te.deleted,class:"tok-deleted"},{tag:Te.literal,class:"tok-literal"},{tag:Te.string,class:"tok-string"},{tag:Te.number,class:"tok-number"},{tag:[Te.regexp,Te.escape,Te.special(Te.string)],class:"tok-string2"},{tag:Te.variableName,class:"tok-variableName"},{tag:Te.local(Te.variableName),class:"tok-variableName tok-local"},{tag:Te.definition(Te.variableName),class:"tok-variableName tok-definition"},{tag:Te.special(Te.variableName),class:"tok-variableName2"},{tag:Te.definition(Te.propertyName),class:"tok-propertyName tok-definition"},{tag:Te.typeName,class:"tok-typeName"},{tag:Te.namespace,class:"tok-namespace"},{tag:Te.className,class:"tok-className"},{tag:Te.macroName,class:"tok-macroName"},{tag:Te.propertyName,class:"tok-propertyName"},{tag:Te.operator,class:"tok-operator"},{tag:Te.comment,class:"tok-comment"},{tag:Te.meta,class:"tok-meta"},{tag:Te.invalid,class:"tok-invalid"},{tag:Te.punctuation,class:"tok-punctuation"}]);const tj="modulepreload",nj=function(l,s){return new URL(l,s).href},bb={},Je=function(s,r,c){let o=Promise.resolve();if(r&&r.length>0){let h=function(y){return Promise.all(y.map(j=>Promise.resolve(j).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};const m=document.getElementsByTagName("link"),g=document.querySelector("meta[property=csp-nonce]"),x=(g==null?void 0:g.nonce)||(g==null?void 0:g.getAttribute("nonce"));o=h(r.map(y=>{if(y=nj(y,c),y in bb)return;bb[y]=!0;const j=y.endsWith(".css"),v=j?'[rel="stylesheet"]':"";if(!!c)for(let N=m.length-1;N>=0;N--){const A=m[N];if(A.href===y&&(!j||A.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${y}"]${v}`))return;const k=document.createElement("link");if(k.rel=j?"stylesheet":tj,j||(k.as="script"),k.crossOrigin="",k.href=y,x&&k.setAttribute("nonce",x),document.head.appendChild(k),j)return new Promise((N,A)=>{k.addEventListener("load",N),k.addEventListener("error",()=>A(new Error(`Unable to preload CSS for ${y}`)))})}))}function d(h){const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=h,window.dispatchEvent(m),!m.defaultPrevented)throw h}return o.then(h=>{for(const m of h||[])m.status==="rejected"&&d(m.reason);return s().catch(d)})},H_={js:async()=>(await Je(async()=>{const{javascript:l}=await import("./index-B5EnmuL9.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({jsx:!0}),cjs:async()=>(await Je(async()=>{const{javascript:l}=await import("./index-B5EnmuL9.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript(),mjs:async()=>(await Je(async()=>{const{javascript:l}=await import("./index-B5EnmuL9.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript(),jsx:async()=>(await Je(async()=>{const{javascript:l}=await import("./index-B5EnmuL9.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({jsx:!0}),ts:async()=>(await Je(async()=>{const{javascript:l}=await import("./index-B5EnmuL9.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),mts:async()=>(await Je(async()=>{const{javascript:l}=await import("./index-B5EnmuL9.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),cts:async()=>(await Je(async()=>{const{javascript:l}=await import("./index-B5EnmuL9.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),tsx:async()=>(await Je(async()=>{const{javascript:l}=await import("./index-B5EnmuL9.js");return{javascript:l}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0,jsx:!0}),json:async()=>(await Je(async()=>{const{json:l}=await import("./index-iBO43oLF.js");return{json:l}},__vite__mapDeps([6,1,2,3,4]),import.meta.url)).json(),jsonc:async()=>(await Je(async()=>{const{json:l}=await import("./index-iBO43oLF.js");return{json:l}},__vite__mapDeps([6,1,2,3,4]),import.meta.url)).json(),css:async()=>(await Je(async()=>{const{css:l}=await import("./index-C4RL1RRN.js");return{css:l}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),scss:async()=>(await Je(async()=>{const{css:l}=await import("./index-C4RL1RRN.js");return{css:l}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),less:async()=>(await Je(async()=>{const{css:l}=await import("./index-C4RL1RRN.js");return{css:l}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),html:async()=>(await Je(async()=>{const{html:l}=await import("./index-BUtKkXYx.js");return{html:l}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),htm:async()=>(await Je(async()=>{const{html:l}=await import("./index-BUtKkXYx.js");return{html:l}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),vue:async()=>(await Je(async()=>{const{html:l}=await import("./index-BUtKkXYx.js");return{html:l}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),svelte:async()=>(await Je(async()=>{const{html:l}=await import("./index-BUtKkXYx.js");return{html:l}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),md:async()=>(await Je(async()=>{const{markdown:l}=await import("./index-BOTbHjsh.js");return{markdown:l}},__vite__mapDeps([9,3,4,2,5,8,1,7,0]),import.meta.url)).markdown(),markdown:async()=>(await Je(async()=>{const{markdown:l}=await import("./index-BOTbHjsh.js");return{markdown:l}},__vite__mapDeps([9,3,4,2,5,8,1,7,0]),import.meta.url)).markdown(),py:async()=>(await Je(async()=>{const{python:l}=await import("./index-Cj3tIh2i.js");return{python:l}},__vite__mapDeps([10,1,2,3,4,5]),import.meta.url)).python(),pyi:async()=>(await Je(async()=>{const{python:l}=await import("./index-Cj3tIh2i.js");return{python:l}},__vite__mapDeps([10,1,2,3,4,5]),import.meta.url)).python(),yaml:async()=>(await Je(async()=>{const{yaml:l}=await import("./index-B54sB01B.js");return{yaml:l}},__vite__mapDeps([11,1,2,3,4]),import.meta.url)).yaml(),yml:async()=>(await Je(async()=>{const{yaml:l}=await import("./index-B54sB01B.js");return{yaml:l}},__vite__mapDeps([11,1,2,3,4]),import.meta.url)).yaml(),rs:async()=>(await Je(async()=>{const{rust:l}=await import("./index-5z-WKiE2.js");return{rust:l}},__vite__mapDeps([12,1,2,3,4]),import.meta.url)).rust(),c:async()=>(await Je(async()=>{const{cpp:l}=await import("./index-BRDMJVs_.js");return{cpp:l}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),h:async()=>(await Je(async()=>{const{cpp:l}=await import("./index-BRDMJVs_.js");return{cpp:l}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),cc:async()=>(await Je(async()=>{const{cpp:l}=await import("./index-BRDMJVs_.js");return{cpp:l}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),cpp:async()=>(await Je(async()=>{const{cpp:l}=await import("./index-BRDMJVs_.js");return{cpp:l}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),hpp:async()=>(await Je(async()=>{const{cpp:l}=await import("./index-BRDMJVs_.js");return{cpp:l}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),java:async()=>(await Je(async()=>{const{java:l}=await import("./index-DiFzORZa.js");return{java:l}},__vite__mapDeps([14,1,2,3,4]),import.meta.url)).java(),go:async()=>(await Je(async()=>{const{go:l}=await import("./index-DqNX5AfU.js");return{go:l}},__vite__mapDeps([15,1,2,3,4,5]),import.meta.url)).go(),php:async()=>(await Je(async()=>{const{php:l}=await import("./index-A6KnUhy4.js");return{php:l}},__vite__mapDeps([16,1,8,7,2,3,4,0,5]),import.meta.url)).php(),sql:async()=>(await Je(async()=>{const{sql:l}=await import("./index-DcOycRyY.js");return{sql:l}},__vite__mapDeps([17,2,3,4,1,5]),import.meta.url)).sql(),xml:async()=>(await Je(async()=>{const{xml:l}=await import("./index-CEtwcv2R.js");return{xml:l}},__vite__mapDeps([18,1,2,3,4]),import.meta.url)).xml(),svg:async()=>(await Je(async()=>{const{xml:l}=await import("./index-CEtwcv2R.js");return{xml:l}},__vite__mapDeps([18,1,2,3,4]),import.meta.url)).xml()},lj={".mcp.json":"json",dockerfile:"yaml",makefile:"yaml"},sj={javascript:"js",node:"js",typescript:"ts",python:"py",python3:"py",yml:"yaml",rust:"rs",golang:"go","c++":"cpp",cplusplus:"cpp"};async function aj(l){const s=sj[l.toLowerCase()]??l.toLowerCase(),r=H_[s];return r?r().catch(()=>null):null}async function ij(l){const s=(l.split("/").pop()??"").toLowerCase(),r=lj[s]??s.split(".").pop()??"",c=H_[r];return c?c().catch(()=>null):null}const rj=U_([{tag:[Te.keyword,Te.modifier,Te.controlKeyword,Te.moduleKeyword],class:"cmh-key"},{tag:[Te.propertyName],class:"cmh-prop"},{tag:[Te.function(Te.variableName),Te.labelName],class:"cmh-fn"},{tag:[Te.color,Te.constant(Te.name),Te.standard(Te.name),Te.bool],class:"cmh-const"},{tag:[Te.typeName,Te.className,Te.changed,Te.annotation,Te.self,Te.namespace],class:"cmh-type"},{tag:[Te.number,Te.integer,Te.float],class:"cmh-num"},{tag:[Te.string,Te.special(Te.string),Te.regexp],class:"cmh-str"},{tag:[Te.operator,Te.operatorKeyword,Te.escape],class:"cmh-op"},{tag:[Te.meta,Te.comment],class:"cmh-comment"},{tag:Te.invalid,class:"cmh-invalid"}]);function wf(l){return l.replace(/[&<>]/g,s=>s==="&"?"&amp;":s==="<"?"&lt;":"&gt;")}async function cj(l,s){const r=s?await aj(s):null;if(!r)return wf(l);try{const c=r.language.parser.parse(l);let o="";return W1(l,c,rj,(d,h)=>{o+=h?`<span class="${h}">${wf(d)}</span>`:wf(d)},()=>{o+=`
118
- `}),o}catch{return wf(l)}}Dt.setOptions({gfm:!0,breaks:!1});function B_(l){var r;const s=(r=l.split(".").pop())==null?void 0:r.toLowerCase();return s==="md"||s==="markdown"}async function td(l){const s=await Dt.parse(l,{async:!0,walkTokens:async r=>{if(r.type!=="code")return;const c=r;c.text=await cj(c.text,c.lang??""),c.escaped=!0}});return M1.sanitize(s)}function _b(l,s){return{path:l.path,text:l.content,saved:l.content,eol:l.eol,encoding:l.encoding,mtime:l.mtime,size:l.size,binary:l.binary,tooLarge:l.tooLarge,mediaMime:l.mediaMime,mediaTooLarge:l.mediaTooLarge,stale:!1,revision:s,previewMode:B_(l.path)}}function qa(l){return!l.binary&&!l.tooLarge&&l.text!==l.saved}function oj(l){return l.split("/").pop()??l}function Er(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 Oi({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(),k=8,N=Math.max(k,Math.min(l,window.innerWidth-C.width-k)),A=Math.max(k,Math.min(s,window.innerHeight-C.height-k));m({left:N,top:A})},[l,s]),_.useLayoutEffect(()=>{var v;(v=d.current)==null||v.focus()},[]),_.useLayoutEffect(()=>{function v(k){var N;(N=d.current)!=null&&N.contains(k.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((k,N)=>({item:k,index:N})).filter(k=>!k.item.disabled);if(C.length!==0){if(v.key==="ArrowDown"||v.key==="ArrowUp"){v.preventDefault();const k=v.key==="ArrowDown"?1:-1,N=C.findIndex(B=>B.index===g),A=C[(((N===-1?0:N)+k)%C.length+C.length)%C.length];A&&x(A.index);return}if(v.key==="Enter"||v.key===" "){v.preventDefault();const k=r[g];k&&y(k)}}}return a.jsxs("div",{ref:d,className:"ctxmenu",style:{left:h.left,top:h.top},role:"menu",tabIndex:-1,onKeyDown:j,children:[c&&a.jsx("div",{className:"ctxmenu__note",children:c}),r.map((v,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 uj=3500,fj=9e3,yb=220;function Rr({result:l,onDismiss:s}){const[r,c]=_.useState(l),[o,d]=_.useState(!1);if(_.useEffect(()=>{if(!l){c(null),d(!1);return}if(c(l),d(!1),l.url)return;const m=l.ok?uj:fj,g=setTimeout(()=>d(!0),m),x=setTimeout(()=>c(null),m+yb);return()=>{clearTimeout(g),clearTimeout(x)}},[l]),!r)return null;const h=()=>{d(!0),setTimeout(()=>{c(null),s==null||s()},yb)};return a.jsxs("div",{className:"oplog "+(r.ok?"oplog--ok":"oplog--bad")+(o?" oplog--leaving":"")+(r.url?" oplog--dismissible":""),role:"status","aria-live":r.ok?"polite":"assertive",children:[r.message,r.url&&a.jsxs("a",{className:"oplog__link",href:r.url,target:"_blank",rel:"noreferrer",onClick:m=>m.stopPropagation(),children:[r.url.replace(/^https?:\/\//,"")," ↗"]}),r.url&&s&&a.jsx("button",{type:"button",className:"oplog__dismiss",title:"Закрыть","aria-label":"Закрыть сообщение",onClick:h,children:"✕"})]})}function ha({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 Vc({active:l}){return l?a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M2 5h3V2"}),a.jsx("path",{d:"M14 5h-3V2"}),a.jsx("path",{d:"M2 11h3v3"}),a.jsx("path",{d:"M14 11h-3v3"})]}):a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M5 2H2v3"}),a.jsx("path",{d:"M11 2h3v3"}),a.jsx("path",{d:"M2 11v3h3"}),a.jsx("path",{d:"M14 11v3h-3"})]})}const dj=500,_r="application/x-ccv-fs-path",hj=200;function pj({open:l,tree:s,expanded:r,activePath:c,dirty:o,gitChanges:d,result:h,searchResult:m,onSearch:g,onReveal:x,onToggle:y,onOpen:j,onCreate:v,onRename:C,onMove:k,onCopy:N,onDelete:A,onRefresh:B,onClose:P,zoomed:X,onToggleZoom:R}){const[Y,L]=_.useState(""),[Z,D]=_.useState(null),[z,te]=_.useState(null),[J,fe]=_.useState(null),[be,Ne]=_.useState(null),[Se,V]=_.useState(null),[pe,H]=_.useState(null),_e=Wf("(hover: hover)"),K=_.useRef(null),E=_.useMemo(()=>xj(d),[d]);function G(se){return!(!J||se===J.path||J.kind==="dir"&&se.startsWith(`${J.path}/`)||se===Er(J.path))}function de(se){return!(!Se||se===Se.path||Se.kind==="dir"&&se.startsWith(`${Se.path}/`)||Se.mode==="cut"&&se===Er(Se.path))}function xe(se){V({path:se.path,kind:se.kind,mode:"copy"})}function ke(se){V({path:se.path,kind:se.kind,mode:"cut"})}function Re(se){!Se||!de(se)||(se&&!r.has(se)&&y(se),Se.mode==="cut"?(k(Se.path,se),V(null)):N(Se.path,se))}function Me(se,ge){const He=se.touches[0];if(!He)return;const Ke={timer:0,x:He.clientX,y:He.clientY,el:se.currentTarget,fired:!1};Ke.timer=window.setTimeout(()=>{Ke.fired=!0,ge(Ke.x,Ke.y,Ke.el)},dj),K.current=Ke}function Xe(se){const ge=K.current,He=se.touches[0];!ge||!He||Math.hypot(He.clientX-ge.x,He.clientY-ge.y)>10&&(window.clearTimeout(ge.timer),K.current=null)}function We(se){const ge=K.current;ge&&(window.clearTimeout(ge.timer),ge.fired&&se.preventDefault())}function kn(){var se;return(se=K.current)!=null&&se.fired?(K.current=null,!0):!1}function Be(se,ge,He,Ke){L((Ke==null?void 0:Ke.path)??""),H({x:se,y:ge,opener:He,entry:Ke})}function dt(){const se=pe==null?void 0:pe.opener;H(null),se!=null&&se.isConnected&&se.focus()}function nt(se){return{onContextMenu:ge=>{ge.preventDefault(),Be(ge.clientX,ge.clientY,ge.currentTarget,se)},onTouchStart:ge=>Me(ge,(He,Ke,Ue)=>Be(He,Ke,Ue,se)),onTouchMove:Xe,onTouchEnd:We,onTouchCancel:We}}function Ot(se){se.target===se.currentTarget&&(se.preventDefault(),Be(se.clientX,se.clientY,se.currentTarget,null))}function et(se){se.target===se.currentTarget&&Me(se,(ge,He,Ke)=>Be(ge,He,Ke,null))}function Jt(se){if(!(se.ctrlKey||se.metaKey)||se.target instanceof HTMLInputElement)return;const ge=se.key.toLowerCase();if(ge==="v"){se.preventDefault(),Re(Nn());return}if(!Y)return;const He=vb(s,Y);He&&(ge==="c"?(se.preventDefault(),xe(He)):ge==="x"&&(se.preventDefault(),ke(He)))}function Fn(se){return ge=>{ge.dataTransfer.effectAllowed="move",ge.dataTransfer.setData(_r,se.path),fe({path:se.path,kind:se.kind})}}function gt(){fe(null),Ne(null)}function Jn(se){return ge=>{ge.dataTransfer.types.includes(_r)&&(ge.stopPropagation(),!(se.kind!=="dir"||!G(se.path))&&(ge.preventDefault(),Ne(se.path)))}}function $t(se){return ge=>{if(!ge.dataTransfer.types.includes(_r)||(ge.stopPropagation(),se.kind!=="dir"||!G(se.path)))return;ge.preventDefault();const He=ge.dataTransfer.getData(_r);Ne(null),He&&k(He,se.path)}}function zn(se){!se.dataTransfer.types.includes(_r)||!G("")||(se.preventDefault(),Ne(""))}function Un(se){if(!se.dataTransfer.types.includes(_r)||!G(""))return;se.preventDefault();const ge=se.dataTransfer.getData(_r);Ne(null),ge&&k(ge,"")}const[St,_t]=_.useState(""),Zt=St.trim(),Lt=Zt.length>0,sn=_.useRef(null),xt=_.useRef(g);xt.current=g;function rt(se){_t(se),sn.current&&clearTimeout(sn.current);const ge=se.trim();if(!ge){xt.current("");return}sn.current=setTimeout(()=>xt.current(ge),hj)}function mn(se){sn.current&&clearTimeout(sn.current),_t(""),xt.current(""),L(se.path),x(se)}const gn=Lt&&(m==null?void 0:m.query)===Zt?m:null;function Nn(){if(Y==="")return"";const se=vb(s,Y);if((se==null?void 0:se.kind)==="dir")return Y;const ge=Y.lastIndexOf("/");return ge===-1?"":Y.slice(0,ge)}function an(se,ge){const He=ge??Nn();He&&!r.has(He)&&y(He),te({parent:He,kind:se})}function zt(){if(!pe)return[];const se=Ke=>_e?Ke:void 0;if(!pe.entry)return[{id:"paste",label:"Вставить в корень проекта",hint:se("Ctrl+V"),disabled:!de(""),onSelect:()=>Re("")},{id:"new-file",label:"Создать файл",onSelect:()=>an("file","")},{id:"new-dir",label:"Создать каталог",onSelect:()=>an("dir","")}];const ge=pe.entry,He=[ge.kind==="file"?{id:"open",label:"Открыть",onSelect:()=>j(ge.path)}:{id:"toggle",label:r.has(ge.path)?"Свернуть":"Развернуть",onSelect:()=>y(ge.path)},{id:"copy",label:"Копировать",hint:se("Ctrl+C"),onSelect:()=>xe(ge)},{id:"cut",label:"Вырезать",hint:se("Ctrl+X"),onSelect:()=>ke(ge)}];return ge.kind==="dir"&&(He.push({id:"paste",label:"Вставить",hint:se("Ctrl+V"),disabled:!de(ge.path),onSelect:()=>Re(ge.path)}),He.push({id:"new-file",label:"Создать файл",onSelect:()=>an("file",ge.path)}),He.push({id:"new-dir",label:"Создать каталог",onSelect:()=>an("dir",ge.path)})),He.push({id:"rename",label:"Переименовать",onSelect:()=>D(ge.path)}),He.push({id:"delete",label:"Удалить",onSelect:()=>A(ge)}),He}const rn=Lt?[]:wt("",0);function wt(se,ge){const He=s[se],Ke=[];if(z&&z.parent===se&&Ke.push(a.jsxs("div",{className:"fsrow fsrow--draft",style:Ga(ge),children:[a.jsx("span",{className:"fsrow__icon",children:z.kind==="dir"?a.jsx(Kf,{}):a.jsx(Zf,{})}),a.jsx(ha,{className:"rename--file",value:"",placeholder:z.kind==="dir"?"имя каталога":"имя файла",onCommit:Ue=>{te(null),v(se,z.kind,Ue)},onCancel:()=>te(null)})]},`draft:${se}`)),!He)return Ke.push(a.jsx("p",{className:"fsrow__pending",style:Ga(ge),children:"читаем…"},`wait:${se}`)),Ke;He.length===0&&!z&&Ke.push(a.jsx("p",{className:"fsrow__pending",style:Ga(ge),children:"пусто"},`empty:${se}`));for(const Ue of He){const I=Ue.kind==="dir"&&r.has(Ue.path);Ke.push(Z===Ue.path?a.jsxs("div",{className:"fsrow fsrow--draft",style:Ga(ge),children:[a.jsx("span",{className:"fsrow__icon",children:Ue.kind==="dir"?a.jsx(Kf,{open:I}):a.jsx(Zf,{})}),a.jsx(ha,{className:"rename--file",value:Ue.name,placeholder:"новое имя",onCommit:ae=>{D(null),C(Ue.path,ae)},onCancel:()=>D(null)})]},Ue.path):a.jsx(mj,{entry:Ue,depth:ge,open:I,active:Ue.path===c,selected:Ue.path===Y,dirty:o.has(Ue.path),gitStatus:E.get(Ue.path),dragging:(J==null?void 0:J.path)===Ue.path,dropTarget:be===Ue.path,cut:(Se==null?void 0:Se.mode)==="cut"&&Se.path===Ue.path,onClick:()=>{kn()||(L(Ue.path),Ue.kind==="dir"?y(Ue.path):j(Ue.path))},onRename:()=>D(Ue.path),onDelete:()=>A(Ue),onDragStart:Fn(Ue),onDragEnd:gt,onDragOver:Jn(Ue),onDrop:$t(Ue),...nt(Ue)},Ue.path)),I&&Ke.push(...wt(Ue.path,ge+1))}return Ke}function Wn(){if(!gn)return[a.jsx("p",{className:"fsrow__pending",style:Ga(0),children:"ищем…"},"search:wait")];if(gn.entries.length===0)return[a.jsx("p",{className:"fsrow__pending",style:Ga(0),children:"ничего не найдено"},"search:empty")];const se=gn.entries.map(ge=>a.jsx(gj,{entry:ge,gitStatus:E.get(ge.path),onClick:()=>mn(ge)},ge.path));return gn.truncated&&se.push(a.jsxs("p",{className:"fsrow__pending",style:Ga(0),children:["показаны первые ",gn.entries.length," — уточните запрос"]},"search:truncated")),se}return a.jsxs("aside",{className:(l?"sidepane sidepane--files sidepane--open":"sidepane sidepane--files")+(X?" sidepane--zoomed":""),"aria-label":"Файлы проекта",onKeyDown:Jt,children:[a.jsxs("div",{className:"sidepane__head",onDoubleClick:se=>{R&&(se.target.closest("button")||R())},children:[a.jsx(vj,{}),a.jsx("span",{className:"sidepane__title",children:"Файлы"}),a.jsx("button",{className:"sidepane__btn",title:"Новый файл","aria-label":"Новый файл",onClick:()=>an("file"),children:a.jsx(_j,{})}),a.jsx("button",{className:"sidepane__btn",title:"Новый каталог","aria-label":"Новый каталог",onClick:()=>an("dir"),children:a.jsx(yj,{})}),a.jsx("button",{className:"sidepane__btn",title:"Перечитать дерево","aria-label":"Перечитать дерево",onClick:B,children:"↻"}),R&&a.jsx("button",{className:"sidepane__btn",title:X?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":X?"Свернуть панель файлов":"Развернуть панель файлов на весь экран","aria-pressed":X,onClick:R,children:a.jsx(Vc,{active:X})}),a.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель файлов",onClick:P,children:"✕"})]}),a.jsxs("div",{className:"fssearch",children:[a.jsx(jj,{}),a.jsx("input",{className:"fssearch__input",type:"text",value:St,spellCheck:!1,placeholder:"Поиск файлов и папок…","aria-label":"Поиск файлов и папок",onChange:se=>rt(se.target.value),onKeyDown:se=>{se.stopPropagation(),se.key==="Escape"&&(se.preventDefault(),St?rt(""):se.currentTarget.blur())}}),St&&a.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>rt(""),children:"✕"})]}),a.jsx("div",{className:"sidepane__scroll fstree"+(be===""?" fstree--drop-target":""),tabIndex:-1,onDragOver:zn,onDrop:Un,onContextMenu:Ot,onTouchStart:et,onTouchMove:Xe,onTouchEnd:We,onTouchCancel:We,children:Lt?Wn():rn}),a.jsx(Rr,{result:h}),pe&&a.jsx(Oi,{x:pe.x,y:pe.y,items:zt(),onClose:dt})]})}function mj({entry:l,depth:s,open:r,active:c,selected:o,dirty:d,gitStatus:h,dragging:m,dropTarget:g,cut:x,onClick:y,onRename:j,onDelete:v,onDragStart:C,onDragEnd:k,onDragOver:N,onDrop:A,onContextMenu:B,onTouchStart:P,onTouchMove:X,onTouchEnd:R,onTouchCancel:Y}){const L="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:L,style:Ga(s),draggable:!0,onDragStart:C,onDragEnd:k,onDragOver:N,onDrop:A,onContextMenu:B,onTouchStart:P,onTouchMove:X,onTouchEnd:R,onTouchCancel:Y,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 gj({entry:l,gitStatus:s,onClick:r}){const c=l.path.slice(0,l.path.length-l.name.length-1);return a.jsxs("button",{className:"fsrow fsrow--search"+(l.ignored?" fsrow--ignored":""),style:Ga(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 Ga(l){return{"--depth":l}}function vb(l,s){var o;const r=s.lastIndexOf("/"),c=r===-1?"":s.slice(0,r);return((o=l[c])==null?void 0:o.find(d=>d.path===s))??null}function xj(l){const s=new Map,r={added:1,modified:2},c=(o,d)=>{const h=s.get(o);(!h||r[d]>r[h])&&s.set(o,d)};for(const o of l){const d=bj(o.status);if(!d)continue;c(o.path,d);let h=Er(o.path);for(;c(h,d),!!h;)h=Er(h)}return s}function bj(l){if(l==="??")return"added";const[s="",r=""]=l;return s==="A"||s==="R"||s==="C"?"added":s==="M"||r==="M"?"modified":null}function 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 _j(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,"aria-hidden":"true",children:[a.jsxs("g",{transform:"translate(-1.3,-1.6) scale(0.78)",strokeLinejoin:"round",children:[a.jsx("path",{d:"M9 2H4.4a.7.7 0 0 0-.7.7v10.6a.7.7 0 0 0 .7.7h7.2a.7.7 0 0 0 .7-.7V5.2Z"}),a.jsx("path",{d:"M9 2v3.2h3.3"})]}),a.jsx("path",{d:"M12.2 10.3v3.8M10.3 12.2h3.8",strokeLinecap:"round"})]})}function yj(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,"aria-hidden":"true",children:[a.jsx("g",{transform:"translate(-1.3,-1.6) scale(0.78)",children:a.jsx("path",{d:"M2 12.4V4.2a.7.7 0 0 1 .7-.7h3.1l1.5 1.6h5.9a.7.7 0 0 1 .7.7v6.6a.7.7 0 0 1-.7.7H2.7a.7.7 0 0 1-.7-.7Z"})}),a.jsx("path",{d:"M12.2 10.3v3.8M10.3 12.2h3.8",strokeLinecap:"round"})]})}function vj(){return a.jsxs("svg",{className:"sidepane__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M2 4.1V3a.6.6 0 0 1 .6-.6h2.6l1.2 1.4h5a.6.6 0 0 1 .6.6v1.1"}),a.jsx("path",{d:"M2 12.6V5.7h11.4a.6.6 0 0 1 .58.75l-1.5 6.2a.6.6 0 0 1-.58.45H2.6a.6.6 0 0 1-.6-.5Z"})]})}function jj(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[a.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),a.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}const Sj=200;function wj({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(A){g(A),j.current&&clearTimeout(j.current);const B=A.trim();if(!B){v.current("");return}j.current=setTimeout(()=>v.current(B),Sj)}const k=y&&(s==null?void 0:s.query)===x?s:null;function N(){if(!k)return[a.jsx("p",{className:"fsrow__pending",children:"ищем…"},"grep:wait")];if(k.matches.length===0)return[a.jsx("p",{className:"fsrow__pending",children:"ничего не найдено"},"grep:empty")];const A=[];let B="";for(const P of k.matches)P.path!==B&&(B=P.path,A.push(a.jsx("p",{className:"searchgroup__path",title:P.path,children:P.path},`path:${P.path}`))),A.push(a.jsx(kj,{match:P,onClick:()=>c(P)},`${P.path}:${P.line}:${P.column}`));return k.truncated&&A.push(a.jsxs("p",{className:"fsrow__pending",children:["показаны первые ",k.matches.length," — уточните запрос"]},"grep:truncated")),A}return a.jsxs("aside",{className:(l?"sidepane sidepane--search sidepane--open":"sidepane sidepane--search")+(d?" sidepane--zoomed":""),"aria-label":"Поиск по тексту в проекте",children:[a.jsxs("div",{className:"sidepane__head",onDoubleClick:A=>{h&&(A.target.closest("button")||h())},children:[a.jsx(Nj,{}),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(Vc,{active:d})}),a.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель поиска",onClick:o,children:"✕"})]}),a.jsxs("div",{className:"fssearch",children:[a.jsx(Tj,{}),a.jsx("input",{className:"fssearch__input",type:"text",value:m,spellCheck:!1,placeholder:"Поиск по тексту во всех файлах…","aria-label":"Поиск по тексту во всех файлах",onChange:A=>C(A.target.value),onKeyDown:A=>{A.stopPropagation(),A.key==="Escape"&&(A.preventDefault(),m?C(""):A.currentTarget.blur())}}),m&&a.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>C(""),children:"✕"})]}),a.jsx("div",{className:"sidepane__scroll fstree",children:y?N():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 Nj(){return a.jsxs("svg",{className:"sidepane__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[a.jsx("circle",{cx:"6.8",cy:"6.8",r:"4.3"}),a.jsx("path",{d:"M13.2 13.2 10.1 10.1"})]})}function Tj(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[a.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),a.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}let kf=null;function Ej(){return kf||(kf=Promise.all([Je(()=>import("./index-CHk-wT2e.js"),__vite__mapDeps([19,4,3,2,20,5]),import.meta.url),Je(()=>import("./index-891wE-Rj.js").then(l=>l.v),__vite__mapDeps([4,3]),import.meta.url),Je(()=>import("./index-BHot-lnj.js"),[],import.meta.url),Je(()=>import("./index-CftAsWDp.js"),__vite__mapDeps([20,3,4,2]),import.meta.url),Je(()=>import("./codemirror-BVRIW86g.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 kf=null,l})),kf}function Cj({path:l,doc:s,revision:r,goto:c,onChange:o,onSave:d}){const h=_.useRef(null),m=_.useRef(null),g=_.useRef(null),x=_.useRef(new Map),y=_.useRef(new Map),j=_.useRef(new Set),v=_.useRef(null),C=_.useRef(o),k=_.useRef(d),N=_.useRef(l),A=_.useRef(r),B=_.useRef(s);C.current=o,k.current=d,N.current=l,A.current=r,B.current=s;const[P,X]=_.useState("loading"),[R,Y]=_.useState(!1);function L(D,z,te,J,fe){const be=x.current.get(J),Ne=y.current.get(J)===fe;if(be&&Ne)te.setState(be);else{const V=D.EditorState.create({doc:B.current,extensions:[D.basicSetup,D.Prec.highest(D.keymap.of([{key:"Mod-s",preventDefault:!0,run:()=>(k.current(N.current),!0)}])),D.keymap.of([D.indentWithTab]),z.of([]),D.editorTheme,D.editorHighlight,D.EditorView.updateListener.of(pe=>{pe.docChanged&&C.current(N.current,pe.state.doc.toString())})]});x.current.set(J,V),y.current.set(J,fe),te.setState(V),j.current.delete(J)}if(j.current.has(J))return()=>{};let Se=!1;return ij(J).then(V=>{Se||!V||N.current!==J||(te.dispatch({effects:z.reconfigure(V)}),x.current.set(J,te.state),j.current.add(J))}),()=>{Se=!0}}_.useEffect(()=>{if(!h.current)return;let z=!1,te=null,J=null;X("loading"),Y(!1);const fe=window.setTimeout(()=>{z||Y(!0)},200);return(async()=>{let be;try{be=await Ej()}catch{window.clearTimeout(fe),z||X("error");return}if(z||!h.current)return;window.clearTimeout(fe);const Ne=new be.Compartment;v.current=Ne,g.current=be,J=new be.EditorView({parent:h.current}),m.current=J,te=L(be,Ne,J,N.current,A.current),X("ready")})(),()=>{z=!0,window.clearTimeout(fe),te==null||te(),J==null||J.destroy(),m.current===J&&(m.current=null),g.current=null,v.current=null}},[]),_.useEffect(()=>{const D=g.current,z=m.current,te=v.current;if(!(!D||!z||!te))return L(D,te,z,l,r)},[l,r]);const Z=_.useRef(0);return _.useEffect(()=>{const D=m.current,z=g.current;if(!D||!z||!c||c.token===Z.current)return;Z.current=c.token;const te=D.state.doc.lines,J=Math.min(Math.max(c.line,1),te),fe=D.state.doc.line(J),be=Math.min(fe.from+Math.max(c.column-1,0),fe.to);D.dispatch({selection:z.EditorSelection.cursor(be),effects:z.EditorView.scrollIntoView(be,{y:"center"})}),D.focus()},[c]),_.useEffect(()=>()=>{const D=m.current;D&&x.current.set(l,D.state)},[l]),a.jsxs("div",{className:"editor__code",children:[a.jsx("div",{ref:h,className:"editor__code-surface"+(P==="ready"?"":" is-hidden")}),P==="loading"&&R&&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:"Загружается редактор…"})]}),P==="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 Ls({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(A=>A.value===l)??null;_.useEffect(()=>{if(!m)return;const A=s.findIndex(B=>B.value===l);y(A===-1?0:A)},[m]),_.useEffect(()=>{if(!m)return;function A(B){var P;(P=j.current)!=null&&P.contains(B.target)||g(!1)}return document.addEventListener("mousedown",A),()=>document.removeEventListener("mousedown",A)},[m]),_.useEffect(()=>{var A,B;m&&((B=(A=v.current)==null?void 0:A.querySelector(".is-cursor"))==null||B.scrollIntoView({block:"nearest"}))},[m,x]),_.useEffect(()=>{if(!m)return;const A=v.current,B=Aj(j.current);if(!A||!B)return;const P=A.getBoundingClientRect().bottom-B.getBoundingClientRect().bottom;P>0&&(B.scrollTop+=Math.min(P+8,A.offsetHeight))},[m]);function k(A){g(!1),A.value!==l&&r(A.value)}function N(A){if(A.key==="Escape"){if(!m)return;A.preventDefault(),A.stopPropagation(),g(!1);return}if(A.key==="ArrowDown"||A.key==="ArrowUp"){if(A.preventDefault(),!m)return g(!0);const B=A.key==="ArrowDown"?1:s.length-1;return y(P=>(P+B)%s.length)}if(A.key==="Enter"||A.key===" "){if(A.preventDefault(),!m)return g(!0);const B=s[x];B&&k(B)}}return a.jsxs("div",{ref:j,className:"select"+(m?" select--open":"")+(c?` ${c}`:""),children:[a.jsxs("button",{type:"button",className:"select__trigger",title:o,"aria-label":d??o,"aria-haspopup":"listbox","aria-expanded":m,onClick:()=>g(A=>!A),onKeyDown:N,children:[a.jsx("span",{className:"select__value",children:(C==null?void 0:C.label)??h}),a.jsx(Mj,{})]}),m&&a.jsx("div",{ref:v,className:"select__menu",role:"listbox","aria-label":d??o,children:s.map((A,B)=>a.jsxs("button",{type:"button",role:"option","aria-selected":A.value===l,className:"select__option"+(B===x?" is-cursor":"")+(A.value===l?" is-on":""),onMouseEnter:()=>y(B),onClick:()=>k(A),children:[a.jsx("span",{className:"select__check","aria-hidden":"true",children:A.value===l?"✓":""}),a.jsx("span",{className:"select__label",children:A.label}),A.hint&&a.jsx("span",{className:"select__hint",children:A.hint})]},A.value))})]})}function Aj(l){let s=(l==null?void 0:l.parentElement)??null;for(;s;){if(s.scrollHeight>s.clientHeight&&getComputedStyle(s).overflowY!=="visible")return s;s=s.parentElement}return null}function Mj(){return a.jsx("svg",{className:"select__chev",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M3 4.5 6 7.5 9 4.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function Rj(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("circle",{cx:"6.6",cy:"6.6",r:"4.3"}),a.jsx("path",{d:"M9.7 9.7 14 14"}),a.jsx("path",{d:"M6.6 4.6v4M4.6 6.6h4"})]})}function Dj(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("circle",{cx:"6.6",cy:"6.6",r:"4.3"}),a.jsx("path",{d:"M9.7 9.7 14 14"}),a.jsx("path",{d:"M4.6 6.6h4"})]})}function Oj(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M13 8a5 5 0 1 1-1.6-3.7"}),a.jsx("path",{d:"M13 2.5v3.3h-3.3"})]})}function Lj({path:l,mime:s,base64:r,error:c,tooLarge:o,size:d,onRequestMedia:h}){_.useEffect(()=>{!o&&r===void 0&&c===void 0&&h(l)},[]);const m=zj(r,s);return o?a.jsx("div",{className:"mediaview mediaview--message",children:a.jsxs("p",{className:"mediaview__error",children:["Файл слишком велик для просмотра (",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(Hj,{url:m}):s.startsWith("video/")?a.jsx(Ij,{url:m}):null:a.jsxs("div",{className:"mediaview mediaview--message",role:"status",children:[a.jsx("div",{className:"mediaview__progress",children:a.jsx("div",{className:"mediaview__progress-fill"})}),a.jsx("span",{className:"mediaview__label",children:"Загружается…"})]})}function zj(l,s){const[r,c]=_.useState(null);return _.useEffect(()=>{if(l===void 0){c(null);return}const o=atob(l),d=new Uint8Array(o.length);for(let m=0;m<o.length;m++)d[m]=o.charCodeAt(m);const h=URL.createObjectURL(new Blob([d],{type:s}));return c(h),()=>URL.revokeObjectURL(h)},[l,s]),r}const Ai=1,q_=8,Nf=1.25;function Uj(l){return Math.min(q_,Math.max(Ai,l))}function Hj({url:l}){const[s,r]=_.useState({scale:Ai,x:0,y:0}),[c,o]=_.useState(!1),d=_.useRef(null),h=_.useRef(null);function m(C,k,N){r(A=>{const B=Uj(A.scale*C);if(B===A.scale)return A;if(B<=Ai)return{scale:Ai,x:0,y:0};const P=(k-A.x)/A.scale,X=(N-A.y)/A.scale;return{scale:B,x:k-B*P,y:N-B*X}})}_.useEffect(()=>{const C=d.current;if(!C)return;function k(N){N.preventDefault();const A=C.getBoundingClientRect(),B=N.clientX-A.left-A.width/2,P=N.clientY-A.top-A.height/2;m(N.deltaY<0?Nf:1/Nf,B,P)}return C.addEventListener("wheel",k,{passive:!1}),()=>C.removeEventListener("wheel",k)},[]);function g(C){s.scale<=Ai||(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 k=h.current;!k||k.pointerId!==C.pointerId||r(N=>({...N,x:k.origX+(C.clientX-k.startX),y:k.origY+(C.clientY-k.startY)}))}function y(){h.current=null,o(!1)}const j=s.scale>Ai,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<=Ai,title:"Уменьшить","aria-label":"Уменьшить",onClick:()=>m(1/Nf,0,0),children:a.jsx(Dj,{})}),a.jsxs("span",{className:"mediaview__zoomlabel",children:[Math.round(s.scale*100),"%"]}),a.jsx("button",{className:"btn btn--sm",disabled:s.scale>=q_,title:"Увеличить","aria-label":"Увеличить",onClick:()=>m(Nf,0,0),children:a.jsx(Rj,{})}),a.jsx("button",{className:"btn btn--sm",disabled:v,title:"Вписать в окно","aria-label":"Сбросить масштаб — вписать в окно",onClick:()=>r({scale:Ai,x:0,y:0}),children:a.jsx(Oj,{})})]})]})}const Bj=[{value:"0.5",label:"0.5×"},{value:"0.75",label:"0.75×"},{value:"1",label:"1× — обычная"},{value:"1.25",label:"1.25×"},{value:"1.5",label:"1.5×"},{value:"2",label:"2×"}];function Ij({url:l}){const s=_.useRef(null),[r,c]=_.useState("1");return _.useEffect(()=>{s.current&&(s.current.playbackRate=Number(r))},[r]),a.jsxs("div",{className:"mediaview mediaview--video",children:[a.jsx("video",{ref:s,className:"mediaview__video",src:l,controls:!0}),a.jsxs("div",{className:"mediaview__speedbar",children:[a.jsx("span",{className:"mediaview__speedlabel",children:"Скорость"}),a.jsx(Ls,{className:"mediaview__speedselect",value:r,onChange:c,ariaLabel:"Скорость воспроизведения",options:Bj})]})]})}function qj({file:l,goto:s,onChange:r,onSave:c,onReload:o,onOverwrite:d,onRequestMedia:h,onTogglePreview:m}){const g=qa(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(Lj,{path:l.path,mime:l.mediaMime,base64:l.mediaBase64,error:l.mediaError,tooLarge:l.mediaTooLarge,size:l.size,onRequestMedia:h},l.path):l.binary?a.jsxs("p",{className:"editor__empty",children:["Это не текстовый файл — редактировать его здесь нечем. ",qf(l.size)," на диске."]}):l.tooLarge?a.jsxs("p",{className:"editor__empty",children:["Файл слишком велик для редактора (",qf(l.size),"). Такие правит агент, а не браузер."]}):x&&l.previewMode?a.jsx(Gj,{text:l.text}):a.jsx(Cj,{path:l.path,doc:l.text,revision:l.revision,goto:s,onChange:r,onSave:c})]})}function Gj({text:l}){const[s,r]=_.useState("");return _.useEffect(()=>{let c=!1;return td(l).then(o=>{c||r(o)}),()=>{c=!0}},[l]),a.jsx("div",{className:"markdown-preview",dangerouslySetInnerHTML:{__html:s}})}function Yj({files:l,activePath:s,busy:r,onSelect:c,onClose:o,zoomed:d,onToggleZoom:h}){return a.jsxs("div",{className:"worktabs",role:"tablist",onDoubleClick:m=>{h&&(m.target.closest("button")||h())},children:[a.jsxs("button",{className:"worktab"+(s===null?" is-on":""),role:"tab","aria-selected":s===null,onClick:()=>c(null),onDoubleClick:()=>h==null?void 0:h(),children:[a.jsx("span",{className:"worktab__name",children:"Разговор"}),r&&a.jsx("span",{className:"worktab__dot worktab__dot--busy",title:"Агент работает"})]}),l.map(m=>a.jsxs("div",{className:"worktab"+(m.path===s?" is-on":""),role:"tab","aria-selected":m.path===s,onDoubleClick:g=>{h&&(g.target.closest(".worktab__close, .worktab__dot")||h())},children:[a.jsx("button",{className:"worktab__name",title:m.path,onClick:()=>c(m.path),children:oj(m.path)}),qa(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(Vc,{active:d})})]})}function ns(l){return l.claudeSessionId??l.id}function Tf(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 Sb(l){return[...l.filter(jb),...l.filter(s=>!jb(s))]}function Ef(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 Dp(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} ${Dp(l,"агент","агента","агентов")}`}function $j(l){const s=l.filter(o=>o.kind==="agent").length,r=l.length-s,c=[];return s>0&&c.push(G_(s)),r>0&&c.push(`${r} ${Dp(r,"задача","задачи","задач")} в фоне`),c.join(" · ")}function Xj(l){switch(l.kind){case"agent":return l.agentType??"агент";case"shell":return"команда";case"workflow":return"сценарий";default:return"задача"}}function Vj(l){const s=Math.max(0,Math.floor(l/1e3)),r=Math.floor(s/3600),c=Math.floor(s%3600/60),o=s%60,d=String(o).padStart(2,"0");return r>0?`${r}:${String(c).padStart(2,"0")}:${d}`:`${c}:${d}`}function Qj(l){return l<1e3?`${l} ток.`:`${(l/1e3).toFixed(1).replace(".",",")} k ток.`}function Kj({tasks:l,onStop:s}){const[r,c]=_.useState(!1),[o,d]=_.useState(()=>Date.now()),[h,m]=_.useState(()=>new Set);_.useEffect(()=>{const x=window.setInterval(()=>d(Date.now()),1e3);return()=>window.clearInterval(x)},[]),_.useEffect(()=>{m(x=>{const y=new Set(l.map(v=>v.id)),j=new Set([...x].filter(v=>y.has(v)));return j.size===x.size?x:j})},[l]);const g=x=>{m(y=>new Set(y).add(x)),s(x),window.setTimeout(()=>{m(y=>{if(!y.has(x))return y;const j=new Set(y);return j.delete(x),j})},1e4)};return a.jsxs("div",{className:r?"tasks is-open":"tasks",children:[a.jsxs("button",{type:"button",className:"tasks__toggle","aria-expanded":r,"aria-controls":"tasks-list",onClick:()=>c(x=>!x),children:[a.jsx("span",{className:"tasks__dot","aria-hidden":"true"}),a.jsx("span",{className:"tasks__summary",children:$j(l)}),a.jsx("svg",{className:"tasks__chev",viewBox:"0 0 16 16","aria-hidden":"true",children:a.jsx("path",{d:"M4 6.5l4 4 4-4",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})]}),r&&a.jsx("ul",{className:"tasks__list",id:"tasks-list",children:l.map(x=>{const y=h.has(x.id);return a.jsxs("li",{className:y?"task is-stopping":"task",children:[a.jsxs("div",{className:"task__main",children:[a.jsxs("div",{className:"task__head",children:[a.jsx("span",{className:"task__kind",children:Xj(x)}),x.background&&a.jsx("span",{className:"task__bg",children:"фон"}),a.jsx("span",{className:"task__time",children:Vj(o-x.startedAt)})]}),a.jsx("div",{className:"task__desc",title:x.description,children:x.description}),(x.activity||x.lastTool)&&a.jsx("div",{className:"task__activity",title:x.activity??x.lastTool??void 0,children:x.activity??x.lastTool}),a.jsxs("div",{className:"task__stats",children:[Qj(x.tokens)," · ",x.toolUses," ",Dp(x.toolUses,"вызов","вызова","вызовов")]})]}),a.jsx("button",{type:"button",className:"btn btn--sm btn--danger task__stop",disabled:y,"aria-label":`Остановить: ${x.description}`,onClick:()=>g(x.id),children:y?"Останавливается":"Стоп"})]},x.id)})})]})}const Zj=""+new URL("antigravity-logo-DRKQga2U.png",import.meta.url).href;function Op({className:l}){return a.jsx("img",{src:Zj,alt:"","aria-hidden":"true",className:l,style:{aspectRatio:"200 / 184"}})}const Fj=450,Jj=6,Wj=[{id:"claude",label:"Claude",hint:"Claude Code — как обычно"},{id:"antigravity",label:"Antigravity",hint:"Google agy, отдельная палитра и права"}];function Pj({disabled:l,providers:s,onStart:r}){const c=Wj.filter(z=>s.includes(z.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 k(){C.current&&window.clearTimeout(C.current.timer),C.current=null}function N(){k(),g(0),h(!0)}function A(z){var te;h(!1),z&&((te=j.current)==null||te.focus())}function B(z){if(l||!o||z.button!==0)return;const te={timer:0,x:z.clientX,y:z.clientY,fired:!1};te.timer=window.setTimeout(()=>{te.fired=!0,N()},Fj),C.current=te}function P(z){const te=C.current;!te||te.fired||Math.hypot(z.clientX-te.x,z.clientY-te.y)>Jj&&k()}function X(){C.current&&!C.current.fired&&k()}function R(z){var J;if((J=C.current)!=null&&J.fired){C.current=null,z.preventDefault();return}if(l)return;const te=c[0];te&&r(te.id)}function Y(z){o&&(z.preventDefault(),!l&&N())}function L(z){if(l||!o)return;(z.key==="ArrowDown"||z.key==="ArrowUp"||z.key==="Enter"&&z.shiftKey)&&(z.preventDefault(),N())}_.useLayoutEffect(()=>{if(!d)return;const z=j.current,te=v.current;if(!z||!te)return;const J=z.getBoundingClientRect(),fe=te.getBoundingClientRect(),be=8,Ne=Math.max(be,Math.min(J.right-fe.width,window.innerWidth-fe.width-be));let Se=J.top-fe.height-8;Se<be&&(Se=Math.min(J.bottom+8,window.innerHeight-fe.height-be)),y({left:Ne,top:Se})},[d]),_.useLayoutEffect(()=>{var z;d&&((z=v.current)==null||z.focus())},[d]),_.useLayoutEffect(()=>{if(!d)return;function z(te){var fe,be;const J=te.target;!((fe=v.current)!=null&&fe.contains(J))&&!((be=j.current)!=null&&be.contains(J))&&A(!1)}return document.addEventListener("mousedown",z),()=>document.removeEventListener("mousedown",z)},[d]);function Z(z){A(!1),r(z.id)}function D(z){if(z.key==="Escape"){z.preventDefault(),z.stopPropagation(),A(!0);return}if(z.key==="ArrowDown"||z.key==="ArrowUp"){z.preventDefault();const te=z.key==="ArrowDown"?1:-1;g(J=>(J+te+c.length)%c.length);return}if(z.key==="Enter"||z.key===" "){z.preventDefault();const te=c[m];te&&Z(te);return}z.key==="Tab"&&A(!1)}return a.jsxs("div",{className:"newsession",children:[a.jsxs("button",{ref:j,type:"button",className:"btn btn--primary newsession__btn",disabled:l,title:o?"Удерживайте, чтобы выбрать агента":void 0,"aria-haspopup":o?"menu":void 0,"aria-expanded":o?d:void 0,onClick:R,onContextMenu:Y,onPointerDown:B,onPointerMove:P,onPointerUp:X,onPointerCancel:X,onPointerLeave:X,onKeyDown:L,children:["+ Сессия",o&&a.jsx(eS,{})]}),d&&o&&a.jsx("div",{ref:v,className:"newsession__menu",style:{left:x.left,top:x.top},role:"menu","aria-label":"Выбрать агента для новой сессии",tabIndex:-1,onKeyDown:D,children:c.map((z,te)=>a.jsxs("button",{type:"button",role:"menuitem",className:"newsession__item"+(te===m?" is-cursor":""),onMouseEnter:()=>g(te),onClick:()=>Z(z),children:[a.jsx("span",{className:`newsession__mark newsession__mark--${z.id}`,"aria-hidden":"true",children:z.id==="antigravity"?a.jsx(Op,{className:"newsession__mark-logo"}):a.jsx(tS,{})}),a.jsxs("span",{className:"newsession__text",children:[a.jsx("span",{className:"newsession__label",children:z.label}),a.jsx("span",{className:"newsession__hint",children:z.hint})]})]},z.id))})]})}function eS(){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 tS(){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",nS=500,Kh="транскрипт остаётся на диске — сессию можно вернуть из архива в любой момент.";function lS({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:k,activeWorkspaceId:N,activeSessionId:A,onSelectWorkspace:B,onSelectSession:P,onRenameSession:X,onStopSession:R,onPinSessions:Y,onSelectPinned:L,onCloseWorkspaces:Z,onRestoreWorkspaces:D,onArchiveSessions:z,onUnarchiveSessions:te,onCreateFolder:J,onRenameFolder:fe,onSetFolderColor:be,onDeleteFolder:Ne,onAssignToFolder:Se,onOpenWorkspace:V,onNewSession:pe,enabledProviders:H,onOpenExtensions:_e,account:K,onOpenAccount:E,relay:G,onOpenRelay:de,onOpenSettings:xe,themeMode:ke,onCycleTheme:Re}){var ps;const[Me,Xe]=_.useState(null),[We,kn]=_.useState(null),[Be,dt]=_.useState(null);function nt(w){return(Be==null?void 0:Be.folderId)===w.id?Be.color??void 0:w.color}function Ot(w){const ce=w&&nt(w);return ce?{"--folder-color":ce}:void 0}function et(w){return w?a.jsx("span",{className:"row__stripe","aria-hidden":"true"}):null}const Jt=_.useRef(void 0),[Fn,gt]=_.useState(null),[Jn,$t]=_.useState(""),[zn,Un]=_.useState(bS),[St,_t]=_.useState(_S),[Zt,Lt]=_.useState(yS);function sn(w){Lt(w);try{localStorage.setItem($_,w)}catch{}}const xt=Jn.trim().toLowerCase(),rt=xt!=="",mn=_.useMemo(()=>Tf(c,v==null?void 0:v.workspaces,w=>w.id,"bottom"),[c,v]),gn=_.useMemo(()=>{const w=Tf(g,N?v==null?void 0:v.sessions[N]:void 0,ns,"top");return C?Sb(w):w},[g,v,N,C]),Nn=_.useMemo(()=>{const w=Tf(y,v==null?void 0:v.pinned,ns,"bottom");return C?Sb(w):w},[y,v,C]),an=_.useMemo(()=>Tf(j,v==null?void 0:v.live,ns,"bottom"),[j,v]),zt=_.useMemo(()=>rt?mn.filter(w=>w.name.toLowerCase().includes(xt)||w.path.toLowerCase().includes(xt)):mn,[mn,xt,rt]),rn=_.useMemo(()=>rt?o.filter(w=>w.name.toLowerCase().includes(xt)||w.path.toLowerCase().includes(xt)):o,[o,xt,rt]),wt=_.useMemo(()=>rt?gn.filter(w=>(w.title??"").toLowerCase().includes(xt)):gn,[gn,xt,rt]),Wn=_.useMemo(()=>rt?x.filter(w=>(w.title??"").toLowerCase().includes(xt)):x,[x,xt,rt]),se=w=>{var ce;return((ce=c.find(Ce=>Ce.id===w))==null?void 0:ce.name)??"—"},ge=w=>{var ce;return(ce=c.find(Ce=>Ce.id===w))==null?void 0:ce.path},He=_.useMemo(()=>rt?Nn.filter(w=>(w.title??"").toLowerCase().includes(xt)||se(w.workspaceId).toLowerCase().includes(xt)):Nn,[Nn,c,xt,rt]),Ke=_.useMemo(()=>rt?an.filter(w=>(w.title??"").toLowerCase().includes(xt)||se(w.workspaceId).toLowerCase().includes(xt)):an,[an,c,xt,rt]),Ue=!rt;function I(w){Un(ce=>{const Ce=ce.includes(w)?ce.filter(Ze=>Ze!==w):[...ce,w];try{localStorage.setItem(Y_,JSON.stringify(Ce))}catch{}return Ce})}const ae=w=>!zn.includes(w);function we(w){_t(ce=>{const Ce=ce.includes(w)?ce.filter(Ze=>Ze!==w):[...ce,w];try{localStorage.setItem(X_,JSON.stringify(Ce))}catch{}return Ce})}const qe=w=>!St.includes(w),at=_.useMemo(()=>qo(zt,d),[zt,d]),xn=_.useMemo(()=>qo(rn,d),[rn,d]),Hn=_.useMemo(()=>qo(wt,h),[wt,h]),wl=_.useMemo(()=>qo(Wn,h),[Wn,h]),pl=_.useMemo(()=>qo(He,m,w=>w.pinnedFolderId),[He,m]),as=_.useMemo(()=>({groups:[],ungrouped:Ke}),[Ke]),Us=((v==null?void 0:v.workspaces.length)??0)>0,is=N?(((ps=v==null?void 0:v.sessions[N])==null?void 0:ps.length)??0)>0:!1,rs=((v==null?void 0:v.pinned.length)??0)>0,cs=((v==null?void 0:v.live.length)??0)>0,al=Cf({enabled:Ue,scope:"workspaces",itemKey:w=>w.id,groups:at.groups,ungrouped:at.ungrouped,onReorder:k}),Pn=Cf({enabled:Ue,scope:"sessions",workspaceId:N??void 0,itemKey:ns,groups:Hn.groups,ungrouped:Hn.ungrouped,onReorder:k}),lt=Cf({enabled:Ue,scope:"pinned",itemKey:ns,groups:pl.groups,ungrouped:pl.ungrouped,onReorder:k}),Qe=Cf({enabled:Ue,scope:"live",itemKey:ns,groups:as.groups,ungrouped:as.ungrouped,onReorder:k});_.useEffect(()=>{var Ce;if(!Be)return;const ce=(Ce=[...pl.groups,...at.groups,...xn.groups,...Hn.groups,...wl.groups].find(Ze=>Ze.folder.id===Be.folderId))==null?void 0:Ce.folder;ce&&ce.color===(Be.color??void 0)&&dt(null)},[Be,pl,at,xn,Hn,wl]),_.useEffect(()=>()=>window.clearTimeout(Jt.current),[]);const fn=Fh(zt),kl=Fh(rn),il=Fh(wt),[Wt,os]=_.useState(null),[bt,us]=_.useState(null),[Ve,ml]=_.useState(null),[Pt,cn]=_.useState(null),[ht,rl]=_.useState(null),cl=_.useRef(null);function Xt(w,ce){const Ce=w.touches[0];if(!Ce)return;const Ze={timer:0,x:Ce.clientX,y:Ce.clientY,el:w.currentTarget,fired:!1};Ze.timer=window.setTimeout(()=>{Ze.fired=!0,ce(Ze.x,Ze.y,Ze.el)},nS),cl.current=Ze}function Tn(w){const ce=cl.current,Ce=w.touches[0];!ce||!Ce||Math.hypot(Ce.clientX-ce.x,Ce.clientY-ce.y)>10&&(window.clearTimeout(ce.timer),cl.current=null)}function Tt(w){const ce=cl.current;ce&&(window.clearTimeout(ce.timer),ce.fired&&w.preventDefault())}function ol(){var w;return(w=cl.current)!=null&&w.fired?(cl.current=null,!0):!1}function Hl(){const w=Wt==null?void 0:Wt.opener;os(null),w!=null&&w.isConnected&&w.focus()}function Vl(){const w=bt==null?void 0:bt.opener;us(null),w!=null&&w.isConnected&&w.focus()}function Bl(){const w=Ve==null?void 0:Ve.opener;ml(null),w!=null&&w.isConnected&&w.focus()}function $n(){const w=Pt==null?void 0:Pt.opener;cn(null),w!=null&&w.isConnected&&w.focus()}function yn(){const w=ht==null?void 0:ht.opener;rl(null),w!=null&&w.isConnected&&w.focus()}function it(w){return{onContextMenu:ce=>{ce.preventDefault(),os({x:ce.clientX,y:ce.clientY,opener:ce.currentTarget,ids:fn.targetsFor(w)})},onTouchStart:ce=>Xt(ce,(Ce,Ze,el)=>os({x:Ce,y:Ze,opener:el,ids:fn.targetsFor(w)})),onTouchMove:Tn,onTouchEnd:Tt,onTouchCancel:Tt}}function fs(w){return{onContextMenu:ce=>{ce.preventDefault(),us({x:ce.clientX,y:ce.clientY,opener:ce.currentTarget,ids:kl.targetsFor(w)})},onTouchStart:ce=>Xt(ce,(Ce,Ze,el)=>us({x:Ce,y:Ze,opener:el,ids:kl.targetsFor(w)})),onTouchMove:Tn,onTouchEnd:Tt,onTouchCancel:Tt}}function Hs(w){return{onContextMenu:ce=>{ce.preventDefault(),ml({x:ce.clientX,y:ce.clientY,opener:ce.currentTarget,ids:il.targetsFor(w)})},onTouchStart:ce=>Xt(ce,(Ce,Ze,el)=>ml({x:Ce,y:Ze,opener:el,ids:il.targetsFor(w)})),onTouchMove:Tn,onTouchEnd:Tt,onTouchCancel:Tt}}function Ql(w){return{onContextMenu:ce=>{ce.preventDefault(),cn({x:ce.clientX,y:ce.clientY,opener:ce.currentTarget,ids:[w.id]})},onTouchStart:ce=>Xt(ce,(Ce,Ze,el)=>cn({x:Ce,y:Ze,opener:el,ids:[w.id]})),onTouchMove:Tn,onTouchEnd:Tt,onTouchCancel:Tt}}function Bs(w){return{onContextMenu:ce=>{ce.preventDefault(),rl({x:ce.clientX,y:ce.clientY,opener:ce.currentTarget,ids:[w.id]})},onTouchStart:ce=>Xt(ce,(Ce,Ze,el)=>rl({x:Ce,y:Ze,opener:el,ids:[w.id]})),onTouchMove:Tn,onTouchEnd:Tt,onTouchCancel:Tt}}const ds=g.filter(w=>w.state!=="closed").length,Is=Wt?zt.find(w=>w.id===Wt.ids[0]):void 0,Xn=Wt?[{id:"close",label:Wt.ids.length>1?`Закрыть проекты (${Wt.ids.length})`:"Закрыть проект",onSelect:()=>{Z(Wt.ids),fn.clear()}},...Go({folders:d,ids:Wt.ids,hasFolder:(Is==null?void 0:Is.folderId)!=null,assign:(w,ce)=>Se("workspace",w,ce),onClear:()=>fn.clear(),onNewFolder:()=>gt("workspace")}),...Wt.ids.length===1&&Ue?al.menuItems(Wt.ids[0],Us):[]]:[],ga=Wt?"закрытие не удаляет проект: каталог и история сессий остаются на диске — открыть его снова можно кнопкой «+ Проект»."+(N&&Wt.ids.includes(N)&&ds>0?` в нём сейчас незавершённых сессий: ${ds} — при закрытии они остановятся на хосте.`:""):void 0,hs=bt?rn.find(w=>w.id===bt.ids[0]):void 0,gl=bt?[{id:"restore",label:bt.ids.length>1?`Вернуть проекты (${bt.ids.length})`:"Вернуть проект",onSelect:()=>{D(bt.ids),kl.clear()}},...Go({folders:d,ids:bt.ids,hasFolder:(hs==null?void 0:hs.folderId)!=null,assign:(w,ce)=>Se("workspace",w,ce),onClear:()=>kl.clear(),onNewFolder:()=>gt("workspace")})]:[],Nl=bt?"каталог и история сессий всё это время оставались на диске — восстановление их не трогает.":void 0,me=Ve?wt.find(w=>w.id===Ve.ids[0]):void 0,T=(me==null?void 0:me.pinned)!==!0,$=Ve?[...Ve.ids.length===1?[{id:"rename",label:"Переименовать",onSelect:()=>Xe(Ve.ids[0])}]:[],{id:"pin",label:T?Ve.ids.length>1?`Закрепить (${Ve.ids.length})`:"Закрепить":Ve.ids.length>1?`Открепить (${Ve.ids.length})`:"Открепить",onSelect:()=>{me&&Y(me.workspaceId,Ve.ids,T),il.clear()}},{id:"archive",label:Ve.ids.length>1?`Убрать в архив (${Ve.ids.length})`:"Убрать в архив",onSelect:()=>{z(N,Ve.ids),il.clear()}},...Go({folders:h,ids:Ve.ids,hasFolder:(me==null?void 0:me.folderId)!=null,assign:(w,ce)=>Se("session",w,ce,N),onClear:()=>il.clear(),onNewFolder:()=>gt("session")}),...Ve.ids.length===1&&Ue&&me?Pn.menuItems(ns(me),is):[]]:[],ue=Ve?Kh:void 0,ye=Pt?He.find(w=>w.id===Pt.ids[0]):void 0,Le=Pt?[{id:"rename",label:"Переименовать",onSelect:()=>Xe(Pt.ids[0])},{id:"unpin",label:"Открепить",onSelect:()=>{ye&&Y(ye.workspaceId,[ye.id],!1)}},{id:"archive",label:"Убрать в архив",onSelect:()=>{ye&&z(ye.workspaceId,[ye.id])}},...ye&&ye.workspaceId===N?Go({folders:h,ids:[ye.id],hasFolder:ye.folderId!=null,assign:(w,ce)=>Se("session",w,ce,ye.workspaceId),onClear:()=>{},onNewFolder:()=>gt("session")}):[],...rS(ye?Go({folders:m,ids:[ye.id],hasFolder:ye.pinnedFolderId!=null,assign:(w,ce)=>Se("pinned",w,ce),onClear:()=>{},onNewFolder:()=>gt("pinned")}):[]),...Ue&&ye?lt.menuItems(ns(ye),rs):[]]:[],Ee=ht?Ke.find(w=>w.id===ht.ids[0]):void 0,Et=ht?[{id:"stop",label:"Остановить",onSelect:()=>{Ee&&R(Ee)}},{id:"rename",label:"Переименовать",onSelect:()=>Xe(ht.ids[0])},{id:"pin",label:(Ee==null?void 0:Ee.pinned)===!0?"Открепить":"Закрепить",onSelect:()=>{Ee&&Y(Ee.workspaceId,[Ee.id],Ee.pinned!==!0)}},{id:"archive",label:"Убрать в архив",onSelect:()=>{Ee&&z(Ee.workspaceId,[Ee.id])}},...Ue&&Ee?Qe.menuItems(ns(Ee),cs):[]]:[];function Ft(w,ce){return a.jsxs("div",{"data-row-key":w.id,className:Nc(w.id===N,fn.selected.includes(w.id),!1,!!ce)+al.dropClass(w.id),style:Ot(ce),...it(w),children:[et(ce),Ue&&a.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить проект, чтобы изменить порядок в списке",...al.gripHandlers(w.id),children:a.jsx(Af,{})}),a.jsxs("button",{className:"row__main",onClick:Ce=>{ol()||fn.click(Ce,w,()=>B(w.id))},onKeyDown:Ce=>al.onKeyDown(w.id,Ce),children:[a.jsxs("span",{className:"row__title",children:[w.name,w.hasClaudeMd&&" ·"]}),a.jsx("span",{className:"row__meta",title:w.path,children:w.path})]})]},w.id)}function Vt(w,ce){return a.jsxs("div",{className:Nc(w.id===N,kl.selected.includes(w.id),!1,!!ce),style:Ot(ce),...fs(w),children:[et(ce),a.jsxs("button",{className:"row__main",onClick:Ce=>{ol()||kl.click(Ce,w,()=>B(w.id))},children:[a.jsxs("span",{className:"row__title",children:[w.name,w.hasClaudeMd&&" ·"]}),a.jsx("span",{className:"row__meta",children:ES(w)})]}),a.jsx("button",{className:"row__restore",title:"Вернуть проект из архива",onClick:()=>D([w.id]),children:"Вернуть"})]},w.id)}function st(w,ce){const Ce=ns(w);return a.jsxs("div",{"data-row-key":Ce,className:Nc(w.id===A,il.selected.includes(w.id),w.provider==="antigravity",!!ce)+Pn.dropClass(Ce),style:Ot(ce),...Me===w.id?{}:Hs(w),children:[et(ce),Me===w.id?a.jsx("div",{className:"row__main",children:a.jsx(ha,{value:w.title??"",onCommit:Ze=>{X(w,Ze),Xe(null)},onCancel:()=>Xe(null)})}):a.jsxs(a.Fragment,{children:[Ue&&a.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...Pn.gripHandlers(Ce),children:a.jsx(Af,{})}),a.jsxs("button",{className:"row__main",onClick:Ze=>{ol()||il.click(Ze,w,()=>P(w))},onKeyDown:Ze=>Pn.onKeyDown(Ce,Ze),children:[a.jsx(Mf,{title:w.title??"Без названия",pinned:w.pinned===!0,provider:w.provider,projectName:se(w.workspaceId),projectPath:ge(w.workspaceId)}),a.jsx(Jh,{session:w,tail:new Date(w.updatedAt).toLocaleString()})]}),a.jsx("button",{className:"row__edit",title:"Переименовать","aria-label":"Переименовать сессию",onClick:()=>{ol()||Xe(w.id)},children:"✎"})]})]},w.id)}function dn(w,ce){return a.jsxs("div",{className:Nc(w.id===A,!1,w.provider==="antigravity",!!ce),style:Ot(ce),children:[et(ce),a.jsxs("button",{className:"row__main",onClick:()=>P(w),children:[a.jsx(Mf,{title:w.title??"Без названия",pinned:!1,provider:w.provider,projectName:se(w.workspaceId),projectPath:ge(w.workspaceId)}),a.jsx("span",{className:"row__meta",children:TS(w)})]}),a.jsx("button",{className:"row__restore",title:"Вернуть сессию из архива",onClick:()=>te([w.id]),children:"Вернуть"})]},w.id)}function Mt(w,ce){const Ce=ns(w);return a.jsxs("div",{"data-row-key":Ce,className:Nc(w.id===A,!1,w.provider==="antigravity",!!ce)+lt.dropClass(Ce),style:Ot(ce),...Me===w.id?{}:{title:"Действия со строкой — правый клик или долгое нажатие",...Ql(w)},children:[et(ce),Me===w.id?a.jsx("div",{className:"row__main",children:a.jsx(ha,{value:w.title??"",onCommit:Ze=>{X(w,Ze),Xe(null)},onCancel:()=>Xe(null)})}):a.jsxs(a.Fragment,{children:[Ue&&a.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...lt.gripHandlers(Ce),children:a.jsx(Af,{})}),a.jsxs("button",{className:"row__main",onClick:()=>{ol()||L(w)},onKeyDown:Ze=>lt.onKeyDown(Ce,Ze),children:[a.jsx(Mf,{title:w.title??"Без названия",pinned:!1,provider:w.provider,projectName:se(w.workspaceId),projectPath:ge(w.workspaceId)}),a.jsx(Jh,{session:w,tail:new Date(w.updatedAt).toLocaleString()})]})]})]},w.id)}function qs(w){const ce=ns(w);return a.jsx("div",{"data-row-key":ce,className:Nc(w.id===A,!1,w.provider==="antigravity")+Qe.dropClass(ce),...Me===w.id?{}:{title:"Действия со строкой — правый клик или долгое нажатие",...Bs(w)},children:Me===w.id?a.jsx("div",{className:"row__main",children:a.jsx(ha,{value:w.title??"",onCommit:Ce=>{X(w,Ce),Xe(null)},onCancel:()=>Xe(null)})}):a.jsxs(a.Fragment,{children:[Ue&&a.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...Qe.gripHandlers(ce),children:a.jsx(Af,{})}),a.jsxs("button",{className:"row__main",onClick:()=>{ol()||L(w)},onKeyDown:Ce=>Qe.onKeyDown(ce,Ce),children:[a.jsx(Mf,{title:w.title??"Без названия",pinned:w.pinned===!0,provider:w.provider,projectName:se(w.workspaceId),projectPath:ge(w.workspaceId)}),a.jsx(Jh,{session:w,tail:new Date(w.updatedAt).toLocaleString()})]}),a.jsx("button",{type:"button",className:"row__stop",title:"Остановить сессию","aria-label":"Остановить сессию",onClick:Ce=>{Ce.stopPropagation(),!ol()&&R(w)},children:a.jsx(pS,{})})]})},w.id)}function vn(w,ce){return a.jsx(dS,{folder:w,count:ce,open:qe(w.id),renaming:We===w.id,onToggle:()=>we(w.id),onStartRename:()=>kn(w.id),onCommitRename:Ce=>{fe(w.id,Ce),kn(null)},onCancelRename:()=>kn(null),onDelete:()=>Ne(w.id),color:nt(w),onPreviewColor:Ce=>{window.clearTimeout(Jt.current),dt({folderId:w.id,color:Ce})},onCommitColor:Ce=>{dt({folderId:w.id,color:Ce}),be(w.id,Ce),window.clearTimeout(Jt.current),Jt.current=window.setTimeout(()=>dt(null),4e3)},onResetColor:()=>{window.clearTimeout(Jt.current),dt(null),be(w.id,null)}},w.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:`Тема: ${kb[ke]}`,"aria-label":`Тема: ${kb[ke]}. Переключить`,onClick:Re,children:a.jsx(vS,{mode:ke})})]}),a.jsxs("div",{className:"sidebar__tabs",role:"tablist","aria-label":"Что показывать в списке",children:[a.jsx("button",{type:"button",role:"tab","aria-selected":Zt==="default",className:Zt==="default"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>sn("default"),children:a.jsx("span",{className:"sidebar__tab-label",children:"Все"})}),a.jsx("button",{type:"button",role:"tab","aria-selected":Zt==="pinned",className:Zt==="pinned"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>sn("pinned"),children:a.jsx("span",{className:"sidebar__tab-label",children:"Закреплённые"})}),a.jsxs("button",{type:"button",role:"tab","aria-selected":Zt==="live",className:Zt==="live"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>sn("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(gS,{}),a.jsx("input",{className:"fssearch__input",type:"text",value:Jn,spellCheck:!1,placeholder:"Проект или сессия…","aria-label":"Поиск по проектам и сессиям",onChange:w=>$t(w.target.value),onKeyDown:w=>{w.stopPropagation(),w.key==="Escape"&&(w.preventDefault(),Jn?$t(""):w.currentTarget.blur())}}),Jn&&a.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>$t(""),children:"✕"})]}),a.jsx("div",{className:"sidebar__scroll",children:Zt==="pinned"?a.jsxs(a.Fragment,{children:[a.jsx(Tc,{title:"Закреплённые",count:He.length,open:ae("pinned"),onToggle:()=>I("pinned"),action:{label:"Новая папка закреплённых",onClick:()=>{gt("pinned"),ae("pinned")||I("pinned")}}}),ae("pinned")&&a.jsxs(a.Fragment,{children:[Fn==="pinned"&&a.jsx("div",{className:"row",children:a.jsx("div",{className:"row__main",children:a.jsx(ha,{value:"",placeholder:"Название папки",onCommit:w=>{J("pinned",w),gt(null)},onCancel:()=>gt(null)})})}),He.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:rt?"Ничего не найдено":"закрепите сессию через её меню (правый клик или долгое нажатие) — она останется под рукой из любого проекта"})}),pl.groups.map(w=>a.jsxs(_.Fragment,{children:[vn(w.folder,w.items.length),qe(w.folder.id)&&w.items.map(ce=>Mt(ce,w.folder))]},w.folder.id)),pl.ungrouped.map(w=>Mt(w))]})]}):Zt==="live"?a.jsxs(a.Fragment,{children:[a.jsx(Tc,{title:"Запущенные",count:Ke.length,open:ae("live"),onToggle:()=>I("live")}),ae("live")&&a.jsxs(a.Fragment,{children:[Ke.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:rt?"Ничего не найдено":"Нет запущенных сессий"})}),Ke.map(w=>qs(w))]})]}):a.jsxs(a.Fragment,{children:[a.jsx(Tc,{title:"Проекты",count:zt.length,open:ae("workspaces"),onToggle:()=>I("workspaces"),action:{label:"Новая папка проектов",onClick:()=>{gt("workspace"),ae("workspaces")||I("workspaces")}}}),ae("workspaces")&&a.jsxs(a.Fragment,{children:[Fn==="workspace"&&a.jsx("div",{className:"row",children:a.jsx("div",{className:"row__main",children:a.jsx(ha,{value:"",placeholder:"Название папки",onCommit:w=>{J("workspace",w),gt(null)},onCancel:()=>gt(null)})})}),zt.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:rt?"Ничего не найдено":"Пока ни одного"})}),at.groups.map(w=>a.jsxs(_.Fragment,{children:[vn(w.folder,w.items.length),qe(w.folder.id)&&w.items.map(ce=>Ft(ce,w.folder))]},w.folder.id)),at.ungrouped.map(w=>Ft(w))]}),o.length>0&&a.jsxs(a.Fragment,{children:[a.jsx(Tc,{title:"Архив проектов",count:rn.length,open:ae("workspacesArchive"),onToggle:()=>I("workspacesArchive"),hint:"проект закрывают вручную; каталог и история сессий остаются на диске и открываются заново отсюда или через «+ Проект»"}),ae("workspacesArchive")&&a.jsxs(a.Fragment,{children:[rn.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:rt?"Ничего не найдено":"Пока пусто"})}),xn.groups.map(w=>a.jsxs(_.Fragment,{children:[vn(w.folder,w.items.length),qe(w.folder.id)&&w.items.map(ce=>Vt(ce,w.folder))]},w.folder.id)),xn.ungrouped.map(w=>Vt(w))]})]}),N&&a.jsxs(a.Fragment,{children:[a.jsx(Tc,{title:"Сессии",count:wt.length,open:ae("sessions"),onToggle:()=>I("sessions"),action:{label:"Новая папка сессий",onClick:()=>{gt("session"),ae("sessions")||I("sessions")}}}),ae("sessions")&&a.jsxs(a.Fragment,{children:[Fn==="session"&&a.jsx("div",{className:"row",children:a.jsx("div",{className:"row__main",children:a.jsx(ha,{value:"",placeholder:"Название папки",onCommit:w=>{J("session",w,N),gt(null)},onCancel:()=>gt(null)})})}),wt.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:rt?"Ничего не найдено":"Пока ни одной"})}),Hn.groups.map(w=>a.jsxs(_.Fragment,{children:[vn(w.folder,w.items.length),qe(w.folder.id)&&w.items.map(ce=>st(ce,w.folder))]},w.folder.id)),Hn.ungrouped.map(w=>st(w))]}),x.length>0&&a.jsxs(a.Fragment,{children:[a.jsx(Tc,{title:"Архив",count:Wn.length,open:ae("archive"),onToggle:()=>I("archive"),hint:"сессии без обращения дольше двух суток уезжают сюда сами; ничего не удаляется"}),ae("archive")&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:"сюда сами уезжают сессии без обращения дольше двух суток; транскрипт остаётся на диске, ничего не удаляется"})}),Wn.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:rt?"Ничего не найдено":"Пока пусто"})}),wl.groups.map(w=>a.jsxs(_.Fragment,{children:[vn(w.folder,w.items.length),qe(w.folder.id)&&w.items.map(ce=>dn(ce,w.folder))]},w.folder.id)),wl.ungrouped.map(w=>dn(w))]})]})]})]})}),a.jsxs("div",{className:"sidebar__foot",children:[a.jsxs("button",{className:"account-btn",title:"Аккаунт Claude",onClick:E,children:[a.jsx("span",{className:K!=null&&K.loggedIn?"dot dot--on":"dot"}),a.jsx("span",{className:"account-btn__id",children:K===null?"Аккаунт":K.loggedIn?K.email||"Вход выполнен":"Войти в аккаунт"}),(K==null?void 0:K.plan)&&a.jsx("span",{className:"chip",children:K.plan})]}),de&&a.jsxs("button",{className:"account-btn",title:"Доступ с телефона и из браузера",onClick:de,children:[a.jsx("span",{className:G!=null&&G.connected?"dot dot--on":"dot"}),a.jsx("span",{className:"account-btn__id",children:G===null?"Удалённый доступ":G.paired?G.connected?G.name||"Удалённый доступ включён":"Удалённый доступ · нет связи":"Удалённый доступ"}),(G==null?void 0:G.connected)&&G.clients>0&&a.jsx("span",{className:"chip",children:G.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:xe,children:"Настройки"})]}),a.jsxs("div",{className:"sidebar__foot-row",children:[a.jsx("button",{className:"btn btn--ghost",onClick:V,children:"+ Проект"}),a.jsx(Pj,{disabled:!N,providers:H,onStart:pe})]})]}),Wt&&a.jsx(Oi,{x:Wt.x,y:Wt.y,items:Xn,note:ga,onClose:Hl}),bt&&a.jsx(Oi,{x:bt.x,y:bt.y,items:gl,note:Nl,onClose:Vl}),Ve&&a.jsx(Oi,{x:Ve.x,y:Ve.y,items:$,note:ue,onClose:Bl}),Pt&&a.jsx(Oi,{x:Pt.x,y:Pt.y,items:Le,note:Kh,onClose:$n}),ht&&a.jsx(Oi,{x:ht.x,y:ht.y,items:Et,note:Kh,onClose:yn})]})}function Nc(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 qo(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 sS(l,s,r){return[...l.flatMap(c=>c.items.map(r)),...s.map(r)]}const aS="\0ungrouped";function iS(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),aS);return c}function Zh(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 Cf(l){const[s,r]=_.useState(null),[c,o]=_.useState(null),d=_.useMemo(()=>sS(l.groups,l.ungrouped,l.itemKey),[l.groups,l.ungrouped,l.itemKey]),h=_.useMemo(()=>iS(l.groups,l.ungrouped,l.itemKey),[l.groups,l.ungrouped,l.itemKey]);function m(){r(null),o(null)}function g(B,P){l.enabled&&(P.preventDefault(),P.currentTarget.setPointerCapture(P.pointerId),r(B),o(null))}function x(B,P){var Z;if(!s)return;const X=(Z=document.elementFromPoint(B,P))==null?void 0:Z.closest("[data-row-key]"),R=X==null?void 0:X.dataset.rowKey;if(!R||R===s||h.get(R)!==h.get(s)){o(null);return}const Y=X.getBoundingClientRect(),L=P-Y.top<Y.height/2?"before":"after";o(D=>(D==null?void 0:D.key)===R&&D.position===L?D:{key:R,position:L})}function y(B){x(B.clientX,B.clientY)}function j(){if(s&&c){const B=Ef(d,s,c.key,c.position);B&&l.onReorder(l.scope,B,l.workspaceId)}m()}function v(B,P){if(!l.enabled)return;const X=Zh(B,l.groups,l.ungrouped,l.itemKey,P);if(!X)return;const R=Ef(d,B,X.target,X.position);R&&l.onReorder(l.scope,R,l.workspaceId)}function C(B,P){const X=Zh(B,l.groups,l.ungrouped,l.itemKey,"up"),R=Zh(B,l.groups,l.ungrouped,l.itemKey,"down"),Y=[{id:"move-up",label:"Переместить выше",disabled:!X,onSelect:()=>{if(!X)return;const L=Ef(d,B,X.target,X.position);L&&l.onReorder(l.scope,L,l.workspaceId)}},{id:"move-down",label:"Переместить ниже",disabled:!R,onSelect:()=>{if(!R)return;const L=Ef(d,B,R.target,R.position);L&&l.onReorder(l.scope,L,l.workspaceId)}}];return P&&Y.push({id:"reset-order",label:"Сбросить порядок",onSelect:()=>l.onReorder(l.scope,null,l.workspaceId)}),Y}function k(B){return s===B?" row--dragging":(c==null?void 0:c.key)===B?c.position==="before"?" row--drop-before":" row--drop-after":""}function N(B){return{onPointerDown:P=>g(B,P),onPointerMove:y,onPointerUp:j,onPointerCancel:m}}function A(B,P){!P.altKey||P.key!=="ArrowUp"&&P.key!=="ArrowDown"||(P.preventDefault(),v(B,P.key==="ArrowUp"?"up":"down"))}return{dragging:s!==null,dropClass:k,gripHandlers:N,onKeyDown:A,menuItems:C}}function Go(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 rS(l){return l.map(s=>({...s,id:`pinned:${s.id}`,label:s.id==="folder:new"?"Новая папка закреплённых…":s.id==="folder:none"?"Без папки закреплённых":s.label}))}function Fh(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(k=>k.id));return}}o(),c.current=g.id,x()}function h(m){return s.includes(m.id)?s:(r([m.id]),c.current=m.id,[m.id])}return{selected:s,click:d,targetsFor:h,clear:o}}const cS={display:"flex",alignItems:"center",gap:6,flex:1,minWidth:0,textAlign:"left"},oS={width:22,height:22,borderRadius:6};function Tc({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:cS,"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:oS,title:d.label,"aria-label":d.label,onClick:d.onClick,children:a.jsx(xS,{})})]})}const wb={paddingLeft:22},uS={display:"flex",alignItems:"center",gap:6,width:"100%"},fS={flex:1,minWidth:0,color:"var(--text-2)",fontWeight:500};function dS({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),k=_.useRef(j);return k.current=j,_.useEffect(()=>{const N=C.current;if(!N)return;const A=()=>k.current(N.value);return N.addEventListener("change",A),()=>N.removeEventListener("change",A)},[c]),c?a.jsx("div",{className:"row",style:wb,children:a.jsx("div",{className:"row__main",children:a.jsx(ha,{value:l.name,placeholder:"Название папки",onCommit:h,onCancel:m})})}):a.jsxs("div",{className:"row",style:wb,children:[a.jsxs("button",{className:"row__main",style:uS,"aria-expanded":r,title:r?`Свернуть папку «${l.name}»`:`Развернуть папку «${l.name}»`,onClick:o,children:[a.jsx(V_,{open:r}),a.jsx("span",{style:fS,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??hS(),"aria-label":`Цвет папки «${l.name}»`,onChange:N=>y(N.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 hS(){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 Af(){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 pS(){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 mS({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 gS(){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 xS(){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 bS(){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 _S(){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 yS(){try{const l=localStorage.getItem($_);return l==="pinned"||l==="live"?l:"default"}catch{return"default"}}const kb={system:"как в системе",light:"светлая",dark:"тёмная"};function vS({mode:l}){const s={viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0};return l==="dark"?a.jsx("svg",{...s,children:a.jsx("path",{d:"M13.2 9.7A5.4 5.4 0 0 1 6.3 2.8a5.6 5.6 0 1 0 6.9 6.9Z"})}):l==="light"?a.jsxs("svg",{...s,children:[a.jsx("circle",{cx:"8",cy:"8",r:"3.1"}),a.jsx("path",{d:"M8 1.4v1.4M8 13.2v1.4M2.4 8H1M15 8h-1.4M4 4l-1-1M13 13l-1-1M12 4l1-1M3 13l1-1"})]}):a.jsxs("svg",{...s,children:[a.jsx("rect",{x:"1.8",y:"2.6",width:"12.4",height:"8.4",rx:"1.4"}),a.jsx("path",{d:"M5.6 13.4h4.8"})]})}function jS(l){const s=SS(l),r=(l.tasks??[]).filter(c=>c.kind==="agent").length;return r>0?`${s} · ${G_(r)}`:s}function SS(l){switch(l.state){case"running":return"работает";case"waiting_permission":return"ждёт разрешения";case"idle":return l.backgroundWork?"работает в фоне":wS(l.lastTurn);case"starting":return"запускается";case"reconnecting":return"переподключается";case"error":return"ошибка";case"closed":return"на диске"}}function wS(l){switch(l){case"interrupted":return"прервана";case"stopped":return"остановлена";case"failed":return"оборвалась";case"completed":return"готова";case null:return"ждёт задачу"}}function kS(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":NS(l.lastTurn);case"error":return"error";case"closed":return"closed"}}function NS(l){switch(l){case"interrupted":case"stopped":return"halted";case"failed":return"error";case"completed":return"ready";case null:return"fresh"}}function Jh({session:l,tail:s}){return a.jsxs("span",{className:"row__meta",children:[a.jsxs("span",{className:`row__state row__state--${kS(l)}`,children:[a.jsx("span",{className:"row__state-dot","aria-hidden":"true"}),jS(l)]})," · ",s]})}function Mf({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(mS,{className:"row__pin"}),r==="antigravity"&&a.jsx(Op,{className:"row__provider"}),l]}),a.jsx("span",{className:"row__project",title:o,children:c})]})}function TS(l){const s=l.archivedAuto?"сама, по сроку молчания":"убрана вручную";return l.archivedAt?`${new Date(l.archivedAt).toLocaleString()} · ${s}`:s}function ES(l){return l.archivedAt?`закрыт ${new Date(l.archivedAt).toLocaleString()}`:"закрыт"}const Nb=3,CS=15e5;function Q_(l,s){if(!s||typeof s!="object")return null;const r=s,c=typeof r.file_path=="string"?r.file_path:"";if(!c)return null;if(l==="Write"){if(typeof r.content!="string")return null;const o=Wh(r.content).map(d=>({type:"add",text:d}));return{kind:"create",filePath:c,rows:o,added:o.length,removed:0,note:"файл записывается целиком"}}if(l==="Edit"){if(typeof r.old_string!="string"||typeof r.new_string!="string")return null;const o=DS(AS(Wh(r.old_string),Wh(r.new_string)));return{kind:"edit",filePath:c,rows:o,added:o.filter(d=>d.type==="add").length,removed:o.filter(d=>d.type==="del").length,note:r.replace_all===!0?"все вхождения":null}}return null}function Wh(l){if(l==="")return[];const s=l.split(/\r?\n/);return s.length>1&&s[s.length-1]===""&&s.pop(),s}function AS(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),...MS(l.slice(r,c),s.slice(r,o)),...l.slice(c).map(d)]}function MS(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)>CS)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 RS(m)}function RS(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 DS(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-Nb);m<=Math.min(l.length-1,h+Nb);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} ${OS(c.length)} без изменений`}),c=[]}return l.forEach((d,h)=>{s[h]?(o(),r.push(d)):c.push(d)}),o(),r}function OS(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 ma(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 gp(){try{return await navigator.clipboard.readText()}catch{return null}}const Lp=1600,Cr="Копировать",Oc="Скопировано";function $c({text:l,hint:s,className:r}){const[c,o]=_.useState(!1);return _.useEffect(()=>{if(!c)return;const d=setTimeout(()=>o(!1),Lp);return()=>clearTimeout(d)},[c]),_.useEffect(()=>o(!1),[l]),a.jsx("button",{type:"button",className:"copybtn"+(c?" copybtn--done":"")+(r?` ${r}`:""),"aria-label":c?Oc:`${Cr} ${s}`,title:c?Oc:`${Cr} ${s}`,onClick:()=>{ma(l).then(d=>{d&&o(!0)})},children:c?Oc:Cr})}function zp({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 LS({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 Up({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),k=_.useRef(null),N=_.useRef(!1);_.useEffect(()=>{v.current=!0,C.current=null,N.current=!1,k.current!==null&&(clearTimeout(k.current),k.current=null)},[m]),_.useEffect(()=>{const R=y.current,Y=j.current;if(!R||!Y)return;function L(z){!R||z===R.scrollTop||(N.current=!0,R.scrollTop=z)}function Z(){if(!R)return;const z=C.current;if(z){const te=Eb(R,z.id);if(te){const J=te.getBoundingClientRect().top-R.getBoundingClientRect().top;L(R.scrollTop+(J-z.top))}k.current!==null&&clearTimeout(k.current),k.current=setTimeout(()=>{C.current=null},500);return}v.current&&L(R.scrollHeight)}const D=new ResizeObserver(Z);return D.observe(Y),()=>{D.disconnect(),k.current!==null&&clearTimeout(k.current)}},[]);function A(){const R=y.current;if(R){if(N.current){N.current=!1;return}v.current=R.scrollHeight-R.scrollTop-R.clientHeight<80}}function B(){if(d)return;const R=y.current,Y=c[0];if(R&&Y){const L=Eb(R,Y.id);L&&(C.current={id:Y.id,top:L.getBoundingClientRect().top-R.getBoundingClientRect().top})}h==null||h()}let P=0;function X(R){return R.kind==="user"?P++:-1}return a.jsx("div",{className:"transcript",ref:y,onScroll:A,children:a.jsxs("div",{className:"stream",ref:j,children:[o&&a.jsx("button",{type:"button",className:"transcript__more",onClick:B,disabled:d,children:d?"Загружаем…":"Показать более раннее"}),c.map(R=>a.jsx(Tb,{item:R,userIndex:X(R),onEditMessage:g},R.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(R=>a.jsx(Tb,{item:R,userIndex:X(R),onEditMessage:g},R.id)),s&&a.jsx(LS,{waiting:r})]})})}function Tb({item:l,userIndex:s,onEditMessage:r}){switch(l.kind){case"user":return a.jsx(US,{item:l,userIndex:s,onEditMessage:r});case"assistant":return a.jsxs("div",{className:"msg--assistant","data-item-id":l.id,children:[a.jsx(HS,{text:l.text}),l.streaming&&a.jsx("span",{className:"caret"}),l.text.trim()!==""&&a.jsx("div",{className:"msg--assistant__foot",children:a.jsx($c,{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(IS,{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 zS=500;function US({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=Wf("(max-width: 860px)"),v=_.useRef(null);function C(D,z){o({x:D,y:z})}function k(D){D.preventDefault(),C(D.clientX,D.clientY)}function N(D){const z=D.touches[0];if(!z)return;const te={timer:0,x:z.clientX,y:z.clientY,fired:!1};te.timer=window.setTimeout(()=>{te.fired=!0,C(te.x,te.y)},zS),v.current=te}function A(D){const z=v.current,te=D.touches[0];!z||!te||Math.hypot(te.clientX-z.x,te.clientY-z.y)>10&&(window.clearTimeout(z.timer),v.current=null)}function B(D){const z=v.current;z&&(window.clearTimeout(z.timer),z.fired&&D.preventDefault())}function P(){g(l.text),h(!0)}function X(){h(!1)}function R(){const D=m.trim();if(D===""&&!(l.images&&l.images.length>0))return;const z=r==null?void 0:r(s,D,l.images);if(z instanceof Promise){if(y.current)return;y.current=!0,z.then(te=>{y.current=!1,te&&h(!1)},()=>{y.current=!1});return}z!==!1&&h(!1)}_.useEffect(()=>{const D=x.current;!D||!d||(D.style.height="auto",D.style.height=`${D.scrollHeight}px`)},[m,d]),_.useEffect(()=>{if(!d)return;const D=x.current;D&&(D.focus(),D.setSelectionRange(D.value.length,D.value.length))},[d]);function Y(D){if(D.key==="Escape"){D.preventDefault(),D.stopPropagation(),X();return}D.key==="Enter"&&!D.shiftKey&&!j&&(D.preventDefault(),R())}const L=l.images&&l.images.length>0&&a.jsx("div",{className:"msg--user__images",children:l.images.map((D,z)=>a.jsx("img",{className:"msg--user__image",src:`data:${D.mediaType};base64,${D.data}`,alt:"Вложение"},z))});if(d){const D=m.trim()!==""||!!(l.images&&l.images.length>0);return a.jsxs("div",{className:"msg--user msg--user--editing","data-item-id":l.id,children:[L,a.jsxs("div",{className:"msg--user__edit",children:[a.jsx("textarea",{ref:x,className:"msg--user__edit-field",value:m,onChange:z=>g(z.target.value),onKeyDown:Y,rows:1}),a.jsxs("div",{className:"msg--user__edit-actions",children:[a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:X,children:"Отмена"}),a.jsx("button",{type:"button",className:"btn btn--sm btn--primary",onClick:R,disabled:!D,children:"Сохранить"})]})]})]})}const Z=[{id:"copy",label:"Копировать",onSelect:()=>void ma(l.text)},...r?[{id:"edit",label:"Изменить",onSelect:P}]:[]];return a.jsxs("div",{className:"msg--user","data-item-id":l.id,onContextMenu:k,onTouchStart:N,onTouchMove:A,onTouchEnd:B,onTouchCancel:B,children:[L,l.text,c&&a.jsx(Oi,{x:c.x,y:c.y,items:Z,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 HS({text:l}){const[s,r]=_.useState(""),c=_.useRef([]);_.useEffect(()=>{let d=!1;return td(l).then(h=>{d||r(BS(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!==""&&ma(m).then(y=>{if(!y)return;h.textContent=Oc,h.setAttribute("aria-label",Oc),h.classList.add("copybtn--done");const j=window.setTimeout(()=>{h.isConnected&&(h.textContent=Cr,h.setAttribute("aria-label",xp),h.classList.remove("copybtn--done"))},Lp);c.current.push(j)})}return a.jsx("div",{className:"markdown-preview msg--assistant__body",onClick:o,dangerouslySetInnerHTML:{__html:s}})}const xp=`${Cr} блок кода`;function BS(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",xp),o.title=xp,o.textContent=Cr,c.append(o)}return s.body.innerHTML}function IS({item:l}){const[s,r]=_.useState(!1),c=l.result===null,o=Q_(l.name,l.input),d=l.name==="AskUserQuestion"?YS(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?GS(d):qS(l.input)}),a.jsx("span",{className:"tool__status",children:c?"…":l.isError?"ошибка":s?"▴":"▾"})]}),s&&a.jsxs("div",{className:"tool__body",children:[d?a.jsx($S,{questions:d,answers:l.answers}):o?a.jsx(zp,{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($c,{text:l,hint:s,className:"codeblock__copy"})]})}function qS(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 GS(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 YS(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 $S({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 XS="ccv.dictation.lang",Mb="ru-RU";function VS(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(VS);return!r&&s.length>0&&Rs("распознавание подменено: родной реализации в странице нет"),r??s[0]??null}function K_(){var l;try{return((l=localStorage.getItem(XS))==null?void 0:l.trim())||Mb}catch{return Mb}}function Rs(l,s){s===void 0?console.debug(`[dictation] ${l}`):console.debug(`[dictation] ${l}`,s)}const QS=3,KS=400,ZS=5,FS=250,JS=2e3,WS=2e4;async function PS(){try{return(await navigator.permissions.query({name:"microphone"})).state==="granted"}catch{return!1}}const ew={"not-allowed":"Браузер не дал доступ к микрофону","service-not-allowed":"Браузер не дал доступ к микрофону","audio-capture":"Микрофон не найден",network:"Сервис распознавания недоступен","language-not-supported":`Распознавание не знает языка ${K_()}`};function tw(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),k=_.useCallback(()=>{C.current&&clearTimeout(C.current),C.current=null},[]),N=_.useCallback(()=>{k();const R=async Y=>{if(C.current=null,!(!m.current||v.current)){if(!Y&&!await PS()){if(Rs("ждём ответа на запрос доступа к микрофону"),!m.current||v.current)return;C.current=setTimeout(()=>void R(!0),WS);return}Rs("движок не ответил на start()"),m.current=!1,c(!1),d("Распознавание не отвечает — проверьте расширения браузера и доступ к микрофону")}};C.current=setTimeout(()=>void R(!1),JS)},[k]);_.useEffect(()=>{x.current=l}),_.useEffect(()=>{const R=Rb();if(!R)return;const Y=new R;return Y.lang=K_(),Y.continuous=!0,Y.interimResults=!0,Y.onstart=()=>{Rs("сессия открыта"),v.current=!0,k(),c(!0)},Y.onaudiostart=()=>{Rs("пошёл звук с микрофона"),y.current.audio=!0},Y.onresult=L=>{var te;if(g.current)return;let Z="",D="";for(let J=L.resultIndex;J<L.results.length;J++){const fe=L.results[J];if(!fe)continue;const be=((te=fe[0])==null?void 0:te.transcript)??"";fe.isFinal?Z+=be:D+=be}const z=y.current;z.heard=!0,z.everHeard=!0,Rs("распознано",{final:Z,interim:D}),x.current(Z,D)},Y.onerror=L=>{y.current.lastError=L.error,Rs("ошибка движка",L.error),!(L.error==="no-speech"||L.error==="aborted")&&(m.current=!1,c(!1),d(ew[L.error]??`Распознавание не работает: ${L.error}`))},Y.onend=()=>{g.current=!1,v.current=!1;const L=y.current,Z=Date.now()-L.openedAt;if(Rs("сессия закрыта",{мс:Z,звук:L.audio,слова:L.heard,ошибка:L.lastError||null}),!m.current){c(!1);return}if(L.dead=!L.audio&&Z<KS?L.dead+1:0,L.dead>=ZS){m.current=!1,c(!1),d(L.lastError?`Распознавание не работает: ${L.lastError}`:"Распознавание закрывается сразу после запуска — проверьте доступ к микрофону в настройках сайта");return}L.silent=L.heard?0:L.silent+1,!L.everHeard&&!L.warned&&L.silent>=QS&&(L.warned=!0,d(L.audio?"Микрофон слушает, но речь не распознаётся — проверьте язык диктовки и уровень звука":"С микрофона не идёт звук — проверьте устройство ввода в настройках сайта в браузере")),j.current=setTimeout(()=>{if(j.current=null,!!m.current){L.openedAt=Date.now(),L.audio=!1,L.heard=!1,L.lastError="",N();try{Y.start()}catch{}}},FS)},h.current=Y,()=>{m.current=!1,j.current&&clearTimeout(j.current),j.current=null,k(),Y.onend=null,Y.onresult=null,Y.onerror=null,Y.onstart=null,Y.onaudiostart=null,Y.abort(),h.current=null}},[]);const A=_.useCallback(()=>{var R;if(m.current){if(m.current=!1,Rs("выключение микрофона"),j.current&&clearTimeout(j.current),j.current=null,k(),!v.current){c(!1);return}(R=h.current)==null||R.stop()}},[]),B=_.useCallback(()=>{const R=h.current;if(R){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),Rs("включение микрофона",{язык:R.lang}),N();try{R.start()}catch(Y){Rs("start() не прошёл",Y)}}},[N]),P=_.useCallback(()=>{m.current?A():B()},[B,A]),X=_.useCallback(()=>{var R;m.current&&v.current&&(g.current=!0,(R=h.current)==null||R.abort())},[]);return{supported:s,listening:r,error:o,toggle:P,stop:A,drop:X}}const nw="(max-width: 860px)",Db=/^\/(\S*)$/,lw=new Set(["model","permissions"]);function sw(l){return lw.has(l.name)||l.name.startsWith("__")}const aw=new Set(["clear","rename"]),Ob=/(?:^|\s)@([^\s@]*)$/,iw=200,rw=100,cw=190,ow=5,uw=20*1024*1024,fw=1568,dw=.85;let Lb=0;async function hw(l){var j,v;if(!l.type.startsWith("image/")||l.size>uw)return null;const s=await pw(l);if(!s)return null;const{width:r,height:c}=s;if(r<=0||c<=0)return null;const o=Math.min(1,fw/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:dw),y=x.slice(x.indexOf(",")+1);return y?(Lb+=1,{id:`att${Lb}`,mediaType:g,data:y,previewUrl:x}):null}async function pw(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,onContextSearch:j,onCommand:v,onSend:C,onInterrupt:k,onEscape:N}){var Ue;const A=Wf(nw),[B,P]=_.useState(()=>m?Hh(m):""),[X,R]=_.useState(!1),[Y,L]=_.useState(0),Z=_.useRef(null),D=_.useRef(null),z=_.useRef(!1),te=_.useRef(null),[J,fe]=_.useState(()=>m?Hh(m).length:0),[be,Ne]=_.useState([]),Se=_.useRef(null),V=_.useCallback(I=>{!y||I.length===0||Promise.all(I.map(hw)).then(ae=>{const we=ae.filter(qe=>qe!==null);we.length!==0&&Ne(qe=>[...qe,...we].slice(0,ow))})},[y]);function pe(I){Ne(ae=>ae.filter(we=>we.id!==I))}function H(I){var qe;if(!y)return;const ae=(qe=I.clipboardData)==null?void 0:qe.items;if(!ae)return;const we=[];for(const at of ae){if(!at.type.startsWith("image/"))continue;const xn=at.getAsFile();xn&&we.push(xn)}we.length!==0&&(I.preventDefault(),V(we))}function _e(I){const ae=I.target.files?Array.from(I.target.files):[];I.target.value="",V(ae)}_.useEffect(()=>{y||Ne([])},[y]);const[K,E]=_.useState([]),[G,de]=_.useState(-1),xe=_.useRef(""),[ke,Re]=_.useState(""),Me=tw(_.useCallback((I,ae)=>{I&&P(we=>Ph(we,I)),Re(ae.trim())},[])),Xe=ke?Ph(B,ke):B;_.useEffect(()=>{Me.listening||ke===""||(P(I=>Ph(I,ke)),Re(""))},[Me.listening,ke]),_.useEffect(()=>{var I;x&&((I=Z.current)==null||I.focus())},[x]);const We=_.useRef(new Map),kn=_.useRef(new Map),Be=_.useRef(m),dt=_.useRef({text:B,caret:J});dt.current={text:B,caret:J};const nt=_.useCallback((I,ae,we)=>{ae===""?(We.current.delete(I),kn.current.delete(I)):(We.current.set(I,ae),kn.current.set(I,we)),u_(I,ae)},[]),Ot=Me.drop;_.useLayoutEffect(()=>{const I=Be.current;if(I===m)return;Be.current=m,I&&nt(I,dt.current.text,dt.current.caret);const ae=m?We.current.get(m)??Hh(m):"",we=m?kn.current.get(m):void 0,qe=Math.min(we??ae.length,ae.length);P(ae),fe(qe),te.current=[qe,qe],Re(""),L(0),R(!1),de(-1),xe.current="",Ne([]),Ot()},[m,nt,Ot]),_.useEffect(()=>{m&&nt(m,B,J)},[m,B,J,nt]);const et=l?"Выберите сессию":h??"Опишите задачу… («/» — команды, «@» — файлы)",Jt=_.useRef(0),Fn=_.useCallback(I=>{const ae=parseFloat(getComputedStyle(I).maxHeight),we=Number.isFinite(ae)&&ae>0?ae:cw;I.style.height="auto";const qe=I.scrollHeight;I.style.height=`${Math.min(qe,we)}px`,I.style.overflowY=qe>we?"auto":"hidden"},[]);_.useEffect(()=>{const I=Z.current;I&&Fn(I)},[Xe,et,l,Fn]),_.useLayoutEffect(()=>{const I=Z.current,ae=te.current;!I||!ae||(te.current=null,I.setSelectionRange(ae[0],ae[1]))}),_.useEffect(()=>{const I=Z.current;if(!I)return;const ae=new ResizeObserver(([we])=>{const qe=we==null?void 0:we.contentRect.width;qe===void 0||Math.abs(qe-Jt.current)<1||(Jt.current=qe,Fn(I))});return ae.observe(I),()=>ae.disconnect()},[Fn]);const gt=Me.stop;_.useEffect(()=>{l&&gt()},[l,gt]);const Jn=_.useMemo(()=>Me.error?{ok:!1,message:Me.error}:null,[Me.error]),$t=_.useMemo(()=>{var we;const I=(we=Db.exec(B))==null?void 0:we[1];if(I===void 0)return[];const ae=I.toLowerCase();return r.filter(qe=>!sw(qe)&&ep(qe,ae)<F_).sort((qe,at)=>ep(qe,ae)-ep(at,ae))},[B,r]),zn=!X&&$t.length>0,Un=Math.min(Y,$t.length-1),St=X?null:((Ue=Ob.exec(Xe.slice(0,J)))==null?void 0:Ue[1])??null,_t=_.useRef(j);_t.current=j,_.useEffect(()=>{if(St===null||St===""||St.endsWith("/")){_t.current(St);return}const I=setTimeout(()=>_t.current(St),iw);return()=>clearTimeout(I)},[St]);const Zt=St!==null&&(o==null?void 0:o.query)===St,Lt=Zt?o.entries:[],sn=St!==null,xt=sn&&!Zt,rt=Math.min(Y,Math.max(Lt.length-1,0));_.useEffect(()=>{var ae,we;if(!zn&&!sn)return;const I=zn?Un:rt;(we=(ae=D.current)==null?void 0:ae.children[I])==null||we.scrollIntoView({block:"nearest"})},[zn,sn,Un,rt]);function mn(I,ae){var we;P(I),fe(ae),te.current=[ae,ae],L(0),R(!1),ke!==""&&(Re(""),Me.drop()),(we=Z.current)==null||we.focus()}function gn(){P(""),Re(""),L(0),fe(0),R(!1),de(-1),xe.current="",Ne([]),Me.drop(),m&&nt(m,"",0)}function Nn(I){const ae=I.trim();if(ae===""&&be.length===0||l||z.current)return;const we=C(ae,be.length>0?be.map(qe=>({mediaType:qe.mediaType,data:qe.data})):void 0);if(we instanceof Promise){z.current=!0,we.then(qe=>{z.current=!1,qe&&an(ae)},()=>{z.current=!1});return}we!==!1&&an(ae)}function an(I){I!==""&&E(ae=>[I,...ae.filter(we=>we!==I)].slice(0,rw)),gn()}function zt(I){if(I<-1||I>=K.length)return;G===-1&&(xe.current=B);const ae=I===-1?xe.current:K[I]??"";de(I),mn(ae,ae.length)}function rn(){var qe;const I=((qe=Z.current)==null?void 0:qe.selectionStart)??Xe.length,we=`${I>0&&!/\s$/.test(Xe.slice(0,I))?" ":""}@`;mn(Xe.slice(0,I)+we+Xe.slice(I),I+we.length)}function wt(I){var at;const ae=(at=Ob.exec(Xe.slice(0,J)))==null?void 0:at[1];if(ae===void 0)return;const we=J-ae.length-1,qe=I.kind==="dir"?`@${I.path}/`:`@${I.path} `;mn(Xe.slice(0,we)+qe+Xe.slice(J),we+qe.length)}function Wn(){var ae;const I=(ae=Db.exec(Xe.trim()))==null?void 0:ae[1];if(I&&v(I)){gn();return}Nn(Xe)}function se(I,ae){P(I),fe(ae),L(0),R(!1),de(-1),ke!==""&&(Re(""),Me.drop())}function ge(I){var qe;const ae=aw.has(I.name)?c:null,we=`/${I.name} `;P(we+(ae??"")),fe(we.length+((ae==null?void 0:ae.length)??0)),ae&&(te.current=[we.length,we.length+ae.length]),L(0),(qe=Z.current)==null||qe.focus()}function He(I){if(v(I.name)){P(""),L(0),R(!1);return}I.argumentHint?ge(I):Nn(`/${I.name}`)}function Ke(I){if(zn){if(I.key==="ArrowDown")return I.preventDefault(),L(ae=>(Math.min(ae,$t.length-1)+1)%$t.length);if(I.key==="ArrowUp"){I.preventDefault();const ae=$t.length-1;return L(we=>(Math.min(we,ae)+ae)%$t.length)}if(I.key==="Enter"&&!I.shiftKey){I.preventDefault();const ae=$t[Un];ae&&He(ae);return}if(I.key==="Tab"){I.preventDefault();const ae=$t[Un];ae&&ge(ae);return}if(I.key==="Escape"){I.preventDefault(),I.stopPropagation(),R(!0);return}}if(sn){if(I.key==="ArrowDown"&&Lt.length>0)return I.preventDefault(),L(ae=>(Math.min(ae,Lt.length-1)+1)%Lt.length);if(I.key==="ArrowUp"&&Lt.length>0){I.preventDefault();const ae=Lt.length-1;return L(we=>(Math.min(we,ae)+ae)%Lt.length)}if(I.key==="Enter"&&!I.shiftKey||I.key==="Tab"){const ae=Lt[rt];if(ae){I.preventDefault(),wt(ae);return}if(I.key==="Tab")return}if(I.key==="Escape"){I.preventDefault(),I.stopPropagation(),R(!0);return}}if((I.key==="ArrowUp"||I.key==="ArrowDown")&&!I.shiftKey){const ae=I.currentTarget,we=ae.selectionStart;if(ae.selectionEnd===we){const at=I.key==="ArrowUp"?G+1:G-1;at>=-1&&at<K.length&&requestAnimationFrame(()=>{ae.selectionStart===we&&ae.selectionEnd===we&&zt(at)})}}if(I.key==="Escape"&&N){I.preventDefault(),I.stopPropagation(),N();return}I.key==="Enter"&&!I.shiftKey&&!A&&(I.preventDefault(),Wn())}return a.jsx("div",{className:d?`composer ${d}`:"composer",children:a.jsxs("div",{className:"composer__inner",children:[a.jsx(Rr,{result:Jn}),sn&&!zn&&a.jsxs("div",{className:"cmdmenu",role:"listbox",ref:D,children:[Lt.map((I,ae)=>a.jsxs("button",{role:"option","aria-selected":ae===rt,className:ae===rt?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>L(ae),onMouseDown:we=>{we.preventDefault(),wt(I)},children:[a.jsxs("span",{className:"cmdmenu__name",children:[I.name,I.kind==="dir"?"/":""]}),a.jsx("span",{className:"cmdmenu__desc",children:I.path}),I.ignored&&a.jsx("span",{className:"cmdmenu__tag",children:"git-ignore"})]},I.path)),Lt.length===0&&a.jsx("div",{className:"cmdmenu__empty",children:xt?"ищем…":St?"Ничего не нашлось":"Наберите имя файла или каталога"})]}),zn&&a.jsx("div",{className:"cmdmenu",role:"listbox",ref:D,children:$t.map((I,ae)=>a.jsxs("button",{role:"option","aria-selected":ae===Un,className:ae===Un?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>L(ae),onMouseDown:we=>{we.preventDefault(),He(I)},children:[a.jsxs("span",{className:"cmdmenu__name",children:["/",I.name]}),I.argumentHint&&a.jsx("span",{className:"cmdmenu__hint",children:I.argumentHint}),a.jsx("span",{className:"cmdmenu__desc",children:I.description})]},I.name))}),be.length>0&&a.jsx("div",{className:"composer__attachments",children:be.map(I=>a.jsxs("div",{className:"composer__thumb",children:[a.jsx("img",{src:I.previewUrl,alt:"Вложение"}),a.jsx("button",{type:"button",className:"composer__thumb-remove","aria-label":"Удалить вложение",onClick:()=>pe(I.id),children:a.jsx(yw,{})})]},I.id))}),a.jsxs("div",{className:"composer__field",children:[a.jsx("button",{type:"button",className:"addbtn",title:"Добавить контекст — файл проекта («@»)","aria-label":"Добавить контекст",disabled:l,onClick:rn,children:a.jsx(xw,{})}),y&&a.jsxs(a.Fragment,{children:[a.jsx("input",{ref:Se,type:"file",accept:"image/*",multiple:!0,className:"composer__fileinput",tabIndex:-1,"aria-hidden":"true",onChange:_e}),a.jsx("button",{type:"button",className:"attachbtn",title:"Прикрепить изображение","aria-label":"Прикрепить изображение",disabled:l,onClick:()=>{var I;return(I=Se.current)==null?void 0:I.click()},children:a.jsx(_w,{})})]}),a.jsx("textarea",{ref:Z,value:Xe,disabled:l,placeholder:et,onChange:I=>se(I.target.value,I.target.selectionStart),onSelect:I=>fe(I.currentTarget.selectionStart),onKeyDown:Ke,onPaste:H}),Me.supported&&a.jsx("button",{type:"button",className:Me.listening?"micbtn is-on":"micbtn",title:Me.listening?"Остановить диктовку":"Продиктовать промпт","aria-label":Me.listening?"Остановить диктовку":"Продиктовать промпт","aria-pressed":Me.listening,disabled:l,onClick:Me.toggle,children:a.jsx(vw,{on:Me.listening})}),s?a.jsx("button",{className:"btn",onClick:k,title:"Прервать (Esc)",children:"Стоп"}):a.jsxs("button",{className:"btn btn--primary sendbtn",onClick:Wn,disabled:l||Xe.trim()===""&&be.length===0,"aria-label":g,title:g,children:[a.jsx("span",{className:"sendbtn__label",children:g}),a.jsx(bw,{})]})]})]})})}function Ph(l,s){const r=s.trim();if(r==="")return l;const c=bp(r).slice(mw(l,r)).join(" ");return c===""?l:l===""||/\s$/.test(l)?l+c:`${l} ${c}`}function mw(l,s){const r=bp(l),c=bp(s);for(let o=Math.min(r.length,c.length);o>0;o--)if(r.slice(r.length-o).every((d,h)=>gw(d,c[h]??"")))return o;return 0}function bp(l){return l.split(/\s+/).filter(s=>s!=="")}function gw(l,s){const r=c=>c.toLowerCase().replace(/[.,!?;:…]+$/u,"");return r(l)===r(s)}function xw(){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 bw(){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 _w(){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 yw(){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 vw({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 ep(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 jw({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(Hp,{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(Sw,{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 Sw({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 ww({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 Hp({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 kw({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(Hp,{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(zp,{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 Nw({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(()=>Ew(h,m,x),[h,m,x]),k=C!==null;function N(Y,L){var Z,D;(D=(Z=h[Y])==null?void 0:Z.options[L])!=null&&D.preview&&v(z=>{const te=z.slice();return te[Y]=L,te})}function A(Y,L,Z){g(D=>{const z=D.slice(),te=new Set(z[Y]);return Z?te.has(L)?te.delete(L):te.add(L):te.has(L)||(te.clear(),te.add(L)),z[Y]=te,z}),L!=="other"&&N(Y,L)}function B(Y,L){y(Z=>{const D=Z.slice();return D[Y]=L,D})}function P(){C&&o(l.requestId,C)}function X(Y){Y.key==="Enter"&&(Y.target.closest("button")||k&&(Y.preventDefault(),P()))}function R(Y){var z;if(!["ArrowDown","ArrowUp","ArrowRight","ArrowLeft"].includes(Y.key))return;const L=Array.from(Y.currentTarget.querySelectorAll("button.qsheet__option")),Z=L.indexOf(document.activeElement);if(Z===-1)return;Y.preventDefault();const D=Y.key==="ArrowDown"||Y.key==="ArrowRight"?1:-1;(z=L[(Z+D+L.length)%L.length])==null||z.focus()}return a.jsx("div",{className:"modal-backdrop modal-backdrop--sheet",hidden:r,children:a.jsxs("div",{className:"qsheet",role:"dialog","aria-modal":"true","aria-label":"Вопрос от Claude",onKeyDown:X,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(Hp,{onClick:c})]}),a.jsxs("div",{className:"qsheet__body",children:[l.reason&&a.jsx("p",{className:"qsheet__reason",children:l.reason}),h.map((Y,L)=>a.jsx(Tw,{q:Y,qi:L,selected:m[L]??new Set,otherText:x[L]??"",previewIndex:j[L]??null,onToggle:A,onFocusOption:N,onOtherText:B,onOptionsKeyDown:R},L))]}),a.jsxs("div",{className:"qsheet__actions",children:[a.jsx("button",{className:"btn",onClick:()=>d(l.requestId),children:"Не отвечать"}),a.jsx("button",{className:"btn btn--primary",disabled:!k,onClick:P,children:"Ответить"})]})]})})}function Tw({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(k=>k.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((k,N)=>{const A=r.has(N);return a.jsxs("button",{type:"button",role:v,"aria-checked":A,className:"qsheet__option"+(A?" is-selected":""),onClick:()=>d(s,N,l.multiSelect),onFocus:()=>h(s,N),onMouseEnter:()=>h(s,N),children:[a.jsx("span",{className:"qsheet__opt-mark","aria-hidden":"true"}),a.jsxs("span",{className:"qsheet__opt-body",children:[a.jsx("span",{className:"qsheet__opt-label",children:k.label}),a.jsx("span",{className:"qsheet__opt-desc",children:k.description})]})]},N)}),a.jsxs("div",{className:"qsheet__other",children:[a.jsxs("button",{type:"button",role:v,"aria-checked":j,className:"qsheet__option qsheet__option--other"+(j?" is-selected":""),onClick:()=>d(s,"other",l.multiSelect),children:[a.jsx("span",{className:"qsheet__opt-mark","aria-hidden":"true"}),a.jsxs("span",{className:"qsheet__opt-body",children:[a.jsx("span",{className:"qsheet__opt-label",children:"Другое"}),a.jsx("span",{className:"qsheet__opt-desc",children:"Свой вариант ответа"})]})]}),j&&a.jsx("input",{type:"text",className:"qsheet__other-input",placeholder:"Впишите свой вариант…","aria-label":`Свой вариант ответа на вопрос «${l.question}»`,value:c,onChange:k=>m(s,k.target.value),autoFocus:!0})]})]}),x&&a.jsx("pre",{className:"qsheet__preview",children:y??""})]})}function zb(l){return l.map(s=>{const r=s.options.findIndex(c=>c.preview);return r===-1?null:r})}function Ew(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 Cw(l,s){if(l!=="ExitPlanMode"||!s||typeof s!="object")return null;const r=s.plan;return typeof r=="string"?r:null}function W_({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),Lp);return()=>clearTimeout(m)},[c]),_.useEffect(()=>r(!1),[l]);async function h(){await ma(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(Aw,{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?Oc:Cr})]})]})}function Aw({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 Mw=["low","medium","high"];function P_({models:l,value:s,effort:r,ultracode:c,thinking:o,switchOnFlag:d,showSwitchOnFlag:h=!0,className:m,onModel:g,onEffort:x,onUltracode:y,onThinking:j,onSwitchOnFlag:v}){const[C,k]=_.useState(!1),[N,A]=_.useState(0),B=_.useRef(null),P=_.useRef(null),X=l.find(D=>D.value===s)??null,R=X&&X.supportsEffort?X.effortLevels.length>0?X.effortLevels:Mw:[],Y=R.includes("xhigh");_.useEffect(()=>{if(!C)return;const D=l.findIndex(z=>z.value===s);A(D===-1?0:D)},[C]),_.useEffect(()=>{if(!C)return;function D(z){var te;(te=B.current)!=null&&te.contains(z.target)||k(!1)}return document.addEventListener("mousedown",D),()=>document.removeEventListener("mousedown",D)},[C]),_.useEffect(()=>{var D,z;C&&((z=(D=P.current)==null?void 0:D.querySelector(".is-cursor"))==null||z.scrollIntoView({block:"nearest"}))},[C,N]);function L(D){k(!1),D.value!==s&&g(D.value)}function Z(D){if(D.key==="Escape"){if(!C)return;D.preventDefault(),D.stopPropagation(),k(!1);return}if(D.key==="ArrowDown"||D.key==="ArrowUp"){if(D.preventDefault(),!C)return k(!0);if(l.length===0)return;const z=D.key==="ArrowDown"?1:l.length-1;return A(te=>(te+z)%l.length)}if(D.key==="Enter"||D.key===" "){if(D.preventDefault(),!C)return k(!0);const z=l[N];z&&L(z)}}return a.jsxs("div",{ref:B,className:"select"+(C?" select--open":"")+(m?` ${m}`:""),children:[a.jsxs("button",{type:"button",className:"select__trigger",title:"Модель, усилие и размышления","aria-label":"Модель, усилие и размышления","aria-haspopup":"menu","aria-expanded":C,onClick:()=>k(D=>!D),onKeyDown:Z,children:[(X==null?void 0:X.displayName)??s?a.jsx("span",{className:"select__value",children:(X==null?void 0:X.displayName)??s}):a.jsx("span",{className:"select__value select__value--muted",children:"по умолчанию"}),c?a.jsx("span",{className:"select__suffix select__suffix--hot",children:"ultracode"}):R.length>0&&r&&a.jsx("span",{className:"select__suffix",children:r}),a.jsx(Rw,{})]}),C&&a.jsxs("div",{ref:P,className:"select__menu modelmenu",role:"menu",children:[a.jsx("div",{className:"modelmenu__head",children:"Модель"}),l.map((D,z)=>a.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":D.value===s,className:"select__option"+(z===N?" is-cursor":"")+(D.value===s?" is-on":""),onMouseEnter:()=>A(z),onClick:()=>L(D),children:[a.jsx("span",{className:"select__check","aria-hidden":"true",children:D.value===s?"✓":""}),a.jsx("span",{className:"select__label",children:D.displayName}),D.description&&a.jsx("span",{className:"select__hint",children:D.description})]},D.value)),R.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:R.map(D=>a.jsx("button",{type:"button",role:"menuitemradio","aria-checked":D===r,className:D===r?"modelmenu__level is-on":"modelmenu__level",onClick:()=>x(D),children:D},D))})]}),Y&&a.jsx(tp,{label:"Ultracode",desc:"xhigh и постоянная оркестрация подагентами",on:c,onToggle:()=>y(!c)})]}),a.jsx("div",{className:"modelmenu__sep",role:"separator"}),(X==null?void 0:X.supportsThinking)!==!1&&a.jsx(tp,{label:"Размышления",desc:"расширенное обдумывание перед ответом",on:o,onToggle:()=>j(!o)}),h&&a.jsx(tp,{label:"Менять модель по флагу",desc:"иначе помеченный ход встаёт на паузу",on:d,onToggle:()=>v(!d)})]})]})}function tp({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 Rw(){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 fl({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 Dw({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,k]=_.useState("open"),[N,A]=_.useState(""),[B,P]=_.useState(!1),[X,R]=_.useState(""),[Y,L]=_.useState(""),[Z,D]=_.useState({git:!0,claudeMd:!0,readme:!0}),z=N.trim(),te=z!=="",J=X.trim(),fe=Y.trim(),be=J!==""&&fe!=="";_.useEffect(()=>{X===""&&d.length>0&&R(d[0])},[d]);const Ne=_.useRef(m);Ne.current=m,_.useEffect(()=>{if(C!=="open")return;const H=N.trim(),_e=setTimeout(()=>Ne.current(H),200);return()=>clearTimeout(_e)},[N,C]);function Se(){te&&y(z)}function V(){be&&j(J,fe,Z)}function pe(){te&&(P(!0),g(z))}return h?a.jsxs(fl,{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(H=>a.jsx("li",{children:H},H))})}),a.jsx("p",{className:"modal__text modal__text--dim",children:"Проект открыт и работает — недостающее можно добавить руками, в дереве файлов или из терминала."})]}):a.jsxs(fl,{title:"Новый проект",className:B&&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:!te,onClick:pe,title:"Найти по описанию",children:"Попросить агента"}),a.jsx("button",{className:"btn btn--primary",disabled:!te,onClick:Se,children:"Открыть"})]}):a.jsx("button",{className:"btn btn--primary",disabled:!be,onClick:V,children:"Создать"})]}),children:[a.jsxs("div",{className:"tabs",children:[a.jsx(Ub,{label:"Открыть",on:C==="open",onClick:()=>k("open")}),a.jsx(Ub,{label:"Создать",on:C==="create",onClick:()=>k("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:N,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"C:\\Projects\\my-app",onChange:H=>A(H.target.value),onKeyDown:H=>{H.key==="Enter"&&(H.preventDefault(),Se())}}),o&&a.jsx("p",{className:"modal__error",children:o}),l.length>0&&a.jsx("ul",{className:"finds",children:l.map(H=>a.jsx("li",{children:a.jsxs("button",{className:"find",disabled:H.open,title:H.open?"Этот проект уже открыт":H.path,onClick:()=>A(H.path),onDoubleClick:()=>y(H.path),children:[a.jsx("span",{className:"find__name",children:H.name}),a.jsx("span",{className:"find__path",children:H.path}),a.jsx("span",{className:"find__note",children:zw(H)})]})},H.path))}),l.length===0&&te&&!s&&!B&&a.jsx("p",{className:"modal__text modal__text--dim",children:"Ничего похожего среди каталогов, где вы работали. Если помните не имя, а суть проекта — опишите его и нажмите «Попросить агента». Проекта ещё нет вовсе — рядом вкладка «Создать»."}),B&&a.jsx("div",{className:"finds__agent",children:a.jsx(Up,{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:X,spellCheck:!1,autoComplete:"off",placeholder:"C:\\Projects",onChange:H=>R(H.target.value)}),d.length>0&&a.jsx("div",{className:"newproj__roots",children:d.map(H=>a.jsx("button",{type:"button",className:H===J?"newproj__root is-on":"newproj__root",title:H,onClick:()=>R(H),children:Lw(H)},H))}),a.jsx("label",{className:"field newproj__field",htmlFor:"workspace-name",children:"Имя проекта"}),a.jsx("input",{id:"workspace-name",className:"input input--mono",value:Y,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"my-app",onChange:H=>L(H.target.value),onKeyDown:H=>{H.key==="Enter"&&(H.preventDefault(),V())}}),a.jsx("p",{className:"newproj__preview",children:be?Ow(J,fe):"Каталог появится здесь"}),o&&a.jsx("p",{className:"modal__error",children:o}),a.jsxs("div",{className:"newproj__opts",children:[a.jsx(np,{label:"git init",desc:"панель истории работает сразу",on:Z.git,onToggle:()=>D(H=>({...H,git:!H.git}))}),a.jsx(np,{label:"CLAUDE.md",desc:"заготовка инструкций для агента",on:Z.claudeMd,onToggle:()=>D(H=>({...H,claudeMd:!H.claudeMd}))}),a.jsx(np,{label:"README.md",desc:"по нему проект потом узнаёт поиск",on:Z.readme,onToggle:()=>D(H=>({...H,readme:!H.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 np({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 Ow(l,s){const r=l.includes("\\")?"\\":"/";return l.replace(/[\\/]+$/,"")+r+s}function Lw(l){const s=l.includes("\\")?"\\":"/",r=l.split(/[\\/]/).filter(Boolean);return r.length<=2?l:`…${s}${r.slice(-2).join(s)}`}function zw(l){return l.open?"уже открыт":l.why?l.why:l.sessions===0?"рядом с вашими проектами":`${Uw(l.sessions)}${Hw(l.lastUsedAt)}`}function Uw(l){const s=l%10,r=l%100;return r>=11&&r<=14?`${l} сессий`:s===1?`${l} сессия`:s>=2&&s<=4?`${l} сессии`:`${l} сессий`}function Hw(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 Bp=7;function Bw(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)}Iw(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,Bp)}}function Hb(l){const s=l.indexOf(null);return s!==-1?s:(l.push(null),l.length-1)}function Iw(l){for(;l.length>0&&l[l.length-1]===null;)l.pop()}const ey=1500;function qw(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:Gw(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:Yw(l,r)}}function Gw(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 Yw(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 $w({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:k,onToggleZoom:N}){const A=Bw((s==null?void 0:s.commits)??[]),B=[...s!=null&&s.detached?[{value:"",label:`отделён · ${s.head.slice(0,8)}`}]:[],...((s==null?void 0:s.branches)??[]).map(P=>({value:P.name,label:P.name,hint:P.hash.slice(0,8)}))];return a.jsxs("aside",{className:(l?"sidepane sidepane--git sidepane--open":"sidepane sidepane--git")+(k?" sidepane--zoomed":""),"aria-label":"История git",children:[a.jsxs("div",{className:"sidepane__head",onDoubleClick:P=>{N&&(P.target.closest("button")||N())},children:[a.jsx(Fw,{}),a.jsx("span",{className:"sidepane__title",children:"История"}),a.jsx("button",{className:"sidepane__btn",title:"Обновить","aria-label":"Обновить историю",onClick:d,children:"↻"}),N&&a.jsx("button",{className:"sidepane__btn",title:k?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":k?"Свернуть панель истории":"Развернуть панель истории на весь экран","aria-pressed":k,onClick:N,children:a.jsx(Vc,{active:k})}),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(Ls,{className:"gitbar__branch",title:"Ветка — выбрать значит переключиться",value:s.detached?"":s.branch,options:B,onChange:P=>{P&&m(P,`ветку ${P}`)}}),a.jsx($c,{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(ek,{}),o]}):s.hasRemote?a.jsxs(a.Fragment,{children:[a.jsxs("button",{type:"button",className:"btn btn--sm",title:"Отправить текущую ветку в origin",onClick:g,children:[a.jsx(Jw,{}),"Отправить",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(Ww,{}),"Забрать",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(Pw,{})})]})]}):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} ${sk(s.changed.length)}`:"Рабочее дерево чистое"}),a.jsx("span",{className:"gitrow__meta",children:s.changed.length>0?s.changed.slice(0,4).map(P=>lk(P.path)).join(", "):"незакоммиченных изменений нет"})]})}),A.rows.map(P=>a.jsx(Vw,{row:P,columns:A.columns,head:P.commit.hash===s.head,local:s.hasRemote&&!P.commit.pushed,active:c===P.commit.hash,onOpen:()=>h(P.commit.hash)},P.commit.hash)),A.rows.length===0&&a.jsx("p",{className:"sidepane__empty",children:"В репозитории ещё нет коммитов"})]})]}):a.jsxs("div",{className:"gitempty",children:[a.jsx("p",{className:"gitempty__text",children:s.message||"Это не git-репозиторий"}),s.noRepo&&a.jsxs(a.Fragment,{children:[a.jsxs("button",{type:"button",className:"btn btn--sm btn--primary gitempty__btn",onClick:y,children:[a.jsx(Ib,{}),"Опубликовать на GitHub"]}),a.jsx("p",{className:"gitempty__hint",children:"Заведёт репозиторий, сделает первый коммит и отправит его на GitHub."})]})]}),a.jsx(Rr,{result:r,onDismiss:v})]})}const Yo=50,Bb=13,Xw=500;function Vw({row:l,columns:s,head:r,local:c,active:o,onOpen:d}){const{commit:h}=l,m=h.refs.map(tk).filter(Boolean),[g,x]=_.useState(null),y=_.useRef(null);function j(N){const A=N.touches[0];if(!A)return;const B={timer:0,x:A.clientX,y:A.clientY,fired:!1};B.timer=window.setTimeout(()=>{B.fired=!0,x({x:B.x,y:B.y})},Xw),y.current=B}function v(N){const A=y.current,B=N.touches[0];!A||!B||Math.hypot(B.clientX-A.x,B.clientY-A.y)>10&&(window.clearTimeout(A.timer),y.current=null)}function C(N){const A=y.current;A&&(window.clearTimeout(A.timer),A.fired&&N.preventDefault())}function k(){const N=[{id:"hash",label:"Копировать хеш",hint:h.shortHash,onSelect:()=>void ma(h.hash)},{id:"short",label:"Копировать короткий хеш",onSelect:()=>void ma(h.shortHash)},{id:"subject",label:"Копировать сообщение",onSelect:()=>void ma(h.subject)}],A=new Set;for(const B of h.refs){const P=B.startsWith("tag: "),X=nk(B);!X||A.has(X)||(A.add(X),N.push({id:`ref:${X}`,label:P?"Копировать тег":"Копировать ветку",hint:X,onSelect:()=>void ma(X)}))}return N}return a.jsxs(a.Fragment,{children:[a.jsxs("button",{className:"gitrow"+(o?" is-on":""),title:c?"Коммит ещё не отправлен на удалённый репозиторий":void 0,onClick:()=>{var N;if((N=y.current)!=null&&N.fired){y.current=null;return}d()},onContextMenu:N=>{N.preventDefault(),x({x:N.clientX,y:N.clientY})},onTouchStart:j,onTouchMove:v,onTouchEnd:C,onTouchCancel:C,children:[a.jsx(Qw,{row:l,columns:s,head:r,local:c}),a.jsxs("span",{className:"gitrow__body",children:[a.jsxs("span",{className:"gitrow__subject",children:[m.map(N=>a.jsx("span",{className:"gitrow__ref",children:N},N)),h.subject]}),a.jsxs("span",{className:"gitrow__meta",children:[h.shortHash," · ",h.author," · ",ak(h.date),c&&a.jsx("span",{className:"gitrow__local",children:"· не отправлен"})]})]})]}),g&&a.jsx(Oi,{x:g.x,y:g.y,items:k(),onClose:()=>x(null)})]})}function Qw({row:l,columns:s,head:r,local:c}){const o=s*Bb+6,d=Yo/2,h=x=>8+Math.min(x,Bp-1)*Bb,m=c?"3.5 2.5":void 0,g=Rf(l.col);return a.jsxs("svg",{className:"gitgraph",width:o,height:Yo,viewBox:`0 0 ${o} ${Yo}`,"aria-hidden":"true",children:[l.through.map(x=>a.jsx("line",{x1:h(x),y1:0,x2:h(x),y2:Yo,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)} ${Yo}`,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%Bp})`}function Kw({detail:l,local:s,onCheckout:r,onClose:c}){const o=l.hash==="";return a.jsxs(fl,{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($c,{text:l.subject,hint:"сообщение коммита"})]}),a.jsxs("p",{className:"commit__meta",children:[l.author,l.email&&` <${l.email}>`," · ",ik(l.date)]}),a.jsxs("div",{className:"commit__line commit__line--hash",children:[a.jsx("span",{className:"commit__hash",children:l.hash}),a.jsx($c,{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(Zw,{file:d,defaultOpen:l.files.length<=3},d.path+d.oldPath))]})}function Zw({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(zp,{diff:qw(l)})]})}function Fw(){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 Jw(){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 Ww(){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 Pw(){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 ek(){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 tk(l){return l.replace(/^HEAD -> /,"").replace(/^tag: /,"⌂ ").trim()}function nk(l){const s=l.replace(/^HEAD -> /,"").replace(/^tag: /,"").trim();return s==="HEAD"?"":s}function lk(l){const s=l.split("/");return s[s.length-1]??l}function sk(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 ak(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 ik(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 rk({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 H;const[v,C]=_.useState(()=>qb(c)),[k,N]=_.useState(""),[A,B]=_.useState(""),[P,X]=_.useState(!0),[R,Y]=_.useState("Первый коммит"),[L,Z]=_.useState(null),[D,z]=_.useState("");_.useEffect(()=>{!k&&s.length>0&&N(s[0].login)},[k,s]),_.useEffect(()=>{r&&L===null&&Z(new Set(r.files))},[r,L]);const te=(l==null?void 0:l.connected)===!0,J=s.map(_e=>({value:_e.login,label:_e.login,hint:_e.kind==="org"?"организация":void 0})),fe=_.useMemo(()=>{if(!r)return[];const _e=D.trim().toLowerCase();return _e?r.files.filter(K=>K.toLowerCase().includes(_e)):r.files},[r,D]),be=(L==null?void 0:L.size)??0,Ne=te&&v.trim()!==""&&k!==""&&d===""&&(o||be>0);function Se(_e){Z(K=>{const E=new Set(K??[]);return E.has(_e)?E.delete(_e):E.add(_e),E})}function V(_e){Z(K=>{const E=new Set(K??[]);for(const G of fe)_e?E.add(G):E.delete(G);return E})}function pe(){if(!Ne)return;const _e=(r==null?void 0:r.files)??[];x({owner:k,name:v.trim(),description:A.trim(),private:P,include:o?[]:_e.filter(K=>L==null?void 0:L.has(K)),ignore:o?[]:_e.filter(K=>!(L!=null&&L.has(K))),message:o?"":R.trim()||"Первый коммит"})}return a.jsxs(fl,{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:!Ne,onClick:pe,children:d||"Опубликовать"})]}),children:[a.jsx(ck,{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(Ls,{className:"settings__select",value:k,options:J,onChange:N,placeholder:"выберите владельца",ariaLabel:"Владелец репозитория"}):a.jsx("p",{className:"publish__static",children:((H=s[0])==null?void 0:H.login)??"—"})]}),a.jsxs("label",{className:"field publish__field",children:[a.jsx("span",{children:"Описание (необязательно)"}),a.jsx("input",{className:"input",value:A,placeholder:"о чём проект — одной строкой",onChange:_e=>B(_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:P,onClick:()=>X(!0)}),a.jsx(Gb,{title:"Публичный",desc:"Виден всем в интернете — код, история коммитов, всё содержимое.",risky:!0,on:!P,onClick:()=>X(!1)})]})]})]}),!o&&a.jsxs("div",{className:"publish__section",children:[a.jsx("h3",{className:"publish__heading",children:"Файлы первого коммита"}),r===null?a.jsx("p",{className:"modal__text",children:"Читаем файлы…"}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"publish__filehead",children:[a.jsxs("span",{className:"publish__filecount",children:[be," из ",r.files.length," файлов"]}),a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>V(!0),children:"Отметить все"}),a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>V(!1),children:"Снять все"})]}),r.files.length>8&&a.jsx("input",{className:"input publish__filter",value:D,placeholder:"Фильтр по пути…",spellCheck:!1,onChange:_e=>z(_e.target.value)}),a.jsx("div",{className:"publish__filelist",children:fe.length===0?a.jsx("p",{className:"modal__text publish__filesempty",children:"Ничего не найдено по фильтру."}):fe.map(_e=>a.jsxs("button",{type:"button",role:"checkbox","aria-checked":(L==null?void 0:L.has(_e))===!0,className:"publish__file",onClick:()=>Se(_e),children:[a.jsx("span",{className:"publish__box"+(L!=null&&L.has(_e)?" is-on":""),"aria-hidden":"true",children:(L==null?void 0:L.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:R,onChange:_e=>Y(_e.target.value)})]})]})]}),a.jsx(Rr,{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 ck({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(ok,{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 ok({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(fk,{}):a.jsx(uk,{})})]})}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("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 fk(){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 dk({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(fl,{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(Rr,{result:s,onDismiss:c})]})}function hk({open:l,items:s,busy:r,ready:c,commands:o,contextResult:d,draftKey:h,models:m,model:g,effort:x,ultracode:y,thinking:j,switchOnFlag:v,onContextSearch:C,onCommand:k,onModel:N,onEffort:A,onUltracode:B,onThinking:P,onSwitchOnFlag:X,onAsk:R,onInterrupt:Y,onReset:L,onClose:Z,zoomed:D,onToggleZoom:z}){return a.jsxs("aside",{className:(l?"sidepane sidepane--ask sidepane--open":"sidepane sidepane--ask")+(D?" sidepane--zoomed":""),"aria-label":"Вопрос на полях",children:[a.jsxs("div",{className:"sidepane__head",onDoubleClick:te=>{z&&(te.target.closest("button")||z())},children:[a.jsx(pk,{}),a.jsx("span",{className:"sidepane__title",children:"Вопрос на полях"}),a.jsx("button",{className:"sidepane__btn",title:"Начать заново — следующий вопрос возьмёт свежий контекст","aria-label":"Начать боковой разговор заново",disabled:s.length===0,onClick:L,children:"↻"}),z&&a.jsx("button",{className:"sidepane__btn",title:D?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":D?"Свернуть панель вопроса":"Развернуть панель вопроса на весь экран","aria-pressed":D,onClick:z,children:a.jsx(Vc,{active:D})}),a.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель вопроса",onClick:Z,children:"✕"})]}),m.length>0&&a.jsxs("div",{className:"sidepane__tools",children:[a.jsx(P_,{className:"select--compact",models:m,value:g,effort:x,ultracode:y,thinking:j,switchOnFlag:v,onModel:N,onEffort:A,onUltracode:B,onThinking:P,onSwitchOnFlag:X}),a.jsx("span",{className:"sidepane__note",title:"Боковой вопрос работает только на чтение",children:"только чтение"})]}),a.jsx(Up,{items:s,busy:r,waiting:!1,empty:c?"Спросите о том, что происходит: вопрос уйдёт в сторону от основного разговора и не попадёт в его контекст. Отвечающий видит сессию и проект, но ничего не меняет.":"Откройте сессию — вопрос задаётся о ней."}),a.jsx(Z_,{className:"composer--side",disabled:!c,busy:r,commands:o,sessionTitle:null,contextResult:d,draftKey:h?`side:${h}`:null,placeholder:"Спросить, не мешая работе…",sendLabel:"Спросить",autoFocus:l,attachmentsEnabled:!1,onContextSearch:C,onCommand:k,onSend:R,onInterrupt:Y,onEscape:r?Y:Z})]})}function pk(){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 mk=75,gk=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:_k(l,s),"aria-label":c,children:r.map(o=>a.jsx(xk,{label:o.label,window:o.window},o.key))})}function xk({label:l,window:s}){const r=Math.round(s.utilization),c=vk(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${bk(r)}`,style:{width:`${r}%`}})}),a.jsxs("span",{className:"usage__pct",children:[r,"%"]}),a.jsx("span",{className:"usage__reset",title:Ip(s.resetsAt)||void 0,children:c&&`↻ ${c}`})]})}function bk(l){return l>=gk?" usage__fill--over":l>=mk?" usage__fill--warn":""}function _k(l,s){if(s.length>0)return yk(s);const r=[l.plan?`Лимиты плана ${l.plan}`:"Лимиты плана"],c=(o,d)=>{if(!d)return;const h=Ip(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 yk(l){const s=["Квота Antigravity"];for(const r of l){const c=Ip(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 vk(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 Ip(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:jk(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 jk(l){return l.toLocaleDateString(void 0,{weekday:"long",day:"numeric",month:"long",year:"numeric"})}function Sk({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 k=b_({onLongPress:()=>j==null?void 0:j(),onClick:()=>y==null?void 0:y(),disabled:v});return a.jsx(fl,{title:"Настройки сессии",className:"modal--sheet",sheet:!0,onClose:l,children:a.jsxs("div",{className:"sessionmenu",children:[s&&a.jsx(Ec,{label:"Режим прав",children:s}),a.jsx(Ec,{label:"Модель",children:r}),(c==null?void 0:c.available)&&(c.fiveHour||c.sevenDay||c.buckets&&c.buckets.length>0)&&a.jsx(Ec,{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(wk,{}),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(Ec,{label:"Время",children:a.jsx(sy,{})}),d&&a.jsx(Ec,{label:"Стоимость хода",children:a.jsx("span",{className:"badge badge--cost",children:d})}),o&&a.jsx(Ec,{label:"Каталог проекта",children:a.jsx(W_,{path:o})}),x&&a.jsx("button",{type:"button",className:"sessionmenu__rename",onClick:x,children:"Переименовать сессию"}),y&&a.jsxs("button",{type:"button",className:v?"sessionmenu__handoff is-busy":k.holding?"sessionmenu__handoff is-holding":"sessionmenu__handoff",style:{"--hold-ms":`${k.thresholdMs}ms`},"aria-busy":v,disabled:v,...k.handlers,children:[a.jsx("span",{className:"sessionmenu__handoff-hold","aria-hidden":"true"}),a.jsxs("span",{className:"sessionmenu__handoff-text",children:[v?"Пишется хэндофф…":"Хэндофф и новая сессия",!v&&a.jsx("span",{className:"sessionmenu__handoff-hint",children:"Зажмите — новая сессия без хэндоффа"})]})]}),C&&a.jsx("button",{type:"button",className:"sessionmenu__stop",onClick:C,children:"Остановить сессию"})]})})}function Ec({label:l,children:s}){return a.jsxs("div",{className:"sessionmenu__row",children:[a.jsx("span",{className:"sessionmenu__label",children:l}),s]})}function wk(){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 kk({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(fl,{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(Nk,{servers:s,auth:h,remote:m,actions:g}),l==="plugins"&&a.jsx(Rk,{plugins:r,marketplaces:c,actions:g}),l==="catalog"&&a.jsx(Dk,{catalog:o,hasMarketplaces:c.length>0,actions:g,onMarketplaces:()=>x("plugins")}),a.jsx(Rr,{result:d})]})}function Nk({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--${Ck(h.status)}`,children:Ek[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(Tk,{auth:m,remote:r,actions:c})]},h.name)})}),o?a.jsx(Ak,{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 Tk({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 Ek={connected:"подключён",failed:"ошибка","needs-auth":"нужна авторизация",pending:"подключается",disabled:"выключен",unknown:"неизвестно"};function Ck(l){return l==="connected"?"ok":l==="failed"?"bad":l==="needs-auth"?"warn":"mute"}function Ak({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 k(){if(C)if(v){const[N,...A]=Mk(h);l(r.trim(),{transport:"stdio",command:N??"",args:A,env:Yb(y)})}else l(r.trim(),{transport:o,url:g.trim(),headers:Yb(y)})}return a.jsxs("div",{className:"extform extform--card",children:[a.jsx("label",{className:"field",htmlFor:"mcp-name",children:"Имя сервера"}),a.jsx("input",{id:"mcp-name",className:"input input--mono",value:r,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"context7",onChange:N=>c(N.target.value)}),a.jsx("label",{className:"field",children:"Транспорт"}),a.jsx(Ls,{title:"Транспорт",value:o,options:[{value:"stdio",label:"stdio",hint:"локальный процесс"},{value:"http",label:"http",hint:"удалённый сервер"},{value:"sse",label:"sse",hint:"удалённый, поток событий"}],onChange:N=>d(N)}),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:N=>m(N.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:N=>x(N.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:N=>j(N.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:k,children:"Подключить"})]})]})}function Yb(l){const s={};for(const r of l.split(`
122
- `)){const c=r.trim();if(!c)continue;const o=c.indexOf("="),d=c.indexOf(":"),h=o===-1?d:d===-1?o:Math.min(o,d);h<=0||(s[c.slice(0,h).trim()]=c.slice(h+1).trim())}return s}function Mk(l){return(l.trim().match(/"[^"]*"|'[^']*'|\S+/g)??[]).map(s=>s.replace(/^["']|["']$/g,""))}function Rk({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 $o=30;function Dk({catalog:l,hasMarketplaces:s,actions:r,onMarketplaces:c}){const[o,d]=_.useState(""),[h,m]=_.useState(""),[g,x]=_.useState($o),[y,j]=_.useState(""),v=_.useMemo(()=>[...new Set(l.map(N=>N.category).filter(Boolean))].sort(),[l]),C=_.useMemo(()=>{const k=o.trim().toLowerCase();return l.filter(N=>h&&N.category!==h?!1:k?`${N.name} ${N.displayName} ${N.description} ${N.author}`.toLowerCase().includes(k):!0)},[l,o,h]);return l.length===0?a.jsxs("p",{className:"modal__text",children:[s?"Маркетплейсы подключены, но их каталог ещё не выкачан. Попробуйте открыть окно ещё раз через минуту.":"Ни одного маркетплейса — ставить нечего."," ",a.jsx("button",{className:"linkish",onClick:c,children:"Подключить маркетплейс"})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"catalog__filters",children:[a.jsx("input",{className:"input",value:o,spellCheck:!1,autoComplete:"off","aria-label":"Поиск по каталогу",placeholder:"Поиск: имя, описание, автор",onChange:k=>{d(k.target.value),x($o)}}),a.jsx(Ls,{title:"Категория",value:h,options:[{value:"",label:"все категории"},...v.map(k=>({value:k,label:k}))],onChange:k=>{m(k),x($o)}})]}),C.length===0?a.jsx("p",{className:"modal__text",children:"Ничего не нашлось."}):a.jsx("ul",{className:"extlist",children:C.slice(0,g).map(k=>a.jsxs("li",{className:"extlist__row",children:[a.jsxs("div",{className:"extlist__head",children:[a.jsx("span",{className:"extlist__name",children:k.name}),k.installed&&a.jsx("span",{className:"chip chip--ok",children:"установлен"}),k.version&&a.jsx("span",{className:"chip",children:k.version}),k.category&&a.jsx("span",{className:"chip",children:k.category})]}),k.description&&a.jsx("div",{className:"catalog__desc",children:k.description}),a.jsxs("div",{className:"extlist__meta",children:[k.author&&`${k.author} · `,k.marketplace]}),a.jsxs("div",{className:"extlist__actions",children:[a.jsx("button",{className:"btn btn--ghost btn--sm",disabled:k.installed,onClick:()=>r.pluginInstall(k.id),children:k.installed?"Уже стоит":"Установить"}),k.homepage&&a.jsx("a",{className:"btn btn--ghost btn--sm",href:k.homepage,target:"_blank",rel:"noreferrer",children:"Страница"})]})]},k.id))}),C.length>g&&a.jsx("div",{className:"extbar",children:a.jsxs("button",{className:"btn",onClick:()=>x(k=>k+$o),children:["Ещё ",Math.min($o,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:k=>j(k.target.value),onKeyDown:k=>{k.key!=="Enter"||y.trim()===""||(k.preventDefault(),r.pluginInstall(y.trim()),j(""))}}),a.jsx("button",{className:"btn",disabled:y.trim()==="",onClick:()=>{r.pluginInstall(y.trim()),j("")},children:"Установить"})]})]})]})}function Ok({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,k]=_.useState(!1),N=d!==null&&(l==null?void 0:l.loggedIn)===!0&&!C&&!j,A=_.useMemo(()=>{if(s.error)return{ok:!1,message:s.error};const X=s.output.trim();return X===""?null:{ok:!0,message:X}},[s.error,s.output]);function B(X=x){const R=X.trim();R!==""&&(r.submitCode(R),y(""))}function P(){if(o>0){v(!1),k(!0);return}r.login("claudeai",!0)}return a.jsxs(fl,{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:Uk[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(Hk,{login:s,remote:c,code:x,onCode:y,onSubmit:B,onCancel:r.cancel}):a.jsxs(a.Fragment,{children:[a.jsx(Rr,{result:A}),C&&a.jsx("p",{className:"account__warn",role:"alert",children:Lk(o)}),N&&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:[N&&a.jsxs("button",{type:"button",className:"btn account__relink",title:`Переподключить сессию
123
- ${m}`,"aria-label":"Переподключить сессию",disabled:h,onClick:d,children:[a.jsx(zk,{}),"Переподключить"]}),C?a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>k(!1),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",autoFocus:!0,onClick:()=>{k(!1),r.login("claudeai",!0)},children:"Всё равно сменить"})]}):a.jsx("button",{className:"btn",onClick:P,children:"Сменить аккаунт"}),j?a.jsx("button",{className:"btn btn--danger",autoFocus:!0,onClick:()=>{v(!1),r.logout()},children:"Точно выйти?"}):a.jsx("button",{className:"btn",onClick:()=>{k(!1),v(!0)},children:"Выйти"})]}):a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>r.login("console",!1),children:"Через Console"}),a.jsx("button",{className:"btn btn--primary",onClick:()=>r.login("claudeai",!1),children:"Войти"})]})})]})]})}function Lk(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 zk(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("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 Uk={"claude.ai":"подписка Claude",console:"Anthropic Console",apiKey:"API-ключ",none:"нет"};function Hk({login:l,remote:s,code:r,onCode:c,onSubmit:o,onCancel:d}){var k;const[h,m]=_.useState(null),g=_.useRef(""),x=_.useRef({code:r,onCode:c,onSubmit:o});x.current={code:r,onCode:c,onSubmit:o};const y=_.useCallback(async N=>{const{code:A,onCode:B,onSubmit:P}=x.current;if(N&&A.trim()!=="")return;const X=await gp();if(X===null){N||m("Не получилось прочитать буфер — вставьте код в поле руками.");return}const R=X.trim();if(!$b(R)){N||m("В буфере не похоже на код: нужен он целиком, вместе с частью после «#». Подойдёт и адрес страницы, на которую увёл браузер, — его тоже разберём.");return}if(N){if(g.current===R)return;g.current=R}m(null),B(R),P(R)},[]);_.useEffect(()=>{if(!l.awaitingCode)return;const N=()=>{document.visibilityState==="visible"&&y(!0)};return document.addEventListener("visibilitychange",N),()=>document.removeEventListener("visibilitychange",N)},[l.awaitingCode,y]);const j=typeof((k=navigator.clipboard)==null?void 0:k.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($c,{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:N=>{m(null),c(N.target.value)},onKeyDown:N=>{N.key==="Enter"&&(N.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 Bk({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(fl,{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:"claude",label:"Claude",hint:"Claude Code"},{id:"antigravity",label:"Antigravity",hint:"Google agy"}],lp="",Ik=[{value:"opus",label:"Opus",hint:"полный список моделей виден, когда открыта сессия"},{value:"sonnet",label:"Sonnet",hint:"полный список моделей виден, когда открыта сессия"},{value:"haiku",label:"Haiku",hint:"полный список моделей виден, когда открыта сессия"}],qk=p_.map(l=>({value:l.value,label:l.value,hint:l.hint})),Df=3600*1e3,Gk=[{value:"6h",label:"6 часов"},{value:"24h",label:"Сутки"},{value:"48h",label:"Двое суток"},{value:"168h",label:"Неделя"},{value:"never",label:"Никогда"}],Ac={"6h":6*Df,"24h":24*Df,"48h":48*Df,"168h":168*Df,never:0};function Yk(l){return Ac[l]??Ac["48h"]}const $k=[{value:"5m",label:"5 минут"},{value:"10m",label:"10 минут"},{value:"30m",label:"30 минут"},{value:"60m",label:"Час"},{value:"never",label:"Никогда"}],Of=60*1e3,Mc={"5m":5*Of,"10m":10*Of,"30m":30*Of,"60m":60*Of,never:0};function Xk(l){return Mc[l]??Mc["10m"]}function Vk(l){const s=Object.entries(Mc).find(([,r])=>r===l);return s?s[0]:Object.keys(Mc).reduce((r,c)=>Math.abs(Mc[c]-l)<Math.abs(Mc[r]-l)?c:r)}function Qk(l){const s=Object.entries(Ac).find(([,r])=>r===l);return s?s[0]:Object.keys(Ac).reduce((r,c)=>Math.abs(Ac[c]-l)<Math.abs(Ac[r]-l)?c:r)}const Kk=[{value:"off",label:"Выключено"},{value:"500",label:"0.5 с"},{value:"1500",label:"1.5 с"},{value:"3000",label:"3 с"},{value:"10000",label:"10 с"}],Rc={off:0,500:500,1500:1500,3e3:3e3,1e4:1e4};function Zk(l){return Rc[l]??Rc.off}function Qb(l){return Number.isFinite(l)?Math.min(100,Math.max(0,Math.round(l))):0}function Fk(l){const s=Object.entries(Rc).find(([,r])=>r===l);return s?s[0]:Object.keys(Rc).reduce((r,c)=>Math.abs(Rc[c]-l)<Math.abs(Rc[r]-l)?c:r)}const Jk=[{value:"project",title:"Только текущий проект",description:"Агент молча пишет файлы в открытом проекте и в ~/.claude — настройках самого Claude Code. Чужой проект и любая новая папка — только с явного разрешения."},{value:"projects",title:"Папка с проектами",description:"То же плюс каталог, где лежат открытые проекты, — то есть и соседний проект тоже. Всё остальное — с разрешения."},{value:"all",title:"Все папки на компьютере",description:"Агент пишет файлы куда угодно на диске — вопросов про место записи не будет.",risky:!0}];function Wk({settings:l,models:s,relayState:r,local:c,onChange:o,onEnableShell:d,onDisableShell:h,onOpenRelay:m,onClose:g}){const x=l===null,y=!x&&l.terminalEnabled===!0,j=!x&&l.liveSessionsFirst===!0,v=!y,C=_.useMemo(()=>{const N=[{value:lp,label:"Как в Claude Code",hint:"модель определят настройки самого Claude Code"},...s.length>0?s.map(A=>({value:A.value,label:A.displayName,hint:A.description})):Ik];return l&&l.startModel!==null&&!N.some(A=>A.value===l.startModel)&&N.push({value:l.startModel,label:l.startModel}),N},[s,l]);function k(){var N,A;return(r==null?void 0:r.paired)!==!0?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"settings__hint",children:"Компьютер не связан с аккаунтом — включать удалённый доступ пока не к чему: без пары ни телефон, ни другое устройство этот компьютер вообще не видят."}),a.jsx("button",{type:"button",className:"btn",disabled:v,onClick:m,children:"Связать компьютер"})]}):(N=r.shell)!=null&&N.enabled?a.jsxs(a.Fragment,{children:[a.jsxs("p",{className:"settings__hint",children:["Разрешён: с телефона и любого другого устройства этого аккаунта можно открыть терминал и выполнить на этом компьютере что угодно — как если бы сидели за ним.",r.shell.confirmedAt&&` Включено ${new Date(r.shell.confirmedAt).toLocaleString()}.`]}),a.jsx("button",{type:"button",className:"btn btn--danger",disabled:v,onClick:h,children:"Запретить"})]}):(A=r.shell)!=null&&A.pending?a.jsxs(a.Fragment,{children:[a.jsxs("p",{className:"settings__hint",children:["Письмо ушло на ",a.jsx("b",{children:r.shell.email}),". Перейдите по ссылке из него — терминал заработает удалённо."]}),a.jsx("p",{className:"settings__hint",children:"Повторная отправка ограничена раз в минуту — если жали кнопку только что, письмо не придёт и от повторного нажатия тоже. Если сейчас доберётесь до самого компьютера, там разрешение включится сразу, без письма."}),a.jsx("button",{type:"button",className:"btn",disabled:v,onClick:d,children:"Отправить письмо ещё раз"})]}):a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"settings__hint",children:"Сейчас с телефона можно смотреть разговоры и файлы, но не запускать команды. Разрешение даёт полный доступ к терминалу этого компьютера: с телефона станет можно выполнить любую команду, как в обычной консоли за этой машиной."}),c?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"settings__hint",children:"Включится сразу — вы уже за этим компьютером, подтверждать доступ к нему нечем и незачем."}),a.jsx("button",{type:"button",className:"btn",disabled:v,onClick:d,children:"Разрешить с телефона"})]}):a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"settings__hint",children:"Отсюда мгновенно не включится: на почту аккаунта уйдёт письмо, и терминал заработает только после перехода по ссылке из него."}),a.jsx("button",{type:"button",className:"btn",disabled:v,onClick:d,children:"Прислать письмо"})]})]})}return a.jsx(fl,{title:"Настройки",onClose:g,children:a.jsxs("div",{className:"settings",children:[a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Архивация молчащих сессий"}),a.jsx("p",{className:"settings__hint",children:"Сессия, к которой долго не возвращались, сама уезжает в архив — на диске ничего не удаляется, транскрипт остаётся, и её можно вернуть обратно в любой момент."}),x?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(Ls,{className:"settings__select",value:Qk(l.autoArchiveAfterMs),options:Gk,onChange:N=>o({autoArchiveAfterMs:Yk(N)}),ariaLabel:"Через сколько молчащая сессия уезжает в архив"})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Останавливать простаивающие сессии через"}),a.jsx("p",{className:"settings__hint",children:"Простаивающая живая сессия сама отпускает процесс CLI — освобождает память компьютера, на котором стоит хост. Простой — это когда сессия ничего не делает (не работает, не ждёт разрешения, фоновых задач нет), в ней ничего не происходит и ни в одном открытом окне не висит недописанный черновик для неё. Разговор при этом никуда не девается: открытая заново сессия, как и отправленное в неё сообщение, продолжают с того же места."}),x?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(Ls,{className:"settings__select",value:Vk(l.autoStopAfterMs),options:$k,onChange:N=>o({autoStopAfterMs:Xk(N)}),ariaLabel:"Останавливать простаивающие сессии через"})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Остановка у лимита плана"}),a.jsx("p",{className:"settings__hint",children:"Когда расход окна лимита доходит до этого порога, хост прерывает все живые сессии Claude, сохраняет хэндофф у занятых и останавливает их — разговор остаётся на диске, а хэндофф показывается баннером в открытой сессии. Antigravity эта настройка не касается."}),a.jsxs("div",{className:"settings__field",children:[a.jsx("span",{className:"settings__field-label",children:"Остановка у 5-часового лимита, %"}),x?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsxs("div",{className:"settings__pct",children:[a.jsx("input",{type:"number",className:"input settings__pct-input",min:0,max:100,step:1,value:l.limitStopFiveHourPct,onChange:N=>o({limitStopFiveHourPct:Qb(N.target.valueAsNumber)}),"aria-label":"Остановка у 5-часового лимита, %"}),a.jsx("span",{className:"settings__pct-suffix",children:"%"})]}),a.jsx("p",{className:"settings__hint",children:"0 — не останавливать."})]}),a.jsxs("div",{className:"settings__field",children:[a.jsx("span",{className:"settings__field-label",children:"Остановка у недельного лимита, %"}),x?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsxs("div",{className:"settings__pct",children:[a.jsx("input",{type:"number",className:"input settings__pct-input",min:0,max:100,step:1,value:l.limitStopSevenDayPct,onChange:N=>o({limitStopSevenDayPct:Qb(N.target.valueAsNumber)}),"aria-label":"Остановка у недельного лимита, %"}),a.jsx("span",{className:"settings__pct-suffix",children:"%"})]}),a.jsx("p",{className:"settings__hint",children:"0 — не останавливать."})]})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Автосохранение"}),a.jsx("p",{className:"settings__hint",children:"Открытый файл сам уезжает на диск, если немного постоять без ввода — ручное сохранение, кнопкой или Ctrl+S, при этом всегда работает как обычно, независимо от этой настройки."}),x?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(Ls,{className:"settings__select",value:Fk(l.autoSaveAfterPauseMs),options:Kk,onChange:N=>o({autoSaveAfterPauseMs:Zk(N)}),ariaLabel:"Пауза перед автосохранением открытого файла"})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Агенты"}),a.jsx("p",{className:"settings__hint",children:"Выключенный агент не предлагается при создании новой сессии. Уже открытые сессии с ним продолжают работать."}),Vb.map(N=>{const A=(l==null?void 0:l.enabledProviders)??["claude","antigravity"],B=!x&&A.includes(N.id),P=B&&A.length<=1;return a.jsxs("div",{className:"settings__switch-row settings__agent",children:[a.jsx("span",{className:`newsession__mark newsession__mark--${N.id}`,"aria-hidden":"true",children:N.id==="antigravity"?a.jsx(Op,{className:"newsession__mark-logo"}):a.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:a.jsx("circle",{cx:"8",cy:"8",r:"6",fill:"var(--accent)"})})}),a.jsxs("div",{className:"settings__switch-copy settings__agent-copy",children:[a.jsx("span",{className:"settings__field-label",children:N.label}),a.jsx("span",{className:"settings__hint",children:P?"Хотя бы один агент должен остаться включённым":N.hint})]}),x?a.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):a.jsx("button",{type:"button",role:"switch","aria-checked":B,"aria-label":N.label,disabled:P,title:P?"Хотя бы один агент должен остаться включённым":void 0,className:B?"switch is-on":"switch",onClick:()=>{const X=Vb.map(R=>R.id).filter(R=>R===N.id?!B:A.includes(R));o({enabledProviders:X})},children:a.jsx("span",{className:"switch__knob"})})]},N.id)})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Старт новой сессии"}),a.jsx("p",{className:"settings__hint",children:"Модель и режим прав, с которыми поднимается новая сессия. Уже открытую это не меняет — у неё свои переключатели в шапке."}),a.jsxs("div",{className:"settings__field",children:[a.jsx("span",{className:"settings__field-label",children:"Модель"}),x?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(Ls,{className:"settings__select",value:l.startModel??lp,options:C,onChange:N=>o({startModel:N===lp?null:N}),ariaLabel:"Модель, с которой поднимается новая сессия"})]}),a.jsxs("div",{className:"settings__field",children:[a.jsx("span",{className:"settings__field-label",children:"Режим прав при старте"}),x?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(Ls,{className:"settings__select",value:l.startPermissionMode,options:qk,onChange:N=>o({startPermissionMode:N}),ariaLabel:"Режим прав, с которым поднимается новая сессия"})]})]}),a.jsx("section",{className:"settings__section",children:a.jsxs("div",{className:"settings__switch-row",children:[a.jsxs("div",{className:"settings__switch-copy",children:[a.jsx("h3",{className:"settings__heading",children:"Запущенные сессии сверху"}),a.jsx("p",{className:"settings__hint",children:"Сессии, поднятые в хосте прямо сейчас — работают, готовы, ждут разрешения, работают в фоне, переподключаются, — показываются выше остальных в списке сессий проекта и в панели закреплённых. Порядок внутри каждой из двух частей остаётся тем, что задан руками."})]}),x?a.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):a.jsx("button",{type:"button",role:"switch","aria-checked":j,"aria-label":"Запущенные сессии сверху",className:j?"switch is-on":"switch",onClick:()=>o({liveSessionsFirst:!j}),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:Jk.map(N=>{const A=!x&&l.folderAccess===N.value;return a.jsxs("button",{type:"button",role:"radio","aria-checked":A,disabled:x,className:"access__card"+(A?" is-on":"")+(N.risky?" access__card--risky":""),onClick:()=>o({folderAccess:N.value}),children:[a.jsx("span",{className:"access__radio","aria-hidden":"true"}),a.jsxs("span",{className:"access__body",children:[a.jsxs("span",{className:"access__title",children:[N.title,N.risky&&a.jsx("span",{className:"access__risk",children:"самое широкое"})]}),a.jsx("span",{className:"access__desc",children:N.description})]})]},N.value)})})]}),a.jsxs("section",{className:"settings__section",children:[a.jsxs("div",{className:"settings__switch-row",children:[a.jsxs("div",{className:"settings__switch-copy",children:[a.jsx("h3",{className:"settings__heading",children:"Терминал"}),a.jsx("p",{className:"settings__hint",children:"Панель терминала под лентой разговора: команда, которую там набрали, выполняется прямо на этом компьютере с правами вашего пользователя — не в песочнице агента, как Bash-инструмент в разговоре. Выключите — и все открытые вкладки терминала закроются, а процессы в них не переживут закрытия."})]}),x?a.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):a.jsx("button",{type:"button",role:"switch","aria-checked":y,"aria-label":"Терминал",className:y?"switch is-on":"switch",onClick:()=>o({terminalEnabled:!y}),children:a.jsx("span",{className:"switch__knob"})})]}),a.jsxs("div",{className:"settings__nested"+(v?" is-disabled":""),children:[a.jsx("h4",{className:"settings__nested-heading",children:"Удалённый доступ к терминалу"}),x?a.jsx("p",{className:"settings__hint",children:"Загрузка…"}):a.jsxs(a.Fragment,{children:[v&&a.jsx("p",{className:"settings__hint",children:"Сначала включите терминал выше — удалённый доступ выдаётся к тому, что на этой машине уже разрешено, а не поверх выключенного рубильника."}),k()]})]})]})]})})}const Kb={fiveHour:"5-часовой лимит",sevenDay:"недельный лимит"};function Pk(l){if(!l)return"срок неизвестен";const s=new Date(l);return Number.isNaN(s.getTime())?"срок неизвестен":s.toLocaleString()}function eN({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(),". Окно сбросится: ",Pk(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 tN({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(fl,{title:"Хэндофф",className:"modal--wide",onClose:s,children:a.jsx("div",{className:"markdown-preview",dangerouslySetInnerHTML:{__html:r}})})}const Ff={fiveHour:"5-часовой лимит",sevenDay:"недельный лимит"},nN=12e3;function lN(l){const s=l%10,r=l%100;return s===1&&r!==11?"сессии":"сессиях"}function sN({notices:l,onDismiss:s}){return l.length===0?null:a.jsx("div",{className:"limittoasts",children:l.map(r=>a.jsx(aN,{notice:r,onDismiss:()=>s(r.id)},r.id))})}function aN({notice:l,onDismiss:s}){return _.useEffect(()=>{const r=window.setTimeout(s,nN);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," ",lN(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 iN(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 rN(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 cN=16;function oN({pane:l,width:s,onResize:r,onReset:c}){const o=Tr[l],d=_.useRef(null);function h(y){if(y.button!==0)return;const j=document.querySelector(".main"),v=j?Math.max(0,j.getBoundingClientRect().width-ev):0;d.current={x:y.clientX,width:s,max:Math.min(o.max,s+v)},y.currentTarget.setPointerCapture(y.pointerId),document.body.classList.add("is-resizing"),y.preventDefault()}function m(y){const j=d.current;if(!j)return;const v=o.side==="left"?y.clientX-j.x:j.x-y.clientX;r(Math.min(j.max,j.width+v))}function g(y){d.current&&(d.current=null,y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),document.body.classList.remove("is-resizing"))}function x(y){const j=y.key==="ArrowRight"?1:y.key==="ArrowLeft"?-1:0;j!==0&&(y.preventDefault(),r(s+j*cN*(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 uN=16;function fN({height:l,onResize:s,onReset:r}){const c=_.useRef(null);function o(){const x=document.querySelector(".main .transcript, .main .editor");if(!x)return 1/0;const y=x.getBoundingClientRect().height-sv;return Math.round(l+Math.max(0,y))}function d(x){x.button===0&&(c.current={y:x.clientY,height:l,max:o()},x.currentTarget.setPointerCapture(x.pointerId),document.body.classList.add("is-resizing-row"),x.preventDefault())}function h(x){const y=c.current;if(!y)return;const j=y.y-x.clientY;s(y.height+j,y.max)}function m(x){c.current&&(c.current=null,x.currentTarget.hasPointerCapture(x.pointerId)&&x.currentTarget.releasePointerCapture(x.pointerId),document.body.classList.remove("is-resizing-row"))}function g(x){const y=x.key==="ArrowUp"?1:x.key==="ArrowDown"?-1:0;y!==0&&(x.preventDefault(),s(l+y*uN,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=P=>s.getPropertyValue(P).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"),k=r("--cm-key"),N=r("--cm-type"),A=Fb(o,c,55),B=P=>Fb(P,"#ffffff",25);return{background:c,foreground:o,cursor:m,cursorAccent:g,selectionBackground:x,black:A,brightBlack:h,red:y,brightRed:B(y),green:j,brightGreen:B(j),yellow:v,brightYellow:B(v),blue:C,brightBlue:B(C),magenta:k,brightMagenta:B(k),cyan:N,brightCyan:B(N),white:d,brightWhite:o}}function dN(){return getComputedStyle(document.documentElement).getPropertyValue("--mono").trim()}let ra=null;function hN(l){return ra||(ra=document.createElement("span"),ra.style.position="fixed",ra.style.width="0",ra.style.height="0",ra.style.opacity="0",ra.style.pointerEvents="none",document.body.appendChild(ra)),ra.style.color=l,getComputedStyle(ra).color}function Fb(l,s,r){return hN(`color-mix(in srgb, ${l} ${100-r}%, ${s} ${r}%)`)}let Lf=null;function pN(){return Lf||(Lf=Promise.all([Je(()=>import("./xterm-D6Mng-DB.js").then(l=>l.x),__vite__mapDeps([22,23]),import.meta.url),Je(()=>import("./addon-fit-CevVMrUA.js").then(l=>l.a),__vite__mapDeps([24,23]),import.meta.url),Je(()=>import("./addon-web-links-CnB65OV_.js").then(l=>l.a),__vite__mapDeps([25,23]),import.meta.url),Je(()=>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 mN({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:k,onAttach:N,onHide:A,registerSink:B}){const[P,X]=_.useState(()=>Zb());return _.useEffect(()=>{const R=new MutationObserver(()=>X(Zb()));return R.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>R.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:R=>{x&&(R.target.closest("button")||x())},children:[a.jsx("div",{className:"termpanel__tabs",role:"tablist","aria-label":"Открытые терминалы",children:l.map(R=>a.jsxs("div",{role:"tab","aria-selected":R.id===s,className:"termtab"+(R.id===s?" is-on":"")+(R.exitCode!==null?" termtab--exited":""),onDoubleClick:Y=>{x&&(Y.target.closest(".termtab__close")||x())},children:[a.jsx("button",{className:"termtab__name",title:R.cwd,onClick:()=>y(R.id),children:R.title}),R.exitCode!==null&&a.jsx("span",{className:"termtab__code",title:`Оболочка завершилась с кодом ${R.exitCode}`,children:R.exitCode}),a.jsx("button",{className:"termtab__close",title:"Закрыть терминал","aria-label":`Закрыть терминал «${R.title}»`,onClick:()=>v(R.id),children:"✕"})]},R.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(Vc,{active:g})}),a.jsx("button",{className:"termpanel__hide",title:"Скрыть панель","aria-label":"Скрыть панель терминала",onClick:A,children:"✕"})]}),c&&l.length>0&&a.jsx(Jb,{message:c,strip:!0,onRetry:null,onDismiss:o}),a.jsxs("div",{className:"termpanel__body",children:[c&&l.length===0?a.jsx(Jb,{message:c,onRetry:r?null:j,onDismiss:o}):r?a.jsxs("div",{className:"termpanel__empty",children:[a.jsx("p",{children:"Терминал с удалённых устройств выключен"}),a.jsx("p",{className:"termpanel__hint",children:"Откройте «Удалённый доступ» → «Прислать письмо»: на почту аккаунта придёт ссылка, и после перехода по ней терминал заработает прямо здесь. Если сейчас доберётесь до самого компьютера — там разрешение включается сразу, без письма."})]}):l.length===0&&a.jsxs("div",{className:"termpanel__empty",children:[a.jsx("p",{children:"Терминалов не открыто"}),a.jsx("button",{className:"btn btn--primary",onClick:j,children:"Открыть терминал"})]}),l.map(R=>a.jsx(xN,{id:R.id,exitCode:R.exitCode,active:R.id===s,theme:P,mobile:m,onInput:C,onResize:k,onAttach:N,registerSink:B},R.id))]})]})}function Jb({message:l,strip:s=!1,onRetry:r,onDismiss:c}){const{lede:o,hint:d,details:h}=gN(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 gN(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 xN({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),k=_.useRef(s),[N,A]=_.useState("loading"),[B,P]=_.useState(!1);return _.useEffect(()=>{if(!x.current)return;let R=!1,Y=null;A("loading"),P(!1);const L=window.setTimeout(()=>{R||P(!0)},200);return(async()=>{var K;let Z;try{Z=await pN()}catch{window.clearTimeout(L),R||A("error");return}if(R||!x.current)return;window.clearTimeout(L);const{Terminal:D,FitAddon:z,WebLinksAddon:te}=Z,J=new D({fontFamily:dN()||"monospace",fontSize:13,lineHeight:1.2,cursorBlink:!0,cursorStyle:"bar",scrollback:5e3,theme:C.current}),fe=new z;J.loadAddon(fe),J.loadAddon(new te),J.open(x.current),y.current=J,J.attachCustomKeyEventHandler(E=>{if(E.type!=="keydown"||!(E.ctrlKey||E.metaKey))return!0;if(E.key==="`")return E.preventDefault(),!1;if(E.key==="c"||E.key==="C"){const de=J.getSelection();return de?(E.preventDefault(),ma(de),!1):!E.shiftKey}return E.key==="v"||E.key==="V"?(E.preventDefault(),gp().then(de=>{de&&J.paste(de)}),!1):!0});const be=E=>{E.preventDefault();const G=J.getSelection();if(G){ma(G),J.clearSelection();return}gp().then(de=>{de&&J.paste(de)})};(K=J.element)==null||K.addEventListener("contextmenu",be);const Ne=J.onData(E=>d(l,E));let Se={cols:J.cols,rows:J.rows},V=null;const pe=J.onResize(({cols:E,rows:G})=>{V!==null&&window.clearTimeout(V),V=window.setTimeout(()=>{V=null,!(E===Se.cols&&G===Se.rows)&&(Se={cols:E,rows:G},h(l,E,G))},100)}),H=new ResizeObserver(()=>{try{fe.fit()}catch{return}v.current&&J.scrollToBottom()});H.observe(x.current);const _e=g(l,E=>{E.kind==="buffer"&&J.reset(),J.write(E.data)});m(l),k.current!==null&&!j.current&&(j.current=!0,J.write(`\r
129
- \x1B[2m— Процесс завершён (код ${k.current}) —\x1B[0m\r
130
- `)),r&&J.focus(),Y=()=>{var E;V!==null&&window.clearTimeout(V),H.disconnect(),(E=J.element)==null||E.removeEventListener("contextmenu",be),Ne.dispose(),pe.dispose(),_e(),J.dispose(),y.current=null},A("ready")})(),()=>{R=!0,window.clearTimeout(L),Y==null||Y(),Y=null}},[l]),_.useEffect(()=>{if(!o)return;const X=x.current;if(!X)return;let R=null,Y=0,L=!1;const Z=J=>{J.pointerType==="mouse"||R!==null||(R=J.pointerId,Y=J.clientY,L=!1)},D=J=>{if(J.pointerId!==R)return;const fe=Y-J.clientY;if(!L){if(Math.abs(fe)<4)return;L=!0,X.setPointerCapture(J.pointerId)}Y=J.clientY;const be=X.querySelector(".xterm-viewport");be&&(be.scrollTop+=fe)},z=J=>{J.pointerId===R&&(X.hasPointerCapture(J.pointerId)&&X.releasePointerCapture(J.pointerId),R=null,L=!1)},te=J=>J.stopPropagation();return X.addEventListener("pointerdown",Z),X.addEventListener("pointermove",D),X.addEventListener("pointerup",z),X.addEventListener("pointercancel",z),X.addEventListener("touchmove",te,{capture:!0}),()=>{X.removeEventListener("pointerdown",Z),X.removeEventListener("pointermove",D),X.removeEventListener("pointerup",z),X.removeEventListener("pointercancel",z),X.removeEventListener("touchmove",te,{capture:!0}),R!==null&&X.hasPointerCapture(R)&&X.releasePointerCapture(R)}},[o]),_.useEffect(()=>{C.current=c,y.current&&(y.current.options.theme=c)},[c]),_.useEffect(()=>{var X;r&&((X=y.current)==null||X.focus())},[r]),_.useEffect(()=>{if(k.current=s,s===null){j.current=!1;return}if(j.current)return;const X=y.current;X&&(j.current=!0,X.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"+(N==="ready"?"":" is-hidden")}),N==="loading"&&B&&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:"Загружается терминал…"})]}),N==="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 bN=2e5,_N=75,yN=90;function vN({tokens:l,maxTokens:s,fetchedAt:r}){if(l===null)return null;const c=s??bN,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${jN(o)}`,style:{width:`${o}%`}})}),a.jsxs("span",{className:"contextbar__pct",children:[o,"%"]})]})}function jN(l){return l>=yN?" contextbar__fill--over":l>=_N?" contextbar__fill--warn":""}const ay="ccv:last-session",SN=300*1e3,wN=1e4;function kN(){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 NN(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 TN(l,s){return l.id===s.sessionId?!0:s.claudeSessionId?l.id===s.claudeSessionId||l.claudeSessionId===s.claudeSessionId:!1}const EN={mcp:"mcp",plugins:"plugins",plugin:"plugins"},Wb=[{name:"login",description:"Войти в аккаунт Claude — окно приложения",argumentHint:"",aliases:["signin","вход"]},{name:"switch-account",description:"Сменить аккаунт: выйти и войти заново",argumentHint:"",aliases:["account","аккаунт"]},{name:"logout",description:"Выйти из аккаунта Claude",argumentHint:"",aliases:["signout","выход"]}],CN={active:!1,url:"",awaitingCode:!1,output:"",error:null};function Pb(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 AN(){var dr,oi;const l=_.useRef(null),[s,r]=_.useState(!1),[c,o]=_.useState("Нет связи с хостом"),[d,h]=_.useState(null),[m,g]=_.useState(!1),x=_.useMemo(()=>Hf()==="relay",[]),[y,j]=_.useState([]),[v,C]=_.useState([]),[k,N]=_.useState([]),[A,B]=_.useState([]),[P,X]=_.useState([]),[R,Y]=_.useState([]),[L,Z]=_.useState([]),[D,z]=_.useState([]),[te,J]=_.useState([]),[fe,be]=_.useState(null),[Ne,Se]=_.useState(null),[V,pe]=_.useState(null),[H,_e]=_.useState(null),[K,E]=_.useState(null),[G,de]=_.useState(null),[xe,ke]=_.useState(jl),[Re,Me]=_.useState(Bh),[Xe,We]=_.useState(!1),[kn,Be]=_.useState(!1),dt=Wf("(max-width: 860px)"),[nt,Ot]=_.useState(!1);_.useEffect(()=>{dt||Ot(!1)},[dt]);const[et,Jt]=_.useState(!1),[Fn,gt]=_.useState([]),[Jn,$t]=_.useState(!1),[zn,Un]=_.useState(jl),[St,_t]=_.useState(null),[Zt,Lt]=_.useState(null),[sn,xt]=_.useState([]),[rt,mn]=_.useState(null),[gn,Nn]=_.useState(null),[an,zt]=_.useState([]),[rn,wt]=_.useState([]),[Wn,se]=_.useState([]),[ge,He]=_.useState([]),[Ke,Ue]=_.useState(null),[I,ae]=_.useState(null),[we,qe]=_.useState({}),[at,xn]=_.useState(null),[Hn,wl]=_.useState({}),[pl,as]=_.useState(null),[Us,is]=_.useState([]),[rs,cs]=_.useState(!1),[al,Pn]=_.useState(null),[lt,Qe]=_.useState(null),fn=(lt==null?void 0:lt.enabledProviders)??["claude","antigravity"],[kl,il]=_.useState(!1),[Wt,os]=_.useState(CN),[bt,us]=_.useState(null),[Ve,ml]=_.useState(null),[Pt,cn]=_.useState(!1),[ht,,rl]=J0(),cl=lv(),[Xt,Tn]=_.useState(!1),[Tt,ol]=_.useState(null),[Hl,Vl]=_.useState(null),[Bl,$n]=_.useState(null),[yn,it]=_.useState(null),[fs,Hs]=_.useState(null),[Ql,Bs]=_.useState(""),[ds,Is]=_.useState(null),[Xn,ga]=_.useState([]),[hs,gl]=_.useState(!1),[Nl,me]=_.useState(null),[T,$]=_.useState(!1),[ue,ye]=_.useState(!1),[Le,Ee]=_.useState({}),[Et,Ft]=_.useState([""]),[Vt,st]=_.useState([]),[dn,Mt]=_.useState(null),[qs,vn]=_.useState(null),[ps,w]=_.useState(null),[ce,Ce]=_.useState(null),[Ze,el]=_.useState(null),[Gs,ms]=_.useState({}),[$a,Hi]=_.useState({}),[Ys,$s]=_.useState(!1),[Dr,Or]=_.useState(null),[Bn,gs]=_.useState(null),Bi=_.useRef(0),Xs=_.useRef(null),[Xa,Ii]=_.useState(!1),[Va,xs]=_.useState([]),[Lr,qi]=_.useState(null),[nd,zr]=_.useState(null),Ur=av(),Gi=ov(dt&&Xa),Yi=_.useRef(new Map),xa=(lt==null?void 0:lt.terminalEnabled)===!0,Hr=Hf()==="relay"&&((dr=d==null?void 0:d.shell)==null?void 0:dr.enabled)!==!0,Qc=_.useRef(!1),ld=_.useCallback((p,U)=>(Yi.current.set(p,U),()=>{Yi.current.get(p)===U&&Yi.current.delete(p)}),[]),[Vs,Br]=_.useState(!1),[eu,Ir]=_.useState(null),[tu,Qa]=_.useState(jl),[bs,qr]=_.useState(null),[$i,Qs]=_.useState({}),Xi=_.useRef([]),[on,Kc]=_.useState(null);function sd(p){Kc(U=>U===p?null:p)}_.useEffect(()=>{(dt||on==="terminal"&&!Xa||on==="files"&&!ue||on==="search"&&!Ys||on==="git"&&!Xt||on==="ask"&&!Vs||on==="main"&&Vt.length===0)&&Kc(null)},[on,dt,Xa,ue,Ys,Xt,Vs,Vt.length]);const[ad]=_.useState(kN),Zc=_.useRef(ad),Gr=_.useRef(!1),En=_.useRef(null),Vi=_.useRef(null),ba=_.useRef(null),Ka=_.useRef(0),Cn=_.useRef(null),Fc=_.useRef(0);En.current=K,Cn.current=H,Fc.current=xe.lastSeq;const Jc=_.useRef(Re);Jc.current=Re;const Kl=_.useRef(null),Wc=_.useRef(0);Wc.current=tu.lastSeq;const Qi=_.useRef(null),_s=_.useRef(""),Ki=_.useRef(null),_a=_.useRef([]),nu=_.useRef([""]);_a.current=Vt,nu.current=Et;const Za=_.useRef(new Map),Zi=_.useRef(new Set),ys=_.useRef(null),vs=_.useRef(null),lu=_.useRef(0),Ks=_.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(),wl({});const jt=En.current;jt&&p.send({type:"session.sync",sessionId:jt,sinceSeq:Fc.current});const jn=Kl.current;jn&&p.send({type:"session.sync",sessionId:jn,sinceSeq:Wc.current})});const re=p.on(jt=>su(jt));p.connect();const De=window.setInterval(()=>{U(),p.connected&&p.send({type:"ping",nonce:Date.now()})},15e3);return()=>{re(),window.clearInterval(De),p.close()}},[]);const su=_.useCallback(p=>{var U,re,De,jt,jn,yl,Ml,Cs,ui;switch(p.type){case"hello.ok":r(!0);break;case"workspace.list":{j(p.workspaces),C(p.archived),_e(Ge=>{var Wl;if(Ge)return Ge;const ot=Zc.current,Rt=ot&&NN(p.workspaces,ot.workspaceId);return ot&&Rt&&Rt.id!==ot.workspaceId&&(Zc.current={...ot,workspaceId:Rt.id}),(Rt==null?void 0:Rt.id)??((Wl=p.workspaces[0])==null?void 0:Wl.id)??null});const ve=Ki.current;if(!ve)break;const Ae=p.workspaces.find(Ge=>zN(Ge.path,ve));if(!Ae)break;Ki.current=null,Jt(!1),_e(Ae.id);break}case"workspace.candidates":if(p.query.trim()!==_s.current)break;gt(p.candidates),p.source==="host"&&$t(!1);break;case"finder.opened":Qi.current=p.sessionId;break;case"workspace.roots":xt(p.roots);break;case"workspace.created":if(_e(p.workspace.id),p.warnings.length===0){Jt(!1),Lt(null);break}mn({path:p.workspace.path,warnings:p.warnings});break;case"session.list":if(p.workspaceId!==Cn.current)break;Y(p.sessions),Z(p.archived);break;case"folder.list":N(p.workspaceFolders),B(p.sessionFolders),X(p.pinnedFolders??[]);break;case"session.pinned":z(p.sessions);break;case"session.live":J(p.sessions);break;case"order.state":pe(p.order);break;case"session.summary":if(p.session.id===Qi.current){_t(p.session);break}if(p.session.parentSessionId){p.session.id===Kl.current&&qr(p.session);break}if(J(ve=>{const Ae=ve.findIndex(ot=>ot.id===p.session.id);if(p.session.state==="closed")return Ae===-1?ve:ve.filter(ot=>ot.id!==p.session.id);if(Ae===-1)return[...ve,p.session];const Ge=ve.slice();return Ge[Ae]=p.session,Ge}),Y(ve=>{const Ae=ve.findIndex(ot=>ot.id===p.session.id);if(Ae===-1)return[p.session,...ve];const Ge=ve.slice();return Ge[Ae]=p.session,Ge}),z(ve=>{const Ae=ve.findIndex(ot=>ot.id===p.session.id);if(Ae===-1)return ve;const Ge=ve.slice();return Ge[Ae]={...p.session,pinned:!0,...ve[Ae].pinnedAt?{pinnedAt:ve[Ae].pinnedAt}:{}},Ge}),En.current===null&&ba.current&&ba.current.workspaceId===p.session.workspaceId&&(u_(p.session.id,ba.current.text),ba.current=null),E(ve=>ve??p.session.id),((U=Vi.current)==null?void 0:U.sessionId)===p.session.id){const ve=Vi.current;p.session.state==="error"?Vi.current=null:p.session.state!=="closed"&&(Vi.current=null,(re=l.current)==null||re.send({type:"prompt.send",sessionId:ve.sessionId,text:ve.text,images:ve.images}))}break;case"usage.state":p.sessionId===En.current&&(us(p.usage),cn(!1));break;case"context.state":p.sessionId===En.current&&(ml(p.context),cn(!1));break;case"session.capabilities":p.sessionId===En.current&&de(p.capabilities);break;case"session.events":if(p.sessionId===Kl.current){Qa(ve=>Bf(ve,p.entries));break}if(p.sessionId===Qi.current){Un(ve=>Bf(ve,p.entries));break}if(p.sessionId!==En.current)break;for(const ve of p.entries){if(ve.event.kind!=="rewound")continue;const Ae=ve.event.toUserIndex,Ge=Z0(Jc.current.entries,Ae),ot=Ge.reduce((Rt,Wl)=>Wl.event.kind==="user.message"?Rt+1:Rt,0);Me(Rt=>({...Rt,entries:Ge})),ke(Rt=>({...Rt,items:F0(Rt.items,Ae,ot)}))}ke(ve=>Bf(ve,p.entries));break;case"session.history":if(p.sessionId!==En.current)break;Me(ve=>V0(ve,p));break;case"side.opened":{if(p.parentSessionId!==En.current)break;Kl.current=p.sessionId,Ir(p.sessionId);const ve=Xi.current;Xi.current=[];for(const Ae of ve)Ae(p.sessionId);break}case"side.closed":if(p.parentSessionId!==En.current)break;Kl.current=null,Ir(null),Qa(jl),qr(null);break;case"git.state":if(p.workspaceId!==Cn.current)break;ol(p.state);break;case"git.commit":if(p.workspaceId!==Cn.current)break;Vl(p.detail);break;case"git.result":if(p.workspaceId!==Cn.current)break;it({ok:p.ok,message:p.message,url:p.url}),p.ok&&(Vl(null),$n(null),gl(!1),$(!1));break;case"git.busy":if(p.workspaceId!==Cn.current)break;Bs(p.label);break;case"git.files":if(p.workspaceId!==Cn.current)break;me({files:p.files,truncated:p.truncated});break;case"github.status":Is(p.status);break;case"github.owners":ga(p.owners);break;case"fs.dir":if(p.workspaceId!==Cn.current)break;Ee(ve=>({...ve,[p.path]:p.entries}));break;case"fs.search":if(p.workspaceId!==Cn.current)break;if(p.scope!=="tree"){const ve=p.scope;Hi(Ae=>({...Ae,[ve]:{query:p.query,entries:p.entries}}));break}el({query:p.query,entries:p.entries,truncated:p.truncated});break;case"fs.grep":if(p.workspaceId!==Cn.current)break;Or({query:p.query,matches:p.matches,truncated:p.truncated});break;case"fs.file":{if(p.workspaceId!==Cn.current)break;const ve=Zi.current.delete(p.file.path);st(Ge=>{const ot=Ge.findIndex(fi=>fi.path===p.file.path);if(ot===-1)return[...Ge,_b(p.file,++lu.current)];const Rt=Ge[ot],Wl=Ge.slice();return Wl[ot]=Rt.saved===p.file.content&&!qa(Rt)?{...Rt,mtime:p.file.mtime,size:p.file.size,stale:!1}:_b(p.file,++lu.current),Wl}),ve&&Mt(p.file.path);const Ae=Xs.current;Ae&&Ae.path===p.file.path&&(Xs.current=null,gs({...Ae,token:++Bi.current}));break}case"fs.media":{if(p.workspaceId!==Cn.current)break;Ks.current.delete(p.path),st(ve=>ve.map(Ae=>Ae.path===p.path?{...Ae,mediaBase64:p.base64,mediaError:void 0}:Ae));break}case"fs.mediaFailed":{if(p.workspaceId!==Cn.current)break;Ks.current.delete(p.path),st(ve=>ve.map(Ae=>Ae.path===p.path?{...Ae,mediaError:p.message}:Ae));break}case"fs.saved":{if(p.workspaceId!==Cn.current)break;const ve=Za.current.get(p.path);Za.current.delete(p.path);const Ae=ve!==void 0;st(ot=>ot.map(Rt=>Rt.path!==p.path?Rt:Ae?{...Rt,saved:ve,mtime:p.mtime,size:p.size,stale:!1}:{...Rt,stale:!0}));const Ge=_a.current.find(ot=>ot.path===p.path);!Ae&&Ge&&!qa(Ge)&&((De=l.current)==null||De.send({type:"fs.read",workspaceId:p.workspaceId,path:p.path})),(jt=l.current)==null||jt.send({type:"git.state",workspaceId:p.workspaceId});break}case"fs.result":{if(p.workspaceId!==Cn.current)break;if(vn({ok:p.ok,message:p.message}),p.ok||Za.current.delete(p.path),p.conflict&&st(Ae=>Ae.map(Ge=>Ge.path===p.path?{...Ge,stale:!0}:Ge)),vs.current===p.path){const Ae=vs.current;vs.current=null,p.ok&&(Zi.current.add(Ae),(jn=l.current)==null||jn.send({type:"fs.read",workspaceId:p.workspaceId,path:Ae}))}const ve=ys.current;if(p.ok&&ve&&ve.to===p.path){ys.current=null;const Ae=Ge=>Ge===ve.from?ve.to:Ge.startsWith(`${ve.from}/`)?ve.to+Ge.slice(ve.from.length):Ge;st(Ge=>Ge.map(ot=>({...ot,path:Ae(ot.path)}))),Mt(Ge=>Ge===null?null:Ae(Ge)),Ft(Ge=>Ge.map(Ae)),Ee(Ge=>{const ot={};for(const[Rt,Wl]of Object.entries(Ge))Rt===ve.from||Rt.startsWith(`${ve.from}/`)||(ot[Rt]=Wl);return ot})}p.ok&&((yl=l.current)==null||yl.send({type:"git.state",workspaceId:p.workspaceId}));break}case"term.list":if(p.workspaceId!==Cn.current)break;xs(p.terminals);break;case"term.opened":if(p.terminal.workspaceId!==Cn.current)break;zr(null),xs(ve=>{const Ae=ve.findIndex(ot=>ot.id===p.terminal.id);if(Ae===-1)return[...ve,p.terminal];const Ge=ve.slice();return Ge[Ae]=p.terminal,Ge}),Qc.current&&(Qc.current=!1,qi(p.terminal.id));break;case"term.buffer":(Ml=Yi.current.get(p.id))==null||Ml({kind:"buffer",data:p.data});break;case"term.data":(Cs=Yi.current.get(p.id))==null||Cs({kind:"data",data:p.data});break;case"term.exit":xs(ve=>ve.map(Ae=>Ae.id===p.id?{...Ae,exitCode:p.exitCode}:Ae));break;case"term.closed":xs(ve=>ve.filter(Ae=>Ae.id!==p.id));break;case"mcp.list":p.sessionId===En.current&&zt(p.servers);break;case"mcp.auth":p.sessionId===En.current&&ae(p.state);break;case"plugin.list":if(p.sessionId!==En.current)break;wt(p.plugins),se(p.marketplaces),He(p.catalog);break;case"operation.result":p.sessionId===En.current&&Ue(p.result);break;case"auth.status":Pn(p.status);break;case"relay.state":h(p.state);break;case"settings.state":Qe(p.settings);break;case"handoff.state":qe(ve=>{if(!p.handoff){if(!(p.sessionId in ve))return ve;const Ae={...ve};return delete Ae[p.sessionId],Ae}return{...ve,[p.sessionId]:p.handoff}});break;case"handoff.written":wl(ve=>{if(!(p.sessionId in ve))return ve;const Ae={...ve};return delete Ae[p.sessionId],Ae}),p.handoff&&En.current===p.sessionId?as(p.handoff):p.handoff||console.warn("[handoff] хост не смог записать хэндофф",p.sessionId);break;case"limit.stopped":Ka.current+=1,is(ve=>[...ve,{id:Ka.current,limit:p.limit,utilization:p.utilization,stopped:p.stopped,handoffs:p.handoffs}]);break;case"auth.login":os(p.state),p.state.active&&cs(!0);break;case"session.closed":J(ve=>ve.filter(Ae=>Ae.id!==p.sessionId)),Y(ve=>ve.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")&&(Ki.current=null,Lt(p.message)),(ui=p.context)!=null&&ui.startsWith("term.")&&zr(p.message);break}},[]),ne=_.useCallback(p=>{var U;(U=l.current)==null||U.send(p)},[]);_.useEffect(()=>{H&&ne({type:"session.list",workspaceId:H})},[H,ne]),_.useEffect(()=>{s&&ne({type:"session.pins"})},[s,ne]),_.useEffect(()=>{s&&ne({type:"settings.get"})},[s,ne]),_.useEffect(()=>{if(s)return ne({type:"session.drafts",sessionIds:f_()}),Y0(p=>ne({type:"session.drafts",sessionIds:p}))},[s,ne]),_.useEffect(()=>{if(Gr.current)return;const p=Zc.current;if(!p||!H)return;if(H!==p.workspaceId){Gr.current=!0;return}if(K){Gr.current=!0;return}if(R.length===0)return;const U=R.find(re=>TN(re,p));Gr.current=!0,U&&U.state!=="closed"&&Xr(U)},[R,H,K]),_.useEffect(()=>{!H||Hr||!xa||ne({type:"term.list",workspaceId:H})},[H,Hr,xa,ne]),_.useEffect(()=>{qi(p=>{var U;return p&&Va.some(re=>re.id===p)?p:((U=Va[0])==null?void 0:U.id)??null})},[Va]),_.useEffect(()=>{et&&ne({type:"workspace.roots"})},[et,ne]);const Zs=_.useCallback(()=>{const p=En.current;p&&(cn(!0),ne({type:"usage.get",sessionId:p}),ne({type:"context.get",sessionId:p}))},[ne]);_.useEffect(()=>{if(!Pt)return;const p=window.setTimeout(()=>cn(!1),wN);return()=>window.clearTimeout(p)},[Pt]);const Fi=_.useMemo(()=>{const p=Math.max((bt==null?void 0:bt.fetchedAt)??0,(Ve==null?void 0:Ve.fetchedAt)??0);return p>0?p:null},[bt==null?void 0:bt.fetchedAt,Ve==null?void 0:Ve.fetchedAt]);_.useEffect(()=>{if(ml(null),!K)return;Zs();const p=()=>{document.hidden||Zs()},U=window.setInterval(p,SN),re=()=>{document.hidden||Zs()};return document.addEventListener("visibilitychange",re),()=>{window.clearInterval(U),document.removeEventListener("visibilitychange",re)}},[K,Zs]),_.useEffect(()=>{if(!K){Me(Bh);return}Me({...Bh,loading:!0}),ne({type:"session.history",sessionId:K})},[K,ne]);const au=_.useCallback(()=>{!K||Re.loading||!Lx(Re)||(Me(p=>({...p,loading:!0})),ne({type:"session.history",sessionId:K,before:h_(Re)}))},[K,Re,ne]),iu=_.useMemo(()=>Q0(Re.entries),[Re.entries]),Q=_.useMemo(()=>R.find(p=>p.id===K)??null,[R,K]),Ji=K?(Q==null?void 0:Q.claudeSessionId)??K:null,Wi=Ji?we[Ji]??null:null;_.useEffect(()=>{Ji&&ne({type:"handoff.get",sessionId:Ji})},[Ji,ne]),_.useEffect(()=>{at&&!(at.sessionId in we)&&xn(null)},[we,at]);const ru=_.useMemo(()=>{var re;if(!bt)return null;const p=(((re=bt.buckets)==null?void 0:re.length)??0)>0,U=(Q==null?void 0:Q.provider)==="antigravity";return p===U?bt:null},[bt,Q==null?void 0:Q.provider]),cu="Обновить лимиты и контекст",id=cu+(Fi?`
134
- обновлено в ${new Date(Fi).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)==="antigravity"&&Br(!1)},[Q==null?void 0:Q.provider]);const An=y.find(p=>p.id===H)??v.find(p=>p.id===H)??null;_.useEffect(()=>{if(!H||!K)return;const p={workspaceId:H,sessionId:K,claudeSessionId:(Q==null?void 0:Q.claudeSessionId)??null};try{localStorage.setItem(ay,JSON.stringify(p))}catch{}},[H,K,Q==null?void 0:Q.claudeSessionId]);function Pi(p){Ki.current=p,Lt(null),ne({type:"workspace.open",path:p})}function ou(p,U,re){Lt(null),ne({type:"workspace.create",parent:p,name:U,init:re})}function uu(p){if(_s.current=p,!p){gt([]),$t(!1);return}$t(!0),ne({type:"workspace.find",query:p})}function fu(p){_s.current=p,Un(jl),ne({type:"workspace.find.agent",query:p})}function du(){Jt(!1),Lt(null),mn(null),gt([]),Un(jl),_t(null),_s.current="",Ki.current=null}function Fs(){const p=En.current;p&&Kl.current&&ne({type:"side.reset",sessionId:p}),Kl.current=null,Ir(null),Qa(jl),qr(null),Qs({}),Xi.current=[]}function rd(p){ne({type:"workspace.close",workspaceIds:p}),!(!H||!p.includes(H))&&(Fs(),_e(null),E(null),Y([]),Z([]),ke(jl),de(null),Be(!1))}function Fa(p,U){ne({type:"session.archive",workspaceId:p,sessionIds:U}),K&&(U.includes(K)||Q!=null&&Q.claudeSessionId&&U.includes(Q.claudeSessionId))&&(Fs(),E(null),ke(jl),de(null),Be(!1))}function Pc(p){ne({type:"workspace.restore",workspaceIds:p})}function er(p,U,re){ne({type:"folder.create",scope:p,name:U,workspaceId:re})}function eo(p,U){ne({type:"folder.rename",folderId:p,name:U})}function hu(p,U){ne({type:"folder.setColor",folderId:p,color:U})}function ya(p){ne({type:"folder.delete",folderId:p})}function Ja(p,U,re,De){ne({type:"folder.assign",scope:p,itemId:U,folderId:re,workspaceId:De})}function to(p=fn[0]??"claude"){H&&(Fs(),E(null),de(null),ke(jl),Be(!1),ne({type:"session.start",workspaceId:H,provider:p}),We(!1))}function Yr(p){Fs(),vu(),_e(p),E(null),ke(jl),de(null),Be(!1),ol(null),Vl(null),$n(null),it(null),Bs(""),gl(!1),me(null),$(!1),xs([]),qi(null)}function va(p,U,re){ne({type:"session.pin",workspaceId:p,sessionIds:U,pinned:re})}function pu(p){return p.state==="running"||p.state==="waiting_permission"||p.state==="reconnecting"||p.backgroundWork}function $r(p){if(pu(p)){be(p);return}ne({type:"session.close",sessionId:p.id})}function mu(p,U,re){pe(De=>{const jt=De??{workspaces:[],sessions:{},pinned:[],live:[]};if(p==="sessions"){if(!re)return De;const jn={...jt.sessions};return U&&U.length>0?jn[re]=U:delete jn[re],{...jt,sessions:jn}}return{...jt,[p]:U??[]}}),ne({type:"order.set",scope:p,ids:U,...re?{workspaceId:re}:{}})}function cd(p){p.workspaceId!==H&&Yr(p.workspaceId),Xr(p)}function Xr(p){if(We(!1),Fs(),ke(jl),de(null),Be(!1),p.state==="closed"){E(null),ne({type:"session.start",workspaceId:p.workspaceId,resume:p.id});return}E(p.id),ne({type:"session.sync",sessionId:p.id,sinceSeq:0})}function od(p,U){if(!K)return!1;const re=K,De=Q;return no(()=>{if((De==null?void 0:De.state)==="closed"){Vi.current={sessionId:De.id,text:p,images:U},Xr(De);return}ne({type:"prompt.send",sessionId:re,text:p,images:U})})}function no(p){const U=(Q==null?void 0:Q.provider)==="antigravity"?null:iN(bt,lt);return U?new Promise(re=>{Se(De=>(De==null||De.resolve(!1),{warning:U,resolve:re}))}).then(re=>(re&&p(),re)):(p(),!0)}function Vr(p){Ne&&(Ne.resolve(p),Se(null))}function Qr(p){const U=te.find(re=>(re.claudeSessionId??re.id)===p.sessionId&&re.state!=="closed");tr(p.workspaceId,p.sessionId,p.text),U&&ne({type:"session.close",sessionId:U.id})}function Tl(p){tr(p.workspaceId,p.claudeSessionId??p.id,null)}function tr(p,U,re){ba.current=re===null?null:{workspaceId:p,text:re},p!==H?Yr(p):(Fs(),E(null),de(null),ke(jl),Be(!1)),ne({type:"session.start",workspaceId:p,provider:"claude",continuesFrom:U,...re===null?{}:{fromHandoff:!0}}),We(!1)}_.useEffect(()=>{pl&&(as(null),Qr(pl))},[pl]);function xl(p){Hn[p.id]||(wl(U=>({...U,[p.id]:!0})),ne({type:"session.handoff",sessionId:p.id}))}function Wa(p){ne({type:"handoff.dismiss",sessionId:p})}function Kr(p,U){ne({type:"session.rename",sessionId:p.id,title:U,workspaceId:p.workspaceId}),Y(re=>re.map(De=>De.id===p.id?{...De,title:U}:De))}function nr(p){K&&(We(!1),Ue(null),ae(null),Nn(p),ne({type:"mcp.list",sessionId:K}),ne({type:"plugin.list",sessionId:K}))}const Zr={mcpAction:(p,U)=>{K&&(Ue(null),ne({type:"mcp.action",sessionId:K,name:p,action:U}))},mcpAuth:p=>{K&&(Ue(null),ae({name:p,active:!0,url:"",callbackExpected:!1,done:!1,error:null}),ne({type:"mcp.auth",sessionId:K,name:p}))},mcpAuthCallback:(p,U)=>{K&&ne({type:"mcp.auth_callback",sessionId:K,name:p,callbackUrl:U})},mcpAdd:(p,U)=>{K&&ne({type:"mcp.add",sessionId:K,name:p,draft:U})},mcpRemove:p=>{K&&ne({type:"mcp.remove",sessionId:K,name:p})},pluginInstall:p=>{K&&ne({type:"plugin.install",sessionId:K,spec:p})},pluginUninstall:p=>{K&&ne({type:"plugin.uninstall",sessionId:K,id:p})},pluginToggle:(p,U)=>{K&&ne({type:"plugin.toggle",sessionId:K,id:p,enabled:U})},marketplaceAdd:p=>{K&&ne({type:"marketplace.add",sessionId:K,source:p})},marketplaceRemove:p=>{K&&ne({type:"marketplace.remove",sessionId:K,name:p})}};function Fr(){We(!1),cs(!0),ne({type:"auth.status"})}const js={login:(p,U)=>ne({type:"auth.login",mode:p,switchAccount:U}),submitCode:p=>ne({type:"auth.code",code:p}),cancel:()=>ne({type:"auth.cancel"}),logout:()=>ne({type:"auth.logout"})};function gu(){We(!1),il(!0),ne({type:"settings.get"})}function Jr(p){Qe(U=>U&&{...U,...p}),ne({type:"settings.update",settings:p})}function Pa(p){K&&ne({type:"side.ask",sessionId:K,text:p})}function ud(){K&&(ne({type:"side.reset",sessionId:K}),Kl.current=null,Ir(null),Qa(jl),qr(null),Qs({}),Xi.current=[])}function In(p){const U=Kl.current;if(U){p(U);return}const re=En.current;re&&(Xi.current.push(p),ne({type:"side.open",sessionId:re}))}function Wr(){H&&ne({type:"git.state",workspaceId:H})}function Ss(p){H&&($n(p),ne({type:"git.show",workspaceId:H,ref:p}))}function lo(p,U){it(null),Hs({target:p,label:U})}function Pr(){!H||!fs||(ne({type:"git.checkout",workspaceId:H,target:fs.target}),Hs(null))}function ja(){H&&(it(null),ne({type:"git.push",workspaceId:H}))}function so(p){H&&(it(null),ne({type:"git.pull",workspaceId:H,merge:p}))}function xu(){H&&(it(null),me(null),gl(!0),ne({type:"github.status"}),ne({type:"github.owners"}),ne({type:"git.files",workspaceId:H}))}function ao(p){H&&(it(null),ne({type:"git.publish",workspaceId:H,...p}))}function bu(p){H&&(it(null),ne({type:"git.remote",workspaceId:H,url:p}))}function El(){it(null),$(!0)}function ei(p){ne({type:"github.token",token:p}),ne({type:"github.owners"})}function ti(){ne({type:"github.status"}),ne({type:"github.owners"})}_.useEffect(()=>{if(!(!ue||!H))for(const p of Et)p in Le||ne({type:"fs.list",workspaceId:H,path:p})},[ue,Et,Le,H,ne]);function ec(p){Ft(U=>U.includes(p)?U.filter(re=>re!==p):[...U,p])}function lr(p){if(!p){el(null);return}H&&ne({type:"fs.search",workspaceId:H,query:p})}function Cl(p){if(!p){Or(null);return}H&&ne({type:"fs.grep",workspaceId:H,query:p})}const bl=_.useCallback((p,U)=>{ms(jt=>({...jt,[p]:U}));const re=Cn.current;if(U===null||!re)return;const De=U.lastIndexOf("/");if(De!==-1){ne({type:"fs.list",workspaceId:re,path:U.slice(0,De)});return}if(U===""){ne({type:"fs.list",workspaceId:re,path:""});return}ne({type:"fs.search",workspaceId:re,query:U,scope:p})},[ne]),Js=_.useMemo(()=>Pb(Gs.mention??null,$a.mention??null,Le),[Gs.mention,$a.mention,Le]),Zl=_.useMemo(()=>Pb(Gs.side??null,$a.side??null,Le),[Gs.side,$a.side,Le]);function Fl(p){tc(p.path,{line:p.line,column:p.column})}function ws(p){const U=[];let re=Er(p.path);for(;U.push(re),!!re;)re=Er(re);Ft(De=>{const jt=new Set(De);for(const jn of U)jt.add(jn);return p.kind==="dir"&&jt.add(p.path),[...jt]}),p.kind==="file"&&tc(p.path)}function tc(p,U){if(_a.current.find(De=>De.path===p)){Mt(p),U&&gs({path:p,...U,token:++Bi.current});return}H&&(U&&(Xs.current={path:p,...U}),Zi.current.add(p),ne({type:"fs.read",workspaceId:H,path:p}))}function sr(p,U=!1){const re=_a.current,De=re.find(yl=>yl.path===p);if(De&&qa(De)&&!U){Ce(p);return}Ce(null);const jt=re.findIndex(yl=>yl.path===p),jn=re.filter(yl=>yl.path!==p);st(jn),Mt(yl=>{var Ml;return yl===p?((Ml=jn[Math.min(jt,jn.length-1)])==null?void 0:Ml.path)??null:yl})}function ni(p,U=!1){const re=_a.current.find(De=>De.path===p);!re||!H||!U&&!qa(re)||(Za.current.set(p,re.text),ne({type:"fs.write",workspaceId:H,path:p,content:re.text,eol:re.eol,encoding:re.encoding,baseMtime:re.mtime,...U?{force:!0}:{}}))}function _u(p){H&&ne({type:"fs.read",workspaceId:H,path:p})}function qn(p){H&&(Ks.current.has(p)||(Ks.current.add(p),ne({type:"fs.readMedia",workspaceId:H,path:p})))}const Qt=_.useRef(new Map);function ct(p){const U=Qt.current,re=U.get(p);re&&clearTimeout(re);const De=(lt==null?void 0:lt.autoSaveAfterPauseMs)??0;De<=0||U.set(p,setTimeout(()=>{U.delete(p);const jt=_a.current.find(jn=>jn.path===p);jt&&qa(jt)&&!jt.stale&&ni(p)},De))}function Ws(p,U,re){if(!H)return;const De=p?`${p}/${re}`:re;vn(null),U==="file"&&(vs.current=De),ne({type:"fs.create",workspaceId:H,path:De,kind:U})}function Al(p,U){if(!H)return;const re=Er(p),De=re?`${re}/${U}`:U;vn(null),ys.current={from:p,to:De},ne({type:"fs.rename",workspaceId:H,path:p,to:De})}function io(p,U){if(!H)return;const re=p.slice(p.lastIndexOf("/")+1),De=U?`${U}/${re}`:re;De!==p&&(vn(null),ys.current={from:p,to:De},ne({type:"fs.rename",workspaceId:H,path:p,to:De}))}function Ps(p,U){H&&(vn(null),ne({type:"fs.copy",workspaceId:H,path:p,toDir:U}))}function yu(p){H&&(vn(null),w(null),ne({type:"fs.delete",workspaceId:H,path:p.path}),st(U=>U.filter(re=>re.path!==p.path&&!re.path.startsWith(`${p.path}/`))),Mt(U=>U&&(U===p.path||U.startsWith(`${p.path}/`))?null:U))}function vu(){Ee({}),Ft([""]),st([]),Mt(null),vn(null),el(null),Or(null),ms({}),Hi({}),gs(null),Zi.current.clear(),Za.current.clear(),Ks.current.clear(),Xs.current=null,ys.current=null,vs.current=null}function li(){!H||Hr||!xa||(zr(null),Qc.current=!0,ne({type:"term.open",workspaceId:H,cols:80,rows:24}))}function Sa(p){ne({type:"term.close",id:p})}function ro(p,U){K&&ne({type:"permission.respond",sessionId:K,requestId:p,decision:U})}function ar(p,U){K&&ne({type:"permission.respond",sessionId:K,requestId:p,decision:"allow",answers:U})}function co(p){K&&ne({type:"permission.respond",sessionId:K,requestId:p,decision:"deny",reason:"Пользователь не стал отвечать на вопросы"})}function wa(p,U){K&&ne({type:"permission.respond",sessionId:K,requestId:p,decision:"allow",plan:U})}function ks(p){K&&ne({type:"permission.respond",sessionId:K,requestId:p,decision:"deny",reason:"Пользователь просит продолжить планирование"})}_.useEffect(()=>{function p(U){if(U.key!=="Escape")return;if(on!==null){const De=U.target;if(!(De instanceof HTMLElement&&De.closest(".termview, .editor, .sidepane"))){Kc(null);return}}if(!K||xe.pending.length>0)return;const re=U.target;re instanceof HTMLElement&&re.closest(".sidepane, .editor")||ne({type:"control.interrupt",sessionId:K})}return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[K,xe.pending.length,ne,on]),_.useEffect(()=>{function p(U){U.key!=="`"||!(U.ctrlKey||U.metaKey)||xa&&(U.preventDefault(),Ii(re=>!re))}return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[xa]);const Ns=_.useMemo(()=>{const p=(G==null?void 0:G.commands)??[];return p.length===0||(Q==null?void 0:Q.provider)==="antigravity"?p:[...p,{name:"plugins",description:"Плагины и маркетплейсы — окно приложения",argumentHint:"",aliases:["plugin"]},...Wb]},[G,Q==null?void 0:Q.provider]);function Jl(p){const U=EN[p];return U&&(Q==null?void 0:Q.provider)!=="antigravity"?(nr(U),!0):(Q==null?void 0:Q.provider)==="antigravity"||!Wb.some(re=>re.name===p)?!1:(Fr(),p==="logout"&&js.logout(),p==="switch-account"&&js.login("claudeai",!0),!0)}const si=(Q==null?void 0:Q.state)==="waiting_permission",_l=(Q==null?void 0:Q.state)==="reconnecting",Vn=(Q==null?void 0:Q.state)==="running"||_l||si,Ut=xe.pending[0]??null,Ts=Ut?Cw(Ut.toolName,Ut.input):null,[Gn,nc]=_.useState(()=>new Set),ir=Ut?Gn.has(Ut.requestId):!1,ju=Ut?Ut.questions&&Ut.questions.length>0?"question":Ts!==null?"plan":"permission":null;function lc(p,U){nc(re=>{if(re.has(p)===U)return re;const De=new Set(re);return U?De.add(p):De.delete(p),De})}_.useEffect(()=>{!Xt&&!ue||!H||Vn||ne({type:"git.state",workspaceId:H})},[Xt,ue,H,Vn,ne]),_.useEffect(()=>{if(!(Vn||!H)){ue&&Ee(p=>{const U={};for(const[re,De]of Object.entries(p))nu.current.includes(re)||(U[re]=De);return U});for(const p of _a.current)qa(p)||ne({type:"fs.read",workspaceId:H,path:p.path})}},[Vn,H,ue,ne]);const oo=(Q==null?void 0:Q.cwd)??(G==null?void 0:G.cwd)??null,hn=(G==null?void 0:G.models)??[],ai=(Q==null?void 0:Q.model)??(G==null?void 0:G.model)??null,{rows:ii,selected:rr}=t_(hn,ai),ka=bs?{model:bs.model,effort:bs.effort,ultracode:bs.ultracode,thinking:bs.thinking,switchOnFlag:bs.switchModelsOnFlag}:{model:$i.model??ai,effort:$i.effort??(Q==null?void 0:Q.effort)??null,ultracode:$i.ultracode??(Q==null?void 0:Q.ultracode)??!1,thinking:$i.thinking??(Q==null?void 0:Q.thinking)??!0,switchOnFlag:$i.switchOnFlag??(Q==null?void 0:Q.switchModelsOnFlag)??!0},Na=t_(hn,ka.model),ri=(bs==null?void 0:bs.state)==="running",uo=dn?Vt.find(p=>p.path===dn)??null:null,Su=new Set(Vt.filter(qa).map(p=>p.path)),cr=p=>a.jsx(oN,{pane:p,width:cl.widths[p],onResize:U=>cl.setWidth(p,U),onReset:()=>cl.reset(p)}),Ta=p=>dt?null:()=>sd(p),Ea=(Q==null?void 0:Q.provider)==="antigravity"?P0:p_,sc=G&&a.jsx(Ls,{title:"Режим прав",value:(Q==null?void 0:Q.permissionMode)??"default",options:Ea.map(p=>({value:p.value,label:p.value,hint:p.hint})),onChange:p=>{K&&ne({type:"control.set_mode",sessionId:K,mode:p})}}),or=ii.length>0?a.jsx(P_,{models:ii,value:rr,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)!=="antigravity",onModel:p=>{!K||!p||ne({type:"control.set_model",sessionId:K,model:p})},onEffort:p=>{K&&ne({type:"control.set_effort",sessionId:K,effort:p})},onUltracode:p=>{K&&ne({type:"control.set_ultracode",sessionId:K,enabled:p})},onThinking:p=>{K&&ne({type:"control.set_thinking",sessionId:K,enabled:p})},onSwitchOnFlag:p=>{K&&ne({type:"control.set_flag_switch",sessionId:K,enabled:p})}}):ai&&a.jsx("span",{className:"badge",children:ai}),wu=Vn&&a.jsx("span",{className:si?"badge badge--wait":"badge badge--live",children:si?"ждёт":_l?"переподключается":"работает"}),ci=(Q==null?void 0:Q.state)==="closed"&&a.jsx("span",{className:"badge",title:"Разговор сохранён — сессия поднимется заново, как только вы отправите сообщение",children:"остановлена"}),ac=wu||ci,ur=()=>{K&&ne({type:"session.reconnect",sessionId:K})},ic=_l?"Сессия уже поднимает новый процесс":Vn?"Недоступно, пока идёт ход":"Поднять сессии новый процесс — разговор сохранён",ku=K&&(_l||(Q==null?void 0:Q.state)==="error")?a.jsxs("div",{className:_l?"relink":"relink relink--error",role:"status",children:[a.jsxs("span",{className:"relink__msg",children:[a.jsx("span",{className:"relink__dot","aria-hidden":"true"}),_l?"Связь оборвалась. Сессия поднимает новый процесс — разговор сохранён.":"Переподключиться не удалось. Разговор сохранён — сессия продолжит с этого места."]}),a.jsx("button",{className:"btn btn--sm",title:_l?"Не ждать паузы между попытками — попробовать сейчас":"Поднять сессии новый процесс и продолжить разговор",onClick:ur,children:_l?"Переподключить сейчас":"Переподключить"})]}):null,Nu=Wi?a.jsx(eN,{handoff:Wi,onContinue:()=>Qr(Wi),onShow:()=>xn(Wi),onDismiss:()=>Wa(Wi.sessionId)}):null,Es=Q&&Q.totalCostUsd>0?`$${Q.totalCostUsd.toFixed(3)}`:null,ea=(Q==null?void 0:Q.provider)!=="antigravity"&&a.jsx("button",{className:Vs?"pane-btn is-on":"pane-btn",title:"Вопрос на полях — спросить, не мешая работе","aria-label":"Вопрос на полях","aria-pressed":Vs,onClick:()=>Br(p=>!p),children:a.jsx(HN,{})}),Tu=Q&&Q.state!=="closed"&&a.jsx("button",{type:"button",className:"pane-btn pane-btn--stop",title:"Остановить сессию — освобождает память хоста, разговор остаётся на диске","aria-label":"Остановить сессию",onClick:()=>$r(Q),children:a.jsx(ON,{})}),Ca=Q?Hn[Q.id]===!0:!1,ta=b_({onLongPress:()=>{Q&&Tl(Q)},onClick:()=>{Q&&xl(Q)},disabled:Ca}),fr=Q&&Q.state!=="closed"&&Q.provider!=="antigravity"&&a.jsxs("button",{type:"button",className:Ca?"pane-btn pane-btn--handoff is-busy":ta.holding?"pane-btn pane-btn--handoff is-holding":"pane-btn pane-btn--handoff",style:{"--hold-ms":`${ta.thresholdMs}ms`},title:Ca?"Пишется хэндофф…":"Клик — хэндофф и новая сессия: агент запишет сводку, сессия остановится, работа продолжится в новой. Зажать (или Shift+клик) — новая пустая сессия без хэндоффа: закрепление переходит, старая сессия продолжает работать.","aria-label":"Хэндофф и новая сессия","aria-busy":Ca,disabled:Ca,...ta.handlers,children:[a.jsx("span",{className:"pane-btn__hold","aria-hidden":"true"}),a.jsx(LN,{})]});return a.jsxs("div",{className:"app",style:cl.style,children:[a.jsx(lS,{open:Xe,connected:s,status:c,workspaces:y,archivedWorkspaces:v,workspaceFolders:k,sessionFolders:A.filter(p=>p.workspaceId===H),pinnedFolders:P,sessions:R.filter(p=>p.workspaceId===H),archived:L.filter(p=>p.workspaceId===H),pinned:D,live:te,listOrder:V,liveSessionsFirst:(lt==null?void 0:lt.liveSessionsFirst)===!0,onReorder:mu,activeWorkspaceId:H,activeSessionId:K,onPinSessions:va,onSelectPinned:cd,onCloseWorkspaces:rd,onRestoreWorkspaces:Pc,onArchiveSessions:Fa,onUnarchiveSessions:p=>{H&&ne({type:"session.unarchive",workspaceId:H,sessionIds:p})},onCreateFolder:er,onRenameFolder:eo,onSetFolderColor:hu,onDeleteFolder:ya,onAssignToFolder:Ja,onSelectWorkspace:Yr,onSelectSession:Xr,onRenameSession:Kr,onStopSession:$r,onOpenWorkspace:()=>Jt(!0),onNewSession:to,enabledProviders:fn,onOpenExtensions:K&&(Q==null?void 0:Q.provider)!=="antigravity"?()=>nr("mcp"):null,account:al,onOpenAccount:Fr,relay:d,onOpenRelay:x?null:()=>g(!0),onOpenSettings:gu,themeMode:ht,onCycleTheme:rl}),cr("sidebar"),Xe&&a.jsx("div",{className:"scrim",onClick:()=>We(!1)}),a.jsx(pj,{open:ue,tree:Le,expanded:new Set(Et),activePath:dn,dirty:Su,gitChanges:(Tt==null?void 0:Tt.changed)??[],result:qs,searchResult:Ze,onSearch:lr,onReveal:ws,onToggle:ec,onOpen:tc,onCreate:Ws,onRename:Al,onMove:io,onCopy:Ps,onDelete:w,onRefresh:()=>{vn(null),Ee({}),Wr()},onClose:()=>ye(!1),zoomed:on==="files",onToggleZoom:Ta("files")}),ue&&on!=="files"&&cr("files"),a.jsx(wj,{open:Ys,result:Dr,onSearch:Cl,onOpenMatch:Fl,onClose:()=>$s(!1),zoomed:on==="search",onToggleZoom:Ta("search")}),Ys&&on!=="search"&&cr("search"),a.jsx($w,{open:Xt,state:Tt,result:yn,selected:Bl,busy:Ql,onRefresh:Wr,onShow:Ss,onCheckout:lo,onPush:ja,onPull:so,onPublish:xu,onConnectRemote:El,onDismissResult:()=>it(null),onClose:()=>Tn(!1),zoomed:on==="git",onToggleZoom:Ta("git")}),Xt&&on!=="git"&&cr("git"),a.jsxs("main",{className:on==="main"||on==="terminal"?"main main--zoomed":"main",children:[a.jsxs("header",{className:"topbar",children:[a.jsx("button",{className:"btn btn--ghost menu-btn",onClick:()=>We(!0),children:"☰"}),a.jsx("button",{className:ue?"pane-btn is-on":"pane-btn",title:"Файлы проекта","aria-label":"Файлы проекта","aria-pressed":ue,onClick:()=>{ye(p=>!p),Tn(!1),$s(!1)},children:a.jsx(MN,{})}),a.jsx("button",{className:Ys?"pane-btn is-on":"pane-btn",title:"Поиск по тексту в проекте","aria-label":"Поиск по тексту в проекте","aria-pressed":Ys,onClick:()=>{$s(p=>!p),ye(!1),Tn(!1)},children:a.jsx(RN,{})}),a.jsx("button",{className:Xt?"pane-btn is-on":"pane-btn",title:"История git","aria-label":"История git","aria-pressed":Xt,onClick:()=>{Tn(p=>!p),ye(!1),$s(!1)},children:a.jsx(DN,{})}),xa&&a.jsx("button",{className:Xa?"pane-btn is-on":"pane-btn",title:"Терминал (Ctrl+`)","aria-label":"Терминал","aria-pressed":Xa,onClick:()=>Ii(p=>!p),children:a.jsx(UN,{})}),dt&&ea,dt&&a.jsx("button",{className:nt?"pane-btn is-on":"pane-btn",title:"Ещё","aria-label":"Ещё","aria-haspopup":"menu","aria-pressed":nt,onClick:()=>Ot(!0),children:a.jsx(BN,{})}),a.jsxs("div",{className:"topbar__id",children:[kn&&Q?a.jsx(ha,{className:"rename--title",value:Q.title??"",onCommit:p=>{Kr(Q,p),Be(!1)},onCancel:()=>Be(!1)}):a.jsxs("div",{className:"topbar__head",children:[a.jsx("button",{className:"topbar__title",disabled:!Q||dt,title:Q&&!dt?"Переименовать сессию":void 0,onClick:()=>Be(!0),children:(Q==null?void 0:Q.title)??"Claude Code Visual"}),An&&a.jsx("span",{className:"topbar__project",title:An.path,children:An.name})]}),dt?ac:oo&&a.jsx(W_,{path:oo})]}),!dt&&a.jsxs("div",{className:"topbar__tools",children:[a.jsx("button",{type:"button",className:Pt?"meters-refresh is-busy":"meters-refresh",title:id,"aria-label":cu,"aria-busy":Pt,disabled:!K||Pt,onClick:Zs,children:a.jsx(IN,{})}),a.jsx(ty,{usage:ru}),a.jsx(sy,{}),sc,or,ac,Es&&a.jsx("span",{className:"badge badge--cost",children:Es}),fr,Tu,ea]})]}),a.jsx(vN,{tokens:(Ve==null?void 0:Ve.tokens)??xe.contextTokens,maxTokens:(Ve==null?void 0:Ve.maxTokens)??null,fetchedAt:(Ve==null?void 0:Ve.fetchedAt)??null}),dt&&nt&&a.jsx(Sk,{onClose:()=>Ot(!1),permission:sc,model:or,usage:ru,cwd:oo,costLabel:Es,onRefresh:Zs,refreshing:Pt,metersFetchedAt:Fi,onRename:Q?()=>{Be(!0),Ot(!1)}:null,onHandoff:Q&&Q.state!=="closed"&&Q.provider!=="antigravity"?()=>{xl(Q),Ot(!1)}:null,onFreshSession:Q&&Q.state!=="closed"&&Q.provider!=="antigravity"?()=>{Tl(Q),Ot(!1)}:null,handoffWriting:Ca,onStop:Q&&Q.state!=="closed"?()=>{$r(Q),Ot(!1)}:null}),Vt.length>0&&a.jsx(Yj,{files:Vt,activePath:dn,busy:Vn,onSelect:Mt,onClose:p=>sr(p),zoomed:on==="main",onToggleZoom:Ta("main")}),uo?a.jsx(qj,{file:uo,goto:(Bn==null?void 0:Bn.path)===uo.path?Bn:null,onChange:(p,U)=>{st(re=>re.map(De=>De.path===p?{...De,text:U}:De)),ct(p)},onSave:p=>ni(p),onReload:_u,onOverwrite:p=>ni(p,!0),onRequestMedia:qn,onTogglePreview:p=>st(U=>U.map(re=>re.path===p?{...re,previewMode:!re.previewMode}:re))}):a.jsxs(a.Fragment,{children:[a.jsx(Up,{items:xe.items,busy:Vn&&!_l,waiting:si,empty:(Q==null?void 0:Q.provider)==="antigravity"?"Сессия пуста. Опишите задачу — Antigravity работает в каталоге проекта.":void 0,history:iu,historyHasMore:Lx(Re),historyLoading:Re.loading,onLoadHistory:au,sessionId:K??void 0,onEditMessage:(Q==null?void 0:Q.provider)==="antigravity"?void 0:(p,U,re)=>{if(!K)return!1;const De=K;return no(()=>ne({type:"prompt.edit",sessionId:De,userIndex:p,text:U,images:re}))}}),ku,Nu,K&&((oi=Q==null?void 0:Q.tasks)!=null&&oi.length)?a.jsx(Kj,{tasks:Q.tasks,onStop:p=>ne({type:"task.stop",sessionId:K,taskId:p})}):null,Ut&&ju&&ir&&a.jsx(ww,{kind:ju,toolName:Ut.toolName,queued:xe.pending.length-1,onExpand:()=>lc(Ut.requestId,!1)}),a.jsx(Z_,{disabled:!K,busy:Vn&&!_l,placeholder:_l?"Промпт уйдёт, как только связь вернётся":(Q==null?void 0:Q.state)==="closed"?"Остановлена — отправьте сообщение, чтобы продолжить":void 0,commands:Ns,sessionTitle:(Q==null?void 0:Q.title)??null,contextResult:Js,draftKey:K,onContextSearch:p=>bl("mention",p),onCommand:Jl,onSend:od,onInterrupt:()=>{K&&ne({type:"control.interrupt",sessionId:K})}})]}),Xa&&xa&&a.jsxs(a.Fragment,{children:[!dt&&on!=="terminal"&&a.jsx(fN,{height:Ur.height,onResize:Ur.setHeight,onReset:Ur.reset}),a.jsx(mN,{mobile:dt,zoomed:on==="terminal",onToggleZoom:Ta("terminal"),terminals:Va,activeId:Lr,blocked:Hr,error:nd,onDismissError:()=>zr(null),height:dt?Gi.height:Ur.height,offset:dt?{top:Gi.offsetTop,left:Gi.offsetLeft}:void 0,onSelect:qi,onOpen:li,onClose:Sa,onInput:(p,U)=>ne({type:"term.input",id:p,data:U}),onResize:(p,U,re)=>ne({type:"term.resize",id:p,cols:U,rows:re}),onAttach:p=>ne({type:"term.attach",id:p}),onHide:()=>Ii(!1),registerSink:ld})]})]}),a.jsx(hk,{open:Vs,items:tu.items,busy:ri,ready:K!==null,commands:Ns,contextResult:Zl,draftKey:K,models:Na.rows,model:Na.selected,effort:ka.effort,ultracode:ka.ultracode,thinking:ka.thinking,switchOnFlag:ka.switchOnFlag,onContextSearch:p=>bl("side",p),onCommand:Jl,onModel:p=>{p&&(Qs(U=>({...U,model:p})),In(U=>ne({type:"control.set_model",sessionId:U,model:p})))},onEffort:p=>{Qs(U=>({...U,effort:p,ultracode:!1})),In(U=>ne({type:"control.set_effort",sessionId:U,effort:p}))},onUltracode:p=>{Qs(U=>({...U,ultracode:p,...p?{effort:"xhigh"}:{}})),In(U=>ne({type:"control.set_ultracode",sessionId:U,enabled:p}))},onThinking:p=>{Qs(U=>({...U,thinking:p})),In(U=>ne({type:"control.set_thinking",sessionId:U,enabled:p}))},onSwitchOnFlag:p=>{Qs(U=>({...U,switchOnFlag:p})),In(U=>ne({type:"control.set_flag_switch",sessionId:U,enabled:p}))},onAsk:Pa,onInterrupt:()=>{eu&&ne({type:"control.interrupt",sessionId:eu})},onReset:ud,onClose:()=>Br(!1),zoomed:on==="ask",onToggleZoom:Ta("ask")}),Vs&&on!=="ask"&&cr("ask"),(Xt||Vs||ue||Ys)&&a.jsx("div",{className:"scrim scrim--pane",onClick:()=>{Tn(!1),Br(!1),ye(!1),$s(!1)}}),Hl&&a.jsx(Kw,{detail:Hl,local:((Tt==null?void 0:Tt.hasRemote)??!1)&&(Tt==null?void 0:Tt.commits.some(p=>p.hash===Hl.hash&&!p.pushed))===!0,onCheckout:lo,onClose:()=>{Vl(null),$n(null)}}),Ne&&a.jsxs(fl,{title:"Лимит плана почти исчерпан",onClose:()=>Vr(!1),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",autoFocus:!0,onClick:()=>Vr(!1),children:"Отмена"}),a.jsx("button",{className:"btn btn--primary",onClick:()=>Vr(!0),children:"Отправить всё равно"})]}),children:[a.jsxs("p",{className:"modal__text",children:[Ff[Ne.warning.limit][0].toUpperCase(),Ff[Ne.warning.limit].slice(1)," использован на"," ",Math.round(Ne.warning.utilization)," %, сброс в"," ",rN(Ne.warning.resetsAt),". Сообщение может оборваться на полуслове, когда лимит дойдёт до 100 %."]}),a.jsx("p",{className:"modal__text modal__text--dim",children:"До сброса сессию повторно останавливать не будем."})]}),fe&&a.jsx(fl,{title:"Остановить сессию?",onClose:()=>be(null),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>be(null),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",onClick:()=>{ne({type:"session.close",sessionId:fe.id}),be(null)},children:"Остановить"})]}),children:a.jsx("p",{className:"modal__text",children:"Сессия сейчас работает — остановка прервёт текущий ход. Разговор останется на диске: открыть сессию заново или просто написать в неё снова можно в любой момент."})}),fs&&a.jsxs(fl,{title:"Переключить рабочее дерево?",onClose:()=>Hs(null),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>Hs(null),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",onClick:Pr,children:"Переключиться"})]}),children:[a.jsxs("p",{className:"modal__text",children:["git переключится на ",fs.label,". Файлы в каталоге проекта изменятся — это тот же каталог, в котором работает агент."]}),Vn&&a.jsx("p",{className:"modal__text",children:"Сейчас идёт ход агента: он читает и правит файлы прямо сейчас."}),Tt&&Tt.changed.length>0&&a.jsxs("p",{className:"modal__text",children:["Незакоммиченных изменений: ",Tt.changed.length,". Git откажется переключаться, если они будут затёрты."]})]}),hs&&a.jsx(rk,{status:ds,owners:Xn,files:Nl,defaultName:(An==null?void 0:An.name)??"",hasCommits:Tt===null||Tt.head!=="",busy:Ql,result:yn,onRefreshStatus:ti,onSaveToken:ei,onPublish:ao,onDismissResult:()=>it(null),onClose:()=>gl(!1)}),T&&a.jsx(dk,{busy:Ql,result:yn,onSubmit:bu,onDismissResult:()=>it(null),onClose:()=>$(!1)}),ps&&a.jsx(fl,{title:ps.kind==="dir"?"Удалить каталог?":"Удалить файл?",onClose:()=>w(null),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>w(null),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",onClick:()=>yu(ps),children:"Удалить"})]}),children:a.jsxs("p",{className:"modal__text",children:[ps.path," будет удалён с диска",ps.kind==="dir"?" вместе со всем содержимым":"",". Корзины здесь нет: это тот же каталог, в котором работает агент."]})}),ce&&a.jsx(fl,{title:"Закрыть без сохранения?",onClose:()=>Ce(null),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>Ce(null),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",onClick:()=>sr(ce,!0),children:"Закрыть"}),a.jsx("button",{className:"btn btn--primary",onClick:()=>{ni(ce),sr(ce,!0)},children:"Сохранить и закрыть"})]}),children:a.jsxs("p",{className:"modal__text",children:["В ",ce," есть несохранённые правки."]})}),gn&&a.jsx(kk,{tab:gn,servers:an,plugins:rn,marketplaces:Wn,catalog:ge,result:Ke,auth:I,remote:x,actions:Zr,onTab:Nn,onClose:()=>Nn(null)}),rs&&a.jsx(Ok,{status:al,login:Wt,actions:js,remote:x,runningSessions:R.filter(p=>p.state==="running"||p.state==="waiting_permission").length,onReconnect:K?()=>{ur(),cs(!1)}:null,reconnectBlocked:Vn,reconnectHint:ic,onClose:()=>cs(!1)}),m&&a.jsx(Bk,{state:d,onPair:(p,U)=>ne({type:"relay.pair",code:p,...U?{name:U}:{}}),onUnpair:()=>ne({type:"relay.unpair"}),onClose:()=>g(!1)}),kl&&a.jsx(Wk,{settings:lt,models:(G==null?void 0:G.models)??[],relayState:d,local:Hf()==="local",onChange:Jr,onEnableShell:()=>ne({type:"relay.shell.enable"}),onDisableShell:()=>ne({type:"relay.shell.disable"}),onOpenRelay:()=>{il(!1),g(!0)},onClose:()=>il(!1)}),et&&a.jsx(Dw,{candidates:Fn,searching:Jn,agentItems:zn.items,agentBusy:(St==null?void 0:St.state)==="running",error:Zt,roots:sn,created:rt,onSearch:uu,onAskAgent:fu,onInterrupt:()=>{const p=Qi.current;p&&ne({type:"control.interrupt",sessionId:p})},onSubmit:Pi,onCreate:ou,onClose:du}),Ut!=null&&Ut.questions&&Ut.questions.length>0?a.jsx(Nw,{request:{...Ut,questions:Ut.questions},queued:xe.pending.length-1,collapsed:ir,onCollapse:()=>lc(Ut.requestId,!0),onAnswer:ar,onDecline:co}):Ut&&Ts!==null?a.jsx(jw,{request:Ut,plan:Ts,queued:xe.pending.length-1,collapsed:ir,onCollapse:()=>lc(Ut.requestId,!0),onAccept:wa,onDecline:ks}):Ut&&a.jsx(kw,{request:Ut,queued:xe.pending.length-1,collapsed:ir,onCollapse:()=>lc(Ut.requestId,!0),onDecide:ro}),at&&a.jsx(tN,{handoff:at,onClose:()=>xn(null)}),a.jsx(sN,{notices:Us,onDismiss:p=>is(U=>U.filter(re=>re.id!==p))})]})}function MN(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("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 RN(){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 DN(){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 ON(){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 LN(){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 zN(l,s){return n_(l)===n_(s)}function n_(l){return l.replace(/[\\/]+/g,"/").replace(/\/+$/,"").toLowerCase()}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("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 HN(){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 BN(){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 IN(){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(AN,{})}));export{R1 as D,tn as I,ln as N,YN as P,ls as T,zs as a,R_ as b,Ul as c,GN as d,U_ as e,Fo as f,J1 as h,$N as p,XN as s,Te as t};