@i14ks/ccv 0.44.0 → 0.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD-PARTY-NOTICES.md +1726 -62
- package/bundle/ccv.mjs +2813 -453
- package/package.json +1 -1
- package/web/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- package/web/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- package/web/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- package/web/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- package/web/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- package/web/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- package/web/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- package/web/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- package/web/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- package/web/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- package/web/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- package/web/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- package/web/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- package/web/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- package/web/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- package/web/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- package/web/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- package/web/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- package/web/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- package/web/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- package/web/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- package/web/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- package/web/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- package/web/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- package/web/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- package/web/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- package/web/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- package/web/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- package/web/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- package/web/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- package/web/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- package/web/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- package/web/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- package/web/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- package/web/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- package/web/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- package/web/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- package/web/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- package/web/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- package/web/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- package/web/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- package/web/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- package/web/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- package/web/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- package/web/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- package/web/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- package/web/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- package/web/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- package/web/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- package/web/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- package/web/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- package/web/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- package/web/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- package/web/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- package/web/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- package/web/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- package/web/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- package/web/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- package/web/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- package/web/assets/abnfDiagram-S7VZAUFO-CNj02zRV.js +1 -0
- package/web/assets/architectureDiagram-YGSQEFNW-UnapXBnq.js +36 -0
- package/web/assets/blockDiagram-APKKGZFW-By1mA1_j.js +140 -0
- package/web/assets/bpmnIcons-APHXDYXF-ByGoYv9M.js +1 -0
- package/web/assets/c4Diagram-KJ2TOQU5-DxR8Tp-K.js +38 -0
- package/web/assets/chunk-2Q5K7J3B-CfcIu3Ah.js +1 -0
- package/web/assets/chunk-5VM5RSS4-Ddk-Fv2Y.js +15 -0
- package/web/assets/chunk-HFQBQIA3-DqPjzTQu.js +1 -0
- package/web/assets/chunk-JWPE2WC7-VUIzkY_4.js +1 -0
- package/web/assets/chunk-KQLB2F66-Bi85gKHH.js +2 -0
- package/web/assets/chunk-KS47KZWR-BZwBvPDM.js +1 -0
- package/web/assets/chunk-OY52VR5R-B_DWv6kS.js +88 -0
- package/web/assets/chunk-TU62E6Q5-BZ5M8LNU.js +1 -0
- package/web/assets/chunk-XXDRQBXY-DcC5f1oO.js +1 -0
- package/web/assets/classDiagram-v2-L25IHNXF-CiZfI5zH.js +217 -0
- package/web/assets/{codemirror-CpnHxn-s.js → codemirror-B_zWrnLp.js} +1 -1
- package/web/assets/cose-bilkent-JH36ORCC-OecldNrx.js +1 -0
- package/web/assets/cynefin-EF2NZ3EQ-BHDQXZEc.js +141 -0
- package/web/assets/cynefinDiagram-L36ESFBY-COnZzGKx.js +62 -0
- package/web/assets/cytoscape.esm-Bw5aGq32.js +332 -0
- package/web/assets/d3-scale-4DPf7zan.js +1 -0
- package/web/assets/dagre-SPEB5RXH-XxNubJTv.js +4 -0
- package/web/assets/diagram-3B7GL73J-BEpsszbY.js +200 -0
- package/web/assets/diagram-DNEMPZML-DAKChpAZ.js +24 -0
- package/web/assets/diagram-L3MUGCDN-CvDcHjXy.js +41 -0
- package/web/assets/diagram-LA4NIPWU-BO-n7J3S.js +24 -0
- package/web/assets/diagram-MHCOC4E2-BW8MchVY.js +3 -0
- package/web/assets/diagram-XPFHEONP-DjiEBmkx.js +30 -0
- package/web/assets/ebnfDiagram-UZSYDL2S-DKGunvzj.js +1 -0
- package/web/assets/elk-XV6XMXQE-b9lmTG03.js +2 -0
- package/web/assets/erDiagram-EYBAPDEH-DT_k1OGC.js +99 -0
- package/web/assets/flowDiagram-MALGAFMO-BUqGlWOn.js +213 -0
- package/web/assets/ganttDiagram-23REXITY-Cbr_kL7O.js +292 -0
- package/web/assets/gitGraphDiagram-STJD7YCW-Cw6S4Bcr.js +106 -0
- package/web/assets/graph-Bn3Yngep.js +1 -0
- package/web/assets/index-B1IBfUz9.css +1 -0
- package/web/assets/{index-BIaTEYpO.js → index-B5vdEupB.js} +1 -1
- package/web/assets/{index-BjcBtkKx.js → index-BLmLDrEY.js} +1 -1
- package/web/assets/{index-CWyId3-O.js → index-BO8effSp.js} +1 -1
- package/web/assets/index-BYJrmc8N.js +1 -0
- package/web/assets/{index-BCNV5J5e.js → index-B_SP1UWv.js} +1 -1
- package/web/assets/index-BdwT0-rx.js +152 -0
- package/web/assets/index-BoggcMUx.js +7 -0
- package/web/assets/{index-891wE-Rj.js → index-COYbUhJ2.js} +1 -1
- package/web/assets/index-CfWAy0wv.js +1 -0
- package/web/assets/{index-C6vpveFy.js → index-Ch08lakn.js} +1 -1
- package/web/assets/index-Cl3pbMFT.js +1 -0
- package/web/assets/index-CnRY1mXR.js +1 -0
- package/web/assets/index-Ctc6whsQ.js +1 -0
- package/web/assets/{index-BPiJlpKF.js → index-D7DCXKEo.js} +1 -1
- package/web/assets/{index-B6h8VCuY.js → index-DQnArn0a.js} +1 -1
- package/web/assets/{index-BnIobsSF.js → index-DnFYUU1x.js} +1 -1
- package/web/assets/{index-DqFhjq3T.js → index-Du5Qar1T.js} +1 -1
- package/web/assets/{index-CFOaholk.js → index-DvFMS_gT.js} +4 -4
- package/web/assets/{index-6xG2dMZE.js → index-HQJZpoPE.js} +1 -1
- package/web/assets/{index-DOU-NfbM.js → index-dkD_YPIB.js} +2 -2
- package/web/assets/{index-DVVbk6ww.js → index-qkpXZNl3.js} +1 -1
- package/web/assets/infoDiagram-KBXO4MBG-CusT957H.js +2 -0
- package/web/assets/ishikawaDiagram-M35NCXHK-DlxUISb3.js +70 -0
- package/web/assets/journeyDiagram-OPLOXDXO-B7X0y02x.js +139 -0
- package/web/assets/kanban-definition-BZKZHSQY-DzEKGEDz.js +89 -0
- package/web/assets/katex-DFbIS0RS.js +257 -0
- package/web/assets/katex-DxB02YXk.css +1 -0
- package/web/assets/katex-RYEII7GN.js +257 -0
- package/web/assets/mermaid.core-BM9CG8VU.js +312 -0
- package/web/assets/mindmap-definition-I2QAS2VK-DgE3KgdI.js +98 -0
- package/web/assets/pegDiagram-FD4XPPHP-2wTO2ZJT.js +1 -0
- package/web/assets/pieDiagram-J4AKIIQI-CKRDBux_.js +39 -0
- package/web/assets/quadrantDiagram-XTYBLID2-Ceg_KG7b.js +7 -0
- package/web/assets/railroadDiagram-MRQ6NCDL-DkyGV8eQ.js +1 -0
- package/web/assets/requirementDiagram-Y7LWUY3S-DEpWnvQ5.js +84 -0
- package/web/assets/sankeyDiagram-WGJFYUXA-D06-ObVT.js +40 -0
- package/web/assets/sequenceDiagram-5NDRBG5M-CNgwRsPl.js +169 -0
- package/web/assets/sizeCapture-INFHLROL-DLPIeXe1.js +1 -0
- package/web/assets/stateDiagram-v2-FJ4FJNEA-CjTQ5dpG.js +291 -0
- package/web/assets/swimlanes-UMQ2AFYF-eJkqG_t9.js +1 -0
- package/web/assets/swimlanesDiagram-OMPLPG4O-D-nejod0.js +8 -0
- package/web/assets/timeline-definition-SEUHKTQE-CUTdCFpH.js +120 -0
- package/web/assets/usecaseDiagram-AFA6YXN4-BHojL49I.js +370 -0
- package/web/assets/vennDiagram-NNMJR3RB-Bk5isaer.js +34 -0
- package/web/assets/wardleyDiagram-S7YFUSEH-DolRO_uR.js +78 -0
- package/web/assets/xychartDiagram-GGNKY7IX-V3IUgdp-.js +7 -0
- package/web/index.html +2 -2
- package/web/assets/index-BCr4Xq2t.js +0 -1
- package/web/assets/index-BTBYwWBS.js +0 -1
- package/web/assets/index-CBzCYPlp.css +0 -1
- package/web/assets/index-DesNy3O4.js +0 -1
- package/web/assets/index-DmPq7iLF.js +0 -1
- package/web/assets/index-Dxbgrz7x.js +0 -135
- package/web/assets/index-EbSAIVkK.js +0 -1
- package/web/assets/index-Tib36HVB.js +0 -7
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-BPiJlpKF.js","./index-BjcBtkKx.js","./index-BCr4Xq2t.js","./index-BHot-lnj.js","./index-891wE-Rj.js","./index-DqFhjq3T.js","./index-BIaTEYpO.js","./index-6xG2dMZE.js","./index-DVVbk6ww.js","./index-CFOaholk.js","./index-BnIobsSF.js","./index-BCNV5J5e.js","./index-DesNy3O4.js","./index-DmPq7iLF.js","./index-BTBYwWBS.js","./index-Tib36HVB.js","./index-EbSAIVkK.js","./index-B6h8VCuY.js","./index-C6vpveFy.js","./index-DOU-NfbM.js","./index-CWyId3-O.js","./codemirror-CpnHxn-s.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 nv=Object.defineProperty;var $x=n=>{throw TypeError(n)};var sv=(n,l,r)=>l in n?nv(n,l,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[l]=r;var Ft=(n,l,r)=>sv(n,typeof l!="symbol"?l+"":l,r),Fh=(n,l,r)=>l.has(n)||$x("Cannot "+r);var Pe=(n,l,r)=>(Fh(n,l,"read from private field"),r?r.call(n):l.get(n)),yn=(n,l,r)=>l.has(n)?$x("Cannot add the same private member more than once"):l instanceof WeakSet?l.add(n):l.set(n,r),Lt=(n,l,r,c)=>(Fh(n,l,"write to private field"),c?c.call(n,r):l.set(n,r),r),Qn=(n,l,r)=>(Fh(n,l,"access private method"),r);(function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))c(o);new MutationObserver(o=>{for(const d of o)if(d.type==="childList")for(const h of d.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&c(h)}).observe(document,{childList:!0,subtree:!0});function r(o){const d={};return o.integrity&&(d.integrity=o.integrity),o.referrerPolicy&&(d.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?d.credentials="include":o.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function c(o){if(o.ep)return;o.ep=!0;const d=r(o);fetch(o.href,d)}})();var Zh={exports:{}},du={};/**
|
|
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 qx;function lv(){if(qx)return du;qx=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function r(c,o,d){var h=null;if(d!==void 0&&(h=""+d),o.key!==void 0&&(h=""+o.key),"key"in o){d={};for(var m in o)m!=="key"&&(d[m]=o[m])}else d=o;return o=d.ref,{$$typeof:n,type:c,key:h,ref:o!==void 0?o:null,props:d}}return du.Fragment=l,du.jsx=r,du.jsxs=r,du}var Gx;function av(){return Gx||(Gx=1,Zh.exports=lv()),Zh.exports}var a=av(),Jh={exports:{}},st={};/**
|
|
11
|
-
* @license React
|
|
12
|
-
* react.production.js
|
|
13
|
-
*
|
|
14
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
15
|
-
*
|
|
16
|
-
* This source code is licensed under the MIT license found in the
|
|
17
|
-
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*/var Yx;function iv(){if(Yx)return st;Yx=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),h=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),b=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),v=Symbol.iterator;function S(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(){}},A=Object.assign,C={};function V(E,ee,me){this.props=E,this.context=ee,this.refs=C,this.updater=me||k}V.prototype.isReactComponent={},V.prototype.setState=function(E,ee){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,ee,"setState")},V.prototype.forceUpdate=function(E){this.updater.enqueueForceUpdate(this,E,"forceUpdate")};function Q(){}Q.prototype=V.prototype;function $(E,ee,me){this.props=E,this.context=ee,this.refs=C,this.updater=me||k}var I=$.prototype=new Q;I.constructor=$,A(I,V.prototype),I.isPureReactComponent=!0;var G=Array.isArray;function M(){}var z={H:null,A:null,T:null,S:null},R=Object.prototype.hasOwnProperty;function K(E,ee,me){var Se=me.ref;return{$$typeof:n,type:E,key:ee,ref:Se!==void 0?Se:null,props:me}}function ae(E,ee){return K(E.type,ee,E.props)}function Y(E){return typeof E=="object"&&E!==null&&E.$$typeof===n}function H(E){var ee={"=":"=0",":":"=2"};return"$"+E.replace(/[=:]/g,function(me){return ee[me]})}var fe=/\/+/g;function ue(E,ee){return typeof E=="object"&&E!==null&&E.key!=null?H(""+E.key):ee.toString(36)}function X(E){switch(E.status){case"fulfilled":return E.value;case"rejected":throw E.reason;default:switch(typeof E.status=="string"?E.then(M,M):(E.status="pending",E.then(function(ee){E.status==="pending"&&(E.status="fulfilled",E.value=ee)},function(ee){E.status==="pending"&&(E.status="rejected",E.reason=ee)})),E.status){case"fulfilled":return E.value;case"rejected":throw E.reason}}throw E}function D(E,ee,me,Se,q){var we=typeof E;(we==="undefined"||we==="boolean")&&(E=null);var ie=!1;if(E===null)ie=!0;else switch(we){case"bigint":case"string":case"number":ie=!0;break;case"object":switch(E.$$typeof){case n:case l:ie=!0;break;case y:return ie=E._init,D(ie(E._payload),ee,me,Se,q)}}if(ie)return q=q(E),ie=Se===""?"."+ue(E,0):Se,G(q)?(me="",ie!=null&&(me=ie.replace(fe,"$&/")+"/"),D(q,ee,me,"",function(Zt){return Zt})):q!=null&&(Y(q)&&(q=ae(q,me+(q.key==null||E&&E.key===q.key?"":(""+q.key).replace(fe,"$&/")+"/")+ie)),ee.push(q)),1;ie=0;var Ie=Se===""?".":Se+":";if(G(E))for(var ze=0;ze<E.length;ze++)Se=E[ze],we=Ie+ue(Se,ze),ie+=D(Se,ee,me,we,q);else if(ze=S(E),typeof ze=="function")for(E=ze.call(E),ze=0;!(Se=E.next()).done;)Se=Se.value,we=Ie+ue(Se,ze++),ie+=D(Se,ee,me,we,q);else if(we==="object"){if(typeof E.then=="function")return D(X(E),ee,me,Se,q);throw ee=String(E),Error("Objects are not valid as a React child (found: "+(ee==="[object Object]"?"object with keys {"+Object.keys(E).join(", ")+"}":ee)+"). If you meant to render a collection of children, use an array instead.")}return ie}function U(E,ee,me){if(E==null)return E;var Se=[],q=0;return D(E,Se,"","",function(we){return ee.call(me,we,q++)}),Se}function ce(E){if(E._status===-1){var ee=E._result;ee=ee(),ee.then(function(me){(E._status===0||E._status===-1)&&(E._status=1,E._result=me)},function(me){(E._status===0||E._status===-1)&&(E._status=2,E._result=me)}),E._status===-1&&(E._status=0,E._result=ee)}if(E._status===1)return E._result.default;throw E._result}var be=typeof reportError=="function"?reportError:function(E){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var ee=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(ee))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",E);return}console.error(E)},Ne={map:U,forEach:function(E,ee,me){U(E,function(){ee.apply(this,arguments)},me)},count:function(E){var ee=0;return U(E,function(){ee++}),ee},toArray:function(E){return U(E,function(ee){return ee})||[]},only:function(E){if(!Y(E))throw Error("React.Children.only expected to receive a single React element child.");return E}};return st.Activity=j,st.Children=Ne,st.Component=V,st.Fragment=r,st.Profiler=o,st.PureComponent=$,st.StrictMode=c,st.Suspense=g,st.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=z,st.__COMPILER_RUNTIME={__proto__:null,c:function(E){return z.H.useMemoCache(E)}},st.cache=function(E){return function(){return E.apply(null,arguments)}},st.cacheSignal=function(){return null},st.cloneElement=function(E,ee,me){if(E==null)throw Error("The argument must be a React element, but you passed "+E+".");var Se=A({},E.props),q=E.key;if(ee!=null)for(we in ee.key!==void 0&&(q=""+ee.key),ee)!R.call(ee,we)||we==="key"||we==="__self"||we==="__source"||we==="ref"&&ee.ref===void 0||(Se[we]=ee[we]);var we=arguments.length-2;if(we===1)Se.children=me;else if(1<we){for(var ie=Array(we),Ie=0;Ie<we;Ie++)ie[Ie]=arguments[Ie+2];Se.children=ie}return K(E.type,q,Se)},st.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},st.createElement=function(E,ee,me){var Se,q={},we=null;if(ee!=null)for(Se in ee.key!==void 0&&(we=""+ee.key),ee)R.call(ee,Se)&&Se!=="key"&&Se!=="__self"&&Se!=="__source"&&(q[Se]=ee[Se]);var ie=arguments.length-2;if(ie===1)q.children=me;else if(1<ie){for(var Ie=Array(ie),ze=0;ze<ie;ze++)Ie[ze]=arguments[ze+2];q.children=Ie}if(E&&E.defaultProps)for(Se in ie=E.defaultProps,ie)q[Se]===void 0&&(q[Se]=ie[Se]);return K(E,we,q)},st.createRef=function(){return{current:null}},st.forwardRef=function(E){return{$$typeof:m,render:E}},st.isValidElement=Y,st.lazy=function(E){return{$$typeof:y,_payload:{_status:-1,_result:E},_init:ce}},st.memo=function(E,ee){return{$$typeof:b,type:E,compare:ee===void 0?null:ee}},st.startTransition=function(E){var ee=z.T,me={};z.T=me;try{var Se=E(),q=z.S;q!==null&&q(me,Se),typeof Se=="object"&&Se!==null&&typeof Se.then=="function"&&Se.then(M,be)}catch(we){be(we)}finally{ee!==null&&me.types!==null&&(ee.types=me.types),z.T=ee}},st.unstable_useCacheRefresh=function(){return z.H.useCacheRefresh()},st.use=function(E){return z.H.use(E)},st.useActionState=function(E,ee,me){return z.H.useActionState(E,ee,me)},st.useCallback=function(E,ee){return z.H.useCallback(E,ee)},st.useContext=function(E){return z.H.useContext(E)},st.useDebugValue=function(){},st.useDeferredValue=function(E,ee){return z.H.useDeferredValue(E,ee)},st.useEffect=function(E,ee){return z.H.useEffect(E,ee)},st.useEffectEvent=function(E){return z.H.useEffectEvent(E)},st.useId=function(){return z.H.useId()},st.useImperativeHandle=function(E,ee,me){return z.H.useImperativeHandle(E,ee,me)},st.useInsertionEffect=function(E,ee){return z.H.useInsertionEffect(E,ee)},st.useLayoutEffect=function(E,ee){return z.H.useLayoutEffect(E,ee)},st.useMemo=function(E,ee){return z.H.useMemo(E,ee)},st.useOptimistic=function(E,ee){return z.H.useOptimistic(E,ee)},st.useReducer=function(E,ee,me){return z.H.useReducer(E,ee,me)},st.useRef=function(E){return z.H.useRef(E)},st.useState=function(E){return z.H.useState(E)},st.useSyncExternalStore=function(E,ee,me){return z.H.useSyncExternalStore(E,ee,me)},st.useTransition=function(){return z.H.useTransition()},st.version="19.2.8",st}var Xx;function Ip(){return Xx||(Xx=1,Jh.exports=iv()),Jh.exports}var x=Ip(),Ph={exports:{}},fu={},Wh={exports:{}},ep={};/**
|
|
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 Vx;function rv(){return Vx||(Vx=1,(function(n){function l(D,U){var ce=D.length;D.push(U);e:for(;0<ce;){var be=ce-1>>>1,Ne=D[be];if(0<o(Ne,U))D[be]=U,D[ce]=Ne,ce=be;else break e}}function r(D){return D.length===0?null:D[0]}function c(D){if(D.length===0)return null;var U=D[0],ce=D.pop();if(ce!==U){D[0]=ce;e:for(var be=0,Ne=D.length,E=Ne>>>1;be<E;){var ee=2*(be+1)-1,me=D[ee],Se=ee+1,q=D[Se];if(0>o(me,ce))Se<Ne&&0>o(q,me)?(D[be]=q,D[Se]=ce,be=Se):(D[be]=me,D[ee]=ce,be=ee);else if(Se<Ne&&0>o(q,ce))D[be]=q,D[Se]=ce,be=Se;else break e}}return U}function o(D,U){var ce=D.sortIndex-U.sortIndex;return ce!==0?ce:D.id-U.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;n.unstable_now=function(){return d.now()}}else{var h=Date,m=h.now();n.unstable_now=function(){return h.now()-m}}var g=[],b=[],y=1,j=null,v=3,S=!1,k=!1,A=!1,C=!1,V=typeof setTimeout=="function"?setTimeout:null,Q=typeof clearTimeout=="function"?clearTimeout:null,$=typeof setImmediate<"u"?setImmediate:null;function I(D){for(var U=r(b);U!==null;){if(U.callback===null)c(b);else if(U.startTime<=D)c(b),U.sortIndex=U.expirationTime,l(g,U);else break;U=r(b)}}function G(D){if(A=!1,I(D),!k)if(r(g)!==null)k=!0,M||(M=!0,H());else{var U=r(b);U!==null&&X(G,U.startTime-D)}}var M=!1,z=-1,R=5,K=-1;function ae(){return C?!0:!(n.unstable_now()-K<R)}function Y(){if(C=!1,M){var D=n.unstable_now();K=D;var U=!0;try{e:{k=!1,A&&(A=!1,Q(z),z=-1),S=!0;var ce=v;try{t:{for(I(D),j=r(g);j!==null&&!(j.expirationTime>D&&ae());){var be=j.callback;if(typeof be=="function"){j.callback=null,v=j.priorityLevel;var Ne=be(j.expirationTime<=D);if(D=n.unstable_now(),typeof Ne=="function"){j.callback=Ne,I(D),U=!0;break t}j===r(g)&&c(g),I(D)}else c(g);j=r(g)}if(j!==null)U=!0;else{var E=r(b);E!==null&&X(G,E.startTime-D),U=!1}}break e}finally{j=null,v=ce,S=!1}U=void 0}}finally{U?H():M=!1}}}var H;if(typeof $=="function")H=function(){$(Y)};else if(typeof MessageChannel<"u"){var fe=new MessageChannel,ue=fe.port2;fe.port1.onmessage=Y,H=function(){ue.postMessage(null)}}else H=function(){V(Y,0)};function X(D,U){z=V(function(){D(n.unstable_now())},U)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(D){D.callback=null},n.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<D?Math.floor(1e3/D):5},n.unstable_getCurrentPriorityLevel=function(){return v},n.unstable_next=function(D){switch(v){case 1:case 2:case 3:var U=3;break;default:U=v}var ce=v;v=U;try{return D()}finally{v=ce}},n.unstable_requestPaint=function(){C=!0},n.unstable_runWithPriority=function(D,U){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var ce=v;v=D;try{return U()}finally{v=ce}},n.unstable_scheduleCallback=function(D,U,ce){var be=n.unstable_now();switch(typeof ce=="object"&&ce!==null?(ce=ce.delay,ce=typeof ce=="number"&&0<ce?be+ce:be):ce=be,D){case 1:var Ne=-1;break;case 2:Ne=250;break;case 5:Ne=1073741823;break;case 4:Ne=1e4;break;default:Ne=5e3}return Ne=ce+Ne,D={id:y++,callback:U,priorityLevel:D,startTime:ce,expirationTime:Ne,sortIndex:-1},ce>be?(D.sortIndex=ce,l(b,D),r(g)===null&&D===r(b)&&(A?(Q(z),z=-1):A=!0,X(G,ce-be))):(D.sortIndex=Ne,l(g,D),k||S||(k=!0,M||(M=!0,H()))),D},n.unstable_shouldYield=ae,n.unstable_wrapCallback=function(D){var U=v;return function(){var ce=v;v=U;try{return D.apply(this,arguments)}finally{v=ce}}}})(ep)),ep}var Qx;function cv(){return Qx||(Qx=1,Wh.exports=rv()),Wh.exports}var tp={exports:{}},Ns={};/**
|
|
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 Kx;function ov(){if(Kx)return Ns;Kx=1;var n=Ip();function l(g){var b="https://react.dev/errors/"+g;if(1<arguments.length){b+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)b+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+g+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var c={d:{f:r,r:function(){throw Error(l(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for("react.portal");function d(g,b,y){var j=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:j==null?null:""+j,children:g,containerInfo:b,implementation:y}}var h=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(g,b){if(g==="font")return"";if(typeof b=="string")return b==="use-credentials"?b:""}return Ns.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,Ns.createPortal=function(g,b){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!b||b.nodeType!==1&&b.nodeType!==9&&b.nodeType!==11)throw Error(l(299));return d(g,b,null,y)},Ns.flushSync=function(g){var b=h.T,y=c.p;try{if(h.T=null,c.p=2,g)return g()}finally{h.T=b,c.p=y,c.d.f()}},Ns.preconnect=function(g,b){typeof g=="string"&&(b?(b=b.crossOrigin,b=typeof b=="string"?b==="use-credentials"?b:"":void 0):b=null,c.d.C(g,b))},Ns.prefetchDNS=function(g){typeof g=="string"&&c.d.D(g)},Ns.preinit=function(g,b){if(typeof g=="string"&&b&&typeof b.as=="string"){var y=b.as,j=m(y,b.crossOrigin),v=typeof b.integrity=="string"?b.integrity:void 0,S=typeof b.fetchPriority=="string"?b.fetchPriority:void 0;y==="style"?c.d.S(g,typeof b.precedence=="string"?b.precedence:void 0,{crossOrigin:j,integrity:v,fetchPriority:S}):y==="script"&&c.d.X(g,{crossOrigin:j,integrity:v,fetchPriority:S,nonce:typeof b.nonce=="string"?b.nonce:void 0})}},Ns.preinitModule=function(g,b){if(typeof g=="string")if(typeof b=="object"&&b!==null){if(b.as==null||b.as==="script"){var y=m(b.as,b.crossOrigin);c.d.M(g,{crossOrigin:y,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0})}}else b==null&&c.d.M(g)},Ns.preload=function(g,b){if(typeof g=="string"&&typeof b=="object"&&b!==null&&typeof b.as=="string"){var y=b.as,j=m(y,b.crossOrigin);c.d.L(g,y,{crossOrigin:j,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0,type:typeof b.type=="string"?b.type:void 0,fetchPriority:typeof b.fetchPriority=="string"?b.fetchPriority:void 0,referrerPolicy:typeof b.referrerPolicy=="string"?b.referrerPolicy:void 0,imageSrcSet:typeof b.imageSrcSet=="string"?b.imageSrcSet:void 0,imageSizes:typeof b.imageSizes=="string"?b.imageSizes:void 0,media:typeof b.media=="string"?b.media:void 0})}},Ns.preloadModule=function(g,b){if(typeof g=="string")if(b){var y=m(b.as,b.crossOrigin);c.d.m(g,{as:typeof b.as=="string"&&b.as!=="script"?b.as:void 0,crossOrigin:y,integrity:typeof b.integrity=="string"?b.integrity:void 0})}else c.d.m(g)},Ns.requestFormReset=function(g){c.d.r(g)},Ns.unstable_batchedUpdates=function(g,b){return g(b)},Ns.useFormState=function(g,b,y){return h.H.useFormState(g,b,y)},Ns.useFormStatus=function(){return h.H.useHostTransitionStatus()},Ns.version="19.2.8",Ns}var Fx;function uv(){if(Fx)return tp.exports;Fx=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),tp.exports=ov(),tp.exports}/**
|
|
35
|
-
* @license React
|
|
36
|
-
* react-dom-client.production.js
|
|
37
|
-
*
|
|
38
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
39
|
-
*
|
|
40
|
-
* This source code is licensed under the MIT license found in the
|
|
41
|
-
* LICENSE file in the root directory of this source tree.
|
|
42
|
-
*/var Zx;function dv(){if(Zx)return fu;Zx=1;var n=cv(),l=Ip(),r=uv();function c(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)t+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function d(e){var t=e,s=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(s=t.return),e=t.return;while(e)}return t.tag===3?s:null}function h(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function m(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function g(e){if(d(e)!==e)throw Error(c(188))}function b(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(c(188));return t!==e?null:e}for(var s=e,i=t;;){var u=s.return;if(u===null)break;var f=u.alternate;if(f===null){if(i=u.return,i!==null){s=i;continue}break}if(u.child===f.child){for(f=u.child;f;){if(f===s)return g(u),e;if(f===i)return g(u),t;f=f.sibling}throw Error(c(188))}if(s.return!==i.return)s=u,i=f;else{for(var _=!1,N=u.child;N;){if(N===s){_=!0,s=u,i=f;break}if(N===i){_=!0,i=u,s=f;break}N=N.sibling}if(!_){for(N=f.child;N;){if(N===s){_=!0,s=f,i=u;break}if(N===i){_=!0,i=f,s=u;break}N=N.sibling}if(!_)throw Error(c(189))}}if(s.alternate!==i)throw Error(c(190))}if(s.tag!==3)throw Error(c(188));return s.stateNode.current===s?e:t}function y(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=y(e),t!==null)return t;e=e.sibling}return null}var j=Object.assign,v=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),V=Symbol.for("react.profiler"),Q=Symbol.for("react.consumer"),$=Symbol.for("react.context"),I=Symbol.for("react.forward_ref"),G=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),K=Symbol.for("react.activity"),ae=Symbol.for("react.memo_cache_sentinel"),Y=Symbol.iterator;function H(e){return e===null||typeof e!="object"?null:(e=Y&&e[Y]||e["@@iterator"],typeof e=="function"?e:null)}var fe=Symbol.for("react.client.reference");function ue(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===fe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case A:return"Fragment";case V:return"Profiler";case C:return"StrictMode";case G:return"Suspense";case M:return"SuspenseList";case K:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case k:return"Portal";case $:return e.displayName||"Context";case Q:return(e._context.displayName||"Context")+".Consumer";case I: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:ue(e.type)||"Memo";case R:t=e._payload,e=e._init;try{return ue(e(t))}catch{}}return null}var X=Array.isArray,D=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce={pending:!1,data:null,method:null,action:null},be=[],Ne=-1;function E(e){return{current:e}}function ee(e){0>Ne||(e.current=be[Ne],be[Ne]=null,Ne--)}function me(e,t){Ne++,be[Ne]=e.current,e.current=t}var Se=E(null),q=E(null),we=E(null),ie=E(null);function Ie(e,t){switch(me(we,t),me(q,e),me(Se,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?ux(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=ux(t),e=dx(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}ee(Se),me(Se,e)}function ze(){ee(Se),ee(q),ee(we)}function Zt(e){e.memoizedState!==null&&me(ie,e);var t=Se.current,s=dx(t,e.type);t!==s&&(me(q,e),me(Se,s))}function Qe(e){q.current===e&&(ee(Se),ee(q)),ie.current===e&&(ee(ie),ru._currentValue=ce)}var un,Ze;function dt(e){if(un===void 0)try{throw Error()}catch(s){var t=s.stack.trim().match(/\n( *(at )?)/);un=t&&t[1]||"",Ze=-1<s.stack.indexOf(`
|
|
43
|
-
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
44
|
-
`+un+e+Ze}var tt=!1;function Gt(e,t){if(!e||tt)return"";tt=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var xe=function(){throw Error()};if(Object.defineProperty(xe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(xe,[])}catch(oe){var le=oe}Reflect.construct(e,[],xe)}else{try{xe.call()}catch(oe){le=oe}e.call(xe.prototype)}}else{try{throw Error()}catch(oe){le=oe}(xe=e())&&typeof xe.catch=="function"&&xe.catch(function(){})}}catch(oe){if(oe&&le&&typeof oe.stack=="string")return[oe.stack,le.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=i.DetermineComponentFrameRoot(),_=f[0],N=f[1];if(_&&N){var O=_.split(`
|
|
45
|
-
`),ne=N.split(`
|
|
46
|
-
`);for(u=i=0;i<O.length&&!O[i].includes("DetermineComponentFrameRoot");)i++;for(;u<ne.length&&!ne[u].includes("DetermineComponentFrameRoot");)u++;if(i===O.length||u===ne.length)for(i=O.length-1,u=ne.length-1;1<=i&&0<=u&&O[i]!==ne[u];)u--;for(;1<=i&&0<=u;i--,u--)if(O[i]!==ne[u]){if(i!==1||u!==1)do if(i--,u--,0>u||O[i]!==ne[u]){var he=`
|
|
47
|
-
`+O[i].replace(" at new "," at ");return e.displayName&&he.includes("<anonymous>")&&(he=he.replace("<anonymous>",e.displayName)),he}while(1<=i&&0<=u);break}}}finally{tt=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?dt(s):""}function es(e,t){switch(e.tag){case 26:case 27:case 5:return dt(e.type);case 16:return dt("Lazy");case 13:return e.child!==t&&t!==null?dt("Suspense Fallback"):dt("Suspense");case 19:return dt("SuspenseList");case 0:case 15:return Gt(e.type,!1);case 11:return Gt(e.type.render,!1);case 1:return Gt(e.type,!0);case 31:return dt("Activity");default:return""}}function ct(e){try{var t="",s=null;do t+=es(e,s),s=e,e=e.return;while(e);return t}catch(i){return`
|
|
48
|
-
Error generating stack: `+i.message+`
|
|
49
|
-
`+i.stack}}var ft=Object.prototype.hasOwnProperty,Ce=n.unstable_scheduleCallback,Je=n.unstable_cancelCallback,St=n.unstable_shouldYield,pt=n.unstable_requestPaint,Xe=n.unstable_now,vn=n.unstable_getCurrentPriorityLevel,zn=n.unstable_ImmediatePriority,Tt=n.unstable_UserBlockingPriority,tn=n.unstable_NormalPriority,is=n.unstable_LowPriority,gn=n.unstable_IdlePriority,Sn=n.log,ms=n.unstable_setDisableYieldValue,Et=null,Pt=null;function En(e){if(typeof Sn=="function"&&ms(e),Pt&&typeof Pt.setStrictMode=="function")try{Pt.setStrictMode(Et,e)}catch{}}var Wt=Math.clz32?Math.clz32:ke,ts=Math.log,de=Math.LN2;function ke(e){return e>>>=0,e===0?32:31-(ts(e)/de|0)|0}var Ke=256,it=262144,Be=4194304;function nt(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 J(e,t,s){var i=e.pendingLanes;if(i===0)return 0;var u=0,f=e.suspendedLanes,_=e.pingedLanes;e=e.warmLanes;var N=i&134217727;return N!==0?(i=N&~f,i!==0?u=nt(i):(_&=N,_!==0?u=nt(_):s||(s=N&~e,s!==0&&(u=nt(s))))):(N=i&~f,N!==0?u=nt(N):_!==0?u=nt(_):s||(s=i&~e,s!==0&&(u=nt(s)))),u===0?0:t!==0&&t!==u&&(t&f)===0&&(f=u&-u,s=t&-t,f>=s||f===32&&(s&4194048)!==0)?t:u}function ge(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function De(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 qe(){var e=Be;return Be<<=1,(Be&62914560)===0&&(Be=4194304),e}function Yt(e){for(var t=[],s=0;31>s;s++)t.push(e);return t}function Tn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Is(e,t,s,i,u,f){var _=e.pendingLanes;e.pendingLanes=s,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=s,e.entangledLanes&=s,e.errorRecoveryDisabledLanes&=s,e.shellSuspendCounter=0;var N=e.entanglements,O=e.expirationTimes,ne=e.hiddenUpdates;for(s=_&~s;0<s;){var he=31-Wt(s),xe=1<<he;N[he]=0,O[he]=-1;var le=ne[he];if(le!==null)for(ne[he]=null,he=0;he<le.length;he++){var oe=le[he];oe!==null&&(oe.lane&=-536870913)}s&=~xe}i!==0&&Dl(e,i,0),f!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=f&~(_&~t))}function Dl(e,t,s){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-Wt(t);e.entangledLanes|=t,e.entanglements[i]=e.entanglements[i]|1073741824|s&261930}function Zl(e,t){var s=e.entangledLanes|=t;for(e=e.entanglements;s;){var i=31-Wt(s),u=1<<i;u&t|e[i]&t&&(e[i]|=t),s&=~u}}function Bs(e,t){var s=t&-t;return s=(s&42)!==0?1:Es(s),(s&(e.suspendedLanes|t))!==0?0:s}function Es(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 Cn(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function ll(){var e=U.p;return e!==0?e:(e=window.event,e===void 0?32:Ox(e.type))}function dn(e,t){var s=U.p;try{return U.p=e,t()}finally{U.p=s}}var Hs=Math.random().toString(36).slice(2),zt="__reactFiber$"+Hs,We="__reactProps$"+Hs,rs="__reactContainer$"+Hs,Ts="__reactEvents$"+Hs,Jl="__reactListeners$"+Hs,Pl="__reactHandles$"+Hs,Ol="__reactResources$"+Hs,An="__reactMarker$"+Hs;function al(e){delete e[zt],delete e[We],delete e[Ts],delete e[Jl],delete e[Pl]}function xl(e){var t=e[zt];if(t)return t;for(var s=e.parentNode;s;){if(t=s[rs]||s[zt]){if(s=t.alternate,t.child!==null||s!==null&&s.child!==null)for(e=bx(e);e!==null;){if(s=e[zt])return s;e=bx(e)}return t}e=s,s=e.parentNode}return null}function il(e){if(e=e[zt]||e[rs]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ll(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function Mn(e){var t=e[Ol];return t||(t=e[Ol]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Ut(e){e[An]=!0}var Fn=new Set,Un={};function Cs(e,t){cs(e,t),cs(e+"Capture",t)}function cs(e,t){for(Un[e]=t,e=0;e<t.length;e++)Fn.add(t[e])}var As=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),bl={},In={};function $s(e){return ft.call(In,e)?!0:ft.call(bl,e)?!1:As.test(e)?In[e]=!0:(bl[e]=!0,!1)}function ns(e,t,s){if($s(t))if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var i=t.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+s)}}function vt(e,t,s){if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+s)}}function xn(e,t,s,i){if(i===null)e.removeAttribute(s);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(s);return}e.setAttributeNS(t,s,""+i)}}function at(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Wl(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Rn(e,t,s){var i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var u=i.get,f=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(_){s=""+_,f.call(this,_)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return s},setValue:function(_){s=""+_},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function qs(e){if(!e._valueTracker){var t=Wl(e)?"checked":"value";e._valueTracker=Rn(e,t,""+e[t])}}function Zn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),i="";return e&&(i=Wl(e)?e.checked?"true":"false":e.value),e=i,e!==s?(t.setValue(e),!0):!1}function _l(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Bn=/[\n"\\]/g;function Dn(e){return e.replace(Bn,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Gs(e,t,s,i,u,f,_,N){e.name="",_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?e.type=_:e.removeAttribute("type"),t!=null?_==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+at(t)):e.value!==""+at(t)&&(e.value=""+at(t)):_!=="submit"&&_!=="reset"||e.removeAttribute("value"),t!=null?gs(e,_,at(t)):s!=null?gs(e,_,at(s)):i!=null&&e.removeAttribute("value"),u==null&&f!=null&&(e.defaultChecked=!!f),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?e.name=""+at(N):e.removeAttribute("name")}function bn(e,t,s,i,u,f,_,N){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.type=f),t!=null||s!=null){if(!(f!=="submit"&&f!=="reset"||t!=null)){qs(e);return}s=s!=null?""+at(s):"",t=t!=null?""+at(t):s,N||t===e.value||(e.value=t),e.defaultValue=t}i=i??u,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=N?e.checked:!!i,e.defaultChecked=!!i,_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(e.name=_),qs(e)}function gs(e,t,s){t==="number"&&_l(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function xt(e,t,s,i){if(e=e.options,t){t={};for(var u=0;u<s.length;u++)t["$"+s[u]]=!0;for(s=0;s<e.length;s++)u=t.hasOwnProperty("$"+e[s].value),e[s].selected!==u&&(e[s].selected=u),u&&i&&(e[s].defaultSelected=!0)}else{for(s=""+at(s),t=null,u=0;u<e.length;u++){if(e[u].value===s){e[u].selected=!0,i&&(e[u].defaultSelected=!0);return}t!==null||e[u].disabled||(t=e[u])}t!==null&&(t.selected=!0)}}function je(e,t,s){if(t!=null&&(t=""+at(t),t!==e.value&&(e.value=t),s==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=s!=null?""+at(s):""}function T(e,t,s,i){if(t==null){if(i!=null){if(s!=null)throw Error(c(92));if(X(i)){if(1<i.length)throw Error(c(93));i=i[0]}s=i}s==null&&(s=""),t=s}s=at(t),e.defaultValue=s,i=e.textContent,i===s&&i!==""&&i!==null&&(e.value=i),qs(e)}function P(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=t;return}}e.textContent=t}var ye=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 Le(e,t,s){var i=t.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?i?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":i?e.setProperty(t,s):typeof s!="number"||s===0||ye.has(t)?t==="float"?e.cssFloat=s:e[t]=(""+s).trim():e[t]=s+"px"}function Ge(e,t,s){if(t!=null&&typeof t!="object")throw Error(c(62));if(e=e.style,s!=null){for(var i in s)!s.hasOwnProperty(i)||t!=null&&t.hasOwnProperty(i)||(i.indexOf("--")===0?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="");for(var u in t)i=t[u],t.hasOwnProperty(u)&&s[u]!==i&&Le(e,u,i)}else for(var f in t)t.hasOwnProperty(f)&&Le(e,f,t[f])}function He(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ct=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),bt=/^[\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 jn(e){return bt.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function At(){}var Nn=null;function _n(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ms=null,yl=null;function os(e){var t=il(e);if(t&&(e=t.stateNode)){var s=e[We]||null;e:switch(e=t.stateNode,t.type){case"input":if(Gs(e,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),t=s.name,s.type==="radio"&&t!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+Dn(""+t)+'"][type="radio"]'),t=0;t<s.length;t++){var i=s[t];if(i!==e&&i.form===e.form){var u=i[We]||null;if(!u)throw Error(c(90));Gs(i,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(t=0;t<s.length;t++)i=s[t],i.form===e.form&&Zn(i)}break e;case"textarea":je(e,s.value,s.defaultValue);break e;case"select":t=s.value,t!=null&&xt(e,!!s.multiple,t,!1)}}}var Xt=!1;function Da(e,t,s){if(Xt)return e(t,s);Xt=!0;try{var i=e(t);return i}finally{if(Xt=!1,(Ms!==null||yl!==null)&&(xd(),Ms&&(t=Ms,e=yl,yl=Ms=null,os(t),e)))for(t=0;t<e.length;t++)os(e[t])}}function fn(e,t){var s=e.stateNode;if(s===null)return null;var i=s[We]||null;if(i===null)return null;s=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(c(231,t,typeof s));return s}var Ys=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ur=!1;if(Ys)try{var ea={};Object.defineProperty(ea,"passive",{get:function(){ur=!0}}),window.addEventListener("test",ea,ea),window.removeEventListener("test",ea,ea)}catch{ur=!1}var rl=null,dr=null,Oa=null;function ta(){if(Oa)return Oa;var e,t=dr,s=t.length,i,u="value"in rl?rl.value:rl.textContent,f=u.length;for(e=0;e<s&&t[e]===u[e];e++);var _=s-e;for(i=1;i<=_&&t[s-i]===u[f-i];i++);return Oa=u.slice(e,1<i?1-i:void 0)}function mi(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 cl(){return!0}function fr(){return!1}function w(e){function t(s,i,u,f,_){this._reactName=s,this._targetInst=u,this.type=i,this.nativeEvent=f,this.target=_,this.currentTarget=null;for(var N in e)e.hasOwnProperty(N)&&(s=e[N],this[N]=s?s(f):f[N]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?cl:fr,this.isPropagationStopped=fr,this}return j(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=cl)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=cl)},persist:function(){},isPersistent:cl}),t}var W={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ve=w(W),Re=j({},W,{view:0,detail:0}),jt=w(Re),Hn,nn,On,xs=j({},Re,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ia,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!==On&&(On&&e.type==="mousemove"?(Hn=e.screenX-On.screenX,nn=e.screenY-On.screenY):nn=Hn=0,On=e),Hn)},movementY:function(e){return"movementY"in e?e.movementY:nn}}),hr=w(xs),La=j({},xs,{dataTransfer:0}),Af=w(La),na=j({},Re,{relatedTarget:0}),za=w(na),ec=j({},W,{animationName:0,elapsedTime:0,pseudoElement:0}),pr=w(ec),tc=j({},W,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Mf=w(tc),yo=j({},W,{data:0}),mr=w(yo),Ru={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},nc={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"},Du={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ua(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Du[e])?!!t[e]:!1}function Ia(){return Ua}var Rf=j({},Re,{key:function(e){if(e.key){var t=Ru[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=mi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?nc[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ia,charCode:function(e){return e.type==="keypress"?mi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?mi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),vo=w(Rf),sc=j({},xs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),lc=w(sc),Ou=j({},Re,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ia}),ac=w(Ou),gi=j({},W,{propertyName:0,elapsedTime:0,pseudoElement:0}),jo=w(gi),ic=j({},xs,{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}),gr=w(ic),Df=j({},W,{newState:0,oldState:0}),rc=w(Df),Of=[9,13,27,32],xi=Ys&&"CompositionEvent"in window,sa=null;Ys&&"documentMode"in document&&(sa=document.documentMode);var No=Ys&&"TextEvent"in window&&!sa,bi=Ys&&(!xi||sa&&8<sa&&11>=sa),la=" ",xr=!1;function cc(e,t){switch(e){case"keyup":return Of.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Lu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Xs=!1;function oc(e,t){switch(e){case"compositionend":return Lu(t);case"keypress":return t.which!==32?null:(xr=!0,la);case"textInput":return e=t.data,e===la&&xr?null:e;default:return null}}function zu(e,t){if(Xs)return e==="compositionend"||!xi&&cc(e,t)?(e=ta(),Oa=dr=rl=null,Xs=!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 bi&&t.locale!=="ko"?null:t.data;default:return null}}var uc={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 wo(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!uc[e.type]:t==="textarea"}function br(e,t,s,i){Ms?yl?yl.push(i):yl=[i]:Ms=i,t=wd(t,"onChange"),0<t.length&&(s=new ve("onChange","change",null,s,i),e.push({event:s,listeners:t}))}var Rs=null,aa=null;function _r(e){lx(e,0)}function vl(e){var t=Ll(e);if(Zn(t))return e}function _i(e,t){if(e==="change")return t}var sn=!1;if(Ys){var yr;if(Ys){var ko="oninput"in document;if(!ko){var Uu=document.createElement("div");Uu.setAttribute("oninput","return;"),ko=typeof Uu.oninput=="function"}yr=ko}else yr=!1;sn=yr&&(!document.documentMode||9<document.documentMode)}function dc(){Rs&&(Rs.detachEvent("onpropertychange",vr),aa=Rs=null)}function vr(e){if(e.propertyName==="value"&&vl(aa)){var t=[];br(t,aa,e,_n(e)),Da(_r,t)}}function $n(e,t,s){e==="focusin"?(dc(),Rs=t,aa=s,Rs.attachEvent("onpropertychange",vr)):e==="focusout"&&dc()}function jr(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return vl(aa)}function Nr(e,t){if(e==="click")return vl(t)}function ia(e,t){if(e==="input"||e==="change")return vl(t)}function Iu(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Nt=typeof Object.is=="function"?Object.is:Iu;function yi(e,t){if(Nt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var s=Object.keys(e),i=Object.keys(t);if(s.length!==i.length)return!1;for(i=0;i<s.length;i++){var u=s[i];if(!ft.call(t,u)||!Nt(e[u],t[u]))return!1}return!0}function So(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function jl(e,t){var s=So(e);e=0;for(var i;s;){if(s.nodeType===3){if(i=e+s.textContent.length,e<=t&&i>=t)return{node:s,offset:t-e};e=i}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=So(s)}}function Eo(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Eo(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function wr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=_l(e.document);t instanceof e.HTMLIFrameElement;){try{var s=typeof t.contentWindow.location.href=="string"}catch{s=!1}if(s)e=t.contentWindow;else break;t=_l(e.document)}return t}function vi(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 kr=Ys&&"documentMode"in document&&11>=document.documentMode,Vs=null,fc=null,zl=null,ji=!1;function Ni(e,t,s){var i=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;ji||Vs==null||Vs!==_l(i)||(i=Vs,"selectionStart"in i&&vi(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}),zl&&yi(zl,i)||(zl=i,i=wd(fc,"onSelect"),0<i.length&&(t=new ve("onSelect","select",null,t,s),e.push({event:t,listeners:i}),t.target=Vs)))}function ol(e,t){var s={};return s[e.toLowerCase()]=t.toLowerCase(),s["Webkit"+e]="webkit"+t,s["Moz"+e]="moz"+t,s}var Ba={animationend:ol("Animation","AnimationEnd"),animationiteration:ol("Animation","AnimationIteration"),animationstart:ol("Animation","AnimationStart"),transitionrun:ol("Transition","TransitionRun"),transitionstart:ol("Transition","TransitionStart"),transitioncancel:ol("Transition","TransitionCancel"),transitionend:ol("Transition","TransitionEnd")},Ha={},Bu={};Ys&&(Bu=document.createElement("div").style,"AnimationEvent"in window||(delete Ba.animationend.animation,delete Ba.animationiteration.animation,delete Ba.animationstart.animation),"TransitionEvent"in window||delete Ba.transitionend.transition);function se(e){if(Ha[e])return Ha[e];if(!Ba[e])return e;var t=Ba[e],s;for(s in t)if(t.hasOwnProperty(s)&&s in Bu)return Ha[e]=t[s];return e}var $a=se("animationend"),hc=se("animationiteration"),Hu=se("animationstart"),Lf=se("transitionrun"),Z=se("transitionstart"),Ul=se("transitioncancel"),Qs=se("transitionend"),To=new Map,wi="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(" ");wi.push("scrollEnd");function Ks(e,t){To.set(e,t),Cs(t,[e])}var pc=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)},hn=[],ki=0,mc=0;function gc(){for(var e=ki,t=mc=ki=0;t<e;){var s=hn[t];hn[t++]=null;var i=hn[t];hn[t++]=null;var u=hn[t];hn[t++]=null;var f=hn[t];if(hn[t++]=null,i!==null&&u!==null){var _=i.pending;_===null?u.next=u:(u.next=_.next,_.next=u),i.pending=u}f!==0&&$u(s,u,f)}}function Il(e,t,s,i){hn[ki++]=e,hn[ki++]=t,hn[ki++]=s,hn[ki++]=i,mc|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function xc(e,t,s,i){return Il(e,t,s,i),bc(e)}function qa(e,t){return Il(e,null,null,t),bc(e)}function $u(e,t,s){e.lanes|=s;var i=e.alternate;i!==null&&(i.lanes|=s);for(var u=!1,f=e.return;f!==null;)f.childLanes|=s,i=f.alternate,i!==null&&(i.childLanes|=s),f.tag===22&&(e=f.stateNode,e===null||e._visibility&1||(u=!0)),e=f,f=f.return;return e.tag===3?(f=e.stateNode,u&&t!==null&&(u=31-Wt(s),e=f.hiddenUpdates,i=e[u],i===null?e[u]=[t]:i.push(t),t.lane=s|536870912),f):null}function bc(e){if(50<eu)throw eu=0,_h=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Si={};function Ei(e,t,s,i){this.tag=e,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ds(e,t,s,i){return new Ei(e,t,s,i)}function Co(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Nl(e,t){var s=e.alternate;return s===null?(s=Ds(e.tag,t,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=t,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&65011712,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,t=e.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s.refCleanup=e.refCleanup,s}function qu(e,t){e.flags&=65011714;var s=e.alternate;return s===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=s.childLanes,e.lanes=s.lanes,e.child=s.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=s.memoizedProps,e.memoizedState=s.memoizedState,e.updateQueue=s.updateQueue,e.type=s.type,t=s.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function _c(e,t,s,i,u,f){var _=0;if(i=e,typeof e=="function")Co(e)&&(_=1);else if(typeof e=="string")_=Y0(e,s,Se.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case K:return e=Ds(31,s,t,u),e.elementType=K,e.lanes=f,e;case A:return Ga(s.children,u,f,t);case C:_=8,u|=24;break;case V:return e=Ds(12,s,t,u|2),e.elementType=V,e.lanes=f,e;case G:return e=Ds(13,s,t,u),e.elementType=G,e.lanes=f,e;case M:return e=Ds(19,s,t,u),e.elementType=M,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case $:_=10;break e;case Q:_=9;break e;case I:_=11;break e;case z:_=14;break e;case R:_=16,i=null;break e}_=29,s=Error(c(130,e===null?"null":typeof e,"")),i=null}return t=Ds(_,s,t,u),t.elementType=e,t.type=i,t.lanes=f,t}function Ga(e,t,s,i){return e=Ds(7,e,i,t),e.lanes=s,e}function Ao(e,t,s){return e=Ds(6,e,null,t),e.lanes=s,e}function Gu(e){var t=Ds(18,null,null,0);return t.stateNode=e,t}function Mo(e,t,s){return t=Ds(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Yu=new WeakMap;function bs(e,t){if(typeof e=="object"&&e!==null){var s=Yu.get(e);return s!==void 0?s:(t={value:e,source:t,stack:ct(t)},Yu.set(e,t),t)}return{value:e,source:t,stack:ct(t)}}var Ti=[],Ci=0,Ai=null,Sr=0,Fs=[],_s=0,ra=null,ul=1,Zs="";function wl(e,t){Ti[Ci++]=Sr,Ti[Ci++]=Ai,Ai=e,Sr=t}function yc(e,t,s){Fs[_s++]=ul,Fs[_s++]=Zs,Fs[_s++]=ra,ra=e;var i=ul;e=Zs;var u=32-Wt(i)-1;i&=~(1<<u),s+=1;var f=32-Wt(t)+u;if(30<f){var _=u-u%5;f=(i&(1<<_)-1).toString(32),i>>=_,u-=_,ul=1<<32-Wt(t)+u|s<<u|i,Zs=f+e}else ul=1<<f|s<<u|i,Zs=e}function vc(e){e.return!==null&&(wl(e,1),yc(e,1,0))}function jc(e){for(;e===Ai;)Ai=Ti[--Ci],Ti[Ci]=null,Sr=Ti[--Ci],Ti[Ci]=null;for(;e===ra;)ra=Fs[--_s],Fs[_s]=null,Zs=Fs[--_s],Fs[_s]=null,ul=Fs[--_s],Fs[_s]=null}function Ro(e,t){Fs[_s++]=ul,Fs[_s++]=Zs,Fs[_s++]=ra,ul=t.id,Zs=t.overflow,ra=e}var Jn=null,Vt=null,ht=!1,ca=null,Os=!1,Er=Error(c(519));function oa(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Bl(bs(t,e)),Er}function Nc(e){var t=e.stateNode,s=e.type,i=e.memoizedProps;switch(t[zt]=e,t[We]=i,s){case"dialog":gt("cancel",t),gt("close",t);break;case"iframe":case"object":case"embed":gt("load",t);break;case"video":case"audio":for(s=0;s<nu.length;s++)gt(nu[s],t);break;case"source":gt("error",t);break;case"img":case"image":case"link":gt("error",t),gt("load",t);break;case"details":gt("toggle",t);break;case"input":gt("invalid",t),bn(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":gt("invalid",t);break;case"textarea":gt("invalid",t),T(t,i.value,i.defaultValue,i.children)}s=i.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||t.textContent===""+s||i.suppressHydrationWarning===!0||cx(t.textContent,s)?(i.popover!=null&&(gt("beforetoggle",t),gt("toggle",t)),i.onScroll!=null&>("scroll",t),i.onScrollEnd!=null&>("scrollend",t),i.onClick!=null&&(t.onclick=At),t=!0):t=!1,t||oa(e,!0)}function Xu(e){for(Jn=e.return;Jn;)switch(Jn.tag){case 5:case 31:case 13:Os=!1;return;case 27:case 3:Os=!0;return;default:Jn=Jn.return}}function Mi(e){if(e!==Jn)return!1;if(!ht)return Xu(e),ht=!0,!1;var t=e.tag,s;if((s=t!==3&&t!==27)&&((s=t===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||Oh(e.type,e.memoizedProps)),s=!s),s&&Vt&&oa(e),Xu(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));Vt=xx(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));Vt=xx(e)}else t===27?(t=Vt,Qi(e.type)?(e=Bh,Bh=null,Vt=e):Vt=t):Vt=Jn?El(e.stateNode.nextSibling):null;return!0}function Ya(){Vt=Jn=null,ht=!1}function Do(){var e=ca;return e!==null&&(tl===null?tl=e:tl.push.apply(tl,e),ca=null),e}function Bl(e){ca===null?ca=[e]:ca.push(e)}var wc=E(null),Xa=null,kl=null;function ua(e,t,s){me(wc,t._currentValue),t._currentValue=s}function Hl(e){e._currentValue=wc.current,ee(wc)}function Oo(e,t,s){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===s)break;e=e.return}}function Lo(e,t,s,i){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var f=u.dependencies;if(f!==null){var _=u.child;f=f.firstContext;e:for(;f!==null;){var N=f;f=u;for(var O=0;O<t.length;O++)if(N.context===t[O]){f.lanes|=s,N=f.alternate,N!==null&&(N.lanes|=s),Oo(f.return,s,e),i||(_=null);break e}f=N.next}}else if(u.tag===18){if(_=u.return,_===null)throw Error(c(341));_.lanes|=s,f=_.alternate,f!==null&&(f.lanes|=s),Oo(_,s,e),_=null}else _=u.child;if(_!==null)_.return=u;else for(_=u;_!==null;){if(_===e){_=null;break}if(u=_.sibling,u!==null){u.return=_.return,_=u;break}_=_.return}u=_}}function Ri(e,t,s,i){e=null;for(var u=t,f=!1;u!==null;){if(!f){if((u.flags&524288)!==0)f=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var _=u.alternate;if(_===null)throw Error(c(387));if(_=_.memoizedProps,_!==null){var N=u.type;Nt(u.pendingProps.value,_.value)||(e!==null?e.push(N):e=[N])}}else if(u===ie.current){if(_=u.alternate,_===null)throw Error(c(387));_.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(ru):e=[ru])}u=u.return}e!==null&&Lo(t,e,s,i),t.flags|=262144}function kc(e){for(e=e.firstContext;e!==null;){if(!Nt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Va(e){Xa=e,kl=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Pn(e){return Vu(Xa,e)}function Sc(e,t){return Xa===null&&Va(e),Vu(e,t)}function Vu(e,t){var s=t._currentValue;if(t={context:t,memoizedValue:s,next:null},kl===null){if(e===null)throw Error(c(308));kl=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else kl=kl.next=t;return s}var zf=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(s,i){e.push(i)}};this.abort=function(){t.aborted=!0,e.forEach(function(s){return s()})}},Uf=n.unstable_scheduleCallback,Qu=n.unstable_NormalPriority,wn={$$typeof:$,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function zo(){return{controller:new zf,data:new Map,refCount:0}}function Tr(e){e.refCount--,e.refCount===0&&Uf(Qu,function(){e.controller.abort()})}var Cr=null,Ar=0,da=0,$l=null;function If(e,t){if(Cr===null){var s=Cr=[];Ar=0,da=kh(),$l={status:"pending",value:void 0,then:function(i){s.push(i)}}}return Ar++,t.then(Ku,Ku),t}function Ku(){if(--Ar===0&&Cr!==null){$l!==null&&($l.status="fulfilled");var e=Cr;Cr=null,da=0,$l=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Bf(e,t){var s=[],i={status:"pending",value:null,reason:null,then:function(u){s.push(u)}};return e.then(function(){i.status="fulfilled",i.value=t;for(var u=0;u<s.length;u++)(0,s[u])(t)},function(u){for(i.status="rejected",i.reason=u,u=0;u<s.length;u++)(0,s[u])(void 0)}),i}var Fu=D.S;D.S=function(e,t){Rg=Xe(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&If(e,t),Fu!==null&&Fu(e,t)};var Qa=E(null);function Uo(){var e=Qa.current;return e!==null?e:Jt.pooledCache}function Ec(e,t){t===null?me(Qa,Qa.current):me(Qa,t.pool)}function Zu(){var e=Uo();return e===null?null:{parent:wn._currentValue,pool:e}}var Di=Error(c(460)),Io=Error(c(474)),Tc=Error(c(542)),Cc={then:function(){}};function Ju(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Pu(e,t,s){switch(s=e[s],s===void 0?e.push(t):s!==t&&(t.then(At,At),t=s),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Bo(e),e;default:if(typeof t.status=="string")t.then(At,At);else{if(e=Jt,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,Bo(e),e}throw Fa=t,Di}}function Ka(e){try{var t=e._init;return t(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Fa=s,Di):s}}var Fa=null;function Wu(){if(Fa===null)throw Error(c(459));var e=Fa;return Fa=null,e}function Bo(e){if(e===Di||e===Tc)throw Error(c(483))}var Za=null,fa=0;function ys(e){var t=fa;return fa+=1,Za===null&&(Za=[]),Pu(Za,e,t)}function us(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Ht(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 Ac(e){function t(F,B){if(e){var te=F.deletions;te===null?(F.deletions=[B],F.flags|=16):te.push(B)}}function s(F,B){if(!e)return null;for(;B!==null;)t(F,B),B=B.sibling;return null}function i(F){for(var B=new Map;F!==null;)F.key!==null?B.set(F.key,F):B.set(F.index,F),F=F.sibling;return B}function u(F,B){return F=Nl(F,B),F.index=0,F.sibling=null,F}function f(F,B,te){return F.index=te,e?(te=F.alternate,te!==null?(te=te.index,te<B?(F.flags|=67108866,B):te):(F.flags|=67108866,B)):(F.flags|=1048576,B)}function _(F){return e&&F.alternate===null&&(F.flags|=67108866),F}function N(F,B,te,pe){return B===null||B.tag!==6?(B=Ao(te,F.mode,pe),B.return=F,B):(B=u(B,te),B.return=F,B)}function O(F,B,te,pe){var Ve=te.type;return Ve===A?he(F,B,te.props.children,pe,te.key):B!==null&&(B.elementType===Ve||typeof Ve=="object"&&Ve!==null&&Ve.$$typeof===R&&Ka(Ve)===B.type)?(B=u(B,te.props),us(B,te),B.return=F,B):(B=_c(te.type,te.key,te.props,null,F.mode,pe),us(B,te),B.return=F,B)}function ne(F,B,te,pe){return B===null||B.tag!==4||B.stateNode.containerInfo!==te.containerInfo||B.stateNode.implementation!==te.implementation?(B=Mo(te,F.mode,pe),B.return=F,B):(B=u(B,te.children||[]),B.return=F,B)}function he(F,B,te,pe,Ve){return B===null||B.tag!==7?(B=Ga(te,F.mode,pe,Ve),B.return=F,B):(B=u(B,te),B.return=F,B)}function xe(F,B,te){if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return B=Ao(""+B,F.mode,te),B.return=F,B;if(typeof B=="object"&&B!==null){switch(B.$$typeof){case S:return te=_c(B.type,B.key,B.props,null,F.mode,te),us(te,B),te.return=F,te;case k:return B=Mo(B,F.mode,te),B.return=F,B;case R:return B=Ka(B),xe(F,B,te)}if(X(B)||H(B))return B=Ga(B,F.mode,te,null),B.return=F,B;if(typeof B.then=="function")return xe(F,ys(B),te);if(B.$$typeof===$)return xe(F,Sc(F,B),te);Ht(F,B)}return null}function le(F,B,te,pe){var Ve=B!==null?B.key:null;if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return Ve!==null?null:N(F,B,""+te,pe);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case S:return te.key===Ve?O(F,B,te,pe):null;case k:return te.key===Ve?ne(F,B,te,pe):null;case R:return te=Ka(te),le(F,B,te,pe)}if(X(te)||H(te))return Ve!==null?null:he(F,B,te,pe,null);if(typeof te.then=="function")return le(F,B,ys(te),pe);if(te.$$typeof===$)return le(F,B,Sc(F,te),pe);Ht(F,te)}return null}function oe(F,B,te,pe,Ve){if(typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint")return F=F.get(te)||null,N(B,F,""+pe,Ve);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case S:return F=F.get(pe.key===null?te:pe.key)||null,O(B,F,pe,Ve);case k:return F=F.get(pe.key===null?te:pe.key)||null,ne(B,F,pe,Ve);case R:return pe=Ka(pe),oe(F,B,te,pe,Ve)}if(X(pe)||H(pe))return F=F.get(te)||null,he(B,F,pe,Ve,null);if(typeof pe.then=="function")return oe(F,B,te,ys(pe),Ve);if(pe.$$typeof===$)return oe(F,B,te,Sc(B,pe),Ve);Ht(B,pe)}return null}function Ue(F,B,te,pe){for(var Ve=null,Mt=null,$e=B,ut=B=0,yt=null;$e!==null&&ut<te.length;ut++){$e.index>ut?(yt=$e,$e=null):yt=$e.sibling;var Rt=le(F,$e,te[ut],pe);if(Rt===null){$e===null&&($e=yt);break}e&&$e&&Rt.alternate===null&&t(F,$e),B=f(Rt,B,ut),Mt===null?Ve=Rt:Mt.sibling=Rt,Mt=Rt,$e=yt}if(ut===te.length)return s(F,$e),ht&&wl(F,ut),Ve;if($e===null){for(;ut<te.length;ut++)$e=xe(F,te[ut],pe),$e!==null&&(B=f($e,B,ut),Mt===null?Ve=$e:Mt.sibling=$e,Mt=$e);return ht&&wl(F,ut),Ve}for($e=i($e);ut<te.length;ut++)yt=oe($e,F,ut,te[ut],pe),yt!==null&&(e&&yt.alternate!==null&&$e.delete(yt.key===null?ut:yt.key),B=f(yt,B,ut),Mt===null?Ve=yt:Mt.sibling=yt,Mt=yt);return e&&$e.forEach(function(Pi){return t(F,Pi)}),ht&&wl(F,ut),Ve}function Fe(F,B,te,pe){if(te==null)throw Error(c(151));for(var Ve=null,Mt=null,$e=B,ut=B=0,yt=null,Rt=te.next();$e!==null&&!Rt.done;ut++,Rt=te.next()){$e.index>ut?(yt=$e,$e=null):yt=$e.sibling;var Pi=le(F,$e,Rt.value,pe);if(Pi===null){$e===null&&($e=yt);break}e&&$e&&Pi.alternate===null&&t(F,$e),B=f(Pi,B,ut),Mt===null?Ve=Pi:Mt.sibling=Pi,Mt=Pi,$e=yt}if(Rt.done)return s(F,$e),ht&&wl(F,ut),Ve;if($e===null){for(;!Rt.done;ut++,Rt=te.next())Rt=xe(F,Rt.value,pe),Rt!==null&&(B=f(Rt,B,ut),Mt===null?Ve=Rt:Mt.sibling=Rt,Mt=Rt);return ht&&wl(F,ut),Ve}for($e=i($e);!Rt.done;ut++,Rt=te.next())Rt=oe($e,F,ut,Rt.value,pe),Rt!==null&&(e&&Rt.alternate!==null&&$e.delete(Rt.key===null?ut:Rt.key),B=f(Rt,B,ut),Mt===null?Ve=Rt:Mt.sibling=Rt,Mt=Rt);return e&&$e.forEach(function(tv){return t(F,tv)}),ht&&wl(F,ut),Ve}function Kt(F,B,te,pe){if(typeof te=="object"&&te!==null&&te.type===A&&te.key===null&&(te=te.props.children),typeof te=="object"&&te!==null){switch(te.$$typeof){case S:e:{for(var Ve=te.key;B!==null;){if(B.key===Ve){if(Ve=te.type,Ve===A){if(B.tag===7){s(F,B.sibling),pe=u(B,te.props.children),pe.return=F,F=pe;break e}}else if(B.elementType===Ve||typeof Ve=="object"&&Ve!==null&&Ve.$$typeof===R&&Ka(Ve)===B.type){s(F,B.sibling),pe=u(B,te.props),us(pe,te),pe.return=F,F=pe;break e}s(F,B);break}else t(F,B);B=B.sibling}te.type===A?(pe=Ga(te.props.children,F.mode,pe,te.key),pe.return=F,F=pe):(pe=_c(te.type,te.key,te.props,null,F.mode,pe),us(pe,te),pe.return=F,F=pe)}return _(F);case k:e:{for(Ve=te.key;B!==null;){if(B.key===Ve)if(B.tag===4&&B.stateNode.containerInfo===te.containerInfo&&B.stateNode.implementation===te.implementation){s(F,B.sibling),pe=u(B,te.children||[]),pe.return=F,F=pe;break e}else{s(F,B);break}else t(F,B);B=B.sibling}pe=Mo(te,F.mode,pe),pe.return=F,F=pe}return _(F);case R:return te=Ka(te),Kt(F,B,te,pe)}if(X(te))return Ue(F,B,te,pe);if(H(te)){if(Ve=H(te),typeof Ve!="function")throw Error(c(150));return te=Ve.call(te),Fe(F,B,te,pe)}if(typeof te.then=="function")return Kt(F,B,ys(te),pe);if(te.$$typeof===$)return Kt(F,B,Sc(F,te),pe);Ht(F,te)}return typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint"?(te=""+te,B!==null&&B.tag===6?(s(F,B.sibling),pe=u(B,te),pe.return=F,F=pe):(s(F,B),pe=Ao(te,F.mode,pe),pe.return=F,F=pe),_(F)):s(F,B)}return function(F,B,te,pe){try{fa=0;var Ve=Kt(F,B,te,pe);return Za=null,Ve}catch($e){if($e===Di||$e===Tc)throw $e;var Mt=Ds(29,$e,null,F.mode);return Mt.lanes=pe,Mt.return=F,Mt}finally{}}}var Ja=Ac(!0),ed=Ac(!1),dl=!1;function Mc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Oi(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 Sl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ql(e,t,s){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(Ot&2)!==0){var u=i.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),i.pending=t,t=bc(e),$u(e,null,s),t}return Il(e,i,t,s),bc(e)}function ha(e,t,s){if(t=t.updateQueue,t!==null&&(t=t.shared,(s&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,s|=i,t.lanes=s,Zl(e,s)}}function Rc(e,t){var s=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,s===i)){var u=null,f=null;if(s=s.firstBaseUpdate,s!==null){do{var _={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};f===null?u=f=_:f=f.next=_,s=s.next}while(s!==null);f===null?u=f=t:f=f.next=t}else u=f=t;s={baseState:i.baseState,firstBaseUpdate:u,lastBaseUpdate:f,shared:i.shared,callbacks:i.callbacks},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=t:e.next=t,s.lastBaseUpdate=t}var Ho=!1;function Gl(){if(Ho){var e=$l;if(e!==null)throw e}}function Li(e,t,s,i){Ho=!1;var u=e.updateQueue;dl=!1;var f=u.firstBaseUpdate,_=u.lastBaseUpdate,N=u.shared.pending;if(N!==null){u.shared.pending=null;var O=N,ne=O.next;O.next=null,_===null?f=ne:_.next=ne,_=O;var he=e.alternate;he!==null&&(he=he.updateQueue,N=he.lastBaseUpdate,N!==_&&(N===null?he.firstBaseUpdate=ne:N.next=ne,he.lastBaseUpdate=O))}if(f!==null){var xe=u.baseState;_=0,he=ne=O=null,N=f;do{var le=N.lane&-536870913,oe=le!==N.lane;if(oe?(_t&le)===le:(i&le)===le){le!==0&&le===da&&(Ho=!0),he!==null&&(he=he.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var Ue=e,Fe=N;le=t;var Kt=s;switch(Fe.tag){case 1:if(Ue=Fe.payload,typeof Ue=="function"){xe=Ue.call(Kt,xe,le);break e}xe=Ue;break e;case 3:Ue.flags=Ue.flags&-65537|128;case 0:if(Ue=Fe.payload,le=typeof Ue=="function"?Ue.call(Kt,xe,le):Ue,le==null)break e;xe=j({},xe,le);break e;case 2:dl=!0}}le=N.callback,le!==null&&(e.flags|=64,oe&&(e.flags|=8192),oe=u.callbacks,oe===null?u.callbacks=[le]:oe.push(le))}else oe={lane:le,tag:N.tag,payload:N.payload,callback:N.callback,next:null},he===null?(ne=he=oe,O=xe):he=he.next=oe,_|=le;if(N=N.next,N===null){if(N=u.shared.pending,N===null)break;oe=N,N=oe.next,oe.next=null,u.lastBaseUpdate=oe,u.shared.pending=null}}while(!0);he===null&&(O=xe),u.baseState=O,u.firstBaseUpdate=ne,u.lastBaseUpdate=he,f===null&&(u.shared.lanes=0),qi|=_,e.lanes=_,e.memoizedState=xe}}function td(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function Dc(e,t){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)td(s[e],t)}var zi=E(null),pa=E(0);function Pa(e,t){e=ii,me(pa,e),me(zi,t),ii=e|t.baseLanes}function $o(){me(pa,ii),me(zi,zi.current)}function Oc(){ii=pa.current,ee(zi),ee(pa)}var vs=E(null),Js=null;function ma(e){var t=e.alternate;me(Dt,Dt.current&1),me(vs,e),Js===null&&(t===null||zi.current!==null||t.memoizedState!==null)&&(Js=e)}function Lc(e){me(Dt,Dt.current),me(vs,e),Js===null&&(Js=e)}function qo(e){e.tag===22?(me(Dt,Dt.current),me(vs,e),Js===null&&(Js=e)):ga()}function ga(){me(Dt,Dt.current),me(vs,vs.current)}function Ls(e){ee(vs),Js===e&&(Js=null),ee(Dt)}var Dt=E(0);function zc(e){for(var t=e;t!==null;){if(t.tag===13){var s=t.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||Uh(s)||Ih(s)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var qn=0,et=null,It=null,pn=null,Mr=!1,Ui=!1,js=!1,Ii=0,Rr=0,Wa=null,nd=0;function p(){throw Error(c(321))}function L(e,t){if(t===null)return!1;for(var s=0;s<t.length&&s<e.length;s++)if(!Nt(e[s],t[s]))return!1;return!0}function re(e,t,s,i,u,f){return qn=f,et=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,D.H=e===null||e.memoizedState===null?Gm:Kf,js=!1,f=s(i,u),js=!1,Ui&&(f=rt(t,s,i,u)),Te(e),f}function Te(e){D.H=Xo;var t=It!==null&&It.next!==null;if(qn=0,pn=It=et=null,Mr=!1,Rr=0,Wa=null,t)throw Error(c(300));e===null||Xn||(e=e.dependencies,e!==null&&kc(e)&&(Xn=!0))}function rt(e,t,s,i){et=e;var u=0;do{if(Ui&&(Wa=null),Rr=0,Ui=!1,25<=u)throw Error(c(301));if(u+=1,pn=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)}D.H=Ym,f=t(s,i)}while(Ui);return f}function ln(){var e=D.H,t=e.useState()[0];return t=typeof t.then=="function"?_e(t):t,e=e.useState()[0],(It!==null?It.memoizedState:null)!==e&&(et.flags|=1024),t}function Ln(){var e=Ii!==0;return Ii=0,e}function fl(e,t,s){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s}function Bi(e){if(Mr){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Mr=!1}qn=0,pn=It=et=null,Ui=!1,Rr=Ii=0,Wa=null}function Gn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return pn===null?et.memoizedState=pn=e:pn=pn.next=e,pn}function en(){if(It===null){var e=et.alternate;e=e!==null?e.memoizedState:null}else e=It.next;var t=pn===null?et.memoizedState:pn.next;if(t!==null)pn=t,It=e;else{if(e===null)throw et.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},pn===null?et.memoizedState=pn=e:pn=pn.next=e}return pn}function xa(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function _e(e){var t=Rr;return Rr+=1,Wa===null&&(Wa=[]),e=Pu(Wa,e,t),t=et,(pn===null?t.memoizedState:pn.next)===null&&(t=t.alternate,D.H=t===null||t.memoizedState===null?Gm:Kf),e}function Ee(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return _e(e);if(e.$$typeof===$)return Pn(e)}throw Error(c(438,String(e)))}function Me(e){var t=null,s=et.updateQueue;if(s!==null&&(t=s.memoCache),t==null){var i=et.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(t={data:i.data.map(function(u){return u.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),s===null&&(s=xa(),et.updateQueue=s),s.memoCache=t,s=t.data[t.index],s===void 0)for(s=t.data[t.index]=Array(e),i=0;i<e;i++)s[i]=ae;return t.index++,s}function Ye(e,t){return typeof t=="function"?t(e):t}function ot(e){var t=en();return Yn(t,It,e)}function Yn(e,t,s){var i=e.queue;if(i===null)throw Error(c(311));i.lastRenderedReducer=s;var u=e.baseQueue,f=i.pending;if(f!==null){if(u!==null){var _=u.next;u.next=f.next,f.next=_}t.baseQueue=u=f,i.pending=null}if(f=e.baseState,u===null)e.memoizedState=f;else{t=u.next;var N=_=null,O=null,ne=t,he=!1;do{var xe=ne.lane&-536870913;if(xe!==ne.lane?(_t&xe)===xe:(qn&xe)===xe){var le=ne.revertLane;if(le===0)O!==null&&(O=O.next={lane:0,revertLane:0,gesture:null,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null}),xe===da&&(he=!0);else if((qn&le)===le){ne=ne.next,le===da&&(he=!0);continue}else xe={lane:0,revertLane:ne.revertLane,gesture:null,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},O===null?(N=O=xe,_=f):O=O.next=xe,et.lanes|=le,qi|=le;xe=ne.action,js&&s(f,xe),f=ne.hasEagerState?ne.eagerState:s(f,xe)}else le={lane:xe,revertLane:ne.revertLane,gesture:ne.gesture,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},O===null?(N=O=le,_=f):O=O.next=le,et.lanes|=xe,qi|=xe;ne=ne.next}while(ne!==null&&ne!==t);if(O===null?_=f:O.next=N,!Nt(f,e.memoizedState)&&(Xn=!0,he&&(s=$l,s!==null)))throw s;e.memoizedState=f,e.baseState=_,e.baseQueue=O,i.lastRenderedState=f}return u===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function Go(e){var t=en(),s=t.queue;if(s===null)throw Error(c(311));s.lastRenderedReducer=e;var i=s.dispatch,u=s.pending,f=t.memoizedState;if(u!==null){s.pending=null;var _=u=u.next;do f=e(f,_.action),_=_.next;while(_!==u);Nt(f,t.memoizedState)||(Xn=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),s.lastRenderedState=f}return[f,i]}function om(e,t,s){var i=et,u=en(),f=ht;if(f){if(s===void 0)throw Error(c(407));s=s()}else s=t();var _=!Nt((It||u).memoizedState,s);if(_&&(u.memoizedState=s,Xn=!0),u=u.queue,qf(fm.bind(null,i,u,e),[e]),u.getSnapshot!==t||_||pn!==null&&pn.memoizedState.tag&1){if(i.flags|=2048,Uc(9,{destroy:void 0},dm.bind(null,i,u,s,t),null),Jt===null)throw Error(c(349));f||(qn&127)!==0||um(i,t,s)}return s}function um(e,t,s){e.flags|=16384,e={getSnapshot:t,value:s},t=et.updateQueue,t===null?(t=xa(),et.updateQueue=t,t.stores=[e]):(s=t.stores,s===null?t.stores=[e]:s.push(e))}function dm(e,t,s,i){t.value=s,t.getSnapshot=i,hm(t)&&pm(e)}function fm(e,t,s){return s(function(){hm(t)&&pm(e)})}function hm(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!Nt(e,s)}catch{return!0}}function pm(e){var t=qa(e,2);t!==null&&nl(t,e,2)}function Hf(e){var t=Gn();if(typeof e=="function"){var s=e;if(e=s(),js){En(!0);try{s()}finally{En(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ye,lastRenderedState:e},t}function mm(e,t,s,i){return e.baseState=s,Yn(e,It,typeof i=="function"?i:Ye)}function Qy(e,t,s,i,u){if(ad(e))throw Error(c(485));if(e=t.action,e!==null){var f={payload:u,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(_){f.listeners.push(_)}};D.T!==null?s(!0):f.isTransition=!1,i(f),s=t.pending,s===null?(f.next=t.pending=f,gm(t,f)):(f.next=s.next,t.pending=s.next=f)}}function gm(e,t){var s=t.action,i=t.payload,u=e.state;if(t.isTransition){var f=D.T,_={};D.T=_;try{var N=s(u,i),O=D.S;O!==null&&O(_,N),xm(e,t,N)}catch(ne){$f(e,t,ne)}finally{f!==null&&_.types!==null&&(f.types=_.types),D.T=f}}else try{f=s(u,i),xm(e,t,f)}catch(ne){$f(e,t,ne)}}function xm(e,t,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(i){bm(e,t,i)},function(i){return $f(e,t,i)}):bm(e,t,s)}function bm(e,t,s){t.status="fulfilled",t.value=s,_m(t),e.state=s,t=e.pending,t!==null&&(s=t.next,s===t?e.pending=null:(s=s.next,t.next=s,gm(e,s)))}function $f(e,t,s){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do t.status="rejected",t.reason=s,_m(t),t=t.next;while(t!==i)}e.action=null}function _m(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ym(e,t){return t}function vm(e,t){if(ht){var s=Jt.formState;if(s!==null){e:{var i=et;if(ht){if(Vt){t:{for(var u=Vt,f=Os;u.nodeType!==8;){if(!f){u=null;break t}if(u=El(u.nextSibling),u===null){u=null;break t}}f=u.data,u=f==="F!"||f==="F"?u:null}if(u){Vt=El(u.nextSibling),i=u.data==="F!";break e}}oa(i)}i=!1}i&&(t=s[0])}}return s=Gn(),s.memoizedState=s.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ym,lastRenderedState:t},s.queue=i,s=Hm.bind(null,et,i),i.dispatch=s,i=Hf(!1),f=Qf.bind(null,et,!1,i.queue),i=Gn(),u={state:t,dispatch:null,action:e,pending:null},i.queue=u,s=Qy.bind(null,et,u,f,s),u.dispatch=s,i.memoizedState=e,[t,s,!1]}function jm(e){var t=en();return Nm(t,It,e)}function Nm(e,t,s){if(t=Yn(e,t,ym)[0],e=ot(Ye)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var i=_e(t)}catch(_){throw _===Di?Tc:_}else i=t;t=en();var u=t.queue,f=u.dispatch;return s!==t.memoizedState&&(et.flags|=2048,Uc(9,{destroy:void 0},Ky.bind(null,u,s),null)),[i,f,e]}function Ky(e,t){e.action=t}function wm(e){var t=en(),s=It;if(s!==null)return Nm(t,s,e);en(),t=t.memoizedState,s=en();var i=s.queue.dispatch;return s.memoizedState=e,[t,i,!1]}function Uc(e,t,s,i){return e={tag:e,create:s,deps:i,inst:t,next:null},t=et.updateQueue,t===null&&(t=xa(),et.updateQueue=t),s=t.lastEffect,s===null?t.lastEffect=e.next=e:(i=s.next,s.next=e,e.next=i,t.lastEffect=e),e}function km(){return en().memoizedState}function sd(e,t,s,i){var u=Gn();et.flags|=e,u.memoizedState=Uc(1|t,{destroy:void 0},s,i===void 0?null:i)}function ld(e,t,s,i){var u=en();i=i===void 0?null:i;var f=u.memoizedState.inst;It!==null&&i!==null&&L(i,It.memoizedState.deps)?u.memoizedState=Uc(t,f,s,i):(et.flags|=e,u.memoizedState=Uc(1|t,f,s,i))}function Sm(e,t){sd(8390656,8,e,t)}function qf(e,t){ld(2048,8,e,t)}function Fy(e){et.flags|=4;var t=et.updateQueue;if(t===null)t=xa(),et.updateQueue=t,t.events=[e];else{var s=t.events;s===null?t.events=[e]:s.push(e)}}function Em(e){var t=en().memoizedState;return Fy({ref:t,nextImpl:e}),function(){if((Ot&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function Tm(e,t){return ld(4,2,e,t)}function Cm(e,t){return ld(4,4,e,t)}function Am(e,t){if(typeof t=="function"){e=e();var s=t(e);return function(){typeof s=="function"?s():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Mm(e,t,s){s=s!=null?s.concat([e]):null,ld(4,4,Am.bind(null,t,e),s)}function Gf(){}function Rm(e,t){var s=en();t=t===void 0?null:t;var i=s.memoizedState;return t!==null&&L(t,i[1])?i[0]:(s.memoizedState=[e,t],e)}function Dm(e,t){var s=en();t=t===void 0?null:t;var i=s.memoizedState;if(t!==null&&L(t,i[1]))return i[0];if(i=e(),js){En(!0);try{e()}finally{En(!1)}}return s.memoizedState=[i,t],i}function Yf(e,t,s){return s===void 0||(qn&1073741824)!==0&&(_t&261930)===0?e.memoizedState=t:(e.memoizedState=s,e=Og(),et.lanes|=e,qi|=e,s)}function Om(e,t,s,i){return Nt(s,t)?s:zi.current!==null?(e=Yf(e,s,i),Nt(e,t)||(Xn=!0),e):(qn&42)===0||(qn&1073741824)!==0&&(_t&261930)===0?(Xn=!0,e.memoizedState=s):(e=Og(),et.lanes|=e,qi|=e,t)}function Lm(e,t,s,i,u){var f=U.p;U.p=f!==0&&8>f?f:8;var _=D.T,N={};D.T=N,Qf(e,!1,t,s);try{var O=u(),ne=D.S;if(ne!==null&&ne(N,O),O!==null&&typeof O=="object"&&typeof O.then=="function"){var he=Bf(O,i);Yo(e,t,he,ml(e))}else Yo(e,t,i,ml(e))}catch(xe){Yo(e,t,{then:function(){},status:"rejected",reason:xe},ml())}finally{U.p=f,_!==null&&N.types!==null&&(_.types=N.types),D.T=_}}function Zy(){}function Xf(e,t,s,i){if(e.tag!==5)throw Error(c(476));var u=zm(e).queue;Lm(e,u,t,ce,s===null?Zy:function(){return Um(e),s(i)})}function zm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ce,baseState:ce,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ye,lastRenderedState:ce},next:null};var s={};return t.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ye,lastRenderedState:s},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Um(e){var t=zm(e);t.next===null&&(t=e.alternate.memoizedState),Yo(e,t.next.queue,{},ml())}function Vf(){return Pn(ru)}function Im(){return en().memoizedState}function Bm(){return en().memoizedState}function Jy(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var s=ml();e=Sl(s);var i=ql(t,e,s);i!==null&&(nl(i,t,s),ha(i,t,s)),t={cache:zo()},e.payload=t;return}t=t.return}}function Py(e,t,s){var i=ml();s={lane:i,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},ad(e)?$m(t,s):(s=xc(e,t,s,i),s!==null&&(nl(s,e,i),qm(s,t,i)))}function Hm(e,t,s){var i=ml();Yo(e,t,s,i)}function Yo(e,t,s,i){var u={lane:i,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(ad(e))$m(t,u);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var _=t.lastRenderedState,N=f(_,s);if(u.hasEagerState=!0,u.eagerState=N,Nt(N,_))return Il(e,t,u,0),Jt===null&&gc(),!1}catch{}finally{}if(s=xc(e,t,u,i),s!==null)return nl(s,e,i),qm(s,t,i),!0}return!1}function Qf(e,t,s,i){if(i={lane:2,revertLane:kh(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},ad(e)){if(t)throw Error(c(479))}else t=xc(e,s,i,2),t!==null&&nl(t,e,2)}function ad(e){var t=e.alternate;return e===et||t!==null&&t===et}function $m(e,t){Ui=Mr=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function qm(e,t,s){if((s&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,s|=i,t.lanes=s,Zl(e,s)}}var Xo={readContext:Pn,use:Ee,useCallback:p,useContext:p,useEffect:p,useImperativeHandle:p,useLayoutEffect:p,useInsertionEffect:p,useMemo:p,useReducer:p,useRef:p,useState:p,useDebugValue:p,useDeferredValue:p,useTransition:p,useSyncExternalStore:p,useId:p,useHostTransitionStatus:p,useFormState:p,useActionState:p,useOptimistic:p,useMemoCache:p,useCacheRefresh:p};Xo.useEffectEvent=p;var Gm={readContext:Pn,use:Ee,useCallback:function(e,t){return Gn().memoizedState=[e,t===void 0?null:t],e},useContext:Pn,useEffect:Sm,useImperativeHandle:function(e,t,s){s=s!=null?s.concat([e]):null,sd(4194308,4,Am.bind(null,t,e),s)},useLayoutEffect:function(e,t){return sd(4194308,4,e,t)},useInsertionEffect:function(e,t){sd(4,2,e,t)},useMemo:function(e,t){var s=Gn();t=t===void 0?null:t;var i=e();if(js){En(!0);try{e()}finally{En(!1)}}return s.memoizedState=[i,t],i},useReducer:function(e,t,s){var i=Gn();if(s!==void 0){var u=s(t);if(js){En(!0);try{s(t)}finally{En(!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,et,e),[i.memoizedState,e]},useRef:function(e){var t=Gn();return e={current:e},t.memoizedState=e},useState:function(e){e=Hf(e);var t=e.queue,s=Hm.bind(null,et,t);return t.dispatch=s,[e.memoizedState,s]},useDebugValue:Gf,useDeferredValue:function(e,t){var s=Gn();return Yf(s,e,t)},useTransition:function(){var e=Hf(!1);return e=Lm.bind(null,et,e.queue,!0,!1),Gn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,s){var i=et,u=Gn();if(ht){if(s===void 0)throw Error(c(407));s=s()}else{if(s=t(),Jt===null)throw Error(c(349));(_t&127)!==0||um(i,t,s)}u.memoizedState=s;var f={value:s,getSnapshot:t};return u.queue=f,Sm(fm.bind(null,i,f,e),[e]),i.flags|=2048,Uc(9,{destroy:void 0},dm.bind(null,i,f,s,t),null),s},useId:function(){var e=Gn(),t=Jt.identifierPrefix;if(ht){var s=Zs,i=ul;s=(i&~(1<<32-Wt(i)-1)).toString(32)+s,t="_"+t+"R_"+s,s=Ii++,0<s&&(t+="H"+s.toString(32)),t+="_"}else s=nd++,t="_"+t+"r_"+s.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Vf,useFormState:vm,useActionState:vm,useOptimistic:function(e){var t=Gn();t.memoizedState=t.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=s,t=Qf.bind(null,et,!0,s),s.dispatch=t,[e,t]},useMemoCache:Me,useCacheRefresh:function(){return Gn().memoizedState=Jy.bind(null,et)},useEffectEvent:function(e){var t=Gn(),s={impl:e};return t.memoizedState=s,function(){if((Ot&2)!==0)throw Error(c(440));return s.impl.apply(void 0,arguments)}}},Kf={readContext:Pn,use:Ee,useCallback:Rm,useContext:Pn,useEffect:qf,useImperativeHandle:Mm,useInsertionEffect:Tm,useLayoutEffect:Cm,useMemo:Dm,useReducer:ot,useRef:km,useState:function(){return ot(Ye)},useDebugValue:Gf,useDeferredValue:function(e,t){var s=en();return Om(s,It.memoizedState,e,t)},useTransition:function(){var e=ot(Ye)[0],t=en().memoizedState;return[typeof e=="boolean"?e:_e(e),t]},useSyncExternalStore:om,useId:Im,useHostTransitionStatus:Vf,useFormState:jm,useActionState:jm,useOptimistic:function(e,t){var s=en();return mm(s,It,e,t)},useMemoCache:Me,useCacheRefresh:Bm};Kf.useEffectEvent=Em;var Ym={readContext:Pn,use:Ee,useCallback:Rm,useContext:Pn,useEffect:qf,useImperativeHandle:Mm,useInsertionEffect:Tm,useLayoutEffect:Cm,useMemo:Dm,useReducer:Go,useRef:km,useState:function(){return Go(Ye)},useDebugValue:Gf,useDeferredValue:function(e,t){var s=en();return It===null?Yf(s,e,t):Om(s,It.memoizedState,e,t)},useTransition:function(){var e=Go(Ye)[0],t=en().memoizedState;return[typeof e=="boolean"?e:_e(e),t]},useSyncExternalStore:om,useId:Im,useHostTransitionStatus:Vf,useFormState:wm,useActionState:wm,useOptimistic:function(e,t){var s=en();return It!==null?mm(s,It,e,t):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:Me,useCacheRefresh:Bm};Ym.useEffectEvent=Em;function Ff(e,t,s,i){t=e.memoizedState,s=s(i,t),s=s==null?t:j({},t,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var Zf={enqueueSetState:function(e,t,s){e=e._reactInternals;var i=ml(),u=Sl(i);u.payload=t,s!=null&&(u.callback=s),t=ql(e,u,i),t!==null&&(nl(t,e,i),ha(t,e,i))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var i=ml(),u=Sl(i);u.tag=1,u.payload=t,s!=null&&(u.callback=s),t=ql(e,u,i),t!==null&&(nl(t,e,i),ha(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=ml(),i=Sl(s);i.tag=2,t!=null&&(i.callback=t),t=ql(e,i,s),t!==null&&(nl(t,e,s),ha(t,e,s))}};function Xm(e,t,s,i,u,f,_){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,f,_):t.prototype&&t.prototype.isPureReactComponent?!yi(s,i)||!yi(u,f):!0}function Vm(e,t,s,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(s,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(s,i),t.state!==e&&Zf.enqueueReplaceState(t,t.state,null)}function Dr(e,t){var s=t;if("ref"in t){s={};for(var i in t)i!=="ref"&&(s[i]=t[i])}if(e=e.defaultProps){s===t&&(s=j({},s));for(var u in e)s[u]===void 0&&(s[u]=e[u])}return s}function Qm(e){pc(e)}function Km(e){console.error(e)}function Fm(e){pc(e)}function id(e,t){try{var s=e.onUncaughtError;s(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function Zm(e,t,s){try{var i=e.onCaughtError;i(s.value,{componentStack:s.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function Jf(e,t,s){return s=Sl(s),s.tag=3,s.payload={element:null},s.callback=function(){id(e,t)},s}function Jm(e){return e=Sl(e),e.tag=3,e}function Pm(e,t,s,i){var u=s.type.getDerivedStateFromError;if(typeof u=="function"){var f=i.value;e.payload=function(){return u(f)},e.callback=function(){Zm(t,s,i)}}var _=s.stateNode;_!==null&&typeof _.componentDidCatch=="function"&&(e.callback=function(){Zm(t,s,i),typeof u!="function"&&(Gi===null?Gi=new Set([this]):Gi.add(this));var N=i.stack;this.componentDidCatch(i.value,{componentStack:N!==null?N:""})})}function Wy(e,t,s,i,u){if(s.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=s.alternate,t!==null&&Ri(t,s,u,!0),s=vs.current,s!==null){switch(s.tag){case 31:case 13:return Js===null?bd():s.alternate===null&&kn===0&&(kn=3),s.flags&=-257,s.flags|=65536,s.lanes=u,i===Cc?s.flags|=16384:(t=s.updateQueue,t===null?s.updateQueue=new Set([i]):t.add(i),jh(e,i,u)),!1;case 22:return s.flags|=65536,i===Cc?s.flags|=16384:(t=s.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},s.updateQueue=t):(s=t.retryQueue,s===null?t.retryQueue=new Set([i]):s.add(i)),jh(e,i,u)),!1}throw Error(c(435,s.tag))}return jh(e,i,u),bd(),!1}if(ht)return t=vs.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,i!==Er&&(e=Error(c(422),{cause:i}),Bl(bs(e,s)))):(i!==Er&&(t=Error(c(423),{cause:i}),Bl(bs(t,s))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,i=bs(i,s),u=Jf(e.stateNode,i,u),Rc(e,u),kn!==4&&(kn=2)),!1;var f=Error(c(520),{cause:i});if(f=bs(f,s),Wo===null?Wo=[f]:Wo.push(f),kn!==4&&(kn=2),t===null)return!0;i=bs(i,s),s=t;do{switch(s.tag){case 3:return s.flags|=65536,e=u&-u,s.lanes|=e,e=Jf(s.stateNode,i,e),Rc(s,e),!1;case 1:if(t=s.type,f=s.stateNode,(s.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(Gi===null||!Gi.has(f))))return s.flags|=65536,u&=-u,s.lanes|=u,u=Jm(u),Pm(u,e,s,i),Rc(s,u),!1}s=s.return}while(s!==null);return!1}var Pf=Error(c(461)),Xn=!1;function ds(e,t,s,i){t.child=e===null?ed(t,null,s,i):Ja(t,e.child,s,i)}function Wm(e,t,s,i,u){s=s.render;var f=t.ref;if("ref"in i){var _={};for(var N in i)N!=="ref"&&(_[N]=i[N])}else _=i;return Va(t),i=re(e,t,s,_,f,u),N=Ln(),e!==null&&!Xn?(fl(e,t,u),ei(e,t,u)):(ht&&N&&vc(t),t.flags|=1,ds(e,t,i,u),t.child)}function eg(e,t,s,i,u){if(e===null){var f=s.type;return typeof f=="function"&&!Co(f)&&f.defaultProps===void 0&&s.compare===null?(t.tag=15,t.type=f,tg(e,t,f,i,u)):(e=_c(s.type,null,i,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!ih(e,u)){var _=f.memoizedProps;if(s=s.compare,s=s!==null?s:yi,s(_,i)&&e.ref===t.ref)return ei(e,t,u)}return t.flags|=1,e=Nl(f,i),e.ref=t.ref,e.return=t,t.child=e}function tg(e,t,s,i,u){if(e!==null){var f=e.memoizedProps;if(yi(f,i)&&e.ref===t.ref)if(Xn=!1,t.pendingProps=i=f,ih(e,u))(e.flags&131072)!==0&&(Xn=!0);else return t.lanes=e.lanes,ei(e,t,u)}return Wf(e,t,s,i,u)}function ng(e,t,s,i){var u=i.children,f=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((t.flags&128)!==0){if(f=f!==null?f.baseLanes|s:s,e!==null){for(i=t.child=e.child,u=0;i!==null;)u=u|i.lanes|i.childLanes,i=i.sibling;i=u&~f}else i=0,t.child=null;return sg(e,t,f,s,i)}if((s&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ec(t,f!==null?f.cachePool:null),f!==null?Pa(t,f):$o(),qo(t);else return i=t.lanes=536870912,sg(e,t,f!==null?f.baseLanes|s:s,s,i)}else f!==null?(Ec(t,f.cachePool),Pa(t,f),ga(),t.memoizedState=null):(e!==null&&Ec(t,null),$o(),ga());return ds(e,t,u,s),t.child}function Vo(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function sg(e,t,s,i,u){var f=Uo();return f=f===null?null:{parent:wn._currentValue,pool:f},t.memoizedState={baseLanes:s,cachePool:f},e!==null&&Ec(t,null),$o(),qo(t),e!==null&&Ri(e,t,i,!0),t.childLanes=u,null}function rd(e,t){return t=od({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function lg(e,t,s){return Ja(t,e.child,null,s),e=rd(t,t.pendingProps),e.flags|=2,Ls(t),t.memoizedState=null,e}function e0(e,t,s){var i=t.pendingProps,u=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(ht){if(i.mode==="hidden")return e=rd(t,i),t.lanes=536870912,Vo(null,e);if(Lc(t),(e=Vt)?(e=gx(e,Os),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ra!==null?{id:ul,overflow:Zs}:null,retryLane:536870912,hydrationErrors:null},s=Gu(e),s.return=t,t.child=s,Jn=t,Vt=null)):e=null,e===null)throw oa(t);return t.lanes=536870912,null}return rd(t,i)}var f=e.memoizedState;if(f!==null){var _=f.dehydrated;if(Lc(t),u)if(t.flags&256)t.flags&=-257,t=lg(e,t,s);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(c(558));else if(Xn||Ri(e,t,s,!1),u=(s&e.childLanes)!==0,Xn||u){if(i=Jt,i!==null&&(_=Bs(i,s),_!==0&&_!==f.retryLane))throw f.retryLane=_,qa(e,_),nl(i,e,_),Pf;bd(),t=lg(e,t,s)}else e=f.treeContext,Vt=El(_.nextSibling),Jn=t,ht=!0,ca=null,Os=!1,e!==null&&Ro(t,e),t=rd(t,i),t.flags|=4096;return t}return e=Nl(e.child,{mode:i.mode,children:i.children}),e.ref=t.ref,t.child=e,e.return=t,e}function cd(e,t){var s=t.ref;if(s===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(c(284));(e===null||e.ref!==s)&&(t.flags|=4194816)}}function Wf(e,t,s,i,u){return Va(t),s=re(e,t,s,i,void 0,u),i=Ln(),e!==null&&!Xn?(fl(e,t,u),ei(e,t,u)):(ht&&i&&vc(t),t.flags|=1,ds(e,t,s,u),t.child)}function ag(e,t,s,i,u,f){return Va(t),t.updateQueue=null,s=rt(t,i,s,u),Te(e),i=Ln(),e!==null&&!Xn?(fl(e,t,f),ei(e,t,f)):(ht&&i&&vc(t),t.flags|=1,ds(e,t,s,f),t.child)}function ig(e,t,s,i,u){if(Va(t),t.stateNode===null){var f=Si,_=s.contextType;typeof _=="object"&&_!==null&&(f=Pn(_)),f=new s(i,f),t.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=Zf,t.stateNode=f,f._reactInternals=t,f=t.stateNode,f.props=i,f.state=t.memoizedState,f.refs={},Mc(t),_=s.contextType,f.context=typeof _=="object"&&_!==null?Pn(_):Si,f.state=t.memoizedState,_=s.getDerivedStateFromProps,typeof _=="function"&&(Ff(t,s,_,i),f.state=t.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(_=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),_!==f.state&&Zf.enqueueReplaceState(f,f.state,null),Li(t,i,f,u),Gl(),f.state=t.memoizedState),typeof f.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){f=t.stateNode;var N=t.memoizedProps,O=Dr(s,N);f.props=O;var ne=f.context,he=s.contextType;_=Si,typeof he=="object"&&he!==null&&(_=Pn(he));var xe=s.getDerivedStateFromProps;he=typeof xe=="function"||typeof f.getSnapshotBeforeUpdate=="function",N=t.pendingProps!==N,he||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(N||ne!==_)&&Vm(t,f,i,_),dl=!1;var le=t.memoizedState;f.state=le,Li(t,i,f,u),Gl(),ne=t.memoizedState,N||le!==ne||dl?(typeof xe=="function"&&(Ff(t,s,xe,i),ne=t.memoizedState),(O=dl||Xm(t,s,O,i,le,ne,_))?(he||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=ne),f.props=i,f.state=ne,f.context=_,i=O):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{f=t.stateNode,Oi(e,t),_=t.memoizedProps,he=Dr(s,_),f.props=he,xe=t.pendingProps,le=f.context,ne=s.contextType,O=Si,typeof ne=="object"&&ne!==null&&(O=Pn(ne)),N=s.getDerivedStateFromProps,(ne=typeof N=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(_!==xe||le!==O)&&Vm(t,f,i,O),dl=!1,le=t.memoizedState,f.state=le,Li(t,i,f,u),Gl();var oe=t.memoizedState;_!==xe||le!==oe||dl||e!==null&&e.dependencies!==null&&kc(e.dependencies)?(typeof N=="function"&&(Ff(t,s,N,i),oe=t.memoizedState),(he=dl||Xm(t,s,he,i,le,oe,O)||e!==null&&e.dependencies!==null&&kc(e.dependencies))?(ne||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(i,oe,O),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(i,oe,O)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||_===e.memoizedProps&&le===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||_===e.memoizedProps&&le===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=oe),f.props=i,f.state=oe,f.context=O,i=he):(typeof f.componentDidUpdate!="function"||_===e.memoizedProps&&le===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||_===e.memoizedProps&&le===e.memoizedState||(t.flags|=1024),i=!1)}return f=i,cd(e,t),i=(t.flags&128)!==0,f||i?(f=t.stateNode,s=i&&typeof s.getDerivedStateFromError!="function"?null:f.render(),t.flags|=1,e!==null&&i?(t.child=Ja(t,e.child,null,u),t.child=Ja(t,null,s,u)):ds(e,t,s,u),t.memoizedState=f.state,e=t.child):e=ei(e,t,u),e}function rg(e,t,s,i){return Ya(),t.flags|=256,ds(e,t,s,i),t.child}var eh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function th(e){return{baseLanes:e,cachePool:Zu()}}function nh(e,t,s){return e=e!==null?e.childLanes&~s:0,t&&(e|=pl),e}function cg(e,t,s){var i=t.pendingProps,u=!1,f=(t.flags&128)!==0,_;if((_=f)||(_=e!==null&&e.memoizedState===null?!1:(Dt.current&2)!==0),_&&(u=!0,t.flags&=-129),_=(t.flags&32)!==0,t.flags&=-33,e===null){if(ht){if(u?ma(t):ga(),(e=Vt)?(e=gx(e,Os),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ra!==null?{id:ul,overflow:Zs}:null,retryLane:536870912,hydrationErrors:null},s=Gu(e),s.return=t,t.child=s,Jn=t,Vt=null)):e=null,e===null)throw oa(t);return Ih(e)?t.lanes=32:t.lanes=536870912,null}var N=i.children;return i=i.fallback,u?(ga(),u=t.mode,N=od({mode:"hidden",children:N},u),i=Ga(i,u,s,null),N.return=t,i.return=t,N.sibling=i,t.child=N,i=t.child,i.memoizedState=th(s),i.childLanes=nh(e,_,s),t.memoizedState=eh,Vo(null,i)):(ma(t),sh(t,N))}var O=e.memoizedState;if(O!==null&&(N=O.dehydrated,N!==null)){if(f)t.flags&256?(ma(t),t.flags&=-257,t=lh(e,t,s)):t.memoizedState!==null?(ga(),t.child=e.child,t.flags|=128,t=null):(ga(),N=i.fallback,u=t.mode,i=od({mode:"visible",children:i.children},u),N=Ga(N,u,s,null),N.flags|=2,i.return=t,N.return=t,i.sibling=N,t.child=i,Ja(t,e.child,null,s),i=t.child,i.memoizedState=th(s),i.childLanes=nh(e,_,s),t.memoizedState=eh,t=Vo(null,i));else if(ma(t),Ih(N)){if(_=N.nextSibling&&N.nextSibling.dataset,_)var ne=_.dgst;_=ne,i=Error(c(419)),i.stack="",i.digest=_,Bl({value:i,source:null,stack:null}),t=lh(e,t,s)}else if(Xn||Ri(e,t,s,!1),_=(s&e.childLanes)!==0,Xn||_){if(_=Jt,_!==null&&(i=Bs(_,s),i!==0&&i!==O.retryLane))throw O.retryLane=i,qa(e,i),nl(_,e,i),Pf;Uh(N)||bd(),t=lh(e,t,s)}else Uh(N)?(t.flags|=192,t.child=e.child,t=null):(e=O.treeContext,Vt=El(N.nextSibling),Jn=t,ht=!0,ca=null,Os=!1,e!==null&&Ro(t,e),t=sh(t,i.children),t.flags|=4096);return t}return u?(ga(),N=i.fallback,u=t.mode,O=e.child,ne=O.sibling,i=Nl(O,{mode:"hidden",children:i.children}),i.subtreeFlags=O.subtreeFlags&65011712,ne!==null?N=Nl(ne,N):(N=Ga(N,u,s,null),N.flags|=2),N.return=t,i.return=t,i.sibling=N,t.child=i,Vo(null,i),i=t.child,N=e.child.memoizedState,N===null?N=th(s):(u=N.cachePool,u!==null?(O=wn._currentValue,u=u.parent!==O?{parent:O,pool:O}:u):u=Zu(),N={baseLanes:N.baseLanes|s,cachePool:u}),i.memoizedState=N,i.childLanes=nh(e,_,s),t.memoizedState=eh,Vo(e.child,i)):(ma(t),s=e.child,e=s.sibling,s=Nl(s,{mode:"visible",children:i.children}),s.return=t,s.sibling=null,e!==null&&(_=t.deletions,_===null?(t.deletions=[e],t.flags|=16):_.push(e)),t.child=s,t.memoizedState=null,s)}function sh(e,t){return t=od({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function od(e,t){return e=Ds(22,e,null,t),e.lanes=0,e}function lh(e,t,s){return Ja(t,e.child,null,s),e=sh(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function og(e,t,s){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),Oo(e.return,t,s)}function ah(e,t,s,i,u,f){var _=e.memoizedState;_===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:s,tailMode:u,treeForkCount:f}:(_.isBackwards=t,_.rendering=null,_.renderingStartTime=0,_.last=i,_.tail=s,_.tailMode=u,_.treeForkCount=f)}function ug(e,t,s){var i=t.pendingProps,u=i.revealOrder,f=i.tail;i=i.children;var _=Dt.current,N=(_&2)!==0;if(N?(_=_&1|2,t.flags|=128):_&=1,me(Dt,_),ds(e,t,i,s),i=ht?Sr:0,!N&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&og(e,s,t);else if(e.tag===19)og(e,s,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(u){case"forwards":for(s=t.child,u=null;s!==null;)e=s.alternate,e!==null&&zc(e)===null&&(u=s),s=s.sibling;s=u,s===null?(u=t.child,t.child=null):(u=s.sibling,s.sibling=null),ah(t,!1,u,s,f,i);break;case"backwards":case"unstable_legacy-backwards":for(s=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&zc(e)===null){t.child=u;break}e=u.sibling,u.sibling=s,s=u,u=e}ah(t,!0,s,null,f,i);break;case"together":ah(t,!1,null,null,void 0,i);break;default:t.memoizedState=null}return t.child}function ei(e,t,s){if(e!==null&&(t.dependencies=e.dependencies),qi|=t.lanes,(s&t.childLanes)===0)if(e!==null){if(Ri(e,t,s,!1),(s&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(c(153));if(t.child!==null){for(e=t.child,s=Nl(e,e.pendingProps),t.child=s,s.return=t;e.sibling!==null;)e=e.sibling,s=s.sibling=Nl(e,e.pendingProps),s.return=t;s.sibling=null}return t.child}function ih(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&kc(e)))}function t0(e,t,s){switch(t.tag){case 3:Ie(t,t.stateNode.containerInfo),ua(t,wn,e.memoizedState.cache),Ya();break;case 27:case 5:Zt(t);break;case 4:Ie(t,t.stateNode.containerInfo);break;case 10:ua(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Lc(t),null;break;case 13:var i=t.memoizedState;if(i!==null)return i.dehydrated!==null?(ma(t),t.flags|=128,null):(s&t.child.childLanes)!==0?cg(e,t,s):(ma(t),e=ei(e,t,s),e!==null?e.sibling:null);ma(t);break;case 19:var u=(e.flags&128)!==0;if(i=(s&t.childLanes)!==0,i||(Ri(e,t,s,!1),i=(s&t.childLanes)!==0),u){if(i)return ug(e,t,s);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),me(Dt,Dt.current),i)break;return null;case 22:return t.lanes=0,ng(e,t,s,t.pendingProps);case 24:ua(t,wn,e.memoizedState.cache)}return ei(e,t,s)}function dg(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps)Xn=!0;else{if(!ih(e,s)&&(t.flags&128)===0)return Xn=!1,t0(e,t,s);Xn=(e.flags&131072)!==0}else Xn=!1,ht&&(t.flags&1048576)!==0&&yc(t,Sr,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=Ka(t.elementType),t.type=e,typeof e=="function")Co(e)?(i=Dr(e,i),t.tag=1,t=ig(null,t,e,i,s)):(t.tag=0,t=Wf(null,t,e,i,s));else{if(e!=null){var u=e.$$typeof;if(u===I){t.tag=11,t=Wm(null,t,e,i,s);break e}else if(u===z){t.tag=14,t=eg(null,t,e,i,s);break e}}throw t=ue(e)||e,Error(c(306,t,""))}}return t;case 0:return Wf(e,t,t.type,t.pendingProps,s);case 1:return i=t.type,u=Dr(i,t.pendingProps),ig(e,t,i,u,s);case 3:e:{if(Ie(t,t.stateNode.containerInfo),e===null)throw Error(c(387));i=t.pendingProps;var f=t.memoizedState;u=f.element,Oi(e,t),Li(t,i,null,s);var _=t.memoizedState;if(i=_.cache,ua(t,wn,i),i!==f.cache&&Lo(t,[wn],s,!0),Gl(),i=_.element,f.isDehydrated)if(f={element:i,isDehydrated:!1,cache:_.cache},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){t=rg(e,t,i,s);break e}else if(i!==u){u=bs(Error(c(424)),t),Bl(u),t=rg(e,t,i,s);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Vt=El(e.firstChild),Jn=t,ht=!0,ca=null,Os=!0,s=ed(t,null,i,s),t.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(Ya(),i===u){t=ei(e,t,s);break e}ds(e,t,i,s)}t=t.child}return t;case 26:return cd(e,t),e===null?(s=jx(t.type,null,t.pendingProps,null))?t.memoizedState=s:ht||(s=t.type,e=t.pendingProps,i=kd(we.current).createElement(s),i[zt]=t,i[We]=e,fs(i,s,e),Ut(i),t.stateNode=i):t.memoizedState=jx(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Zt(t),e===null&&ht&&(i=t.stateNode=_x(t.type,t.pendingProps,we.current),Jn=t,Os=!0,u=Vt,Qi(t.type)?(Bh=u,Vt=El(i.firstChild)):Vt=u),ds(e,t,t.pendingProps.children,s),cd(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ht&&((u=i=Vt)&&(i=M0(i,t.type,t.pendingProps,Os),i!==null?(t.stateNode=i,Jn=t,Vt=El(i.firstChild),Os=!1,u=!0):u=!1),u||oa(t)),Zt(t),u=t.type,f=t.pendingProps,_=e!==null?e.memoizedProps:null,i=f.children,Oh(u,f)?i=null:_!==null&&Oh(u,_)&&(t.flags|=32),t.memoizedState!==null&&(u=re(e,t,ln,null,null,s),ru._currentValue=u),cd(e,t),ds(e,t,i,s),t.child;case 6:return e===null&&ht&&((e=s=Vt)&&(s=R0(s,t.pendingProps,Os),s!==null?(t.stateNode=s,Jn=t,Vt=null,e=!0):e=!1),e||oa(t)),null;case 13:return cg(e,t,s);case 4:return Ie(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Ja(t,null,i,s):ds(e,t,i,s),t.child;case 11:return Wm(e,t,t.type,t.pendingProps,s);case 7:return ds(e,t,t.pendingProps,s),t.child;case 8:return ds(e,t,t.pendingProps.children,s),t.child;case 12:return ds(e,t,t.pendingProps.children,s),t.child;case 10:return i=t.pendingProps,ua(t,t.type,i.value),ds(e,t,i.children,s),t.child;case 9:return u=t.type._context,i=t.pendingProps.children,Va(t),u=Pn(u),i=i(u),t.flags|=1,ds(e,t,i,s),t.child;case 14:return eg(e,t,t.type,t.pendingProps,s);case 15:return tg(e,t,t.type,t.pendingProps,s);case 19:return ug(e,t,s);case 31:return e0(e,t,s);case 22:return ng(e,t,s,t.pendingProps);case 24:return Va(t),i=Pn(wn),e===null?(u=Uo(),u===null&&(u=Jt,f=zo(),u.pooledCache=f,f.refCount++,f!==null&&(u.pooledCacheLanes|=s),u=f),t.memoizedState={parent:i,cache:u},Mc(t),ua(t,wn,u)):((e.lanes&s)!==0&&(Oi(e,t),Li(t,null,null,s),Gl()),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),ua(t,wn,i)):(i=f.cache,ua(t,wn,i),i!==u.cache&&Lo(t,[wn],s,!0))),ds(e,t,t.pendingProps.children,s),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function ti(e){e.flags|=4}function rh(e,t,s,i,u){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(u&335544128)===u)if(e.stateNode.complete)e.flags|=8192;else if(Ig())e.flags|=8192;else throw Fa=Cc,Io}else e.flags&=-16777217}function fg(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Ex(t))if(Ig())e.flags|=8192;else throw Fa=Cc,Io}function ud(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?qe():536870912,e.lanes|=t,$c|=t)}function Qo(e,t){if(!ht)switch(e.tailMode){case"hidden":t=e.tail;for(var s=null;t!==null;)t.alternate!==null&&(s=t),t=t.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var i=null;s!==null;)s.alternate!==null&&(i=s),s=s.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function an(e){var t=e.alternate!==null&&e.alternate.child===e.child,s=0,i=0;if(t)for(var u=e.child;u!==null;)s|=u.lanes|u.childLanes,i|=u.subtreeFlags&65011712,i|=u.flags&65011712,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)s|=u.lanes|u.childLanes,i|=u.subtreeFlags,i|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=i,e.childLanes=s,t}function n0(e,t,s){var i=t.pendingProps;switch(jc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return an(t),null;case 1:return an(t),null;case 3:return s=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Hl(wn),ze(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(Mi(t)?ti(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Do())),an(t),null;case 26:var u=t.type,f=t.memoizedState;return e===null?(ti(t),f!==null?(an(t),fg(t,f)):(an(t),rh(t,u,null,i,s))):f?f!==e.memoizedState?(ti(t),an(t),fg(t,f)):(an(t),t.flags&=-16777217):(e=e.memoizedProps,e!==i&&ti(t),an(t),rh(t,u,e,i,s)),null;case 27:if(Qe(t),s=we.current,u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&ti(t);else{if(!i){if(t.stateNode===null)throw Error(c(166));return an(t),null}e=Se.current,Mi(t)?Nc(t):(e=_x(u,i,s),t.stateNode=e,ti(t))}return an(t),null;case 5:if(Qe(t),u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&ti(t);else{if(!i){if(t.stateNode===null)throw Error(c(166));return an(t),null}if(f=Se.current,Mi(t))Nc(t);else{var _=kd(we.current);switch(f){case 1:f=_.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:f=_.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":f=_.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":f=_.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":f=_.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof i.is=="string"?_.createElement("select",{is:i.is}):_.createElement("select"),i.multiple?f.multiple=!0:i.size&&(f.size=i.size);break;default:f=typeof i.is=="string"?_.createElement(u,{is:i.is}):_.createElement(u)}}f[zt]=t,f[We]=i;e:for(_=t.child;_!==null;){if(_.tag===5||_.tag===6)f.appendChild(_.stateNode);else if(_.tag!==4&&_.tag!==27&&_.child!==null){_.child.return=_,_=_.child;continue}if(_===t)break e;for(;_.sibling===null;){if(_.return===null||_.return===t)break e;_=_.return}_.sibling.return=_.return,_=_.sibling}t.stateNode=f;e:switch(fs(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&&ti(t)}}return an(t),rh(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,s),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&ti(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(c(166));if(e=we.current,Mi(t)){if(e=t.stateNode,s=t.memoizedProps,i=null,u=Jn,u!==null)switch(u.tag){case 27:case 5:i=u.memoizedProps}e[zt]=t,e=!!(e.nodeValue===s||i!==null&&i.suppressHydrationWarning===!0||cx(e.nodeValue,s)),e||oa(t,!0)}else e=kd(e).createTextNode(i),e[zt]=t,t.stateNode=e}return an(t),null;case 31:if(s=t.memoizedState,e===null||e.memoizedState!==null){if(i=Mi(t),s!==null){if(e===null){if(!i)throw Error(c(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(557));e[zt]=t}else Ya(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;an(t),e=!1}else s=Do(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return t.flags&256?(Ls(t),t):(Ls(t),null);if((t.flags&128)!==0)throw Error(c(558))}return an(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=Mi(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[zt]=t}else Ya(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;an(t),u=!1}else u=Do(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(Ls(t),t):(Ls(t),null)}return Ls(t),(t.flags&128)!==0?(t.lanes=s,t):(s=i!==null,e=e!==null&&e.memoizedState!==null,s&&(i=t.child,u=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(u=i.alternate.memoizedState.cachePool.pool),f=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(f=i.memoizedState.cachePool.pool),f!==u&&(i.flags|=2048)),s!==e&&s&&(t.child.flags|=8192),ud(t,t.updateQueue),an(t),null);case 4:return ze(),e===null&&Ch(t.stateNode.containerInfo),an(t),null;case 10:return Hl(t.type),an(t),null;case 19:if(ee(Dt),i=t.memoizedState,i===null)return an(t),null;if(u=(t.flags&128)!==0,f=i.rendering,f===null)if(u)Qo(i,!1);else{if(kn!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=zc(e),f!==null){for(t.flags|=128,Qo(i,!1),e=f.updateQueue,t.updateQueue=e,ud(t,e),t.subtreeFlags=0,e=s,s=t.child;s!==null;)qu(s,e),s=s.sibling;return me(Dt,Dt.current&1|2),ht&&wl(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&Xe()>md&&(t.flags|=128,u=!0,Qo(i,!1),t.lanes=4194304)}else{if(!u)if(e=zc(f),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,ud(t,e),Qo(i,!0),i.tail===null&&i.tailMode==="hidden"&&!f.alternate&&!ht)return an(t),null}else 2*Xe()-i.renderingStartTime>md&&s!==536870912&&(t.flags|=128,u=!0,Qo(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=Xe(),e.sibling=null,s=Dt.current,me(Dt,u?s&1|2:s&1),ht&&wl(t,i.treeForkCount),e):(an(t),null);case 22:case 23:return Ls(t),Oc(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?(s&536870912)!==0&&(t.flags&128)===0&&(an(t),t.subtreeFlags&6&&(t.flags|=8192)):an(t),s=t.updateQueue,s!==null&&ud(t,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==s&&(t.flags|=2048),e!==null&&ee(Qa),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),Hl(wn),an(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function s0(e,t){switch(jc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Hl(wn),ze(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Qe(t),null;case 31:if(t.memoizedState!==null){if(Ls(t),t.alternate===null)throw Error(c(340));Ya()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ls(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));Ya()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ee(Dt),null;case 4:return ze(),null;case 10:return Hl(t.type),null;case 22:case 23:return Ls(t),Oc(),e!==null&&ee(Qa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Hl(wn),null;case 25:return null;default:return null}}function hg(e,t){switch(jc(t),t.tag){case 3:Hl(wn),ze();break;case 26:case 27:case 5:Qe(t);break;case 4:ze();break;case 31:t.memoizedState!==null&&Ls(t);break;case 13:Ls(t);break;case 19:ee(Dt);break;case 10:Hl(t.type);break;case 22:case 23:Ls(t),Oc(),e!==null&&ee(Qa);break;case 24:Hl(wn)}}function Ko(e,t){try{var s=t.updateQueue,i=s!==null?s.lastEffect:null;if(i!==null){var u=i.next;s=u;do{if((s.tag&e)===e){i=void 0;var f=s.create,_=s.inst;i=f(),_.destroy=i}s=s.next}while(s!==u)}}catch(N){qt(t,t.return,N)}}function Hi(e,t,s){try{var i=t.updateQueue,u=i!==null?i.lastEffect:null;if(u!==null){var f=u.next;i=f;do{if((i.tag&e)===e){var _=i.inst,N=_.destroy;if(N!==void 0){_.destroy=void 0,u=t;var O=s,ne=N;try{ne()}catch(he){qt(u,O,he)}}}i=i.next}while(i!==f)}}catch(he){qt(t,t.return,he)}}function pg(e){var t=e.updateQueue;if(t!==null){var s=e.stateNode;try{Dc(t,s)}catch(i){qt(e,e.return,i)}}}function mg(e,t,s){s.props=Dr(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(i){qt(e,t,i)}}function Fo(e,t){try{var s=e.ref;if(s!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof s=="function"?e.refCleanup=s(i):s.current=i}}catch(u){qt(e,t,u)}}function ba(e,t){var s=e.ref,i=e.refCleanup;if(s!==null)if(typeof i=="function")try{i()}catch(u){qt(e,t,u)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(u){qt(e,t,u)}else s.current=null}function gg(e){var t=e.type,s=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":s.autoFocus&&i.focus();break e;case"img":s.src?i.src=s.src:s.srcSet&&(i.srcset=s.srcSet)}}catch(u){qt(e,e.return,u)}}function ch(e,t,s){try{var i=e.stateNode;k0(i,e.type,s,t),i[We]=t}catch(u){qt(e,e.return,u)}}function xg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Qi(e.type)||e.tag===4}function oh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||xg(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&&Qi(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 uh(e,t,s){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(e,t):(t=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,t.appendChild(e),s=s._reactRootContainer,s!=null||t.onclick!==null||(t.onclick=At));else if(i!==4&&(i===27&&Qi(e.type)&&(s=e.stateNode,t=null),e=e.child,e!==null))for(uh(e,t,s),e=e.sibling;e!==null;)uh(e,t,s),e=e.sibling}function dd(e,t,s){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?s.insertBefore(e,t):s.appendChild(e);else if(i!==4&&(i===27&&Qi(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(dd(e,t,s),e=e.sibling;e!==null;)dd(e,t,s),e=e.sibling}function bg(e){var t=e.stateNode,s=e.memoizedProps;try{for(var i=e.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);fs(t,i,s),t[zt]=e,t[We]=s}catch(f){qt(e,e.return,f)}}var ni=!1,Vn=!1,dh=!1,_g=typeof WeakSet=="function"?WeakSet:Set,ss=null;function l0(e,t){if(e=e.containerInfo,Rh=Rd,e=wr(e),vi(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var i=s.getSelection&&s.getSelection();if(i&&i.rangeCount!==0){s=i.anchorNode;var u=i.anchorOffset,f=i.focusNode;i=i.focusOffset;try{s.nodeType,f.nodeType}catch{s=null;break e}var _=0,N=-1,O=-1,ne=0,he=0,xe=e,le=null;t:for(;;){for(var oe;xe!==s||u!==0&&xe.nodeType!==3||(N=_+u),xe!==f||i!==0&&xe.nodeType!==3||(O=_+i),xe.nodeType===3&&(_+=xe.nodeValue.length),(oe=xe.firstChild)!==null;)le=xe,xe=oe;for(;;){if(xe===e)break t;if(le===s&&++ne===u&&(N=_),le===f&&++he===i&&(O=_),(oe=xe.nextSibling)!==null)break;xe=le,le=xe.parentNode}xe=oe}s=N===-1||O===-1?null:{start:N,end:O}}else s=null}s=s||{start:0,end:0}}else s=null;for(Dh={focusedElem:e,selectionRange:s},Rd=!1,ss=t;ss!==null;)if(t=ss,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ss=e;else for(;ss!==null;){switch(t=ss,f=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(s=0;s<e.length;s++)u=e[s],u.ref.impl=u.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&f!==null){e=void 0,s=t,u=f.memoizedProps,f=f.memoizedState,i=s.stateNode;try{var Ue=Dr(s.type,u);e=i.getSnapshotBeforeUpdate(Ue,f),i.__reactInternalSnapshotBeforeUpdate=e}catch(Fe){qt(s,s.return,Fe)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,s=e.nodeType,s===9)zh(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":zh(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(c(163))}if(e=t.sibling,e!==null){e.return=t.return,ss=e;break}ss=t.return}}function yg(e,t,s){var i=s.flags;switch(s.tag){case 0:case 11:case 15:li(e,s),i&4&&Ko(5,s);break;case 1:if(li(e,s),i&4)if(e=s.stateNode,t===null)try{e.componentDidMount()}catch(_){qt(s,s.return,_)}else{var u=Dr(s.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(_){qt(s,s.return,_)}}i&64&&pg(s),i&512&&Fo(s,s.return);break;case 3:if(li(e,s),i&64&&(e=s.updateQueue,e!==null)){if(t=null,s.child!==null)switch(s.child.tag){case 27:case 5:t=s.child.stateNode;break;case 1:t=s.child.stateNode}try{Dc(e,t)}catch(_){qt(s,s.return,_)}}break;case 27:t===null&&i&4&&bg(s);case 26:case 5:li(e,s),t===null&&i&4&&gg(s),i&512&&Fo(s,s.return);break;case 12:li(e,s);break;case 31:li(e,s),i&4&&Ng(e,s);break;case 13:li(e,s),i&4&&wg(e,s),i&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=h0.bind(null,s),D0(e,s))));break;case 22:if(i=s.memoizedState!==null||ni,!i){t=t!==null&&t.memoizedState!==null||Vn,u=ni;var f=Vn;ni=i,(Vn=t)&&!f?ai(e,s,(s.subtreeFlags&8772)!==0):li(e,s),ni=u,Vn=f}break;case 30:break;default:li(e,s)}}function vg(e){var t=e.alternate;t!==null&&(e.alternate=null,vg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&al(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 mn=null,Ps=!1;function si(e,t,s){for(s=s.child;s!==null;)jg(e,t,s),s=s.sibling}function jg(e,t,s){if(Pt&&typeof Pt.onCommitFiberUnmount=="function")try{Pt.onCommitFiberUnmount(Et,s)}catch{}switch(s.tag){case 26:Vn||ba(s,t),si(e,t,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Vn||ba(s,t);var i=mn,u=Ps;Qi(s.type)&&(mn=s.stateNode,Ps=!1),si(e,t,s),lu(s.stateNode),mn=i,Ps=u;break;case 5:Vn||ba(s,t);case 6:if(i=mn,u=Ps,mn=null,si(e,t,s),mn=i,Ps=u,mn!==null)if(Ps)try{(mn.nodeType===9?mn.body:mn.nodeName==="HTML"?mn.ownerDocument.body:mn).removeChild(s.stateNode)}catch(f){qt(s,t,f)}else try{mn.removeChild(s.stateNode)}catch(f){qt(s,t,f)}break;case 18:mn!==null&&(Ps?(e=mn,px(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),Fc(e)):px(mn,s.stateNode));break;case 4:i=mn,u=Ps,mn=s.stateNode.containerInfo,Ps=!0,si(e,t,s),mn=i,Ps=u;break;case 0:case 11:case 14:case 15:Hi(2,s,t),Vn||Hi(4,s,t),si(e,t,s);break;case 1:Vn||(ba(s,t),i=s.stateNode,typeof i.componentWillUnmount=="function"&&mg(s,t,i)),si(e,t,s);break;case 21:si(e,t,s);break;case 22:Vn=(i=Vn)||s.memoizedState!==null,si(e,t,s),Vn=i;break;default:si(e,t,s)}}function Ng(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Fc(e)}catch(s){qt(t,t.return,s)}}}function wg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Fc(e)}catch(s){qt(t,t.return,s)}}function a0(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new _g),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new _g),t;default:throw Error(c(435,e.tag))}}function fd(e,t){var s=a0(e);t.forEach(function(i){if(!s.has(i)){s.add(i);var u=p0.bind(null,e,i);i.then(u,u)}})}function Ws(e,t){var s=t.deletions;if(s!==null)for(var i=0;i<s.length;i++){var u=s[i],f=e,_=t,N=_;e:for(;N!==null;){switch(N.tag){case 27:if(Qi(N.type)){mn=N.stateNode,Ps=!1;break e}break;case 5:mn=N.stateNode,Ps=!1;break e;case 3:case 4:mn=N.stateNode.containerInfo,Ps=!0;break e}N=N.return}if(mn===null)throw Error(c(160));jg(f,_,u),mn=null,Ps=!1,f=u.alternate,f!==null&&(f.return=null),u.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)kg(t,e),t=t.sibling}var Yl=null;function kg(e,t){var s=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ws(t,e),el(e),i&4&&(Hi(3,e,e.return),Ko(3,e),Hi(5,e,e.return));break;case 1:Ws(t,e),el(e),i&512&&(Vn||s===null||ba(s,s.return)),i&64&&ni&&(e=e.updateQueue,e!==null&&(i=e.callbacks,i!==null&&(s=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=s===null?i:s.concat(i))));break;case 26:var u=Yl;if(Ws(t,e),el(e),i&512&&(Vn||s===null||ba(s,s.return)),i&4){var f=s!==null?s.memoizedState:null;if(i=e.memoizedState,s===null)if(i===null)if(e.stateNode===null){e:{i=e.type,s=e.memoizedProps,u=u.ownerDocument||u;t:switch(i){case"title":f=u.getElementsByTagName("title")[0],(!f||f[An]||f[zt]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=u.createElement(i),u.head.insertBefore(f,u.querySelector("head > title"))),fs(f,i,s),f[zt]=e,Ut(f),i=f;break e;case"link":var _=kx("link","href",u).get(i+(s.href||""));if(_){for(var N=0;N<_.length;N++)if(f=_[N],f.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&f.getAttribute("rel")===(s.rel==null?null:s.rel)&&f.getAttribute("title")===(s.title==null?null:s.title)&&f.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){_.splice(N,1);break t}}f=u.createElement(i),fs(f,i,s),u.head.appendChild(f);break;case"meta":if(_=kx("meta","content",u).get(i+(s.content||""))){for(N=0;N<_.length;N++)if(f=_[N],f.getAttribute("content")===(s.content==null?null:""+s.content)&&f.getAttribute("name")===(s.name==null?null:s.name)&&f.getAttribute("property")===(s.property==null?null:s.property)&&f.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&f.getAttribute("charset")===(s.charSet==null?null:s.charSet)){_.splice(N,1);break t}}f=u.createElement(i),fs(f,i,s),u.head.appendChild(f);break;default:throw Error(c(468,i))}f[zt]=e,Ut(f),i=f}e.stateNode=i}else Sx(u,e.type,e.stateNode);else e.stateNode=wx(u,i,e.memoizedProps);else f!==i?(f===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):f.count--,i===null?Sx(u,e.type,e.stateNode):wx(u,i,e.memoizedProps)):i===null&&e.stateNode!==null&&ch(e,e.memoizedProps,s.memoizedProps)}break;case 27:Ws(t,e),el(e),i&512&&(Vn||s===null||ba(s,s.return)),s!==null&&i&4&&ch(e,e.memoizedProps,s.memoizedProps);break;case 5:if(Ws(t,e),el(e),i&512&&(Vn||s===null||ba(s,s.return)),e.flags&32){u=e.stateNode;try{P(u,"")}catch(Ue){qt(e,e.return,Ue)}}i&4&&e.stateNode!=null&&(u=e.memoizedProps,ch(e,u,s!==null?s.memoizedProps:u)),i&1024&&(dh=!0);break;case 6:if(Ws(t,e),el(e),i&4){if(e.stateNode===null)throw Error(c(162));i=e.memoizedProps,s=e.stateNode;try{s.nodeValue=i}catch(Ue){qt(e,e.return,Ue)}}break;case 3:if(Td=null,u=Yl,Yl=Sd(t.containerInfo),Ws(t,e),Yl=u,el(e),i&4&&s!==null&&s.memoizedState.isDehydrated)try{Fc(t.containerInfo)}catch(Ue){qt(e,e.return,Ue)}dh&&(dh=!1,Sg(e));break;case 4:i=Yl,Yl=Sd(e.stateNode.containerInfo),Ws(t,e),el(e),Yl=i;break;case 12:Ws(t,e),el(e);break;case 31:Ws(t,e),el(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,fd(e,i)));break;case 13:Ws(t,e),el(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(pd=Xe()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,fd(e,i)));break;case 22:u=e.memoizedState!==null;var O=s!==null&&s.memoizedState!==null,ne=ni,he=Vn;if(ni=ne||u,Vn=he||O,Ws(t,e),Vn=he,ni=ne,el(e),i&8192)e:for(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,u&&(s===null||O||ni||Vn||Or(e)),s=null,t=e;;){if(t.tag===5||t.tag===26){if(s===null){O=s=t;try{if(f=O.stateNode,u)_=f.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none";else{N=O.stateNode;var xe=O.memoizedProps.style,le=xe!=null&&xe.hasOwnProperty("display")?xe.display:null;N.style.display=le==null||typeof le=="boolean"?"":(""+le).trim()}}catch(Ue){qt(O,O.return,Ue)}}}else if(t.tag===6){if(s===null){O=t;try{O.stateNode.nodeValue=u?"":O.memoizedProps}catch(Ue){qt(O,O.return,Ue)}}}else if(t.tag===18){if(s===null){O=t;try{var oe=O.stateNode;u?mx(oe,!0):mx(O.stateNode,!1)}catch(Ue){qt(O,O.return,Ue)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;s===t&&(s=null),t=t.return}s===t&&(s=null),t.sibling.return=t.return,t=t.sibling}i&4&&(i=e.updateQueue,i!==null&&(s=i.retryQueue,s!==null&&(i.retryQueue=null,fd(e,s))));break;case 19:Ws(t,e),el(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,fd(e,i)));break;case 30:break;case 21:break;default:Ws(t,e),el(e)}}function el(e){var t=e.flags;if(t&2){try{for(var s,i=e.return;i!==null;){if(xg(i)){s=i;break}i=i.return}if(s==null)throw Error(c(160));switch(s.tag){case 27:var u=s.stateNode,f=oh(e);dd(e,f,u);break;case 5:var _=s.stateNode;s.flags&32&&(P(_,""),s.flags&=-33);var N=oh(e);dd(e,N,_);break;case 3:case 4:var O=s.stateNode.containerInfo,ne=oh(e);uh(e,ne,O);break;default:throw Error(c(161))}}catch(he){qt(e,e.return,he)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Sg(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Sg(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function li(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)yg(e,t.alternate,t),t=t.sibling}function Or(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Hi(4,t,t.return),Or(t);break;case 1:ba(t,t.return);var s=t.stateNode;typeof s.componentWillUnmount=="function"&&mg(t,t.return,s),Or(t);break;case 27:lu(t.stateNode);case 26:case 5:ba(t,t.return),Or(t);break;case 22:t.memoizedState===null&&Or(t);break;case 30:Or(t);break;default:Or(t)}e=e.sibling}}function ai(e,t,s){for(s=s&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var i=t.alternate,u=e,f=t,_=f.flags;switch(f.tag){case 0:case 11:case 15:ai(u,f,s),Ko(4,f);break;case 1:if(ai(u,f,s),i=f,u=i.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(ne){qt(i,i.return,ne)}if(i=f,u=i.updateQueue,u!==null){var N=i.stateNode;try{var O=u.shared.hiddenCallbacks;if(O!==null)for(u.shared.hiddenCallbacks=null,u=0;u<O.length;u++)td(O[u],N)}catch(ne){qt(i,i.return,ne)}}s&&_&64&&pg(f),Fo(f,f.return);break;case 27:bg(f);case 26:case 5:ai(u,f,s),s&&i===null&&_&4&&gg(f),Fo(f,f.return);break;case 12:ai(u,f,s);break;case 31:ai(u,f,s),s&&_&4&&Ng(u,f);break;case 13:ai(u,f,s),s&&_&4&&wg(u,f);break;case 22:f.memoizedState===null&&ai(u,f,s),Fo(f,f.return);break;case 30:break;default:ai(u,f,s)}t=t.sibling}}function fh(e,t){var s=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==s&&(e!=null&&e.refCount++,s!=null&&Tr(s))}function hh(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Tr(e))}function Xl(e,t,s,i){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Eg(e,t,s,i),t=t.sibling}function Eg(e,t,s,i){var u=t.flags;switch(t.tag){case 0:case 11:case 15:Xl(e,t,s,i),u&2048&&Ko(9,t);break;case 1:Xl(e,t,s,i);break;case 3:Xl(e,t,s,i),u&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Tr(e)));break;case 12:if(u&2048){Xl(e,t,s,i),e=t.stateNode;try{var f=t.memoizedProps,_=f.id,N=f.onPostCommit;typeof N=="function"&&N(_,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(O){qt(t,t.return,O)}}else Xl(e,t,s,i);break;case 31:Xl(e,t,s,i);break;case 13:Xl(e,t,s,i);break;case 23:break;case 22:f=t.stateNode,_=t.alternate,t.memoizedState!==null?f._visibility&2?Xl(e,t,s,i):Zo(e,t):f._visibility&2?Xl(e,t,s,i):(f._visibility|=2,Ic(e,t,s,i,(t.subtreeFlags&10256)!==0||!1)),u&2048&&fh(_,t);break;case 24:Xl(e,t,s,i),u&2048&&hh(t.alternate,t);break;default:Xl(e,t,s,i)}}function Ic(e,t,s,i,u){for(u=u&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var f=e,_=t,N=s,O=i,ne=_.flags;switch(_.tag){case 0:case 11:case 15:Ic(f,_,N,O,u),Ko(8,_);break;case 23:break;case 22:var he=_.stateNode;_.memoizedState!==null?he._visibility&2?Ic(f,_,N,O,u):Zo(f,_):(he._visibility|=2,Ic(f,_,N,O,u)),u&&ne&2048&&fh(_.alternate,_);break;case 24:Ic(f,_,N,O,u),u&&ne&2048&&hh(_.alternate,_);break;default:Ic(f,_,N,O,u)}t=t.sibling}}function Zo(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var s=e,i=t,u=i.flags;switch(i.tag){case 22:Zo(s,i),u&2048&&fh(i.alternate,i);break;case 24:Zo(s,i),u&2048&&hh(i.alternate,i);break;default:Zo(s,i)}t=t.sibling}}var Jo=8192;function Bc(e,t,s){if(e.subtreeFlags&Jo)for(e=e.child;e!==null;)Tg(e,t,s),e=e.sibling}function Tg(e,t,s){switch(e.tag){case 26:Bc(e,t,s),e.flags&Jo&&e.memoizedState!==null&&X0(s,Yl,e.memoizedState,e.memoizedProps);break;case 5:Bc(e,t,s);break;case 3:case 4:var i=Yl;Yl=Sd(e.stateNode.containerInfo),Bc(e,t,s),Yl=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=Jo,Jo=16777216,Bc(e,t,s),Jo=i):Bc(e,t,s));break;default:Bc(e,t,s)}}function Cg(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 Po(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var i=t[s];ss=i,Mg(i,e)}Cg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ag(e),e=e.sibling}function Ag(e){switch(e.tag){case 0:case 11:case 15:Po(e),e.flags&2048&&Hi(9,e,e.return);break;case 3:Po(e);break;case 12:Po(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,hd(e)):Po(e);break;default:Po(e)}}function hd(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var i=t[s];ss=i,Mg(i,e)}Cg(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Hi(8,t,t.return),hd(t);break;case 22:s=t.stateNode,s._visibility&2&&(s._visibility&=-3,hd(t));break;default:hd(t)}e=e.sibling}}function Mg(e,t){for(;ss!==null;){var s=ss;switch(s.tag){case 0:case 11:case 15:Hi(8,s,t);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var i=s.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:Tr(s.memoizedState.cache)}if(i=s.child,i!==null)i.return=s,ss=i;else e:for(s=e;ss!==null;){i=ss;var u=i.sibling,f=i.return;if(vg(i),i===s){ss=null;break e}if(u!==null){u.return=f,ss=u;break e}ss=f}}}var i0={getCacheForType:function(e){var t=Pn(wn),s=t.data.get(e);return s===void 0&&(s=e(),t.data.set(e,s)),s},cacheSignal:function(){return Pn(wn).controller.signal}},r0=typeof WeakMap=="function"?WeakMap:Map,Ot=0,Jt=null,mt=null,_t=0,$t=0,hl=null,$i=!1,Hc=!1,ph=!1,ii=0,kn=0,qi=0,Lr=0,mh=0,pl=0,$c=0,Wo=null,tl=null,gh=!1,pd=0,Rg=0,md=1/0,gd=null,Gi=null,Wn=0,Yi=null,qc=null,ri=0,xh=0,bh=null,Dg=null,eu=0,_h=null;function ml(){return(Ot&2)!==0&&_t!==0?_t&-_t:D.T!==null?kh():ll()}function Og(){if(pl===0)if((_t&536870912)===0||ht){var e=it;it<<=1,(it&3932160)===0&&(it=262144),pl=e}else pl=536870912;return e=vs.current,e!==null&&(e.flags|=32),pl}function nl(e,t,s){(e===Jt&&($t===2||$t===9)||e.cancelPendingCommit!==null)&&(Gc(e,0),Xi(e,_t,pl,!1)),Tn(e,s),((Ot&2)===0||e!==Jt)&&(e===Jt&&((Ot&2)===0&&(Lr|=s),kn===4&&Xi(e,_t,pl,!1)),_a(e))}function Lg(e,t,s){if((Ot&6)!==0)throw Error(c(327));var i=!s&&(t&127)===0&&(t&e.expiredLanes)===0||ge(e,t),u=i?u0(e,t):vh(e,t,!0),f=i;do{if(u===0){Hc&&!i&&Xi(e,t,0,!1);break}else{if(s=e.current.alternate,f&&!c0(s)){u=vh(e,t,!1),f=!1;continue}if(u===2){if(f=t,e.errorRecoveryDisabledLanes&f)var _=0;else _=e.pendingLanes&-536870913,_=_!==0?_:_&536870912?536870912:0;if(_!==0){t=_;e:{var N=e;u=Wo;var O=N.current.memoizedState.isDehydrated;if(O&&(Gc(N,_).flags|=256),_=vh(N,_,!1),_!==2){if(ph&&!O){N.errorRecoveryDisabledLanes|=f,Lr|=f,u=4;break e}f=tl,tl=u,f!==null&&(tl===null?tl=f:tl.push.apply(tl,f))}u=_}if(f=!1,u!==2)continue}}if(u===1){Gc(e,0),Xi(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:Xi(i,t,pl,!$i);break e;case 2:tl=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(u=pd+300-Xe(),10<u)){if(Xi(i,t,pl,!$i),J(i,0,!0)!==0)break e;ri=t,i.timeoutHandle=fx(zg.bind(null,i,s,tl,gd,gh,t,pl,Lr,$c,$i,f,"Throttled",-0,0),u);break e}zg(i,s,tl,gd,gh,t,pl,Lr,$c,$i,f,null,-0,0)}}break}while(!0);_a(e)}function zg(e,t,s,i,u,f,_,N,O,ne,he,xe,le,oe){if(e.timeoutHandle=-1,xe=t.subtreeFlags,xe&8192||(xe&16785408)===16785408){xe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:At},Tg(t,f,xe);var Ue=(f&62914560)===f?pd-Xe():(f&4194048)===f?Rg-Xe():0;if(Ue=V0(xe,Ue),Ue!==null){ri=f,e.cancelPendingCommit=Ue(Yg.bind(null,e,t,f,s,i,u,_,N,O,he,xe,null,le,oe)),Xi(e,f,_,!ne);return}}Yg(e,t,f,s,i,u,_,N,O)}function c0(e){for(var t=e;;){var s=t.tag;if((s===0||s===11||s===15)&&t.flags&16384&&(s=t.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var i=0;i<s.length;i++){var u=s[i],f=u.getSnapshot;u=u.value;try{if(!Nt(f(),u))return!1}catch{return!1}}if(s=t.child,t.subtreeFlags&16384&&s!==null)s.return=t,t=s;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Xi(e,t,s,i){t&=~mh,t&=~Lr,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var u=t;0<u;){var f=31-Wt(u),_=1<<f;i[f]=-1,u&=~_}s!==0&&Dl(e,s,t)}function xd(){return(Ot&6)===0?(tu(0),!1):!0}function yh(){if(mt!==null){if($t===0)var e=mt.return;else e=mt,kl=Xa=null,Bi(e),Za=null,fa=0,e=mt;for(;e!==null;)hg(e.alternate,e),e=e.return;mt=null}}function Gc(e,t){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,T0(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),ri=0,yh(),Jt=e,mt=s=Nl(e.current,null),_t=t,$t=0,hl=null,$i=!1,Hc=ge(e,t),ph=!1,$c=pl=mh=Lr=qi=kn=0,tl=Wo=null,gh=!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 ii=t,gc(),s}function Ug(e,t){et=null,D.H=Xo,t===Di||t===Tc?(t=Wu(),$t=3):t===Io?(t=Wu(),$t=4):$t=t===Pf?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,hl=t,mt===null&&(kn=1,id(e,bs(t,e.current)))}function Ig(){var e=vs.current;return e===null?!0:(_t&4194048)===_t?Js===null:(_t&62914560)===_t||(_t&536870912)!==0?e===Js:!1}function Bg(){var e=D.H;return D.H=Xo,e===null?Xo:e}function Hg(){var e=D.A;return D.A=i0,e}function bd(){kn=4,$i||(_t&4194048)!==_t&&vs.current!==null||(Hc=!0),(qi&134217727)===0&&(Lr&134217727)===0||Jt===null||Xi(Jt,_t,pl,!1)}function vh(e,t,s){var i=Ot;Ot|=2;var u=Bg(),f=Hg();(Jt!==e||_t!==t)&&(gd=null,Gc(e,t)),t=!1;var _=kn;e:do try{if($t!==0&&mt!==null){var N=mt,O=hl;switch($t){case 8:yh(),_=6;break e;case 3:case 2:case 9:case 6:vs.current===null&&(t=!0);var ne=$t;if($t=0,hl=null,Yc(e,N,O,ne),s&&Hc){_=0;break e}break;default:ne=$t,$t=0,hl=null,Yc(e,N,O,ne)}}o0(),_=kn;break}catch(he){Ug(e,he)}while(!0);return t&&e.shellSuspendCounter++,kl=Xa=null,Ot=i,D.H=u,D.A=f,mt===null&&(Jt=null,_t=0,gc()),_}function o0(){for(;mt!==null;)$g(mt)}function u0(e,t){var s=Ot;Ot|=2;var i=Bg(),u=Hg();Jt!==e||_t!==t?(gd=null,md=Xe()+500,Gc(e,t)):Hc=ge(e,t);e:do try{if($t!==0&&mt!==null){t=mt;var f=hl;t:switch($t){case 1:$t=0,hl=null,Yc(e,t,f,1);break;case 2:case 9:if(Ju(f)){$t=0,hl=null,qg(t);break}t=function(){$t!==2&&$t!==9||Jt!==e||($t=7),_a(e)},f.then(t,t);break e;case 3:$t=7;break e;case 4:$t=5;break e;case 7:Ju(f)?($t=0,hl=null,qg(t)):($t=0,hl=null,Yc(e,t,f,7));break;case 5:var _=null;switch(mt.tag){case 26:_=mt.memoizedState;case 5:case 27:var N=mt;if(_?Ex(_):N.stateNode.complete){$t=0,hl=null;var O=N.sibling;if(O!==null)mt=O;else{var ne=N.return;ne!==null?(mt=ne,_d(ne)):mt=null}break t}}$t=0,hl=null,Yc(e,t,f,5);break;case 6:$t=0,hl=null,Yc(e,t,f,6);break;case 8:yh(),kn=6;break e;default:throw Error(c(462))}}d0();break}catch(he){Ug(e,he)}while(!0);return kl=Xa=null,D.H=i,D.A=u,Ot=s,mt!==null?0:(Jt=null,_t=0,gc(),kn)}function d0(){for(;mt!==null&&!St();)$g(mt)}function $g(e){var t=dg(e.alternate,e,ii);e.memoizedProps=e.pendingProps,t===null?_d(e):mt=t}function qg(e){var t=e,s=t.alternate;switch(t.tag){case 15:case 0:t=ag(s,t,t.pendingProps,t.type,void 0,_t);break;case 11:t=ag(s,t,t.pendingProps,t.type.render,t.ref,_t);break;case 5:Bi(t);default:hg(s,t),t=mt=qu(t,ii),t=dg(s,t,ii)}e.memoizedProps=e.pendingProps,t===null?_d(e):mt=t}function Yc(e,t,s,i){kl=Xa=null,Bi(t),Za=null,fa=0;var u=t.return;try{if(Wy(e,u,t,s,_t)){kn=1,id(e,bs(s,e.current)),mt=null;return}}catch(f){if(u!==null)throw mt=u,f;kn=1,id(e,bs(s,e.current)),mt=null;return}t.flags&32768?(ht||i===1?e=!0:Hc||(_t&536870912)!==0?e=!1:($i=e=!0,(i===2||i===9||i===3||i===6)&&(i=vs.current,i!==null&&i.tag===13&&(i.flags|=16384))),Gg(t,e)):_d(t)}function _d(e){var t=e;do{if((t.flags&32768)!==0){Gg(t,$i);return}e=t.return;var s=n0(t.alternate,t,ii);if(s!==null){mt=s;return}if(t=t.sibling,t!==null){mt=t;return}mt=t=e}while(t!==null);kn===0&&(kn=5)}function Gg(e,t){do{var s=s0(e.alternate,e);if(s!==null){s.flags&=32767,mt=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!t&&(e=e.sibling,e!==null)){mt=e;return}mt=e=s}while(e!==null);kn=6,mt=null}function Yg(e,t,s,i,u,f,_,N,O){e.cancelPendingCommit=null;do yd();while(Wn!==0);if((Ot&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));if(f=t.lanes|t.childLanes,f|=mc,Is(e,s,f,_,N,O),e===Jt&&(mt=Jt=null,_t=0),qc=t,Yi=e,ri=s,xh=f,bh=u,Dg=i,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,m0(tn,function(){return Fg(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||i){i=D.T,D.T=null,u=U.p,U.p=2,_=Ot,Ot|=4;try{l0(e,t,s)}finally{Ot=_,U.p=u,D.T=i}}Wn=1,Xg(),Vg(),Qg()}}function Xg(){if(Wn===1){Wn=0;var e=Yi,t=qc,s=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||s){s=D.T,D.T=null;var i=U.p;U.p=2;var u=Ot;Ot|=4;try{kg(t,e);var f=Dh,_=wr(e.containerInfo),N=f.focusedElem,O=f.selectionRange;if(_!==N&&N&&N.ownerDocument&&Eo(N.ownerDocument.documentElement,N)){if(O!==null&&vi(N)){var ne=O.start,he=O.end;if(he===void 0&&(he=ne),"selectionStart"in N)N.selectionStart=ne,N.selectionEnd=Math.min(he,N.value.length);else{var xe=N.ownerDocument||document,le=xe&&xe.defaultView||window;if(le.getSelection){var oe=le.getSelection(),Ue=N.textContent.length,Fe=Math.min(O.start,Ue),Kt=O.end===void 0?Fe:Math.min(O.end,Ue);!oe.extend&&Fe>Kt&&(_=Kt,Kt=Fe,Fe=_);var F=jl(N,Fe),B=jl(N,Kt);if(F&&B&&(oe.rangeCount!==1||oe.anchorNode!==F.node||oe.anchorOffset!==F.offset||oe.focusNode!==B.node||oe.focusOffset!==B.offset)){var te=xe.createRange();te.setStart(F.node,F.offset),oe.removeAllRanges(),Fe>Kt?(oe.addRange(te),oe.extend(B.node,B.offset)):(te.setEnd(B.node,B.offset),oe.addRange(te))}}}}for(xe=[],oe=N;oe=oe.parentNode;)oe.nodeType===1&&xe.push({element:oe,left:oe.scrollLeft,top:oe.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<xe.length;N++){var pe=xe[N];pe.element.scrollLeft=pe.left,pe.element.scrollTop=pe.top}}Rd=!!Rh,Dh=Rh=null}finally{Ot=u,U.p=i,D.T=s}}e.current=t,Wn=2}}function Vg(){if(Wn===2){Wn=0;var e=Yi,t=qc,s=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||s){s=D.T,D.T=null;var i=U.p;U.p=2;var u=Ot;Ot|=4;try{yg(e,t.alternate,t)}finally{Ot=u,U.p=i,D.T=s}}Wn=3}}function Qg(){if(Wn===4||Wn===3){Wn=0,pt();var e=Yi,t=qc,s=ri,i=Dg;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Wn=5:(Wn=0,qc=Yi=null,Kg(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(Gi=null),Cn(s),t=t.stateNode,Pt&&typeof Pt.onCommitFiberRoot=="function")try{Pt.onCommitFiberRoot(Et,t,void 0,(t.current.flags&128)===128)}catch{}if(i!==null){t=D.T,u=U.p,U.p=2,D.T=null;try{for(var f=e.onRecoverableError,_=0;_<i.length;_++){var N=i[_];f(N.value,{componentStack:N.stack})}}finally{D.T=t,U.p=u}}(ri&3)!==0&&yd(),_a(e),u=e.pendingLanes,(s&261930)!==0&&(u&42)!==0?e===_h?eu++:(eu=0,_h=e):eu=0,tu(0)}}function Kg(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Tr(t)))}function yd(){return Xg(),Vg(),Qg(),Fg()}function Fg(){if(Wn!==5)return!1;var e=Yi,t=xh;xh=0;var s=Cn(ri),i=D.T,u=U.p;try{U.p=32>s?32:s,D.T=null,s=bh,bh=null;var f=Yi,_=ri;if(Wn=0,qc=Yi=null,ri=0,(Ot&6)!==0)throw Error(c(331));var N=Ot;if(Ot|=4,Ag(f.current),Eg(f,f.current,_,s),Ot=N,tu(0,!1),Pt&&typeof Pt.onPostCommitFiberRoot=="function")try{Pt.onPostCommitFiberRoot(Et,f)}catch{}return!0}finally{U.p=u,D.T=i,Kg(e,t)}}function Zg(e,t,s){t=bs(s,t),t=Jf(e.stateNode,t,2),e=ql(e,t,2),e!==null&&(Tn(e,2),_a(e))}function qt(e,t,s){if(e.tag===3)Zg(e,e,s);else for(;t!==null;){if(t.tag===3){Zg(t,e,s);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Gi===null||!Gi.has(i))){e=bs(s,e),s=Jm(2),i=ql(t,s,2),i!==null&&(Pm(s,i,t,e),Tn(i,2),_a(i));break}}t=t.return}}function jh(e,t,s){var i=e.pingCache;if(i===null){i=e.pingCache=new r0;var u=new Set;i.set(t,u)}else u=i.get(t),u===void 0&&(u=new Set,i.set(t,u));u.has(s)||(ph=!0,u.add(s),e=f0.bind(null,e,t,s),t.then(e,e))}function f0(e,t,s){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,Jt===e&&(_t&s)===s&&(kn===4||kn===3&&(_t&62914560)===_t&&300>Xe()-pd?(Ot&2)===0&&Gc(e,0):mh|=s,$c===_t&&($c=0)),_a(e)}function Jg(e,t){t===0&&(t=qe()),e=qa(e,t),e!==null&&(Tn(e,t),_a(e))}function h0(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),Jg(e,s)}function p0(e,t){var s=0;switch(e.tag){case 31:case 13:var i=e.stateNode,u=e.memoizedState;u!==null&&(s=u.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(c(314))}i!==null&&i.delete(t),Jg(e,s)}function m0(e,t){return Ce(e,t)}var vd=null,Xc=null,Nh=!1,jd=!1,wh=!1,Vi=0;function _a(e){e!==Xc&&e.next===null&&(Xc===null?vd=Xc=e:Xc=Xc.next=e),jd=!0,Nh||(Nh=!0,x0())}function tu(e,t){if(!wh&&jd){wh=!0;do for(var s=!1,i=vd;i!==null;){if(e!==0){var u=i.pendingLanes;if(u===0)var f=0;else{var _=i.suspendedLanes,N=i.pingedLanes;f=(1<<31-Wt(42|e)+1)-1,f&=u&~(_&~N),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(s=!0,tx(i,f))}else f=_t,f=J(i,i===Jt?f:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(f&3)===0||ge(i,f)||(s=!0,tx(i,f));i=i.next}while(s);wh=!1}}function g0(){Pg()}function Pg(){jd=Nh=!1;var e=0;Vi!==0&&E0()&&(e=Vi);for(var t=Xe(),s=null,i=vd;i!==null;){var u=i.next,f=Wg(i,t);f===0?(i.next=null,s===null?vd=u:s.next=u,u===null&&(Xc=s)):(s=i,(e!==0||(f&3)!==0)&&(jd=!0)),i=u}Wn!==0&&Wn!==5||tu(e),Vi!==0&&(Vi=0)}function Wg(e,t){for(var s=e.suspendedLanes,i=e.pingedLanes,u=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var _=31-Wt(f),N=1<<_,O=u[_];O===-1?((N&s)===0||(N&i)!==0)&&(u[_]=De(N,t)):O<=t&&(e.expiredLanes|=N),f&=~N}if(t=Jt,s=_t,s=J(e,e===t?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,s===0||e===t&&($t===2||$t===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&Je(i),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||ge(e,s)){if(t=s&-s,t===e.callbackPriority)return t;switch(i!==null&&Je(i),Cn(s)){case 2:case 8:s=Tt;break;case 32:s=tn;break;case 268435456:s=gn;break;default:s=tn}return i=ex.bind(null,e),s=Ce(s,i),e.callbackPriority=t,e.callbackNode=s,t}return i!==null&&i!==null&&Je(i),e.callbackPriority=2,e.callbackNode=null,2}function ex(e,t){if(Wn!==0&&Wn!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(yd()&&e.callbackNode!==s)return null;var i=_t;return i=J(e,e===Jt?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(Lg(e,i,t),Wg(e,Xe()),e.callbackNode!=null&&e.callbackNode===s?ex.bind(null,e):null)}function tx(e,t){if(yd())return null;Lg(e,t,!0)}function x0(){C0(function(){(Ot&6)!==0?Ce(zn,g0):Pg()})}function kh(){if(Vi===0){var e=da;e===0&&(e=Ke,Ke<<=1,(Ke&261888)===0&&(Ke=256)),Vi=e}return Vi}function nx(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:jn(""+e)}function sx(e,t){var s=t.ownerDocument.createElement("input");return s.name=t.name,s.value=t.value,e.id&&s.setAttribute("form",e.id),t.parentNode.insertBefore(s,t),e=new FormData(e),s.parentNode.removeChild(s),e}function b0(e,t,s,i,u){if(t==="submit"&&s&&s.stateNode===u){var f=nx((u[We]||null).action),_=i.submitter;_&&(t=(t=_[We]||null)?nx(t.formAction):_.getAttribute("formAction"),t!==null&&(f=t,_=null));var N=new ve("action","action",null,i,u);e.push({event:N,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(Vi!==0){var O=_?sx(u,_):new FormData(u);Xf(s,{pending:!0,data:O,method:u.method,action:f},null,O)}}else typeof f=="function"&&(N.preventDefault(),O=_?sx(u,_):new FormData(u),Xf(s,{pending:!0,data:O,method:u.method,action:f},f,O))},currentTarget:u}]})}}for(var Sh=0;Sh<wi.length;Sh++){var Eh=wi[Sh],_0=Eh.toLowerCase(),y0=Eh[0].toUpperCase()+Eh.slice(1);Ks(_0,"on"+y0)}Ks($a,"onAnimationEnd"),Ks(hc,"onAnimationIteration"),Ks(Hu,"onAnimationStart"),Ks("dblclick","onDoubleClick"),Ks("focusin","onFocus"),Ks("focusout","onBlur"),Ks(Lf,"onTransitionRun"),Ks(Z,"onTransitionStart"),Ks(Ul,"onTransitionCancel"),Ks(Qs,"onTransitionEnd"),cs("onMouseEnter",["mouseout","mouseover"]),cs("onMouseLeave",["mouseout","mouseover"]),cs("onPointerEnter",["pointerout","pointerover"]),cs("onPointerLeave",["pointerout","pointerover"]),Cs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Cs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Cs("onBeforeInput",["compositionend","keypress","textInput","paste"]),Cs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Cs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Cs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var nu="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(" "),v0=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(nu));function lx(e,t){t=(t&4)!==0;for(var s=0;s<e.length;s++){var i=e[s],u=i.event;i=i.listeners;e:{var f=void 0;if(t)for(var _=i.length-1;0<=_;_--){var N=i[_],O=N.instance,ne=N.currentTarget;if(N=N.listener,O!==f&&u.isPropagationStopped())break e;f=N,u.currentTarget=ne;try{f(u)}catch(he){pc(he)}u.currentTarget=null,f=O}else for(_=0;_<i.length;_++){if(N=i[_],O=N.instance,ne=N.currentTarget,N=N.listener,O!==f&&u.isPropagationStopped())break e;f=N,u.currentTarget=ne;try{f(u)}catch(he){pc(he)}u.currentTarget=null,f=O}}}}function gt(e,t){var s=t[Ts];s===void 0&&(s=t[Ts]=new Set);var i=e+"__bubble";s.has(i)||(ax(t,e,2,!1),s.add(i))}function Th(e,t,s){var i=0;t&&(i|=4),ax(s,e,i,t)}var Nd="_reactListening"+Math.random().toString(36).slice(2);function Ch(e){if(!e[Nd]){e[Nd]=!0,Fn.forEach(function(s){s!=="selectionchange"&&(v0.has(s)||Th(s,!1,e),Th(s,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Nd]||(t[Nd]=!0,Th("selectionchange",!1,t))}}function ax(e,t,s,i){switch(Ox(t)){case 2:var u=F0;break;case 8:u=Z0;break;default:u=Yh}s=u.bind(null,t,s,e),u=void 0,!ur||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(u=!0),i?u!==void 0?e.addEventListener(t,s,{capture:!0,passive:u}):e.addEventListener(t,s,!0):u!==void 0?e.addEventListener(t,s,{passive:u}):e.addEventListener(t,s,!1)}function Ah(e,t,s,i,u){var f=i;if((t&1)===0&&(t&2)===0&&i!==null)e:for(;;){if(i===null)return;var _=i.tag;if(_===3||_===4){var N=i.stateNode.containerInfo;if(N===u)break;if(_===4)for(_=i.return;_!==null;){var O=_.tag;if((O===3||O===4)&&_.stateNode.containerInfo===u)return;_=_.return}for(;N!==null;){if(_=xl(N),_===null)return;if(O=_.tag,O===5||O===6||O===26||O===27){i=f=_;continue e}N=N.parentNode}}i=i.return}Da(function(){var ne=f,he=_n(s),xe=[];e:{var le=To.get(e);if(le!==void 0){var oe=ve,Ue=e;switch(e){case"keypress":if(mi(s)===0)break e;case"keydown":case"keyup":oe=vo;break;case"focusin":Ue="focus",oe=za;break;case"focusout":Ue="blur",oe=za;break;case"beforeblur":case"afterblur":oe=za;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":oe=hr;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":oe=Af;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":oe=ac;break;case $a:case hc:case Hu:oe=pr;break;case Qs:oe=jo;break;case"scroll":case"scrollend":oe=jt;break;case"wheel":oe=gr;break;case"copy":case"cut":case"paste":oe=Mf;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":oe=lc;break;case"toggle":case"beforetoggle":oe=rc}var Fe=(t&4)!==0,Kt=!Fe&&(e==="scroll"||e==="scrollend"),F=Fe?le!==null?le+"Capture":null:le;Fe=[];for(var B=ne,te;B!==null;){var pe=B;if(te=pe.stateNode,pe=pe.tag,pe!==5&&pe!==26&&pe!==27||te===null||F===null||(pe=fn(B,F),pe!=null&&Fe.push(su(B,pe,te))),Kt)break;B=B.return}0<Fe.length&&(le=new oe(le,Ue,null,s,he),xe.push({event:le,listeners:Fe}))}}if((t&7)===0){e:{if(le=e==="mouseover"||e==="pointerover",oe=e==="mouseout"||e==="pointerout",le&&s!==Nn&&(Ue=s.relatedTarget||s.fromElement)&&(xl(Ue)||Ue[rs]))break e;if((oe||le)&&(le=he.window===he?he:(le=he.ownerDocument)?le.defaultView||le.parentWindow:window,oe?(Ue=s.relatedTarget||s.toElement,oe=ne,Ue=Ue?xl(Ue):null,Ue!==null&&(Kt=d(Ue),Fe=Ue.tag,Ue!==Kt||Fe!==5&&Fe!==27&&Fe!==6)&&(Ue=null)):(oe=null,Ue=ne),oe!==Ue)){if(Fe=hr,pe="onMouseLeave",F="onMouseEnter",B="mouse",(e==="pointerout"||e==="pointerover")&&(Fe=lc,pe="onPointerLeave",F="onPointerEnter",B="pointer"),Kt=oe==null?le:Ll(oe),te=Ue==null?le:Ll(Ue),le=new Fe(pe,B+"leave",oe,s,he),le.target=Kt,le.relatedTarget=te,pe=null,xl(he)===ne&&(Fe=new Fe(F,B+"enter",Ue,s,he),Fe.target=te,Fe.relatedTarget=Kt,pe=Fe),Kt=pe,oe&&Ue)t:{for(Fe=j0,F=oe,B=Ue,te=0,pe=F;pe;pe=Fe(pe))te++;pe=0;for(var Ve=B;Ve;Ve=Fe(Ve))pe++;for(;0<te-pe;)F=Fe(F),te--;for(;0<pe-te;)B=Fe(B),pe--;for(;te--;){if(F===B||B!==null&&F===B.alternate){Fe=F;break t}F=Fe(F),B=Fe(B)}Fe=null}else Fe=null;oe!==null&&ix(xe,le,oe,Fe,!1),Ue!==null&&Kt!==null&&ix(xe,Kt,Ue,Fe,!0)}}e:{if(le=ne?Ll(ne):window,oe=le.nodeName&&le.nodeName.toLowerCase(),oe==="select"||oe==="input"&&le.type==="file")var Mt=_i;else if(wo(le))if(sn)Mt=ia;else{Mt=jr;var $e=$n}else oe=le.nodeName,!oe||oe.toLowerCase()!=="input"||le.type!=="checkbox"&&le.type!=="radio"?ne&&He(ne.elementType)&&(Mt=_i):Mt=Nr;if(Mt&&(Mt=Mt(e,ne))){br(xe,Mt,s,he);break e}$e&&$e(e,le,ne),e==="focusout"&&ne&&le.type==="number"&&ne.memoizedProps.value!=null&&gs(le,"number",le.value)}switch($e=ne?Ll(ne):window,e){case"focusin":(wo($e)||$e.contentEditable==="true")&&(Vs=$e,fc=ne,zl=null);break;case"focusout":zl=fc=Vs=null;break;case"mousedown":ji=!0;break;case"contextmenu":case"mouseup":case"dragend":ji=!1,Ni(xe,s,he);break;case"selectionchange":if(kr)break;case"keydown":case"keyup":Ni(xe,s,he)}var ut;if(xi)e:{switch(e){case"compositionstart":var yt="onCompositionStart";break e;case"compositionend":yt="onCompositionEnd";break e;case"compositionupdate":yt="onCompositionUpdate";break e}yt=void 0}else Xs?cc(e,s)&&(yt="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(yt="onCompositionStart");yt&&(bi&&s.locale!=="ko"&&(Xs||yt!=="onCompositionStart"?yt==="onCompositionEnd"&&Xs&&(ut=ta()):(rl=he,dr="value"in rl?rl.value:rl.textContent,Xs=!0)),$e=wd(ne,yt),0<$e.length&&(yt=new mr(yt,e,null,s,he),xe.push({event:yt,listeners:$e}),ut?yt.data=ut:(ut=Lu(s),ut!==null&&(yt.data=ut)))),(ut=No?oc(e,s):zu(e,s))&&(yt=wd(ne,"onBeforeInput"),0<yt.length&&($e=new mr("onBeforeInput","beforeinput",null,s,he),xe.push({event:$e,listeners:yt}),$e.data=ut)),b0(xe,e,ne,s,he)}lx(xe,t)})}function su(e,t,s){return{instance:e,listener:t,currentTarget:s}}function wd(e,t){for(var s=t+"Capture",i=[];e!==null;){var u=e,f=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||f===null||(u=fn(e,s),u!=null&&i.unshift(su(e,u,f)),u=fn(e,t),u!=null&&i.push(su(e,u,f))),e.tag===3)return i;e=e.return}return[]}function j0(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function ix(e,t,s,i,u){for(var f=t._reactName,_=[];s!==null&&s!==i;){var N=s,O=N.alternate,ne=N.stateNode;if(N=N.tag,O!==null&&O===i)break;N!==5&&N!==26&&N!==27||ne===null||(O=ne,u?(ne=fn(s,f),ne!=null&&_.unshift(su(s,ne,O))):u||(ne=fn(s,f),ne!=null&&_.push(su(s,ne,O)))),s=s.return}_.length!==0&&e.push({event:t,listeners:_})}var N0=/\r\n?/g,w0=/\u0000|\uFFFD/g;function rx(e){return(typeof e=="string"?e:""+e).replace(N0,`
|
|
50
|
-
`).replace(w0,"")}function cx(e,t){return t=rx(t),rx(e)===t}function Qt(e,t,s,i,u,f){switch(s){case"children":typeof i=="string"?t==="body"||t==="textarea"&&i===""||P(e,i):(typeof i=="number"||typeof i=="bigint")&&t!=="body"&&P(e,""+i);break;case"className":vt(e,"class",i);break;case"tabIndex":vt(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":vt(e,s,i);break;case"style":Ge(e,i,f);break;case"data":if(t!=="object"){vt(e,"data",i);break}case"src":case"href":if(i===""&&(t!=="a"||s!=="href")){e.removeAttribute(s);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(s);break}i=jn(""+i),e.setAttribute(s,i);break;case"action":case"formAction":if(typeof i=="function"){e.setAttribute(s,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof f=="function"&&(s==="formAction"?(t!=="input"&&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(s);break}i=jn(""+i),e.setAttribute(s,i);break;case"onClick":i!=null&&(e.onclick=At);break;case"onScroll":i!=null&>("scroll",e);break;case"onScrollEnd":i!=null&>("scrollend",e);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(c(61));if(s=i.__html,s!=null){if(u.children!=null)throw Error(c(60));e.innerHTML=s}}break;case"multiple":e.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":e.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){e.removeAttribute("xlink:href");break}s=jn(""+i),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(s,""+i):e.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":i&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(s,""):e.removeAttribute(s);break;case"capture":case"download":i===!0?e.setAttribute(s,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(s,i):e.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(s,i):e.removeAttribute(s);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?e.removeAttribute(s):e.setAttribute(s,i);break;case"popover":gt("beforetoggle",e),gt("toggle",e),ns(e,"popover",i);break;case"xlinkActuate":xn(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":xn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":xn(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":xn(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":xn(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":xn(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":xn(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":xn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":xn(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":ns(e,"is",i);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=Ct.get(s)||s,ns(e,s,i))}}function Mh(e,t,s,i,u,f){switch(s){case"style":Ge(e,i,f);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(c(61));if(s=i.__html,s!=null){if(u.children!=null)throw Error(c(60));e.innerHTML=s}}break;case"children":typeof i=="string"?P(e,i):(typeof i=="number"||typeof i=="bigint")&&P(e,""+i);break;case"onScroll":i!=null&>("scroll",e);break;case"onScrollEnd":i!=null&>("scrollend",e);break;case"onClick":i!=null&&(e.onclick=At);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Un.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(u=s.endsWith("Capture"),t=s.slice(2,u?s.length-7:void 0),f=e[We]||null,f=f!=null?f[s]:null,typeof f=="function"&&e.removeEventListener(t,f,u),typeof i=="function")){typeof f!="function"&&f!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(t,i,u);break e}s in e?e[s]=i:i===!0?e.setAttribute(s,""):ns(e,s,i)}}}function fs(e,t,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":gt("error",e),gt("load",e);var i=!1,u=!1,f;for(f in s)if(s.hasOwnProperty(f)){var _=s[f];if(_!=null)switch(f){case"src":i=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Qt(e,t,f,_,s,null)}}u&&Qt(e,t,"srcSet",s.srcSet,s,null),i&&Qt(e,t,"src",s.src,s,null);return;case"input":gt("invalid",e);var N=f=_=u=null,O=null,ne=null;for(i in s)if(s.hasOwnProperty(i)){var he=s[i];if(he!=null)switch(i){case"name":u=he;break;case"type":_=he;break;case"checked":O=he;break;case"defaultChecked":ne=he;break;case"value":f=he;break;case"defaultValue":N=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(c(137,t));break;default:Qt(e,t,i,he,s,null)}}bn(e,f,N,O,ne,_,u,!1);return;case"select":gt("invalid",e),i=_=f=null;for(u in s)if(s.hasOwnProperty(u)&&(N=s[u],N!=null))switch(u){case"value":f=N;break;case"defaultValue":_=N;break;case"multiple":i=N;default:Qt(e,t,u,N,s,null)}t=f,s=_,e.multiple=!!i,t!=null?xt(e,!!i,t,!1):s!=null&&xt(e,!!i,s,!0);return;case"textarea":gt("invalid",e),f=u=i=null;for(_ in s)if(s.hasOwnProperty(_)&&(N=s[_],N!=null))switch(_){case"value":i=N;break;case"defaultValue":u=N;break;case"children":f=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(c(91));break;default:Qt(e,t,_,N,s,null)}T(e,i,u,f);return;case"option":for(O in s)if(s.hasOwnProperty(O)&&(i=s[O],i!=null))switch(O){case"selected":e.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:Qt(e,t,O,i,s,null)}return;case"dialog":gt("beforetoggle",e),gt("toggle",e),gt("cancel",e),gt("close",e);break;case"iframe":case"object":gt("load",e);break;case"video":case"audio":for(i=0;i<nu.length;i++)gt(nu[i],e);break;case"image":gt("error",e),gt("load",e);break;case"details":gt("toggle",e);break;case"embed":case"source":case"link":gt("error",e),gt("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(ne in s)if(s.hasOwnProperty(ne)&&(i=s[ne],i!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Qt(e,t,ne,i,s,null)}return;default:if(He(t)){for(he in s)s.hasOwnProperty(he)&&(i=s[he],i!==void 0&&Mh(e,t,he,i,s,void 0));return}}for(N in s)s.hasOwnProperty(N)&&(i=s[N],i!=null&&Qt(e,t,N,i,s,null))}function k0(e,t,s,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,f=null,_=null,N=null,O=null,ne=null,he=null;for(oe in s){var xe=s[oe];if(s.hasOwnProperty(oe)&&xe!=null)switch(oe){case"checked":break;case"value":break;case"defaultValue":O=xe;default:i.hasOwnProperty(oe)||Qt(e,t,oe,null,i,xe)}}for(var le in i){var oe=i[le];if(xe=s[le],i.hasOwnProperty(le)&&(oe!=null||xe!=null))switch(le){case"type":f=oe;break;case"name":u=oe;break;case"checked":ne=oe;break;case"defaultChecked":he=oe;break;case"value":_=oe;break;case"defaultValue":N=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(c(137,t));break;default:oe!==xe&&Qt(e,t,le,oe,i,xe)}}Gs(e,_,N,O,ne,he,f,u);return;case"select":oe=_=N=le=null;for(f in s)if(O=s[f],s.hasOwnProperty(f)&&O!=null)switch(f){case"value":break;case"multiple":oe=O;default:i.hasOwnProperty(f)||Qt(e,t,f,null,i,O)}for(u in i)if(f=i[u],O=s[u],i.hasOwnProperty(u)&&(f!=null||O!=null))switch(u){case"value":le=f;break;case"defaultValue":N=f;break;case"multiple":_=f;default:f!==O&&Qt(e,t,u,f,i,O)}t=N,s=_,i=oe,le!=null?xt(e,!!s,le,!1):!!i!=!!s&&(t!=null?xt(e,!!s,t,!0):xt(e,!!s,s?[]:"",!1));return;case"textarea":oe=le=null;for(N in s)if(u=s[N],s.hasOwnProperty(N)&&u!=null&&!i.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:Qt(e,t,N,null,i,u)}for(_ in i)if(u=i[_],f=s[_],i.hasOwnProperty(_)&&(u!=null||f!=null))switch(_){case"value":le=u;break;case"defaultValue":oe=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(c(91));break;default:u!==f&&Qt(e,t,_,u,i,f)}je(e,le,oe);return;case"option":for(var Ue in s)if(le=s[Ue],s.hasOwnProperty(Ue)&&le!=null&&!i.hasOwnProperty(Ue))switch(Ue){case"selected":e.selected=!1;break;default:Qt(e,t,Ue,null,i,le)}for(O in i)if(le=i[O],oe=s[O],i.hasOwnProperty(O)&&le!==oe&&(le!=null||oe!=null))switch(O){case"selected":e.selected=le&&typeof le!="function"&&typeof le!="symbol";break;default:Qt(e,t,O,le,i,oe)}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 Fe in s)le=s[Fe],s.hasOwnProperty(Fe)&&le!=null&&!i.hasOwnProperty(Fe)&&Qt(e,t,Fe,null,i,le);for(ne in i)if(le=i[ne],oe=s[ne],i.hasOwnProperty(ne)&&le!==oe&&(le!=null||oe!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(c(137,t));break;default:Qt(e,t,ne,le,i,oe)}return;default:if(He(t)){for(var Kt in s)le=s[Kt],s.hasOwnProperty(Kt)&&le!==void 0&&!i.hasOwnProperty(Kt)&&Mh(e,t,Kt,void 0,i,le);for(he in i)le=i[he],oe=s[he],!i.hasOwnProperty(he)||le===oe||le===void 0&&oe===void 0||Mh(e,t,he,le,i,oe);return}}for(var F in s)le=s[F],s.hasOwnProperty(F)&&le!=null&&!i.hasOwnProperty(F)&&Qt(e,t,F,null,i,le);for(xe in i)le=i[xe],oe=s[xe],!i.hasOwnProperty(xe)||le===oe||le==null&&oe==null||Qt(e,t,xe,le,i,oe)}function ox(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function S0(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,s=performance.getEntriesByType("resource"),i=0;i<s.length;i++){var u=s[i],f=u.transferSize,_=u.initiatorType,N=u.duration;if(f&&N&&ox(_)){for(_=0,N=u.responseEnd,i+=1;i<s.length;i++){var O=s[i],ne=O.startTime;if(ne>N)break;var he=O.transferSize,xe=O.initiatorType;he&&ox(xe)&&(O=O.responseEnd,_+=he*(O<N?1:(N-ne)/(O-ne)))}if(--i,t+=8*(f+_)/(u.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Rh=null,Dh=null;function kd(e){return e.nodeType===9?e:e.ownerDocument}function ux(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 dx(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 Oh(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 Lh=null;function E0(){var e=window.event;return e&&e.type==="popstate"?e===Lh?!1:(Lh=e,!0):(Lh=null,!1)}var fx=typeof setTimeout=="function"?setTimeout:void 0,T0=typeof clearTimeout=="function"?clearTimeout:void 0,hx=typeof Promise=="function"?Promise:void 0,C0=typeof queueMicrotask=="function"?queueMicrotask:typeof hx<"u"?function(e){return hx.resolve(null).then(e).catch(A0)}:fx;function A0(e){setTimeout(function(){throw e})}function Qi(e){return e==="head"}function px(e,t){var s=t,i=0;do{var u=s.nextSibling;if(e.removeChild(s),u&&u.nodeType===8)if(s=u.data,s==="/$"||s==="/&"){if(i===0){e.removeChild(u),Fc(t);return}i--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")i++;else if(s==="html")lu(e.ownerDocument.documentElement);else if(s==="head"){s=e.ownerDocument.head,lu(s);for(var f=s.firstChild;f;){var _=f.nextSibling,N=f.nodeName;f[An]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&f.rel.toLowerCase()==="stylesheet"||s.removeChild(f),f=_}}else s==="body"&&lu(e.ownerDocument.body);s=u}while(s);Fc(t)}function mx(e,t){var s=e;e=0;do{var i=s.nextSibling;if(s.nodeType===1?t?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(t?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),i&&i.nodeType===8)if(s=i.data,s==="/$"){if(e===0)break;e--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||e++;s=i}while(s)}function zh(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var s=t;switch(t=t.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":zh(s),al(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function M0(e,t,s,i){for(;e.nodeType===1;){var u=s;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[An])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=El(e.nextSibling),e===null)break}return null}function R0(e,t,s){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=El(e.nextSibling),e===null))return null;return e}function gx(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=El(e.nextSibling),e===null))return null;return e}function Uh(e){return e.data==="$?"||e.data==="$~"}function Ih(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function D0(e,t){var s=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||s.readyState!=="loading")t();else{var i=function(){t(),s.removeEventListener("DOMContentLoaded",i)};s.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}function El(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 Bh=null;function xx(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"||s==="/&"){if(t===0)return El(e.nextSibling);t--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||t++}e=e.nextSibling}return null}function bx(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(t===0)return e;t--}else s!=="/$"&&s!=="/&"||t++}e=e.previousSibling}return null}function _x(e,t,s){switch(t=kd(s),e){case"html":if(e=t.documentElement,!e)throw Error(c(452));return e;case"head":if(e=t.head,!e)throw Error(c(453));return e;case"body":if(e=t.body,!e)throw Error(c(454));return e;default:throw Error(c(451))}}function lu(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);al(e)}var Tl=new Map,yx=new Set;function Sd(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ci=U.d;U.d={f:O0,r:L0,D:z0,C:U0,L:I0,m:B0,X:$0,S:H0,M:q0};function O0(){var e=ci.f(),t=xd();return e||t}function L0(e){var t=il(e);t!==null&&t.tag===5&&t.type==="form"?Um(t):ci.r(e)}var Vc=typeof document>"u"?null:document;function vx(e,t,s){var i=Vc;if(i&&typeof t=="string"&&t){var u=Dn(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof s=="string"&&(u+='[crossorigin="'+s+'"]'),yx.has(u)||(yx.add(u),e={rel:e,crossOrigin:s,href:t},i.querySelector(u)===null&&(t=i.createElement("link"),fs(t,"link",e),Ut(t),i.head.appendChild(t)))}}function z0(e){ci.D(e),vx("dns-prefetch",e,null)}function U0(e,t){ci.C(e,t),vx("preconnect",e,t)}function I0(e,t,s){ci.L(e,t,s);var i=Vc;if(i&&e&&t){var u='link[rel="preload"][as="'+Dn(t)+'"]';t==="image"&&s&&s.imageSrcSet?(u+='[imagesrcset="'+Dn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(u+='[imagesizes="'+Dn(s.imageSizes)+'"]')):u+='[href="'+Dn(e)+'"]';var f=u;switch(t){case"style":f=Qc(e);break;case"script":f=Kc(e)}Tl.has(f)||(e=j({rel:"preload",href:t==="image"&&s&&s.imageSrcSet?void 0:e,as:t},s),Tl.set(f,e),i.querySelector(u)!==null||t==="style"&&i.querySelector(au(f))||t==="script"&&i.querySelector(iu(f))||(t=i.createElement("link"),fs(t,"link",e),Ut(t),i.head.appendChild(t)))}}function B0(e,t){ci.m(e,t);var s=Vc;if(s&&e){var i=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+Dn(i)+'"][href="'+Dn(e)+'"]',f=u;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=Kc(e)}if(!Tl.has(f)&&(e=j({rel:"modulepreload",href:e},t),Tl.set(f,e),s.querySelector(u)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(iu(f)))return}i=s.createElement("link"),fs(i,"link",e),Ut(i),s.head.appendChild(i)}}}function H0(e,t,s){ci.S(e,t,s);var i=Vc;if(i&&e){var u=Mn(i).hoistableStyles,f=Qc(e);t=t||"default";var _=u.get(f);if(!_){var N={loading:0,preload:null};if(_=i.querySelector(au(f)))N.loading=5;else{e=j({rel:"stylesheet",href:e,"data-precedence":t},s),(s=Tl.get(f))&&Hh(e,s);var O=_=i.createElement("link");Ut(O),fs(O,"link",e),O._p=new Promise(function(ne,he){O.onload=ne,O.onerror=he}),O.addEventListener("load",function(){N.loading|=1}),O.addEventListener("error",function(){N.loading|=2}),N.loading|=4,Ed(_,t,i)}_={type:"stylesheet",instance:_,count:1,state:N},u.set(f,_)}}}function $0(e,t){ci.X(e,t);var s=Vc;if(s&&e){var i=Mn(s).hoistableScripts,u=Kc(e),f=i.get(u);f||(f=s.querySelector(iu(u)),f||(e=j({src:e,async:!0},t),(t=Tl.get(u))&&$h(e,t),f=s.createElement("script"),Ut(f),fs(f,"link",e),s.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},i.set(u,f))}}function q0(e,t){ci.M(e,t);var s=Vc;if(s&&e){var i=Mn(s).hoistableScripts,u=Kc(e),f=i.get(u);f||(f=s.querySelector(iu(u)),f||(e=j({src:e,async:!0,type:"module"},t),(t=Tl.get(u))&&$h(e,t),f=s.createElement("script"),Ut(f),fs(f,"link",e),s.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},i.set(u,f))}}function jx(e,t,s,i){var u=(u=we.current)?Sd(u):null;if(!u)throw Error(c(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(t=Qc(s.href),s=Mn(u).hoistableStyles,i=s.get(t),i||(i={type:"style",instance:null,count:0,state:null},s.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){e=Qc(s.href);var f=Mn(u).hoistableStyles,_=f.get(e);if(_||(u=u.ownerDocument||u,_={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,_),(f=u.querySelector(au(e)))&&!f._p&&(_.instance=f,_.state.loading=5),Tl.has(e)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},Tl.set(e,s),f||G0(u,e,s,_.state))),t&&i===null)throw Error(c(528,""));return _}if(t&&i!==null)throw Error(c(529,""));return null;case"script":return t=s.async,s=s.src,typeof s=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Kc(s),s=Mn(u).hoistableScripts,i=s.get(t),i||(i={type:"script",instance:null,count:0,state:null},s.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,e))}}function Qc(e){return'href="'+Dn(e)+'"'}function au(e){return'link[rel="stylesheet"]['+e+"]"}function Nx(e){return j({},e,{"data-precedence":e.precedence,precedence:null})}function G0(e,t,s,i){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?i.loading=1:(t=e.createElement("link"),i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2}),fs(t,"link",s),Ut(t),e.head.appendChild(t))}function Kc(e){return'[src="'+Dn(e)+'"]'}function iu(e){return"script[async]"+e}function wx(e,t,s){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+Dn(s.href)+'"]');if(i)return t.instance=i,Ut(i),i;var u=j({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),Ut(i),fs(i,"style",u),Ed(i,s.precedence,e),t.instance=i;case"stylesheet":u=Qc(s.href);var f=e.querySelector(au(u));if(f)return t.state.loading|=4,t.instance=f,Ut(f),f;i=Nx(s),(u=Tl.get(u))&&Hh(i,u),f=(e.ownerDocument||e).createElement("link"),Ut(f);var _=f;return _._p=new Promise(function(N,O){_.onload=N,_.onerror=O}),fs(f,"link",i),t.state.loading|=4,Ed(f,s.precedence,e),t.instance=f;case"script":return f=Kc(s.src),(u=e.querySelector(iu(f)))?(t.instance=u,Ut(u),u):(i=s,(u=Tl.get(f))&&(i=j({},s),$h(i,u)),e=e.ownerDocument||e,u=e.createElement("script"),Ut(u),fs(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,Ed(i,s.precedence,e));return t.instance}function Ed(e,t,s){for(var i=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=i.length?i[i.length-1]:null,f=u,_=0;_<i.length;_++){var N=i[_];if(N.dataset.precedence===t)f=N;else if(f!==u)break}f?f.parentNode.insertBefore(e,f.nextSibling):(t=s.nodeType===9?s.head:s,t.insertBefore(e,t.firstChild))}function Hh(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function $h(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Td=null;function kx(e,t,s){if(Td===null){var i=new Map,u=Td=new Map;u.set(s,i)}else u=Td,i=u.get(s),i||(i=new Map,u.set(s,i));if(i.has(e))return i;for(i.set(e,null),s=s.getElementsByTagName(e),u=0;u<s.length;u++){var f=s[u];if(!(f[An]||f[zt]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var _=f.getAttribute(t)||"";_=e+_;var N=i.get(_);N?N.push(f):i.set(_,[f])}}return i}function Sx(e,t,s){e=e.ownerDocument||e,e.head.insertBefore(s,t==="title"?e.querySelector("head > title"):null)}function Y0(e,t,s){if(s===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Ex(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function X0(e,t,s,i){if(s.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var u=Qc(i.href),f=t.querySelector(au(u));if(f){t=f._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Cd.bind(e),t.then(e,e)),s.state.loading|=4,s.instance=f,Ut(f);return}f=t.ownerDocument||t,i=Nx(i),(u=Tl.get(u))&&Hh(i,u),f=f.createElement("link"),Ut(f);var _=f;_._p=new Promise(function(N,O){_.onload=N,_.onerror=O}),fs(f,"link",i),s.instance=f}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(s,t),(t=s.state.preload)&&(s.state.loading&3)===0&&(e.count++,s=Cd.bind(e),t.addEventListener("load",s),t.addEventListener("error",s))}}var qh=0;function V0(e,t){return e.stylesheets&&e.count===0&&Md(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var i=setTimeout(function(){if(e.stylesheets&&Md(e,e.stylesheets),e.unsuspend){var f=e.unsuspend;e.unsuspend=null,f()}},6e4+t);0<e.imgBytes&&qh===0&&(qh=62500*S0());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Md(e,e.stylesheets),e.unsuspend)){var f=e.unsuspend;e.unsuspend=null,f()}},(e.imgBytes>qh?50:800)+t);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(u)}}:null}function Cd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Md(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Ad=null;function Md(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ad=new Map,t.forEach(Q0,e),Ad=null,Cd.call(e))}function Q0(e,t){if(!(t.state.loading&4)){var s=Ad.get(e);if(s)var i=s.get(null);else{s=new Map,Ad.set(e,s);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<u.length;f++){var _=u[f];(_.nodeName==="LINK"||_.getAttribute("media")!=="not all")&&(s.set(_.dataset.precedence,_),i=_)}i&&s.set(null,i)}u=t.instance,_=u.getAttribute("data-precedence"),f=s.get(_)||i,f===i&&s.set(null,u),s.set(_,u),this.count++,i=Cd.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 ru={$$typeof:$,Provider:null,Consumer:null,_currentValue:ce,_currentValue2:ce,_threadCount:0};function K0(e,t,s,i,u,f,_,N,O){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=Yt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yt(0),this.hiddenUpdates=Yt(null),this.identifierPrefix=i,this.onUncaughtError=u,this.onCaughtError=f,this.onRecoverableError=_,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=O,this.incompleteTransitions=new Map}function Tx(e,t,s,i,u,f,_,N,O,ne,he,xe){return e=new K0(e,t,s,_,O,ne,he,xe,N),t=1,f===!0&&(t|=24),f=Ds(3,null,null,t),e.current=f,f.stateNode=e,t=zo(),t.refCount++,e.pooledCache=t,t.refCount++,f.memoizedState={element:i,isDehydrated:s,cache:t},Mc(f),e}function Cx(e){return e?(e=Si,e):Si}function Ax(e,t,s,i,u,f){u=Cx(u),i.context===null?i.context=u:i.pendingContext=u,i=Sl(t),i.payload={element:s},f=f===void 0?null:f,f!==null&&(i.callback=f),s=ql(e,i,t),s!==null&&(nl(s,e,t),ha(s,e,t))}function Mx(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<t?s:t}}function Gh(e,t){Mx(e,t),(e=e.alternate)&&Mx(e,t)}function Rx(e){if(e.tag===13||e.tag===31){var t=qa(e,67108864);t!==null&&nl(t,e,67108864),Gh(e,67108864)}}function Dx(e){if(e.tag===13||e.tag===31){var t=ml();t=Es(t);var s=qa(e,t);s!==null&&nl(s,e,t),Gh(e,t)}}var Rd=!0;function F0(e,t,s,i){var u=D.T;D.T=null;var f=U.p;try{U.p=2,Yh(e,t,s,i)}finally{U.p=f,D.T=u}}function Z0(e,t,s,i){var u=D.T;D.T=null;var f=U.p;try{U.p=8,Yh(e,t,s,i)}finally{U.p=f,D.T=u}}function Yh(e,t,s,i){if(Rd){var u=Xh(i);if(u===null)Ah(e,t,i,Dd,s),Lx(e,i);else if(P0(u,e,t,s,i))i.stopPropagation();else if(Lx(e,i),t&4&&-1<J0.indexOf(e)){for(;u!==null;){var f=il(u);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var _=nt(f.pendingLanes);if(_!==0){var N=f;for(N.pendingLanes|=2,N.entangledLanes|=2;_;){var O=1<<31-Wt(_);N.entanglements[1]|=O,_&=~O}_a(f),(Ot&6)===0&&(md=Xe()+500,tu(0))}}break;case 31:case 13:N=qa(f,2),N!==null&&nl(N,f,2),xd(),Gh(f,2)}if(f=Xh(i),f===null&&Ah(e,t,i,Dd,s),f===u)break;u=f}u!==null&&i.stopPropagation()}else Ah(e,t,i,null,s)}}function Xh(e){return e=_n(e),Vh(e)}var Dd=null;function Vh(e){if(Dd=null,e=xl(e),e!==null){var t=d(e);if(t===null)e=null;else{var s=t.tag;if(s===13){if(e=h(t),e!==null)return e;e=null}else if(s===31){if(e=m(t),e!==null)return e;e=null}else if(s===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Dd=e,null}function Ox(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(vn()){case zn:return 2;case Tt:return 8;case tn:case is:return 32;case gn:return 268435456;default:return 32}default:return 32}}var Qh=!1,Ki=null,Fi=null,Zi=null,cu=new Map,ou=new Map,Ji=[],J0="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 Lx(e,t){switch(e){case"focusin":case"focusout":Ki=null;break;case"dragenter":case"dragleave":Fi=null;break;case"mouseover":case"mouseout":Zi=null;break;case"pointerover":case"pointerout":cu.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ou.delete(t.pointerId)}}function uu(e,t,s,i,u,f){return e===null||e.nativeEvent!==f?(e={blockedOn:t,domEventName:s,eventSystemFlags:i,nativeEvent:f,targetContainers:[u]},t!==null&&(t=il(t),t!==null&&Rx(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function P0(e,t,s,i,u){switch(t){case"focusin":return Ki=uu(Ki,e,t,s,i,u),!0;case"dragenter":return Fi=uu(Fi,e,t,s,i,u),!0;case"mouseover":return Zi=uu(Zi,e,t,s,i,u),!0;case"pointerover":var f=u.pointerId;return cu.set(f,uu(cu.get(f)||null,e,t,s,i,u)),!0;case"gotpointercapture":return f=u.pointerId,ou.set(f,uu(ou.get(f)||null,e,t,s,i,u)),!0}return!1}function zx(e){var t=xl(e.target);if(t!==null){var s=d(t);if(s!==null){if(t=s.tag,t===13){if(t=h(s),t!==null){e.blockedOn=t,dn(e.priority,function(){Dx(s)});return}}else if(t===31){if(t=m(s),t!==null){e.blockedOn=t,dn(e.priority,function(){Dx(s)});return}}else if(t===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Od(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var s=Xh(e.nativeEvent);if(s===null){s=e.nativeEvent;var i=new s.constructor(s.type,s);Nn=i,s.target.dispatchEvent(i),Nn=null}else return t=il(s),t!==null&&Rx(t),e.blockedOn=s,!1;t.shift()}return!0}function Ux(e,t,s){Od(e)&&s.delete(t)}function W0(){Qh=!1,Ki!==null&&Od(Ki)&&(Ki=null),Fi!==null&&Od(Fi)&&(Fi=null),Zi!==null&&Od(Zi)&&(Zi=null),cu.forEach(Ux),ou.forEach(Ux)}function Ld(e,t){e.blockedOn===t&&(e.blockedOn=null,Qh||(Qh=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,W0)))}var zd=null;function Ix(e){zd!==e&&(zd=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){zd===e&&(zd=null);for(var t=0;t<e.length;t+=3){var s=e[t],i=e[t+1],u=e[t+2];if(typeof i!="function"){if(Vh(i||s)===null)continue;break}var f=il(s);f!==null&&(e.splice(t,3),t-=3,Xf(f,{pending:!0,data:u,method:s.method,action:i},i,u))}}))}function Fc(e){function t(O){return Ld(O,e)}Ki!==null&&Ld(Ki,e),Fi!==null&&Ld(Fi,e),Zi!==null&&Ld(Zi,e),cu.forEach(t),ou.forEach(t);for(var s=0;s<Ji.length;s++){var i=Ji[s];i.blockedOn===e&&(i.blockedOn=null)}for(;0<Ji.length&&(s=Ji[0],s.blockedOn===null);)zx(s),s.blockedOn===null&&Ji.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(i=0;i<s.length;i+=3){var u=s[i],f=s[i+1],_=u[We]||null;if(typeof f=="function")_||Ix(s);else if(_){var N=null;if(f&&f.hasAttribute("formAction")){if(u=f,_=f[We]||null)N=_.formAction;else if(Vh(u)!==null)continue}else N=_.action;typeof N=="function"?s[i+1]=N:(s.splice(i,3),i-=3),Ix(s)}}}function Bx(){function e(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(_){return u=_})},focusReset:"manual",scroll:"manual"})}function t(){u!==null&&(u(),u=null),i||setTimeout(s,20)}function s(){if(!i&&!navigation.transition){var f=navigation.currentEntry;f&&f.url!=null&&navigation.navigate(f.url,{state:f.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var i=!1,u=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(s,100),function(){i=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),u!==null&&(u(),u=null)}}}function Kh(e){this._internalRoot=e}Ud.prototype.render=Kh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var s=t.current,i=ml();Ax(s,i,e,t,null,null)},Ud.prototype.unmount=Kh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ax(e.current,2,null,e,null,null),xd(),t[rs]=null}};function Ud(e){this._internalRoot=e}Ud.prototype.unstable_scheduleHydration=function(e){if(e){var t=ll();e={blockedOn:null,target:e,priority:t};for(var s=0;s<Ji.length&&t!==0&&t<Ji[s].priority;s++);Ji.splice(s,0,e),s===0&&zx(e)}};var Hx=l.version;if(Hx!=="19.2.8")throw Error(c(527,Hx,"19.2.8"));U.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=b(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var ev={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:D,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Id=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Id.isDisabled&&Id.supportsFiber)try{Et=Id.inject(ev),Pt=Id}catch{}}return fu.createRoot=function(e,t){if(!o(e))throw Error(c(299));var s=!1,i="",u=Qm,f=Km,_=Fm;return t!=null&&(t.unstable_strictMode===!0&&(s=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onUncaughtError!==void 0&&(u=t.onUncaughtError),t.onCaughtError!==void 0&&(f=t.onCaughtError),t.onRecoverableError!==void 0&&(_=t.onRecoverableError)),t=Tx(e,1,!1,null,null,s,i,null,u,f,_,Bx),e[rs]=t.current,Ch(e),new Kh(t)},fu.hydrateRoot=function(e,t,s){if(!o(e))throw Error(c(299));var i=!1,u="",f=Qm,_=Km,N=Fm,O=null;return s!=null&&(s.unstable_strictMode===!0&&(i=!0),s.identifierPrefix!==void 0&&(u=s.identifierPrefix),s.onUncaughtError!==void 0&&(f=s.onUncaughtError),s.onCaughtError!==void 0&&(_=s.onCaughtError),s.onRecoverableError!==void 0&&(N=s.onRecoverableError),s.formState!==void 0&&(O=s.formState)),t=Tx(e,1,!0,t,s??null,i,u,O,f,_,N,Bx),t.context=Cx(null),s=t.current,i=ml(),i=Es(i),u=Sl(i),u.callback=null,ql(s,u,i),s=i,t.current.lanes=s,Tn(t,s),_a(t),e[rs]=t.current,Ch(e),new Ud(t)},fu.version="19.2.8",fu}var Jx;function fv(){if(Jx)return Ph.exports;Jx=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),Ph.exports=dv(),Ph.exports}var hv=fv();const D_=1,sr="main",Px=["skills","agents","hooks","commands","plugins","output-styles","CLAUDE.md","settings.json","keybindings.json"],hi=["orange","blue","green","purple","pink","teal"];function pv(n){return`${n.replace(/[^\p{L}\p{N}\p{M}]/gu,"-").replace(/-+/g,"-").toLowerCase().replace(/^-|-$/g,"")||"project"}-${O_(n)}`}function mv(n){const l=n.replace(/[^a-zA-Z0-9]/g,"-").replace(/-+/g,"-").toLowerCase(),r=`${l.replace(/^-+|-+$/g,"")||"project"}-${O_(n)}`,c=pv(n);return[l,r].filter(o=>o!==c)}function O_(n){const l=/^[a-zA-Z]:[\\/]|^\\\\/.test(n);return gv(l?n.toLowerCase():n)}function gv(n){let l=3735928559,r=1103547991;for(let c=0;c<n.length;c++){const o=n.charCodeAt(c);l=Math.imul(l^o,2654435761),r=Math.imul(r^o,1597334677)}return l=Math.imul(l^l>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507)^Math.imul(l^l>>>13,3266489909),(4294967296*(2097151&r)+(l>>>0)).toString(36)}const Bp=x.createContext({accounts:[],auth:{},multi:!1});function Hp(){return x.useContext(Bp)}function xv(n,l="claude"){const{accounts:r,multi:c}=x.useContext(Bp);return!c||l==="antigravity"||!n?null:r.find(o=>o.id===n)??null}const tf={orange:"оранжевый",blue:"синий",green:"зелёный",purple:"фиолетовый",pink:"розовый",teal:"бирюзовый"};function L_(n){const l=Array.from(n.trim())[0];return l?l.toUpperCase():"?"}function z_(n){return n?n.loggedIn?n.plan||"вход выполнен":"вход не выполнен":""}const U_="ccv:last-account";function bv(){try{return localStorage.getItem(U_)}catch{return null}}function _v(n){try{localStorage.setItem(U_,n)}catch{}}function Ra({account:n,size:l="sm",className:r}){const c=`Аккаунт «${n.name}», ${tf[n.color]}`;return a.jsx("span",{className:`acct-mark acct-mark--${l} acct--${n.color}${r?` ${r}`:""}`,role:"img","aria-label":c,title:c,children:a.jsx("span",{"aria-hidden":"true",children:L_(n.name)})})}function Wx({account:n,onClick:l,className:r}){const c=a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"acct-mark acct-mark--sm","aria-hidden":"true",children:a.jsx("span",{children:L_(n.name)})}),a.jsx("span",{className:"acct-chip__name",children:n.name})]}),o=`acct-chip acct--${n.color}${r?` ${r}`:""}`,d=`Сессия идёт под аккаунтом «${n.name}» — лимиты и тариф берутся из него`;return l?a.jsx("button",{type:"button",className:o,title:d,"aria-label":`Аккаунт «${n.name}». Открыть аккаунты`,onClick:l,children:c}):a.jsx("span",{className:o,title:d,role:"group","aria-label":`Аккаунт «${n.name}»`,children:c})}var fi,ro,co,oo,uo,Au,fo,jf,I_;class yv{constructor(l){yn(this,jf);yn(this,fi,null);yn(this,ro,new Set);yn(this,co,500);yn(this,oo,null);yn(this,uo,!1);yn(this,Au,null);yn(this,fo,null);this.url=l}get statusText(){return this.connected?"Хост на связи":"Нет связи с хостом"}onStatus(l){Lt(this,fo,l)}connect(){if(Pe(this,uo))return;const l=new WebSocket(this.url);Lt(this,fi,l),l.addEventListener("open",()=>{var r,c;Lt(this,co,500),this.send({type:"hello",protocol:D_,clientName:"ccv-web"}),(r=Pe(this,Au))==null||r.call(this),(c=Pe(this,fo))==null||c.call(this)}),l.addEventListener("message",r=>{let c;try{c=JSON.parse(String(r.data))}catch{return}for(const o of Pe(this,ro))o(c)}),l.addEventListener("close",()=>{var r;Lt(this,fi,null),(r=Pe(this,fo))==null||r.call(this),Qn(this,jf,I_).call(this)}),l.addEventListener("error",()=>l.close())}onReconnect(l){Lt(this,Au,l)}on(l){return Pe(this,ro).add(l),()=>Pe(this,ro).delete(l)}send(l){var r;((r=Pe(this,fi))==null?void 0:r.readyState)===WebSocket.OPEN&&Pe(this,fi).send(JSON.stringify(l))}get connected(){var l;return((l=Pe(this,fi))==null?void 0:l.readyState)===WebSocket.OPEN}close(){var l;Lt(this,uo,!0),(l=Pe(this,fi))==null||l.close()}}fi=new WeakMap,ro=new WeakMap,co=new WeakMap,oo=new WeakMap,uo=new WeakMap,Au=new WeakMap,fo=new WeakMap,jf=new WeakSet,I_=function(){if(Pe(this,uo)||Pe(this,oo)!==null)return;const l=Pe(this,co);Lt(this,co,Math.min(l*2,1e4)),Lt(this,oo,window.setTimeout(()=>{Lt(this,oo,null),this.connect()},l))};const vv=1,B_="ccv:relay",nf="ccv:relay.host";function jv(){try{const n=localStorage.getItem(B_);if(!n)return null;const l=JSON.parse(n);return typeof(l==null?void 0:l.token)!="string"||typeof l.expiresAt=="number"&&l.expiresAt<=Date.now()?null:l}catch{return null}}function H_(){localStorage.removeItem(B_)}var Ea,ho,Ta,po,mo,rr,Gr,Yr,cr,Xr,go,Vr,Qr,cn,tr,vp,$_,Hr,jp;class Nv{constructor(l){yn(this,cn);yn(this,Ea,null);yn(this,ho,new Set);yn(this,Ta,null);yn(this,po,null);yn(this,mo,500);yn(this,rr,null);yn(this,Gr,!1);yn(this,Yr,!1);yn(this,cr,!1);yn(this,Xr,null);yn(this,go,"Подключаемся…");yn(this,Vr,0);yn(this,Qr,[]);this.session=l}get connected(){return Pe(this,Yr)&&Pe(this,cr)}get statusText(){return Pe(this,go)}get hostId(){return Pe(this,Xr)}on(l){return Pe(this,ho).add(l),()=>Pe(this,ho).delete(l)}onReconnect(l){Lt(this,po,l)}onStatus(l){Lt(this,Ta,l)}connect(){Pe(this,Gr)||Qn(this,cn,vp).call(this)}send(l){if(!Pe(this,Yr)){Pe(this,Qr).length<64&&Pe(this,Qr).push(l);return}Qn(this,cn,Hr).call(this,{t:"client.frame",body:l})}close(){var l;Lt(this,Gr,!0),Pe(this,rr)!==null&&window.clearTimeout(Pe(this,rr)),(l=Pe(this,Ea))==null||l.close()}}Ea=new WeakMap,ho=new WeakMap,Ta=new WeakMap,po=new WeakMap,mo=new WeakMap,rr=new WeakMap,Gr=new WeakMap,Yr=new WeakMap,cr=new WeakMap,Xr=new WeakMap,go=new WeakMap,Vr=new WeakMap,Qr=new WeakMap,cn=new WeakSet,tr=function(l){var r;Pe(this,go)!==l&&(Lt(this,go,l),(r=Pe(this,Ta))==null||r.call(this))},vp=async function(){if(Pe(this,Ea))return;if(!Pe(this,Xr))try{Lt(this,Xr,await wv(this.session.token))}catch(c){Qn(this,cn,tr).call(this,c instanceof Error?c.message:String(c)),Qn(this,cn,jp).call(this);return}const l=location.protocol==="https:"?"wss":"ws",r=new WebSocket(`${l}://${location.host}/relay/client`);Lt(this,Ea,r),r.addEventListener("open",()=>{Qn(this,cn,Hr).call(this,{t:"client.hello",protocol:vv,token:this.session.token})}),r.addEventListener("message",c=>{let o;try{o=JSON.parse(String(c.data))}catch{return}Qn(this,cn,$_).call(this,o)}),r.addEventListener("close",()=>{var c;Lt(this,Ea,null),Lt(this,Yr,!1),Lt(this,cr,!1),Qn(this,cn,tr).call(this,"Нет связи с сервером"),(c=Pe(this,Ta))==null||c.call(this),Qn(this,cn,jp).call(this)}),r.addEventListener("error",()=>r.close())},$_=function(l){var r,c,o,d,h,m,g;switch(l.t){case"client.ok":Lt(this,mo,500),Qn(this,cn,Hr).call(this,{t:"client.attach",hostId:Pe(this,Xr)??"",...Pe(this,Vr)>0?{sinceRseq:Pe(this,Vr)}:{}});return;case"client.attached":Lt(this,Yr,!0),Lt(this,cr,l.online),Lt(this,Vr,l.rseq),Qn(this,cn,tr).call(this,l.online?"Хост на связи":"Компьютер не на связи"),Qn(this,cn,Hr).call(this,{t:"client.frame",body:{type:"hello",protocol:D_,clientName:"ccv-web-relay"}});const b=Pe(this,Qr);Lt(this,Qr,[]);for(const y of b)Qn(this,cn,Hr).call(this,{t:"client.frame",body:y});(r=Pe(this,po))==null||r.call(this),(c=Pe(this,Ta))==null||c.call(this);return;case"host.frame":{l.rseq>0&&Lt(this,Vr,l.rseq);const y=l.body;for(const j of Pe(this,ho))j(y);return}case"host.online":Lt(this,cr,!0),Qn(this,cn,tr).call(this,"Хост на связи"),(o=Pe(this,po))==null||o.call(this),(d=Pe(this,Ta))==null||d.call(this);return;case"host.offline":Lt(this,cr,!1),Qn(this,cn,tr).call(this,"Компьютер не на связи"),(h=Pe(this,Ta))==null||h.call(this);return;case"ping":Qn(this,cn,Hr).call(this,{t:"pong",nonce:l.nonce});return;case"error":if(l.code==="auth"){H_(),location.href="/login";return}if(l.code==="not_found"){localStorage.removeItem(nf),Qn(this,cn,tr).call(this,"Этот компьютер отвязан от аккаунта"),Lt(this,Gr,!0),(m=Pe(this,Ea))==null||m.close();return}l.code!=="offline"&&Qn(this,cn,tr).call(this,l.message),(g=Pe(this,Ta))==null||g.call(this);return}},Hr=function(l){var r;((r=Pe(this,Ea))==null?void 0:r.readyState)===WebSocket.OPEN&&Pe(this,Ea).send(JSON.stringify(l))},jp=function(){if(Pe(this,Gr)||Pe(this,rr)!==null)return;const l=Pe(this,mo);Lt(this,mo,Math.min(l*2,1e4)),Lt(this,rr,window.setTimeout(()=>{Lt(this,rr,null),Qn(this,cn,vp).call(this)},l))};async function wv(n){const l=new URLSearchParams(location.search).get("host");if(l)return localStorage.setItem(nf,l),l;const r=localStorage.getItem(nf);if(r)return r;const c=await fetch("/api/hosts",{headers:{authorization:`Bearer ${n}`}});if(c.status===401)throw H_(),location.href="/login",new Error("нужен вход");const d=(await c.json()).hosts??[];if(d.length===1&&d[0])return localStorage.setItem(nf,d[0].id),d[0].id;throw location.href="/hosts",new Error("выберите компьютер")}function sf(){return location.pathname==="/app"||location.pathname.startsWith("/app/")?"relay":"local"}const kv=`${location.protocol==="https:"?"wss":"ws"}://${location.host}/ws`;function Sv(){if(sf()==="local")return new yv(kv);const n=jv();return n?new Nv(n):(location.replace(`/login?next=${encodeURIComponent(location.pathname+location.search)}`),null)}const q_="ccv:drafts",Ev=40,Tv=2e4,Cv=500;let ju=null,Nu=null;function $p(){if(ju)return ju;const n=new Map;try{const l=localStorage.getItem(q_);if(l){const r=JSON.parse(l);if(typeof r=="object"&&r!==null)for(const[c,o]of Object.entries(r))typeof o=="string"&&o!==""&&n.set(c,o)}}catch{}return ju=n,window.addEventListener("pagehide",X_),n}function np(n){return $p().get(n)??""}function G_(n,l){const r=$p(),c=l.slice(0,Tv),o=r.has(n);if(o&&r.delete(n),c!=="")r.set(n,c);else if(!o)return;for(;r.size>Ev;){const d=r.keys().next();if(d.done)break;r.delete(d.value)}Rv(),Mv()}function Y_(){const n=new Set;for(const l of $p().keys())n.add(l.startsWith("side:")?l.slice(5):l);return[...n].sort()}const Np=new Set;let eb="";function Av(n){return Np.add(n),()=>Np.delete(n)}function Mv(){const n=Y_(),l=n.join(`
|
|
51
|
-
`);if(l!==eb){eb=l;for(const r of Np)r(n)}}function Rv(){Nu===null&&(Nu=window.setTimeout(X_,Cv))}function X_(){if(Nu!==null&&window.clearTimeout(Nu),Nu=null,!!ju)try{localStorage.setItem(q_,JSON.stringify(Object.fromEntries(ju)))}catch{}}const zs={items:[],pending:[],lastSeq:0,contextTokens:null},sp={entries:[],total:0,loading:!1};function V_(n){var l;return((l=n.entries[0])==null?void 0:l.seq)??1}function tb(n){return n.total>0&&V_(n)>1}function Dv(n,l){const r=new Set(n.entries.map(o=>o.seq));return{entries:[...n.entries,...l.entries.filter(o=>!r.has(o.seq))].sort((o,d)=>o.seq-d.seq),total:l.total,loading:!1}}function Ov(n){return lf(zs,n).items.map(l=>({...l,id:`h:${l.id}`}))}function lf(n,l){let r=n;for(const c of l)c.seq<=r.lastSeq||(r={...Lv(r,c.event,c.seq),lastSeq:c.seq});return r}function Lv(n,l,r){var o,d;const c=n.items;switch(l.kind){case"user.message":return ya(n,{id:`u${r}`,kind:"user",text:l.text,images:l.images});case"assistant.delta":{const h=c.findIndex(g=>g.id===l.blockId);if(h===-1)return ya(n,{id:l.blockId,kind:"assistant",text:l.text,streaming:!0});const m=c[h];return Zc(n,h,{...m,text:m.text+l.text})}case"assistant.text":{const h=c.findIndex(g=>g.id===l.blockId),m={id:l.blockId,kind:"assistant",text:l.text,streaming:!1};return h===-1?ya(n,m):Zc(n,h,m)}case"thinking.delta":{const h=c.findIndex(g=>g.id===l.blockId);if(h===-1)return ya(n,{id:l.blockId,kind:"thinking",text:l.text});const m=c[h];return Zc(n,h,{...m,text:m.text+l.text})}case"assistant.thinking":{const h=c.findIndex(g=>g.id===l.blockId),m={id:l.blockId,kind:"thinking",text:l.text};return h===-1?ya(n,m):Zc(n,h,m)}case"tool.use":return ya(n,{id:`t${l.toolUseId}`,kind:"tool",toolUseId:l.toolUseId,name:l.name,input:l.input,result:null,isError:!1,awaitingPermission:!1});case"tool.result":{const h=c.findIndex(g=>g.kind==="tool"&&g.toolUseId===l.toolUseId);if(h===-1)return n;const m=c[h];return Zc(n,h,{...m,result:l.content,isError:l.isError,awaitingPermission:!1})}case"permission.request":return{...n,pending:[...n.pending,{requestId:l.requestId,toolName:l.toolName,input:l.input,...l.reason?{reason:l.reason}:{},...l.questions?{questions:l.questions}:{},...l.toolUseId?{toolUseId:l.toolUseId}:{}}]};case"permission.resolved":{const h=n.pending.find(g=>g.requestId===l.requestId),m=n.pending.filter(g=>g.requestId!==l.requestId);if(l.answers&&(h!=null&&h.toolUseId)){const g=c.findIndex(b=>b.kind==="tool"&&b.toolUseId===h.toolUseId);if(g!==-1){const b=c[g];return Zc({...n,pending:m},g,{...b,answers:l.answers})}}return l.decision==="allow"?{...n,pending:m}:ya({...n,pending:m},{id:`p${r}`,kind:"notice",tone:"info",text:`Отклонено${l.reason?`: ${l.reason}`:""}`})}case"result":{const h=n.items.map(g=>g.kind==="assistant"&&g.streaming?{...g,streaming:!1}:g),m=l.contextTokens??n.contextTokens;return ya({...n,items:h,contextTokens:m},{id:`r${r}`,kind:"result",subtype:l.subtype,isError:l.isError,durationMs:l.durationMs,costUsd:l.costUsd,inputTokens:((o=l.usage)==null?void 0:o.inputTokens)??0,outputTokens:((d=l.usage)==null?void 0:d.outputTokens)??0})}case"system":return l.subtype!=="compact_boundary"?n:ya(n,{id:`s${r}`,kind:"notice",tone:"info",text:"Контекст сжат"});case"error":return ya(n,{id:`e${r}`,kind:"notice",tone:"error",text:l.message});case"state":return n;case"rewound":return n;default:return n}}function zv(n,l){let r=0;for(let c=0;c<n.length;c++)if(n[c].event.kind==="user.message"){if(r===l)return n.slice(0,c);r++}return n}function Uv(n,l,r){const c=l-r;if(c<=0)return[];let o=0;for(let d=0;d<n.length;d++)if(n[d].kind==="user"){if(o===c)return n.slice(0,d);o++}return n}function ya(n,l){return{...n,items:[...n.items,l]}}function Zc(n,l,r){const c=n.items.slice();return c[l]=r,{...n,items:c}}const wp="ccv:theme",lp=["system","light","dark"];function Iv(){const[n,l]=x.useState(Bv);x.useEffect(()=>{const o=window.matchMedia("(prefers-color-scheme: dark)"),d=()=>{const h=n==="dark"||n==="system"&&o.matches;document.documentElement.dataset.theme=h?"dark":"light"};return d(),o.addEventListener("change",d),()=>o.removeEventListener("change",d)},[n]);const r=x.useCallback(o=>{try{localStorage.setItem(wp,o)}catch{}l(o)},[]),c=x.useCallback(()=>{l(o=>{const d=lp[(lp.indexOf(o)+1)%lp.length];try{localStorage.setItem(wp,d)}catch{}return d})},[]);return[n,r,c]}function Bv(){try{const n=localStorage.getItem(wp);if(n==="light"||n==="dark"||n==="system")return n}catch{}return"system"}const Q_=[{value:"default",hint:"спрашивать перед каждым действием"},{value:"acceptEdits",hint:"правки файлов без подтверждения"},{value:"plan",hint:"только чтение и план, без изменений"},{value:"auto",hint:"спрашивать только о рискованном — решает сам"},{value:"bypassPermissions",hint:"ничего не спрашивать"}],Hv=[{value:"default",hint:"рискованное agy отклоняет сам: спросить он не может"},{value:"acceptEdits",hint:"правки файлов без подтверждения, команды — нет"},{value:"plan",hint:"только план, без изменений"},{value:"bypassPermissions",hint:"разрешено всё, включая команды"}],Kr={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:"вопроса"}},$v=320,K_="ccv:panes";function qv(n){return`--${n}-w`}function F_(n,l){const r=Kr[n];return Math.round(Math.min(r.max,Math.max(r.min,l)))}function Gv(){const n={};for(const l of Object.keys(Kr))n[l]=Kr[l].width;try{const l=localStorage.getItem(K_);if(l){const r=JSON.parse(l);for(const c of Object.keys(Kr)){const o=r[c];typeof o=="number"&&Number.isFinite(o)&&(n[c]=F_(c,o))}}}catch{}return n}function Yv(){const[n,l]=x.useState(Gv),r=x.useCallback(h=>{try{localStorage.setItem(K_,JSON.stringify(h))}catch{}},[]),c=x.useCallback((h,m)=>{l(g=>{const b=F_(h,m);if(g[h]===b)return g;const y={...g,[h]:b};return r(y),y})},[r]),o=x.useCallback(h=>{l(m=>{const g={...m,[h]:Kr[h].width};return r(g),g})},[r]),d={};for(const h of Object.keys(Kr))d[qv(h)]=`${n[h]}px`;return{widths:n,style:d,setWidth:c,reset:o}}const ap=260,Z_=120,Xv=200,nb="ccv:terminal-h";function sb(n,l){return Math.round(Math.min(l,Math.max(Z_,n)))}function Vv(){const[n,l]=x.useState(()=>{try{const d=localStorage.getItem(nb);if(d){const h=Number(d);if(Number.isFinite(h))return sb(h,1/0)}}catch{}return ap}),r=x.useCallback(d=>{try{localStorage.setItem(nb,String(d))}catch{}},[]),c=x.useCallback((d,h)=>{const m=sb(d,h);l(g=>g===m?g:(r(m),m))},[r]),o=x.useCallback(()=>{l(ap),r(ap)},[r]);return{height:n,setHeight:c,reset:o}}function Nf(n){const[l,r]=x.useState(()=>typeof window>"u"?!1:window.matchMedia(n).matches);return x.useEffect(()=>{const c=window.matchMedia(n),o=()=>r(c.matches);return o(),c.addEventListener("change",o),()=>c.removeEventListener("change",o)},[n]),l}const Qv=500,Kv=6;function J_({onLongPress:n,onClick:l,disabled:r=!1,thresholdMs:c=Qv,moveCancelPx:o=Kv}){const d=x.useRef(null),[h,m]=x.useState(!1),g=x.useCallback(()=>{d.current&&window.clearTimeout(d.current.timer),d.current=null,m(!1)},[]),b=x.useCallback(A=>{if(r||A.button!==0)return;const C={timer:0,x:A.clientX,y:A.clientY,fired:!1};C.timer=window.setTimeout(()=>{C.fired=!0,m(!1),n()},c),d.current=C,m(!0)},[r,c,n]),y=x.useCallback(A=>{const C=d.current;!C||C.fired||Math.hypot(A.clientX-C.x,A.clientY-C.y)>o&&g()},[o,g]),j=x.useCallback(()=>{d.current&&!d.current.fired?g():m(!1)},[g]),v=x.useCallback(A=>{var C;if((C=d.current)!=null&&C.fired){d.current=null,A.preventDefault();return}if(!r){if(A.shiftKey){n();return}l()}},[r,l,n]),S=x.useCallback(A=>{A.preventDefault()},[]),k=x.useCallback(A=>{r||A.shiftKey&&(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),n())},[r,n]);return{holding:h,thresholdMs:c,handlers:{onPointerDown:b,onPointerMove:y,onPointerUp:j,onPointerCancel:j,onPointerLeave:j,onClick:v,onContextMenu:S,onKeyDown:k}}}const Fv={height:0,offsetTop:0,offsetLeft:0};function lb(){if(typeof window>"u")return Fv;const n=window.visualViewport;return n?{height:n.height,offsetTop:n.offsetTop,offsetLeft:n.offsetLeft}:{height:window.innerHeight,offsetTop:0,offsetLeft:0}}function Zv(n){const[l,r]=x.useState(lb);return x.useEffect(()=>{if(!n)return;const c=window.visualViewport,o=()=>{const d=lb();r(h=>h.height===d.height&&h.offsetTop===d.offsetTop&&h.offsetLeft===d.offsetLeft?h:d)};return o(),c?(c.addEventListener("resize",o),c.addEventListener("scroll",o),()=>{c.removeEventListener("resize",o),c.removeEventListener("scroll",o)}):(window.addEventListener("resize",o),()=>window.removeEventListener("resize",o))},[n]),l}function qp(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Pr=qp();function P_(n){Pr=n}var $r={exec:()=>null};function Jc(n){let l=[];return r=>{let c=Math.max(0,Math.min(3,r-1)),o=l[c];return o||(o=n(c),l[c]=o),o}}function kt(n,l=""){let r=typeof n=="string"?n:n.source,c={replace:(o,d)=>{let h=typeof d=="string"?d:d.source;return h=h.replace(ks.caret,"$1"),r=r.replace(o,h),c},getRegex:()=>new RegExp(r,l)};return c}var Jv=((n="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+n)}catch{return!1}})(),ks={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:Jc(n=>new RegExp(`^ {0,${n}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Jc(n=>new RegExp(`^ {0,${n}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Jc(n=>new RegExp(`^ {0,${n}}(?:\`\`\`|~~~)`)),headingBeginRegex:Jc(n=>new RegExp(`^ {0,${n}}#`)),htmlBeginRegex:Jc(n=>new RegExp(`^ {0,${n}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:Jc(n=>new RegExp(`^ {0,${n}}>`))},Pv=/^(?:[ \t]*(?:\n|$))+/,Wv=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ej=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Mu=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,tj=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Gp=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,W_=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ey=kt(W_).replace(/bull/g,Gp).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),nj=kt(W_).replace(/bull/g,Gp).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Yp=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,sj=/^[^\n]+/,Xp=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,lj=kt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Xp).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),aj=kt(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Gp).getRegex(),wf="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Vp=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ij=kt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Vp).replace("tag",wf).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ty=n=>kt(Yp).replace("hr",Mu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list",n).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",wf).getRegex(),rj=ty(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),cj=ty(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),oj=kt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",cj).getRegex(),Qp={blockquote:oj,code:Wv,def:lj,fences:ej,heading:tj,hr:Mu,html:ij,lheading:ey,list:aj,newline:Pv,paragraph:rj,table:$r,text:sj},ab=kt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Mu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",wf).getRegex(),uj={...Qp,lheading:nj,table:ab,paragraph:kt(Yp).replace("hr",Mu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ab).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",wf).getRegex()},dj={...Qp,html:kt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Vp).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:$r,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:kt(Yp).replace("hr",Mu).replace("heading",` *#{1,6} *[^
|
|
52
|
-
]`).replace("lheading",ey).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},fj=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,hj=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ny=/^( {2,}|\\)\n(?!\s*$)/,pj=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,bo=/[\p{P}\p{S}]/u,kf=/[\s\p{P}\p{S}]/u,Kp=/[^\s\p{P}\p{S}]/u,mj=kt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,kf).getRegex(),sy=/(?!~)[\p{P}\p{S}]/u,gj=/(?!~)[\s\p{P}\p{S}]/u,xj=/(?:[^\s\p{P}\p{S}]|~)/u,bj=kt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Jv?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),ly=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,_j=kt(ly,"u").replace(/punct/g,bo).getRegex(),yj=kt(ly,"u").replace(/punct/g,sy).getRegex(),ay="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",vj=kt(ay,"gu").replace(/notPunctSpace/g,Kp).replace(/punctSpace/g,kf).replace(/punct/g,bo).getRegex(),jj=kt(ay,"gu").replace(/notPunctSpace/g,xj).replace(/punctSpace/g,gj).replace(/punct/g,sy).getRegex(),Nj=kt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Kp).replace(/punctSpace/g,kf).replace(/punct/g,bo).getRegex(),wj=kt(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,bo).getRegex(),kj="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Sj=kt(kj,"gu").replace(/notPunctSpace/g,Kp).replace(/punctSpace/g,kf).replace(/punct/g,bo).getRegex(),Ej=kt(/\\(punct)/,"gu").replace(/punct/g,bo).getRegex(),Tj=kt(/^<(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(),Cj=kt(Vp).replace("(?:-->|$)","-->").getRegex(),Aj=kt("^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",Cj).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ff=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Mj=kt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",ff).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),iy=kt(/^!?\[(label)\]\[(ref)\]/).replace("label",ff).replace("ref",Xp).getRegex(),ry=kt(/^!?\[(ref)\](?:\[\])?/).replace("ref",Xp).getRegex(),Rj=kt("reflink|nolink(?!\\()","g").replace("reflink",iy).replace("nolink",ry).getRegex(),ib=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Fp={_backpedal:$r,anyPunctuation:Ej,autolink:Tj,blockSkip:bj,br:ny,code:hj,del:$r,delLDelim:$r,delRDelim:$r,emStrongLDelim:_j,emStrongRDelimAst:vj,emStrongRDelimUnd:Nj,escape:fj,link:Mj,nolink:ry,punctuation:mj,reflink:iy,reflinkSearch:Rj,tag:Aj,text:pj,url:$r},Dj={...Fp,link:kt(/^!?\[(label)\]\((.*?)\)/).replace("label",ff).getRegex(),reflink:kt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ff).getRegex()},kp={...Fp,emStrongRDelimAst:jj,emStrongLDelim:yj,delLDelim:wj,delRDelim:Sj,url:kt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",ib).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:kt(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",ib).getRegex()},Oj={...kp,br:kt(ny).replace("{2,}","*").getRegex(),text:kt(kp.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Bd={normal:Qp,gfm:uj,pedantic:dj},hu={normal:Fp,gfm:kp,breaks:Oj,pedantic:Dj},Lj={"&":"&","<":"<",">":">",'"':""","'":"'"},rb=n=>Lj[n];function wa(n,l){if(l){if(ks.escapeTest.test(n))return n.replace(ks.escapeReplace,rb)}else if(ks.escapeTestNoEncode.test(n))return n.replace(ks.escapeReplaceNoEncode,rb);return n}function cb(n){try{n=encodeURI(n).replace(ks.percentDecode,"%")}catch{return null}return n}function ob(n,l){var d;let r=n.replace(ks.findPipe,(h,m,g)=>{let b=!1,y=m;for(;--y>=0&&g[y]==="\\";)b=!b;return b?"|":" |"}),c=r.split(ks.splitPipe),o=0;if(c[0].trim()||c.shift(),c.length>0&&!((d=c.at(-1))!=null&&d.trim())&&c.pop(),l)if(c.length>l)c.splice(l);else for(;c.length<l;)c.push("");for(;o<c.length;o++)c[o]=c[o].trim().replace(ks.slashPipe,"|");return c}function Wi(n,l,r){let c=n.length;if(c===0)return"";let o=0;for(;o<c&&n.charAt(c-o-1)===l;)o++;return n.slice(0,c-o)}function ub(n){let l=n.split(`
|
|
53
|
-
`),r=l.length-1;for(;r>=0&&ks.blankLine.test(l[r]);)r--;return l.length-r<=2?n:l.slice(0,r+1).join(`
|
|
54
|
-
`)}function zj(n,l){if(n.indexOf(l[1])===-1)return-1;let r=0;for(let c=0;c<n.length;c++)if(n[c]==="\\")c++;else if(n[c]===l[0])r++;else if(n[c]===l[1]&&(r--,r<0))return c;return r>0?-2:-1}function Uj(n,l=0){let r=l,c="";for(let o of n)if(o===" "){let d=4-r%4;c+=" ".repeat(d),r+=d}else c+=o,r++;return c}function db(n,l,r,c,o){let d=l.href,h=l.title||null,m=n[1].replace(o.other.outputLinkReplace,"$1");c.state.inLink=!0;let g={type:n[0].charAt(0)==="!"?"image":"link",raw:r,href:d,title:h,text:m,tokens:c.inlineTokens(m)};return c.state.inLink=!1,g}function Ij(n,l,r){let c=n.match(r.other.indentCodeCompensation);if(c===null)return l;let o=c[1];return l.split(`
|
|
55
|
-
`).map(d=>{let h=d.match(r.other.beginningSpace);if(h===null)return d;let[m]=h;return m.length>=o.length?d.slice(o.length):d}).join(`
|
|
56
|
-
`)}var hf=class{constructor(n){Ft(this,"options");Ft(this,"rules");Ft(this,"lexer");this.options=n||Pr}space(n){let l=this.rules.block.newline.exec(n);if(l&&l[0].length>0)return{type:"space",raw:l[0]}}code(n){let l=this.rules.block.code.exec(n);if(l){let r=this.options.pedantic?l[0]:ub(l[0]),c=r.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r,codeBlockStyle:"indented",text:c}}}fences(n){let l=this.rules.block.fences.exec(n);if(l){let r=l[0],c=Ij(r,l[3]||"",this.rules);return{type:"code",raw:r,lang:l[2]?l[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):l[2],text:c}}}heading(n){let l=this.rules.block.heading.exec(n);if(l){let r=l[2].trim();if(this.rules.other.endingHash.test(r)){let c=Wi(r,"#");(this.options.pedantic||!c||this.rules.other.endingSpaceChar.test(c))&&(r=c.trim())}return{type:"heading",raw:Wi(l[0],`
|
|
57
|
-
`),depth:l[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(n){let l=this.rules.block.hr.exec(n);if(l)return{type:"hr",raw:Wi(l[0],`
|
|
58
|
-
`)}}blockquote(n){let l=this.rules.block.blockquote.exec(n);if(l){let r=Wi(l[0],`
|
|
59
|
-
`).split(`
|
|
60
|
-
`),c="",o="",d=[];for(;r.length>0;){let h=!1,m=[],g;for(g=0;g<r.length;g++)if(this.rules.other.blockquoteStart.test(r[g]))m.push(r[g]),h=!0;else if(!h)m.push(r[g]);else break;r=r.slice(g);let b=m.join(`
|
|
61
|
-
`),y=b.replace(this.rules.other.blockquoteSetextReplace,`
|
|
62
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");c=c?`${c}
|
|
63
|
-
${b}`:b,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 S=v,k=S.raw+`
|
|
65
|
-
`+r.join(`
|
|
66
|
-
`),A=this.blockquote(k);d[d.length-1]=A,c=c.substring(0,c.length-S.raw.length)+A.raw,o=o.substring(0,o.length-S.text.length)+A.text;break}else if((v==null?void 0:v.type)==="list"){let S=v,k=S.raw+`
|
|
67
|
-
`+r.join(`
|
|
68
|
-
`),A=this.list(k);d[d.length-1]=A,c=c.substring(0,c.length-v.raw.length)+A.raw,o=o.substring(0,o.length-S.raw.length)+A.raw,r=k.substring(d.at(-1).raw.length).split(`
|
|
69
|
-
`);continue}}return{type:"blockquote",raw:c,tokens:d,text:o}}}list(n){let l=this.rules.block.list.exec(n);if(l){let r=l[1].trim(),c=r.length>1,o={type:"list",raw:"",ordered:c,start:c?+r.slice(0,-1):"",loose:!1,items:[]};r=c?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=c?r:"[*+-]");let d=this.rules.other.listItemRegex(r),h=!1;for(;n;){let g=!1,b="",y="";if(!(l=d.exec(n))||this.rules.block.hr.test(n))break;b=l[0],n=n.substring(b.length);let j=Uj(l[2].split(`
|
|
70
|
-
`,1)[0],l[1].length),v=n.split(`
|
|
71
|
-
`,1)[0],S=!j.trim(),k=0;if(this.options.pedantic?(k=2,y=j.trimStart()):S?k=l[1].length+1:(k=j.search(this.rules.other.nonSpaceChar),k=k>4?1:k,y=j.slice(k),k+=l[1].length),S&&this.rules.other.blankLine.test(v)&&(b+=v+`
|
|
72
|
-
`,n=n.substring(v.length+1),g=!0),!g){let A=this.rules.other.nextBulletRegex(k),C=this.rules.other.hrRegex(k),V=this.rules.other.fencesBeginRegex(k),Q=this.rules.other.headingBeginRegex(k),$=this.rules.other.htmlBeginRegex(k),I=this.rules.other.blockquoteBeginRegex(k);for(;n;){let G=n.split(`
|
|
73
|
-
`,1)[0],M;if(v=G,this.options.pedantic?(v=v.replace(this.rules.other.listReplaceNesting," "),M=v):M=v.replace(this.rules.other.tabCharGlobal," "),V.test(v)||Q.test(v)||$.test(v)||I.test(v)||A.test(v)||C.test(v))break;if(M.search(this.rules.other.nonSpaceChar)>=k||!v.trim())y+=`
|
|
74
|
-
`+M.slice(k);else{if(S||j.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||V.test(j)||Q.test(j)||C.test(j))break;y+=`
|
|
75
|
-
`+v}S=!v.trim(),b+=G+`
|
|
76
|
-
`,n=n.substring(G.length+1),j=M.slice(k)}}o.loose||(h?o.loose=!0:this.rules.other.doubleBlankLine.test(b)&&(h=!0)),o.items.push({type:"list_item",raw:b,task:!!this.options.gfm&&this.rules.other.listIsTask.test(y),loose:!1,text:y,tokens:[]}),o.raw+=b}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 b=g.tokens[0];if(g.task&&((b==null?void 0:b.type)==="text"||(b==null?void 0:b.type)==="paragraph")){g.text=g.text.replace(this.rules.other.listReplaceTask,""),b.raw=b.raw.replace(this.rules.other.listReplaceTask,""),b.text=b.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 b of g.tokens)b.type==="text"&&(b.type="paragraph")}return o}}html(n){let l=this.rules.block.html.exec(n);if(l){let r=ub(l[0]);return{type:"html",block:!0,raw:r,pre:l[1]==="pre"||l[1]==="script"||l[1]==="style",text:r}}}def(n){let l=this.rules.block.def.exec(n);if(l){let r=l[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),c=l[2]?l[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=l[3]?l[3].substring(1,l[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):l[3];return{type:"def",tag:r,raw:Wi(l[0],`
|
|
77
|
-
`),href:c,title:o}}}table(n){var h;let l=this.rules.block.table.exec(n);if(!l||!this.rules.other.tableDelimiter.test(l[2]))return;let r=ob(l[1]),c=l[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=(h=l[3])!=null&&h.trim()?l[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
78
|
-
`):[],d={type:"table",raw:Wi(l[0],`
|
|
79
|
-
`),header:[],align:[],rows:[]};if(r.length===c.length){for(let m of c)this.rules.other.tableAlignRight.test(m)?d.align.push("right"):this.rules.other.tableAlignCenter.test(m)?d.align.push("center"):this.rules.other.tableAlignLeft.test(m)?d.align.push("left"):d.align.push(null);for(let m=0;m<r.length;m++)d.header.push({text:r[m],tokens:this.lexer.inline(r[m]),header:!0,align:d.align[m]});for(let m of o)d.rows.push(ob(m,d.header.length).map((g,b)=>({text:g,tokens:this.lexer.inline(g),header:!1,align:d.align[b]})));return d}}lheading(n){let l=this.rules.block.lheading.exec(n);if(l){let r=l[1].trim();return{type:"heading",raw:Wi(l[0],`
|
|
80
|
-
`),depth:l[2].charAt(0)==="="?1:2,text:r,tokens:this.lexer.inline(r)}}}paragraph(n){let l=this.rules.block.paragraph.exec(n);if(l){let r=l[1].charAt(l[1].length-1)===`
|
|
81
|
-
`?l[1].slice(0,-1):l[1];return{type:"paragraph",raw:l[0],text:r,tokens:this.lexer.inline(r)}}}text(n){let l=this.rules.block.text.exec(n);if(l)return{type:"text",raw:l[0],text:l[0],tokens:this.lexer.inline(l[0])}}escape(n){let l=this.rules.inline.escape.exec(n);if(l)return{type:"escape",raw:l[0],text:l[1]}}tag(n){let l=this.rules.inline.tag.exec(n);if(l)return!this.lexer.state.inLink&&this.rules.other.startATag.test(l[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(l[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(l[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(l[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:l[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:l[0]}}link(n){let l=this.rules.inline.link.exec(n);if(l){let r=l[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let d=Wi(r.slice(0,-1),"\\");if((r.length-d.length)%2===0)return}else{let d=zj(l[2],"()");if(d===-2)return;if(d>-1){let h=(l[0].indexOf("!")===0?5:4)+l[1].length+d;l[2]=l[2].substring(0,d),l[0]=l[0].substring(0,h).trim(),l[3]=""}}let c=l[2],o="";if(this.options.pedantic){let d=this.rules.other.pedanticHrefTitle.exec(c);d&&(c=d[1],o=d[3])}else o=l[3]?l[3].slice(1,-1):"";return c=c.trim(),this.rules.other.startAngleBracket.test(c)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?c=c.slice(1):c=c.slice(1,-1)),db(l,{href:c&&c.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},l[0],this.lexer,this.rules)}}reflink(n,l){let r;if((r=this.rules.inline.reflink.exec(n))||(r=this.rules.inline.nolink.exec(n))){let c=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=l[c.toLowerCase()];if(!o){let d=r[0].charAt(0);return{type:"text",raw:d,text:d}}return db(r,o,r[0],this.lexer,this.rules)}}emStrong(n,l,r=""){let c=this.rules.inline.emStrongLDelim.exec(n);if(!(!c||!c[1]&&!c[2]&&!c[3]&&!c[4]||c[4]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(c[1]||c[3])||!r||this.rules.inline.punctuation.exec(r))){let o=[...c[0]].length-1,d,h,m=o,g=0,b=c[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(b.lastIndex=0,l=l.slice(-1*n.length+o);(c=b.exec(l))!==null;){if(d=c[1]||c[2]||c[3]||c[4]||c[5]||c[6],!d)continue;if(h=[...d].length,c[3]||c[4]){m+=h;continue}else if((c[5]||c[6])&&o%3&&!((o+h)%3)){g+=h;continue}if(m-=h,m>0)continue;h=Math.min(h,h+m+g);let y=[...c[0]][0].length,j=n.slice(0,o+c.index+y+h);if(Math.min(o,h)%2){let S=j.slice(1,-1);return{type:"em",raw:j,text:S,tokens:this.lexer.inlineTokens(S)}}let v=j.slice(2,-2);return{type:"strong",raw:j,text:v,tokens:this.lexer.inlineTokens(v)}}}}codespan(n){let l=this.rules.inline.code.exec(n);if(l){let r=l[2].replace(this.rules.other.newLineCharGlobal," "),c=this.rules.other.nonSpaceChar.test(r),o=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return c&&o&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:l[0],text:r}}}br(n){let l=this.rules.inline.br.exec(n);if(l)return{type:"br",raw:l[0]}}del(n,l,r=""){let c=this.rules.inline.delLDelim.exec(n);if(c&&(!c[1]||!r||this.rules.inline.punctuation.exec(r))){let o=[...c[0]].length-1,d,h,m=o,g=this.rules.inline.delRDelim;for(g.lastIndex=0,l=l.slice(-1*n.length+o);(c=g.exec(l))!==null;){if(d=c[1]||c[2]||c[3]||c[4]||c[5]||c[6],!d||(h=[...d].length,h!==o))continue;if(c[3]||c[4]){m+=h;continue}if(m-=h,m>0)continue;h=Math.min(h,h+m);let b=[...c[0]][0].length,y=n.slice(0,o+c.index+b+h),j=y.slice(o,-o);return{type:"del",raw:y,text:j,tokens:this.lexer.inlineTokens(j)}}}}autolink(n){let l=this.rules.inline.autolink.exec(n);if(l){let r,c;return l[2]==="@"?(r=l[1],c="mailto:"+r):(r=l[1],c=r),{type:"link",raw:l[0],text:r,href:c,tokens:[{type:"text",raw:r,text:r}]}}}url(n){var r;let l;if(l=this.rules.inline.url.exec(n)){let c,o;if(l[2]==="@")c=l[0],o="mailto:"+c;else{let d;do d=l[0],l[0]=((r=this.rules.inline._backpedal.exec(l[0]))==null?void 0:r[0])??"";while(d!==l[0]);c=l[0],l[1]==="www."?o="http://"+l[0]:o=l[0]}return{type:"link",raw:l[0],text:c,href:o,tokens:[{type:"text",raw:c,text:c}]}}}inlineText(n){let l=this.rules.inline.text.exec(n);if(l){let r=this.lexer.state.inRawBlock;return{type:"text",raw:l[0],text:l[0],escaped:r}}}},Ql=class Sp{constructor(l){Ft(this,"tokens");Ft(this,"options");Ft(this,"state");Ft(this,"inlineQueue");Ft(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=l||Pr,this.options.tokenizer=this.options.tokenizer||new hf,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:ks,block:Bd.normal,inline:hu.normal};this.options.pedantic?(r.block=Bd.pedantic,r.inline=hu.pedantic):this.options.gfm&&(r.block=Bd.gfm,this.options.breaks?r.inline=hu.breaks:r.inline=hu.gfm),this.tokenizer.rules=r}static get rules(){return{block:Bd,inline:hu}}static lex(l,r){return new Sp(r).lex(l)}static lexInline(l,r){return new Sp(r).inlineTokens(l)}lex(l){l=l.replace(ks.carriageReturn,`
|
|
82
|
-
`),this.blockTokens(l,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let c=this.inlineQueue[r];this.inlineTokens(c.src,c.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(l,r=[],c=!1){var d,h,m;this.tokenizer.lexer=this,this.options.pedantic&&(l=l.replace(ks.tabCharGlobal," ").replace(ks.spaceLine,""));let o=1/0;for(;l;){if(l.length<o)o=l.length;else{this.infiniteLoopError(l.charCodeAt(0));break}let g;if((h=(d=this.options.extensions)==null?void 0:d.block)!=null&&h.some(y=>(g=y.call({lexer:this},l,r))?(l=l.substring(g.raw.length),r.push(g),!0):!1))continue;if(g=this.tokenizer.space(l)){l=l.substring(g.raw.length);let y=r.at(-1);g.raw.length===1&&y!==void 0?y.raw+=`
|
|
83
|
-
`:r.push(g);continue}if(g=this.tokenizer.code(l)){l=l.substring(g.raw.length);let y=r.at(-1);(y==null?void 0:y.type)==="paragraph"||(y==null?void 0:y.type)==="text"?(y.raw+=(y.raw.endsWith(`
|
|
84
|
-
`)?"":`
|
|
85
|
-
`)+g.raw,y.text+=`
|
|
86
|
-
`+g.text,this.inlineQueue.at(-1).src=y.text):r.push(g);continue}if(g=this.tokenizer.fences(l)){l=l.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.heading(l)){l=l.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.hr(l)){l=l.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.blockquote(l)){l=l.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.list(l)){l=l.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.html(l)){l=l.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.def(l)){l=l.substring(g.raw.length);let y=r.at(-1);(y==null?void 0:y.type)==="paragraph"||(y==null?void 0:y.type)==="text"?(y.raw+=(y.raw.endsWith(`
|
|
87
|
-
`)?"":`
|
|
88
|
-
`)+g.raw,y.text+=`
|
|
89
|
-
`+g.raw,this.inlineQueue.at(-1).src=y.text):this.tokens.links[g.tag]||(this.tokens.links[g.tag]={href:g.href,title:g.title},r.push(g));continue}if(g=this.tokenizer.table(l)){l=l.substring(g.raw.length),r.push(g);continue}if(g=this.tokenizer.lheading(l)){l=l.substring(g.raw.length),r.push(g);continue}let b=l;if((m=this.options.extensions)!=null&&m.startBlock){let y=1/0,j=l.slice(1),v;this.options.extensions.startBlock.forEach(S=>{v=S.call({lexer:this},j),typeof v=="number"&&v>=0&&(y=Math.min(y,v))}),y<1/0&&y>=0&&(b=l.substring(0,y+1))}if(this.state.top&&(g=this.tokenizer.paragraph(b))){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=b.length!==l.length,l=l.substring(g.raw.length);continue}if(g=this.tokenizer.text(l)){l=l.substring(g.raw.length);let y=r.at(-1);(y==null?void 0:y.type)==="text"?(y.raw+=(y.raw.endsWith(`
|
|
93
|
-
`)?"":`
|
|
94
|
-
`)+g.raw,y.text+=`
|
|
95
|
-
`+g.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=y.text):r.push(g);continue}if(l){this.infiniteLoopError(l.charCodeAt(0));break}}return this.state.top=!0,r}inline(l,r=[]){return this.inlineQueue.push({src:l,tokens:r}),r}inlineTokens(l,r=[]){var m,g,b,y,j;this.tokenizer.lexer=this;let c=l;if(this.tokens.links){let v=Object.keys(this.tokens.links);v.length>0&&(c=c.replace(this.tokenizer.rules.inline.reflinkSearch,S=>v.includes(S.slice(S.lastIndexOf("[")+1,-1))?"["+"a".repeat(S.length-2)+"]":S))}c=c.replace(this.tokenizer.rules.inline.anyPunctuation,"++"),c=c.replace(this.tokenizer.rules.inline.blockSkip,(v,S,k)=>{let A=k?k.length:0;return v.slice(0,A)+"["+"a".repeat(v.length-A-2)+"]"}),c=((g=(m=this.options.hooks)==null?void 0:m.emStrongMask)==null?void 0:g.call({lexer:this},c))??c;let o=!1,d="",h=1/0;for(;l;){if(l.length<h)h=l.length;else{this.infiniteLoopError(l.charCodeAt(0));break}o||(d=""),o=!1;let v;if((y=(b=this.options.extensions)==null?void 0:b.inline)!=null&&y.some(k=>(v=k.call({lexer:this},l,r))?(l=l.substring(v.raw.length),r.push(v),!0):!1))continue;if(v=this.tokenizer.escape(l)){l=l.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.tag(l)){l=l.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.link(l)){l=l.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.reflink(l,this.tokens.links)){l=l.substring(v.raw.length);let 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(l,c,d)){l=l.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.codespan(l)){l=l.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.br(l)){l=l.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.del(l,c,d)){l=l.substring(v.raw.length),r.push(v);continue}if(v=this.tokenizer.autolink(l)){l=l.substring(v.raw.length),r.push(v);continue}if(!this.state.inLink&&(v=this.tokenizer.url(l))){l=l.substring(v.raw.length),r.push(v);continue}let S=l;if((j=this.options.extensions)!=null&&j.startInline){let k=1/0,A=l.slice(1),C;this.options.extensions.startInline.forEach(V=>{C=V.call({lexer:this},A),typeof C=="number"&&C>=0&&(k=Math.min(k,C))}),k<1/0&&k>=0&&(S=l.substring(0,k+1))}if(v=this.tokenizer.inlineText(S)){l=l.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(l){this.infiniteLoopError(l.charCodeAt(0));break}}return r}infiniteLoopError(l){let r="Infinite loop on byte: "+l;if(this.options.silent)console.error(r);else throw new Error(r)}},pf=class{constructor(n){Ft(this,"options");Ft(this,"parser");this.options=n||Pr}space(n){return""}code({text:n,lang:l,escaped:r}){var d;let c=(d=(l||"").match(ks.notSpaceStart))==null?void 0:d[0],o=n.replace(ks.endingNewline,"")+`
|
|
96
|
-
`;return c?'<pre><code class="language-'+wa(c)+'">'+(r?o:wa(o,!0))+`</code></pre>
|
|
97
|
-
`:"<pre><code>"+(r?o:wa(o,!0))+`</code></pre>
|
|
98
|
-
`}blockquote({tokens:n}){return`<blockquote>
|
|
99
|
-
${this.parser.parse(n)}</blockquote>
|
|
100
|
-
`}html({text:n}){return n}def(n){return""}heading({tokens:n,depth:l}){return`<h${l}>${this.parser.parseInline(n)}</h${l}>
|
|
101
|
-
`}hr(n){return`<hr>
|
|
102
|
-
`}list(n){let l=n.ordered,r=n.start,c="";for(let h=0;h<n.items.length;h++){let m=n.items[h];c+=this.listitem(m)}let o=l?"ol":"ul",d=l&&r!==1?' start="'+r+'"':"";return"<"+o+d+`>
|
|
103
|
-
`+c+"</"+o+`>
|
|
104
|
-
`}listitem(n){return`<li>${this.parser.parse(n.tokens)}</li>
|
|
105
|
-
`}checkbox({checked:n}){return"<input "+(n?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:n}){return`<p>${this.parser.parseInline(n)}</p>
|
|
106
|
-
`}table(n){let l="",r="";for(let o=0;o<n.header.length;o++)r+=this.tablecell(n.header[o]);l+=this.tablerow({text:r});let c="";for(let o=0;o<n.rows.length;o++){let d=n.rows[o];r="";for(let h=0;h<d.length;h++)r+=this.tablecell(d[h]);c+=this.tablerow({text:r})}return c&&(c=`<tbody>${c}</tbody>`),`<table>
|
|
107
|
-
<thead>
|
|
108
|
-
`+l+`</thead>
|
|
109
|
-
`+c+`</table>
|
|
110
|
-
`}tablerow({text:n}){return`<tr>
|
|
111
|
-
${n}</tr>
|
|
112
|
-
`}tablecell(n){let l=this.parser.parseInline(n.tokens),r=n.header?"th":"td";return(n.align?`<${r} align="${n.align}">`:`<${r}>`)+l+`</${r}>
|
|
113
|
-
`}strong({tokens:n}){return`<strong>${this.parser.parseInline(n)}</strong>`}em({tokens:n}){return`<em>${this.parser.parseInline(n)}</em>`}codespan({text:n}){return`<code>${wa(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:l,tokens:r}){let c=this.parser.parseInline(r),o=cb(n);if(o===null)return c;n=o;let d='<a href="'+n+'"';return l&&(d+=' title="'+wa(l)+'"'),d+=">"+c+"</a>",d}image({href:n,title:l,text:r,tokens:c}){c&&(r=this.parser.parseInline(c,this.parser.textRenderer));let o=cb(n);if(o===null)return wa(r);n=o;let d=`<img src="${n}" alt="${wa(r)}"`;return l&&(d+=` title="${wa(l)}"`),d+=">",d}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:wa(n.text)}},Zp=class{strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}checkbox({raw:n}){return n}},Kl=class Ep{constructor(l){Ft(this,"options");Ft(this,"renderer");Ft(this,"textRenderer");this.options=l||Pr,this.options.renderer=this.options.renderer||new pf,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Zp}static parse(l,r){return new Ep(r).parse(l)}static parseInline(l,r){return new Ep(r).parseInline(l)}parse(l){var c,o;this.renderer.parser=this;let r="";for(let d=0;d<l.length;d++){let h=l[d];if((o=(c=this.options.extensions)==null?void 0:c.renderers)!=null&&o[h.type]){let g=h,b=this.options.extensions.renderers[g.type].call({parser:this},g);if(b!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(g.type)){r+=b||"";continue}}let m=h;switch(m.type){case"space":{r+=this.renderer.space(m);break}case"hr":{r+=this.renderer.hr(m);break}case"heading":{r+=this.renderer.heading(m);break}case"code":{r+=this.renderer.code(m);break}case"table":{r+=this.renderer.table(m);break}case"blockquote":{r+=this.renderer.blockquote(m);break}case"list":{r+=this.renderer.list(m);break}case"checkbox":{r+=this.renderer.checkbox(m);break}case"html":{r+=this.renderer.html(m);break}case"def":{r+=this.renderer.def(m);break}case"paragraph":{r+=this.renderer.paragraph(m);break}case"text":{r+=this.renderer.text(m);break}default:{let g='Token with "'+m.type+'" type was not found.';if(this.options.silent)return console.error(g),"";throw new Error(g)}}}return r}parseInline(l,r=this.renderer){var o,d;this.renderer.parser=this;let c="";for(let h=0;h<l.length;h++){let m=l[h];if((d=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&d[m.type]){let b=this.options.extensions.renderers[m.type].call({parser:this},m);if(b!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(m.type)){c+=b||"";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 b='Token with "'+g.type+'" type was not found.';if(this.options.silent)return console.error(b),"";throw new Error(b)}}}return c}},ef,_u=(ef=class{constructor(n){Ft(this,"options");Ft(this,"block");this.options=n||Pr}preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}emStrongMask(n){return n}provideLexer(n=this.block){return n?Ql.lex:Ql.lexInline}provideParser(n=this.block){return n?Kl.parse:Kl.parseInline}},Ft(ef,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),Ft(ef,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),ef),Bj=class{constructor(...n){Ft(this,"defaults",qp());Ft(this,"options",this.setOptions);Ft(this,"parse",this.parseMarkdown(!0));Ft(this,"parseInline",this.parseMarkdown(!1));Ft(this,"Parser",Kl);Ft(this,"Renderer",pf);Ft(this,"TextRenderer",Zp);Ft(this,"Lexer",Ql);Ft(this,"Tokenizer",hf);Ft(this,"Hooks",_u);this.use(...n)}walkTokens(n,l){var c,o;let r=[];for(let d of n)switch(r=r.concat(l.call(this,d)),d.type){case"table":{let h=d;for(let m of h.header)r=r.concat(this.walkTokens(m.tokens,l));for(let m of h.rows)for(let g of m)r=r.concat(this.walkTokens(g.tokens,l));break}case"list":{let h=d;r=r.concat(this.walkTokens(h.items,l));break}default:{let h=d;(o=(c=this.defaults.extensions)==null?void 0:c.childTokens)!=null&&o[h.type]?this.defaults.extensions.childTokens[h.type].forEach(m=>{let g=h[m].flat(1/0);r=r.concat(this.walkTokens(g,l))}):h.tokens&&(r=r.concat(this.walkTokens(h.tokens,l)))}}return r}use(...n){let l=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(r=>{let c={...r};if(c.async=this.defaults.async||c.async||!1,r.extensions&&(r.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let d=l.renderers[o.name];d?l.renderers[o.name]=function(...h){let m=o.renderer.apply(this,h);return m===!1&&(m=d.apply(this,h)),m}:l.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let d=l[o.level];d?d.unshift(o.tokenizer):l[o.level]=[o.tokenizer],o.start&&(o.level==="block"?l.startBlock?l.startBlock.push(o.start):l.startBlock=[o.start]:o.level==="inline"&&(l.startInline?l.startInline.push(o.start):l.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(l.childTokens[o.name]=o.childTokens)}),c.extensions=l),r.renderer){let o=this.defaults.renderer||new pf(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]=(...b)=>{let y=m.apply(o,b);return y===!1&&(y=g.apply(o,b)),y||""}}c.renderer=o}if(r.tokenizer){let o=this.defaults.tokenizer||new hf(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]=(...b)=>{let y=m.apply(o,b);return y===!1&&(y=g.apply(o,b)),y}}c.tokenizer=o}if(r.hooks){let o=this.defaults.hooks||new _u;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];_u.passThroughHooks.has(d)?o[h]=b=>{if(this.defaults.async&&_u.passThroughHooksRespectAsync.has(d))return(async()=>{let j=await m.call(o,b);return g.call(o,j)})();let y=m.call(o,b);return g.call(o,y)}:o[h]=(...b)=>{if(this.defaults.async)return(async()=>{let j=await m.apply(o,b);return j===!1&&(j=await g.apply(o,b)),j})();let y=m.apply(o,b);return y===!1&&(y=g.apply(o,b)),y}}c.hooks=o}if(r.walkTokens){let o=this.defaults.walkTokens,d=r.walkTokens;c.walkTokens=function(h){let m=[];return m.push(d.call(this,h)),o&&(m=m.concat(o.call(this,h))),m}}this.defaults={...this.defaults,...c}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,l){return Ql.lex(n,l??this.defaults)}parser(n,l){return Kl.parse(n,l??this.defaults)}parseMarkdown(n){return(l,r)=>{let c={...r},o={...this.defaults,...c},d=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&c.async===!1)return d(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof l>"u"||l===null)return d(new Error("marked(): input parameter is undefined or null"));if(typeof l!="string")return d(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(l)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=n),o.async)return(async()=>{let h=o.hooks?await o.hooks.preprocess(l):l,m=await(o.hooks?await o.hooks.provideLexer(n):n?Ql.lex:Ql.lexInline)(h,o),g=o.hooks?await o.hooks.processAllTokens(m):m;o.walkTokens&&await Promise.all(this.walkTokens(g,o.walkTokens));let b=await(o.hooks?await o.hooks.provideParser(n):n?Kl.parse:Kl.parseInline)(g,o);return o.hooks?await o.hooks.postprocess(b):b})().catch(d);try{o.hooks&&(l=o.hooks.preprocess(l));let h=(o.hooks?o.hooks.provideLexer(n):n?Ql.lex:Ql.lexInline)(l,o);o.hooks&&(h=o.hooks.processAllTokens(h)),o.walkTokens&&this.walkTokens(h,o.walkTokens);let m=(o.hooks?o.hooks.provideParser(n):n?Kl.parse:Kl.parseInline)(h,o);return o.hooks&&(m=o.hooks.postprocess(m)),m}catch(h){return d(h)}}}onError(n,l){return r=>{if(r.message+=`
|
|
114
|
-
Please report this to https://github.com/markedjs/marked.`,n){let c="<p>An error occurred:</p><pre>"+wa(r.message+"",!0)+"</pre>";return l?Promise.resolve(c):c}if(l)return Promise.reject(r);throw r}}},Jr=new Bj;function Bt(n,l){return Jr.parse(n,l)}Bt.options=Bt.setOptions=function(n){return Jr.setOptions(n),Bt.defaults=Jr.defaults,P_(Bt.defaults),Bt};Bt.getDefaults=qp;Bt.defaults=Pr;Bt.use=function(...n){return Jr.use(...n),Bt.defaults=Jr.defaults,P_(Bt.defaults),Bt};Bt.walkTokens=function(n,l){return Jr.walkTokens(n,l)};Bt.parseInline=Jr.parseInline;Bt.Parser=Kl;Bt.parser=Kl.parse;Bt.Renderer=pf;Bt.TextRenderer=Zp;Bt.Lexer=Ql;Bt.lexer=Ql.lex;Bt.Tokenizer=hf;Bt.Hooks=_u;Bt.parse=Bt;Bt.options;Bt.setOptions;Bt.use;Bt.walkTokens;Bt.parseInline;Kl.parse;Ql.lex;/*! @license DOMPurify 3.4.12 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.12/LICENSE */function fb(n,l){(l==null||l>n.length)&&(l=n.length);for(var r=0,c=Array(l);r<l;r++)c[r]=n[r];return c}function Hj(n){if(Array.isArray(n))return n}function $j(n,l){var r=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(r!=null){var c,o,d,h,m=[],g=!0,b=!1;try{if(d=(r=r.call(n)).next,l!==0)for(;!(g=(c=d.call(r)).done)&&(m.push(c.value),m.length!==l);g=!0);}catch(y){b=!0,o=y}finally{try{if(!g&&r.return!=null&&(h=r.return(),Object(h)!==h))return}finally{if(b)throw o}}return m}}function qj(){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 Gj(n,l){return Hj(n)||$j(n,l)||Yj(n,l)||qj()}function Yj(n,l){if(n){if(typeof n=="string")return fb(n,l);var r={}.toString.call(n).slice(8,-1);return r==="Object"&&n.constructor&&(r=n.constructor.name),r==="Map"||r==="Set"?Array.from(n):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?fb(n,l):void 0}}const cy=Object.entries,hb=Object.setPrototypeOf,Xj=Object.isFrozen,Vj=Object.getPrototypeOf,Qj=Object.getOwnPropertyDescriptor;let hs=Object.freeze,ps=Object.seal,eo=Object.create,oy=typeof Reflect<"u"&&Reflect,Tp=oy.apply,Cp=oy.construct;hs||(hs=function(l){return l});ps||(ps=function(l){return l});Tp||(Tp=function(l,r){for(var c=arguments.length,o=new Array(c>2?c-2:0),d=2;d<c;d++)o[d-2]=arguments[d];return l.apply(r,o)});Cp||(Cp=function(l){for(var r=arguments.length,c=new Array(r>1?r-1:0),o=1;o<r;o++)c[o-1]=arguments[o];return new l(...c)});const Pc=Kn(Array.prototype.forEach),Kj=Kn(Array.prototype.lastIndexOf),pb=Kn(Array.prototype.pop),Wc=Kn(Array.prototype.push),Fj=Kn(Array.prototype.splice),ir=Array.isArray,yu=Kn(String.prototype.toLowerCase),ip=Kn(String.prototype.toString),mb=Kn(String.prototype.match),pu=Kn(String.prototype.replace),gb=Kn(String.prototype.indexOf),Zj=Kn(String.prototype.trim),Jj=Kn(Number.prototype.toString),Pj=Kn(Boolean.prototype.toString),xb=typeof BigInt>"u"?null:Kn(BigInt.prototype.toString),bb=typeof Symbol>"u"?null:Kn(Symbol.prototype.toString),as=Kn(Object.prototype.hasOwnProperty),mu=Kn(Object.prototype.toString),ls=Kn(RegExp.prototype.test),zr=Wj(TypeError);function Kn(n){return function(l){l instanceof RegExp&&(l.lastIndex=0);for(var r=arguments.length,c=new Array(r>1?r-1:0),o=1;o<r;o++)c[o-1]=arguments[o];return Tp(n,l,c)}}function Wj(n){return function(){for(var l=arguments.length,r=new Array(l),c=0;c<l;c++)r[c]=arguments[c];return Cp(n,r)}}function wt(n,l){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:yu;if(hb&&hb(n,null),!ir(l))return n;let c=l.length;for(;c--;){let o=l[c];if(typeof o=="string"){const d=r(o);d!==o&&(Xj(l)||(l[c]=d),o=d)}n[o]=!0}return n}function e1(n){for(let l=0;l<n.length;l++)as(n,l)||(n[l]=null);return n}function Us(n){const l=eo(null);for(const c of cy(n)){var r=Gj(c,2);const o=r[0],d=r[1];as(n,o)&&(ir(d)?l[o]=e1(d):d&&typeof d=="object"&&d.constructor===Object?l[o]=Us(d):l[o]=d)}return l}function t1(n){switch(typeof n){case"string":return n;case"number":return Jj(n);case"boolean":return Pj(n);case"bigint":return xb?xb(n):"0";case"symbol":return bb?bb(n):"Symbol()";case"undefined":return mu(n);case"function":case"object":{if(n===null)return mu(n);const l=n,r=ka(l,"toString");if(typeof r=="function"){const c=r(l);return typeof c=="string"?c:mu(c)}return mu(n)}default:return mu(n)}}function ka(n,l){for(;n!==null;){const c=Qj(n,l);if(c){if(c.get)return Kn(c.get);if(typeof c.value=="function")return Kn(c.value)}n=Vj(n)}function r(){return null}return r}function n1(n){try{return ls(n,""),!0}catch{return!1}}const _b=hs(["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"]),rp=hs(["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"]),cp=hs(["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"]),s1=hs(["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"]),op=hs(["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"]),l1=hs(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),yb=hs(["#text"]),vb=hs(["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"]),up=hs(["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"]),jb=hs(["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"]),Hd=hs(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),a1=ps(/{{[\w\W]*|^[\w\W]*}}/g),i1=ps(/<%[\w\W]*|^[\w\W]*%>/g),r1=ps(/\${[\w\W]*/g),c1=ps(/^data-[\-\w.\u00B7-\uFFFF]+$/),o1=ps(/^aria-[\-\w]+$/),Nb=ps(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),u1=ps(/^(?:\w+script|data):/i),d1=ps(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),f1=ps(/^html$/i),h1=ps(/^[a-z][.\w]*(-[.\w]+)+$/i),wb=ps(/<[/\w!]/g),kb=ps(/<[/\w]/g),p1=ps(/<\/no(script|embed|frames)/i),m1=ps(/\/>/i),gl={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},g1=function(){return typeof window>"u"?null:window},x1=function(l,r){if(typeof l!="object"||typeof l.createPolicy!="function")return null;let c=null;const o="data-tt-policy-suffix";r&&r.hasAttribute(o)&&(c=r.getAttribute(o));const d="dompurify"+(c?"#"+c:"");try{return l.createPolicy(d,{createHTML(h){return h},createScriptURL(h){return h}})}catch{return console.warn("TrustedTypes policy "+d+" could not be created."),null}},Sb=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},er=function(l,r,c,o){return as(l,r)&&ir(l[r])?wt(o.base?Us(o.base):{},l[r],o.transform):c};function uy(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:g1();const l=je=>uy(je);if(l.version="3.4.12",l.removed=[],!n||!n.document||n.document.nodeType!==gl.document||!n.Element)return l.isSupported=!1,l;let r=n.document;const c=r,o=c.currentScript;n.DocumentFragment;const d=n.HTMLTemplateElement,h=n.Node,m=n.Element,g=n.NodeFilter,b=n.NamedNodeMap;b===void 0&&(n.NamedNodeMap||n.MozNamedAttrMap),n.HTMLFormElement;const y=n.DOMParser,j=n.trustedTypes,v=m.prototype,S=ka(v,"cloneNode"),k=ka(v,"remove"),A=ka(v,"nextSibling"),C=ka(v,"childNodes"),V=ka(v,"parentNode"),Q=ka(v,"shadowRoot"),$=ka(v,"attributes"),I=h&&h.prototype?ka(h.prototype,"nodeType"):null,G=h&&h.prototype?ka(h.prototype,"nodeName"):null;if(typeof d=="function"){const je=r.createElement("template");je.content&&je.content.ownerDocument&&(r=je.content.ownerDocument)}let M,z="",R,K=!1,ae=0;const Y=function(){if(ae>0)throw zr('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.')},H=function(T){Y(),ae++;try{return M.createHTML(T)}finally{ae--}},fe=function(T){Y(),ae++;try{return M.createScriptURL(T)}finally{ae--}},ue=function(){return K||(R=x1(j,o),K=!0),R},X=r,D=X.implementation,U=X.createNodeIterator,ce=X.createDocumentFragment,be=X.getElementsByTagName,Ne=c.importNode;let E=Sb();l.isSupported=typeof cy=="function"&&typeof V=="function"&&D&&D.createHTMLDocument!==void 0;const ee=a1,me=i1,Se=r1,q=c1,we=o1,ie=u1,Ie=d1,ze=h1;let Zt=Nb,Qe=null;const un=wt({},[..._b,...rp,...cp,...op,...yb]);let Ze=null;const dt=wt({},[...vb,...up,...jb,...Hd]);let tt=Object.seal(eo(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}})),Gt=null,es=null;const ct=Object.seal(eo(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ft=!0,Ce=!0,Je=!1,St=!0,pt=!1,Xe=!0,vn=!1,zn=!1,Tt=null,tn=null,is=!1,gn=!1,Sn=!1,ms=!1,Et=!0,Pt=!1;const En="user-content-";let Wt=!0,ts=!1,de={},ke=null;const Ke=wt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let it=null;const Be=wt({},["audio","video","img","source","image","track"]);let nt=null;const J=wt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ge="http://www.w3.org/1998/Math/MathML",De="http://www.w3.org/2000/svg",qe="http://www.w3.org/1999/xhtml";let Yt=qe,Tn=!1,Is=null;const Dl=wt({},[ge,De,qe],ip),Zl=hs(["mi","mo","mn","ms","mtext"]);let Bs=wt({},Zl);const Es=hs(["annotation-xml"]);let Cn=wt({},Es);const ll=wt({},["title","style","font","a","script"]);let dn=null;const Hs=["application/xhtml+xml","text/html"],zt="text/html";let We=null,rs=null;const Ts=r.createElement("form"),Jl=function(T){return T instanceof RegExp||T instanceof Function},Pl=function(){let T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(rs&&rs===T)return;(!T||typeof T!="object")&&(T={}),T=Us(T),dn=Hs.indexOf(T.PARSER_MEDIA_TYPE)===-1?zt:T.PARSER_MEDIA_TYPE,We=dn==="application/xhtml+xml"?ip:yu,Qe=er(T,"ALLOWED_TAGS",un,{transform:We}),Ze=er(T,"ALLOWED_ATTR",dt,{transform:We}),Is=er(T,"ALLOWED_NAMESPACES",Dl,{transform:ip}),nt=er(T,"ADD_URI_SAFE_ATTR",J,{transform:We,base:J}),it=er(T,"ADD_DATA_URI_TAGS",Be,{transform:We,base:Be}),ke=er(T,"FORBID_CONTENTS",Ke,{transform:We}),Gt=er(T,"FORBID_TAGS",Us({}),{transform:We}),es=er(T,"FORBID_ATTR",Us({}),{transform:We}),de=as(T,"USE_PROFILES")?T.USE_PROFILES&&typeof T.USE_PROFILES=="object"?Us(T.USE_PROFILES):T.USE_PROFILES:!1,ft=T.ALLOW_ARIA_ATTR!==!1,Ce=T.ALLOW_DATA_ATTR!==!1,Je=T.ALLOW_UNKNOWN_PROTOCOLS||!1,St=T.ALLOW_SELF_CLOSE_IN_ATTR!==!1,pt=T.SAFE_FOR_TEMPLATES||!1,Xe=T.SAFE_FOR_XML!==!1,vn=T.WHOLE_DOCUMENT||!1,gn=T.RETURN_DOM||!1,Sn=T.RETURN_DOM_FRAGMENT||!1,ms=T.RETURN_TRUSTED_TYPE||!1,is=T.FORCE_BODY||!1,Et=T.SANITIZE_DOM!==!1,Pt=T.SANITIZE_NAMED_PROPS||!1,Wt=T.KEEP_CONTENT!==!1,ts=T.IN_PLACE||!1,Zt=n1(T.ALLOWED_URI_REGEXP)?T.ALLOWED_URI_REGEXP:Nb,Yt=typeof T.NAMESPACE=="string"?T.NAMESPACE:qe,Bs=as(T,"MATHML_TEXT_INTEGRATION_POINTS")&&T.MATHML_TEXT_INTEGRATION_POINTS&&typeof T.MATHML_TEXT_INTEGRATION_POINTS=="object"?Us(T.MATHML_TEXT_INTEGRATION_POINTS):wt({},Zl),Cn=as(T,"HTML_INTEGRATION_POINTS")&&T.HTML_INTEGRATION_POINTS&&typeof T.HTML_INTEGRATION_POINTS=="object"?Us(T.HTML_INTEGRATION_POINTS):wt({},Es);const P=as(T,"CUSTOM_ELEMENT_HANDLING")&&T.CUSTOM_ELEMENT_HANDLING&&typeof T.CUSTOM_ELEMENT_HANDLING=="object"?Us(T.CUSTOM_ELEMENT_HANDLING):eo(null);if(tt=eo(null),as(P,"tagNameCheck")&&Jl(P.tagNameCheck)&&(tt.tagNameCheck=P.tagNameCheck),as(P,"attributeNameCheck")&&Jl(P.attributeNameCheck)&&(tt.attributeNameCheck=P.attributeNameCheck),as(P,"allowCustomizedBuiltInElements")&&typeof P.allowCustomizedBuiltInElements=="boolean"&&(tt.allowCustomizedBuiltInElements=P.allowCustomizedBuiltInElements),ps(tt),pt&&(Ce=!1),Sn&&(gn=!0),de&&(Qe=wt({},yb),Ze=eo(null),de.html===!0&&(wt(Qe,_b),wt(Ze,vb)),de.svg===!0&&(wt(Qe,rp),wt(Ze,up),wt(Ze,Hd)),de.svgFilters===!0&&(wt(Qe,cp),wt(Ze,up),wt(Ze,Hd)),de.mathMl===!0&&(wt(Qe,op),wt(Ze,jb),wt(Ze,Hd))),ct.tagCheck=null,ct.attributeCheck=null,as(T,"ADD_TAGS")&&(typeof T.ADD_TAGS=="function"?ct.tagCheck=T.ADD_TAGS:ir(T.ADD_TAGS)&&(Qe===un&&(Qe=Us(Qe)),wt(Qe,T.ADD_TAGS,We))),as(T,"ADD_ATTR")&&(typeof T.ADD_ATTR=="function"?ct.attributeCheck=T.ADD_ATTR:ir(T.ADD_ATTR)&&(Ze===dt&&(Ze=Us(Ze)),wt(Ze,T.ADD_ATTR,We))),as(T,"ADD_URI_SAFE_ATTR")&&ir(T.ADD_URI_SAFE_ATTR)&&wt(nt,T.ADD_URI_SAFE_ATTR,We),as(T,"FORBID_CONTENTS")&&ir(T.FORBID_CONTENTS)&&(ke===Ke&&(ke=Us(ke)),wt(ke,T.FORBID_CONTENTS,We)),as(T,"ADD_FORBID_CONTENTS")&&ir(T.ADD_FORBID_CONTENTS)&&(ke===Ke&&(ke=Us(ke)),wt(ke,T.ADD_FORBID_CONTENTS,We)),Wt&&(Qe["#text"]=!0),vn&&wt(Qe,["html","head","body"]),Qe.table&&(wt(Qe,["tbody"]),delete Gt.tbody),T.TRUSTED_TYPES_POLICY){if(typeof T.TRUSTED_TYPES_POLICY.createHTML!="function")throw zr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof T.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw zr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const ye=M;M=T.TRUSTED_TYPES_POLICY;try{z=H("")}catch(Le){throw M=ye,Le}}else T.TRUSTED_TYPES_POLICY===null?(M=void 0,z=""):(M===void 0&&(M=ue()),M&&typeof z=="string"&&(z=H("")));hs&&hs(T),rs=T},Ol=wt({},[...rp,...cp,...s1]),An=wt({},[...op,...l1]),al=function(T,P,ye){return P.namespaceURI===qe?T==="svg":P.namespaceURI===ge?T==="svg"&&(ye==="annotation-xml"||Bs[ye]):!!Ol[T]},xl=function(T,P,ye){return P.namespaceURI===qe?T==="math":P.namespaceURI===De?T==="math"&&Cn[ye]:!!An[T]},il=function(T,P,ye){return P.namespaceURI===De&&!Cn[ye]||P.namespaceURI===ge&&!Bs[ye]?!1:!An[T]&&(ll[T]||!Ol[T])},Ll=function(T){let P=V(T);(!P||!P.tagName)&&(P={namespaceURI:Yt,tagName:"template"});const ye=yu(T.tagName),Le=yu(P.tagName);return Is[T.namespaceURI]?T.namespaceURI===De?al(ye,P,Le):T.namespaceURI===ge?xl(ye,P,Le):T.namespaceURI===qe?il(ye,P,Le):!!(dn==="application/xhtml+xml"&&Is[T.namespaceURI]):!1},Mn=function(T){Wc(l.removed,{element:T});try{V(T).removeChild(T)}catch{if(k(T),!V(T))throw zr("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Ut=function(T){Cs(T);const P=C(T);if(P){const Le=[];Pc(P,Ge=>{Wc(Le,Ge)}),Pc(Le,Ge=>{try{k(Ge)}catch{}})}const ye=$(T);if(ye)for(let Le=ye.length-1;Le>=0;--Le){const Ge=ye[Le],He=Ge&&Ge.name;if(typeof He=="string")try{T.removeAttribute(He)}catch{}}},Fn=function(T,P){try{Wc(l.removed,{attribute:P.getAttributeNode(T),from:P})}catch{Wc(l.removed,{attribute:null,from:P})}if(P.removeAttribute(T),T==="is")if(gn||Sn)try{Mn(P)}catch{}else try{P.setAttribute(T,"")}catch{}},Un=function(T){const P=$(T);if(P)for(let ye=P.length-1;ye>=0;--ye){const Le=P[ye],Ge=Le&&Le.name;if(!(typeof Ge!="string"||Ze[We(Ge)]))try{T.removeAttribute(Ge)}catch{}}},Cs=function(T){const P=[T];for(;P.length>0;){const ye=P.pop();(I?I(ye):ye.nodeType)===gl.element&&Un(ye);const Ge=C(ye);if(Ge)for(let He=Ge.length-1;He>=0;--He)P.push(Ge[He])}},cs=function(T){if(!Xe)return;const P=[T];for(;P.length>0;){const ye=P.pop(),Le=I?I(ye):ye.nodeType;if(Le===gl.processingInstruction||Le===gl.comment&&ls(kb,ye.data)){try{k(ye)}catch{}continue}if(Le===gl.element){const He=ye,Ct=We(G?G(ye):ye.nodeName);try{He.hasAttribute&&He.hasAttribute("patchsrc")&&He.removeAttribute("patchsrc"),He.hasAttribute&&He.hasAttribute("for")&&Ct!=="label"&&Ct!=="output"&&He.removeAttribute("for")}catch{}}const Ge=C(ye);if(Ge)for(let He=Ge.length-1;He>=0;--He)P.push(Ge[He])}},As=function(T){let P=null,ye=null;if(is)T="<remove></remove>"+T;else{const He=mb(T,/^[\r\n\t ]+/);ye=He&&He[0]}dn==="application/xhtml+xml"&&Yt===qe&&(T='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+T+"</body></html>");const Le=M?H(T):T;if(Yt===qe)try{P=new y().parseFromString(Le,dn)}catch{}if(!P||!P.documentElement){P=D.createDocument(Yt,"template",null);try{P.documentElement.innerHTML=Tn?z:Le}catch{}}const Ge=P.body||P.documentElement;return T&&ye&&Ge.insertBefore(r.createTextNode(ye),Ge.childNodes[0]||null),Yt===qe?be.call(P,vn?"html":"body")[0]:vn?P.documentElement:Ge},bl=function(T){return U.call(T.ownerDocument||T,T,g.SHOW_ELEMENT|g.SHOW_COMMENT|g.SHOW_TEXT|g.SHOW_PROCESSING_INSTRUCTION|g.SHOW_CDATA_SECTION,null)},In=function(T){return T=pu(T,ee," "),T=pu(T,me," "),T=pu(T,Se," "),T},$s=function(T){var P;T.normalize();const ye=U.call(T.ownerDocument||T,T,g.SHOW_TEXT|g.SHOW_COMMENT|g.SHOW_CDATA_SECTION|g.SHOW_PROCESSING_INSTRUCTION,null);let Le=ye.nextNode();for(;Le;)Le.data=In(Le.data),Le=ye.nextNode();const Ge=(P=T.querySelectorAll)===null||P===void 0?void 0:P.call(T,"template");Ge&&Pc(Ge,He=>{vt(He.content)&&$s(He.content)})},ns=function(T){const P=G?G(T):null;return typeof P!="string"||We(P)!=="form"?!1:typeof T.nodeName!="string"||typeof T.textContent!="string"||typeof T.removeChild!="function"||T.attributes!==$(T)||typeof T.removeAttribute!="function"||typeof T.setAttribute!="function"||typeof T.namespaceURI!="string"||typeof T.insertBefore!="function"||typeof T.hasChildNodes!="function"||T.nodeType!==I(T)||T.childNodes!==C(T)},vt=function(T){if(!I||typeof T!="object"||T===null)return!1;try{return I(T)===gl.documentFragment}catch{return!1}},xn=function(T){if(!I||typeof T!="object"||T===null)return!1;try{return typeof I(T)=="number"}catch{return!1}};function at(je,T,P){je.length!==0&&Pc(je,ye=>{ye.call(l,T,P,rs)})}const Wl=function(T,P){return!!(Xe&&T.hasChildNodes()&&!xn(T.firstElementChild)&&ls(wb,T.textContent)&&ls(wb,T.innerHTML)||Xe&&T.namespaceURI===qe&&P==="style"&&xn(T.firstElementChild)||T.nodeType===gl.processingInstruction||Xe&&T.nodeType===gl.comment&&ls(kb,T.data))},Rn=function(T,P){if(!Gt[P]&&Bn(P)&&(tt.tagNameCheck instanceof RegExp&&ls(tt.tagNameCheck,P)||tt.tagNameCheck instanceof Function&&tt.tagNameCheck(P)))return!1;if(Wt&&!ke[P]){const ye=V(T),Le=C(T);if(Le&&ye){const Ge=Le.length;for(let He=Ge-1;He>=0;--He){const Ct=ts?Le[He]:S(Le[He],!0);ye.insertBefore(Ct,A(T))}}}return Mn(T),!0},qs=function(T,P){if(at(E.beforeSanitizeElements,T,null),T!==P&&V(T)===null)return!0;if(ns(T))return Mn(T),!0;const ye=We(G?G(T):T.nodeName);if(at(E.uponSanitizeElement,T,{tagName:ye,allowedTags:Qe}),T!==P&&V(T)===null)return!0;if(Wl(T,ye))return Mn(T),!0;if(Gt[ye]||!(ct.tagCheck instanceof Function&&ct.tagCheck(ye))&&!Qe[ye]){const Ge=Rn(T,ye);return Ge===!1&&at(E.afterSanitizeElements,T,null),Ge}if((I?I(T):T.nodeType)===gl.element&&!Ll(T)||(ye==="noscript"||ye==="noembed"||ye==="noframes")&&ls(p1,T.innerHTML))return Mn(T),!0;if(pt&&T.nodeType===gl.text){const Ge=In(T.textContent);T.textContent!==Ge&&(Wc(l.removed,{element:T.cloneNode()}),T.textContent=Ge)}return at(E.afterSanitizeElements,T,null),!1},Zn=function(T,P,ye){if(es[P]||Xe&&P==="patchsrc"||Xe&&P==="for"&&T!=="label"&&T!=="output"||Et&&(P==="id"||P==="name")&&(ye in r||ye in Ts))return!1;const Le=Ze[P]||ct.attributeCheck instanceof Function&&ct.attributeCheck(P,T);if(!(Ce&&ls(q,P))){if(!(ft&&ls(we,P))){if(Le){if(!nt[P]){if(!ls(Zt,pu(ye,Ie,""))){if(!((P==="src"||P==="xlink:href"||P==="href")&&T!=="script"&&gb(ye,"data:")===0&&it[T])){if(!(Je&&!ls(ie,pu(ye,Ie,"")))){if(ye)return!1}}}}}else if(!(Bn(T)&&(tt.tagNameCheck instanceof RegExp&&ls(tt.tagNameCheck,T)||tt.tagNameCheck instanceof Function&&tt.tagNameCheck(T))&&(tt.attributeNameCheck instanceof RegExp&&ls(tt.attributeNameCheck,P)||tt.attributeNameCheck instanceof Function&&tt.attributeNameCheck(P,T))||P==="is"&&tt.allowCustomizedBuiltInElements&&(tt.tagNameCheck instanceof RegExp&&ls(tt.tagNameCheck,ye)||tt.tagNameCheck instanceof Function&&tt.tagNameCheck(ye))))return!1}}return!0},_l=wt({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Bn=function(T){return!_l[yu(T)]&&ls(ze,T)},Dn=function(T,P,ye,Le){if(M&&typeof j=="object"&&typeof j.getAttributeType=="function"&&!ye)switch(j.getAttributeType(T,P)){case"TrustedHTML":return H(Le);case"TrustedScriptURL":return fe(Le)}return Le},Gs=function(T,P,ye,Le){try{ye?T.setAttributeNS(ye,P,Le):T.setAttribute(P,Le),ns(T)?Mn(T):pb(l.removed)}catch{Fn(P,T)}},bn=function(T){at(E.beforeSanitizeAttributes,T,null);const P=T.attributes;if(!P||ns(T))return;const ye={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ze,forceKeepAttr:void 0};let Le=P.length;const Ge=We(T.nodeName);for(;Le--;){const He=P[Le],Ct=He.name,bt=He.namespaceURI,jn=He.value,At=We(Ct),Nn=jn;let _n=Ct==="value"?Nn:Zj(Nn);if(ye.attrName=At,ye.attrValue=_n,ye.keepAttr=!0,ye.forceKeepAttr=void 0,at(E.uponSanitizeAttribute,T,ye),_n=ye.attrValue,Pt&&(At==="id"||At==="name")&&gb(_n,En)!==0&&(Fn(Ct,T),_n=En+_n),Xe&&ls(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,_n)){Fn(Ct,T);continue}if(At==="attributename"&&mb(_n,"href")){Fn(Ct,T);continue}if(!ye.forceKeepAttr){if(!ye.keepAttr){Fn(Ct,T);continue}if(!St&&ls(m1,_n)){Fn(Ct,T);continue}if(pt&&(_n=In(_n)),!Zn(Ge,At,_n)){Fn(Ct,T);continue}_n=Dn(Ge,At,bt,_n),_n!==Nn&&Gs(T,Ct,bt,_n)}}at(E.afterSanitizeAttributes,T,null)},gs=function(T){let P=null;const ye=bl(T);for(at(E.beforeSanitizeShadowDOM,T,null);P=ye.nextNode();)if(at(E.uponSanitizeShadowNode,P,null),qs(P,T),bn(P),vt(P.content)&&gs(P.content),(I?I(P):P.nodeType)===gl.element){const Ge=Q(P);vt(Ge)&&(xt(Ge),gs(Ge))}at(E.afterSanitizeShadowDOM,T,null)},xt=function(T){const P=[{node:T,shadow:null}];for(;P.length>0;){const ye=P.pop();if(ye.shadow){gs(ye.shadow);continue}const Le=ye.node,He=(I?I(Le):Le.nodeType)===gl.element,Ct=C(Le);if(Ct)for(let bt=Ct.length-1;bt>=0;--bt)P.push({node:Ct[bt],shadow:null});if(He){const bt=G?G(Le):null;if(typeof bt=="string"&&We(bt)==="template"){const jn=Le.content;vt(jn)&&P.push({node:jn,shadow:null})}}if(He){const bt=Q(Le);vt(bt)&&P.push({node:null,shadow:bt},{node:bt,shadow:null})}}};return l.sanitize=function(je){let T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},P=null,ye=null,Le=null,Ge=null;if(Tn=!je,Tn&&(je="<!-->"),typeof je!="string"&&!xn(je)&&(je=t1(je),typeof je!="string"))throw zr("dirty is not a string, aborting");if(!l.isSupported)return je;zn?(Qe=Tt,Ze=tn):Pl(T),(E.uponSanitizeElement.length>0||E.uponSanitizeAttribute.length>0)&&(Qe=Us(Qe)),E.uponSanitizeAttribute.length>0&&(Ze=Us(Ze)),l.removed=[];const He=ts&&typeof je!="string"&&xn(je);if(He){cs(je);const At=G?G(je):je.nodeName;if(typeof At=="string"){const Nn=We(At);if(!Qe[Nn]||Gt[Nn])throw Ut(je),zr("root node is forbidden and cannot be sanitized in-place")}if(ns(je))throw Ut(je),zr("root node is clobbered and cannot be sanitized in-place");try{xt(je)}catch(Nn){throw Ut(je),Nn}}else if(xn(je))P=As("<!---->"),ye=P.ownerDocument.importNode(je,!0),ye.nodeType===gl.element&&ye.nodeName==="BODY"||ye.nodeName==="HTML"?P=ye:P.appendChild(ye),xt(ye);else{if(!gn&&!pt&&!vn&&je.indexOf("<")===-1)return M&&ms?H(je):je;if(P=As(je),!P)return gn?null:ms?z:""}P&&is&&Mn(P.firstChild);const Ct=He?je:P,bt=bl(Ct);try{for(;Le=bt.nextNode();)qs(Le,Ct),bn(Le),vt(Le.content)&&gs(Le.content)}catch(At){throw He&&(Ut(je),Pc(l.removed,Nn=>{Nn.element&&Cs(Nn.element)})),At}if(He)return Pc(l.removed,At=>{At.element&&Cs(At.element)}),pt&&$s(je),je;if(gn){if(pt&&$s(P),Sn)for(Ge=ce.call(P.ownerDocument);P.firstChild;)Ge.appendChild(P.firstChild);else Ge=P;return(Ze.shadowroot||Ze.shadowrootmode)&&(Ge=Ne.call(c,Ge,!0)),Ge}let jn=vn?P.outerHTML:P.innerHTML;return vn&&Qe["!doctype"]&&P.ownerDocument&&P.ownerDocument.doctype&&P.ownerDocument.doctype.name&&ls(f1,P.ownerDocument.doctype.name)&&(jn="<!DOCTYPE "+P.ownerDocument.doctype.name+`>
|
|
116
|
-
`+jn),pt&&(jn=In(jn)),M&&ms?H(jn):jn},l.setConfig=function(){let je=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Pl(je),zn=!0,Tt=Qe,tn=Ze},l.clearConfig=function(){rs=null,zn=!1,Tt=null,tn=null,M=R,z=""},l.isValidAttribute=function(je,T,P){rs||Pl({});const ye=We(je),Le=We(T);return Zn(ye,Le,P)},l.addHook=function(je,T){typeof T=="function"&&as(E,je)&&Wc(E[je],T)},l.removeHook=function(je,T){if(as(E,je)){if(T!==void 0){const P=Kj(E[je],T);return P===-1?void 0:Fj(E[je],P,1)[0]}return pb(E[je])}},l.removeHooks=function(je){as(E,je)&&(E[je]=[])},l.removeAllHooks=function(){E=Sb()},l}var b1=uy();const _1=1024;let y1=0;class Rl{constructor(l,r){this.from=l,this.to=r}}class on{constructor(l={}){this.id=y1++,this.perNode=!!l.perNode,this.deserialize=l.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=l.combine||null}add(l){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof l!="function"&&(l=Fl.match(l)),r=>{let c=l(r);return c===void 0?null:[this,c]}}}on.closedBy=new on({deserialize:n=>n.split(" ")});on.openedBy=new on({deserialize:n=>n.split(" ")});on.group=new on({deserialize:n=>n.split(" ")});on.isolate=new on({deserialize:n=>{if(n&&n!="rtl"&&n!="ltr"&&n!="auto")throw new RangeError("Invalid value for isolate: "+n);return n||"auto"}});on.contextHash=new on({perNode:!0});on.lookAhead=new on({perNode:!0});on.mounted=new on({perNode:!0});class ao{constructor(l,r,c,o=!1){this.tree=l,this.overlay=r,this.parser=c,this.bracketed=o}static get(l){return l&&l.props&&l.props[on.mounted.id]}}const v1=Object.create(null);class Fl{constructor(l,r,c,o=0){this.name=l,this.props=r,this.id=c,this.flags=o}static define(l){let r=l.props&&l.props.length?Object.create(null):v1,c=(l.top?1:0)|(l.skipped?2:0)|(l.error?4:0)|(l.name==null?8:0),o=new Fl(l.name||"",r,l.id,c);if(l.props){for(let d of l.props)if(Array.isArray(d)||(d=d(o)),d){if(d[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");r[d[0].id]=d[1]}}return o}prop(l){return this.props[l.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(l){if(typeof l=="string"){if(this.name==l)return!0;let r=this.prop(on.group);return r?r.indexOf(l)>-1:!1}return this.id==l}static match(l){let r=Object.create(null);for(let c in l)for(let o of c.split(" "))r[o]=l[c];return c=>{for(let o=c.prop(on.group),d=-1;d<(o?o.length:0);d++){let h=r[d<0?c.name:o[d]];if(h)return h}}}}Fl.none=new Fl("",Object.create(null),0,8);class dy{constructor(l){this.types=l;for(let r=0;r<l.length;r++)if(l[r].id!=r)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...l){let r=[];for(let c of this.types){let o=null;for(let d of l){let h=d(c);if(h){o||(o=Object.assign({},c.props));let m=h[1],g=h[0];g.combine&&g.id in o&&(m=g.combine(o[g.id],m)),o[g.id]=m}}r.push(o?new Fl(c.name,o,c.id,c.flags):c)}return new dy(r)}}const $d=new WeakMap,Eb=new WeakMap;var rn;(function(n){n[n.ExcludeBuffers=1]="ExcludeBuffers",n[n.IncludeAnonymous=2]="IncludeAnonymous",n[n.IgnoreMounts=4]="IgnoreMounts",n[n.IgnoreOverlays=8]="IgnoreOverlays",n[n.EnterBracketed=16]="EnterBracketed"})(rn||(rn={}));class sl{constructor(l,r,c,o,d){if(this.type=l,this.children=r,this.positions=c,this.length=o,this.props=null,d&&d.length){this.props=Object.create(null);for(let[h,m]of d)this.props[typeof h=="number"?h:h.id]=m}}toString(){let l=ao.get(this);if(l&&!l.overlay)return l.tree.toString();let r="";for(let c of this.children){let o=c.toString();o&&(r&&(r+=","),r+=o)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(r.length?"("+r+")":""):r}cursor(l=0){return new mf(this.topNode,l)}cursorAt(l,r=0,c=0){let o=$d.get(this)||this.topNode,d=new mf(o);return d.moveTo(l,r),$d.set(this,d._tree),d}get topNode(){return new Ss(this,0,0,null)}resolve(l,r=0){let c=Eu($d.get(this)||this.topNode,l,r,!1);return $d.set(this,c),c}resolveInner(l,r=0){let c=Eu(Eb.get(this)||this.topNode,l,r,!0);return Eb.set(this,c),c}resolveStack(l,r=0){return w1(this,l,r)}iterate(l){let{enter:r,leave:c,from:o=0,to:d=this.length}=l,h=l.mode||0,m=(h&rn.IncludeAnonymous)>0;for(let g=this.cursor(h|rn.IncludeAnonymous);;){let b=!1;if(g.from<=d&&g.to>=o&&(!m&&g.type.isAnonymous||r(g)!==!1)){if(g.firstChild())continue;b=!0}for(;b&&c&&(m||!g.type.isAnonymous)&&c(g),!g.nextSibling();){if(!g.parent())return;b=!0}}}prop(l){return l.perNode?this.props?this.props[l.id]:void 0:this.type.prop(l)}get propValues(){let l=[];if(this.props)for(let r in this.props)l.push([+r,this.props[r]]);return l}balance(l={}){return this.children.length<=8?this:Wp(Fl.none,this.children,this.positions,0,this.children.length,0,this.length,(r,c,o)=>new sl(this.type,r,c,o,this.propValues),l.makeTree||((r,c,o)=>new sl(Fl.none,r,c,o)))}static build(l){return k1(l)}}sl.empty=new sl(Fl.none,[],[],0);class Jp{constructor(l,r){this.buffer=l,this.index=r}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Jp(this.buffer,this.index)}}class or{constructor(l,r,c){this.buffer=l,this.length=r,this.set=c}get type(){return Fl.none}toString(){let l=[];for(let r=0;r<this.buffer.length;)l.push(this.childString(r)),r=this.buffer[r+3];return l.join(",")}childString(l){let r=this.buffer[l],c=this.buffer[l+3],o=this.set.types[r],d=o.name;if(/\W/.test(d)&&!o.isError&&(d=JSON.stringify(d)),l+=4,c==l)return d;let h=[];for(;l<c;)h.push(this.childString(l)),l=this.buffer[l+3];return d+"("+h.join(",")+")"}findChild(l,r,c,o,d){let{buffer:h}=this,m=-1;for(let g=l;g!=r&&!(fy(d,o,h[g+1],h[g+2])&&(m=g,c>0));g=h[g+3]);return m}slice(l,r,c){let o=this.buffer,d=new Uint16Array(r-l),h=0;for(let m=l,g=0;m<r;){d[g++]=o[m++],d[g++]=o[m++]-c;let b=d[g++]=o[m++]-c;d[g++]=o[m++]-l,h=Math.max(h,b)}return new or(d,h,this.set)}}function fy(n,l,r,c){switch(n){case-2:return r<l;case-1:return c>=l&&r<l;case 0:return r<l&&c>l;case 1:return r<=l&&c>l;case 2:return c>l;case 4:return!0}}function Eu(n,l,r,c){for(var o;n.from==n.to||(r<1?n.from>=l:n.from>l)||(r>-1?n.to<=l:n.to<l);){let h=!c&&n instanceof Ss&&n.index<0?null:n.parent;if(!h)return n;n=h}let d=c?0:rn.IgnoreOverlays;if(c)for(let h=n,m=h.parent;m;h=m,m=h.parent)h instanceof Ss&&h.index<0&&((o=m.enter(l,r,d))===null||o===void 0?void 0:o.from)!=h.from&&(n=m);for(;;){let h=n.enter(l,r,d);if(!h)return n;n=h}}class hy{cursor(l=0){return new mf(this,l)}getChild(l,r=null,c=null){let o=Tb(this,l,r,c);return o.length?o[0]:null}getChildren(l,r=null,c=null){return Tb(this,l,r,c)}resolve(l,r=0){return Eu(this,l,r,!1)}resolveInner(l,r=0){return Eu(this,l,r,!0)}matchContext(l){return Ap(this.parent,l)}enterUnfinishedNodesBefore(l){let r=this.childBefore(l),c=this;for(;r;){let o=r.lastChild;if(!o||o.to!=r.to)break;o.type.isError&&o.from==o.to?(c=r,r=o.prevSibling):r=o}return c}get node(){return this}get next(){return this.parent}}class Ss extends hy{constructor(l,r,c,o){super(),this._tree=l,this.from=r,this.index=c,this._parent=o}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(l,r,c,o,d=0){for(let h=this;;){for(let{children:m,positions:g}=h._tree,b=r>0?m.length:-1;l!=b;l+=r){let y=m[l],j=g[l]+h.from,v;if(!(!(d&rn.EnterBracketed&&y instanceof sl&&(v=ao.get(y))&&!v.overlay&&v.bracketed&&c>=j&&c<=j+y.length)&&!fy(o,c,j,j+y.length))){if(y instanceof or){if(d&rn.ExcludeBuffers)continue;let S=y.findChild(0,y.buffer.length,r,c-j,o);if(S>-1)return new Ca(new j1(h,y,l,j),null,S)}else if(d&rn.IncludeAnonymous||!y.type.isAnonymous||Pp(y)){let S;if(!(d&rn.IgnoreMounts)&&(S=ao.get(y))&&!S.overlay)return new Ss(S.tree,j,l,h);let k=new Ss(y,j,l,h);return d&rn.IncludeAnonymous||!k.type.isAnonymous?k:k.nextChild(r<0?y.children.length-1:0,r,c,o,d)}}}if(d&rn.IncludeAnonymous||!h.type.isAnonymous||(h.index>=0?l=h.index+r:l=r<0?-1:h._parent._tree.children.length,h=h._parent,!h))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(l){return this.nextChild(0,1,l,2)}childBefore(l){return this.nextChild(this._tree.children.length-1,-1,l,-2)}prop(l){return this._tree.prop(l)}enter(l,r,c=0){let o;if(!(c&rn.IgnoreOverlays)&&(o=ao.get(this._tree))&&o.overlay){let d=l-this.from,h=c&rn.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 Ss(o.tree,o.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,l,r,c)}nextSignificantParent(){let l=this;for(;l.type.isAnonymous&&l._parent;)l=l._parent;return l}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function Tb(n,l,r,c){let o=n.cursor(),d=[];if(!o.firstChild())return d;if(r!=null){for(let h=!1;!h;)if(h=o.type.is(r),!o.nextSibling())return d}for(;;){if(c!=null&&o.type.is(c))return d;if(o.type.is(l)&&d.push(o.node),!o.nextSibling())return c==null?d:[]}}function Ap(n,l,r=l.length-1){for(let c=n;r>=0;c=c.parent){if(!c)return!1;if(!c.type.isAnonymous){if(l[r]&&l[r]!=c.name)return!1;r--}}return!0}class j1{constructor(l,r,c,o){this.parent=l,this.buffer=r,this.index=c,this.start=o}}class Ca extends hy{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(l,r,c){super(),this.context=l,this._parent=r,this.index=c,this.type=l.buffer.set.types[l.buffer.buffer[c]]}child(l,r,c){let{buffer:o}=this.context,d=o.findChild(this.index+4,o.buffer[this.index+3],l,r-this.context.start,c);return d<0?null:new Ca(this.context,this,d)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(l){return this.child(1,l,2)}childBefore(l){return this.child(-1,l,-2)}prop(l){return this.type.prop(l)}enter(l,r,c=0){if(c&rn.ExcludeBuffers)return null;let{buffer:o}=this.context,d=o.findChild(this.index+4,o.buffer[this.index+3],r>0?1:-1,l-this.context.start,r);return d<0?null:new Ca(this.context,this,d)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(l){return this._parent?null:this.context.parent.nextChild(this.context.index+l,l,0,4)}get nextSibling(){let{buffer:l}=this.context,r=l.buffer[this.index+3];return r<(this._parent?l.buffer[this._parent.index+3]:l.buffer.length)?new Ca(this.context,this._parent,r):this.externalSibling(1)}get prevSibling(){let{buffer:l}=this.context,r=this._parent?this._parent.index+4:0;return this.index==r?this.externalSibling(-1):new Ca(this.context,this._parent,l.findChild(r,this.index,-1,0,4))}get tree(){return null}toTree(){let l=[],r=[],{buffer:c}=this.context,o=this.index+4,d=c.buffer[this.index+3];if(d>o){let h=c.buffer[this.index+1];l.push(c.slice(o,d,h)),r.push(0)}return new sl(this.type,l,r,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function py(n){if(!n.length)return null;let l=0,r=n[0];for(let d=1;d<n.length;d++){let h=n[d];(h.from>r.from||h.to<r.to)&&(r=h,l=d)}let c=r instanceof Ss&&r.index<0?null:r.parent,o=n.slice();return c?o[l]=c:o.splice(l,1),new N1(o,r)}class N1{constructor(l,r){this.heads=l,this.node=r}get next(){return py(this.heads)}}function w1(n,l,r){let c=n.resolveInner(l,r),o=null;for(let d=c instanceof Ss?c:c.context.parent;d;d=d.parent)if(d.index<0){let h=d.parent;(o||(o=[c])).push(h.resolve(l,r)),d=h}else{let h=ao.get(d.tree);if(h&&h.overlay&&h.overlay[0].from<=l&&h.overlay[h.overlay.length-1].to>=l){let m=new Ss(h.tree,h.overlay[0].from+d.from,-1,d);(o||(o=[c])).push(Eu(m,l,r,!1))}}return o?py(o):c}class mf{get name(){return this.type.name}constructor(l,r=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=r&~rn.EnterBracketed,l instanceof Ss)this.yieldNode(l);else{this._tree=l.context.parent,this.buffer=l.context;for(let c=l._parent;c;c=c._parent)this.stack.unshift(c.index);this.bufferNode=l,this.yieldBuf(l.index)}}yieldNode(l){return l?(this._tree=l,this.type=l.type,this.from=l.from,this.to=l.to,!0):!1}yieldBuf(l,r){this.index=l;let{start:c,buffer:o}=this.buffer;return this.type=r||o.set.types[o.buffer[l]],this.from=c+o.buffer[l+1],this.to=c+o.buffer[l+2],!0}yield(l){return l?l instanceof Ss?(this.buffer=null,this.yieldNode(l)):(this.buffer=l.context,this.yieldBuf(l.index,l.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(l,r,c){if(!this.buffer)return this.yield(this._tree.nextChild(l<0?this._tree._tree.children.length-1:0,l,r,c,this.mode));let{buffer:o}=this.buffer,d=o.findChild(this.index+4,o.buffer[this.index+3],l,r-this.buffer.start,c);return d<0?!1:(this.stack.push(this.index),this.yieldBuf(d))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(l){return this.enterChild(1,l,2)}childBefore(l){return this.enterChild(-1,l,-2)}enter(l,r,c=this.mode){return this.buffer?c&rn.ExcludeBuffers?!1:this.enterChild(1,l,r):this.yield(this._tree.enter(l,r,c))}parent(){if(!this.buffer)return this.yieldNode(this.mode&rn.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let l=this.mode&rn.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(l)}sibling(l){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+l,l,0,4,this.mode)):!1;let{buffer:r}=this.buffer,c=this.stack.length-1;if(l<0){let o=c<0?0:this.stack[c]+4;if(this.index!=o)return this.yieldBuf(r.findChild(o,this.index,-1,0,4))}else{let o=r.buffer[this.index+3];if(o<(c<0?r.buffer.length:r.buffer[this.stack[c]+3]))return this.yieldBuf(o)}return c<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+l,l,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(l){let r,c,{buffer:o}=this;if(o){if(l>0){if(this.index<o.buffer.buffer.length)return!1}else for(let d=0;d<this.index;d++)if(o.buffer.buffer[d+3]<this.index)return!1;({index:r,parent:c}=o)}else({index:r,_parent:c}=this._tree);for(;c;{index:r,_parent:c}=c)if(r>-1)for(let d=r+l,h=l<0?-1:c._tree.children.length;d!=h;d+=l){let m=c._tree.children[d];if(this.mode&rn.IncludeAnonymous||m instanceof or||!m.type.isAnonymous||Pp(m))return!1}return!0}move(l,r){if(r&&this.enterChild(l,0,4))return!0;for(;;){if(this.sibling(l))return!0;if(this.atLastNode(l)||!this.parent())return!1}}next(l=!0){return this.move(1,l)}prev(l=!0){return this.move(-1,l)}moveTo(l,r=0){for(;(this.from==this.to||(r<1?this.from>=l:this.from>l)||(r>-1?this.to<=l:this.to<l))&&this.parent(););for(;this.enterChild(1,l,r););return this}get node(){if(!this.buffer)return this._tree;let l=this.bufferNode,r=null,c=0;if(l&&l.context==this.buffer)e:for(let o=this.index,d=this.stack.length;d>=0;){for(let h=l;h;h=h._parent)if(h.index==o){if(o==this.index)return h;r=h,c=d+1;break e}o=this.stack[--d]}for(let o=c;o<this.stack.length;o++)r=new Ca(this.buffer,r,this.stack[o]);return this.bufferNode=new Ca(this.buffer,r,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(l,r){for(let c=0;;){let o=!1;if(this.type.isAnonymous||l(this)!==!1){if(this.firstChild()){c++;continue}this.type.isAnonymous||(o=!0)}for(;;){if(o&&r&&r(this),o=this.type.isAnonymous,!c)return;if(this.nextSibling())break;this.parent(),c--,o=!0}}}matchContext(l){if(!this.buffer)return Ap(this.node.parent,l);let{buffer:r}=this.buffer,{types:c}=r.set;for(let o=l.length-1,d=this.stack.length-1;o>=0;d--){if(d<0)return Ap(this._tree,l,o);let h=c[r.buffer[this.stack[d]]];if(!h.isAnonymous){if(l[o]&&l[o]!=h.name)return!1;o--}}return!0}}function Pp(n){return n.children.some(l=>l instanceof or||!l.type.isAnonymous||Pp(l))}function k1(n){var l;let{buffer:r,nodeSet:c,maxBufferLength:o=_1,reused:d=[],minRepeatType:h=c.types.length}=n,m=Array.isArray(r)?new Jp(r,r.length):r,g=c.types,b=0,y=0;function j(G,M,z,R,K,ae){let{id:Y,start:H,end:fe,size:ue}=m,X=y,D=b;if(ue<0)if(m.next(),ue==-1){let E=d[Y];z.push(E),R.push(H-G);return}else if(ue==-3){b=Y;return}else if(ue==-4){y=Y;return}else throw new RangeError(`Unrecognized record size: ${ue}`);let U=g[Y],ce,be,Ne=H-G;if(fe-H<=o&&(be=C(m.pos-M,K))){let E=new Uint16Array(be.size-be.skip),ee=m.pos-be.size,me=E.length;for(;m.pos>ee;)me=V(be.start,E,me);ce=new or(E,fe-be.start,c),Ne=be.start-G}else{let E=m.pos-ue;m.next();let ee=[],me=[],Se=Y>=h?Y:-1,q=0,we=fe;for(;m.pos>E;)Se>=0&&m.id==Se&&m.size>=0?(m.end<=we-o&&(k(ee,me,H,q,m.end,we,Se,X,D),q=ee.length,we=m.end),m.next()):ae>2500?v(H,E,ee,me):j(H,E,ee,me,Se,ae+1);if(Se>=0&&q>0&&q<ee.length&&k(ee,me,H,q,H,we,Se,X,D),ee.reverse(),me.reverse(),Se>-1&&q>0){let ie=S(U,D);ce=Wp(U,ee,me,0,ee.length,0,fe-H,ie,ie)}else ce=A(U,ee,me,fe-H,X-fe,D)}z.push(ce),R.push(Ne)}function v(G,M,z,R){let K=[],ae=0,Y=-1;for(;m.pos>M;){let{id:H,start:fe,end:ue,size:X}=m;if(X>4)m.next();else{if(Y>-1&&fe<Y)break;Y<0&&(Y=ue-o),K.push(H,fe,ue),ae++,m.next()}}if(ae){let H=new Uint16Array(ae*4),fe=K[K.length-2];for(let ue=K.length-3,X=0;ue>=0;ue-=3)H[X++]=K[ue],H[X++]=K[ue+1]-fe,H[X++]=K[ue+2]-fe,H[X++]=X;z.push(new or(H,K[2]-fe,c)),R.push(fe-G)}}function S(G,M){return(z,R,K)=>{let ae=0,Y=z.length-1,H,fe;if(Y>=0&&(H=z[Y])instanceof sl){if(!Y&&H.type==G&&H.length==K)return H;(fe=H.prop(on.lookAhead))&&(ae=R[Y]+H.length+fe)}return A(G,z,R,K,ae,M)}}function k(G,M,z,R,K,ae,Y,H,fe){let ue=[],X=[];for(;G.length>R;)ue.push(G.pop()),X.push(M.pop()+z-K);G.push(A(c.types[Y],ue,X,ae-K,H-ae,fe)),M.push(K-z)}function A(G,M,z,R,K,ae,Y){if(ae){let H=[on.contextHash,ae];Y=Y?[H].concat(Y):[H]}if(K>25){let H=[on.lookAhead,K];Y=Y?[H].concat(Y):[H]}return new sl(G,M,z,R,Y)}function C(G,M){let z=m.fork(),R=0,K=0,ae=0,Y=z.end-o,H={size:0,start:0,skip:0};e:for(let fe=z.pos-G;z.pos>fe;){let ue=z.size;if(z.id==M&&ue>=0){H.size=R,H.start=K,H.skip=ae,ae+=4,R+=4,z.next();continue}let X=z.pos-ue;if(ue<0||X<fe||z.start<Y)break;let D=z.id>=h?4:0,U=z.start;for(z.next();z.pos>X;){if(z.size<0)if(z.size==-3||z.size==-4)D+=4;else break e;else z.id>=h&&(D+=4);z.next()}K=U,R+=ue,ae+=D}return(M<0||R==G)&&(H.size=R,H.start=K,H.skip=ae),H.size>4?H:void 0}function V(G,M,z){let{id:R,start:K,end:ae,size:Y}=m;if(m.next(),Y>=0&&R<h){let H=z;if(Y>4){let fe=m.pos-(Y-4);for(;m.pos>fe;)z=V(G,M,z)}M[--z]=H,M[--z]=ae-G,M[--z]=K-G,M[--z]=R}else Y==-3?b=R:Y==-4&&(y=R);return z}let Q=[],$=[];for(;m.pos>0;)j(n.start||0,n.bufferStart||0,Q,$,-1,0);let I=(l=n.length)!==null&&l!==void 0?l:Q.length?$[0]+Q[0].length:0;return new sl(g[n.topID],Q.reverse(),$.reverse(),I)}const Cb=new WeakMap;function af(n,l){if(!n.isAnonymous||l instanceof or||l.type!=n)return 1;let r=Cb.get(l);if(r==null){r=1;for(let c of l.children){if(c.type!=n||!(c instanceof sl)){r=1;break}r+=af(n,c)}Cb.set(l,r)}return r}function Wp(n,l,r,c,o,d,h,m,g){let b=0;for(let k=c;k<o;k++)b+=af(n,l[k]);let y=Math.ceil(b*1.5/8),j=[],v=[];function S(k,A,C,V,Q){for(let $=C;$<V;){let I=$,G=A[$],M=af(n,k[$]);for($++;$<V;$++){let z=af(n,k[$]);if(M+z>=y)break;M+=z}if($==I+1){if(M>y){let z=k[I];S(z.children,z.positions,0,z.children.length,A[I]+Q);continue}j.push(k[I])}else{let z=A[$-1]+k[$-1].length-G;j.push(Wp(n,k,A,I,$,G,z,null,g))}v.push(G+Q-d)}}return S(l,r,c,o,0),(m||g)(j,v,h)}class XE{constructor(){this.map=new WeakMap}setBuffer(l,r,c){let o=this.map.get(l);o||this.map.set(l,o=new Map),o.set(r,c)}getBuffer(l,r){let c=this.map.get(l);return c&&c.get(r)}set(l,r){l instanceof Ca?this.setBuffer(l.context.buffer,l.index,r):l instanceof Ss&&this.map.set(l.tree,r)}get(l){return l instanceof Ca?this.getBuffer(l.context.buffer,l.index):l instanceof Ss?this.map.get(l.tree):void 0}cursorSet(l,r){l.buffer?this.setBuffer(l.buffer.buffer,l.index,r):this.map.set(l.tree,r)}cursorGet(l){return l.buffer?this.getBuffer(l.buffer.buffer,l.index):this.map.get(l.tree)}}class Tu{constructor(l,r,c,o,d=!1,h=!1){this.from=l,this.to=r,this.tree=c,this.offset=o,this.open=(d?1:0)|(h?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(l,r=[],c=!1){let o=[new Tu(0,l.length,l,0,!1,c)];for(let d of r)d.to>l.length&&o.push(d);return o}static applyChanges(l,r,c=128){if(!r.length)return l;let o=[],d=1,h=l.length?l[0]:null;for(let m=0,g=0,b=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||b){let S=Math.max(v.from,g)-b,k=Math.min(v.to,j)-b;v=S>=k?null:new Tu(S,k,v.tree,v.offset+b,m>0,!!y)}if(v&&o.push(v),h.to>j)break;h=d<l.length?l[d++]:null}if(!y)break;g=y.toA,b=y.toA-y.toB}return o}}class VE{startParse(l,r,c){return typeof l=="string"&&(l=new S1(l)),c=c?c.length?c.map(o=>new Rl(o.from,o.to)):[new Rl(0,0)]:[new Rl(0,l.length)],this.createParse(l,r||[],c)}parse(l,r,c){let o=this.startParse(l,r,c);for(;;){let d=o.advance();if(d)return d}}}class S1{constructor(l){this.string=l}get length(){return this.string.length}chunk(l){return this.string.slice(l)}get lineChunks(){return!1}read(l,r){return this.string.slice(l,r)}}function QE(n){return(l,r,c,o)=>new T1(l,n,r,c,o)}class Ab{constructor(l,r,c,o,d,h){this.parser=l,this.parse=r,this.overlay=c,this.bracketed=o,this.target=d,this.from=h}}function Mb(n){if(!n.length||n.some(l=>l.from>=l.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(n))}class E1{constructor(l,r,c,o,d,h,m,g){this.parser=l,this.predicate=r,this.mounts=c,this.index=o,this.start=d,this.bracketed=h,this.target=m,this.prev=g,this.depth=0,this.ranges=[]}}const Mp=new on({perNode:!0});class T1{constructor(l,r,c,o,d){this.nest=r,this.input=c,this.fragments=o,this.ranges=d,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=l}advance(){if(this.baseParse){let c=this.baseParse.advance();if(!c)return null;if(this.baseParse=null,this.baseTree=c,this.startInner(),this.stoppedAt!=null)for(let o of this.inner)o.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let c=this.baseTree;return this.stoppedAt!=null&&(c=new sl(c.type,c.children,c.positions,c.length,c.propValues.concat([[Mp,this.stoppedAt]]))),c}let l=this.inner[this.innerDone],r=l.parse.advance();if(r){this.innerDone++;let c=Object.assign(Object.create(null),l.target.props);c[on.mounted.id]=new ao(r,l.overlay,l.parser,l.bracketed),l.target.props=c}return null}get parsedPos(){if(this.baseParse)return 0;let l=this.input.length;for(let r=this.innerDone;r<this.inner.length;r++)this.inner[r].from<l&&(l=Math.min(l,this.inner[r].parse.parsedPos));return l}stopAt(l){if(this.stoppedAt=l,this.baseParse)this.baseParse.stopAt(l);else for(let r=this.innerDone;r<this.inner.length;r++)this.inner[r].parse.stopAt(l)}startInner(){let l=new M1(this.fragments),r=null,c=null,o=new mf(new Ss(this.baseTree,this.ranges[0].from,0,null),rn.IncludeAnonymous|rn.IgnoreMounts);e:for(let d,h;;){let m=!0,g;if(this.stoppedAt!=null&&o.from>=this.stoppedAt)m=!1;else if(l.hasNode(o)){if(r){let b=r.mounts.find(y=>y.frag.from<=o.from&&y.frag.to>=o.to&&y.mount.overlay);if(b)for(let y of b.mount.overlay){let j=y.from+b.pos,v=y.to+b.pos;j>=o.from&&v<=o.to&&!r.ranges.some(S=>S.from<v&&S.to>j)&&r.ranges.push({from:j,to:v})}}m=!1}else if(c&&(h=C1(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||(A1(o),r&&r.depth++,c&&c.depth++);let b=l.findMounts(o.from,d.parser);if(typeof d.overlay=="function")r=new E1(d.parser,d.overlay,b,this.inner.length,o.from,!!d.bracketed,o.tree,r);else{let y=Ob(this.ranges,d.overlay||(o.from<o.to?[new Rl(o.from,o.to)]:[]));y.length&&Mb(y),(y.length||!d.overlay)&&this.inner.push(new Ab(d.parser,y.length?d.parser.startParse(this.input,Lb(b,y),y):d.parser.startParse(""),d.overlay?d.overlay.map(j=>new Rl(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 Rl(o.from,o.to)),g.from<g.to)){let b=r.ranges.length-1;b>=0&&r.ranges[b].to==g.from?r.ranges[b]={from:r.ranges[b].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 b=Ob(this.ranges,r.ranges);b.length&&(Mb(b),this.inner.splice(r.index,0,new Ab(r.parser,r.parser.startParse(this.input,Lb(r.mounts,b),b),r.ranges.map(y=>new Rl(y.from-r.start,y.to-r.start)),r.bracketed,r.target,b[0].from))),r=r.prev}c&&!--c.depth&&(c=c.prev)}}}}function C1(n,l,r){for(let c of n){if(c.from>=r)break;if(c.to>l)return c.from<=l&&c.to>=r?2:1}return 0}function Rb(n,l,r,c,o,d){if(l<r){let h=n.buffer[l+1];c.push(n.slice(l,r,h)),o.push(h-d)}}function A1(n){let{node:l}=n,r=[],c=l.context.buffer;do r.push(n.index),n.parent();while(!n.tree);let o=n.tree,d=o.children.indexOf(c),h=o.children[d],m=h.buffer,g=[d];function b(y,j,v,S,k,A){let C=r[A],V=[],Q=[];Rb(h,y,C,V,Q,S);let $=m[C+1],I=m[C+2];g.push(V.length);let G=A?b(C+4,m[C+3],h.set.types[m[C]],$,I-$,A-1):l.toTree();return V.push(G),Q.push($-S),Rb(h,m[C+3],j,V,Q,S),new sl(v,V,Q,k)}o.children[d]=b(0,m.length,Fl.none,0,h.length,r.length-1);for(let y of g){let j=n.tree.children[y],v=n.tree.positions[y];n.yield(new Ss(j,v+n.from,y,n._tree))}}class Db{constructor(l,r){this.offset=r,this.done=!1,this.cursor=l.cursor(rn.IncludeAnonymous|rn.IgnoreMounts)}moveTo(l){let{cursor:r}=this,c=l-this.offset;for(;!this.done&&r.from<c;)if(!(r.to>=l&&r.enter(c,1,rn.IgnoreOverlays|rn.ExcludeBuffers)))if(r.to<=l)r.next(!1)||(this.done=!0);else break}hasNode(l){if(this.moveTo(l.from),!this.done&&this.cursor.from+this.offset==l.from&&this.cursor.tree)for(let r=this.cursor.tree;;){if(r==l.tree)return!0;if(r.children.length&&r.positions[0]==0&&r.children[0]instanceof sl)r=r.children[0];else break}return!1}}class M1{constructor(l){var r;if(this.fragments=l,this.curTo=0,this.fragI=0,l.length){let c=this.curFrag=l[0];this.curTo=(r=c.tree.prop(Mp))!==null&&r!==void 0?r:c.to,this.inner=new Db(c.tree,-c.offset)}else this.curFrag=this.inner=null}hasNode(l){for(;this.curFrag&&l.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=l.from&&this.curTo>=l.to&&this.inner.hasNode(l)}nextFrag(){var l;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let r=this.curFrag=this.fragments[this.fragI];this.curTo=(l=r.tree.prop(Mp))!==null&&l!==void 0?l:r.to,this.inner=new Db(r.tree,-r.offset)}}findMounts(l,r){var c;let o=[];if(this.inner){this.inner.cursor.moveTo(l,1);for(let d=this.inner.cursor.node;d;d=d.parent){let h=(c=d.tree)===null||c===void 0?void 0:c.prop(on.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 Ob(n,l){let r=null,c=l;for(let o=1,d=0;o<n.length;o++){let h=n[o-1].to,m=n[o].from;for(;d<c.length;d++){let g=c[d];if(g.from>=m)break;g.to<=h||(r||(c=r=l.slice()),g.from<h?(r[d]=new Rl(g.from,h),g.to>m&&r.splice(d+1,0,new Rl(m,g.to))):g.to>m?r[d--]=new Rl(m,g.to):r.splice(d--,1))}}return c}function R1(n,l,r,c){let o=0,d=0,h=!1,m=!1,g=-1e9,b=[];for(;;){let y=o==n.length?1e9:h?n[o].to:n[o].from,j=d==l.length?1e9:m?l[d].to:l[d].from;if(h!=m){let v=Math.max(g,r),S=Math.min(y,j,c);v<S&&b.push(new Rl(v,S))}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 b}function Lb(n,l){let r=[];for(let{pos:c,mount:o,frag:d}of n){let h=c+(o.overlay?o.overlay[0].from:0),m=h+o.tree.length,g=Math.max(d.from,h),b=Math.min(d.to,m);if(o.overlay){let y=o.overlay.map(v=>new Rl(v.from+c,v.to+c)),j=R1(l,y,g,b);for(let v=0,S=g;;v++){let k=v==j.length,A=k?b:j[v].from;if(A>S&&r.push(new Tu(S,A,o.tree,-h,d.from>=S||d.openStart,d.to<=A||d.openEnd)),k)break;S=j[v].to}}else r.push(new Tu(g,b,o.tree,-h,d.from>=h||d.openStart,d.to<=m||d.openEnd))}return r}let D1=0;class Al{constructor(l,r,c,o){this.name=l,this.set=r,this.base=c,this.modified=o,this.id=D1++}toString(){let{name:l}=this;for(let r of this.modified)r.name&&(l=`${r.name}(${l})`);return l}static define(l,r){let c=typeof l=="string"?l:"?";if(l instanceof Al&&(r=l),r!=null&&r.base)throw new Error("Can not derive from a modified tag");let o=new Al(c,[],null,[]);if(o.set.push(o),r)for(let d of r.set)o.set.push(d);return o}static defineModifier(l){let r=new gf(l);return c=>c.modified.indexOf(r)>-1?c:gf.get(c.base||c,c.modified.concat(r).sort((o,d)=>o.id-d.id))}}let O1=0;class gf{constructor(l){this.name=l,this.instances=[],this.id=O1++}static get(l,r){if(!r.length)return l;let c=r[0].instances.find(m=>m.base==l&&L1(r,m.modified));if(c)return c;let o=[],d=new Al(l.name,o,l,r);for(let m of r)m.instances.push(d);let h=z1(r);for(let m of l.set)if(!m.modified.length)for(let g of h)o.push(gf.get(m,g));return d}}function L1(n,l){return n.length==l.length&&n.every((r,c)=>r==l[c])}function z1(n){let l=[[]];for(let r=0;r<n.length;r++)for(let c=0,o=l.length;c<o;c++)l.push(l[c].concat(n[r]));return l.sort((r,c)=>c.length-r.length)}function KE(n){let l=Object.create(null);for(let r in n){let c=n[r];Array.isArray(c)||(c=[c]);for(let o of r.split(" "))if(o){let d=[],h=2,m=o;for(let j=0;;){if(m=="..."&&j>0&&j+3==o.length){h=1;break}let v=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(m);if(!v)throw new RangeError("Invalid path: "+o);if(d.push(v[0]=="*"?"":v[0][0]=='"'?JSON.parse(v[0]):v[0]),j+=v[0].length,j==o.length)break;let S=o[j++];if(j==o.length&&S=="!"){h=0;break}if(S!="/")throw new RangeError("Invalid path: "+o);m=o.slice(j)}let g=d.length-1,b=d[g];if(!b)throw new RangeError("Invalid path: "+o);let y=new Cu(c,h,g>0?d.slice(0,g):null);l[b]=y.sort(l[b])}}return my.add(l)}const my=new on({combine(n,l){let r,c,o;for(;n||l;){if(!n||l&&n.depth>=l.depth?(o=l,l=l.next):(o=n,n=n.next),r&&r.mode==o.mode&&!o.context&&!r.context)continue;let d=new Cu(o.tags,o.mode,o.context);r?r.next=d:c=d,r=d}return c}});class Cu{constructor(l,r,c,o){this.tags=l,this.mode=r,this.context=c,this.next=o}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(l){return!l||l.depth<this.depth?(this.next=l,this):(l.next=this.sort(l.next),l)}get depth(){return this.context?this.context.length:0}}Cu.empty=new Cu([],2,null);function gy(n,l){let r=Object.create(null);for(let d of n)if(!Array.isArray(d.tag))r[d.tag.id]=d.class;else for(let h of d.tag)r[h.id]=d.class;let{scope:c,all:o=null}=l||{};return{style:d=>{let h=o;for(let m of d)for(let g of m.set){let b=r[g.id];if(b){h=h?h+" "+b:b;break}}return h},scope:c}}function U1(n,l){let r=null;for(let c of n){let o=c.style(l);o&&(r=r?r+" "+o:o)}return r}function I1(n,l,r,c=0,o=n.length){let d=new H1(c,Array.isArray(l)?l:[l],r);d.highlightRange(n.cursor(),c,o,"",d.highlighters),d.flush(o)}function B1(n,l,r,c,o,d=0,h=n.length){let m=d;function g(b,y){if(!(b<=m)){for(let j=n.slice(m,b),v=0;;){let S=j.indexOf(`
|
|
117
|
-
`,v),k=S<0?j.length:S;if(k>v&&c(j.slice(v,k),y),S<0)break;o(),v=S+1}m=b}}I1(l,r,(b,y,j)=>{g(b,""),g(y,j)},d,h),g(h,"")}class H1{constructor(l,r,c){this.at=l,this.highlighters=r,this.span=c,this.class=""}startSpan(l,r){r!=this.class&&(this.flush(l),l>this.at&&(this.at=l),this.class=r)}flush(l){l>this.at&&this.class&&this.span(this.at,l,this.class)}highlightRange(l,r,c,o,d){let{type:h,from:m,to:g}=l;if(m>=c||g<=r)return;h.isTop&&(d=this.highlighters.filter(S=>!S.scope||S.scope(h)));let b=o,y=$1(l)||Cu.empty,j=U1(d,y.tags);if(j&&(b&&(b+=" "),b+=j,y.mode==1&&(o+=(o?" ":"")+j)),this.startSpan(Math.max(r,m),b),y.opaque)return;let v=l.tree&&l.tree.prop(on.mounted);if(v&&v.overlay){let S=l.node.enter(v.overlay[0].from+m,1),k=this.highlighters.filter(C=>!C.scope||C.scope(v.tree.type)),A=l.firstChild();for(let C=0,V=m;;C++){let Q=C<v.overlay.length?v.overlay[C]:null,$=Q?Q.from+m:g,I=Math.max(r,V),G=Math.min(c,$);if(I<G&&A)for(;l.from<G&&(this.highlightRange(l,I,G,o,d),this.startSpan(Math.min(G,l.to),b),!(l.to>=$||!l.nextSibling())););if(!Q||$>c)break;V=Q.to+m,V>r&&(this.highlightRange(S.cursor(),Math.max(r,Q.from+m),Math.min(c,V),"",k),this.startSpan(Math.min(c,V),b))}A&&l.parent()}else if(l.firstChild()){v&&(o="");do if(!(l.to<=r)){if(l.from>=c)break;this.highlightRange(l,r,c,o,d),this.startSpan(Math.min(c,l.to),b)}while(l.nextSibling());l.parent()}}}function $1(n){let l=n.type.prop(my);for(;l&&l.context&&!n.matchContext(l.context);)l=l.next;return l||null}const Ae=Al.define,qd=Ae(),lr=Ae(),zb=Ae(lr),Ub=Ae(lr),ar=Ae(),Gd=Ae(ar),dp=Ae(ar),Sa=Ae(),Ur=Ae(Sa),va=Ae(),ja=Ae(),Rp=Ae(),gu=Ae(Rp),Yd=Ae(),Oe={comment:qd,lineComment:Ae(qd),blockComment:Ae(qd),docComment:Ae(qd),name:lr,variableName:Ae(lr),typeName:zb,tagName:Ae(zb),propertyName:Ub,attributeName:Ae(Ub),className:Ae(lr),labelName:Ae(lr),namespace:Ae(lr),macroName:Ae(lr),literal:ar,string:Gd,docString:Ae(Gd),character:Ae(Gd),attributeValue:Ae(Gd),number:dp,integer:Ae(dp),float:Ae(dp),bool:Ae(ar),regexp:Ae(ar),escape:Ae(ar),color:Ae(ar),url:Ae(ar),keyword:va,self:Ae(va),null:Ae(va),atom:Ae(va),unit:Ae(va),modifier:Ae(va),operatorKeyword:Ae(va),controlKeyword:Ae(va),definitionKeyword:Ae(va),moduleKeyword:Ae(va),operator:ja,derefOperator:Ae(ja),arithmeticOperator:Ae(ja),logicOperator:Ae(ja),bitwiseOperator:Ae(ja),compareOperator:Ae(ja),updateOperator:Ae(ja),definitionOperator:Ae(ja),typeOperator:Ae(ja),controlOperator:Ae(ja),punctuation:Rp,separator:Ae(Rp),bracket:gu,angleBracket:Ae(gu),squareBracket:Ae(gu),paren:Ae(gu),brace:Ae(gu),content:Sa,heading:Ur,heading1:Ae(Ur),heading2:Ae(Ur),heading3:Ae(Ur),heading4:Ae(Ur),heading5:Ae(Ur),heading6:Ae(Ur),contentSeparator:Ae(Sa),list:Ae(Sa),quote:Ae(Sa),emphasis:Ae(Sa),strong:Ae(Sa),link:Ae(Sa),monospace:Ae(Sa),strikethrough:Ae(Sa),inserted:Ae(),deleted:Ae(),changed:Ae(),invalid:Ae(),meta:Yd,documentMeta:Ae(Yd),annotation:Ae(Yd),processingInstruction:Ae(Yd),definition:Al.defineModifier("definition"),constant:Al.defineModifier("constant"),function:Al.defineModifier("function"),standard:Al.defineModifier("standard"),local:Al.defineModifier("local"),special:Al.defineModifier("special")};for(let n in Oe){let l=Oe[n];l instanceof Al&&(l.name=n)}gy([{tag:Oe.link,class:"tok-link"},{tag:Oe.heading,class:"tok-heading"},{tag:Oe.emphasis,class:"tok-emphasis"},{tag:Oe.strong,class:"tok-strong"},{tag:Oe.keyword,class:"tok-keyword"},{tag:Oe.atom,class:"tok-atom"},{tag:Oe.bool,class:"tok-bool"},{tag:Oe.url,class:"tok-url"},{tag:Oe.labelName,class:"tok-labelName"},{tag:Oe.inserted,class:"tok-inserted"},{tag:Oe.deleted,class:"tok-deleted"},{tag:Oe.literal,class:"tok-literal"},{tag:Oe.string,class:"tok-string"},{tag:Oe.number,class:"tok-number"},{tag:[Oe.regexp,Oe.escape,Oe.special(Oe.string)],class:"tok-string2"},{tag:Oe.variableName,class:"tok-variableName"},{tag:Oe.local(Oe.variableName),class:"tok-variableName tok-local"},{tag:Oe.definition(Oe.variableName),class:"tok-variableName tok-definition"},{tag:Oe.special(Oe.variableName),class:"tok-variableName2"},{tag:Oe.definition(Oe.propertyName),class:"tok-propertyName tok-definition"},{tag:Oe.typeName,class:"tok-typeName"},{tag:Oe.namespace,class:"tok-namespace"},{tag:Oe.className,class:"tok-className"},{tag:Oe.macroName,class:"tok-macroName"},{tag:Oe.propertyName,class:"tok-propertyName"},{tag:Oe.operator,class:"tok-operator"},{tag:Oe.comment,class:"tok-comment"},{tag:Oe.meta,class:"tok-meta"},{tag:Oe.invalid,class:"tok-invalid"},{tag:Oe.punctuation,class:"tok-punctuation"}]);const q1="modulepreload",G1=function(n,l){return new URL(n,l).href},Ib={},lt=function(l,r,c){let o=Promise.resolve();if(r&&r.length>0){let h=function(y){return Promise.all(y.map(j=>Promise.resolve(j).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};const m=document.getElementsByTagName("link"),g=document.querySelector("meta[property=csp-nonce]"),b=(g==null?void 0:g.nonce)||(g==null?void 0:g.getAttribute("nonce"));o=h(r.map(y=>{if(y=G1(y,c),y in Ib)return;Ib[y]=!0;const j=y.endsWith(".css"),v=j?'[rel="stylesheet"]':"";if(!!c)for(let A=m.length-1;A>=0;A--){const C=m[A];if(C.href===y&&(!j||C.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${y}"]${v}`))return;const k=document.createElement("link");if(k.rel=j?"stylesheet":q1,j||(k.as="script"),k.crossOrigin="",k.href=y,b&&k.setAttribute("nonce",b),document.head.appendChild(k),j)return new Promise((A,C)=>{k.addEventListener("load",A),k.addEventListener("error",()=>C(new Error(`Unable to preload CSS for ${y}`)))})}))}function d(h){const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=h,window.dispatchEvent(m),!m.defaultPrevented)throw h}return o.then(h=>{for(const m of h||[])m.status==="rejected"&&d(m.reason);return l().catch(d)})},xy={js:async()=>(await lt(async()=>{const{javascript:n}=await import("./index-BPiJlpKF.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({jsx:!0}),cjs:async()=>(await lt(async()=>{const{javascript:n}=await import("./index-BPiJlpKF.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript(),mjs:async()=>(await lt(async()=>{const{javascript:n}=await import("./index-BPiJlpKF.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript(),jsx:async()=>(await lt(async()=>{const{javascript:n}=await import("./index-BPiJlpKF.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({jsx:!0}),ts:async()=>(await lt(async()=>{const{javascript:n}=await import("./index-BPiJlpKF.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),mts:async()=>(await lt(async()=>{const{javascript:n}=await import("./index-BPiJlpKF.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),cts:async()=>(await lt(async()=>{const{javascript:n}=await import("./index-BPiJlpKF.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),tsx:async()=>(await lt(async()=>{const{javascript:n}=await import("./index-BPiJlpKF.js");return{javascript:n}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0,jsx:!0}),json:async()=>(await lt(async()=>{const{json:n}=await import("./index-BIaTEYpO.js");return{json:n}},__vite__mapDeps([6,1,2,3,4]),import.meta.url)).json(),jsonc:async()=>(await lt(async()=>{const{json:n}=await import("./index-BIaTEYpO.js");return{json:n}},__vite__mapDeps([6,1,2,3,4]),import.meta.url)).json(),css:async()=>(await lt(async()=>{const{css:n}=await import("./index-6xG2dMZE.js");return{css:n}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),scss:async()=>(await lt(async()=>{const{css:n}=await import("./index-6xG2dMZE.js");return{css:n}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),less:async()=>(await lt(async()=>{const{css:n}=await import("./index-6xG2dMZE.js");return{css:n}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),html:async()=>(await lt(async()=>{const{html:n}=await import("./index-DVVbk6ww.js");return{html:n}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),htm:async()=>(await lt(async()=>{const{html:n}=await import("./index-DVVbk6ww.js");return{html:n}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),vue:async()=>(await lt(async()=>{const{html:n}=await import("./index-DVVbk6ww.js");return{html:n}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),svelte:async()=>(await lt(async()=>{const{html:n}=await import("./index-DVVbk6ww.js");return{html:n}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),md:async()=>(await lt(async()=>{const{markdown:n}=await import("./index-CFOaholk.js");return{markdown:n}},__vite__mapDeps([9,3,4,2,5,8,1,7,0]),import.meta.url)).markdown(),markdown:async()=>(await lt(async()=>{const{markdown:n}=await import("./index-CFOaholk.js");return{markdown:n}},__vite__mapDeps([9,3,4,2,5,8,1,7,0]),import.meta.url)).markdown(),py:async()=>(await lt(async()=>{const{python:n}=await import("./index-BnIobsSF.js");return{python:n}},__vite__mapDeps([10,1,2,3,4,5]),import.meta.url)).python(),pyi:async()=>(await lt(async()=>{const{python:n}=await import("./index-BnIobsSF.js");return{python:n}},__vite__mapDeps([10,1,2,3,4,5]),import.meta.url)).python(),yaml:async()=>(await lt(async()=>{const{yaml:n}=await import("./index-BCNV5J5e.js");return{yaml:n}},__vite__mapDeps([11,1,2,3,4]),import.meta.url)).yaml(),yml:async()=>(await lt(async()=>{const{yaml:n}=await import("./index-BCNV5J5e.js");return{yaml:n}},__vite__mapDeps([11,1,2,3,4]),import.meta.url)).yaml(),rs:async()=>(await lt(async()=>{const{rust:n}=await import("./index-DesNy3O4.js");return{rust:n}},__vite__mapDeps([12,1,2,3,4]),import.meta.url)).rust(),c:async()=>(await lt(async()=>{const{cpp:n}=await import("./index-DmPq7iLF.js");return{cpp:n}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),h:async()=>(await lt(async()=>{const{cpp:n}=await import("./index-DmPq7iLF.js");return{cpp:n}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),cc:async()=>(await lt(async()=>{const{cpp:n}=await import("./index-DmPq7iLF.js");return{cpp:n}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),cpp:async()=>(await lt(async()=>{const{cpp:n}=await import("./index-DmPq7iLF.js");return{cpp:n}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),hpp:async()=>(await lt(async()=>{const{cpp:n}=await import("./index-DmPq7iLF.js");return{cpp:n}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),java:async()=>(await lt(async()=>{const{java:n}=await import("./index-BTBYwWBS.js");return{java:n}},__vite__mapDeps([14,1,2,3,4]),import.meta.url)).java(),go:async()=>(await lt(async()=>{const{go:n}=await import("./index-Tib36HVB.js");return{go:n}},__vite__mapDeps([15,1,2,3,4,5]),import.meta.url)).go(),php:async()=>(await lt(async()=>{const{php:n}=await import("./index-EbSAIVkK.js");return{php:n}},__vite__mapDeps([16,1,8,7,2,3,4,0,5]),import.meta.url)).php(),sql:async()=>(await lt(async()=>{const{sql:n}=await import("./index-B6h8VCuY.js");return{sql:n}},__vite__mapDeps([17,2,3,4,1,5]),import.meta.url)).sql(),xml:async()=>(await lt(async()=>{const{xml:n}=await import("./index-C6vpveFy.js");return{xml:n}},__vite__mapDeps([18,1,2,3,4]),import.meta.url)).xml(),svg:async()=>(await lt(async()=>{const{xml:n}=await import("./index-C6vpveFy.js");return{xml:n}},__vite__mapDeps([18,1,2,3,4]),import.meta.url)).xml()},Y1={".mcp.json":"json",dockerfile:"yaml",makefile:"yaml"},X1={javascript:"js",node:"js",typescript:"ts",python:"py",python3:"py",yml:"yaml",rust:"rs",golang:"go","c++":"cpp",cplusplus:"cpp"};async function V1(n){const l=X1[n.toLowerCase()]??n.toLowerCase(),r=xy[l];return r?r().catch(()=>null):null}async function Q1(n){const l=(n.split("/").pop()??"").toLowerCase(),r=Y1[l]??l.split(".").pop()??"",c=xy[r];return c?c().catch(()=>null):null}const K1=gy([{tag:[Oe.keyword,Oe.modifier,Oe.controlKeyword,Oe.moduleKeyword],class:"cmh-key"},{tag:[Oe.propertyName],class:"cmh-prop"},{tag:[Oe.function(Oe.variableName),Oe.labelName],class:"cmh-fn"},{tag:[Oe.color,Oe.constant(Oe.name),Oe.standard(Oe.name),Oe.bool],class:"cmh-const"},{tag:[Oe.typeName,Oe.className,Oe.changed,Oe.annotation,Oe.self,Oe.namespace],class:"cmh-type"},{tag:[Oe.number,Oe.integer,Oe.float],class:"cmh-num"},{tag:[Oe.string,Oe.special(Oe.string),Oe.regexp],class:"cmh-str"},{tag:[Oe.operator,Oe.operatorKeyword,Oe.escape],class:"cmh-op"},{tag:[Oe.meta,Oe.comment],class:"cmh-comment"},{tag:Oe.invalid,class:"cmh-invalid"}]);function Xd(n){return n.replace(/[&<>]/g,l=>l==="&"?"&":l==="<"?"<":">")}async function F1(n,l){const r=l?await V1(l):null;if(!r)return Xd(n);try{const c=r.language.parser.parse(n);let o="";return B1(n,c,K1,(d,h)=>{o+=h?`<span class="${h}">${Xd(d)}</span>`:Xd(d)},()=>{o+=`
|
|
118
|
-
`}),o}catch{return Xd(n)}}Bt.setOptions({gfm:!0,breaks:!1});function by(n){var r;const l=(r=n.split(".").pop())==null?void 0:r.toLowerCase();return l==="md"||l==="markdown"}async function Sf(n){const l=await Bt.parse(n,{async:!0,walkTokens:async r=>{if(r.type!=="code")return;const c=r;c.text=await F1(c.text,c.lang??""),c.escaped=!0}});return b1.sanitize(l)}function Bb(n,l){return{path:n.path,text:n.content,saved:n.content,eol:n.eol,encoding:n.encoding,mtime:n.mtime,size:n.size,binary:n.binary,tooLarge:n.tooLarge,mediaMime:n.mediaMime,mediaTooLarge:n.mediaTooLarge,stale:!1,revision:l,previewMode:by(n.path)}}function oi(n){return!n.binary&&!n.tooLarge&&n.text!==n.saved}function Z1(n){return n.split("/").pop()??n}function Fr(n){const l=n.lastIndexOf("/");return l===-1?"":n.slice(0,l)}function rf(n){return n<1024?`${n} Б`:n<1024*1024?`${(n/1024).toFixed(1)} КБ`:`${(n/1024/1024).toFixed(1)} МБ`}function pi({x:n,y:l,items:r,note:c,onClose:o}){const d=x.useRef(null),[h,m]=x.useState({left:n,top:l}),[g,b]=x.useState(()=>{const S=r.findIndex(k=>!k.disabled);return S===-1?0:S}),y=x.useRef(null);x.useLayoutEffect(()=>{const S=d.current;if(!S)return;y.current=document.elementsFromPoint(n,l).find(Q=>!S.contains(Q))??null;const k=S.getBoundingClientRect(),A=8,C=Math.max(A,Math.min(n,window.innerWidth-k.width-A)),V=Math.max(A,Math.min(l,window.innerHeight-k.height-A));m({left:C,top:V})},[n,l]),x.useLayoutEffect(()=>{var S;(S=d.current)==null||S.focus()},[]),x.useLayoutEffect(()=>{function S(A){var C;(C=d.current)!=null&&C.contains(A.target)||o()}function k(A){var Q;const C=A.target;if(C===document||C===document.documentElement){o();return}if(!(C instanceof Node)||(Q=d.current)!=null&&Q.contains(C))return;const V=y.current;(!V||C.contains(V))&&o()}return document.addEventListener("mousedown",S),document.addEventListener("scroll",k,!0),()=>{document.removeEventListener("mousedown",S),document.removeEventListener("scroll",k,!0)}},[o]);function j(S){S.disabled||(S.onSelect(),o())}function v(S){if(S.key==="Escape"){S.preventDefault(),S.stopPropagation(),o();return}const k=r.map((A,C)=>({item:A,index:C})).filter(A=>!A.item.disabled);if(k.length!==0){if(S.key==="ArrowDown"||S.key==="ArrowUp"){S.preventDefault();const A=S.key==="ArrowDown"?1:-1,C=k.findIndex(Q=>Q.index===g),V=k[(((C===-1?0:C)+A)%k.length+k.length)%k.length];V&&b(V.index);return}if(S.key==="Enter"||S.key===" "){S.preventDefault();const A=r[g];A&&j(A)}}}return a.jsxs("div",{ref:d,className:"ctxmenu",style:{left:h.left,top:h.top},role:"menu",tabIndex:-1,onKeyDown:v,children:[c&&a.jsx("div",{className:"ctxmenu__note",children:c}),r.map((S,k)=>a.jsxs("button",{type:"button",role:"menuitem","aria-disabled":S.disabled,className:"ctxmenu__item"+(k===g?" is-cursor":""),onMouseEnter:()=>b(k),onClick:()=>j(S),children:[a.jsx("span",{className:"ctxmenu__label",children:S.label}),S.hint&&a.jsx("span",{className:"ctxmenu__hint",children:S.hint})]},S.id))]})}const J1=3500,P1=9e3,Hb=220;function Wr({result:n,onDismiss:l}){const[r,c]=x.useState(n),[o,d]=x.useState(!1);if(x.useEffect(()=>{if(!n){c(null),d(!1);return}if(c(n),d(!1),n.url)return;const m=n.ok?J1:P1,g=setTimeout(()=>d(!0),m),b=setTimeout(()=>c(null),m+Hb);return()=>{clearTimeout(g),clearTimeout(b)}},[n]),!r)return null;const h=()=>{d(!0),setTimeout(()=>{c(null),l==null||l()},Hb)};return a.jsxs("div",{className:"oplog "+(r.ok?"oplog--ok":"oplog--bad")+(o?" oplog--leaving":"")+(r.url?" oplog--dismissible":""),role:"status","aria-live":r.ok?"polite":"assertive",children:[r.message,r.url&&a.jsxs("a",{className:"oplog__link",href:r.url,target:"_blank",rel:"noreferrer",onClick:m=>m.stopPropagation(),children:[r.url.replace(/^https?:\/\//,"")," ↗"]}),r.url&&l&&a.jsx("button",{type:"button",className:"oplog__dismiss",title:"Закрыть","aria-label":"Закрыть сообщение",onClick:h,children:"✕"})]})}function Aa({value:n,className:l,placeholder:r="Название сессии",onCommit:c,onCancel:o}){const[d,h]=x.useState(n),m=x.useRef(null);x.useEffect(()=>{var b;(b=m.current)==null||b.select()},[]);function g(){const b=d.trim();if(!b||b===n)return o();c(b)}return a.jsx("input",{ref:m,className:l?`rename ${l}`:"rename",value:d,autoFocus:!0,spellCheck:!1,placeholder:r,onChange:b=>h(b.target.value),onBlur:g,onKeyDown:b=>{b.stopPropagation(),b.key==="Enter"?(b.preventDefault(),g()):b.key==="Escape"&&(b.preventDefault(),o())}})}function _o({active:n}){return n?a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M2 5h3V2"}),a.jsx("path",{d:"M14 5h-3V2"}),a.jsx("path",{d:"M2 11h3v3"}),a.jsx("path",{d:"M14 11h-3v3"})]}):a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M5 2H2v3"}),a.jsx("path",{d:"M11 2h3v3"}),a.jsx("path",{d:"M2 11v3h3"}),a.jsx("path",{d:"M14 11v3h-3"})]})}const W1=500,Ir="application/x-ccv-fs-path",eN=200;function tN({open:n,tree:l,expanded:r,activePath:c,dirty:o,gitChanges:d,result:h,searchResult:m,onSearch:g,onReveal:b,onToggle:y,onOpen:j,onCreate:v,onRename:S,onMove:k,onCopy:A,onDelete:C,onRefresh:V,onClose:Q,zoomed:$,onToggleZoom:I}){const[G,M]=x.useState(""),[z,R]=x.useState(null),[K,ae]=x.useState(null),[Y,H]=x.useState(null),[fe,ue]=x.useState(null),[X,D]=x.useState(null),[U,ce]=x.useState(null),be=Nf("(hover: hover)"),Ne=x.useRef(null),E=x.useMemo(()=>lN(d),[d]);function ee(de){return!(!Y||de===Y.path||Y.kind==="dir"&&de.startsWith(`${Y.path}/`)||de===Fr(Y.path))}function me(de){return!(!X||de===X.path||X.kind==="dir"&&de.startsWith(`${X.path}/`)||X.mode==="cut"&&de===Fr(X.path))}function Se(de){D({path:de.path,kind:de.kind,mode:"copy"})}function q(de){D({path:de.path,kind:de.kind,mode:"cut"})}function we(de){!X||!me(de)||(de&&!r.has(de)&&y(de),X.mode==="cut"?(k(X.path,de),D(null)):A(X.path,de))}function ie(de,ke){const Ke=de.touches[0];if(!Ke)return;const it={timer:0,x:Ke.clientX,y:Ke.clientY,el:de.currentTarget,fired:!1};it.timer=window.setTimeout(()=>{it.fired=!0,ke(it.x,it.y,it.el)},W1),Ne.current=it}function Ie(de){const ke=Ne.current,Ke=de.touches[0];!ke||!Ke||Math.hypot(Ke.clientX-ke.x,Ke.clientY-ke.y)>10&&(window.clearTimeout(ke.timer),Ne.current=null)}function ze(de){const ke=Ne.current;ke&&(window.clearTimeout(ke.timer),ke.fired&&de.preventDefault())}function Zt(){var de;return(de=Ne.current)!=null&&de.fired?(Ne.current=null,!0):!1}function Qe(de,ke,Ke,it){M((it==null?void 0:it.path)??""),ce({x:de,y:ke,opener:Ke,entry:it})}function un(){const de=U==null?void 0:U.opener;ce(null),de!=null&&de.isConnected&&de.focus()}function Ze(de){return{onContextMenu:ke=>{ke.preventDefault(),Qe(ke.clientX,ke.clientY,ke.currentTarget,de)},onTouchStart:ke=>ie(ke,(Ke,it,Be)=>Qe(Ke,it,Be,de)),onTouchMove:Ie,onTouchEnd:ze,onTouchCancel:ze}}function dt(de){de.target===de.currentTarget&&(de.preventDefault(),Qe(de.clientX,de.clientY,de.currentTarget,null))}function tt(de){de.target===de.currentTarget&&ie(de,(ke,Ke,it)=>Qe(ke,Ke,it,null))}function Gt(de){if(!(de.ctrlKey||de.metaKey)||de.target instanceof HTMLInputElement)return;const ke=de.key.toLowerCase();if(ke==="v"){de.preventDefault(),we(ms());return}if(!G)return;const Ke=$b(l,G);Ke&&(ke==="c"?(de.preventDefault(),Se(Ke)):ke==="x"&&(de.preventDefault(),q(Ke)))}function es(de){return ke=>{ke.dataTransfer.effectAllowed="move",ke.dataTransfer.setData(Ir,de.path),H({path:de.path,kind:de.kind})}}function ct(){H(null),ue(null)}function ft(de){return ke=>{ke.dataTransfer.types.includes(Ir)&&(ke.stopPropagation(),!(de.kind!=="dir"||!ee(de.path))&&(ke.preventDefault(),ue(de.path)))}}function Ce(de){return ke=>{if(!ke.dataTransfer.types.includes(Ir)||(ke.stopPropagation(),de.kind!=="dir"||!ee(de.path)))return;ke.preventDefault();const Ke=ke.dataTransfer.getData(Ir);ue(null),Ke&&k(Ke,de.path)}}function Je(de){!de.dataTransfer.types.includes(Ir)||!ee("")||(de.preventDefault(),ue(""))}function St(de){if(!de.dataTransfer.types.includes(Ir)||!ee(""))return;de.preventDefault();const ke=de.dataTransfer.getData(Ir);ue(null),ke&&k(ke,"")}const[pt,Xe]=x.useState(""),vn=pt.trim(),zn=vn.length>0,Tt=x.useRef(null),tn=x.useRef(g);tn.current=g;function is(de){Xe(de),Tt.current&&clearTimeout(Tt.current);const ke=de.trim();if(!ke){tn.current("");return}Tt.current=setTimeout(()=>tn.current(ke),eN)}function gn(de){Tt.current&&clearTimeout(Tt.current),Xe(""),tn.current(""),M(de.path),b(de)}const Sn=zn&&(m==null?void 0:m.query)===vn?m:null;function ms(){if(G==="")return"";const de=$b(l,G);if((de==null?void 0:de.kind)==="dir")return G;const ke=G.lastIndexOf("/");return ke===-1?"":G.slice(0,ke)}function Et(de,ke){const Ke=ke??ms();Ke&&!r.has(Ke)&&y(Ke),ae({parent:Ke,kind:de})}function Pt(){if(!U)return[];const de=it=>be?it:void 0;if(!U.entry)return[{id:"paste",label:"Вставить в корень проекта",hint:de("Ctrl+V"),disabled:!me(""),onSelect:()=>we("")},{id:"new-file",label:"Создать файл",onSelect:()=>Et("file","")},{id:"new-dir",label:"Создать каталог",onSelect:()=>Et("dir","")}];const ke=U.entry,Ke=[ke.kind==="file"?{id:"open",label:"Открыть",onSelect:()=>j(ke.path)}:{id:"toggle",label:r.has(ke.path)?"Свернуть":"Развернуть",onSelect:()=>y(ke.path)},{id:"copy",label:"Копировать",hint:de("Ctrl+C"),onSelect:()=>Se(ke)},{id:"cut",label:"Вырезать",hint:de("Ctrl+X"),onSelect:()=>q(ke)}];return ke.kind==="dir"&&(Ke.push({id:"paste",label:"Вставить",hint:de("Ctrl+V"),disabled:!me(ke.path),onSelect:()=>we(ke.path)}),Ke.push({id:"new-file",label:"Создать файл",onSelect:()=>Et("file",ke.path)}),Ke.push({id:"new-dir",label:"Создать каталог",onSelect:()=>Et("dir",ke.path)})),Ke.push({id:"rename",label:"Переименовать",onSelect:()=>R(ke.path)}),Ke.push({id:"delete",label:"Удалить",onSelect:()=>C(ke)}),Ke}const En=zn?[]:Wt("",0);function Wt(de,ke){const Ke=l[de],it=[];if(K&&K.parent===de&&it.push(a.jsxs("div",{className:"fsrow fsrow--draft",style:ui(ke),children:[a.jsx("span",{className:"fsrow__icon",children:K.kind==="dir"?a.jsx(bf,{}):a.jsx(_f,{})}),a.jsx(Aa,{className:"rename--file",value:"",placeholder:K.kind==="dir"?"имя каталога":"имя файла",onCommit:Be=>{ae(null),v(de,K.kind,Be)},onCancel:()=>ae(null)})]},`draft:${de}`)),!Ke)return it.push(a.jsx("p",{className:"fsrow__pending",style:ui(ke),children:"читаем…"},`wait:${de}`)),it;Ke.length===0&&!K&&it.push(a.jsx("p",{className:"fsrow__pending",style:ui(ke),children:"пусто"},`empty:${de}`));for(const Be of Ke){const nt=Be.kind==="dir"&&r.has(Be.path);it.push(z===Be.path?a.jsxs("div",{className:"fsrow fsrow--draft",style:ui(ke),children:[a.jsx("span",{className:"fsrow__icon",children:Be.kind==="dir"?a.jsx(bf,{open:nt}):a.jsx(_f,{})}),a.jsx(Aa,{className:"rename--file",value:Be.name,placeholder:"новое имя",onCommit:J=>{R(null),S(Be.path,J)},onCancel:()=>R(null)})]},Be.path):a.jsx(nN,{entry:Be,depth:ke,open:nt,active:Be.path===c,selected:Be.path===G,dirty:o.has(Be.path),gitStatus:E.get(Be.path),dragging:(Y==null?void 0:Y.path)===Be.path,dropTarget:fe===Be.path,cut:(X==null?void 0:X.mode)==="cut"&&X.path===Be.path,onClick:()=>{Zt()||(M(Be.path),Be.kind==="dir"?y(Be.path):j(Be.path))},onRename:()=>R(Be.path),onDelete:()=>C(Be),onDragStart:es(Be),onDragEnd:ct,onDragOver:ft(Be),onDrop:Ce(Be),...Ze(Be)},Be.path)),nt&&it.push(...Wt(Be.path,ke+1))}return it}function ts(){if(!Sn)return[a.jsx("p",{className:"fsrow__pending",style:ui(0),children:"ищем…"},"search:wait")];if(Sn.entries.length===0)return[a.jsx("p",{className:"fsrow__pending",style:ui(0),children:"ничего не найдено"},"search:empty")];const de=Sn.entries.map(ke=>a.jsx(sN,{entry:ke,gitStatus:E.get(ke.path),onClick:()=>gn(ke)},ke.path));return Sn.truncated&&de.push(a.jsxs("p",{className:"fsrow__pending",style:ui(0),children:["показаны первые ",Sn.entries.length," — уточните запрос"]},"search:truncated")),de}return a.jsxs("aside",{className:(n?"sidepane sidepane--files sidepane--open":"sidepane sidepane--files")+($?" sidepane--zoomed":""),"aria-label":"Файлы проекта",onKeyDown:Gt,children:[a.jsxs("div",{className:"sidepane__head",onDoubleClick:de=>{I&&(de.target.closest("button")||I())},children:[a.jsx(cN,{}),a.jsx("span",{className:"sidepane__title",children:"Файлы"}),a.jsx("button",{className:"sidepane__btn",title:"Новый файл","aria-label":"Новый файл",onClick:()=>Et("file"),children:a.jsx(iN,{})}),a.jsx("button",{className:"sidepane__btn",title:"Новый каталог","aria-label":"Новый каталог",onClick:()=>Et("dir"),children:a.jsx(rN,{})}),a.jsx("button",{className:"sidepane__btn",title:"Перечитать дерево","aria-label":"Перечитать дерево",onClick:V,children:"↻"}),I&&a.jsx("button",{className:"sidepane__btn",title:$?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":$?"Свернуть панель файлов":"Развернуть панель файлов на весь экран","aria-pressed":$,onClick:I,children:a.jsx(_o,{active:$})}),a.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель файлов",onClick:Q,children:"✕"})]}),a.jsxs("div",{className:"fssearch",children:[a.jsx(oN,{}),a.jsx("input",{className:"fssearch__input",type:"text",value:pt,spellCheck:!1,placeholder:"Поиск файлов и папок…","aria-label":"Поиск файлов и папок",onChange:de=>is(de.target.value),onKeyDown:de=>{de.stopPropagation(),de.key==="Escape"&&(de.preventDefault(),pt?is(""):de.currentTarget.blur())}}),pt&&a.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>is(""),children:"✕"})]}),a.jsx("div",{className:"sidepane__scroll fstree"+(fe===""?" fstree--drop-target":""),tabIndex:-1,onDragOver:Je,onDrop:St,onContextMenu:dt,onTouchStart:tt,onTouchMove:Ie,onTouchEnd:ze,onTouchCancel:ze,children:zn?ts():En}),a.jsx(Wr,{result:h}),U&&a.jsx(pi,{x:U.x,y:U.y,items:Pt(),onClose:un})]})}function nN({entry:n,depth:l,open:r,active:c,selected:o,dirty:d,gitStatus:h,dragging:m,dropTarget:g,cut:b,onClick:y,onRename:j,onDelete:v,onDragStart:S,onDragEnd:k,onDragOver:A,onDrop:C,onContextMenu:V,onTouchStart:Q,onTouchMove:$,onTouchEnd:I,onTouchCancel:G}){const M="fsrow"+(c?" is-open":"")+(o&&!c?" is-selected":"")+(n.ignored?" fsrow--ignored":"")+(m?" fsrow--dragging":"")+(g?" fsrow--drop-target":"")+(b?" fsrow--cut":"");return a.jsxs("div",{className:M,style:ui(l),draggable:!0,onDragStart:S,onDragEnd:k,onDragOver:A,onDrop:C,onContextMenu:V,onTouchStart:Q,onTouchMove:$,onTouchEnd:I,onTouchCancel:G,children:[a.jsxs("button",{className:"fsrow__main",onClick:y,title:_y(n),children:[a.jsx("span",{className:"fsrow__icon"+xf("fsrow__icon",h),children:n.kind==="dir"?a.jsx(bf,{open:r}):a.jsx(_f,{})}),a.jsx("span",{className:"fsrow__name"+xf("fsrow__name",h),children:n.name}),n.ignored&&a.jsx("span",{className:"fsrow__tag",title:"Игнорируется git (.gitignore)",children:"git-ignore"}),d&&a.jsx("span",{className:"fsrow__dot",title:"Есть несохранённые правки"})]}),a.jsx("button",{className:"fsrow__act",title:"Переименовать","aria-label":`Переименовать ${n.name}`,onClick:j,children:"✎"}),a.jsx("button",{className:"fsrow__act",title:"Удалить","aria-label":`Удалить ${n.name}`,onClick:v,children:"✕"})]})}function sN({entry:n,gitStatus:l,onClick:r}){const c=n.path.slice(0,n.path.length-n.name.length-1);return a.jsxs("button",{className:"fsrow fsrow--search"+(n.ignored?" fsrow--ignored":""),style:ui(0),onClick:r,title:_y(n),children:[a.jsx("span",{className:"fsrow__icon"+xf("fsrow__icon",l),children:n.kind==="dir"?a.jsx(bf,{}):a.jsx(_f,{})}),a.jsx("span",{className:"fsrow__name"+xf("fsrow__name",l),children:n.name}),n.ignored&&a.jsx("span",{className:"fsrow__tag",children:"git-ignore"}),c&&a.jsx("span",{className:"fsrow__path",children:c})]})}function _y(n){return n.ignored?`${n.path} — игнорируется git (.gitignore)`:n.path}function ui(n){return{"--depth":n}}function $b(n,l){var o;const r=l.lastIndexOf("/"),c=r===-1?"":l.slice(0,r);return((o=n[c])==null?void 0:o.find(d=>d.path===l))??null}function lN(n){const l=new Map,r={added:1,modified:2},c=(o,d)=>{const h=l.get(o);(!h||r[d]>r[h])&&l.set(o,d)};for(const o of n){const d=aN(o.status);if(!d)continue;c(o.path,d);let h=Fr(o.path);for(;c(h,d),!!h;)h=Fr(h)}return l}function aN(n){if(n==="??")return"added";const[l="",r=""]=n;return l==="A"||l==="R"||l==="C"?"added":l==="M"||r==="M"?"modified":null}function xf(n,l){return l?` ${n}--git-${l}`:""}function bf({open:n=!1}){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,"aria-hidden":"true",children:n?a.jsx("path",{d:"M2 12.5V4.2a.7.7 0 0 1 .7-.7h3.1l1.5 1.6h4.4a.7.7 0 0 1 .7.7v1.2M2 12.5l1.7-4.6a.7.7 0 0 1 .66-.46h9.2a.5.5 0 0 1 .47.66L12.4 12.5Z"}):a.jsx("path",{d:"M2 12.4V4.2a.7.7 0 0 1 .7-.7h3.1l1.5 1.6h5.9a.7.7 0 0 1 .7.7v6.6a.7.7 0 0 1-.7.7H2.7a.7.7 0 0 1-.7-.7Z"})})}function _f(){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 iN(){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 rN(){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 cN(){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 oN(){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 uN=200;function dN({open:n,result:l,onSearch:r,onOpenMatch:c,onClose:o,zoomed:d,onToggleZoom:h}){const[m,g]=x.useState(""),b=m.trim(),y=b.length>0,j=x.useRef(null),v=x.useRef(r);v.current=r;function S(C){g(C),j.current&&clearTimeout(j.current);const V=C.trim();if(!V){v.current("");return}j.current=setTimeout(()=>v.current(V),uN)}const k=y&&(l==null?void 0:l.query)===b?l:null;function A(){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 C=[];let V="";for(const Q of k.matches)Q.path!==V&&(V=Q.path,C.push(a.jsx("p",{className:"searchgroup__path",title:Q.path,children:Q.path},`path:${Q.path}`))),C.push(a.jsx(fN,{match:Q,onClick:()=>c(Q)},`${Q.path}:${Q.line}:${Q.column}`));return k.truncated&&C.push(a.jsxs("p",{className:"fsrow__pending",children:["показаны первые ",k.matches.length," — уточните запрос"]},"grep:truncated")),C}return a.jsxs("aside",{className:(n?"sidepane sidepane--search sidepane--open":"sidepane sidepane--search")+(d?" sidepane--zoomed":""),"aria-label":"Поиск по тексту в проекте",children:[a.jsxs("div",{className:"sidepane__head",onDoubleClick:C=>{h&&(C.target.closest("button")||h())},children:[a.jsx(hN,{}),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(_o,{active:d})}),a.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель поиска",onClick:o,children:"✕"})]}),a.jsxs("div",{className:"fssearch",children:[a.jsx(pN,{}),a.jsx("input",{className:"fssearch__input",type:"text",value:m,spellCheck:!1,placeholder:"Поиск по тексту во всех файлах…","aria-label":"Поиск по тексту во всех файлах",onChange:C=>S(C.target.value),onKeyDown:C=>{C.stopPropagation(),C.key==="Escape"&&(C.preventDefault(),m?S(""):C.currentTarget.blur())}}),m&&a.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>S(""),children:"✕"})]}),a.jsx("div",{className:"sidepane__scroll fstree",children:y?A():a.jsx("p",{className:"sidepane__empty",children:"Введите текст, чтобы найти его во всех файлах проекта."})})]})}function fN({match:n,onClick:l}){const r=n.lineText.slice(0,n.column-1),c=n.lineText.slice(n.column-1,n.column-1+n.matchLength),o=n.lineText.slice(n.column-1+n.matchLength);return a.jsxs("button",{className:"searchmatch",onClick:l,title:`${n.path}:${n.line}`,children:[a.jsx("span",{className:"searchmatch__line",children:n.line}),a.jsxs("span",{className:"searchmatch__text",children:[r,a.jsx("mark",{children:c}),o]})]})}function hN(){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 pN(){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 Vd=null;function mN(){return Vd||(Vd=Promise.all([lt(()=>import("./index-DOU-NfbM.js"),__vite__mapDeps([19,4,3,2,20,5]),import.meta.url),lt(()=>import("./index-891wE-Rj.js").then(n=>n.v),__vite__mapDeps([4,3]),import.meta.url),lt(()=>import("./index-BHot-lnj.js"),[],import.meta.url),lt(()=>import("./index-CWyId3-O.js"),__vite__mapDeps([20,3,4,2]),import.meta.url),lt(()=>import("./codemirror-CpnHxn-s.js"),__vite__mapDeps([21,2,3,4]),import.meta.url)]).then(([n,l,r,c,o])=>({EditorView:l.EditorView,EditorState:r.EditorState,Compartment:r.Compartment,EditorSelection:r.EditorSelection,Prec:r.Prec,keymap:l.keymap,indentWithTab:c.indentWithTab,basicSetup:n.basicSetup,editorTheme:o.editorTheme,editorHighlight:o.editorHighlight})).catch(n=>{throw Vd=null,n})),Vd}function gN({path:n,doc:l,revision:r,goto:c,onChange:o,onSave:d}){const h=x.useRef(null),m=x.useRef(null),g=x.useRef(null),b=x.useRef(new Map),y=x.useRef(new Map),j=x.useRef(new Set),v=x.useRef(null),S=x.useRef(o),k=x.useRef(d),A=x.useRef(n),C=x.useRef(r),V=x.useRef(l);S.current=o,k.current=d,A.current=n,C.current=r,V.current=l;const[Q,$]=x.useState("loading"),[I,G]=x.useState(!1);function M(R,K,ae,Y,H){const fe=b.current.get(Y),ue=y.current.get(Y)===H;if(fe&&ue)ae.setState(fe);else{const D=R.EditorState.create({doc:V.current,extensions:[R.basicSetup,R.Prec.highest(R.keymap.of([{key:"Mod-s",preventDefault:!0,run:()=>(k.current(A.current),!0)}])),R.keymap.of([R.indentWithTab]),K.of([]),R.editorTheme,R.editorHighlight,R.EditorView.updateListener.of(U=>{U.docChanged&&S.current(A.current,U.state.doc.toString())})]});b.current.set(Y,D),y.current.set(Y,H),ae.setState(D),j.current.delete(Y)}if(j.current.has(Y))return()=>{};let X=!1;return Q1(Y).then(D=>{X||!D||A.current!==Y||(ae.dispatch({effects:K.reconfigure(D)}),b.current.set(Y,ae.state),j.current.add(Y))}),()=>{X=!0}}x.useEffect(()=>{if(!h.current)return;let K=!1,ae=null,Y=null;$("loading"),G(!1);const H=window.setTimeout(()=>{K||G(!0)},200);return(async()=>{let fe;try{fe=await mN()}catch{window.clearTimeout(H),K||$("error");return}if(K||!h.current)return;window.clearTimeout(H);const ue=new fe.Compartment;v.current=ue,g.current=fe,Y=new fe.EditorView({parent:h.current}),m.current=Y,ae=M(fe,ue,Y,A.current,C.current),$("ready")})(),()=>{K=!0,window.clearTimeout(H),ae==null||ae(),Y==null||Y.destroy(),m.current===Y&&(m.current=null),g.current=null,v.current=null}},[]),x.useEffect(()=>{const R=g.current,K=m.current,ae=v.current;if(!(!R||!K||!ae))return M(R,ae,K,n,r)},[n,r]);const z=x.useRef(0);return x.useEffect(()=>{const R=m.current,K=g.current;if(!R||!K||!c||c.token===z.current)return;z.current=c.token;const ae=R.state.doc.lines,Y=Math.min(Math.max(c.line,1),ae),H=R.state.doc.line(Y),fe=Math.min(H.from+Math.max(c.column-1,0),H.to);R.dispatch({selection:K.EditorSelection.cursor(fe),effects:K.EditorView.scrollIntoView(fe,{y:"center"})}),R.focus()},[c]),x.useEffect(()=>()=>{const R=m.current;R&&b.current.set(n,R.state)},[n]),a.jsxs("div",{className:"editor__code",children:[a.jsx("div",{ref:h,className:"editor__code-surface"+(Q==="ready"?"":" is-hidden")}),Q==="loading"&&I&&a.jsxs("div",{className:"editor__state work",role:"status",children:[a.jsxs("div",{className:"work__dots",children:[a.jsx("span",{className:"work__dot"}),a.jsx("span",{className:"work__dot"}),a.jsx("span",{className:"work__dot"})]}),a.jsx("span",{className:"work__label",children:"Загружается редактор…"})]}),Q==="error"&&a.jsxs("div",{className:"editor__fallback",children:[a.jsxs("div",{className:"editor__fallback-banner",role:"alert",children:[a.jsx("span",{children:"Редактор не загрузился — ниже только просмотр, без сохранения правок."}),a.jsx("button",{className:"btn btn--sm btn--primary",onClick:()=>window.location.reload(),children:"Перезагрузить страницу"})]}),a.jsx("pre",{className:"editor__fallback-text",children:l})]})]})}function Ml({value:n,options:l,onChange:r,className:c,title:o,ariaLabel:d,placeholder:h="—"}){const[m,g]=x.useState(!1),[b,y]=x.useState(0),j=x.useRef(null),v=x.useRef(null),S=l.find(C=>C.value===n)??null;x.useEffect(()=>{if(!m)return;const C=l.findIndex(V=>V.value===n);y(C===-1?0:C)},[m]),x.useEffect(()=>{if(!m)return;function C(V){var Q;(Q=j.current)!=null&&Q.contains(V.target)||g(!1)}return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[m]),x.useEffect(()=>{var C,V;m&&((V=(C=v.current)==null?void 0:C.querySelector(".is-cursor"))==null||V.scrollIntoView({block:"nearest"}))},[m,b]),x.useEffect(()=>{if(!m)return;const C=v.current,V=xN(j.current);if(!C||!V)return;const Q=C.getBoundingClientRect().bottom-V.getBoundingClientRect().bottom;Q>0&&(V.scrollTop+=Math.min(Q+8,C.offsetHeight))},[m]);function k(C){g(!1),C.value!==n&&r(C.value)}function A(C){if(C.key==="Escape"){if(!m)return;C.preventDefault(),C.stopPropagation(),g(!1);return}if(C.key==="ArrowDown"||C.key==="ArrowUp"){if(C.preventDefault(),!m)return g(!0);const V=C.key==="ArrowDown"?1:l.length-1;return y(Q=>(Q+V)%l.length)}if(C.key==="Enter"||C.key===" "){if(C.preventDefault(),!m)return g(!0);const V=l[b];V&&k(V)}}return a.jsxs("div",{ref:j,className:"select"+(m?" select--open":"")+(c?` ${c}`:""),children:[a.jsxs("button",{type:"button",className:"select__trigger",title:o,"aria-label":d??o,"aria-haspopup":"listbox","aria-expanded":m,onClick:()=>g(C=>!C),onKeyDown:A,children:[a.jsx("span",{className:"select__value",children:(S==null?void 0:S.label)??h}),a.jsx(bN,{})]}),m&&a.jsx("div",{ref:v,className:"select__menu",role:"listbox","aria-label":d??o,children:l.map((C,V)=>a.jsxs("button",{type:"button",role:"option","aria-selected":C.value===n,className:"select__option"+(V===b?" is-cursor":"")+(C.value===n?" is-on":""),onMouseEnter:()=>y(V),onClick:()=>k(C),children:[a.jsx("span",{className:"select__check","aria-hidden":"true",children:C.value===n?"✓":""}),a.jsx("span",{className:"select__label",children:C.label}),C.hint&&a.jsx("span",{className:"select__hint",children:C.hint})]},C.value))})]})}function xN(n){let l=(n==null?void 0:n.parentElement)??null;for(;l;){if(l.scrollHeight>l.clientHeight&&getComputedStyle(l).overflowY!=="visible")return l;l=l.parentElement}return null}function bN(){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 _N(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("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 yN(){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 vN(){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 jN({path:n,mime:l,base64:r,error:c,tooLarge:o,size:d,onRequestMedia:h}){x.useEffect(()=>{!o&&r===void 0&&c===void 0&&h(n)},[]);const m=NN(r,l);return o?a.jsx("div",{className:"mediaview mediaview--message",children:a.jsxs("p",{className:"mediaview__error",children:["Файл слишком велик для просмотра (",rf(d),"). Лимит — 64 МБ."]})}):c?a.jsxs("div",{className:"mediaview mediaview--message",role:"alert",children:[a.jsx("p",{className:"mediaview__error",children:c}),a.jsx("button",{className:"btn btn--sm btn--primary",onClick:()=>h(n),children:"Повторить"})]}):m?l.startsWith("image/")?a.jsx(kN,{url:m}):l.startsWith("video/")?a.jsx(EN,{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 NN(n,l){const[r,c]=x.useState(null);return x.useEffect(()=>{if(n===void 0){c(null);return}const o=atob(n),d=new Uint8Array(o.length);for(let m=0;m<o.length;m++)d[m]=o.charCodeAt(m);const h=URL.createObjectURL(new Blob([d],{type:l}));return c(h),()=>URL.revokeObjectURL(h)},[n,l]),r}const nr=1,yy=8,Qd=1.25;function wN(n){return Math.min(yy,Math.max(nr,n))}function kN({url:n}){const[l,r]=x.useState({scale:nr,x:0,y:0}),[c,o]=x.useState(!1),d=x.useRef(null),h=x.useRef(null);function m(S,k,A){r(C=>{const V=wN(C.scale*S);if(V===C.scale)return C;if(V<=nr)return{scale:nr,x:0,y:0};const Q=(k-C.x)/C.scale,$=(A-C.y)/C.scale;return{scale:V,x:k-V*Q,y:A-V*$}})}x.useEffect(()=>{const S=d.current;if(!S)return;function k(A){A.preventDefault();const C=S.getBoundingClientRect(),V=A.clientX-C.left-C.width/2,Q=A.clientY-C.top-C.height/2;m(A.deltaY<0?Qd:1/Qd,V,Q)}return S.addEventListener("wheel",k,{passive:!1}),()=>S.removeEventListener("wheel",k)},[]);function g(S){l.scale<=nr||(S.currentTarget.setPointerCapture(S.pointerId),h.current={pointerId:S.pointerId,startX:S.clientX,startY:S.clientY,origX:l.x,origY:l.y},o(!0))}function b(S){const k=h.current;!k||k.pointerId!==S.pointerId||r(A=>({...A,x:k.origX+(S.clientX-k.startX),y:k.origY+(S.clientY-k.startY)}))}function y(){h.current=null,o(!1)}const j=l.scale>nr,v=!j&&l.x===0&&l.y===0;return a.jsxs("div",{className:"mediaview mediaview--image",children:[a.jsx("div",{ref:d,className:"mediaview__stage"+(j?c?" is-dragging":" is-zoomed":""),onPointerDown:g,onPointerMove:b,onPointerUp:y,onPointerCancel:y,children:a.jsx("img",{src:n,alt:"",className:"mediaview__image",draggable:!1,style:{transform:`translate(${l.x}px, ${l.y}px) scale(${l.scale})`}})}),a.jsxs("div",{className:"mediaview__toolbar",children:[a.jsx("button",{className:"btn btn--sm",disabled:l.scale<=nr,title:"Уменьшить","aria-label":"Уменьшить",onClick:()=>m(1/Qd,0,0),children:a.jsx(yN,{})}),a.jsxs("span",{className:"mediaview__zoomlabel",children:[Math.round(l.scale*100),"%"]}),a.jsx("button",{className:"btn btn--sm",disabled:l.scale>=yy,title:"Увеличить","aria-label":"Увеличить",onClick:()=>m(Qd,0,0),children:a.jsx(_N,{})}),a.jsx("button",{className:"btn btn--sm",disabled:v,title:"Вписать в окно","aria-label":"Сбросить масштаб — вписать в окно",onClick:()=>r({scale:nr,x:0,y:0}),children:a.jsx(vN,{})})]})]})}const SN=[{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 EN({url:n}){const l=x.useRef(null),[r,c]=x.useState("1");return x.useEffect(()=>{l.current&&(l.current.playbackRate=Number(r))},[r]),a.jsxs("div",{className:"mediaview mediaview--video",children:[a.jsx("video",{ref:l,className:"mediaview__video",src:n,controls:!0}),a.jsxs("div",{className:"mediaview__speedbar",children:[a.jsx("span",{className:"mediaview__speedlabel",children:"Скорость"}),a.jsx(Ml,{className:"mediaview__speedselect",value:r,onChange:c,ariaLabel:"Скорость воспроизведения",options:SN})]})]})}function TN({file:n,goto:l,onChange:r,onSave:c,onReload:o,onOverwrite:d,onRequestMedia:h,onTogglePreview:m}){const g=oi(n),b=by(n.path)&&!n.binary&&!n.tooLarge;return a.jsxs("div",{className:"editor",children:[a.jsxs("div",{className:"editor__bar",children:[a.jsx("span",{className:"editor__path",title:n.path,children:n.path}),a.jsxs("span",{className:"editor__meta",children:[rf(n.size),n.eol==="crlf"&&" · CRLF"]}),b&&a.jsxs("div",{className:"editor__viewtoggle",role:"tablist","aria-label":"Режим просмотра",children:[a.jsx("button",{className:"btn btn--sm"+(n.previewMode?" is-on":""),role:"tab","aria-selected":n.previewMode,onClick:()=>!n.previewMode&&m(n.path),children:"Просмотр"}),a.jsx("button",{className:"btn btn--sm"+(n.previewMode?"":" is-on"),role:"tab","aria-selected":!n.previewMode,onClick:()=>n.previewMode&&m(n.path),children:"Код"})]}),a.jsx("button",{className:"btn btn--sm",disabled:!g,title:"Сохранить (Ctrl+S)",onClick:()=>c(n.path),children:g?"Сохранить":"Сохранено"})]}),n.stale&&a.jsxs("div",{className:"editor__warn",children:[a.jsxs("span",{children:["Файл изменился на диске",g?" — а здесь есть несохранённые правки.":"."]}),a.jsx("button",{className:"btn btn--sm",onClick:()=>o(n.path),children:"Взять с диска"}),g&&a.jsx("button",{className:"btn btn--sm btn--danger",onClick:()=>d(n.path),children:"Сохранить поверх"})]}),n.binary&&n.mediaMime?a.jsx(jN,{path:n.path,mime:n.mediaMime,base64:n.mediaBase64,error:n.mediaError,tooLarge:n.mediaTooLarge,size:n.size,onRequestMedia:h},n.path):n.binary?a.jsxs("p",{className:"editor__empty",children:["Это не текстовый файл — редактировать его здесь нечем. ",rf(n.size)," на диске."]}):n.tooLarge?a.jsxs("p",{className:"editor__empty",children:["Файл слишком велик для редактора (",rf(n.size),"). Такие правит агент, а не браузер."]}):b&&n.previewMode?a.jsx(CN,{text:n.text}):a.jsx(gN,{path:n.path,doc:n.text,revision:n.revision,goto:l,onChange:r,onSave:c})]})}function CN({text:n}){const[l,r]=x.useState("");return x.useEffect(()=>{let c=!1;return Sf(n).then(o=>{c||r(o)}),()=>{c=!0}},[n]),a.jsx("div",{className:"markdown-preview",dangerouslySetInnerHTML:{__html:l}})}function AN({files:n,activePath:l,busy:r,onSelect:c,onClose:o,zoomed:d,onToggleZoom:h}){return a.jsxs("div",{className:"worktabs",role:"tablist",onDoubleClick:m=>{h&&(m.target.closest("button")||h())},children:[a.jsxs("button",{className:"worktab"+(l===null?" is-on":""),role:"tab","aria-selected":l===null,onClick:()=>c(null),onDoubleClick:()=>h==null?void 0:h(),children:[a.jsx("span",{className:"worktab__name",children:"Разговор"}),r&&a.jsx("span",{className:"worktab__dot worktab__dot--busy",title:"Агент работает"})]}),n.map(m=>a.jsxs("div",{className:"worktab"+(m.path===l?" is-on":""),role:"tab","aria-selected":m.path===l,onDoubleClick:g=>{h&&(g.target.closest(".worktab__close, .worktab__dot")||h())},children:[a.jsx("button",{className:"worktab__name",title:m.path,onClick:()=>c(m.path),children:Z1(m.path)}),oi(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(_o,{active:d})})]})}function Cl(n){return n.claudeSessionId??n.id}function cf(n,l,r,c){if(!l||l.length===0)return n;const o=new Map(l.map((m,g)=>[m,g])),d=[],h=[];for(const m of n)(o.has(r(m))?d:h).push(m);return d.sort((m,g)=>o.get(r(m))-o.get(r(g))),c==="top"?[...h,...d]:[...d,...h]}function qb(n){return n.state!=="closed"}function vy(n){return[...n.filter(qb),...n.filter(l=>!qb(l))]}function Kd(n,l,r,c){if(l===r||!n.includes(l)||!n.includes(r))return null;const o=n.filter(m=>m!==l),d=o.indexOf(r)+(c==="after"?1:0),h=[...o.slice(0,d),l,...o.slice(d)];return h.every((m,g)=>m===n[g])?null:h}function em(n,l,r,c){const o=n%10,d=n%100;return o===1&&d!==11?l:o>=2&&o<=4&&(d<12||d>14)?r:c}function jy(n){return`${n} ${em(n,"агент","агента","агентов")}`}function MN(n){const l=n.filter(o=>o.kind==="agent").length,r=n.length-l,c=[];return l>0&&c.push(jy(l)),r>0&&c.push(`${r} ${em(r,"задача","задачи","задач")} в фоне`),c.join(" · ")}function RN(n){switch(n.kind){case"agent":return n.agentType??"агент";case"shell":return"команда";case"workflow":return"сценарий";default:return"задача"}}function DN(n){const l=Math.max(0,Math.floor(n/1e3)),r=Math.floor(l/3600),c=Math.floor(l%3600/60),o=l%60,d=String(o).padStart(2,"0");return r>0?`${r}:${String(c).padStart(2,"0")}:${d}`:`${c}:${d}`}function ON(n){return n<1e3?`${n} ток.`:`${(n/1e3).toFixed(1).replace(".",",")} k ток.`}function LN({tasks:n,onStop:l}){const[r,c]=x.useState(!1),[o,d]=x.useState(()=>Date.now()),[h,m]=x.useState(()=>new Set);x.useEffect(()=>{const b=window.setInterval(()=>d(Date.now()),1e3);return()=>window.clearInterval(b)},[]),x.useEffect(()=>{m(b=>{const y=new Set(n.map(v=>v.id)),j=new Set([...b].filter(v=>y.has(v)));return j.size===b.size?b:j})},[n]);const g=b=>{m(y=>new Set(y).add(b)),l(b),window.setTimeout(()=>{m(y=>{if(!y.has(b))return y;const j=new Set(y);return j.delete(b),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(b=>!b),children:[a.jsx("span",{className:"tasks__dot","aria-hidden":"true"}),a.jsx("span",{className:"tasks__summary",children:MN(n)}),a.jsx("svg",{className:"tasks__chev",viewBox:"0 0 16 16","aria-hidden":"true",children:a.jsx("path",{d:"M4 6.5l4 4 4-4",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})]}),r&&a.jsx("ul",{className:"tasks__list",id:"tasks-list",children:n.map(b=>{const y=h.has(b.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:RN(b)}),b.background&&a.jsx("span",{className:"task__bg",children:"фон"}),a.jsx("span",{className:"task__time",children:DN(o-b.startedAt)})]}),a.jsx("div",{className:"task__desc",title:b.description,children:b.description}),(b.activity||b.lastTool)&&a.jsx("div",{className:"task__activity",title:b.activity??b.lastTool??void 0,children:b.activity??b.lastTool}),a.jsxs("div",{className:"task__stats",children:[ON(b.tokens)," · ",b.toolUses," ",em(b.toolUses,"вызов","вызова","вызовов")]})]}),a.jsx("button",{type:"button",className:"btn btn--sm btn--danger task__stop",disabled:y,"aria-label":`Остановить: ${b.description}`,onClick:()=>g(b.id),children:y?"Останавливается":"Стоп"})]},b.id)})})]})}const zN=""+new URL("antigravity-logo-DRKQga2U.png",import.meta.url).href;function tm({className:n}){return a.jsx("img",{src:zN,alt:"","aria-hidden":"true",className:n,style:{aspectRatio:"200 / 184"}})}const UN=450,IN=6,BN={claude:{label:"Claude",hint:"Claude Code — как обычно"},antigravity:{label:"Antigravity",hint:"Google agy, отдельная палитра и права"}};function HN({disabled:n,providers:l,lastAccountId:r,onStart:c,onSignIn:o}){var D;const{accounts:d,auth:h,multi:m}=Hp(),g=["claude","antigravity"].filter(U=>l.includes(U)).flatMap(U=>U==="claude"&&m?d.map(ce=>{const be=h[ce.id],Ne=z_(be);return{key:`claude:${ce.id}`,id:"claude",label:ce.name,hint:Ne?`Claude Code, ${Ne}`:"Claude Code",account:ce,isDefault:ce.id===r,needsLogin:ce.id!==sr&&be!=null&&!be.loggedIn}}):[{key:U,id:U,...BN[U]}]),b=g.length>1,y=g.find(U=>U.isDefault)??g[0],j=Math.max(0,g.indexOf(y)),[v,S]=x.useState(!1),[k,A]=x.useState(0),[C,V]=x.useState({left:0,top:0}),Q=x.useRef(null),$=x.useRef(null),I=x.useRef(null);function G(){I.current&&window.clearTimeout(I.current.timer),I.current=null}function M(){G(),A(j),S(!0)}function z(U){var ce;S(!1),U&&((ce=Q.current)==null||ce.focus())}function R(U){if(n||!b||U.button!==0)return;const ce={timer:0,x:U.clientX,y:U.clientY,fired:!1};ce.timer=window.setTimeout(()=>{ce.fired=!0,M()},UN),I.current=ce}function K(U){const ce=I.current;!ce||ce.fired||Math.hypot(U.clientX-ce.x,U.clientY-ce.y)>IN&&G()}function ae(){I.current&&!I.current.fired&&G()}function Y(U){var ce;if((ce=I.current)!=null&&ce.fired){I.current=null,U.preventDefault();return}n||y&&ue(y)}function H(U){b&&(U.preventDefault(),!n&&M())}function fe(U){if(n||!b)return;(U.key==="ArrowDown"||U.key==="ArrowUp"||U.key==="Enter"&&U.shiftKey)&&(U.preventDefault(),M())}x.useLayoutEffect(()=>{if(!v)return;const U=Q.current,ce=$.current;if(!U||!ce)return;const be=U.getBoundingClientRect(),Ne=ce.getBoundingClientRect(),E=8,ee=Math.max(E,Math.min(be.right-Ne.width,window.innerWidth-Ne.width-E));let me=be.top-Ne.height-8;me<E&&(me=Math.min(be.bottom+8,window.innerHeight-Ne.height-E)),V({left:ee,top:me})},[v]),x.useLayoutEffect(()=>{var U;v&&((U=$.current)==null||U.focus())},[v]),x.useLayoutEffect(()=>{if(!v)return;function U(ce){var Ne,E;const be=ce.target;!((Ne=$.current)!=null&&Ne.contains(be))&&!((E=Q.current)!=null&&E.contains(be))&&z(!1)}return document.addEventListener("mousedown",U),()=>document.removeEventListener("mousedown",U)},[v]);function ue(U){var ce;if(z(!1),U.needsLogin&&U.account){o(U.account.id);return}c(U.id,(ce=U.account)==null?void 0:ce.id)}function X(U){if(U.key==="Escape"){U.preventDefault(),U.stopPropagation(),z(!0);return}if(U.key==="ArrowDown"||U.key==="ArrowUp"){U.preventDefault();const ce=U.key==="ArrowDown"?1:-1;A(be=>(be+ce+g.length)%g.length);return}if(U.key==="Enter"||U.key===" "){U.preventDefault();const ce=g[k];ce&&ue(ce);return}U.key==="Tab"&&z(!1)}return a.jsxs("div",{className:"newsession",children:[a.jsxs("button",{ref:Q,type:"button",className:"btn btn--primary newsession__btn",disabled:n,title:b?m?`Новая сессия под «${((D=y==null?void 0:y.account)==null?void 0:D.name)??""}». Удерживайте, чтобы выбрать агента или аккаунт`:"Удерживайте, чтобы выбрать агента":void 0,"aria-label":m&&(y!=null&&y.account)?`Новая сессия, аккаунт «${y.account.name}»`:void 0,"aria-haspopup":b?"menu":void 0,"aria-expanded":b?v:void 0,onClick:Y,onContextMenu:H,onPointerDown:R,onPointerMove:K,onPointerUp:ae,onPointerCancel:ae,onPointerLeave:ae,onKeyDown:fe,children:["+ Сессия",m&&(y==null?void 0:y.account)&&a.jsx("span",{className:`newsession__acct acct--${y.account.color}`,"aria-hidden":"true"}),b&&a.jsx($N,{})]}),v&&b&&a.jsx("div",{ref:$,className:"newsession__menu",style:{left:C.left,top:C.top},role:"menu","aria-label":m?"Выбрать агента и аккаунт для новой сессии":"Выбрать агента для новой сессии",tabIndex:-1,onKeyDown:X,children:g.map((U,ce)=>{var be;return a.jsxs("button",{type:"button",role:"menuitem",className:"newsession__item"+(ce===k?" is-cursor":"")+(ce>0&&((be=g[ce-1])==null?void 0:be.id)!==U.id?" newsession__item--sep":""),onMouseEnter:()=>A(ce),onClick:()=>ue(U),children:[U.account?a.jsx("span",{className:"newsession__mark newsession__mark--account",children:a.jsx(Ra,{account:U.account,size:"md"})}):a.jsx("span",{className:`newsession__mark newsession__mark--${U.id}`,"aria-hidden":"true",children:U.id==="antigravity"?a.jsx(tm,{className:"newsession__mark-logo"}):a.jsx(qN,{})}),a.jsxs("span",{className:"newsession__text",children:[a.jsx("span",{className:"newsession__label",children:U.label}),a.jsx("span",{className:"newsession__hint",children:U.hint})]}),U.needsLogin?a.jsx("span",{className:"newsession__tag newsession__tag--login",children:"Войти"}):U.isDefault&&a.jsx("span",{className:"newsession__tag",children:"по клику"})]},U.key)})})]})}function $N(){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 qN(){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 Ny="ccv:sidebar.collapsed",wy="ccv:sidebar.mode",ky="ccv:sidebar.foldersCollapsed",Gb="ccv:sidebar.expandedProjects",Yb="ccv:sidebar.expandedProjectArchives",Sy=500,Dp="транскрипт остаётся на диске — сессию можно вернуть из архива в любой момент.";function GN({open:n,connected:l,status:r,workspaces:c,archivedWorkspaces:o,workspaceFolders:d,sessionFolders:h,pinnedFolders:m,projectSessions:g,onRequestSessions:b,pinned:y,live:j,listOrder:v,liveSessionsFirst:S,onReorder:k,activeWorkspaceId:A,activeSessionId:C,onSelectWorkspace:V,onRenameSession:Q,onStopSession:$,onPinSessions:I,onSelectPinned:G,onCloseWorkspaces:M,onRestoreWorkspaces:z,onUnmarkWorkspaces:R,onArchiveSessions:K,onUnarchiveSessions:ae,onCreateFolder:Y,onRenameFolder:H,onSetFolderColor:fe,onAssignToFolder:ue,folderNotice:X,onDismissFolderNotice:D,movingProjectId:U,foldersReady:ce,onOpenWorkspace:be,onOpenUnopened:Ne,onNewSession:E,enabledProviders:ee,lastAccountId:me,onSignInAccount:Se,onOpenExtensions:q,account:we,onOpenAccount:ie,relay:Ie,onOpenRelay:ze,onOpenSettings:Zt,themeMode:Qe,onCycleTheme:un}){var fr;const Ze=Hp(),[dt,tt]=x.useState(null),[Gt,es]=x.useState(null),[ct,ft]=x.useState(null);function Ce(w){return(ct==null?void 0:ct.folderId)===w.id?ct.color??void 0:w.color}function Je(w){const W=w&&Ce(w);return W?{"--folder-color":W}:void 0}const St=x.useRef(void 0),[pt,Xe]=x.useState(null),[vn,zn]=x.useState(null),[Tt,tn]=x.useState(""),[is,gn]=x.useState(aw),[Sn,ms]=x.useState(iw),[Et,Pt]=x.useState(rw),[En,Wt]=x.useState(()=>Qb(Gb)),[ts,de]=x.useState(()=>Qb(Yb)),[ke,Ke]=x.useState([]);function it(w){Pt(w);try{localStorage.setItem(wy,w)}catch{}}const Be=Tt.trim().toLowerCase(),nt=Be!=="",J=x.useMemo(()=>cf(c,v==null?void 0:v.workspaces,w=>w.id,"bottom"),[c,v]),ge=x.useMemo(()=>{const w=cf(y,v==null?void 0:v.pinned,Cl,"bottom");return S?vy(w):w},[y,v,S]),De=x.useMemo(()=>cf(j,v==null?void 0:v.live,Cl,"bottom"),[j,v]),qe=x.useMemo(()=>{const w=new Map,W=new Map,ve=new Map,Re=new Map(c.map(jt=>[jt.id,jt.folderId]));for(const jt of j){const Hn=Ay(jt);hp(w,jt.workspaceId,Hn),jt.folderId&&hp(W,jt.folderId,Hn);const nn=Re.get(jt.workspaceId);nn&&hp(ve,nn,Hn)}return{byWorkspace:w,bySessionFolder:W,byWorkspaceFolder:ve}},[j,c]),Yt=w=>w.name.toLowerCase().includes(Be)||w.path.toLowerCase().includes(Be),Tn=x.useMemo(()=>ce?nt?J.filter(w=>{if(Yt(w))return!0;const W=g[w.id];return!!W&&(W.sessions.some(ve=>wu(ve,Be))||W.archived.some(ve=>wu(ve,Be)))}):J:[],[J,g,Be,nt,ce]),Is=x.useMemo(()=>ce?nt?o.filter(Yt):o:[],[o,Be,nt,ce]),Dl=w=>{var W;return((W=c.find(ve=>ve.id===w))==null?void 0:W.name)??"—"},Zl=w=>{var W;return(W=c.find(ve=>ve.id===w))==null?void 0:W.path},Bs=x.useMemo(()=>nt?ge.filter(w=>(w.title??"").toLowerCase().includes(Be)||Dl(w.workspaceId).toLowerCase().includes(Be)):ge,[ge,c,Be,nt]),Es=x.useMemo(()=>nt?De.filter(w=>(w.title??"").toLowerCase().includes(Be)||Dl(w.workspaceId).toLowerCase().includes(Be)):De,[De,c,Be,nt]),Cn=!nt;function ll(w){gn(W=>{const ve=W.includes(w)?W.filter(Re=>Re!==w):[...W,w];try{localStorage.setItem(Ny,JSON.stringify(ve))}catch{}return ve})}const dn=w=>!is.includes(w);function Hs(w){ms(W=>{const ve=W.includes(w)?W.filter(Re=>Re!==w):[...W,w];try{localStorage.setItem(ky,JSON.stringify(ve))}catch{}return ve})}const zt=w=>!Sn.includes(w);function We(w,W){Wt(ve=>{if(ve.includes(w)===W)return ve;const Re=W?[...ve,w]:ve.filter(jt=>jt!==w);return Kb(Gb,Re),Re})}function rs(w){de(W=>{const ve=W.includes(w)?W.filter(Re=>Re!==w):[...W,w];return Kb(Yb,ve),ve})}x.useEffect(()=>{A&&We(A,!0)},[A]),x.useEffect(()=>Ke(w=>w.length?[]:w),[Be]);const Ts=x.useRef(new Set);x.useEffect(()=>{if(!l){Ts.current.clear();return}for(const w of En)Ts.current.has(w)||!c.some(W=>W.id===w)||(Ts.current.add(w),w!==A&&b(w))},[l,En,c,A]);function Jl(w){const W=g[w.id],ve=!nt||Yt(w),Re=!ve,jt=Re?!ke.includes(w.id):En.includes(w.id),Hn=W?ve?W.sessions.length:W.sessions.filter(nn=>wu(nn,Be)).length:void 0;return{entry:W,showAll:ve,forced:Re,open:jt,count:Hn}}function Pl(w,W){if(W.forced){Ke(ve=>ve.includes(w.id)?ve.filter(Re=>Re!==w.id):[...ve,w.id]);return}We(w.id,!W.open)}function Ol(w,W){Pl(w,W),!W.open&&w.id!==A&&V(w.id)}const An=x.useMemo(()=>ku(Tn,d,void 0,!nt),[Tn,d,nt]),al=x.useMemo(()=>{const w=new Map;for(const W of d){const ve=(W.unopened??[]).filter(Re=>!nt||Re.name.toLowerCase().includes(Be));ve.length&&w.set(W.id,ve)}return w},[d,Be,nt]),xl=x.useMemo(()=>{if(!nt)return An.groups;const w=new Set(An.groups.map(ve=>ve.folder.id)),W=d.filter(ve=>!w.has(ve.id)&&al.has(ve.id)).map(ve=>({folder:ve,items:[]}));return W.length?[...An.groups,...W].sort((ve,Re)=>ve.folder.name.localeCompare(Re.folder.name,"ru")):An.groups},[An,d,al,nt]),[il,Ll]=x.useState([]),Mn=x.useMemo(()=>ku(Is,d),[Is,d]),Ut=x.useMemo(()=>ku(Bs,m,w=>w.pinnedFolderId,!nt),[Bs,m,nt]),Fn=x.useMemo(()=>({groups:[],ungrouped:Es}),[Es]),Un=((v==null?void 0:v.workspaces.length)??0)>0,Cs=((v==null?void 0:v.pinned.length)??0)>0,cs=((v==null?void 0:v.live.length)??0)>0,As=uf({enabled:Cn,scope:"workspaces",itemKey:w=>w.id,groups:An.groups,ungrouped:An.ungrouped,onReorder:k,onMoveToGroup:(w,W)=>{ue("workspace",w,W.folderId),W.order&&k("workspaces",W.order)}}),bl=uf({enabled:Cn,scope:"pinned",itemKey:Cl,groups:Ut.groups,ungrouped:Ut.ungrouped,onReorder:k}),In=uf({enabled:Cn,scope:"live",itemKey:Cl,groups:Fn.groups,ungrouped:Fn.ungrouped,onReorder:k});x.useEffect(()=>{if(!ct)return;const w=[...m,...d,...h].find(W=>W.id===ct.folderId);w&&w.color===(ct.color??void 0)&&ft(null)},[ct,m,d,h]),x.useEffect(()=>()=>window.clearTimeout(St.current),[]);const $s=Op(Tn),ns=Op(Is),[vt,xn]=x.useState(null),[at,Wl]=x.useState(null),[Rn,qs]=x.useState(null),[Zn,_l]=x.useState(null),[Bn,Dn]=x.useState(null),Gs=x.useRef(null);function bn(w,W){const ve=w.touches[0];if(!ve)return;const Re={timer:0,x:ve.clientX,y:ve.clientY,el:w.currentTarget,fired:!1};Re.timer=window.setTimeout(()=>{Re.fired=!0,W(Re.x,Re.y,Re.el)},Sy),Gs.current=Re}function gs(w){const W=Gs.current,ve=w.touches[0];!W||!ve||Math.hypot(ve.clientX-W.x,ve.clientY-W.y)>10&&(window.clearTimeout(W.timer),Gs.current=null)}function xt(w){const W=Gs.current;W&&(window.clearTimeout(W.timer),W.fired&&w.preventDefault())}function je(){var w;return(w=Gs.current)!=null&&w.fired?(Gs.current=null,!0):!1}function T(){const w=vt==null?void 0:vt.opener;xn(null),w!=null&&w.isConnected&&w.focus()}function P(){const w=at==null?void 0:at.opener;Wl(null),w!=null&&w.isConnected&&w.focus()}function ye(){const w=Zn==null?void 0:Zn.opener;_l(null),w!=null&&w.isConnected&&w.focus()}function Le(){const w=Bn==null?void 0:Bn.opener;Dn(null),w!=null&&w.isConnected&&w.focus()}function Ge(w){return{onContextMenu:W=>{W.preventDefault(),xn({x:W.clientX,y:W.clientY,opener:W.currentTarget,ids:$s.targetsFor(w)})},onTouchStart:W=>bn(W,(ve,Re,jt)=>xn({x:ve,y:Re,opener:jt,ids:$s.targetsFor(w)})),onTouchMove:gs,onTouchEnd:xt,onTouchCancel:xt}}function He(w){return{onContextMenu:W=>{W.preventDefault(),Wl({x:W.clientX,y:W.clientY,opener:W.currentTarget,ids:ns.targetsFor(w)})},onTouchStart:W=>bn(W,(ve,Re,jt)=>Wl({x:ve,y:Re,opener:jt,ids:ns.targetsFor(w)})),onTouchMove:gs,onTouchEnd:xt,onTouchCancel:xt}}function Ct(w){return{onContextMenu:W=>{W.preventDefault(),_l({x:W.clientX,y:W.clientY,opener:W.currentTarget,ids:[w.id]})},onTouchStart:W=>bn(W,(ve,Re,jt)=>_l({x:ve,y:Re,opener:jt,ids:[w.id]})),onTouchMove:gs,onTouchEnd:xt,onTouchCancel:xt}}function bt(w){return{onContextMenu:W=>{W.preventDefault(),Dn({x:W.clientX,y:W.clientY,opener:W.currentTarget,ids:[w.id]})},onTouchStart:W=>bn(W,(ve,Re,jt)=>Dn({x:ve,y:Re,opener:jt,ids:[w.id]})),onTouchMove:gs,onTouchEnd:xt,onTouchCancel:xt}}const jn=((A?(fr=g[A])==null?void 0:fr.sessions:void 0)??[]).filter(w=>w.state!=="closed").length,At=vt?Tn.find(w=>w.id===vt.ids[0]):void 0,Nn=vt?[{id:"close",label:vt.ids.length>1?`Закрыть проекты (${vt.ids.length})`:"Закрыть проект",onSelect:()=>{M(vt.ids),$s.clear()}},...vt.ids.length===1?[{id:"new-session-folder",label:"Новая папка сессий",onSelect:()=>{const w=vt.ids[0];We(w,!0),zn(w)}}]:[],...vt.ids.length===1?[{id:"unmark",label:"Снять отметку проекта",onSelect:()=>qs(vt.ids[0])}]:[],...vu({folders:d,ids:vt.ids,hasFolder:(At==null?void 0:At.folderId)!=null,assign:(w,W)=>ue("workspace",w,W),onClear:()=>$s.clear(),onNewFolder:()=>Xe("workspace")}),...vt.ids.length===1&&Cn?As.menuItems(vt.ids[0],Un):[]]:[],_n=vt?"закрытие не удаляет проект: каталог и история сессий остаются на диске — открыть его снова можно кнопкой «+ Проект»."+(A&&vt.ids.includes(A)&&jn>0?` в нём сейчас незавершённых сессий: ${jn} — при закрытии они остановятся на хосте.`:""):void 0,Ms=at?Is.find(w=>w.id===at.ids[0]):void 0,yl=at?[{id:"restore",label:at.ids.length>1?`Вернуть проекты (${at.ids.length})`:"Вернуть проект",onSelect:()=>{z(at.ids),ns.clear()}},...at.ids.length===1?[{id:"unmark",label:"Снять отметку проекта",onSelect:()=>qs(at.ids[0])}]:[],...vu({folders:d,ids:at.ids,hasFolder:(Ms==null?void 0:Ms.folderId)!=null,assign:(w,W)=>ue("workspace",w,W),onClear:()=>ns.clear(),onNewFolder:()=>Xe("workspace")})]:[],os=at?"каталог и история сессий всё это время оставались на диске — восстановление их не трогает.":void 0,Xt=Zn?Bs.find(w=>w.id===Zn.ids[0]):void 0,Da=Zn?[{id:"rename",label:"Переименовать",onSelect:()=>tt(Zn.ids[0])},{id:"unpin",label:"Открепить",onSelect:()=>{Xt&&I(Xt.workspaceId,[Xt.id],!1)}},{id:"archive",label:"Убрать в архив",onSelect:()=>{Xt&&K(Xt.workspaceId,[Xt.id])}},...Xt&&Xt.workspaceId===A?vu({folders:h.filter(w=>w.workspaceId===Xt.workspaceId),ids:[Xt.id],hasFolder:Xt.folderId!=null,assign:(w,W)=>ue("session",w,W,Xt.workspaceId),onClear:()=>{},onNewFolder:()=>{We(Xt.workspaceId,!0),zn(Xt.workspaceId)}}):[],...KN(Xt?vu({folders:m,ids:[Xt.id],hasFolder:Xt.pinnedFolderId!=null,assign:(w,W)=>ue("pinned",w,W),onClear:()=>{},onNewFolder:()=>Xe("pinned")}):[]),...Cn&&Xt?bl.menuItems(Cl(Xt),Cs):[]]:[],fn=Bn?Es.find(w=>w.id===Bn.ids[0]):void 0,Ys=Bn?[{id:"stop",label:"Остановить",onSelect:()=>{fn&&$(fn)}},{id:"rename",label:"Переименовать",onSelect:()=>tt(Bn.ids[0])},{id:"pin",label:(fn==null?void 0:fn.pinned)===!0?"Открепить":"Закрепить",onSelect:()=>{fn&&I(fn.workspaceId,[fn.id],fn.pinned!==!0)}},{id:"archive",label:"Убрать в архив",onSelect:()=>{fn&&K(fn.workspaceId,[fn.id])}},...Cn&&fn?In.menuItems(Cl(fn),cs):[]]:[],ur={start:bn,move:gs,end:xt,consumed:je};function ea(w,W){return a.jsxs("div",{className:"row row--confirm",style:Su(W),role:"alertdialog","aria-label":`Снять отметку с «${w.name}»`,children:[a.jsx("p",{className:"row__confirm-text",children:`Снять отметку с «${w.name}»? Каталог и файлы останутся на диске, сессии проекта будут остановлены.`}),a.jsxs("div",{className:"row__confirm-bar",children:[a.jsx("button",{type:"button",className:"btn btn--sm",onClick:()=>qs(null),children:"Отмена"}),a.jsx("button",{type:"button",className:"btn btn--danger btn--sm",autoFocus:!0,onClick:()=>{qs(null),R([w.id])},children:"Снять отметку"})]})]},w.id)}function rl(w,W){var Hn,nn;const ve=W?1:0;if(Rn===w.id)return ea(w,ve);const Re=Jl(w),jt=`ws-branch-${w.id}`;return a.jsxs(x.Fragment,{children:[a.jsxs("div",{"data-row-key":w.id,"data-row-scope":"workspaces",className:to(w.id===A,$s.selected.includes(w.id),!1,!!W)+" row--project"+As.dropClass(w.id),style:di(ve,Je(W)),...Ge(w),children:[qr(W),Cn&&a.jsx("button",{type:"button",className:"row__grip",title:"Перетащить в папку (каталог проекта переедет на диске) или изменить порядок","aria-label":"Перетащить проект: в папку или на другое место в списке",...As.gripHandlers(w.id),children:a.jsx(df,{})}),a.jsx("button",{type:"button",className:"row__chev","aria-expanded":Re.open,"aria-controls":jt,"aria-label":`${Re.open?"Свернуть":"Развернуть"} проект «${w.name}»`,title:Re.open?"Свернуть сессии проекта":"Показать сессии проекта",onClick:()=>{je()||Ol(w,Re)},children:a.jsx(Ef,{open:Re.open})}),a.jsxs("button",{className:"row__main",onClick:On=>{je()||$s.click(On,w,()=>{V(w.id),We(w.id,!0)})},onKeyDown:On=>As.onKeyDown(w.id,On),children:[a.jsxs("span",{className:"row__title",children:[w.name,w.hasClaudeMd&&" ·"]}),a.jsx("span",{className:"row__meta",title:w.path,children:U===w.id?"переносим…":w.path})]}),a.jsx(My,{agg:qe.byWorkspace.get(w.id)}),Re.count!==void 0&&a.jsx("span",{className:"sidebar__count row__count",title:"Всего сессий в проекте, запущенных и нет",children:Re.count})]}),Re.open&&a.jsx("div",{id:jt,role:"group","aria-label":`Сессии проекта «${w.name}»`,className:W?"tree__branch tree__branch--railed":"tree__branch",style:di(ve,Je(W)),children:a.jsx(YN,{workspace:w,baseDepth:ve+1,loaded:Re.entry!==void 0,sessions:((Hn=Re.entry)==null?void 0:Hn.sessions)??Xb,archived:((nn=Re.entry)==null?void 0:nn.archived)??Xb,folders:h.filter(On=>On.workspaceId===w.id),needle:Be,showAll:Re.showAll,reorderEnabled:Cn,listOrder:v,liveSessionsFirst:S,activeSessionId:C,archiveExpanded:ts.includes(w.id),onToggleArchive:()=>rs(w.id),creatingFolder:vn===w.id,onStartCreateFolder:()=>zn(w.id),onFinishCreateFolder:()=>zn(null),renamingId:dt,setRenamingId:tt,renderFolderHead:cl,liveInFolder:qe.bySessionFolder,isFolderOpen:zt,folderRowStyle:Je,longPress:ur,onOpenSession:G,onRenameSession:Q,onPinSessions:I,onArchiveSessions:K,onUnarchiveSessions:ae,onCreateFolder:Y,onAssignToFolder:ue,onReorder:k})})]},w.id)}function dr(w){const W=al.get(w.id);if(!W)return null;const ve=nt||il.includes(w.id),Re=ve?W:W.slice(0,Vb),jt=W.length-Re.length,Hn=di(1,Je(w));return a.jsxs("div",{role:"group","aria-label":`Не открытые в ccv каталоги папки «${w.name}»`,children:[Re.map(nn=>a.jsxs("div",{className:"row row--foldered row--unopened",style:Hn,children:[qr(w),a.jsxs("button",{type:"button",className:"row__main row__main--unopened",title:`${nn.path}
|
|
119
|
-
Не открыт в ccv — нажмите, чтобы открыть как проект`,onClick:()=>Ne(nn.path),children:[a.jsx("span",{className:"row__unopened-icon","aria-hidden":"true",children:a.jsx(WN,{})}),a.jsx("span",{className:"row__title",children:nn.name})]})]},nn.path)),(jt>0||ve&&!nt&&W.length>Vb)&&a.jsxs("div",{className:"row row--foldered row--unopened",style:Hn,children:[qr(w),a.jsxs("button",{type:"button",className:"row__main row__main--unopened row__more","aria-expanded":ve,onClick:()=>Ll(nn=>nn.includes(w.id)?nn.filter(On=>On!==w.id):[...nn,w.id]),children:[a.jsx("span",{className:"row__unopened-icon","aria-hidden":"true"}),a.jsx("span",{className:"row__title",children:jt>0?`Ещё ${jt}`:"Свернуть"})]})]})]})}function Oa(w,W){return Rn===w.id?ea(w,W?1:0):a.jsxs("div",{className:to(w.id===A,ns.selected.includes(w.id),!1,!!W),style:Je(W),...He(w),children:[qr(W),a.jsxs("button",{className:"row__main",onClick:ve=>{je()||ns.click(ve,w,()=>V(w.id))},children:[a.jsxs("span",{className:"row__title",children:[w.name,w.hasClaudeMd&&" ·"]}),a.jsx("span",{className:"row__meta",children:pw(w)})]}),a.jsx("button",{className:"row__restore",title:"Вернуть проект из архива",onClick:()=>z([w.id]),children:"Вернуть"})]},w.id)}function ta(w,W){const ve=Cl(w);return a.jsxs("div",{"data-row-key":ve,"data-row-scope":"pinned",className:to(w.id===C,!1,w.provider==="antigravity",!!W,!0)+bl.dropClass(ve),style:Je(W),...dt===w.id?{}:{title:"Действия со строкой — правый клик или долгое нажатие",...Ct(w)},children:[qr(W),dt===w.id?a.jsx("div",{className:"row__main",children:a.jsx(Aa,{value:w.title??"",onCommit:Re=>{Q(w,Re),tt(null)},onCancel:()=>tt(null)})}):a.jsxs(a.Fragment,{children:[Cn&&a.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...bl.gripHandlers(ve),children:a.jsx(df,{})}),a.jsx("button",{className:"row__main row__main--session",onClick:()=>{je()||G(w)},onKeyDown:Re=>bl.onKeyDown(ve,Re),children:a.jsx(yf,{session:w,pinned:!1,projectName:Dl(w.workspaceId),projectPath:Zl(w.workspaceId)})})]})]},w.id)}function mi(w){const W=Cl(w);return a.jsx("div",{"data-row-key":W,"data-row-scope":"live",className:to(w.id===C,!1,w.provider==="antigravity",!1,!0)+In.dropClass(W),...dt===w.id?{}:{title:"Действия со строкой — правый клик или долгое нажатие",...bt(w)},children:dt===w.id?a.jsx("div",{className:"row__main",children:a.jsx(Aa,{value:w.title??"",onCommit:ve=>{Q(w,ve),tt(null)},onCancel:()=>tt(null)})}):a.jsxs(a.Fragment,{children:[Cn&&a.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...In.gripHandlers(W),children:a.jsx(df,{})}),a.jsx("button",{className:"row__main row__main--session",onClick:()=>{je()||G(w)},onKeyDown:ve=>In.onKeyDown(W,ve),children:a.jsx(yf,{session:w,pinned:w.pinned===!0,projectName:Dl(w.workspaceId),projectPath:Zl(w.workspaceId)})}),a.jsx("button",{type:"button",className:"row__stop",title:"Остановить сессию","aria-label":"Остановить сессию",onClick:ve=>{ve.stopPropagation(),!je()&&$(w)},children:a.jsx(tw,{})})]})},w.id)}function cl(w,W,ve={}){return a.jsx(JN,{folder:w,count:W,live:ve.live,depth:ve.depth??0,droppable:ve.droppable===!0,dropActive:ve.droppable===!0&&As.isDropFolder(w.id),open:zt(w.id),renaming:Gt===w.id,onToggle:()=>Hs(w.id),onStartRename:()=>es(w.id),onCommitRename:Re=>{H(w.id,Re),es(null)},onCancelRename:()=>es(null),onOpenAsProject:w.id.startsWith("dir:")&&w.path?()=>Ne(w.path):void 0,color:Ce(w),onPreviewColor:Re=>{window.clearTimeout(St.current),ft({folderId:w.id,color:Re})},onCommitColor:Re=>{ft({folderId:w.id,color:Re}),fe(w.id,Re),window.clearTimeout(St.current),St.current=window.setTimeout(()=>ft(null),4e3)},onResetColor:()=>{window.clearTimeout(St.current),ft(null),fe(w.id,null)}},w.id)}return a.jsxs("aside",{className:n?"sidebar sidebar--open":"sidebar",children:[a.jsxs("div",{className:"sidebar__head",children:[a.jsx("span",{className:l?"dot dot--on":"dot",title:r}),a.jsx("span",{className:"brand",children:"Claude Code Visual"}),a.jsx("button",{className:"theme-btn",title:`Тема: ${Fb[Qe]}`,"aria-label":`Тема: ${Fb[Qe]}. Переключить`,onClick:un,children:a.jsx(cw,{mode:Qe})})]}),a.jsxs("div",{className:"sidebar__tabs",role:"tablist","aria-label":"Что показывать в списке",children:[a.jsx("button",{type:"button",role:"tab","aria-selected":Et==="default",className:Et==="default"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>it("default"),children:a.jsx("span",{className:"sidebar__tab-label",children:"Все"})}),a.jsx("button",{type:"button",role:"tab","aria-selected":Et==="pinned",className:Et==="pinned"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>it("pinned"),children:a.jsx("span",{className:"sidebar__tab-label",children:"Закреплённые"})}),a.jsxs("button",{type:"button",role:"tab","aria-selected":Et==="live",className:Et==="live"?"sidebar__tab is-active":"sidebar__tab",onClick:()=>it("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(sw,{}),a.jsx("input",{className:"fssearch__input",type:"text",value:Tt,spellCheck:!1,placeholder:"Проект или сессия…","aria-label":"Поиск по проектам и сессиям",onChange:w=>tn(w.target.value),onKeyDown:w=>{w.stopPropagation(),w.key==="Escape"&&(w.preventDefault(),Tt?tn(""):w.currentTarget.blur())}}),Tt&&a.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>tn(""),children:"✕"})]}),a.jsx("div",{className:"sidebar__scroll",children:Et==="pinned"?a.jsxs(a.Fragment,{children:[a.jsx(Fd,{title:"Закреплённые",count:Bs.length,open:dn("pinned"),onToggle:()=>ll("pinned"),action:{label:"Новая папка закреплённых",onClick:()=>{Xe("pinned"),dn("pinned")||ll("pinned")}}}),dn("pinned")&&a.jsxs(a.Fragment,{children:[pt==="pinned"&&a.jsx("div",{className:"row",children:a.jsx("div",{className:"row__main",children:a.jsx(Aa,{value:"",placeholder:"Название папки",onCommit:w=>{Y("pinned",w),Xe(null)},onCancel:()=>Xe(null)})})}),Bs.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:nt?"Ничего не найдено":"закрепите сессию через её меню (правый клик или долгое нажатие) — она останется под рукой из любого проекта"})}),Ut.groups.map(w=>a.jsxs(x.Fragment,{children:[cl(w.folder,w.items.length),zt(w.folder.id)&&w.items.map(W=>ta(W,w.folder))]},w.folder.id)),Ut.ungrouped.map(w=>ta(w))]})]}):Et==="live"?a.jsxs(a.Fragment,{children:[a.jsx(Fd,{title:"Запущенные",count:Es.length,open:dn("live"),onToggle:()=>ll("live")}),dn("live")&&a.jsxs(a.Fragment,{children:[Es.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:nt?"Ничего не найдено":"Нет запущенных сессий"})}),Es.map(w=>mi(w))]})]}):a.jsxs(a.Fragment,{children:[a.jsx(Fd,{title:"Проекты",count:Tn.length,open:dn("workspaces"),onToggle:()=>ll("workspaces"),action:{label:"Новая папка проектов",onClick:()=>{Xe("workspace"),dn("workspaces")||ll("workspaces")}}}),dn("workspaces")&&a.jsxs(a.Fragment,{children:[X&&a.jsxs("div",{className:"sidebar__notice",role:"alert",children:[a.jsx("span",{children:X}),a.jsx("button",{type:"button",className:"sidebar__notice-close","aria-label":"Закрыть сообщение",onClick:D,children:"✕"})]}),pt==="workspace"&&a.jsx("div",{className:"row",children:a.jsx("div",{className:"row__main",children:a.jsx(Aa,{value:"",placeholder:"Название папки",onCommit:w=>{Y("workspace",w),Xe(null)},onCancel:()=>Xe(null)})})}),ce&&Tn.length===0&&al.size===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:nt?"Ничего не найдено":"Пока ни одного"})}),xl.map(w=>a.jsxs(x.Fragment,{children:[cl(w.folder,w.items.length,{droppable:Cn,live:qe.byWorkspaceFolder.get(w.folder.id)}),zt(w.folder.id)&&w.items.map(W=>rl(W,w.folder)),zt(w.folder.id)&&dr(w.folder)]},w.folder.id)),An.ungrouped.map(w=>rl(w)),As.canUngroup&&a.jsx("div",{className:As.zoneActive?"tree__zone tree__zone--active":"tree__zone","data-drop-zone":"ungrouped",children:"Без папки"})]}),o.length>0&&a.jsxs(a.Fragment,{children:[a.jsx(Fd,{title:"Архив проектов",count:Is.length,open:dn("workspacesArchive"),onToggle:()=>ll("workspacesArchive"),hint:"проект закрывают вручную; каталог и история сессий остаются на диске и открываются заново отсюда или через «+ Проект»"}),dn("workspacesArchive")&&a.jsxs(a.Fragment,{children:[Is.length===0&&a.jsx("div",{className:"row",children:a.jsx("span",{className:"row__meta",children:nt?"Ничего не найдено":"Пока пусто"})}),Mn.groups.map(w=>a.jsxs(x.Fragment,{children:[cl(w.folder,w.items.length),zt(w.folder.id)&&w.items.map(W=>Oa(W,w.folder))]},w.folder.id)),Mn.ungrouped.map(w=>Oa(w))]})]})]})}),a.jsxs("div",{className:"sidebar__foot",children:[Ze.multi?a.jsxs("button",{className:"account-btn",title:"Аккаунты Claude",onClick:ie,children:[a.jsx("span",{className:"account-btn__marks",children:Ze.accounts.map(w=>{var ve;const W=((ve=Ze.auth[w.id])==null?void 0:ve.loggedIn)===!1;return a.jsx("span",{className:W?"account-btn__mark is-out":"account-btn__mark",children:a.jsx(Ra,{account:w})},w.id)})}),a.jsx("span",{className:"account-btn__id",children:"Аккаунты Claude"}),Ze.accounts.some(w=>{var W;return((W=Ze.auth[w.id])==null?void 0:W.loggedIn)===!1})&&a.jsx("span",{className:"chip chip--warn",children:"нет входа"})]}):a.jsxs("button",{className:"account-btn",title:"Аккаунт Claude",onClick:ie,children:[a.jsx("span",{className:we!=null&&we.loggedIn?"dot dot--on":"dot"}),a.jsx("span",{className:"account-btn__id",children:we===null?"Аккаунт":we.loggedIn?we.email||"Вход выполнен":"Войти в аккаунт"}),(we==null?void 0:we.plan)&&a.jsx("span",{className:"chip",children:we.plan})]}),ze&&a.jsxs("button",{className:"account-btn",title:"Доступ с телефона и из браузера",onClick:ze,children:[a.jsx("span",{className:Ie!=null&&Ie.connected?"dot dot--on":"dot"}),a.jsx("span",{className:"account-btn__id",children:Ie===null?"Удалённый доступ":Ie.paired?Ie.connected?Ie.name||"Удалённый доступ включён":"Удалённый доступ · нет связи":"Удалённый доступ"}),(Ie==null?void 0:Ie.connected)&&Ie.clients>0&&a.jsx("span",{className:"chip",children:Ie.clients})]}),a.jsxs("div",{className:"sidebar__foot-row",children:[a.jsx("button",{className:"btn btn--ghost",disabled:!q,title:"MCP-серверы и плагины",onClick:()=>q==null?void 0:q(),children:"Расширения"}),a.jsx("button",{className:"btn btn--ghost",title:"Настройки приложения",onClick:Zt,children:"Настройки"})]}),a.jsxs("div",{className:"sidebar__foot-row",children:[a.jsx("button",{className:"btn btn--ghost",onClick:be,children:"+ Проект"}),a.jsx(HN,{disabled:!A,providers:ee,lastAccountId:me,onStart:E,onSignIn:Se})]})]}),vt&&a.jsx(pi,{x:vt.x,y:vt.y,items:Nn,note:_n,onClose:T}),at&&a.jsx(pi,{x:at.x,y:at.y,items:yl,note:os,onClose:P}),Zn&&a.jsx(pi,{x:Zn.x,y:Zn.y,items:Da,note:Dp,onClose:ye}),Bn&&a.jsx(pi,{x:Bn.x,y:Bn.y,items:Ys,note:Dp,onClose:Le})]})}const Xb=[];function wu(n,l){return(n.title??"").toLowerCase().includes(l)}function qr(n){return n?a.jsx("span",{className:"row__stripe","aria-hidden":"true"}):null}function di(n,l){return{"--depth":n,...l}}function YN({workspace:n,baseDepth:l,loaded:r,sessions:c,archived:o,folders:d,needle:h,showAll:m,reorderEnabled:g,listOrder:b,liveSessionsFirst:y,activeSessionId:j,archiveExpanded:v,onToggleArchive:S,creatingFolder:k,onStartCreateFolder:A,onFinishCreateFolder:C,renamingId:V,setRenamingId:Q,renderFolderHead:$,liveInFolder:I,isFolderOpen:G,folderRowStyle:M,longPress:z,onOpenSession:R,onRenameSession:K,onPinSessions:ae,onArchiveSessions:Y,onUnarchiveSessions:H,onCreateFolder:fe,onAssignToFolder:ue,onReorder:X}){var ft;const D=n.id,U=h!=="",ce=x.useMemo(()=>{const Ce=cf(c,b==null?void 0:b.sessions[D],Cl,"top");return y?vy(Ce):Ce},[c,b,D,y]),be=x.useMemo(()=>m?ce:ce.filter(Ce=>wu(Ce,h)),[ce,m,h]),Ne=x.useMemo(()=>m?o:o.filter(Ce=>wu(Ce,h)),[o,m,h]),E=x.useMemo(()=>ku(be,d,void 0,!U),[be,d,U]),ee=x.useMemo(()=>ku(Ne,d),[Ne,d]),me=(((ft=b==null?void 0:b.sessions[D])==null?void 0:ft.length)??0)>0,Se=uf({enabled:g,scope:"sessions",workspaceId:D,itemKey:Cl,groups:E.groups,ungrouped:E.ungrouped,onReorder:X}),q=Op(be),[we,ie]=x.useState(null),[Ie,ze]=x.useState(!1);x.useEffect(()=>ze(!1),[h]);const Zt=U&&Ne.length>0,Qe=Zt?!Ie:v;function un(){const Ce=we==null?void 0:we.opener;ie(null),Ce!=null&&Ce.isConnected&&Ce.focus()}function Ze(Ce){return{onContextMenu:Je=>{Je.preventDefault(),ie({x:Je.clientX,y:Je.clientY,opener:Je.currentTarget,ids:q.targetsFor(Ce)})},onTouchStart:Je=>z.start(Je,(St,pt,Xe)=>ie({x:St,y:pt,opener:Xe,ids:q.targetsFor(Ce)})),onTouchMove:z.move,onTouchEnd:z.end,onTouchCancel:z.end}}const dt=we?be.find(Ce=>Ce.id===we.ids[0]):void 0,tt=(dt==null?void 0:dt.pinned)!==!0,Gt=we?[...we.ids.length===1?[{id:"rename",label:"Переименовать",onSelect:()=>Q(we.ids[0])}]:[],{id:"pin",label:tt?we.ids.length>1?`Закрепить (${we.ids.length})`:"Закрепить":we.ids.length>1?`Открепить (${we.ids.length})`:"Открепить",onSelect:()=>{ae(D,we.ids,tt),q.clear()}},{id:"archive",label:we.ids.length>1?`Убрать в архив (${we.ids.length})`:"Убрать в архив",onSelect:()=>{Y(D,we.ids),q.clear()}},...vu({folders:d,ids:we.ids,hasFolder:(dt==null?void 0:dt.folderId)!=null,assign:(Ce,Je)=>ue("session",Ce,Je,D),onClear:()=>q.clear(),onNewFolder:A}),...we.ids.length===1&&g&&dt?Se.menuItems(Cl(dt),me):[]]:[];function es(Ce,Je,St){const pt=Cl(Ce);return a.jsxs("div",{"data-row-key":pt,"data-row-scope":"sessions",className:to(Ce.id===j,q.selected.includes(Ce.id),Ce.provider==="antigravity",!!St,!0)+Se.dropClass(pt),style:di(Je,M(St)),...V===Ce.id?{}:Ze(Ce),children:[qr(St),V===Ce.id?a.jsx("div",{className:"row__main",children:a.jsx(Aa,{value:Ce.title??"",onCommit:Xe=>{K(Ce,Xe),Q(null)},onCancel:()=>Q(null)})}):a.jsxs(a.Fragment,{children:[g&&a.jsx("button",{type:"button",className:"row__grip",title:"Перетащить, чтобы изменить порядок","aria-label":"Перетащить сессию, чтобы изменить порядок в списке",...Se.gripHandlers(pt),children:a.jsx(df,{})}),a.jsx("button",{className:"row__main row__main--session",onClick:Xe=>{z.consumed()||q.click(Xe,Ce,()=>R(Ce))},onKeyDown:Xe=>Se.onKeyDown(pt,Xe),children:a.jsx(yf,{session:Ce,pinned:Ce.pinned===!0})}),a.jsx("button",{className:"row__edit",title:"Переименовать","aria-label":"Переименовать сессию",onClick:()=>{z.consumed()||Q(Ce.id)},children:"✎"})]})]},Ce.id)}function ct(Ce,Je,St){return a.jsxs("div",{className:to(Ce.id===j,!1,Ce.provider==="antigravity",!!St,!0),style:di(Je,M(St)),children:[qr(St),a.jsx("button",{className:"row__main row__main--session",onClick:()=>R(Ce),children:a.jsx(yf,{session:Ce,pinned:!1,archived:!0})}),a.jsx("button",{className:"row__restore",title:"Вернуть сессию из архива",onClick:()=>H(D,[Ce.id]),children:"Вернуть"})]},Ce.id)}return a.jsxs(a.Fragment,{children:[k&&a.jsx("div",{className:"row row--hint",style:di(l,void 0),children:a.jsx("div",{className:"row__main",children:a.jsx(Aa,{value:"",placeholder:"Название папки",onCommit:Ce=>{fe("session",Ce,D),C()},onCancel:C})})}),r?be.length===0&&a.jsx("div",{className:"row row--hint",style:di(l,void 0),children:a.jsx("span",{className:"row__meta",children:"Пока ни одной"})}):a.jsx("div",{className:"row row--hint",style:di(l,void 0),"aria-busy":"true",children:a.jsx("span",{className:"row__meta",children:"Загрузка…"})}),E.groups.map(Ce=>a.jsxs(x.Fragment,{children:[$(Ce.folder,Ce.items.length,{depth:l,live:I.get(Ce.folder.id)}),G(Ce.folder.id)&&Ce.items.map(Je=>es(Je,l+1,Ce.folder))]},Ce.folder.id)),E.ungrouped.map(Ce=>es(Ce,l)),r&&o.length>0&&(!U||Ne.length>0)&&a.jsxs(a.Fragment,{children:[a.jsx(XN,{title:"Архив",count:Ne.length,open:Qe,depth:l,hint:"сессии без обращения дольше двух суток уезжают сюда сами; ничего не удаляется",onToggle:()=>Zt?ze(Ce=>!Ce):S()}),Qe&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"row row--hint",style:di(l,void 0),children:a.jsx("span",{className:"row__meta",children:"сюда сами уезжают сессии без обращения дольше двух суток; транскрипт остаётся на диске, ничего не удаляется"})}),ee.groups.map(Ce=>a.jsxs(x.Fragment,{children:[$(Ce.folder,Ce.items.length,{depth:l}),G(Ce.folder.id)&&Ce.items.map(Je=>ct(Je,l+1,Ce.folder))]},Ce.folder.id)),ee.ungrouped.map(Ce=>ct(Ce,l))]})]}),we&&a.jsx(pi,{x:we.x,y:we.y,items:Gt,note:Dp,onClose:un})]})}function XN({title:n,count:l,open:r,depth:c,hint:o,onToggle:d}){const h=r?`Свернуть «${n}»`:`Развернуть «${n}»`;return a.jsx("div",{className:"row",style:Su(c),children:a.jsxs("button",{className:"row__main",style:Ey,"aria-expanded":r,title:`${h} — ${o}`,onClick:d,children:[a.jsx(Ef,{open:r}),a.jsx("span",{style:Cy,children:n}),a.jsx("span",{className:"sidebar__count",children:l})]})})}function to(n,l,r,c,o){const d=["row"];return o&&d.push("row--session"),c&&d.push("row--foldered"),n&&d.push("row--active"),l&&d.push("row--selected"),r&&d.push("row--antigravity"),d.join(" ")}function ku(n,l,r=o=>o.folderId,c=!1){const o=new Map(l.map(g=>[g.id,g])),d=new Map,h=[];for(const g of n){const b=r(g),y=b?o.get(b):void 0;if(!y){h.push(g);continue}const j=d.get(y.id);j?j.push(g):d.set(y.id,[g])}if(c)for(const g of l)d.has(g.id)||d.set(g.id,[]);return{groups:[...d.entries()].map(([g,b])=>({folder:o.get(g),items:b})).sort((g,b)=>g.folder.name.localeCompare(b.folder.name,"ru")),ungrouped:h}}function VN(n,l,r){return[...n.flatMap(c=>c.items.map(r)),...l.map(r)]}const of="\0ungrouped";function QN(n,l,r){const c=new Map;for(const o of n)for(const d of o.items)c.set(r(d),o.folder.id);for(const o of l)c.set(r(o),of);return c}function fp(n,l,r,c,o){const d=[...l.map(m=>m.items),r].find(m=>m.some(g=>c(g)===n));if(!d)return null;const h=d.findIndex(m=>c(m)===n);return o==="up"?h<=0?null:{target:c(d[h-1]),position:"before"}:h===-1||h>=d.length-1?null:{target:c(d[h+1]),position:"after"}}function uf(n){const[l,r]=x.useState(null),[c,o]=x.useState(null),[d,h]=x.useState(null),m=n.onMoveToGroup,g=x.useMemo(()=>VN(n.groups,n.ungrouped,n.itemKey),[n.groups,n.ungrouped,n.itemKey]),b=x.useMemo(()=>QN(n.groups,n.ungrouped,n.itemKey),[n.groups,n.ungrouped,n.itemKey]),y=x.useRef({raf:0,el:null,x:0,y:0}),j=x.useRef(()=>{});function v(){window.cancelAnimationFrame(y.current.raf),y.current.raf=0,y.current.el=null}function S(Y){v();const H=y.current;if(H.el=Y.closest(".sidebar__scroll"),!H.el)return;const fe=56,ue=16,X=()=>{const D=H.el;if(!D)return;const U=D.getBoundingClientRect();let ce=0;if(H.y<U.top+fe?ce=-ue*Math.min(1,(U.top+fe-H.y)/fe):H.y>U.bottom-fe&&(ce=ue*Math.min(1,(H.y-(U.bottom-fe))/fe)),ce!==0){const be=D.scrollTop;D.scrollTop=be+ce,D.scrollTop!==be&&j.current(H.x,H.y)}H.raf=window.requestAnimationFrame(X)};H.raf=window.requestAnimationFrame(X)}x.useEffect(()=>v,[]);function k(){v(),r(null),o(null),h(null)}function A(Y,H){n.enabled&&(H.preventDefault(),H.currentTarget.setPointerCapture(H.pointerId),y.current.x=H.clientX,y.current.y=H.clientY,S(H.currentTarget),r(Y),o(null),h(null))}function C(Y,H){if(!l)return;const fe=document.elementFromPoint(Y,H),ue=b.get(l);if(m){const Ne=fe==null?void 0:fe.closest("[data-drop-folder]"),E=Ne?null:fe==null?void 0:fe.closest("[data-drop-zone]");if(Ne||E){const ee=Ne?Ne.dataset.dropFolder:null,me=ee??of;o(null),h(me===ue?null:{folderId:ee});return}}const X=fe==null?void 0:fe.closest("[data-row-key]"),D=(X==null?void 0:X.dataset.rowScope)===n.scope?X.dataset.rowKey:void 0,U=D?b.get(D):void 0;if(h(null),!D||D===l||U===void 0||!m&&U!==ue){o(null);return}const ce=X.getBoundingClientRect(),be=H-ce.top<ce.height/2?"before":"after";o(Ne=>(Ne==null?void 0:Ne.key)===D&&Ne.position===be?Ne:{key:D,position:be})}j.current=C;function V(Y){y.current.x=Y.clientX,y.current.y=Y.clientY,C(Y.clientX,Y.clientY)}function Q(){if(l&&d&&m)m(l,{folderId:d.folderId,order:null});else if(l&&c){const Y=Kd(g,l,c.key,c.position),H=b.get(c.key);m&&H!==b.get(l)?m(l,{folderId:H===of?null:H??null,order:Y}):Y&&n.onReorder(n.scope,Y,n.workspaceId)}k()}function $(Y,H){if(!n.enabled)return;const fe=fp(Y,n.groups,n.ungrouped,n.itemKey,H);if(!fe)return;const ue=Kd(g,Y,fe.target,fe.position);ue&&n.onReorder(n.scope,ue,n.workspaceId)}function I(Y,H){const fe=fp(Y,n.groups,n.ungrouped,n.itemKey,"up"),ue=fp(Y,n.groups,n.ungrouped,n.itemKey,"down"),X=[{id:"move-up",label:"Переместить выше",disabled:!fe,onSelect:()=>{if(!fe)return;const D=Kd(g,Y,fe.target,fe.position);D&&n.onReorder(n.scope,D,n.workspaceId)}},{id:"move-down",label:"Переместить ниже",disabled:!ue,onSelect:()=>{if(!ue)return;const D=Kd(g,Y,ue.target,ue.position);D&&n.onReorder(n.scope,D,n.workspaceId)}}];return H&&X.push({id:"reset-order",label:"Сбросить порядок",onSelect:()=>n.onReorder(n.scope,null,n.workspaceId)}),X}function G(Y){return l===Y?" row--dragging":(c==null?void 0:c.key)===Y?c.position==="before"?" row--drop-before":" row--drop-after":""}function M(Y){return{onPointerDown:H=>A(Y,H),onPointerMove:V,onPointerUp:Q,onPointerCancel:k,onLostPointerCapture:k}}function z(Y,H){!H.altKey||H.key!=="ArrowUp"&&H.key!=="ArrowDown"||(H.preventDefault(),$(Y,H.key==="ArrowUp"?"up":"down"))}const R=Y=>(d==null?void 0:d.folderId)===Y,K=!!m&&l!==null&&b.get(l)!==of,ae=d!==null&&d.folderId===null;return{dragging:l!==null,dropClass:G,gripHandlers:M,onKeyDown:z,menuItems:I,isDropFolder:R,canUngroup:K,zoneActive:ae}}function vu(n){return[...[...n.folders].sort((r,c)=>r.name.localeCompare(c.name,"ru")).map(r=>({id:`folder:${r.id}`,label:`В папку «${r.name}»`,onSelect:()=>{n.ids.forEach(c=>n.assign(c,r.id)),n.onClear()}})),...n.hasFolder?[{id:"folder:none",label:"Без папки",onSelect:()=>{n.ids.forEach(r=>n.assign(r,null)),n.onClear()}}]:[],{id:"folder:new",label:"Новая папка…",onSelect:n.onNewFolder}]}function KN(n){return n.map(l=>({...l,id:`pinned:${l.id}`,label:l.id==="folder:new"?"Новая папка закреплённых…":l.id==="folder:none"?"Без папки закреплённых":l.label}))}function Op(n){const[l,r]=x.useState([]),c=x.useRef(null);function o(){r([]),c.current=null}function d(m,g,b){if(m.ctrlKey||m.metaKey){r(y=>y.includes(g.id)?y.filter(j=>j!==g.id):[...y,g.id]),c.current=g.id;return}if(m.shiftKey&&c.current){const y=n.findIndex(v=>v.id===c.current),j=n.findIndex(v=>v.id===g.id);if(y!==-1&&j!==-1){const[v,S]=y<j?[y,j]:[j,y];r(n.slice(v,S+1).map(k=>k.id));return}}o(),c.current=g.id,b()}function h(m){return l.includes(m.id)?l:(r([m.id]),c.current=m.id,[m.id])}return{selected:l,click:d,targetsFor:h,clear:o}}const FN={display:"flex",alignItems:"center",gap:6,flex:1,minWidth:0,textAlign:"left"},ZN={width:22,height:22,borderRadius:6};function Fd({title:n,count:l,open:r,onToggle:c,hint:o,action:d}){const h=r?`Свернуть «${n}»`:`Развернуть «${n}»`;return a.jsxs("div",{className:"sidebar__section",children:[a.jsxs("button",{className:"sidebar__section--btn",style:FN,"aria-expanded":r,title:o?`${h} — ${o}`:h,onClick:c,children:[a.jsx(Ef,{open:r}),a.jsx("span",{className:"sidebar__section-name",children:n}),a.jsx("span",{className:"sidebar__count",children:l})]}),d&&a.jsx("button",{className:"theme-btn",style:ZN,title:d.label,"aria-label":d.label,onClick:d.onClick,children:a.jsx(lw,{})})]})}function Su(n){return{paddingLeft:`calc(37px + ${n} * var(--tree-indent, 24px))`}}const Ey={display:"flex",alignItems:"center",gap:6,width:"100%"},Ty={flex:1,minWidth:0,color:"var(--text-2)",fontWeight:500},Cy={...Ty,color:"var(--muted)",fontSize:12.5};function JN({folder:n,count:l,live:r,open:c,renaming:o,onToggle:d,onStartRename:h,onCommitRename:m,onCancelRename:g,onOpenAsProject:b,color:y,onPreviewColor:j,onCommitColor:v,onResetColor:S,depth:k,droppable:A,dropActive:C}){const V=x.useRef(null),[Q,$]=x.useState(!1),[I,G]=x.useState(null),M=x.useRef(null);x.useEffect(()=>()=>{var ue;return window.clearTimeout((ue=M.current)==null?void 0:ue.timer)},[]);function z(ue){const X=ue.touches[0];if(!X)return;const D={timer:0,x:X.clientX,y:X.clientY,el:ue.currentTarget,fired:!1};D.timer=window.setTimeout(()=>{D.fired=!0,G({x:D.x,y:D.y,opener:D.el})},Sy),M.current=D}function R(ue){const X=M.current,D=ue.touches[0];!X||!D||Math.hypot(D.clientX-X.x,D.clientY-X.y)>10&&(window.clearTimeout(X.timer),M.current=null)}function K(ue){const X=M.current;X&&(window.clearTimeout(X.timer),X.fired&&ue.preventDefault())}function ae(){const ue=I==null?void 0:I.opener;G(null),ue!=null&&ue.isConnected&&ue.focus()}function Y(){const ue=V.current;if(ue)try{ue.showPicker()}catch{ue.click()}}const H=[{id:"rename",label:"Переименовать",onSelect:h},{id:"color",label:"Выбрать цвет…",onSelect:Y},...n.color?[{id:"reset-color",label:"Сбросить цвет",onSelect:S}]:[],...b?[{id:"as-project",label:"Это проект",onSelect:()=>$(!0)}]:[]],fe=x.useRef(v);return fe.current=v,x.useEffect(()=>{const ue=V.current;if(!ue)return;const X=()=>fe.current(ue.value);return ue.addEventListener("change",X),()=>ue.removeEventListener("change",X)},[o,Q]),Q&&b?a.jsxs("div",{className:"row row--confirm",style:Su(k),role:"alertdialog","aria-label":`Открыть «${n.name}» как проект`,children:[a.jsx("p",{className:"row__confirm-text",children:`Открыть «${n.name}» как проект? Проекты внутри останутся открытыми, но без папки.`}),a.jsxs("div",{className:"row__confirm-bar",children:[a.jsx("button",{type:"button",className:"btn btn--sm",onClick:()=>$(!1),children:"Отмена"}),a.jsx("button",{type:"button",className:"btn btn--sm",autoFocus:!0,onClick:()=>{$(!1),b()},children:"Открыть как проект"})]})]}):o?a.jsx("div",{className:"row",style:Su(k),children:a.jsx("div",{className:"row__main",children:a.jsx(Aa,{value:n.name,placeholder:"Название папки",onCommit:m,onCancel:g})})}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:C?"row row--drop-target":"row",style:Su(k),"data-drop-folder":A?n.id:void 0,onContextMenu:ue=>{ue.preventDefault(),G({x:ue.clientX,y:ue.clientY,opener:ue.currentTarget})},onTouchStart:z,onTouchMove:R,onTouchEnd:K,onTouchCancel:K,children:[a.jsxs("button",{className:"row__main",style:Ey,"aria-expanded":c,title:c?`Свернуть папку «${n.name}»`:`Развернуть папку «${n.name}»`,onClick:d,children:[a.jsx(Ef,{open:c}),a.jsx("span",{style:k>0?Cy:Ty,children:n.name}),!c&&a.jsx(My,{agg:r}),a.jsx("span",{className:"sidebar__count",children:l})]}),a.jsxs("span",{className:"row__more",children:[a.jsx("button",{type:"button",className:"row__edit",title:"Действия с папкой","aria-label":`Действия с папкой «${n.name}»`,"aria-haspopup":"menu","aria-expanded":I!==null,onClick:ue=>{const X=ue.currentTarget.getBoundingClientRect();G({x:X.left,y:X.bottom,opener:ue.currentTarget})},children:a.jsx(ew,{})}),a.jsx("input",{ref:V,className:"row__color-input",type:"color",tabIndex:-1,"aria-hidden":"true",value:y??PN(),onChange:ue=>j(ue.target.value)})]})]}),I&&a.jsx(pi,{x:I.x,y:I.y,items:H,onClose:ae})]})}function PN(){const n=getComputedStyle(document.documentElement).getPropertyValue("--folder-default").trim();return/^#[0-9a-f]{6}$/i.test(n)?n.toLowerCase():"#9a978d"}const Vb=8;function WN(){return a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round",children:a.jsx("path",{d:"M2 4.5A1.5 1.5 0 0 1 3.5 3h2.6l1.4 1.5h5A1.5 1.5 0 0 1 14 6v5.5a1.5 1.5 0 0 1-1.5 1.5h-9A1.5 1.5 0 0 1 2 11.5z"})})}function Ef({open:n}){return a.jsx("svg",{className:n?"sidebar__chev sidebar__chev--open":"sidebar__chev",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M6 3.5 10.5 8 6 12.5"})})}function ew(){return a.jsxs("svg",{viewBox:"0 0 16 16",width:"16",height:"16",fill:"currentColor","aria-hidden":"true",children:[a.jsx("circle",{cx:"3.5",cy:"8",r:"1.3"}),a.jsx("circle",{cx:"8",cy:"8",r:"1.3"}),a.jsx("circle",{cx:"12.5",cy:"8",r:"1.3"})]})}function df(){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 tw(){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 nw({className:n}){return a.jsxs("svg",{className:n,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("rect",{x:"4.5",y:"2.4",width:"7",height:"4.2",rx:"1.6"}),a.jsx("path",{d:"M5.4 6.6 8 12.2 10.6 6.6"}),a.jsx("path",{d:"M8 12.2v1.4"})]})}function sw(){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 lw(){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 aw(){try{const n=localStorage.getItem(Ny);if(n===null)return["workspacesArchive"];const l=JSON.parse(n);return Array.isArray(l)?l.filter(r=>r==="workspaces"||r==="workspacesArchive"||r==="pinned"||r==="live"):["workspacesArchive"]}catch{return["workspacesArchive"]}}function Qb(n){try{const l=localStorage.getItem(n);if(l===null)return[];const r=JSON.parse(l);return Array.isArray(r)?r.filter(c=>typeof c=="string"):[]}catch{return[]}}function Kb(n,l){try{localStorage.setItem(n,JSON.stringify(l))}catch{}}function iw(){try{const n=localStorage.getItem(ky);if(n===null)return[];const l=JSON.parse(n);return Array.isArray(l)?l.filter(r=>typeof r=="string"):[]}catch{return[]}}function rw(){try{const n=localStorage.getItem(wy);return n==="pinned"||n==="live"?n:"default"}catch{return"default"}}const Fb={system:"как в системе",light:"светлая",dark:"тёмная"};function cw({mode:n}){const l={viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0};return n==="dark"?a.jsx("svg",{...l,children:a.jsx("path",{d:"M13.2 9.7A5.4 5.4 0 0 1 6.3 2.8a5.6 5.6 0 1 0 6.9 6.9Z"})}):n==="light"?a.jsxs("svg",{...l,children:[a.jsx("circle",{cx:"8",cy:"8",r:"3.1"}),a.jsx("path",{d:"M8 1.4v1.4M8 13.2v1.4M2.4 8H1M15 8h-1.4M4 4l-1-1M13 13l-1-1M12 4l1-1M3 13l1-1"})]}):a.jsxs("svg",{...l,children:[a.jsx("rect",{x:"1.8",y:"2.6",width:"12.4",height:"8.4",rx:"1.4"}),a.jsx("path",{d:"M5.6 13.4h4.8"})]})}function Zb(n){const l=ow(n),r=(n.tasks??[]).filter(c=>c.kind==="agent").length;return r>0?`${l} · ${jy(r)}`:l}function ow(n){switch(n.state){case"running":return"работает";case"waiting_permission":return"ждёт разрешения";case"idle":return n.backgroundWork?"работает в фоне":uw(n.lastTurn);case"starting":return"запускается";case"reconnecting":return"переподключается";case"error":return"ошибка";case"closed":return"на диске"}}function uw(n){switch(n){case"interrupted":return"прервана";case"stopped":return"остановлена";case"failed":return"оборвалась";case"completed":return"готова";case null:return"ждёт задачу"}}function Ay(n){switch(n.state){case"running":return"running";case"starting":return"starting";case"reconnecting":return"reconnecting";case"waiting_permission":return"waiting";case"idle":return n.backgroundWork?"background":dw(n.lastTurn);case"error":return"error";case"closed":return"closed"}}function dw(n){switch(n){case"interrupted":case"stopped":return"halted";case"failed":return"error";case"completed":return"ready";case null:return"fresh"}}function yf({session:n,pinned:l,projectName:r,projectPath:c,archived:o}){const d=o?"closed":Ay(n);return a.jsxs(a.Fragment,{children:[a.jsx("span",{className:`row__lead row__state--${d}`,"aria-hidden":"true",children:a.jsx("span",{className:"row__state-dot"})}),a.jsxs("span",{className:"row__body"+(r!==void 0?" row__body--with-project":"")+(o?" row__body--archived":""),title:o?hw(n):`${Zb(n)} · ${new Date(n.updatedAt).toLocaleString()}`,children:[a.jsx(fw,{title:n.title??"Без названия",pinned:l,provider:n.provider,accountId:n.accountId,projectName:r,projectPath:c}),o?a.jsxs("span",{className:"row__meta row__vh row__vh--wide",children:[a.jsx("span",{className:"row__state",children:n.archivedAuto?"по сроку":"вручную"}),n.archivedAt?a.jsx("span",{className:"row__time",children:` · ${pp(n.archivedAt)}`}):null]}):a.jsxs("span",{className:`row__meta${d==="closed"?` row__vh${r===void 0?" row__vh--time":""}`:""}`,children:[a.jsx("span",{className:`row__state row__state--${d}${d==="closed"?" row__vh":""}`,children:Zb(n)}),r===void 0&&a.jsx("span",{className:"row__time",children:d==="closed"?pp(n.updatedAt):` · ${pp(n.updatedAt)}`})]})]})]})}const Jb=["waiting","error","running","reconnecting","background","starting","halted","ready","fresh","closed"];function hp(n,l,r){const c=n.get(l);if(!c){n.set(l,{count:1,tone:r,waiting:r==="waiting"?1:0});return}c.count+=1,r==="waiting"&&(c.waiting+=1),Jb.indexOf(r)<Jb.indexOf(c.tone)&&(c.tone=r)}function My({agg:n}){if(!n)return null;const l=`Запущено сессий: ${n.count}`,r=n.waiting>0?`${l}, ждут решения: ${n.waiting}`:l;return a.jsxs("span",{className:`row__live row__state--${n.tone}`,role:"img","aria-label":r,title:r,children:[a.jsx("span",{className:"row__state-dot","aria-hidden":"true"}),a.jsx("span",{"aria-hidden":"true",children:n.count})]})}function fw({title:n,pinned:l,provider:r,accountId:c,projectName:o,projectPath:d}){const h=xv(c,r);return a.jsxs("span",{className:"row__head",children:[a.jsxs("span",{className:"row__title",children:[l&&a.jsx(nw,{className:"row__pin"}),h&&a.jsx(Ra,{account:h,className:"row__acct"}),r==="antigravity"&&a.jsx(tm,{className:"row__provider"}),n]}),o!==void 0&&a.jsx("span",{className:"row__project",title:d,children:o})]})}function pp(n){const l=new Date(n);return l.toDateString()===new Date().toDateString()?l.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):l.toLocaleDateString(void 0,{day:"numeric",month:"short"})}function hw(n){const l=n.archivedAuto?"сама, по сроку молчания":"убрана вручную";return n.archivedAt?`${new Date(n.archivedAt).toLocaleString()} · ${l}`:l}function pw(n){return n.archivedAt?`закрыт ${new Date(n.archivedAt).toLocaleString()}`:"закрыт"}const Pb=3,mw=15e5;function Ry(n,l){if(!l||typeof l!="object")return null;const r=l,c=typeof r.file_path=="string"?r.file_path:"";if(!c)return null;if(n==="Write"){if(typeof r.content!="string")return null;const o=mp(r.content).map(d=>({type:"add",text:d}));return{kind:"create",filePath:c,rows:o,added:o.length,removed:0,note:"файл записывается целиком"}}if(n==="Edit"){if(typeof r.old_string!="string"||typeof r.new_string!="string")return null;const o=_w(gw(mp(r.old_string),mp(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 mp(n){if(n==="")return[];const l=n.split(/\r?\n/);return l.length>1&&l[l.length-1]===""&&l.pop(),l}function gw(n,l){let r=0;for(;r<n.length&&r<l.length&&n[r]===l[r];)r++;let c=n.length,o=l.length;for(;c>r&&o>r&&n[c-1]===l[o-1];)c--,o--;const d=h=>({type:"ctx",text:h});return[...n.slice(0,r).map(d),...xw(n.slice(r,c),l.slice(r,o)),...n.slice(c).map(d)]}function xw(n,l){if(n.length===0&&l.length===0)return[];if(n.length===0)return l.map(y=>({type:"add",text:y}));if(l.length===0)return n.map(y=>({type:"del",text:y}));if((n.length+1)*(l.length+1)>mw)return[...n.map(y=>({type:"del",text:y})),...l.map(y=>({type:"add",text:y}))];const r=n.length,c=l.length,o=c+1,d=new Uint32Array((r+1)*o),h=(y,j)=>d[y*o+j]??0;for(let y=r-1;y>=0;y--)for(let j=c-1;j>=0;j--)d[y*o+j]=n[y]===l[j]?h(y+1,j+1)+1:Math.max(h(y+1,j),h(y,j+1));const m=[];let g=0,b=0;for(;g<r&&b<c;){const y=n[g],j=l[b];y===j?(m.push({type:"ctx",text:y}),g++,b++):h(g+1,b)>=h(g,b+1)?(m.push({type:"del",text:y}),g++):(m.push({type:"add",text:j}),b++)}for(;g<r;)m.push({type:"del",text:n[g++]});for(;b<c;)m.push({type:"add",text:l[b++]});return bw(m)}function bw(n){const l=[];let r=[];function c(){l.push(...r.filter(o=>o.type==="del")),l.push(...r.filter(o=>o.type==="add")),r=[]}for(const o of n)o.type==="ctx"?(c(),l.push(o)):r.push(o);return c(),l}function _w(n){if(!n.some(d=>d.type!=="ctx"))return n;const l=n.map(()=>!1);n.forEach((d,h)=>{if(d.type!=="ctx")for(let m=Math.max(0,h-Pb);m<=Math.min(n.length-1,h+Pb);m++)l[m]=!0});const r=[];let c=[];function o(){c.length===1?r.push(...c):c.length>1&&r.push({type:"gap",text:`⋯ ${c.length} ${yw(c.length)} без изменений`}),c=[]}return n.forEach((d,h)=>{l[h]?(o(),r.push(d)):c.push(d)}),o(),r}function yw(n){const l=n%100;if(l>=11&&l<=14)return"строк";switch(n%10){case 1:return"строка";case 2:case 3:case 4:return"строки";default:return"строк"}}async function Ma(n){try{return await navigator.clipboard.writeText(n),!0}catch{}const l=document.createElement("textarea");l.value=n,l.setAttribute("readonly",""),l.style.position="fixed",l.style.opacity="0",document.body.appendChild(l);try{return l.select(),document.execCommand("copy")}catch{return!1}finally{l.remove()}}async function Lp(){try{return await navigator.clipboard.readText()}catch{return null}}const nm=1600,Zr="Копировать",io="Скопировано";function xo({text:n,hint:l,className:r}){const[c,o]=x.useState(!1);return x.useEffect(()=>{if(!c)return;const d=setTimeout(()=>o(!1),nm);return()=>clearTimeout(d)},[c]),x.useEffect(()=>o(!1),[n]),a.jsx("button",{type:"button",className:"copybtn"+(c?" copybtn--done":"")+(r?` ${r}`:""),"aria-label":c?io:`${Zr} ${l}`,title:c?io:`${Zr} ${l}`,onClick:()=>{Ma(n).then(d=>{d&&o(!0)})},children:c?io:Zr})}function sm({diff:n}){return a.jsxs("div",{className:"diff",children:[a.jsxs("div",{className:"diff__head",children:[a.jsx("span",{className:"diff__path",title:n.filePath,children:n.filePath}),a.jsxs("span",{className:"diff__stat",children:[n.added>0&&a.jsxs("span",{className:"diff__stat--add",children:["+",n.added]}),n.removed>0&&a.jsxs("span",{className:"diff__stat--del",children:["−",n.removed]})]})]}),n.note&&a.jsx("div",{className:"diff__note",children:n.note}),a.jsx("div",{className:"diff__body",children:n.rows.length===0?a.jsx("div",{className:"diff__row diff__row--gap",children:a.jsx("span",{className:"diff__text",children:"пустое содержимое"})}):n.rows.map((l,r)=>a.jsxs("div",{className:`diff__row diff__row--${l.type}`,children:[a.jsx("span",{className:"diff__mark","aria-hidden":"true",children:l.type==="add"?"+":l.type==="del"?"−":""}),a.jsx("span",{className:"diff__text",children:l.text===""?" ":l.text})]},r))})]})}function vw({waiting:n}){const[l,r]=x.useState(0);return x.useEffect(()=>{const c=window.setInterval(()=>r(o=>o+1),1e3);return()=>window.clearInterval(c)},[]),a.jsxs("div",{className:n?"work work--wait":"work",children:[a.jsxs("span",{className:"work__dots","aria-hidden":"true",children:[a.jsx("span",{className:"work__dot"}),a.jsx("span",{className:"work__dot"}),a.jsx("span",{className:"work__dot"})]}),a.jsx("span",{className:"work__label",children:n?"ждёт разрешения":"думает"}),!n&&a.jsxs("span",{className:"work__time",children:[l," с"]})]})}function lm({items:n,busy:l,waiting:r,history:c=[],historyHasMore:o=!1,historyLoading:d=!1,onLoadHistory:h,sessionId:m,onEditMessage:g,empty:b="Сессия пуста. Опишите задачу — Claude Code работает в каталоге проекта с полным набором инструментов."}){const y=x.useRef(null),j=x.useRef(null),v=x.useRef(!0),S=x.useRef(null),k=x.useRef(null),A=x.useRef(!1);x.useEffect(()=>{v.current=!0,S.current=null,A.current=!1,k.current!==null&&(clearTimeout(k.current),k.current=null)},[m]),x.useEffect(()=>{const I=y.current,G=j.current;if(!I||!G)return;function M(K){!I||K===I.scrollTop||(A.current=!0,I.scrollTop=K)}function z(){if(!I)return;const K=S.current;if(K){const ae=e_(I,K.id);if(ae){const Y=ae.getBoundingClientRect().top-I.getBoundingClientRect().top;M(I.scrollTop+(Y-K.top))}k.current!==null&&clearTimeout(k.current),k.current=setTimeout(()=>{S.current=null},500);return}v.current&&M(I.scrollHeight)}const R=new ResizeObserver(z);return R.observe(G),()=>{R.disconnect(),k.current!==null&&clearTimeout(k.current)}},[]);function C(){const I=y.current;if(I){if(A.current){A.current=!1;return}v.current=I.scrollHeight-I.scrollTop-I.clientHeight<80}}function V(){if(d)return;const I=y.current,G=c[0];if(I&&G){const M=e_(I,G.id);M&&(S.current={id:G.id,top:M.getBoundingClientRect().top-I.getBoundingClientRect().top})}h==null||h()}let Q=0;function $(I){return I.kind==="user"?Q++:-1}return a.jsx("div",{className:"transcript",ref:y,onScroll:C,children:a.jsxs("div",{className:"stream",ref:j,children:[o&&a.jsx("button",{type:"button",className:"transcript__more",onClick:V,disabled:d,children:d?"Загружаем…":"Показать более раннее"}),c.map(I=>a.jsx(Wb,{item:I,userIndex:$(I),onEditMessage:g},I.id)),c.length>0&&n.length>0&&a.jsx("div",{className:"transcript__divider",children:a.jsx("span",{children:"дальше — сессия открыта заново"})}),c.length===0&&n.length===0&&a.jsx("p",{className:"empty",children:b}),n.map(I=>a.jsx(Wb,{item:I,userIndex:$(I),onEditMessage:g},I.id)),l&&a.jsx(vw,{waiting:r})]})})}function Wb({item:n,userIndex:l,onEditMessage:r}){switch(n.kind){case"user":return a.jsx(Nw,{item:n,userIndex:l,onEditMessage:r});case"assistant":return a.jsxs("div",{className:"msg--assistant","data-item-id":n.id,children:[a.jsx(ww,{text:n.text}),n.streaming&&a.jsx("span",{className:"caret"}),n.text.trim()!==""&&a.jsx("div",{className:"msg--assistant__foot",children:a.jsx(xo,{text:n.text,hint:"ответ целиком"})})]});case"thinking":return a.jsx("div",{className:"thinking","data-item-id":n.id,children:n.text});case"tool":return a.jsx(Sw,{item:n});case"result":return a.jsxs("div",{className:"result-line","data-item-id":n.id,children:[a.jsx("span",{children:n.isError?"✗ "+n.subtype:"✓ готово"}),a.jsxs("span",{children:[(n.durationMs/1e3).toFixed(1)," с"]}),n.costUsd!==null&&a.jsxs("span",{children:["$",n.costUsd.toFixed(4)]}),a.jsxs("span",{children:["↑",n_(n.inputTokens)," ↓",n_(n.outputTokens)]})]});case"notice":return a.jsx("div",{className:n.tone==="error"?"notice notice--error":"notice","data-item-id":n.id,children:n.text})}}const jw=500;function Nw({item:n,userIndex:l,onEditMessage:r}){const[c,o]=x.useState(null),[d,h]=x.useState(!1),[m,g]=x.useState(n.text),b=x.useRef(null),y=x.useRef(!1),j=Nf("(max-width: 860px)"),v=x.useRef(null);function S(R,K){o({x:R,y:K})}function k(R){R.preventDefault(),S(R.clientX,R.clientY)}function A(R){const K=R.touches[0];if(!K)return;const ae={timer:0,x:K.clientX,y:K.clientY,fired:!1};ae.timer=window.setTimeout(()=>{ae.fired=!0,S(ae.x,ae.y)},jw),v.current=ae}function C(R){const K=v.current,ae=R.touches[0];!K||!ae||Math.hypot(ae.clientX-K.x,ae.clientY-K.y)>10&&(window.clearTimeout(K.timer),v.current=null)}function V(R){const K=v.current;K&&(window.clearTimeout(K.timer),K.fired&&R.preventDefault())}function Q(){g(n.text),h(!0)}function $(){h(!1)}function I(){const R=m.trim();if(R===""&&!(n.images&&n.images.length>0))return;const K=r==null?void 0:r(l,R,n.images);if(K instanceof Promise){if(y.current)return;y.current=!0,K.then(ae=>{y.current=!1,ae&&h(!1)},()=>{y.current=!1});return}K!==!1&&h(!1)}x.useEffect(()=>{const R=b.current;!R||!d||(R.style.height="auto",R.style.height=`${R.scrollHeight}px`)},[m,d]),x.useEffect(()=>{if(!d)return;const R=b.current;R&&(R.focus(),R.setSelectionRange(R.value.length,R.value.length))},[d]);function G(R){if(R.key==="Escape"){R.preventDefault(),R.stopPropagation(),$();return}R.key==="Enter"&&!R.shiftKey&&!j&&(R.preventDefault(),I())}const M=n.images&&n.images.length>0&&a.jsx("div",{className:"msg--user__images",children:n.images.map((R,K)=>a.jsx("img",{className:"msg--user__image",src:`data:${R.mediaType};base64,${R.data}`,alt:"Вложение"},K))});if(d){const R=m.trim()!==""||!!(n.images&&n.images.length>0);return a.jsxs("div",{className:"msg--user msg--user--editing","data-item-id":n.id,children:[M,a.jsxs("div",{className:"msg--user__edit",children:[a.jsx("textarea",{ref:b,className:"msg--user__edit-field",value:m,onChange:K=>g(K.target.value),onKeyDown:G,rows:1}),a.jsxs("div",{className:"msg--user__edit-actions",children:[a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:$,children:"Отмена"}),a.jsx("button",{type:"button",className:"btn btn--sm btn--primary",onClick:I,disabled:!R,children:"Сохранить"})]})]})]})}const z=[{id:"copy",label:"Копировать",onSelect:()=>void Ma(n.text)},...r?[{id:"edit",label:"Изменить",onSelect:Q}]:[]];return a.jsxs("div",{className:"msg--user","data-item-id":n.id,onContextMenu:k,onTouchStart:A,onTouchMove:C,onTouchEnd:V,onTouchCancel:V,children:[M,n.text,c&&a.jsx(pi,{x:c.x,y:c.y,items:z,onClose:()=>o(null)})]})}function e_(n,l){const r=n.querySelectorAll("[data-item-id]");for(const c of r)if(c.dataset.itemId===l)return c;return null}function ww({text:n}){const[l,r]=x.useState(""),c=x.useRef([]);x.useEffect(()=>{let d=!1;return Sf(n).then(h=>{d||r(kw(h))}),()=>{d=!0}},[n]),x.useEffect(()=>{const d=c.current;return()=>d.forEach(h=>clearTimeout(h))},[]);function o(d){var g,b;const h=d.target.closest(".codeblock__copy");if(!(h instanceof HTMLElement))return;const m=((b=(g=h.parentElement)==null?void 0:g.querySelector("pre"))==null?void 0:b.textContent)??"";m!==""&&Ma(m).then(y=>{if(!y)return;h.textContent=io,h.setAttribute("aria-label",io),h.classList.add("copybtn--done");const j=window.setTimeout(()=>{h.isConnected&&(h.textContent=Zr,h.setAttribute("aria-label",zp),h.classList.remove("copybtn--done"))},nm);c.current.push(j)})}return a.jsx("div",{className:"markdown-preview msg--assistant__body",onClick:o,dangerouslySetInnerHTML:{__html:l}})}const zp=`${Zr} блок кода`;function kw(n){if(!n.includes("<pre"))return n;const l=new DOMParser().parseFromString(n,"text/html");for(const r of l.body.querySelectorAll("pre")){const c=l.createElement("div");c.className="codeblock",r.replaceWith(c),c.append(r);const o=l.createElement("button");o.type="button",o.className="copybtn codeblock__copy",o.setAttribute("aria-label",zp),o.title=zp,o.textContent=Zr,c.append(o)}return l.body.innerHTML}function Sw({item:n}){const[l,r]=x.useState(!1),c=n.result===null,o=Ry(n.name,n.input),d=n.name==="AskUserQuestion"?Cw(n.input):null;return a.jsxs("div",{className:"tool"+(n.isError?" tool--error":"")+(n.awaitingPermission?" tool--wait":""),"data-item-id":n.id,children:[a.jsxs("button",{className:"tool__head",onClick:()=>r(h=>!h),children:[a.jsx("span",{className:"tool__name",children:n.name}),a.jsx("span",{className:"tool__arg",children:d?Tw(d):Ew(n.input)}),a.jsx("span",{className:"tool__status",children:c?"…":n.isError?"ошибка":l?"▴":"▾"})]}),l&&a.jsxs("div",{className:"tool__body",children:[d?a.jsx(Aw,{questions:d,answers:n.answers}):o?a.jsx(sm,{diff:o}):a.jsx(t_,{text:JSON.stringify(n.input,null,2),hint:"аргументы вызова"}),n.result!==null&&(!d||n.isError)&&a.jsx(t_,{text:n.result,hint:"результат вызова",style:{marginTop:10}})]})]})}function t_({text:n,hint:l,style:r}){return a.jsxs("div",{className:"codeblock",style:r,children:[a.jsx("pre",{className:"code",children:n}),a.jsx(xo,{text:n,hint:l,className:"codeblock__copy"})]})}function Ew(n){if(!n||typeof n!="object")return"";const l=n;for(const r of["file_path","command","pattern","path","url","prompt"]){const c=l[r];if(typeof c=="string")return c.replace(/\s+/g," ").slice(0,160)}return JSON.stringify(l).slice(0,160)}function Tw(n){var r;const l=n.map(c=>c.header).filter(c=>c.length>0);return l.length===n.length?l.join(" · "):((r=n[0])==null?void 0:r.question.replace(/\s+/g," ").slice(0,160))??""}function Cw(n){if(typeof n!="object"||n===null)return null;const l=n.questions;if(!Array.isArray(l)||l.length===0)return null;const r=[];for(const c of l){if(typeof c!="object"||c===null)return null;const{question:o,header:d,options:h,multiSelect:m}=c;if(typeof o!="string"||!Array.isArray(h)||h.length===0)return null;const g=[];for(const b of h){if(typeof b!="object"||b===null)return null;const{label:y,description:j,preview:v}=b;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 Aw({questions:n,answers:l}){return a.jsx("div",{className:"tool__questions",children:n.map((r,c)=>a.jsxs("div",{className:"tool__question",children:[a.jsxs("div",{className:"tool__question-head",children:[r.header&&a.jsx("span",{className:"chip chip--accent",children:r.header}),a.jsx("span",{className:"tool__question-text",children:r.question})]}),a.jsx("div",{className:"tool__question-answer",children:l!=null&&l[r.question]?a.jsx("span",{className:"tool__answer-value",children:l[r.question]}):a.jsx("span",{className:"tool__answer-empty",children:"не отвечено"})})]},c))})}function n_(n){return n>=1e3?`${(n/1e3).toFixed(1)}k`:String(n)}const Mw="ccv.dictation.lang",s_="ru-RU";function Rw(n){try{return Function.prototype.toString.call(n).includes("[native code]")}catch{return!1}}function l_(){const n=window,l=[n.SpeechRecognition,n.webkitSpeechRecognition].filter(c=>typeof c=="function"),r=l.find(Rw);return!r&&l.length>0&&Vl("распознавание подменено: родной реализации в странице нет"),r??l[0]??null}function Dy(){var n;try{return((n=localStorage.getItem(Mw))==null?void 0:n.trim())||s_}catch{return s_}}function Vl(n,l){l===void 0?console.debug(`[dictation] ${n}`):console.debug(`[dictation] ${n}`,l)}const Dw=3,Ow=400,Lw=5,zw=250,Uw=2e3,Iw=2e4;async function Bw(){try{return(await navigator.permissions.query({name:"microphone"})).state==="granted"}catch{return!1}}const Hw={"not-allowed":"Браузер не дал доступ к микрофону","service-not-allowed":"Браузер не дал доступ к микрофону","audio-capture":"Микрофон не найден",network:"Сервис распознавания недоступен","language-not-supported":`Распознавание не знает языка ${Dy()}`};function $w(n){const[l]=x.useState(()=>l_()!==null),[r,c]=x.useState(!1),[o,d]=x.useState(null),h=x.useRef(null),m=x.useRef(!1),g=x.useRef(!1),b=x.useRef(n),y=x.useRef({openedAt:0,audio:!1,heard:!1,everHeard:!1,silent:0,dead:0,lastError:"",warned:!1}),j=x.useRef(null),v=x.useRef(!1),S=x.useRef(null),k=x.useCallback(()=>{S.current&&clearTimeout(S.current),S.current=null},[]),A=x.useCallback(()=>{k();const I=async G=>{if(S.current=null,!(!m.current||v.current)){if(!G&&!await Bw()){if(Vl("ждём ответа на запрос доступа к микрофону"),!m.current||v.current)return;S.current=setTimeout(()=>void I(!0),Iw);return}Vl("движок не ответил на start()"),m.current=!1,c(!1),d("Распознавание не отвечает — проверьте расширения браузера и доступ к микрофону")}};S.current=setTimeout(()=>void I(!1),Uw)},[k]);x.useEffect(()=>{b.current=n}),x.useEffect(()=>{const I=l_();if(!I)return;const G=new I;return G.lang=Dy(),G.continuous=!0,G.interimResults=!0,G.onstart=()=>{Vl("сессия открыта"),v.current=!0,k(),c(!0)},G.onaudiostart=()=>{Vl("пошёл звук с микрофона"),y.current.audio=!0},G.onresult=M=>{var ae;if(g.current)return;let z="",R="";for(let Y=M.resultIndex;Y<M.results.length;Y++){const H=M.results[Y];if(!H)continue;const fe=((ae=H[0])==null?void 0:ae.transcript)??"";H.isFinal?z+=fe:R+=fe}const K=y.current;K.heard=!0,K.everHeard=!0,Vl("распознано",{final:z,interim:R}),b.current(z,R)},G.onerror=M=>{y.current.lastError=M.error,Vl("ошибка движка",M.error),!(M.error==="no-speech"||M.error==="aborted")&&(m.current=!1,c(!1),d(Hw[M.error]??`Распознавание не работает: ${M.error}`))},G.onend=()=>{g.current=!1,v.current=!1;const M=y.current,z=Date.now()-M.openedAt;if(Vl("сессия закрыта",{мс:z,звук:M.audio,слова:M.heard,ошибка:M.lastError||null}),!m.current){c(!1);return}if(M.dead=!M.audio&&z<Ow?M.dead+1:0,M.dead>=Lw){m.current=!1,c(!1),d(M.lastError?`Распознавание не работает: ${M.lastError}`:"Распознавание закрывается сразу после запуска — проверьте доступ к микрофону в настройках сайта");return}M.silent=M.heard?0:M.silent+1,!M.everHeard&&!M.warned&&M.silent>=Dw&&(M.warned=!0,d(M.audio?"Микрофон слушает, но речь не распознаётся — проверьте язык диктовки и уровень звука":"С микрофона не идёт звук — проверьте устройство ввода в настройках сайта в браузере")),j.current=setTimeout(()=>{if(j.current=null,!!m.current){M.openedAt=Date.now(),M.audio=!1,M.heard=!1,M.lastError="",A();try{G.start()}catch{}}},zw)},h.current=G,()=>{m.current=!1,j.current&&clearTimeout(j.current),j.current=null,k(),G.onend=null,G.onresult=null,G.onerror=null,G.onstart=null,G.onaudiostart=null,G.abort(),h.current=null}},[]);const C=x.useCallback(()=>{var I;if(m.current){if(m.current=!1,Vl("выключение микрофона"),j.current&&clearTimeout(j.current),j.current=null,k(),!v.current){c(!1);return}(I=h.current)==null||I.stop()}},[]),V=x.useCallback(()=>{const I=h.current;if(I){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),Vl("включение микрофона",{язык:I.lang}),A();try{I.start()}catch(G){Vl("start() не прошёл",G)}}},[A]),Q=x.useCallback(()=>{m.current?C():V()},[V,C]),$=x.useCallback(()=>{var I;m.current&&v.current&&(g.current=!0,(I=h.current)==null||I.abort())},[]);return{supported:l,listening:r,error:o,toggle:Q,stop:C,drop:$}}const qw="(max-width: 860px)",a_=/^\/(\S*)$/,Gw=new Set(["model","permissions"]);function Yw(n){return Gw.has(n.name)||n.name.startsWith("__")}const Xw=new Set(["clear","rename"]),i_=/(?:^|\s)@([^\s@]*)$/,Vw=200,Qw=100,Kw=190,Fw=5,Zw=20*1024*1024,Jw=1568,Pw=.85;let r_=0;async function Ww(n){var j,v;if(!n.type.startsWith("image/")||n.size>Zw)return null;const l=await ek(n);if(!l)return null;const{width:r,height:c}=l;if(r<=0||c<=0)return null;const o=Math.min(1,Jw/Math.max(r,c)),d=document.createElement("canvas");d.width=Math.max(1,Math.round(r*o)),d.height=Math.max(1,Math.round(c*o));const h=d.getContext("2d");if(!h)return null;h.drawImage(l.image,0,0,d.width,d.height),(v=(j=l.image).close)==null||v.call(j);const m=n.type==="image/png",g=m?"image/png":"image/jpeg",b=d.toDataURL(g,m?void 0:Pw),y=b.slice(b.indexOf(",")+1);return y?(r_+=1,{id:`att${r_}`,mediaType:g,data:y,previewUrl:b}):null}async function ek(n){if(typeof createImageBitmap=="function")try{const l=await createImageBitmap(n);return{image:l,width:l.width,height:l.height}}catch{}return new Promise(l=>{const r=URL.createObjectURL(n),c=new Image;c.onload=()=>{URL.revokeObjectURL(r),l({image:c,width:c.naturalWidth,height:c.naturalHeight})},c.onerror=()=>{URL.revokeObjectURL(r),l(null)},c.src=r})}function Oy({disabled:n,busy:l,commands:r,sessionTitle:c,contextResult:o,className:d,placeholder:h,draftKey:m,sendLabel:g="Отправить",autoFocus:b=!1,attachmentsEnabled:y=!0,sendBlocked:j=!1,onContextSearch:v,onCommand:S,onSend:k,onInterrupt:A,onEscape:C}){var nt;const V=Nf(qw),[Q,$]=x.useState(()=>m?np(m):""),[I,G]=x.useState(!1),[M,z]=x.useState(0),R=x.useRef(null),K=x.useRef(null),ae=x.useRef(!1),Y=x.useRef(null),[H,fe]=x.useState(()=>m?np(m).length:0),[ue,X]=x.useState([]),D=x.useRef(null),U=x.useCallback(J=>{!y||J.length===0||Promise.all(J.map(Ww)).then(ge=>{const De=ge.filter(qe=>qe!==null);De.length!==0&&X(qe=>[...qe,...De].slice(0,Fw))})},[y]);function ce(J){X(ge=>ge.filter(De=>De.id!==J))}function be(J){var qe;if(!y)return;const ge=(qe=J.clipboardData)==null?void 0:qe.items;if(!ge)return;const De=[];for(const Yt of ge){if(!Yt.type.startsWith("image/"))continue;const Tn=Yt.getAsFile();Tn&&De.push(Tn)}De.length!==0&&(J.preventDefault(),U(De))}function Ne(J){const ge=J.target.files?Array.from(J.target.files):[];J.target.value="",U(ge)}x.useEffect(()=>{y||X([])},[y]);const[E,ee]=x.useState([]),[me,Se]=x.useState(-1),q=x.useRef(""),[we,ie]=x.useState(""),Ie=$w(x.useCallback((J,ge)=>{J&&$(De=>gp(De,J)),ie(ge.trim())},[])),ze=we?gp(Q,we):Q;x.useEffect(()=>{Ie.listening||we===""||($(J=>gp(J,we)),ie(""))},[Ie.listening,we]),x.useEffect(()=>{var J;b&&((J=R.current)==null||J.focus())},[b]);const Zt=x.useRef(new Map),Qe=x.useRef(new Map),un=x.useRef(m),Ze=x.useRef({text:Q,caret:H});Ze.current={text:Q,caret:H};const dt=x.useCallback((J,ge,De)=>{ge===""?(Zt.current.delete(J),Qe.current.delete(J)):(Zt.current.set(J,ge),Qe.current.set(J,De)),G_(J,ge)},[]),tt=Ie.drop;x.useLayoutEffect(()=>{const J=un.current;if(J===m)return;un.current=m,J&&dt(J,Ze.current.text,Ze.current.caret);const ge=m?Zt.current.get(m)??np(m):"",De=m?Qe.current.get(m):void 0,qe=Math.min(De??ge.length,ge.length);$(ge),fe(qe),Y.current=[qe,qe],ie(""),z(0),G(!1),Se(-1),q.current="",X([]),tt()},[m,dt,tt]),x.useEffect(()=>{m&&dt(m,Q,H)},[m,Q,H,dt]);const Gt=n?"Выберите сессию":j?"Нет VPN — отправка остановлена":h??"Опишите задачу… («/» — команды, «@» — файлы)",es=x.useRef(0),ct=x.useCallback(J=>{const ge=parseFloat(getComputedStyle(J).maxHeight),De=Number.isFinite(ge)&&ge>0?ge:Kw;J.style.height="auto";const qe=J.scrollHeight;J.style.height=`${Math.min(qe,De)}px`,J.style.overflowY=qe>De?"auto":"hidden"},[]);x.useEffect(()=>{const J=R.current;J&&ct(J)},[ze,Gt,n,ct]),x.useLayoutEffect(()=>{const J=R.current,ge=Y.current;!J||!ge||(Y.current=null,J.setSelectionRange(ge[0],ge[1]))}),x.useEffect(()=>{const J=R.current;if(!J)return;const ge=new ResizeObserver(([De])=>{const qe=De==null?void 0:De.contentRect.width;qe===void 0||Math.abs(qe-es.current)<1||(es.current=qe,ct(J))});return ge.observe(J),()=>ge.disconnect()},[ct]);const ft=Ie.stop;x.useEffect(()=>{n&&ft()},[n,ft]);const Ce=x.useMemo(()=>Ie.error?{ok:!1,message:Ie.error}:null,[Ie.error]),Je=x.useMemo(()=>{var De;const J=(De=a_.exec(Q))==null?void 0:De[1];if(J===void 0)return[];const ge=J.toLowerCase();return r.filter(qe=>!Yw(qe)&&xp(qe,ge)<Ly).sort((qe,Yt)=>xp(qe,ge)-xp(Yt,ge))},[Q,r]),St=!I&&Je.length>0,pt=Math.min(M,Je.length-1),Xe=I?null:((nt=i_.exec(ze.slice(0,H)))==null?void 0:nt[1])??null,vn=x.useRef(v);vn.current=v,x.useEffect(()=>{if(Xe===null||Xe===""||Xe.endsWith("/")){vn.current(Xe);return}const J=setTimeout(()=>vn.current(Xe),Vw);return()=>clearTimeout(J)},[Xe]);const zn=Xe!==null&&(o==null?void 0:o.query)===Xe,Tt=zn?o.entries:[],tn=Xe!==null,is=tn&&!zn,gn=Math.min(M,Math.max(Tt.length-1,0));x.useEffect(()=>{var ge,De;if(!St&&!tn)return;const J=St?pt:gn;(De=(ge=K.current)==null?void 0:ge.children[J])==null||De.scrollIntoView({block:"nearest"})},[St,tn,pt,gn]);function Sn(J,ge){var De;$(J),fe(ge),Y.current=[ge,ge],z(0),G(!1),we!==""&&(ie(""),Ie.drop()),(De=R.current)==null||De.focus()}function ms(){$(""),ie(""),z(0),fe(0),G(!1),Se(-1),q.current="",X([]),Ie.drop(),m&&dt(m,"",0)}function Et(J){const ge=J.trim();if(ge===""&&ue.length===0||n||j||ae.current)return;const De=k(ge,ue.length>0?ue.map(qe=>({mediaType:qe.mediaType,data:qe.data})):void 0);if(De instanceof Promise){ae.current=!0,De.then(qe=>{ae.current=!1,qe&&Pt(ge)},()=>{ae.current=!1});return}De!==!1&&Pt(ge)}function Pt(J){J!==""&&ee(ge=>[J,...ge.filter(De=>De!==J)].slice(0,Qw)),ms()}function En(J){if(J<-1||J>=E.length)return;me===-1&&(q.current=Q);const ge=J===-1?q.current:E[J]??"";Se(J),Sn(ge,ge.length)}function Wt(){var qe;const J=((qe=R.current)==null?void 0:qe.selectionStart)??ze.length,De=`${J>0&&!/\s$/.test(ze.slice(0,J))?" ":""}@`;Sn(ze.slice(0,J)+De+ze.slice(J),J+De.length)}function ts(J){var Yt;const ge=(Yt=i_.exec(ze.slice(0,H)))==null?void 0:Yt[1];if(ge===void 0)return;const De=H-ge.length-1,qe=J.kind==="dir"?`@${J.path}/`:`@${J.path} `;Sn(ze.slice(0,De)+qe+ze.slice(H),De+qe.length)}function de(){var ge;if(j)return;const J=(ge=a_.exec(ze.trim()))==null?void 0:ge[1];if(J&&S(J)){ms();return}Et(ze)}function ke(J,ge){$(J),fe(ge),z(0),G(!1),Se(-1),we!==""&&(ie(""),Ie.drop())}function Ke(J){var qe;const ge=Xw.has(J.name)?c:null,De=`/${J.name} `;$(De+(ge??"")),fe(De.length+((ge==null?void 0:ge.length)??0)),ge&&(Y.current=[De.length,De.length+ge.length]),z(0),(qe=R.current)==null||qe.focus()}function it(J){if(S(J.name)){$(""),z(0),G(!1);return}J.argumentHint?Ke(J):Et(`/${J.name}`)}function Be(J){if(St){if(J.key==="ArrowDown")return J.preventDefault(),z(ge=>(Math.min(ge,Je.length-1)+1)%Je.length);if(J.key==="ArrowUp"){J.preventDefault();const ge=Je.length-1;return z(De=>(Math.min(De,ge)+ge)%Je.length)}if(J.key==="Enter"&&!J.shiftKey){J.preventDefault();const ge=Je[pt];ge&&it(ge);return}if(J.key==="Tab"){J.preventDefault();const ge=Je[pt];ge&&Ke(ge);return}if(J.key==="Escape"){J.preventDefault(),J.stopPropagation(),G(!0);return}}if(tn){if(J.key==="ArrowDown"&&Tt.length>0)return J.preventDefault(),z(ge=>(Math.min(ge,Tt.length-1)+1)%Tt.length);if(J.key==="ArrowUp"&&Tt.length>0){J.preventDefault();const ge=Tt.length-1;return z(De=>(Math.min(De,ge)+ge)%Tt.length)}if(J.key==="Enter"&&!J.shiftKey||J.key==="Tab"){const ge=Tt[gn];if(ge){J.preventDefault(),ts(ge);return}if(J.key==="Tab")return}if(J.key==="Escape"){J.preventDefault(),J.stopPropagation(),G(!0);return}}if((J.key==="ArrowUp"||J.key==="ArrowDown")&&!J.shiftKey){const ge=J.currentTarget,De=ge.selectionStart;if(ge.selectionEnd===De){const Yt=J.key==="ArrowUp"?me+1:me-1;Yt>=-1&&Yt<E.length&&requestAnimationFrame(()=>{ge.selectionStart===De&&ge.selectionEnd===De&&En(Yt)})}}if(J.key==="Escape"&&C){J.preventDefault(),J.stopPropagation(),C();return}J.key==="Enter"&&!J.shiftKey&&!V&&(J.preventDefault(),de())}return a.jsx("div",{className:d?`composer ${d}`:"composer",children:a.jsxs("div",{className:"composer__inner",children:[a.jsx(Wr,{result:Ce}),tn&&!St&&a.jsxs("div",{className:"cmdmenu",role:"listbox",ref:K,children:[Tt.map((J,ge)=>a.jsxs("button",{role:"option","aria-selected":ge===gn,className:ge===gn?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>z(ge),onMouseDown:De=>{De.preventDefault(),ts(J)},children:[a.jsxs("span",{className:"cmdmenu__name",children:[J.name,J.kind==="dir"?"/":""]}),a.jsx("span",{className:"cmdmenu__desc",children:J.path}),J.ignored&&a.jsx("span",{className:"cmdmenu__tag",children:"git-ignore"})]},J.path)),Tt.length===0&&a.jsx("div",{className:"cmdmenu__empty",children:is?"ищем…":Xe?"Ничего не нашлось":"Наберите имя файла или каталога"})]}),St&&a.jsx("div",{className:"cmdmenu",role:"listbox",ref:K,children:Je.map((J,ge)=>a.jsxs("button",{role:"option","aria-selected":ge===pt,className:ge===pt?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>z(ge),onMouseDown:De=>{De.preventDefault(),it(J)},children:[a.jsxs("span",{className:"cmdmenu__name",children:["/",J.name]}),J.argumentHint&&a.jsx("span",{className:"cmdmenu__hint",children:J.argumentHint}),a.jsx("span",{className:"cmdmenu__desc",children:J.description})]},J.name))}),ue.length>0&&a.jsx("div",{className:"composer__attachments",children:ue.map(J=>a.jsxs("div",{className:"composer__thumb",children:[a.jsx("img",{src:J.previewUrl,alt:"Вложение"}),a.jsx("button",{type:"button",className:"composer__thumb-remove","aria-label":"Удалить вложение",onClick:()=>ce(J.id),children:a.jsx(ik,{})})]},J.id))}),a.jsxs("div",{className:"composer__field",children:[a.jsx("button",{type:"button",className:"addbtn",title:"Добавить контекст — файл проекта («@»)","aria-label":"Добавить контекст",disabled:n,onClick:Wt,children:a.jsx(sk,{})}),y&&a.jsxs(a.Fragment,{children:[a.jsx("input",{ref:D,type:"file",accept:"image/*",multiple:!0,className:"composer__fileinput",tabIndex:-1,"aria-hidden":"true",onChange:Ne}),a.jsx("button",{type:"button",className:"attachbtn",title:"Прикрепить изображение","aria-label":"Прикрепить изображение",disabled:n,onClick:()=>{var J;return(J=D.current)==null?void 0:J.click()},children:a.jsx(ak,{})})]}),a.jsx("textarea",{ref:R,value:ze,disabled:n,placeholder:Gt,onChange:J=>ke(J.target.value,J.target.selectionStart),onSelect:J=>fe(J.currentTarget.selectionStart),onKeyDown:Be,onPaste:be}),Ie.supported&&a.jsx("button",{type:"button",className:Ie.listening?"micbtn is-on":"micbtn",title:Ie.listening?"Остановить диктовку":"Продиктовать промпт","aria-label":Ie.listening?"Остановить диктовку":"Продиктовать промпт","aria-pressed":Ie.listening,disabled:n,onClick:Ie.toggle,children:a.jsx(rk,{on:Ie.listening})}),l?a.jsx("button",{className:"btn",onClick:A,title:"Прервать (Esc)",children:"Стоп"}):a.jsxs("button",{className:"btn btn--primary sendbtn",onClick:de,disabled:n||j||ze.trim()===""&&ue.length===0,"aria-label":g,title:j?"Нет VPN — отправка остановлена":g,children:[a.jsx("span",{className:"sendbtn__label",children:g}),a.jsx(lk,{})]})]})]})})}function gp(n,l){const r=l.trim();if(r==="")return n;const c=Up(r).slice(tk(n,r)).join(" ");return c===""?n:n===""||/\s$/.test(n)?n+c:`${n} ${c}`}function tk(n,l){const r=Up(n),c=Up(l);for(let o=Math.min(r.length,c.length);o>0;o--)if(r.slice(r.length-o).every((d,h)=>nk(d,c[h]??"")))return o;return 0}function Up(n){return n.split(/\s+/).filter(l=>l!=="")}function nk(n,l){const r=c=>c.toLowerCase().replace(/[.,!?;:…]+$/u,"");return r(n)===r(l)}function sk(){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 lk(){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 ak(){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 ik(){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 rk({on:n}){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("rect",{x:"5.9",y:"1.7",width:"4.2",height:"7.6",rx:"2.1",fill:n?"currentColor":"none"}),a.jsx("path",{d:"M3.3 7.3v.8a4.7 4.7 0 0 0 9.4 0v-.8"}),a.jsx("path",{d:"M8 12.8v1.5"})]})}const Ly=4;function xp(n,l){const r=n.name.toLowerCase();return r===l?0:r.startsWith(l)?1:n.aliases.some(c=>c.toLowerCase().startsWith(l))?2:r.includes(l)?3:Ly}function ck({request:n,plan:l,queued:r,collapsed:c,onCollapse:o,onAccept:d,onDecline:h}){const[m,g]=x.useState(l),[b,y]=x.useState("preview");x.useEffect(()=>{g(l),y("preview")},[n.requestId,l]);const j=m.trim().length>0;function v(){j&&d(n.requestId,m)}return a.jsx("div",{className:"modal-backdrop modal-backdrop--sheet",hidden:c,children:a.jsxs("div",{className:"plansheet",role:"dialog","aria-modal":"true","aria-label":"План агента",children:[a.jsxs("div",{className:"plansheet__head",children:[a.jsx("span",{className:"plansheet__head-icon","aria-hidden":"true",children:a.jsx(zy,{})}),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"+(b==="preview"?" is-on":""),role:"tab","aria-selected":b==="preview",onClick:()=>y("preview"),children:"Просмотр"}),a.jsx("button",{className:"btn btn--sm"+(b==="source"?" is-on":""),role:"tab","aria-selected":b==="source",onClick:()=>y("source"),children:"Код"})]}),a.jsx(am,{onClick:o})]}),a.jsxs("div",{className:"plansheet__body",children:[n.reason&&a.jsx("p",{className:"plansheet__reason",children:n.reason}),a.jsx("div",{className:"plansheet__content",children:b==="preview"?a.jsx(ok,{text:m}):a.jsx("textarea",{className:"plansheet__source",value:m,onChange:S=>g(S.target.value),spellCheck:!1,"aria-label":"Текст плана — можно отредактировать перед тем, как согласиться",autoFocus:!0})})]}),a.jsxs("div",{className:"plansheet__actions",children:[a.jsx("button",{className:"btn",onClick:()=>h(n.requestId),children:"Доработать"}),a.jsx("button",{className:"btn btn--ok",disabled:!j,autoFocus:!0,onClick:v,children:"Одобрить план"})]})]})})}function ok({text:n}){const[l,r]=x.useState("");return x.useEffect(()=>{let c=!1;return Sf(n).then(o=>{c||r(o)}),()=>{c=!0}},[n]),a.jsx("div",{className:"markdown-preview plansheet__preview",dangerouslySetInnerHTML:{__html:l}})}function zy(){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 uk({kind:n,toolName:l,queued:r,onExpand:c}){const o=n==="question"?"Уточняющий вопрос":n==="plan"?"План на согласование":`Разрешить действие: ${l}`;return a.jsxs("button",{type:"button",className:`decision-bar decision-bar--${n}`,onClick:c,children:[a.jsx("span",{className:"decision-bar__icon","aria-hidden":"true",children:n==="question"?"?":n==="plan"?a.jsx(zy,{}):"!"}),a.jsxs("span",{className:"decision-bar__text",children:[a.jsx("span",{className:"decision-bar__title",children:o}),a.jsxs("span",{className:"decision-bar__sub",children:["ждёт вашего решения",r>0&&` — ещё ${r} в очереди`]})]}),a.jsxs("span",{className:"decision-bar__action",children:["Развернуть",a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"m4 10 4-4 4 4"})})]})]})}function am({onClick:n}){return a.jsxs("button",{type:"button",className:"decision-collapse",onClick:n,title:"Свернуть — агент продолжит ждать","aria-label":"Свернуть",children:[a.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"m4 6 4 4 4-4"})}),a.jsx("span",{className:"decision-collapse__label",children:"Свернуть"})]})}function dk({request:n,queued:l,collapsed:r,onCollapse:c,onDecide:o}){const d=Ry(n.toolName,n.input);return a.jsx("div",{className:"modal-backdrop modal-backdrop--sheet",hidden:r,children:a.jsxs("div",{className:"sheet",role:"dialog","aria-modal":"true","aria-label":"Запрос разрешения",children:[a.jsxs("div",{className:"sheet__head",children:[a.jsxs("span",{className:"sheet__head-text",children:["Разрешить действие?",l>0&&` (ещё ${l} в очереди)`]}),a.jsx(am,{onClick:c})]}),a.jsxs("div",{className:"sheet__body",children:[a.jsx("div",{className:"sheet__tool",children:n.toolName}),n.reason&&a.jsx("p",{className:"sheet__reason",children:n.reason}),d?a.jsx(sm,{diff:d}):a.jsx("pre",{className:"code",children:JSON.stringify(n.input,null,2)})]}),a.jsxs("div",{className:"sheet__actions",children:[a.jsx("button",{className:"btn",onClick:()=>o(n.requestId,"deny"),children:"Отклонить"}),a.jsx("button",{className:"btn btn--warn",autoFocus:!0,onClick:()=>o(n.requestId,"allow"),children:"Разрешить"})]})]})})}function fk({request:n,queued:l,collapsed:r,onCollapse:c,onAnswer:o,onDecline:d}){const{questions:h}=n,[m,g]=x.useState(()=>h.map(()=>new Set)),[b,y]=x.useState(()=>h.map(()=>"")),[j,v]=x.useState(()=>c_(h));x.useEffect(()=>{g(h.map(()=>new Set)),y(h.map(()=>"")),v(c_(h))},[n.requestId]);const S=x.useMemo(()=>pk(h,m,b),[h,m,b]),k=S!==null;function A(G,M){var z,R;(R=(z=h[G])==null?void 0:z.options[M])!=null&&R.preview&&v(K=>{const ae=K.slice();return ae[G]=M,ae})}function C(G,M,z){g(R=>{const K=R.slice(),ae=new Set(K[G]);return z?ae.has(M)?ae.delete(M):ae.add(M):ae.has(M)||(ae.clear(),ae.add(M)),K[G]=ae,K}),M!=="other"&&A(G,M)}function V(G,M){y(z=>{const R=z.slice();return R[G]=M,R})}function Q(){S&&o(n.requestId,S)}function $(G){G.key==="Enter"&&(G.target.closest("button")||k&&(G.preventDefault(),Q()))}function I(G){var K;if(!["ArrowDown","ArrowUp","ArrowRight","ArrowLeft"].includes(G.key))return;const M=Array.from(G.currentTarget.querySelectorAll("button.qsheet__option")),z=M.indexOf(document.activeElement);if(z===-1)return;G.preventDefault();const R=G.key==="ArrowDown"||G.key==="ArrowRight"?1:-1;(K=M[(z+R+M.length)%M.length])==null||K.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:$,children:[a.jsxs("div",{className:"qsheet__head",children:[a.jsx("span",{className:"qsheet__head-icon","aria-hidden":"true",children:"?"}),a.jsxs("span",{className:"qsheet__head-text",children:[h.length===1?"Уточняющий вопрос":`Уточняющие вопросы (${h.length})`,l>0&&` — ещё ${l} в очереди`]}),a.jsx(am,{onClick:c})]}),a.jsxs("div",{className:"qsheet__body",children:[n.reason&&a.jsx("p",{className:"qsheet__reason",children:n.reason}),h.map((G,M)=>a.jsx(hk,{q:G,qi:M,selected:m[M]??new Set,otherText:b[M]??"",previewIndex:j[M]??null,onToggle:C,onFocusOption:A,onOtherText:V,onOptionsKeyDown:I},M))]}),a.jsxs("div",{className:"qsheet__actions",children:[a.jsx("button",{className:"btn",onClick:()=>d(n.requestId),children:"Не отвечать"}),a.jsx("button",{className:"btn btn--primary",disabled:!k,onClick:Q,children:"Ответить"})]})]})})}function hk({q:n,qi:l,selected:r,otherText:c,previewIndex:o,onToggle:d,onFocusOption:h,onOtherText:m,onOptionsKeyDown:g}){var S;const b=n.options.some(k=>k.preview),y=o!==null?(S=n.options[o])==null?void 0:S.preview:void 0,j=r.has("other"),v=n.multiSelect?"checkbox":"radio";return a.jsxs("div",{className:"qsheet__question",children:[a.jsxs("div",{className:"qsheet__qhead",children:[a.jsx("span",{className:"chip chip--accent",children:n.header}),a.jsx("span",{className:"qsheet__qtext",children:n.question})]}),a.jsxs("div",{className:"qsheet__options"+(n.multiSelect?"":" qsheet__options--radio"),role:n.multiSelect?"group":"radiogroup","aria-label":n.question,onKeyDown:g,children:[n.options.map((k,A)=>{const C=r.has(A);return a.jsxs("button",{type:"button",role:v,"aria-checked":C,className:"qsheet__option"+(C?" is-selected":""),onClick:()=>d(l,A,n.multiSelect),onFocus:()=>h(l,A),onMouseEnter:()=>h(l,A),children:[a.jsx("span",{className:"qsheet__opt-mark","aria-hidden":"true"}),a.jsxs("span",{className:"qsheet__opt-body",children:[a.jsx("span",{className:"qsheet__opt-label",children:k.label}),a.jsx("span",{className:"qsheet__opt-desc",children:k.description})]})]},A)}),a.jsxs("div",{className:"qsheet__other",children:[a.jsxs("button",{type:"button",role:v,"aria-checked":j,className:"qsheet__option qsheet__option--other"+(j?" is-selected":""),onClick:()=>d(l,"other",n.multiSelect),children:[a.jsx("span",{className:"qsheet__opt-mark","aria-hidden":"true"}),a.jsxs("span",{className:"qsheet__opt-body",children:[a.jsx("span",{className:"qsheet__opt-label",children:"Другое"}),a.jsx("span",{className:"qsheet__opt-desc",children:"Свой вариант ответа"})]})]}),j&&a.jsx("input",{type:"text",className:"qsheet__other-input",placeholder:"Впишите свой вариант…","aria-label":`Свой вариант ответа на вопрос «${n.question}»`,value:c,onChange:k=>m(l,k.target.value),autoFocus:!0})]})]}),b&&a.jsx("pre",{className:"qsheet__preview",children:y??""})]})}function c_(n){return n.map(l=>{const r=l.options.findIndex(c=>c.preview);return r===-1?null:r})}function pk(n,l,r){const c={};for(let o=0;o<n.length;o++){const d=n[o];if(!d)continue;const h=l[o]??new Set,m=[];for(let g=0;g<d.options.length;g++){const b=d.options[g];b&&h.has(g)&&m.push(b.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 mk(n,l){if(n!=="ExitPlanMode"||!l||typeof l!="object")return null;const r=l.plan;return typeof r=="string"?r:null}function Uy({path:n}){const[l,r]=x.useState(!1),[c,o]=x.useState(!1),d=x.useRef(null);x.useEffect(()=>{if(!l)return;function m(g){var b;(b=d.current)!=null&&b.contains(g.target)||r(!1)}return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[l]),x.useEffect(()=>{if(!c)return;const m=setTimeout(()=>o(!1),nm);return()=>clearTimeout(m)},[c]),x.useEffect(()=>r(!1),[n]);async function h(){await Ma(n)&&o(!0)}return a.jsxs("div",{ref:d,className:"cwd",children:[a.jsxs("button",{type:"button",className:"cwd__toggle","aria-expanded":l,title:l?"Свернуть путь":`Полный путь: ${n}`,onClick:()=>r(m=>!m),onKeyDown:m=>{m.key!=="Escape"||!l||(m.preventDefault(),m.stopPropagation(),r(!1))},children:[a.jsx(gk,{open:l}),a.jsx("span",{className:"cwd__short",children:n})]}),l&&a.jsxs("div",{className:"cwd__pop",children:[a.jsx("span",{className:"cwd__full",children:n}),a.jsx("button",{type:"button",className:"btn btn--ghost cwd__copy",onClick:()=>void h(),children:c?io:Zr})]})]})}function gk({open:n}){return a.jsx("svg",{className:n?"cwd__chev cwd__chev--open":"cwd__chev",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M6 3.5 10.5 8 6 12.5"})})}const xk=["low","medium","high"];function Iy({models:n,value:l,effort:r,ultracode:c,thinking:o,switchOnFlag:d,showSwitchOnFlag:h=!0,className:m,onModel:g,onEffort:b,onUltracode:y,onThinking:j,onSwitchOnFlag:v}){const[S,k]=x.useState(!1),[A,C]=x.useState(0),V=x.useRef(null),Q=x.useRef(null),$=n.find(R=>R.value===l)??null,I=$&&$.supportsEffort?$.effortLevels.length>0?$.effortLevels:xk:[],G=I.includes("xhigh");x.useEffect(()=>{if(!S)return;const R=n.findIndex(K=>K.value===l);C(R===-1?0:R)},[S]),x.useEffect(()=>{if(!S)return;function R(K){var ae;(ae=V.current)!=null&&ae.contains(K.target)||k(!1)}return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[S]),x.useEffect(()=>{var R,K;S&&((K=(R=Q.current)==null?void 0:R.querySelector(".is-cursor"))==null||K.scrollIntoView({block:"nearest"}))},[S,A]);function M(R){k(!1),R.value!==l&&g(R.value)}function z(R){if(R.key==="Escape"){if(!S)return;R.preventDefault(),R.stopPropagation(),k(!1);return}if(R.key==="ArrowDown"||R.key==="ArrowUp"){if(R.preventDefault(),!S)return k(!0);if(n.length===0)return;const K=R.key==="ArrowDown"?1:n.length-1;return C(ae=>(ae+K)%n.length)}if(R.key==="Enter"||R.key===" "){if(R.preventDefault(),!S)return k(!0);const K=n[A];K&&M(K)}}return a.jsxs("div",{ref:V,className:"select"+(S?" select--open":"")+(m?` ${m}`:""),children:[a.jsxs("button",{type:"button",className:"select__trigger",title:"Модель, усилие и размышления","aria-label":"Модель, усилие и размышления","aria-haspopup":"menu","aria-expanded":S,onClick:()=>k(R=>!R),onKeyDown:z,children:[($==null?void 0:$.displayName)??l?a.jsx("span",{className:"select__value",children:($==null?void 0:$.displayName)??l}):a.jsx("span",{className:"select__value select__value--muted",children:"по умолчанию"}),c?a.jsx("span",{className:"select__suffix select__suffix--hot",children:"ultracode"}):I.length>0&&r&&a.jsx("span",{className:"select__suffix",children:r}),a.jsx(bk,{})]}),S&&a.jsxs("div",{ref:Q,className:"select__menu modelmenu",role:"menu",children:[a.jsx("div",{className:"modelmenu__head",children:"Модель"}),n.map((R,K)=>a.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":R.value===l,className:"select__option"+(K===A?" is-cursor":"")+(R.value===l?" is-on":""),onMouseEnter:()=>C(K),onClick:()=>M(R),children:[a.jsx("span",{className:"select__check","aria-hidden":"true",children:R.value===l?"✓":""}),a.jsx("span",{className:"select__label",children:R.displayName}),R.description&&a.jsx("span",{className:"select__hint",children:R.description})]},R.value)),I.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:I.map(R=>a.jsx("button",{type:"button",role:"menuitemradio","aria-checked":R===r,className:R===r?"modelmenu__level is-on":"modelmenu__level",onClick:()=>b(R),children:R},R))})]}),G&&a.jsx(bp,{label:"Ultracode",desc:"xhigh и постоянная оркестрация подагентами",on:c,onToggle:()=>y(!c)})]}),a.jsx("div",{className:"modelmenu__sep",role:"separator"}),($==null?void 0:$.supportsThinking)!==!1&&a.jsx(bp,{label:"Размышления",desc:"расширенное обдумывание перед ответом",on:o,onToggle:()=>j(!o)}),h&&a.jsx(bp,{label:"Менять модель по флагу",desc:"иначе помеченный ход встаёт на паузу",on:d,onToggle:()=>v(!d)})]})]})}function bp({label:n,desc:l,on:r,onToggle:c}){return a.jsxs("button",{type:"button",role:"menuitemcheckbox","aria-checked":r,className:"modelmenu__row modelmenu__row--btn",onClick:c,children:[a.jsxs("span",{className:"modelmenu__label",children:[n,a.jsx("span",{className:"modelmenu__desc",children:l})]}),a.jsx("span",{className:r?"switch is-on":"switch","aria-hidden":"true",children:a.jsx("span",{className:"switch__knob"})})]})}function bk(){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 ws({title:n,children:l,actions:r,className:c,sheet:o=!1,onClose:d}){const h=x.useRef(null);return x.useEffect(()=>{function m(g){if(g.key==="Escape"){g.preventDefault(),g.stopPropagation(),d();return}if(g.key!=="Tab")return;const b=h.current;if(!b)return;const y=b.querySelectorAll('button, input, textarea, select, a[href], [tabindex]:not([tabindex="-1"])'),j=y[0],v=y[y.length-1];!j||!v||(g.shiftKey&&document.activeElement===j?(g.preventDefault(),v.focus()):!g.shiftKey&&document.activeElement===v&&(g.preventDefault(),j.focus()))}return document.addEventListener("keydown",m,!0),()=>document.removeEventListener("keydown",m,!0)},[d]),a.jsx("div",{className:o?"modal-backdrop modal-backdrop--sheet":"modal-backdrop",onMouseDown:m=>{m.target===m.currentTarget&&d()},children:a.jsxs("div",{ref:h,className:c?`modal ${c}`:"modal",role:"dialog","aria-modal":"true","aria-label":n,children:[a.jsxs("div",{className:"modal__head",children:[a.jsx("h2",{className:"modal__title",children:n}),a.jsx("button",{className:"modal__close","aria-label":"Закрыть",onClick:d,children:"✕"})]}),a.jsx("div",{className:"modal__body",children:l}),r&&a.jsx("div",{className:"modal__actions",children:r})]})})}function _k({candidates:n,searching:l,agentItems:r,agentBusy:c,error:o,roots:d,folders:h,projectsRoot:m,created:g,onSearch:b,onAskAgent:y,onInterrupt:j,onSubmit:v,onCreate:S,onClose:k}){const[A,C]=x.useState("open"),[V,Q]=x.useState(""),[$,I]=x.useState(!1),[G,M]=x.useState(""),[z,R]=x.useState(""),[K,ae]=x.useState(""),[Y,H]=x.useState({git:!0,claudeMd:!0,readme:!0}),fe=V.trim(),ue=fe!=="",X=G.trim(),D=z.trim(),U=h.find(q=>q.id===K),ce=U!==void 0&&m!==null,be=D!==""&&(ce||K===""&&X!==""),Ne=[{value:"",label:"Без папки",hint:"каталог по указанному пути"},...h.map(q=>({value:q.id,label:q.name}))];x.useEffect(()=>{G===""&&d.length>0&&M(d[0])},[d]);const E=x.useRef(b);E.current=b,x.useEffect(()=>{if(A!=="open")return;const q=V.trim(),we=setTimeout(()=>E.current(q),200);return()=>clearTimeout(we)},[V,A]);function ee(){ue&&v(fe)}function me(){be&&S(ce?m:X,D,Y,ce?U.id:void 0)}function Se(){ue&&(I(!0),y(fe))}return g?a.jsxs(ws,{title:"Новый проект",onClose:k,actions:a.jsx("button",{className:"btn btn--primary",onClick:k,autoFocus:!0,children:"Понятно"}),children:[a.jsx("p",{className:"modal__text",children:"Каталог создан и открыт как проект, но часть шагов не удалась."}),a.jsx("p",{className:"newproj__preview",children:g.path}),a.jsx("div",{className:"modal__error",children:a.jsx("ul",{className:"newproj__warnings",children:g.warnings.map(q=>a.jsx("li",{children:q},q))})}),a.jsx("p",{className:"modal__text modal__text--dim",children:"Проект открыт и работает — недостающее можно добавить руками, в дереве файлов или из терминала."})]}):a.jsxs(ws,{title:"Новый проект",className:$&&A==="open"?"modal--wide":void 0,onClose:k,actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:k,children:"Отмена"}),A==="open"?a.jsxs(a.Fragment,{children:[c?a.jsx("button",{className:"btn",onClick:j,children:"Остановить"}):a.jsx("button",{className:"btn",disabled:!ue,onClick:Se,title:"Найти по описанию",children:"Попросить агента"}),a.jsx("button",{className:"btn btn--primary",disabled:!ue,onClick:ee,children:"Открыть"})]}):a.jsx("button",{className:"btn btn--primary",disabled:!be,onClick:me,children:"Создать"})]}),children:[a.jsxs("div",{className:"tabs",children:[a.jsx(o_,{label:"Открыть",on:A==="open",onClick:()=>C("open")}),a.jsx(o_,{label:"Создать",on:A==="create",onClick:()=>C("create")})]}),A==="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:V,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"C:\\Projects\\my-app",onChange:q=>Q(q.target.value),onKeyDown:q=>{q.key==="Enter"&&(q.preventDefault(),ee())}}),o&&a.jsx("p",{className:"modal__error",children:o}),n.length>0&&a.jsx("ul",{className:"finds",children:n.map(q=>a.jsx("li",{children:a.jsxs("button",{className:"find",disabled:q.open,title:q.open?"Этот проект уже открыт":q.path,onClick:()=>Q(q.path),onDoubleClick:()=>v(q.path),children:[a.jsx("span",{className:"find__name",children:q.name}),a.jsx("span",{className:"find__path",children:q.path}),a.jsx("span",{className:"find__note",children:vk(q)})]})},q.path))}),n.length===0&&ue&&!l&&!$&&a.jsx("p",{className:"modal__text modal__text--dim",children:"Ничего похожего среди каталогов, где вы работали. Если помните не имя, а суть проекта — опишите его и нажмите «Попросить агента». Проекта ещё нет вовсе — рядом вкладка «Создать»."}),$&&a.jsx("div",{className:"finds__agent",children:a.jsx(lm,{items:r,busy:c,waiting:!1,empty:"Агент ищет…"})})]}):a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"modal__text",children:"Пустой каталог для нового проекта. Дальше в нём работает агент — с первого промпта, без отдельной настройки."}),h.length>0&&m!==null&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"field",children:"Папка"}),a.jsx(Ml,{value:K,options:Ne,ariaLabel:"Папка проектов",onChange:ae})]}),ce?a.jsxs("p",{className:"account__step newproj__where",children:["Каталог появится внутри папки «",U.name,"» в корне проектов."]}):a.jsxs(a.Fragment,{children:[a.jsx("label",{className:"field",htmlFor:"workspace-parent",children:"Где создать"}),a.jsx("input",{id:"workspace-parent",className:"input input--mono",value:G,spellCheck:!1,autoComplete:"off",placeholder:"C:\\Projects",onChange:q=>M(q.target.value)}),d.length>0&&a.jsx("div",{className:"newproj__roots",children:d.map(q=>a.jsx("button",{type:"button",className:q===X?"newproj__root is-on":"newproj__root",title:q,onClick:()=>M(q),children:yk(q)},q))})]}),a.jsx("label",{className:"field newproj__field",htmlFor:"workspace-name",children:"Имя проекта"}),a.jsx("input",{id:"workspace-name",className:"input input--mono",value:z,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"my-app",onChange:q=>R(q.target.value),onKeyDown:q=>{q.key==="Enter"&&(q.preventDefault(),me())}}),a.jsx("p",{className:"newproj__preview",children:be?u_(ce?u_(m,U.name):X,D):"Каталог появится здесь"}),o&&a.jsx("p",{className:"modal__error",children:o}),a.jsxs("div",{className:"newproj__opts",children:[a.jsx(_p,{label:"git init",desc:"панель истории работает сразу",on:Y.git,onToggle:()=>H(q=>({...q,git:!q.git}))}),a.jsx(_p,{label:"CLAUDE.md",desc:"заготовка инструкций для агента",on:Y.claudeMd,onToggle:()=>H(q=>({...q,claudeMd:!q.claudeMd}))}),a.jsx(_p,{label:"README.md",desc:"по нему проект потом узнаёт поиск",on:Y.readme,onToggle:()=>H(q=>({...q,readme:!q.readme}))})]})]})]})}function o_({label:n,on:l,onClick:r}){return a.jsx("button",{type:"button",className:l?"tabs__tab is-on":"tabs__tab","aria-pressed":l,onClick:r,children:n})}function _p({label:n,desc:l,on:r,onToggle:c}){return a.jsxs("button",{type:"button",role:"checkbox","aria-checked":r,className:"newproj__opt",onClick:c,children:[a.jsxs("span",{className:"newproj__optlabel",children:[n,a.jsx("span",{className:"newproj__optdesc",children:l})]}),a.jsx("span",{className:r?"switch is-on":"switch","aria-hidden":"true",children:a.jsx("span",{className:"switch__knob"})})]})}function u_(n,l){const r=n.includes("\\")?"\\":"/";return n.replace(/[\\/]+$/,"")+r+l}function yk(n){const l=n.includes("\\")?"\\":"/",r=n.split(/[\\/]/).filter(Boolean);return r.length<=2?n:`…${l}${r.slice(-2).join(l)}`}function vk(n){return n.open?"уже открыт":n.why?n.why:n.sessions===0?"рядом с вашими проектами":`${jk(n.sessions)}${Nk(n.lastUsedAt)}`}function jk(n){const l=n%10,r=n%100;return r>=11&&r<=14?`${n} сессий`:l===1?`${n} сессия`:l>=2&&l<=4?`${n} сессии`:`${n} сессий`}function Nk(n){if(!n)return"";const l=Math.floor((Date.now()-n)/864e5);return l<=0?" · сегодня":l===1?" · вчера":l<30?` · ${l} дн. назад`:` · ${new Date(n).toLocaleDateString("ru-RU")}`}const im=7;function wk(n){const l=[],r=[];let c=1;for(const o of n){const d=l.slice();let h=l.indexOf(o.hash);h===-1&&(h=d_(l),l[h]=o.hash);const[m,...g]=o.parents;l[h]=m??null;const b=[];m!==void 0&&b.push({from:h,to:h});for(const v of g){let S=l.indexOf(v);S===-1&&(S=d_(l),l[S]=v),b.push({from:h,to:S})}const y=[];for(let v=0;v<d.length;v++)d[v]===o.hash&&(y.push({from:v,to:h}),v!==h&&(l[v]=null));const j=[];for(let v=0;v<d.length;v++){const S=d[v];!S||S===o.hash||v===h||l[v]===S&&j.push(v)}kk(l),c=Math.max(c,l.length,h+1),r.push({commit:o,col:h,up:y,down:b,through:j})}return{rows:r,columns:Math.min(c,im)}}function d_(n){const l=n.indexOf(null);return l!==-1?l:(n.push(null),n.length-1)}function kk(n){for(;n.length>0&&n[n.length-1]===null;)n.pop()}const By=1500;function Sk(n){const l=[];let r=!1;for(const c of n.patch.split(`
|
|
120
|
-
`)){if(l.length>=By){r=!0;break}if(c.startsWith("@@"))l.push({type:"gap",text:Ek(c)});else if(c.startsWith("+"))l.push({type:"add",text:c.slice(1)});else if(c.startsWith("-"))l.push({type:"del",text:c.slice(1)});else{if(c.startsWith("\\"))continue;(c!==""||l.length>0)&&l.push({type:"ctx",text:c.startsWith(" ")?c.slice(1):c})}}return{kind:"patch",filePath:n.path||n.oldPath,rows:l,added:n.added,removed:n.removed,note:Tk(n,r)}}function Ek(n){const l=/^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@ ?(.*)$/.exec(n);if(!l)return n;const r=Number(l[1]),c=l[2]===void 0?1:Number(l[2]),o=(l[3]??"").trim(),d=c>1?`строки ${r}–${r+c-1}`:`строка ${r}`;return o?`⋯ ${d} · ${o}`:`⋯ ${d}`}function Tk(n,l){const r=[];return n.status==="added"&&r.push("новый файл"),n.status==="deleted"&&r.push("файл удалён"),n.status==="renamed"&&r.push(`переименован из ${n.oldPath}`),n.binary?r.push("двоичный файл"):n.patch===""&&r.push("содержимое не показано"),l&&r.push(`показаны первые ${By} строк`),r.length>0?r.join(" · "):null}function Ck({open:n,state:l,result:r,selected:c,busy:o,onRefresh:d,onShow:h,onCheckout:m,onPush:g,onPull:b,onPublish:y,onConnectRemote:j,onDismissResult:v,onClose:S,zoomed:k,onToggleZoom:A}){const C=wk((l==null?void 0:l.commits)??[]),V=[...l!=null&&l.detached?[{value:"",label:`отделён · ${l.head.slice(0,8)}`}]:[],...((l==null?void 0:l.branches)??[]).map(Q=>({value:Q.name,label:Q.name,hint:Q.hash.slice(0,8)}))];return a.jsxs("aside",{className:(n?"sidepane sidepane--git sidepane--open":"sidepane sidepane--git")+(k?" sidepane--zoomed":""),"aria-label":"История git",children:[a.jsxs("div",{className:"sidepane__head",onDoubleClick:Q=>{A&&(Q.target.closest("button")||A())},children:[a.jsx(Lk,{}),a.jsx("span",{className:"sidepane__title",children:"История"}),a.jsx("button",{className:"sidepane__btn",title:"Обновить","aria-label":"Обновить историю",onClick:d,children:"↻"}),A&&a.jsx("button",{className:"sidepane__btn",title:k?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":k?"Свернуть панель истории":"Развернуть панель истории на весь экран","aria-pressed":k,onClick:A,children:a.jsx(_o,{active:k})}),a.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель истории",onClick:S,children:"✕"})]}),l===null?a.jsx("p",{className:"sidepane__empty",children:"Читаем репозиторий…"}):l.available?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"gitbar",children:[a.jsx(Ml,{className:"gitbar__branch",title:"Ветка — выбрать значит переключиться",value:l.detached?"":l.branch,options:V,onChange:Q=>{Q&&m(Q,`ветку ${Q}`)}}),a.jsx(xo,{text:l.detached?l.head:l.branch,hint:l.detached?"хеш HEAD":"имя ветки"})]}),l.detached&&a.jsx("p",{className:"gitbar__note",children:"HEAD отделён от ветки. Выберите ветку в списке, чтобы вернуться."}),a.jsx("div",{className:"gitbar__actions",children:o?a.jsxs("p",{className:"gitbar__busy",children:[a.jsx(Bk,{}),o]}):l.hasRemote?a.jsxs(a.Fragment,{children:[a.jsxs("button",{type:"button",className:"btn btn--sm",title:"Отправить текущую ветку в origin",onClick:g,children:[a.jsx(zk,{}),"Отправить",l.ahead>0&&a.jsx("span",{className:"gitbar__count",children:l.ahead})]}),a.jsxs("div",{className:"gitbar__group",children:[a.jsxs("button",{type:"button",className:"btn btn--sm",title:"Забрать с origin и перемотать вперёд (git pull --ff-only)",onClick:()=>b(!0),children:[a.jsx(Uk,{}),"Забрать",l.behind>0&&a.jsx("span",{className:"gitbar__count",children:l.behind})]}),a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost gitbar__check",title:"Только проверить — git fetch, рабочее дерево не меняется","aria-label":"Проверить, что нового на origin, без изменений на диске",onClick:()=>b(!1),children:a.jsx(Ik,{})})]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("button",{type:"button",className:"btn btn--sm btn--primary",title:"Создать репозиторий на GitHub и отправить в него ветку",onClick:y,children:[a.jsx(h_,{}),"Опубликовать на GitHub"]}),a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",title:"Прописать origin на уже существующий репозиторий",onClick:j,children:"уже есть репозиторий"})]})}),a.jsxs("div",{className:"sidepane__scroll",children:[a.jsx("button",{className:"gitrow gitrow--work"+(c===""?" is-on":""),onClick:()=>h(""),children:a.jsxs("span",{className:"gitrow__body",children:[a.jsx("span",{className:"gitrow__subject",children:l.changed.length>0?`Рабочее дерево · ${l.changed.length} ${Gk(l.changed.length)}`:"Рабочее дерево чистое"}),a.jsx("span",{className:"gitrow__meta",children:l.changed.length>0?l.changed.slice(0,4).map(Q=>qk(Q.path)).join(", "):"незакоммиченных изменений нет"})]})}),C.rows.map(Q=>a.jsx(Mk,{row:Q,columns:C.columns,head:Q.commit.hash===l.head,local:l.hasRemote&&!Q.commit.pushed,active:c===Q.commit.hash,onOpen:()=>h(Q.commit.hash)},Q.commit.hash)),C.rows.length===0&&a.jsx("p",{className:"sidepane__empty",children:"В репозитории ещё нет коммитов"})]})]}):a.jsxs("div",{className:"gitempty",children:[a.jsx("p",{className:"gitempty__text",children:l.message||"Это не git-репозиторий"}),l.noRepo&&a.jsxs(a.Fragment,{children:[a.jsxs("button",{type:"button",className:"btn btn--sm btn--primary gitempty__btn",onClick:y,children:[a.jsx(h_,{}),"Опубликовать на GitHub"]}),a.jsx("p",{className:"gitempty__hint",children:"Заведёт репозиторий, сделает первый коммит и отправит его на GitHub."})]})]}),a.jsx(Wr,{result:r,onDismiss:v})]})}const xu=50,f_=13,Ak=500;function Mk({row:n,columns:l,head:r,local:c,active:o,onOpen:d}){const{commit:h}=n,m=h.refs.map(Hk).filter(Boolean),[g,b]=x.useState(null),y=x.useRef(null);function j(A){const C=A.touches[0];if(!C)return;const V={timer:0,x:C.clientX,y:C.clientY,fired:!1};V.timer=window.setTimeout(()=>{V.fired=!0,b({x:V.x,y:V.y})},Ak),y.current=V}function v(A){const C=y.current,V=A.touches[0];!C||!V||Math.hypot(V.clientX-C.x,V.clientY-C.y)>10&&(window.clearTimeout(C.timer),y.current=null)}function S(A){const C=y.current;C&&(window.clearTimeout(C.timer),C.fired&&A.preventDefault())}function k(){const A=[{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)}],C=new Set;for(const V of h.refs){const Q=V.startsWith("tag: "),$=$k(V);!$||C.has($)||(C.add($),A.push({id:`ref:${$}`,label:Q?"Копировать тег":"Копировать ветку",hint:$,onSelect:()=>void Ma($)}))}return A}return a.jsxs(a.Fragment,{children:[a.jsxs("button",{className:"gitrow"+(o?" is-on":""),title:c?"Коммит ещё не отправлен на удалённый репозиторий":void 0,onClick:()=>{var A;if((A=y.current)!=null&&A.fired){y.current=null;return}d()},onContextMenu:A=>{A.preventDefault(),b({x:A.clientX,y:A.clientY})},onTouchStart:j,onTouchMove:v,onTouchEnd:S,onTouchCancel:S,children:[a.jsx(Rk,{row:n,columns:l,head:r,local:c}),a.jsxs("span",{className:"gitrow__body",children:[a.jsxs("span",{className:"gitrow__subject",children:[m.map(A=>a.jsx("span",{className:"gitrow__ref",children:A},A)),h.subject]}),a.jsxs("span",{className:"gitrow__meta",children:[h.shortHash," · ",h.author," · ",Yk(h.date),c&&a.jsx("span",{className:"gitrow__local",children:"· не отправлен"})]})]})]}),g&&a.jsx(pi,{x:g.x,y:g.y,items:k(),onClose:()=>b(null)})]})}function Rk({row:n,columns:l,head:r,local:c}){const o=l*f_+6,d=xu/2,h=b=>8+Math.min(b,im-1)*f_,m=c?"3.5 2.5":void 0,g=Zd(n.col);return a.jsxs("svg",{className:"gitgraph",width:o,height:xu,viewBox:`0 0 ${o} ${xu}`,"aria-hidden":"true",children:[n.through.map(b=>a.jsx("line",{x1:h(b),y1:0,x2:h(b),y2:xu,style:{stroke:Zd(b)}},`t${b}`)),n.up.map((b,y)=>a.jsx("path",{d:`M${h(b.from)} 0 L${h(b.from)} ${d-12} L${h(b.to)} ${d}`,fill:"none",style:{stroke:Zd(b.from),strokeDasharray:m}},`u${y}`)),n.down.map((b,y)=>a.jsx("path",{d:`M${h(b.from)} ${d} L${h(b.to)} ${d+12} L${h(b.to)} ${xu}`,fill:"none",style:{stroke:Zd(b.to),strokeDasharray:m}},`d${y}`)),r&&a.jsx("circle",{className:"gitgraph__head",cx:h(n.col),cy:d,r:n.commit.parents.length>1?7.4:6.6}),a.jsx("circle",{className:"gitgraph__dot",cx:h(n.col),cy:d,r:n.commit.parents.length>1?4.6:3.6,style:{stroke:g,fill:c?void 0:g}})]})}function Zd(n){return`var(--lane-${n%im})`}function Dk({detail:n,local:l,onCheckout:r,onClose:c}){const o=n.hash==="";return a.jsxs(ws,{className:"modal--wide",title:o?"Незакоммиченные изменения":`Коммит ${n.shortHash}`,onClose:c,actions:a.jsxs(a.Fragment,{children:[!o&&a.jsx("button",{className:"btn",onClick:()=>r(n.hash,`коммит ${n.shortHash} (HEAD отделится от ветки)`),children:"Переключиться сюда"}),a.jsx("button",{className:"btn btn--primary",onClick:c,children:"Закрыть"})]}),children:[!o&&a.jsxs("div",{className:"commit__head",children:[a.jsxs("div",{className:"commit__line",children:[a.jsx("p",{className:"commit__subject",children:n.subject}),a.jsx(xo,{text:n.subject,hint:"сообщение коммита"})]}),a.jsxs("p",{className:"commit__meta",children:[n.author,n.email&&` <${n.email}>`," · ",Xk(n.date)]}),a.jsxs("div",{className:"commit__line commit__line--hash",children:[a.jsx("span",{className:"commit__hash",children:n.hash}),a.jsx(xo,{text:n.hash,hint:"хеш коммита"})]}),l&&a.jsx("p",{className:"commit__meta commit__meta--local",children:"Не отправлен: этого коммита нет ни в одной удалённой ветке."}),n.parents.length>0&&a.jsxs("p",{className:"commit__meta",children:[n.parents.length>1?"слияние: ":"родитель: ",n.parents.map(d=>d.slice(0,8)).join(", ")]}),n.body&&a.jsx("pre",{className:"commit__body",children:n.body})]}),n.truncated&&a.jsx("p",{className:"modal__text",children:"Изменения слишком велики — часть патча не показана."}),n.files.length===0?a.jsx("p",{className:"modal__text",children:"Изменений нет."}):n.files.map(d=>a.jsx(Ok,{file:d,defaultOpen:n.files.length<=3},d.path+d.oldPath))]})}function Ok({file:n,defaultOpen:l}){const[r,c]=x.useState(l);return a.jsxs("div",{className:"commit__file",children:[a.jsxs("button",{className:"commit__filehead",onClick:()=>c(o=>!o),children:[a.jsx("span",{className:"commit__filepath",children:n.path||n.oldPath}),a.jsxs("span",{className:"diff__stat",children:[n.added>0&&a.jsxs("span",{className:"diff__stat--add",children:["+",n.added]}),n.removed>0&&a.jsxs("span",{className:"diff__stat--del",children:["−",n.removed]})]}),a.jsx("span",{className:"tool__status",children:r?"▴":"▾"})]}),r&&a.jsx(sm,{diff:Sk(n)})]})}function Lk(){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 zk(){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 Uk(){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 Ik(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("circle",{cx:"7",cy:"7",r:"4"}),a.jsx("path",{d:"m13 13-2.6-2.6"})]})}function h_(){return a.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:a.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8Z"})})}function Bk(){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 Hk(n){return n.replace(/^HEAD -> /,"").replace(/^tag: /,"⌂ ").trim()}function $k(n){const l=n.replace(/^HEAD -> /,"").replace(/^tag: /,"").trim();return l==="HEAD"?"":l}function qk(n){const l=n.split("/");return l[l.length-1]??n}function Gk(n){const l=n%100;if(l>=11&&l<=14)return"файлов";switch(n%10){case 1:return"файл";case 2:case 3:case 4:return"файла";default:return"файлов"}}function Yk(n){const l=Date.parse(n);if(Number.isNaN(l))return n;const r=Math.round((Date.now()-l)/6e4);if(r<1)return"только что";if(r<60)return`${r} мин назад`;const c=Math.round(r/60);if(c<24)return`${c} ч назад`;const o=Math.round(c/24);return o<30?`${o} дн назад`:new Date(l).toLocaleDateString()}function Xk(n){const l=Date.parse(n);return Number.isNaN(l)?n:new Date(l).toLocaleString()}function p_(n){return n.replace(/[^A-Za-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")}function Vk({status:n,owners:l,files:r,defaultName:c,hasCommits:o,busy:d,result:h,onRefreshStatus:m,onSaveToken:g,onPublish:b,onDismissResult:y,onClose:j}){var ce;const[v,S]=x.useState(()=>p_(c)),[k,A]=x.useState(""),[C,V]=x.useState(""),[Q,$]=x.useState(!0),[I,G]=x.useState("Первый коммит"),[M,z]=x.useState(null),[R,K]=x.useState("");x.useEffect(()=>{!k&&l.length>0&&A(l[0].login)},[k,l]),x.useEffect(()=>{r&&M===null&&z(new Set(r.files))},[r,M]);const ae=(n==null?void 0:n.connected)===!0,Y=l.map(be=>({value:be.login,label:be.login,hint:be.kind==="org"?"организация":void 0})),H=x.useMemo(()=>{if(!r)return[];const be=R.trim().toLowerCase();return be?r.files.filter(Ne=>Ne.toLowerCase().includes(be)):r.files},[r,R]),fe=(M==null?void 0:M.size)??0,ue=ae&&v.trim()!==""&&k!==""&&d===""&&(o||fe>0);function X(be){z(Ne=>{const E=new Set(Ne??[]);return E.has(be)?E.delete(be):E.add(be),E})}function D(be){z(Ne=>{const E=new Set(Ne??[]);for(const ee of H)be?E.add(ee):E.delete(ee);return E})}function U(){if(!ue)return;const be=(r==null?void 0:r.files)??[];b({owner:k,name:v.trim(),description:C.trim(),private:Q,include:o?[]:be.filter(Ne=>M==null?void 0:M.has(Ne)),ignore:o?[]:be.filter(Ne=>!(M!=null&&M.has(Ne))),message:o?"":I.trim()||"Первый коммит"})}return a.jsxs(ws,{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:!ue,onClick:U,children:d||"Опубликовать"})]}),children:[a.jsx(Qk,{status:n,onRefreshStatus:m,onSaveToken:g}),a.jsxs("div",{className:"publish__section",children:[a.jsx("h3",{className:"publish__heading",children:"Репозиторий"}),a.jsxs("label",{className:"field publish__field",children:[a.jsx("span",{children:"Имя"}),a.jsx("input",{className:"input input--mono",value:v,spellCheck:!1,autoComplete:"off",onChange:be=>S(p_(be.target.value))})]}),v.trim()===""&&a.jsx("p",{className:"modal__error",children:"Имя репозитория не может быть пустым."}),a.jsxs("label",{className:"field publish__field",children:[a.jsx("span",{children:"Владелец"}),l.length>1?a.jsx(Ml,{className:"settings__select",value:k,options:Y,onChange:A,placeholder:"выберите владельца",ariaLabel:"Владелец репозитория"}):a.jsx("p",{className:"publish__static",children:((ce=l[0])==null?void 0:ce.login)??"—"})]}),a.jsxs("label",{className:"field publish__field",children:[a.jsx("span",{children:"Описание (необязательно)"}),a.jsx("input",{className:"input",value:C,placeholder:"о чём проект — одной строкой",onChange:be=>V(be.target.value)})]}),a.jsxs("div",{className:"field publish__field",children:[a.jsx("span",{children:"Видимость"}),a.jsxs("div",{className:"access",role:"radiogroup","aria-label":"Видимость репозитория",children:[a.jsx(m_,{title:"Приватный",desc:"Виден только вам и тем, кого вы пригласите. Стоит по умолчанию: репозиторий с чужим кодом, случайно ставший публичным, потом не отозвать.",on:Q,onClick:()=>$(!0)}),a.jsx(m_,{title:"Публичный",desc:"Виден всем в интернете — код, история коммитов, всё содержимое.",risky:!0,on:!Q,onClick:()=>$(!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:[fe," из ",r.files.length," файлов"]}),a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>D(!0),children:"Отметить все"}),a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>D(!1),children:"Снять все"})]}),r.files.length>8&&a.jsx("input",{className:"input publish__filter",value:R,placeholder:"Фильтр по пути…",spellCheck:!1,onChange:be=>K(be.target.value)}),a.jsx("div",{className:"publish__filelist",children:H.length===0?a.jsx("p",{className:"modal__text publish__filesempty",children:"Ничего не найдено по фильтру."}):H.map(be=>a.jsxs("button",{type:"button",role:"checkbox","aria-checked":(M==null?void 0:M.has(be))===!0,className:"publish__file",onClick:()=>X(be),children:[a.jsx("span",{className:"publish__box"+(M!=null&&M.has(be)?" is-on":""),"aria-hidden":"true",children:(M==null?void 0:M.has(be))&&"✓"}),a.jsx("span",{className:"publish__filepath",children:be})]},be))}),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:I,onChange:be=>G(be.target.value)})]})]})]}),a.jsx(Wr,{result:h,onDismiss:y})]})}function m_({title:n,desc:l,on:r,risky:c,onClick:o}){return a.jsxs("button",{type:"button",role:"radio","aria-checked":r,className:"access__card"+(r?" is-on":"")+(c?" access__card--risky":""),onClick:o,children:[a.jsx("span",{className:"access__radio","aria-hidden":"true"}),a.jsxs("span",{className:"access__body",children:[a.jsxs("span",{className:"access__title",children:[n,c&&a.jsx("span",{className:"access__risk",children:"видно всем"})]}),a.jsx("span",{className:"access__desc",children:l})]})]})}function Qk({status:n,onRefreshStatus:l,onSaveToken:r}){const[c,o]=x.useState(""),[d,h]=x.useState(!1);return a.jsxs("div",{className:"publish__section publish__section--first",children:[a.jsx("h3",{className:"publish__heading",children:"Учётная запись GitHub"}),n===null?a.jsx("p",{className:"modal__text",children:"Проверяем подключение…"}):n.connected?a.jsxs("div",{className:"publish__account",children:[a.jsx("span",{className:"chip chip--ok",children:n.login}),a.jsx("span",{className:"publish__accountvia",children:n.source==="gh"?"через GitHub CLI":"по личному токену"}),n.source==="token"&&a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>r(""),children:"Отключить токен"})]}):a.jsxs("div",{className:"publish__connect",children:[n.ghInstalled&&a.jsxs("p",{className:"modal__text",children:["В системе установлен ",a.jsx("code",{children:"gh"}),", но вход в нём не выполнен. Можно вместо токена выполнить ",a.jsx("code",{children:"gh auth login"})," в панели терминала и нажать «Проверить снова» — либо ввести личный токен ниже."]}),a.jsxs("label",{className:"field publish__field",children:[a.jsx("span",{children:"Личный токен GitHub"}),a.jsx(Kk,{value:c,onChange:o,visible:d,onToggleVisible:()=>h(m=>!m),placeholder:"ghp_…"})]}),a.jsxs("p",{className:"publish__tokenhint",children:["Нужен токен с доступом ",a.jsx("code",{children:"repo"})," — им приложение создаст репозиторий и отправит в него код."," ",a.jsx("a",{href:"https://github.com/settings/tokens/new?scopes=repo&description=Claude%20Code%20Visual",target:"_blank",rel:"noreferrer",children:"Создать токен на GitHub ↗"})]}),n.message&&a.jsx("p",{className:"modal__error",children:n.message}),a.jsxs("div",{className:"extbar",children:[a.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:l,children:"Проверить снова"}),a.jsx("button",{type:"button",className:"btn btn--sm btn--primary",disabled:c.trim()==="",onClick:()=>r(c.trim()),children:"Сохранить токен"})]})]})]})}function Kk({value:n,onChange:l,visible:r,onToggleVisible:c,placeholder:o,autoFocus:d}){return a.jsxs("div",{className:"pwfield",children:[a.jsx("input",{className:"input input--mono pwfield__input",type:r?"text":"password",value:n,placeholder:o,spellCheck:!1,autoComplete:"off",autoFocus:d,onChange:h=>l(h.target.value)}),a.jsx("button",{type:"button",className:"pwfield__toggle","aria-label":r?"Скрыть токен":"Показать токен","aria-pressed":r,onClick:c,children:r?a.jsx(Zk,{}):a.jsx(Fk,{})})]})}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"})]})}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:"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 Jk({busy:n,result:l,onSubmit:r,onDismissResult:c,onClose:o}){const[d,h]=x.useState(""),m=/^(https?|ssh|git):\/\/\S+/i.test(d.trim())||/^[\w.-]+@[\w.-]+:.+/.test(d.trim());return a.jsxs(ws,{title:"Подключить существующий репозиторий",onClose:o,actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:"btn",onClick:o,children:"Отмена"}),a.jsx("button",{type:"button",className:"btn btn--primary",disabled:!m||n!=="",onClick:()=>r(d.trim()),children:n||"Подключить"})]}),children:[a.jsxs("p",{className:"modal__text",children:["Пропишет этот адрес как ",a.jsx("code",{children:"origin"})," текущего репозитория. Ничего не отправляется само — после этого в панели появятся обычные «Отправить» и «Забрать»."]}),a.jsxs("label",{className:"field",children:[a.jsx("span",{children:"Адрес репозитория"}),a.jsx("input",{className:"input input--mono",value:d,placeholder:"https://github.com/owner/name.git",spellCheck:!1,autoComplete:"off",autoFocus:!0,onChange:g=>h(g.target.value),onKeyDown:g=>{g.key==="Enter"&&m&&n===""&&r(d.trim())}})]}),a.jsxs("p",{className:"modal__text modal__text--dim",children:["Подходят адреса вида ",a.jsx("code",{children:"https://…"}),", ",a.jsx("code",{children:"ssh://…"}),", ",a.jsx("code",{children:"git://…"})," и"," ",a.jsx("code",{children:"git@host:path"}),"."]}),a.jsx(Wr,{result:l,onDismiss:c})]})}function Pk({open:n,items:l,busy:r,ready:c,sendBlocked:o,commands:d,contextResult:h,draftKey:m,models:g,model:b,effort:y,ultracode:j,thinking:v,switchOnFlag:S,onContextSearch:k,onCommand:A,onModel:C,onEffort:V,onUltracode:Q,onThinking:$,onSwitchOnFlag:I,onAsk:G,onInterrupt:M,onReset:z,onClose:R,zoomed:K,onToggleZoom:ae}){return a.jsxs("aside",{className:(n?"sidepane sidepane--ask sidepane--open":"sidepane sidepane--ask")+(K?" sidepane--zoomed":""),"aria-label":"Вопрос на полях",children:[a.jsxs("div",{className:"sidepane__head",onDoubleClick:Y=>{ae&&(Y.target.closest("button")||ae())},children:[a.jsx(Wk,{}),a.jsx("span",{className:"sidepane__title",children:"Вопрос на полях"}),a.jsx("button",{className:"sidepane__btn",title:"Начать заново — следующий вопрос возьмёт свежий контекст","aria-label":"Начать боковой разговор заново",disabled:l.length===0,onClick:z,children:"↻"}),ae&&a.jsx("button",{className:"sidepane__btn",title:K?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":K?"Свернуть панель вопроса":"Развернуть панель вопроса на весь экран","aria-pressed":K,onClick:ae,children:a.jsx(_o,{active:K})}),a.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель вопроса",onClick:R,children:"✕"})]}),g.length>0&&a.jsxs("div",{className:"sidepane__tools",children:[a.jsx(Iy,{className:"select--compact",models:g,value:b,effort:y,ultracode:j,thinking:v,switchOnFlag:S,onModel:C,onEffort:V,onUltracode:Q,onThinking:$,onSwitchOnFlag:I}),a.jsx("span",{className:"sidepane__note",title:"Боковой вопрос работает только на чтение",children:"только чтение"})]}),a.jsx(lm,{items:l,busy:r,waiting:!1,empty:c?"Спросите о том, что происходит: вопрос уйдёт в сторону от основного разговора и не попадёт в его контекст. Отвечающий видит сессию и проект, но ничего не меняет.":"Откройте сессию — вопрос задаётся о ней."}),a.jsx(Oy,{className:"composer--side",disabled:!c,busy:r,commands:d,sessionTitle:null,contextResult:h,draftKey:m?`side:${m}`:null,placeholder:"Спросить, не мешая работе…",sendLabel:"Спросить",autoFocus:n,attachmentsEnabled:!1,sendBlocked:o,onContextSearch:k,onCommand:A,onSend:G,onInterrupt:M,onEscape:r?M:R})]})}function Wk(){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 eS=75,tS=90;function rm({usage:n,variant:l="topbar"}){if(!(n!=null&&n.available))return null;const r=n.buckets??[],c=r.length>0?r.map(d=>({key:d.id,label:d.label,window:d.window})):[...n.fiveHour?[{key:"five",label:"5 ч",window:n.fiveHour}]:[],...n.sevenDay?[{key:"week",label:"нед",window:n.sevenDay}]:[]];if(c.length===0)return null;const o=r.length>0?"Квота Antigravity":`Расход лимитов плана${n.plan?` ${n.plan}`:""}`;return a.jsx("div",{className:l==="card"?"usage usage--card":"usage",title:lS(n,r),role:"group","aria-label":o,children:c.map(d=>a.jsx(nS,{label:d.label,window:d.window},d.key))})}function nS({label:n,window:l}){const r=Math.round(l.utilization),c=iS(l.resetsAt);return a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"usage__label",children:n}),a.jsx("span",{className:"usage__track",role:"progressbar","aria-label":n,"aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,children:a.jsx("span",{className:`usage__fill${sS(r)}`,style:{width:`${r}%`}})}),a.jsxs("span",{className:"usage__pct",children:[r,"%"]}),a.jsx("span",{className:"usage__reset",title:cm(l.resetsAt)||void 0,children:c&&`↻ ${c}`})]})}function sS(n){return n>=tS?" usage__fill--over":n>=eS?" usage__fill--warn":""}function lS(n,l){if(l.length>0)return aS(l);const r=[n.plan?`Лимиты плана ${n.plan}`:"Лимиты плана"],c=(o,d)=>{if(!d)return;const h=cm(d.resetsAt);r.push(`${o}: ${Math.round(d.utilization)}%${h?`, ${h}`:""}`)};return c("5 часов",n.fiveHour),c("Неделя",n.sevenDay),c("Неделя, Opus",n.sevenDayOpus),r.join(`
|
|
121
|
-
`)}function aS(n){const l=["Квота Antigravity"];for(const r of n){const c=cm(r.window.resetsAt),o=Math.round(r.window.utilization);l.push(`${r.title}: ${o}%${c?`, ${c}`:""}`),r.description&&l.push(r.description)}return l.join(`
|
|
122
|
-
`)}function Hy(n){if(!n)return null;const l=new Date(n);return Number.isNaN(l.getTime())?null:l}function $y(n){return n.getTime()-Date.now()<1440*60*1e3}function iS(n){const l=Hy(n);return l?$y(l)?l.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):l.toLocaleDateString(void 0,{day:"numeric",month:"short"}):""}function cm(n){const l=Hy(n);return l?`обнулится ${$y(l)?`в ${l.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:l.toLocaleDateString(void 0,{day:"numeric",month:"long"})}`:""}function qy(){const[n,l]=x.useState(()=>new Date);return x.useEffect(()=>{let r=0;const c=()=>{const d=new Date;l(d),r=window.setTimeout(c,6e4-(d.getSeconds()*1e3+d.getMilliseconds()))};c();const o=()=>{document.hidden||(window.clearTimeout(r),c())};return document.addEventListener("visibilitychange",o),()=>{window.clearTimeout(r),document.removeEventListener("visibilitychange",o)}},[]),a.jsxs("time",{className:"clock",dateTime:n.toISOString(),title:rS(n),children:[a.jsx("span",{className:"clock__time",children:n.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}),a.jsx("span",{className:"clock__date",children:n.toLocaleDateString(void 0,{weekday:"short",day:"numeric",month:"short"})})]})}function rS(n){return n.toLocaleDateString(void 0,{weekday:"long",day:"numeric",month:"long",year:"numeric"})}function cS({onClose:n,permission:l,model:r,account:c,usage:o,cwd:d,costLabel:h,onRefresh:m,refreshing:g,metersFetchedAt:b,onRename:y,onHandoff:j,onFreshSession:v,handoffWriting:S,handoffAccount:k,onStop:A}){const C=J_({onLongPress:()=>v==null?void 0:v(),onClick:()=>j==null?void 0:j(),disabled:S});return a.jsx(ws,{title:"Настройки сессии",className:"modal--sheet",sheet:!0,onClose:n,children:a.jsxs("div",{className:"sessionmenu",children:[l&&a.jsx(Br,{label:"Режим прав",children:l}),a.jsx(Br,{label:"Модель",children:r}),c&&a.jsx(Br,{label:"Аккаунт",children:c}),(o==null?void 0:o.available)&&(o.fiveHour||o.sevenDay||o.buckets&&o.buckets.length>0)&&a.jsx(Br,{label:"Лимиты плана",children:a.jsx(rm,{usage:o})}),a.jsxs("button",{type:"button",className:g?"sessionmenu__refresh is-busy":"sessionmenu__refresh","aria-busy":g,disabled:g,onClick:m,children:[a.jsx(oS,{}),a.jsxs("span",{className:"sessionmenu__refresh-text",children:["Обновить показания",b&&a.jsxs("span",{className:"sessionmenu__refresh-time",children:["обновлено в"," ",new Date(b).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})]})]})]}),a.jsx(Br,{label:"Время",children:a.jsx(qy,{})}),h&&a.jsx(Br,{label:"Стоимость хода",children:a.jsx("span",{className:"badge badge--cost",children:h})}),d&&a.jsx(Br,{label:"Каталог проекта",children:a.jsx(Uy,{path:d})}),y&&a.jsx("button",{type:"button",className:"sessionmenu__rename",onClick:y,children:"Переименовать сессию"}),j&&a.jsxs("button",{type:"button",className:S?"sessionmenu__handoff is-busy":C.holding?"sessionmenu__handoff is-holding":"sessionmenu__handoff",style:{"--hold-ms":`${C.thresholdMs}ms`},"aria-busy":S,disabled:S,...C.handlers,children:[a.jsx("span",{className:"sessionmenu__handoff-hold","aria-hidden":"true"}),a.jsxs("span",{className:"sessionmenu__handoff-text",children:[S?"Пишется хэндофф…":"Хэндофф и новая сессия",!S&&a.jsx("span",{className:"sessionmenu__handoff-hint",children:"Зажмите — новая сессия без хэндоффа"})]})]}),j&&k,A&&a.jsx("button",{type:"button",className:"sessionmenu__stop",onClick:A,children:"Остановить сессию"})]})})}function Br({label:n,children:l}){return a.jsxs("div",{className:"sessionmenu__row",children:[a.jsx("span",{className:"sessionmenu__label",children:n}),l]})}function oS(){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 uS({tab:n,servers:l,plugins:r,marketplaces:c,catalog:o,result:d,auth:h,remote:m,actions:g,onTab:b,onClose:y}){const j=[{id:"mcp",label:"MCP-серверы",count:l.length},{id:"plugins",label:"Плагины",count:r.length},{id:"catalog",label:"Каталог",count:o.length}];return a.jsxs(ws,{title:"Расширения",className:"modal--wide",onClose:y,children:[a.jsx("div",{className:"tabs",role:"tablist",children:j.map(v=>a.jsxs("button",{role:"tab","aria-selected":n===v.id,className:n===v.id?"tabs__tab is-on":"tabs__tab",onClick:()=>b(v.id),children:[v.label,a.jsx("span",{className:"tabs__count",children:v.count})]},v.id))}),n==="mcp"&&a.jsx(dS,{servers:l,auth:h,remote:m,actions:g}),n==="plugins"&&a.jsx(xS,{plugins:r,marketplaces:c,actions:g}),n==="catalog"&&a.jsx(bS,{catalog:o,hasMarketplaces:c.length>0,actions:g,onMarketplaces:()=>b("plugins")}),a.jsx(Wr,{result:d})]})}function dS({servers:n,auth:l,remote:r,actions:c}){const[o,d]=x.useState(!1);return a.jsxs(a.Fragment,{children:[n.length===0&&!o&&a.jsxs("p",{className:"modal__text",children:["Ни одного MCP-сервера. Добавленный здесь попадёт в ",a.jsx("code",{children:".mcp.json"})," ","проекта — его увидит и консольный ",a.jsx("code",{children:"claude mcp list"}),"."]}),a.jsx("ul",{className:"extlist",children:n.map(h=>{const m=(l==null?void 0:l.name)===h.name?l:null,g=m!==null&&m.active&&m.url==="",b=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--${pS(h.status)}`,children:hS[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:b?"btn btn--ghost btn--sm":"btn btn--primary btn--sm",disabled:g,onClick:()=>c.mcpAuth(h.name),children:g?"Запускаем вход…":b?"Начать заново":"Авторизовать"}),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(fS,{auth:m,remote:r,actions:c})]},h.name)})}),o?a.jsx(mS,{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 fS({auth:n,remote:l,actions:r}){const[c,o]=x.useState("");function d(){const g=c.trim();g!==""&&(r.mcpAuthCallback(n.name,g),o(""))}if(!n.active)return n.error?a.jsx("div",{className:"extlist__error",children:n.error}):n.done?a.jsxs("div",{className:"extauth extauth--done",role:"status",children:[a.jsx("span",{className:"extauth__tick","aria-hidden":"true",children:"✓"}),"Вход выполнен, сервер подключён."]}):null;const h=a.jsxs("div",{className:"extauth__paste",children:[l&&a.jsx("label",{className:"extauth__label",htmlFor:`mcp-cb-${n.name}`,children:"Адрес из строки браузера после входа"}),a.jsxs("div",{className:"extform__row",children:[a.jsx("input",{id:`mcp-cb-${n.name}`,"aria-label":"Адрес из строки браузера после входа",className:"input input--mono",value:c,spellCheck:!1,autoComplete:"off",placeholder:"http://localhost:…/callback?code=…",onChange:g=>o(g.target.value),onKeyDown:g=>{g.key==="Enter"&&(g.preventDefault(),d())}}),a.jsx("button",{className:c.trim()===""?"btn btn--ghost btn--sm":"btn btn--primary btn--sm",disabled:c.trim()==="",onClick:d,children:"Отправить"})]}),a.jsx("p",{className:"extauth__hint",children:l?"Браузер покажет ошибку на localhost — это нормально. Скопируйте адрес из его строки и вставьте сюда.":"Скопируйте адрес из строки браузера и вставьте сюда."})]}),m=n.callbackExpected&&(l?h:a.jsxs("details",{className:"extauth__more",children:[a.jsx("summary",{children:"Браузер показал ошибку на localhost?"}),h]}));return a.jsxs("div",{className:"extauth",role:"status",children:[n.url&&a.jsxs(a.Fragment,{children:[a.jsx("a",{className:"btn btn--primary extauth__go",href:n.url,target:"_blank",rel:"noopener noreferrer",children:"Открыть страницу входа"}),!l&&a.jsx("p",{className:"extauth__hint",children:"На этом компьютере окно обновится само, как только вы войдёте."})]}),m,n.error&&a.jsx("div",{className:"extlist__error",children:n.error}),a.jsxs("div",{className:"extauth__wait",children:[a.jsx("span",{className:"extauth__dot","aria-hidden":"true"}),"Ждём завершения входа…"]})]})}const hS={connected:"подключён",failed:"ошибка","needs-auth":"нужна авторизация",pending:"подключается",disabled:"выключен",unknown:"неизвестно"};function pS(n){return n==="connected"?"ok":n==="failed"?"bad":n==="needs-auth"?"warn":"mute"}function mS({onSubmit:n,onCancel:l}){const[r,c]=x.useState(""),[o,d]=x.useState("stdio"),[h,m]=x.useState(""),[g,b]=x.useState(""),[y,j]=x.useState(""),v=o==="stdio",S=r.trim()!==""&&(v?h.trim()!=="":g.trim()!=="");function k(){if(S)if(v){const[A,...C]=gS(h);n(r.trim(),{transport:"stdio",command:A??"",args:C,env:g_(y)})}else n(r.trim(),{transport:o,url:g.trim(),headers:g_(y)})}return a.jsxs("div",{className:"extform extform--card",children:[a.jsx("label",{className:"field",htmlFor:"mcp-name",children:"Имя сервера"}),a.jsx("input",{id:"mcp-name",className:"input input--mono",value:r,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"context7",onChange:A=>c(A.target.value)}),a.jsx("label",{className:"field",children:"Транспорт"}),a.jsx(Ml,{title:"Транспорт",value:o,options:[{value:"stdio",label:"stdio",hint:"локальный процесс"},{value:"http",label:"http",hint:"удалённый сервер"},{value:"sse",label:"sse",hint:"удалённый, поток событий"}],onChange:A=>d(A)}),v?a.jsxs(a.Fragment,{children:[a.jsx("label",{className:"field",htmlFor:"mcp-command",children:"Команда с аргументами"}),a.jsx("input",{id:"mcp-command",className:"input input--mono",value:h,spellCheck:!1,autoComplete:"off",placeholder:"npx -y @upstash/context7-mcp",onChange:A=>m(A.target.value)})]}):a.jsxs(a.Fragment,{children:[a.jsx("label",{className:"field",htmlFor:"mcp-url",children:"URL"}),a.jsx("input",{id:"mcp-url",className:"input input--mono",value:g,spellCheck:!1,autoComplete:"off",placeholder:"https://mcp.example.dev/mcp",onChange:A=>b(A.target.value)})]}),a.jsxs("label",{className:"field",htmlFor:"mcp-pairs",children:[v?"Переменные окружения":"Заголовки"," — по одной на строку, необязательно"]}),a.jsx("textarea",{id:"mcp-pairs",className:"input input--mono input--area",value:y,spellCheck:!1,placeholder:v?"API_KEY=xxx":"Authorization: Bearer xxx",onChange:A=>j(A.target.value)}),a.jsxs("div",{className:"extbar",children:[a.jsx("button",{className:"btn",onClick:l,children:"Отмена"}),a.jsx("button",{className:"btn btn--primary",disabled:!S,onClick:k,children:"Подключить"})]})]})}function g_(n){const l={};for(const r of n.split(`
|
|
123
|
-
`)){const c=r.trim();if(!c)continue;const o=c.indexOf("="),d=c.indexOf(":"),h=o===-1?d:d===-1?o:Math.min(o,d);h<=0||(l[c.slice(0,h).trim()]=c.slice(h+1).trim())}return l}function gS(n){return(n.trim().match(/"[^"]*"|'[^']*'|\S+/g)??[]).map(l=>l.replace(/^["']|["']$/g,""))}function xS({plugins:n,marketplaces:l,actions:r}){const[c,o]=x.useState("");return a.jsxs(a.Fragment,{children:[n.length===0&&a.jsx("p",{className:"modal__text",children:"Ни одного установленного плагина. Что можно поставить — на вкладке «Каталог»."}),a.jsx("ul",{className:"extlist",children:n.map(d=>a.jsxs("li",{className:"extlist__row",children:[a.jsxs("div",{className:"extlist__head",children:[a.jsx("span",{className:"extlist__name",children:d.name}),a.jsx("span",{className:d.enabled?"chip chip--ok":"chip chip--mute",children:d.enabled?"включён":"выключен"}),d.version&&d.version!=="unknown"&&a.jsx("span",{className:"chip",children:d.version}),d.scope&&a.jsx("span",{className:"chip",children:d.scope})]}),d.marketplace&&a.jsx("div",{className:"extlist__meta",children:d.marketplace}),d.mcpServers.length>0&&a.jsxs("div",{className:"extlist__meta",children:["MCP-серверы: ",d.mcpServers.join(", ")]}),a.jsxs("div",{className:"extlist__actions",children:[a.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>r.pluginToggle(d.id,!d.enabled),children:d.enabled?"Выключить":"Включить"}),a.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>r.pluginUninstall(d.id),children:"Удалить"})]})]},d.id))}),a.jsx("div",{className:"sidebar__section",children:"Маркетплейсы"}),a.jsx("ul",{className:"extlist",children:l.map(d=>a.jsxs("li",{className:"extlist__row",children:[a.jsx("div",{className:"extlist__head",children:a.jsx("span",{className:"extlist__name",children:d.name})}),d.source&&a.jsx("div",{className:"extlist__meta",children:d.source}),a.jsx("div",{className:"extlist__actions",children:a.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>r.marketplaceRemove(d.name),children:"Отключить"})})]},d.name))}),a.jsxs("div",{className:"extform__row",children:[a.jsx("input",{className:"input input--mono",value:c,spellCheck:!1,autoComplete:"off","aria-label":"Источник маркетплейса",placeholder:"owner/repo, URL или путь",onChange:d=>o(d.target.value),onKeyDown:d=>{d.key!=="Enter"||c.trim()===""||(d.preventDefault(),r.marketplaceAdd(c.trim()),o(""))}}),a.jsx("button",{className:"btn",disabled:c.trim()==="",onClick:()=>{r.marketplaceAdd(c.trim()),o("")},children:"Добавить"})]})]})}const bu=30;function bS({catalog:n,hasMarketplaces:l,actions:r,onMarketplaces:c}){const[o,d]=x.useState(""),[h,m]=x.useState(""),[g,b]=x.useState(bu),[y,j]=x.useState(""),v=x.useMemo(()=>[...new Set(n.map(A=>A.category).filter(Boolean))].sort(),[n]),S=x.useMemo(()=>{const k=o.trim().toLowerCase();return n.filter(A=>h&&A.category!==h?!1:k?`${A.name} ${A.displayName} ${A.description} ${A.author}`.toLowerCase().includes(k):!0)},[n,o,h]);return n.length===0?a.jsxs("p",{className:"modal__text",children:[l?"Маркетплейсы подключены, но их каталог ещё не выкачан. Попробуйте открыть окно ещё раз через минуту.":"Ни одного маркетплейса — ставить нечего."," ",a.jsx("button",{className:"linkish",onClick:c,children:"Подключить маркетплейс"})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"catalog__filters",children:[a.jsx("input",{className:"input",value:o,spellCheck:!1,autoComplete:"off","aria-label":"Поиск по каталогу",placeholder:"Поиск: имя, описание, автор",onChange:k=>{d(k.target.value),b(bu)}}),a.jsx(Ml,{title:"Категория",value:h,options:[{value:"",label:"все категории"},...v.map(k=>({value:k,label:k}))],onChange:k=>{m(k),b(bu)}})]}),S.length===0?a.jsx("p",{className:"modal__text",children:"Ничего не нашлось."}):a.jsx("ul",{className:"extlist",children:S.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))}),S.length>g&&a.jsx("div",{className:"extbar",children:a.jsxs("button",{className:"btn",onClick:()=>b(k=>k+bu),children:["Ещё ",Math.min(bu,S.length-g)," из ",S.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 _S({accounts:n,auth:l,logins:r,candidates:c,usage:o,actions:d,activeAccountId:h,error:m,onReconnect:g,reconnectBlocked:b,reconnectHint:y,onOpenLogin:j,onClose:v}){const S=n.length>1,[k,A]=x.useState(!1),C=n.find(H=>H.main)??n[0],V=x.useRef(n.length);x.useEffect(()=>{n.length>V.current&&A(!1),V.current=n.length},[n.length]);const Q=n.map(H=>`${H.id}:${H.dir}`).join("|"),$=x.useRef(d.discover);$.current=d.discover,x.useEffect(()=>{$.current()},[Q]);const I=x.useRef(d.requestUsage);I.current=d.requestUsage;const[G,M]=x.useState(!1);x.useEffect(()=>{I.current();const H=window.setInterval(()=>I.current(),9e4),fe=window.setTimeout(()=>M(!0),25e3);return()=>{window.clearInterval(H),window.clearTimeout(fe)}},[]);const[z,R]=x.useState(null),K=z!==null&&Object.values(o).some(H=>H!=null&&H.fetchedAt>=z),ae=z!==null&&!K;x.useEffect(()=>{if(z===null)return;if(K){R(null);return}const H=window.setTimeout(()=>R(null),25e3);return()=>window.clearTimeout(H)},[z,K]);const Y=(c??[]).filter(H=>H.accountId===null&&!n.some(fe=>fe.dir===H.configDir));return a.jsxs(ws,{title:S?"Аккаунты":"Аккаунт",className:"modal--accounts",onClose:v,children:[a.jsxs("div",{className:"acctlimits",children:[a.jsx("span",{className:"acctlimits__title",children:"Лимиты плана"}),a.jsxs("button",{type:"button",className:ae?"btn btn--ghost btn--sm acctlimits__btn is-busy":"btn btn--ghost btn--sm acctlimits__btn","aria-label":"Обновить лимиты","aria-busy":ae,disabled:ae,onClick:()=>{R(Date.now()),d.requestUsage()},children:[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"})]}),a.jsx("span",{"aria-live":"polite",children:ae?"Обновляем…":"Обновить"})]})]}),n.map(H=>{var fe;return a.jsx(TS,{account:H,multi:S,status:l[H.id]??null,usage:o[H.id],usageSettled:G,main:C,loginActive:((fe=r[H.id])==null?void 0:fe.active)===!0,actions:d,takenColors:n.filter(ue=>ue.id!==H.id).map(ue=>ue.color),onReconnect:H.id===h?g:null,reconnectBlocked:b,reconnectHint:y,onOpenLogin:()=>j(H.id)},H.id)}),m&&a.jsx("p",{className:"account__warn",role:"alert",children:m}),Y.length>0&&C&&a.jsx(jS,{found:Y,accounts:n,main:C,onConnect:(H,fe,ue,X)=>d.add(fe,ue,H.configDir,X),onMakeMain:H=>d.update(C.id,{configDir:H.configDir})}),k?a.jsx(MS,{accounts:n,onAdd:d.add,onCancel:()=>A(!1)}):a.jsx("button",{type:"button",className:"btn account__add",onClick:()=>A(!0),children:"+ Добавить аккаунт"})]})}function yS(n){const l=n.split(/[\\/]+/).filter(Boolean),r=l[l.length-1];return r&&(/^(users|home)$/i.test(l[0]??"")||/^(users|home)$/i.test(l[1]??""))&&l.length<=4?`~/${r}`:n}function vS(n){const l=n.split(/[\\/]+/).filter(Boolean);return(l[l.length-1]??"").replace(/^\.+/,"").slice(0,Tf)}function jS({found:n,accounts:l,main:r,onConnect:c,onMakeMain:o}){return a.jsxs("section",{className:"found","aria-labelledby":"found-title",children:[a.jsx("h3",{className:"found__title",id:"found-title",children:"Найдено на этом компьютере"}),a.jsx("p",{className:"account__step found__lead",children:"Здесь уже есть вход Claude Code. Ничего не копируется: аккаунт просто указывает на эту папку, а вход остаётся у Claude Code."}),a.jsx("ul",{className:"found__list",children:n.map(d=>a.jsx(NS,{candidate:d,accounts:l,main:r,onConnect:c,onMakeMain:o},d.configDir))})]})}function NS({candidate:n,accounts:l,main:r,onConnect:c,onMakeMain:o}){const[d,h]=x.useState(!1),[m,g]=x.useState(!1),[b,y]=x.useState(()=>vS(n.configDir)),[j,v]=x.useState(!0),S=b.trim(),k=l.some($=>$.name.toLowerCase()===S.toLowerCase()),A=hi.find($=>!l.some(I=>I.color===$))??hi[1],C=`found-${n.configDir.replace(/[^a-z0-9]/gi,"-")}`,V=r.liveSessions>0;function Q($){$.preventDefault(),S!==""&&c(n,S,A,j)}return a.jsxs("li",{className:"found__row",children:[a.jsxs("div",{className:"found__id",children:[a.jsx("span",{className:"found__email",children:n.email||"Вход выполнен"}),n.plan&&a.jsx("span",{className:"chip",children:n.plan})]}),n.organization&&a.jsx("div",{className:"extlist__meta",children:n.organization}),a.jsx("div",{className:"acctcard__dir found__dir",title:n.configDir,children:yS(n.configDir)}),d?a.jsxs("form",{className:"found__form",onSubmit:Q,children:[a.jsx("label",{className:"field",htmlFor:`${C}-name`,children:"Название аккаунта"}),a.jsx("input",{id:`${C}-name`,className:"input",value:b,maxLength:Tf,autoFocus:!0,autoComplete:"off","aria-describedby":k?`${C}-taken`:void 0,onChange:$=>y($.target.value)}),k&&a.jsx("p",{className:"account__note",id:`${C}-taken`,children:"Такое имя уже есть — хост откажет. Выберите другое."}),a.jsxs("label",{className:"acctform__check",children:[a.jsx("input",{type:"checkbox",checked:j,onChange:$=>v($.target.checked)}),a.jsxs("span",{children:["Общая конфигурация (ссылки на ",a.jsx("code",{children:"~/.claude-shared"}),")",a.jsx("span",{className:"account__step acctform__checkhint",children:"Что именно делится, задаётся в Настройках. Файлы, которые уже лежат в подключаемой папке, не перезаписываются. Если часть настроек и данных плагинов включена в общие, они станут общими с другими аккаунтами."})]})]}),a.jsxs("div",{className:"extbar",children:[a.jsx("button",{type:"button",className:"btn",onClick:()=>h(!1),children:"Отмена"}),a.jsx("button",{type:"submit",className:"btn btn--primary",disabled:S==="",children:"Подключить"})]})]}):a.jsxs("div",{className:"found__actions",children:[a.jsx("button",{type:"button",className:"btn btn--primary btn--sm",onClick:()=>h(!0),children:"Подключить"}),a.jsxs("button",{type:"button",className:"btn btn--ghost btn--sm found__more","aria-expanded":m,"aria-controls":`${C}-more`,onClick:()=>g($=>!$),children:["Ещё",a.jsx("svg",{viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",className:m?"is-open":"",children:a.jsx("path",{d:"m3 4.5 3 3 3-3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]})]}),m&&!d&&a.jsxs("div",{className:"found__menu",id:`${C}-more`,children:[a.jsx("button",{type:"button",className:"btn btn--sm",disabled:V,onClick:()=>o(n),children:"Сделать основным"}),a.jsx("span",{className:"account__note found__why",children:V?`Сначала закройте сессии основного аккаунта (${r.liveSessions}).`:`Основной аккаунт «${r.name}» будет брать вход из этой папки.`})]})]})}const wS="Вход выполняется в Настройках → Вход и выход Claude Code.",kS=120*1e3;function SS(n){const l=Math.max(1,Math.round((Date.now()-n)/6e4));if(l<60)return`${l} мин назад`;const r=Math.round(l/60);return r<48?`${r} ч назад`:`${Math.round(r/24)} дн. назад`}function ES({usage:n,settled:l}){if(!n)return a.jsx("p",{className:"account__note usage__state","aria-live":"polite",children:l?"Лимиты не получены — попробуем снова при следующем обновлении.":"Загружаем лимиты…"});if(!n.available)return a.jsx("p",{className:"account__note usage__state",children:"Лимиты недоступны: у этого способа входа нет окон плана."});const r=Date.now()-n.fetchedAt>kS;return a.jsxs("div",{className:"acctusage",children:[a.jsx(rm,{usage:n,variant:"card"}),r&&a.jsxs("p",{className:"account__step acctusage__age",children:["Показания от ",SS(n.fetchedAt)]})]})}function TS({account:n,multi:l,status:r,usage:c,usageSettled:o,main:d,loginActive:h,actions:m,takenColors:g,onReconnect:b,reconnectBlocked:y,reconnectHint:j,onOpenLogin:v}){const[S,k]=x.useState(!1),A=n.id,C=b!==null&&(r==null?void 0:r.loggedIn)===!0,V=!l,Q=!S&&a.jsx("button",{type:"button",className:"btn btn--ghost btn--sm",onClick:()=>k(!0),"aria-label":l?`Изменить аккаунт «${n.name}»`:"Изменить каталог аккаунта",children:l?"Изменить":"Изменить каталог"});return a.jsxs("section",{className:`acctcard acct--${n.color}${V?" acctcard--single":""}`,"aria-label":l?`Аккаунт «${n.name}»`:void 0,children:[l&&a.jsxs("header",{className:"acctcard__head",children:[a.jsx(Ra,{account:n,size:"md"}),a.jsxs("div",{className:"acctcard__name",children:[a.jsx("span",{className:"acctcard__title",children:n.name}),n.main&&a.jsx("span",{className:"chip chip--mute",children:"основной"})]}),Q]}),S?a.jsx(AS,{account:n,multi:l,main:d,takenColors:g,onSave:$=>{m.update(A,$),k(!1)},onMakeMain:()=>{m.makeMain(A),k(!1)},onRemove:()=>m.remove(A),onCancel:()=>k(!1)}):r===null?a.jsx("p",{className:"modal__text",children:"Спрашиваем у хоста…"}):r.loggedIn?a.jsxs("div",{className:"account",children:[a.jsx("div",{className:"account__id",children:r.email||"Вход выполнен"}),a.jsxs("div",{className:"account__chips",children:[a.jsx("span",{className:"chip chip--ok",children:CS[r.method]??r.method}),r.plan&&a.jsx("span",{className:"chip",children:r.plan})]}),r.organization&&a.jsx("div",{className:"extlist__meta",children:r.organization}),a.jsx(ES,{usage:c,settled:o})]}):a.jsxs("div",{className:"account__signedout",children:[a.jsx("p",{className:"modal__text",children:l?"Вход не выполнен. Сессии этого аккаунта не запустятся, пока вы в него не войдёте.":"Вход не выполнен. Сессии не запустятся, пока аккаунт не подключён."}),a.jsx("p",{className:"account__note",children:h?"Вход идёт — продолжите в Настройках.":wS}),a.jsx("button",{type:"button",className:"btn btn--sm",onClick:v,children:h?"Продолжить вход":"Открыть вход в Настройках"})]}),!S&&n.dir!==""&&a.jsxs("div",{className:"acctdir",children:[a.jsx("div",{className:"acctcard__dir",title:"Каталог конфигурации: вход, тариф, лимиты и транскрипты этого аккаунта",children:n.dir}),n.main&&n.configDir===null&&a.jsx("span",{className:"account__step",children:"унаследован из окружения"}),V&&a.jsx("div",{className:"acctdir__edit",children:Q})]}),C&&!S&&a.jsxs(a.Fragment,{children:[y&&a.jsx("p",{className:"account__note",children:j}),a.jsx("div",{className:"extbar account__bar",children:a.jsxs("button",{type:"button",className:"btn account__relink",title:`Переподключить сессию
|
|
124
|
-
${j}`,"aria-label":"Переподключить сессию",disabled:y,onClick:b??void 0,children:[a.jsx(RS,{}),"Переподключить"]})})]})]})}const CS={"claude.ai":"подписка Claude",console:"Anthropic Console",apiKey:"API-ключ",none:"нет"};function Gy({value:n,taken:l,onChange:r}){function c(o){const d=o.key==="ArrowRight"||o.key==="ArrowDown"?1:o.key==="ArrowLeft"||o.key==="ArrowUp"?-1:0;if(d===0)return;o.preventDefault();const h=hi.indexOf(n),m=hi[(h+d+hi.length)%hi.length];if(m){r(m);const g=o.currentTarget;window.requestAnimationFrame(()=>{var b;return(b=g.querySelector(`[data-color="${m}"]`))==null?void 0:b.focus()})}}return a.jsx("div",{className:"colorpick",role:"radiogroup","aria-label":"Цвет аккаунта",onKeyDown:c,children:hi.map(o=>{const d=o===n;return a.jsx("button",{type:"button",role:"radio","aria-checked":d,"aria-label":tf[o],title:l.includes(o)?`${tf[o]} — уже у другого аккаунта`:tf[o],"data-color":o,tabIndex:d?0:-1,className:`colorpick__item acct--${o}${d?" is-selected":""}`,onClick:()=>r(o),children:d&&a.jsx("svg",{viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M2.6 6.3 5 8.6l4.4-5",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})},o)})})}const Tf=40;function AS({account:n,multi:l,main:r,takenColors:c,onSave:o,onMakeMain:d,onRemove:h,onCancel:m}){const[g,b]=x.useState(n.name),[y,j]=x.useState(n.color),[v,S]=x.useState(n.dir),[k,A]=x.useState(!1),[C,V]=x.useState(!1),Q=g.trim(),$=v.trim(),I=$!==""&&$!==n.dir,G=Q!==n.name||y!==n.color||I,M=n.liveSessions,z=M>0,R=`acct-edit-${n.id}`,K=!n.main&&r!==void 0,ae=M>0||((r==null?void 0:r.liveSessions)??0)>0,Y=!n.main;function H(fe){fe.preventDefault(),!(l&&Q===""||!G)&&o({...Q!==n.name?{name:Q}:{},...y!==n.color?{color:y}:{},...I?{configDir:$}:{}})}return a.jsxs("div",{className:"acctform",children:[a.jsxs("form",{className:"extform acctform__fields",onSubmit:H,children:[l&&a.jsxs(a.Fragment,{children:[a.jsx("label",{className:"field",htmlFor:`${R}-name`,children:"Имя"}),a.jsx("input",{id:`${R}-name`,className:"input",value:g,maxLength:Tf,autoFocus:!0,autoComplete:"off",onChange:fe=>b(fe.target.value)}),a.jsx("span",{className:"field",children:"Цвет"}),a.jsx(Gy,{value:y,taken:c,onChange:j})]}),a.jsx("label",{className:"field",htmlFor:`${R}-dir`,children:"Каталог конфигурации"}),a.jsx("input",{id:`${R}-dir`,className:"input input--mono",value:v,disabled:z,spellCheck:!1,autoComplete:"off",autoFocus:!l,placeholder:"~/.claude","aria-describedby":`${R}-dirnote`,onChange:fe=>S(fe.target.value)}),a.jsx("p",{className:"account__step acctform__note",id:`${R}-dirnote`,children:z?`Каталог нельзя менять, пока у аккаунта есть живые сессии (${M}) — сначала закройте их.`:"Здесь лежат вход, тариф и история аккаунта. Файлы не переносятся: аккаунт начнёт брать вход из новой папки."}),n.main&&n.configDir!==null&&a.jsx("button",{type:"button",className:"btn btn--sm acctform__inherit",disabled:z,onClick:()=>o({configDir:null}),children:"Вернуть унаследованный"}),a.jsxs("div",{className:"extbar",children:[a.jsx("button",{type:"button",className:"btn",onClick:m,children:"Отмена"}),a.jsx("button",{type:"submit",className:"btn btn--primary",disabled:l&&Q===""||!G,children:"Сохранить"})]})]}),K&&a.jsxs("div",{className:"acctform__zone",children:[a.jsx("h4",{className:"acctform__zonetitle",children:"Основной аккаунт"}),a.jsx("p",{className:"account__note",children:`Аккаунты поменяются местами: «Основной» станет «${n.name}» и наоборот — каталог, имя и цвет. Файлы не переносятся.`}),ae?a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:"btn btn--sm",disabled:!0,children:"Сделать основным"}),a.jsx("p",{className:"account__note acctform__why",children:M>0&&((r==null?void 0:r.liveSessions)??0)>0?`Сначала закройте сессии обоих аккаунтов: этого (${M}) и основного (${r==null?void 0:r.liveSessions}).`:M>0?`Сначала закройте сессии этого аккаунта (${M}).`:`Сначала закройте сессии основного аккаунта (${r==null?void 0:r.liveSessions}).`})]}):k?a.jsxs("div",{className:"extbar",children:[a.jsx("button",{type:"button",className:"btn btn--sm",onClick:()=>A(!1),children:"Отмена"}),a.jsx("button",{type:"button",className:"btn btn--primary btn--sm",autoFocus:!0,onClick:d,children:"Поменять местами"})]}):a.jsx("button",{type:"button",className:"btn btn--sm",onClick:()=>A(!0),children:"Сделать основным"})]}),Y&&a.jsxs("div",{className:"acctform__zone",children:[a.jsx("h4",{className:"acctform__zonetitle",children:"Убрать аккаунт"}),M>0?a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:"btn btn--danger btn--sm",disabled:!0,children:"Убрать из списка"}),a.jsx("p",{className:"account__note acctform__why",children:`Сначала закройте сессии этого аккаунта (${M}).`})]}):C?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"account__note",role:"alert",children:`Убрать аккаунт «${n.name}» из списка? Его каталог ${n.dir} останется на диске, вход в нём сохранится.`}),a.jsxs("div",{className:"extbar",children:[a.jsx("button",{type:"button",className:"btn btn--sm",onClick:()=>V(!1),children:"Отмена"}),a.jsx("button",{type:"button",className:"btn btn--danger btn--sm",autoFocus:!0,onClick:h,children:"Убрать из списка"})]})]}):a.jsx("button",{type:"button",className:"btn btn--danger btn--sm",onClick:()=>V(!0),children:"Убрать из списка"})]})]})}function MS({accounts:n,onAdd:l,onCancel:r}){const c=n.map(k=>k.color),[o,d]=x.useState(""),[h,m]=x.useState(()=>hi.find(k=>!c.includes(k))??hi[1]),[g,b]=x.useState(""),[y,j]=x.useState(!0),v=o.trim();function S(k){k.preventDefault(),v!==""&&l(v,h,g.trim()===""?null:g.trim(),y)}return a.jsxs("form",{className:"extform extform--card acctform",onSubmit:S,children:[a.jsx("label",{className:"field",htmlFor:"acct-new-name",children:"Название аккаунта"}),a.jsx("input",{id:"acct-new-name",className:"input",value:o,maxLength:Tf,placeholder:"Например, Работа",autoFocus:!0,autoComplete:"off",onChange:k=>d(k.target.value)}),a.jsx("span",{className:"field",children:"Цвет"}),a.jsx(Gy,{value:h,taken:c,onChange:m}),a.jsxs("details",{className:"account__fallback acctform__dir",children:[a.jsx("summary",{children:"Каталог конфигурации"}),a.jsx("label",{className:"field",htmlFor:"acct-new-dir",children:"Путь к каталогу"}),a.jsx("input",{id:"acct-new-dir",className:"input input--mono",value:g,spellCheck:!1,autoComplete:"off",placeholder:"~/.claude-ccv-…",onChange:k=>b(k.target.value)}),a.jsxs("p",{className:"account__step",children:["Если оставить пустым, хост создаст отдельный каталог ",a.jsx("code",{children:"~/.claude-ccv-…"})," сам."]})]}),a.jsxs("label",{className:"acctform__check",children:[a.jsx("input",{type:"checkbox",checked:y,onChange:k=>j(k.target.checked)}),a.jsxs("span",{children:["Общая конфигурация (ссылки на ",a.jsx("code",{children:"~/.claude-shared"}),")",a.jsxs("span",{className:"account__step acctform__checkhint",children:["Аккаунт получит ссылки на общую папку, а не копии. Что именно делится, задаётся в Настройках. Вход, лимиты, переписка и ",a.jsx("code",{children:".claude.json"})," остаются отдельными. Если в общие включены настройки и плагины, их данные (в том числе токены плагинов) станут общими с другими аккаунтами."]})]})]}),a.jsxs("p",{className:"account__step",children:[y?"Новый аккаунт начнётся с общей конфигурации из Настроек.":"Новый аккаунт начнётся с чистого листа: своя конфигурация, плагины и CLAUDE.md."," ","Если в папке ещё нет входа, войдите в него отдельно — в Настройках, в разделе «Вход и выход Claude Code»."]}),a.jsxs("div",{className:"extbar",children:[a.jsx("button",{type:"button",className:"btn",onClick:r,children:"Отмена"}),a.jsx("button",{type:"submit",className:"btn btn--primary",disabled:v==="",children:"Добавить"})]})]})}function RS(){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 DS({state:n,onPair:l,onUnpair:r,onClose:c}){const[o,d]=x.useState(""),[h,m]=x.useState(""),[g,b]=x.useState(!1),y=x.useRef(null),j=(n==null?void 0:n.paired)===!0;x.useEffect(()=>{var S;j||(S=y.current)==null||S.focus()},[j]),x.useEffect(()=>{b(!1),j&&d("")},[j,n==null?void 0:n.error]);const v=(n==null?void 0:n.url)??"https://claudevisual.com";return a.jsx(ws,{title:"Удалённый доступ",onClose:c,children:j?a.jsxs("div",{className:"relay",children:[a.jsxs("p",{className:"relay__lede",children:["Компьютер связан с аккаунтом на ",a.jsx("b",{children:x_(v)}),". Открывайте его оттуда с любого устройства — с телефона в том числе."]}),a.jsxs("dl",{className:"relay__facts",children:[a.jsxs("div",{children:[a.jsx("dt",{children:"Имя"}),a.jsx("dd",{children:(n==null?void 0:n.name)??"—"})]}),a.jsxs("div",{children:[a.jsx("dt",{children:"Связь"}),a.jsxs("dd",{children:[a.jsx("span",{className:n!=null&&n.connected?"dot dot--on":"dot"})," ",n!=null&&n.connected?"на связи":"нет связи, пробуем переподключиться"]})]}),a.jsxs("div",{children:[a.jsx("dt",{children:"Подключено"}),a.jsxs("dd",{children:[(n==null?void 0:n.clients)??0," вкладок"]})]})]}),(n==null?void 0:n.error)&&a.jsx("p",{className:"relay__error",children:n.error}),a.jsx("p",{className:"relay__note",children:"Терминал с удалённых устройств настраивается в настройках приложения, раздел «Терминал»."}),a.jsx("p",{className:"relay__note",children:"Отвязка гасит токен этой машины: чтобы вернуть доступ, понадобится новый код. Сессии Claude Code это не трогает."}),a.jsx("button",{className:"btn btn--danger",onClick:r,children:"Отвязать компьютер"})]}):a.jsxs("div",{className:"relay",children:[a.jsx("p",{className:"relay__lede",children:"Чтобы работать с этим компьютером из браузера и с телефона, свяжите его с аккаунтом."}),a.jsxs("ol",{className:"relay__steps",children:[a.jsxs("li",{children:["Откройте ",a.jsx("b",{children:x_(v)})," и войдите (или зарегистрируйтесь)."]}),a.jsxs("li",{children:["Нажмите ",a.jsx("b",{children:"«Подключить ПК»"})," — появится код из восьми знаков."]}),a.jsx("li",{children:"Введите его сюда."})]}),a.jsxs("form",{className:"relay__form",onSubmit:S=>{S.preventDefault(),o.trim()&&(b(!0),l(o.trim(),h.trim()))},children:[a.jsxs("label",{className:"field",children:[a.jsx("span",{children:"Код сопряжения"}),a.jsx("input",{ref:y,className:"input relay__code",value:o,onChange:S=>d(S.target.value.toUpperCase()),placeholder:"XXXX-XXXX",autoComplete:"off",spellCheck:!1,maxLength:12})]}),a.jsxs("label",{className:"field",children:[a.jsx("span",{children:"Как назвать этот компьютер"}),a.jsx("input",{className:"input",value:h,onChange:S=>m(S.target.value),placeholder:"имя машины",autoComplete:"off",maxLength:64})]}),(n==null?void 0:n.error)&&a.jsx("p",{className:"relay__error",children:n.error}),a.jsx("button",{className:"btn btn--primary",type:"submit",disabled:!o.trim()||g,children:g?"Связываем…":"Связать"})]})]})})}function x_(n){try{return new URL(n).host}catch{return n}}const OS={active:!1,url:"",awaitingCode:!1,output:"",error:null},LS={"claude.ai":"подписка Claude",console:"Anthropic Console",apiKey:"API-ключ",none:"нет"};function zS({accounts:n,auth:l,logins:r,actions:c,remote:o,runningByAccount:d,focusAccountId:h}){return a.jsx("div",{className:"loginlist",children:n.map(m=>a.jsx(US,{account:m,status:l[m.id]??null,login:r[m.id]??OS,actions:c,remote:o,running:d[m.id]??0,focused:m.id===h},m.id))})}function US({account:n,status:l,login:r,actions:c,remote:o,running:d,focused:h}){const[m,g]=x.useState(""),[b,y]=x.useState(!1),[j,v]=x.useState(!1),S=x.useRef(null),k=n.id;x.useEffect(()=>{var $;h&&(($=S.current)==null||$.scrollIntoView({block:"nearest"}))},[h]);const A=x.useMemo(()=>{if(r.error)return{ok:!1,message:r.error};const $=r.output.trim();return $===""?null:{ok:!0,message:$}},[r.error,r.output]);function C($=m){const I=$.trim();I!==""&&(c.submitCode(k,I),g(""))}function V(){if(d>0){y(!1),v(!0);return}c.login(k,"claudeai",!0)}const Q=(l==null?void 0:l.loggedIn)===!0;return a.jsxs("section",{ref:S,className:`acctcard logincard acct--${n.color}${h?" is-focused":""}`,"aria-label":`Вход аккаунта «${n.name}»`,children:[a.jsxs("header",{className:"acctcard__head",children:[a.jsx(Ra,{account:n,size:"md"}),a.jsxs("div",{className:"acctcard__name",children:[a.jsx("span",{className:"acctcard__title",children:n.name}),n.main&&a.jsx("span",{className:"chip chip--mute",children:"основной"})]}),a.jsx("span",{className:`chip ${l===null?"chip--mute":Q?"chip--ok":"chip--warn"}`,children:l===null?"проверяем":Q?"вошёл":"не вошёл"})]}),Q&&a.jsx("div",{className:"logincard__who",children:[l.email||"Вход выполнен",l.plan,LS[l.method]??l.method].filter(Boolean).join(" · ")}),r.active?a.jsx(BS,{login:r,remote:o,code:m,onCode:g,onSubmit:C,onCancel:()=>c.cancel(k),inputId:`auth-code-${k}`}):a.jsxs(a.Fragment,{children:[a.jsx(Wr,{result:A}),(j||b)&&d>0&&a.jsx("p",{className:"account__warn",role:"alert",children:IS(d)}),a.jsx("div",{className:"extbar logincard__bar",children:Q?a.jsxs(a.Fragment,{children:[j?a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:"btn",onClick:()=>v(!1),children:"Отмена"}),a.jsx("button",{type:"button",className:"btn btn--warn",autoFocus:!0,onClick:()=>{v(!1),c.login(k,"claudeai",!0)},children:"Всё равно сменить"})]}):a.jsx("button",{type:"button",className:"btn",onClick:V,children:"Сменить аккаунт"}),b?a.jsx("button",{type:"button",className:"btn btn--danger",autoFocus:!0,onClick:()=>{y(!1),c.logout(k)},children:"Точно выйти?"}):a.jsx("button",{type:"button",className:"btn",onClick:()=>{v(!1),y(!0)},children:"Выйти"})]}):a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:"btn",onClick:()=>c.login(k,"console",!1),children:"Через Console"}),a.jsx("button",{type:"button",className:"btn btn--primary",onClick:()=>c.login(k,"claudeai",!1),children:"Войти"})]})})]})]})}function IS(n){const l=n%10,r=n%100,c=l===1&&r!==11,o=c?"сессия":l>=2&&l<=4&&(r<12||r>14)?"сессии":"сессий";return`${n} ${o} сейчас ${c?"работает":"работают"} — смена аккаунта может ${c?"её":"их"} прервать.`}function BS({login:n,remote:l,code:r,onCode:c,onSubmit:o,onCancel:d,inputId:h}){var A;const[m,g]=x.useState(null),b=x.useRef(""),y=x.useRef({code:r,onCode:c,onSubmit:o});y.current={code:r,onCode:c,onSubmit:o};const j=x.useCallback(async C=>{const{code:V,onCode:Q,onSubmit:$}=y.current;if(C&&V.trim()!=="")return;const I=await Lp();if(I===null){C||g("Не получилось прочитать буфер — вставьте код в поле руками.");return}const G=I.trim();if(!b_(G)){C||g("В буфере не похоже на код: нужен он целиком, вместе с частью после «#». Подойдёт и адрес страницы, на которую увёл браузер, — его тоже разберём.");return}if(C){if(b.current===G)return;b.current=G}g(null),Q(G),$(G)},[]);x.useEffect(()=>{if(!n.awaitingCode)return;const C=()=>{document.visibilityState==="visible"&&j(!0)};return document.addEventListener("visibilitychange",C),()=>document.removeEventListener("visibilitychange",C)},[n.awaitingCode,j]);const v=typeof((A=navigator.clipboard)==null?void 0:A.readText)=="function",S=r.trim()!==""&&!b_(r),k=m??(S?"Похоже, скопирована только часть кода — нужен он целиком, вместе с частью после «#».":null);return a.jsxs("div",{className:"account__flow",children:[n.url?l?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"field",children:"Подтвердите вход на странице Anthropic"}),a.jsx("a",{className:"btn btn--primary account__go",href:n.url,target:"_blank",rel:"noreferrer",children:"Открыть страницу входа"}),a.jsx("p",{className:"account__step",children:"После кнопки «Authorize» там появится код — скопируйте его и вернитесь сюда."}),a.jsxs("div",{className:"account__raw",children:[a.jsx("span",{className:"account__rawurl",children:n.url}),a.jsx(xo,{text:n.url,hint:"ссылку входа"})]})]}):a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"field",children:"Подтвердите вход в открывшемся браузере"}),a.jsx("p",{className:"account__step",children:"Хост открыл страницу входа на этом же компьютере — там достаточно нажать «Authorize», остальное произойдёт само."}),a.jsxs("details",{className:"account__fallback",children:[a.jsx("summary",{children:"Браузер не открылся"}),a.jsx("p",{className:"account__step",children:"Тогда откройте ссылку сами: страница покажет код, и его нужно будет вставить ниже."}),a.jsx("a",{className:"account__link",href:n.url,target:"_blank",rel:"noreferrer",children:n.url})]})]}):a.jsx("p",{className:"modal__text",children:"Запускаем вход…"}),n.awaitingCode&&a.jsxs(a.Fragment,{children:[a.jsx("label",{className:"field",htmlFor:h,children:"Код со страницы авторизации"}),a.jsxs("div",{className:"extform__row account__coderow",children:[a.jsx("input",{id:h,className:"input input--mono",value:r,autoFocus:!l,spellCheck:!1,autoComplete:"off",placeholder:"код#state",onChange:C=>{g(null),c(C.target.value)},onKeyDown:C=>{C.key==="Enter"&&(C.preventDefault(),o())}}),v&&a.jsx("button",{type:"button",className:"btn",onClick:()=>void j(!1),children:"Вставить код"}),a.jsx("button",{type:"button",className:"btn btn--primary",disabled:r.trim()==="",onClick:()=>o(),children:"Готово"})]}),k&&a.jsx("p",{className:"account__note account__note--code",children:k})]}),n.output.trim()!==""&&a.jsx("pre",{className:"account__log",children:n.output.trim()}),a.jsx("div",{className:"extbar",children:a.jsx("button",{className:"btn",onClick:d,children:"Отменить вход"})})]})}function b_(n){const l=n.trim();if(/^https?:\/\//i.test(l))return/[?#&]code=/.test(l);const[r,c]=l.split("#");return!!r&&!!c&&!/\s/.test(l)}const __=[{id:"claude",label:"Claude",hint:"Claude Code"},{id:"antigravity",label:"Antigravity",hint:"Google agy"}],HS=[{id:"skills",label:"Скиллы",hint:"Читаются Claude Code, безопасно делить."},{id:"agents",label:"Агенты",hint:"Читаются Claude Code, безопасно делить."},{id:"commands",label:"Команды",hint:"Читаются Claude Code, безопасно делить."},{id:"hooks",label:"Хуки",hint:"Читаются Claude Code, безопасно делить."},{id:"output-styles",label:"Стили вывода",hint:"Читаются Claude Code, безопасно делить."},{id:"plugins",label:"Плагины",hint:"Вместе с данными плагинов — в них могут лежать токены."},{id:"CLAUDE.md",label:"CLAUDE.md",hint:"Общие инструкции."},{id:"settings.json",label:"settings.json",hint:"Модель, права, хуки, список плагинов: изменение в одном аккаунте сразу видно в другом. Ссылку Claude Code может заменить обычным файлом."},{id:"keybindings.json",label:"keybindings.json",hint:"Сочетания клавиш."}],$S=[{label:"Вход и токены (.credentials.json)",why:"У каждого аккаунта свой."},{label:".claude.json",why:"В нём личность вошедшего и пользовательские MCP-серверы: общий файл смешал бы аккаунты."},{label:"История сессий и лимиты",why:"У каждого аккаунта своя."}],yp="",qS=[{value:"opus",label:"Opus",hint:"полный список моделей виден, когда открыта сессия"},{value:"sonnet",label:"Sonnet",hint:"полный список моделей виден, когда открыта сессия"},{value:"haiku",label:"Haiku",hint:"полный список моделей виден, когда открыта сессия"}],GS=Q_.map(n=>({value:n.value,label:n.value,hint:n.hint})),Jd=3600*1e3,YS=[{value:"6h",label:"6 часов"},{value:"24h",label:"Сутки"},{value:"48h",label:"Двое суток"},{value:"168h",label:"Неделя"},{value:"never",label:"Никогда"}],no={"6h":6*Jd,"24h":24*Jd,"48h":48*Jd,"168h":168*Jd,never:0};function XS(n){return no[n]??no["48h"]}const VS=[{value:"5m",label:"5 минут"},{value:"10m",label:"10 минут"},{value:"30m",label:"30 минут"},{value:"60m",label:"Час"},{value:"never",label:"Никогда"}],Pd=60*1e3,so={"5m":5*Pd,"10m":10*Pd,"30m":30*Pd,"60m":60*Pd,never:0};function QS(n){return so[n]??so["10m"]}function KS(n){const l=Object.entries(so).find(([,r])=>r===n);return l?l[0]:Object.keys(so).reduce((r,c)=>Math.abs(so[c]-n)<Math.abs(so[r]-n)?c:r)}function FS(n){const l=Object.entries(no).find(([,r])=>r===n);return l?l[0]:Object.keys(no).reduce((r,c)=>Math.abs(no[c]-n)<Math.abs(no[r]-n)?c:r)}const ZS=[{value:"off",label:"Выключено"},{value:"500",label:"0.5 с"},{value:"1500",label:"1.5 с"},{value:"3000",label:"3 с"},{value:"10000",label:"10 с"}],lo={off:0,500:500,1500:1500,3e3:3e3,1e4:1e4};function JS(n){return lo[n]??lo.off}function y_(n){return Number.isFinite(n)?Math.min(100,Math.max(0,Math.round(n))):0}function PS(n){const l=Object.entries(lo).find(([,r])=>r===n);return l?l[0]:Object.keys(lo).reduce((r,c)=>Math.abs(lo[c]-n)<Math.abs(lo[r]-n)?c:r)}const WS=[{value:"project",title:"Только текущий проект",description:"Агент молча пишет файлы в открытом проекте и в ~/.claude — настройках самого Claude Code. Чужой проект и любая новая папка — только с явного разрешения."},{value:"projects",title:"Папка с проектами",description:"То же плюс каталог, где лежат открытые проекты, — то есть и соседний проект тоже. Всё остальное — с разрешения."},{value:"all",title:"Все папки на компьютере",description:"Агент пишет файлы куда угодно на диске — вопросов про место записи не будет.",risky:!0}];function eE({settings:n,models:l,relayState:r,networkState:c,local:o,onChange:d,onEnableShell:h,onDisableShell:m,onOpenRelay:g,claudeLogin:b,projectsRootHint:y,onClose:j}){const v=x.useRef(null),S=n===null,k=b.focusAccountId!==null;x.useEffect(()=>{var X;k&&((X=v.current)==null||X.scrollIntoView({block:"start"}))},[k]);const A=(n==null?void 0:n.projectsRoot)??"",[C,V]=x.useState(A);x.useEffect(()=>V(A),[A]);function Q(){const X=C.trim();X!==A&&d({projectsRoot:X===""?null:X})}const[$,I]=x.useState(""),[G,M]=x.useState(null),z=!S&&n.networkGuardEnabled,R=(n==null?void 0:n.networkGuardBlockedCountries)??[];function K(){const X=$.trim().toUpperCase();if(X!==""){if(!/^[A-Z]{2}$/.test(X)){M("Нужен код из двух латинских букв, например RU или CN.");return}if(R.includes(X)){M(`Код ${X} уже в списке.`);return}M(null),I(""),d({networkGuardBlockedCountries:[...R,X]})}}const ae=!S&&n.terminalEnabled===!0,Y=!S&&n.liveSessionsFirst===!0,H=!ae,fe=x.useMemo(()=>{const X=[{value:yp,label:"Как в Claude Code",hint:"модель определят настройки самого Claude Code"},...l.length>0?l.map(D=>({value:D.value,label:D.displayName,hint:D.description})):qS];return n&&n.startModel!==null&&!X.some(D=>D.value===n.startModel)&&X.push({value:n.startModel,label:n.startModel}),X},[l,n]);function ue(){var X,D;return(r==null?void 0:r.paired)!==!0?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"settings__hint",children:"Компьютер не связан с аккаунтом — включать удалённый доступ пока не к чему: без пары ни телефон, ни другое устройство этот компьютер вообще не видят."}),a.jsx("button",{type:"button",className:"btn",disabled:H,onClick:g,children:"Связать компьютер"})]}):(X=r.shell)!=null&&X.enabled?a.jsxs(a.Fragment,{children:[a.jsxs("p",{className:"settings__hint",children:["Разрешён: с телефона и любого другого устройства этого аккаунта можно открыть терминал и выполнить на этом компьютере что угодно — как если бы сидели за ним.",r.shell.confirmedAt&&` Включено ${new Date(r.shell.confirmedAt).toLocaleString()}.`]}),a.jsx("button",{type:"button",className:"btn btn--danger",disabled:H,onClick:m,children:"Запретить"})]}):(D=r.shell)!=null&&D.pending?a.jsxs(a.Fragment,{children:[a.jsxs("p",{className:"settings__hint",children:["Письмо ушло на ",a.jsx("b",{children:r.shell.email}),". Перейдите по ссылке из него — терминал заработает удалённо."]}),a.jsx("p",{className:"settings__hint",children:"Повторная отправка ограничена раз в минуту — если жали кнопку только что, письмо не придёт и от повторного нажатия тоже. Если сейчас доберётесь до самого компьютера, там разрешение включится сразу, без письма."}),a.jsx("button",{type:"button",className:"btn",disabled:H,onClick:h,children:"Отправить письмо ещё раз"})]}):a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"settings__hint",children:"Сейчас с телефона можно смотреть разговоры и файлы, но не запускать команды. Разрешение даёт полный доступ к терминалу этого компьютера: с телефона станет можно выполнить любую команду, как в обычной консоли за этой машиной."}),o?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"settings__hint",children:"Включится сразу — вы уже за этим компьютером, подтверждать доступ к нему нечем и незачем."}),a.jsx("button",{type:"button",className:"btn",disabled:H,onClick:h,children:"Разрешить с телефона"})]}):a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"settings__hint",children:"Отсюда мгновенно не включится: на почту аккаунта уйдёт письмо, и терминал заработает только после перехода по ссылке из него."}),a.jsx("button",{type:"button",className:"btn",disabled:H,onClick:h,children:"Прислать письмо"})]})]})}return a.jsx(ws,{title:"Настройки",onClose:j,children:a.jsxs("div",{className:"settings",children:[a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Архивация молчащих сессий"}),a.jsx("p",{className:"settings__hint",children:"Сессия, к которой долго не возвращались, сама уезжает в архив — на диске ничего не удаляется, транскрипт остаётся, и её можно вернуть обратно в любой момент."}),S?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(Ml,{className:"settings__select",value:FS(n.autoArchiveAfterMs),options:YS,onChange:X=>d({autoArchiveAfterMs:XS(X)}),ariaLabel:"Через сколько молчащая сессия уезжает в архив"})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Останавливать простаивающие сессии через"}),a.jsx("p",{className:"settings__hint",children:"Простаивающая живая сессия сама отпускает процесс CLI — освобождает память компьютера, на котором стоит хост. Простой — это когда сессия ничего не делает (не работает, не ждёт разрешения, фоновых задач нет), в ней ничего не происходит и ни в одном открытом окне не висит недописанный черновик для неё. Разговор при этом никуда не девается: открытая заново сессия, как и отправленное в неё сообщение, продолжают с того же места."}),S?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(Ml,{className:"settings__select",value:KS(n.autoStopAfterMs),options:VS,onChange:X=>d({autoStopAfterMs:QS(X)}),ariaLabel:"Останавливать простаивающие сессии через"})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Корень проектов"}),a.jsx("p",{className:"settings__hint",children:"Папки проектов в боковой панели — настоящие каталоги внутри этого корня, а перенос проекта в папку переносит его каталог на диске. Пусто — корень выбирается автоматически."}),S?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx("input",{className:"input input--mono",value:C,spellCheck:!1,autoComplete:"off",placeholder:y??"Автоматически","aria-label":"Корень проектов",onChange:X=>V(X.target.value),onBlur:Q,onKeyDown:X=>{X.key==="Enter"&&(X.preventDefault(),Q())}})]}),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-часового лимита, %"}),S?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsxs("div",{className:"settings__pct",children:[a.jsx("input",{type:"number",className:"input settings__pct-input",min:0,max:100,step:1,value:n.limitStopFiveHourPct,onChange:X=>d({limitStopFiveHourPct:y_(X.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:"Остановка у недельного лимита, %"}),S?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsxs("div",{className:"settings__pct",children:[a.jsx("input",{type:"number",className:"input settings__pct-input",min:0,max:100,step:1,value:n.limitStopSevenDayPct,onChange:X=>d({limitStopSevenDayPct:y_(X.target.valueAsNumber)}),"aria-label":"Остановка у недельного лимита, %"}),a.jsx("span",{className:"settings__pct-suffix",children:"%"})]}),a.jsx("p",{className:"settings__hint",children:"0 — не останавливать."})]})]}),a.jsxs("section",{className:"settings__section",children:[a.jsxs("div",{className:"settings__switch-row",children:[a.jsxs("div",{className:"settings__switch-copy",children:[a.jsx("h3",{className:"settings__heading",children:"Kill switch: останавливать агентов, если упал VPN"}),a.jsx("p",{className:"settings__hint",children:"Если VPN отключился, ccv сразу останавливает всех агентов и не даёт отправлять сообщения, пока VPN не вернётся. Как определяем: смотрим, из какой страны Anthropic видит запросы — страна из списка ниже или неудачная проверка считаются падением VPN. Сессии остаются открытыми и продолжатся после возврата VPN. Kill switch самого VPN-клиента это не заменяет — его тоже стоит включить."})]}),S?a.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):a.jsx("button",{type:"button",role:"switch","aria-checked":z,"aria-label":"Kill switch: останавливать агентов, если упал VPN",className:z?"switch is-on":"switch",onClick:()=>d({networkGuardEnabled:!z}),children:a.jsx("span",{className:"switch__knob"})})]}),z&&c&&a.jsx("p",{className:c.status==="blocked"?"settings__hint settings__netstatus is-bad":"settings__hint settings__netstatus",children:c.status==="blocked"?c.reason??"Маршрут не прошёл проверку.":c.country?`Сейчас: ${c.country} — всё в порядке.`:"Сейчас всё в порядке."}),a.jsxs("div",{className:z?"settings__field":"settings__field settings__nested is-disabled",children:[a.jsx("span",{className:"settings__field-label",children:"Запрещённые страны"}),a.jsxs("ul",{className:"countries","aria-label":"Запрещённые страны",children:[R.map(X=>a.jsxs("li",{className:"countries__chip",children:[a.jsx("span",{children:X}),a.jsx("button",{type:"button",className:"countries__remove","aria-label":`Убрать ${X} из списка`,disabled:!z,onClick:()=>d({networkGuardBlockedCountries:R.filter(D=>D!==X)}),children:"×"})]},X)),R.length===0&&a.jsx("li",{className:"settings__hint",children:"Список пуст: блокировать будет только сбой проверки."})]}),a.jsxs("form",{className:"countries__add",onSubmit:X=>{X.preventDefault(),K()},children:[a.jsx("input",{type:"text",className:"input countries__input",value:$,maxLength:2,placeholder:"RU",autoCapitalize:"characters",spellCheck:!1,disabled:!z,"aria-label":"Код страны, две буквы","aria-invalid":G!==null,onChange:X=>{I(X.target.value.toUpperCase()),M(null)}}),a.jsx("button",{type:"submit",className:"btn",disabled:!z||$.trim()==="",children:"Добавить"})]}),G&&a.jsx("p",{className:"settings__hint countries__error",role:"alert",children:G})]})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Автосохранение"}),a.jsx("p",{className:"settings__hint",children:"Открытый файл сам уезжает на диск, если немного постоять без ввода — ручное сохранение, кнопкой или Ctrl+S, при этом всегда работает как обычно, независимо от этой настройки."}),S?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(Ml,{className:"settings__select",value:PS(n.autoSaveAfterPauseMs),options:ZS,onChange:X=>d({autoSaveAfterPauseMs:JS(X)}),ariaLabel:"Пауза перед автосохранением открытого файла"})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Агенты"}),a.jsx("p",{className:"settings__hint",children:"Выключенный агент не предлагается при создании новой сессии. Уже открытые сессии с ним продолжают работать."}),__.map(X=>{const D=(n==null?void 0:n.enabledProviders)??["claude","antigravity"],U=!S&&D.includes(X.id),ce=U&&D.length<=1;return a.jsxs("div",{className:"settings__switch-row settings__agent",children:[a.jsx("span",{className:`newsession__mark newsession__mark--${X.id}`,"aria-hidden":"true",children:X.id==="antigravity"?a.jsx(tm,{className:"newsession__mark-logo"}):a.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:a.jsx("circle",{cx:"8",cy:"8",r:"6",fill:"var(--accent)"})})}),a.jsxs("div",{className:"settings__switch-copy settings__agent-copy",children:[a.jsx("span",{className:"settings__field-label",children:X.label}),a.jsx("span",{className:"settings__hint",children:ce?"Хотя бы один агент должен остаться включённым":X.hint})]}),S?a.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):a.jsx("button",{type:"button",role:"switch","aria-checked":U,"aria-label":X.label,disabled:ce,title:ce?"Хотя бы один агент должен остаться включённым":void 0,className:U?"switch is-on":"switch",onClick:()=>{const be=__.map(Ne=>Ne.id).filter(Ne=>Ne===X.id?!U:D.includes(Ne));d({enabledProviders:be})},children:a.jsx("span",{className:"switch__knob"})})]},X.id)})]}),a.jsxs("section",{className:"settings__section","aria-labelledby":"settings-shared-title",children:[a.jsx("h3",{className:"settings__heading",id:"settings-shared-title",children:"Общая конфигурация аккаунтов"}),a.jsx("p",{className:"settings__hint",children:"Выбор действует, когда аккаунт добавляется или подключается с включённым общим доступом. Уже существующие аккаунты не меняются, ссылки не удаляются."}),HS.map(X=>{const D=(n==null?void 0:n.sharedConfigItems)??Px,U=!S&&D.includes(X.id);return a.jsxs("div",{className:"settings__switch-row",children:[a.jsxs("div",{className:"settings__switch-copy",children:[a.jsx("span",{className:"settings__field-label",children:X.label}),a.jsx("span",{className:"settings__hint",children:X.hint})]}),S?a.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):a.jsx("button",{type:"button",role:"switch","aria-checked":U,"aria-label":X.label,className:U?"switch is-on":"switch",onClick:()=>d({sharedConfigItems:Px.filter(ce=>ce===X.id?!U:D.includes(ce))}),children:a.jsx("span",{className:"switch__knob"})})]},X.id)}),a.jsx("h4",{className:"settings__subheading",children:"Никогда не делится"}),a.jsx("ul",{className:"settings__never",children:$S.map(X=>a.jsxs("li",{children:[a.jsx("span",{className:"settings__never-name",children:X.label}),a.jsx("span",{className:"settings__hint",children:X.why})]},X.label))})]}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Старт новой сессии"}),a.jsx("p",{className:"settings__hint",children:"Модель и режим прав, с которыми поднимается новая сессия. Уже открытую это не меняет — у неё свои переключатели в шапке."}),a.jsxs("div",{className:"settings__field",children:[a.jsx("span",{className:"settings__field-label",children:"Модель"}),S?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(Ml,{className:"settings__select",value:n.startModel??yp,options:fe,onChange:X=>d({startModel:X===yp?null:X}),ariaLabel:"Модель, с которой поднимается новая сессия"})]}),a.jsxs("div",{className:"settings__field",children:[a.jsx("span",{className:"settings__field-label",children:"Режим прав при старте"}),S?a.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):a.jsx(Ml,{className:"settings__select",value:n.startPermissionMode,options:GS,onChange:X=>d({startPermissionMode:X}),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:"Сессии, поднятые в хосте прямо сейчас — работают, готовы, ждут разрешения, работают в фоне, переподключаются, — показываются выше остальных в списке сессий проекта и в панели закреплённых. Порядок внутри каждой из двух частей остаётся тем, что задан руками."})]}),S?a.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):a.jsx("button",{type:"button",role:"switch","aria-checked":Y,"aria-label":"Запущенные сессии сверху",className:Y?"switch is-on":"switch",onClick:()=>d({liveSessionsFirst:!Y}),children:a.jsx("span",{className:"switch__knob"})})]})}),a.jsxs("section",{className:"settings__section",children:[a.jsx("h3",{className:"settings__heading",children:"Доступ к папкам"}),a.jsx("p",{className:"settings__hint",children:"Это про то, где агент пишет файлы (Write, Edit, NotebookEdit), не спрашивая разрешения, — не про чтение: читает он в любом случае. Ничего не запрещается наглухо — выход за выбранную границу просто превращается в обычный запрос прав, который остаётся подтвердить или отклонить."}),a.jsx("div",{className:"access",role:"radiogroup","aria-label":"Доступ к папкам",children:WS.map(X=>{const D=!S&&n.folderAccess===X.value;return a.jsxs("button",{type:"button",role:"radio","aria-checked":D,disabled:S,className:"access__card"+(D?" is-on":"")+(X.risky?" access__card--risky":""),onClick:()=>d({folderAccess:X.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:[X.title,X.risky&&a.jsx("span",{className:"access__risk",children:"самое широкое"})]}),a.jsx("span",{className:"access__desc",children:X.description})]})]},X.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-инструмент в разговоре. Выключите — и все открытые вкладки терминала закроются, а процессы в них не переживут закрытия."})]}),S?a.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):a.jsx("button",{type:"button",role:"switch","aria-checked":ae,"aria-label":"Терминал",className:ae?"switch is-on":"switch",onClick:()=>d({terminalEnabled:!ae}),children:a.jsx("span",{className:"switch__knob"})})]}),a.jsxs("div",{className:"settings__nested"+(H?" is-disabled":""),children:[a.jsx("h4",{className:"settings__nested-heading",children:"Удалённый доступ к терминалу"}),S?a.jsx("p",{className:"settings__hint",children:"Загрузка…"}):a.jsxs(a.Fragment,{children:[H&&a.jsx("p",{className:"settings__hint",children:"Сначала включите терминал выше — удалённый доступ выдаётся к тому, что на этой машине уже разрешено, а не поверх выключенного рубильника."}),ue()]})]})]}),a.jsxs("details",{ref:v,className:"settings__section settings__advanced",open:k||void 0,children:[a.jsxs("summary",{className:"settings__advanced-summary",children:[a.jsx("h3",{className:"settings__heading",children:"Вход и выход Claude Code (расширенное)"}),a.jsx("svg",{viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",className:"settings__advanced-chev",children:a.jsx("path",{d:"m3 4.5 3 3 3-3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]}),a.jsxs("div",{className:"settings__advanced-body",children:[a.jsxs("p",{className:"settings__hint",children:["ccv не хранит ни паролей, ни токенов. Эти кнопки запускают собственные команды Claude Code — ",a.jsx("code",{children:"claude auth login"})," и ",a.jsx("code",{children:"claude auth logout"})," — для папки выбранного аккаунта."]}),a.jsxs("ul",{className:"settings__hint settings__advanced-list",children:[a.jsxs("li",{children:[a.jsx("strong",{children:"Войти"})," — входит в эту папку: откроется ссылка в браузере, и Claude Code попросит код."]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Выйти"})," — убирает вход из этой папки для всех сессий аккаунта."]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Сменить аккаунт"})," — выйти и войти заново."]})]}),a.jsx(zS,{...b})]})]})]})})}const Cf="Новая сессия начнётся с нуля: на другой аккаунт переходит только текст хэндоффа, прежний разговор под ним не открыть.";function Yy({targets:n,selectedId:l,sourceId:r,onSelect:c,variant:o,className:d,disabled:h}){const{auth:m}=Hp(),g=n.find(M=>M.id===l)??n[0],[b,y]=x.useState(!1),[j,v]=x.useState(0),[S,k]=x.useState({left:0,top:0}),A=x.useRef(null),C=x.useRef(null);function V(){v(Math.max(0,n.findIndex(M=>M.id===l))),y(!0)}function Q(M){var z;y(!1),M&&((z=A.current)==null||z.focus())}function $(M){c(M.id),Q(!0)}x.useLayoutEffect(()=>{if(!b)return;const M=A.current,z=C.current;if(!M||!z)return;const R=M.getBoundingClientRect(),K=z.getBoundingClientRect(),ae=8,Y=Math.max(ae,Math.min(R.right-K.width,window.innerWidth-K.width-ae));let H=R.bottom+6;H+K.height>window.innerHeight-ae&&(H=Math.max(ae,R.top-K.height-6)),k({left:Y,top:H}),z.focus()},[b]),x.useLayoutEffect(()=>{if(!b)return;function M(z){var K,ae;const R=z.target;!((K=C.current)!=null&&K.contains(R))&&!((ae=A.current)!=null&&ae.contains(R))&&Q(!1)}return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[b]);function I(M){if(M.key==="Escape")M.preventDefault(),M.stopPropagation(),Q(!0);else if(M.key==="ArrowDown"||M.key==="ArrowUp"){M.preventDefault();const z=M.key==="ArrowDown"?1:-1;v(R=>(R+z+n.length)%n.length)}else if(M.key==="Enter"||M.key===" "){M.preventDefault();const z=n[j];z&&$(z)}else M.key==="Tab"&&Q(!1)}if(!g)return null;const G=`Аккаунт новой сессии: «${g.name}». Сменить`;return a.jsxs(a.Fragment,{children:[a.jsxs("button",{ref:A,type:"button",className:`${o==="split"?"splitbtn__caret":"pane-btn pane-btn--target"}${d?` ${d}`:""}`,title:G,"aria-label":G,"aria-haspopup":"menu","aria-expanded":b,disabled:h,onClick:()=>b?Q(!1):V(),onKeyDown:M=>{(M.key==="ArrowDown"||M.key==="ArrowUp")&&(M.preventDefault(),V())},children:[o==="mark"&&a.jsx(Ra,{account:g,size:"sm",className:"pane-btn__mark"}),a.jsx("svg",{className:"splitbtn__icon",viewBox:"0 0 10 6",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"M1 1.2 5 5 9 1.2",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})]}),b&&a.jsxs("div",{ref:C,className:"newsession__menu targetmenu",style:{left:S.left,top:S.top},role:"menu","aria-label":"Аккаунт новой сессии",tabIndex:-1,onKeyDown:I,children:[a.jsx("p",{className:"targetmenu__note",children:Cf}),n.map((M,z)=>{const R=z_(m[M.id]);return a.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":M.id===l,className:"newsession__item"+(z===j?" is-cursor":""),onMouseEnter:()=>v(z),onClick:()=>$(M),children:[a.jsx("span",{className:"newsession__mark newsession__mark--account",children:a.jsx(Ra,{account:M,size:"md"})}),a.jsxs("span",{className:"newsession__text",children:[a.jsx("span",{className:"newsession__label",children:M.name}),R&&a.jsx("span",{className:"newsession__hint",children:R})]}),M.id===r&&a.jsx("span",{className:"newsession__tag",children:"прежняя"}),M.id===l&&a.jsx("svg",{className:"targetmenu__check",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:a.jsx("path",{d:"m2.5 6.4 2.4 2.4 4.6-5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})]},M.id)})]})]})}function tE({targets:n,selectedId:l,onSelect:r}){return a.jsxs("div",{className:"targetchips",role:"radiogroup","aria-label":"Аккаунт новой сессии",children:[a.jsx("span",{className:"targetchips__label",children:"Новая сессия на аккаунте"}),a.jsx("div",{className:"targetchips__row",children:n.map(c=>a.jsxs("button",{type:"button",role:"radio","aria-checked":c.id===l,className:`targetchips__chip acct--${c.color}${c.id===l?" is-on":""}`,onClick:()=>r(c.id),children:[a.jsx(Ra,{account:c,size:"sm"}),a.jsx("span",{className:"targetchips__name",children:c.name})]},c.id))}),a.jsx("span",{className:"targetchips__note",children:Cf})]})}const v_={fiveHour:"5-часовой лимит",sevenDay:"недельный лимит"};function nE(n){if(!n)return"срок неизвестен";const l=new Date(n);return Number.isNaN(l.getTime())?"срок неизвестен":l.toLocaleString()}function j_({label:n,primary:l,choice:r,onContinue:c}){const o=`btn btn--sm${l?" btn--primary":""}`,d=r==null?void 0:r.targets.find(m=>m.id===r.selectedId);if(!r||!d)return a.jsx("button",{type:"button",className:o,onClick:c,children:n});const h=d.id!==r.sourceId;return a.jsxs("span",{className:`splitbtn${l?" splitbtn--primary":""}`,children:[a.jsxs("button",{type:"button",className:`${o} splitbtn__main`,title:h?Cf:`Новая сессия на том же аккаунте «${d.name}»`,onClick:c,children:[a.jsx("span",{className:`newsession__acct acct--${d.color}`,"aria-hidden":"true"}),n," на «",d.name,"»"]}),a.jsx(Yy,{variant:"split",className:o,targets:r.targets,selectedId:r.selectedId,sourceId:r.sourceId,onSelect:r.onSelect})]})}function sE({handoff:n,onContinue:l,onShow:r,onDismiss:c,sourceAccount:o=null,accountChoice:d=null}){if(n.continuedAt!==void 0){const h=n.limit===null?`Хэндофф записан вручную ${new Date(n.stoppedAt).toLocaleString()}`:`${v_[n.limit]} (${Math.round(n.utilization)} %) — работа прервана ${new Date(n.stoppedAt).toLocaleString()}`;return a.jsxs("div",{className:"handoff handoff--continued",role:"status",children:[a.jsxs("div",{className:"handoff__msg",children:[a.jsx("span",{className:"handoff__dot","aria-hidden":"true"}),a.jsxs("span",{children:[a.jsxs("span",{className:"handoff__continued",children:["Новая сессия из этого хэндоффа уже начата ",new Date(n.continuedAt).toLocaleString(),"."]})," ",h,".",n.source==="journal"&&" Хэндофф собран автоматически из журнала."]})]}),a.jsxs("div",{className:"handoff__actions",children:[a.jsx("button",{type:"button",className:"btn btn--sm",onClick:r,children:"Показать хэндофф"}),a.jsx("button",{type:"button",className:"btn btn--sm",onClick:c,children:"Скрыть"}),a.jsx(j_,{label:"Продолжить ещё раз",primary:!1,choice:d,onContinue:l})]})]})}return a.jsxs("div",{className:"handoff",role:"status",children:[a.jsxs("div",{className:"handoff__msg",children:[a.jsx("span",{className:"handoff__dot","aria-hidden":"true"}),a.jsxs("span",{children:[n.limit===null?a.jsxs(a.Fragment,{children:["Хэндофф записан вручную ",new Date(n.stoppedAt).toLocaleString()," — сессия остановлена."]}):a.jsxs(a.Fragment,{children:[o&&a.jsxs(a.Fragment,{children:[a.jsx(Ra,{account:o,size:"sm",className:"handoff__acct"})," ",a.jsxs("strong",{className:"handoff__acctname",children:["«",o.name,"»"]}),":"," "]}),v_[n.limit]," (",Math.round(n.utilization)," %) — работа прервана"," ",new Date(n.stoppedAt).toLocaleString(),". Окно сбросится: ",nE(n.resetsAt),"."]}),n.source==="journal"&&" Хэндофф собран автоматически из журнала."]})]}),d&&d.selectedId!==d.sourceId&&a.jsx("p",{className:"handoff__hint",children:Cf}),a.jsxs("div",{className:"handoff__actions",children:[a.jsx(j_,{label:d?"Продолжить":"Продолжить в новой сессии",primary:!0,choice:d,onContinue:l}),a.jsx("button",{type:"button",className:"btn btn--sm",onClick:r,children:"Показать хэндофф"}),a.jsx("button",{type:"button",className:"btn btn--sm",onClick:c,children:"Скрыть"})]})]})}function lE({handoff:n,onClose:l}){const[r,c]=x.useState("");return x.useEffect(()=>{let o=!1;return Sf(n.text).then(d=>{o||c(d)}),()=>{o=!0}},[n.text]),a.jsx(ws,{title:"Хэндофф",className:"modal--wide",onClose:l,children:a.jsx("div",{className:"markdown-preview",dangerouslySetInnerHTML:{__html:r}})})}function aE({state:n}){return a.jsxs("div",{className:"netguard",role:"alert",children:[a.jsxs("svg",{className:"netguard__icon",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[a.jsx("path",{d:"M8 1.8 14.2 13H1.8L8 1.8Z",stroke:"currentColor",strokeWidth:1.4,strokeLinejoin:"round"}),a.jsx("path",{d:"M8 6.4v3",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round"}),a.jsx("circle",{cx:"8",cy:"11.2",r:"0.8",fill:"currentColor"})]}),a.jsxs("div",{className:"netguard__copy",children:[a.jsx("strong",{className:"netguard__reason",children:n.reason??"Не удалось убедиться, что запросы идут через VPN"}),a.jsx("span",{className:"netguard__note",children:"Запросы агента остановлены, отправка отключена. Когда VPN вернётся, сессии можно продолжить: следующее сообщение возобновит разговор."})]})]})}const vf={fiveHour:"5-часовой лимит",sevenDay:"недельный лимит"},iE=12e3;function rE(n){const l=n%10,r=n%100;return l===1&&r!==11?"сессии":"сессиях"}function cE({notices:n,onDismiss:l}){return n.length===0?null:a.jsx("div",{className:"limittoasts",children:n.map(r=>a.jsx(oE,{notice:r,onDismiss:()=>l(r.id)},r.id))})}function oE({notice:n,onDismiss:l}){return x.useEffect(()=>{const r=window.setTimeout(l,iE);return()=>window.clearTimeout(r)},[l]),a.jsxs("div",{className:"limittoast",role:"status",children:[a.jsx("span",{className:"limittoast__dot","aria-hidden":"true"}),a.jsx("span",{className:"limittoast__body",children:n.stopped>0?a.jsxs(a.Fragment,{children:["Достигнут ",vf[n.limit]," (",Math.round(n.utilization)," %): работа прервана в ",n.stopped," ",rE(n.stopped),", хэндоффов —"," ",n.handoffs,". Сессии остаются запущенными."]}):a.jsxs(a.Fragment,{children:["Достигнут ",vf[n.limit]," (",Math.round(n.utilization)," %): занятых сессий не было — ничего не прервано."]})}),a.jsx("button",{type:"button",className:"limittoast__dismiss","aria-label":"Закрыть уведомление",onClick:l,children:"✕"})]})}function uE(n,l,r=Date.now()){if(!n||!n.available||!l)return null;const c=[["fiveHour",n.fiveHour,l.limitStopFiveHourPct],["sevenDay",n.sevenDay,l.limitStopSevenDayPct]];for(const[o,d,h]of c){if(!d||h<=0||d.utilization<h)continue;const m=Date.parse(d.resetsAt);if(!(!Number.isFinite(m)||m<=r))return{limit:o,utilization:d.utilization,resetsAt:m}}return null}function dE(n,l=Date.now()){const r=new Date(n),c=r.toLocaleTimeString("ru-RU",{hour:"2-digit",minute:"2-digit"});return r.toDateString()===new Date(l).toDateString()?c:`${r.toLocaleDateString("ru-RU",{day:"numeric",month:"short"})}, ${c}`}const fE=16;function hE({pane:n,width:l,onResize:r,onReset:c}){const o=Kr[n],d=x.useRef(null);function h(y){if(y.button!==0)return;const j=document.querySelector(".main"),v=j?Math.max(0,j.getBoundingClientRect().width-$v):0;d.current={x:y.clientX,width:l,max:Math.min(o.max,l+v)},y.currentTarget.setPointerCapture(y.pointerId),document.body.classList.add("is-resizing"),y.preventDefault()}function m(y){const j=d.current;if(!j)return;const v=o.side==="left"?y.clientX-j.x:j.x-y.clientX;r(Math.min(j.max,j.width+v))}function g(y){d.current&&(d.current=null,y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),document.body.classList.remove("is-resizing"))}function b(y){const j=y.key==="ArrowRight"?1:y.key==="ArrowLeft"?-1:0;j!==0&&(y.preventDefault(),r(l+j*fE*(o.side==="left"?1:-1)))}return a.jsx("div",{className:`pane-resizer pane-resizer--${n} pane-resizer--${o.side}`,role:"separator","aria-orientation":"vertical","aria-label":`Ширина панели ${o.label}`,"aria-valuenow":l,"aria-valuemin":o.min,"aria-valuemax":o.max,tabIndex:0,title:"Потяните, чтобы изменить ширину; двойной щелчок — ширина по умолчанию",onPointerDown:h,onPointerMove:m,onPointerUp:g,onPointerCancel:g,onDoubleClick:c,onKeyDown:b,children:a.jsx("span",{className:"pane-resizer__line","aria-hidden":"true"})})}const pE=16;function mE({height:n,onResize:l,onReset:r}){const c=x.useRef(null);function o(){const b=document.querySelector(".main .transcript, .main .editor");if(!b)return 1/0;const y=b.getBoundingClientRect().height-Xv;return Math.round(n+Math.max(0,y))}function d(b){b.button===0&&(c.current={y:b.clientY,height:n,max:o()},b.currentTarget.setPointerCapture(b.pointerId),document.body.classList.add("is-resizing-row"),b.preventDefault())}function h(b){const y=c.current;if(!y)return;const j=y.y-b.clientY;l(y.height+j,y.max)}function m(b){c.current&&(c.current=null,b.currentTarget.hasPointerCapture(b.pointerId)&&b.currentTarget.releasePointerCapture(b.pointerId),document.body.classList.remove("is-resizing-row"))}function g(b){const y=b.key==="ArrowUp"?1:b.key==="ArrowDown"?-1:0;y!==0&&(b.preventDefault(),l(n+y*pE,o()))}return a.jsx("div",{className:"term-resizer",role:"separator","aria-orientation":"horizontal","aria-label":"Высота панели терминала","aria-valuenow":n,"aria-valuemin":Z_,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 N_(){const n=document.documentElement,l=getComputedStyle(n),r=Q=>l.getPropertyValue(Q).trim(),c=r("--surface"),o=r("--text"),d=r("--text-2"),h=r("--muted"),m=r("--accent"),g=r("--accent-fg"),b=r("--select"),y=r("--danger"),j=r("--ok"),v=r("--warn"),S=r("--cm-fn"),k=r("--cm-key"),A=r("--cm-type"),C=w_(o,c,55),V=Q=>w_(Q,"#ffffff",25);return{background:c,foreground:o,cursor:m,cursorAccent:g,selectionBackground:b,black:C,brightBlack:h,red:y,brightRed:V(y),green:j,brightGreen:V(j),yellow:v,brightYellow:V(v),blue:S,brightBlue:V(S),magenta:k,brightMagenta:V(k),cyan:A,brightCyan:V(A),white:d,brightWhite:o}}function gE(){return getComputedStyle(document.documentElement).getPropertyValue("--mono").trim()}let Na=null;function xE(n){return Na||(Na=document.createElement("span"),Na.style.position="fixed",Na.style.width="0",Na.style.height="0",Na.style.opacity="0",Na.style.pointerEvents="none",document.body.appendChild(Na)),Na.style.color=n,getComputedStyle(Na).color}function w_(n,l,r){return xE(`color-mix(in srgb, ${n} ${100-r}%, ${l} ${r}%)`)}let Wd=null;function bE(){return Wd||(Wd=Promise.all([lt(()=>import("./xterm-D6Mng-DB.js").then(n=>n.x),__vite__mapDeps([22,23]),import.meta.url),lt(()=>import("./addon-fit-CevVMrUA.js").then(n=>n.a),__vite__mapDeps([24,23]),import.meta.url),lt(()=>import("./addon-web-links-CnB65OV_.js").then(n=>n.a),__vite__mapDeps([25,23]),import.meta.url),lt(()=>Promise.resolve({}),__vite__mapDeps([26]),import.meta.url)]).then(([n,l,r])=>({Terminal:n.Terminal,FitAddon:l.FitAddon,WebLinksAddon:r.WebLinksAddon})).catch(n=>{throw Wd=null,n})),Wd}function _E({terminals:n,activeId:l,blocked:r,error:c,onDismissError:o,height:d,offset:h,mobile:m=!1,zoomed:g,onToggleZoom:b,onSelect:y,onOpen:j,onClose:v,onInput:S,onResize:k,onAttach:A,onHide:C,registerSink:V}){const[Q,$]=x.useState(()=>N_());return x.useEffect(()=>{const I=new MutationObserver(()=>$(N_()));return I.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>I.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:I=>{b&&(I.target.closest("button")||b())},children:[a.jsx("div",{className:"termpanel__tabs",role:"tablist","aria-label":"Открытые терминалы",children:n.map(I=>a.jsxs("div",{role:"tab","aria-selected":I.id===l,className:"termtab"+(I.id===l?" is-on":"")+(I.exitCode!==null?" termtab--exited":""),onDoubleClick:G=>{b&&(G.target.closest(".termtab__close")||b())},children:[a.jsx("button",{className:"termtab__name",title:I.cwd,onClick:()=>y(I.id),children:I.title}),I.exitCode!==null&&a.jsx("span",{className:"termtab__code",title:`Оболочка завершилась с кодом ${I.exitCode}`,children:I.exitCode}),a.jsx("button",{className:"termtab__close",title:"Закрыть терминал","aria-label":`Закрыть терминал «${I.title}»`,onClick:()=>v(I.id),children:"✕"})]},I.id))}),a.jsx("button",{className:"termpanel__add",title:"Новый терминал","aria-label":"Новый терминал",disabled:r,onClick:j,children:"+"}),a.jsx("div",{className:"termpanel__spacer"}),b&&a.jsx("button",{className:"termpanel__zoom",title:g?"Свернуть терминал — то же самое, что двойной клик по вкладке":"Развернуть терминал на весь экран — то же самое, что двойной клик по вкладке","aria-label":g?"Свернуть терминал":"Развернуть терминал на весь экран","aria-pressed":g,onClick:b,children:a.jsx(_o,{active:g})}),a.jsx("button",{className:"termpanel__hide",title:"Скрыть панель","aria-label":"Скрыть панель терминала",onClick:C,children:"✕"})]}),c&&n.length>0&&a.jsx(k_,{message:c,strip:!0,onRetry:null,onDismiss:o}),a.jsxs("div",{className:"termpanel__body",children:[c&&n.length===0?a.jsx(k_,{message:c,onRetry:r?null:j,onDismiss:o}):r?a.jsxs("div",{className:"termpanel__empty",children:[a.jsx("p",{children:"Терминал с удалённых устройств выключен"}),a.jsx("p",{className:"termpanel__hint",children:"Откройте «Удалённый доступ» → «Прислать письмо»: на почту аккаунта придёт ссылка, и после перехода по ней терминал заработает прямо здесь. Если сейчас доберётесь до самого компьютера — там разрешение включается сразу, без письма."})]}):n.length===0&&a.jsxs("div",{className:"termpanel__empty",children:[a.jsx("p",{children:"Терминалов не открыто"}),a.jsx("button",{className:"btn btn--primary",onClick:j,children:"Открыть терминал"})]}),n.map(I=>a.jsx(vE,{id:I.id,exitCode:I.exitCode,active:I.id===l,theme:Q,mobile:m,onInput:S,onResize:k,onAttach:A,registerSink:V},I.id))]})]})}function k_({message:n,strip:l=!1,onRetry:r,onDismiss:c}){const{lede:o,hint:d,details:h}=yE(n);return a.jsxs("div",{className:l?"termfail termfail--strip":"termfail",role:"alert",children:[a.jsxs("div",{className:"termfail__text",children:[a.jsx("p",{className:"termfail__lede",children:o}),d&&a.jsx("p",{className:"termfail__hint",children:d}),h&&a.jsxs("details",{className:"termfail__details",children:[a.jsx("summary",{children:"Подробности"}),a.jsx("pre",{children:h})]})]}),a.jsxs("div",{className:"termfail__bar",children:[r&&a.jsx("button",{className:"btn btn--primary",onClick:r,children:"Открыть терминал"}),a.jsx("button",{className:"btn",onClick:c,children:"Понятно"})]})]})}function yE(n){const[l="",...r]=n.trim().split(`
|
|
125
|
-
|
|
126
|
-
`),c=l.split(`
|
|
127
|
-
`).map(o=>o.trim()).filter(o=>o!=="");return{lede:c[0]??n.trim(),hint:c.slice(1).join(" "),details:r.join(`
|
|
128
|
-
|
|
129
|
-
`).trim()}}function vE({id:n,exitCode:l,active:r,theme:c,mobile:o,onInput:d,onResize:h,onAttach:m,registerSink:g}){const b=x.useRef(null),y=x.useRef(null),j=x.useRef(!1),v=x.useRef(o);v.current=o;const S=x.useRef(c),k=x.useRef(l),[A,C]=x.useState("loading"),[V,Q]=x.useState(!1);return x.useEffect(()=>{if(!b.current)return;let I=!1,G=null;C("loading"),Q(!1);const M=window.setTimeout(()=>{I||Q(!0)},200);return(async()=>{var Ne;let z;try{z=await bE()}catch{window.clearTimeout(M),I||C("error");return}if(I||!b.current)return;window.clearTimeout(M);const{Terminal:R,FitAddon:K,WebLinksAddon:ae}=z,Y=new R({fontFamily:gE()||"monospace",fontSize:13,lineHeight:1.2,cursorBlink:!0,cursorStyle:"bar",scrollback:5e3,theme:S.current}),H=new K;Y.loadAddon(H),Y.loadAddon(new ae),Y.open(b.current),y.current=Y,Y.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 me=Y.getSelection();return me?(E.preventDefault(),Ma(me),!1):!E.shiftKey}return E.key==="v"||E.key==="V"?(E.preventDefault(),Lp().then(me=>{me&&Y.paste(me)}),!1):!0});const fe=E=>{E.preventDefault();const ee=Y.getSelection();if(ee){Ma(ee),Y.clearSelection();return}Lp().then(me=>{me&&Y.paste(me)})};(Ne=Y.element)==null||Ne.addEventListener("contextmenu",fe);const ue=Y.onData(E=>d(n,E));let X={cols:Y.cols,rows:Y.rows},D=null;const U=Y.onResize(({cols:E,rows:ee})=>{D!==null&&window.clearTimeout(D),D=window.setTimeout(()=>{D=null,!(E===X.cols&&ee===X.rows)&&(X={cols:E,rows:ee},h(n,E,ee))},100)}),ce=new ResizeObserver(()=>{try{H.fit()}catch{return}v.current&&Y.scrollToBottom()});ce.observe(b.current);const be=g(n,E=>{E.kind==="buffer"&&Y.reset(),Y.write(E.data)});m(n),k.current!==null&&!j.current&&(j.current=!0,Y.write(`\r
|
|
130
|
-
\x1B[2m— Процесс завершён (код ${k.current}) —\x1B[0m\r
|
|
131
|
-
`)),r&&Y.focus(),G=()=>{var E;D!==null&&window.clearTimeout(D),ce.disconnect(),(E=Y.element)==null||E.removeEventListener("contextmenu",fe),ue.dispose(),U.dispose(),be(),Y.dispose(),y.current=null},C("ready")})(),()=>{I=!0,window.clearTimeout(M),G==null||G(),G=null}},[n]),x.useEffect(()=>{if(!o)return;const $=b.current;if(!$)return;let I=null,G=0,M=!1;const z=Y=>{Y.pointerType==="mouse"||I!==null||(I=Y.pointerId,G=Y.clientY,M=!1)},R=Y=>{if(Y.pointerId!==I)return;const H=G-Y.clientY;if(!M){if(Math.abs(H)<4)return;M=!0,$.setPointerCapture(Y.pointerId)}G=Y.clientY;const fe=$.querySelector(".xterm-viewport");fe&&(fe.scrollTop+=H)},K=Y=>{Y.pointerId===I&&($.hasPointerCapture(Y.pointerId)&&$.releasePointerCapture(Y.pointerId),I=null,M=!1)},ae=Y=>Y.stopPropagation();return $.addEventListener("pointerdown",z),$.addEventListener("pointermove",R),$.addEventListener("pointerup",K),$.addEventListener("pointercancel",K),$.addEventListener("touchmove",ae,{capture:!0}),()=>{$.removeEventListener("pointerdown",z),$.removeEventListener("pointermove",R),$.removeEventListener("pointerup",K),$.removeEventListener("pointercancel",K),$.removeEventListener("touchmove",ae,{capture:!0}),I!==null&&$.hasPointerCapture(I)&&$.releasePointerCapture(I)}},[o]),x.useEffect(()=>{S.current=c,y.current&&(y.current.options.theme=c)},[c]),x.useEffect(()=>{var $;r&&(($=y.current)==null||$.focus())},[r]),x.useEffect(()=>{if(k.current=l,l===null){j.current=!1;return}if(j.current)return;const $=y.current;$&&(j.current=!0,$.write(`\r
|
|
132
|
-
\x1B[2m— Процесс завершён (код ${l}) —\x1B[0m\r
|
|
133
|
-
`))},[l]),a.jsxs("div",{className:"termview"+(r?" is-active":""),children:[a.jsx("div",{ref:b,className:"termview__surface"+(A==="ready"?"":" is-hidden")}),A==="loading"&&V&&a.jsxs("div",{className:"termview__state work",role:"status",children:[a.jsxs("div",{className:"work__dots",children:[a.jsx("span",{className:"work__dot"}),a.jsx("span",{className:"work__dot"}),a.jsx("span",{className:"work__dot"})]}),a.jsx("span",{className:"work__label",children:"Загружается терминал…"})]}),A==="error"&&a.jsxs("div",{className:"termview__state termview__state--error",role:"alert",children:[a.jsx("p",{children:"Не удалось загрузить терминал"}),a.jsx("p",{className:"termpanel__hint",children:"Соединение оборвалось раньше, чем приехал нужный модуль — на мобильном relay это обычное дело на слабой сети. Ниже — перезагрузка страницы, а не тихий повтор: открытые терминалы и их содержимое приедут обратно с хоста, а вот черновик в поле ввода внизу — нет."}),a.jsx("button",{className:"btn btn--primary",onClick:()=>window.location.reload(),children:"Перезагрузить страницу"})]})]})}const jE=2e5,NE=75,wE=90;function kE({tokens:n,maxTokens:l,fetchedAt:r}){if(n===null)return null;const c=l??jE,o=Math.min(100,Math.round(n/c*100)),d=`${n.toLocaleString()} из ${c.toLocaleString()} токенов${r?`
|
|
134
|
-
обновлено в ${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${SE(o)}`,style:{width:`${o}%`}})}),a.jsxs("span",{className:"contextbar__pct",children:[o,"%"]})]})}function SE(n){return n>=wE?" contextbar__fill--over":n>=NE?" contextbar__fill--warn":""}const Xy="ccv:last-session",EE=300*1e3,TE=1e4;function CE(){try{const n=localStorage.getItem(Xy);if(!n)return null;const l=JSON.parse(n);if(typeof l!="object"||l===null)return null;const{workspaceId:r,sessionId:c,claudeSessionId:o}=l;return typeof r!="string"||typeof c!="string"?null:{workspaceId:r,sessionId:c,claudeSessionId:typeof o=="string"?o:null}}catch{return null}}function S_(n){const l=new Set;return n.filter(r=>l.has(r.id)?!1:(l.add(r.id),!0))}function AE(n,l){const r=n.find(o=>o.id===l);if(r)return r;const c=n.filter(o=>mv(o.path).includes(l));return c.length===1?c[0]:void 0}function ME(n,l){return n.id===l.sessionId?!0:l.claudeSessionId?n.id===l.claudeSessionId||n.claudeSessionId===l.claudeSessionId:!1}const RE={mcp:"mcp",plugins:"plugins",plugin:"plugins"},E_=[{name:"login",description:"Войти в аккаунт Claude — Настройки, раздел входа",argumentHint:"",aliases:["signin","вход"]},{name:"switch-account",description:"Сменить аккаунт: выйти и войти заново (Настройки)",argumentHint:"",aliases:["account","аккаунт"]},{name:"logout",description:"Выйти из аккаунта Claude (Настройки)",argumentHint:"",aliases:["signout","выход"]}],T_=[{id:sr,name:"Основной",color:"orange",configDir:null,dir:"",main:!0,liveSessions:0}];function C_(n,l,r){if(n===null)return null;const c=n.lastIndexOf("/");if(c===-1&&n!=="")return l;const o=r[c===-1?"":n.slice(0,c)];if(!o)return null;const d=n.slice(c+1).toLowerCase();return d===""?{query:n,entries:o}:{query:n,entries:o.filter(h=>h.name.toLowerCase().includes(d)).sort((h,m)=>A_(h.name,d)-A_(m.name,d))}}function A_(n,l){return n.toLowerCase().startsWith(l)?0:1}function M_(n,l){const r=n.find(o=>o.value===l)??n.find(o=>o.resolvedModel===l),c=l&&!r?l:null;return{rows:[...c?[{value:c,resolvedModel:c,displayName:c,description:"задана в настройках",supportsEffort:!1,effortLevels:[],supportsThinking:!0,supportsAutoMode:!1}]:[],...n],selected:(r==null?void 0:r.value)??c??(n.some(o=>o.value==="default")?"default":"")}}function DE(){var Wa,nd;const n=x.useRef(null),[l,r]=x.useState(!1),[c,o]=x.useState("Нет связи с хостом"),[d,h]=x.useState(null),[m,g]=x.useState(null),b=(m==null?void 0:m.status)==="blocked",[y,j]=x.useState(!1),v=x.useMemo(()=>sf()==="relay",[]),[S,k]=x.useState([]),[A,C]=x.useState([]),[V,Q]=x.useState([]),[$,I]=x.useState([]),[G,M]=x.useState([]),[z,R]=x.useState(!1),[K,ae]=x.useState([]),[Y,H]=x.useState([]),[fe,ue]=x.useState({}),[X,D]=x.useState([]),[U,ce]=x.useState([]),[be,Ne]=x.useState(null),[E,ee]=x.useState(null),[me,Se]=x.useState(null),[q,we]=x.useState(null),[ie,Ie]=x.useState(null),[ze,Zt]=x.useState(null),[Qe,un]=x.useState(zs),[Ze,dt]=x.useState(sp),[tt,Gt]=x.useState(!1),[es,ct]=x.useState(!1),ft=Nf("(max-width: 860px)"),[Ce,Je]=x.useState(!1);x.useEffect(()=>{ft||Je(!1)},[ft]);const[St,pt]=x.useState(!1),[Xe,vn]=x.useState([]),[zn,Tt]=x.useState(!1),[tn,is]=x.useState(zs),[gn,Sn]=x.useState(null),[ms,Et]=x.useState(null),[Pt,En]=x.useState(null),[Wt,ts]=x.useState(null),[de,ke]=x.useState(null),[Ke,it]=x.useState({}),[Be,nt]=x.useState([]),[J,ge]=x.useState(null),[De,qe]=x.useState(null),[Yt,Tn]=x.useState([]),[Is,Dl]=x.useState([]),[Zl,Bs]=x.useState([]),[Es,Cn]=x.useState([]),[ll,dn]=x.useState(null),[Hs,zt]=x.useState(null),[We,rs]=x.useState({}),[Ts,Jl]=x.useState(null),[Pl,Ol]=x.useState({}),[An,al]=x.useState(null),[xl,il]=x.useState({}),[Ll,Mn]=x.useState([]),[Ut,Fn]=x.useState(!1),[Un,Cs]=x.useState(T_),[cs,As]=x.useState({}),[bl,In]=x.useState(null),[$s,ns]=x.useState(null),[vt,xn]=x.useState(null),[at,Wl]=x.useState(()=>bv()??sr),[Rn,qs]=x.useState(null),Zn=(Rn==null?void 0:Rn.enabledProviders)??["claude","antigravity"],[_l,Bn]=x.useState(!1),[Dn,Gs]=x.useState({}),[bn,gs]=x.useState(null),[xt,je]=x.useState(null),[T,P]=x.useState(!1),[ye,,Le]=Iv(),Ge=Yv(),[He,Ct]=x.useState(!1),[bt,jn]=x.useState(null),[At,Nn]=x.useState(null),[_n,Ms]=x.useState(null),[yl,os]=x.useState(null),[Xt,Da]=x.useState(null),[fn,Ys]=x.useState(""),[ur,ea]=x.useState(null),[rl,dr]=x.useState([]),[Oa,ta]=x.useState(!1),[mi,cl]=x.useState(null),[fr,w]=x.useState(!1),[W,ve]=x.useState(!1),[Re,jt]=x.useState({}),[Hn,nn]=x.useState([""]),[On,xs]=x.useState([]),[hr,La]=x.useState(null),[Af,na]=x.useState(null),[za,ec]=x.useState(null),[pr,tc]=x.useState(null),[Mf,yo]=x.useState(null),[mr,Ru]=x.useState({}),[nc,Du]=x.useState({}),[Ua,Ia]=x.useState(!1),[Rf,vo]=x.useState(null),[sc,lc]=x.useState(null),Ou=x.useRef(0),ac=x.useRef(null),[gi,jo]=x.useState(!1),[ic,gr]=x.useState([]),[Df,rc]=x.useState(null),[Of,xi]=x.useState(null),sa=Vv(),No=Zv(ft&&gi),bi=x.useRef(new Map),la=(Rn==null?void 0:Rn.terminalEnabled)===!0,xr=sf()==="relay"&&((Wa=d==null?void 0:d.shell)==null?void 0:Wa.enabled)!==!0,cc=x.useRef(!1),Lu=x.useCallback((p,L)=>(bi.current.set(p,L),()=>{bi.current.get(p)===L&&bi.current.delete(p)}),[]),[Xs,oc]=x.useState(!1),[zu,uc]=x.useState(null),[wo,br]=x.useState(zs),[Rs,aa]=x.useState(null),[_r,vl]=x.useState({}),_i=x.useRef([]),[sn,yr]=x.useState(null);function ko(p){yr(L=>L===p?null:p)}x.useEffect(()=>{(ft||sn==="terminal"&&!gi||sn==="files"&&!W||sn==="search"&&!Ua||sn==="git"&&!He||sn==="ask"&&!Xs||sn==="main"&&On.length===0)&&yr(null)},[sn,ft,gi,W,Ua,He,Xs,On.length]);const[Uu]=x.useState(CE),dc=x.useRef(Uu),vr=x.useRef(!1),$n=x.useRef(null),jr=x.useRef(null),Nr=x.useRef(null),ia=x.useRef(null),Iu=x.useRef(0),Nt=x.useRef(null),yi=x.useRef(0);$n.current=ie,Nt.current=q,yi.current=Qe.lastSeq;const So=x.useRef(Ze);So.current=Ze;const jl=x.useRef(null),Eo=x.useRef(0);Eo.current=wo.lastSeq;const wr=x.useRef(null),vi=x.useRef(""),kr=x.useRef(null),Vs=x.useRef([]),fc=x.useRef([""]);Vs.current=On,fc.current=Hn;const zl=x.useRef(new Map),ji=x.useRef(new Set),Ni=x.useRef(null),ol=x.useRef(null),Ba=x.useRef(0),Ha=x.useRef(new Set);x.useEffect(()=>{const p=Sv();if(!p)return;n.current=p;const L=()=>{r(p.connected),o(p.statusText)};p.onStatus(L),p.onReconnect(()=>{L(),Ol({});const rt=$n.current;rt&&p.send({type:"session.sync",sessionId:rt,sinceSeq:yi.current});const ln=jl.current;ln&&p.send({type:"session.sync",sessionId:ln,sinceSeq:Eo.current})});const re=p.on(rt=>Bu(rt));p.connect();const Te=window.setInterval(()=>{L(),p.connected&&p.send({type:"ping",nonce:Date.now()})},15e3);return()=>{re(),window.clearInterval(Te),p.close()}},[]);const Bu=x.useCallback(p=>{var L,re,Te,rt,ln,Ln,fl,Bi,Gn,en,xa;switch(p.type){case"hello.ok":r(!0);break;case"workspace.list":{k(S_(p.workspaces)),C(S_(p.archived)),ke(null),we(Me=>{var Yn;if(Me)return Me;const Ye=dc.current,ot=Ye&&AE(p.workspaces,Ye.workspaceId);return Ye&&ot&&ot.id!==Ye.workspaceId&&(dc.current={...Ye,workspaceId:ot.id}),(ot==null?void 0:ot.id)??((Yn=p.workspaces[0])==null?void 0:Yn.id)??null});const _e=kr.current;if(!_e)break;const Ee=p.workspaces.find(Me=>BE(Me.path,_e));if(!Ee)break;kr.current=null,pt(!1),we(Ee.id);break}case"workspace.candidates":if(p.query.trim()!==vi.current)break;vn(p.candidates),p.source==="host"&&Tt(!1);break;case"finder.opened":wr.current=p.sessionId;break;case"workspace.roots":nt(p.roots);break;case"workspace.created":if(we(p.workspace.id),p.warnings.length===0){pt(!1),Et(null);break}ge({path:p.workspace.path,warnings:p.warnings});break;case"session.list":if(ue(_e=>({..._e,[p.workspaceId]:{sessions:p.sessions??[],archived:p.archived??[]}})),p.workspaceId!==Nt.current)break;ae(p.sessions),H(p.archived);break;case"folder.list":Q(p.workspaceFolders),R(!0),I(p.sessionFolders),M(p.pinnedFolders??[]),En(p.projectsRoot??null),ke(null);break;case"session.pinned":D(p.sessions);break;case"session.live":ce(p.sessions);break;case"order.state":Se(p.order);break;case"session.summary":if(p.session.id===wr.current){Sn(p.session);break}if(p.session.parentSessionId){p.session.id===jl.current&&aa(p.session);break}if(ce(_e=>{const Ee=_e.findIndex(Ye=>Ye.id===p.session.id);if(p.session.state==="closed")return Ee===-1?_e:_e.filter(Ye=>Ye.id!==p.session.id);if(Ee===-1)return[..._e,p.session];const Me=_e.slice();return Me[Ee]=p.session,Me}),ae(_e=>{const Ee=_e.findIndex(Ye=>Ye.id===p.session.id);if(Ee===-1)return p.session.workspaceId!==Nt.current?_e:[p.session,..._e];const Me=_e.slice();return Me[Ee]=p.session,Me}),ue(_e=>{const Ee=_e[p.session.workspaceId];if(!Ee)return _e;const Me=Ee.sessions.findIndex(ot=>ot.id===p.session.id);let Ye;if(Me!==-1)Ye=Ee.sessions.slice(),Ye[Me]=p.session;else{if(Ee.archived.some(ot=>ot.id===p.session.id))return _e;Ye=[p.session,...Ee.sessions]}return{..._e,[p.session.workspaceId]:{...Ee,sessions:Ye}}}),D(_e=>{const Ee=_e.findIndex(Ye=>Ye.id===p.session.id);if(Ee===-1)return _e;const Me=_e.slice();return Me[Ee]={...p.session,pinned:!0,..._e[Ee].pinnedAt?{pinnedAt:_e[Ee].pinnedAt}:{}},Me}),$n.current===null&&Nr.current&&Nr.current.workspaceId===p.session.workspaceId&&(G_(p.session.id,Nr.current.text),Nr.current=null),ia.current!==null&&ia.current===p.session.workspaceId&&p.session.workspaceId===Nt.current&&(ia.current=null,Ie(_e=>_e??p.session.id)),((L=jr.current)==null?void 0:L.sessionId)===p.session.id){const _e=jr.current;p.session.state==="error"?jr.current=null:p.session.state!=="closed"&&(jr.current=null,(re=n.current)==null||re.send({type:"prompt.send",sessionId:_e.sessionId,text:_e.text,images:_e.images}))}break;case"usage.state":p.sessionId===$n.current&&(gs(p.usage),P(!1));break;case"context.state":p.sessionId===$n.current&&(je(p.context),P(!1));break;case"session.capabilities":p.sessionId===$n.current&&Zt(p.capabilities);break;case"session.events":if(p.sessionId===jl.current){br(_e=>lf(_e,p.entries));break}if(p.sessionId===wr.current){is(_e=>lf(_e,p.entries));break}if(p.sessionId!==$n.current)break;for(const _e of p.entries){if(_e.event.kind!=="rewound")continue;const Ee=_e.event.toUserIndex,Me=zv(So.current.entries,Ee),Ye=Me.reduce((ot,Yn)=>Yn.event.kind==="user.message"?ot+1:ot,0);dt(ot=>({...ot,entries:Me})),un(ot=>({...ot,items:Uv(ot.items,Ee,Ye)}))}un(_e=>lf(_e,p.entries));break;case"session.history":if(p.sessionId!==$n.current)break;dt(_e=>Dv(_e,p));break;case"side.opened":{if(p.parentSessionId!==$n.current)break;jl.current=p.sessionId,uc(p.sessionId);const _e=_i.current;_i.current=[];for(const Ee of _e)Ee(p.sessionId);break}case"side.closed":if(p.parentSessionId!==$n.current)break;jl.current=null,uc(null),br(zs),aa(null);break;case"git.state":if(p.workspaceId!==Nt.current)break;jn(p.state);break;case"git.commit":if(p.workspaceId!==Nt.current)break;Nn(p.detail);break;case"git.result":if(p.workspaceId!==Nt.current)break;os({ok:p.ok,message:p.message,url:p.url}),p.ok&&(Nn(null),Ms(null),ta(!1),w(!1));break;case"git.busy":if(p.workspaceId!==Nt.current)break;Ys(p.label);break;case"git.files":if(p.workspaceId!==Nt.current)break;cl({files:p.files,truncated:p.truncated});break;case"github.status":ea(p.status);break;case"github.owners":dr(p.owners);break;case"fs.dir":if(p.workspaceId!==Nt.current)break;jt(_e=>({..._e,[p.path]:p.entries}));break;case"fs.search":if(p.workspaceId!==Nt.current)break;if(p.scope!=="tree"){const _e=p.scope;Du(Ee=>({...Ee,[_e]:{query:p.query,entries:p.entries}}));break}yo({query:p.query,entries:p.entries,truncated:p.truncated});break;case"fs.grep":if(p.workspaceId!==Nt.current)break;vo({query:p.query,matches:p.matches,truncated:p.truncated});break;case"fs.file":{if(p.workspaceId!==Nt.current)break;const _e=ji.current.delete(p.file.path);xs(Me=>{const Ye=Me.findIndex(Go=>Go.path===p.file.path);if(Ye===-1)return[...Me,Bb(p.file,++Ba.current)];const ot=Me[Ye],Yn=Me.slice();return Yn[Ye]=ot.saved===p.file.content&&!oi(ot)?{...ot,mtime:p.file.mtime,size:p.file.size,stale:!1}:Bb(p.file,++Ba.current),Yn}),_e&&La(p.file.path);const Ee=ac.current;Ee&&Ee.path===p.file.path&&(ac.current=null,lc({...Ee,token:++Ou.current}));break}case"fs.media":{if(p.workspaceId!==Nt.current)break;Ha.current.delete(p.path),xs(_e=>_e.map(Ee=>Ee.path===p.path?{...Ee,mediaBase64:p.base64,mediaError:void 0}:Ee));break}case"fs.mediaFailed":{if(p.workspaceId!==Nt.current)break;Ha.current.delete(p.path),xs(_e=>_e.map(Ee=>Ee.path===p.path?{...Ee,mediaError:p.message}:Ee));break}case"fs.saved":{if(p.workspaceId!==Nt.current)break;const _e=zl.current.get(p.path);zl.current.delete(p.path);const Ee=_e!==void 0;xs(Ye=>Ye.map(ot=>ot.path!==p.path?ot:Ee?{...ot,saved:_e,mtime:p.mtime,size:p.size,stale:!1}:{...ot,stale:!0}));const Me=Vs.current.find(Ye=>Ye.path===p.path);!Ee&&Me&&!oi(Me)&&((Te=n.current)==null||Te.send({type:"fs.read",workspaceId:p.workspaceId,path:p.path})),(rt=n.current)==null||rt.send({type:"git.state",workspaceId:p.workspaceId});break}case"fs.result":{if(p.workspaceId!==Nt.current)break;if(na({ok:p.ok,message:p.message}),p.ok||zl.current.delete(p.path),p.conflict&&xs(Ee=>Ee.map(Me=>Me.path===p.path?{...Me,stale:!0}:Me)),ol.current===p.path){const Ee=ol.current;ol.current=null,p.ok&&(ji.current.add(Ee),(ln=n.current)==null||ln.send({type:"fs.read",workspaceId:p.workspaceId,path:Ee}))}const _e=Ni.current;if(p.ok&&_e&&_e.to===p.path){Ni.current=null;const Ee=Me=>Me===_e.from?_e.to:Me.startsWith(`${_e.from}/`)?_e.to+Me.slice(_e.from.length):Me;xs(Me=>Me.map(Ye=>({...Ye,path:Ee(Ye.path)}))),La(Me=>Me===null?null:Ee(Me)),nn(Me=>Me.map(Ee)),jt(Me=>{const Ye={};for(const[ot,Yn]of Object.entries(Me))ot===_e.from||ot.startsWith(`${_e.from}/`)||(Ye[ot]=Yn);return Ye})}p.ok&&((Ln=n.current)==null||Ln.send({type:"git.state",workspaceId:p.workspaceId}));break}case"term.list":if(p.workspaceId!==Nt.current)break;gr(p.terminals);break;case"term.opened":if(p.terminal.workspaceId!==Nt.current)break;xi(null),gr(_e=>{const Ee=_e.findIndex(Ye=>Ye.id===p.terminal.id);if(Ee===-1)return[..._e,p.terminal];const Me=_e.slice();return Me[Ee]=p.terminal,Me}),cc.current&&(cc.current=!1,rc(p.terminal.id));break;case"term.buffer":(fl=bi.current.get(p.id))==null||fl({kind:"buffer",data:p.data});break;case"term.data":(Bi=bi.current.get(p.id))==null||Bi({kind:"data",data:p.data});break;case"term.exit":gr(_e=>_e.map(Ee=>Ee.id===p.id?{...Ee,exitCode:p.exitCode}:Ee));break;case"term.closed":gr(_e=>_e.filter(Ee=>Ee.id!==p.id));break;case"mcp.list":p.sessionId===$n.current&&Tn(p.servers);break;case"mcp.auth":p.sessionId===$n.current&&zt(p.state);break;case"plugin.list":if(p.sessionId!==$n.current)break;Dl(p.plugins),Bs(p.marketplaces),Cn(p.catalog);break;case"operation.result":p.sessionId===$n.current&&dn(p.result);break;case"auth.status":As(_e=>({..._e,[p.accountId]:p.status}));break;case"accounts.candidates":ns(p.candidates);break;case"accounts.usage":it(_e=>{const Ee={..._e};for(const[Me,Ye]of Object.entries(p.usage))(Ye!==null||!(Me in Ee))&&(Ee[Me]=Ye);return Ee});break;case"accounts.state":Cs(p.accounts.length>0?p.accounts:T_),In(null),As(_e=>{const Ee={};for(const Me of p.accounts)Ee[Me.id]=p.auth[Me.id]??_e[Me.id]??null;return Ee});break;case"relay.state":h(p.state);break;case"network.state":g(p.state);break;case"settings.state":qs(p.settings);break;case"handoff.state":rs(_e=>{if(!p.handoff){if(!(p.sessionId in _e))return _e;const Ee={..._e};return delete Ee[p.sessionId],Ee}return{..._e,[p.sessionId]:p.handoff}});break;case"handoff.written":Ol(_e=>{if(!(p.sessionId in _e))return _e;const Ee={..._e};return delete Ee[p.sessionId],Ee}),p.handoff&&$n.current===p.sessionId?al(p.handoff):p.handoff||console.warn("[handoff] хост не смог записать хэндофф",p.sessionId);break;case"limit.stopped":Iu.current+=1,Mn(_e=>[..._e,{id:Iu.current,limit:p.limit,utilization:p.utilization,stopped:p.stopped,handoffs:p.handoffs}]);break;case"auth.login":Gs(_e=>({..._e,[p.accountId]:p.state})),p.state.active&&Fn(!0);break;case"session.closed":ce(_e=>_e.filter(Ee=>Ee.id!==p.sessionId)),ae(_e=>_e.map(Ee=>Ee.id===p.sessionId?{...Ee,state:"closed"}:Ee)),ue(_e=>{let Ee=!1;const Me={};for(const[Ye,ot]of Object.entries(_e))ot.sessions.some(Yn=>Yn.id===p.sessionId&&Yn.state!=="closed")?(Ee=!0,Me[Ye]={...ot,sessions:ot.sessions.map(Yn=>Yn.id===p.sessionId?{...Yn,state:"closed"}:Yn)}):Me[Ye]=ot;return Ee?Me:_e});break;case"error":console.error("[host]",p.message,p.context??""),(p.context==="workspace.open"||p.context==="workspace.create")&&(kr.current=null,Et(p.message)),(Gn=p.context)!=null&&Gn.startsWith("term.")&&xi(p.message),(en=p.context)!=null&&en.startsWith("folder.")&&(ke(null),ts(`${p.message} Ничего не изменилось.`)),(xa=p.context)!=null&&xa.startsWith("accounts.")&&In(p.message);break}},[]),se=x.useCallback(p=>{var L;(L=n.current)==null||L.send(p)},[]);x.useEffect(()=>{q&&se({type:"session.list",workspaceId:q})},[q,se]),x.useEffect(()=>{l&&se({type:"session.pins"})},[l,se]),x.useEffect(()=>{l&&se({type:"settings.get"})},[l,se]),x.useEffect(()=>{if(l)return se({type:"session.drafts",sessionIds:Y_()}),Av(p=>se({type:"session.drafts",sessionIds:p}))},[l,se]),x.useEffect(()=>{if(vr.current)return;const p=dc.current;if(!p||!q)return;if(q!==p.workspaceId){vr.current=!0;return}if(ie){vr.current=!0;return}if(K.length===0)return;const L=K.find(re=>ME(re,p));vr.current=!0,L&&L.state!=="closed"&&_s(L)},[K,q,ie]),x.useEffect(()=>{!q||xr||!la||se({type:"term.list",workspaceId:q})},[q,xr,la,se]),x.useEffect(()=>{rc(p=>{var L;return p&&ic.some(re=>re.id===p)?p:((L=ic[0])==null?void 0:L.id)??null})},[ic]),x.useEffect(()=>{St&&se({type:"workspace.roots"})},[St,se]);const $a=x.useCallback(()=>{const p=$n.current;p&&(P(!0),se({type:"usage.get",sessionId:p}),se({type:"context.get",sessionId:p}))},[se]);x.useEffect(()=>{if(!T)return;const p=window.setTimeout(()=>P(!1),TE);return()=>window.clearTimeout(p)},[T]);const hc=x.useMemo(()=>{const p=Math.max((bn==null?void 0:bn.fetchedAt)??0,(xt==null?void 0:xt.fetchedAt)??0);return p>0?p:null},[bn==null?void 0:bn.fetchedAt,xt==null?void 0:xt.fetchedAt]);x.useEffect(()=>{if(je(null),!ie)return;$a();const p=()=>{document.hidden||$a()},L=window.setInterval(p,EE),re=()=>{document.hidden||$a()};return document.addEventListener("visibilitychange",re),()=>{window.clearInterval(L),document.removeEventListener("visibilitychange",re)}},[ie,$a]),x.useEffect(()=>{if(!ie){dt(sp);return}dt({...sp,loading:!0}),se({type:"session.history",sessionId:ie})},[ie,se]);const Hu=x.useCallback(()=>{!ie||Ze.loading||!tb(Ze)||(dt(p=>({...p,loading:!0})),se({type:"session.history",sessionId:ie,before:V_(Ze)}))},[ie,Ze,se]),Lf=x.useMemo(()=>Ov(Ze.entries),[Ze.entries]),Z=x.useMemo(()=>K.find(p=>p.id===ie)??null,[K,ie]),Ul=ie?(Z==null?void 0:Z.claudeSessionId)??ie:null,Qs=Ul?We[Ul]??null:null;x.useEffect(()=>{Ul&&se({type:"handoff.get",sessionId:Ul})},[Ul,se]),x.useEffect(()=>{Ts&&!(Ts.sessionId in We)&&Jl(null)},[We,Ts]);const To=x.useMemo(()=>{var re;if(!bn)return null;const p=(((re=bn.buckets)==null?void 0:re.length)??0)>0,L=(Z==null?void 0:Z.provider)==="antigravity";return p===L?bn:null},[bn,Z==null?void 0:Z.provider]),wi=Un.length>1;function Ks(p){return Un.some(L=>L.id===p)?p:sr}const pc=x.useMemo(()=>({accounts:Un,auth:cs,multi:Un.length>1}),[Un,cs]),hn=wi&&Z&&Z.provider!=="antigravity"?Un.find(p=>p.id===Z.accountId)??null:null,ki=x.useMemo(()=>{const p={};for(const L of K)L.provider!=="antigravity"&&(L.state!=="running"&&L.state!=="waiting_permission"||(p[L.accountId]=(p[L.accountId]??0)+1));return p},[K]),mc="Обновить лимиты и контекст",gc=mc+(hc?`
|
|
135
|
-
обновлено в ${new Date(hc).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:"");x.useEffect(()=>{document.documentElement.dataset.provider=(Z==null?void 0:Z.provider)??"claude"},[Z==null?void 0:Z.provider]),x.useEffect(()=>{(Z==null?void 0:Z.provider)==="antigravity"&&oc(!1)},[Z==null?void 0:Z.provider]);const Il=S.find(p=>p.id===q)??A.find(p=>p.id===q)??null;x.useEffect(()=>{if(!q||!ie)return;const p={workspaceId:q,sessionId:ie,claudeSessionId:(Z==null?void 0:Z.claudeSessionId)??null};try{localStorage.setItem(Xy,JSON.stringify(p))}catch{}},[q,ie,Z==null?void 0:Z.claudeSessionId]),x.useEffect(()=>{if(!de)return;const p=window.setTimeout(()=>ke(null),6e4);return()=>window.clearTimeout(p)},[de]);function xc(p){kr.current=p,Et(null),se({type:"workspace.open",path:p})}function qa(p,L,re,Te){Et(null),se({type:"workspace.create",parent:p,name:L,init:re,...Te?{folderId:Te}:{}})}function $u(p){if(vi.current=p,!p){vn([]),Tt(!1);return}Tt(!0),se({type:"workspace.find",query:p})}function bc(p){vi.current=p,is(zs),se({type:"workspace.find.agent",query:p})}function Si(){pt(!1),Et(null),ge(null),vn([]),is(zs),Sn(null),vi.current="",kr.current=null}function Ei(){const p=$n.current;p&&jl.current&&se({type:"side.reset",sessionId:p}),jl.current=null,uc(null),br(zs),aa(null),vl({}),_i.current=[]}function Ds(p){se({type:"workspace.close",workspaceIds:p}),Nl(p)}function Co(p){se({type:"workspace.unmark",workspaceIds:p}),Nl(p)}function Nl(p){!q||!p.includes(q)||(Ei(),we(null),Ie(null),ae([]),H([]),un(zs),Zt(null),ct(!1))}function qu(p,L){se({type:"session.archive",workspaceId:p,sessionIds:L}),ie&&(L.includes(ie)||Z!=null&&Z.claudeSessionId&&L.includes(Z.claudeSessionId))&&(Ei(),Ie(null),un(zs),Zt(null),ct(!1))}function _c(p){se({type:"workspace.restore",workspaceIds:p})}function Ga(p,L,re){ts(null),se({type:"folder.create",scope:p,name:L,workspaceId:re})}function Ao(p,L){ts(null),se({type:"folder.rename",folderId:p,name:L})}function Gu(p,L){se({type:"folder.setColor",folderId:p,color:L})}function Mo(p,L,re,Te){ts(null),p==="workspace"&&ke(L),se({type:"folder.assign",scope:p,itemId:L,folderId:re,workspaceId:Te})}function Yu(p=Zn[0]??"claude",L){if(!q)return;let re;p==="claude"&&wi&&(re=L??Ks(at),Wl(re),_v(re)),Ei(),Ie(null),Zt(null),un(zs),ct(!1),ia.current=q,se({type:"session.start",workspaceId:q,provider:p,...re?{accountId:re}:{}}),Gt(!1)}function bs(p){ia.current=null,Ei(),Io(),we(p),Ie(null),un(zs),Zt(null),ct(!1),jn(null),Nn(null),Ms(null),os(null),Ys(""),ta(!1),cl(null),w(!1),gr([]),rc(null)}function Ti(p,L,re){se({type:"session.pin",workspaceId:p,sessionIds:L,pinned:re})}function Ci(p){return p.state==="running"||p.state==="waiting_permission"||p.state==="reconnecting"||p.backgroundWork}function Ai(p){if(Ci(p)){Ne(p);return}se({type:"session.close",sessionId:p.id})}function Sr(p,L,re){Se(Te=>{const rt=Te??{workspaces:[],sessions:{},pinned:[],live:[]};if(p==="sessions"){if(!re)return Te;const ln={...rt.sessions};return L&&L.length>0?ln[re]=L:delete ln[re],{...rt,sessions:ln}}return{...rt,[p]:L??[]}}),se({type:"order.set",scope:p,ids:L,...re?{workspaceId:re}:{}})}function Fs(p){p.workspaceId!==q&&bs(p.workspaceId),_s(p)}function _s(p){if(Gt(!1),Ei(),un(zs),Zt(null),ct(!1),p.state==="closed"){Ie(null),ia.current=p.workspaceId,se({type:"session.start",workspaceId:p.workspaceId,resume:p.id});return}ia.current=null,Ie(p.id),se({type:"session.sync",sessionId:p.id,sinceSeq:0})}function ra(p,L){if(!ie||b)return!1;const re=ie,Te=Z;return ul(()=>{if((Te==null?void 0:Te.state)==="closed"){jr.current={sessionId:Te.id,text:p,images:L},_s(Te);return}se({type:"prompt.send",sessionId:re,text:p,images:L})})}function ul(p){const L=(Z==null?void 0:Z.provider)==="antigravity"?null:uE(bn,Rn);return L?new Promise(re=>{ee(Te=>(Te==null||Te.resolve(!1),{warning:L,resolve:re}))}).then(re=>(re&&p(),re)):(p(),!0)}function Zs(p){E&&(E.resolve(p),ee(null))}function wl(p){const L=U.find(rt=>(rt.claudeSessionId??rt.id)===p.sessionId&&rt.state!=="closed"),re=yc(p.sessionId,p.workspaceId,p.limit!==null),Te=re!=null&&re.canChoose?re.selectedId:(re==null?void 0:re.sourceId)??(L==null?void 0:L.accountId);jc(p.workspaceId,p.sessionId,p.text,Te),L&&se({type:"session.close",sessionId:L.id})}function yc(p,L,re){var xa,_e,Ee;if(!wi)return null;const Te=Me=>Me.id===p||Me.claudeSessionId===p,rt=U.find(Te)??K.find(Te)??((xa=fe[L])==null?void 0:xa.sessions.find(Te));if((rt==null?void 0:rt.provider)==="antigravity")return null;const ln=rt==null?void 0:rt.accountId,Ln=Un.filter(Me=>{var Ye;return((Ye=cs[Me.id])==null?void 0:Ye.loggedIn)!==!1}),fl=Me=>Me&&Ln.some(Ye=>Ye.id===Me)?Me:void 0,Bi=fl(xl[p]),Gn=ln?(_e=Ln.find(Me=>Me.id!==ln))==null?void 0:_e.id:void 0,en=Bi??(re?Gn:void 0)??fl(ln)??fl(sr)??((Ee=Ln[0])==null?void 0:Ee.id)??sr;return{source:Un.find(Me=>Me.id===ln)??null,sourceId:ln,targets:Ln,selectedId:en,canChoose:Ln.length>1}}function vc(p){jc(p.workspaceId,p.claudeSessionId??p.id,null,p.accountId)}function jc(p,L,re,Te){Nr.current=re===null?null:{workspaceId:p,text:re},p!==q?bs(p):(Ei(),Ie(null),Zt(null),un(zs),ct(!1)),ia.current=p,se({type:"session.start",workspaceId:p,provider:"claude",...wi&&Te?{accountId:Te}:{},continuesFrom:L,...re===null?{}:{fromHandoff:!0}}),Gt(!1)}x.useEffect(()=>{An&&(al(null),wl(An))},[An]);function Ro(p){Pl[p.id]||(Ol(L=>({...L,[p.id]:!0})),se({type:"session.handoff",sessionId:p.id}))}function Jn(p){se({type:"handoff.dismiss",sessionId:p})}function Vt(p,L){se({type:"session.rename",sessionId:p.id,title:L,workspaceId:p.workspaceId}),ae(re=>re.map(Te=>Te.id===p.id?{...Te,title:L}:Te)),ue(re=>{const Te=re[p.workspaceId];return Te?{...re,[p.workspaceId]:{...Te,sessions:Te.sessions.map(rt=>rt.id===p.id?{...rt,title:L}:rt)}}:re})}function ht(p){ie&&(Gt(!1),dn(null),zt(null),qe(p),se({type:"mcp.list",sessionId:ie}),se({type:"plugin.list",sessionId:ie}))}const ca={mcpAction:(p,L)=>{ie&&(dn(null),se({type:"mcp.action",sessionId:ie,name:p,action:L}))},mcpAuth:p=>{ie&&(dn(null),zt({name:p,active:!0,url:"",callbackExpected:!1,done:!1,error:null}),se({type:"mcp.auth",sessionId:ie,name:p}))},mcpAuthCallback:(p,L)=>{ie&&se({type:"mcp.auth_callback",sessionId:ie,name:p,callbackUrl:L})},mcpAdd:(p,L)=>{ie&&se({type:"mcp.add",sessionId:ie,name:p,draft:L})},mcpRemove:p=>{ie&&se({type:"mcp.remove",sessionId:ie,name:p})},pluginInstall:p=>{ie&&se({type:"plugin.install",sessionId:ie,spec:p})},pluginUninstall:p=>{ie&&se({type:"plugin.uninstall",sessionId:ie,id:p})},pluginToggle:(p,L)=>{ie&&se({type:"plugin.toggle",sessionId:ie,id:p,enabled:L})},marketplaceAdd:p=>{ie&&se({type:"marketplace.add",sessionId:ie,source:p})},marketplaceRemove:p=>{ie&&se({type:"marketplace.remove",sessionId:ie,name:p})}};function Os(){Gt(!1),Fn(!0),In(null);for(const p of Un)se({type:"auth.status",accountId:p.id})}const Er={login:(p,L,re)=>se({type:"auth.login",mode:L,switchAccount:re,accountId:p}),submitCode:(p,L)=>se({type:"auth.code",code:L,accountId:p}),cancel:p=>se({type:"auth.cancel",accountId:p}),logout:p=>se({type:"auth.logout",accountId:p})},oa={discover:()=>se({type:"accounts.discover"}),requestUsage:()=>se({type:"accounts.usage"}),add:(p,L,re,Te)=>{In(null),se({type:"accounts.add",name:p,color:L,...re?{configDir:re}:{},...Te?{shareConfig:!0}:{}})},update:(p,L)=>{In(null),se({type:"accounts.update",accountId:p,...L})},remove:p=>{In(null),se({type:"accounts.remove",accountId:p})},makeMain:p=>{In(null),se({type:"accounts.makeMain",accountId:p})}};function Nc(p){Fn(!1),Gt(!1),xn(p),Bn(!0),se({type:"settings.get"});for(const L of Un)se({type:"auth.status",accountId:L.id})}function Xu(){Gt(!1),xn(null),Bn(!0),se({type:"settings.get"});for(const p of Un)se({type:"auth.status",accountId:p.id})}function Mi(p){qs(L=>L&&{...L,...p}),se({type:"settings.update",settings:p})}function Ya(p){!ie||b||se({type:"side.ask",sessionId:ie,text:p})}function Do(){ie&&(se({type:"side.reset",sessionId:ie}),jl.current=null,uc(null),br(zs),aa(null),vl({}),_i.current=[])}function Bl(p){const L=jl.current;if(L){p(L);return}const re=$n.current;re&&(_i.current.push(p),se({type:"side.open",sessionId:re}))}function wc(){q&&se({type:"git.state",workspaceId:q})}function Xa(p){q&&(Ms(p),se({type:"git.show",workspaceId:q,ref:p}))}function kl(p,L){os(null),Da({target:p,label:L})}function ua(){!q||!Xt||(se({type:"git.checkout",workspaceId:q,target:Xt.target}),Da(null))}function Hl(){q&&(os(null),se({type:"git.push",workspaceId:q}))}function Oo(p){q&&(os(null),se({type:"git.pull",workspaceId:q,merge:p}))}function Lo(){q&&(os(null),cl(null),ta(!0),se({type:"github.status"}),se({type:"github.owners"}),se({type:"git.files",workspaceId:q}))}function Ri(p){q&&(os(null),se({type:"git.publish",workspaceId:q,...p}))}function kc(p){q&&(os(null),se({type:"git.remote",workspaceId:q,url:p}))}function Va(){os(null),w(!0)}function Pn(p){se({type:"github.token",token:p}),se({type:"github.owners"})}function Sc(){se({type:"github.status"}),se({type:"github.owners"})}x.useEffect(()=>{if(!(!W||!q))for(const p of Hn)p in Re||se({type:"fs.list",workspaceId:q,path:p})},[W,Hn,Re,q,se]);function Vu(p){nn(L=>L.includes(p)?L.filter(re=>re!==p):[...L,p])}function zf(p){if(!p){yo(null);return}q&&se({type:"fs.search",workspaceId:q,query:p})}function Uf(p){if(!p){vo(null);return}q&&se({type:"fs.grep",workspaceId:q,query:p})}const Qu=x.useCallback((p,L)=>{Ru(rt=>({...rt,[p]:L}));const re=Nt.current;if(L===null||!re)return;const Te=L.lastIndexOf("/");if(Te!==-1){se({type:"fs.list",workspaceId:re,path:L.slice(0,Te)});return}if(L===""){se({type:"fs.list",workspaceId:re,path:""});return}se({type:"fs.search",workspaceId:re,query:L,scope:p})},[se]),wn=x.useMemo(()=>C_(mr.mention??null,nc.mention??null,Re),[mr.mention,nc.mention,Re]),zo=x.useMemo(()=>C_(mr.side??null,nc.side??null,Re),[mr.side,nc.side,Re]);function Tr(p){Ar(p.path,{line:p.line,column:p.column})}function Cr(p){const L=[];let re=Fr(p.path);for(;L.push(re),!!re;)re=Fr(re);nn(Te=>{const rt=new Set(Te);for(const ln of L)rt.add(ln);return p.kind==="dir"&&rt.add(p.path),[...rt]}),p.kind==="file"&&Ar(p.path)}function Ar(p,L){if(Vs.current.find(Te=>Te.path===p)){La(p),L&&lc({path:p,...L,token:++Ou.current});return}q&&(L&&(ac.current={path:p,...L}),ji.current.add(p),se({type:"fs.read",workspaceId:q,path:p}))}function da(p,L=!1){const re=Vs.current,Te=re.find(Ln=>Ln.path===p);if(Te&&oi(Te)&&!L){tc(p);return}tc(null);const rt=re.findIndex(Ln=>Ln.path===p),ln=re.filter(Ln=>Ln.path!==p);xs(ln),La(Ln=>{var fl;return Ln===p?((fl=ln[Math.min(rt,ln.length-1)])==null?void 0:fl.path)??null:Ln})}function $l(p,L=!1){const re=Vs.current.find(Te=>Te.path===p);!re||!q||!L&&!oi(re)||(zl.current.set(p,re.text),se({type:"fs.write",workspaceId:q,path:p,content:re.text,eol:re.eol,encoding:re.encoding,baseMtime:re.mtime,...L?{force:!0}:{}}))}function If(p){q&&se({type:"fs.read",workspaceId:q,path:p})}function Ku(p){q&&(Ha.current.has(p)||(Ha.current.add(p),se({type:"fs.readMedia",workspaceId:q,path:p})))}const Bf=x.useRef(new Map);function Fu(p){const L=Bf.current,re=L.get(p);re&&clearTimeout(re);const Te=(Rn==null?void 0:Rn.autoSaveAfterPauseMs)??0;Te<=0||L.set(p,setTimeout(()=>{L.delete(p);const rt=Vs.current.find(ln=>ln.path===p);rt&&oi(rt)&&!rt.stale&&$l(p)},Te))}function Qa(p,L,re){if(!q)return;const Te=p?`${p}/${re}`:re;na(null),L==="file"&&(ol.current=Te),se({type:"fs.create",workspaceId:q,path:Te,kind:L})}function Uo(p,L){if(!q)return;const re=Fr(p),Te=re?`${re}/${L}`:L;na(null),Ni.current={from:p,to:Te},se({type:"fs.rename",workspaceId:q,path:p,to:Te})}function Ec(p,L){if(!q)return;const re=p.slice(p.lastIndexOf("/")+1),Te=L?`${L}/${re}`:re;Te!==p&&(na(null),Ni.current={from:p,to:Te},se({type:"fs.rename",workspaceId:q,path:p,to:Te}))}function Zu(p,L){q&&(na(null),se({type:"fs.copy",workspaceId:q,path:p,toDir:L}))}function Di(p){q&&(na(null),ec(null),se({type:"fs.delete",workspaceId:q,path:p.path}),xs(L=>L.filter(re=>re.path!==p.path&&!re.path.startsWith(`${p.path}/`))),La(L=>L&&(L===p.path||L.startsWith(`${p.path}/`))?null:L))}function Io(){jt({}),nn([""]),xs([]),La(null),na(null),yo(null),vo(null),Ru({}),Du({}),lc(null),ji.current.clear(),zl.current.clear(),Ha.current.clear(),ac.current=null,Ni.current=null,ol.current=null}function Tc(){!q||xr||!la||(xi(null),cc.current=!0,se({type:"term.open",workspaceId:q,cols:80,rows:24}))}function Cc(p){se({type:"term.close",id:p})}function Ju(p,L){ie&&se({type:"permission.respond",sessionId:ie,requestId:p,decision:L})}function Pu(p,L){ie&&se({type:"permission.respond",sessionId:ie,requestId:p,decision:"allow",answers:L})}function Ka(p){ie&&se({type:"permission.respond",sessionId:ie,requestId:p,decision:"deny",reason:"Пользователь не стал отвечать на вопросы"})}function Fa(p,L){ie&&se({type:"permission.respond",sessionId:ie,requestId:p,decision:"allow",plan:L})}function Wu(p){ie&&se({type:"permission.respond",sessionId:ie,requestId:p,decision:"deny",reason:"Пользователь просит продолжить планирование"})}x.useEffect(()=>{function p(L){if(L.key!=="Escape")return;if(sn!==null){const Te=L.target;if(!(Te instanceof HTMLElement&&Te.closest(".termview, .editor, .sidepane"))){yr(null);return}}if(!ie||Qe.pending.length>0)return;const re=L.target;re instanceof HTMLElement&&re.closest(".sidepane, .editor")||se({type:"control.interrupt",sessionId:ie})}return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[ie,Qe.pending.length,se,sn]),x.useEffect(()=>{function p(L){L.key!=="`"||!(L.ctrlKey||L.metaKey)||la&&(L.preventDefault(),jo(re=>!re))}return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[la]);const Bo=x.useMemo(()=>{const p=(ze==null?void 0:ze.commands)??[];return p.length===0||(Z==null?void 0:Z.provider)==="antigravity"?p:[...p,{name:"plugins",description:"Плагины и маркетплейсы — окно приложения",argumentHint:"",aliases:["plugin"]},...E_]},[ze,Z==null?void 0:Z.provider]);function Za(p){const L=RE[p];if(L&&(Z==null?void 0:Z.provider)!=="antigravity")return ht(L),!0;if((Z==null?void 0:Z.provider)==="antigravity"||!E_.some(Te=>Te.name===p))return!1;const re=(Z==null?void 0:Z.accountId)??sr;return Nc(re),p==="logout"&&Er.logout(re),p==="switch-account"&&Er.login(re,"claudeai",!0),!0}const fa=(Z==null?void 0:Z.state)==="waiting_permission",ys=(Z==null?void 0:Z.state)==="reconnecting",us=(Z==null?void 0:Z.state)==="running"||ys||fa,Ht=Qe.pending[0]??null,Ac=Ht?mk(Ht.toolName,Ht.input):null,[Ja,ed]=x.useState(()=>new Set),dl=Ht?Ja.has(Ht.requestId):!1,Mc=Ht?Ht.questions&&Ht.questions.length>0?"question":Ac!==null?"plan":"permission":null;function Oi(p,L){ed(re=>{if(re.has(p)===L)return re;const Te=new Set(re);return L?Te.add(p):Te.delete(p),Te})}x.useEffect(()=>{!He&&!W||!q||us||se({type:"git.state",workspaceId:q})},[He,W,q,us,se]),x.useEffect(()=>{if(!(us||!q)){W&&jt(p=>{const L={};for(const[re,Te]of Object.entries(p))fc.current.includes(re)||(L[re]=Te);return L});for(const p of Vs.current)oi(p)||se({type:"fs.read",workspaceId:q,path:p.path})}},[us,q,W,se]);const Sl=(Z==null?void 0:Z.cwd)??(ze==null?void 0:ze.cwd)??null,ql=(ze==null?void 0:ze.models)??[],ha=(Z==null?void 0:Z.model)??(ze==null?void 0:ze.model)??null,{rows:Rc,selected:Ho}=M_(ql,ha),Gl=Rs?{model:Rs.model,effort:Rs.effort,ultracode:Rs.ultracode,thinking:Rs.thinking,switchOnFlag:Rs.switchModelsOnFlag}:{model:_r.model??ha,effort:_r.effort??(Z==null?void 0:Z.effort)??null,ultracode:_r.ultracode??(Z==null?void 0:Z.ultracode)??!1,thinking:_r.thinking??(Z==null?void 0:Z.thinking)??!0,switchOnFlag:_r.switchOnFlag??(Z==null?void 0:Z.switchModelsOnFlag)??!0},Li=M_(ql,Gl.model),td=(Rs==null?void 0:Rs.state)==="running",Dc=hr?On.find(p=>p.path===hr)??null:null,zi=new Set(On.filter(oi).map(p=>p.path)),pa=p=>a.jsx(hE,{pane:p,width:Ge.widths[p],onResize:L=>Ge.setWidth(p,L),onReset:()=>Ge.reset(p)}),Pa=p=>ft?null:()=>ko(p),$o=(Z==null?void 0:Z.provider)==="antigravity"?Hv:Q_,Oc=ze&&a.jsx(Ml,{title:"Режим прав",value:(Z==null?void 0:Z.permissionMode)??"default",options:$o.map(p=>({value:p.value,label:p.value,hint:p.hint})),onChange:p=>{ie&&se({type:"control.set_mode",sessionId:ie,mode:p})}}),vs=Rc.length>0?a.jsx(Iy,{models:Rc,value:Ho,effort:(Z==null?void 0:Z.effort)??null,ultracode:(Z==null?void 0:Z.ultracode)??!1,thinking:(Z==null?void 0:Z.thinking)??!0,switchOnFlag:(Z==null?void 0:Z.switchModelsOnFlag)??!0,showSwitchOnFlag:(Z==null?void 0:Z.provider)!=="antigravity",onModel:p=>{!ie||!p||se({type:"control.set_model",sessionId:ie,model:p})},onEffort:p=>{ie&&se({type:"control.set_effort",sessionId:ie,effort:p})},onUltracode:p=>{ie&&se({type:"control.set_ultracode",sessionId:ie,enabled:p})},onThinking:p=>{ie&&se({type:"control.set_thinking",sessionId:ie,enabled:p})},onSwitchOnFlag:p=>{ie&&se({type:"control.set_flag_switch",sessionId:ie,enabled:p})}}):ha&&a.jsx("span",{className:"badge",children:ha}),Js=us&&a.jsx("span",{className:fa?"badge badge--wait":"badge badge--live",children:fa?"ждёт":ys?"переподключается":"работает"}),ma=(Z==null?void 0:Z.state)==="closed"&&a.jsx("span",{className:"badge",title:"Разговор сохранён — сессия поднимется заново, как только вы отправите сообщение",children:"остановлена"}),Lc=Js||ma,qo=()=>{ie&&se({type:"session.reconnect",sessionId:ie})},ga=ys?"Сессия уже поднимает новый процесс":us?"Недоступно, пока идёт ход":"Поднять сессии новый процесс — разговор сохранён",Ls=ie&&(ys||(Z==null?void 0:Z.state)==="error")?a.jsxs("div",{className:ys?"relink":"relink relink--error",role:"status",children:[a.jsxs("span",{className:"relink__msg",children:[a.jsx("span",{className:"relink__dot","aria-hidden":"true"}),ys?"Связь оборвалась. Сессия поднимает новый процесс — разговор сохранён.":"Переподключиться не удалось. Разговор сохранён — сессия продолжит с этого места."]}),a.jsx("button",{className:"btn btn--sm",title:ys?"Не ждать паузы между попытками — попробовать сейчас":"Поднять сессии новый процесс и продолжить разговор",onClick:qo,children:ys?"Переподключить сейчас":"Переподключить"})]}):null,Dt=Qs?yc(Qs.sessionId,Qs.workspaceId,Qs.limit!==null):null,zc=Qs&&(Dt!=null&&Dt.canChoose)?{targets:Dt.targets,selectedId:Dt.selectedId,sourceId:Dt.sourceId,onSelect:p=>il(L=>({...L,[Qs.sessionId]:p}))}:null,qn=Z&&Z.state!=="closed"&&Z.provider!=="antigravity"&&Ul?yc(Ul,Z.workspaceId,!1):null,et=qn!=null&&qn.canChoose&&Ul?p=>il(L=>({...L,[Ul]:p})):null,It=Qs?a.jsx(sE,{handoff:Qs,sourceAccount:(Dt==null?void 0:Dt.source)??null,accountChoice:zc,onContinue:()=>wl(Qs),onShow:()=>Jl(Qs),onDismiss:()=>Jn(Qs.sessionId)}):null,pn=Z&&Z.totalCostUsd>0?`$${Z.totalCostUsd.toFixed(3)}`:null,Mr=(Z==null?void 0:Z.provider)!=="antigravity"&&a.jsx("button",{className:Xs?"pane-btn is-on":"pane-btn",title:"Вопрос на полях — спросить, не мешая работе","aria-label":"Вопрос на полях","aria-pressed":Xs,onClick:()=>oc(p=>!p),children:a.jsx($E,{})}),Ui=Z&&Z.state!=="closed"&&a.jsx("button",{type:"button",className:"pane-btn pane-btn--stop",title:"Остановить сессию — освобождает память хоста, разговор остаётся на диске","aria-label":"Остановить сессию",onClick:()=>Ai(Z),children:a.jsx(UE,{})}),js=Z?Pl[Z.id]===!0:!1,Ii=J_({onLongPress:()=>{Z&&vc(Z)},onClick:()=>{Z&&Ro(Z)},disabled:js}),Rr=Z&&Z.state!=="closed"&&Z.provider!=="antigravity"&&a.jsxs("button",{type:"button",className:js?"pane-btn pane-btn--handoff is-busy":Ii.holding?"pane-btn pane-btn--handoff is-holding":"pane-btn pane-btn--handoff",style:{"--hold-ms":`${Ii.thresholdMs}ms`},title:js?"Пишется хэндофф…":"Клик — хэндофф и новая сессия: агент запишет сводку, сессия остановится, работа продолжится в новой. Зажать (или Shift+клик) — новая пустая сессия без хэндоффа: закрепление переходит, старая сессия продолжает работать.","aria-label":"Хэндофф и новая сессия","aria-busy":js,disabled:js,...Ii.handlers,children:[a.jsx("span",{className:"pane-btn__hold","aria-hidden":"true"}),a.jsx(IE,{})]});return a.jsx(Bp.Provider,{value:pc,children:a.jsxs("div",{className:"app",style:Ge.style,children:[a.jsx(GN,{open:tt,connected:l,status:c,workspaces:S,archivedWorkspaces:A,workspaceFolders:V,sessionFolders:$,pinnedFolders:G,projectSessions:fe,onRequestSessions:p=>se({type:"session.list",workspaceId:p}),pinned:X,live:U,listOrder:me,liveSessionsFirst:(Rn==null?void 0:Rn.liveSessionsFirst)===!0,onReorder:Sr,activeWorkspaceId:q,activeSessionId:ie,onPinSessions:Ti,onSelectPinned:Fs,onCloseWorkspaces:Ds,onRestoreWorkspaces:_c,onUnmarkWorkspaces:Co,onArchiveSessions:qu,onUnarchiveSessions:(p,L)=>{se({type:"session.unarchive",workspaceId:p,sessionIds:L})},onCreateFolder:Ga,onRenameFolder:Ao,onSetFolderColor:Gu,onAssignToFolder:Mo,folderNotice:Wt,onDismissFolderNotice:()=>ts(null),movingProjectId:de,foldersReady:z,onSelectWorkspace:bs,onRenameSession:Vt,onStopSession:Ai,onOpenWorkspace:()=>pt(!0),onOpenUnopened:xc,onNewSession:Yu,enabledProviders:Zn,lastAccountId:Ks(at),onSignInAccount:Nc,onOpenExtensions:ie&&(Z==null?void 0:Z.provider)!=="antigravity"?()=>ht("mcp"):null,account:cs[sr]??null,onOpenAccount:Os,relay:d,onOpenRelay:v?null:()=>j(!0),onOpenSettings:Xu,themeMode:ye,onCycleTheme:Le}),pa("sidebar"),tt&&a.jsx("div",{className:"scrim",onClick:()=>Gt(!1)}),a.jsx(tN,{open:W,tree:Re,expanded:new Set(Hn),activePath:hr,dirty:zi,gitChanges:(bt==null?void 0:bt.changed)??[],result:Af,searchResult:Mf,onSearch:zf,onReveal:Cr,onToggle:Vu,onOpen:Ar,onCreate:Qa,onRename:Uo,onMove:Ec,onCopy:Zu,onDelete:ec,onRefresh:()=>{na(null),jt({}),wc()},onClose:()=>ve(!1),zoomed:sn==="files",onToggleZoom:Pa("files")}),W&&sn!=="files"&&pa("files"),a.jsx(dN,{open:Ua,result:Rf,onSearch:Uf,onOpenMatch:Tr,onClose:()=>Ia(!1),zoomed:sn==="search",onToggleZoom:Pa("search")}),Ua&&sn!=="search"&&pa("search"),a.jsx(Ck,{open:He,state:bt,result:yl,selected:_n,busy:fn,onRefresh:wc,onShow:Xa,onCheckout:kl,onPush:Hl,onPull:Oo,onPublish:Lo,onConnectRemote:Va,onDismissResult:()=>os(null),onClose:()=>Ct(!1),zoomed:sn==="git",onToggleZoom:Pa("git")}),He&&sn!=="git"&&pa("git"),a.jsxs("main",{className:(sn==="main"||sn==="terminal"?"main main--zoomed":"main")+(hn?` main--acct acct--${hn.color}`:""),children:[m&&b&&a.jsx(aE,{state:m}),a.jsxs("header",{className:"topbar",children:[a.jsx("button",{className:"btn btn--ghost menu-btn",onClick:()=>Gt(!0),children:"☰"}),a.jsx("button",{className:W?"pane-btn is-on":"pane-btn",title:"Файлы проекта","aria-label":"Файлы проекта","aria-pressed":W,onClick:()=>{ve(p=>!p),Ct(!1),Ia(!1)},children:a.jsx(OE,{})}),a.jsx("button",{className:Ua?"pane-btn is-on":"pane-btn",title:"Поиск по тексту в проекте","aria-label":"Поиск по тексту в проекте","aria-pressed":Ua,onClick:()=>{Ia(p=>!p),ve(!1),Ct(!1)},children:a.jsx(LE,{})}),a.jsx("button",{className:He?"pane-btn is-on":"pane-btn",title:"История git","aria-label":"История git","aria-pressed":He,onClick:()=>{Ct(p=>!p),ve(!1),Ia(!1)},children:a.jsx(zE,{})}),la&&a.jsx("button",{className:gi?"pane-btn is-on":"pane-btn",title:"Терминал (Ctrl+`)","aria-label":"Терминал","aria-pressed":gi,onClick:()=>jo(p=>!p),children:a.jsx(HE,{})}),ft&&Mr,ft&&a.jsx("button",{className:Ce?"pane-btn is-on":"pane-btn",title:"Ещё","aria-label":"Ещё","aria-haspopup":"menu","aria-pressed":Ce,onClick:()=>Je(!0),children:a.jsx(qE,{})}),a.jsxs("div",{className:"topbar__id",children:[es&&Z?a.jsx(Aa,{className:"rename--title",value:Z.title??"",onCommit:p=>{Vt(Z,p),ct(!1)},onCancel:()=>ct(!1)}):a.jsxs("div",{className:"topbar__head",children:[ft&&hn&&a.jsx(Ra,{account:hn}),a.jsx("button",{className:"topbar__title",disabled:!Z||ft,title:Z&&!ft?"Переименовать сессию":void 0,onClick:()=>ct(!0),children:(Z==null?void 0:Z.title)??"Claude Code Visual"}),Il&&a.jsx("span",{className:"topbar__project",title:Il.path,children:Il.name})]}),ft?Lc:Sl&&a.jsx(Uy,{path:Sl})]}),!ft&&a.jsxs("div",{className:"topbar__tools",children:[a.jsx("button",{type:"button",className:T?"meters-refresh is-busy":"meters-refresh",title:gc,"aria-label":mc,"aria-busy":T,disabled:!ie||T,onClick:$a,children:a.jsx(GE,{})}),hn&&a.jsx(Wx,{account:hn,onClick:Os}),a.jsx(rm,{usage:To}),a.jsx(qy,{}),Oc,vs,Lc,pn&&a.jsx("span",{className:"badge badge--cost",children:pn}),Rr,qn&&et&&!js&&a.jsx(Yy,{variant:"mark",targets:qn.targets,selectedId:qn.selectedId,sourceId:qn.sourceId,onSelect:et}),Ui,Mr]})]}),a.jsx(kE,{tokens:(xt==null?void 0:xt.tokens)??Qe.contextTokens,maxTokens:(xt==null?void 0:xt.maxTokens)??null,fetchedAt:(xt==null?void 0:xt.fetchedAt)??null}),ft&&Ce&&a.jsx(cS,{onClose:()=>Je(!1),permission:Oc,model:vs,account:hn&&a.jsx(Wx,{account:hn}),usage:To,cwd:Sl,costLabel:pn,onRefresh:$a,refreshing:T,metersFetchedAt:hc,onRename:Z?()=>{ct(!0),Je(!1)}:null,onHandoff:Z&&Z.state!=="closed"&&Z.provider!=="antigravity"?()=>{Ro(Z),Je(!1)}:null,onFreshSession:Z&&Z.state!=="closed"&&Z.provider!=="antigravity"?()=>{vc(Z),Je(!1)}:null,handoffWriting:js,handoffAccount:qn&&et&&!js?a.jsx(tE,{targets:qn.targets,selectedId:qn.selectedId,onSelect:et}):null,onStop:Z&&Z.state!=="closed"?()=>{Ai(Z),Je(!1)}:null}),On.length>0&&a.jsx(AN,{files:On,activePath:hr,busy:us,onSelect:La,onClose:p=>da(p),zoomed:sn==="main",onToggleZoom:Pa("main")}),Dc?a.jsx(TN,{file:Dc,goto:(sc==null?void 0:sc.path)===Dc.path?sc:null,onChange:(p,L)=>{xs(re=>re.map(Te=>Te.path===p?{...Te,text:L}:Te)),Fu(p)},onSave:p=>$l(p),onReload:If,onOverwrite:p=>$l(p,!0),onRequestMedia:Ku,onTogglePreview:p=>xs(L=>L.map(re=>re.path===p?{...re,previewMode:!re.previewMode}:re))}):a.jsxs(a.Fragment,{children:[a.jsx(lm,{items:Qe.items,busy:us&&!ys,waiting:fa,empty:(Z==null?void 0:Z.provider)==="antigravity"?"Сессия пуста. Опишите задачу — Antigravity работает в каталоге проекта.":void 0,history:Lf,historyHasMore:tb(Ze),historyLoading:Ze.loading,onLoadHistory:Hu,sessionId:ie??void 0,onEditMessage:(Z==null?void 0:Z.provider)==="antigravity"?void 0:(p,L,re)=>{if(!ie||b)return!1;const Te=ie;return ul(()=>se({type:"prompt.edit",sessionId:Te,userIndex:p,text:L,images:re}))}}),Ls,It,ie&&((nd=Z==null?void 0:Z.tasks)!=null&&nd.length)?a.jsx(LN,{tasks:Z.tasks,onStop:p=>se({type:"task.stop",sessionId:ie,taskId:p})}):null,Ht&&Mc&&dl&&a.jsx(uk,{kind:Mc,toolName:Ht.toolName,queued:Qe.pending.length-1,onExpand:()=>Oi(Ht.requestId,!1)}),a.jsx(Oy,{disabled:!ie,busy:us&&!ys,sendBlocked:b,placeholder:ys?"Промпт уйдёт, как только связь вернётся":(Z==null?void 0:Z.state)==="closed"?"Остановлена — отправьте сообщение, чтобы продолжить":void 0,commands:Bo,sessionTitle:(Z==null?void 0:Z.title)??null,contextResult:wn,draftKey:ie,onContextSearch:p=>Qu("mention",p),onCommand:Za,onSend:ra,onInterrupt:()=>{ie&&se({type:"control.interrupt",sessionId:ie})}})]}),gi&&la&&a.jsxs(a.Fragment,{children:[!ft&&sn!=="terminal"&&a.jsx(mE,{height:sa.height,onResize:sa.setHeight,onReset:sa.reset}),a.jsx(_E,{mobile:ft,zoomed:sn==="terminal",onToggleZoom:Pa("terminal"),terminals:ic,activeId:Df,blocked:xr,error:Of,onDismissError:()=>xi(null),height:ft?No.height:sa.height,offset:ft?{top:No.offsetTop,left:No.offsetLeft}:void 0,onSelect:rc,onOpen:Tc,onClose:Cc,onInput:(p,L)=>se({type:"term.input",id:p,data:L}),onResize:(p,L,re)=>se({type:"term.resize",id:p,cols:L,rows:re}),onAttach:p=>se({type:"term.attach",id:p}),onHide:()=>jo(!1),registerSink:Lu})]})]}),a.jsx(Pk,{open:Xs,items:wo.items,busy:td,ready:ie!==null,sendBlocked:b,commands:Bo,contextResult:zo,draftKey:ie,models:Li.rows,model:Li.selected,effort:Gl.effort,ultracode:Gl.ultracode,thinking:Gl.thinking,switchOnFlag:Gl.switchOnFlag,onContextSearch:p=>Qu("side",p),onCommand:Za,onModel:p=>{p&&(vl(L=>({...L,model:p})),Bl(L=>se({type:"control.set_model",sessionId:L,model:p})))},onEffort:p=>{vl(L=>({...L,effort:p,ultracode:!1})),Bl(L=>se({type:"control.set_effort",sessionId:L,effort:p}))},onUltracode:p=>{vl(L=>({...L,ultracode:p,...p?{effort:"xhigh"}:{}})),Bl(L=>se({type:"control.set_ultracode",sessionId:L,enabled:p}))},onThinking:p=>{vl(L=>({...L,thinking:p})),Bl(L=>se({type:"control.set_thinking",sessionId:L,enabled:p}))},onSwitchOnFlag:p=>{vl(L=>({...L,switchOnFlag:p})),Bl(L=>se({type:"control.set_flag_switch",sessionId:L,enabled:p}))},onAsk:Ya,onInterrupt:()=>{zu&&se({type:"control.interrupt",sessionId:zu})},onReset:Do,onClose:()=>oc(!1),zoomed:sn==="ask",onToggleZoom:Pa("ask")}),Xs&&sn!=="ask"&&pa("ask"),(He||Xs||W||Ua)&&a.jsx("div",{className:"scrim scrim--pane",onClick:()=>{Ct(!1),oc(!1),ve(!1),Ia(!1)}}),At&&a.jsx(Dk,{detail:At,local:((bt==null?void 0:bt.hasRemote)??!1)&&(bt==null?void 0:bt.commits.some(p=>p.hash===At.hash&&!p.pushed))===!0,onCheckout:kl,onClose:()=>{Nn(null),Ms(null)}}),E&&a.jsxs(ws,{title:"Лимит плана почти исчерпан",onClose:()=>Zs(!1),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",autoFocus:!0,onClick:()=>Zs(!1),children:"Отмена"}),a.jsx("button",{className:"btn btn--primary",onClick:()=>Zs(!0),children:"Отправить всё равно"})]}),children:[a.jsxs("p",{className:"modal__text",children:[vf[E.warning.limit][0].toUpperCase(),vf[E.warning.limit].slice(1)," использован на"," ",Math.round(E.warning.utilization)," %, сброс в"," ",dE(E.warning.resetsAt),". Сообщение может оборваться на полуслове, когда лимит дойдёт до 100 %."]}),a.jsx("p",{className:"modal__text modal__text--dim",children:"До сброса сессию повторно останавливать не будем."})]}),be&&a.jsx(ws,{title:"Остановить сессию?",onClose:()=>Ne(null),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>Ne(null),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",onClick:()=>{se({type:"session.close",sessionId:be.id}),Ne(null)},children:"Остановить"})]}),children:a.jsx("p",{className:"modal__text",children:"Сессия сейчас работает — остановка прервёт текущий ход. Разговор останется на диске: открыть сессию заново или просто написать в неё снова можно в любой момент."})}),Xt&&a.jsxs(ws,{title:"Переключить рабочее дерево?",onClose:()=>Da(null),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>Da(null),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",onClick:ua,children:"Переключиться"})]}),children:[a.jsxs("p",{className:"modal__text",children:["git переключится на ",Xt.label,". Файлы в каталоге проекта изменятся — это тот же каталог, в котором работает агент."]}),us&&a.jsx("p",{className:"modal__text",children:"Сейчас идёт ход агента: он читает и правит файлы прямо сейчас."}),bt&&bt.changed.length>0&&a.jsxs("p",{className:"modal__text",children:["Незакоммиченных изменений: ",bt.changed.length,". Git откажется переключаться, если они будут затёрты."]})]}),Oa&&a.jsx(Vk,{status:ur,owners:rl,files:mi,defaultName:(Il==null?void 0:Il.name)??"",hasCommits:bt===null||bt.head!=="",busy:fn,result:yl,onRefreshStatus:Sc,onSaveToken:Pn,onPublish:Ri,onDismissResult:()=>os(null),onClose:()=>ta(!1)}),fr&&a.jsx(Jk,{busy:fn,result:yl,onSubmit:kc,onDismissResult:()=>os(null),onClose:()=>w(!1)}),za&&a.jsx(ws,{title:za.kind==="dir"?"Удалить каталог?":"Удалить файл?",onClose:()=>ec(null),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>ec(null),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",onClick:()=>Di(za),children:"Удалить"})]}),children:a.jsxs("p",{className:"modal__text",children:[za.path," будет удалён с диска",za.kind==="dir"?" вместе со всем содержимым":"",". Корзины здесь нет: это тот же каталог, в котором работает агент."]})}),pr&&a.jsx(ws,{title:"Закрыть без сохранения?",onClose:()=>tc(null),actions:a.jsxs(a.Fragment,{children:[a.jsx("button",{className:"btn",onClick:()=>tc(null),children:"Отмена"}),a.jsx("button",{className:"btn btn--warn",onClick:()=>da(pr,!0),children:"Закрыть"}),a.jsx("button",{className:"btn btn--primary",onClick:()=>{$l(pr),da(pr,!0)},children:"Сохранить и закрыть"})]}),children:a.jsxs("p",{className:"modal__text",children:["В ",pr," есть несохранённые правки."]})}),De&&a.jsx(uS,{tab:De,servers:Yt,plugins:Is,marketplaces:Zl,catalog:Es,result:ll,auth:Hs,remote:v,actions:ca,onTab:qe,onClose:()=>qe(null)}),Ut&&a.jsx(_S,{accounts:Un,auth:cs,logins:Dn,candidates:$s,usage:Ke,actions:oa,onOpenLogin:Nc,activeAccountId:(hn==null?void 0:hn.id)??null,error:bl,onReconnect:ie?()=>{qo(),Fn(!1)}:null,reconnectBlocked:us,reconnectHint:ga,onClose:()=>Fn(!1)}),y&&a.jsx(DS,{state:d,onPair:(p,L)=>se({type:"relay.pair",code:p,...L?{name:L}:{}}),onUnpair:()=>se({type:"relay.unpair"}),onClose:()=>j(!1)}),_l&&a.jsx(eE,{settings:Rn,projectsRootHint:Pt,models:(ze==null?void 0:ze.models)??[],relayState:d,networkState:m,local:sf()==="local",onChange:Mi,onEnableShell:()=>se({type:"relay.shell.enable"}),onDisableShell:()=>se({type:"relay.shell.disable"}),onOpenRelay:()=>{Bn(!1),j(!0)},claudeLogin:{accounts:Un,auth:cs,logins:Dn,actions:Er,remote:v,runningByAccount:ki,focusAccountId:vt},onClose:()=>{Bn(!1),xn(null)}}),St&&a.jsx(_k,{candidates:Xe,searching:zn,agentItems:tn.items,agentBusy:(gn==null?void 0:gn.state)==="running",error:ms,roots:Be,folders:V,projectsRoot:Pt,created:J,onSearch:$u,onAskAgent:bc,onInterrupt:()=>{const p=wr.current;p&&se({type:"control.interrupt",sessionId:p})},onSubmit:xc,onCreate:qa,onClose:Si}),Ht!=null&&Ht.questions&&Ht.questions.length>0?a.jsx(fk,{request:{...Ht,questions:Ht.questions},queued:Qe.pending.length-1,collapsed:dl,onCollapse:()=>Oi(Ht.requestId,!0),onAnswer:Pu,onDecline:Ka}):Ht&&Ac!==null?a.jsx(ck,{request:Ht,plan:Ac,queued:Qe.pending.length-1,collapsed:dl,onCollapse:()=>Oi(Ht.requestId,!0),onAccept:Fa,onDecline:Wu}):Ht&&a.jsx(dk,{request:Ht,queued:Qe.pending.length-1,collapsed:dl,onCollapse:()=>Oi(Ht.requestId,!0),onDecide:Ju}),Ts&&a.jsx(lE,{handoff:Ts,onClose:()=>Jl(null)}),a.jsx(cE,{notices:Ll,onDismiss:p=>Mn(L=>L.filter(re=>re.id!==p))})]})})}function OE(){return a.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("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 LE(){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 zE(){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 UE(){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 IE(){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 BE(n,l){return R_(n)===R_(l)}function R_(n){return n.replace(/[\\/]+/g,"/").replace(/\/+$/,"").toLowerCase()}function HE(){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 $E(){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 qE(){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 GE(){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 Vy=document.getElementById("root");if(!Vy)throw new Error("#root not found");hv.createRoot(Vy).render(a.jsx(x.StrictMode,{children:a.jsx(DE,{})}));export{_1 as D,rn as I,on as N,VE as P,Al as T,Fl as a,dy as b,sl as c,XE as d,gy as e,Tu as f,I1 as h,QE as p,KE as s,Oe as t};
|