@i14ks/ccv 0.11.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/ccv.mjs +69 -5
- package/package.json +1 -1
- package/web/assets/{codemirror-BVMwXG_R.js → codemirror-Byu5BOry.js} +1 -1
- package/web/assets/{index-BlZDoET-.js → index-BednlsnR.js} +1 -1
- package/web/assets/{index-gl1MvN4b.js → index-BhTNEiv0.js} +1 -1
- package/web/assets/{index-CrW8SGCA.js → index-BiJkY5lu.js} +1 -1
- package/web/assets/{index-CPWAVXhz.js → index-Buinfinc.js} +1 -1
- package/web/assets/{index-mnefozuu.js → index-CBtC705w.js} +1 -1
- package/web/assets/{index-C1BT9XMC.js → index-CNdrabZC.js} +1 -1
- package/web/assets/{index-BsH-IJBy.js → index-CPLRJruN.js} +1 -1
- package/web/assets/{index-BZ8Mi5_8.js → index-CQlHFJzv.js} +1 -1
- package/web/assets/{index-C-geC5VJ.js → index-CmXpz6wO.js} +1 -1
- package/web/assets/{index-Bu_Ukh1_.js → index-CsBX1VvC.js} +1 -1
- package/web/assets/{index-DKofSKA7.js → index-CzPnlrTh.js} +1 -1
- package/web/assets/index-D5y0Nk74.css +1 -0
- package/web/assets/{index-DAjl7nVl.js → index-DG-5rv4t.js} +1 -1
- package/web/assets/{index-DLDXVZaf.js → index-DJN6swZl.js} +1 -1
- package/web/assets/{index-DJYXqBtm.js → index-DJPI4hL4.js} +1 -1
- package/web/assets/{index-BCAmULlL.js → index-DM4oBLe8.js} +1 -1
- package/web/assets/{index-Ey94wZ1k.js → index-DNppE7jj.js} +1 -1
- package/web/assets/index-DO6gKWcT.js +132 -0
- package/web/assets/{index-C59fVtiO.js → index-DSzfAcOE.js} +1 -1
- package/web/assets/{index-BFLfK-j6.js → index-DXYp3jsl.js} +1 -1
- package/web/assets/{index-AByrn5FE.js → index-rekQBGDD.js} +1 -1
- package/web/index.html +2 -2
- package/web/assets/index-DRlKZHMW.js +0 -132
- package/web/assets/index-c0zvhlqR.css +0 -1
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-DM4oBLe8.js","./index-BhTNEiv0.js","./index-CzPnlrTh.js","./index-BHot-lnj.js","./index-891wE-Rj.js","./index-CsBX1VvC.js","./index-DXYp3jsl.js","./index-Buinfinc.js","./index-rekQBGDD.js","./index-BednlsnR.js","./index-CNdrabZC.js","./index-CQlHFJzv.js","./index-CPLRJruN.js","./index-DJPI4hL4.js","./index-CBtC705w.js","./index-DJN6swZl.js","./index-BiJkY5lu.js","./index-DG-5rv4t.js","./index-CmXpz6wO.js","./index-DSzfAcOE.js","./index-DNppE7jj.js","./codemirror-Byu5BOry.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 Z_=Object.defineProperty;var tb=s=>{throw TypeError(s)};var K_=(s,l,r)=>l in s?Z_(s,l,{enumerable:!0,configurable:!0,writable:!0,value:r}):s[l]=r;var Mt=(s,l,r)=>K_(s,typeof l!="symbol"?l+"":l,r),nh=(s,l,r)=>l.has(s)||tb("Cannot "+r);var qe=(s,l,r)=>(nh(s,l,"read from private field"),r?r.call(s):l.get(s)),en=(s,l,r)=>l.has(s)?tb("Cannot add the same private member more than once"):l instanceof WeakSet?l.add(s):l.set(s,r),_t=(s,l,r,c)=>(nh(s,l,"write to private field"),c?c.call(s,r):l.set(s,r),r),kn=(s,l,r)=>(nh(s,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 lh={exports:{}},$c={};/**
|
|
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 nb;function F_(){if(nb)return $c;nb=1;var s=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 p in o)p!=="key"&&(d[p]=o[p])}else d=o;return o=d.ref,{$$typeof:s,type:c,key:h,ref:o!==void 0?o:null,props:d}}return $c.Fragment=l,$c.jsx=r,$c.jsxs=r,$c}var lb;function J_(){return lb||(lb=1,lh.exports=F_()),lh.exports}var i=J_(),sh={exports:{}},Xe={};/**
|
|
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 sb;function W_(){if(sb)return Xe;sb=1;var s=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"),p=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),v=Symbol.iterator;function E(w){return w===null||typeof w!="object"?null:(w=v&&w[v]||w["@@iterator"],typeof w=="function"?w:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},O=Object.assign,z={};function ee(w,Q,re){this.props=w,this.context=Q,this.refs=z,this.updater=re||k}ee.prototype.isReactComponent={},ee.prototype.setState=function(w,Q){if(typeof w!="object"&&typeof w!="function"&&w!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,w,Q,"setState")},ee.prototype.forceUpdate=function(w){this.updater.enqueueForceUpdate(this,w,"forceUpdate")};function te(){}te.prototype=ee.prototype;function K(w,Q,re){this.props=w,this.context=Q,this.refs=z,this.updater=re||k}var M=K.prototype=new te;M.constructor=K,O(M,ee.prototype),M.isPureReactComponent=!0;var F=Array.isArray;function H(){}var A={H:null,A:null,T:null,S:null},Z=Object.prototype.hasOwnProperty;function ae(w,Q,re){var oe=re.ref;return{$$typeof:s,type:w,key:Q,ref:oe!==void 0?oe:null,props:re}}function G(w,Q){return ae(w.type,Q,w.props)}function J(w){return typeof w=="object"&&w!==null&&w.$$typeof===s}function D(w){var Q={"=":"=0",":":"=2"};return"$"+w.replace(/[=:]/g,function(re){return Q[re]})}var ge=/\/+/g;function Se(w,Q){return typeof w=="object"&&w!==null&&w.key!=null?D(""+w.key):Q.toString(36)}function xe(w){switch(w.status){case"fulfilled":return w.value;case"rejected":throw w.reason;default:switch(typeof w.status=="string"?w.then(H,H):(w.status="pending",w.then(function(Q){w.status==="pending"&&(w.status="fulfilled",w.value=Q)},function(Q){w.status==="pending"&&(w.status="rejected",w.reason=Q)})),w.status){case"fulfilled":return w.value;case"rejected":throw w.reason}}throw w}function B(w,Q,re,oe,ye){var je=typeof w;(je==="undefined"||je==="boolean")&&(w=null);var Me=!1;if(w===null)Me=!0;else switch(je){case"bigint":case"string":case"number":Me=!0;break;case"object":switch(w.$$typeof){case s:case l:Me=!0;break;case _:return Me=w._init,B(Me(w._payload),Q,re,oe,ye)}}if(Me)return ye=ye(w),Me=oe===""?"."+Se(w,0):oe,F(ye)?(re="",Me!=null&&(re=Me.replace(ge,"$&/")+"/"),B(ye,Q,re,"",function(Nn){return Nn})):ye!=null&&(J(ye)&&(ye=G(ye,re+(ye.key==null||w&&w.key===ye.key?"":(""+ye.key).replace(ge,"$&/")+"/")+Me)),Q.push(ye)),1;Me=0;var ht=oe===""?".":oe+":";if(F(w))for(var lt=0;lt<w.length;lt++)oe=w[lt],je=ht+Se(oe,lt),Me+=B(oe,Q,re,je,ye);else if(lt=E(w),typeof lt=="function")for(w=lt.call(w),lt=0;!(oe=w.next()).done;)oe=oe.value,je=ht+Se(oe,lt++),Me+=B(oe,Q,re,je,ye);else if(je==="object"){if(typeof w.then=="function")return B(xe(w),Q,re,oe,ye);throw Q=String(w),Error("Objects are not valid as a React child (found: "+(Q==="[object Object]"?"object with keys {"+Object.keys(w).join(", ")+"}":Q)+"). If you meant to render a collection of children, use an array instead.")}return Me}function ue(w,Q,re){if(w==null)return w;var oe=[],ye=0;return B(w,oe,"","",function(je){return Q.call(re,je,ye++)}),oe}function se(w){if(w._status===-1){var Q=w._result;Q=Q(),Q.then(function(re){(w._status===0||w._status===-1)&&(w._status=1,w._result=re)},function(re){(w._status===0||w._status===-1)&&(w._status=2,w._result=re)}),w._status===-1&&(w._status=0,w._result=Q)}if(w._status===1)return w._result.default;throw w._result}var be=typeof reportError=="function"?reportError:function(w){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof w=="object"&&w!==null&&typeof w.message=="string"?String(w.message):String(w),error:w});if(!window.dispatchEvent(Q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",w);return}console.error(w)},Ce={map:ue,forEach:function(w,Q,re){ue(w,function(){Q.apply(this,arguments)},re)},count:function(w){var Q=0;return ue(w,function(){Q++}),Q},toArray:function(w){return ue(w,function(Q){return Q})||[]},only:function(w){if(!J(w))throw Error("React.Children.only expected to receive a single React element child.");return w}};return Xe.Activity=j,Xe.Children=Ce,Xe.Component=ee,Xe.Fragment=r,Xe.Profiler=o,Xe.PureComponent=K,Xe.StrictMode=c,Xe.Suspense=m,Xe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A,Xe.__COMPILER_RUNTIME={__proto__:null,c:function(w){return A.H.useMemoCache(w)}},Xe.cache=function(w){return function(){return w.apply(null,arguments)}},Xe.cacheSignal=function(){return null},Xe.cloneElement=function(w,Q,re){if(w==null)throw Error("The argument must be a React element, but you passed "+w+".");var oe=O({},w.props),ye=w.key;if(Q!=null)for(je in Q.key!==void 0&&(ye=""+Q.key),Q)!Z.call(Q,je)||je==="key"||je==="__self"||je==="__source"||je==="ref"&&Q.ref===void 0||(oe[je]=Q[je]);var je=arguments.length-2;if(je===1)oe.children=re;else if(1<je){for(var Me=Array(je),ht=0;ht<je;ht++)Me[ht]=arguments[ht+2];oe.children=Me}return ae(w.type,ye,oe)},Xe.createContext=function(w){return w={$$typeof:h,_currentValue:w,_currentValue2:w,_threadCount:0,Provider:null,Consumer:null},w.Provider=w,w.Consumer={$$typeof:d,_context:w},w},Xe.createElement=function(w,Q,re){var oe,ye={},je=null;if(Q!=null)for(oe in Q.key!==void 0&&(je=""+Q.key),Q)Z.call(Q,oe)&&oe!=="key"&&oe!=="__self"&&oe!=="__source"&&(ye[oe]=Q[oe]);var Me=arguments.length-2;if(Me===1)ye.children=re;else if(1<Me){for(var ht=Array(Me),lt=0;lt<Me;lt++)ht[lt]=arguments[lt+2];ye.children=ht}if(w&&w.defaultProps)for(oe in Me=w.defaultProps,Me)ye[oe]===void 0&&(ye[oe]=Me[oe]);return ae(w,je,ye)},Xe.createRef=function(){return{current:null}},Xe.forwardRef=function(w){return{$$typeof:p,render:w}},Xe.isValidElement=J,Xe.lazy=function(w){return{$$typeof:_,_payload:{_status:-1,_result:w},_init:se}},Xe.memo=function(w,Q){return{$$typeof:x,type:w,compare:Q===void 0?null:Q}},Xe.startTransition=function(w){var Q=A.T,re={};A.T=re;try{var oe=w(),ye=A.S;ye!==null&&ye(re,oe),typeof oe=="object"&&oe!==null&&typeof oe.then=="function"&&oe.then(H,be)}catch(je){be(je)}finally{Q!==null&&re.types!==null&&(Q.types=re.types),A.T=Q}},Xe.unstable_useCacheRefresh=function(){return A.H.useCacheRefresh()},Xe.use=function(w){return A.H.use(w)},Xe.useActionState=function(w,Q,re){return A.H.useActionState(w,Q,re)},Xe.useCallback=function(w,Q){return A.H.useCallback(w,Q)},Xe.useContext=function(w){return A.H.useContext(w)},Xe.useDebugValue=function(){},Xe.useDeferredValue=function(w,Q){return A.H.useDeferredValue(w,Q)},Xe.useEffect=function(w,Q){return A.H.useEffect(w,Q)},Xe.useEffectEvent=function(w){return A.H.useEffectEvent(w)},Xe.useId=function(){return A.H.useId()},Xe.useImperativeHandle=function(w,Q,re){return A.H.useImperativeHandle(w,Q,re)},Xe.useInsertionEffect=function(w,Q){return A.H.useInsertionEffect(w,Q)},Xe.useLayoutEffect=function(w,Q){return A.H.useLayoutEffect(w,Q)},Xe.useMemo=function(w,Q){return A.H.useMemo(w,Q)},Xe.useOptimistic=function(w,Q){return A.H.useOptimistic(w,Q)},Xe.useReducer=function(w,Q,re){return A.H.useReducer(w,Q,re)},Xe.useRef=function(w){return A.H.useRef(w)},Xe.useState=function(w){return A.H.useState(w)},Xe.useSyncExternalStore=function(w,Q,re){return A.H.useSyncExternalStore(w,Q,re)},Xe.useTransition=function(){return A.H.useTransition()},Xe.version="19.2.8",Xe}var ab;function Gh(){return ab||(ab=1,sh.exports=W_()),sh.exports}var y=Gh(),ah={exports:{}},Qc={},ih={exports:{}},rh={};/**
|
|
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 ib;function P_(){return ib||(ib=1,(function(s){function l(B,ue){var se=B.length;B.push(ue);e:for(;0<se;){var be=se-1>>>1,Ce=B[be];if(0<o(Ce,ue))B[be]=ue,B[se]=Ce,se=be;else break e}}function r(B){return B.length===0?null:B[0]}function c(B){if(B.length===0)return null;var ue=B[0],se=B.pop();if(se!==ue){B[0]=se;e:for(var be=0,Ce=B.length,w=Ce>>>1;be<w;){var Q=2*(be+1)-1,re=B[Q],oe=Q+1,ye=B[oe];if(0>o(re,se))oe<Ce&&0>o(ye,re)?(B[be]=ye,B[oe]=se,be=oe):(B[be]=re,B[Q]=se,be=Q);else if(oe<Ce&&0>o(ye,se))B[be]=ye,B[oe]=se,be=oe;else break e}}return ue}function o(B,ue){var se=B.sortIndex-ue.sortIndex;return se!==0?se:B.id-ue.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;s.unstable_now=function(){return d.now()}}else{var h=Date,p=h.now();s.unstable_now=function(){return h.now()-p}}var m=[],x=[],_=1,j=null,v=3,E=!1,k=!1,O=!1,z=!1,ee=typeof setTimeout=="function"?setTimeout:null,te=typeof clearTimeout=="function"?clearTimeout:null,K=typeof setImmediate<"u"?setImmediate:null;function M(B){for(var ue=r(x);ue!==null;){if(ue.callback===null)c(x);else if(ue.startTime<=B)c(x),ue.sortIndex=ue.expirationTime,l(m,ue);else break;ue=r(x)}}function F(B){if(O=!1,M(B),!k)if(r(m)!==null)k=!0,H||(H=!0,D());else{var ue=r(x);ue!==null&&xe(F,ue.startTime-B)}}var H=!1,A=-1,Z=5,ae=-1;function G(){return z?!0:!(s.unstable_now()-ae<Z)}function J(){if(z=!1,H){var B=s.unstable_now();ae=B;var ue=!0;try{e:{k=!1,O&&(O=!1,te(A),A=-1),E=!0;var se=v;try{t:{for(M(B),j=r(m);j!==null&&!(j.expirationTime>B&&G());){var be=j.callback;if(typeof be=="function"){j.callback=null,v=j.priorityLevel;var Ce=be(j.expirationTime<=B);if(B=s.unstable_now(),typeof Ce=="function"){j.callback=Ce,M(B),ue=!0;break t}j===r(m)&&c(m),M(B)}else c(m);j=r(m)}if(j!==null)ue=!0;else{var w=r(x);w!==null&&xe(F,w.startTime-B),ue=!1}}break e}finally{j=null,v=se,E=!1}ue=void 0}}finally{ue?D():H=!1}}}var D;if(typeof K=="function")D=function(){K(J)};else if(typeof MessageChannel<"u"){var ge=new MessageChannel,Se=ge.port2;ge.port1.onmessage=J,D=function(){Se.postMessage(null)}}else D=function(){ee(J,0)};function xe(B,ue){A=ee(function(){B(s.unstable_now())},ue)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(B){B.callback=null},s.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Z=0<B?Math.floor(1e3/B):5},s.unstable_getCurrentPriorityLevel=function(){return v},s.unstable_next=function(B){switch(v){case 1:case 2:case 3:var ue=3;break;default:ue=v}var se=v;v=ue;try{return B()}finally{v=se}},s.unstable_requestPaint=function(){z=!0},s.unstable_runWithPriority=function(B,ue){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var se=v;v=B;try{return ue()}finally{v=se}},s.unstable_scheduleCallback=function(B,ue,se){var be=s.unstable_now();switch(typeof se=="object"&&se!==null?(se=se.delay,se=typeof se=="number"&&0<se?be+se:be):se=be,B){case 1:var Ce=-1;break;case 2:Ce=250;break;case 5:Ce=1073741823;break;case 4:Ce=1e4;break;default:Ce=5e3}return Ce=se+Ce,B={id:_++,callback:ue,priorityLevel:B,startTime:se,expirationTime:Ce,sortIndex:-1},se>be?(B.sortIndex=se,l(x,B),r(m)===null&&B===r(x)&&(O?(te(A),A=-1):O=!0,xe(F,se-be))):(B.sortIndex=Ce,l(m,B),k||E||(k=!0,H||(H=!0,D()))),B},s.unstable_shouldYield=G,s.unstable_wrapCallback=function(B){var ue=v;return function(){var se=v;v=ue;try{return B.apply(this,arguments)}finally{v=se}}}})(rh)),rh}var rb;function e0(){return rb||(rb=1,ih.exports=P_()),ih.exports}var ch={exports:{}},fl={};/**
|
|
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 cb;function t0(){if(cb)return fl;cb=1;var s=Gh();function l(m){var x="https://react.dev/errors/"+m;if(1<arguments.length){x+="?args[]="+encodeURIComponent(arguments[1]);for(var _=2;_<arguments.length;_++)x+="&args[]="+encodeURIComponent(arguments[_])}return"Minified React error #"+m+"; visit "+x+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var c={d:{f:r,r:function(){throw Error(l(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for("react.portal");function d(m,x,_){var j=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:j==null?null:""+j,children:m,containerInfo:x,implementation:_}}var h=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(m,x){if(m==="font")return"";if(typeof x=="string")return x==="use-credentials"?x:""}return fl.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,fl.createPortal=function(m,x){var _=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!x||x.nodeType!==1&&x.nodeType!==9&&x.nodeType!==11)throw Error(l(299));return d(m,x,null,_)},fl.flushSync=function(m){var x=h.T,_=c.p;try{if(h.T=null,c.p=2,m)return m()}finally{h.T=x,c.p=_,c.d.f()}},fl.preconnect=function(m,x){typeof m=="string"&&(x?(x=x.crossOrigin,x=typeof x=="string"?x==="use-credentials"?x:"":void 0):x=null,c.d.C(m,x))},fl.prefetchDNS=function(m){typeof m=="string"&&c.d.D(m)},fl.preinit=function(m,x){if(typeof m=="string"&&x&&typeof x.as=="string"){var _=x.as,j=p(_,x.crossOrigin),v=typeof x.integrity=="string"?x.integrity:void 0,E=typeof x.fetchPriority=="string"?x.fetchPriority:void 0;_==="style"?c.d.S(m,typeof x.precedence=="string"?x.precedence:void 0,{crossOrigin:j,integrity:v,fetchPriority:E}):_==="script"&&c.d.X(m,{crossOrigin:j,integrity:v,fetchPriority:E,nonce:typeof x.nonce=="string"?x.nonce:void 0})}},fl.preinitModule=function(m,x){if(typeof m=="string")if(typeof x=="object"&&x!==null){if(x.as==null||x.as==="script"){var _=p(x.as,x.crossOrigin);c.d.M(m,{crossOrigin:_,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0})}}else x==null&&c.d.M(m)},fl.preload=function(m,x){if(typeof m=="string"&&typeof x=="object"&&x!==null&&typeof x.as=="string"){var _=x.as,j=p(_,x.crossOrigin);c.d.L(m,_,{crossOrigin:j,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0,type:typeof x.type=="string"?x.type:void 0,fetchPriority:typeof x.fetchPriority=="string"?x.fetchPriority:void 0,referrerPolicy:typeof x.referrerPolicy=="string"?x.referrerPolicy:void 0,imageSrcSet:typeof x.imageSrcSet=="string"?x.imageSrcSet:void 0,imageSizes:typeof x.imageSizes=="string"?x.imageSizes:void 0,media:typeof x.media=="string"?x.media:void 0})}},fl.preloadModule=function(m,x){if(typeof m=="string")if(x){var _=p(x.as,x.crossOrigin);c.d.m(m,{as:typeof x.as=="string"&&x.as!=="script"?x.as:void 0,crossOrigin:_,integrity:typeof x.integrity=="string"?x.integrity:void 0})}else c.d.m(m)},fl.requestFormReset=function(m){c.d.r(m)},fl.unstable_batchedUpdates=function(m,x){return m(x)},fl.useFormState=function(m,x,_){return h.H.useFormState(m,x,_)},fl.useFormStatus=function(){return h.H.useHostTransitionStatus()},fl.version="19.2.8",fl}var ub;function n0(){if(ub)return ch.exports;ub=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(l){console.error(l)}}return s(),ch.exports=t0(),ch.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 ob;function l0(){if(ob)return Qc;ob=1;var s=e0(),l=Gh(),r=n0();function c(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function d(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function h(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(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 m(e){if(d(e)!==e)throw Error(c(188))}function x(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(c(188));return t!==e?null:e}for(var n=e,a=t;;){var u=n.return;if(u===null)break;var f=u.alternate;if(f===null){if(a=u.return,a!==null){n=a;continue}break}if(u.child===f.child){for(f=u.child;f;){if(f===n)return m(u),e;if(f===a)return m(u),t;f=f.sibling}throw Error(c(188))}if(n.return!==a.return)n=u,a=f;else{for(var b=!1,S=u.child;S;){if(S===n){b=!0,n=u,a=f;break}if(S===a){b=!0,a=u,n=f;break}S=S.sibling}if(!b){for(S=f.child;S;){if(S===n){b=!0,n=f,a=u;break}if(S===a){b=!0,a=f,n=u;break}S=S.sibling}if(!b)throw Error(c(189))}}if(n.alternate!==a)throw Error(c(190))}if(n.tag!==3)throw Error(c(188));return n.stateNode.current===n?e:t}function _(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=_(e),t!==null)return t;e=e.sibling}return null}var j=Object.assign,v=Symbol.for("react.element"),E=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),z=Symbol.for("react.strict_mode"),ee=Symbol.for("react.profiler"),te=Symbol.for("react.consumer"),K=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),H=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),Z=Symbol.for("react.lazy"),ae=Symbol.for("react.activity"),G=Symbol.for("react.memo_cache_sentinel"),J=Symbol.iterator;function D(e){return e===null||typeof e!="object"?null:(e=J&&e[J]||e["@@iterator"],typeof e=="function"?e:null)}var ge=Symbol.for("react.client.reference");function Se(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ge?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case O:return"Fragment";case ee:return"Profiler";case z:return"StrictMode";case F:return"Suspense";case H:return"SuspenseList";case ae:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case k:return"Portal";case K:return e.displayName||"Context";case te:return(e._context.displayName||"Context")+".Consumer";case M:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case A:return t=e.displayName||null,t!==null?t:Se(e.type)||"Memo";case Z:t=e._payload,e=e._init;try{return Se(e(t))}catch{}}return null}var xe=Array.isArray,B=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,se={pending:!1,data:null,method:null,action:null},be=[],Ce=-1;function w(e){return{current:e}}function Q(e){0>Ce||(e.current=be[Ce],be[Ce]=null,Ce--)}function re(e,t){Ce++,be[Ce]=e.current,e.current=t}var oe=w(null),ye=w(null),je=w(null),Me=w(null);function ht(e,t){switch(re(je,t),re(ye,e),re(oe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?kg(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=kg(t),e=wg(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Q(oe),re(oe,e)}function lt(){Q(oe),Q(ye),Q(je)}function Nn(e){e.memoizedState!==null&&re(Me,e);var t=oe.current,n=wg(t,e.type);t!==n&&(re(ye,e),re(oe,n))}function Je(e){ye.current===e&&(Q(oe),Q(ye)),Me.current===e&&(Q(Me),Gc._currentValue=se)}var Kt,ct;function rn(e){if(Kt===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Kt=t&&t[1]||"",ct=-1<n.stack.indexOf(`
|
|
43
|
+
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
44
|
+
`+Kt+e+ct}var Be=!1;function rt(e,t){if(!e||Be)return"";Be=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var ce=function(){throw Error()};if(Object.defineProperty(ce.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ce,[])}catch(P){var $=P}Reflect.construct(e,[],ce)}else{try{ce.call()}catch(P){$=P}e.call(ce.prototype)}}else{try{throw Error()}catch(P){$=P}(ce=e())&&typeof ce.catch=="function"&&ce.catch(function(){})}}catch(P){if(P&&$&&typeof P.stack=="string")return[P.stack,$.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=a.DetermineComponentFrameRoot(),b=f[0],S=f[1];if(b&&S){var C=b.split(`
|
|
45
|
+
`),X=S.split(`
|
|
46
|
+
`);for(u=a=0;a<C.length&&!C[a].includes("DetermineComponentFrameRoot");)a++;for(;u<X.length&&!X[u].includes("DetermineComponentFrameRoot");)u++;if(a===C.length||u===X.length)for(a=C.length-1,u=X.length-1;1<=a&&0<=u&&C[a]!==X[u];)u--;for(;1<=a&&0<=u;a--,u--)if(C[a]!==X[u]){if(a!==1||u!==1)do if(a--,u--,0>u||C[a]!==X[u]){var ne=`
|
|
47
|
+
`+C[a].replace(" at new "," at ");return e.displayName&&ne.includes("<anonymous>")&&(ne=ne.replace("<anonymous>",e.displayName)),ne}while(1<=a&&0<=u);break}}}finally{Be=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?rn(n):""}function Hn(e,t){switch(e.tag){case 26:case 27:case 5:return rn(e.type);case 16:return rn("Lazy");case 13:return e.child!==t&&t!==null?rn("Suspense Fallback"):rn("Suspense");case 19:return rn("SuspenseList");case 0:case 15:return rt(e.type,!1);case 11:return rt(e.type.render,!1);case 1:return rt(e.type,!0);case 31:return rn("Activity");default:return""}}function wt(e){try{var t="",n=null;do t+=Hn(e,n),n=e,e=e.return;while(e);return t}catch(a){return`
|
|
48
|
+
Error generating stack: `+a.message+`
|
|
49
|
+
`+a.stack}}var Ot=Object.prototype.hasOwnProperty,Ft=s.unstable_scheduleCallback,tn=s.unstable_cancelCallback,$t=s.unstable_shouldYield,Nt=s.unstable_requestPaint,Qe=s.unstable_now,We=s.unstable_getCurrentPriorityLevel,dn=s.unstable_ImmediatePriority,Jt=s.unstable_UserBlockingPriority,Qt=s.unstable_NormalPriority,Bn=s.unstable_LowPriority,Tn=s.unstable_IdlePriority,hn=s.log,sl=s.unstable_setDisableYieldValue,zt=null,bt=null;function Ut(e){if(typeof hn=="function"&&sl(e),bt&&typeof bt.setStrictMode=="function")try{bt.setStrictMode(zt,e)}catch{}}var $e=Math.clz32?Math.clz32:de,Qn=Math.log,W=Math.LN2;function de(e){return e>>>=0,e===0?32:31-(Qn(e)/W|0)|0}var we=256,L=262144,V=4194304;function _e(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 ze(e,t,n){var a=e.pendingLanes;if(a===0)return 0;var u=0,f=e.suspendedLanes,b=e.pingedLanes;e=e.warmLanes;var S=a&134217727;return S!==0?(a=S&~f,a!==0?u=_e(a):(b&=S,b!==0?u=_e(b):n||(n=S&~e,n!==0&&(u=_e(n))))):(S=a&~f,S!==0?u=_e(S):b!==0?u=_e(b):n||(n=a&~e,n!==0&&(u=_e(n)))),u===0?0:t!==0&&t!==u&&(t&f)===0&&(f=u&-u,n=t&-t,f>=n||f===32&&(n&4194048)!==0)?t:u}function st(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function al(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 Pe(){var e=V;return V<<=1,(V&62914560)===0&&(V=4194304),e}function En(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function In(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function $l(e,t,n,a,u,f){var b=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var S=e.entanglements,C=e.expirationTimes,X=e.hiddenUpdates;for(n=b&~n;0<n;){var ne=31-$e(n),ce=1<<ne;S[ne]=0,C[ne]=-1;var $=X[ne];if($!==null)for(X[ne]=null,ne=0;ne<$.length;ne++){var P=$[ne];P!==null&&(P.lane&=-536870913)}n&=~ce}a!==0&&da(e,a,0),f!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=f&~(b&~t))}function da(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-$e(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|n&261930}function qs(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var a=31-$e(n),u=1<<a;u&t|e[a]&t&&(e[a]|=t),n&=~u}}function Ll(e,t){var n=t&-t;return n=(n&42)!==0?1:qn(n),(n&(e.suspendedLanes|t))!==0?0:n}function qn(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function pl(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function nn(){var e=ue.p;return e!==0?e:(e=window.event,e===void 0?32:Zg(e.type))}function _l(e,t){var n=ue.p;try{return ue.p=e,t()}finally{ue.p=n}}var Gn=Math.random().toString(36).slice(2),Ht="__reactFiber$"+Gn,Ze="__reactProps$"+Gn,ln="__reactContainer$"+Gn,is="__reactEvents$"+Gn,An="__reactListeners$"+Gn,Cn="__reactHandles$"+Gn,zl="__reactResources$"+Gn,vl="__reactMarker$"+Gn;function ys(e){delete e[Ht],delete e[Ze],delete e[is],delete e[An],delete e[Cn]}function It(e){var t=e[Ht];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ln]||n[Ht]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Mg(e);e!==null;){if(n=e[Ht])return n;e=Mg(e)}return t}e=n,n=e.parentNode}return null}function Ql(e){if(e=e[Ht]||e[ln]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Zl(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function pn(e){var t=e[zl];return t||(t=e[zl]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Tt(e){e[vl]=!0}var Yn=new Set,Gs={};function cn(e,t){T(e,t),T(e+"Capture",t)}function T(e,t){for(Gs[e]=t,e=0;e<t.length;e++)Yn.add(t[e])}var he=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]*$"),Ge={},pt={};function un(e){return Ot.call(pt,e)?!0:Ot.call(Ge,e)?!1:he.test(e)?pt[e]=!0:(Ge[e]=!0,!1)}function ml(e,t,n){if(un(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function il(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function mn(e,t,n,a){if(a===null)e.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+a)}}function xt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function rl(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ha(e,t,n){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var u=a.get,f=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(b){n=""+b,f.call(this,b)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return n},setValue:function(b){n=""+b},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Sl(e){if(!e._valueTracker){var t=rl(e)?"checked":"value";e._valueTracker=ha(e,t,""+e[t])}}function ti(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),a="";return e&&(a=rl(e)?e.checked?"true":"false":e.value),e=a,e!==n?(t.setValue(e),!0):!1}function gl(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 _s=/[\n"\\]/g;function Rn(e){return e.replace(_s,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function rs(e,t,n,a,u,f,b,S){e.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.type=b:e.removeAttribute("type"),t!=null?b==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+xt(t)):e.value!==""+xt(t)&&(e.value=""+xt(t)):b!=="submit"&&b!=="reset"||e.removeAttribute("value"),t!=null?Ss(e,b,xt(t)):n!=null?Ss(e,b,xt(n)):a!=null&&e.removeAttribute("value"),u==null&&f!=null&&(e.defaultChecked=!!f),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?e.name=""+xt(S):e.removeAttribute("name")}function vs(e,t,n,a,u,f,b,S){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.type=f),t!=null||n!=null){if(!(f!=="submit"&&f!=="reset"||t!=null)){Sl(e);return}n=n!=null?""+xt(n):"",t=t!=null?""+xt(t):n,S||t===e.value||(e.value=t),e.defaultValue=t}a=a??u,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=S?e.checked:!!a,e.defaultChecked=!!a,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(e.name=b),Sl(e)}function Ss(e,t,n){t==="number"&&gl(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function jl(e,t,n,a){if(e=e.options,t){t={};for(var u=0;u<n.length;u++)t["$"+n[u]]=!0;for(n=0;n<e.length;n++)u=t.hasOwnProperty("$"+e[n].value),e[n].selected!==u&&(e[n].selected=u),u&&a&&(e[n].defaultSelected=!0)}else{for(n=""+xt(n),t=null,u=0;u<e.length;u++){if(e[u].value===n){e[u].selected=!0,a&&(e[u].defaultSelected=!0);return}t!==null||e[u].disabled||(t=e[u])}t!==null&&(t.selected=!0)}}function me(e,t,n){if(t!=null&&(t=""+xt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+xt(n):""}function N(e,t,n,a){if(t==null){if(a!=null){if(n!=null)throw Error(c(92));if(xe(a)){if(1<a.length)throw Error(c(93));a=a[0]}n=a}n==null&&(n=""),t=n}n=xt(t),e.defaultValue=n,a=e.textContent,a===n&&a!==""&&a!==null&&(e.value=a),Sl(e)}function I(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var fe=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 Ne(e,t,n){var a=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?a?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":a?e.setProperty(t,n):typeof n!="number"||n===0||fe.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Oe(e,t,n){if(t!=null&&typeof t!="object")throw Error(c(62));if(e=e.style,n!=null){for(var a in n)!n.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="");for(var u in t)a=t[u],t.hasOwnProperty(u)&&n[u]!==a&&Ne(e,u,a)}else for(var f in t)t.hasOwnProperty(f)&&Ne(e,f,t[f])}function Ue(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Et=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Wt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function gn(e){return Wt.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Dt(){}var bn=null;function Bt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var js=null,cs=null;function pa(e){var t=Ql(e);if(t&&(e=t.stateNode)){var n=e[Ze]||null;e:switch(e=t.stateNode,t.type){case"input":if(rs(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+Rn(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var a=n[t];if(a!==e&&a.form===e.form){var u=a[Ze]||null;if(!u)throw Error(c(90));rs(a,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(t=0;t<n.length;t++)a=n[t],a.form===e.form&&ti(a)}break e;case"textarea":me(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&jl(e,!!n.multiple,t,!1)}}}var Kr=!1;function ni(e,t,n){if(Kr)return e(t,n);Kr=!0;try{var a=e(t);return a}finally{if(Kr=!1,(js!==null||cs!==null)&&(ho(),js&&(t=js,e=cs,cs=js=null,pa(t),e)))for(t=0;t<e.length;t++)pa(e[t])}}function li(e,t){var n=e.stateNode;if(n===null)return null;var a=n[Ze]||null;if(a===null)return null;n=a[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":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(c(231,t,typeof n));return n}var kl=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ma=!1;if(kl)try{var Ys={};Object.defineProperty(Ys,"passive",{get:function(){ma=!0}}),window.addEventListener("test",Ys,Ys),window.removeEventListener("test",Ys,Ys)}catch{ma=!1}var wl=null,us=null,Xs=null;function Gi(){if(Xs)return Xs;var e,t=us,n=t.length,a,u="value"in wl?wl.value:wl.textContent,f=u.length;for(e=0;e<n&&t[e]===u[e];e++);var b=n-e;for(a=1;a<=b&&t[n-a]===u[f-a];a++);return Xs=u.slice(e,1<a?1-a:void 0)}function Yi(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 Kl(){return!0}function Xi(){return!1}function Zn(e){function t(n,a,u,f,b){this._reactName=n,this._targetInst=u,this.type=a,this.nativeEvent=f,this.target=b,this.currentTarget=null;for(var S in e)e.hasOwnProperty(S)&&(n=e[S],this[S]=n?n(f):f[S]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?Kl:Xi,this.isPropagationStopped=Xi,this}return j(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Kl)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Kl)},persist:function(){},isPersistent:Kl}),t}var Fl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},si=Zn(Fl),ks=j({},Fl,{view:0,detail:0}),os=Zn(ks),ga,Vs,Ul,ws=j({},ks,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:fs,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!==Ul&&(Ul&&e.type==="mousemove"?(ga=e.screenX-Ul.screenX,Vs=e.screenY-Ul.screenY):Vs=ga=0,Ul=e),ga)},movementY:function(e){return"movementY"in e?e.movementY:Vs}}),qt=Zn(ws),Fr=j({},ws,{dataTransfer:0}),df=Zn(Fr),hf=j({},ks,{relatedTarget:0}),Vi=Zn(hf),$i=j({},Fl,{animationName:0,elapsedTime:0,pseudoElement:0}),Kn=Zn($i),xn=j({},Fl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),du=Zn(xn),hu=j({},Fl,{data:0}),Jl=Zn(hu),pu={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Qi={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"},Zi={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ai(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Zi[e])?!!t[e]:!1}function fs(){return ai}var mu=j({},ks,{key:function(e){if(e.key){var t=pu[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Yi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Qi[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:fs,charCode:function(e){return e.type==="keypress"?Yi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Yi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),ii=Zn(mu),Ki=j({},ws,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ba=Zn(Ki),ri=j({},ks,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:fs}),gu=Zn(ri),ci=j({},Fl,{propertyName:0,elapsedTime:0,pseudoElement:0}),pf=Zn(ci),le=j({},ws,{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}),xa=Zn(le),Jr=j({},Fl,{newState:0,oldState:0}),mf=Zn(Jr),gf=[9,13,27,32],Wr=kl&&"CompositionEvent"in window,ke=null;kl&&"documentMode"in document&&(ke=document.documentMode);var ya=kl&&"TextEvent"in window&&!ke,bu=kl&&(!Wr||ke&&8<ke&&11>=ke),xu=" ",yu=!1;function _u(e,t){switch(e){case"keyup":return gf.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function vu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Wl=!1;function bf(e,t){switch(e){case"compositionend":return vu(t);case"keypress":return t.which!==32?null:(yu=!0,xu);case"textInput":return e=t.data,e===xu&&yu?null:e;default:return null}}function xf(e,t){if(Wl)return e==="compositionend"||!Wr&&_u(e,t)?(e=Gi(),Xs=us=wl=null,Wl=!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 bu&&t.locale!=="ko"?null:t.data;default:return null}}var yf={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 Su(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!yf[e.type]:t==="textarea"}function ju(e,t,n,a){js?cs?cs.push(a):cs=[a]:js=a,t=_o(t,"onChange"),0<t.length&&(n=new si("onChange","change",null,n,a),e.push({event:n,listeners:t}))}var ui=null,oi=null;function _f(e){xg(e,0)}function fi(e){var t=Zl(e);if(ti(t))return e}function ku(e,t){if(e==="change")return t}var wu=!1;if(kl){var di;if(kl){var Fi="oninput"in document;if(!Fi){var Pr=document.createElement("div");Pr.setAttribute("oninput","return;"),Fi=typeof Pr.oninput=="function"}di=Fi}else di=!1;wu=di&&(!document.documentMode||9<document.documentMode)}function Nu(){ui&&(ui.detachEvent("onpropertychange",ec),oi=ui=null)}function ec(e){if(e.propertyName==="value"&&fi(oi)){var t=[];ju(t,oi,e,Bt(e)),ni(_f,t)}}function tc(e,t,n){e==="focusin"?(Nu(),ui=t,oi=n,ui.attachEvent("onpropertychange",ec)):e==="focusout"&&Nu()}function vf(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return fi(oi)}function Sf(e,t){if(e==="click")return fi(t)}function jf(e,t){if(e==="input"||e==="change")return fi(t)}function kf(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Mn=typeof Object.is=="function"?Object.is:kf;function _a(e,t){if(Mn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;for(a=0;a<n.length;a++){var u=n[a];if(!Ot.call(t,u)||!Mn(e[u],t[u]))return!1}return!0}function Tu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function nc(e,t){var n=Tu(e);e=0;for(var a;n;){if(n.nodeType===3){if(a=e+n.textContent.length,e<=t&&a>=t)return{node:n,offset:t-e};e=a}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Tu(n)}}function Eu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Eu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Au(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=gl(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=gl(e.document)}return t}function lc(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 wf=kl&&"documentMode"in document&&11>=document.documentMode,va=null,sc=null,hi=null,ac=!1;function Cu(e,t,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ac||va==null||va!==gl(a)||(a=va,"selectionStart"in a&&lc(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),hi&&_a(hi,a)||(hi=a,a=_o(sc,"onSelect"),0<a.length&&(t=new si("onSelect","select",null,t,n),e.push({event:t,listeners:a}),t.target=va)))}function $s(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Sa={animationend:$s("Animation","AnimationEnd"),animationiteration:$s("Animation","AnimationIteration"),animationstart:$s("Animation","AnimationStart"),transitionrun:$s("Transition","TransitionRun"),transitionstart:$s("Transition","TransitionStart"),transitioncancel:$s("Transition","TransitionCancel"),transitionend:$s("Transition","TransitionEnd")},ic={},rc={};kl&&(rc=document.createElement("div").style,"AnimationEvent"in window||(delete Sa.animationend.animation,delete Sa.animationiteration.animation,delete Sa.animationstart.animation),"TransitionEvent"in window||delete Sa.transitionend.transition);function Qs(e){if(ic[e])return ic[e];if(!Sa[e])return e;var t=Sa[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in rc)return ic[e]=t[n];return e}var Ru=Qs("animationend"),Mu=Qs("animationiteration"),Ou=Qs("animationstart"),cc=Qs("transitionrun"),uc=Qs("transitionstart"),Ji=Qs("transitioncancel"),Du=Qs("transitionend"),Lu=new Map,oc="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(" ");oc.push("scrollEnd");function Hl(e,t){Lu.set(e,t),cn(t,[e])}var Wi=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)},Nl=[],ja=0,fc=0;function Pi(){for(var e=ja,t=fc=ja=0;t<e;){var n=Nl[t];Nl[t++]=null;var a=Nl[t];Nl[t++]=null;var u=Nl[t];Nl[t++]=null;var f=Nl[t];if(Nl[t++]=null,a!==null&&u!==null){var b=a.pending;b===null?u.next=u:(u.next=b.next,b.next=u),a.pending=u}f!==0&&zu(n,u,f)}}function er(e,t,n,a){Nl[ja++]=e,Nl[ja++]=t,Nl[ja++]=n,Nl[ja++]=a,fc|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function dc(e,t,n,a){return er(e,t,n,a),tr(e)}function Zs(e,t){return er(e,null,null,t),tr(e)}function zu(e,t,n){e.lanes|=n;var a=e.alternate;a!==null&&(a.lanes|=n);for(var u=!1,f=e.return;f!==null;)f.childLanes|=n,a=f.alternate,a!==null&&(a.childLanes|=n),f.tag===22&&(e=f.stateNode,e===null||e._visibility&1||(u=!0)),e=f,f=f.return;return e.tag===3?(f=e.stateNode,u&&t!==null&&(u=31-$e(n),e=f.hiddenUpdates,a=e[u],a===null?e[u]=[t]:a.push(t),t.lane=n|536870912),f):null}function tr(e){if(50<Lc)throw Lc=0,Nd=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ka={};function Nf(e,t,n,a){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function bl(e,t,n,a){return new Nf(e,t,n,a)}function nr(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Pl(e,t){var n=e.alternate;return n===null?(n=bl(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function pi(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function cl(e,t,n,a,u,f){var b=0;if(a=e,typeof e=="function")nr(e)&&(b=1);else if(typeof e=="string")b=z_(e,n,oe.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ae:return e=bl(31,n,t,u),e.elementType=ae,e.lanes=f,e;case O:return On(n.children,u,f,t);case z:b=8,u|=24;break;case ee:return e=bl(12,n,t,u|2),e.elementType=ee,e.lanes=f,e;case F:return e=bl(13,n,t,u),e.elementType=F,e.lanes=f,e;case H:return e=bl(19,n,t,u),e.elementType=H,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case K:b=10;break e;case te:b=9;break e;case M:b=11;break e;case A:b=14;break e;case Z:b=16,a=null;break e}b=29,n=Error(c(130,e===null?"null":typeof e,"")),a=null}return t=bl(b,n,t,u),t.elementType=e,t.type=a,t.lanes=f,t}function On(e,t,n,a){return e=bl(7,e,a,t),e.lanes=n,e}function Fn(e,t,n){return e=bl(6,e,null,t),e.lanes=n,e}function hc(e){var t=bl(18,null,null,0);return t.stateNode=e,t}function mi(e,t,n){return t=bl(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var pc=new WeakMap;function Jn(e,t){if(typeof e=="object"&&e!==null){var n=pc.get(e);return n!==void 0?n:(t={value:e,source:t,stack:wt(t)},pc.set(e,t),t)}return{value:e,source:t,stack:wt(t)}}var Ks=[],wa=0,Ns=null,Na=0,Tl=[],ul=0,Ts=null,ol=1,Wn="";function es(e,t){Ks[wa++]=Na,Ks[wa++]=Ns,Ns=e,Na=t}function mc(e,t,n){Tl[ul++]=ol,Tl[ul++]=Wn,Tl[ul++]=Ts,Ts=e;var a=ol;e=Wn;var u=32-$e(a)-1;a&=~(1<<u),n+=1;var f=32-$e(t)+u;if(30<f){var b=u-u%5;f=(a&(1<<b)-1).toString(32),a>>=b,u-=b,ol=1<<32-$e(t)+u|n<<u|a,Wn=f+e}else ol=1<<f|n<<u|a,Wn=e}function lr(e){e.return!==null&&(es(e,1),mc(e,1,0))}function sr(e){for(;e===Ns;)Ns=Ks[--wa],Ks[wa]=null,Na=Ks[--wa],Ks[wa]=null;for(;e===Ts;)Ts=Tl[--ul],Tl[ul]=null,Wn=Tl[--ul],Tl[ul]=null,ol=Tl[--ul],Tl[ul]=null}function Uu(e,t){Tl[ul++]=ol,Tl[ul++]=Wn,Tl[ul++]=Ts,ol=t.id,Wn=t.overflow,Ts=e}var Dn=null,St=null,et=!1,ds=null,g=!1,q=Error(c(519));function pe(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ee(Jn(t,e)),q}function Ye(e){var t=e.stateNode,n=e.type,a=e.memoizedProps;switch(t[Ht]=e,t[Ze]=a,n){case"dialog":nt("cancel",t),nt("close",t);break;case"iframe":case"object":case"embed":nt("load",t);break;case"video":case"audio":for(n=0;n<Uc.length;n++)nt(Uc[n],t);break;case"source":nt("error",t);break;case"img":case"image":case"link":nt("error",t),nt("load",t);break;case"details":nt("toggle",t);break;case"input":nt("invalid",t),vs(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":nt("invalid",t);break;case"textarea":nt("invalid",t),N(t,a.value,a.defaultValue,a.children)}n=a.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||a.suppressHydrationWarning===!0||Sg(t.textContent,n)?(a.popover!=null&&(nt("beforetoggle",t),nt("toggle",t)),a.onScroll!=null&&nt("scroll",t),a.onScrollEnd!=null&&nt("scrollend",t),a.onClick!=null&&(t.onclick=Dt),t=!0):t=!1,t||pe(e,!0)}function Pt(e){for(Dn=e.return;Dn;)switch(Dn.tag){case 5:case 31:case 13:g=!1;return;case 27:case 3:g=!0;return;default:Dn=Dn.return}}function yn(e){if(e!==Dn)return!1;if(!et)return Pt(e),et=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||qd(e.type,e.memoizedProps)),n=!n),n&&St&&pe(e),Pt(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));St=Rg(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));St=Rg(e)}else t===27?(t=St,Ba(e.type)?(e=$d,$d=null,St=e):St=t):St=Dn?ns(e.stateNode.nextSibling):null;return!0}function Ln(){St=Dn=null,et=!1}function Fs(){var e=ds;return e!==null&&(Rl===null?Rl=e:Rl.push.apply(Rl,e),ds=null),e}function Ee(e){ds===null?ds=[e]:ds.push(e)}var De=w(null),Ie=null,ut=null;function dt(e,t,n){re(De,t._currentValue),t._currentValue=n}function zn(e){e._currentValue=De.current,Q(De)}function gi(e,t,n){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===n)break;e=e.return}}function Tf(e,t,n,a){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var f=u.dependencies;if(f!==null){var b=u.child;f=f.firstContext;e:for(;f!==null;){var S=f;f=u;for(var C=0;C<t.length;C++)if(S.context===t[C]){f.lanes|=n,S=f.alternate,S!==null&&(S.lanes|=n),gi(f.return,n,e),a||(b=null);break e}f=S.next}}else if(u.tag===18){if(b=u.return,b===null)throw Error(c(341));b.lanes|=n,f=b.alternate,f!==null&&(f.lanes|=n),gi(b,n,e),b=null}else b=u.child;if(b!==null)b.return=u;else for(b=u;b!==null;){if(b===e){b=null;break}if(u=b.sibling,u!==null){u.return=b.return,b=u;break}b=b.return}u=b}}function ar(e,t,n,a){e=null;for(var u=t,f=!1;u!==null;){if(!f){if((u.flags&524288)!==0)f=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var b=u.alternate;if(b===null)throw Error(c(387));if(b=b.memoizedProps,b!==null){var S=u.type;Mn(u.pendingProps.value,b.value)||(e!==null?e.push(S):e=[S])}}else if(u===Me.current){if(b=u.alternate,b===null)throw Error(c(387));b.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(Gc):e=[Gc])}u=u.return}e!==null&&Tf(t,e,n,a),t.flags|=262144}function Hu(e){for(e=e.firstContext;e!==null;){if(!Mn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function bi(e){Ie=e,ut=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Pn(e){return rp(Ie,e)}function Bu(e,t){return Ie===null&&bi(e),rp(e,t)}function rp(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ut===null){if(e===null)throw Error(c(308));ut=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ut=ut.next=t;return n}var My=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,a){e.push(a)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},Oy=s.unstable_scheduleCallback,Dy=s.unstable_NormalPriority,_n={$$typeof:K,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ef(){return{controller:new My,data:new Map,refCount:0}}function gc(e){e.refCount--,e.refCount===0&&Oy(Dy,function(){e.controller.abort()})}var bc=null,Af=0,ir=0,rr=null;function Ly(e,t){if(bc===null){var n=bc=[];Af=0,ir=Md(),rr={status:"pending",value:void 0,then:function(a){n.push(a)}}}return Af++,t.then(cp,cp),t}function cp(){if(--Af===0&&bc!==null){rr!==null&&(rr.status="fulfilled");var e=bc;bc=null,ir=0,rr=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function zy(e,t){var n=[],a={status:"pending",value:null,reason:null,then:function(u){n.push(u)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var u=0;u<n.length;u++)(0,n[u])(t)},function(u){for(a.status="rejected",a.reason=u,u=0;u<n.length;u++)(0,n[u])(void 0)}),a}var up=B.S;B.S=function(e,t){$m=Qe(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Ly(e,t),up!==null&&up(e,t)};var xi=w(null);function Cf(){var e=xi.current;return e!==null?e:Lt.pooledCache}function Iu(e,t){t===null?re(xi,xi.current):re(xi,t.pool)}function op(){var e=Cf();return e===null?null:{parent:_n._currentValue,pool:e}}var cr=Error(c(460)),Rf=Error(c(474)),qu=Error(c(542)),Gu={then:function(){}};function fp(e){return e=e.status,e==="fulfilled"||e==="rejected"}function dp(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Dt,Dt),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,pp(e),e;default:if(typeof t.status=="string")t.then(Dt,Dt);else{if(e=Lt,e!==null&&100<e.shellSuspendCounter)throw Error(c(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var u=t;u.status="fulfilled",u.value=a}},function(a){if(t.status==="pending"){var u=t;u.status="rejected",u.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,pp(e),e}throw _i=t,cr}}function yi(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(_i=n,cr):n}}var _i=null;function hp(){if(_i===null)throw Error(c(459));var e=_i;return _i=null,e}function pp(e){if(e===cr||e===qu)throw Error(c(483))}var ur=null,xc=0;function Yu(e){var t=xc;return xc+=1,ur===null&&(ur=[]),dp(ur,e,t)}function yc(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Xu(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 mp(e){function t(U,R){if(e){var Y=U.deletions;Y===null?(U.deletions=[R],U.flags|=16):Y.push(R)}}function n(U,R){if(!e)return null;for(;R!==null;)t(U,R),R=R.sibling;return null}function a(U){for(var R=new Map;U!==null;)U.key!==null?R.set(U.key,U):R.set(U.index,U),U=U.sibling;return R}function u(U,R){return U=Pl(U,R),U.index=0,U.sibling=null,U}function f(U,R,Y){return U.index=Y,e?(Y=U.alternate,Y!==null?(Y=Y.index,Y<R?(U.flags|=67108866,R):Y):(U.flags|=67108866,R)):(U.flags|=1048576,R)}function b(U){return e&&U.alternate===null&&(U.flags|=67108866),U}function S(U,R,Y,ie){return R===null||R.tag!==6?(R=Fn(Y,U.mode,ie),R.return=U,R):(R=u(R,Y),R.return=U,R)}function C(U,R,Y,ie){var Le=Y.type;return Le===O?ne(U,R,Y.props.children,ie,Y.key):R!==null&&(R.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===Z&&yi(Le)===R.type)?(R=u(R,Y.props),yc(R,Y),R.return=U,R):(R=cl(Y.type,Y.key,Y.props,null,U.mode,ie),yc(R,Y),R.return=U,R)}function X(U,R,Y,ie){return R===null||R.tag!==4||R.stateNode.containerInfo!==Y.containerInfo||R.stateNode.implementation!==Y.implementation?(R=mi(Y,U.mode,ie),R.return=U,R):(R=u(R,Y.children||[]),R.return=U,R)}function ne(U,R,Y,ie,Le){return R===null||R.tag!==7?(R=On(Y,U.mode,ie,Le),R.return=U,R):(R=u(R,Y),R.return=U,R)}function ce(U,R,Y){if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return R=Fn(""+R,U.mode,Y),R.return=U,R;if(typeof R=="object"&&R!==null){switch(R.$$typeof){case E:return Y=cl(R.type,R.key,R.props,null,U.mode,Y),yc(Y,R),Y.return=U,Y;case k:return R=mi(R,U.mode,Y),R.return=U,R;case Z:return R=yi(R),ce(U,R,Y)}if(xe(R)||D(R))return R=On(R,U.mode,Y,null),R.return=U,R;if(typeof R.then=="function")return ce(U,Yu(R),Y);if(R.$$typeof===K)return ce(U,Bu(U,R),Y);Xu(U,R)}return null}function $(U,R,Y,ie){var Le=R!==null?R.key:null;if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return Le!==null?null:S(U,R,""+Y,ie);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case E:return Y.key===Le?C(U,R,Y,ie):null;case k:return Y.key===Le?X(U,R,Y,ie):null;case Z:return Y=yi(Y),$(U,R,Y,ie)}if(xe(Y)||D(Y))return Le!==null?null:ne(U,R,Y,ie,null);if(typeof Y.then=="function")return $(U,R,Yu(Y),ie);if(Y.$$typeof===K)return $(U,R,Bu(U,Y),ie);Xu(U,Y)}return null}function P(U,R,Y,ie,Le){if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return U=U.get(Y)||null,S(R,U,""+ie,Le);if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case E:return U=U.get(ie.key===null?Y:ie.key)||null,C(R,U,ie,Le);case k:return U=U.get(ie.key===null?Y:ie.key)||null,X(R,U,ie,Le);case Z:return ie=yi(ie),P(U,R,Y,ie,Le)}if(xe(ie)||D(ie))return U=U.get(Y)||null,ne(R,U,ie,Le,null);if(typeof ie.then=="function")return P(U,R,Y,Yu(ie),Le);if(ie.$$typeof===K)return P(U,R,Y,Bu(R,ie),Le);Xu(R,ie)}return null}function Ae(U,R,Y,ie){for(var Le=null,mt=null,Re=R,Fe=R=0,it=null;Re!==null&&Fe<Y.length;Fe++){Re.index>Fe?(it=Re,Re=null):it=Re.sibling;var gt=$(U,Re,Y[Fe],ie);if(gt===null){Re===null&&(Re=it);break}e&&Re&>.alternate===null&&t(U,Re),R=f(gt,R,Fe),mt===null?Le=gt:mt.sibling=gt,mt=gt,Re=it}if(Fe===Y.length)return n(U,Re),et&&es(U,Fe),Le;if(Re===null){for(;Fe<Y.length;Fe++)Re=ce(U,Y[Fe],ie),Re!==null&&(R=f(Re,R,Fe),mt===null?Le=Re:mt.sibling=Re,mt=Re);return et&&es(U,Fe),Le}for(Re=a(Re);Fe<Y.length;Fe++)it=P(Re,U,Fe,Y[Fe],ie),it!==null&&(e&&it.alternate!==null&&Re.delete(it.key===null?Fe:it.key),R=f(it,R,Fe),mt===null?Le=it:mt.sibling=it,mt=it);return e&&Re.forEach(function(Xa){return t(U,Xa)}),et&&es(U,Fe),Le}function He(U,R,Y,ie){if(Y==null)throw Error(c(151));for(var Le=null,mt=null,Re=R,Fe=R=0,it=null,gt=Y.next();Re!==null&&!gt.done;Fe++,gt=Y.next()){Re.index>Fe?(it=Re,Re=null):it=Re.sibling;var Xa=$(U,Re,gt.value,ie);if(Xa===null){Re===null&&(Re=it);break}e&&Re&&Xa.alternate===null&&t(U,Re),R=f(Xa,R,Fe),mt===null?Le=Xa:mt.sibling=Xa,mt=Xa,Re=it}if(gt.done)return n(U,Re),et&&es(U,Fe),Le;if(Re===null){for(;!gt.done;Fe++,gt=Y.next())gt=ce(U,gt.value,ie),gt!==null&&(R=f(gt,R,Fe),mt===null?Le=gt:mt.sibling=gt,mt=gt);return et&&es(U,Fe),Le}for(Re=a(Re);!gt.done;Fe++,gt=Y.next())gt=P(Re,U,Fe,gt.value,ie),gt!==null&&(e&>.alternate!==null&&Re.delete(gt.key===null?Fe:gt.key),R=f(gt,R,Fe),mt===null?Le=gt:mt.sibling=gt,mt=gt);return e&&Re.forEach(function(Q_){return t(U,Q_)}),et&&es(U,Fe),Le}function Rt(U,R,Y,ie){if(typeof Y=="object"&&Y!==null&&Y.type===O&&Y.key===null&&(Y=Y.props.children),typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case E:e:{for(var Le=Y.key;R!==null;){if(R.key===Le){if(Le=Y.type,Le===O){if(R.tag===7){n(U,R.sibling),ie=u(R,Y.props.children),ie.return=U,U=ie;break e}}else if(R.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===Z&&yi(Le)===R.type){n(U,R.sibling),ie=u(R,Y.props),yc(ie,Y),ie.return=U,U=ie;break e}n(U,R);break}else t(U,R);R=R.sibling}Y.type===O?(ie=On(Y.props.children,U.mode,ie,Y.key),ie.return=U,U=ie):(ie=cl(Y.type,Y.key,Y.props,null,U.mode,ie),yc(ie,Y),ie.return=U,U=ie)}return b(U);case k:e:{for(Le=Y.key;R!==null;){if(R.key===Le)if(R.tag===4&&R.stateNode.containerInfo===Y.containerInfo&&R.stateNode.implementation===Y.implementation){n(U,R.sibling),ie=u(R,Y.children||[]),ie.return=U,U=ie;break e}else{n(U,R);break}else t(U,R);R=R.sibling}ie=mi(Y,U.mode,ie),ie.return=U,U=ie}return b(U);case Z:return Y=yi(Y),Rt(U,R,Y,ie)}if(xe(Y))return Ae(U,R,Y,ie);if(D(Y)){if(Le=D(Y),typeof Le!="function")throw Error(c(150));return Y=Le.call(Y),He(U,R,Y,ie)}if(typeof Y.then=="function")return Rt(U,R,Yu(Y),ie);if(Y.$$typeof===K)return Rt(U,R,Bu(U,Y),ie);Xu(U,Y)}return typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint"?(Y=""+Y,R!==null&&R.tag===6?(n(U,R.sibling),ie=u(R,Y),ie.return=U,U=ie):(n(U,R),ie=Fn(Y,U.mode,ie),ie.return=U,U=ie),b(U)):n(U,R)}return function(U,R,Y,ie){try{xc=0;var Le=Rt(U,R,Y,ie);return ur=null,Le}catch(Re){if(Re===cr||Re===qu)throw Re;var mt=bl(29,Re,null,U.mode);return mt.lanes=ie,mt.return=U,mt}finally{}}}var vi=mp(!0),gp=mp(!1),Ta=!1;function Mf(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Of(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 Ea(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Aa(e,t,n){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(yt&2)!==0){var u=a.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),a.pending=t,t=tr(e),zu(e,null,n),t}return er(e,a,t,n),tr(e)}function _c(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,qs(e,n)}}function Df(e,t){var n=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,n===a)){var u=null,f=null;if(n=n.firstBaseUpdate,n!==null){do{var b={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};f===null?u=f=b:f=f.next=b,n=n.next}while(n!==null);f===null?u=f=t:f=f.next=t}else u=f=t;n={baseState:a.baseState,firstBaseUpdate:u,lastBaseUpdate:f,shared:a.shared,callbacks:a.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Lf=!1;function vc(){if(Lf){var e=rr;if(e!==null)throw e}}function Sc(e,t,n,a){Lf=!1;var u=e.updateQueue;Ta=!1;var f=u.firstBaseUpdate,b=u.lastBaseUpdate,S=u.shared.pending;if(S!==null){u.shared.pending=null;var C=S,X=C.next;C.next=null,b===null?f=X:b.next=X,b=C;var ne=e.alternate;ne!==null&&(ne=ne.updateQueue,S=ne.lastBaseUpdate,S!==b&&(S===null?ne.firstBaseUpdate=X:S.next=X,ne.lastBaseUpdate=C))}if(f!==null){var ce=u.baseState;b=0,ne=X=C=null,S=f;do{var $=S.lane&-536870913,P=$!==S.lane;if(P?(at&$)===$:(a&$)===$){$!==0&&$===ir&&(Lf=!0),ne!==null&&(ne=ne.next={lane:0,tag:S.tag,payload:S.payload,callback:null,next:null});e:{var Ae=e,He=S;$=t;var Rt=n;switch(He.tag){case 1:if(Ae=He.payload,typeof Ae=="function"){ce=Ae.call(Rt,ce,$);break e}ce=Ae;break e;case 3:Ae.flags=Ae.flags&-65537|128;case 0:if(Ae=He.payload,$=typeof Ae=="function"?Ae.call(Rt,ce,$):Ae,$==null)break e;ce=j({},ce,$);break e;case 2:Ta=!0}}$=S.callback,$!==null&&(e.flags|=64,P&&(e.flags|=8192),P=u.callbacks,P===null?u.callbacks=[$]:P.push($))}else P={lane:$,tag:S.tag,payload:S.payload,callback:S.callback,next:null},ne===null?(X=ne=P,C=ce):ne=ne.next=P,b|=$;if(S=S.next,S===null){if(S=u.shared.pending,S===null)break;P=S,S=P.next,P.next=null,u.lastBaseUpdate=P,u.shared.pending=null}}while(!0);ne===null&&(C=ce),u.baseState=C,u.firstBaseUpdate=X,u.lastBaseUpdate=ne,f===null&&(u.shared.lanes=0),Da|=b,e.lanes=b,e.memoizedState=ce}}function bp(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function xp(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)bp(n[e],t)}var or=w(null),Vu=w(0);function yp(e,t){e=aa,re(Vu,e),re(or,t),aa=e|t.baseLanes}function zf(){re(Vu,aa),re(or,or.current)}function Uf(){aa=Vu.current,Q(or),Q(Vu)}var Bl=w(null),ts=null;function Ca(e){var t=e.alternate;re(on,on.current&1),re(Bl,e),ts===null&&(t===null||or.current!==null||t.memoizedState!==null)&&(ts=e)}function Hf(e){re(on,on.current),re(Bl,e),ts===null&&(ts=e)}function _p(e){e.tag===22?(re(on,on.current),re(Bl,e),ts===null&&(ts=e)):Ra()}function Ra(){re(on,on.current),re(Bl,Bl.current)}function Il(e){Q(Bl),ts===e&&(ts=null),Q(on)}var on=w(0);function $u(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Xd(n)||Vd(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Js=0,Ke=null,At=null,vn=null,Qu=!1,fr=!1,Si=!1,Zu=0,jc=0,dr=null,Uy=0;function sn(){throw Error(c(321))}function Bf(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Mn(e[n],t[n]))return!1;return!0}function If(e,t,n,a,u,f){return Js=f,Ke=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,B.H=e===null||e.memoizedState===null?lm:td,Si=!1,f=n(a,u),Si=!1,fr&&(f=Sp(t,n,a,u)),vp(e),f}function vp(e){B.H=Nc;var t=At!==null&&At.next!==null;if(Js=0,vn=At=Ke=null,Qu=!1,jc=0,dr=null,t)throw Error(c(300));e===null||Sn||(e=e.dependencies,e!==null&&Hu(e)&&(Sn=!0))}function Sp(e,t,n,a){Ke=e;var u=0;do{if(fr&&(dr=null),jc=0,fr=!1,25<=u)throw Error(c(301));if(u+=1,vn=At=null,e.updateQueue!=null){var f=e.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}B.H=sm,f=t(n,a)}while(fr);return f}function Hy(){var e=B.H,t=e.useState()[0];return t=typeof t.then=="function"?kc(t):t,e=e.useState()[0],(At!==null?At.memoizedState:null)!==e&&(Ke.flags|=1024),t}function qf(){var e=Zu!==0;return Zu=0,e}function Gf(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Yf(e){if(Qu){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Qu=!1}Js=0,vn=At=Ke=null,fr=!1,jc=Zu=0,dr=null}function xl(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return vn===null?Ke.memoizedState=vn=e:vn=vn.next=e,vn}function fn(){if(At===null){var e=Ke.alternate;e=e!==null?e.memoizedState:null}else e=At.next;var t=vn===null?Ke.memoizedState:vn.next;if(t!==null)vn=t,At=e;else{if(e===null)throw Ke.alternate===null?Error(c(467)):Error(c(310));At=e,e={memoizedState:At.memoizedState,baseState:At.baseState,baseQueue:At.baseQueue,queue:At.queue,next:null},vn===null?Ke.memoizedState=vn=e:vn=vn.next=e}return vn}function Ku(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function kc(e){var t=jc;return jc+=1,dr===null&&(dr=[]),e=dp(dr,e,t),t=Ke,(vn===null?t.memoizedState:vn.next)===null&&(t=t.alternate,B.H=t===null||t.memoizedState===null?lm:td),e}function Fu(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return kc(e);if(e.$$typeof===K)return Pn(e)}throw Error(c(438,String(e)))}function Xf(e){var t=null,n=Ke.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var a=Ke.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(u){return u.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Ku(),Ke.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),a=0;a<e;a++)n[a]=G;return t.index++,n}function Ws(e,t){return typeof t=="function"?t(e):t}function Ju(e){var t=fn();return Vf(t,At,e)}function Vf(e,t,n){var a=e.queue;if(a===null)throw Error(c(311));a.lastRenderedReducer=n;var u=e.baseQueue,f=a.pending;if(f!==null){if(u!==null){var b=u.next;u.next=f.next,f.next=b}t.baseQueue=u=f,a.pending=null}if(f=e.baseState,u===null)e.memoizedState=f;else{t=u.next;var S=b=null,C=null,X=t,ne=!1;do{var ce=X.lane&-536870913;if(ce!==X.lane?(at&ce)===ce:(Js&ce)===ce){var $=X.revertLane;if($===0)C!==null&&(C=C.next={lane:0,revertLane:0,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null}),ce===ir&&(ne=!0);else if((Js&$)===$){X=X.next,$===ir&&(ne=!0);continue}else ce={lane:0,revertLane:X.revertLane,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},C===null?(S=C=ce,b=f):C=C.next=ce,Ke.lanes|=$,Da|=$;ce=X.action,Si&&n(f,ce),f=X.hasEagerState?X.eagerState:n(f,ce)}else $={lane:ce,revertLane:X.revertLane,gesture:X.gesture,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},C===null?(S=C=$,b=f):C=C.next=$,Ke.lanes|=ce,Da|=ce;X=X.next}while(X!==null&&X!==t);if(C===null?b=f:C.next=S,!Mn(f,e.memoizedState)&&(Sn=!0,ne&&(n=rr,n!==null)))throw n;e.memoizedState=f,e.baseState=b,e.baseQueue=C,a.lastRenderedState=f}return u===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function $f(e){var t=fn(),n=t.queue;if(n===null)throw Error(c(311));n.lastRenderedReducer=e;var a=n.dispatch,u=n.pending,f=t.memoizedState;if(u!==null){n.pending=null;var b=u=u.next;do f=e(f,b.action),b=b.next;while(b!==u);Mn(f,t.memoizedState)||(Sn=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),n.lastRenderedState=f}return[f,a]}function jp(e,t,n){var a=Ke,u=fn(),f=et;if(f){if(n===void 0)throw Error(c(407));n=n()}else n=t();var b=!Mn((At||u).memoizedState,n);if(b&&(u.memoizedState=n,Sn=!0),u=u.queue,Kf(Np.bind(null,a,u,e),[e]),u.getSnapshot!==t||b||vn!==null&&vn.memoizedState.tag&1){if(a.flags|=2048,hr(9,{destroy:void 0},wp.bind(null,a,u,n,t),null),Lt===null)throw Error(c(349));f||(Js&127)!==0||kp(a,t,n)}return n}function kp(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ke.updateQueue,t===null?(t=Ku(),Ke.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function wp(e,t,n,a){t.value=n,t.getSnapshot=a,Tp(t)&&Ep(e)}function Np(e,t,n){return n(function(){Tp(t)&&Ep(e)})}function Tp(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Mn(e,n)}catch{return!0}}function Ep(e){var t=Zs(e,2);t!==null&&Ml(t,e,2)}function Qf(e){var t=xl();if(typeof e=="function"){var n=e;if(e=n(),Si){Ut(!0);try{n()}finally{Ut(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ws,lastRenderedState:e},t}function Ap(e,t,n,a){return e.baseState=n,Vf(e,At,typeof a=="function"?a:Ws)}function By(e,t,n,a,u){if(eo(e))throw Error(c(485));if(e=t.action,e!==null){var f={payload:u,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(b){f.listeners.push(b)}};B.T!==null?n(!0):f.isTransition=!1,a(f),n=t.pending,n===null?(f.next=t.pending=f,Cp(t,f)):(f.next=n.next,t.pending=n.next=f)}}function Cp(e,t){var n=t.action,a=t.payload,u=e.state;if(t.isTransition){var f=B.T,b={};B.T=b;try{var S=n(u,a),C=B.S;C!==null&&C(b,S),Rp(e,t,S)}catch(X){Zf(e,t,X)}finally{f!==null&&b.types!==null&&(f.types=b.types),B.T=f}}else try{f=n(u,a),Rp(e,t,f)}catch(X){Zf(e,t,X)}}function Rp(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(a){Mp(e,t,a)},function(a){return Zf(e,t,a)}):Mp(e,t,n)}function Mp(e,t,n){t.status="fulfilled",t.value=n,Op(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Cp(e,n)))}function Zf(e,t,n){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=n,Op(t),t=t.next;while(t!==a)}e.action=null}function Op(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Dp(e,t){return t}function Lp(e,t){if(et){var n=Lt.formState;if(n!==null){e:{var a=Ke;if(et){if(St){t:{for(var u=St,f=g;u.nodeType!==8;){if(!f){u=null;break t}if(u=ns(u.nextSibling),u===null){u=null;break t}}f=u.data,u=f==="F!"||f==="F"?u:null}if(u){St=ns(u.nextSibling),a=u.data==="F!";break e}}pe(a)}a=!1}a&&(t=n[0])}}return n=xl(),n.memoizedState=n.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Dp,lastRenderedState:t},n.queue=a,n=em.bind(null,Ke,a),a.dispatch=n,a=Qf(!1),f=ed.bind(null,Ke,!1,a.queue),a=xl(),u={state:t,dispatch:null,action:e,pending:null},a.queue=u,n=By.bind(null,Ke,u,f,n),u.dispatch=n,a.memoizedState=e,[t,n,!1]}function zp(e){var t=fn();return Up(t,At,e)}function Up(e,t,n){if(t=Vf(e,t,Dp)[0],e=Ju(Ws)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=kc(t)}catch(b){throw b===cr?qu:b}else a=t;t=fn();var u=t.queue,f=u.dispatch;return n!==t.memoizedState&&(Ke.flags|=2048,hr(9,{destroy:void 0},Iy.bind(null,u,n),null)),[a,f,e]}function Iy(e,t){e.action=t}function Hp(e){var t=fn(),n=At;if(n!==null)return Up(t,n,e);fn(),t=t.memoizedState,n=fn();var a=n.queue.dispatch;return n.memoizedState=e,[t,a,!1]}function hr(e,t,n,a){return e={tag:e,create:n,deps:a,inst:t,next:null},t=Ke.updateQueue,t===null&&(t=Ku(),Ke.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(a=n.next,n.next=e,e.next=a,t.lastEffect=e),e}function Bp(){return fn().memoizedState}function Wu(e,t,n,a){var u=xl();Ke.flags|=e,u.memoizedState=hr(1|t,{destroy:void 0},n,a===void 0?null:a)}function Pu(e,t,n,a){var u=fn();a=a===void 0?null:a;var f=u.memoizedState.inst;At!==null&&a!==null&&Bf(a,At.memoizedState.deps)?u.memoizedState=hr(t,f,n,a):(Ke.flags|=e,u.memoizedState=hr(1|t,f,n,a))}function Ip(e,t){Wu(8390656,8,e,t)}function Kf(e,t){Pu(2048,8,e,t)}function qy(e){Ke.flags|=4;var t=Ke.updateQueue;if(t===null)t=Ku(),Ke.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function qp(e){var t=fn().memoizedState;return qy({ref:t,nextImpl:e}),function(){if((yt&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function Gp(e,t){return Pu(4,2,e,t)}function Yp(e,t){return Pu(4,4,e,t)}function Xp(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Vp(e,t,n){n=n!=null?n.concat([e]):null,Pu(4,4,Xp.bind(null,t,e),n)}function Ff(){}function $p(e,t){var n=fn();t=t===void 0?null:t;var a=n.memoizedState;return t!==null&&Bf(t,a[1])?a[0]:(n.memoizedState=[e,t],e)}function Qp(e,t){var n=fn();t=t===void 0?null:t;var a=n.memoizedState;if(t!==null&&Bf(t,a[1]))return a[0];if(a=e(),Si){Ut(!0);try{e()}finally{Ut(!1)}}return n.memoizedState=[a,t],a}function Jf(e,t,n){return n===void 0||(Js&1073741824)!==0&&(at&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Zm(),Ke.lanes|=e,Da|=e,n)}function Zp(e,t,n,a){return Mn(n,t)?n:or.current!==null?(e=Jf(e,n,a),Mn(e,t)||(Sn=!0),e):(Js&42)===0||(Js&1073741824)!==0&&(at&261930)===0?(Sn=!0,e.memoizedState=n):(e=Zm(),Ke.lanes|=e,Da|=e,t)}function Kp(e,t,n,a,u){var f=ue.p;ue.p=f!==0&&8>f?f:8;var b=B.T,S={};B.T=S,ed(e,!1,t,n);try{var C=u(),X=B.S;if(X!==null&&X(S,C),C!==null&&typeof C=="object"&&typeof C.then=="function"){var ne=zy(C,a);wc(e,t,ne,Yl(e))}else wc(e,t,a,Yl(e))}catch(ce){wc(e,t,{then:function(){},status:"rejected",reason:ce},Yl())}finally{ue.p=f,b!==null&&S.types!==null&&(b.types=S.types),B.T=b}}function Gy(){}function Wf(e,t,n,a){if(e.tag!==5)throw Error(c(476));var u=Fp(e).queue;Kp(e,u,t,se,n===null?Gy:function(){return Jp(e),n(a)})}function Fp(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:se,baseState:se,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ws,lastRenderedState:se},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ws,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Jp(e){var t=Fp(e);t.next===null&&(t=e.alternate.memoizedState),wc(e,t.next.queue,{},Yl())}function Pf(){return Pn(Gc)}function Wp(){return fn().memoizedState}function Pp(){return fn().memoizedState}function Yy(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Yl();e=Ea(n);var a=Aa(t,e,n);a!==null&&(Ml(a,t,n),_c(a,t,n)),t={cache:Ef()},e.payload=t;return}t=t.return}}function Xy(e,t,n){var a=Yl();n={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},eo(e)?tm(t,n):(n=dc(e,t,n,a),n!==null&&(Ml(n,e,a),nm(n,t,a)))}function em(e,t,n){var a=Yl();wc(e,t,n,a)}function wc(e,t,n,a){var u={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(eo(e))tm(t,u);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var b=t.lastRenderedState,S=f(b,n);if(u.hasEagerState=!0,u.eagerState=S,Mn(S,b))return er(e,t,u,0),Lt===null&&Pi(),!1}catch{}finally{}if(n=dc(e,t,u,a),n!==null)return Ml(n,e,a),nm(n,t,a),!0}return!1}function ed(e,t,n,a){if(a={lane:2,revertLane:Md(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},eo(e)){if(t)throw Error(c(479))}else t=dc(e,n,a,2),t!==null&&Ml(t,e,2)}function eo(e){var t=e.alternate;return e===Ke||t!==null&&t===Ke}function tm(e,t){fr=Qu=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function nm(e,t,n){if((n&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,qs(e,n)}}var Nc={readContext:Pn,use:Fu,useCallback:sn,useContext:sn,useEffect:sn,useImperativeHandle:sn,useLayoutEffect:sn,useInsertionEffect:sn,useMemo:sn,useReducer:sn,useRef:sn,useState:sn,useDebugValue:sn,useDeferredValue:sn,useTransition:sn,useSyncExternalStore:sn,useId:sn,useHostTransitionStatus:sn,useFormState:sn,useActionState:sn,useOptimistic:sn,useMemoCache:sn,useCacheRefresh:sn};Nc.useEffectEvent=sn;var lm={readContext:Pn,use:Fu,useCallback:function(e,t){return xl().memoizedState=[e,t===void 0?null:t],e},useContext:Pn,useEffect:Ip,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Wu(4194308,4,Xp.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Wu(4194308,4,e,t)},useInsertionEffect:function(e,t){Wu(4,2,e,t)},useMemo:function(e,t){var n=xl();t=t===void 0?null:t;var a=e();if(Si){Ut(!0);try{e()}finally{Ut(!1)}}return n.memoizedState=[a,t],a},useReducer:function(e,t,n){var a=xl();if(n!==void 0){var u=n(t);if(Si){Ut(!0);try{n(t)}finally{Ut(!1)}}}else u=t;return a.memoizedState=a.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},a.queue=e,e=e.dispatch=Xy.bind(null,Ke,e),[a.memoizedState,e]},useRef:function(e){var t=xl();return e={current:e},t.memoizedState=e},useState:function(e){e=Qf(e);var t=e.queue,n=em.bind(null,Ke,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ff,useDeferredValue:function(e,t){var n=xl();return Jf(n,e,t)},useTransition:function(){var e=Qf(!1);return e=Kp.bind(null,Ke,e.queue,!0,!1),xl().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var a=Ke,u=xl();if(et){if(n===void 0)throw Error(c(407));n=n()}else{if(n=t(),Lt===null)throw Error(c(349));(at&127)!==0||kp(a,t,n)}u.memoizedState=n;var f={value:n,getSnapshot:t};return u.queue=f,Ip(Np.bind(null,a,f,e),[e]),a.flags|=2048,hr(9,{destroy:void 0},wp.bind(null,a,f,n,t),null),n},useId:function(){var e=xl(),t=Lt.identifierPrefix;if(et){var n=Wn,a=ol;n=(a&~(1<<32-$e(a)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Zu++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=Uy++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Pf,useFormState:Lp,useActionState:Lp,useOptimistic:function(e){var t=xl();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=ed.bind(null,Ke,!0,n),n.dispatch=t,[e,t]},useMemoCache:Xf,useCacheRefresh:function(){return xl().memoizedState=Yy.bind(null,Ke)},useEffectEvent:function(e){var t=xl(),n={impl:e};return t.memoizedState=n,function(){if((yt&2)!==0)throw Error(c(440));return n.impl.apply(void 0,arguments)}}},td={readContext:Pn,use:Fu,useCallback:$p,useContext:Pn,useEffect:Kf,useImperativeHandle:Vp,useInsertionEffect:Gp,useLayoutEffect:Yp,useMemo:Qp,useReducer:Ju,useRef:Bp,useState:function(){return Ju(Ws)},useDebugValue:Ff,useDeferredValue:function(e,t){var n=fn();return Zp(n,At.memoizedState,e,t)},useTransition:function(){var e=Ju(Ws)[0],t=fn().memoizedState;return[typeof e=="boolean"?e:kc(e),t]},useSyncExternalStore:jp,useId:Wp,useHostTransitionStatus:Pf,useFormState:zp,useActionState:zp,useOptimistic:function(e,t){var n=fn();return Ap(n,At,e,t)},useMemoCache:Xf,useCacheRefresh:Pp};td.useEffectEvent=qp;var sm={readContext:Pn,use:Fu,useCallback:$p,useContext:Pn,useEffect:Kf,useImperativeHandle:Vp,useInsertionEffect:Gp,useLayoutEffect:Yp,useMemo:Qp,useReducer:$f,useRef:Bp,useState:function(){return $f(Ws)},useDebugValue:Ff,useDeferredValue:function(e,t){var n=fn();return At===null?Jf(n,e,t):Zp(n,At.memoizedState,e,t)},useTransition:function(){var e=$f(Ws)[0],t=fn().memoizedState;return[typeof e=="boolean"?e:kc(e),t]},useSyncExternalStore:jp,useId:Wp,useHostTransitionStatus:Pf,useFormState:Hp,useActionState:Hp,useOptimistic:function(e,t){var n=fn();return At!==null?Ap(n,At,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Xf,useCacheRefresh:Pp};sm.useEffectEvent=qp;function nd(e,t,n,a){t=e.memoizedState,n=n(a,t),n=n==null?t:j({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var ld={enqueueSetState:function(e,t,n){e=e._reactInternals;var a=Yl(),u=Ea(a);u.payload=t,n!=null&&(u.callback=n),t=Aa(e,u,a),t!==null&&(Ml(t,e,a),_c(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var a=Yl(),u=Ea(a);u.tag=1,u.payload=t,n!=null&&(u.callback=n),t=Aa(e,u,a),t!==null&&(Ml(t,e,a),_c(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Yl(),a=Ea(n);a.tag=2,t!=null&&(a.callback=t),t=Aa(e,a,n),t!==null&&(Ml(t,e,n),_c(t,e,n))}};function am(e,t,n,a,u,f,b){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,f,b):t.prototype&&t.prototype.isPureReactComponent?!_a(n,a)||!_a(u,f):!0}function im(e,t,n,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,a),t.state!==e&&ld.enqueueReplaceState(t,t.state,null)}function ji(e,t){var n=t;if("ref"in t){n={};for(var a in t)a!=="ref"&&(n[a]=t[a])}if(e=e.defaultProps){n===t&&(n=j({},n));for(var u in e)n[u]===void 0&&(n[u]=e[u])}return n}function rm(e){Wi(e)}function cm(e){console.error(e)}function um(e){Wi(e)}function to(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function om(e,t,n){try{var a=e.onCaughtError;a(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function sd(e,t,n){return n=Ea(n),n.tag=3,n.payload={element:null},n.callback=function(){to(e,t)},n}function fm(e){return e=Ea(e),e.tag=3,e}function dm(e,t,n,a){var u=n.type.getDerivedStateFromError;if(typeof u=="function"){var f=a.value;e.payload=function(){return u(f)},e.callback=function(){om(t,n,a)}}var b=n.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(e.callback=function(){om(t,n,a),typeof u!="function"&&(La===null?La=new Set([this]):La.add(this));var S=a.stack;this.componentDidCatch(a.value,{componentStack:S!==null?S:""})})}function Vy(e,t,n,a,u){if(n.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=n.alternate,t!==null&&ar(t,n,u,!0),n=Bl.current,n!==null){switch(n.tag){case 31:case 13:return ts===null?po():n.alternate===null&&an===0&&(an=3),n.flags&=-257,n.flags|=65536,n.lanes=u,a===Gu?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([a]):t.add(a),Ad(e,a,u)),!1;case 22:return n.flags|=65536,a===Gu?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([a]):n.add(a)),Ad(e,a,u)),!1}throw Error(c(435,n.tag))}return Ad(e,a,u),po(),!1}if(et)return t=Bl.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,a!==q&&(e=Error(c(422),{cause:a}),Ee(Jn(e,n)))):(a!==q&&(t=Error(c(423),{cause:a}),Ee(Jn(t,n))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,a=Jn(a,n),u=sd(e.stateNode,a,u),Df(e,u),an!==4&&(an=2)),!1;var f=Error(c(520),{cause:a});if(f=Jn(f,n),Dc===null?Dc=[f]:Dc.push(f),an!==4&&(an=2),t===null)return!0;a=Jn(a,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=u&-u,n.lanes|=e,e=sd(n.stateNode,a,e),Df(n,e),!1;case 1:if(t=n.type,f=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(La===null||!La.has(f))))return n.flags|=65536,u&=-u,n.lanes|=u,u=fm(u),dm(u,e,n,a),Df(n,u),!1}n=n.return}while(n!==null);return!1}var ad=Error(c(461)),Sn=!1;function el(e,t,n,a){t.child=e===null?gp(t,null,n,a):vi(t,e.child,n,a)}function hm(e,t,n,a,u){n=n.render;var f=t.ref;if("ref"in a){var b={};for(var S in a)S!=="ref"&&(b[S]=a[S])}else b=a;return bi(t),a=If(e,t,n,b,f,u),S=qf(),e!==null&&!Sn?(Gf(e,t,u),Ps(e,t,u)):(et&&S&&lr(t),t.flags|=1,el(e,t,a,u),t.child)}function pm(e,t,n,a,u){if(e===null){var f=n.type;return typeof f=="function"&&!nr(f)&&f.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=f,mm(e,t,f,a,u)):(e=cl(n.type,null,a,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!hd(e,u)){var b=f.memoizedProps;if(n=n.compare,n=n!==null?n:_a,n(b,a)&&e.ref===t.ref)return Ps(e,t,u)}return t.flags|=1,e=Pl(f,a),e.ref=t.ref,e.return=t,t.child=e}function mm(e,t,n,a,u){if(e!==null){var f=e.memoizedProps;if(_a(f,a)&&e.ref===t.ref)if(Sn=!1,t.pendingProps=a=f,hd(e,u))(e.flags&131072)!==0&&(Sn=!0);else return t.lanes=e.lanes,Ps(e,t,u)}return id(e,t,n,a,u)}function gm(e,t,n,a){var u=a.children,f=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((t.flags&128)!==0){if(f=f!==null?f.baseLanes|n:n,e!==null){for(a=t.child=e.child,u=0;a!==null;)u=u|a.lanes|a.childLanes,a=a.sibling;a=u&~f}else a=0,t.child=null;return bm(e,t,f,n,a)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Iu(t,f!==null?f.cachePool:null),f!==null?yp(t,f):zf(),_p(t);else return a=t.lanes=536870912,bm(e,t,f!==null?f.baseLanes|n:n,n,a)}else f!==null?(Iu(t,f.cachePool),yp(t,f),Ra(),t.memoizedState=null):(e!==null&&Iu(t,null),zf(),Ra());return el(e,t,u,n),t.child}function Tc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function bm(e,t,n,a,u){var f=Cf();return f=f===null?null:{parent:_n._currentValue,pool:f},t.memoizedState={baseLanes:n,cachePool:f},e!==null&&Iu(t,null),zf(),_p(t),e!==null&&ar(e,t,a,!0),t.childLanes=u,null}function no(e,t){return t=so({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function xm(e,t,n){return vi(t,e.child,null,n),e=no(t,t.pendingProps),e.flags|=2,Il(t),t.memoizedState=null,e}function $y(e,t,n){var a=t.pendingProps,u=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(et){if(a.mode==="hidden")return e=no(t,a),t.lanes=536870912,Tc(null,e);if(Hf(t),(e=St)?(e=Cg(e,g),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ts!==null?{id:ol,overflow:Wn}:null,retryLane:536870912,hydrationErrors:null},n=hc(e),n.return=t,t.child=n,Dn=t,St=null)):e=null,e===null)throw pe(t);return t.lanes=536870912,null}return no(t,a)}var f=e.memoizedState;if(f!==null){var b=f.dehydrated;if(Hf(t),u)if(t.flags&256)t.flags&=-257,t=xm(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(c(558));else if(Sn||ar(e,t,n,!1),u=(n&e.childLanes)!==0,Sn||u){if(a=Lt,a!==null&&(b=Ll(a,n),b!==0&&b!==f.retryLane))throw f.retryLane=b,Zs(e,b),Ml(a,e,b),ad;po(),t=xm(e,t,n)}else e=f.treeContext,St=ns(b.nextSibling),Dn=t,et=!0,ds=null,g=!1,e!==null&&Uu(t,e),t=no(t,a),t.flags|=4096;return t}return e=Pl(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function lo(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(c(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function id(e,t,n,a,u){return bi(t),n=If(e,t,n,a,void 0,u),a=qf(),e!==null&&!Sn?(Gf(e,t,u),Ps(e,t,u)):(et&&a&&lr(t),t.flags|=1,el(e,t,n,u),t.child)}function ym(e,t,n,a,u,f){return bi(t),t.updateQueue=null,n=Sp(t,a,n,u),vp(e),a=qf(),e!==null&&!Sn?(Gf(e,t,f),Ps(e,t,f)):(et&&a&&lr(t),t.flags|=1,el(e,t,n,f),t.child)}function _m(e,t,n,a,u){if(bi(t),t.stateNode===null){var f=ka,b=n.contextType;typeof b=="object"&&b!==null&&(f=Pn(b)),f=new n(a,f),t.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=ld,t.stateNode=f,f._reactInternals=t,f=t.stateNode,f.props=a,f.state=t.memoizedState,f.refs={},Mf(t),b=n.contextType,f.context=typeof b=="object"&&b!==null?Pn(b):ka,f.state=t.memoizedState,b=n.getDerivedStateFromProps,typeof b=="function"&&(nd(t,n,b,a),f.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(b=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),b!==f.state&&ld.enqueueReplaceState(f,f.state,null),Sc(t,a,f,u),vc(),f.state=t.memoizedState),typeof f.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){f=t.stateNode;var S=t.memoizedProps,C=ji(n,S);f.props=C;var X=f.context,ne=n.contextType;b=ka,typeof ne=="object"&&ne!==null&&(b=Pn(ne));var ce=n.getDerivedStateFromProps;ne=typeof ce=="function"||typeof f.getSnapshotBeforeUpdate=="function",S=t.pendingProps!==S,ne||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(S||X!==b)&&im(t,f,a,b),Ta=!1;var $=t.memoizedState;f.state=$,Sc(t,a,f,u),vc(),X=t.memoizedState,S||$!==X||Ta?(typeof ce=="function"&&(nd(t,n,ce,a),X=t.memoizedState),(C=Ta||am(t,n,C,a,$,X,b))?(ne||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=a,t.memoizedState=X),f.props=a,f.state=X,f.context=b,a=C):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{f=t.stateNode,Of(e,t),b=t.memoizedProps,ne=ji(n,b),f.props=ne,ce=t.pendingProps,$=f.context,X=n.contextType,C=ka,typeof X=="object"&&X!==null&&(C=Pn(X)),S=n.getDerivedStateFromProps,(X=typeof S=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(b!==ce||$!==C)&&im(t,f,a,C),Ta=!1,$=t.memoizedState,f.state=$,Sc(t,a,f,u),vc();var P=t.memoizedState;b!==ce||$!==P||Ta||e!==null&&e.dependencies!==null&&Hu(e.dependencies)?(typeof S=="function"&&(nd(t,n,S,a),P=t.memoizedState),(ne=Ta||am(t,n,ne,a,$,P,C)||e!==null&&e.dependencies!==null&&Hu(e.dependencies))?(X||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(a,P,C),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(a,P,C)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||b===e.memoizedProps&&$===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&$===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=P),f.props=a,f.state=P,f.context=C,a=ne):(typeof f.componentDidUpdate!="function"||b===e.memoizedProps&&$===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&$===e.memoizedState||(t.flags|=1024),a=!1)}return f=a,lo(e,t),a=(t.flags&128)!==0,f||a?(f=t.stateNode,n=a&&typeof n.getDerivedStateFromError!="function"?null:f.render(),t.flags|=1,e!==null&&a?(t.child=vi(t,e.child,null,u),t.child=vi(t,null,n,u)):el(e,t,n,u),t.memoizedState=f.state,e=t.child):e=Ps(e,t,u),e}function vm(e,t,n,a){return Ln(),t.flags|=256,el(e,t,n,a),t.child}var rd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function cd(e){return{baseLanes:e,cachePool:op()}}function ud(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Gl),e}function Sm(e,t,n){var a=t.pendingProps,u=!1,f=(t.flags&128)!==0,b;if((b=f)||(b=e!==null&&e.memoizedState===null?!1:(on.current&2)!==0),b&&(u=!0,t.flags&=-129),b=(t.flags&32)!==0,t.flags&=-33,e===null){if(et){if(u?Ca(t):Ra(),(e=St)?(e=Cg(e,g),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ts!==null?{id:ol,overflow:Wn}:null,retryLane:536870912,hydrationErrors:null},n=hc(e),n.return=t,t.child=n,Dn=t,St=null)):e=null,e===null)throw pe(t);return Vd(e)?t.lanes=32:t.lanes=536870912,null}var S=a.children;return a=a.fallback,u?(Ra(),u=t.mode,S=so({mode:"hidden",children:S},u),a=On(a,u,n,null),S.return=t,a.return=t,S.sibling=a,t.child=S,a=t.child,a.memoizedState=cd(n),a.childLanes=ud(e,b,n),t.memoizedState=rd,Tc(null,a)):(Ca(t),od(t,S))}var C=e.memoizedState;if(C!==null&&(S=C.dehydrated,S!==null)){if(f)t.flags&256?(Ca(t),t.flags&=-257,t=fd(e,t,n)):t.memoizedState!==null?(Ra(),t.child=e.child,t.flags|=128,t=null):(Ra(),S=a.fallback,u=t.mode,a=so({mode:"visible",children:a.children},u),S=On(S,u,n,null),S.flags|=2,a.return=t,S.return=t,a.sibling=S,t.child=a,vi(t,e.child,null,n),a=t.child,a.memoizedState=cd(n),a.childLanes=ud(e,b,n),t.memoizedState=rd,t=Tc(null,a));else if(Ca(t),Vd(S)){if(b=S.nextSibling&&S.nextSibling.dataset,b)var X=b.dgst;b=X,a=Error(c(419)),a.stack="",a.digest=b,Ee({value:a,source:null,stack:null}),t=fd(e,t,n)}else if(Sn||ar(e,t,n,!1),b=(n&e.childLanes)!==0,Sn||b){if(b=Lt,b!==null&&(a=Ll(b,n),a!==0&&a!==C.retryLane))throw C.retryLane=a,Zs(e,a),Ml(b,e,a),ad;Xd(S)||po(),t=fd(e,t,n)}else Xd(S)?(t.flags|=192,t.child=e.child,t=null):(e=C.treeContext,St=ns(S.nextSibling),Dn=t,et=!0,ds=null,g=!1,e!==null&&Uu(t,e),t=od(t,a.children),t.flags|=4096);return t}return u?(Ra(),S=a.fallback,u=t.mode,C=e.child,X=C.sibling,a=Pl(C,{mode:"hidden",children:a.children}),a.subtreeFlags=C.subtreeFlags&65011712,X!==null?S=Pl(X,S):(S=On(S,u,n,null),S.flags|=2),S.return=t,a.return=t,a.sibling=S,t.child=a,Tc(null,a),a=t.child,S=e.child.memoizedState,S===null?S=cd(n):(u=S.cachePool,u!==null?(C=_n._currentValue,u=u.parent!==C?{parent:C,pool:C}:u):u=op(),S={baseLanes:S.baseLanes|n,cachePool:u}),a.memoizedState=S,a.childLanes=ud(e,b,n),t.memoizedState=rd,Tc(e.child,a)):(Ca(t),n=e.child,e=n.sibling,n=Pl(n,{mode:"visible",children:a.children}),n.return=t,n.sibling=null,e!==null&&(b=t.deletions,b===null?(t.deletions=[e],t.flags|=16):b.push(e)),t.child=n,t.memoizedState=null,n)}function od(e,t){return t=so({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function so(e,t){return e=bl(22,e,null,t),e.lanes=0,e}function fd(e,t,n){return vi(t,e.child,null,n),e=od(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function jm(e,t,n){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),gi(e.return,t,n)}function dd(e,t,n,a,u,f){var b=e.memoizedState;b===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:n,tailMode:u,treeForkCount:f}:(b.isBackwards=t,b.rendering=null,b.renderingStartTime=0,b.last=a,b.tail=n,b.tailMode=u,b.treeForkCount=f)}function km(e,t,n){var a=t.pendingProps,u=a.revealOrder,f=a.tail;a=a.children;var b=on.current,S=(b&2)!==0;if(S?(b=b&1|2,t.flags|=128):b&=1,re(on,b),el(e,t,a,n),a=et?Na:0,!S&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&jm(e,n,t);else if(e.tag===19)jm(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(u){case"forwards":for(n=t.child,u=null;n!==null;)e=n.alternate,e!==null&&$u(e)===null&&(u=n),n=n.sibling;n=u,n===null?(u=t.child,t.child=null):(u=n.sibling,n.sibling=null),dd(t,!1,u,n,f,a);break;case"backwards":case"unstable_legacy-backwards":for(n=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&$u(e)===null){t.child=u;break}e=u.sibling,u.sibling=n,n=u,u=e}dd(t,!0,n,null,f,a);break;case"together":dd(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function Ps(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Da|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(ar(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(c(153));if(t.child!==null){for(e=t.child,n=Pl(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Pl(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function hd(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Hu(e)))}function Qy(e,t,n){switch(t.tag){case 3:ht(t,t.stateNode.containerInfo),dt(t,_n,e.memoizedState.cache),Ln();break;case 27:case 5:Nn(t);break;case 4:ht(t,t.stateNode.containerInfo);break;case 10:dt(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Hf(t),null;break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(Ca(t),t.flags|=128,null):(n&t.child.childLanes)!==0?Sm(e,t,n):(Ca(t),e=Ps(e,t,n),e!==null?e.sibling:null);Ca(t);break;case 19:var u=(e.flags&128)!==0;if(a=(n&t.childLanes)!==0,a||(ar(e,t,n,!1),a=(n&t.childLanes)!==0),u){if(a)return km(e,t,n);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),re(on,on.current),a)break;return null;case 22:return t.lanes=0,gm(e,t,n,t.pendingProps);case 24:dt(t,_n,e.memoizedState.cache)}return Ps(e,t,n)}function wm(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Sn=!0;else{if(!hd(e,n)&&(t.flags&128)===0)return Sn=!1,Qy(e,t,n);Sn=(e.flags&131072)!==0}else Sn=!1,et&&(t.flags&1048576)!==0&&mc(t,Na,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=yi(t.elementType),t.type=e,typeof e=="function")nr(e)?(a=ji(e,a),t.tag=1,t=_m(null,t,e,a,n)):(t.tag=0,t=id(null,t,e,a,n));else{if(e!=null){var u=e.$$typeof;if(u===M){t.tag=11,t=hm(null,t,e,a,n);break e}else if(u===A){t.tag=14,t=pm(null,t,e,a,n);break e}}throw t=Se(e)||e,Error(c(306,t,""))}}return t;case 0:return id(e,t,t.type,t.pendingProps,n);case 1:return a=t.type,u=ji(a,t.pendingProps),_m(e,t,a,u,n);case 3:e:{if(ht(t,t.stateNode.containerInfo),e===null)throw Error(c(387));a=t.pendingProps;var f=t.memoizedState;u=f.element,Of(e,t),Sc(t,a,null,n);var b=t.memoizedState;if(a=b.cache,dt(t,_n,a),a!==f.cache&&Tf(t,[_n],n,!0),vc(),a=b.element,f.isDehydrated)if(f={element:a,isDehydrated:!1,cache:b.cache},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){t=vm(e,t,a,n);break e}else if(a!==u){u=Jn(Error(c(424)),t),Ee(u),t=vm(e,t,a,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(St=ns(e.firstChild),Dn=t,et=!0,ds=null,g=!0,n=gp(t,null,a,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ln(),a===u){t=Ps(e,t,n);break e}el(e,t,a,n)}t=t.child}return t;case 26:return lo(e,t),e===null?(n=zg(t.type,null,t.pendingProps,null))?t.memoizedState=n:et||(n=t.type,e=t.pendingProps,a=vo(je.current).createElement(n),a[Ht]=t,a[Ze]=e,tl(a,n,e),Tt(a),t.stateNode=a):t.memoizedState=zg(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Nn(t),e===null&&et&&(a=t.stateNode=Og(t.type,t.pendingProps,je.current),Dn=t,g=!0,u=St,Ba(t.type)?($d=u,St=ns(a.firstChild)):St=u),el(e,t,t.pendingProps.children,n),lo(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&et&&((u=a=St)&&(a=j_(a,t.type,t.pendingProps,g),a!==null?(t.stateNode=a,Dn=t,St=ns(a.firstChild),g=!1,u=!0):u=!1),u||pe(t)),Nn(t),u=t.type,f=t.pendingProps,b=e!==null?e.memoizedProps:null,a=f.children,qd(u,f)?a=null:b!==null&&qd(u,b)&&(t.flags|=32),t.memoizedState!==null&&(u=If(e,t,Hy,null,null,n),Gc._currentValue=u),lo(e,t),el(e,t,a,n),t.child;case 6:return e===null&&et&&((e=n=St)&&(n=k_(n,t.pendingProps,g),n!==null?(t.stateNode=n,Dn=t,St=null,e=!0):e=!1),e||pe(t)),null;case 13:return Sm(e,t,n);case 4:return ht(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=vi(t,null,a,n):el(e,t,a,n),t.child;case 11:return hm(e,t,t.type,t.pendingProps,n);case 7:return el(e,t,t.pendingProps,n),t.child;case 8:return el(e,t,t.pendingProps.children,n),t.child;case 12:return el(e,t,t.pendingProps.children,n),t.child;case 10:return a=t.pendingProps,dt(t,t.type,a.value),el(e,t,a.children,n),t.child;case 9:return u=t.type._context,a=t.pendingProps.children,bi(t),u=Pn(u),a=a(u),t.flags|=1,el(e,t,a,n),t.child;case 14:return pm(e,t,t.type,t.pendingProps,n);case 15:return mm(e,t,t.type,t.pendingProps,n);case 19:return km(e,t,n);case 31:return $y(e,t,n);case 22:return gm(e,t,n,t.pendingProps);case 24:return bi(t),a=Pn(_n),e===null?(u=Cf(),u===null&&(u=Lt,f=Ef(),u.pooledCache=f,f.refCount++,f!==null&&(u.pooledCacheLanes|=n),u=f),t.memoizedState={parent:a,cache:u},Mf(t),dt(t,_n,u)):((e.lanes&n)!==0&&(Of(e,t),Sc(t,null,null,n),vc()),u=e.memoizedState,f=t.memoizedState,u.parent!==a?(u={parent:a,cache:a},t.memoizedState=u,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=u),dt(t,_n,a)):(a=f.cache,dt(t,_n,a),a!==u.cache&&Tf(t,[_n],n,!0))),el(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function ea(e){e.flags|=4}function pd(e,t,n,a,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(Wm())e.flags|=8192;else throw _i=Gu,Rf}else e.flags&=-16777217}function Nm(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!qg(t))if(Wm())e.flags|=8192;else throw _i=Gu,Rf}function ao(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Pe():536870912,e.lanes|=t,br|=t)}function Ec(e,t){if(!et)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function Gt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,a=0;if(t)for(var u=e.child;u!==null;)n|=u.lanes|u.childLanes,a|=u.subtreeFlags&65011712,a|=u.flags&65011712,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)n|=u.lanes|u.childLanes,a|=u.subtreeFlags,a|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=a,e.childLanes=n,t}function Zy(e,t,n){var a=t.pendingProps;switch(sr(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Gt(t),null;case 1:return Gt(t),null;case 3:return n=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),zn(_n),lt(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(yn(t)?ea(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Fs())),Gt(t),null;case 26:var u=t.type,f=t.memoizedState;return e===null?(ea(t),f!==null?(Gt(t),Nm(t,f)):(Gt(t),pd(t,u,null,a,n))):f?f!==e.memoizedState?(ea(t),Gt(t),Nm(t,f)):(Gt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&ea(t),Gt(t),pd(t,u,e,a,n)),null;case 27:if(Je(t),n=je.current,u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&ea(t);else{if(!a){if(t.stateNode===null)throw Error(c(166));return Gt(t),null}e=oe.current,yn(t)?Ye(t):(e=Og(u,a,n),t.stateNode=e,ea(t))}return Gt(t),null;case 5:if(Je(t),u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&ea(t);else{if(!a){if(t.stateNode===null)throw Error(c(166));return Gt(t),null}if(f=oe.current,yn(t))Ye(t);else{var b=vo(je.current);switch(f){case 1:f=b.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:f=b.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":f=b.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":f=b.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":f=b.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof a.is=="string"?b.createElement("select",{is:a.is}):b.createElement("select"),a.multiple?f.multiple=!0:a.size&&(f.size=a.size);break;default:f=typeof a.is=="string"?b.createElement(u,{is:a.is}):b.createElement(u)}}f[Ht]=t,f[Ze]=a;e:for(b=t.child;b!==null;){if(b.tag===5||b.tag===6)f.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===t)break e;for(;b.sibling===null;){if(b.return===null||b.return===t)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}t.stateNode=f;e:switch(tl(f,u,a),u){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&ea(t)}}return Gt(t),pd(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&ea(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(c(166));if(e=je.current,yn(t)){if(e=t.stateNode,n=t.memoizedProps,a=null,u=Dn,u!==null)switch(u.tag){case 27:case 5:a=u.memoizedProps}e[Ht]=t,e=!!(e.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||Sg(e.nodeValue,n)),e||pe(t,!0)}else e=vo(e).createTextNode(a),e[Ht]=t,t.stateNode=e}return Gt(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(a=yn(t),n!==null){if(e===null){if(!a)throw Error(c(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(557));e[Ht]=t}else Ln(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Gt(t),e=!1}else n=Fs(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Il(t),t):(Il(t),null);if((t.flags&128)!==0)throw Error(c(558))}return Gt(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=yn(t),a!==null&&a.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[Ht]=t}else Ln(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Gt(t),u=!1}else u=Fs(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(Il(t),t):(Il(t),null)}return Il(t),(t.flags&128)!==0?(t.lanes=n,t):(n=a!==null,e=e!==null&&e.memoizedState!==null,n&&(a=t.child,u=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(u=a.alternate.memoizedState.cachePool.pool),f=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(f=a.memoizedState.cachePool.pool),f!==u&&(a.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),ao(t,t.updateQueue),Gt(t),null);case 4:return lt(),e===null&&zd(t.stateNode.containerInfo),Gt(t),null;case 10:return zn(t.type),Gt(t),null;case 19:if(Q(on),a=t.memoizedState,a===null)return Gt(t),null;if(u=(t.flags&128)!==0,f=a.rendering,f===null)if(u)Ec(a,!1);else{if(an!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=$u(e),f!==null){for(t.flags|=128,Ec(a,!1),e=f.updateQueue,t.updateQueue=e,ao(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)pi(n,e),n=n.sibling;return re(on,on.current&1|2),et&&es(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&Qe()>oo&&(t.flags|=128,u=!0,Ec(a,!1),t.lanes=4194304)}else{if(!u)if(e=$u(f),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,ao(t,e),Ec(a,!0),a.tail===null&&a.tailMode==="hidden"&&!f.alternate&&!et)return Gt(t),null}else 2*Qe()-a.renderingStartTime>oo&&n!==536870912&&(t.flags|=128,u=!0,Ec(a,!1),t.lanes=4194304);a.isBackwards?(f.sibling=t.child,t.child=f):(e=a.last,e!==null?e.sibling=f:t.child=f,a.last=f)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=Qe(),e.sibling=null,n=on.current,re(on,u?n&1|2:n&1),et&&es(t,a.treeForkCount),e):(Gt(t),null);case 22:case 23:return Il(t),Uf(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(n&536870912)!==0&&(t.flags&128)===0&&(Gt(t),t.subtreeFlags&6&&(t.flags|=8192)):Gt(t),n=t.updateQueue,n!==null&&ao(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==n&&(t.flags|=2048),e!==null&&Q(xi),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),zn(_n),Gt(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function Ky(e,t){switch(sr(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return zn(_n),lt(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Je(t),null;case 31:if(t.memoizedState!==null){if(Il(t),t.alternate===null)throw Error(c(340));Ln()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Il(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));Ln()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Q(on),null;case 4:return lt(),null;case 10:return zn(t.type),null;case 22:case 23:return Il(t),Uf(),e!==null&&Q(xi),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return zn(_n),null;case 25:return null;default:return null}}function Tm(e,t){switch(sr(t),t.tag){case 3:zn(_n),lt();break;case 26:case 27:case 5:Je(t);break;case 4:lt();break;case 31:t.memoizedState!==null&&Il(t);break;case 13:Il(t);break;case 19:Q(on);break;case 10:zn(t.type);break;case 22:case 23:Il(t),Uf(),e!==null&&Q(xi);break;case 24:zn(_n)}}function Ac(e,t){try{var n=t.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var u=a.next;n=u;do{if((n.tag&e)===e){a=void 0;var f=n.create,b=n.inst;a=f(),b.destroy=a}n=n.next}while(n!==u)}}catch(S){kt(t,t.return,S)}}function Ma(e,t,n){try{var a=t.updateQueue,u=a!==null?a.lastEffect:null;if(u!==null){var f=u.next;a=f;do{if((a.tag&e)===e){var b=a.inst,S=b.destroy;if(S!==void 0){b.destroy=void 0,u=t;var C=n,X=S;try{X()}catch(ne){kt(u,C,ne)}}}a=a.next}while(a!==f)}}catch(ne){kt(t,t.return,ne)}}function Em(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{xp(t,n)}catch(a){kt(e,e.return,a)}}}function Am(e,t,n){n.props=ji(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(a){kt(e,t,a)}}function Cc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof n=="function"?e.refCleanup=n(a):n.current=a}}catch(u){kt(e,t,u)}}function Es(e,t){var n=e.ref,a=e.refCleanup;if(n!==null)if(typeof a=="function")try{a()}catch(u){kt(e,t,u)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(u){kt(e,t,u)}else n.current=null}function Cm(e){var t=e.type,n=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&a.focus();break e;case"img":n.src?a.src=n.src:n.srcSet&&(a.srcset=n.srcSet)}}catch(u){kt(e,e.return,u)}}function md(e,t,n){try{var a=e.stateNode;b_(a,e.type,n,t),a[Ze]=t}catch(u){kt(e,e.return,u)}}function Rm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ba(e.type)||e.tag===4}function gd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Rm(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&&Ba(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 bd(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Dt));else if(a!==4&&(a===27&&Ba(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(bd(e,t,n),e=e.sibling;e!==null;)bd(e,t,n),e=e.sibling}function io(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(a!==4&&(a===27&&Ba(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(io(e,t,n),e=e.sibling;e!==null;)io(e,t,n),e=e.sibling}function Mm(e){var t=e.stateNode,n=e.memoizedProps;try{for(var a=e.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);tl(t,a,n),t[Ht]=e,t[Ze]=n}catch(f){kt(e,e.return,f)}}var ta=!1,jn=!1,xd=!1,Om=typeof WeakSet=="function"?WeakSet:Set,Xn=null;function Fy(e,t){if(e=e.containerInfo,Bd=Eo,e=Au(e),lc(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var a=n.getSelection&&n.getSelection();if(a&&a.rangeCount!==0){n=a.anchorNode;var u=a.anchorOffset,f=a.focusNode;a=a.focusOffset;try{n.nodeType,f.nodeType}catch{n=null;break e}var b=0,S=-1,C=-1,X=0,ne=0,ce=e,$=null;t:for(;;){for(var P;ce!==n||u!==0&&ce.nodeType!==3||(S=b+u),ce!==f||a!==0&&ce.nodeType!==3||(C=b+a),ce.nodeType===3&&(b+=ce.nodeValue.length),(P=ce.firstChild)!==null;)$=ce,ce=P;for(;;){if(ce===e)break t;if($===n&&++X===u&&(S=b),$===f&&++ne===a&&(C=b),(P=ce.nextSibling)!==null)break;ce=$,$=ce.parentNode}ce=P}n=S===-1||C===-1?null:{start:S,end:C}}else n=null}n=n||{start:0,end:0}}else n=null;for(Id={focusedElem:e,selectionRange:n},Eo=!1,Xn=t;Xn!==null;)if(t=Xn,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Xn=e;else for(;Xn!==null;){switch(t=Xn,f=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)u=e[n],u.ref.impl=u.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&f!==null){e=void 0,n=t,u=f.memoizedProps,f=f.memoizedState,a=n.stateNode;try{var Ae=ji(n.type,u);e=a.getSnapshotBeforeUpdate(Ae,f),a.__reactInternalSnapshotBeforeUpdate=e}catch(He){kt(n,n.return,He)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Yd(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Yd(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,Xn=e;break}Xn=t.return}}function Dm(e,t,n){var a=n.flags;switch(n.tag){case 0:case 11:case 15:la(e,n),a&4&&Ac(5,n);break;case 1:if(la(e,n),a&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(b){kt(n,n.return,b)}else{var u=ji(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(b){kt(n,n.return,b)}}a&64&&Em(n),a&512&&Cc(n,n.return);break;case 3:if(la(e,n),a&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{xp(e,t)}catch(b){kt(n,n.return,b)}}break;case 27:t===null&&a&4&&Mm(n);case 26:case 5:la(e,n),t===null&&a&4&&Cm(n),a&512&&Cc(n,n.return);break;case 12:la(e,n);break;case 31:la(e,n),a&4&&Um(e,n);break;case 13:la(e,n),a&4&&Hm(e,n),a&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=a_.bind(null,n),w_(e,n))));break;case 22:if(a=n.memoizedState!==null||ta,!a){t=t!==null&&t.memoizedState!==null||jn,u=ta;var f=jn;ta=a,(jn=t)&&!f?sa(e,n,(n.subtreeFlags&8772)!==0):la(e,n),ta=u,jn=f}break;case 30:break;default:la(e,n)}}function Lm(e){var t=e.alternate;t!==null&&(e.alternate=null,Lm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ys(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 Zt=null,El=!1;function na(e,t,n){for(n=n.child;n!==null;)zm(e,t,n),n=n.sibling}function zm(e,t,n){if(bt&&typeof bt.onCommitFiberUnmount=="function")try{bt.onCommitFiberUnmount(zt,n)}catch{}switch(n.tag){case 26:jn||Es(n,t),na(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:jn||Es(n,t);var a=Zt,u=El;Ba(n.type)&&(Zt=n.stateNode,El=!1),na(e,t,n),Bc(n.stateNode),Zt=a,El=u;break;case 5:jn||Es(n,t);case 6:if(a=Zt,u=El,Zt=null,na(e,t,n),Zt=a,El=u,Zt!==null)if(El)try{(Zt.nodeType===9?Zt.body:Zt.nodeName==="HTML"?Zt.ownerDocument.body:Zt).removeChild(n.stateNode)}catch(f){kt(n,t,f)}else try{Zt.removeChild(n.stateNode)}catch(f){kt(n,t,f)}break;case 18:Zt!==null&&(El?(e=Zt,Eg(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),wr(e)):Eg(Zt,n.stateNode));break;case 4:a=Zt,u=El,Zt=n.stateNode.containerInfo,El=!0,na(e,t,n),Zt=a,El=u;break;case 0:case 11:case 14:case 15:Ma(2,n,t),jn||Ma(4,n,t),na(e,t,n);break;case 1:jn||(Es(n,t),a=n.stateNode,typeof a.componentWillUnmount=="function"&&Am(n,t,a)),na(e,t,n);break;case 21:na(e,t,n);break;case 22:jn=(a=jn)||n.memoizedState!==null,na(e,t,n),jn=a;break;default:na(e,t,n)}}function Um(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{wr(e)}catch(n){kt(t,t.return,n)}}}function Hm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{wr(e)}catch(n){kt(t,t.return,n)}}function Jy(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Om),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Om),t;default:throw Error(c(435,e.tag))}}function ro(e,t){var n=Jy(e);t.forEach(function(a){if(!n.has(a)){n.add(a);var u=i_.bind(null,e,a);a.then(u,u)}})}function Al(e,t){var n=t.deletions;if(n!==null)for(var a=0;a<n.length;a++){var u=n[a],f=e,b=t,S=b;e:for(;S!==null;){switch(S.tag){case 27:if(Ba(S.type)){Zt=S.stateNode,El=!1;break e}break;case 5:Zt=S.stateNode,El=!1;break e;case 3:case 4:Zt=S.stateNode.containerInfo,El=!0;break e}S=S.return}if(Zt===null)throw Error(c(160));zm(f,b,u),Zt=null,El=!1,f=u.alternate,f!==null&&(f.return=null),u.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Bm(t,e),t=t.sibling}var hs=null;function Bm(e,t){var n=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Al(t,e),Cl(e),a&4&&(Ma(3,e,e.return),Ac(3,e),Ma(5,e,e.return));break;case 1:Al(t,e),Cl(e),a&512&&(jn||n===null||Es(n,n.return)),a&64&&ta&&(e=e.updateQueue,e!==null&&(a=e.callbacks,a!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?a:n.concat(a))));break;case 26:var u=hs;if(Al(t,e),Cl(e),a&512&&(jn||n===null||Es(n,n.return)),a&4){var f=n!==null?n.memoizedState:null;if(a=e.memoizedState,n===null)if(a===null)if(e.stateNode===null){e:{a=e.type,n=e.memoizedProps,u=u.ownerDocument||u;t:switch(a){case"title":f=u.getElementsByTagName("title")[0],(!f||f[vl]||f[Ht]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=u.createElement(a),u.head.insertBefore(f,u.querySelector("head > title"))),tl(f,a,n),f[Ht]=e,Tt(f),a=f;break e;case"link":var b=Bg("link","href",u).get(a+(n.href||""));if(b){for(var S=0;S<b.length;S++)if(f=b[S],f.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&f.getAttribute("rel")===(n.rel==null?null:n.rel)&&f.getAttribute("title")===(n.title==null?null:n.title)&&f.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){b.splice(S,1);break t}}f=u.createElement(a),tl(f,a,n),u.head.appendChild(f);break;case"meta":if(b=Bg("meta","content",u).get(a+(n.content||""))){for(S=0;S<b.length;S++)if(f=b[S],f.getAttribute("content")===(n.content==null?null:""+n.content)&&f.getAttribute("name")===(n.name==null?null:n.name)&&f.getAttribute("property")===(n.property==null?null:n.property)&&f.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&f.getAttribute("charset")===(n.charSet==null?null:n.charSet)){b.splice(S,1);break t}}f=u.createElement(a),tl(f,a,n),u.head.appendChild(f);break;default:throw Error(c(468,a))}f[Ht]=e,Tt(f),a=f}e.stateNode=a}else Ig(u,e.type,e.stateNode);else e.stateNode=Hg(u,a,e.memoizedProps);else f!==a?(f===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):f.count--,a===null?Ig(u,e.type,e.stateNode):Hg(u,a,e.memoizedProps)):a===null&&e.stateNode!==null&&md(e,e.memoizedProps,n.memoizedProps)}break;case 27:Al(t,e),Cl(e),a&512&&(jn||n===null||Es(n,n.return)),n!==null&&a&4&&md(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Al(t,e),Cl(e),a&512&&(jn||n===null||Es(n,n.return)),e.flags&32){u=e.stateNode;try{I(u,"")}catch(Ae){kt(e,e.return,Ae)}}a&4&&e.stateNode!=null&&(u=e.memoizedProps,md(e,u,n!==null?n.memoizedProps:u)),a&1024&&(xd=!0);break;case 6:if(Al(t,e),Cl(e),a&4){if(e.stateNode===null)throw Error(c(162));a=e.memoizedProps,n=e.stateNode;try{n.nodeValue=a}catch(Ae){kt(e,e.return,Ae)}}break;case 3:if(ko=null,u=hs,hs=So(t.containerInfo),Al(t,e),hs=u,Cl(e),a&4&&n!==null&&n.memoizedState.isDehydrated)try{wr(t.containerInfo)}catch(Ae){kt(e,e.return,Ae)}xd&&(xd=!1,Im(e));break;case 4:a=hs,hs=So(e.stateNode.containerInfo),Al(t,e),Cl(e),hs=a;break;case 12:Al(t,e),Cl(e);break;case 31:Al(t,e),Cl(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,ro(e,a)));break;case 13:Al(t,e),Cl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(uo=Qe()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,ro(e,a)));break;case 22:u=e.memoizedState!==null;var C=n!==null&&n.memoizedState!==null,X=ta,ne=jn;if(ta=X||u,jn=ne||C,Al(t,e),jn=ne,ta=X,Cl(e),a&8192)e:for(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,u&&(n===null||C||ta||jn||ki(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){C=n=t;try{if(f=C.stateNode,u)b=f.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{S=C.stateNode;var ce=C.memoizedProps.style,$=ce!=null&&ce.hasOwnProperty("display")?ce.display:null;S.style.display=$==null||typeof $=="boolean"?"":(""+$).trim()}}catch(Ae){kt(C,C.return,Ae)}}}else if(t.tag===6){if(n===null){C=t;try{C.stateNode.nodeValue=u?"":C.memoizedProps}catch(Ae){kt(C,C.return,Ae)}}}else if(t.tag===18){if(n===null){C=t;try{var P=C.stateNode;u?Ag(P,!0):Ag(C.stateNode,!1)}catch(Ae){kt(C,C.return,Ae)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}a&4&&(a=e.updateQueue,a!==null&&(n=a.retryQueue,n!==null&&(a.retryQueue=null,ro(e,n))));break;case 19:Al(t,e),Cl(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,ro(e,a)));break;case 30:break;case 21:break;default:Al(t,e),Cl(e)}}function Cl(e){var t=e.flags;if(t&2){try{for(var n,a=e.return;a!==null;){if(Rm(a)){n=a;break}a=a.return}if(n==null)throw Error(c(160));switch(n.tag){case 27:var u=n.stateNode,f=gd(e);io(e,f,u);break;case 5:var b=n.stateNode;n.flags&32&&(I(b,""),n.flags&=-33);var S=gd(e);io(e,S,b);break;case 3:case 4:var C=n.stateNode.containerInfo,X=gd(e);bd(e,X,C);break;default:throw Error(c(161))}}catch(ne){kt(e,e.return,ne)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Im(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Im(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function la(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Dm(e,t.alternate,t),t=t.sibling}function ki(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ma(4,t,t.return),ki(t);break;case 1:Es(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Am(t,t.return,n),ki(t);break;case 27:Bc(t.stateNode);case 26:case 5:Es(t,t.return),ki(t);break;case 22:t.memoizedState===null&&ki(t);break;case 30:ki(t);break;default:ki(t)}e=e.sibling}}function sa(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,u=e,f=t,b=f.flags;switch(f.tag){case 0:case 11:case 15:sa(u,f,n),Ac(4,f);break;case 1:if(sa(u,f,n),a=f,u=a.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(X){kt(a,a.return,X)}if(a=f,u=a.updateQueue,u!==null){var S=a.stateNode;try{var C=u.shared.hiddenCallbacks;if(C!==null)for(u.shared.hiddenCallbacks=null,u=0;u<C.length;u++)bp(C[u],S)}catch(X){kt(a,a.return,X)}}n&&b&64&&Em(f),Cc(f,f.return);break;case 27:Mm(f);case 26:case 5:sa(u,f,n),n&&a===null&&b&4&&Cm(f),Cc(f,f.return);break;case 12:sa(u,f,n);break;case 31:sa(u,f,n),n&&b&4&&Um(u,f);break;case 13:sa(u,f,n),n&&b&4&&Hm(u,f);break;case 22:f.memoizedState===null&&sa(u,f,n),Cc(f,f.return);break;case 30:break;default:sa(u,f,n)}t=t.sibling}}function yd(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&gc(n))}function _d(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&gc(e))}function ps(e,t,n,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)qm(e,t,n,a),t=t.sibling}function qm(e,t,n,a){var u=t.flags;switch(t.tag){case 0:case 11:case 15:ps(e,t,n,a),u&2048&&Ac(9,t);break;case 1:ps(e,t,n,a);break;case 3:ps(e,t,n,a),u&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&gc(e)));break;case 12:if(u&2048){ps(e,t,n,a),e=t.stateNode;try{var f=t.memoizedProps,b=f.id,S=f.onPostCommit;typeof S=="function"&&S(b,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(C){kt(t,t.return,C)}}else ps(e,t,n,a);break;case 31:ps(e,t,n,a);break;case 13:ps(e,t,n,a);break;case 23:break;case 22:f=t.stateNode,b=t.alternate,t.memoizedState!==null?f._visibility&2?ps(e,t,n,a):Rc(e,t):f._visibility&2?ps(e,t,n,a):(f._visibility|=2,pr(e,t,n,a,(t.subtreeFlags&10256)!==0||!1)),u&2048&&yd(b,t);break;case 24:ps(e,t,n,a),u&2048&&_d(t.alternate,t);break;default:ps(e,t,n,a)}}function pr(e,t,n,a,u){for(u=u&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var f=e,b=t,S=n,C=a,X=b.flags;switch(b.tag){case 0:case 11:case 15:pr(f,b,S,C,u),Ac(8,b);break;case 23:break;case 22:var ne=b.stateNode;b.memoizedState!==null?ne._visibility&2?pr(f,b,S,C,u):Rc(f,b):(ne._visibility|=2,pr(f,b,S,C,u)),u&&X&2048&&yd(b.alternate,b);break;case 24:pr(f,b,S,C,u),u&&X&2048&&_d(b.alternate,b);break;default:pr(f,b,S,C,u)}t=t.sibling}}function Rc(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,a=t,u=a.flags;switch(a.tag){case 22:Rc(n,a),u&2048&&yd(a.alternate,a);break;case 24:Rc(n,a),u&2048&&_d(a.alternate,a);break;default:Rc(n,a)}t=t.sibling}}var Mc=8192;function mr(e,t,n){if(e.subtreeFlags&Mc)for(e=e.child;e!==null;)Gm(e,t,n),e=e.sibling}function Gm(e,t,n){switch(e.tag){case 26:mr(e,t,n),e.flags&Mc&&e.memoizedState!==null&&U_(n,hs,e.memoizedState,e.memoizedProps);break;case 5:mr(e,t,n);break;case 3:case 4:var a=hs;hs=So(e.stateNode.containerInfo),mr(e,t,n),hs=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=Mc,Mc=16777216,mr(e,t,n),Mc=a):mr(e,t,n));break;default:mr(e,t,n)}}function Ym(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 Oc(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];Xn=a,Vm(a,e)}Ym(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Xm(e),e=e.sibling}function Xm(e){switch(e.tag){case 0:case 11:case 15:Oc(e),e.flags&2048&&Ma(9,e,e.return);break;case 3:Oc(e);break;case 12:Oc(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,co(e)):Oc(e);break;default:Oc(e)}}function co(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];Xn=a,Vm(a,e)}Ym(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ma(8,t,t.return),co(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,co(t));break;default:co(t)}e=e.sibling}}function Vm(e,t){for(;Xn!==null;){var n=Xn;switch(n.tag){case 0:case 11:case 15:Ma(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var a=n.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:gc(n.memoizedState.cache)}if(a=n.child,a!==null)a.return=n,Xn=a;else e:for(n=e;Xn!==null;){a=Xn;var u=a.sibling,f=a.return;if(Lm(a),a===n){Xn=null;break e}if(u!==null){u.return=f,Xn=u;break e}Xn=f}}}var Wy={getCacheForType:function(e){var t=Pn(_n),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Pn(_n).controller.signal}},Py=typeof WeakMap=="function"?WeakMap:Map,yt=0,Lt=null,tt=null,at=0,jt=0,ql=null,Oa=!1,gr=!1,vd=!1,aa=0,an=0,Da=0,wi=0,Sd=0,Gl=0,br=0,Dc=null,Rl=null,jd=!1,uo=0,$m=0,oo=1/0,fo=null,La=null,Un=0,za=null,xr=null,ia=0,kd=0,wd=null,Qm=null,Lc=0,Nd=null;function Yl(){return(yt&2)!==0&&at!==0?at&-at:B.T!==null?Md():nn()}function Zm(){if(Gl===0)if((at&536870912)===0||et){var e=L;L<<=1,(L&3932160)===0&&(L=262144),Gl=e}else Gl=536870912;return e=Bl.current,e!==null&&(e.flags|=32),Gl}function Ml(e,t,n){(e===Lt&&(jt===2||jt===9)||e.cancelPendingCommit!==null)&&(yr(e,0),Ua(e,at,Gl,!1)),In(e,n),((yt&2)===0||e!==Lt)&&(e===Lt&&((yt&2)===0&&(wi|=n),an===4&&Ua(e,at,Gl,!1)),As(e))}function Km(e,t,n){if((yt&6)!==0)throw Error(c(327));var a=!n&&(t&127)===0&&(t&e.expiredLanes)===0||st(e,t),u=a?n_(e,t):Ed(e,t,!0),f=a;do{if(u===0){gr&&!a&&Ua(e,t,0,!1);break}else{if(n=e.current.alternate,f&&!e_(n)){u=Ed(e,t,!1),f=!1;continue}if(u===2){if(f=t,e.errorRecoveryDisabledLanes&f)var b=0;else b=e.pendingLanes&-536870913,b=b!==0?b:b&536870912?536870912:0;if(b!==0){t=b;e:{var S=e;u=Dc;var C=S.current.memoizedState.isDehydrated;if(C&&(yr(S,b).flags|=256),b=Ed(S,b,!1),b!==2){if(vd&&!C){S.errorRecoveryDisabledLanes|=f,wi|=f,u=4;break e}f=Rl,Rl=u,f!==null&&(Rl===null?Rl=f:Rl.push.apply(Rl,f))}u=b}if(f=!1,u!==2)continue}}if(u===1){yr(e,0),Ua(e,t,0,!0);break}e:{switch(a=e,f=u,f){case 0:case 1:throw Error(c(345));case 4:if((t&4194048)!==t)break;case 6:Ua(a,t,Gl,!Oa);break e;case 2:Rl=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(u=uo+300-Qe(),10<u)){if(Ua(a,t,Gl,!Oa),ze(a,0,!0)!==0)break e;ia=t,a.timeoutHandle=Ng(Fm.bind(null,a,n,Rl,fo,jd,t,Gl,wi,br,Oa,f,"Throttled",-0,0),u);break e}Fm(a,n,Rl,fo,jd,t,Gl,wi,br,Oa,f,null,-0,0)}}break}while(!0);As(e)}function Fm(e,t,n,a,u,f,b,S,C,X,ne,ce,$,P){if(e.timeoutHandle=-1,ce=t.subtreeFlags,ce&8192||(ce&16785408)===16785408){ce={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Dt},Gm(t,f,ce);var Ae=(f&62914560)===f?uo-Qe():(f&4194048)===f?$m-Qe():0;if(Ae=H_(ce,Ae),Ae!==null){ia=f,e.cancelPendingCommit=Ae(sg.bind(null,e,t,f,n,a,u,b,S,C,ne,ce,null,$,P)),Ua(e,f,b,!X);return}}sg(e,t,f,n,a,u,b,S,C)}function e_(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var a=0;a<n.length;a++){var u=n[a],f=u.getSnapshot;u=u.value;try{if(!Mn(f(),u))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ua(e,t,n,a){t&=~Sd,t&=~wi,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var u=t;0<u;){var f=31-$e(u),b=1<<f;a[f]=-1,u&=~b}n!==0&&da(e,n,t)}function ho(){return(yt&6)===0?(zc(0),!1):!0}function Td(){if(tt!==null){if(jt===0)var e=tt.return;else e=tt,ut=Ie=null,Yf(e),ur=null,xc=0,e=tt;for(;e!==null;)Tm(e.alternate,e),e=e.return;tt=null}}function yr(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,__(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),ia=0,Td(),Lt=e,tt=n=Pl(e.current,null),at=t,jt=0,ql=null,Oa=!1,gr=st(e,t),vd=!1,br=Gl=Sd=wi=Da=an=0,Rl=Dc=null,jd=!1,(t&8)!==0&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var u=31-$e(a),f=1<<u;t|=e[u],a&=~f}return aa=t,Pi(),n}function Jm(e,t){Ke=null,B.H=Nc,t===cr||t===qu?(t=hp(),jt=3):t===Rf?(t=hp(),jt=4):jt=t===ad?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,ql=t,tt===null&&(an=1,to(e,Jn(t,e.current)))}function Wm(){var e=Bl.current;return e===null?!0:(at&4194048)===at?ts===null:(at&62914560)===at||(at&536870912)!==0?e===ts:!1}function Pm(){var e=B.H;return B.H=Nc,e===null?Nc:e}function eg(){var e=B.A;return B.A=Wy,e}function po(){an=4,Oa||(at&4194048)!==at&&Bl.current!==null||(gr=!0),(Da&134217727)===0&&(wi&134217727)===0||Lt===null||Ua(Lt,at,Gl,!1)}function Ed(e,t,n){var a=yt;yt|=2;var u=Pm(),f=eg();(Lt!==e||at!==t)&&(fo=null,yr(e,t)),t=!1;var b=an;e:do try{if(jt!==0&&tt!==null){var S=tt,C=ql;switch(jt){case 8:Td(),b=6;break e;case 3:case 2:case 9:case 6:Bl.current===null&&(t=!0);var X=jt;if(jt=0,ql=null,_r(e,S,C,X),n&&gr){b=0;break e}break;default:X=jt,jt=0,ql=null,_r(e,S,C,X)}}t_(),b=an;break}catch(ne){Jm(e,ne)}while(!0);return t&&e.shellSuspendCounter++,ut=Ie=null,yt=a,B.H=u,B.A=f,tt===null&&(Lt=null,at=0,Pi()),b}function t_(){for(;tt!==null;)tg(tt)}function n_(e,t){var n=yt;yt|=2;var a=Pm(),u=eg();Lt!==e||at!==t?(fo=null,oo=Qe()+500,yr(e,t)):gr=st(e,t);e:do try{if(jt!==0&&tt!==null){t=tt;var f=ql;t:switch(jt){case 1:jt=0,ql=null,_r(e,t,f,1);break;case 2:case 9:if(fp(f)){jt=0,ql=null,ng(t);break}t=function(){jt!==2&&jt!==9||Lt!==e||(jt=7),As(e)},f.then(t,t);break e;case 3:jt=7;break e;case 4:jt=5;break e;case 7:fp(f)?(jt=0,ql=null,ng(t)):(jt=0,ql=null,_r(e,t,f,7));break;case 5:var b=null;switch(tt.tag){case 26:b=tt.memoizedState;case 5:case 27:var S=tt;if(b?qg(b):S.stateNode.complete){jt=0,ql=null;var C=S.sibling;if(C!==null)tt=C;else{var X=S.return;X!==null?(tt=X,mo(X)):tt=null}break t}}jt=0,ql=null,_r(e,t,f,5);break;case 6:jt=0,ql=null,_r(e,t,f,6);break;case 8:Td(),an=6;break e;default:throw Error(c(462))}}l_();break}catch(ne){Jm(e,ne)}while(!0);return ut=Ie=null,B.H=a,B.A=u,yt=n,tt!==null?0:(Lt=null,at=0,Pi(),an)}function l_(){for(;tt!==null&&!$t();)tg(tt)}function tg(e){var t=wm(e.alternate,e,aa);e.memoizedProps=e.pendingProps,t===null?mo(e):tt=t}function ng(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=ym(n,t,t.pendingProps,t.type,void 0,at);break;case 11:t=ym(n,t,t.pendingProps,t.type.render,t.ref,at);break;case 5:Yf(t);default:Tm(n,t),t=tt=pi(t,aa),t=wm(n,t,aa)}e.memoizedProps=e.pendingProps,t===null?mo(e):tt=t}function _r(e,t,n,a){ut=Ie=null,Yf(t),ur=null,xc=0;var u=t.return;try{if(Vy(e,u,t,n,at)){an=1,to(e,Jn(n,e.current)),tt=null;return}}catch(f){if(u!==null)throw tt=u,f;an=1,to(e,Jn(n,e.current)),tt=null;return}t.flags&32768?(et||a===1?e=!0:gr||(at&536870912)!==0?e=!1:(Oa=e=!0,(a===2||a===9||a===3||a===6)&&(a=Bl.current,a!==null&&a.tag===13&&(a.flags|=16384))),lg(t,e)):mo(t)}function mo(e){var t=e;do{if((t.flags&32768)!==0){lg(t,Oa);return}e=t.return;var n=Zy(t.alternate,t,aa);if(n!==null){tt=n;return}if(t=t.sibling,t!==null){tt=t;return}tt=t=e}while(t!==null);an===0&&(an=5)}function lg(e,t){do{var n=Ky(e.alternate,e);if(n!==null){n.flags&=32767,tt=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){tt=e;return}tt=e=n}while(e!==null);an=6,tt=null}function sg(e,t,n,a,u,f,b,S,C){e.cancelPendingCommit=null;do go();while(Un!==0);if((yt&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));if(f=t.lanes|t.childLanes,f|=fc,$l(e,n,f,b,S,C),e===Lt&&(tt=Lt=null,at=0),xr=t,za=e,ia=n,kd=f,wd=u,Qm=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,r_(Qt,function(){return ug(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=B.T,B.T=null,u=ue.p,ue.p=2,b=yt,yt|=4;try{Fy(e,t,n)}finally{yt=b,ue.p=u,B.T=a}}Un=1,ag(),ig(),rg()}}function ag(){if(Un===1){Un=0;var e=za,t=xr,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=B.T,B.T=null;var a=ue.p;ue.p=2;var u=yt;yt|=4;try{Bm(t,e);var f=Id,b=Au(e.containerInfo),S=f.focusedElem,C=f.selectionRange;if(b!==S&&S&&S.ownerDocument&&Eu(S.ownerDocument.documentElement,S)){if(C!==null&&lc(S)){var X=C.start,ne=C.end;if(ne===void 0&&(ne=X),"selectionStart"in S)S.selectionStart=X,S.selectionEnd=Math.min(ne,S.value.length);else{var ce=S.ownerDocument||document,$=ce&&ce.defaultView||window;if($.getSelection){var P=$.getSelection(),Ae=S.textContent.length,He=Math.min(C.start,Ae),Rt=C.end===void 0?He:Math.min(C.end,Ae);!P.extend&&He>Rt&&(b=Rt,Rt=He,He=b);var U=nc(S,He),R=nc(S,Rt);if(U&&R&&(P.rangeCount!==1||P.anchorNode!==U.node||P.anchorOffset!==U.offset||P.focusNode!==R.node||P.focusOffset!==R.offset)){var Y=ce.createRange();Y.setStart(U.node,U.offset),P.removeAllRanges(),He>Rt?(P.addRange(Y),P.extend(R.node,R.offset)):(Y.setEnd(R.node,R.offset),P.addRange(Y))}}}}for(ce=[],P=S;P=P.parentNode;)P.nodeType===1&&ce.push({element:P,left:P.scrollLeft,top:P.scrollTop});for(typeof S.focus=="function"&&S.focus(),S=0;S<ce.length;S++){var ie=ce[S];ie.element.scrollLeft=ie.left,ie.element.scrollTop=ie.top}}Eo=!!Bd,Id=Bd=null}finally{yt=u,ue.p=a,B.T=n}}e.current=t,Un=2}}function ig(){if(Un===2){Un=0;var e=za,t=xr,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=B.T,B.T=null;var a=ue.p;ue.p=2;var u=yt;yt|=4;try{Dm(e,t.alternate,t)}finally{yt=u,ue.p=a,B.T=n}}Un=3}}function rg(){if(Un===4||Un===3){Un=0,Nt();var e=za,t=xr,n=ia,a=Qm;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Un=5:(Un=0,xr=za=null,cg(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(La=null),pl(n),t=t.stateNode,bt&&typeof bt.onCommitFiberRoot=="function")try{bt.onCommitFiberRoot(zt,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=B.T,u=ue.p,ue.p=2,B.T=null;try{for(var f=e.onRecoverableError,b=0;b<a.length;b++){var S=a[b];f(S.value,{componentStack:S.stack})}}finally{B.T=t,ue.p=u}}(ia&3)!==0&&go(),As(e),u=e.pendingLanes,(n&261930)!==0&&(u&42)!==0?e===Nd?Lc++:(Lc=0,Nd=e):Lc=0,zc(0)}}function cg(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,gc(t)))}function go(){return ag(),ig(),rg(),ug()}function ug(){if(Un!==5)return!1;var e=za,t=kd;kd=0;var n=pl(ia),a=B.T,u=ue.p;try{ue.p=32>n?32:n,B.T=null,n=wd,wd=null;var f=za,b=ia;if(Un=0,xr=za=null,ia=0,(yt&6)!==0)throw Error(c(331));var S=yt;if(yt|=4,Xm(f.current),qm(f,f.current,b,n),yt=S,zc(0,!1),bt&&typeof bt.onPostCommitFiberRoot=="function")try{bt.onPostCommitFiberRoot(zt,f)}catch{}return!0}finally{ue.p=u,B.T=a,cg(e,t)}}function og(e,t,n){t=Jn(n,t),t=sd(e.stateNode,t,2),e=Aa(e,t,2),e!==null&&(In(e,2),As(e))}function kt(e,t,n){if(e.tag===3)og(e,e,n);else for(;t!==null;){if(t.tag===3){og(t,e,n);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(La===null||!La.has(a))){e=Jn(n,e),n=fm(2),a=Aa(t,n,2),a!==null&&(dm(n,a,t,e),In(a,2),As(a));break}}t=t.return}}function Ad(e,t,n){var a=e.pingCache;if(a===null){a=e.pingCache=new Py;var u=new Set;a.set(t,u)}else u=a.get(t),u===void 0&&(u=new Set,a.set(t,u));u.has(n)||(vd=!0,u.add(n),e=s_.bind(null,e,t,n),t.then(e,e))}function s_(e,t,n){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Lt===e&&(at&n)===n&&(an===4||an===3&&(at&62914560)===at&&300>Qe()-uo?(yt&2)===0&&yr(e,0):Sd|=n,br===at&&(br=0)),As(e)}function fg(e,t){t===0&&(t=Pe()),e=Zs(e,t),e!==null&&(In(e,t),As(e))}function a_(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),fg(e,n)}function i_(e,t){var n=0;switch(e.tag){case 31:case 13:var a=e.stateNode,u=e.memoizedState;u!==null&&(n=u.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(c(314))}a!==null&&a.delete(t),fg(e,n)}function r_(e,t){return Ft(e,t)}var bo=null,vr=null,Cd=!1,xo=!1,Rd=!1,Ha=0;function As(e){e!==vr&&e.next===null&&(vr===null?bo=vr=e:vr=vr.next=e),xo=!0,Cd||(Cd=!0,u_())}function zc(e,t){if(!Rd&&xo){Rd=!0;do for(var n=!1,a=bo;a!==null;){if(e!==0){var u=a.pendingLanes;if(u===0)var f=0;else{var b=a.suspendedLanes,S=a.pingedLanes;f=(1<<31-$e(42|e)+1)-1,f&=u&~(b&~S),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(n=!0,mg(a,f))}else f=at,f=ze(a,a===Lt?f:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(f&3)===0||st(a,f)||(n=!0,mg(a,f));a=a.next}while(n);Rd=!1}}function c_(){dg()}function dg(){xo=Cd=!1;var e=0;Ha!==0&&y_()&&(e=Ha);for(var t=Qe(),n=null,a=bo;a!==null;){var u=a.next,f=hg(a,t);f===0?(a.next=null,n===null?bo=u:n.next=u,u===null&&(vr=n)):(n=a,(e!==0||(f&3)!==0)&&(xo=!0)),a=u}Un!==0&&Un!==5||zc(e),Ha!==0&&(Ha=0)}function hg(e,t){for(var n=e.suspendedLanes,a=e.pingedLanes,u=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var b=31-$e(f),S=1<<b,C=u[b];C===-1?((S&n)===0||(S&a)!==0)&&(u[b]=al(S,t)):C<=t&&(e.expiredLanes|=S),f&=~S}if(t=Lt,n=at,n=ze(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,n===0||e===t&&(jt===2||jt===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&tn(a),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||st(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(a!==null&&tn(a),pl(n)){case 2:case 8:n=Jt;break;case 32:n=Qt;break;case 268435456:n=Tn;break;default:n=Qt}return a=pg.bind(null,e),n=Ft(n,a),e.callbackPriority=t,e.callbackNode=n,t}return a!==null&&a!==null&&tn(a),e.callbackPriority=2,e.callbackNode=null,2}function pg(e,t){if(Un!==0&&Un!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(go()&&e.callbackNode!==n)return null;var a=at;return a=ze(e,e===Lt?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(Km(e,a,t),hg(e,Qe()),e.callbackNode!=null&&e.callbackNode===n?pg.bind(null,e):null)}function mg(e,t){if(go())return null;Km(e,t,!0)}function u_(){v_(function(){(yt&6)!==0?Ft(dn,c_):dg()})}function Md(){if(Ha===0){var e=ir;e===0&&(e=we,we<<=1,(we&261888)===0&&(we=256)),Ha=e}return Ha}function gg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:gn(""+e)}function bg(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function o_(e,t,n,a,u){if(t==="submit"&&n&&n.stateNode===u){var f=gg((u[Ze]||null).action),b=a.submitter;b&&(t=(t=b[Ze]||null)?gg(t.formAction):b.getAttribute("formAction"),t!==null&&(f=t,b=null));var S=new si("action","action",null,a,u);e.push({event:S,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(Ha!==0){var C=b?bg(u,b):new FormData(u);Wf(n,{pending:!0,data:C,method:u.method,action:f},null,C)}}else typeof f=="function"&&(S.preventDefault(),C=b?bg(u,b):new FormData(u),Wf(n,{pending:!0,data:C,method:u.method,action:f},f,C))},currentTarget:u}]})}}for(var Od=0;Od<oc.length;Od++){var Dd=oc[Od],f_=Dd.toLowerCase(),d_=Dd[0].toUpperCase()+Dd.slice(1);Hl(f_,"on"+d_)}Hl(Ru,"onAnimationEnd"),Hl(Mu,"onAnimationIteration"),Hl(Ou,"onAnimationStart"),Hl("dblclick","onDoubleClick"),Hl("focusin","onFocus"),Hl("focusout","onBlur"),Hl(cc,"onTransitionRun"),Hl(uc,"onTransitionStart"),Hl(Ji,"onTransitionCancel"),Hl(Du,"onTransitionEnd"),T("onMouseEnter",["mouseout","mouseover"]),T("onMouseLeave",["mouseout","mouseover"]),T("onPointerEnter",["pointerout","pointerover"]),T("onPointerLeave",["pointerout","pointerover"]),cn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),cn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),cn("onBeforeInput",["compositionend","keypress","textInput","paste"]),cn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),cn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),cn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Uc="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(" "),h_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Uc));function xg(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var a=e[n],u=a.event;a=a.listeners;e:{var f=void 0;if(t)for(var b=a.length-1;0<=b;b--){var S=a[b],C=S.instance,X=S.currentTarget;if(S=S.listener,C!==f&&u.isPropagationStopped())break e;f=S,u.currentTarget=X;try{f(u)}catch(ne){Wi(ne)}u.currentTarget=null,f=C}else for(b=0;b<a.length;b++){if(S=a[b],C=S.instance,X=S.currentTarget,S=S.listener,C!==f&&u.isPropagationStopped())break e;f=S,u.currentTarget=X;try{f(u)}catch(ne){Wi(ne)}u.currentTarget=null,f=C}}}}function nt(e,t){var n=t[is];n===void 0&&(n=t[is]=new Set);var a=e+"__bubble";n.has(a)||(yg(t,e,2,!1),n.add(a))}function Ld(e,t,n){var a=0;t&&(a|=4),yg(n,e,a,t)}var yo="_reactListening"+Math.random().toString(36).slice(2);function zd(e){if(!e[yo]){e[yo]=!0,Yn.forEach(function(n){n!=="selectionchange"&&(h_.has(n)||Ld(n,!1,e),Ld(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[yo]||(t[yo]=!0,Ld("selectionchange",!1,t))}}function yg(e,t,n,a){switch(Zg(t)){case 2:var u=q_;break;case 8:u=G_;break;default:u=Jd}n=u.bind(null,t,n,e),u=void 0,!ma||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(u=!0),a?u!==void 0?e.addEventListener(t,n,{capture:!0,passive:u}):e.addEventListener(t,n,!0):u!==void 0?e.addEventListener(t,n,{passive:u}):e.addEventListener(t,n,!1)}function Ud(e,t,n,a,u){var f=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var b=a.tag;if(b===3||b===4){var S=a.stateNode.containerInfo;if(S===u)break;if(b===4)for(b=a.return;b!==null;){var C=b.tag;if((C===3||C===4)&&b.stateNode.containerInfo===u)return;b=b.return}for(;S!==null;){if(b=It(S),b===null)return;if(C=b.tag,C===5||C===6||C===26||C===27){a=f=b;continue e}S=S.parentNode}}a=a.return}ni(function(){var X=f,ne=Bt(n),ce=[];e:{var $=Lu.get(e);if($!==void 0){var P=si,Ae=e;switch(e){case"keypress":if(Yi(n)===0)break e;case"keydown":case"keyup":P=ii;break;case"focusin":Ae="focus",P=Vi;break;case"focusout":Ae="blur",P=Vi;break;case"beforeblur":case"afterblur":P=Vi;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":P=qt;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":P=df;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":P=gu;break;case Ru:case Mu:case Ou:P=Kn;break;case Du:P=pf;break;case"scroll":case"scrollend":P=os;break;case"wheel":P=xa;break;case"copy":case"cut":case"paste":P=du;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":P=ba;break;case"toggle":case"beforetoggle":P=mf}var He=(t&4)!==0,Rt=!He&&(e==="scroll"||e==="scrollend"),U=He?$!==null?$+"Capture":null:$;He=[];for(var R=X,Y;R!==null;){var ie=R;if(Y=ie.stateNode,ie=ie.tag,ie!==5&&ie!==26&&ie!==27||Y===null||U===null||(ie=li(R,U),ie!=null&&He.push(Hc(R,ie,Y))),Rt)break;R=R.return}0<He.length&&($=new P($,Ae,null,n,ne),ce.push({event:$,listeners:He}))}}if((t&7)===0){e:{if($=e==="mouseover"||e==="pointerover",P=e==="mouseout"||e==="pointerout",$&&n!==bn&&(Ae=n.relatedTarget||n.fromElement)&&(It(Ae)||Ae[ln]))break e;if((P||$)&&($=ne.window===ne?ne:($=ne.ownerDocument)?$.defaultView||$.parentWindow:window,P?(Ae=n.relatedTarget||n.toElement,P=X,Ae=Ae?It(Ae):null,Ae!==null&&(Rt=d(Ae),He=Ae.tag,Ae!==Rt||He!==5&&He!==27&&He!==6)&&(Ae=null)):(P=null,Ae=X),P!==Ae)){if(He=qt,ie="onMouseLeave",U="onMouseEnter",R="mouse",(e==="pointerout"||e==="pointerover")&&(He=ba,ie="onPointerLeave",U="onPointerEnter",R="pointer"),Rt=P==null?$:Zl(P),Y=Ae==null?$:Zl(Ae),$=new He(ie,R+"leave",P,n,ne),$.target=Rt,$.relatedTarget=Y,ie=null,It(ne)===X&&(He=new He(U,R+"enter",Ae,n,ne),He.target=Y,He.relatedTarget=Rt,ie=He),Rt=ie,P&&Ae)t:{for(He=p_,U=P,R=Ae,Y=0,ie=U;ie;ie=He(ie))Y++;ie=0;for(var Le=R;Le;Le=He(Le))ie++;for(;0<Y-ie;)U=He(U),Y--;for(;0<ie-Y;)R=He(R),ie--;for(;Y--;){if(U===R||R!==null&&U===R.alternate){He=U;break t}U=He(U),R=He(R)}He=null}else He=null;P!==null&&_g(ce,$,P,He,!1),Ae!==null&&Rt!==null&&_g(ce,Rt,Ae,He,!0)}}e:{if($=X?Zl(X):window,P=$.nodeName&&$.nodeName.toLowerCase(),P==="select"||P==="input"&&$.type==="file")var mt=ku;else if(Su($))if(wu)mt=jf;else{mt=vf;var Re=tc}else P=$.nodeName,!P||P.toLowerCase()!=="input"||$.type!=="checkbox"&&$.type!=="radio"?X&&Ue(X.elementType)&&(mt=ku):mt=Sf;if(mt&&(mt=mt(e,X))){ju(ce,mt,n,ne);break e}Re&&Re(e,$,X),e==="focusout"&&X&&$.type==="number"&&X.memoizedProps.value!=null&&Ss($,"number",$.value)}switch(Re=X?Zl(X):window,e){case"focusin":(Su(Re)||Re.contentEditable==="true")&&(va=Re,sc=X,hi=null);break;case"focusout":hi=sc=va=null;break;case"mousedown":ac=!0;break;case"contextmenu":case"mouseup":case"dragend":ac=!1,Cu(ce,n,ne);break;case"selectionchange":if(wf)break;case"keydown":case"keyup":Cu(ce,n,ne)}var Fe;if(Wr)e:{switch(e){case"compositionstart":var it="onCompositionStart";break e;case"compositionend":it="onCompositionEnd";break e;case"compositionupdate":it="onCompositionUpdate";break e}it=void 0}else Wl?_u(e,n)&&(it="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(it="onCompositionStart");it&&(bu&&n.locale!=="ko"&&(Wl||it!=="onCompositionStart"?it==="onCompositionEnd"&&Wl&&(Fe=Gi()):(wl=ne,us="value"in wl?wl.value:wl.textContent,Wl=!0)),Re=_o(X,it),0<Re.length&&(it=new Jl(it,e,null,n,ne),ce.push({event:it,listeners:Re}),Fe?it.data=Fe:(Fe=vu(n),Fe!==null&&(it.data=Fe)))),(Fe=ya?bf(e,n):xf(e,n))&&(it=_o(X,"onBeforeInput"),0<it.length&&(Re=new Jl("onBeforeInput","beforeinput",null,n,ne),ce.push({event:Re,listeners:it}),Re.data=Fe)),o_(ce,e,X,n,ne)}xg(ce,t)})}function Hc(e,t,n){return{instance:e,listener:t,currentTarget:n}}function _o(e,t){for(var n=t+"Capture",a=[];e!==null;){var u=e,f=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||f===null||(u=li(e,n),u!=null&&a.unshift(Hc(e,u,f)),u=li(e,t),u!=null&&a.push(Hc(e,u,f))),e.tag===3)return a;e=e.return}return[]}function p_(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function _g(e,t,n,a,u){for(var f=t._reactName,b=[];n!==null&&n!==a;){var S=n,C=S.alternate,X=S.stateNode;if(S=S.tag,C!==null&&C===a)break;S!==5&&S!==26&&S!==27||X===null||(C=X,u?(X=li(n,f),X!=null&&b.unshift(Hc(n,X,C))):u||(X=li(n,f),X!=null&&b.push(Hc(n,X,C)))),n=n.return}b.length!==0&&e.push({event:t,listeners:b})}var m_=/\r\n?/g,g_=/\u0000|\uFFFD/g;function vg(e){return(typeof e=="string"?e:""+e).replace(m_,`
|
|
50
|
+
`).replace(g_,"")}function Sg(e,t){return t=vg(t),vg(e)===t}function Ct(e,t,n,a,u,f){switch(n){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||I(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&I(e,""+a);break;case"className":il(e,"class",a);break;case"tabIndex":il(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":il(e,n,a);break;case"style":Oe(e,a,f);break;case"data":if(t!=="object"){il(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=gn(""+a),e.setAttribute(n,a);break;case"action":case"formAction":if(typeof a=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof f=="function"&&(n==="formAction"?(t!=="input"&&Ct(e,t,"name",u.name,u,null),Ct(e,t,"formEncType",u.formEncType,u,null),Ct(e,t,"formMethod",u.formMethod,u,null),Ct(e,t,"formTarget",u.formTarget,u,null)):(Ct(e,t,"encType",u.encType,u,null),Ct(e,t,"method",u.method,u,null),Ct(e,t,"target",u.target,u,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=gn(""+a),e.setAttribute(n,a);break;case"onClick":a!=null&&(e.onclick=Dt);break;case"onScroll":a!=null&&nt("scroll",e);break;case"onScrollEnd":a!=null&&nt("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(c(61));if(n=a.__html,n!=null){if(u.children!=null)throw Error(c(60));e.innerHTML=n}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}n=gn(""+a),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,""+a):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":a===!0?e.setAttribute(n,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,a):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(n,a):e.removeAttribute(n);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(n):e.setAttribute(n,a);break;case"popover":nt("beforetoggle",e),nt("toggle",e),ml(e,"popover",a);break;case"xlinkActuate":mn(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":mn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":mn(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":mn(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":mn(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":mn(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":mn(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":mn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":mn(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":ml(e,"is",a);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=Et.get(n)||n,ml(e,n,a))}}function Hd(e,t,n,a,u,f){switch(n){case"style":Oe(e,a,f);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(c(61));if(n=a.__html,n!=null){if(u.children!=null)throw Error(c(60));e.innerHTML=n}}break;case"children":typeof a=="string"?I(e,a):(typeof a=="number"||typeof a=="bigint")&&I(e,""+a);break;case"onScroll":a!=null&&nt("scroll",e);break;case"onScrollEnd":a!=null&&nt("scrollend",e);break;case"onClick":a!=null&&(e.onclick=Dt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Gs.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(u=n.endsWith("Capture"),t=n.slice(2,u?n.length-7:void 0),f=e[Ze]||null,f=f!=null?f[n]:null,typeof f=="function"&&e.removeEventListener(t,f,u),typeof a=="function")){typeof f!="function"&&f!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,a,u);break e}n in e?e[n]=a:a===!0?e.setAttribute(n,""):ml(e,n,a)}}}function tl(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":nt("error",e),nt("load",e);var a=!1,u=!1,f;for(f in n)if(n.hasOwnProperty(f)){var b=n[f];if(b!=null)switch(f){case"src":a=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Ct(e,t,f,b,n,null)}}u&&Ct(e,t,"srcSet",n.srcSet,n,null),a&&Ct(e,t,"src",n.src,n,null);return;case"input":nt("invalid",e);var S=f=b=u=null,C=null,X=null;for(a in n)if(n.hasOwnProperty(a)){var ne=n[a];if(ne!=null)switch(a){case"name":u=ne;break;case"type":b=ne;break;case"checked":C=ne;break;case"defaultChecked":X=ne;break;case"value":f=ne;break;case"defaultValue":S=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(c(137,t));break;default:Ct(e,t,a,ne,n,null)}}vs(e,f,S,C,X,b,u,!1);return;case"select":nt("invalid",e),a=b=f=null;for(u in n)if(n.hasOwnProperty(u)&&(S=n[u],S!=null))switch(u){case"value":f=S;break;case"defaultValue":b=S;break;case"multiple":a=S;default:Ct(e,t,u,S,n,null)}t=f,n=b,e.multiple=!!a,t!=null?jl(e,!!a,t,!1):n!=null&&jl(e,!!a,n,!0);return;case"textarea":nt("invalid",e),f=u=a=null;for(b in n)if(n.hasOwnProperty(b)&&(S=n[b],S!=null))switch(b){case"value":a=S;break;case"defaultValue":u=S;break;case"children":f=S;break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(c(91));break;default:Ct(e,t,b,S,n,null)}N(e,a,u,f);return;case"option":for(C in n)if(n.hasOwnProperty(C)&&(a=n[C],a!=null))switch(C){case"selected":e.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:Ct(e,t,C,a,n,null)}return;case"dialog":nt("beforetoggle",e),nt("toggle",e),nt("cancel",e),nt("close",e);break;case"iframe":case"object":nt("load",e);break;case"video":case"audio":for(a=0;a<Uc.length;a++)nt(Uc[a],e);break;case"image":nt("error",e),nt("load",e);break;case"details":nt("toggle",e);break;case"embed":case"source":case"link":nt("error",e),nt("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(X in n)if(n.hasOwnProperty(X)&&(a=n[X],a!=null))switch(X){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Ct(e,t,X,a,n,null)}return;default:if(Ue(t)){for(ne in n)n.hasOwnProperty(ne)&&(a=n[ne],a!==void 0&&Hd(e,t,ne,a,n,void 0));return}}for(S in n)n.hasOwnProperty(S)&&(a=n[S],a!=null&&Ct(e,t,S,a,n,null))}function b_(e,t,n,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,f=null,b=null,S=null,C=null,X=null,ne=null;for(P in n){var ce=n[P];if(n.hasOwnProperty(P)&&ce!=null)switch(P){case"checked":break;case"value":break;case"defaultValue":C=ce;default:a.hasOwnProperty(P)||Ct(e,t,P,null,a,ce)}}for(var $ in a){var P=a[$];if(ce=n[$],a.hasOwnProperty($)&&(P!=null||ce!=null))switch($){case"type":f=P;break;case"name":u=P;break;case"checked":X=P;break;case"defaultChecked":ne=P;break;case"value":b=P;break;case"defaultValue":S=P;break;case"children":case"dangerouslySetInnerHTML":if(P!=null)throw Error(c(137,t));break;default:P!==ce&&Ct(e,t,$,P,a,ce)}}rs(e,b,S,C,X,ne,f,u);return;case"select":P=b=S=$=null;for(f in n)if(C=n[f],n.hasOwnProperty(f)&&C!=null)switch(f){case"value":break;case"multiple":P=C;default:a.hasOwnProperty(f)||Ct(e,t,f,null,a,C)}for(u in a)if(f=a[u],C=n[u],a.hasOwnProperty(u)&&(f!=null||C!=null))switch(u){case"value":$=f;break;case"defaultValue":S=f;break;case"multiple":b=f;default:f!==C&&Ct(e,t,u,f,a,C)}t=S,n=b,a=P,$!=null?jl(e,!!n,$,!1):!!a!=!!n&&(t!=null?jl(e,!!n,t,!0):jl(e,!!n,n?[]:"",!1));return;case"textarea":P=$=null;for(S in n)if(u=n[S],n.hasOwnProperty(S)&&u!=null&&!a.hasOwnProperty(S))switch(S){case"value":break;case"children":break;default:Ct(e,t,S,null,a,u)}for(b in a)if(u=a[b],f=n[b],a.hasOwnProperty(b)&&(u!=null||f!=null))switch(b){case"value":$=u;break;case"defaultValue":P=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(c(91));break;default:u!==f&&Ct(e,t,b,u,a,f)}me(e,$,P);return;case"option":for(var Ae in n)if($=n[Ae],n.hasOwnProperty(Ae)&&$!=null&&!a.hasOwnProperty(Ae))switch(Ae){case"selected":e.selected=!1;break;default:Ct(e,t,Ae,null,a,$)}for(C in a)if($=a[C],P=n[C],a.hasOwnProperty(C)&&$!==P&&($!=null||P!=null))switch(C){case"selected":e.selected=$&&typeof $!="function"&&typeof $!="symbol";break;default:Ct(e,t,C,$,a,P)}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 He in n)$=n[He],n.hasOwnProperty(He)&&$!=null&&!a.hasOwnProperty(He)&&Ct(e,t,He,null,a,$);for(X in a)if($=a[X],P=n[X],a.hasOwnProperty(X)&&$!==P&&($!=null||P!=null))switch(X){case"children":case"dangerouslySetInnerHTML":if($!=null)throw Error(c(137,t));break;default:Ct(e,t,X,$,a,P)}return;default:if(Ue(t)){for(var Rt in n)$=n[Rt],n.hasOwnProperty(Rt)&&$!==void 0&&!a.hasOwnProperty(Rt)&&Hd(e,t,Rt,void 0,a,$);for(ne in a)$=a[ne],P=n[ne],!a.hasOwnProperty(ne)||$===P||$===void 0&&P===void 0||Hd(e,t,ne,$,a,P);return}}for(var U in n)$=n[U],n.hasOwnProperty(U)&&$!=null&&!a.hasOwnProperty(U)&&Ct(e,t,U,null,a,$);for(ce in a)$=a[ce],P=n[ce],!a.hasOwnProperty(ce)||$===P||$==null&&P==null||Ct(e,t,ce,$,a,P)}function jg(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function x_(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),a=0;a<n.length;a++){var u=n[a],f=u.transferSize,b=u.initiatorType,S=u.duration;if(f&&S&&jg(b)){for(b=0,S=u.responseEnd,a+=1;a<n.length;a++){var C=n[a],X=C.startTime;if(X>S)break;var ne=C.transferSize,ce=C.initiatorType;ne&&jg(ce)&&(C=C.responseEnd,b+=ne*(C<S?1:(S-X)/(C-X)))}if(--a,t+=8*(f+b)/(u.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Bd=null,Id=null;function vo(e){return e.nodeType===9?e:e.ownerDocument}function kg(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 wg(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 qd(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 Gd=null;function y_(){var e=window.event;return e&&e.type==="popstate"?e===Gd?!1:(Gd=e,!0):(Gd=null,!1)}var Ng=typeof setTimeout=="function"?setTimeout:void 0,__=typeof clearTimeout=="function"?clearTimeout:void 0,Tg=typeof Promise=="function"?Promise:void 0,v_=typeof queueMicrotask=="function"?queueMicrotask:typeof Tg<"u"?function(e){return Tg.resolve(null).then(e).catch(S_)}:Ng;function S_(e){setTimeout(function(){throw e})}function Ba(e){return e==="head"}function Eg(e,t){var n=t,a=0;do{var u=n.nextSibling;if(e.removeChild(n),u&&u.nodeType===8)if(n=u.data,n==="/$"||n==="/&"){if(a===0){e.removeChild(u),wr(t);return}a--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")a++;else if(n==="html")Bc(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Bc(n);for(var f=n.firstChild;f;){var b=f.nextSibling,S=f.nodeName;f[vl]||S==="SCRIPT"||S==="STYLE"||S==="LINK"&&f.rel.toLowerCase()==="stylesheet"||n.removeChild(f),f=b}}else n==="body"&&Bc(e.ownerDocument.body);n=u}while(n);wr(t)}function Ag(e,t){var n=e;e=0;do{var a=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=a}while(n)}function Yd(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Yd(n),ys(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function j_(e,t,n,a){for(;e.nodeType===1;){var u=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[vl])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=ns(e.nextSibling),e===null)break}return null}function k_(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=ns(e.nextSibling),e===null))return null;return e}function Cg(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=ns(e.nextSibling),e===null))return null;return e}function Xd(e){return e.data==="$?"||e.data==="$~"}function Vd(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function w_(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var a=function(){t(),n.removeEventListener("DOMContentLoaded",a)};n.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function ns(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 $d=null;function Rg(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return ns(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function Mg(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function Og(e,t,n){switch(t=vo(n),e){case"html":if(e=t.documentElement,!e)throw Error(c(452));return e;case"head":if(e=t.head,!e)throw Error(c(453));return e;case"body":if(e=t.body,!e)throw Error(c(454));return e;default:throw Error(c(451))}}function Bc(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ys(e)}var ls=new Map,Dg=new Set;function So(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ra=ue.d;ue.d={f:N_,r:T_,D:E_,C:A_,L:C_,m:R_,X:O_,S:M_,M:D_};function N_(){var e=ra.f(),t=ho();return e||t}function T_(e){var t=Ql(e);t!==null&&t.tag===5&&t.type==="form"?Jp(t):ra.r(e)}var Sr=typeof document>"u"?null:document;function Lg(e,t,n){var a=Sr;if(a&&typeof t=="string"&&t){var u=Rn(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof n=="string"&&(u+='[crossorigin="'+n+'"]'),Dg.has(u)||(Dg.add(u),e={rel:e,crossOrigin:n,href:t},a.querySelector(u)===null&&(t=a.createElement("link"),tl(t,"link",e),Tt(t),a.head.appendChild(t)))}}function E_(e){ra.D(e),Lg("dns-prefetch",e,null)}function A_(e,t){ra.C(e,t),Lg("preconnect",e,t)}function C_(e,t,n){ra.L(e,t,n);var a=Sr;if(a&&e&&t){var u='link[rel="preload"][as="'+Rn(t)+'"]';t==="image"&&n&&n.imageSrcSet?(u+='[imagesrcset="'+Rn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(u+='[imagesizes="'+Rn(n.imageSizes)+'"]')):u+='[href="'+Rn(e)+'"]';var f=u;switch(t){case"style":f=jr(e);break;case"script":f=kr(e)}ls.has(f)||(e=j({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),ls.set(f,e),a.querySelector(u)!==null||t==="style"&&a.querySelector(Ic(f))||t==="script"&&a.querySelector(qc(f))||(t=a.createElement("link"),tl(t,"link",e),Tt(t),a.head.appendChild(t)))}}function R_(e,t){ra.m(e,t);var n=Sr;if(n&&e){var a=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+Rn(a)+'"][href="'+Rn(e)+'"]',f=u;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=kr(e)}if(!ls.has(f)&&(e=j({rel:"modulepreload",href:e},t),ls.set(f,e),n.querySelector(u)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(qc(f)))return}a=n.createElement("link"),tl(a,"link",e),Tt(a),n.head.appendChild(a)}}}function M_(e,t,n){ra.S(e,t,n);var a=Sr;if(a&&e){var u=pn(a).hoistableStyles,f=jr(e);t=t||"default";var b=u.get(f);if(!b){var S={loading:0,preload:null};if(b=a.querySelector(Ic(f)))S.loading=5;else{e=j({rel:"stylesheet",href:e,"data-precedence":t},n),(n=ls.get(f))&&Qd(e,n);var C=b=a.createElement("link");Tt(C),tl(C,"link",e),C._p=new Promise(function(X,ne){C.onload=X,C.onerror=ne}),C.addEventListener("load",function(){S.loading|=1}),C.addEventListener("error",function(){S.loading|=2}),S.loading|=4,jo(b,t,a)}b={type:"stylesheet",instance:b,count:1,state:S},u.set(f,b)}}}function O_(e,t){ra.X(e,t);var n=Sr;if(n&&e){var a=pn(n).hoistableScripts,u=kr(e),f=a.get(u);f||(f=n.querySelector(qc(u)),f||(e=j({src:e,async:!0},t),(t=ls.get(u))&&Zd(e,t),f=n.createElement("script"),Tt(f),tl(f,"link",e),n.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},a.set(u,f))}}function D_(e,t){ra.M(e,t);var n=Sr;if(n&&e){var a=pn(n).hoistableScripts,u=kr(e),f=a.get(u);f||(f=n.querySelector(qc(u)),f||(e=j({src:e,async:!0,type:"module"},t),(t=ls.get(u))&&Zd(e,t),f=n.createElement("script"),Tt(f),tl(f,"link",e),n.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},a.set(u,f))}}function zg(e,t,n,a){var u=(u=je.current)?So(u):null;if(!u)throw Error(c(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=jr(n.href),n=pn(u).hoistableStyles,a=n.get(t),a||(a={type:"style",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=jr(n.href);var f=pn(u).hoistableStyles,b=f.get(e);if(b||(u=u.ownerDocument||u,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,b),(f=u.querySelector(Ic(e)))&&!f._p&&(b.instance=f,b.state.loading=5),ls.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},ls.set(e,n),f||L_(u,e,n,b.state))),t&&a===null)throw Error(c(528,""));return b}if(t&&a!==null)throw Error(c(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=kr(n),n=pn(u).hoistableScripts,a=n.get(t),a||(a={type:"script",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,e))}}function jr(e){return'href="'+Rn(e)+'"'}function Ic(e){return'link[rel="stylesheet"]['+e+"]"}function Ug(e){return j({},e,{"data-precedence":e.precedence,precedence:null})}function L_(e,t,n,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),tl(t,"link",n),Tt(t),e.head.appendChild(t))}function kr(e){return'[src="'+Rn(e)+'"]'}function qc(e){return"script[async]"+e}function Hg(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+Rn(n.href)+'"]');if(a)return t.instance=a,Tt(a),a;var u=j({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),Tt(a),tl(a,"style",u),jo(a,n.precedence,e),t.instance=a;case"stylesheet":u=jr(n.href);var f=e.querySelector(Ic(u));if(f)return t.state.loading|=4,t.instance=f,Tt(f),f;a=Ug(n),(u=ls.get(u))&&Qd(a,u),f=(e.ownerDocument||e).createElement("link"),Tt(f);var b=f;return b._p=new Promise(function(S,C){b.onload=S,b.onerror=C}),tl(f,"link",a),t.state.loading|=4,jo(f,n.precedence,e),t.instance=f;case"script":return f=kr(n.src),(u=e.querySelector(qc(f)))?(t.instance=u,Tt(u),u):(a=n,(u=ls.get(f))&&(a=j({},n),Zd(a,u)),e=e.ownerDocument||e,u=e.createElement("script"),Tt(u),tl(u,"link",a),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&&(a=t.instance,t.state.loading|=4,jo(a,n.precedence,e));return t.instance}function jo(e,t,n){for(var a=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=a.length?a[a.length-1]:null,f=u,b=0;b<a.length;b++){var S=a[b];if(S.dataset.precedence===t)f=S;else if(f!==u)break}f?f.parentNode.insertBefore(e,f.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Qd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Zd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ko=null;function Bg(e,t,n){if(ko===null){var a=new Map,u=ko=new Map;u.set(n,a)}else u=ko,a=u.get(n),a||(a=new Map,u.set(n,a));if(a.has(e))return a;for(a.set(e,null),n=n.getElementsByTagName(e),u=0;u<n.length;u++){var f=n[u];if(!(f[vl]||f[Ht]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var b=f.getAttribute(t)||"";b=e+b;var S=a.get(b);S?S.push(f):a.set(b,[f])}}return a}function Ig(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function z_(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function qg(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function U_(e,t,n,a){if(n.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var u=jr(a.href),f=t.querySelector(Ic(u));if(f){t=f._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=wo.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=f,Tt(f);return}f=t.ownerDocument||t,a=Ug(a),(u=ls.get(u))&&Qd(a,u),f=f.createElement("link"),Tt(f);var b=f;b._p=new Promise(function(S,C){b.onload=S,b.onerror=C}),tl(f,"link",a),n.instance=f}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=wo.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Kd=0;function H_(e,t){return e.stylesheets&&e.count===0&&To(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var a=setTimeout(function(){if(e.stylesheets&&To(e,e.stylesheets),e.unsuspend){var f=e.unsuspend;e.unsuspend=null,f()}},6e4+t);0<e.imgBytes&&Kd===0&&(Kd=62500*x_());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&To(e,e.stylesheets),e.unsuspend)){var f=e.unsuspend;e.unsuspend=null,f()}},(e.imgBytes>Kd?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(u)}}:null}function wo(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)To(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var No=null;function To(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,No=new Map,t.forEach(B_,e),No=null,wo.call(e))}function B_(e,t){if(!(t.state.loading&4)){var n=No.get(e);if(n)var a=n.get(null);else{n=new Map,No.set(e,n);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<u.length;f++){var b=u[f];(b.nodeName==="LINK"||b.getAttribute("media")!=="not all")&&(n.set(b.dataset.precedence,b),a=b)}a&&n.set(null,a)}u=t.instance,b=u.getAttribute("data-precedence"),f=n.get(b)||a,f===a&&n.set(null,u),n.set(b,u),this.count++,a=wo.bind(this),u.addEventListener("load",a),u.addEventListener("error",a),f?f.parentNode.insertBefore(u,f.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),t.state.loading|=4}}var Gc={$$typeof:K,Provider:null,Consumer:null,_currentValue:se,_currentValue2:se,_threadCount:0};function I_(e,t,n,a,u,f,b,S,C){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=En(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=En(0),this.hiddenUpdates=En(null),this.identifierPrefix=a,this.onUncaughtError=u,this.onCaughtError=f,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=C,this.incompleteTransitions=new Map}function Gg(e,t,n,a,u,f,b,S,C,X,ne,ce){return e=new I_(e,t,n,b,C,X,ne,ce,S),t=1,f===!0&&(t|=24),f=bl(3,null,null,t),e.current=f,f.stateNode=e,t=Ef(),t.refCount++,e.pooledCache=t,t.refCount++,f.memoizedState={element:a,isDehydrated:n,cache:t},Mf(f),e}function Yg(e){return e?(e=ka,e):ka}function Xg(e,t,n,a,u,f){u=Yg(u),a.context===null?a.context=u:a.pendingContext=u,a=Ea(t),a.payload={element:n},f=f===void 0?null:f,f!==null&&(a.callback=f),n=Aa(e,a,t),n!==null&&(Ml(n,e,t),_c(n,e,t))}function Vg(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Fd(e,t){Vg(e,t),(e=e.alternate)&&Vg(e,t)}function $g(e){if(e.tag===13||e.tag===31){var t=Zs(e,67108864);t!==null&&Ml(t,e,67108864),Fd(e,67108864)}}function Qg(e){if(e.tag===13||e.tag===31){var t=Yl();t=qn(t);var n=Zs(e,t);n!==null&&Ml(n,e,t),Fd(e,t)}}var Eo=!0;function q_(e,t,n,a){var u=B.T;B.T=null;var f=ue.p;try{ue.p=2,Jd(e,t,n,a)}finally{ue.p=f,B.T=u}}function G_(e,t,n,a){var u=B.T;B.T=null;var f=ue.p;try{ue.p=8,Jd(e,t,n,a)}finally{ue.p=f,B.T=u}}function Jd(e,t,n,a){if(Eo){var u=Wd(a);if(u===null)Ud(e,t,a,Ao,n),Kg(e,a);else if(X_(u,e,t,n,a))a.stopPropagation();else if(Kg(e,a),t&4&&-1<Y_.indexOf(e)){for(;u!==null;){var f=Ql(u);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var b=_e(f.pendingLanes);if(b!==0){var S=f;for(S.pendingLanes|=2,S.entangledLanes|=2;b;){var C=1<<31-$e(b);S.entanglements[1]|=C,b&=~C}As(f),(yt&6)===0&&(oo=Qe()+500,zc(0))}}break;case 31:case 13:S=Zs(f,2),S!==null&&Ml(S,f,2),ho(),Fd(f,2)}if(f=Wd(a),f===null&&Ud(e,t,a,Ao,n),f===u)break;u=f}u!==null&&a.stopPropagation()}else Ud(e,t,a,null,n)}}function Wd(e){return e=Bt(e),Pd(e)}var Ao=null;function Pd(e){if(Ao=null,e=It(e),e!==null){var t=d(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=h(t),e!==null)return e;e=null}else if(n===31){if(e=p(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Ao=e,null}function Zg(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(We()){case dn:return 2;case Jt:return 8;case Qt:case Bn:return 32;case Tn:return 268435456;default:return 32}default:return 32}}var eh=!1,Ia=null,qa=null,Ga=null,Yc=new Map,Xc=new Map,Ya=[],Y_="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 Kg(e,t){switch(e){case"focusin":case"focusout":Ia=null;break;case"dragenter":case"dragleave":qa=null;break;case"mouseover":case"mouseout":Ga=null;break;case"pointerover":case"pointerout":Yc.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Xc.delete(t.pointerId)}}function Vc(e,t,n,a,u,f){return e===null||e.nativeEvent!==f?(e={blockedOn:t,domEventName:n,eventSystemFlags:a,nativeEvent:f,targetContainers:[u]},t!==null&&(t=Ql(t),t!==null&&$g(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function X_(e,t,n,a,u){switch(t){case"focusin":return Ia=Vc(Ia,e,t,n,a,u),!0;case"dragenter":return qa=Vc(qa,e,t,n,a,u),!0;case"mouseover":return Ga=Vc(Ga,e,t,n,a,u),!0;case"pointerover":var f=u.pointerId;return Yc.set(f,Vc(Yc.get(f)||null,e,t,n,a,u)),!0;case"gotpointercapture":return f=u.pointerId,Xc.set(f,Vc(Xc.get(f)||null,e,t,n,a,u)),!0}return!1}function Fg(e){var t=It(e.target);if(t!==null){var n=d(t);if(n!==null){if(t=n.tag,t===13){if(t=h(n),t!==null){e.blockedOn=t,_l(e.priority,function(){Qg(n)});return}}else if(t===31){if(t=p(n),t!==null){e.blockedOn=t,_l(e.priority,function(){Qg(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Co(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Wd(e.nativeEvent);if(n===null){n=e.nativeEvent;var a=new n.constructor(n.type,n);bn=a,n.target.dispatchEvent(a),bn=null}else return t=Ql(n),t!==null&&$g(t),e.blockedOn=n,!1;t.shift()}return!0}function Jg(e,t,n){Co(e)&&n.delete(t)}function V_(){eh=!1,Ia!==null&&Co(Ia)&&(Ia=null),qa!==null&&Co(qa)&&(qa=null),Ga!==null&&Co(Ga)&&(Ga=null),Yc.forEach(Jg),Xc.forEach(Jg)}function Ro(e,t){e.blockedOn===t&&(e.blockedOn=null,eh||(eh=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,V_)))}var Mo=null;function Wg(e){Mo!==e&&(Mo=e,s.unstable_scheduleCallback(s.unstable_NormalPriority,function(){Mo===e&&(Mo=null);for(var t=0;t<e.length;t+=3){var n=e[t],a=e[t+1],u=e[t+2];if(typeof a!="function"){if(Pd(a||n)===null)continue;break}var f=Ql(n);f!==null&&(e.splice(t,3),t-=3,Wf(f,{pending:!0,data:u,method:n.method,action:a},a,u))}}))}function wr(e){function t(C){return Ro(C,e)}Ia!==null&&Ro(Ia,e),qa!==null&&Ro(qa,e),Ga!==null&&Ro(Ga,e),Yc.forEach(t),Xc.forEach(t);for(var n=0;n<Ya.length;n++){var a=Ya[n];a.blockedOn===e&&(a.blockedOn=null)}for(;0<Ya.length&&(n=Ya[0],n.blockedOn===null);)Fg(n),n.blockedOn===null&&Ya.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(a=0;a<n.length;a+=3){var u=n[a],f=n[a+1],b=u[Ze]||null;if(typeof f=="function")b||Wg(n);else if(b){var S=null;if(f&&f.hasAttribute("formAction")){if(u=f,b=f[Ze]||null)S=b.formAction;else if(Pd(u)!==null)continue}else S=b.action;typeof S=="function"?n[a+1]=S:(n.splice(a,3),a-=3),Wg(n)}}}function Pg(){function e(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(b){return u=b})},focusReset:"manual",scroll:"manual"})}function t(){u!==null&&(u(),u=null),a||setTimeout(n,20)}function n(){if(!a&&!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 a=!1,u=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){a=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),u!==null&&(u(),u=null)}}}function th(e){this._internalRoot=e}Oo.prototype.render=th.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var n=t.current,a=Yl();Xg(n,a,e,t,null,null)},Oo.prototype.unmount=th.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Xg(e.current,2,null,e,null,null),ho(),t[ln]=null}};function Oo(e){this._internalRoot=e}Oo.prototype.unstable_scheduleHydration=function(e){if(e){var t=nn();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ya.length&&t!==0&&t<Ya[n].priority;n++);Ya.splice(n,0,e),n===0&&Fg(e)}};var eb=l.version;if(eb!=="19.2.8")throw Error(c(527,eb,"19.2.8"));ue.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(c(188)):(e=Object.keys(e).join(","),Error(c(268,e)));return e=x(t),e=e!==null?_(e):null,e=e===null?null:e.stateNode,e};var $_={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Do=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Do.isDisabled&&Do.supportsFiber)try{zt=Do.inject($_),bt=Do}catch{}}return Qc.createRoot=function(e,t){if(!o(e))throw Error(c(299));var n=!1,a="",u=rm,f=cm,b=um;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(u=t.onUncaughtError),t.onCaughtError!==void 0&&(f=t.onCaughtError),t.onRecoverableError!==void 0&&(b=t.onRecoverableError)),t=Gg(e,1,!1,null,null,n,a,null,u,f,b,Pg),e[ln]=t.current,zd(e),new th(t)},Qc.hydrateRoot=function(e,t,n){if(!o(e))throw Error(c(299));var a=!1,u="",f=rm,b=cm,S=um,C=null;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(u=n.identifierPrefix),n.onUncaughtError!==void 0&&(f=n.onUncaughtError),n.onCaughtError!==void 0&&(b=n.onCaughtError),n.onRecoverableError!==void 0&&(S=n.onRecoverableError),n.formState!==void 0&&(C=n.formState)),t=Gg(e,1,!0,t,n??null,a,u,C,f,b,S,Pg),t.context=Yg(null),n=t.current,a=Yl(),a=qn(a),u=Ea(a),u.callback=null,Aa(n,u,a),n=a,t.current.lanes=n,In(t,n),As(t),e[ln]=t.current,zd(e),new Oo(t)},Qc.version="19.2.8",Qc}var fb;function s0(){if(fb)return ah.exports;fb=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(l){console.error(l)}}return s(),ah.exports=l0(),ah.exports}var a0=s0();const Rx=1;var oa,Ur,Hr,Br,Ir,ou,qr,cf,Mx;class i0{constructor(l){en(this,cf);en(this,oa,null);en(this,Ur,new Set);en(this,Hr,500);en(this,Br,null);en(this,Ir,!1);en(this,ou,null);en(this,qr,null);this.url=l}get statusText(){return this.connected?"Хост на связи":"Нет связи с хостом"}onStatus(l){_t(this,qr,l)}connect(){if(qe(this,Ir))return;const l=new WebSocket(this.url);_t(this,oa,l),l.addEventListener("open",()=>{var r,c;_t(this,Hr,500),this.send({type:"hello",protocol:Rx,clientName:"ccv-web"}),(r=qe(this,ou))==null||r.call(this),(c=qe(this,qr))==null||c.call(this)}),l.addEventListener("message",r=>{let c;try{c=JSON.parse(String(r.data))}catch{return}for(const o of qe(this,Ur))o(c)}),l.addEventListener("close",()=>{var r;_t(this,oa,null),(r=qe(this,qr))==null||r.call(this),kn(this,cf,Mx).call(this)}),l.addEventListener("error",()=>l.close())}onReconnect(l){_t(this,ou,l)}on(l){return qe(this,Ur).add(l),()=>qe(this,Ur).delete(l)}send(l){var r;((r=qe(this,oa))==null?void 0:r.readyState)===WebSocket.OPEN&&qe(this,oa).send(JSON.stringify(l))}get connected(){var l;return((l=qe(this,oa))==null?void 0:l.readyState)===WebSocket.OPEN}close(){var l;_t(this,Ir,!0),(l=qe(this,oa))==null||l.close()}}oa=new WeakMap,Ur=new WeakMap,Hr=new WeakMap,Br=new WeakMap,Ir=new WeakMap,ou=new WeakMap,qr=new WeakMap,cf=new WeakSet,Mx=function(){if(qe(this,Ir)||qe(this,Br)!==null)return;const l=qe(this,Hr);_t(this,Hr,Math.min(l*2,1e4)),_t(this,Br,window.setTimeout(()=>{_t(this,Br,null),this.connect()},l))};const r0=1,Ox="ccv:relay",Zo="ccv:relay.host";function c0(){try{const s=localStorage.getItem(Ox);if(!s)return null;const l=JSON.parse(s);return typeof(l==null?void 0:l.token)!="string"||typeof l.expiresAt=="number"&&l.expiresAt<=Date.now()?null:l}catch{return null}}function Dx(){localStorage.removeItem(Ox)}var Us,Gr,Hs,Yr,Xr,Wa,Ri,Mi,Pa,Oi,Vr,Di,Li,Xt,Qa,Eh,Lx,Ai,Ah;class u0{constructor(l){en(this,Xt);en(this,Us,null);en(this,Gr,new Set);en(this,Hs,null);en(this,Yr,null);en(this,Xr,500);en(this,Wa,null);en(this,Ri,!1);en(this,Mi,!1);en(this,Pa,!1);en(this,Oi,null);en(this,Vr,"Подключаемся…");en(this,Di,0);en(this,Li,[]);this.session=l}get connected(){return qe(this,Mi)&&qe(this,Pa)}get statusText(){return qe(this,Vr)}get hostId(){return qe(this,Oi)}on(l){return qe(this,Gr).add(l),()=>qe(this,Gr).delete(l)}onReconnect(l){_t(this,Yr,l)}onStatus(l){_t(this,Hs,l)}connect(){qe(this,Ri)||kn(this,Xt,Eh).call(this)}send(l){if(!qe(this,Mi)){qe(this,Li).length<64&&qe(this,Li).push(l);return}kn(this,Xt,Ai).call(this,{t:"client.frame",body:l})}close(){var l;_t(this,Ri,!0),qe(this,Wa)!==null&&window.clearTimeout(qe(this,Wa)),(l=qe(this,Us))==null||l.close()}}Us=new WeakMap,Gr=new WeakMap,Hs=new WeakMap,Yr=new WeakMap,Xr=new WeakMap,Wa=new WeakMap,Ri=new WeakMap,Mi=new WeakMap,Pa=new WeakMap,Oi=new WeakMap,Vr=new WeakMap,Di=new WeakMap,Li=new WeakMap,Xt=new WeakSet,Qa=function(l){var r;qe(this,Vr)!==l&&(_t(this,Vr,l),(r=qe(this,Hs))==null||r.call(this))},Eh=async function(){if(qe(this,Us))return;if(!qe(this,Oi))try{_t(this,Oi,await o0(this.session.token))}catch(c){kn(this,Xt,Qa).call(this,c instanceof Error?c.message:String(c)),kn(this,Xt,Ah).call(this);return}const l=location.protocol==="https:"?"wss":"ws",r=new WebSocket(`${l}://${location.host}/relay/client`);_t(this,Us,r),r.addEventListener("open",()=>{kn(this,Xt,Ai).call(this,{t:"client.hello",protocol:r0,token:this.session.token})}),r.addEventListener("message",c=>{let o;try{o=JSON.parse(String(c.data))}catch{return}kn(this,Xt,Lx).call(this,o)}),r.addEventListener("close",()=>{var c;_t(this,Us,null),_t(this,Mi,!1),_t(this,Pa,!1),kn(this,Xt,Qa).call(this,"Нет связи с сервером"),(c=qe(this,Hs))==null||c.call(this),kn(this,Xt,Ah).call(this)}),r.addEventListener("error",()=>r.close())},Lx=function(l){var r,c,o,d,h,p,m;switch(l.t){case"client.ok":_t(this,Xr,500),kn(this,Xt,Ai).call(this,{t:"client.attach",hostId:qe(this,Oi)??"",...qe(this,Di)>0?{sinceRseq:qe(this,Di)}:{}});return;case"client.attached":_t(this,Mi,!0),_t(this,Pa,l.online),_t(this,Di,l.rseq),kn(this,Xt,Qa).call(this,l.online?"Хост на связи":"Компьютер не на связи"),kn(this,Xt,Ai).call(this,{t:"client.frame",body:{type:"hello",protocol:Rx,clientName:"ccv-web-relay"}});const x=qe(this,Li);_t(this,Li,[]);for(const _ of x)kn(this,Xt,Ai).call(this,{t:"client.frame",body:_});(r=qe(this,Yr))==null||r.call(this),(c=qe(this,Hs))==null||c.call(this);return;case"host.frame":{l.rseq>0&&_t(this,Di,l.rseq);const _=l.body;for(const j of qe(this,Gr))j(_);return}case"host.online":_t(this,Pa,!0),kn(this,Xt,Qa).call(this,"Хост на связи"),(o=qe(this,Yr))==null||o.call(this),(d=qe(this,Hs))==null||d.call(this);return;case"host.offline":_t(this,Pa,!1),kn(this,Xt,Qa).call(this,"Компьютер не на связи"),(h=qe(this,Hs))==null||h.call(this);return;case"ping":kn(this,Xt,Ai).call(this,{t:"pong",nonce:l.nonce});return;case"error":if(l.code==="auth"){Dx(),location.href="/login";return}if(l.code==="not_found"){localStorage.removeItem(Zo),kn(this,Xt,Qa).call(this,"Этот компьютер отвязан от аккаунта"),_t(this,Ri,!0),(p=qe(this,Us))==null||p.close();return}l.code!=="offline"&&kn(this,Xt,Qa).call(this,l.message),(m=qe(this,Hs))==null||m.call(this);return}},Ai=function(l){var r;((r=qe(this,Us))==null?void 0:r.readyState)===WebSocket.OPEN&&qe(this,Us).send(JSON.stringify(l))},Ah=function(){if(qe(this,Ri)||qe(this,Wa)!==null)return;const l=qe(this,Xr);_t(this,Xr,Math.min(l*2,1e4)),_t(this,Wa,window.setTimeout(()=>{_t(this,Wa,null),kn(this,Xt,Eh).call(this)},l))};async function o0(s){const l=new URLSearchParams(location.search).get("host");if(l)return localStorage.setItem(Zo,l),l;const r=localStorage.getItem(Zo);if(r)return r;const c=await fetch("/api/hosts",{headers:{authorization:`Bearer ${s}`}});if(c.status===401)throw Dx(),location.href="/login",new Error("нужен вход");const d=(await c.json()).hosts??[];if(d.length===1&&d[0])return localStorage.setItem(Zo,d[0].id),d[0].id;throw location.href="/hosts",new Error("выберите компьютер")}function Ko(){return location.pathname==="/app"||location.pathname.startsWith("/app/")?"relay":"local"}const f0=`${location.protocol==="https:"?"wss":"ws"}://${location.host}/ws`;function d0(){if(Ko()==="local")return new i0(f0);const s=c0();return s?new u0(s):(location.replace(`/login?next=${encodeURIComponent(location.pathname+location.search)}`),null)}const Ol={items:[],pending:[],lastSeq:0,contextTokens:null},uh={entries:[],total:0,loading:!1};function zx(s){var l;return((l=s.entries[0])==null?void 0:l.seq)??1}function db(s){return s.total>0&&zx(s)>1}function h0(s,l){const r=new Set(s.entries.map(o=>o.seq));return{entries:[...s.entries,...l.entries.filter(o=>!r.has(o.seq))].sort((o,d)=>o.seq-d.seq),total:l.total,loading:!1}}function p0(s){return Fo(Ol,s).items.map(l=>({...l,id:`h:${l.id}`}))}function Fo(s,l){let r=s;for(const c of l)c.seq<=r.lastSeq||(r={...m0(r,c.event,c.seq),lastSeq:c.seq});return r}function m0(s,l,r){var o,d;const c=s.items;switch(l.kind){case"user.message":return Cs(s,{id:`u${r}`,kind:"user",text:l.text,images:l.images});case"assistant.delta":{const h=c.findIndex(m=>m.id===l.blockId);if(h===-1)return Cs(s,{id:l.blockId,kind:"assistant",text:l.text,streaming:!0});const p=c[h];return Nr(s,h,{...p,text:p.text+l.text})}case"assistant.text":{const h=c.findIndex(m=>m.id===l.blockId),p={id:l.blockId,kind:"assistant",text:l.text,streaming:!1};return h===-1?Cs(s,p):Nr(s,h,p)}case"thinking.delta":{const h=c.findIndex(m=>m.id===l.blockId);if(h===-1)return Cs(s,{id:l.blockId,kind:"thinking",text:l.text});const p=c[h];return Nr(s,h,{...p,text:p.text+l.text})}case"assistant.thinking":{const h=c.findIndex(m=>m.id===l.blockId),p={id:l.blockId,kind:"thinking",text:l.text};return h===-1?Cs(s,p):Nr(s,h,p)}case"tool.use":return Cs(s,{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(m=>m.kind==="tool"&&m.toolUseId===l.toolUseId);if(h===-1)return s;const p=c[h];return Nr(s,h,{...p,result:l.content,isError:l.isError,awaitingPermission:!1})}case"permission.request":return{...s,pending:[...s.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=s.pending.find(m=>m.requestId===l.requestId),p=s.pending.filter(m=>m.requestId!==l.requestId);if(l.answers&&(h!=null&&h.toolUseId)){const m=c.findIndex(x=>x.kind==="tool"&&x.toolUseId===h.toolUseId);if(m!==-1){const x=c[m];return Nr({...s,pending:p},m,{...x,answers:l.answers})}}return l.decision==="allow"?{...s,pending:p}:Cs({...s,pending:p},{id:`p${r}`,kind:"notice",tone:"info",text:`Отклонено${l.reason?`: ${l.reason}`:""}`})}case"result":{const h=s.items.map(m=>m.kind==="assistant"&&m.streaming?{...m,streaming:!1}:m),p=l.contextTokens??s.contextTokens;return Cs({...s,items:h,contextTokens:p},{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"?s:Cs(s,{id:`s${r}`,kind:"notice",tone:"info",text:"Контекст сжат"});case"error":return Cs(s,{id:`e${r}`,kind:"notice",tone:"error",text:l.message});case"state":return s;case"rewound":return s;default:return s}}function g0(s,l){let r=0;for(let c=0;c<s.length;c++)if(s[c].event.kind==="user.message"){if(r===l)return s.slice(0,c);r++}return s}function b0(s,l,r){const c=l-r;if(c<=0)return[];let o=0;for(let d=0;d<s.length;d++)if(s[d].kind==="user"){if(o===c)return s.slice(0,d);o++}return s}function Cs(s,l){return{...s,items:[...s.items,l]}}function Nr(s,l,r){const c=s.items.slice();return c[l]=r,{...s,items:c}}const Ch="ccv:theme",oh=["system","light","dark"];function x0(){const[s,l]=y.useState(y0);y.useEffect(()=>{const o=window.matchMedia("(prefers-color-scheme: dark)"),d=()=>{const h=s==="dark"||s==="system"&&o.matches;document.documentElement.dataset.theme=h?"dark":"light"};return d(),o.addEventListener("change",d),()=>o.removeEventListener("change",d)},[s]);const r=y.useCallback(o=>{try{localStorage.setItem(Ch,o)}catch{}l(o)},[]),c=y.useCallback(()=>{l(o=>{const d=oh[(oh.indexOf(o)+1)%oh.length];try{localStorage.setItem(Ch,d)}catch{}return d})},[]);return[s,r,c]}function y0(){try{const s=localStorage.getItem(Ch);if(s==="light"||s==="dark"||s==="system")return s}catch{}return"system"}const Ux=[{value:"default",hint:"спрашивать перед каждым действием"},{value:"acceptEdits",hint:"правки файлов без подтверждения"},{value:"plan",hint:"только чтение и план, без изменений"},{value:"auto",hint:"спрашивать только о рискованном — решает сам"},{value:"bypassPermissions",hint:"ничего не спрашивать"}],zi={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:"вопроса"}},_0=320,Hx="ccv:panes";function v0(s){return`--${s}-w`}function Bx(s,l){const r=zi[s];return Math.round(Math.min(r.max,Math.max(r.min,l)))}function S0(){const s={};for(const l of Object.keys(zi))s[l]=zi[l].width;try{const l=localStorage.getItem(Hx);if(l){const r=JSON.parse(l);for(const c of Object.keys(zi)){const o=r[c];typeof o=="number"&&Number.isFinite(o)&&(s[c]=Bx(c,o))}}}catch{}return s}function j0(){const[s,l]=y.useState(S0),r=y.useCallback(h=>{try{localStorage.setItem(Hx,JSON.stringify(h))}catch{}},[]),c=y.useCallback((h,p)=>{l(m=>{const x=Bx(h,p);if(m[h]===x)return m;const _={...m,[h]:x};return r(_),_})},[r]),o=y.useCallback(h=>{l(p=>{const m={...p,[h]:zi[h].width};return r(m),m})},[r]),d={};for(const h of Object.keys(zi))d[v0(h)]=`${s[h]}px`;return{widths:s,style:d,setWidth:c,reset:o}}const fh=260,Ix=120,k0=200,hb="ccv:terminal-h";function pb(s,l){return Math.round(Math.min(l,Math.max(Ix,s)))}function w0(){const[s,l]=y.useState(()=>{try{const d=localStorage.getItem(hb);if(d){const h=Number(d);if(Number.isFinite(h))return pb(h,1/0)}}catch{}return fh}),r=y.useCallback(d=>{try{localStorage.setItem(hb,String(d))}catch{}},[]),c=y.useCallback((d,h)=>{const p=pb(d,h);l(m=>m===p?m:(r(p),p))},[r]),o=y.useCallback(()=>{l(fh),r(fh)},[r]);return{height:s,setHeight:c,reset:o}}function uf(s){const[l,r]=y.useState(()=>typeof window>"u"?!1:window.matchMedia(s).matches);return y.useEffect(()=>{const c=window.matchMedia(s),o=()=>r(c.matches);return o(),c.addEventListener("change",o),()=>c.removeEventListener("change",o)},[s]),l}const N0={height:0,offsetTop:0,offsetLeft:0};function mb(){if(typeof window>"u")return N0;const s=window.visualViewport;return s?{height:s.height,offsetTop:s.offsetTop,offsetLeft:s.offsetLeft}:{height:window.innerHeight,offsetTop:0,offsetLeft:0}}function T0(s){const[l,r]=y.useState(mb);return y.useEffect(()=>{if(!s)return;const c=window.visualViewport,o=()=>{const d=mb();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))},[s]),l}function Yh(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ii=Yh();function qx(s){Ii=s}var Ci={exec:()=>null};function Tr(s){let l=[];return r=>{let c=Math.max(0,Math.min(3,r-1)),o=l[c];return o||(o=s(c),l[c]=o),o}}function ft(s,l=""){let r=typeof s=="string"?s:s.source,c={replace:(o,d)=>{let h=typeof d=="string"?d:d.source;return h=h.replace(dl.caret,"$1"),r=r.replace(o,h),c},getRegex:()=>new RegExp(r,l)};return c}var E0=((s="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+s)}catch{return!1}})(),dl={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:s=>new RegExp(`^( {0,3}${s})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:Tr(s=>new RegExp(`^ {0,${s}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Tr(s=>new RegExp(`^ {0,${s}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Tr(s=>new RegExp(`^ {0,${s}}(?:\`\`\`|~~~)`)),headingBeginRegex:Tr(s=>new RegExp(`^ {0,${s}}#`)),htmlBeginRegex:Tr(s=>new RegExp(`^ {0,${s}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:Tr(s=>new RegExp(`^ {0,${s}}>`))},A0=/^(?:[ \t]*(?:\n|$))+/,C0=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,R0=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,fu=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,M0=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Xh=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Gx=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Yx=ft(Gx).replace(/bull/g,Xh).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(),O0=ft(Gx).replace(/bull/g,Xh).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(),Vh=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,D0=/^[^\n]+/,$h=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,L0=ft(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",$h).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),z0=ft(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Xh).getRegex(),of="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",Qh=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,U0=ft("^ {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",Qh).replace("tag",of).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Xx=s=>ft(Vh).replace("hr",fu).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",s).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",of).getRegex(),H0=Xx(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),B0=Xx(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),I0=ft(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",B0).getRegex(),Zh={blockquote:I0,code:C0,def:L0,fences:R0,heading:M0,hr:fu,html:U0,lheading:Yx,list:z0,newline:A0,paragraph:H0,table:Ci,text:D0},gb=ft("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",fu).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",of).getRegex(),q0={...Zh,lheading:O0,table:gb,paragraph:ft(Vh).replace("hr",fu).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",gb).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",of).getRegex()},G0={...Zh,html:ft(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Qh).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:Ci,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ft(Vh).replace("hr",fu).replace("heading",` *#{1,6} *[^
|
|
51
|
+
]`).replace("lheading",Yx).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Y0=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,X0=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Vx=/^( {2,}|\\)\n(?!\s*$)/,V0=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Qr=/[\p{P}\p{S}]/u,ff=/[\s\p{P}\p{S}]/u,Kh=/[^\s\p{P}\p{S}]/u,$0=ft(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ff).getRegex(),$x=/(?!~)[\p{P}\p{S}]/u,Q0=/(?!~)[\s\p{P}\p{S}]/u,Z0=/(?:[^\s\p{P}\p{S}]|~)/u,K0=ft(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",E0?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Qx=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,F0=ft(Qx,"u").replace(/punct/g,Qr).getRegex(),J0=ft(Qx,"u").replace(/punct/g,$x).getRegex(),Zx="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",W0=ft(Zx,"gu").replace(/notPunctSpace/g,Kh).replace(/punctSpace/g,ff).replace(/punct/g,Qr).getRegex(),P0=ft(Zx,"gu").replace(/notPunctSpace/g,Z0).replace(/punctSpace/g,Q0).replace(/punct/g,$x).getRegex(),ev=ft("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Kh).replace(/punctSpace/g,ff).replace(/punct/g,Qr).getRegex(),tv=ft(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Qr).getRegex(),nv="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",lv=ft(nv,"gu").replace(/notPunctSpace/g,Kh).replace(/punctSpace/g,ff).replace(/punct/g,Qr).getRegex(),sv=ft(/\\(punct)/,"gu").replace(/punct/g,Qr).getRegex(),av=ft(/^<(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(),iv=ft(Qh).replace("(?:-->|$)","-->").getRegex(),rv=ft("^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",iv).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Po=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,cv=ft(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Po).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Kx=ft(/^!?\[(label)\]\[(ref)\]/).replace("label",Po).replace("ref",$h).getRegex(),Fx=ft(/^!?\[(ref)\](?:\[\])?/).replace("ref",$h).getRegex(),uv=ft("reflink|nolink(?!\\()","g").replace("reflink",Kx).replace("nolink",Fx).getRegex(),bb=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Fh={_backpedal:Ci,anyPunctuation:sv,autolink:av,blockSkip:K0,br:Vx,code:X0,del:Ci,delLDelim:Ci,delRDelim:Ci,emStrongLDelim:F0,emStrongRDelimAst:W0,emStrongRDelimUnd:ev,escape:Y0,link:cv,nolink:Fx,punctuation:$0,reflink:Kx,reflinkSearch:uv,tag:rv,text:V0,url:Ci},ov={...Fh,link:ft(/^!?\[(label)\]\((.*?)\)/).replace("label",Po).getRegex(),reflink:ft(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Po).getRegex()},Rh={...Fh,emStrongRDelimAst:P0,emStrongLDelim:J0,delLDelim:tv,delRDelim:lv,url:ft(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",bb).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:ft(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",bb).getRegex()},fv={...Rh,br:ft(Vx).replace("{2,}","*").getRegex(),text:ft(Rh.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Lo={normal:Zh,gfm:q0,pedantic:G0},Zc={normal:Fh,gfm:Rh,breaks:fv,pedantic:ov},dv={"&":"&","<":"<",">":">",'"':""","'":"'"},xb=s=>dv[s];function Ds(s,l){if(l){if(dl.escapeTest.test(s))return s.replace(dl.escapeReplace,xb)}else if(dl.escapeTestNoEncode.test(s))return s.replace(dl.escapeReplaceNoEncode,xb);return s}function yb(s){try{s=encodeURI(s).replace(dl.percentDecode,"%")}catch{return null}return s}function _b(s,l){var d;let r=s.replace(dl.findPipe,(h,p,m)=>{let x=!1,_=p;for(;--_>=0&&m[_]==="\\";)x=!x;return x?"|":" |"}),c=r.split(dl.splitPipe),o=0;if(c[0].trim()||c.shift(),c.length>0&&!((d=c.at(-1))!=null&&d.trim())&&c.pop(),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(dl.slashPipe,"|");return c}function Va(s,l,r){let c=s.length;if(c===0)return"";let o=0;for(;o<c&&s.charAt(c-o-1)===l;)o++;return s.slice(0,c-o)}function vb(s){let l=s.split(`
|
|
52
|
+
`),r=l.length-1;for(;r>=0&&dl.blankLine.test(l[r]);)r--;return l.length-r<=2?s:l.slice(0,r+1).join(`
|
|
53
|
+
`)}function hv(s,l){if(s.indexOf(l[1])===-1)return-1;let r=0;for(let c=0;c<s.length;c++)if(s[c]==="\\")c++;else if(s[c]===l[0])r++;else if(s[c]===l[1]&&(r--,r<0))return c;return r>0?-2:-1}function pv(s,l=0){let r=l,c="";for(let o of s)if(o===" "){let d=4-r%4;c+=" ".repeat(d),r+=d}else c+=o,r++;return c}function Sb(s,l,r,c,o){let d=l.href,h=l.title||null,p=s[1].replace(o.other.outputLinkReplace,"$1");c.state.inLink=!0;let m={type:s[0].charAt(0)==="!"?"image":"link",raw:r,href:d,title:h,text:p,tokens:c.inlineTokens(p)};return c.state.inLink=!1,m}function mv(s,l,r){let c=s.match(r.other.indentCodeCompensation);if(c===null)return l;let o=c[1];return l.split(`
|
|
54
|
+
`).map(d=>{let h=d.match(r.other.beginningSpace);if(h===null)return d;let[p]=h;return p.length>=o.length?d.slice(o.length):d}).join(`
|
|
55
|
+
`)}var ef=class{constructor(s){Mt(this,"options");Mt(this,"rules");Mt(this,"lexer");this.options=s||Ii}space(s){let l=this.rules.block.newline.exec(s);if(l&&l[0].length>0)return{type:"space",raw:l[0]}}code(s){let l=this.rules.block.code.exec(s);if(l){let r=this.options.pedantic?l[0]:vb(l[0]),c=r.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r,codeBlockStyle:"indented",text:c}}}fences(s){let l=this.rules.block.fences.exec(s);if(l){let r=l[0],c=mv(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(s){let l=this.rules.block.heading.exec(s);if(l){let r=l[2].trim();if(this.rules.other.endingHash.test(r)){let c=Va(r,"#");(this.options.pedantic||!c||this.rules.other.endingSpaceChar.test(c))&&(r=c.trim())}return{type:"heading",raw:Va(l[0],`
|
|
56
|
+
`),depth:l[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(s){let l=this.rules.block.hr.exec(s);if(l)return{type:"hr",raw:Va(l[0],`
|
|
57
|
+
`)}}blockquote(s){let l=this.rules.block.blockquote.exec(s);if(l){let r=Va(l[0],`
|
|
58
|
+
`).split(`
|
|
59
|
+
`),c="",o="",d=[];for(;r.length>0;){let h=!1,p=[],m;for(m=0;m<r.length;m++)if(this.rules.other.blockquoteStart.test(r[m]))p.push(r[m]),h=!0;else if(!h)p.push(r[m]);else break;r=r.slice(m);let x=p.join(`
|
|
60
|
+
`),_=x.replace(this.rules.other.blockquoteSetextReplace,`
|
|
61
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");c=c?`${c}
|
|
62
|
+
${x}`:x,o=o?`${o}
|
|
63
|
+
${_}`:_;let j=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(_,d,!0),this.lexer.state.top=j,r.length===0)break;let v=d.at(-1);if((v==null?void 0:v.type)==="code")break;if((v==null?void 0:v.type)==="blockquote"){let E=v,k=E.raw+`
|
|
64
|
+
`+r.join(`
|
|
65
|
+
`),O=this.blockquote(k);d[d.length-1]=O,c=c.substring(0,c.length-E.raw.length)+O.raw,o=o.substring(0,o.length-E.text.length)+O.text;break}else if((v==null?void 0:v.type)==="list"){let E=v,k=E.raw+`
|
|
66
|
+
`+r.join(`
|
|
67
|
+
`),O=this.list(k);d[d.length-1]=O,c=c.substring(0,c.length-v.raw.length)+O.raw,o=o.substring(0,o.length-E.raw.length)+O.raw,r=k.substring(d.at(-1).raw.length).split(`
|
|
68
|
+
`);continue}}return{type:"blockquote",raw:c,tokens:d,text:o}}}list(s){let l=this.rules.block.list.exec(s);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(;s;){let m=!1,x="",_="";if(!(l=d.exec(s))||this.rules.block.hr.test(s))break;x=l[0],s=s.substring(x.length);let j=pv(l[2].split(`
|
|
69
|
+
`,1)[0],l[1].length),v=s.split(`
|
|
70
|
+
`,1)[0],E=!j.trim(),k=0;if(this.options.pedantic?(k=2,_=j.trimStart()):E?k=l[1].length+1:(k=j.search(this.rules.other.nonSpaceChar),k=k>4?1:k,_=j.slice(k),k+=l[1].length),E&&this.rules.other.blankLine.test(v)&&(x+=v+`
|
|
71
|
+
`,s=s.substring(v.length+1),m=!0),!m){let O=this.rules.other.nextBulletRegex(k),z=this.rules.other.hrRegex(k),ee=this.rules.other.fencesBeginRegex(k),te=this.rules.other.headingBeginRegex(k),K=this.rules.other.htmlBeginRegex(k),M=this.rules.other.blockquoteBeginRegex(k);for(;s;){let F=s.split(`
|
|
72
|
+
`,1)[0],H;if(v=F,this.options.pedantic?(v=v.replace(this.rules.other.listReplaceNesting," "),H=v):H=v.replace(this.rules.other.tabCharGlobal," "),ee.test(v)||te.test(v)||K.test(v)||M.test(v)||O.test(v)||z.test(v))break;if(H.search(this.rules.other.nonSpaceChar)>=k||!v.trim())_+=`
|
|
73
|
+
`+H.slice(k);else{if(E||j.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||ee.test(j)||te.test(j)||z.test(j))break;_+=`
|
|
74
|
+
`+v}E=!v.trim(),x+=F+`
|
|
75
|
+
`,s=s.substring(F.length+1),j=H.slice(k)}}o.loose||(h?o.loose=!0:this.rules.other.doubleBlankLine.test(x)&&(h=!0)),o.items.push({type:"list_item",raw:x,task:!!this.options.gfm&&this.rules.other.listIsTask.test(_),loose:!1,text:_,tokens:[]}),o.raw+=x}let p=o.items.at(-1);if(p)p.raw=p.raw.trimEnd(),p.text=p.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let m of o.items){this.lexer.state.top=!1,m.tokens=this.lexer.blockTokens(m.text,[]);let x=m.tokens[0];if(m.task&&((x==null?void 0:x.type)==="text"||(x==null?void 0:x.type)==="paragraph")){m.text=m.text.replace(this.rules.other.listReplaceTask,""),x.raw=x.raw.replace(this.rules.other.listReplaceTask,""),x.text=x.text.replace(this.rules.other.listReplaceTask,"");for(let j=this.lexer.inlineQueue.length-1;j>=0;j--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[j].src)){this.lexer.inlineQueue[j].src=this.lexer.inlineQueue[j].src.replace(this.rules.other.listReplaceTask,"");break}let _=this.rules.other.listTaskCheckbox.exec(m.raw);if(_){let j={type:"checkbox",raw:_[0]+" ",checked:_[0]!=="[ ]"};m.checked=j.checked,o.loose?m.tokens[0]&&["paragraph","text"].includes(m.tokens[0].type)&&"tokens"in m.tokens[0]&&m.tokens[0].tokens?(m.tokens[0].raw=j.raw+m.tokens[0].raw,m.tokens[0].text=j.raw+m.tokens[0].text,m.tokens[0].tokens.unshift(j)):m.tokens.unshift({type:"paragraph",raw:j.raw,text:j.raw,tokens:[j]}):m.tokens.unshift(j)}}else m.task&&(m.task=!1);if(!o.loose){let _=m.tokens.filter(v=>v.type==="space"),j=_.length>0&&_.some(v=>this.rules.other.anyLine.test(v.raw));o.loose=j}}if(o.loose)for(let m of o.items){m.loose=!0;for(let x of m.tokens)x.type==="text"&&(x.type="paragraph")}return o}}html(s){let l=this.rules.block.html.exec(s);if(l){let r=vb(l[0]);return{type:"html",block:!0,raw:r,pre:l[1]==="pre"||l[1]==="script"||l[1]==="style",text:r}}}def(s){let l=this.rules.block.def.exec(s);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:Va(l[0],`
|
|
76
|
+
`),href:c,title:o}}}table(s){var h;let l=this.rules.block.table.exec(s);if(!l||!this.rules.other.tableDelimiter.test(l[2]))return;let r=_b(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(`
|
|
77
|
+
`):[],d={type:"table",raw:Va(l[0],`
|
|
78
|
+
`),header:[],align:[],rows:[]};if(r.length===c.length){for(let p of c)this.rules.other.tableAlignRight.test(p)?d.align.push("right"):this.rules.other.tableAlignCenter.test(p)?d.align.push("center"):this.rules.other.tableAlignLeft.test(p)?d.align.push("left"):d.align.push(null);for(let p=0;p<r.length;p++)d.header.push({text:r[p],tokens:this.lexer.inline(r[p]),header:!0,align:d.align[p]});for(let p of o)d.rows.push(_b(p,d.header.length).map((m,x)=>({text:m,tokens:this.lexer.inline(m),header:!1,align:d.align[x]})));return d}}lheading(s){let l=this.rules.block.lheading.exec(s);if(l){let r=l[1].trim();return{type:"heading",raw:Va(l[0],`
|
|
79
|
+
`),depth:l[2].charAt(0)==="="?1:2,text:r,tokens:this.lexer.inline(r)}}}paragraph(s){let l=this.rules.block.paragraph.exec(s);if(l){let r=l[1].charAt(l[1].length-1)===`
|
|
80
|
+
`?l[1].slice(0,-1):l[1];return{type:"paragraph",raw:l[0],text:r,tokens:this.lexer.inline(r)}}}text(s){let l=this.rules.block.text.exec(s);if(l)return{type:"text",raw:l[0],text:l[0],tokens:this.lexer.inline(l[0])}}escape(s){let l=this.rules.inline.escape.exec(s);if(l)return{type:"escape",raw:l[0],text:l[1]}}tag(s){let l=this.rules.inline.tag.exec(s);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(s){let l=this.rules.inline.link.exec(s);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=Va(r.slice(0,-1),"\\");if((r.length-d.length)%2===0)return}else{let d=hv(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)),Sb(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(s,l){let r;if((r=this.rules.inline.reflink.exec(s))||(r=this.rules.inline.nolink.exec(s))){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 Sb(r,o,r[0],this.lexer,this.rules)}}emStrong(s,l,r=""){let c=this.rules.inline.emStrongLDelim.exec(s);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,p=o,m=0,x=c[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(x.lastIndex=0,l=l.slice(-1*s.length+o);(c=x.exec(l))!==null;){if(d=c[1]||c[2]||c[3]||c[4]||c[5]||c[6],!d)continue;if(h=[...d].length,c[3]||c[4]){p+=h;continue}else if((c[5]||c[6])&&o%3&&!((o+h)%3)){m+=h;continue}if(p-=h,p>0)continue;h=Math.min(h,h+p+m);let _=[...c[0]][0].length,j=s.slice(0,o+c.index+_+h);if(Math.min(o,h)%2){let E=j.slice(1,-1);return{type:"em",raw:j,text:E,tokens:this.lexer.inlineTokens(E)}}let v=j.slice(2,-2);return{type:"strong",raw:j,text:v,tokens:this.lexer.inlineTokens(v)}}}}codespan(s){let l=this.rules.inline.code.exec(s);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(s){let l=this.rules.inline.br.exec(s);if(l)return{type:"br",raw:l[0]}}del(s,l,r=""){let c=this.rules.inline.delLDelim.exec(s);if(c&&(!c[1]||!r||this.rules.inline.punctuation.exec(r))){let o=[...c[0]].length-1,d,h,p=o,m=this.rules.inline.delRDelim;for(m.lastIndex=0,l=l.slice(-1*s.length+o);(c=m.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]){p+=h;continue}if(p-=h,p>0)continue;h=Math.min(h,h+p);let x=[...c[0]][0].length,_=s.slice(0,o+c.index+x+h),j=_.slice(o,-o);return{type:"del",raw:_,text:j,tokens:this.lexer.inlineTokens(j)}}}}autolink(s){let l=this.rules.inline.autolink.exec(s);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(s){var r;let l;if(l=this.rules.inline.url.exec(s)){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(s){let l=this.rules.inline.text.exec(s);if(l){let r=this.lexer.state.inRawBlock;return{type:"text",raw:l[0],text:l[0],escaped:r}}}},gs=class Mh{constructor(l){Mt(this,"tokens");Mt(this,"options");Mt(this,"state");Mt(this,"inlineQueue");Mt(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=l||Ii,this.options.tokenizer=this.options.tokenizer||new ef,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:dl,block:Lo.normal,inline:Zc.normal};this.options.pedantic?(r.block=Lo.pedantic,r.inline=Zc.pedantic):this.options.gfm&&(r.block=Lo.gfm,this.options.breaks?r.inline=Zc.breaks:r.inline=Zc.gfm),this.tokenizer.rules=r}static get rules(){return{block:Lo,inline:Zc}}static lex(l,r){return new Mh(r).lex(l)}static lexInline(l,r){return new Mh(r).inlineTokens(l)}lex(l){l=l.replace(dl.carriageReturn,`
|
|
81
|
+
`),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,p;this.tokenizer.lexer=this,this.options.pedantic&&(l=l.replace(dl.tabCharGlobal," ").replace(dl.spaceLine,""));let o=1/0;for(;l;){if(l.length<o)o=l.length;else{this.infiniteLoopError(l.charCodeAt(0));break}let m;if((h=(d=this.options.extensions)==null?void 0:d.block)!=null&&h.some(_=>(m=_.call({lexer:this},l,r))?(l=l.substring(m.raw.length),r.push(m),!0):!1))continue;if(m=this.tokenizer.space(l)){l=l.substring(m.raw.length);let _=r.at(-1);m.raw.length===1&&_!==void 0?_.raw+=`
|
|
82
|
+
`:r.push(m);continue}if(m=this.tokenizer.code(l)){l=l.substring(m.raw.length);let _=r.at(-1);(_==null?void 0:_.type)==="paragraph"||(_==null?void 0:_.type)==="text"?(_.raw+=(_.raw.endsWith(`
|
|
83
|
+
`)?"":`
|
|
84
|
+
`)+m.raw,_.text+=`
|
|
85
|
+
`+m.text,this.inlineQueue.at(-1).src=_.text):r.push(m);continue}if(m=this.tokenizer.fences(l)){l=l.substring(m.raw.length),r.push(m);continue}if(m=this.tokenizer.heading(l)){l=l.substring(m.raw.length),r.push(m);continue}if(m=this.tokenizer.hr(l)){l=l.substring(m.raw.length),r.push(m);continue}if(m=this.tokenizer.blockquote(l)){l=l.substring(m.raw.length),r.push(m);continue}if(m=this.tokenizer.list(l)){l=l.substring(m.raw.length),r.push(m);continue}if(m=this.tokenizer.html(l)){l=l.substring(m.raw.length),r.push(m);continue}if(m=this.tokenizer.def(l)){l=l.substring(m.raw.length);let _=r.at(-1);(_==null?void 0:_.type)==="paragraph"||(_==null?void 0:_.type)==="text"?(_.raw+=(_.raw.endsWith(`
|
|
86
|
+
`)?"":`
|
|
87
|
+
`)+m.raw,_.text+=`
|
|
88
|
+
`+m.raw,this.inlineQueue.at(-1).src=_.text):this.tokens.links[m.tag]||(this.tokens.links[m.tag]={href:m.href,title:m.title},r.push(m));continue}if(m=this.tokenizer.table(l)){l=l.substring(m.raw.length),r.push(m);continue}if(m=this.tokenizer.lheading(l)){l=l.substring(m.raw.length),r.push(m);continue}let x=l;if((p=this.options.extensions)!=null&&p.startBlock){let _=1/0,j=l.slice(1),v;this.options.extensions.startBlock.forEach(E=>{v=E.call({lexer:this},j),typeof v=="number"&&v>=0&&(_=Math.min(_,v))}),_<1/0&&_>=0&&(x=l.substring(0,_+1))}if(this.state.top&&(m=this.tokenizer.paragraph(x))){let _=r.at(-1);c&&(_==null?void 0:_.type)==="paragraph"?(_.raw+=(_.raw.endsWith(`
|
|
89
|
+
`)?"":`
|
|
90
|
+
`)+m.raw,_.text+=`
|
|
91
|
+
`+m.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=_.text):r.push(m),c=x.length!==l.length,l=l.substring(m.raw.length);continue}if(m=this.tokenizer.text(l)){l=l.substring(m.raw.length);let _=r.at(-1);(_==null?void 0:_.type)==="text"?(_.raw+=(_.raw.endsWith(`
|
|
92
|
+
`)?"":`
|
|
93
|
+
`)+m.raw,_.text+=`
|
|
94
|
+
`+m.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=_.text):r.push(m);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 p,m,x,_,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,E=>v.includes(E.slice(E.lastIndexOf("[")+1,-1))?"["+"a".repeat(E.length-2)+"]":E))}c=c.replace(this.tokenizer.rules.inline.anyPunctuation,"++"),c=c.replace(this.tokenizer.rules.inline.blockSkip,(v,E,k)=>{let O=k?k.length:0;return v.slice(0,O)+"["+"a".repeat(v.length-O-2)+"]"}),c=((m=(p=this.options.hooks)==null?void 0:p.emStrongMask)==null?void 0:m.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((_=(x=this.options.extensions)==null?void 0:x.inline)!=null&&_.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 E=l;if((j=this.options.extensions)!=null&&j.startInline){let k=1/0,O=l.slice(1),z;this.options.extensions.startInline.forEach(ee=>{z=ee.call({lexer:this},O),typeof z=="number"&&z>=0&&(k=Math.min(k,z))}),k<1/0&&k>=0&&(E=l.substring(0,k+1))}if(v=this.tokenizer.inlineText(E)){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)}},tf=class{constructor(s){Mt(this,"options");Mt(this,"parser");this.options=s||Ii}space(s){return""}code({text:s,lang:l,escaped:r}){var d;let c=(d=(l||"").match(dl.notSpaceStart))==null?void 0:d[0],o=s.replace(dl.endingNewline,"")+`
|
|
95
|
+
`;return c?'<pre><code class="language-'+Ds(c)+'">'+(r?o:Ds(o,!0))+`</code></pre>
|
|
96
|
+
`:"<pre><code>"+(r?o:Ds(o,!0))+`</code></pre>
|
|
97
|
+
`}blockquote({tokens:s}){return`<blockquote>
|
|
98
|
+
${this.parser.parse(s)}</blockquote>
|
|
99
|
+
`}html({text:s}){return s}def(s){return""}heading({tokens:s,depth:l}){return`<h${l}>${this.parser.parseInline(s)}</h${l}>
|
|
100
|
+
`}hr(s){return`<hr>
|
|
101
|
+
`}list(s){let l=s.ordered,r=s.start,c="";for(let h=0;h<s.items.length;h++){let p=s.items[h];c+=this.listitem(p)}let o=l?"ol":"ul",d=l&&r!==1?' start="'+r+'"':"";return"<"+o+d+`>
|
|
102
|
+
`+c+"</"+o+`>
|
|
103
|
+
`}listitem(s){return`<li>${this.parser.parse(s.tokens)}</li>
|
|
104
|
+
`}checkbox({checked:s}){return"<input "+(s?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:s}){return`<p>${this.parser.parseInline(s)}</p>
|
|
105
|
+
`}table(s){let l="",r="";for(let o=0;o<s.header.length;o++)r+=this.tablecell(s.header[o]);l+=this.tablerow({text:r});let c="";for(let o=0;o<s.rows.length;o++){let d=s.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>
|
|
106
|
+
<thead>
|
|
107
|
+
`+l+`</thead>
|
|
108
|
+
`+c+`</table>
|
|
109
|
+
`}tablerow({text:s}){return`<tr>
|
|
110
|
+
${s}</tr>
|
|
111
|
+
`}tablecell(s){let l=this.parser.parseInline(s.tokens),r=s.header?"th":"td";return(s.align?`<${r} align="${s.align}">`:`<${r}>`)+l+`</${r}>
|
|
112
|
+
`}strong({tokens:s}){return`<strong>${this.parser.parseInline(s)}</strong>`}em({tokens:s}){return`<em>${this.parser.parseInline(s)}</em>`}codespan({text:s}){return`<code>${Ds(s,!0)}</code>`}br(s){return"<br>"}del({tokens:s}){return`<del>${this.parser.parseInline(s)}</del>`}link({href:s,title:l,tokens:r}){let c=this.parser.parseInline(r),o=yb(s);if(o===null)return c;s=o;let d='<a href="'+s+'"';return l&&(d+=' title="'+Ds(l)+'"'),d+=">"+c+"</a>",d}image({href:s,title:l,text:r,tokens:c}){c&&(r=this.parser.parseInline(c,this.parser.textRenderer));let o=yb(s);if(o===null)return Ds(r);s=o;let d=`<img src="${s}" alt="${Ds(r)}"`;return l&&(d+=` title="${Ds(l)}"`),d+=">",d}text(s){return"tokens"in s&&s.tokens?this.parser.parseInline(s.tokens):"escaped"in s&&s.escaped?s.text:Ds(s.text)}},Jh=class{strong({text:s}){return s}em({text:s}){return s}codespan({text:s}){return s}del({text:s}){return s}html({text:s}){return s}text({text:s}){return s}link({text:s}){return""+s}image({text:s}){return""+s}br(){return""}checkbox({raw:s}){return s}},bs=class Oh{constructor(l){Mt(this,"options");Mt(this,"renderer");Mt(this,"textRenderer");this.options=l||Ii,this.options.renderer=this.options.renderer||new tf,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Jh}static parse(l,r){return new Oh(r).parse(l)}static parseInline(l,r){return new Oh(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 m=h,x=this.options.extensions.renderers[m.type].call({parser:this},m);if(x!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(m.type)){r+=x||"";continue}}let p=h;switch(p.type){case"space":{r+=this.renderer.space(p);break}case"hr":{r+=this.renderer.hr(p);break}case"heading":{r+=this.renderer.heading(p);break}case"code":{r+=this.renderer.code(p);break}case"table":{r+=this.renderer.table(p);break}case"blockquote":{r+=this.renderer.blockquote(p);break}case"list":{r+=this.renderer.list(p);break}case"checkbox":{r+=this.renderer.checkbox(p);break}case"html":{r+=this.renderer.html(p);break}case"def":{r+=this.renderer.def(p);break}case"paragraph":{r+=this.renderer.paragraph(p);break}case"text":{r+=this.renderer.text(p);break}default:{let m='Token with "'+p.type+'" type was not found.';if(this.options.silent)return console.error(m),"";throw new Error(m)}}}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 p=l[h];if((d=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&d[p.type]){let x=this.options.extensions.renderers[p.type].call({parser:this},p);if(x!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(p.type)){c+=x||"";continue}}let m=p;switch(m.type){case"escape":{c+=r.text(m);break}case"html":{c+=r.html(m);break}case"link":{c+=r.link(m);break}case"image":{c+=r.image(m);break}case"checkbox":{c+=r.checkbox(m);break}case"strong":{c+=r.strong(m);break}case"em":{c+=r.em(m);break}case"codespan":{c+=r.codespan(m);break}case"br":{c+=r.br(m);break}case"del":{c+=r.del(m);break}case"text":{c+=r.text(m);break}default:{let x='Token with "'+m.type+'" type was not found.';if(this.options.silent)return console.error(x),"";throw new Error(x)}}}return c}},Qo,lu=(Qo=class{constructor(s){Mt(this,"options");Mt(this,"block");this.options=s||Ii}preprocess(s){return s}postprocess(s){return s}processAllTokens(s){return s}emStrongMask(s){return s}provideLexer(s=this.block){return s?gs.lex:gs.lexInline}provideParser(s=this.block){return s?bs.parse:bs.parseInline}},Mt(Qo,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),Mt(Qo,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Qo),gv=class{constructor(...s){Mt(this,"defaults",Yh());Mt(this,"options",this.setOptions);Mt(this,"parse",this.parseMarkdown(!0));Mt(this,"parseInline",this.parseMarkdown(!1));Mt(this,"Parser",bs);Mt(this,"Renderer",tf);Mt(this,"TextRenderer",Jh);Mt(this,"Lexer",gs);Mt(this,"Tokenizer",ef);Mt(this,"Hooks",lu);this.use(...s)}walkTokens(s,l){var c,o;let r=[];for(let d of s)switch(r=r.concat(l.call(this,d)),d.type){case"table":{let h=d;for(let p of h.header)r=r.concat(this.walkTokens(p.tokens,l));for(let p of h.rows)for(let m of p)r=r.concat(this.walkTokens(m.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(p=>{let m=h[p].flat(1/0);r=r.concat(this.walkTokens(m,l))}):h.tokens&&(r=r.concat(this.walkTokens(h.tokens,l)))}}return r}use(...s){let l=this.defaults.extensions||{renderers:{},childTokens:{}};return s.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 p=o.renderer.apply(this,h);return p===!1&&(p=d.apply(this,h)),p}: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 tf(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,p=r.renderer[h],m=o[h];o[h]=(...x)=>{let _=p.apply(o,x);return _===!1&&(_=m.apply(o,x)),_||""}}c.renderer=o}if(r.tokenizer){let o=this.defaults.tokenizer||new ef(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,p=r.tokenizer[h],m=o[h];o[h]=(...x)=>{let _=p.apply(o,x);return _===!1&&(_=m.apply(o,x)),_}}c.tokenizer=o}if(r.hooks){let o=this.defaults.hooks||new lu;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,p=r.hooks[h],m=o[h];lu.passThroughHooks.has(d)?o[h]=x=>{if(this.defaults.async&&lu.passThroughHooksRespectAsync.has(d))return(async()=>{let j=await p.call(o,x);return m.call(o,j)})();let _=p.call(o,x);return m.call(o,_)}:o[h]=(...x)=>{if(this.defaults.async)return(async()=>{let j=await p.apply(o,x);return j===!1&&(j=await m.apply(o,x)),j})();let _=p.apply(o,x);return _===!1&&(_=m.apply(o,x)),_}}c.hooks=o}if(r.walkTokens){let o=this.defaults.walkTokens,d=r.walkTokens;c.walkTokens=function(h){let p=[];return p.push(d.call(this,h)),o&&(p=p.concat(o.call(this,h))),p}}this.defaults={...this.defaults,...c}}),this}setOptions(s){return this.defaults={...this.defaults,...s},this}lexer(s,l){return gs.lex(s,l??this.defaults)}parser(s,l){return bs.parse(s,l??this.defaults)}parseMarkdown(s){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=s),o.async)return(async()=>{let h=o.hooks?await o.hooks.preprocess(l):l,p=await(o.hooks?await o.hooks.provideLexer(s):s?gs.lex:gs.lexInline)(h,o),m=o.hooks?await o.hooks.processAllTokens(p):p;o.walkTokens&&await Promise.all(this.walkTokens(m,o.walkTokens));let x=await(o.hooks?await o.hooks.provideParser(s):s?bs.parse:bs.parseInline)(m,o);return o.hooks?await o.hooks.postprocess(x):x})().catch(d);try{o.hooks&&(l=o.hooks.preprocess(l));let h=(o.hooks?o.hooks.provideLexer(s):s?gs.lex:gs.lexInline)(l,o);o.hooks&&(h=o.hooks.processAllTokens(h)),o.walkTokens&&this.walkTokens(h,o.walkTokens);let p=(o.hooks?o.hooks.provideParser(s):s?bs.parse:bs.parseInline)(h,o);return o.hooks&&(p=o.hooks.postprocess(p)),p}catch(h){return d(h)}}}onError(s,l){return r=>{if(r.message+=`
|
|
113
|
+
Please report this to https://github.com/markedjs/marked.`,s){let c="<p>An error occurred:</p><pre>"+Ds(r.message+"",!0)+"</pre>";return l?Promise.resolve(c):c}if(l)return Promise.reject(r);throw r}}},Bi=new gv;function vt(s,l){return Bi.parse(s,l)}vt.options=vt.setOptions=function(s){return Bi.setOptions(s),vt.defaults=Bi.defaults,qx(vt.defaults),vt};vt.getDefaults=Yh;vt.defaults=Ii;vt.use=function(...s){return Bi.use(...s),vt.defaults=Bi.defaults,qx(vt.defaults),vt};vt.walkTokens=function(s,l){return Bi.walkTokens(s,l)};vt.parseInline=Bi.parseInline;vt.Parser=bs;vt.parser=bs.parse;vt.Renderer=tf;vt.TextRenderer=Jh;vt.Lexer=gs;vt.lexer=gs.lex;vt.Tokenizer=ef;vt.Hooks=lu;vt.parse=vt;vt.options;vt.setOptions;vt.use;vt.walkTokens;vt.parseInline;bs.parse;gs.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 jb(s,l){(l==null||l>s.length)&&(l=s.length);for(var r=0,c=Array(l);r<l;r++)c[r]=s[r];return c}function bv(s){if(Array.isArray(s))return s}function xv(s,l){var r=s==null?null:typeof Symbol<"u"&&s[Symbol.iterator]||s["@@iterator"];if(r!=null){var c,o,d,h,p=[],m=!0,x=!1;try{if(d=(r=r.call(s)).next,l!==0)for(;!(m=(c=d.call(r)).done)&&(p.push(c.value),p.length!==l);m=!0);}catch(_){x=!0,o=_}finally{try{if(!m&&r.return!=null&&(h=r.return(),Object(h)!==h))return}finally{if(x)throw o}}return p}}function yv(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
114
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _v(s,l){return bv(s)||xv(s,l)||vv(s,l)||yv()}function vv(s,l){if(s){if(typeof s=="string")return jb(s,l);var r={}.toString.call(s).slice(8,-1);return r==="Object"&&s.constructor&&(r=s.constructor.name),r==="Map"||r==="Set"?Array.from(s):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?jb(s,l):void 0}}const Jx=Object.entries,kb=Object.setPrototypeOf,Sv=Object.isFrozen,jv=Object.getPrototypeOf,kv=Object.getOwnPropertyDescriptor;let nl=Object.freeze,ll=Object.seal,Rr=Object.create,Wx=typeof Reflect<"u"&&Reflect,Dh=Wx.apply,Lh=Wx.construct;nl||(nl=function(l){return l});ll||(ll=function(l){return l});Dh||(Dh=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)});Lh||(Lh=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 Er=wn(Array.prototype.forEach),wv=wn(Array.prototype.lastIndexOf),wb=wn(Array.prototype.pop),Ar=wn(Array.prototype.push),Nv=wn(Array.prototype.splice),Ja=Array.isArray,su=wn(String.prototype.toLowerCase),dh=wn(String.prototype.toString),Nb=wn(String.prototype.match),Kc=wn(String.prototype.replace),Tb=wn(String.prototype.indexOf),Tv=wn(String.prototype.trim),Ev=wn(Number.prototype.toString),Av=wn(Boolean.prototype.toString),Eb=typeof BigInt>"u"?null:wn(BigInt.prototype.toString),Ab=typeof Symbol>"u"?null:wn(Symbol.prototype.toString),$n=wn(Object.prototype.hasOwnProperty),Fc=wn(Object.prototype.toString),Vn=wn(RegExp.prototype.test),Ni=Cv(TypeError);function wn(s){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 Dh(s,l,c)}}function Cv(s){return function(){for(var l=arguments.length,r=new Array(l),c=0;c<l;c++)r[c]=arguments[c];return Lh(s,r)}}function ot(s,l){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:su;if(kb&&kb(s,null),!Ja(l))return s;let c=l.length;for(;c--;){let o=l[c];if(typeof o=="string"){const d=r(o);d!==o&&(Sv(l)||(l[c]=d),o=d)}s[o]=!0}return s}function Rv(s){for(let l=0;l<s.length;l++)$n(s,l)||(s[l]=null);return s}function yl(s){const l=Rr(null);for(const c of Jx(s)){var r=_v(c,2);const o=r[0],d=r[1];$n(s,o)&&(Ja(d)?l[o]=Rv(d):d&&typeof d=="object"&&d.constructor===Object?l[o]=yl(d):l[o]=d)}return l}function Mv(s){switch(typeof s){case"string":return s;case"number":return Ev(s);case"boolean":return Av(s);case"bigint":return Eb?Eb(s):"0";case"symbol":return Ab?Ab(s):"Symbol()";case"undefined":return Fc(s);case"function":case"object":{if(s===null)return Fc(s);const l=s,r=Ls(l,"toString");if(typeof r=="function"){const c=r(l);return typeof c=="string"?c:Fc(c)}return Fc(s)}default:return Fc(s)}}function Ls(s,l){for(;s!==null;){const c=kv(s,l);if(c){if(c.get)return wn(c.get);if(typeof c.value=="function")return wn(c.value)}s=jv(s)}function r(){return null}return r}function Ov(s){try{return Vn(s,""),!0}catch{return!1}}const Cb=nl(["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"]),hh=nl(["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"]),ph=nl(["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"]),Dv=nl(["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"]),mh=nl(["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"]),Lv=nl(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Rb=nl(["#text"]),Mb=nl(["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"]),gh=nl(["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"]),Ob=nl(["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"]),zo=nl(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),zv=ll(/{{[\w\W]*|^[\w\W]*}}/g),Uv=ll(/<%[\w\W]*|^[\w\W]*%>/g),Hv=ll(/\${[\w\W]*/g),Bv=ll(/^data-[\-\w.\u00B7-\uFFFF]+$/),Iv=ll(/^aria-[\-\w]+$/),Db=ll(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),qv=ll(/^(?:\w+script|data):/i),Gv=ll(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Yv=ll(/^html$/i),Xv=ll(/^[a-z][.\w]*(-[.\w]+)+$/i),Lb=ll(/<[/\w!]/g),zb=ll(/<[/\w]/g),Vv=ll(/<\/no(script|embed|frames)/i),$v=ll(/\/>/i),Xl={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Qv=function(){return typeof window>"u"?null:window},Zv=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}},Ub=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},$a=function(l,r,c,o){return $n(l,r)&&Ja(l[r])?ot(o.base?yl(o.base):{},l[r],o.transform):c};function Px(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Qv();const l=me=>Px(me);if(l.version="3.4.12",l.removed=[],!s||!s.document||s.document.nodeType!==Xl.document||!s.Element)return l.isSupported=!1,l;let r=s.document;const c=r,o=c.currentScript;s.DocumentFragment;const d=s.HTMLTemplateElement,h=s.Node,p=s.Element,m=s.NodeFilter,x=s.NamedNodeMap;x===void 0&&(s.NamedNodeMap||s.MozNamedAttrMap),s.HTMLFormElement;const _=s.DOMParser,j=s.trustedTypes,v=p.prototype,E=Ls(v,"cloneNode"),k=Ls(v,"remove"),O=Ls(v,"nextSibling"),z=Ls(v,"childNodes"),ee=Ls(v,"parentNode"),te=Ls(v,"shadowRoot"),K=Ls(v,"attributes"),M=h&&h.prototype?Ls(h.prototype,"nodeType"):null,F=h&&h.prototype?Ls(h.prototype,"nodeName"):null;if(typeof d=="function"){const me=r.createElement("template");me.content&&me.content.ownerDocument&&(r=me.content.ownerDocument)}let H,A="",Z,ae=!1,G=0;const J=function(){if(G>0)throw Ni('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.')},D=function(N){J(),G++;try{return H.createHTML(N)}finally{G--}},ge=function(N){J(),G++;try{return H.createScriptURL(N)}finally{G--}},Se=function(){return ae||(Z=Zv(j,o),ae=!0),Z},xe=r,B=xe.implementation,ue=xe.createNodeIterator,se=xe.createDocumentFragment,be=xe.getElementsByTagName,Ce=c.importNode;let w=Ub();l.isSupported=typeof Jx=="function"&&typeof ee=="function"&&B&&B.createHTMLDocument!==void 0;const Q=zv,re=Uv,oe=Hv,ye=Bv,je=Iv,Me=qv,ht=Gv,lt=Xv;let Nn=Db,Je=null;const Kt=ot({},[...Cb,...hh,...ph,...mh,...Rb]);let ct=null;const rn=ot({},[...Mb,...gh,...Ob,...zo]);let Be=Object.seal(Rr(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}})),rt=null,Hn=null;const wt=Object.seal(Rr(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ot=!0,Ft=!0,tn=!1,$t=!0,Nt=!1,Qe=!0,We=!1,dn=!1,Jt=null,Qt=null,Bn=!1,Tn=!1,hn=!1,sl=!1,zt=!0,bt=!1;const Ut="user-content-";let $e=!0,Qn=!1,W={},de=null;const we=ot({},["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 L=null;const V=ot({},["audio","video","img","source","image","track"]);let _e=null;const ze=ot({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),st="http://www.w3.org/1998/Math/MathML",al="http://www.w3.org/2000/svg",Pe="http://www.w3.org/1999/xhtml";let En=Pe,In=!1,$l=null;const da=ot({},[st,al,Pe],dh),qs=nl(["mi","mo","mn","ms","mtext"]);let Ll=ot({},qs);const qn=nl(["annotation-xml"]);let pl=ot({},qn);const nn=ot({},["title","style","font","a","script"]);let _l=null;const Gn=["application/xhtml+xml","text/html"],Ht="text/html";let Ze=null,ln=null;const is=r.createElement("form"),An=function(N){return N instanceof RegExp||N instanceof Function},Cn=function(){let N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ln&&ln===N)return;(!N||typeof N!="object")&&(N={}),N=yl(N),_l=Gn.indexOf(N.PARSER_MEDIA_TYPE)===-1?Ht:N.PARSER_MEDIA_TYPE,Ze=_l==="application/xhtml+xml"?dh:su,Je=$a(N,"ALLOWED_TAGS",Kt,{transform:Ze}),ct=$a(N,"ALLOWED_ATTR",rn,{transform:Ze}),$l=$a(N,"ALLOWED_NAMESPACES",da,{transform:dh}),_e=$a(N,"ADD_URI_SAFE_ATTR",ze,{transform:Ze,base:ze}),L=$a(N,"ADD_DATA_URI_TAGS",V,{transform:Ze,base:V}),de=$a(N,"FORBID_CONTENTS",we,{transform:Ze}),rt=$a(N,"FORBID_TAGS",yl({}),{transform:Ze}),Hn=$a(N,"FORBID_ATTR",yl({}),{transform:Ze}),W=$n(N,"USE_PROFILES")?N.USE_PROFILES&&typeof N.USE_PROFILES=="object"?yl(N.USE_PROFILES):N.USE_PROFILES:!1,Ot=N.ALLOW_ARIA_ATTR!==!1,Ft=N.ALLOW_DATA_ATTR!==!1,tn=N.ALLOW_UNKNOWN_PROTOCOLS||!1,$t=N.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Nt=N.SAFE_FOR_TEMPLATES||!1,Qe=N.SAFE_FOR_XML!==!1,We=N.WHOLE_DOCUMENT||!1,Tn=N.RETURN_DOM||!1,hn=N.RETURN_DOM_FRAGMENT||!1,sl=N.RETURN_TRUSTED_TYPE||!1,Bn=N.FORCE_BODY||!1,zt=N.SANITIZE_DOM!==!1,bt=N.SANITIZE_NAMED_PROPS||!1,$e=N.KEEP_CONTENT!==!1,Qn=N.IN_PLACE||!1,Nn=Ov(N.ALLOWED_URI_REGEXP)?N.ALLOWED_URI_REGEXP:Db,En=typeof N.NAMESPACE=="string"?N.NAMESPACE:Pe,Ll=$n(N,"MATHML_TEXT_INTEGRATION_POINTS")&&N.MATHML_TEXT_INTEGRATION_POINTS&&typeof N.MATHML_TEXT_INTEGRATION_POINTS=="object"?yl(N.MATHML_TEXT_INTEGRATION_POINTS):ot({},qs),pl=$n(N,"HTML_INTEGRATION_POINTS")&&N.HTML_INTEGRATION_POINTS&&typeof N.HTML_INTEGRATION_POINTS=="object"?yl(N.HTML_INTEGRATION_POINTS):ot({},qn);const I=$n(N,"CUSTOM_ELEMENT_HANDLING")&&N.CUSTOM_ELEMENT_HANDLING&&typeof N.CUSTOM_ELEMENT_HANDLING=="object"?yl(N.CUSTOM_ELEMENT_HANDLING):Rr(null);if(Be=Rr(null),$n(I,"tagNameCheck")&&An(I.tagNameCheck)&&(Be.tagNameCheck=I.tagNameCheck),$n(I,"attributeNameCheck")&&An(I.attributeNameCheck)&&(Be.attributeNameCheck=I.attributeNameCheck),$n(I,"allowCustomizedBuiltInElements")&&typeof I.allowCustomizedBuiltInElements=="boolean"&&(Be.allowCustomizedBuiltInElements=I.allowCustomizedBuiltInElements),ll(Be),Nt&&(Ft=!1),hn&&(Tn=!0),W&&(Je=ot({},Rb),ct=Rr(null),W.html===!0&&(ot(Je,Cb),ot(ct,Mb)),W.svg===!0&&(ot(Je,hh),ot(ct,gh),ot(ct,zo)),W.svgFilters===!0&&(ot(Je,ph),ot(ct,gh),ot(ct,zo)),W.mathMl===!0&&(ot(Je,mh),ot(ct,Ob),ot(ct,zo))),wt.tagCheck=null,wt.attributeCheck=null,$n(N,"ADD_TAGS")&&(typeof N.ADD_TAGS=="function"?wt.tagCheck=N.ADD_TAGS:Ja(N.ADD_TAGS)&&(Je===Kt&&(Je=yl(Je)),ot(Je,N.ADD_TAGS,Ze))),$n(N,"ADD_ATTR")&&(typeof N.ADD_ATTR=="function"?wt.attributeCheck=N.ADD_ATTR:Ja(N.ADD_ATTR)&&(ct===rn&&(ct=yl(ct)),ot(ct,N.ADD_ATTR,Ze))),$n(N,"ADD_URI_SAFE_ATTR")&&Ja(N.ADD_URI_SAFE_ATTR)&&ot(_e,N.ADD_URI_SAFE_ATTR,Ze),$n(N,"FORBID_CONTENTS")&&Ja(N.FORBID_CONTENTS)&&(de===we&&(de=yl(de)),ot(de,N.FORBID_CONTENTS,Ze)),$n(N,"ADD_FORBID_CONTENTS")&&Ja(N.ADD_FORBID_CONTENTS)&&(de===we&&(de=yl(de)),ot(de,N.ADD_FORBID_CONTENTS,Ze)),$e&&(Je["#text"]=!0),We&&ot(Je,["html","head","body"]),Je.table&&(ot(Je,["tbody"]),delete rt.tbody),N.TRUSTED_TYPES_POLICY){if(typeof N.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ni('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof N.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ni('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const fe=H;H=N.TRUSTED_TYPES_POLICY;try{A=D("")}catch(Ne){throw H=fe,Ne}}else N.TRUSTED_TYPES_POLICY===null?(H=void 0,A=""):(H===void 0&&(H=Se()),H&&typeof A=="string"&&(A=D("")));nl&&nl(N),ln=N},zl=ot({},[...hh,...ph,...Dv]),vl=ot({},[...mh,...Lv]),ys=function(N,I,fe){return I.namespaceURI===Pe?N==="svg":I.namespaceURI===st?N==="svg"&&(fe==="annotation-xml"||Ll[fe]):!!zl[N]},It=function(N,I,fe){return I.namespaceURI===Pe?N==="math":I.namespaceURI===al?N==="math"&&pl[fe]:!!vl[N]},Ql=function(N,I,fe){return I.namespaceURI===al&&!pl[fe]||I.namespaceURI===st&&!Ll[fe]?!1:!vl[N]&&(nn[N]||!zl[N])},Zl=function(N){let I=ee(N);(!I||!I.tagName)&&(I={namespaceURI:En,tagName:"template"});const fe=su(N.tagName),Ne=su(I.tagName);return $l[N.namespaceURI]?N.namespaceURI===al?ys(fe,I,Ne):N.namespaceURI===st?It(fe,I,Ne):N.namespaceURI===Pe?Ql(fe,I,Ne):!!(_l==="application/xhtml+xml"&&$l[N.namespaceURI]):!1},pn=function(N){Ar(l.removed,{element:N});try{ee(N).removeChild(N)}catch{if(k(N),!ee(N))throw Ni("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Tt=function(N){cn(N);const I=z(N);if(I){const Ne=[];Er(I,Oe=>{Ar(Ne,Oe)}),Er(Ne,Oe=>{try{k(Oe)}catch{}})}const fe=K(N);if(fe)for(let Ne=fe.length-1;Ne>=0;--Ne){const Oe=fe[Ne],Ue=Oe&&Oe.name;if(typeof Ue=="string")try{N.removeAttribute(Ue)}catch{}}},Yn=function(N,I){try{Ar(l.removed,{attribute:I.getAttributeNode(N),from:I})}catch{Ar(l.removed,{attribute:null,from:I})}if(I.removeAttribute(N),N==="is")if(Tn||hn)try{pn(I)}catch{}else try{I.setAttribute(N,"")}catch{}},Gs=function(N){const I=K(N);if(I)for(let fe=I.length-1;fe>=0;--fe){const Ne=I[fe],Oe=Ne&&Ne.name;if(!(typeof Oe!="string"||ct[Ze(Oe)]))try{N.removeAttribute(Oe)}catch{}}},cn=function(N){const I=[N];for(;I.length>0;){const fe=I.pop();(M?M(fe):fe.nodeType)===Xl.element&&Gs(fe);const Oe=z(fe);if(Oe)for(let Ue=Oe.length-1;Ue>=0;--Ue)I.push(Oe[Ue])}},T=function(N){if(!Qe)return;const I=[N];for(;I.length>0;){const fe=I.pop(),Ne=M?M(fe):fe.nodeType;if(Ne===Xl.processingInstruction||Ne===Xl.comment&&Vn(zb,fe.data)){try{k(fe)}catch{}continue}if(Ne===Xl.element){const Ue=fe,Et=Ze(F?F(fe):fe.nodeName);try{Ue.hasAttribute&&Ue.hasAttribute("patchsrc")&&Ue.removeAttribute("patchsrc"),Ue.hasAttribute&&Ue.hasAttribute("for")&&Et!=="label"&&Et!=="output"&&Ue.removeAttribute("for")}catch{}}const Oe=z(fe);if(Oe)for(let Ue=Oe.length-1;Ue>=0;--Ue)I.push(Oe[Ue])}},he=function(N){let I=null,fe=null;if(Bn)N="<remove></remove>"+N;else{const Ue=Nb(N,/^[\r\n\t ]+/);fe=Ue&&Ue[0]}_l==="application/xhtml+xml"&&En===Pe&&(N='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+N+"</body></html>");const Ne=H?D(N):N;if(En===Pe)try{I=new _().parseFromString(Ne,_l)}catch{}if(!I||!I.documentElement){I=B.createDocument(En,"template",null);try{I.documentElement.innerHTML=In?A:Ne}catch{}}const Oe=I.body||I.documentElement;return N&&fe&&Oe.insertBefore(r.createTextNode(fe),Oe.childNodes[0]||null),En===Pe?be.call(I,We?"html":"body")[0]:We?I.documentElement:Oe},Ge=function(N){return ue.call(N.ownerDocument||N,N,m.SHOW_ELEMENT|m.SHOW_COMMENT|m.SHOW_TEXT|m.SHOW_PROCESSING_INSTRUCTION|m.SHOW_CDATA_SECTION,null)},pt=function(N){return N=Kc(N,Q," "),N=Kc(N,re," "),N=Kc(N,oe," "),N},un=function(N){var I;N.normalize();const fe=ue.call(N.ownerDocument||N,N,m.SHOW_TEXT|m.SHOW_COMMENT|m.SHOW_CDATA_SECTION|m.SHOW_PROCESSING_INSTRUCTION,null);let Ne=fe.nextNode();for(;Ne;)Ne.data=pt(Ne.data),Ne=fe.nextNode();const Oe=(I=N.querySelectorAll)===null||I===void 0?void 0:I.call(N,"template");Oe&&Er(Oe,Ue=>{il(Ue.content)&&un(Ue.content)})},ml=function(N){const I=F?F(N):null;return typeof I!="string"||Ze(I)!=="form"?!1:typeof N.nodeName!="string"||typeof N.textContent!="string"||typeof N.removeChild!="function"||N.attributes!==K(N)||typeof N.removeAttribute!="function"||typeof N.setAttribute!="function"||typeof N.namespaceURI!="string"||typeof N.insertBefore!="function"||typeof N.hasChildNodes!="function"||N.nodeType!==M(N)||N.childNodes!==z(N)},il=function(N){if(!M||typeof N!="object"||N===null)return!1;try{return M(N)===Xl.documentFragment}catch{return!1}},mn=function(N){if(!M||typeof N!="object"||N===null)return!1;try{return typeof M(N)=="number"}catch{return!1}};function xt(me,N,I){me.length!==0&&Er(me,fe=>{fe.call(l,N,I,ln)})}const rl=function(N,I){return!!(Qe&&N.hasChildNodes()&&!mn(N.firstElementChild)&&Vn(Lb,N.textContent)&&Vn(Lb,N.innerHTML)||Qe&&N.namespaceURI===Pe&&I==="style"&&mn(N.firstElementChild)||N.nodeType===Xl.processingInstruction||Qe&&N.nodeType===Xl.comment&&Vn(zb,N.data))},ha=function(N,I){if(!rt[I]&&_s(I)&&(Be.tagNameCheck instanceof RegExp&&Vn(Be.tagNameCheck,I)||Be.tagNameCheck instanceof Function&&Be.tagNameCheck(I)))return!1;if($e&&!de[I]){const fe=ee(N),Ne=z(N);if(Ne&&fe){const Oe=Ne.length;for(let Ue=Oe-1;Ue>=0;--Ue){const Et=Qn?Ne[Ue]:E(Ne[Ue],!0);fe.insertBefore(Et,O(N))}}}return pn(N),!0},Sl=function(N,I){if(xt(w.beforeSanitizeElements,N,null),N!==I&&ee(N)===null)return!0;if(ml(N))return pn(N),!0;const fe=Ze(F?F(N):N.nodeName);if(xt(w.uponSanitizeElement,N,{tagName:fe,allowedTags:Je}),N!==I&&ee(N)===null)return!0;if(rl(N,fe))return pn(N),!0;if(rt[fe]||!(wt.tagCheck instanceof Function&&wt.tagCheck(fe))&&!Je[fe]){const Oe=ha(N,fe);return Oe===!1&&xt(w.afterSanitizeElements,N,null),Oe}if((M?M(N):N.nodeType)===Xl.element&&!Zl(N)||(fe==="noscript"||fe==="noembed"||fe==="noframes")&&Vn(Vv,N.innerHTML))return pn(N),!0;if(Nt&&N.nodeType===Xl.text){const Oe=pt(N.textContent);N.textContent!==Oe&&(Ar(l.removed,{element:N.cloneNode()}),N.textContent=Oe)}return xt(w.afterSanitizeElements,N,null),!1},ti=function(N,I,fe){if(Hn[I]||Qe&&I==="patchsrc"||Qe&&I==="for"&&N!=="label"&&N!=="output"||zt&&(I==="id"||I==="name")&&(fe in r||fe in is))return!1;const Ne=ct[I]||wt.attributeCheck instanceof Function&&wt.attributeCheck(I,N);if(!(Ft&&Vn(ye,I))){if(!(Ot&&Vn(je,I))){if(Ne){if(!_e[I]){if(!Vn(Nn,Kc(fe,ht,""))){if(!((I==="src"||I==="xlink:href"||I==="href")&&N!=="script"&&Tb(fe,"data:")===0&&L[N])){if(!(tn&&!Vn(Me,Kc(fe,ht,"")))){if(fe)return!1}}}}}else if(!(_s(N)&&(Be.tagNameCheck instanceof RegExp&&Vn(Be.tagNameCheck,N)||Be.tagNameCheck instanceof Function&&Be.tagNameCheck(N))&&(Be.attributeNameCheck instanceof RegExp&&Vn(Be.attributeNameCheck,I)||Be.attributeNameCheck instanceof Function&&Be.attributeNameCheck(I,N))||I==="is"&&Be.allowCustomizedBuiltInElements&&(Be.tagNameCheck instanceof RegExp&&Vn(Be.tagNameCheck,fe)||Be.tagNameCheck instanceof Function&&Be.tagNameCheck(fe))))return!1}}return!0},gl=ot({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),_s=function(N){return!gl[su(N)]&&Vn(lt,N)},Rn=function(N,I,fe,Ne){if(H&&typeof j=="object"&&typeof j.getAttributeType=="function"&&!fe)switch(j.getAttributeType(N,I)){case"TrustedHTML":return D(Ne);case"TrustedScriptURL":return ge(Ne)}return Ne},rs=function(N,I,fe,Ne){try{fe?N.setAttributeNS(fe,I,Ne):N.setAttribute(I,Ne),ml(N)?pn(N):wb(l.removed)}catch{Yn(I,N)}},vs=function(N){xt(w.beforeSanitizeAttributes,N,null);const I=N.attributes;if(!I||ml(N))return;const fe={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ct,forceKeepAttr:void 0};let Ne=I.length;const Oe=Ze(N.nodeName);for(;Ne--;){const Ue=I[Ne],Et=Ue.name,Wt=Ue.namespaceURI,gn=Ue.value,Dt=Ze(Et),bn=gn;let Bt=Et==="value"?bn:Tv(bn);if(fe.attrName=Dt,fe.attrValue=Bt,fe.keepAttr=!0,fe.forceKeepAttr=void 0,xt(w.uponSanitizeAttribute,N,fe),Bt=fe.attrValue,bt&&(Dt==="id"||Dt==="name")&&Tb(Bt,Ut)!==0&&(Yn(Et,N),Bt=Ut+Bt),Qe&&Vn(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Bt)){Yn(Et,N);continue}if(Dt==="attributename"&&Nb(Bt,"href")){Yn(Et,N);continue}if(!fe.forceKeepAttr){if(!fe.keepAttr){Yn(Et,N);continue}if(!$t&&Vn($v,Bt)){Yn(Et,N);continue}if(Nt&&(Bt=pt(Bt)),!ti(Oe,Dt,Bt)){Yn(Et,N);continue}Bt=Rn(Oe,Dt,Wt,Bt),Bt!==bn&&rs(N,Et,Wt,Bt)}}xt(w.afterSanitizeAttributes,N,null)},Ss=function(N){let I=null;const fe=Ge(N);for(xt(w.beforeSanitizeShadowDOM,N,null);I=fe.nextNode();)if(xt(w.uponSanitizeShadowNode,I,null),Sl(I,N),vs(I),il(I.content)&&Ss(I.content),(M?M(I):I.nodeType)===Xl.element){const Oe=te(I);il(Oe)&&(jl(Oe),Ss(Oe))}xt(w.afterSanitizeShadowDOM,N,null)},jl=function(N){const I=[{node:N,shadow:null}];for(;I.length>0;){const fe=I.pop();if(fe.shadow){Ss(fe.shadow);continue}const Ne=fe.node,Ue=(M?M(Ne):Ne.nodeType)===Xl.element,Et=z(Ne);if(Et)for(let Wt=Et.length-1;Wt>=0;--Wt)I.push({node:Et[Wt],shadow:null});if(Ue){const Wt=F?F(Ne):null;if(typeof Wt=="string"&&Ze(Wt)==="template"){const gn=Ne.content;il(gn)&&I.push({node:gn,shadow:null})}}if(Ue){const Wt=te(Ne);il(Wt)&&I.push({node:null,shadow:Wt},{node:Wt,shadow:null})}}};return l.sanitize=function(me){let N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},I=null,fe=null,Ne=null,Oe=null;if(In=!me,In&&(me="<!-->"),typeof me!="string"&&!mn(me)&&(me=Mv(me),typeof me!="string"))throw Ni("dirty is not a string, aborting");if(!l.isSupported)return me;dn?(Je=Jt,ct=Qt):Cn(N),(w.uponSanitizeElement.length>0||w.uponSanitizeAttribute.length>0)&&(Je=yl(Je)),w.uponSanitizeAttribute.length>0&&(ct=yl(ct)),l.removed=[];const Ue=Qn&&typeof me!="string"&&mn(me);if(Ue){T(me);const Dt=F?F(me):me.nodeName;if(typeof Dt=="string"){const bn=Ze(Dt);if(!Je[bn]||rt[bn])throw Tt(me),Ni("root node is forbidden and cannot be sanitized in-place")}if(ml(me))throw Tt(me),Ni("root node is clobbered and cannot be sanitized in-place");try{jl(me)}catch(bn){throw Tt(me),bn}}else if(mn(me))I=he("<!---->"),fe=I.ownerDocument.importNode(me,!0),fe.nodeType===Xl.element&&fe.nodeName==="BODY"||fe.nodeName==="HTML"?I=fe:I.appendChild(fe),jl(fe);else{if(!Tn&&!Nt&&!We&&me.indexOf("<")===-1)return H&&sl?D(me):me;if(I=he(me),!I)return Tn?null:sl?A:""}I&&Bn&&pn(I.firstChild);const Et=Ue?me:I,Wt=Ge(Et);try{for(;Ne=Wt.nextNode();)Sl(Ne,Et),vs(Ne),il(Ne.content)&&Ss(Ne.content)}catch(Dt){throw Ue&&(Tt(me),Er(l.removed,bn=>{bn.element&&cn(bn.element)})),Dt}if(Ue)return Er(l.removed,Dt=>{Dt.element&&cn(Dt.element)}),Nt&&un(me),me;if(Tn){if(Nt&&un(I),hn)for(Oe=se.call(I.ownerDocument);I.firstChild;)Oe.appendChild(I.firstChild);else Oe=I;return(ct.shadowroot||ct.shadowrootmode)&&(Oe=Ce.call(c,Oe,!0)),Oe}let gn=We?I.outerHTML:I.innerHTML;return We&&Je["!doctype"]&&I.ownerDocument&&I.ownerDocument.doctype&&I.ownerDocument.doctype.name&&Vn(Yv,I.ownerDocument.doctype.name)&&(gn="<!DOCTYPE "+I.ownerDocument.doctype.name+`>
|
|
115
|
+
`+gn),Nt&&(gn=pt(gn)),H&&sl?D(gn):gn},l.setConfig=function(){let me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Cn(me),dn=!0,Jt=Je,Qt=ct},l.clearConfig=function(){ln=null,dn=!1,Jt=null,Qt=null,H=Z,A=""},l.isValidAttribute=function(me,N,I){ln||Cn({});const fe=Ze(me),Ne=Ze(N);return ti(fe,Ne,I)},l.addHook=function(me,N){typeof N=="function"&&$n(w,me)&&Ar(w[me],N)},l.removeHook=function(me,N){if($n(w,me)){if(N!==void 0){const I=wv(w[me],N);return I===-1?void 0:Nv(w[me],I,1)[0]}return wb(w[me])}},l.removeHooks=function(me){$n(w,me)&&(w[me]=[])},l.removeAllHooks=function(){w=Ub()},l}var Kv=Px();const Fv=1024;let Jv=0;class as{constructor(l,r){this.from=l,this.to=r}}class Vt{constructor(l={}){this.id=Jv++,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=xs.match(l)),r=>{let c=l(r);return c===void 0?null:[this,c]}}}Vt.closedBy=new Vt({deserialize:s=>s.split(" ")});Vt.openedBy=new Vt({deserialize:s=>s.split(" ")});Vt.group=new Vt({deserialize:s=>s.split(" ")});Vt.isolate=new Vt({deserialize:s=>{if(s&&s!="rtl"&&s!="ltr"&&s!="auto")throw new RangeError("Invalid value for isolate: "+s);return s||"auto"}});Vt.contextHash=new Vt({perNode:!0});Vt.lookAhead=new Vt({perNode:!0});Vt.mounted=new Vt({perNode:!0});class Lr{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[Vt.mounted.id]}}const Wv=Object.create(null);class xs{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):Wv,c=(l.top?1:0)|(l.skipped?2:0)|(l.error?4:0)|(l.name==null?8:0),o=new xs(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(Vt.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(Vt.group),d=-1;d<(o?o.length:0);d++){let h=r[d<0?c.name:o[d]];if(h)return h}}}}xs.none=new xs("",Object.create(null),0,8);class ey{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 p=h[1],m=h[0];m.combine&&m.id in o&&(p=m.combine(o[m.id],p)),o[m.id]=p}}r.push(o?new xs(c.name,o,c.id,c.flags):c)}return new ey(r)}}const Uo=new WeakMap,Hb=new WeakMap;var Yt;(function(s){s[s.ExcludeBuffers=1]="ExcludeBuffers",s[s.IncludeAnonymous=2]="IncludeAnonymous",s[s.IgnoreMounts=4]="IgnoreMounts",s[s.IgnoreOverlays=8]="IgnoreOverlays",s[s.EnterBracketed=16]="EnterBracketed"})(Yt||(Yt={}));class Dl{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,p]of d)this.props[typeof h=="number"?h:h.id]=p}}toString(){let l=Lr.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 nf(this.topNode,l)}cursorAt(l,r=0,c=0){let o=Uo.get(this)||this.topNode,d=new nf(o);return d.moveTo(l,r),Uo.set(this,d._tree),d}get topNode(){return new hl(this,0,0,null)}resolve(l,r=0){let c=ru(Uo.get(this)||this.topNode,l,r,!1);return Uo.set(this,c),c}resolveInner(l,r=0){let c=ru(Hb.get(this)||this.topNode,l,r,!0);return Hb.set(this,c),c}resolveStack(l,r=0){return t1(this,l,r)}iterate(l){let{enter:r,leave:c,from:o=0,to:d=this.length}=l,h=l.mode||0,p=(h&Yt.IncludeAnonymous)>0;for(let m=this.cursor(h|Yt.IncludeAnonymous);;){let x=!1;if(m.from<=d&&m.to>=o&&(!p&&m.type.isAnonymous||r(m)!==!1)){if(m.firstChild())continue;x=!0}for(;x&&c&&(p||!m.type.isAnonymous)&&c(m),!m.nextSibling();){if(!m.parent())return;x=!0}}}prop(l){return l.perNode?this.props?this.props[l.id]:void 0:this.type.prop(l)}get propValues(){let l=[];if(this.props)for(let r in this.props)l.push([+r,this.props[r]]);return l}balance(l={}){return this.children.length<=8?this:ep(xs.none,this.children,this.positions,0,this.children.length,0,this.length,(r,c,o)=>new Dl(this.type,r,c,o,this.propValues),l.makeTree||((r,c,o)=>new Dl(xs.none,r,c,o)))}static build(l){return n1(l)}}Dl.empty=new Dl(xs.none,[],[],0);class Wh{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 Wh(this.buffer,this.index)}}class ei{constructor(l,r,c){this.buffer=l,this.length=r,this.set=c}get type(){return xs.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,p=-1;for(let m=l;m!=r&&!(ty(d,o,h[m+1],h[m+2])&&(p=m,c>0));m=h[m+3]);return p}slice(l,r,c){let o=this.buffer,d=new Uint16Array(r-l),h=0;for(let p=l,m=0;p<r;){d[m++]=o[p++],d[m++]=o[p++]-c;let x=d[m++]=o[p++]-c;d[m++]=o[p++]-l,h=Math.max(h,x)}return new ei(d,h,this.set)}}function ty(s,l,r,c){switch(s){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 ru(s,l,r,c){for(var o;s.from==s.to||(r<1?s.from>=l:s.from>l)||(r>-1?s.to<=l:s.to<l);){let h=!c&&s instanceof hl&&s.index<0?null:s.parent;if(!h)return s;s=h}let d=c?0:Yt.IgnoreOverlays;if(c)for(let h=s,p=h.parent;p;h=p,p=h.parent)h instanceof hl&&h.index<0&&((o=p.enter(l,r,d))===null||o===void 0?void 0:o.from)!=h.from&&(s=p);for(;;){let h=s.enter(l,r,d);if(!h)return s;s=h}}class ny{cursor(l=0){return new nf(this,l)}getChild(l,r=null,c=null){let o=Bb(this,l,r,c);return o.length?o[0]:null}getChildren(l,r=null,c=null){return Bb(this,l,r,c)}resolve(l,r=0){return ru(this,l,r,!1)}resolveInner(l,r=0){return ru(this,l,r,!0)}matchContext(l){return zh(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 hl extends ny{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:p,positions:m}=h._tree,x=r>0?p.length:-1;l!=x;l+=r){let _=p[l],j=m[l]+h.from,v;if(!(!(d&Yt.EnterBracketed&&_ instanceof Dl&&(v=Lr.get(_))&&!v.overlay&&v.bracketed&&c>=j&&c<=j+_.length)&&!ty(o,c,j,j+_.length))){if(_ instanceof ei){if(d&Yt.ExcludeBuffers)continue;let E=_.findChild(0,_.buffer.length,r,c-j,o);if(E>-1)return new Bs(new Pv(h,_,l,j),null,E)}else if(d&Yt.IncludeAnonymous||!_.type.isAnonymous||Ph(_)){let E;if(!(d&Yt.IgnoreMounts)&&(E=Lr.get(_))&&!E.overlay)return new hl(E.tree,j,l,h);let k=new hl(_,j,l,h);return d&Yt.IncludeAnonymous||!k.type.isAnonymous?k:k.nextChild(r<0?_.children.length-1:0,r,c,o,d)}}}if(d&Yt.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&Yt.IgnoreOverlays)&&(o=Lr.get(this._tree))&&o.overlay){let d=l-this.from,h=c&Yt.EnterBracketed&&o.bracketed;for(let{from:p,to:m}of o.overlay)if((r>0||h?p<=d:p<d)&&(r<0||h?m>=d:m>d))return new hl(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 Bb(s,l,r,c){let o=s.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 zh(s,l,r=l.length-1){for(let c=s;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 Pv{constructor(l,r,c,o){this.parent=l,this.buffer=r,this.index=c,this.start=o}}class Bs extends ny{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 Bs(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&Yt.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 Bs(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 Bs(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 Bs(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 Dl(this.type,l,r,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function ly(s){if(!s.length)return null;let l=0,r=s[0];for(let d=1;d<s.length;d++){let h=s[d];(h.from>r.from||h.to<r.to)&&(r=h,l=d)}let c=r instanceof hl&&r.index<0?null:r.parent,o=s.slice();return c?o[l]=c:o.splice(l,1),new e1(o,r)}class e1{constructor(l,r){this.heads=l,this.node=r}get next(){return ly(this.heads)}}function t1(s,l,r){let c=s.resolveInner(l,r),o=null;for(let d=c instanceof hl?c:c.context.parent;d;d=d.parent)if(d.index<0){let h=d.parent;(o||(o=[c])).push(h.resolve(l,r)),d=h}else{let h=Lr.get(d.tree);if(h&&h.overlay&&h.overlay[0].from<=l&&h.overlay[h.overlay.length-1].to>=l){let p=new hl(h.tree,h.overlay[0].from+d.from,-1,d);(o||(o=[c])).push(ru(p,l,r,!1))}}return o?ly(o):c}class nf{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&~Yt.EnterBracketed,l instanceof hl)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 hl?(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&Yt.ExcludeBuffers?!1:this.enterChild(1,l,r):this.yield(this._tree.enter(l,r,c))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Yt.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let l=this.mode&Yt.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 p=c._tree.children[d];if(this.mode&Yt.IncludeAnonymous||p instanceof ei||!p.type.isAnonymous||Ph(p))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 Bs(this.buffer,r,this.stack[o]);return this.bufferNode=new Bs(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 zh(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 zh(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 Ph(s){return s.children.some(l=>l instanceof ei||!l.type.isAnonymous||Ph(l))}function n1(s){var l;let{buffer:r,nodeSet:c,maxBufferLength:o=Fv,reused:d=[],minRepeatType:h=c.types.length}=s,p=Array.isArray(r)?new Wh(r,r.length):r,m=c.types,x=0,_=0;function j(F,H,A,Z,ae,G){let{id:J,start:D,end:ge,size:Se}=p,xe=_,B=x;if(Se<0)if(p.next(),Se==-1){let w=d[J];A.push(w),Z.push(D-F);return}else if(Se==-3){x=J;return}else if(Se==-4){_=J;return}else throw new RangeError(`Unrecognized record size: ${Se}`);let ue=m[J],se,be,Ce=D-F;if(ge-D<=o&&(be=z(p.pos-H,ae))){let w=new Uint16Array(be.size-be.skip),Q=p.pos-be.size,re=w.length;for(;p.pos>Q;)re=ee(be.start,w,re);se=new ei(w,ge-be.start,c),Ce=be.start-F}else{let w=p.pos-Se;p.next();let Q=[],re=[],oe=J>=h?J:-1,ye=0,je=ge;for(;p.pos>w;)oe>=0&&p.id==oe&&p.size>=0?(p.end<=je-o&&(k(Q,re,D,ye,p.end,je,oe,xe,B),ye=Q.length,je=p.end),p.next()):G>2500?v(D,w,Q,re):j(D,w,Q,re,oe,G+1);if(oe>=0&&ye>0&&ye<Q.length&&k(Q,re,D,ye,D,je,oe,xe,B),Q.reverse(),re.reverse(),oe>-1&&ye>0){let Me=E(ue,B);se=ep(ue,Q,re,0,Q.length,0,ge-D,Me,Me)}else se=O(ue,Q,re,ge-D,xe-ge,B)}A.push(se),Z.push(Ce)}function v(F,H,A,Z){let ae=[],G=0,J=-1;for(;p.pos>H;){let{id:D,start:ge,end:Se,size:xe}=p;if(xe>4)p.next();else{if(J>-1&&ge<J)break;J<0&&(J=Se-o),ae.push(D,ge,Se),G++,p.next()}}if(G){let D=new Uint16Array(G*4),ge=ae[ae.length-2];for(let Se=ae.length-3,xe=0;Se>=0;Se-=3)D[xe++]=ae[Se],D[xe++]=ae[Se+1]-ge,D[xe++]=ae[Se+2]-ge,D[xe++]=xe;A.push(new ei(D,ae[2]-ge,c)),Z.push(ge-F)}}function E(F,H){return(A,Z,ae)=>{let G=0,J=A.length-1,D,ge;if(J>=0&&(D=A[J])instanceof Dl){if(!J&&D.type==F&&D.length==ae)return D;(ge=D.prop(Vt.lookAhead))&&(G=Z[J]+D.length+ge)}return O(F,A,Z,ae,G,H)}}function k(F,H,A,Z,ae,G,J,D,ge){let Se=[],xe=[];for(;F.length>Z;)Se.push(F.pop()),xe.push(H.pop()+A-ae);F.push(O(c.types[J],Se,xe,G-ae,D-G,ge)),H.push(ae-A)}function O(F,H,A,Z,ae,G,J){if(G){let D=[Vt.contextHash,G];J=J?[D].concat(J):[D]}if(ae>25){let D=[Vt.lookAhead,ae];J=J?[D].concat(J):[D]}return new Dl(F,H,A,Z,J)}function z(F,H){let A=p.fork(),Z=0,ae=0,G=0,J=A.end-o,D={size:0,start:0,skip:0};e:for(let ge=A.pos-F;A.pos>ge;){let Se=A.size;if(A.id==H&&Se>=0){D.size=Z,D.start=ae,D.skip=G,G+=4,Z+=4,A.next();continue}let xe=A.pos-Se;if(Se<0||xe<ge||A.start<J)break;let B=A.id>=h?4:0,ue=A.start;for(A.next();A.pos>xe;){if(A.size<0)if(A.size==-3||A.size==-4)B+=4;else break e;else A.id>=h&&(B+=4);A.next()}ae=ue,Z+=Se,G+=B}return(H<0||Z==F)&&(D.size=Z,D.start=ae,D.skip=G),D.size>4?D:void 0}function ee(F,H,A){let{id:Z,start:ae,end:G,size:J}=p;if(p.next(),J>=0&&Z<h){let D=A;if(J>4){let ge=p.pos-(J-4);for(;p.pos>ge;)A=ee(F,H,A)}H[--A]=D,H[--A]=G-F,H[--A]=ae-F,H[--A]=Z}else J==-3?x=Z:J==-4&&(_=Z);return A}let te=[],K=[];for(;p.pos>0;)j(s.start||0,s.bufferStart||0,te,K,-1,0);let M=(l=s.length)!==null&&l!==void 0?l:te.length?K[0]+te[0].length:0;return new Dl(m[s.topID],te.reverse(),K.reverse(),M)}const Ib=new WeakMap;function Jo(s,l){if(!s.isAnonymous||l instanceof ei||l.type!=s)return 1;let r=Ib.get(l);if(r==null){r=1;for(let c of l.children){if(c.type!=s||!(c instanceof Dl)){r=1;break}r+=Jo(s,c)}Ib.set(l,r)}return r}function ep(s,l,r,c,o,d,h,p,m){let x=0;for(let k=c;k<o;k++)x+=Jo(s,l[k]);let _=Math.ceil(x*1.5/8),j=[],v=[];function E(k,O,z,ee,te){for(let K=z;K<ee;){let M=K,F=O[K],H=Jo(s,k[K]);for(K++;K<ee;K++){let A=Jo(s,k[K]);if(H+A>=_)break;H+=A}if(K==M+1){if(H>_){let A=k[M];E(A.children,A.positions,0,A.children.length,O[M]+te);continue}j.push(k[M])}else{let A=O[K-1]+k[K-1].length-F;j.push(ep(s,k,O,M,K,F,A,null,m))}v.push(F+te-d)}}return E(l,r,c,o,0),(p||m)(j,v,h)}class Tw{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 Bs?this.setBuffer(l.context.buffer,l.index,r):l instanceof hl&&this.map.set(l.tree,r)}get(l){return l instanceof Bs?this.getBuffer(l.context.buffer,l.index):l instanceof hl?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 cu{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 cu(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 p=0,m=0,x=0;;p++){let _=p<r.length?r[p]:null,j=_?_.fromA:1e9;if(j-m>=c)for(;h&&h.from<j;){let v=h;if(m>=v.from||j<=v.to||x){let E=Math.max(v.from,m)-x,k=Math.min(v.to,j)-x;v=E>=k?null:new cu(E,k,v.tree,v.offset+x,p>0,!!_)}if(v&&o.push(v),h.to>j)break;h=d<l.length?l[d++]:null}if(!_)break;m=_.toA,x=_.toA-_.toB}return o}}class Ew{startParse(l,r,c){return typeof l=="string"&&(l=new l1(l)),c=c?c.length?c.map(o=>new as(o.from,o.to)):[new as(0,0)]:[new as(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 l1{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 Aw(s){return(l,r,c,o)=>new a1(l,s,r,c,o)}class qb{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 Gb(s){if(!s.length||s.some(l=>l.from>=l.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(s))}class s1{constructor(l,r,c,o,d,h,p,m){this.parser=l,this.predicate=r,this.mounts=c,this.index=o,this.start=d,this.bracketed=h,this.target=p,this.prev=m,this.depth=0,this.ranges=[]}}const Uh=new Vt({perNode:!0});class a1{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 Dl(c.type,c.children,c.positions,c.length,c.propValues.concat([[Uh,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[Vt.mounted.id]=new Lr(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 c1(this.fragments),r=null,c=null,o=new nf(new hl(this.baseTree,this.ranges[0].from,0,null),Yt.IncludeAnonymous|Yt.IgnoreMounts);e:for(let d,h;;){let p=!0,m;if(this.stoppedAt!=null&&o.from>=this.stoppedAt)p=!1;else if(l.hasNode(o)){if(r){let x=r.mounts.find(_=>_.frag.from<=o.from&&_.frag.to>=o.to&&_.mount.overlay);if(x)for(let _ of x.mount.overlay){let j=_.from+x.pos,v=_.to+x.pos;j>=o.from&&v<=o.to&&!r.ranges.some(E=>E.from<v&&E.to>j)&&r.ranges.push({from:j,to:v})}}p=!1}else if(c&&(h=i1(c.ranges,o.from,o.to)))p=h!=2;else if(!o.type.isAnonymous&&(d=this.nest(o,this.input))&&(o.from<o.to||!d.overlay)){o.tree||(r1(o),r&&r.depth++,c&&c.depth++);let x=l.findMounts(o.from,d.parser);if(typeof d.overlay=="function")r=new s1(d.parser,d.overlay,x,this.inner.length,o.from,!!d.bracketed,o.tree,r);else{let _=Vb(this.ranges,d.overlay||(o.from<o.to?[new as(o.from,o.to)]:[]));_.length&&Gb(_),(_.length||!d.overlay)&&this.inner.push(new qb(d.parser,_.length?d.parser.startParse(this.input,$b(x,_),_):d.parser.startParse(""),d.overlay?d.overlay.map(j=>new as(j.from-o.from,j.to-o.from)):null,!!d.bracketed,o.tree,_.length?_[0].from:o.from)),d.overlay?_.length&&(c={ranges:_,depth:0,prev:c}):p=!1}}else if(r&&(m=r.predicate(o))&&(m===!0&&(m=new as(o.from,o.to)),m.from<m.to)){let x=r.ranges.length-1;x>=0&&r.ranges[x].to==m.from?r.ranges[x]={from:r.ranges[x].from,to:m.to}:r.ranges.push(m)}if(p&&o.firstChild())r&&r.depth++,c&&c.depth++;else for(;!o.nextSibling();){if(!o.parent())break e;if(r&&!--r.depth){let x=Vb(this.ranges,r.ranges);x.length&&(Gb(x),this.inner.splice(r.index,0,new qb(r.parser,r.parser.startParse(this.input,$b(r.mounts,x),x),r.ranges.map(_=>new as(_.from-r.start,_.to-r.start)),r.bracketed,r.target,x[0].from))),r=r.prev}c&&!--c.depth&&(c=c.prev)}}}}function i1(s,l,r){for(let c of s){if(c.from>=r)break;if(c.to>l)return c.from<=l&&c.to>=r?2:1}return 0}function Yb(s,l,r,c,o,d){if(l<r){let h=s.buffer[l+1];c.push(s.slice(l,r,h)),o.push(h-d)}}function r1(s){let{node:l}=s,r=[],c=l.context.buffer;do r.push(s.index),s.parent();while(!s.tree);let o=s.tree,d=o.children.indexOf(c),h=o.children[d],p=h.buffer,m=[d];function x(_,j,v,E,k,O){let z=r[O],ee=[],te=[];Yb(h,_,z,ee,te,E);let K=p[z+1],M=p[z+2];m.push(ee.length);let F=O?x(z+4,p[z+3],h.set.types[p[z]],K,M-K,O-1):l.toTree();return ee.push(F),te.push(K-E),Yb(h,p[z+3],j,ee,te,E),new Dl(v,ee,te,k)}o.children[d]=x(0,p.length,xs.none,0,h.length,r.length-1);for(let _ of m){let j=s.tree.children[_],v=s.tree.positions[_];s.yield(new hl(j,v+s.from,_,s._tree))}}class Xb{constructor(l,r){this.offset=r,this.done=!1,this.cursor=l.cursor(Yt.IncludeAnonymous|Yt.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,Yt.IgnoreOverlays|Yt.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 Dl)r=r.children[0];else break}return!1}}class c1{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(Uh))!==null&&r!==void 0?r:c.to,this.inner=new Xb(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(Uh))!==null&&l!==void 0?l:r.to,this.inner=new Xb(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(Vt.mounted);if(h&&h.parser==r)for(let p=this.fragI;p<this.fragments.length;p++){let m=this.fragments[p];if(m.from>=d.to)break;m.tree==this.curFrag.tree&&o.push({frag:m,pos:d.from-m.offset,mount:h})}}}return o}}function Vb(s,l){let r=null,c=l;for(let o=1,d=0;o<s.length;o++){let h=s[o-1].to,p=s[o].from;for(;d<c.length;d++){let m=c[d];if(m.from>=p)break;m.to<=h||(r||(c=r=l.slice()),m.from<h?(r[d]=new as(m.from,h),m.to>p&&r.splice(d+1,0,new as(p,m.to))):m.to>p?r[d--]=new as(p,m.to):r.splice(d--,1))}}return c}function u1(s,l,r,c){let o=0,d=0,h=!1,p=!1,m=-1e9,x=[];for(;;){let _=o==s.length?1e9:h?s[o].to:s[o].from,j=d==l.length?1e9:p?l[d].to:l[d].from;if(h!=p){let v=Math.max(m,r),E=Math.min(_,j,c);v<E&&x.push(new as(v,E))}if(m=Math.min(_,j),m==1e9)break;_==m&&(h?(h=!1,o++):h=!0),j==m&&(p?(p=!1,d++):p=!0)}return x}function $b(s,l){let r=[];for(let{pos:c,mount:o,frag:d}of s){let h=c+(o.overlay?o.overlay[0].from:0),p=h+o.tree.length,m=Math.max(d.from,h),x=Math.min(d.to,p);if(o.overlay){let _=o.overlay.map(v=>new as(v.from+c,v.to+c)),j=u1(l,_,m,x);for(let v=0,E=m;;v++){let k=v==j.length,O=k?x:j[v].from;if(O>E&&r.push(new cu(E,O,o.tree,-h,d.from>=E||d.openStart,d.to<=O||d.openEnd)),k)break;E=j[v].to}}else r.push(new cu(m,x,o.tree,-h,d.from>=h||d.openStart,d.to<=p||d.openEnd))}return r}let o1=0;class ss{constructor(l,r,c,o){this.name=l,this.set=r,this.base=c,this.modified=o,this.id=o1++}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 ss&&(r=l),r!=null&&r.base)throw new Error("Can not derive from a modified tag");let o=new ss(c,[],null,[]);if(o.set.push(o),r)for(let d of r.set)o.set.push(d);return o}static defineModifier(l){let r=new lf(l);return c=>c.modified.indexOf(r)>-1?c:lf.get(c.base||c,c.modified.concat(r).sort((o,d)=>o.id-d.id))}}let f1=0;class lf{constructor(l){this.name=l,this.instances=[],this.id=f1++}static get(l,r){if(!r.length)return l;let c=r[0].instances.find(p=>p.base==l&&d1(r,p.modified));if(c)return c;let o=[],d=new ss(l.name,o,l,r);for(let p of r)p.instances.push(d);let h=h1(r);for(let p of l.set)if(!p.modified.length)for(let m of h)o.push(lf.get(p,m));return d}}function d1(s,l){return s.length==l.length&&s.every((r,c)=>r==l[c])}function h1(s){let l=[[]];for(let r=0;r<s.length;r++)for(let c=0,o=l.length;c<o;c++)l.push(l[c].concat(s[r]));return l.sort((r,c)=>c.length-r.length)}function Cw(s){let l=Object.create(null);for(let r in s){let c=s[r];Array.isArray(c)||(c=[c]);for(let o of r.split(" "))if(o){let d=[],h=2,p=o;for(let j=0;;){if(p=="..."&&j>0&&j+3==o.length){h=1;break}let v=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(p);if(!v)throw new RangeError("Invalid path: "+o);if(d.push(v[0]=="*"?"":v[0][0]=='"'?JSON.parse(v[0]):v[0]),j+=v[0].length,j==o.length)break;let E=o[j++];if(j==o.length&&E=="!"){h=0;break}if(E!="/")throw new RangeError("Invalid path: "+o);p=o.slice(j)}let m=d.length-1,x=d[m];if(!x)throw new RangeError("Invalid path: "+o);let _=new uu(c,h,m>0?d.slice(0,m):null);l[x]=_.sort(l[x])}}return sy.add(l)}const sy=new Vt({combine(s,l){let r,c,o;for(;s||l;){if(!s||l&&s.depth>=l.depth?(o=l,l=l.next):(o=s,s=s.next),r&&r.mode==o.mode&&!o.context&&!r.context)continue;let d=new uu(o.tags,o.mode,o.context);r?r.next=d:c=d,r=d}return c}});class uu{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}}uu.empty=new uu([],2,null);function ay(s,l){let r=Object.create(null);for(let d of s)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 p of d)for(let m of p.set){let x=r[m.id];if(x){h=h?h+" "+x:x;break}}return h},scope:c}}function p1(s,l){let r=null;for(let c of s){let o=c.style(l);o&&(r=r?r+" "+o:o)}return r}function m1(s,l,r,c=0,o=s.length){let d=new b1(c,Array.isArray(l)?l:[l],r);d.highlightRange(s.cursor(),c,o,"",d.highlighters),d.flush(o)}function g1(s,l,r,c,o,d=0,h=s.length){let p=d;function m(x,_){if(!(x<=p)){for(let j=s.slice(p,x),v=0;;){let E=j.indexOf(`
|
|
116
|
+
`,v),k=E<0?j.length:E;if(k>v&&c(j.slice(v,k),_),E<0)break;o(),v=E+1}p=x}}m1(l,r,(x,_,j)=>{m(x,""),m(_,j)},d,h),m(h,"")}class b1{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:p,to:m}=l;if(p>=c||m<=r)return;h.isTop&&(d=this.highlighters.filter(E=>!E.scope||E.scope(h)));let x=o,_=x1(l)||uu.empty,j=p1(d,_.tags);if(j&&(x&&(x+=" "),x+=j,_.mode==1&&(o+=(o?" ":"")+j)),this.startSpan(Math.max(r,p),x),_.opaque)return;let v=l.tree&&l.tree.prop(Vt.mounted);if(v&&v.overlay){let E=l.node.enter(v.overlay[0].from+p,1),k=this.highlighters.filter(z=>!z.scope||z.scope(v.tree.type)),O=l.firstChild();for(let z=0,ee=p;;z++){let te=z<v.overlay.length?v.overlay[z]:null,K=te?te.from+p:m,M=Math.max(r,ee),F=Math.min(c,K);if(M<F&&O)for(;l.from<F&&(this.highlightRange(l,M,F,o,d),this.startSpan(Math.min(F,l.to),x),!(l.to>=K||!l.nextSibling())););if(!te||K>c)break;ee=te.to+p,ee>r&&(this.highlightRange(E.cursor(),Math.max(r,te.from+p),Math.min(c,ee),"",k),this.startSpan(Math.min(c,ee),x))}O&&l.parent()}else if(l.firstChild()){v&&(o="");do if(!(l.to<=r)){if(l.from>=c)break;this.highlightRange(l,r,c,o,d),this.startSpan(Math.min(c,l.to),x)}while(l.nextSibling());l.parent()}}}function x1(s){let l=s.type.prop(sy);for(;l&&l.context&&!s.matchContext(l.context);)l=l.next;return l||null}const ve=ss.define,Ho=ve(),Ka=ve(),Qb=ve(Ka),Zb=ve(Ka),Fa=ve(),Bo=ve(Fa),bh=ve(Fa),zs=ve(),Ti=ve(zs),Rs=ve(),Ms=ve(),Hh=ve(),Jc=ve(Hh),Io=ve(),Te={comment:Ho,lineComment:ve(Ho),blockComment:ve(Ho),docComment:ve(Ho),name:Ka,variableName:ve(Ka),typeName:Qb,tagName:ve(Qb),propertyName:Zb,attributeName:ve(Zb),className:ve(Ka),labelName:ve(Ka),namespace:ve(Ka),macroName:ve(Ka),literal:Fa,string:Bo,docString:ve(Bo),character:ve(Bo),attributeValue:ve(Bo),number:bh,integer:ve(bh),float:ve(bh),bool:ve(Fa),regexp:ve(Fa),escape:ve(Fa),color:ve(Fa),url:ve(Fa),keyword:Rs,self:ve(Rs),null:ve(Rs),atom:ve(Rs),unit:ve(Rs),modifier:ve(Rs),operatorKeyword:ve(Rs),controlKeyword:ve(Rs),definitionKeyword:ve(Rs),moduleKeyword:ve(Rs),operator:Ms,derefOperator:ve(Ms),arithmeticOperator:ve(Ms),logicOperator:ve(Ms),bitwiseOperator:ve(Ms),compareOperator:ve(Ms),updateOperator:ve(Ms),definitionOperator:ve(Ms),typeOperator:ve(Ms),controlOperator:ve(Ms),punctuation:Hh,separator:ve(Hh),bracket:Jc,angleBracket:ve(Jc),squareBracket:ve(Jc),paren:ve(Jc),brace:ve(Jc),content:zs,heading:Ti,heading1:ve(Ti),heading2:ve(Ti),heading3:ve(Ti),heading4:ve(Ti),heading5:ve(Ti),heading6:ve(Ti),contentSeparator:ve(zs),list:ve(zs),quote:ve(zs),emphasis:ve(zs),strong:ve(zs),link:ve(zs),monospace:ve(zs),strikethrough:ve(zs),inserted:ve(),deleted:ve(),changed:ve(),invalid:ve(),meta:Io,documentMeta:ve(Io),annotation:ve(Io),processingInstruction:ve(Io),definition:ss.defineModifier("definition"),constant:ss.defineModifier("constant"),function:ss.defineModifier("function"),standard:ss.defineModifier("standard"),local:ss.defineModifier("local"),special:ss.defineModifier("special")};for(let s in Te){let l=Te[s];l instanceof ss&&(l.name=s)}ay([{tag:Te.link,class:"tok-link"},{tag:Te.heading,class:"tok-heading"},{tag:Te.emphasis,class:"tok-emphasis"},{tag:Te.strong,class:"tok-strong"},{tag:Te.keyword,class:"tok-keyword"},{tag:Te.atom,class:"tok-atom"},{tag:Te.bool,class:"tok-bool"},{tag:Te.url,class:"tok-url"},{tag:Te.labelName,class:"tok-labelName"},{tag:Te.inserted,class:"tok-inserted"},{tag:Te.deleted,class:"tok-deleted"},{tag:Te.literal,class:"tok-literal"},{tag:Te.string,class:"tok-string"},{tag:Te.number,class:"tok-number"},{tag:[Te.regexp,Te.escape,Te.special(Te.string)],class:"tok-string2"},{tag:Te.variableName,class:"tok-variableName"},{tag:Te.local(Te.variableName),class:"tok-variableName tok-local"},{tag:Te.definition(Te.variableName),class:"tok-variableName tok-definition"},{tag:Te.special(Te.variableName),class:"tok-variableName2"},{tag:Te.definition(Te.propertyName),class:"tok-propertyName tok-definition"},{tag:Te.typeName,class:"tok-typeName"},{tag:Te.namespace,class:"tok-namespace"},{tag:Te.className,class:"tok-className"},{tag:Te.macroName,class:"tok-macroName"},{tag:Te.propertyName,class:"tok-propertyName"},{tag:Te.operator,class:"tok-operator"},{tag:Te.comment,class:"tok-comment"},{tag:Te.meta,class:"tok-meta"},{tag:Te.invalid,class:"tok-invalid"},{tag:Te.punctuation,class:"tok-punctuation"}]);const y1="modulepreload",_1=function(s,l){return new URL(s,l).href},Kb={},Ve=function(l,r,c){let o=Promise.resolve();if(r&&r.length>0){let h=function(_){return Promise.all(_.map(j=>Promise.resolve(j).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};const p=document.getElementsByTagName("link"),m=document.querySelector("meta[property=csp-nonce]"),x=(m==null?void 0:m.nonce)||(m==null?void 0:m.getAttribute("nonce"));o=h(r.map(_=>{if(_=_1(_,c),_ in Kb)return;Kb[_]=!0;const j=_.endsWith(".css"),v=j?'[rel="stylesheet"]':"";if(!!c)for(let O=p.length-1;O>=0;O--){const z=p[O];if(z.href===_&&(!j||z.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${_}"]${v}`))return;const k=document.createElement("link");if(k.rel=j?"stylesheet":y1,j||(k.as="script"),k.crossOrigin="",k.href=_,x&&k.setAttribute("nonce",x),document.head.appendChild(k),j)return new Promise((O,z)=>{k.addEventListener("load",O),k.addEventListener("error",()=>z(new Error(`Unable to preload CSS for ${_}`)))})}))}function d(h){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=h,window.dispatchEvent(p),!p.defaultPrevented)throw h}return o.then(h=>{for(const p of h||[])p.status==="rejected"&&d(p.reason);return l().catch(d)})},iy={js:async()=>(await Ve(async()=>{const{javascript:s}=await import("./index-DM4oBLe8.js");return{javascript:s}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({jsx:!0}),cjs:async()=>(await Ve(async()=>{const{javascript:s}=await import("./index-DM4oBLe8.js");return{javascript:s}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript(),mjs:async()=>(await Ve(async()=>{const{javascript:s}=await import("./index-DM4oBLe8.js");return{javascript:s}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript(),jsx:async()=>(await Ve(async()=>{const{javascript:s}=await import("./index-DM4oBLe8.js");return{javascript:s}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({jsx:!0}),ts:async()=>(await Ve(async()=>{const{javascript:s}=await import("./index-DM4oBLe8.js");return{javascript:s}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),mts:async()=>(await Ve(async()=>{const{javascript:s}=await import("./index-DM4oBLe8.js");return{javascript:s}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),cts:async()=>(await Ve(async()=>{const{javascript:s}=await import("./index-DM4oBLe8.js");return{javascript:s}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),tsx:async()=>(await Ve(async()=>{const{javascript:s}=await import("./index-DM4oBLe8.js");return{javascript:s}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0,jsx:!0}),json:async()=>(await Ve(async()=>{const{json:s}=await import("./index-DXYp3jsl.js");return{json:s}},__vite__mapDeps([6,1,2,3,4]),import.meta.url)).json(),jsonc:async()=>(await Ve(async()=>{const{json:s}=await import("./index-DXYp3jsl.js");return{json:s}},__vite__mapDeps([6,1,2,3,4]),import.meta.url)).json(),css:async()=>(await Ve(async()=>{const{css:s}=await import("./index-Buinfinc.js");return{css:s}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),scss:async()=>(await Ve(async()=>{const{css:s}=await import("./index-Buinfinc.js");return{css:s}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),less:async()=>(await Ve(async()=>{const{css:s}=await import("./index-Buinfinc.js");return{css:s}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),html:async()=>(await Ve(async()=>{const{html:s}=await import("./index-rekQBGDD.js");return{html:s}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),htm:async()=>(await Ve(async()=>{const{html:s}=await import("./index-rekQBGDD.js");return{html:s}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),vue:async()=>(await Ve(async()=>{const{html:s}=await import("./index-rekQBGDD.js");return{html:s}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),svelte:async()=>(await Ve(async()=>{const{html:s}=await import("./index-rekQBGDD.js");return{html:s}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),md:async()=>(await Ve(async()=>{const{markdown:s}=await import("./index-BednlsnR.js");return{markdown:s}},__vite__mapDeps([9,3,4,2,5,8,1,7,0]),import.meta.url)).markdown(),markdown:async()=>(await Ve(async()=>{const{markdown:s}=await import("./index-BednlsnR.js");return{markdown:s}},__vite__mapDeps([9,3,4,2,5,8,1,7,0]),import.meta.url)).markdown(),py:async()=>(await Ve(async()=>{const{python:s}=await import("./index-CNdrabZC.js");return{python:s}},__vite__mapDeps([10,1,2,3,4,5]),import.meta.url)).python(),pyi:async()=>(await Ve(async()=>{const{python:s}=await import("./index-CNdrabZC.js");return{python:s}},__vite__mapDeps([10,1,2,3,4,5]),import.meta.url)).python(),yaml:async()=>(await Ve(async()=>{const{yaml:s}=await import("./index-CQlHFJzv.js");return{yaml:s}},__vite__mapDeps([11,1,2,3,4]),import.meta.url)).yaml(),yml:async()=>(await Ve(async()=>{const{yaml:s}=await import("./index-CQlHFJzv.js");return{yaml:s}},__vite__mapDeps([11,1,2,3,4]),import.meta.url)).yaml(),rs:async()=>(await Ve(async()=>{const{rust:s}=await import("./index-CPLRJruN.js");return{rust:s}},__vite__mapDeps([12,1,2,3,4]),import.meta.url)).rust(),c:async()=>(await Ve(async()=>{const{cpp:s}=await import("./index-DJPI4hL4.js");return{cpp:s}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),h:async()=>(await Ve(async()=>{const{cpp:s}=await import("./index-DJPI4hL4.js");return{cpp:s}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),cc:async()=>(await Ve(async()=>{const{cpp:s}=await import("./index-DJPI4hL4.js");return{cpp:s}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),cpp:async()=>(await Ve(async()=>{const{cpp:s}=await import("./index-DJPI4hL4.js");return{cpp:s}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),hpp:async()=>(await Ve(async()=>{const{cpp:s}=await import("./index-DJPI4hL4.js");return{cpp:s}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),java:async()=>(await Ve(async()=>{const{java:s}=await import("./index-CBtC705w.js");return{java:s}},__vite__mapDeps([14,1,2,3,4]),import.meta.url)).java(),go:async()=>(await Ve(async()=>{const{go:s}=await import("./index-DJN6swZl.js");return{go:s}},__vite__mapDeps([15,1,2,3,4,5]),import.meta.url)).go(),php:async()=>(await Ve(async()=>{const{php:s}=await import("./index-BiJkY5lu.js");return{php:s}},__vite__mapDeps([16,1,8,7,2,3,4,0,5]),import.meta.url)).php(),sql:async()=>(await Ve(async()=>{const{sql:s}=await import("./index-DG-5rv4t.js");return{sql:s}},__vite__mapDeps([17,2,3,4,1,5]),import.meta.url)).sql(),xml:async()=>(await Ve(async()=>{const{xml:s}=await import("./index-CmXpz6wO.js");return{xml:s}},__vite__mapDeps([18,1,2,3,4]),import.meta.url)).xml(),svg:async()=>(await Ve(async()=>{const{xml:s}=await import("./index-CmXpz6wO.js");return{xml:s}},__vite__mapDeps([18,1,2,3,4]),import.meta.url)).xml()},v1={".mcp.json":"json",dockerfile:"yaml",makefile:"yaml"},S1={javascript:"js",node:"js",typescript:"ts",python:"py",python3:"py",yml:"yaml",rust:"rs",golang:"go","c++":"cpp",cplusplus:"cpp"};async function j1(s){const l=S1[s.toLowerCase()]??s.toLowerCase(),r=iy[l];return r?r().catch(()=>null):null}async function k1(s){const l=(s.split("/").pop()??"").toLowerCase(),r=v1[l]??l.split(".").pop()??"",c=iy[r];return c?c().catch(()=>null):null}const w1=ay([{tag:[Te.keyword,Te.modifier,Te.controlKeyword,Te.moduleKeyword],class:"cmh-key"},{tag:[Te.propertyName],class:"cmh-prop"},{tag:[Te.function(Te.variableName),Te.labelName],class:"cmh-fn"},{tag:[Te.color,Te.constant(Te.name),Te.standard(Te.name),Te.bool],class:"cmh-const"},{tag:[Te.typeName,Te.className,Te.changed,Te.annotation,Te.self,Te.namespace],class:"cmh-type"},{tag:[Te.number,Te.integer,Te.float],class:"cmh-num"},{tag:[Te.string,Te.special(Te.string),Te.regexp],class:"cmh-str"},{tag:[Te.operator,Te.operatorKeyword,Te.escape],class:"cmh-op"},{tag:[Te.meta,Te.comment],class:"cmh-comment"},{tag:Te.invalid,class:"cmh-invalid"}]);function qo(s){return s.replace(/[&<>]/g,l=>l==="&"?"&":l==="<"?"<":">")}async function N1(s,l){const r=l?await j1(l):null;if(!r)return qo(s);try{const c=r.language.parser.parse(s);let o="";return g1(s,c,w1,(d,h)=>{o+=h?`<span class="${h}">${qo(d)}</span>`:qo(d)},()=>{o+=`
|
|
117
|
+
`}),o}catch{return qo(s)}}vt.setOptions({gfm:!0,breaks:!1});function ry(s){var r;const l=(r=s.split(".").pop())==null?void 0:r.toLowerCase();return l==="md"||l==="markdown"}async function tp(s){const l=await vt.parse(s,{async:!0,walkTokens:async r=>{if(r.type!=="code")return;const c=r;c.text=await N1(c.text,c.lang??""),c.escaped=!0}});return Kv.sanitize(l)}function Fb(s,l){return{path:s.path,text:s.content,saved:s.content,eol:s.eol,encoding:s.encoding,mtime:s.mtime,size:s.size,binary:s.binary,tooLarge:s.tooLarge,mediaMime:s.mediaMime,mediaTooLarge:s.mediaTooLarge,stale:!1,revision:l,previewMode:ry(s.path)}}function ca(s){return!s.binary&&!s.tooLarge&&s.text!==s.saved}function T1(s){return s.split("/").pop()??s}function Ui(s){const l=s.lastIndexOf("/");return l===-1?"":s.slice(0,l)}function Wo(s){return s<1024?`${s} Б`:s<1024*1024?`${(s/1024).toFixed(1)} КБ`:`${(s/1024/1024).toFixed(1)} МБ`}function Mr({x:s,y:l,items:r,note:c,onClose:o}){const d=y.useRef(null),[h,p]=y.useState({left:s,top:l}),[m,x]=y.useState(()=>{const v=r.findIndex(E=>!E.disabled);return v===-1?0:v});y.useLayoutEffect(()=>{const v=d.current;if(!v)return;const E=v.getBoundingClientRect(),k=8,O=Math.max(k,Math.min(s,window.innerWidth-E.width-k)),z=Math.max(k,Math.min(l,window.innerHeight-E.height-k));p({left:O,top:z})},[s,l]),y.useLayoutEffect(()=>{var v;(v=d.current)==null||v.focus()},[]),y.useLayoutEffect(()=>{function v(k){var O;(O=d.current)!=null&&O.contains(k.target)||o()}function E(){o()}return document.addEventListener("mousedown",v),document.addEventListener("scroll",E,!0),()=>{document.removeEventListener("mousedown",v),document.removeEventListener("scroll",E,!0)}},[o]);function _(v){v.disabled||(v.onSelect(),o())}function j(v){if(v.key==="Escape"){v.preventDefault(),v.stopPropagation(),o();return}const E=r.map((k,O)=>({item:k,index:O})).filter(k=>!k.item.disabled);if(E.length!==0){if(v.key==="ArrowDown"||v.key==="ArrowUp"){v.preventDefault();const k=v.key==="ArrowDown"?1:-1,O=E.findIndex(ee=>ee.index===m),z=E[(((O===-1?0:O)+k)%E.length+E.length)%E.length];z&&x(z.index);return}if(v.key==="Enter"||v.key===" "){v.preventDefault();const k=r[m];k&&_(k)}}}return i.jsxs("div",{ref:d,className:"ctxmenu",style:{left:h.left,top:h.top},role:"menu",tabIndex:-1,onKeyDown:j,children:[c&&i.jsx("div",{className:"ctxmenu__note",children:c}),r.map((v,E)=>i.jsxs("button",{type:"button",role:"menuitem","aria-disabled":v.disabled,className:"ctxmenu__item"+(E===m?" is-cursor":""),onMouseEnter:()=>x(E),onClick:()=>_(v),children:[i.jsx("span",{className:"ctxmenu__label",children:v.label}),v.hint&&i.jsx("span",{className:"ctxmenu__hint",children:v.hint})]},v.id))]})}const E1=3500,A1=9e3,Jb=220;function qi({result:s,onDismiss:l}){const[r,c]=y.useState(s),[o,d]=y.useState(!1);if(y.useEffect(()=>{if(!s){c(null),d(!1);return}if(c(s),d(!1),s.url)return;const p=s.ok?E1:A1,m=setTimeout(()=>d(!0),p),x=setTimeout(()=>c(null),p+Jb);return()=>{clearTimeout(m),clearTimeout(x)}},[s]),!r)return null;const h=()=>{d(!0),setTimeout(()=>{c(null),l==null||l()},Jb)};return i.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&&i.jsxs("a",{className:"oplog__link",href:r.url,target:"_blank",rel:"noreferrer",onClick:p=>p.stopPropagation(),children:[r.url.replace(/^https?:\/\//,"")," ↗"]}),r.url&&l&&i.jsx("button",{type:"button",className:"oplog__dismiss",title:"Закрыть","aria-label":"Закрыть сообщение",onClick:h,children:"✕"})]})}function fa({value:s,className:l,placeholder:r="Название сессии",onCommit:c,onCancel:o}){const[d,h]=y.useState(s),p=y.useRef(null);y.useEffect(()=>{var x;(x=p.current)==null||x.select()},[]);function m(){const x=d.trim();if(!x||x===s)return o();c(x)}return i.jsx("input",{ref:p,className:l?`rename ${l}`:"rename",value:d,autoFocus:!0,spellCheck:!1,placeholder:r,onChange:x=>h(x.target.value),onBlur:m,onKeyDown:x=>{x.stopPropagation(),x.key==="Enter"?(x.preventDefault(),m()):x.key==="Escape"&&(x.preventDefault(),o())}})}function Zr({active:s}){return s?i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M2 5h3V2"}),i.jsx("path",{d:"M14 5h-3V2"}),i.jsx("path",{d:"M2 11h3v3"}),i.jsx("path",{d:"M14 11h-3v3"})]}):i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M5 2H2v3"}),i.jsx("path",{d:"M11 2h3v3"}),i.jsx("path",{d:"M2 11v3h3"}),i.jsx("path",{d:"M14 11v3h-3"})]})}const C1=500,Ei="application/x-ccv-fs-path",R1=200;function M1({open:s,tree:l,expanded:r,activePath:c,dirty:o,gitChanges:d,result:h,searchResult:p,onSearch:m,onReveal:x,onToggle:_,onOpen:j,onCreate:v,onRename:E,onMove:k,onCopy:O,onDelete:z,onRefresh:ee,onClose:te,zoomed:K,onToggleZoom:M}){const[F,H]=y.useState(""),[A,Z]=y.useState(null),[ae,G]=y.useState(null),[J,D]=y.useState(null),[ge,Se]=y.useState(null),[xe,B]=y.useState(null),[ue,se]=y.useState(null),be=uf("(hover: hover)"),Ce=y.useRef(null),w=y.useMemo(()=>L1(d),[d]);function Q(W){return!(!J||W===J.path||J.kind==="dir"&&W.startsWith(`${J.path}/`)||W===Ui(J.path))}function re(W){return!(!xe||W===xe.path||xe.kind==="dir"&&W.startsWith(`${xe.path}/`)||xe.mode==="cut"&&W===Ui(xe.path))}function oe(W){B({path:W.path,kind:W.kind,mode:"copy"})}function ye(W){B({path:W.path,kind:W.kind,mode:"cut"})}function je(W){!xe||!re(W)||(W&&!r.has(W)&&_(W),xe.mode==="cut"?(k(xe.path,W),B(null)):O(xe.path,W))}function Me(W,de){const we=W.touches[0];if(!we)return;const L={timer:0,x:we.clientX,y:we.clientY,el:W.currentTarget,fired:!1};L.timer=window.setTimeout(()=>{L.fired=!0,de(L.x,L.y,L.el)},C1),Ce.current=L}function ht(W){const de=Ce.current,we=W.touches[0];!de||!we||Math.hypot(we.clientX-de.x,we.clientY-de.y)>10&&(window.clearTimeout(de.timer),Ce.current=null)}function lt(W){const de=Ce.current;de&&(window.clearTimeout(de.timer),de.fired&&W.preventDefault())}function Nn(){var W;return(W=Ce.current)!=null&&W.fired?(Ce.current=null,!0):!1}function Je(W,de,we,L){H((L==null?void 0:L.path)??""),se({x:W,y:de,opener:we,entry:L})}function Kt(){const W=ue==null?void 0:ue.opener;se(null),W!=null&&W.isConnected&&W.focus()}function ct(W){return{onContextMenu:de=>{de.preventDefault(),Je(de.clientX,de.clientY,de.currentTarget,W)},onTouchStart:de=>Me(de,(we,L,V)=>Je(we,L,V,W)),onTouchMove:ht,onTouchEnd:lt,onTouchCancel:lt}}function rn(W){W.target===W.currentTarget&&(W.preventDefault(),Je(W.clientX,W.clientY,W.currentTarget,null))}function Be(W){W.target===W.currentTarget&&Me(W,(de,we,L)=>Je(de,we,L,null))}function rt(W){if(!(W.ctrlKey||W.metaKey)||W.target instanceof HTMLInputElement)return;const de=W.key.toLowerCase();if(de==="v"){W.preventDefault(),je(sl());return}if(!F)return;const we=Wb(l,F);we&&(de==="c"?(W.preventDefault(),oe(we)):de==="x"&&(W.preventDefault(),ye(we)))}function Hn(W){return de=>{de.dataTransfer.effectAllowed="move",de.dataTransfer.setData(Ei,W.path),D({path:W.path,kind:W.kind})}}function wt(){D(null),Se(null)}function Ot(W){return de=>{de.dataTransfer.types.includes(Ei)&&(de.stopPropagation(),!(W.kind!=="dir"||!Q(W.path))&&(de.preventDefault(),Se(W.path)))}}function Ft(W){return de=>{if(!de.dataTransfer.types.includes(Ei)||(de.stopPropagation(),W.kind!=="dir"||!Q(W.path)))return;de.preventDefault();const we=de.dataTransfer.getData(Ei);Se(null),we&&k(we,W.path)}}function tn(W){!W.dataTransfer.types.includes(Ei)||!Q("")||(W.preventDefault(),Se(""))}function $t(W){if(!W.dataTransfer.types.includes(Ei)||!Q(""))return;W.preventDefault();const de=W.dataTransfer.getData(Ei);Se(null),de&&k(de,"")}const[Nt,Qe]=y.useState(""),We=Nt.trim(),dn=We.length>0,Jt=y.useRef(null),Qt=y.useRef(m);Qt.current=m;function Bn(W){Qe(W),Jt.current&&clearTimeout(Jt.current);const de=W.trim();if(!de){Qt.current("");return}Jt.current=setTimeout(()=>Qt.current(de),R1)}function Tn(W){Jt.current&&clearTimeout(Jt.current),Qe(""),Qt.current(""),H(W.path),x(W)}const hn=dn&&(p==null?void 0:p.query)===We?p:null;function sl(){if(F==="")return"";const W=Wb(l,F);if((W==null?void 0:W.kind)==="dir")return F;const de=F.lastIndexOf("/");return de===-1?"":F.slice(0,de)}function zt(W,de){const we=de??sl();we&&!r.has(we)&&_(we),G({parent:we,kind:W})}function bt(){if(!ue)return[];const W=L=>be?L:void 0;if(!ue.entry)return[{id:"paste",label:"Вставить в корень проекта",hint:W("Ctrl+V"),disabled:!re(""),onSelect:()=>je("")},{id:"new-file",label:"Создать файл",onSelect:()=>zt("file","")},{id:"new-dir",label:"Создать каталог",onSelect:()=>zt("dir","")}];const de=ue.entry,we=[de.kind==="file"?{id:"open",label:"Открыть",onSelect:()=>j(de.path)}:{id:"toggle",label:r.has(de.path)?"Свернуть":"Развернуть",onSelect:()=>_(de.path)},{id:"copy",label:"Копировать",hint:W("Ctrl+C"),onSelect:()=>oe(de)},{id:"cut",label:"Вырезать",hint:W("Ctrl+X"),onSelect:()=>ye(de)}];return de.kind==="dir"&&(we.push({id:"paste",label:"Вставить",hint:W("Ctrl+V"),disabled:!re(de.path),onSelect:()=>je(de.path)}),we.push({id:"new-file",label:"Создать файл",onSelect:()=>zt("file",de.path)}),we.push({id:"new-dir",label:"Создать каталог",onSelect:()=>zt("dir",de.path)})),we.push({id:"rename",label:"Переименовать",onSelect:()=>Z(de.path)}),we.push({id:"delete",label:"Удалить",onSelect:()=>z(de)}),we}const Ut=dn?[]:$e("",0);function $e(W,de){const we=l[W],L=[];if(ae&&ae.parent===W&&L.push(i.jsxs("div",{className:"fsrow fsrow--draft",style:ua(de),children:[i.jsx("span",{className:"fsrow__icon",children:ae.kind==="dir"?i.jsx(af,{}):i.jsx(rf,{})}),i.jsx(fa,{className:"rename--file",value:"",placeholder:ae.kind==="dir"?"имя каталога":"имя файла",onCommit:V=>{G(null),v(W,ae.kind,V)},onCancel:()=>G(null)})]},`draft:${W}`)),!we)return L.push(i.jsx("p",{className:"fsrow__pending",style:ua(de),children:"читаем…"},`wait:${W}`)),L;we.length===0&&!ae&&L.push(i.jsx("p",{className:"fsrow__pending",style:ua(de),children:"пусто"},`empty:${W}`));for(const V of we){const _e=V.kind==="dir"&&r.has(V.path);L.push(A===V.path?i.jsxs("div",{className:"fsrow fsrow--draft",style:ua(de),children:[i.jsx("span",{className:"fsrow__icon",children:V.kind==="dir"?i.jsx(af,{open:_e}):i.jsx(rf,{})}),i.jsx(fa,{className:"rename--file",value:V.name,placeholder:"новое имя",onCommit:ze=>{Z(null),E(V.path,ze)},onCancel:()=>Z(null)})]},V.path):i.jsx(O1,{entry:V,depth:de,open:_e,active:V.path===c,selected:V.path===F,dirty:o.has(V.path),gitStatus:w.get(V.path),dragging:(J==null?void 0:J.path)===V.path,dropTarget:ge===V.path,cut:(xe==null?void 0:xe.mode)==="cut"&&xe.path===V.path,onClick:()=>{Nn()||(H(V.path),V.kind==="dir"?_(V.path):j(V.path))},onRename:()=>Z(V.path),onDelete:()=>z(V),onDragStart:Hn(V),onDragEnd:wt,onDragOver:Ot(V),onDrop:Ft(V),...ct(V)},V.path)),_e&&L.push(...$e(V.path,de+1))}return L}function Qn(){if(!hn)return[i.jsx("p",{className:"fsrow__pending",style:ua(0),children:"ищем…"},"search:wait")];if(hn.entries.length===0)return[i.jsx("p",{className:"fsrow__pending",style:ua(0),children:"ничего не найдено"},"search:empty")];const W=hn.entries.map(de=>i.jsx(D1,{entry:de,gitStatus:w.get(de.path),onClick:()=>Tn(de)},de.path));return hn.truncated&&W.push(i.jsxs("p",{className:"fsrow__pending",style:ua(0),children:["показаны первые ",hn.entries.length," — уточните запрос"]},"search:truncated")),W}return i.jsxs("aside",{className:(s?"sidepane sidepane--files sidepane--open":"sidepane sidepane--files")+(K?" sidepane--zoomed":""),"aria-label":"Файлы проекта",onKeyDown:rt,children:[i.jsxs("div",{className:"sidepane__head",onDoubleClick:W=>{M&&(W.target.closest("button")||M())},children:[i.jsx(B1,{}),i.jsx("span",{className:"sidepane__title",children:"Файлы"}),i.jsx("button",{className:"sidepane__btn",title:"Новый файл","aria-label":"Новый файл",onClick:()=>zt("file"),children:i.jsx(U1,{})}),i.jsx("button",{className:"sidepane__btn",title:"Новый каталог","aria-label":"Новый каталог",onClick:()=>zt("dir"),children:i.jsx(H1,{})}),i.jsx("button",{className:"sidepane__btn",title:"Перечитать дерево","aria-label":"Перечитать дерево",onClick:ee,children:"↻"}),M&&i.jsx("button",{className:"sidepane__btn",title:K?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":K?"Свернуть панель файлов":"Развернуть панель файлов на весь экран","aria-pressed":K,onClick:M,children:i.jsx(Zr,{active:K})}),i.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель файлов",onClick:te,children:"✕"})]}),i.jsxs("div",{className:"fssearch",children:[i.jsx(I1,{}),i.jsx("input",{className:"fssearch__input",type:"text",value:Nt,spellCheck:!1,placeholder:"Поиск файлов и папок…","aria-label":"Поиск файлов и папок",onChange:W=>Bn(W.target.value),onKeyDown:W=>{W.stopPropagation(),W.key==="Escape"&&(W.preventDefault(),Nt?Bn(""):W.currentTarget.blur())}}),Nt&&i.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>Bn(""),children:"✕"})]}),i.jsx("div",{className:"sidepane__scroll fstree"+(ge===""?" fstree--drop-target":""),tabIndex:-1,onDragOver:tn,onDrop:$t,onContextMenu:rn,onTouchStart:Be,onTouchMove:ht,onTouchEnd:lt,onTouchCancel:lt,children:dn?Qn():Ut}),i.jsx(qi,{result:h}),ue&&i.jsx(Mr,{x:ue.x,y:ue.y,items:bt(),onClose:Kt})]})}function O1({entry:s,depth:l,open:r,active:c,selected:o,dirty:d,gitStatus:h,dragging:p,dropTarget:m,cut:x,onClick:_,onRename:j,onDelete:v,onDragStart:E,onDragEnd:k,onDragOver:O,onDrop:z,onContextMenu:ee,onTouchStart:te,onTouchMove:K,onTouchEnd:M,onTouchCancel:F}){const H="fsrow"+(c?" is-open":"")+(o&&!c?" is-selected":"")+(s.ignored?" fsrow--ignored":"")+(p?" fsrow--dragging":"")+(m?" fsrow--drop-target":"")+(x?" fsrow--cut":"");return i.jsxs("div",{className:H,style:ua(l),draggable:!0,onDragStart:E,onDragEnd:k,onDragOver:O,onDrop:z,onContextMenu:ee,onTouchStart:te,onTouchMove:K,onTouchEnd:M,onTouchCancel:F,children:[i.jsxs("button",{className:"fsrow__main",onClick:_,title:cy(s),children:[i.jsx("span",{className:"fsrow__icon"+sf("fsrow__icon",h),children:s.kind==="dir"?i.jsx(af,{open:r}):i.jsx(rf,{})}),i.jsx("span",{className:"fsrow__name"+sf("fsrow__name",h),children:s.name}),s.ignored&&i.jsx("span",{className:"fsrow__tag",title:"Игнорируется git (.gitignore)",children:"git-ignore"}),d&&i.jsx("span",{className:"fsrow__dot",title:"Есть несохранённые правки"})]}),i.jsx("button",{className:"fsrow__act",title:"Переименовать","aria-label":`Переименовать ${s.name}`,onClick:j,children:"✎"}),i.jsx("button",{className:"fsrow__act",title:"Удалить","aria-label":`Удалить ${s.name}`,onClick:v,children:"✕"})]})}function D1({entry:s,gitStatus:l,onClick:r}){const c=s.path.slice(0,s.path.length-s.name.length-1);return i.jsxs("button",{className:"fsrow fsrow--search"+(s.ignored?" fsrow--ignored":""),style:ua(0),onClick:r,title:cy(s),children:[i.jsx("span",{className:"fsrow__icon"+sf("fsrow__icon",l),children:s.kind==="dir"?i.jsx(af,{}):i.jsx(rf,{})}),i.jsx("span",{className:"fsrow__name"+sf("fsrow__name",l),children:s.name}),s.ignored&&i.jsx("span",{className:"fsrow__tag",children:"git-ignore"}),c&&i.jsx("span",{className:"fsrow__path",children:c})]})}function cy(s){return s.ignored?`${s.path} — игнорируется git (.gitignore)`:s.path}function ua(s){return{"--depth":s}}function Wb(s,l){var o;const r=l.lastIndexOf("/"),c=r===-1?"":l.slice(0,r);return((o=s[c])==null?void 0:o.find(d=>d.path===l))??null}function L1(s){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 s){const d=z1(o.status);if(!d)continue;c(o.path,d);let h=Ui(o.path);for(;c(h,d),!!h;)h=Ui(h)}return l}function z1(s){if(s==="??")return"added";const[l="",r=""]=s;return l==="A"||l==="R"||l==="C"?"added":l==="M"||r==="M"?"modified":null}function sf(s,l){return l?` ${s}--git-${l}`:""}function af({open:s=!1}){return i.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,"aria-hidden":"true",children:s?i.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"}):i.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 rf(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,strokeLinejoin:"round","aria-hidden":"true",children:[i.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"}),i.jsx("path",{d:"M9 2v3.2h3.3"})]})}function U1(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,"aria-hidden":"true",children:[i.jsxs("g",{transform:"translate(-1.3,-1.6) scale(0.78)",strokeLinejoin:"round",children:[i.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"}),i.jsx("path",{d:"M9 2v3.2h3.3"})]}),i.jsx("path",{d:"M12.2 10.3v3.8M10.3 12.2h3.8",strokeLinecap:"round"})]})}function H1(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,"aria-hidden":"true",children:[i.jsx("g",{transform:"translate(-1.3,-1.6) scale(0.78)",children:i.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"})}),i.jsx("path",{d:"M12.2 10.3v3.8M10.3 12.2h3.8",strokeLinecap:"round"})]})}function B1(){return i.jsxs("svg",{className:"sidepane__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[i.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"}),i.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 I1(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[i.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),i.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}const q1=200;function G1({open:s,result:l,onSearch:r,onOpenMatch:c,onClose:o,zoomed:d,onToggleZoom:h}){const[p,m]=y.useState(""),x=p.trim(),_=x.length>0,j=y.useRef(null),v=y.useRef(r);v.current=r;function E(z){m(z),j.current&&clearTimeout(j.current);const ee=z.trim();if(!ee){v.current("");return}j.current=setTimeout(()=>v.current(ee),q1)}const k=_&&(l==null?void 0:l.query)===x?l:null;function O(){if(!k)return[i.jsx("p",{className:"fsrow__pending",children:"ищем…"},"grep:wait")];if(k.matches.length===0)return[i.jsx("p",{className:"fsrow__pending",children:"ничего не найдено"},"grep:empty")];const z=[];let ee="";for(const te of k.matches)te.path!==ee&&(ee=te.path,z.push(i.jsx("p",{className:"searchgroup__path",title:te.path,children:te.path},`path:${te.path}`))),z.push(i.jsx(Y1,{match:te,onClick:()=>c(te)},`${te.path}:${te.line}:${te.column}`));return k.truncated&&z.push(i.jsxs("p",{className:"fsrow__pending",children:["показаны первые ",k.matches.length," — уточните запрос"]},"grep:truncated")),z}return i.jsxs("aside",{className:(s?"sidepane sidepane--search sidepane--open":"sidepane sidepane--search")+(d?" sidepane--zoomed":""),"aria-label":"Поиск по тексту в проекте",children:[i.jsxs("div",{className:"sidepane__head",onDoubleClick:z=>{h&&(z.target.closest("button")||h())},children:[i.jsx(X1,{}),i.jsx("span",{className:"sidepane__title",children:"Поиск по тексту"}),h&&i.jsx("button",{className:"sidepane__btn",title:d?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":d?"Свернуть панель поиска":"Развернуть панель поиска на весь экран","aria-pressed":d,onClick:h,children:i.jsx(Zr,{active:d})}),i.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель поиска",onClick:o,children:"✕"})]}),i.jsxs("div",{className:"fssearch",children:[i.jsx(V1,{}),i.jsx("input",{className:"fssearch__input",type:"text",value:p,spellCheck:!1,placeholder:"Поиск по тексту во всех файлах…","aria-label":"Поиск по тексту во всех файлах",onChange:z=>E(z.target.value),onKeyDown:z=>{z.stopPropagation(),z.key==="Escape"&&(z.preventDefault(),p?E(""):z.currentTarget.blur())}}),p&&i.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>E(""),children:"✕"})]}),i.jsx("div",{className:"sidepane__scroll fstree",children:_?O():i.jsx("p",{className:"sidepane__empty",children:"Введите текст, чтобы найти его во всех файлах проекта."})})]})}function Y1({match:s,onClick:l}){const r=s.lineText.slice(0,s.column-1),c=s.lineText.slice(s.column-1,s.column-1+s.matchLength),o=s.lineText.slice(s.column-1+s.matchLength);return i.jsxs("button",{className:"searchmatch",onClick:l,title:`${s.path}:${s.line}`,children:[i.jsx("span",{className:"searchmatch__line",children:s.line}),i.jsxs("span",{className:"searchmatch__text",children:[r,i.jsx("mark",{children:c}),o]})]})}function X1(){return i.jsxs("svg",{className:"sidepane__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[i.jsx("circle",{cx:"6.8",cy:"6.8",r:"4.3"}),i.jsx("path",{d:"M13.2 13.2 10.1 10.1"})]})}function V1(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[i.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),i.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}let Go=null;function $1(){return Go||(Go=Promise.all([Ve(()=>import("./index-DSzfAcOE.js"),__vite__mapDeps([19,4,3,2,20,5]),import.meta.url),Ve(()=>import("./index-891wE-Rj.js").then(s=>s.v),__vite__mapDeps([4,3]),import.meta.url),Ve(()=>import("./index-BHot-lnj.js"),[],import.meta.url),Ve(()=>import("./index-DNppE7jj.js"),__vite__mapDeps([20,3,4,2]),import.meta.url),Ve(()=>import("./codemirror-Byu5BOry.js"),__vite__mapDeps([21,2,3,4]),import.meta.url)]).then(([s,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:s.basicSetup,editorTheme:o.editorTheme,editorHighlight:o.editorHighlight})).catch(s=>{throw Go=null,s})),Go}function Q1({path:s,doc:l,revision:r,goto:c,onChange:o,onSave:d}){const h=y.useRef(null),p=y.useRef(null),m=y.useRef(null),x=y.useRef(new Map),_=y.useRef(new Map),j=y.useRef(new Set),v=y.useRef(null),E=y.useRef(o),k=y.useRef(d),O=y.useRef(s),z=y.useRef(r),ee=y.useRef(l);E.current=o,k.current=d,O.current=s,z.current=r,ee.current=l;const[te,K]=y.useState("loading"),[M,F]=y.useState(!1);function H(Z,ae,G,J,D){const ge=x.current.get(J),Se=_.current.get(J)===D;if(ge&&Se)G.setState(ge);else{const B=Z.EditorState.create({doc:ee.current,extensions:[Z.basicSetup,Z.Prec.highest(Z.keymap.of([{key:"Mod-s",preventDefault:!0,run:()=>(k.current(O.current),!0)}])),Z.keymap.of([Z.indentWithTab]),ae.of([]),Z.editorTheme,Z.editorHighlight,Z.EditorView.updateListener.of(ue=>{ue.docChanged&&E.current(O.current,ue.state.doc.toString())})]});x.current.set(J,B),_.current.set(J,D),G.setState(B),j.current.delete(J)}if(j.current.has(J))return()=>{};let xe=!1;return k1(J).then(B=>{xe||!B||O.current!==J||(G.dispatch({effects:ae.reconfigure(B)}),x.current.set(J,G.state),j.current.add(J))}),()=>{xe=!0}}y.useEffect(()=>{if(!h.current)return;let ae=!1,G=null,J=null;K("loading"),F(!1);const D=window.setTimeout(()=>{ae||F(!0)},200);return(async()=>{let ge;try{ge=await $1()}catch{window.clearTimeout(D),ae||K("error");return}if(ae||!h.current)return;window.clearTimeout(D);const Se=new ge.Compartment;v.current=Se,m.current=ge,J=new ge.EditorView({parent:h.current}),p.current=J,G=H(ge,Se,J,O.current,z.current),K("ready")})(),()=>{ae=!0,window.clearTimeout(D),G==null||G(),J==null||J.destroy(),p.current===J&&(p.current=null),m.current=null,v.current=null}},[]),y.useEffect(()=>{const Z=m.current,ae=p.current,G=v.current;if(!(!Z||!ae||!G))return H(Z,G,ae,s,r)},[s,r]);const A=y.useRef(0);return y.useEffect(()=>{const Z=p.current,ae=m.current;if(!Z||!ae||!c||c.token===A.current)return;A.current=c.token;const G=Z.state.doc.lines,J=Math.min(Math.max(c.line,1),G),D=Z.state.doc.line(J),ge=Math.min(D.from+Math.max(c.column-1,0),D.to);Z.dispatch({selection:ae.EditorSelection.cursor(ge),effects:ae.EditorView.scrollIntoView(ge,{y:"center"})}),Z.focus()},[c]),y.useEffect(()=>()=>{const Z=p.current;Z&&x.current.set(s,Z.state)},[s]),i.jsxs("div",{className:"editor__code",children:[i.jsx("div",{ref:h,className:"editor__code-surface"+(te==="ready"?"":" is-hidden")}),te==="loading"&&M&&i.jsxs("div",{className:"editor__state work",role:"status",children:[i.jsxs("div",{className:"work__dots",children:[i.jsx("span",{className:"work__dot"}),i.jsx("span",{className:"work__dot"}),i.jsx("span",{className:"work__dot"})]}),i.jsx("span",{className:"work__label",children:"Загружается редактор…"})]}),te==="error"&&i.jsxs("div",{className:"editor__fallback",children:[i.jsxs("div",{className:"editor__fallback-banner",role:"alert",children:[i.jsx("span",{children:"Редактор не загрузился — ниже только просмотр, без сохранения правок."}),i.jsx("button",{className:"btn btn--sm btn--primary",onClick:()=>window.location.reload(),children:"Перезагрузить страницу"})]}),i.jsx("pre",{className:"editor__fallback-text",children:l})]})]})}function Is({value:s,options:l,onChange:r,className:c,title:o,ariaLabel:d,placeholder:h="—"}){const[p,m]=y.useState(!1),[x,_]=y.useState(0),j=y.useRef(null),v=y.useRef(null),E=l.find(z=>z.value===s)??null;y.useEffect(()=>{if(!p)return;const z=l.findIndex(ee=>ee.value===s);_(z===-1?0:z)},[p]),y.useEffect(()=>{if(!p)return;function z(ee){var te;(te=j.current)!=null&&te.contains(ee.target)||m(!1)}return document.addEventListener("mousedown",z),()=>document.removeEventListener("mousedown",z)},[p]),y.useEffect(()=>{var z,ee;p&&((ee=(z=v.current)==null?void 0:z.querySelector(".is-cursor"))==null||ee.scrollIntoView({block:"nearest"}))},[p,x]),y.useEffect(()=>{if(!p)return;const z=v.current,ee=Z1(j.current);if(!z||!ee)return;const te=z.getBoundingClientRect().bottom-ee.getBoundingClientRect().bottom;te>0&&(ee.scrollTop+=Math.min(te+8,z.offsetHeight))},[p]);function k(z){m(!1),z.value!==s&&r(z.value)}function O(z){if(z.key==="Escape"){if(!p)return;z.preventDefault(),z.stopPropagation(),m(!1);return}if(z.key==="ArrowDown"||z.key==="ArrowUp"){if(z.preventDefault(),!p)return m(!0);const ee=z.key==="ArrowDown"?1:l.length-1;return _(te=>(te+ee)%l.length)}if(z.key==="Enter"||z.key===" "){if(z.preventDefault(),!p)return m(!0);const ee=l[x];ee&&k(ee)}}return i.jsxs("div",{ref:j,className:"select"+(p?" select--open":"")+(c?` ${c}`:""),children:[i.jsxs("button",{type:"button",className:"select__trigger",title:o,"aria-label":d??o,"aria-haspopup":"listbox","aria-expanded":p,onClick:()=>m(z=>!z),onKeyDown:O,children:[i.jsx("span",{className:"select__value",children:(E==null?void 0:E.label)??h}),i.jsx(K1,{})]}),p&&i.jsx("div",{ref:v,className:"select__menu",role:"listbox","aria-label":d??o,children:l.map((z,ee)=>i.jsxs("button",{type:"button",role:"option","aria-selected":z.value===s,className:"select__option"+(ee===x?" is-cursor":"")+(z.value===s?" is-on":""),onMouseEnter:()=>_(ee),onClick:()=>k(z),children:[i.jsx("span",{className:"select__check","aria-hidden":"true",children:z.value===s?"✓":""}),i.jsx("span",{className:"select__label",children:z.label}),z.hint&&i.jsx("span",{className:"select__hint",children:z.hint})]},z.value))})]})}function Z1(s){let l=(s==null?void 0:s.parentElement)??null;for(;l;){if(l.scrollHeight>l.clientHeight&&getComputedStyle(l).overflowY!=="visible")return l;l=l.parentElement}return null}function K1(){return i.jsx("svg",{className:"select__chev",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:i.jsx("path",{d:"M3 4.5 6 7.5 9 4.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function F1(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("circle",{cx:"6.6",cy:"6.6",r:"4.3"}),i.jsx("path",{d:"M9.7 9.7 14 14"}),i.jsx("path",{d:"M6.6 4.6v4M4.6 6.6h4"})]})}function J1(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("circle",{cx:"6.6",cy:"6.6",r:"4.3"}),i.jsx("path",{d:"M9.7 9.7 14 14"}),i.jsx("path",{d:"M4.6 6.6h4"})]})}function W1(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M13 8a5 5 0 1 1-1.6-3.7"}),i.jsx("path",{d:"M13 2.5v3.3h-3.3"})]})}function P1({path:s,mime:l,base64:r,error:c,tooLarge:o,size:d,onRequestMedia:h}){y.useEffect(()=>{!o&&r===void 0&&c===void 0&&h(s)},[]);const p=eS(r,l);return o?i.jsx("div",{className:"mediaview mediaview--message",children:i.jsxs("p",{className:"mediaview__error",children:["Файл слишком велик для просмотра (",Wo(d),"). Лимит — 64 МБ."]})}):c?i.jsxs("div",{className:"mediaview mediaview--message",role:"alert",children:[i.jsx("p",{className:"mediaview__error",children:c}),i.jsx("button",{className:"btn btn--sm btn--primary",onClick:()=>h(s),children:"Повторить"})]}):p?l.startsWith("image/")?i.jsx(nS,{url:p}):l.startsWith("video/")?i.jsx(sS,{url:p}):null:i.jsxs("div",{className:"mediaview mediaview--message",role:"status",children:[i.jsx("div",{className:"mediaview__progress",children:i.jsx("div",{className:"mediaview__progress-fill"})}),i.jsx("span",{className:"mediaview__label",children:"Загружается…"})]})}function eS(s,l){const[r,c]=y.useState(null);return y.useEffect(()=>{if(s===void 0){c(null);return}const o=atob(s),d=new Uint8Array(o.length);for(let p=0;p<o.length;p++)d[p]=o.charCodeAt(p);const h=URL.createObjectURL(new Blob([d],{type:l}));return c(h),()=>URL.revokeObjectURL(h)},[s,l]),r}const Za=1,uy=8,Yo=1.25;function tS(s){return Math.min(uy,Math.max(Za,s))}function nS({url:s}){const[l,r]=y.useState({scale:Za,x:0,y:0}),[c,o]=y.useState(!1),d=y.useRef(null),h=y.useRef(null);function p(E,k,O){r(z=>{const ee=tS(z.scale*E);if(ee===z.scale)return z;if(ee<=Za)return{scale:Za,x:0,y:0};const te=(k-z.x)/z.scale,K=(O-z.y)/z.scale;return{scale:ee,x:k-ee*te,y:O-ee*K}})}y.useEffect(()=>{const E=d.current;if(!E)return;function k(O){O.preventDefault();const z=E.getBoundingClientRect(),ee=O.clientX-z.left-z.width/2,te=O.clientY-z.top-z.height/2;p(O.deltaY<0?Yo:1/Yo,ee,te)}return E.addEventListener("wheel",k,{passive:!1}),()=>E.removeEventListener("wheel",k)},[]);function m(E){l.scale<=Za||(E.currentTarget.setPointerCapture(E.pointerId),h.current={pointerId:E.pointerId,startX:E.clientX,startY:E.clientY,origX:l.x,origY:l.y},o(!0))}function x(E){const k=h.current;!k||k.pointerId!==E.pointerId||r(O=>({...O,x:k.origX+(E.clientX-k.startX),y:k.origY+(E.clientY-k.startY)}))}function _(){h.current=null,o(!1)}const j=l.scale>Za,v=!j&&l.x===0&&l.y===0;return i.jsxs("div",{className:"mediaview mediaview--image",children:[i.jsx("div",{ref:d,className:"mediaview__stage"+(j?c?" is-dragging":" is-zoomed":""),onPointerDown:m,onPointerMove:x,onPointerUp:_,onPointerCancel:_,children:i.jsx("img",{src:s,alt:"",className:"mediaview__image",draggable:!1,style:{transform:`translate(${l.x}px, ${l.y}px) scale(${l.scale})`}})}),i.jsxs("div",{className:"mediaview__toolbar",children:[i.jsx("button",{className:"btn btn--sm",disabled:l.scale<=Za,title:"Уменьшить","aria-label":"Уменьшить",onClick:()=>p(1/Yo,0,0),children:i.jsx(J1,{})}),i.jsxs("span",{className:"mediaview__zoomlabel",children:[Math.round(l.scale*100),"%"]}),i.jsx("button",{className:"btn btn--sm",disabled:l.scale>=uy,title:"Увеличить","aria-label":"Увеличить",onClick:()=>p(Yo,0,0),children:i.jsx(F1,{})}),i.jsx("button",{className:"btn btn--sm",disabled:v,title:"Вписать в окно","aria-label":"Сбросить масштаб — вписать в окно",onClick:()=>r({scale:Za,x:0,y:0}),children:i.jsx(W1,{})})]})]})}const lS=[{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 sS({url:s}){const l=y.useRef(null),[r,c]=y.useState("1");return y.useEffect(()=>{l.current&&(l.current.playbackRate=Number(r))},[r]),i.jsxs("div",{className:"mediaview mediaview--video",children:[i.jsx("video",{ref:l,className:"mediaview__video",src:s,controls:!0}),i.jsxs("div",{className:"mediaview__speedbar",children:[i.jsx("span",{className:"mediaview__speedlabel",children:"Скорость"}),i.jsx(Is,{className:"mediaview__speedselect",value:r,onChange:c,ariaLabel:"Скорость воспроизведения",options:lS})]})]})}function aS({file:s,goto:l,onChange:r,onSave:c,onReload:o,onOverwrite:d,onRequestMedia:h,onTogglePreview:p}){const m=ca(s),x=ry(s.path)&&!s.binary&&!s.tooLarge;return i.jsxs("div",{className:"editor",children:[i.jsxs("div",{className:"editor__bar",children:[i.jsx("span",{className:"editor__path",title:s.path,children:s.path}),i.jsxs("span",{className:"editor__meta",children:[Wo(s.size),s.eol==="crlf"&&" · CRLF"]}),x&&i.jsxs("div",{className:"editor__viewtoggle",role:"tablist","aria-label":"Режим просмотра",children:[i.jsx("button",{className:"btn btn--sm"+(s.previewMode?" is-on":""),role:"tab","aria-selected":s.previewMode,onClick:()=>!s.previewMode&&p(s.path),children:"Просмотр"}),i.jsx("button",{className:"btn btn--sm"+(s.previewMode?"":" is-on"),role:"tab","aria-selected":!s.previewMode,onClick:()=>s.previewMode&&p(s.path),children:"Код"})]}),i.jsx("button",{className:"btn btn--sm",disabled:!m,title:"Сохранить (Ctrl+S)",onClick:()=>c(s.path),children:m?"Сохранить":"Сохранено"})]}),s.stale&&i.jsxs("div",{className:"editor__warn",children:[i.jsxs("span",{children:["Файл изменился на диске",m?" — а здесь есть несохранённые правки.":"."]}),i.jsx("button",{className:"btn btn--sm",onClick:()=>o(s.path),children:"Взять с диска"}),m&&i.jsx("button",{className:"btn btn--sm btn--danger",onClick:()=>d(s.path),children:"Сохранить поверх"})]}),s.binary&&s.mediaMime?i.jsx(P1,{path:s.path,mime:s.mediaMime,base64:s.mediaBase64,error:s.mediaError,tooLarge:s.mediaTooLarge,size:s.size,onRequestMedia:h},s.path):s.binary?i.jsxs("p",{className:"editor__empty",children:["Это не текстовый файл — редактировать его здесь нечем. ",Wo(s.size)," на диске."]}):s.tooLarge?i.jsxs("p",{className:"editor__empty",children:["Файл слишком велик для редактора (",Wo(s.size),"). Такие правит агент, а не браузер."]}):x&&s.previewMode?i.jsx(iS,{text:s.text}):i.jsx(Q1,{path:s.path,doc:s.text,revision:s.revision,goto:l,onChange:r,onSave:c})]})}function iS({text:s}){const[l,r]=y.useState("");return y.useEffect(()=>{let c=!1;return tp(s).then(o=>{c||r(o)}),()=>{c=!0}},[s]),i.jsx("div",{className:"markdown-preview",dangerouslySetInnerHTML:{__html:l}})}function rS({files:s,activePath:l,busy:r,onSelect:c,onClose:o,zoomed:d,onToggleZoom:h}){return i.jsxs("div",{className:"worktabs",role:"tablist",onDoubleClick:p=>{h&&(p.target.closest("button")||h())},children:[i.jsxs("button",{className:"worktab"+(l===null?" is-on":""),role:"tab","aria-selected":l===null,onClick:()=>c(null),onDoubleClick:()=>h==null?void 0:h(),children:[i.jsx("span",{className:"worktab__name",children:"Разговор"}),r&&i.jsx("span",{className:"worktab__dot worktab__dot--busy",title:"Агент работает"})]}),s.map(p=>i.jsxs("div",{className:"worktab"+(p.path===l?" is-on":""),role:"tab","aria-selected":p.path===l,onDoubleClick:m=>{h&&(m.target.closest(".worktab__close, .worktab__dot")||h())},children:[i.jsx("button",{className:"worktab__name",title:p.path,onClick:()=>c(p.path),children:T1(p.path)}),ca(p)?i.jsx("button",{className:"worktab__dot",title:"Не сохранено — закрыть","aria-label":`Закрыть ${p.path}`,onClick:()=>o(p.path)}):i.jsx("button",{className:"worktab__close",title:"Закрыть","aria-label":`Закрыть ${p.path}`,onClick:()=>o(p.path),children:"✕"})]},p.path)),i.jsx("div",{className:"worktabs__spacer"}),h&&i.jsx("button",{className:"worktabs__zoom",title:d?"Свернуть — то же самое, что двойной клик по вкладке":"Развернуть на весь экран — то же самое, что двойной клик по вкладке","aria-label":d?"Свернуть колонку разговора":"Развернуть колонку разговора на весь экран","aria-pressed":d,onClick:h,children:i.jsx(Zr,{active:d})})]})}const oy="ccv:sidebar.collapsed",fy="ccv:sidebar.mode",dy="ccv:sidebar.foldersCollapsed",cS=500,Pb="транскрипт остаётся на диске — сессию можно вернуть из архива в любой момент.";function uS({open:s,connected:l,status:r,workspaces:c,archivedWorkspaces:o,workspaceFolders:d,sessionFolders:h,pinnedFolders:p,sessions:m,archived:x,pinned:_,activeWorkspaceId:j,activeSessionId:v,onSelectWorkspace:E,onSelectSession:k,onRenameSession:O,onPinSessions:z,onSelectPinned:ee,onCloseWorkspaces:te,onRestoreWorkspaces:K,onArchiveSessions:M,onUnarchiveSessions:F,onCreateFolder:H,onRenameFolder:A,onDeleteFolder:Z,onAssignToFolder:ae,onOpenWorkspace:G,onNewSession:J,onOpenExtensions:D,account:ge,onOpenAccount:Se,relay:xe,onOpenRelay:B,onOpenSettings:ue,themeMode:se,onCycleTheme:be}){const[Ce,w]=y.useState(null),[Q,re]=y.useState(null),[oe,ye]=y.useState(null),[je,Me]=y.useState(""),[ht,lt]=y.useState(xS),[Nn,Je]=y.useState(yS),[Kt,ct]=y.useState(_S);function rn(){ct(T=>{const he=T==="pinned"?"default":"pinned";try{localStorage.setItem(fy,he)}catch{}return he})}const Be=je.trim().toLowerCase(),rt=Be!=="",Hn=y.useMemo(()=>rt?c.filter(T=>T.name.toLowerCase().includes(Be)||T.path.toLowerCase().includes(Be)):c,[c,Be,rt]),wt=y.useMemo(()=>rt?o.filter(T=>T.name.toLowerCase().includes(Be)||T.path.toLowerCase().includes(Be)):o,[o,Be,rt]),Ot=y.useMemo(()=>rt?m.filter(T=>(T.title??"").toLowerCase().includes(Be)):m,[m,Be,rt]),Ft=y.useMemo(()=>rt?x.filter(T=>(T.title??"").toLowerCase().includes(Be)):x,[x,Be,rt]),tn=T=>{var he;return((he=c.find(Ge=>Ge.id===T))==null?void 0:he.name)??"—"},$t=T=>{var he;return(he=c.find(Ge=>Ge.id===T))==null?void 0:he.path},Nt=y.useMemo(()=>rt?_.filter(T=>(T.title??"").toLowerCase().includes(Be)||tn(T.workspaceId).toLowerCase().includes(Be)):_,[_,c,Be,rt]);function Qe(T){lt(he=>{const Ge=he.includes(T)?he.filter(pt=>pt!==T):[...he,T];try{localStorage.setItem(oy,JSON.stringify(Ge))}catch{}return Ge})}const We=T=>!ht.includes(T);function dn(T){Je(he=>{const Ge=he.includes(T)?he.filter(pt=>pt!==T):[...he,T];try{localStorage.setItem(dy,JSON.stringify(Ge))}catch{}return Ge})}const Jt=T=>!Nn.includes(T),Qt=y.useMemo(()=>Wc(Hn,d),[Hn,d]),Bn=y.useMemo(()=>Wc(wt,d),[wt,d]),Tn=y.useMemo(()=>Wc(Ot,h),[Ot,h]),hn=y.useMemo(()=>Wc(Ft,h),[Ft,h]),sl=y.useMemo(()=>Wc(Nt,p,T=>T.pinnedFolderId),[Nt,p]),zt=yh(Hn),bt=yh(wt),Ut=yh(Ot),[$e,Qn]=y.useState(null),[W,de]=y.useState(null),[we,L]=y.useState(null),[V,_e]=y.useState(null),ze=y.useRef(null);function st(T,he){const Ge=T.touches[0];if(!Ge)return;const pt={timer:0,x:Ge.clientX,y:Ge.clientY,el:T.currentTarget,fired:!1};pt.timer=window.setTimeout(()=>{pt.fired=!0,he(pt.x,pt.y,pt.el)},cS),ze.current=pt}function al(T){const he=ze.current,Ge=T.touches[0];!he||!Ge||Math.hypot(Ge.clientX-he.x,Ge.clientY-he.y)>10&&(window.clearTimeout(he.timer),ze.current=null)}function Pe(T){const he=ze.current;he&&(window.clearTimeout(he.timer),he.fired&&T.preventDefault())}function En(){var T;return(T=ze.current)!=null&&T.fired?(ze.current=null,!0):!1}function In(){const T=$e==null?void 0:$e.opener;Qn(null),T!=null&&T.isConnected&&T.focus()}function $l(){const T=W==null?void 0:W.opener;de(null),T!=null&&T.isConnected&&T.focus()}function da(){const T=we==null?void 0:we.opener;L(null),T!=null&&T.isConnected&&T.focus()}function qs(){const T=V==null?void 0:V.opener;_e(null),T!=null&&T.isConnected&&T.focus()}function Ll(T){return{onContextMenu:he=>{he.preventDefault(),Qn({x:he.clientX,y:he.clientY,opener:he.currentTarget,ids:zt.targetsFor(T)})},onTouchStart:he=>st(he,(Ge,pt,un)=>Qn({x:Ge,y:pt,opener:un,ids:zt.targetsFor(T)})),onTouchMove:al,onTouchEnd:Pe,onTouchCancel:Pe}}function qn(T){return{onContextMenu:he=>{he.preventDefault(),de({x:he.clientX,y:he.clientY,opener:he.currentTarget,ids:bt.targetsFor(T)})},onTouchStart:he=>st(he,(Ge,pt,un)=>de({x:Ge,y:pt,opener:un,ids:bt.targetsFor(T)})),onTouchMove:al,onTouchEnd:Pe,onTouchCancel:Pe}}function pl(T){return{onContextMenu:he=>{he.preventDefault(),L({x:he.clientX,y:he.clientY,opener:he.currentTarget,ids:Ut.targetsFor(T)})},onTouchStart:he=>st(he,(Ge,pt,un)=>L({x:Ge,y:pt,opener:un,ids:Ut.targetsFor(T)})),onTouchMove:al,onTouchEnd:Pe,onTouchCancel:Pe}}function nn(T){return{onContextMenu:he=>{he.preventDefault(),_e({x:he.clientX,y:he.clientY,opener:he.currentTarget,ids:[T.id]})},onTouchStart:he=>st(he,(Ge,pt,un)=>_e({x:Ge,y:pt,opener:un,ids:[T.id]})),onTouchMove:al,onTouchEnd:Pe,onTouchCancel:Pe}}const _l=m.filter(T=>T.state!=="closed").length,Gn=$e?Hn.find(T=>T.id===$e.ids[0]):void 0,Ht=$e?[{id:"close",label:$e.ids.length>1?`Закрыть проекты (${$e.ids.length})`:"Закрыть проект",onSelect:()=>{te($e.ids),zt.clear()}},...Pc({folders:d,ids:$e.ids,hasFolder:(Gn==null?void 0:Gn.folderId)!=null,assign:(T,he)=>ae("workspace",T,he),onClear:()=>zt.clear(),onNewFolder:()=>ye("workspace")})]:[],Ze=$e?"закрытие не удаляет проект: каталог и история сессий остаются на диске — открыть его снова можно кнопкой «+ Проект»."+(j&&$e.ids.includes(j)&&_l>0?` в нём сейчас незавершённых сессий: ${_l} — при закрытии они остановятся на хосте.`:""):void 0,ln=W?wt.find(T=>T.id===W.ids[0]):void 0,is=W?[{id:"restore",label:W.ids.length>1?`Вернуть проекты (${W.ids.length})`:"Вернуть проект",onSelect:()=>{K(W.ids),bt.clear()}},...Pc({folders:d,ids:W.ids,hasFolder:(ln==null?void 0:ln.folderId)!=null,assign:(T,he)=>ae("workspace",T,he),onClear:()=>bt.clear(),onNewFolder:()=>ye("workspace")})]:[],An=W?"каталог и история сессий всё это время оставались на диске — восстановление их не трогает.":void 0,Cn=we?Ot.find(T=>T.id===we.ids[0]):void 0,zl=(Cn==null?void 0:Cn.pinned)!==!0,vl=we?[...we.ids.length===1?[{id:"rename",label:"Переименовать",onSelect:()=>w(we.ids[0])}]:[],{id:"pin",label:zl?we.ids.length>1?`Закрепить (${we.ids.length})`:"Закрепить":we.ids.length>1?`Открепить (${we.ids.length})`:"Открепить",onSelect:()=>{Cn&&z(Cn.workspaceId,we.ids,zl),Ut.clear()}},{id:"archive",label:we.ids.length>1?`Убрать в архив (${we.ids.length})`:"Убрать в архив",onSelect:()=>{M(j,we.ids),Ut.clear()}},...Pc({folders:h,ids:we.ids,hasFolder:(Cn==null?void 0:Cn.folderId)!=null,assign:(T,he)=>ae("session",T,he,j),onClear:()=>Ut.clear(),onNewFolder:()=>ye("session")})]:[],ys=we?Pb:void 0,It=V?Nt.find(T=>T.id===V.ids[0]):void 0,Ql=V?[{id:"rename",label:"Переименовать",onSelect:()=>w(V.ids[0])},{id:"unpin",label:"Открепить",onSelect:()=>{It&&z(It.workspaceId,[It.id],!1)}},{id:"archive",label:"Убрать в архив",onSelect:()=>{It&&M(It.workspaceId,[It.id])}},...It&&It.workspaceId===j?Pc({folders:h,ids:[It.id],hasFolder:It.folderId!=null,assign:(T,he)=>ae("session",T,he,It.workspaceId),onClear:()=>{},onNewFolder:()=>ye("session")}):[],...oS(It?Pc({folders:p,ids:[It.id],hasFolder:It.pinnedFolderId!=null,assign:(T,he)=>ae("pinned",T,he),onClear:()=>{},onNewFolder:()=>ye("pinned")}):[])]:[];function Zl(T){return i.jsx("div",{className:xh(T.id===j,zt.selected.includes(T.id)),...Ll(T),children:i.jsxs("button",{className:"row__main",onClick:he=>{En()||zt.click(he,T,()=>E(T.id))},children:[i.jsxs("span",{className:"row__title",children:[T.name,T.hasClaudeMd&&" ·"]}),i.jsx("span",{className:"row__meta",title:T.path,children:T.path})]})},T.id)}function pn(T){return i.jsxs("div",{className:xh(T.id===j,bt.selected.includes(T.id)),...qn(T),children:[i.jsxs("button",{className:"row__main",onClick:he=>{En()||bt.click(he,T,()=>E(T.id))},children:[i.jsxs("span",{className:"row__title",children:[T.name,T.hasClaudeMd&&" ·"]}),i.jsx("span",{className:"row__meta",children:TS(T)})]}),i.jsx("button",{className:"row__restore",title:"Вернуть проект из архива",onClick:()=>K([T.id]),children:"Вернуть"})]},T.id)}function Tt(T){return i.jsx("div",{className:xh(T.id===v,Ut.selected.includes(T.id)),...Ce===T.id?{}:pl(T),children:Ce===T.id?i.jsx("div",{className:"row__main",children:i.jsx(fa,{value:T.title??"",onCommit:he=>{O(T,he),w(null)},onCancel:()=>w(null)})}):i.jsxs(i.Fragment,{children:[i.jsxs("button",{className:"row__main",onClick:he=>{En()||Ut.click(he,T,()=>k(T))},children:[i.jsx(_h,{title:T.title??"Без названия",pinned:T.pinned===!0,projectName:tn(T.workspaceId),projectPath:$t(T.workspaceId)}),i.jsx(nx,{session:T,tail:new Date(T.updatedAt).toLocaleString()})]}),i.jsx("button",{className:"row__edit",title:"Переименовать","aria-label":"Переименовать сессию",onClick:()=>{En()||w(T.id)},children:"✎"})]})},T.id)}function Yn(T){return i.jsxs("div",{className:T.id===v?"row row--active":"row",children:[i.jsxs("button",{className:"row__main",onClick:()=>k(T),children:[i.jsx(_h,{title:T.title??"Без названия",pinned:!1,projectName:tn(T.workspaceId),projectPath:$t(T.workspaceId)}),i.jsx("span",{className:"row__meta",children:NS(T)})]}),i.jsx("button",{className:"row__restore",title:"Вернуть сессию из архива",onClick:()=>F([T.id]),children:"Вернуть"})]},T.id)}function Gs(T){return i.jsx("div",{className:T.id===v?"row row--active":"row",...Ce===T.id?{}:{title:"Действия со строкой — правый клик или долгое нажатие",...nn(T)},children:Ce===T.id?i.jsx("div",{className:"row__main",children:i.jsx(fa,{value:T.title??"",onCommit:he=>{O(T,he),w(null)},onCancel:()=>w(null)})}):i.jsxs("button",{className:"row__main",onClick:()=>{En()||ee(T)},children:[i.jsx(_h,{title:T.title??"Без названия",pinned:!1,projectName:tn(T.workspaceId),projectPath:$t(T.workspaceId)}),i.jsx(nx,{session:T,tail:new Date(T.updatedAt).toLocaleString()})]})},T.id)}function cn(T,he){return i.jsx(mS,{folder:T,count:he,open:Jt(T.id),renaming:Q===T.id,onToggle:()=>dn(T.id),onStartRename:()=>re(T.id),onCommitRename:Ge=>{A(T.id,Ge),re(null)},onCancelRename:()=>re(null),onDelete:()=>Z(T.id)},T.id)}return i.jsxs("aside",{className:s?"sidebar sidebar--open":"sidebar",children:[i.jsxs("div",{className:"sidebar__head",children:[i.jsx("span",{className:l?"dot dot--on":"dot",title:r}),i.jsx("span",{className:"brand",children:"Claude Code Visual"}),i.jsx("button",{className:"theme-btn","aria-pressed":Kt==="pinned",title:Kt==="pinned"?"Показать все проекты и сессии":"Показать только закреплённые","aria-label":Kt==="pinned"?"Панель закреплённых сессий включена. Показать все проекты и сессии":"Показать только закреплённые сессии",onClick:rn,children:i.jsx(py,{})}),i.jsx("button",{className:"theme-btn",title:`Тема: ${tx[se]}`,"aria-label":`Тема: ${tx[se]}. Переключить`,onClick:be,children:i.jsx(vS,{mode:se})})]}),i.jsxs("div",{className:"fssearch fssearch--sidebar",children:[i.jsx(gS,{}),i.jsx("input",{className:"fssearch__input",type:"text",value:je,spellCheck:!1,placeholder:"Проект или сессия…","aria-label":"Поиск по проектам и сессиям",onChange:T=>Me(T.target.value),onKeyDown:T=>{T.stopPropagation(),T.key==="Escape"&&(T.preventDefault(),je?Me(""):T.currentTarget.blur())}}),je&&i.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>Me(""),children:"✕"})]}),i.jsx("div",{className:"sidebar__scroll",children:Kt==="pinned"?i.jsxs(i.Fragment,{children:[i.jsx(eu,{title:"Закреплённые",count:Nt.length,open:We("pinned"),onToggle:()=>Qe("pinned"),action:{label:"Новая папка закреплённых",onClick:()=>{ye("pinned"),We("pinned")||Qe("pinned")}}}),We("pinned")&&i.jsxs(i.Fragment,{children:[oe==="pinned"&&i.jsx("div",{className:"row",children:i.jsx("div",{className:"row__main",children:i.jsx(fa,{value:"",placeholder:"Название папки",onCommit:T=>{H("pinned",T),ye(null)},onCancel:()=>ye(null)})})}),Nt.length===0&&i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:rt?"Ничего не найдено":"закрепите сессию через её меню (правый клик или долгое нажатие) — она останется под рукой из любого проекта"})}),sl.groups.map(T=>i.jsxs(y.Fragment,{children:[cn(T.folder,T.items.length),Jt(T.folder.id)&&T.items.map(he=>Gs(he))]},T.folder.id)),sl.ungrouped.map(T=>Gs(T))]})]}):i.jsxs(i.Fragment,{children:[i.jsx(eu,{title:"Проекты",count:Hn.length,open:We("workspaces"),onToggle:()=>Qe("workspaces"),action:{label:"Новая папка проектов",onClick:()=>{ye("workspace"),We("workspaces")||Qe("workspaces")}}}),We("workspaces")&&i.jsxs(i.Fragment,{children:[oe==="workspace"&&i.jsx("div",{className:"row",children:i.jsx("div",{className:"row__main",children:i.jsx(fa,{value:"",placeholder:"Название папки",onCommit:T=>{H("workspace",T),ye(null)},onCancel:()=>ye(null)})})}),Hn.length===0&&i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:rt?"Ничего не найдено":"Пока ни одного"})}),Qt.groups.map(T=>i.jsxs(y.Fragment,{children:[cn(T.folder,T.items.length),Jt(T.folder.id)&&T.items.map(he=>Zl(he))]},T.folder.id)),Qt.ungrouped.map(T=>Zl(T))]}),o.length>0&&i.jsxs(i.Fragment,{children:[i.jsx(eu,{title:"Архив проектов",count:wt.length,open:We("workspacesArchive"),onToggle:()=>Qe("workspacesArchive"),hint:"проект закрывают вручную; каталог и история сессий остаются на диске и открываются заново отсюда или через «+ Проект»"}),We("workspacesArchive")&&i.jsxs(i.Fragment,{children:[wt.length===0&&i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:rt?"Ничего не найдено":"Пока пусто"})}),Bn.groups.map(T=>i.jsxs(y.Fragment,{children:[cn(T.folder,T.items.length),Jt(T.folder.id)&&T.items.map(he=>pn(he))]},T.folder.id)),Bn.ungrouped.map(T=>pn(T))]})]}),j&&i.jsxs(i.Fragment,{children:[i.jsx(eu,{title:"Сессии",count:Ot.length,open:We("sessions"),onToggle:()=>Qe("sessions"),action:{label:"Новая папка сессий",onClick:()=>{ye("session"),We("sessions")||Qe("sessions")}}}),We("sessions")&&i.jsxs(i.Fragment,{children:[oe==="session"&&i.jsx("div",{className:"row",children:i.jsx("div",{className:"row__main",children:i.jsx(fa,{value:"",placeholder:"Название папки",onCommit:T=>{H("session",T,j),ye(null)},onCancel:()=>ye(null)})})}),Ot.length===0&&i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:rt?"Ничего не найдено":"Пока ни одной"})}),Tn.groups.map(T=>i.jsxs(y.Fragment,{children:[cn(T.folder,T.items.length),Jt(T.folder.id)&&T.items.map(he=>Tt(he))]},T.folder.id)),Tn.ungrouped.map(T=>Tt(T))]}),x.length>0&&i.jsxs(i.Fragment,{children:[i.jsx(eu,{title:"Архив",count:Ft.length,open:We("archive"),onToggle:()=>Qe("archive"),hint:"сессии без обращения дольше двух суток уезжают сюда сами; ничего не удаляется"}),We("archive")&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:"сюда сами уезжают сессии без обращения дольше двух суток; транскрипт остаётся на диске, ничего не удаляется"})}),Ft.length===0&&i.jsx("div",{className:"row",children:i.jsx("span",{className:"row__meta",children:rt?"Ничего не найдено":"Пока пусто"})}),hn.groups.map(T=>i.jsxs(y.Fragment,{children:[cn(T.folder,T.items.length),Jt(T.folder.id)&&T.items.map(he=>Yn(he))]},T.folder.id)),hn.ungrouped.map(T=>Yn(T))]})]})]})]})}),i.jsxs("div",{className:"sidebar__foot",children:[i.jsxs("button",{className:"account-btn sidebar__wide",title:"Аккаунт Claude",onClick:Se,children:[i.jsx("span",{className:ge!=null&&ge.loggedIn?"dot dot--on":"dot"}),i.jsx("span",{className:"account-btn__id",children:ge===null?"Аккаунт":ge.loggedIn?ge.email||"Вход выполнен":"Войти в аккаунт"}),(ge==null?void 0:ge.plan)&&i.jsx("span",{className:"chip",children:ge.plan})]}),B&&i.jsxs("button",{className:"account-btn sidebar__wide",title:"Доступ с телефона и из браузера",onClick:B,children:[i.jsx("span",{className:xe!=null&&xe.connected?"dot dot--on":"dot"}),i.jsx("span",{className:"account-btn__id",children:xe===null?"Удалённый доступ":xe.paired?xe.connected?xe.name||"Удалённый доступ включён":"Удалённый доступ · нет связи":"Удалённый доступ"}),(xe==null?void 0:xe.connected)&&xe.clients>0&&i.jsx("span",{className:"chip",children:xe.clients})]}),i.jsx("button",{className:"btn btn--ghost sidebar__wide",disabled:!D,title:"MCP-серверы и плагины",onClick:()=>D==null?void 0:D(),children:"Расширения"}),i.jsx("button",{className:"btn btn--ghost sidebar__wide",title:"Настройки приложения",onClick:ue,children:"Настройки"}),i.jsx("button",{className:"btn btn--ghost",onClick:G,children:"+ Проект"}),i.jsx("button",{className:"btn btn--primary",onClick:J,disabled:!j,children:"+ Сессия"})]}),$e&&i.jsx(Mr,{x:$e.x,y:$e.y,items:Ht,note:Ze,onClose:In}),W&&i.jsx(Mr,{x:W.x,y:W.y,items:is,note:An,onClose:$l}),we&&i.jsx(Mr,{x:we.x,y:we.y,items:vl,note:ys,onClose:da}),V&&i.jsx(Mr,{x:V.x,y:V.y,items:Ql,note:Pb,onClose:qs})]})}function xh(s,l){const r=["row"];return s&&r.push("row--active"),l&&r.push("row--selected"),r.join(" ")}function Wc(s,l,r=c=>c.folderId){const c=new Map(l.map(p=>[p.id,p])),o=new Map,d=[];for(const p of s){const m=r(p),x=m?c.get(m):void 0;if(!x){d.push(p);continue}const _=o.get(x.id);_?_.push(p):o.set(x.id,[p])}return{groups:[...o.entries()].map(([p,m])=>({folder:c.get(p),items:m})).sort((p,m)=>p.folder.name.localeCompare(m.folder.name,"ru")),ungrouped:d}}function Pc(s){return[...[...s.folders].sort((r,c)=>r.name.localeCompare(c.name,"ru")).map(r=>({id:`folder:${r.id}`,label:`В папку «${r.name}»`,onSelect:()=>{s.ids.forEach(c=>s.assign(c,r.id)),s.onClear()}})),...s.hasFolder?[{id:"folder:none",label:"Без папки",onSelect:()=>{s.ids.forEach(r=>s.assign(r,null)),s.onClear()}}]:[],{id:"folder:new",label:"Новая папка…",onSelect:s.onNewFolder}]}function oS(s){return s.map(l=>({...l,id:`pinned:${l.id}`,label:l.id==="folder:new"?"Новая папка закреплённых…":l.id==="folder:none"?"Без папки закреплённых":l.label}))}function yh(s){const[l,r]=y.useState([]),c=y.useRef(null);function o(){r([]),c.current=null}function d(p,m,x){if(p.ctrlKey||p.metaKey){r(_=>_.includes(m.id)?_.filter(j=>j!==m.id):[..._,m.id]),c.current=m.id;return}if(p.shiftKey&&c.current){const _=s.findIndex(v=>v.id===c.current),j=s.findIndex(v=>v.id===m.id);if(_!==-1&&j!==-1){const[v,E]=_<j?[_,j]:[j,_];r(s.slice(v,E+1).map(k=>k.id));return}}o(),c.current=m.id,x()}function h(p){return l.includes(p.id)?l:(r([p.id]),c.current=p.id,[p.id])}return{selected:l,click:d,targetsFor:h,clear:o}}const fS={display:"flex",alignItems:"center",gap:6,flex:1,minWidth:0,textAlign:"left"},dS={width:22,height:22,borderRadius:6};function eu({title:s,count:l,open:r,onToggle:c,hint:o,action:d}){const h=r?`Свернуть «${s}»`:`Развернуть «${s}»`;return i.jsxs("div",{className:"sidebar__section",children:[i.jsxs("button",{className:"sidebar__section--btn",style:fS,"aria-expanded":r,title:o?`${h} — ${o}`:h,onClick:c,children:[i.jsx(hy,{open:r}),i.jsx("span",{className:"sidebar__section-name",children:s}),i.jsx("span",{className:"sidebar__count",children:l})]}),d&&i.jsx("button",{className:"theme-btn",style:dS,title:d.label,"aria-label":d.label,onClick:d.onClick,children:i.jsx(bS,{})})]})}const ex={paddingLeft:22},hS={display:"flex",alignItems:"center",gap:6,width:"100%"},pS={flex:1,minWidth:0,color:"var(--text-2)",fontWeight:500};function mS({folder:s,count:l,open:r,renaming:c,onToggle:o,onStartRename:d,onCommitRename:h,onCancelRename:p,onDelete:m}){return c?i.jsx("div",{className:"row",style:ex,children:i.jsx("div",{className:"row__main",children:i.jsx(fa,{value:s.name,placeholder:"Название папки",onCommit:h,onCancel:p})})}):i.jsxs("div",{className:"row",style:ex,children:[i.jsxs("button",{className:"row__main",style:hS,"aria-expanded":r,title:r?`Свернуть папку «${s.name}»`:`Развернуть папку «${s.name}»`,onClick:o,children:[i.jsx(hy,{open:r}),i.jsx("span",{style:pS,children:s.name}),i.jsx("span",{className:"sidebar__count",children:l})]}),i.jsx("button",{className:"row__edit",title:"Переименовать папку","aria-label":`Переименовать папку «${s.name}»`,onClick:d,children:"✎"}),i.jsx("button",{className:"row__edit",title:"Удалить папку — содержимое останется, просто станет без папки","aria-label":`Удалить папку «${s.name}»`,onClick:m,children:"✕"})]})}function hy({open:s}){return i.jsx("svg",{className:s?"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:i.jsx("path",{d:"M6 3.5 10.5 8 6 12.5"})})}function py({className:s}){return i.jsxs("svg",{className:s,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("rect",{x:"4.5",y:"2.4",width:"7",height:"4.2",rx:"1.6"}),i.jsx("path",{d:"M5.4 6.6 8 12.2 10.6 6.6"}),i.jsx("path",{d:"M8 12.2v1.4"})]})}function gS(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[i.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),i.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}function bS(){return i.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round","aria-hidden":"true",children:i.jsx("path",{d:"M8 3.2v9.6M3.2 8h9.6"})})}function xS(){try{const s=localStorage.getItem(oy);if(s===null)return["archive","workspacesArchive"];const l=JSON.parse(s);return Array.isArray(l)?l.filter(r=>r==="workspaces"||r==="workspacesArchive"||r==="sessions"||r==="archive"||r==="pinned"):["archive","workspacesArchive"]}catch{return["archive","workspacesArchive"]}}function yS(){try{const s=localStorage.getItem(dy);if(s===null)return[];const l=JSON.parse(s);return Array.isArray(l)?l.filter(r=>typeof r=="string"):[]}catch{return[]}}function _S(){try{return localStorage.getItem(fy)==="pinned"?"pinned":"default"}catch{return"default"}}const tx={system:"как в системе",light:"светлая",dark:"тёмная"};function vS({mode:s}){const l={viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0};return s==="dark"?i.jsx("svg",{...l,children:i.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"})}):s==="light"?i.jsxs("svg",{...l,children:[i.jsx("circle",{cx:"8",cy:"8",r:"3.1"}),i.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"})]}):i.jsxs("svg",{...l,children:[i.jsx("rect",{x:"1.8",y:"2.6",width:"12.4",height:"8.4",rx:"1.4"}),i.jsx("path",{d:"M5.6 13.4h4.8"})]})}function SS(s){switch(s.state){case"running":return"работает";case"waiting_permission":return"ждёт разрешения";case"idle":return s.backgroundWork?"работает в фоне":jS(s.lastTurn);case"starting":return"запускается";case"reconnecting":return"переподключается";case"error":return"ошибка";case"closed":return"на диске"}}function jS(s){switch(s){case"interrupted":return"прервана";case"stopped":return"остановлена";case"failed":return"оборвалась";case"completed":return"готова";case null:return"ждёт задачу"}}function kS(s){switch(s.state){case"running":return"running";case"starting":return"starting";case"reconnecting":return"reconnecting";case"waiting_permission":return"waiting";case"idle":return s.backgroundWork?"background":wS(s.lastTurn);case"error":return"error";case"closed":return"closed"}}function wS(s){switch(s){case"interrupted":case"stopped":return"halted";case"failed":return"error";case"completed":return"ready";case null:return"fresh"}}function nx({session:s,tail:l}){return i.jsxs("span",{className:"row__meta",children:[i.jsxs("span",{className:`row__state row__state--${kS(s)}`,children:[i.jsx("span",{className:"row__state-dot","aria-hidden":"true"}),SS(s)]})," · ",l]})}function _h({title:s,pinned:l,projectName:r,projectPath:c}){return i.jsxs("span",{className:"row__head",children:[i.jsxs("span",{className:"row__title",children:[l&&i.jsx(py,{className:"row__pin"}),s]}),i.jsx("span",{className:"row__project",title:c,children:r})]})}function NS(s){const l=s.archivedAuto?"сама, по сроку молчания":"убрана вручную";return s.archivedAt?`${new Date(s.archivedAt).toLocaleString()} · ${l}`:l}function TS(s){return s.archivedAt?`закрыт ${new Date(s.archivedAt).toLocaleString()}`:"закрыт"}const lx=3,ES=15e5;function my(s,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(s==="Write"){if(typeof r.content!="string")return null;const o=vh(r.content).map(d=>({type:"add",text:d}));return{kind:"create",filePath:c,rows:o,added:o.length,removed:0,note:"файл записывается целиком"}}if(s==="Edit"){if(typeof r.old_string!="string"||typeof r.new_string!="string")return null;const o=MS(AS(vh(r.old_string),vh(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 vh(s){if(s==="")return[];const l=s.split(/\r?\n/);return l.length>1&&l[l.length-1]===""&&l.pop(),l}function AS(s,l){let r=0;for(;r<s.length&&r<l.length&&s[r]===l[r];)r++;let c=s.length,o=l.length;for(;c>r&&o>r&&s[c-1]===l[o-1];)c--,o--;const d=h=>({type:"ctx",text:h});return[...s.slice(0,r).map(d),...CS(s.slice(r,c),l.slice(r,o)),...s.slice(c).map(d)]}function CS(s,l){if(s.length===0&&l.length===0)return[];if(s.length===0)return l.map(_=>({type:"add",text:_}));if(l.length===0)return s.map(_=>({type:"del",text:_}));if((s.length+1)*(l.length+1)>ES)return[...s.map(_=>({type:"del",text:_})),...l.map(_=>({type:"add",text:_}))];const r=s.length,c=l.length,o=c+1,d=new Uint32Array((r+1)*o),h=(_,j)=>d[_*o+j]??0;for(let _=r-1;_>=0;_--)for(let j=c-1;j>=0;j--)d[_*o+j]=s[_]===l[j]?h(_+1,j+1)+1:Math.max(h(_+1,j),h(_,j+1));const p=[];let m=0,x=0;for(;m<r&&x<c;){const _=s[m],j=l[x];_===j?(p.push({type:"ctx",text:_}),m++,x++):h(m+1,x)>=h(m,x+1)?(p.push({type:"del",text:_}),m++):(p.push({type:"add",text:j}),x++)}for(;m<r;)p.push({type:"del",text:s[m++]});for(;x<c;)p.push({type:"add",text:l[x++]});return RS(p)}function RS(s){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 s)o.type==="ctx"?(c(),l.push(o)):r.push(o);return c(),l}function MS(s){if(!s.some(d=>d.type!=="ctx"))return s;const l=s.map(()=>!1);s.forEach((d,h)=>{if(d.type!=="ctx")for(let p=Math.max(0,h-lx);p<=Math.min(s.length-1,h+lx);p++)l[p]=!0});const r=[];let c=[];function o(){c.length===1?r.push(...c):c.length>1&&r.push({type:"gap",text:`⋯ ${c.length} ${OS(c.length)} без изменений`}),c=[]}return s.forEach((d,h)=>{l[h]?(o(),r.push(d)):c.push(d)}),o(),r}function OS(s){const l=s%100;if(l>=11&&l<=14)return"строк";switch(s%10){case 1:return"строка";case 2:case 3:case 4:return"строки";default:return"строк"}}async function $r(s){try{return await navigator.clipboard.writeText(s),!0}catch{}const l=document.createElement("textarea");l.value=s,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 Bh(){try{return await navigator.clipboard.readText()}catch{return null}}const np=1600,Hi="Копировать",zr="Скопировано";function lp({text:s,hint:l,className:r}){const[c,o]=y.useState(!1);return y.useEffect(()=>{if(!c)return;const d=setTimeout(()=>o(!1),np);return()=>clearTimeout(d)},[c]),y.useEffect(()=>o(!1),[s]),i.jsx("button",{type:"button",className:"copybtn"+(c?" copybtn--done":"")+(r?` ${r}`:""),"aria-label":c?zr:`${Hi} ${l}`,title:c?zr:`${Hi} ${l}`,onClick:()=>{$r(s).then(d=>{d&&o(!0)})},children:c?zr:Hi})}function sp({diff:s}){return i.jsxs("div",{className:"diff",children:[i.jsxs("div",{className:"diff__head",children:[i.jsx("span",{className:"diff__path",title:s.filePath,children:s.filePath}),i.jsxs("span",{className:"diff__stat",children:[s.added>0&&i.jsxs("span",{className:"diff__stat--add",children:["+",s.added]}),s.removed>0&&i.jsxs("span",{className:"diff__stat--del",children:["−",s.removed]})]})]}),s.note&&i.jsx("div",{className:"diff__note",children:s.note}),i.jsx("div",{className:"diff__body",children:s.rows.length===0?i.jsx("div",{className:"diff__row diff__row--gap",children:i.jsx("span",{className:"diff__text",children:"пустое содержимое"})}):s.rows.map((l,r)=>i.jsxs("div",{className:`diff__row diff__row--${l.type}`,children:[i.jsx("span",{className:"diff__mark","aria-hidden":"true",children:l.type==="add"?"+":l.type==="del"?"−":""}),i.jsx("span",{className:"diff__text",children:l.text===""?" ":l.text})]},r))})]})}function DS({waiting:s}){const[l,r]=y.useState(0);return y.useEffect(()=>{const c=window.setInterval(()=>r(o=>o+1),1e3);return()=>window.clearInterval(c)},[]),i.jsxs("div",{className:s?"work work--wait":"work",children:[i.jsxs("span",{className:"work__dots","aria-hidden":"true",children:[i.jsx("span",{className:"work__dot"}),i.jsx("span",{className:"work__dot"}),i.jsx("span",{className:"work__dot"})]}),i.jsx("span",{className:"work__label",children:s?"ждёт разрешения":"думает"}),!s&&i.jsxs("span",{className:"work__time",children:[l," с"]})]})}function ap({items:s,busy:l,waiting:r,history:c=[],historyHasMore:o=!1,historyLoading:d=!1,onLoadHistory:h,sessionId:p,onEditMessage:m,empty:x="Сессия пуста. Опишите задачу — Claude Code работает в каталоге проекта с полным набором инструментов."}){const _=y.useRef(null),j=y.useRef(null),v=y.useRef(!0),E=y.useRef(null),k=y.useRef(null),O=y.useRef(!1);y.useEffect(()=>{v.current=!0,E.current=null,O.current=!1,k.current!==null&&(clearTimeout(k.current),k.current=null)},[p]),y.useEffect(()=>{const M=_.current,F=j.current;if(!M||!F)return;function H(ae){!M||ae===M.scrollTop||(O.current=!0,M.scrollTop=ae)}function A(){if(!M)return;const ae=E.current;if(ae){const G=ax(M,ae.id);if(G){const J=G.getBoundingClientRect().top-M.getBoundingClientRect().top;H(M.scrollTop+(J-ae.top))}k.current!==null&&clearTimeout(k.current),k.current=setTimeout(()=>{E.current=null},500);return}v.current&&H(M.scrollHeight)}const Z=new ResizeObserver(A);return Z.observe(F),()=>{Z.disconnect(),k.current!==null&&clearTimeout(k.current)}},[]);function z(){const M=_.current;if(M){if(O.current){O.current=!1;return}v.current=M.scrollHeight-M.scrollTop-M.clientHeight<80}}function ee(){if(d)return;const M=_.current,F=c[0];if(M&&F){const H=ax(M,F.id);H&&(E.current={id:F.id,top:H.getBoundingClientRect().top-M.getBoundingClientRect().top})}h==null||h()}let te=0;function K(M){return M.kind==="user"?te++:-1}return i.jsx("div",{className:"transcript",ref:_,onScroll:z,children:i.jsxs("div",{className:"stream",ref:j,children:[o&&i.jsx("button",{type:"button",className:"transcript__more",onClick:ee,disabled:d,children:d?"Загружаем…":"Показать более раннее"}),c.map(M=>i.jsx(sx,{item:M,userIndex:K(M),onEditMessage:m},M.id)),c.length>0&&s.length>0&&i.jsx("div",{className:"transcript__divider",children:i.jsx("span",{children:"дальше — сессия открыта заново"})}),c.length===0&&s.length===0&&i.jsx("p",{className:"empty",children:x}),s.map(M=>i.jsx(sx,{item:M,userIndex:K(M),onEditMessage:m},M.id)),l&&i.jsx(DS,{waiting:r})]})})}function sx({item:s,userIndex:l,onEditMessage:r}){switch(s.kind){case"user":return i.jsx(zS,{item:s,userIndex:l,onEditMessage:r});case"assistant":return i.jsxs("div",{className:"msg--assistant","data-item-id":s.id,children:[i.jsx(US,{text:s.text}),s.streaming&&i.jsx("span",{className:"caret"}),s.text.trim()!==""&&i.jsx("div",{className:"msg--assistant__foot",children:i.jsx(lp,{text:s.text,hint:"ответ целиком"})})]});case"thinking":return i.jsx("div",{className:"thinking","data-item-id":s.id,children:s.text});case"tool":return i.jsx(BS,{item:s});case"result":return i.jsxs("div",{className:"result-line","data-item-id":s.id,children:[i.jsx("span",{children:s.isError?"✗ "+s.subtype:"✓ готово"}),i.jsxs("span",{children:[(s.durationMs/1e3).toFixed(1)," с"]}),s.costUsd!==null&&i.jsxs("span",{children:["$",s.costUsd.toFixed(4)]}),i.jsxs("span",{children:["↑",rx(s.inputTokens)," ↓",rx(s.outputTokens)]})]});case"notice":return i.jsx("div",{className:s.tone==="error"?"notice notice--error":"notice","data-item-id":s.id,children:s.text})}}const LS=500;function zS({item:s,userIndex:l,onEditMessage:r}){const[c,o]=y.useState(null),[d,h]=y.useState(!1),[p,m]=y.useState(s.text),x=y.useRef(null),_=uf("(max-width: 860px)"),j=y.useRef(null);function v(A,Z){o({x:A,y:Z})}function E(A){A.preventDefault(),v(A.clientX,A.clientY)}function k(A){const Z=A.touches[0];if(!Z)return;const ae={timer:0,x:Z.clientX,y:Z.clientY,fired:!1};ae.timer=window.setTimeout(()=>{ae.fired=!0,v(ae.x,ae.y)},LS),j.current=ae}function O(A){const Z=j.current,ae=A.touches[0];!Z||!ae||Math.hypot(ae.clientX-Z.x,ae.clientY-Z.y)>10&&(window.clearTimeout(Z.timer),j.current=null)}function z(A){const Z=j.current;Z&&(window.clearTimeout(Z.timer),Z.fired&&A.preventDefault())}function ee(){m(s.text),h(!0)}function te(){h(!1)}function K(){const A=p.trim();A===""&&!(s.images&&s.images.length>0)||(r==null||r(l,A,s.images),h(!1))}y.useEffect(()=>{const A=x.current;!A||!d||(A.style.height="auto",A.style.height=`${A.scrollHeight}px`)},[p,d]),y.useEffect(()=>{if(!d)return;const A=x.current;A&&(A.focus(),A.setSelectionRange(A.value.length,A.value.length))},[d]);function M(A){if(A.key==="Escape"){A.preventDefault(),A.stopPropagation(),te();return}A.key==="Enter"&&!A.shiftKey&&!_&&(A.preventDefault(),K())}const F=s.images&&s.images.length>0&&i.jsx("div",{className:"msg--user__images",children:s.images.map((A,Z)=>i.jsx("img",{className:"msg--user__image",src:`data:${A.mediaType};base64,${A.data}`,alt:"Вложение"},Z))});if(d){const A=p.trim()!==""||!!(s.images&&s.images.length>0);return i.jsxs("div",{className:"msg--user msg--user--editing","data-item-id":s.id,children:[F,i.jsxs("div",{className:"msg--user__edit",children:[i.jsx("textarea",{ref:x,className:"msg--user__edit-field",value:p,onChange:Z=>m(Z.target.value),onKeyDown:M,rows:1}),i.jsxs("div",{className:"msg--user__edit-actions",children:[i.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:te,children:"Отмена"}),i.jsx("button",{type:"button",className:"btn btn--sm btn--primary",onClick:K,disabled:!A,children:"Сохранить"})]})]})]})}const H=[{id:"copy",label:"Копировать",onSelect:()=>void $r(s.text)},...r?[{id:"edit",label:"Изменить",onSelect:ee}]:[]];return i.jsxs("div",{className:"msg--user","data-item-id":s.id,onContextMenu:E,onTouchStart:k,onTouchMove:O,onTouchEnd:z,onTouchCancel:z,children:[F,s.text,c&&i.jsx(Mr,{x:c.x,y:c.y,items:H,onClose:()=>o(null)})]})}function ax(s,l){const r=s.querySelectorAll("[data-item-id]");for(const c of r)if(c.dataset.itemId===l)return c;return null}function US({text:s}){const[l,r]=y.useState(""),c=y.useRef([]);y.useEffect(()=>{let d=!1;return tp(s).then(h=>{d||r(HS(h))}),()=>{d=!0}},[s]),y.useEffect(()=>{const d=c.current;return()=>d.forEach(h=>clearTimeout(h))},[]);function o(d){var m,x;const h=d.target.closest(".codeblock__copy");if(!(h instanceof HTMLElement))return;const p=((x=(m=h.parentElement)==null?void 0:m.querySelector("pre"))==null?void 0:x.textContent)??"";p!==""&&$r(p).then(_=>{if(!_)return;h.textContent=zr,h.setAttribute("aria-label",zr),h.classList.add("copybtn--done");const j=window.setTimeout(()=>{h.isConnected&&(h.textContent=Hi,h.setAttribute("aria-label",Ih),h.classList.remove("copybtn--done"))},np);c.current.push(j)})}return i.jsx("div",{className:"markdown-preview msg--assistant__body",onClick:o,dangerouslySetInnerHTML:{__html:l}})}const Ih=`${Hi} блок кода`;function HS(s){if(!s.includes("<pre"))return s;const l=new DOMParser().parseFromString(s,"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",Ih),o.title=Ih,o.textContent=Hi,c.append(o)}return l.body.innerHTML}function BS({item:s}){const[l,r]=y.useState(!1),c=s.result===null,o=my(s.name,s.input),d=s.name==="AskUserQuestion"?GS(s.input):null;return i.jsxs("div",{className:"tool"+(s.isError?" tool--error":"")+(s.awaitingPermission?" tool--wait":""),"data-item-id":s.id,children:[i.jsxs("button",{className:"tool__head",onClick:()=>r(h=>!h),children:[i.jsx("span",{className:"tool__name",children:s.name}),i.jsx("span",{className:"tool__arg",children:d?qS(d):IS(s.input)}),i.jsx("span",{className:"tool__status",children:c?"…":s.isError?"ошибка":l?"▴":"▾"})]}),l&&i.jsxs("div",{className:"tool__body",children:[d?i.jsx(YS,{questions:d,answers:s.answers}):o?i.jsx(sp,{diff:o}):i.jsx(ix,{text:JSON.stringify(s.input,null,2),hint:"аргументы вызова"}),s.result!==null&&(!d||s.isError)&&i.jsx(ix,{text:s.result,hint:"результат вызова",style:{marginTop:10}})]})]})}function ix({text:s,hint:l,style:r}){return i.jsxs("div",{className:"codeblock",style:r,children:[i.jsx("pre",{className:"code",children:s}),i.jsx(lp,{text:s,hint:l,className:"codeblock__copy"})]})}function IS(s){if(!s||typeof s!="object")return"";const l=s;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 qS(s){var r;const l=s.map(c=>c.header).filter(c=>c.length>0);return l.length===s.length?l.join(" · "):((r=s[0])==null?void 0:r.question.replace(/\s+/g," ").slice(0,160))??""}function GS(s){if(typeof s!="object"||s===null)return null;const l=s.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:p}=c;if(typeof o!="string"||!Array.isArray(h)||h.length===0)return null;const m=[];for(const x of h){if(typeof x!="object"||x===null)return null;const{label:_,description:j,preview:v}=x;if(typeof _!="string"||typeof j!="string")return null;m.push({label:_,description:j,...typeof v=="string"?{preview:v}:{}})}r.push({question:o,header:typeof d=="string"?d:"",options:m,multiSelect:p===!0})}return r}function YS({questions:s,answers:l}){return i.jsx("div",{className:"tool__questions",children:s.map((r,c)=>i.jsxs("div",{className:"tool__question",children:[i.jsxs("div",{className:"tool__question-head",children:[r.header&&i.jsx("span",{className:"chip chip--accent",children:r.header}),i.jsx("span",{className:"tool__question-text",children:r.question})]}),i.jsx("div",{className:"tool__question-answer",children:l!=null&&l[r.question]?i.jsx("span",{className:"tool__answer-value",children:l[r.question]}):i.jsx("span",{className:"tool__answer-empty",children:"не отвечено"})})]},c))})}function rx(s){return s>=1e3?`${(s/1e3).toFixed(1)}k`:String(s)}const XS="ccv.dictation.lang",cx="ru-RU";function VS(s){try{return Function.prototype.toString.call(s).includes("[native code]")}catch{return!1}}function ux(){const s=window,l=[s.SpeechRecognition,s.webkitSpeechRecognition].filter(c=>typeof c=="function"),r=l.find(VS);return!r&&l.length>0&&ms("распознавание подменено: родной реализации в странице нет"),r??l[0]??null}function gy(){var s;try{return((s=localStorage.getItem(XS))==null?void 0:s.trim())||cx}catch{return cx}}function ms(s,l){l===void 0?console.debug(`[dictation] ${s}`):console.debug(`[dictation] ${s}`,l)}const $S=3,QS=400,ZS=5,KS=250,FS=2e3,JS=2e4;async function WS(){try{return(await navigator.permissions.query({name:"microphone"})).state==="granted"}catch{return!1}}const PS={"not-allowed":"Браузер не дал доступ к микрофону","service-not-allowed":"Браузер не дал доступ к микрофону","audio-capture":"Микрофон не найден",network:"Сервис распознавания недоступен","language-not-supported":`Распознавание не знает языка ${gy()}`};function ej(s){const[l]=y.useState(()=>ux()!==null),[r,c]=y.useState(!1),[o,d]=y.useState(null),h=y.useRef(null),p=y.useRef(!1),m=y.useRef(!1),x=y.useRef(s),_=y.useRef({openedAt:0,audio:!1,heard:!1,everHeard:!1,silent:0,dead:0,lastError:"",warned:!1}),j=y.useRef(null),v=y.useRef(!1),E=y.useRef(null),k=y.useCallback(()=>{E.current&&clearTimeout(E.current),E.current=null},[]),O=y.useCallback(()=>{k();const M=async F=>{if(E.current=null,!(!p.current||v.current)){if(!F&&!await WS()){if(ms("ждём ответа на запрос доступа к микрофону"),!p.current||v.current)return;E.current=setTimeout(()=>void M(!0),JS);return}ms("движок не ответил на start()"),p.current=!1,c(!1),d("Распознавание не отвечает — проверьте расширения браузера и доступ к микрофону")}};E.current=setTimeout(()=>void M(!1),FS)},[k]);y.useEffect(()=>{x.current=s}),y.useEffect(()=>{const M=ux();if(!M)return;const F=new M;return F.lang=gy(),F.continuous=!0,F.interimResults=!0,F.onstart=()=>{ms("сессия открыта"),v.current=!0,k(),c(!0)},F.onaudiostart=()=>{ms("пошёл звук с микрофона"),_.current.audio=!0},F.onresult=H=>{var G;if(m.current)return;let A="",Z="";for(let J=H.resultIndex;J<H.results.length;J++){const D=H.results[J];if(!D)continue;const ge=((G=D[0])==null?void 0:G.transcript)??"";D.isFinal?A+=ge:Z+=ge}const ae=_.current;ae.heard=!0,ae.everHeard=!0,ms("распознано",{final:A,interim:Z}),x.current(A,Z)},F.onerror=H=>{_.current.lastError=H.error,ms("ошибка движка",H.error),!(H.error==="no-speech"||H.error==="aborted")&&(p.current=!1,c(!1),d(PS[H.error]??`Распознавание не работает: ${H.error}`))},F.onend=()=>{m.current=!1,v.current=!1;const H=_.current,A=Date.now()-H.openedAt;if(ms("сессия закрыта",{мс:A,звук:H.audio,слова:H.heard,ошибка:H.lastError||null}),!p.current){c(!1);return}if(H.dead=!H.audio&&A<QS?H.dead+1:0,H.dead>=ZS){p.current=!1,c(!1),d(H.lastError?`Распознавание не работает: ${H.lastError}`:"Распознавание закрывается сразу после запуска — проверьте доступ к микрофону в настройках сайта");return}H.silent=H.heard?0:H.silent+1,!H.everHeard&&!H.warned&&H.silent>=$S&&(H.warned=!0,d(H.audio?"Микрофон слушает, но речь не распознаётся — проверьте язык диктовки и уровень звука":"С микрофона не идёт звук — проверьте устройство ввода в настройках сайта в браузере")),j.current=setTimeout(()=>{if(j.current=null,!!p.current){H.openedAt=Date.now(),H.audio=!1,H.heard=!1,H.lastError="",O();try{F.start()}catch{}}},KS)},h.current=F,()=>{p.current=!1,j.current&&clearTimeout(j.current),j.current=null,k(),F.onend=null,F.onresult=null,F.onerror=null,F.onstart=null,F.onaudiostart=null,F.abort(),h.current=null}},[]);const z=y.useCallback(()=>{var M;if(p.current){if(p.current=!1,ms("выключение микрофона"),j.current&&clearTimeout(j.current),j.current=null,k(),!v.current){c(!1);return}(M=h.current)==null||M.stop()}},[]),ee=y.useCallback(()=>{const M=h.current;if(M){if(!window.isSecureContext){d("Микрофон доступен только по https или с localhost");return}d(null),p.current=!0,m.current=!1,j.current&&clearTimeout(j.current),j.current=null,_.current={openedAt:Date.now(),audio:!1,heard:!1,everHeard:!1,silent:0,dead:0,lastError:"",warned:!1},c(!0),ms("включение микрофона",{язык:M.lang}),O();try{M.start()}catch(F){ms("start() не прошёл",F)}}},[O]),te=y.useCallback(()=>{p.current?z():ee()},[ee,z]),K=y.useCallback(()=>{var M;p.current&&v.current&&(m.current=!0,(M=h.current)==null||M.abort())},[]);return{supported:l,listening:r,error:o,toggle:te,stop:z,drop:K}}const by="ccv:drafts",tj=40,nj=2e4,lj=500;let au=null,iu=null;function xy(){if(au)return au;const s=new Map;try{const l=localStorage.getItem(by);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!==""&&s.set(c,o)}}catch{}return au=s,window.addEventListener("pagehide",yy),s}function Sh(s){return xy().get(s)??""}function sj(s,l){const r=xy(),c=l.slice(0,nj),o=r.has(s);if(o&&r.delete(s),c!=="")r.set(s,c);else if(!o)return;for(;r.size>tj;){const d=r.keys().next();if(d.done)break;r.delete(d.value)}aj()}function aj(){iu===null&&(iu=window.setTimeout(yy,lj))}function yy(){if(iu!==null&&window.clearTimeout(iu),iu=null,!!au)try{localStorage.setItem(by,JSON.stringify(Object.fromEntries(au)))}catch{}}const ij="(max-width: 860px)",ox=/^\/(\S*)$/,rj=new Set(["model","permissions"]);function cj(s){return rj.has(s.name)||s.name.startsWith("__")}const uj=new Set(["clear","rename"]),fx=/(?:^|\s)@([^\s@]*)$/,oj=200,fj=100,dj=190,hj=5,pj=20*1024*1024,mj=1568,gj=.85;let dx=0;async function bj(s){var j,v;if(!s.type.startsWith("image/")||s.size>pj)return null;const l=await xj(s);if(!l)return null;const{width:r,height:c}=l;if(r<=0||c<=0)return null;const o=Math.min(1,mj/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 p=s.type==="image/png",m=p?"image/png":"image/jpeg",x=d.toDataURL(m,p?void 0:gj),_=x.slice(x.indexOf(",")+1);return _?(dx+=1,{id:`att${dx}`,mediaType:m,data:_,previewUrl:x}):null}async function xj(s){if(typeof createImageBitmap=="function")try{const l=await createImageBitmap(s);return{image:l,width:l.width,height:l.height}}catch{}return new Promise(l=>{const r=URL.createObjectURL(s),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 _y({disabled:s,busy:l,commands:r,sessionTitle:c,contextResult:o,className:d,placeholder:h,draftKey:p,sendLabel:m="Отправить",autoFocus:x=!1,attachmentsEnabled:_=!0,onContextSearch:j,onCommand:v,onSend:E,onInterrupt:k,onEscape:O}){var we;const z=uf(ij),[ee,te]=y.useState(()=>p?Sh(p):""),[K,M]=y.useState(!1),[F,H]=y.useState(0),A=y.useRef(null),Z=y.useRef(null),ae=y.useRef(null),[G,J]=y.useState(()=>p?Sh(p).length:0),[D,ge]=y.useState([]),Se=y.useRef(null),xe=y.useCallback(L=>{!_||L.length===0||Promise.all(L.map(bj)).then(V=>{const _e=V.filter(ze=>ze!==null);_e.length!==0&&ge(ze=>[...ze,..._e].slice(0,hj))})},[_]);function B(L){ge(V=>V.filter(_e=>_e.id!==L))}function ue(L){var ze;if(!_)return;const V=(ze=L.clipboardData)==null?void 0:ze.items;if(!V)return;const _e=[];for(const st of V){if(!st.type.startsWith("image/"))continue;const al=st.getAsFile();al&&_e.push(al)}_e.length!==0&&(L.preventDefault(),xe(_e))}function se(L){const V=L.target.files?Array.from(L.target.files):[];L.target.value="",xe(V)}y.useEffect(()=>{_||ge([])},[_]);const[be,Ce]=y.useState([]),[w,Q]=y.useState(-1),re=y.useRef(""),[oe,ye]=y.useState(""),je=ej(y.useCallback((L,V)=>{L&&te(_e=>jh(_e,L)),ye(V.trim())},[])),Me=oe?jh(ee,oe):ee;y.useEffect(()=>{je.listening||oe===""||(te(L=>jh(L,oe)),ye(""))},[je.listening,oe]),y.useEffect(()=>{var L;x&&((L=A.current)==null||L.focus())},[x]);const ht=y.useRef(new Map),lt=y.useRef(new Map),Nn=y.useRef(p),Je=y.useRef({text:ee,caret:G});Je.current={text:ee,caret:G};const Kt=y.useCallback((L,V,_e)=>{V===""?(ht.current.delete(L),lt.current.delete(L)):(ht.current.set(L,V),lt.current.set(L,_e)),sj(L,V)},[]),ct=je.drop;y.useLayoutEffect(()=>{const L=Nn.current;if(L===p)return;Nn.current=p,L&&Kt(L,Je.current.text,Je.current.caret);const V=p?ht.current.get(p)??Sh(p):"",_e=p?lt.current.get(p):void 0,ze=Math.min(_e??V.length,V.length);te(V),J(ze),ae.current=[ze,ze],ye(""),H(0),M(!1),Q(-1),re.current="",ge([]),ct()},[p,Kt,ct]),y.useEffect(()=>{p&&Kt(p,ee,G)},[p,ee,G,Kt]);const rn=s?"Выберите сессию":h??"Опишите задачу… («/» — команды, «@» — файлы)",Be=y.useRef(0),rt=y.useCallback(L=>{const V=parseFloat(getComputedStyle(L).maxHeight),_e=Number.isFinite(V)&&V>0?V:dj;L.style.height="auto";const ze=L.scrollHeight;L.style.height=`${Math.min(ze,_e)}px`,L.style.overflowY=ze>_e?"auto":"hidden"},[]);y.useEffect(()=>{const L=A.current;L&&rt(L)},[Me,rn,s,rt]),y.useLayoutEffect(()=>{const L=A.current,V=ae.current;!L||!V||(ae.current=null,L.setSelectionRange(V[0],V[1]))}),y.useEffect(()=>{const L=A.current;if(!L)return;const V=new ResizeObserver(([_e])=>{const ze=_e==null?void 0:_e.contentRect.width;ze===void 0||Math.abs(ze-Be.current)<1||(Be.current=ze,rt(L))});return V.observe(L),()=>V.disconnect()},[rt]);const Hn=je.stop;y.useEffect(()=>{s&&Hn()},[s,Hn]);const wt=y.useMemo(()=>je.error?{ok:!1,message:je.error}:null,[je.error]),Ot=y.useMemo(()=>{var _e;const L=(_e=ox.exec(ee))==null?void 0:_e[1];if(L===void 0)return[];const V=L.toLowerCase();return r.filter(ze=>!cj(ze)&&kh(ze,V)<vy).sort((ze,st)=>kh(ze,V)-kh(st,V))},[ee,r]),Ft=!K&&Ot.length>0,tn=Math.min(F,Ot.length-1),$t=K?null:((we=fx.exec(Me.slice(0,G)))==null?void 0:we[1])??null,Nt=y.useRef(j);Nt.current=j,y.useEffect(()=>{if($t===null||$t===""||$t.endsWith("/")){Nt.current($t);return}const L=setTimeout(()=>Nt.current($t),oj);return()=>clearTimeout(L)},[$t]);const Qe=$t!==null&&(o==null?void 0:o.query)===$t,We=Qe?o.entries:[],dn=$t!==null,Jt=dn&&!Qe,Qt=Math.min(F,Math.max(We.length-1,0));y.useEffect(()=>{var V,_e;if(!Ft&&!dn)return;const L=Ft?tn:Qt;(_e=(V=Z.current)==null?void 0:V.children[L])==null||_e.scrollIntoView({block:"nearest"})},[Ft,dn,tn,Qt]);function Bn(L,V){var _e;te(L),J(V),ae.current=[V,V],H(0),M(!1),oe!==""&&(ye(""),je.drop()),(_e=A.current)==null||_e.focus()}function Tn(){te(""),ye(""),H(0),J(0),M(!1),Q(-1),re.current="",ge([]),je.drop(),p&&Kt(p,"",0)}function hn(L){const V=L.trim();V===""&&D.length===0||s||(E(V,D.length>0?D.map(_e=>({mediaType:_e.mediaType,data:_e.data})):void 0),V!==""&&Ce(_e=>[V,..._e.filter(ze=>ze!==V)].slice(0,fj)),Tn())}function sl(L){if(L<-1||L>=be.length)return;w===-1&&(re.current=ee);const V=L===-1?re.current:be[L]??"";Q(L),Bn(V,V.length)}function zt(){var ze;const L=((ze=A.current)==null?void 0:ze.selectionStart)??Me.length,_e=`${L>0&&!/\s$/.test(Me.slice(0,L))?" ":""}@`;Bn(Me.slice(0,L)+_e+Me.slice(L),L+_e.length)}function bt(L){var st;const V=(st=fx.exec(Me.slice(0,G)))==null?void 0:st[1];if(V===void 0)return;const _e=G-V.length-1,ze=L.kind==="dir"?`@${L.path}/`:`@${L.path} `;Bn(Me.slice(0,_e)+ze+Me.slice(G),_e+ze.length)}function Ut(){var V;const L=(V=ox.exec(Me.trim()))==null?void 0:V[1];if(L&&v(L)){Tn();return}hn(Me)}function $e(L,V){te(L),J(V),H(0),M(!1),Q(-1),oe!==""&&(ye(""),je.drop())}function Qn(L){var ze;const V=uj.has(L.name)?c:null,_e=`/${L.name} `;te(_e+(V??"")),J(_e.length+((V==null?void 0:V.length)??0)),V&&(ae.current=[_e.length,_e.length+V.length]),H(0),(ze=A.current)==null||ze.focus()}function W(L){if(v(L.name)){te(""),H(0),M(!1);return}L.argumentHint?Qn(L):hn(`/${L.name}`)}function de(L){if(Ft){if(L.key==="ArrowDown")return L.preventDefault(),H(V=>(Math.min(V,Ot.length-1)+1)%Ot.length);if(L.key==="ArrowUp"){L.preventDefault();const V=Ot.length-1;return H(_e=>(Math.min(_e,V)+V)%Ot.length)}if(L.key==="Enter"&&!L.shiftKey){L.preventDefault();const V=Ot[tn];V&&W(V);return}if(L.key==="Tab"){L.preventDefault();const V=Ot[tn];V&&Qn(V);return}if(L.key==="Escape"){L.preventDefault(),L.stopPropagation(),M(!0);return}}if(dn){if(L.key==="ArrowDown"&&We.length>0)return L.preventDefault(),H(V=>(Math.min(V,We.length-1)+1)%We.length);if(L.key==="ArrowUp"&&We.length>0){L.preventDefault();const V=We.length-1;return H(_e=>(Math.min(_e,V)+V)%We.length)}if(L.key==="Enter"&&!L.shiftKey||L.key==="Tab"){const V=We[Qt];if(V){L.preventDefault(),bt(V);return}if(L.key==="Tab")return}if(L.key==="Escape"){L.preventDefault(),L.stopPropagation(),M(!0);return}}if((L.key==="ArrowUp"||L.key==="ArrowDown")&&!L.shiftKey){const V=L.currentTarget,_e=V.selectionStart;if(V.selectionEnd===_e){const st=L.key==="ArrowUp"?w+1:w-1;st>=-1&&st<be.length&&requestAnimationFrame(()=>{V.selectionStart===_e&&V.selectionEnd===_e&&sl(st)})}}if(L.key==="Escape"&&O){L.preventDefault(),L.stopPropagation(),O();return}L.key==="Enter"&&!L.shiftKey&&!z&&(L.preventDefault(),Ut())}return i.jsx("div",{className:d?`composer ${d}`:"composer",children:i.jsxs("div",{className:"composer__inner",children:[i.jsx(qi,{result:wt}),dn&&!Ft&&i.jsxs("div",{className:"cmdmenu",role:"listbox",ref:Z,children:[We.map((L,V)=>i.jsxs("button",{role:"option","aria-selected":V===Qt,className:V===Qt?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>H(V),onMouseDown:_e=>{_e.preventDefault(),bt(L)},children:[i.jsxs("span",{className:"cmdmenu__name",children:[L.name,L.kind==="dir"?"/":""]}),i.jsx("span",{className:"cmdmenu__desc",children:L.path}),L.ignored&&i.jsx("span",{className:"cmdmenu__tag",children:"git-ignore"})]},L.path)),We.length===0&&i.jsx("div",{className:"cmdmenu__empty",children:Jt?"ищем…":$t?"Ничего не нашлось":"Наберите имя файла или каталога"})]}),Ft&&i.jsx("div",{className:"cmdmenu",role:"listbox",ref:Z,children:Ot.map((L,V)=>i.jsxs("button",{role:"option","aria-selected":V===tn,className:V===tn?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>H(V),onMouseDown:_e=>{_e.preventDefault(),W(L)},children:[i.jsxs("span",{className:"cmdmenu__name",children:["/",L.name]}),L.argumentHint&&i.jsx("span",{className:"cmdmenu__hint",children:L.argumentHint}),i.jsx("span",{className:"cmdmenu__desc",children:L.description})]},L.name))}),D.length>0&&i.jsx("div",{className:"composer__attachments",children:D.map(L=>i.jsxs("div",{className:"composer__thumb",children:[i.jsx("img",{src:L.previewUrl,alt:"Вложение"}),i.jsx("button",{type:"button",className:"composer__thumb-remove","aria-label":"Удалить вложение",onClick:()=>B(L.id),children:i.jsx(kj,{})})]},L.id))}),i.jsxs("div",{className:"composer__field",children:[i.jsx("button",{type:"button",className:"addbtn",title:"Добавить контекст — файл проекта («@»)","aria-label":"Добавить контекст",disabled:s,onClick:zt,children:i.jsx(vj,{})}),_&&i.jsxs(i.Fragment,{children:[i.jsx("input",{ref:Se,type:"file",accept:"image/*",multiple:!0,className:"composer__fileinput",tabIndex:-1,"aria-hidden":"true",onChange:se}),i.jsx("button",{type:"button",className:"attachbtn",title:"Прикрепить изображение","aria-label":"Прикрепить изображение",disabled:s,onClick:()=>{var L;return(L=Se.current)==null?void 0:L.click()},children:i.jsx(jj,{})})]}),i.jsx("textarea",{ref:A,value:Me,disabled:s,placeholder:rn,onChange:L=>$e(L.target.value,L.target.selectionStart),onSelect:L=>J(L.currentTarget.selectionStart),onKeyDown:de,onPaste:ue}),je.supported&&i.jsx("button",{type:"button",className:je.listening?"micbtn is-on":"micbtn",title:je.listening?"Остановить диктовку":"Продиктовать промпт","aria-label":je.listening?"Остановить диктовку":"Продиктовать промпт","aria-pressed":je.listening,disabled:s,onClick:je.toggle,children:i.jsx(wj,{on:je.listening})}),l?i.jsx("button",{className:"btn",onClick:k,title:"Прервать (Esc)",children:"Стоп"}):i.jsxs("button",{className:"btn btn--primary sendbtn",onClick:Ut,disabled:s||Me.trim()===""&&D.length===0,"aria-label":m,title:m,children:[i.jsx("span",{className:"sendbtn__label",children:m}),i.jsx(Sj,{})]})]})]})})}function jh(s,l){const r=l.trim();if(r==="")return s;const c=qh(r).slice(yj(s,r)).join(" ");return c===""?s:s===""||/\s$/.test(s)?s+c:`${s} ${c}`}function yj(s,l){const r=qh(s),c=qh(l);for(let o=Math.min(r.length,c.length);o>0;o--)if(r.slice(r.length-o).every((d,h)=>_j(d,c[h]??"")))return o;return 0}function qh(s){return s.split(/\s+/).filter(l=>l!=="")}function _j(s,l){const r=c=>c.toLowerCase().replace(/[.,!?;:…]+$/u,"");return r(s)===r(l)}function vj(){return i.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round","aria-hidden":"true",children:i.jsx("path",{d:"M8 3.4v9.2M3.4 8h9.2"})})}function Sj(){return i.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:i.jsx("path",{d:"M8 12.5V3.5M4 7.5 8 3.5l4 4"})})}function jj(){return i.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:i.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 kj(){return i.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round","aria-hidden":"true",children:i.jsx("path",{d:"M4 4l8 8M12 4l-8 8"})})}function wj({on:s}){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("rect",{x:"5.9",y:"1.7",width:"4.2",height:"7.6",rx:"2.1",fill:s?"currentColor":"none"}),i.jsx("path",{d:"M3.3 7.3v.8a4.7 4.7 0 0 0 9.4 0v-.8"}),i.jsx("path",{d:"M8 12.8v1.5"})]})}const vy=4;function kh(s,l){const r=s.name.toLowerCase();return r===l?0:r.startsWith(l)?1:s.aliases.some(c=>c.toLowerCase().startsWith(l))?2:r.includes(l)?3:vy}function Nj({request:s,queued:l,onDecide:r}){const c=my(s.toolName,s.input);return i.jsx("div",{className:"modal-backdrop modal-backdrop--sheet",children:i.jsxs("div",{className:"sheet",role:"dialog","aria-modal":"true",children:[i.jsxs("div",{className:"sheet__head",children:["Разрешить действие?",l>0&&` (ещё ${l} в очереди)`]}),i.jsxs("div",{className:"sheet__body",children:[i.jsx("div",{className:"sheet__tool",children:s.toolName}),s.reason&&i.jsx("p",{className:"sheet__reason",children:s.reason}),c?i.jsx(sp,{diff:c}):i.jsx("pre",{className:"code",children:JSON.stringify(s.input,null,2)})]}),i.jsxs("div",{className:"sheet__actions",children:[i.jsx("button",{className:"btn",onClick:()=>r(s.requestId,"deny"),children:"Отклонить"}),i.jsx("button",{className:"btn btn--warn",autoFocus:!0,onClick:()=>r(s.requestId,"allow"),children:"Разрешить"})]})]})})}function Tj({request:s,queued:l,onAnswer:r,onDecline:c}){const{questions:o}=s,[d,h]=y.useState(()=>o.map(()=>new Set)),[p,m]=y.useState(()=>o.map(()=>"")),[x,_]=y.useState(()=>hx(o));y.useEffect(()=>{h(o.map(()=>new Set)),m(o.map(()=>"")),_(hx(o))},[s.requestId]);const j=y.useMemo(()=>Aj(o,d,p),[o,d,p]),v=j!==null;function E(K,M){var F,H;(H=(F=o[K])==null?void 0:F.options[M])!=null&&H.preview&&_(A=>{const Z=A.slice();return Z[K]=M,Z})}function k(K,M,F){h(H=>{const A=H.slice(),Z=new Set(A[K]);return F?Z.has(M)?Z.delete(M):Z.add(M):Z.has(M)||(Z.clear(),Z.add(M)),A[K]=Z,A}),M!=="other"&&E(K,M)}function O(K,M){m(F=>{const H=F.slice();return H[K]=M,H})}function z(){j&&r(s.requestId,j)}function ee(K){K.key==="Enter"&&(K.target.closest("button")||v&&(K.preventDefault(),z()))}function te(K){var A;if(!["ArrowDown","ArrowUp","ArrowRight","ArrowLeft"].includes(K.key))return;const M=Array.from(K.currentTarget.querySelectorAll("button.qsheet__option")),F=M.indexOf(document.activeElement);if(F===-1)return;K.preventDefault();const H=K.key==="ArrowDown"||K.key==="ArrowRight"?1:-1;(A=M[(F+H+M.length)%M.length])==null||A.focus()}return i.jsx("div",{className:"modal-backdrop modal-backdrop--sheet",children:i.jsxs("div",{className:"qsheet",role:"dialog","aria-modal":"true","aria-label":"Вопрос от Claude",onKeyDown:ee,children:[i.jsxs("div",{className:"qsheet__head",children:[i.jsx("span",{className:"qsheet__head-icon","aria-hidden":"true",children:"?"}),i.jsxs("span",{children:[o.length===1?"Уточняющий вопрос":`Уточняющие вопросы (${o.length})`,l>0&&` — ещё ${l} в очереди`]})]}),i.jsxs("div",{className:"qsheet__body",children:[s.reason&&i.jsx("p",{className:"qsheet__reason",children:s.reason}),o.map((K,M)=>i.jsx(Ej,{q:K,qi:M,selected:d[M]??new Set,otherText:p[M]??"",previewIndex:x[M]??null,onToggle:k,onFocusOption:E,onOtherText:O,onOptionsKeyDown:te},M))]}),i.jsxs("div",{className:"qsheet__actions",children:[i.jsx("button",{className:"btn",onClick:()=>c(s.requestId),children:"Не отвечать"}),i.jsx("button",{className:"btn btn--primary",disabled:!v,onClick:z,children:"Ответить"})]})]})})}function Ej({q:s,qi:l,selected:r,otherText:c,previewIndex:o,onToggle:d,onFocusOption:h,onOtherText:p,onOptionsKeyDown:m}){var E;const x=s.options.some(k=>k.preview),_=o!==null?(E=s.options[o])==null?void 0:E.preview:void 0,j=r.has("other"),v=s.multiSelect?"checkbox":"radio";return i.jsxs("div",{className:"qsheet__question",children:[i.jsxs("div",{className:"qsheet__qhead",children:[i.jsx("span",{className:"chip chip--accent",children:s.header}),i.jsx("span",{className:"qsheet__qtext",children:s.question})]}),i.jsxs("div",{className:"qsheet__options"+(s.multiSelect?"":" qsheet__options--radio"),role:s.multiSelect?"group":"radiogroup","aria-label":s.question,onKeyDown:m,children:[s.options.map((k,O)=>{const z=r.has(O);return i.jsxs("button",{type:"button",role:v,"aria-checked":z,className:"qsheet__option"+(z?" is-selected":""),onClick:()=>d(l,O,s.multiSelect),onFocus:()=>h(l,O),onMouseEnter:()=>h(l,O),children:[i.jsx("span",{className:"qsheet__opt-mark","aria-hidden":"true"}),i.jsxs("span",{className:"qsheet__opt-body",children:[i.jsx("span",{className:"qsheet__opt-label",children:k.label}),i.jsx("span",{className:"qsheet__opt-desc",children:k.description})]})]},O)}),i.jsxs("div",{className:"qsheet__other",children:[i.jsxs("button",{type:"button",role:v,"aria-checked":j,className:"qsheet__option qsheet__option--other"+(j?" is-selected":""),onClick:()=>d(l,"other",s.multiSelect),children:[i.jsx("span",{className:"qsheet__opt-mark","aria-hidden":"true"}),i.jsxs("span",{className:"qsheet__opt-body",children:[i.jsx("span",{className:"qsheet__opt-label",children:"Другое"}),i.jsx("span",{className:"qsheet__opt-desc",children:"Свой вариант ответа"})]})]}),j&&i.jsx("input",{type:"text",className:"qsheet__other-input",placeholder:"Впишите свой вариант…","aria-label":`Свой вариант ответа на вопрос «${s.question}»`,value:c,onChange:k=>p(l,k.target.value),autoFocus:!0})]})]}),x&&i.jsx("pre",{className:"qsheet__preview",children:_??""})]})}function hx(s){return s.map(l=>{const r=l.options.findIndex(c=>c.preview);return r===-1?null:r})}function Aj(s,l,r){const c={};for(let o=0;o<s.length;o++){const d=s[o];if(!d)continue;const h=l[o]??new Set,p=[];for(let m=0;m<d.options.length;m++){const x=d.options[m];x&&h.has(m)&&p.push(x.label)}if(h.has("other")){const m=(r[o]??"").trim();m&&p.push(m)}if(p.length===0)return null;c[d.question]=p.join(", ")}return c}function Cj({request:s,plan:l,queued:r,onAccept:c,onDecline:o}){const[d,h]=y.useState(l),[p,m]=y.useState("preview");y.useEffect(()=>{h(l),m("preview")},[s.requestId,l]);const x=d.trim().length>0;function _(){x&&c(s.requestId,d)}return i.jsx("div",{className:"modal-backdrop modal-backdrop--sheet",children:i.jsxs("div",{className:"plansheet",role:"dialog","aria-modal":"true","aria-label":"План агента",children:[i.jsxs("div",{className:"plansheet__head",children:[i.jsx("span",{className:"plansheet__head-icon","aria-hidden":"true",children:i.jsx(Mj,{})}),i.jsxs("span",{className:"plansheet__head-text",children:["План на согласование",r>0&&` — ещё ${r} в очереди`]}),i.jsxs("div",{className:"plansheet__viewtoggle",role:"tablist","aria-label":"Режим просмотра",children:[i.jsx("button",{className:"btn btn--sm"+(p==="preview"?" is-on":""),role:"tab","aria-selected":p==="preview",onClick:()=>m("preview"),children:"Просмотр"}),i.jsx("button",{className:"btn btn--sm"+(p==="source"?" is-on":""),role:"tab","aria-selected":p==="source",onClick:()=>m("source"),children:"Код"})]})]}),i.jsxs("div",{className:"plansheet__body",children:[s.reason&&i.jsx("p",{className:"plansheet__reason",children:s.reason}),i.jsx("div",{className:"plansheet__content",children:p==="preview"?i.jsx(Rj,{text:d}):i.jsx("textarea",{className:"plansheet__source",value:d,onChange:j=>h(j.target.value),spellCheck:!1,"aria-label":"Текст плана — можно отредактировать перед тем, как согласиться",autoFocus:!0})})]}),i.jsxs("div",{className:"plansheet__actions",children:[i.jsx("button",{className:"btn",onClick:()=>o(s.requestId),children:"Доработать"}),i.jsx("button",{className:"btn btn--ok",disabled:!x,autoFocus:!0,onClick:_,children:"Одобрить план"})]})]})})}function Rj({text:s}){const[l,r]=y.useState("");return y.useEffect(()=>{let c=!1;return tp(s).then(o=>{c||r(o)}),()=>{c=!0}},[s]),i.jsx("div",{className:"markdown-preview plansheet__preview",dangerouslySetInnerHTML:{__html:l}})}function Mj(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.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"}),i.jsx("path",{d:"M9.5 2.5v2.5a.5.5 0 0 0 .5.5h3"}),i.jsx("path",{d:"M5.6 8.6 7 10l3-3.2"})]})}function Oj(s,l){if(s!=="ExitPlanMode"||!l||typeof l!="object")return null;const r=l.plan;return typeof r=="string"?r:null}function Sy({path:s}){const[l,r]=y.useState(!1),[c,o]=y.useState(!1),d=y.useRef(null);y.useEffect(()=>{if(!l)return;function p(m){var x;(x=d.current)!=null&&x.contains(m.target)||r(!1)}return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[l]),y.useEffect(()=>{if(!c)return;const p=setTimeout(()=>o(!1),np);return()=>clearTimeout(p)},[c]),y.useEffect(()=>r(!1),[s]);async function h(){await $r(s)&&o(!0)}return i.jsxs("div",{ref:d,className:"cwd",children:[i.jsxs("button",{type:"button",className:"cwd__toggle","aria-expanded":l,title:l?"Свернуть путь":`Полный путь: ${s}`,onClick:()=>r(p=>!p),onKeyDown:p=>{p.key!=="Escape"||!l||(p.preventDefault(),p.stopPropagation(),r(!1))},children:[i.jsx(Dj,{open:l}),i.jsx("span",{className:"cwd__short",children:s})]}),l&&i.jsxs("div",{className:"cwd__pop",children:[i.jsx("span",{className:"cwd__full",children:s}),i.jsx("button",{type:"button",className:"btn btn--ghost cwd__copy",onClick:()=>void h(),children:c?zr:Hi})]})]})}function Dj({open:s}){return i.jsx("svg",{className:s?"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:i.jsx("path",{d:"M6 3.5 10.5 8 6 12.5"})})}const Lj=["low","medium","high"];function jy({models:s,value:l,effort:r,ultracode:c,thinking:o,switchOnFlag:d,className:h,onModel:p,onEffort:m,onUltracode:x,onThinking:_,onSwitchOnFlag:j}){const[v,E]=y.useState(!1),[k,O]=y.useState(0),z=y.useRef(null),ee=y.useRef(null),te=s.find(A=>A.value===l)??null,K=te&&te.supportsEffort?te.effortLevels.length>0?te.effortLevels:Lj:[],M=K.includes("xhigh");y.useEffect(()=>{if(!v)return;const A=s.findIndex(Z=>Z.value===l);O(A===-1?0:A)},[v]),y.useEffect(()=>{if(!v)return;function A(Z){var ae;(ae=z.current)!=null&&ae.contains(Z.target)||E(!1)}return document.addEventListener("mousedown",A),()=>document.removeEventListener("mousedown",A)},[v]),y.useEffect(()=>{var A,Z;v&&((Z=(A=ee.current)==null?void 0:A.querySelector(".is-cursor"))==null||Z.scrollIntoView({block:"nearest"}))},[v,k]);function F(A){E(!1),A.value!==l&&p(A.value)}function H(A){if(A.key==="Escape"){if(!v)return;A.preventDefault(),A.stopPropagation(),E(!1);return}if(A.key==="ArrowDown"||A.key==="ArrowUp"){if(A.preventDefault(),!v)return E(!0);if(s.length===0)return;const Z=A.key==="ArrowDown"?1:s.length-1;return O(ae=>(ae+Z)%s.length)}if(A.key==="Enter"||A.key===" "){if(A.preventDefault(),!v)return E(!0);const Z=s[k];Z&&F(Z)}}return i.jsxs("div",{ref:z,className:"select"+(v?" select--open":"")+(h?` ${h}`:""),children:[i.jsxs("button",{type:"button",className:"select__trigger",title:"Модель, усилие и размышления","aria-label":"Модель, усилие и размышления","aria-haspopup":"menu","aria-expanded":v,onClick:()=>E(A=>!A),onKeyDown:H,children:[i.jsx("span",{className:"select__value",children:(te==null?void 0:te.displayName)??l??"—"}),c?i.jsx("span",{className:"select__suffix select__suffix--hot",children:"ultracode"}):K.length>0&&r&&i.jsx("span",{className:"select__suffix",children:r}),i.jsx(zj,{})]}),v&&i.jsxs("div",{ref:ee,className:"select__menu modelmenu",role:"menu",children:[i.jsx("div",{className:"modelmenu__head",children:"Модель"}),s.map((A,Z)=>i.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":A.value===l,className:"select__option"+(Z===k?" is-cursor":"")+(A.value===l?" is-on":""),onMouseEnter:()=>O(Z),onClick:()=>F(A),children:[i.jsx("span",{className:"select__check","aria-hidden":"true",children:A.value===l?"✓":""}),i.jsx("span",{className:"select__label",children:A.displayName}),A.description&&i.jsx("span",{className:"select__hint",children:A.description})]},A.value)),K.length>0&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"modelmenu__sep",role:"separator"}),i.jsxs("div",{className:"modelmenu__row",children:[i.jsxs("span",{className:"modelmenu__label",children:["Усилие",i.jsx("span",{className:"modelmenu__desc",children:"насколько усердно модель думает"})]}),i.jsx("span",{className:"modelmenu__levels",children:K.map(A=>i.jsx("button",{type:"button",role:"menuitemradio","aria-checked":A===r,className:A===r?"modelmenu__level is-on":"modelmenu__level",onClick:()=>m(A),children:A},A))})]}),M&&i.jsx(wh,{label:"Ultracode",desc:"xhigh и постоянная оркестрация подагентами",on:c,onToggle:()=>x(!c)})]}),i.jsx("div",{className:"modelmenu__sep",role:"separator"}),(te==null?void 0:te.supportsThinking)!==!1&&i.jsx(wh,{label:"Размышления",desc:"расширенное обдумывание перед ответом",on:o,onToggle:()=>_(!o)}),i.jsx(wh,{label:"Менять модель по флагу",desc:"иначе помеченный ход встаёт на паузу",on:d,onToggle:()=>j(!d)})]})]})}function wh({label:s,desc:l,on:r,onToggle:c}){return i.jsxs("button",{type:"button",role:"menuitemcheckbox","aria-checked":r,className:"modelmenu__row modelmenu__row--btn",onClick:c,children:[i.jsxs("span",{className:"modelmenu__label",children:[s,i.jsx("span",{className:"modelmenu__desc",children:l})]}),i.jsx("span",{className:r?"switch is-on":"switch","aria-hidden":"true",children:i.jsx("span",{className:"switch__knob"})})]})}function zj(){return i.jsx("svg",{className:"select__chev",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:i.jsx("path",{d:"M3 4.5 6 7.5 9 4.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function Vl({title:s,children:l,actions:r,className:c,sheet:o=!1,onClose:d}){const h=y.useRef(null);return y.useEffect(()=>{function p(m){if(m.key==="Escape"){m.preventDefault(),m.stopPropagation(),d();return}if(m.key!=="Tab")return;const x=h.current;if(!x)return;const _=x.querySelectorAll('button, input, textarea, select, a[href], [tabindex]:not([tabindex="-1"])'),j=_[0],v=_[_.length-1];!j||!v||(m.shiftKey&&document.activeElement===j?(m.preventDefault(),v.focus()):!m.shiftKey&&document.activeElement===v&&(m.preventDefault(),j.focus()))}return document.addEventListener("keydown",p,!0),()=>document.removeEventListener("keydown",p,!0)},[d]),i.jsx("div",{className:o?"modal-backdrop modal-backdrop--sheet":"modal-backdrop",onMouseDown:p=>{p.target===p.currentTarget&&d()},children:i.jsxs("div",{ref:h,className:c?`modal ${c}`:"modal",role:"dialog","aria-modal":"true","aria-label":s,children:[i.jsxs("div",{className:"modal__head",children:[i.jsx("h2",{className:"modal__title",children:s}),i.jsx("button",{className:"modal__close","aria-label":"Закрыть",onClick:d,children:"✕"})]}),i.jsx("div",{className:"modal__body",children:l}),r&&i.jsx("div",{className:"modal__actions",children:r})]})})}function Uj({candidates:s,searching:l,agentItems:r,agentBusy:c,error:o,roots:d,created:h,onSearch:p,onAskAgent:m,onInterrupt:x,onSubmit:_,onCreate:j,onClose:v}){const[E,k]=y.useState("open"),[O,z]=y.useState(""),[ee,te]=y.useState(!1),[K,M]=y.useState(""),[F,H]=y.useState(""),[A,Z]=y.useState({git:!0,claudeMd:!0,readme:!0}),ae=O.trim(),G=ae!=="",J=K.trim(),D=F.trim(),ge=J!==""&&D!=="";y.useEffect(()=>{K===""&&d.length>0&&M(d[0])},[d]);const Se=y.useRef(p);Se.current=p,y.useEffect(()=>{if(E!=="open")return;const se=O.trim(),be=setTimeout(()=>Se.current(se),200);return()=>clearTimeout(be)},[O,E]);function xe(){G&&_(ae)}function B(){ge&&j(J,D,A)}function ue(){G&&(te(!0),m(ae))}return h?i.jsxs(Vl,{title:"Новый проект",onClose:v,actions:i.jsx("button",{className:"btn btn--primary",onClick:v,autoFocus:!0,children:"Понятно"}),children:[i.jsx("p",{className:"modal__text",children:"Каталог создан и открыт как проект, но часть шагов не удалась."}),i.jsx("p",{className:"newproj__preview",children:h.path}),i.jsx("div",{className:"modal__error",children:i.jsx("ul",{className:"newproj__warnings",children:h.warnings.map(se=>i.jsx("li",{children:se},se))})}),i.jsx("p",{className:"modal__text modal__text--dim",children:"Проект открыт и работает — недостающее можно добавить руками, в дереве файлов или из терминала."})]}):i.jsxs(Vl,{title:"Новый проект",className:ee&&E==="open"?"modal--wide":void 0,onClose:v,actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:v,children:"Отмена"}),E==="open"?i.jsxs(i.Fragment,{children:[c?i.jsx("button",{className:"btn",onClick:x,children:"Остановить"}):i.jsx("button",{className:"btn",disabled:!G,onClick:ue,title:"Найти по описанию",children:"Попросить агента"}),i.jsx("button",{className:"btn btn--primary",disabled:!G,onClick:xe,children:"Открыть"})]}):i.jsx("button",{className:"btn btn--primary",disabled:!ge,onClick:B,children:"Создать"})]}),children:[i.jsxs("div",{className:"tabs",children:[i.jsx(px,{label:"Открыть",on:E==="open",onClick:()=>k("open")}),i.jsx(px,{label:"Создать",on:E==="create",onClick:()=>k("create")})]}),E==="open"?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"modal__text",children:"Каталог, в котором будет работать агент. Введите путь или часть имени — подходящие каталоги появятся ниже."}),i.jsx("label",{className:"field",htmlFor:"workspace-path",children:"Путь или название"}),i.jsx("input",{id:"workspace-path",className:"input input--mono",value:O,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"C:\\Projects\\my-app",onChange:se=>z(se.target.value),onKeyDown:se=>{se.key==="Enter"&&(se.preventDefault(),xe())}}),o&&i.jsx("p",{className:"modal__error",children:o}),s.length>0&&i.jsx("ul",{className:"finds",children:s.map(se=>i.jsx("li",{children:i.jsxs("button",{className:"find",disabled:se.open,title:se.open?"Этот проект уже открыт":se.path,onClick:()=>z(se.path),onDoubleClick:()=>_(se.path),children:[i.jsx("span",{className:"find__name",children:se.name}),i.jsx("span",{className:"find__path",children:se.path}),i.jsx("span",{className:"find__note",children:Ij(se)})]})},se.path))}),s.length===0&&G&&!l&&!ee&&i.jsx("p",{className:"modal__text modal__text--dim",children:"Ничего похожего среди каталогов, где вы работали. Если помните не имя, а суть проекта — опишите его и нажмите «Попросить агента». Проекта ещё нет вовсе — рядом вкладка «Создать»."}),ee&&i.jsx("div",{className:"finds__agent",children:i.jsx(ap,{items:r,busy:c,waiting:!1,empty:"Агент ищет…"})})]}):i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"modal__text",children:"Пустой каталог для нового проекта. Дальше в нём работает агент — с первого промпта, без отдельной настройки."}),i.jsx("label",{className:"field",htmlFor:"workspace-parent",children:"Где создать"}),i.jsx("input",{id:"workspace-parent",className:"input input--mono",value:K,spellCheck:!1,autoComplete:"off",placeholder:"C:\\Projects",onChange:se=>M(se.target.value)}),d.length>0&&i.jsx("div",{className:"newproj__roots",children:d.map(se=>i.jsx("button",{type:"button",className:se===J?"newproj__root is-on":"newproj__root",title:se,onClick:()=>M(se),children:Bj(se)},se))}),i.jsx("label",{className:"field newproj__field",htmlFor:"workspace-name",children:"Имя проекта"}),i.jsx("input",{id:"workspace-name",className:"input input--mono",value:F,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"my-app",onChange:se=>H(se.target.value),onKeyDown:se=>{se.key==="Enter"&&(se.preventDefault(),B())}}),i.jsx("p",{className:"newproj__preview",children:ge?Hj(J,D):"Каталог появится здесь"}),o&&i.jsx("p",{className:"modal__error",children:o}),i.jsxs("div",{className:"newproj__opts",children:[i.jsx(Nh,{label:"git init",desc:"панель истории работает сразу",on:A.git,onToggle:()=>Z(se=>({...se,git:!se.git}))}),i.jsx(Nh,{label:"CLAUDE.md",desc:"заготовка инструкций для агента",on:A.claudeMd,onToggle:()=>Z(se=>({...se,claudeMd:!se.claudeMd}))}),i.jsx(Nh,{label:"README.md",desc:"по нему проект потом узнаёт поиск",on:A.readme,onToggle:()=>Z(se=>({...se,readme:!se.readme}))})]})]})]})}function px({label:s,on:l,onClick:r}){return i.jsx("button",{type:"button",className:l?"tabs__tab is-on":"tabs__tab","aria-pressed":l,onClick:r,children:s})}function Nh({label:s,desc:l,on:r,onToggle:c}){return i.jsxs("button",{type:"button",role:"checkbox","aria-checked":r,className:"newproj__opt",onClick:c,children:[i.jsxs("span",{className:"newproj__optlabel",children:[s,i.jsx("span",{className:"newproj__optdesc",children:l})]}),i.jsx("span",{className:r?"switch is-on":"switch","aria-hidden":"true",children:i.jsx("span",{className:"switch__knob"})})]})}function Hj(s,l){const r=s.includes("\\")?"\\":"/";return s.replace(/[\\/]+$/,"")+r+l}function Bj(s){const l=s.includes("\\")?"\\":"/",r=s.split(/[\\/]/).filter(Boolean);return r.length<=2?s:`…${l}${r.slice(-2).join(l)}`}function Ij(s){return s.open?"уже открыт":s.why?s.why:s.sessions===0?"рядом с вашими проектами":`${qj(s.sessions)}${Gj(s.lastUsedAt)}`}function qj(s){const l=s%10,r=s%100;return r>=11&&r<=14?`${s} сессий`:l===1?`${s} сессия`:l>=2&&l<=4?`${s} сессии`:`${s} сессий`}function Gj(s){if(!s)return"";const l=Math.floor((Date.now()-s)/864e5);return l<=0?" · сегодня":l===1?" · вчера":l<30?` · ${l} дн. назад`:` · ${new Date(s).toLocaleDateString("ru-RU")}`}const ip=7;function Yj(s){const l=[],r=[];let c=1;for(const o of s){const d=l.slice();let h=l.indexOf(o.hash);h===-1&&(h=mx(l),l[h]=o.hash);const[p,...m]=o.parents;l[h]=p??null;const x=[];p!==void 0&&x.push({from:h,to:h});for(const v of m){let E=l.indexOf(v);E===-1&&(E=mx(l),l[E]=v),x.push({from:h,to:E})}const _=[];for(let v=0;v<d.length;v++)d[v]===o.hash&&(_.push({from:v,to:h}),v!==h&&(l[v]=null));const j=[];for(let v=0;v<d.length;v++){const E=d[v];!E||E===o.hash||v===h||l[v]===E&&j.push(v)}Xj(l),c=Math.max(c,l.length,h+1),r.push({commit:o,col:h,up:_,down:x,through:j})}return{rows:r,columns:Math.min(c,ip)}}function mx(s){const l=s.indexOf(null);return l!==-1?l:(s.push(null),s.length-1)}function Xj(s){for(;s.length>0&&s[s.length-1]===null;)s.pop()}const ky=1500;function Vj(s){const l=[];let r=!1;for(const c of s.patch.split(`
|
|
118
|
+
`)){if(l.length>=ky){r=!0;break}if(c.startsWith("@@"))l.push({type:"gap",text:$j(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:s.path||s.oldPath,rows:l,added:s.added,removed:s.removed,note:Qj(s,r)}}function $j(s){const l=/^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@ ?(.*)$/.exec(s);if(!l)return s;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 Qj(s,l){const r=[];return s.status==="added"&&r.push("новый файл"),s.status==="deleted"&&r.push("файл удалён"),s.status==="renamed"&&r.push(`переименован из ${s.oldPath}`),s.binary?r.push("двоичный файл"):s.patch===""&&r.push("содержимое не показано"),l&&r.push(`показаны первые ${ky} строк`),r.length>0?r.join(" · "):null}function Zj({open:s,state:l,result:r,selected:c,busy:o,onRefresh:d,onShow:h,onCheckout:p,onPush:m,onPull:x,onPublish:_,onConnectRemote:j,onDismissResult:v,onClose:E,zoomed:k,onToggleZoom:O}){const z=Yj((l==null?void 0:l.commits)??[]),ee=[...l!=null&&l.detached?[{value:"",label:`отделён · ${l.head.slice(0,8)}`}]:[],...((l==null?void 0:l.branches)??[]).map(te=>({value:te.name,label:te.name,hint:te.hash.slice(0,8)}))];return i.jsxs("aside",{className:(s?"sidepane sidepane--git sidepane--open":"sidepane sidepane--git")+(k?" sidepane--zoomed":""),"aria-label":"История git",children:[i.jsxs("div",{className:"sidepane__head",onDoubleClick:te=>{O&&(te.target.closest("button")||O())},children:[i.jsx(Pj,{}),i.jsx("span",{className:"sidepane__title",children:"История"}),i.jsx("button",{className:"sidepane__btn",title:"Обновить","aria-label":"Обновить историю",onClick:d,children:"↻"}),O&&i.jsx("button",{className:"sidepane__btn",title:k?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":k?"Свернуть панель истории":"Развернуть панель истории на весь экран","aria-pressed":k,onClick:O,children:i.jsx(Zr,{active:k})}),i.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель истории",onClick:E,children:"✕"})]}),l===null?i.jsx("p",{className:"sidepane__empty",children:"Читаем репозиторий…"}):l.available?i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"gitbar",children:i.jsx(Is,{className:"gitbar__branch",title:"Ветка — выбрать значит переключиться",value:l.detached?"":l.branch,options:ee,onChange:te=>{te&&p(te,`ветку ${te}`)}})}),l.detached&&i.jsx("p",{className:"gitbar__note",children:"HEAD отделён от ветки. Выберите ветку в списке, чтобы вернуться."}),i.jsx("div",{className:"gitbar__actions",children:o?i.jsxs("p",{className:"gitbar__busy",children:[i.jsx(lk,{}),o]}):l.hasRemote?i.jsxs(i.Fragment,{children:[i.jsxs("button",{type:"button",className:"btn btn--sm",title:"Отправить текущую ветку в origin",onClick:m,children:[i.jsx(ek,{}),"Отправить",l.ahead>0&&i.jsx("span",{className:"gitbar__count",children:l.ahead})]}),i.jsxs("div",{className:"gitbar__group",children:[i.jsxs("button",{type:"button",className:"btn btn--sm",title:"Забрать с origin и перемотать вперёд (git pull --ff-only)",onClick:()=>x(!0),children:[i.jsx(tk,{}),"Забрать",l.behind>0&&i.jsx("span",{className:"gitbar__count",children:l.behind})]}),i.jsx("button",{type:"button",className:"btn btn--sm btn--ghost gitbar__check",title:"Только проверить — git fetch, рабочее дерево не меняется","aria-label":"Проверить, что нового на origin, без изменений на диске",onClick:()=>x(!1),children:i.jsx(nk,{})})]})]}):i.jsxs(i.Fragment,{children:[i.jsxs("button",{type:"button",className:"btn btn--sm btn--primary",title:"Создать репозиторий на GitHub и отправить в него ветку",onClick:_,children:[i.jsx(bx,{}),"Опубликовать на GitHub"]}),i.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",title:"Прописать origin на уже существующий репозиторий",onClick:j,children:"уже есть репозиторий"})]})}),i.jsxs("div",{className:"sidepane__scroll",children:[i.jsx("button",{className:"gitrow gitrow--work"+(c===""?" is-on":""),onClick:()=>h(""),children:i.jsxs("span",{className:"gitrow__body",children:[i.jsx("span",{className:"gitrow__subject",children:l.changed.length>0?`Рабочее дерево · ${l.changed.length} ${ik(l.changed.length)}`:"Рабочее дерево чистое"}),i.jsx("span",{className:"gitrow__meta",children:l.changed.length>0?l.changed.slice(0,4).map(te=>ak(te.path)).join(", "):"незакоммиченных изменений нет"})]})}),z.rows.map(te=>i.jsx(Kj,{row:te,columns:z.columns,head:te.commit.hash===l.head,local:l.hasRemote&&!te.commit.pushed,active:c===te.commit.hash,onOpen:()=>h(te.commit.hash)},te.commit.hash)),z.rows.length===0&&i.jsx("p",{className:"sidepane__empty",children:"В репозитории ещё нет коммитов"})]})]}):i.jsxs("div",{className:"gitempty",children:[i.jsx("p",{className:"gitempty__text",children:l.message||"Это не git-репозиторий"}),l.noRepo&&i.jsxs(i.Fragment,{children:[i.jsxs("button",{type:"button",className:"btn btn--sm btn--primary gitempty__btn",onClick:_,children:[i.jsx(bx,{}),"Опубликовать на GitHub"]}),i.jsx("p",{className:"gitempty__hint",children:"Заведёт репозиторий, сделает первый коммит и отправит его на GitHub."})]})]}),i.jsx(qi,{result:r,onDismiss:v})]})}const tu=50,gx=13;function Kj({row:s,columns:l,head:r,local:c,active:o,onOpen:d}){const{commit:h}=s,p=h.refs.map(sk).filter(Boolean);return i.jsxs("button",{className:"gitrow"+(o?" is-on":""),title:c?"Коммит ещё не отправлен на удалённый репозиторий":void 0,onClick:d,children:[i.jsx(Fj,{row:s,columns:l,head:r,local:c}),i.jsxs("span",{className:"gitrow__body",children:[i.jsxs("span",{className:"gitrow__subject",children:[p.map(m=>i.jsx("span",{className:"gitrow__ref",children:m},m)),h.subject]}),i.jsxs("span",{className:"gitrow__meta",children:[h.shortHash," · ",h.author," · ",rk(h.date),c&&i.jsx("span",{className:"gitrow__local",children:"· не отправлен"})]})]})]})}function Fj({row:s,columns:l,head:r,local:c}){const o=l*gx+6,d=tu/2,h=x=>8+Math.min(x,ip-1)*gx,p=c?"3.5 2.5":void 0,m=Xo(s.col);return i.jsxs("svg",{className:"gitgraph",width:o,height:tu,viewBox:`0 0 ${o} ${tu}`,"aria-hidden":"true",children:[s.through.map(x=>i.jsx("line",{x1:h(x),y1:0,x2:h(x),y2:tu,style:{stroke:Xo(x)}},`t${x}`)),s.up.map((x,_)=>i.jsx("path",{d:`M${h(x.from)} 0 L${h(x.from)} ${d-12} L${h(x.to)} ${d}`,fill:"none",style:{stroke:Xo(x.from),strokeDasharray:p}},`u${_}`)),s.down.map((x,_)=>i.jsx("path",{d:`M${h(x.from)} ${d} L${h(x.to)} ${d+12} L${h(x.to)} ${tu}`,fill:"none",style:{stroke:Xo(x.to),strokeDasharray:p}},`d${_}`)),r&&i.jsx("circle",{className:"gitgraph__head",cx:h(s.col),cy:d,r:s.commit.parents.length>1?7.4:6.6}),i.jsx("circle",{className:"gitgraph__dot",cx:h(s.col),cy:d,r:s.commit.parents.length>1?4.6:3.6,style:{stroke:m,fill:c?void 0:m}})]})}function Xo(s){return`var(--lane-${s%ip})`}function Jj({detail:s,local:l,onCheckout:r,onClose:c}){const o=s.hash==="";return i.jsxs(Vl,{className:"modal--wide",title:o?"Незакоммиченные изменения":`Коммит ${s.shortHash}`,onClose:c,actions:i.jsxs(i.Fragment,{children:[!o&&i.jsx("button",{className:"btn",onClick:()=>r(s.hash,`коммит ${s.shortHash} (HEAD отделится от ветки)`),children:"Переключиться сюда"}),i.jsx("button",{className:"btn btn--primary",onClick:c,children:"Закрыть"})]}),children:[!o&&i.jsxs("div",{className:"commit__head",children:[i.jsx("p",{className:"commit__subject",children:s.subject}),i.jsxs("p",{className:"commit__meta",children:[s.author,s.email&&` <${s.email}>`," · ",ck(s.date)," ·"," ",i.jsx("span",{className:"commit__hash",children:s.hash})]}),l&&i.jsx("p",{className:"commit__meta commit__meta--local",children:"Не отправлен: этого коммита нет ни в одной удалённой ветке."}),s.parents.length>0&&i.jsxs("p",{className:"commit__meta",children:[s.parents.length>1?"слияние: ":"родитель: ",s.parents.map(d=>d.slice(0,8)).join(", ")]}),s.body&&i.jsx("pre",{className:"commit__body",children:s.body})]}),s.truncated&&i.jsx("p",{className:"modal__text",children:"Изменения слишком велики — часть патча не показана."}),s.files.length===0?i.jsx("p",{className:"modal__text",children:"Изменений нет."}):s.files.map(d=>i.jsx(Wj,{file:d,defaultOpen:s.files.length<=3},d.path+d.oldPath))]})}function Wj({file:s,defaultOpen:l}){const[r,c]=y.useState(l);return i.jsxs("div",{className:"commit__file",children:[i.jsxs("button",{className:"commit__filehead",onClick:()=>c(o=>!o),children:[i.jsx("span",{className:"commit__filepath",children:s.path||s.oldPath}),i.jsxs("span",{className:"diff__stat",children:[s.added>0&&i.jsxs("span",{className:"diff__stat--add",children:["+",s.added]}),s.removed>0&&i.jsxs("span",{className:"diff__stat--del",children:["−",s.removed]})]}),i.jsx("span",{className:"tool__status",children:r?"▴":"▾"})]}),r&&i.jsx(sp,{diff:Vj(s)})]})}function Pj(){return i.jsxs("svg",{className:"sidepane__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[i.jsx("circle",{cx:"4.5",cy:"3.5",r:"1.9"}),i.jsx("circle",{cx:"4.5",cy:"12.5",r:"1.9"}),i.jsx("circle",{cx:"11.5",cy:"8",r:"1.9"}),i.jsx("path",{d:"M4.5 5.4v5.2M6.4 3.9h2.2a1.6 1.6 0 0 1 1.6 1.6v.8"})]})}function ek(){return i.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:i.jsx("path",{d:"M8 13V3M4.5 6.5 8 3l3.5 3.5"})})}function tk(){return i.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:i.jsx("path",{d:"M8 3v10M4.5 9.5 8 13l3.5-3.5"})})}function nk(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("circle",{cx:"7",cy:"7",r:"4"}),i.jsx("path",{d:"m13 13-2.6-2.6"})]})}function bx(){return i.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:i.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8Z"})})}function lk(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M14 8a6 6 0 1 1-6-6c1.68 0 3.29.67 4.49 1.83L14 5.33"}),i.jsx("path",{d:"M14 2v3.33h-3.33"})]})}function sk(s){return s.replace(/^HEAD -> /,"").replace(/^tag: /,"⌂ ").trim()}function ak(s){const l=s.split("/");return l[l.length-1]??s}function ik(s){const l=s%100;if(l>=11&&l<=14)return"файлов";switch(s%10){case 1:return"файл";case 2:case 3:case 4:return"файла";default:return"файлов"}}function rk(s){const l=Date.parse(s);if(Number.isNaN(l))return s;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 ck(s){const l=Date.parse(s);return Number.isNaN(l)?s:new Date(l).toLocaleString()}function xx(s){return s.replace(/[^A-Za-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")}function uk({status:s,owners:l,files:r,defaultName:c,hasCommits:o,busy:d,result:h,onRefreshStatus:p,onSaveToken:m,onPublish:x,onDismissResult:_,onClose:j}){var se;const[v,E]=y.useState(()=>xx(c)),[k,O]=y.useState(""),[z,ee]=y.useState(""),[te,K]=y.useState(!0),[M,F]=y.useState("Первый коммит"),[H,A]=y.useState(null),[Z,ae]=y.useState("");y.useEffect(()=>{!k&&l.length>0&&O(l[0].login)},[k,l]),y.useEffect(()=>{r&&H===null&&A(new Set(r.files))},[r,H]);const G=(s==null?void 0:s.connected)===!0,J=l.map(be=>({value:be.login,label:be.login,hint:be.kind==="org"?"организация":void 0})),D=y.useMemo(()=>{if(!r)return[];const be=Z.trim().toLowerCase();return be?r.files.filter(Ce=>Ce.toLowerCase().includes(be)):r.files},[r,Z]),ge=(H==null?void 0:H.size)??0,Se=G&&v.trim()!==""&&k!==""&&d===""&&(o||ge>0);function xe(be){A(Ce=>{const w=new Set(Ce??[]);return w.has(be)?w.delete(be):w.add(be),w})}function B(be){A(Ce=>{const w=new Set(Ce??[]);for(const Q of D)be?w.add(Q):w.delete(Q);return w})}function ue(){if(!Se)return;const be=(r==null?void 0:r.files)??[];x({owner:k,name:v.trim(),description:z.trim(),private:te,include:o?[]:be.filter(Ce=>H==null?void 0:H.has(Ce)),ignore:o?[]:be.filter(Ce=>!(H!=null&&H.has(Ce))),message:o?"":M.trim()||"Первый коммит"})}return i.jsxs(Vl,{className:"modal--wide",title:"Опубликовать на GitHub",onClose:j,actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",className:"btn",onClick:j,children:"Отмена"}),i.jsx("button",{type:"button",className:"btn btn--primary",disabled:!Se,onClick:ue,children:d||"Опубликовать"})]}),children:[i.jsx(ok,{status:s,onRefreshStatus:p,onSaveToken:m}),i.jsxs("div",{className:"publish__section",children:[i.jsx("h3",{className:"publish__heading",children:"Репозиторий"}),i.jsxs("label",{className:"field publish__field",children:[i.jsx("span",{children:"Имя"}),i.jsx("input",{className:"input input--mono",value:v,spellCheck:!1,autoComplete:"off",onChange:be=>E(xx(be.target.value))})]}),v.trim()===""&&i.jsx("p",{className:"modal__error",children:"Имя репозитория не может быть пустым."}),i.jsxs("label",{className:"field publish__field",children:[i.jsx("span",{children:"Владелец"}),l.length>1?i.jsx(Is,{className:"settings__select",value:k,options:J,onChange:O,placeholder:"выберите владельца",ariaLabel:"Владелец репозитория"}):i.jsx("p",{className:"publish__static",children:((se=l[0])==null?void 0:se.login)??"—"})]}),i.jsxs("label",{className:"field publish__field",children:[i.jsx("span",{children:"Описание (необязательно)"}),i.jsx("input",{className:"input",value:z,placeholder:"о чём проект — одной строкой",onChange:be=>ee(be.target.value)})]}),i.jsxs("div",{className:"field publish__field",children:[i.jsx("span",{children:"Видимость"}),i.jsxs("div",{className:"access",role:"radiogroup","aria-label":"Видимость репозитория",children:[i.jsx(yx,{title:"Приватный",desc:"Виден только вам и тем, кого вы пригласите. Стоит по умолчанию: репозиторий с чужим кодом, случайно ставший публичным, потом не отозвать.",on:te,onClick:()=>K(!0)}),i.jsx(yx,{title:"Публичный",desc:"Виден всем в интернете — код, история коммитов, всё содержимое.",risky:!0,on:!te,onClick:()=>K(!1)})]})]})]}),!o&&i.jsxs("div",{className:"publish__section",children:[i.jsx("h3",{className:"publish__heading",children:"Файлы первого коммита"}),r===null?i.jsx("p",{className:"modal__text",children:"Читаем файлы…"}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"publish__filehead",children:[i.jsxs("span",{className:"publish__filecount",children:[ge," из ",r.files.length," файлов"]}),i.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>B(!0),children:"Отметить все"}),i.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>B(!1),children:"Снять все"})]}),r.files.length>8&&i.jsx("input",{className:"input publish__filter",value:Z,placeholder:"Фильтр по пути…",spellCheck:!1,onChange:be=>ae(be.target.value)}),i.jsx("div",{className:"publish__filelist",children:D.length===0?i.jsx("p",{className:"modal__text publish__filesempty",children:"Ничего не найдено по фильтру."}):D.map(be=>i.jsxs("button",{type:"button",role:"checkbox","aria-checked":(H==null?void 0:H.has(be))===!0,className:"publish__file",onClick:()=>xe(be),children:[i.jsx("span",{className:"publish__box"+(H!=null&&H.has(be)?" is-on":""),"aria-hidden":"true",children:(H==null?void 0:H.has(be))&&"✓"}),i.jsx("span",{className:"publish__filepath",children:be})]},be))}),r.truncated&&i.jsx("p",{className:"publish__truncated",children:"Каталог больше, чем показано здесь, — часть файлов в список не попала. Их всё равно можно закоммитить потом обычным образом."}),i.jsxs("label",{className:"field publish__field",children:[i.jsx("span",{children:"Сообщение коммита"}),i.jsx("input",{className:"input",value:M,onChange:be=>F(be.target.value)})]})]})]}),i.jsx(qi,{result:h,onDismiss:_})]})}function yx({title:s,desc:l,on:r,risky:c,onClick:o}){return i.jsxs("button",{type:"button",role:"radio","aria-checked":r,className:"access__card"+(r?" is-on":"")+(c?" access__card--risky":""),onClick:o,children:[i.jsx("span",{className:"access__radio","aria-hidden":"true"}),i.jsxs("span",{className:"access__body",children:[i.jsxs("span",{className:"access__title",children:[s,c&&i.jsx("span",{className:"access__risk",children:"видно всем"})]}),i.jsx("span",{className:"access__desc",children:l})]})]})}function ok({status:s,onRefreshStatus:l,onSaveToken:r}){const[c,o]=y.useState(""),[d,h]=y.useState(!1);return i.jsxs("div",{className:"publish__section publish__section--first",children:[i.jsx("h3",{className:"publish__heading",children:"Учётная запись GitHub"}),s===null?i.jsx("p",{className:"modal__text",children:"Проверяем подключение…"}):s.connected?i.jsxs("div",{className:"publish__account",children:[i.jsx("span",{className:"chip chip--ok",children:s.login}),i.jsx("span",{className:"publish__accountvia",children:s.source==="gh"?"через GitHub CLI":"по личному токену"}),s.source==="token"&&i.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>r(""),children:"Отключить токен"})]}):i.jsxs("div",{className:"publish__connect",children:[s.ghInstalled&&i.jsxs("p",{className:"modal__text",children:["В системе установлен ",i.jsx("code",{children:"gh"}),", но вход в нём не выполнен. Можно вместо токена выполнить ",i.jsx("code",{children:"gh auth login"})," в панели терминала и нажать «Проверить снова» — либо ввести личный токен ниже."]}),i.jsxs("label",{className:"field publish__field",children:[i.jsx("span",{children:"Личный токен GitHub"}),i.jsx(fk,{value:c,onChange:o,visible:d,onToggleVisible:()=>h(p=>!p),placeholder:"ghp_…"})]}),i.jsxs("p",{className:"publish__tokenhint",children:["Нужен токен с доступом ",i.jsx("code",{children:"repo"})," — им приложение создаст репозиторий и отправит в него код."," ",i.jsx("a",{href:"https://github.com/settings/tokens/new?scopes=repo&description=Claude%20Code%20Visual",target:"_blank",rel:"noreferrer",children:"Создать токен на GitHub ↗"})]}),s.message&&i.jsx("p",{className:"modal__error",children:s.message}),i.jsxs("div",{className:"extbar",children:[i.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:l,children:"Проверить снова"}),i.jsx("button",{type:"button",className:"btn btn--sm btn--primary",disabled:c.trim()==="",onClick:()=>r(c.trim()),children:"Сохранить токен"})]})]})]})}function fk({value:s,onChange:l,visible:r,onToggleVisible:c,placeholder:o,autoFocus:d}){return i.jsxs("div",{className:"pwfield",children:[i.jsx("input",{className:"input input--mono pwfield__input",type:r?"text":"password",value:s,placeholder:o,spellCheck:!1,autoComplete:"off",autoFocus:d,onChange:h=>l(h.target.value)}),i.jsx("button",{type:"button",className:"pwfield__toggle","aria-label":r?"Скрыть токен":"Показать токен","aria-pressed":r,onClick:c,children:r?i.jsx(hk,{}):i.jsx(dk,{})})]})}function dk(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M1 8s2.5-5 7-5 7 5 7 5-2.5 5-7 5-7-5-7-5Z"}),i.jsx("circle",{cx:"8",cy:"8",r:"2.1"})]})}function hk(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M1 8s2.5-5 7-5 7 5 7 5-2.5 5-7 5-7-5-7-5Z"}),i.jsx("circle",{cx:"8",cy:"8",r:"2.1"}),i.jsx("path",{d:"M2 14 14 2"})]})}function pk({busy:s,result:l,onSubmit:r,onDismissResult:c,onClose:o}){const[d,h]=y.useState(""),p=/^(https?|ssh|git):\/\/\S+/i.test(d.trim())||/^[\w.-]+@[\w.-]+:.+/.test(d.trim());return i.jsxs(Vl,{title:"Подключить существующий репозиторий",onClose:o,actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",className:"btn",onClick:o,children:"Отмена"}),i.jsx("button",{type:"button",className:"btn btn--primary",disabled:!p||s!=="",onClick:()=>r(d.trim()),children:s||"Подключить"})]}),children:[i.jsxs("p",{className:"modal__text",children:["Пропишет этот адрес как ",i.jsx("code",{children:"origin"})," текущего репозитория. Ничего не отправляется само — после этого в панели появятся обычные «Отправить» и «Забрать»."]}),i.jsxs("label",{className:"field",children:[i.jsx("span",{children:"Адрес репозитория"}),i.jsx("input",{className:"input input--mono",value:d,placeholder:"https://github.com/owner/name.git",spellCheck:!1,autoComplete:"off",autoFocus:!0,onChange:m=>h(m.target.value),onKeyDown:m=>{m.key==="Enter"&&p&&s===""&&r(d.trim())}})]}),i.jsxs("p",{className:"modal__text modal__text--dim",children:["Подходят адреса вида ",i.jsx("code",{children:"https://…"}),", ",i.jsx("code",{children:"ssh://…"}),", ",i.jsx("code",{children:"git://…"})," и"," ",i.jsx("code",{children:"git@host:path"}),"."]}),i.jsx(qi,{result:l,onDismiss:c})]})}function mk({open:s,items:l,busy:r,ready:c,commands:o,contextResult:d,draftKey:h,models:p,model:m,effort:x,ultracode:_,thinking:j,switchOnFlag:v,onContextSearch:E,onCommand:k,onModel:O,onEffort:z,onUltracode:ee,onThinking:te,onSwitchOnFlag:K,onAsk:M,onInterrupt:F,onReset:H,onClose:A,zoomed:Z,onToggleZoom:ae}){return i.jsxs("aside",{className:(s?"sidepane sidepane--ask sidepane--open":"sidepane sidepane--ask")+(Z?" sidepane--zoomed":""),"aria-label":"Вопрос на полях",children:[i.jsxs("div",{className:"sidepane__head",onDoubleClick:G=>{ae&&(G.target.closest("button")||ae())},children:[i.jsx(gk,{}),i.jsx("span",{className:"sidepane__title",children:"Вопрос на полях"}),i.jsx("button",{className:"sidepane__btn",title:"Начать заново — следующий вопрос возьмёт свежий контекст","aria-label":"Начать боковой разговор заново",disabled:l.length===0,onClick:H,children:"↻"}),ae&&i.jsx("button",{className:"sidepane__btn",title:Z?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":Z?"Свернуть панель вопроса":"Развернуть панель вопроса на весь экран","aria-pressed":Z,onClick:ae,children:i.jsx(Zr,{active:Z})}),i.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель вопроса",onClick:A,children:"✕"})]}),p.length>0&&i.jsxs("div",{className:"sidepane__tools",children:[i.jsx(jy,{className:"select--compact",models:p,value:m,effort:x,ultracode:_,thinking:j,switchOnFlag:v,onModel:O,onEffort:z,onUltracode:ee,onThinking:te,onSwitchOnFlag:K}),i.jsx("span",{className:"sidepane__note",title:"Боковой вопрос работает только на чтение",children:"только чтение"})]}),i.jsx(ap,{items:l,busy:r,waiting:!1,empty:c?"Спросите о том, что происходит: вопрос уйдёт в сторону от основного разговора и не попадёт в его контекст. Отвечающий видит сессию и проект, но ничего не меняет.":"Откройте сессию — вопрос задаётся о ней."}),i.jsx(_y,{className:"composer--side",disabled:!c,busy:r,commands:o,sessionTitle:null,contextResult:d,draftKey:h?`side:${h}`:null,placeholder:"Спросить, не мешая работе…",sendLabel:"Спросить",autoFocus:s,attachmentsEnabled:!1,onContextSearch:E,onCommand:k,onSend:M,onInterrupt:F,onEscape:r?F:A})]})}function gk(){return i.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:[i.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"}),i.jsx("path",{d:"M8.4 8.5v-.3c0-.7.9-.9.9-1.7a1 1 0 0 0-1.9-.4"})]})}const bk=75,xk=90;function wy({usage:s}){if(!(s!=null&&s.available))return null;const l=[];return s.fiveHour&&l.push({key:"five",label:"5 ч",window:s.fiveHour}),s.sevenDay&&l.push({key:"week",label:"нед",window:s.sevenDay}),l.length===0?null:i.jsx("div",{className:"usage",title:vk(s),"aria-label":`Расход лимитов плана${s.plan?` ${s.plan}`:""}`,children:l.map(r=>i.jsx(yk,{label:r.label,window:r.window},r.key))})}function yk({label:s,window:l}){const r=Math.round(l.utilization),c=Sk(l.resetsAt);return i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"usage__label",children:s}),i.jsx("span",{className:"usage__track",role:"progressbar","aria-label":s,"aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,children:i.jsx("span",{className:`usage__fill${_k(r)}`,style:{width:`${r}%`}})}),i.jsxs("span",{className:"usage__pct",children:[r,"%"]}),i.jsx("span",{className:"usage__reset",title:Ey(l.resetsAt)||void 0,children:c&&`↻ ${c}`})]})}function _k(s){return s>=xk?" usage__fill--over":s>=bk?" usage__fill--warn":""}function vk(s){const l=[s.plan?`Лимиты плана ${s.plan}`:"Лимиты плана"],r=(c,o)=>{if(!o)return;const d=Ey(o.resetsAt);l.push(`${c}: ${Math.round(o.utilization)}%${d?`, ${d}`:""}`)};return r("5 часов",s.fiveHour),r("Неделя",s.sevenDay),r("Неделя, Opus",s.sevenDayOpus),l.join(`
|
|
119
|
+
`)}function Ny(s){if(!s)return null;const l=new Date(s);return Number.isNaN(l.getTime())?null:l}function Ty(s){return s.getTime()-Date.now()<1440*60*1e3}function Sk(s){const l=Ny(s);return l?Ty(l)?l.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):l.toLocaleDateString(void 0,{day:"numeric",month:"short"}):""}function Ey(s){const l=Ny(s);return l?`обнулится ${Ty(l)?`в ${l.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:l.toLocaleDateString(void 0,{day:"numeric",month:"long"})}`:""}function Ay(){const[s,l]=y.useState(()=>new Date);return y.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)}},[]),i.jsxs("time",{className:"clock",dateTime:s.toISOString(),title:jk(s),children:[i.jsx("span",{className:"clock__time",children:s.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}),i.jsx("span",{className:"clock__date",children:s.toLocaleDateString(void 0,{weekday:"short",day:"numeric",month:"short"})})]})}function jk(s){return s.toLocaleDateString(void 0,{weekday:"long",day:"numeric",month:"long",year:"numeric"})}function kk({onClose:s,permission:l,model:r,usage:c,cwd:o,costLabel:d,onRefresh:h,refreshing:p,metersFetchedAt:m,onRename:x}){return i.jsx(Vl,{title:"Настройки сессии",className:"modal--sheet",sheet:!0,onClose:s,children:i.jsxs("div",{className:"sessionmenu",children:[l&&i.jsx(Cr,{label:"Режим прав",children:l}),i.jsx(Cr,{label:"Модель",children:r}),(c==null?void 0:c.available)&&(c.fiveHour||c.sevenDay)&&i.jsx(Cr,{label:"Лимиты плана",children:i.jsx(wy,{usage:c})}),i.jsxs("button",{type:"button",className:p?"sessionmenu__refresh is-busy":"sessionmenu__refresh","aria-busy":p,disabled:p,onClick:h,children:[i.jsx(wk,{}),i.jsxs("span",{className:"sessionmenu__refresh-text",children:["Обновить показания",m&&i.jsxs("span",{className:"sessionmenu__refresh-time",children:["обновлено в"," ",new Date(m).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})]})]})]}),i.jsx(Cr,{label:"Время",children:i.jsx(Ay,{})}),d&&i.jsx(Cr,{label:"Стоимость хода",children:i.jsx("span",{className:"badge badge--cost",children:d})}),o&&i.jsx(Cr,{label:"Каталог проекта",children:i.jsx(Sy,{path:o})}),x&&i.jsx("button",{type:"button",className:"sessionmenu__rename",onClick:x,children:"Переименовать сессию"})]})})}function Cr({label:s,children:l}){return i.jsxs("div",{className:"sessionmenu__row",children:[i.jsx("span",{className:"sessionmenu__label",children:s}),l]})}function wk(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M14 8a6 6 0 1 1-6-6c1.68 0 3.29.67 4.49 1.83L14 5.33"}),i.jsx("path",{d:"M14 2v3.33h-3.33"})]})}function Nk({tab:s,servers:l,plugins:r,marketplaces:c,catalog:o,result:d,actions:h,onTab:p,onClose:m}){const x=[{id:"mcp",label:"MCP-серверы",count:l.length},{id:"plugins",label:"Плагины",count:r.length},{id:"catalog",label:"Каталог",count:o.length}];return i.jsxs(Vl,{title:"Расширения",className:"modal--wide",onClose:m,children:[i.jsx("div",{className:"tabs",role:"tablist",children:x.map(_=>i.jsxs("button",{role:"tab","aria-selected":s===_.id,className:s===_.id?"tabs__tab is-on":"tabs__tab",onClick:()=>p(_.id),children:[_.label,i.jsx("span",{className:"tabs__count",children:_.count})]},_.id))}),s==="mcp"&&i.jsx(Tk,{servers:l,actions:h}),s==="plugins"&&i.jsx(Mk,{plugins:r,marketplaces:c,actions:h}),s==="catalog"&&i.jsx(Ok,{catalog:o,hasMarketplaces:c.length>0,actions:h,onMarketplaces:()=>p("plugins")}),i.jsx(qi,{result:d})]})}function Tk({servers:s,actions:l}){const[r,c]=y.useState(!1);return i.jsxs(i.Fragment,{children:[s.length===0&&!r&&i.jsxs("p",{className:"modal__text",children:["Ни одного MCP-сервера. Добавленный здесь попадёт в ",i.jsx("code",{children:".mcp.json"})," ","проекта — его увидит и консольный ",i.jsx("code",{children:"claude mcp list"}),"."]}),i.jsx("ul",{className:"extlist",children:s.map(o=>i.jsxs("li",{className:"extlist__row",children:[i.jsxs("div",{className:"extlist__head",children:[i.jsx("span",{className:"extlist__name",children:o.name}),i.jsx("span",{className:`chip chip--${Ak(o.status)}`,children:Ek[o.status]}),o.scope&&i.jsx("span",{className:"chip",children:o.scope}),o.transport&&i.jsx("span",{className:"chip",children:o.transport})]}),o.target&&i.jsx("div",{className:"extlist__meta",title:o.target,children:o.target}),o.error&&i.jsx("div",{className:"extlist__error",children:o.error}),o.tools.length>0&&i.jsxs("div",{className:"extlist__meta",children:["Инструментов: ",o.tools.length," · ",o.tools.slice(0,6).join(", "),o.tools.length>6&&"…"]}),i.jsxs("div",{className:"extlist__actions",children:[i.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>l.mcpAction(o.name,"reconnect"),children:"Переподключить"}),o.status==="disabled"?i.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>l.mcpAction(o.name,"enable"),children:"Включить"}):i.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>l.mcpAction(o.name,"disable"),children:"Выключить"}),o.editable&&i.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>l.mcpRemove(o.name),children:"Удалить"})]})]},o.name))}),r?i.jsx(Ck,{onCancel:()=>c(!1),onSubmit:(o,d)=>{l.mcpAdd(o,d),c(!1)}}):i.jsx("div",{className:"extbar",children:i.jsx("button",{className:"btn btn--primary",onClick:()=>c(!0),children:"+ Сервер"})})]})}const Ek={connected:"подключён",failed:"ошибка","needs-auth":"нужна авторизация",pending:"подключается",disabled:"выключен",unknown:"неизвестно"};function Ak(s){return s==="connected"?"ok":s==="failed"?"bad":s==="needs-auth"?"warn":"mute"}function Ck({onSubmit:s,onCancel:l}){const[r,c]=y.useState(""),[o,d]=y.useState("stdio"),[h,p]=y.useState(""),[m,x]=y.useState(""),[_,j]=y.useState(""),v=o==="stdio",E=r.trim()!==""&&(v?h.trim()!=="":m.trim()!=="");function k(){if(E)if(v){const[O,...z]=Rk(h);s(r.trim(),{transport:"stdio",command:O??"",args:z,env:_x(_)})}else s(r.trim(),{transport:o,url:m.trim(),headers:_x(_)})}return i.jsxs("div",{className:"extform extform--card",children:[i.jsx("label",{className:"field",htmlFor:"mcp-name",children:"Имя сервера"}),i.jsx("input",{id:"mcp-name",className:"input input--mono",value:r,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"context7",onChange:O=>c(O.target.value)}),i.jsx("label",{className:"field",children:"Транспорт"}),i.jsx(Is,{title:"Транспорт",value:o,options:[{value:"stdio",label:"stdio",hint:"локальный процесс"},{value:"http",label:"http",hint:"удалённый сервер"},{value:"sse",label:"sse",hint:"удалённый, поток событий"}],onChange:O=>d(O)}),v?i.jsxs(i.Fragment,{children:[i.jsx("label",{className:"field",htmlFor:"mcp-command",children:"Команда с аргументами"}),i.jsx("input",{id:"mcp-command",className:"input input--mono",value:h,spellCheck:!1,autoComplete:"off",placeholder:"npx -y @upstash/context7-mcp",onChange:O=>p(O.target.value)})]}):i.jsxs(i.Fragment,{children:[i.jsx("label",{className:"field",htmlFor:"mcp-url",children:"URL"}),i.jsx("input",{id:"mcp-url",className:"input input--mono",value:m,spellCheck:!1,autoComplete:"off",placeholder:"https://mcp.example.dev/mcp",onChange:O=>x(O.target.value)})]}),i.jsxs("label",{className:"field",htmlFor:"mcp-pairs",children:[v?"Переменные окружения":"Заголовки"," — по одной на строку, необязательно"]}),i.jsx("textarea",{id:"mcp-pairs",className:"input input--mono input--area",value:_,spellCheck:!1,placeholder:v?"API_KEY=xxx":"Authorization: Bearer xxx",onChange:O=>j(O.target.value)}),i.jsxs("div",{className:"extbar",children:[i.jsx("button",{className:"btn",onClick:l,children:"Отмена"}),i.jsx("button",{className:"btn btn--primary",disabled:!E,onClick:k,children:"Подключить"})]})]})}function _x(s){const l={};for(const r of s.split(`
|
|
120
|
+
`)){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 Rk(s){return(s.trim().match(/"[^"]*"|'[^']*'|\S+/g)??[]).map(l=>l.replace(/^["']|["']$/g,""))}function Mk({plugins:s,marketplaces:l,actions:r}){const[c,o]=y.useState("");return i.jsxs(i.Fragment,{children:[s.length===0&&i.jsx("p",{className:"modal__text",children:"Ни одного установленного плагина. Что можно поставить — на вкладке «Каталог»."}),i.jsx("ul",{className:"extlist",children:s.map(d=>i.jsxs("li",{className:"extlist__row",children:[i.jsxs("div",{className:"extlist__head",children:[i.jsx("span",{className:"extlist__name",children:d.name}),i.jsx("span",{className:d.enabled?"chip chip--ok":"chip chip--mute",children:d.enabled?"включён":"выключен"}),d.version&&d.version!=="unknown"&&i.jsx("span",{className:"chip",children:d.version}),d.scope&&i.jsx("span",{className:"chip",children:d.scope})]}),d.marketplace&&i.jsx("div",{className:"extlist__meta",children:d.marketplace}),d.mcpServers.length>0&&i.jsxs("div",{className:"extlist__meta",children:["MCP-серверы: ",d.mcpServers.join(", ")]}),i.jsxs("div",{className:"extlist__actions",children:[i.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>r.pluginToggle(d.id,!d.enabled),children:d.enabled?"Выключить":"Включить"}),i.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>r.pluginUninstall(d.id),children:"Удалить"})]})]},d.id))}),i.jsx("div",{className:"sidebar__section",children:"Маркетплейсы"}),i.jsx("ul",{className:"extlist",children:l.map(d=>i.jsxs("li",{className:"extlist__row",children:[i.jsx("div",{className:"extlist__head",children:i.jsx("span",{className:"extlist__name",children:d.name})}),d.source&&i.jsx("div",{className:"extlist__meta",children:d.source}),i.jsx("div",{className:"extlist__actions",children:i.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>r.marketplaceRemove(d.name),children:"Отключить"})})]},d.name))}),i.jsxs("div",{className:"extform__row",children:[i.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(""))}}),i.jsx("button",{className:"btn",disabled:c.trim()==="",onClick:()=>{r.marketplaceAdd(c.trim()),o("")},children:"Добавить"})]})]})}const nu=30;function Ok({catalog:s,hasMarketplaces:l,actions:r,onMarketplaces:c}){const[o,d]=y.useState(""),[h,p]=y.useState(""),[m,x]=y.useState(nu),[_,j]=y.useState(""),v=y.useMemo(()=>[...new Set(s.map(O=>O.category).filter(Boolean))].sort(),[s]),E=y.useMemo(()=>{const k=o.trim().toLowerCase();return s.filter(O=>h&&O.category!==h?!1:k?`${O.name} ${O.displayName} ${O.description} ${O.author}`.toLowerCase().includes(k):!0)},[s,o,h]);return s.length===0?i.jsxs("p",{className:"modal__text",children:[l?"Маркетплейсы подключены, но их каталог ещё не выкачан. Попробуйте открыть окно ещё раз через минуту.":"Ни одного маркетплейса — ставить нечего."," ",i.jsx("button",{className:"linkish",onClick:c,children:"Подключить маркетплейс"})]}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"catalog__filters",children:[i.jsx("input",{className:"input",value:o,spellCheck:!1,autoComplete:"off","aria-label":"Поиск по каталогу",placeholder:"Поиск: имя, описание, автор",onChange:k=>{d(k.target.value),x(nu)}}),i.jsx(Is,{title:"Категория",value:h,options:[{value:"",label:"все категории"},...v.map(k=>({value:k,label:k}))],onChange:k=>{p(k),x(nu)}})]}),E.length===0?i.jsx("p",{className:"modal__text",children:"Ничего не нашлось."}):i.jsx("ul",{className:"extlist",children:E.slice(0,m).map(k=>i.jsxs("li",{className:"extlist__row",children:[i.jsxs("div",{className:"extlist__head",children:[i.jsx("span",{className:"extlist__name",children:k.name}),k.installed&&i.jsx("span",{className:"chip chip--ok",children:"установлен"}),k.version&&i.jsx("span",{className:"chip",children:k.version}),k.category&&i.jsx("span",{className:"chip",children:k.category})]}),k.description&&i.jsx("div",{className:"catalog__desc",children:k.description}),i.jsxs("div",{className:"extlist__meta",children:[k.author&&`${k.author} · `,k.marketplace]}),i.jsxs("div",{className:"extlist__actions",children:[i.jsx("button",{className:"btn btn--ghost btn--sm",disabled:k.installed,onClick:()=>r.pluginInstall(k.id),children:k.installed?"Уже стоит":"Установить"}),k.homepage&&i.jsx("a",{className:"btn btn--ghost btn--sm",href:k.homepage,target:"_blank",rel:"noreferrer",children:"Страница"})]})]},k.id))}),E.length>m&&i.jsx("div",{className:"extbar",children:i.jsxs("button",{className:"btn",onClick:()=>x(k=>k+nu),children:["Ещё ",Math.min(nu,E.length-m)," из ",E.length-m]})}),i.jsxs("div",{className:"extform",children:[i.jsx("label",{className:"field",htmlFor:"plugin-spec",children:"Или установить по имени — если нужного в каталоге нет"}),i.jsxs("div",{className:"extform__row",children:[i.jsx("input",{id:"plugin-spec",className:"input input--mono",value:_,spellCheck:!1,autoComplete:"off",placeholder:"имя или имя@маркетплейс",onChange:k=>j(k.target.value),onKeyDown:k=>{k.key!=="Enter"||_.trim()===""||(k.preventDefault(),r.pluginInstall(_.trim()),j(""))}}),i.jsx("button",{className:"btn",disabled:_.trim()==="",onClick:()=>{r.pluginInstall(_.trim()),j("")},children:"Установить"})]})]})]})}function Dk({status:s,login:l,actions:r,remote:c,runningSessions:o,onReconnect:d,reconnectBlocked:h,reconnectHint:p,onClose:m}){const[x,_]=y.useState(""),[j,v]=y.useState(!1),[E,k]=y.useState(!1),O=d!==null&&(s==null?void 0:s.loggedIn)===!0&&!E&&!j,z=y.useMemo(()=>{if(l.error)return{ok:!1,message:l.error};const K=l.output.trim();return K===""?null:{ok:!0,message:K}},[l.error,l.output]);function ee(K=x){const M=K.trim();M!==""&&(r.submitCode(M),_(""))}function te(){if(o>0){v(!1),k(!0);return}r.login("claudeai",!0)}return i.jsxs(Vl,{title:"Аккаунт",onClose:m,children:[s===null?i.jsx("p",{className:"modal__text",children:"Спрашиваем у хоста…"}):s.loggedIn?i.jsxs("div",{className:"account",children:[i.jsx("div",{className:"account__id",children:s.email||"Вход выполнен"}),i.jsxs("div",{className:"account__chips",children:[i.jsx("span",{className:"chip chip--ok",children:Uk[s.method]??s.method}),s.plan&&i.jsx("span",{className:"chip",children:s.plan})]}),s.organization&&i.jsx("div",{className:"extlist__meta",children:s.organization})]}):i.jsxs("p",{className:"modal__text",children:["Вход не выполнен. Сессии не запустятся, пока аккаунт не подключён — или пока в окружении хоста нет ",i.jsx("code",{children:"ANTHROPIC_API_KEY"}),"."]}),l.active?i.jsx(Hk,{login:l,remote:c,code:x,onCode:_,onSubmit:ee,onCancel:r.cancel}):i.jsxs(i.Fragment,{children:[i.jsx(qi,{result:z}),E&&i.jsx("p",{className:"account__warn",role:"alert",children:Lk(o)}),O&&h&&i.jsx("p",{className:"account__note",children:p}),i.jsx("div",{className:`extbar${s!=null&&s.loggedIn?" account__bar":""}`,children:s!=null&&s.loggedIn?i.jsxs(i.Fragment,{children:[O&&i.jsxs("button",{type:"button",className:"btn account__relink",title:`Переподключить сессию
|
|
121
|
+
${p}`,"aria-label":"Переподключить сессию",disabled:h,onClick:d,children:[i.jsx(zk,{}),"Переподключить"]}),E?i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:()=>k(!1),children:"Отмена"}),i.jsx("button",{className:"btn btn--warn",autoFocus:!0,onClick:()=>{k(!1),r.login("claudeai",!0)},children:"Всё равно сменить"})]}):i.jsx("button",{className:"btn",onClick:te,children:"Сменить аккаунт"}),j?i.jsx("button",{className:"btn btn--danger",autoFocus:!0,onClick:()=>{v(!1),r.logout()},children:"Точно выйти?"}):i.jsx("button",{className:"btn",onClick:()=>{k(!1),v(!0)},children:"Выйти"})]}):i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:()=>r.login("console",!1),children:"Через Console"}),i.jsx("button",{className:"btn btn--primary",onClick:()=>r.login("claudeai",!1),children:"Войти"})]})})]})]})}function Lk(s){const l=s%10,r=s%100,c=l===1&&r!==11,o=c?"сессия":l>=2&&l<=4&&(r<12||r>14)?"сессии":"сессий";return`${s} ${o} сейчас ${c?"работает":"работают"} — смена аккаунта может ${c?"её":"их"} прервать.`}function zk(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M14 8a6 6 0 1 1-6-6c1.68 0 3.29.67 4.49 1.83L14 5.33"}),i.jsx("path",{d:"M14 2v3.33h-3.33"})]})}const Uk={"claude.ai":"подписка Claude",console:"Anthropic Console",apiKey:"API-ключ",none:"нет"};function Hk({login:s,remote:l,code:r,onCode:c,onSubmit:o,onCancel:d}){var k;const[h,p]=y.useState(null),m=y.useRef(""),x=y.useRef({code:r,onCode:c,onSubmit:o});x.current={code:r,onCode:c,onSubmit:o};const _=y.useCallback(async O=>{const{code:z,onCode:ee,onSubmit:te}=x.current;if(O&&z.trim()!=="")return;const K=await Bh();if(K===null){O||p("Не получилось прочитать буфер — вставьте код в поле руками.");return}const M=K.trim();if(!vx(M)){O||p("В буфере не похоже на код: нужен он целиком, вместе с частью после «#». Подойдёт и адрес страницы, на которую увёл браузер, — его тоже разберём.");return}if(O){if(m.current===M)return;m.current=M}p(null),ee(M),te(M)},[]);y.useEffect(()=>{if(!s.awaitingCode)return;const O=()=>{document.visibilityState==="visible"&&_(!0)};return document.addEventListener("visibilitychange",O),()=>document.removeEventListener("visibilitychange",O)},[s.awaitingCode,_]);const j=typeof((k=navigator.clipboard)==null?void 0:k.readText)=="function",v=r.trim()!==""&&!vx(r),E=h??(v?"Похоже, скопирована только часть кода — нужен он целиком, вместе с частью после «#».":null);return i.jsxs("div",{className:"account__flow",children:[s.url?l?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"field",children:"Подтвердите вход на странице Anthropic"}),i.jsx("a",{className:"btn btn--primary account__go",href:s.url,target:"_blank",rel:"noreferrer",children:"Открыть страницу входа"}),i.jsx("p",{className:"account__step",children:"После кнопки «Authorize» там появится код — скопируйте его и вернитесь сюда."}),i.jsxs("div",{className:"account__raw",children:[i.jsx("span",{className:"account__rawurl",children:s.url}),i.jsx(lp,{text:s.url,hint:"ссылку входа"})]})]}):i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"field",children:"Подтвердите вход в открывшемся браузере"}),i.jsx("p",{className:"account__step",children:"Хост открыл страницу входа на этом же компьютере — там достаточно нажать «Authorize», остальное произойдёт само."}),i.jsxs("details",{className:"account__fallback",children:[i.jsx("summary",{children:"Браузер не открылся"}),i.jsx("p",{className:"account__step",children:"Тогда откройте ссылку сами: страница покажет код, и его нужно будет вставить ниже."}),i.jsx("a",{className:"account__link",href:s.url,target:"_blank",rel:"noreferrer",children:s.url})]})]}):i.jsx("p",{className:"modal__text",children:"Запускаем вход…"}),s.awaitingCode&&i.jsxs(i.Fragment,{children:[i.jsx("label",{className:"field",htmlFor:"auth-code",children:"Код со страницы авторизации"}),i.jsxs("div",{className:"extform__row account__coderow",children:[i.jsx("input",{id:"auth-code",className:"input input--mono",value:r,autoFocus:!l,spellCheck:!1,autoComplete:"off",placeholder:"код#state",onChange:O=>{p(null),c(O.target.value)},onKeyDown:O=>{O.key==="Enter"&&(O.preventDefault(),o())}}),j&&i.jsx("button",{type:"button",className:"btn",onClick:()=>void _(!1),children:"Вставить код"}),i.jsx("button",{type:"button",className:"btn btn--primary",disabled:r.trim()==="",onClick:()=>o(),children:"Готово"})]}),E&&i.jsx("p",{className:"account__note account__note--code",children:E})]}),s.output.trim()!==""&&i.jsx("pre",{className:"account__log",children:s.output.trim()}),i.jsx("div",{className:"extbar",children:i.jsx("button",{className:"btn",onClick:d,children:"Отменить вход"})})]})}function vx(s){const l=s.trim();if(/^https?:\/\//i.test(l))return/[?#&]code=/.test(l);const[r,c]=l.split("#");return!!r&&!!c&&!/\s/.test(l)}function Bk({state:s,onPair:l,onUnpair:r,onClose:c}){const[o,d]=y.useState(""),[h,p]=y.useState(""),[m,x]=y.useState(!1),_=y.useRef(null),j=(s==null?void 0:s.paired)===!0;y.useEffect(()=>{var E;j||(E=_.current)==null||E.focus()},[j]),y.useEffect(()=>{x(!1),j&&d("")},[j,s==null?void 0:s.error]);const v=(s==null?void 0:s.url)??"https://claudevisual.com";return i.jsx(Vl,{title:"Удалённый доступ",onClose:c,children:j?i.jsxs("div",{className:"relay",children:[i.jsxs("p",{className:"relay__lede",children:["Компьютер связан с аккаунтом на ",i.jsx("b",{children:Sx(v)}),". Открывайте его оттуда с любого устройства — с телефона в том числе."]}),i.jsxs("dl",{className:"relay__facts",children:[i.jsxs("div",{children:[i.jsx("dt",{children:"Имя"}),i.jsx("dd",{children:(s==null?void 0:s.name)??"—"})]}),i.jsxs("div",{children:[i.jsx("dt",{children:"Связь"}),i.jsxs("dd",{children:[i.jsx("span",{className:s!=null&&s.connected?"dot dot--on":"dot"})," ",s!=null&&s.connected?"на связи":"нет связи, пробуем переподключиться"]})]}),i.jsxs("div",{children:[i.jsx("dt",{children:"Подключено"}),i.jsxs("dd",{children:[(s==null?void 0:s.clients)??0," вкладок"]})]})]}),(s==null?void 0:s.error)&&i.jsx("p",{className:"relay__error",children:s.error}),i.jsx("p",{className:"relay__note",children:"Терминал с удалённых устройств настраивается в настройках приложения, раздел «Терминал»."}),i.jsx("p",{className:"relay__note",children:"Отвязка гасит токен этой машины: чтобы вернуть доступ, понадобится новый код. Сессии Claude Code это не трогает."}),i.jsx("button",{className:"btn btn--danger",onClick:r,children:"Отвязать компьютер"})]}):i.jsxs("div",{className:"relay",children:[i.jsx("p",{className:"relay__lede",children:"Чтобы работать с этим компьютером из браузера и с телефона, свяжите его с аккаунтом."}),i.jsxs("ol",{className:"relay__steps",children:[i.jsxs("li",{children:["Откройте ",i.jsx("b",{children:Sx(v)})," и войдите (или зарегистрируйтесь)."]}),i.jsxs("li",{children:["Нажмите ",i.jsx("b",{children:"«Подключить ПК»"})," — появится код из восьми знаков."]}),i.jsx("li",{children:"Введите его сюда."})]}),i.jsxs("form",{className:"relay__form",onSubmit:E=>{E.preventDefault(),o.trim()&&(x(!0),l(o.trim(),h.trim()))},children:[i.jsxs("label",{className:"field",children:[i.jsx("span",{children:"Код сопряжения"}),i.jsx("input",{ref:_,className:"input relay__code",value:o,onChange:E=>d(E.target.value.toUpperCase()),placeholder:"XXXX-XXXX",autoComplete:"off",spellCheck:!1,maxLength:12})]}),i.jsxs("label",{className:"field",children:[i.jsx("span",{children:"Как назвать этот компьютер"}),i.jsx("input",{className:"input",value:h,onChange:E=>p(E.target.value),placeholder:"имя машины",autoComplete:"off",maxLength:64})]}),(s==null?void 0:s.error)&&i.jsx("p",{className:"relay__error",children:s.error}),i.jsx("button",{className:"btn btn--primary",type:"submit",disabled:!o.trim()||m,children:m?"Связываем…":"Связать"})]})]})})}function Sx(s){try{return new URL(s).host}catch{return s}}const Th="",Ik=[{value:"opus",label:"Opus",hint:"полный список моделей виден, когда открыта сессия"},{value:"sonnet",label:"Sonnet",hint:"полный список моделей виден, когда открыта сессия"},{value:"haiku",label:"Haiku",hint:"полный список моделей виден, когда открыта сессия"}],qk=Ux.map(s=>({value:s.value,label:s.value,hint:s.hint})),Vo=3600*1e3,Gk=[{value:"6h",label:"6 часов"},{value:"24h",label:"Сутки"},{value:"48h",label:"Двое суток"},{value:"168h",label:"Неделя"},{value:"never",label:"Никогда"}],Or={"6h":6*Vo,"24h":24*Vo,"48h":48*Vo,"168h":168*Vo,never:0};function Yk(s){return Or[s]??Or["48h"]}function Xk(s){const l=Object.entries(Or).find(([,r])=>r===s);return l?l[0]:Object.keys(Or).reduce((r,c)=>Math.abs(Or[c]-s)<Math.abs(Or[r]-s)?c:r)}const Vk=[{value:"off",label:"Выключено"},{value:"500",label:"0.5 с"},{value:"1500",label:"1.5 с"},{value:"3000",label:"3 с"},{value:"10000",label:"10 с"}],Dr={off:0,500:500,1500:1500,3e3:3e3,1e4:1e4};function $k(s){return Dr[s]??Dr.off}function Qk(s){const l=Object.entries(Dr).find(([,r])=>r===s);return l?l[0]:Object.keys(Dr).reduce((r,c)=>Math.abs(Dr[c]-s)<Math.abs(Dr[r]-s)?c:r)}const Zk=[{value:"project",title:"Только текущий проект",description:"Агент молча пишет файлы в открытом проекте и в ~/.claude — настройках самого Claude Code. Чужой проект и любая новая папка — только с явного разрешения."},{value:"projects",title:"Папка с проектами",description:"То же плюс каталог, где лежат открытые проекты, — то есть и соседний проект тоже. Всё остальное — с разрешения."},{value:"all",title:"Все папки на компьютере",description:"Агент пишет файлы куда угодно на диске — вопросов про место записи не будет.",risky:!0}];function Kk({settings:s,models:l,relayState:r,local:c,onChange:o,onEnableShell:d,onDisableShell:h,onOpenRelay:p,onClose:m}){const x=s===null,_=!x&&s.terminalEnabled===!0,j=!_,v=y.useMemo(()=>{const k=[{value:Th,label:"Как в Claude Code",hint:"модель определят настройки самого Claude Code"},...l.length>0?l.map(O=>({value:O.value,label:O.displayName,hint:O.description})):Ik];return s&&s.startModel!==null&&!k.some(O=>O.value===s.startModel)&&k.push({value:s.startModel,label:s.startModel}),k},[l,s]);function E(){var k,O;return(r==null?void 0:r.paired)!==!0?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"settings__hint",children:"Компьютер не связан с аккаунтом — включать удалённый доступ пока не к чему: без пары ни телефон, ни другое устройство этот компьютер вообще не видят."}),i.jsx("button",{type:"button",className:"btn",disabled:j,onClick:p,children:"Связать компьютер"})]}):(k=r.shell)!=null&&k.enabled?i.jsxs(i.Fragment,{children:[i.jsxs("p",{className:"settings__hint",children:["Разрешён: с телефона и любого другого устройства этого аккаунта можно открыть терминал и выполнить на этом компьютере что угодно — как если бы сидели за ним.",r.shell.confirmedAt&&` Включено ${new Date(r.shell.confirmedAt).toLocaleString()}.`]}),i.jsx("button",{type:"button",className:"btn btn--danger",disabled:j,onClick:h,children:"Запретить"})]}):(O=r.shell)!=null&&O.pending?i.jsxs(i.Fragment,{children:[i.jsxs("p",{className:"settings__hint",children:["Письмо ушло на ",i.jsx("b",{children:r.shell.email}),". Перейдите по ссылке из него — терминал заработает удалённо."]}),i.jsx("p",{className:"settings__hint",children:"Повторная отправка ограничена раз в минуту — если жали кнопку только что, письмо не придёт и от повторного нажатия тоже. Если сейчас доберётесь до самого компьютера, там разрешение включится сразу, без письма."}),i.jsx("button",{type:"button",className:"btn",disabled:j,onClick:d,children:"Отправить письмо ещё раз"})]}):i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"settings__hint",children:"Сейчас с телефона можно смотреть разговоры и файлы, но не запускать команды. Разрешение даёт полный доступ к терминалу этого компьютера: с телефона станет можно выполнить любую команду, как в обычной консоли за этой машиной."}),c?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"settings__hint",children:"Включится сразу — вы уже за этим компьютером, подтверждать доступ к нему нечем и незачем."}),i.jsx("button",{type:"button",className:"btn",disabled:j,onClick:d,children:"Разрешить с телефона"})]}):i.jsxs(i.Fragment,{children:[i.jsx("p",{className:"settings__hint",children:"Отсюда мгновенно не включится: на почту аккаунта уйдёт письмо, и терминал заработает только после перехода по ссылке из него."}),i.jsx("button",{type:"button",className:"btn",disabled:j,onClick:d,children:"Прислать письмо"})]})]})}return i.jsx(Vl,{title:"Настройки",onClose:m,children:i.jsxs("div",{className:"settings",children:[i.jsxs("section",{className:"settings__section",children:[i.jsx("h3",{className:"settings__heading",children:"Архивация молчащих сессий"}),i.jsx("p",{className:"settings__hint",children:"Сессия, к которой долго не возвращались, сама уезжает в архив — на диске ничего не удаляется, транскрипт остаётся, и её можно вернуть обратно в любой момент."}),x?i.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):i.jsx(Is,{className:"settings__select",value:Xk(s.autoArchiveAfterMs),options:Gk,onChange:k=>o({autoArchiveAfterMs:Yk(k)}),ariaLabel:"Через сколько молчащая сессия уезжает в архив"})]}),i.jsxs("section",{className:"settings__section",children:[i.jsx("h3",{className:"settings__heading",children:"Автосохранение"}),i.jsx("p",{className:"settings__hint",children:"Открытый файл сам уезжает на диск, если немного постоять без ввода — ручное сохранение, кнопкой или Ctrl+S, при этом всегда работает как обычно, независимо от этой настройки."}),x?i.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):i.jsx(Is,{className:"settings__select",value:Qk(s.autoSaveAfterPauseMs),options:Vk,onChange:k=>o({autoSaveAfterPauseMs:$k(k)}),ariaLabel:"Пауза перед автосохранением открытого файла"})]}),i.jsxs("section",{className:"settings__section",children:[i.jsx("h3",{className:"settings__heading",children:"Старт новой сессии"}),i.jsx("p",{className:"settings__hint",children:"Модель и режим прав, с которыми поднимается новая сессия. Уже открытую это не меняет — у неё свои переключатели в шапке."}),i.jsxs("div",{className:"settings__field",children:[i.jsx("span",{className:"settings__field-label",children:"Модель"}),x?i.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):i.jsx(Is,{className:"settings__select",value:s.startModel??Th,options:v,onChange:k=>o({startModel:k===Th?null:k}),ariaLabel:"Модель, с которой поднимается новая сессия"})]}),i.jsxs("div",{className:"settings__field",children:[i.jsx("span",{className:"settings__field-label",children:"Режим прав при старте"}),x?i.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):i.jsx(Is,{className:"settings__select",value:s.startPermissionMode,options:qk,onChange:k=>o({startPermissionMode:k}),ariaLabel:"Режим прав, с которым поднимается новая сессия"})]})]}),i.jsxs("section",{className:"settings__section",children:[i.jsx("h3",{className:"settings__heading",children:"Доступ к папкам"}),i.jsx("p",{className:"settings__hint",children:"Это про то, где агент пишет файлы (Write, Edit, NotebookEdit), не спрашивая разрешения, — не про чтение: читает он в любом случае. Ничего не запрещается наглухо — выход за выбранную границу просто превращается в обычный запрос прав, который остаётся подтвердить или отклонить."}),i.jsx("div",{className:"access",role:"radiogroup","aria-label":"Доступ к папкам",children:Zk.map(k=>{const O=!x&&s.folderAccess===k.value;return i.jsxs("button",{type:"button",role:"radio","aria-checked":O,disabled:x,className:"access__card"+(O?" is-on":"")+(k.risky?" access__card--risky":""),onClick:()=>o({folderAccess:k.value}),children:[i.jsx("span",{className:"access__radio","aria-hidden":"true"}),i.jsxs("span",{className:"access__body",children:[i.jsxs("span",{className:"access__title",children:[k.title,k.risky&&i.jsx("span",{className:"access__risk",children:"самое широкое"})]}),i.jsx("span",{className:"access__desc",children:k.description})]})]},k.value)})})]}),i.jsxs("section",{className:"settings__section",children:[i.jsxs("div",{className:"settings__switch-row",children:[i.jsxs("div",{className:"settings__switch-copy",children:[i.jsx("h3",{className:"settings__heading",children:"Терминал"}),i.jsx("p",{className:"settings__hint",children:"Панель терминала под лентой разговора: команда, которую там набрали, выполняется прямо на этом компьютере с правами вашего пользователя — не в песочнице агента, как Bash-инструмент в разговоре. Выключите — и все открытые вкладки терминала закроются, а процессы в них не переживут закрытия."})]}),x?i.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):i.jsx("button",{type:"button",role:"switch","aria-checked":_,"aria-label":"Терминал",className:_?"switch is-on":"switch",onClick:()=>o({terminalEnabled:!_}),children:i.jsx("span",{className:"switch__knob"})})]}),i.jsxs("div",{className:"settings__nested"+(j?" is-disabled":""),children:[i.jsx("h4",{className:"settings__nested-heading",children:"Удалённый доступ к терминалу"}),x?i.jsx("p",{className:"settings__hint",children:"Загрузка…"}):i.jsxs(i.Fragment,{children:[j&&i.jsx("p",{className:"settings__hint",children:"Сначала включите терминал выше — удалённый доступ выдаётся к тому, что на этой машине уже разрешено, а не поверх выключенного рубильника."}),E()]})]})]})]})})}const Fk=16;function Jk({pane:s,width:l,onResize:r,onReset:c}){const o=zi[s],d=y.useRef(null);function h(_){if(_.button!==0)return;const j=document.querySelector(".main"),v=j?Math.max(0,j.getBoundingClientRect().width-_0):0;d.current={x:_.clientX,width:l,max:Math.min(o.max,l+v)},_.currentTarget.setPointerCapture(_.pointerId),document.body.classList.add("is-resizing"),_.preventDefault()}function p(_){const j=d.current;if(!j)return;const v=o.side==="left"?_.clientX-j.x:j.x-_.clientX;r(Math.min(j.max,j.width+v))}function m(_){d.current&&(d.current=null,_.currentTarget.hasPointerCapture(_.pointerId)&&_.currentTarget.releasePointerCapture(_.pointerId),document.body.classList.remove("is-resizing"))}function x(_){const j=_.key==="ArrowRight"?1:_.key==="ArrowLeft"?-1:0;j!==0&&(_.preventDefault(),r(l+j*Fk*(o.side==="left"?1:-1)))}return i.jsx("div",{className:`pane-resizer pane-resizer--${s} 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:p,onPointerUp:m,onPointerCancel:m,onDoubleClick:c,onKeyDown:x,children:i.jsx("span",{className:"pane-resizer__line","aria-hidden":"true"})})}const Wk=16;function Pk({height:s,onResize:l,onReset:r}){const c=y.useRef(null);function o(){const x=document.querySelector(".main .transcript, .main .editor");if(!x)return 1/0;const _=x.getBoundingClientRect().height-k0;return Math.round(s+Math.max(0,_))}function d(x){x.button===0&&(c.current={y:x.clientY,height:s,max:o()},x.currentTarget.setPointerCapture(x.pointerId),document.body.classList.add("is-resizing-row"),x.preventDefault())}function h(x){const _=c.current;if(!_)return;const j=_.y-x.clientY;l(_.height+j,_.max)}function p(x){c.current&&(c.current=null,x.currentTarget.hasPointerCapture(x.pointerId)&&x.currentTarget.releasePointerCapture(x.pointerId),document.body.classList.remove("is-resizing-row"))}function m(x){const _=x.key==="ArrowUp"?1:x.key==="ArrowDown"?-1:0;_!==0&&(x.preventDefault(),l(s+_*Wk,o()))}return i.jsx("div",{className:"term-resizer",role:"separator","aria-orientation":"horizontal","aria-label":"Высота панели терминала","aria-valuenow":s,"aria-valuemin":Ix,tabIndex:0,title:"Потяните, чтобы изменить высоту; двойной щелчок — высота по умолчанию",onPointerDown:d,onPointerMove:h,onPointerUp:p,onPointerCancel:p,onDoubleClick:r,onKeyDown:m,children:i.jsx("span",{className:"term-resizer__line","aria-hidden":"true"})})}function jx(){const s=document.documentElement,l=getComputedStyle(s),r=te=>l.getPropertyValue(te).trim(),c=r("--surface"),o=r("--text"),d=r("--text-2"),h=r("--muted"),p=r("--accent"),m=r("--accent-fg"),x=r("--select"),_=r("--danger"),j=r("--ok"),v=r("--warn"),E=r("--cm-fn"),k=r("--cm-key"),O=r("--cm-type"),z=kx(o,c,55),ee=te=>kx(te,"#ffffff",25);return{background:c,foreground:o,cursor:p,cursorAccent:m,selectionBackground:x,black:z,brightBlack:h,red:_,brightRed:ee(_),green:j,brightGreen:ee(j),yellow:v,brightYellow:ee(v),blue:E,brightBlue:ee(E),magenta:k,brightMagenta:ee(k),cyan:O,brightCyan:ee(O),white:d,brightWhite:o}}function ew(){return getComputedStyle(document.documentElement).getPropertyValue("--mono").trim()}let Os=null;function tw(s){return Os||(Os=document.createElement("span"),Os.style.position="fixed",Os.style.width="0",Os.style.height="0",Os.style.opacity="0",Os.style.pointerEvents="none",document.body.appendChild(Os)),Os.style.color=s,getComputedStyle(Os).color}function kx(s,l,r){return tw(`color-mix(in srgb, ${s} ${100-r}%, ${l} ${r}%)`)}let $o=null;function nw(){return $o||($o=Promise.all([Ve(()=>import("./xterm-D6Mng-DB.js").then(s=>s.x),__vite__mapDeps([22,23]),import.meta.url),Ve(()=>import("./addon-fit-CevVMrUA.js").then(s=>s.a),__vite__mapDeps([24,23]),import.meta.url),Ve(()=>import("./addon-web-links-CnB65OV_.js").then(s=>s.a),__vite__mapDeps([25,23]),import.meta.url),Ve(()=>Promise.resolve({}),__vite__mapDeps([26]),import.meta.url)]).then(([s,l,r])=>({Terminal:s.Terminal,FitAddon:l.FitAddon,WebLinksAddon:r.WebLinksAddon})).catch(s=>{throw $o=null,s})),$o}function lw({terminals:s,activeId:l,blocked:r,error:c,onDismissError:o,height:d,offset:h,mobile:p=!1,zoomed:m,onToggleZoom:x,onSelect:_,onOpen:j,onClose:v,onInput:E,onResize:k,onAttach:O,onHide:z,registerSink:ee}){const[te,K]=y.useState(()=>jx());return y.useEffect(()=>{const M=new MutationObserver(()=>K(jx()));return M.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>M.disconnect()},[]),i.jsxs("div",{className:"termpanel"+(p?" termpanel--mobile":"")+(!p&&m?" termpanel--zoomed":""),style:p?{height:d,top:(h==null?void 0:h.top)??0,left:(h==null?void 0:h.left)??0}:m?void 0:{height:d},children:[i.jsxs("div",{className:"termpanel__tabbar",onDoubleClick:M=>{x&&(M.target.closest("button")||x())},children:[i.jsx("div",{className:"termpanel__tabs",role:"tablist","aria-label":"Открытые терминалы",children:s.map(M=>i.jsxs("div",{role:"tab","aria-selected":M.id===l,className:"termtab"+(M.id===l?" is-on":"")+(M.exitCode!==null?" termtab--exited":""),onDoubleClick:F=>{x&&(F.target.closest(".termtab__close")||x())},children:[i.jsx("button",{className:"termtab__name",title:M.cwd,onClick:()=>_(M.id),children:M.title}),M.exitCode!==null&&i.jsx("span",{className:"termtab__code",title:`Оболочка завершилась с кодом ${M.exitCode}`,children:M.exitCode}),i.jsx("button",{className:"termtab__close",title:"Закрыть терминал","aria-label":`Закрыть терминал «${M.title}»`,onClick:()=>v(M.id),children:"✕"})]},M.id))}),i.jsx("button",{className:"termpanel__add",title:"Новый терминал","aria-label":"Новый терминал",disabled:r,onClick:j,children:"+"}),i.jsx("div",{className:"termpanel__spacer"}),x&&i.jsx("button",{className:"termpanel__zoom",title:m?"Свернуть терминал — то же самое, что двойной клик по вкладке":"Развернуть терминал на весь экран — то же самое, что двойной клик по вкладке","aria-label":m?"Свернуть терминал":"Развернуть терминал на весь экран","aria-pressed":m,onClick:x,children:i.jsx(Zr,{active:m})}),i.jsx("button",{className:"termpanel__hide",title:"Скрыть панель","aria-label":"Скрыть панель терминала",onClick:z,children:"✕"})]}),c&&s.length>0&&i.jsx(wx,{message:c,strip:!0,onRetry:null,onDismiss:o}),i.jsxs("div",{className:"termpanel__body",children:[c&&s.length===0?i.jsx(wx,{message:c,onRetry:r?null:j,onDismiss:o}):r?i.jsxs("div",{className:"termpanel__empty",children:[i.jsx("p",{children:"Терминал с удалённых устройств выключен"}),i.jsx("p",{className:"termpanel__hint",children:"Откройте «Удалённый доступ» → «Прислать письмо»: на почту аккаунта придёт ссылка, и после перехода по ней терминал заработает прямо здесь. Если сейчас доберётесь до самого компьютера — там разрешение включается сразу, без письма."})]}):s.length===0&&i.jsxs("div",{className:"termpanel__empty",children:[i.jsx("p",{children:"Терминалов не открыто"}),i.jsx("button",{className:"btn btn--primary",onClick:j,children:"Открыть терминал"})]}),s.map(M=>i.jsx(aw,{id:M.id,exitCode:M.exitCode,active:M.id===l,theme:te,mobile:p,onInput:E,onResize:k,onAttach:O,registerSink:ee},M.id))]})]})}function wx({message:s,strip:l=!1,onRetry:r,onDismiss:c}){const{lede:o,hint:d,details:h}=sw(s);return i.jsxs("div",{className:l?"termfail termfail--strip":"termfail",role:"alert",children:[i.jsxs("div",{className:"termfail__text",children:[i.jsx("p",{className:"termfail__lede",children:o}),d&&i.jsx("p",{className:"termfail__hint",children:d}),h&&i.jsxs("details",{className:"termfail__details",children:[i.jsx("summary",{children:"Подробности"}),i.jsx("pre",{children:h})]})]}),i.jsxs("div",{className:"termfail__bar",children:[r&&i.jsx("button",{className:"btn btn--primary",onClick:r,children:"Открыть терминал"}),i.jsx("button",{className:"btn",onClick:c,children:"Понятно"})]})]})}function sw(s){const[l="",...r]=s.trim().split(`
|
|
122
|
+
|
|
123
|
+
`),c=l.split(`
|
|
124
|
+
`).map(o=>o.trim()).filter(o=>o!=="");return{lede:c[0]??s.trim(),hint:c.slice(1).join(" "),details:r.join(`
|
|
125
|
+
|
|
126
|
+
`).trim()}}function aw({id:s,exitCode:l,active:r,theme:c,mobile:o,onInput:d,onResize:h,onAttach:p,registerSink:m}){const x=y.useRef(null),_=y.useRef(null),j=y.useRef(!1),v=y.useRef(o);v.current=o;const E=y.useRef(c),k=y.useRef(l),[O,z]=y.useState("loading"),[ee,te]=y.useState(!1);return y.useEffect(()=>{if(!x.current)return;let M=!1,F=null;z("loading"),te(!1);const H=window.setTimeout(()=>{M||te(!0)},200);return(async()=>{var Ce;let A;try{A=await nw()}catch{window.clearTimeout(H),M||z("error");return}if(M||!x.current)return;window.clearTimeout(H);const{Terminal:Z,FitAddon:ae,WebLinksAddon:G}=A,J=new Z({fontFamily:ew()||"monospace",fontSize:13,lineHeight:1.2,cursorBlink:!0,cursorStyle:"bar",scrollback:5e3,theme:E.current}),D=new ae;J.loadAddon(D),J.loadAddon(new G),J.open(x.current),_.current=J,J.attachCustomKeyEventHandler(w=>{if(w.type!=="keydown"||!(w.ctrlKey||w.metaKey))return!0;if(w.key==="`")return w.preventDefault(),!1;if(w.key==="c"||w.key==="C"){const re=J.getSelection();return re?(w.preventDefault(),$r(re),!1):!w.shiftKey}return w.key==="v"||w.key==="V"?(w.preventDefault(),Bh().then(re=>{re&&J.paste(re)}),!1):!0});const ge=w=>{w.preventDefault();const Q=J.getSelection();if(Q){$r(Q),J.clearSelection();return}Bh().then(re=>{re&&J.paste(re)})};(Ce=J.element)==null||Ce.addEventListener("contextmenu",ge);const Se=J.onData(w=>d(s,w));let xe={cols:J.cols,rows:J.rows},B=null;const ue=J.onResize(({cols:w,rows:Q})=>{B!==null&&window.clearTimeout(B),B=window.setTimeout(()=>{B=null,!(w===xe.cols&&Q===xe.rows)&&(xe={cols:w,rows:Q},h(s,w,Q))},100)}),se=new ResizeObserver(()=>{try{D.fit()}catch{return}v.current&&J.scrollToBottom()});se.observe(x.current);const be=m(s,w=>{w.kind==="buffer"&&J.reset(),J.write(w.data)});p(s),k.current!==null&&!j.current&&(j.current=!0,J.write(`\r
|
|
127
|
+
\x1B[2m— Процесс завершён (код ${k.current}) —\x1B[0m\r
|
|
128
|
+
`)),r&&J.focus(),F=()=>{var w;B!==null&&window.clearTimeout(B),se.disconnect(),(w=J.element)==null||w.removeEventListener("contextmenu",ge),Se.dispose(),ue.dispose(),be(),J.dispose(),_.current=null},z("ready")})(),()=>{M=!0,window.clearTimeout(H),F==null||F(),F=null}},[s]),y.useEffect(()=>{if(!o)return;const K=x.current;if(!K)return;let M=null,F=0,H=!1;const A=J=>{J.pointerType==="mouse"||M!==null||(M=J.pointerId,F=J.clientY,H=!1)},Z=J=>{if(J.pointerId!==M)return;const D=F-J.clientY;if(!H){if(Math.abs(D)<4)return;H=!0,K.setPointerCapture(J.pointerId)}F=J.clientY;const ge=K.querySelector(".xterm-viewport");ge&&(ge.scrollTop+=D)},ae=J=>{J.pointerId===M&&(K.hasPointerCapture(J.pointerId)&&K.releasePointerCapture(J.pointerId),M=null,H=!1)},G=J=>J.stopPropagation();return K.addEventListener("pointerdown",A),K.addEventListener("pointermove",Z),K.addEventListener("pointerup",ae),K.addEventListener("pointercancel",ae),K.addEventListener("touchmove",G,{capture:!0}),()=>{K.removeEventListener("pointerdown",A),K.removeEventListener("pointermove",Z),K.removeEventListener("pointerup",ae),K.removeEventListener("pointercancel",ae),K.removeEventListener("touchmove",G,{capture:!0}),M!==null&&K.hasPointerCapture(M)&&K.releasePointerCapture(M)}},[o]),y.useEffect(()=>{E.current=c,_.current&&(_.current.options.theme=c)},[c]),y.useEffect(()=>{var K;r&&((K=_.current)==null||K.focus())},[r]),y.useEffect(()=>{if(k.current=l,l===null){j.current=!1;return}if(j.current)return;const K=_.current;K&&(j.current=!0,K.write(`\r
|
|
129
|
+
\x1B[2m— Процесс завершён (код ${l}) —\x1B[0m\r
|
|
130
|
+
`))},[l]),i.jsxs("div",{className:"termview"+(r?" is-active":""),children:[i.jsx("div",{ref:x,className:"termview__surface"+(O==="ready"?"":" is-hidden")}),O==="loading"&&ee&&i.jsxs("div",{className:"termview__state work",role:"status",children:[i.jsxs("div",{className:"work__dots",children:[i.jsx("span",{className:"work__dot"}),i.jsx("span",{className:"work__dot"}),i.jsx("span",{className:"work__dot"})]}),i.jsx("span",{className:"work__label",children:"Загружается терминал…"})]}),O==="error"&&i.jsxs("div",{className:"termview__state termview__state--error",role:"alert",children:[i.jsx("p",{children:"Не удалось загрузить терминал"}),i.jsx("p",{className:"termpanel__hint",children:"Соединение оборвалось раньше, чем приехал нужный модуль — на мобильном relay это обычное дело на слабой сети. Ниже — перезагрузка страницы, а не тихий повтор: открытые терминалы и их содержимое приедут обратно с хоста, а вот черновик в поле ввода внизу — нет."}),i.jsx("button",{className:"btn btn--primary",onClick:()=>window.location.reload(),children:"Перезагрузить страницу"})]})]})}const iw=2e5,rw=75,cw=90;function uw({tokens:s,maxTokens:l,fetchedAt:r}){if(s===null)return null;const c=l??iw,o=Math.min(100,Math.round(s/c*100)),d=`${s.toLocaleString()} из ${c.toLocaleString()} токенов${r?`
|
|
131
|
+
обновлено в ${new Date(r).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:""}`;return i.jsxs("div",{className:"contextbar","aria-label":`Занято контекста: ${o}%`,title:d,children:[i.jsx("span",{className:"contextbar__label",children:"контекст"}),i.jsx("span",{className:"contextbar__track",role:"progressbar","aria-valuenow":o,"aria-valuemin":0,"aria-valuemax":100,children:i.jsx("span",{className:`contextbar__fill${ow(o)}`,style:{width:`${o}%`}})}),i.jsxs("span",{className:"contextbar__pct",children:[o,"%"]})]})}function ow(s){return s>=cw?" contextbar__fill--over":s>=rw?" contextbar__fill--warn":""}const Cy="ccv:last-session",fw=300*1e3,dw=1e4;function hw(){try{const s=localStorage.getItem(Cy);if(!s)return null;const l=JSON.parse(s);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 pw(s,l){return s.id===l.sessionId?!0:l.claudeSessionId?s.id===l.claudeSessionId||s.claudeSessionId===l.claudeSessionId:!1}const mw={mcp:"mcp",plugins:"plugins",plugin:"plugins"},Nx=[{name:"login",description:"Войти в аккаунт Claude — окно приложения",argumentHint:"",aliases:["signin","вход"]},{name:"switch-account",description:"Сменить аккаунт: выйти и войти заново",argumentHint:"",aliases:["account","аккаунт"]},{name:"logout",description:"Выйти из аккаунта Claude",argumentHint:"",aliases:["signout","выход"]}],gw={active:!1,url:"",awaitingCode:!1,output:"",error:null};function Tx(s,l,r){if(s===null)return null;const c=s.lastIndexOf("/");if(c===-1&&s!=="")return l;const o=r[c===-1?"":s.slice(0,c)];if(!o)return null;const d=s.slice(c+1).toLowerCase();return d===""?{query:s,entries:o}:{query:s,entries:o.filter(h=>h.name.toLowerCase().includes(d)).sort((h,p)=>Ex(h.name,d)-Ex(p.name,d))}}function Ex(s,l){return s.toLowerCase().startsWith(l)?0:1}function Ax(s,l){const r=s.find(o=>o.value===l)??s.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}]:[],...s],selected:(r==null?void 0:r.value)??c??(s.some(o=>o.value==="default")?"default":"")}}function bw(){var ds;const s=y.useRef(null),[l,r]=y.useState(!1),[c,o]=y.useState("Нет связи с хостом"),[d,h]=y.useState(null),[p,m]=y.useState(!1),x=y.useMemo(()=>Ko()==="relay",[]),[_,j]=y.useState([]),[v,E]=y.useState([]),[k,O]=y.useState([]),[z,ee]=y.useState([]),[te,K]=y.useState([]),[M,F]=y.useState([]),[H,A]=y.useState([]),[Z,ae]=y.useState([]),[G,J]=y.useState(null),[D,ge]=y.useState(null),[Se,xe]=y.useState(null),[B,ue]=y.useState(Ol),[se,be]=y.useState(uh),[Ce,w]=y.useState(!1),[Q,re]=y.useState(!1),oe=uf("(max-width: 860px)"),[ye,je]=y.useState(!1);y.useEffect(()=>{oe||je(!1)},[oe]);const[Me,ht]=y.useState(!1),[lt,Nn]=y.useState([]),[Je,Kt]=y.useState(!1),[ct,rn]=y.useState(Ol),[Be,rt]=y.useState(null),[Hn,wt]=y.useState(null),[Ot,Ft]=y.useState([]),[tn,$t]=y.useState(null),[Nt,Qe]=y.useState(null),[We,dn]=y.useState([]),[Jt,Qt]=y.useState([]),[Bn,Tn]=y.useState([]),[hn,sl]=y.useState([]),[zt,bt]=y.useState(null),[Ut,$e]=y.useState(!1),[Qn,W]=y.useState(null),[de,we]=y.useState(null),[L,V]=y.useState(!1),[_e,ze]=y.useState(gw),[st,al]=y.useState(null),[Pe,En]=y.useState(null),[In,$l]=y.useState(!1),[da,,qs]=x0(),Ll=j0(),[qn,pl]=y.useState(!1),[nn,_l]=y.useState(null),[Gn,Ht]=y.useState(null),[Ze,ln]=y.useState(null),[is,An]=y.useState(null),[Cn,zl]=y.useState(null),[vl,ys]=y.useState(""),[It,Ql]=y.useState(null),[Zl,pn]=y.useState([]),[Tt,Yn]=y.useState(!1),[Gs,cn]=y.useState(null),[T,he]=y.useState(!1),[Ge,pt]=y.useState(!1),[un,ml]=y.useState({}),[il,mn]=y.useState([""]),[xt,rl]=y.useState([]),[ha,Sl]=y.useState(null),[ti,gl]=y.useState(null),[_s,Rn]=y.useState(null),[rs,vs]=y.useState(null),[Ss,jl]=y.useState(null),[me,N]=y.useState({}),[I,fe]=y.useState({}),[Ne,Oe]=y.useState(!1),[Ue,Et]=y.useState(null),[Wt,gn]=y.useState(null),Dt=y.useRef(0),bn=y.useRef(null),[Bt,js]=y.useState(!1),[cs,pa]=y.useState([]),[Kr,ni]=y.useState(null),[li,kl]=y.useState(null),ma=w0(),Ys=T0(oe&&Bt),wl=y.useRef(new Map),us=(de==null?void 0:de.terminalEnabled)===!0,Xs=Ko()==="relay"&&((ds=d==null?void 0:d.shell)==null?void 0:ds.enabled)!==!0,Gi=y.useRef(!1),Yi=y.useCallback((g,q)=>(wl.current.set(g,q),()=>{wl.current.get(g)===q&&wl.current.delete(g)}),[]),[Kl,Xi]=y.useState(!1),[Zn,Fl]=y.useState(null),[si,ks]=y.useState(Ol),[os,ga]=y.useState(null),[Vs,Ul]=y.useState({}),ws=y.useRef([]),[qt,Fr]=y.useState(null);function df(g){Fr(q=>q===g?null:g)}y.useEffect(()=>{(oe||qt==="terminal"&&!Bt||qt==="files"&&!Ge||qt==="search"&&!Ne||qt==="git"&&!qn||qt==="ask"&&!Kl||qt==="main"&&xt.length===0)&&Fr(null)},[qt,oe,Bt,Ge,Ne,qn,Kl,xt.length]);const[hf]=y.useState(hw),Vi=y.useRef(hf),$i=y.useRef(!1),Kn=y.useRef(null),xn=y.useRef(null),du=y.useRef(0);Kn.current=D,xn.current=G,du.current=B.lastSeq;const hu=y.useRef(se);hu.current=se;const Jl=y.useRef(null),pu=y.useRef(0);pu.current=si.lastSeq;const Qi=y.useRef(null),Zi=y.useRef(""),ai=y.useRef(null),fs=y.useRef([]),mu=y.useRef([""]);fs.current=xt,mu.current=il;const ii=y.useRef(new Map),Ki=y.useRef(new Set),ba=y.useRef(null),ri=y.useRef(null),gu=y.useRef(0),ci=y.useRef(new Set);y.useEffect(()=>{const g=d0();if(!g)return;s.current=g;const q=()=>{r(g.connected),o(g.statusText)};g.onStatus(q),g.onReconnect(()=>{q();const Pt=Kn.current;Pt&&g.send({type:"session.sync",sessionId:Pt,sinceSeq:du.current});const yn=Jl.current;yn&&g.send({type:"session.sync",sessionId:yn,sinceSeq:pu.current})});const pe=g.on(Pt=>pf(Pt));g.connect();const Ye=window.setInterval(()=>{q(),g.connected&&g.send({type:"ping",nonce:Date.now()})},15e3);return()=>{pe(),window.clearInterval(Ye),g.close()}},[]);const pf=y.useCallback(g=>{var q,pe,Ye,Pt,yn,Ln,Fs;switch(g.type){case"hello.ok":r(!0);break;case"workspace.list":{j(g.workspaces),E(g.archived),J(Ie=>{var zn;if(Ie)return Ie;const ut=Vi.current,dt=ut&&g.workspaces.find(gi=>gi.id===ut.workspaceId);return(dt==null?void 0:dt.id)??((zn=g.workspaces[0])==null?void 0:zn.id)??null});const Ee=ai.current;if(!Ee)break;const De=g.workspaces.find(Ie=>vw(Ie.path,Ee));if(!De)break;ai.current=null,ht(!1),J(De.id);break}case"workspace.candidates":if(g.query.trim()!==Zi.current)break;Nn(g.candidates),g.source==="host"&&Kt(!1);break;case"finder.opened":Qi.current=g.sessionId;break;case"workspace.roots":Ft(g.roots);break;case"workspace.created":if(J(g.workspace.id),g.warnings.length===0){ht(!1),wt(null);break}$t({path:g.workspace.path,warnings:g.warnings});break;case"session.list":if(g.workspaceId!==xn.current)break;F(g.sessions),A(g.archived);break;case"folder.list":O(g.workspaceFolders),ee(g.sessionFolders),K(g.pinnedFolders);break;case"session.pinned":ae(g.sessions);break;case"session.summary":if(g.session.id===Qi.current){rt(g.session);break}if(g.session.parentSessionId){g.session.id===Jl.current&&ga(g.session);break}F(Ee=>{const De=Ee.findIndex(ut=>ut.id===g.session.id);if(De===-1)return[g.session,...Ee];const Ie=Ee.slice();return Ie[De]=g.session,Ie}),ae(Ee=>{const De=Ee.findIndex(ut=>ut.id===g.session.id);if(De===-1)return Ee;const Ie=Ee.slice();return Ie[De]={...g.session,pinned:!0,...Ee[De].pinnedAt?{pinnedAt:Ee[De].pinnedAt}:{}},Ie}),ge(Ee=>Ee??g.session.id);break;case"usage.state":g.sessionId===Kn.current&&(al(g.usage),$l(!1));break;case"context.state":g.sessionId===Kn.current&&(En(g.context),$l(!1));break;case"session.capabilities":g.sessionId===Kn.current&&xe(g.capabilities);break;case"session.events":if(g.sessionId===Jl.current){ks(Ee=>Fo(Ee,g.entries));break}if(g.sessionId===Qi.current){rn(Ee=>Fo(Ee,g.entries));break}if(g.sessionId!==Kn.current)break;for(const Ee of g.entries){if(Ee.event.kind!=="rewound")continue;const De=Ee.event.toUserIndex,Ie=g0(hu.current.entries,De),ut=Ie.reduce((dt,zn)=>zn.event.kind==="user.message"?dt+1:dt,0);be(dt=>({...dt,entries:Ie})),ue(dt=>({...dt,items:b0(dt.items,De,ut)}))}ue(Ee=>Fo(Ee,g.entries));break;case"session.history":if(g.sessionId!==Kn.current)break;be(Ee=>h0(Ee,g));break;case"side.opened":{if(g.parentSessionId!==Kn.current)break;Jl.current=g.sessionId,Fl(g.sessionId);const Ee=ws.current;ws.current=[];for(const De of Ee)De(g.sessionId);break}case"side.closed":if(g.parentSessionId!==Kn.current)break;Jl.current=null,Fl(null),ks(Ol),ga(null);break;case"git.state":if(g.workspaceId!==xn.current)break;_l(g.state);break;case"git.commit":if(g.workspaceId!==xn.current)break;Ht(g.detail);break;case"git.result":if(g.workspaceId!==xn.current)break;An({ok:g.ok,message:g.message,url:g.url}),g.ok&&(Ht(null),ln(null),Yn(!1),he(!1));break;case"git.busy":if(g.workspaceId!==xn.current)break;ys(g.label);break;case"git.files":if(g.workspaceId!==xn.current)break;cn({files:g.files,truncated:g.truncated});break;case"github.status":Ql(g.status);break;case"github.owners":pn(g.owners);break;case"fs.dir":if(g.workspaceId!==xn.current)break;ml(Ee=>({...Ee,[g.path]:g.entries}));break;case"fs.search":if(g.workspaceId!==xn.current)break;if(g.scope!=="tree"){const Ee=g.scope;fe(De=>({...De,[Ee]:{query:g.query,entries:g.entries}}));break}jl({query:g.query,entries:g.entries,truncated:g.truncated});break;case"fs.grep":if(g.workspaceId!==xn.current)break;Et({query:g.query,matches:g.matches,truncated:g.truncated});break;case"fs.file":{if(g.workspaceId!==xn.current)break;const Ee=Ki.current.delete(g.file.path);rl(Ie=>{const ut=Ie.findIndex(gi=>gi.path===g.file.path);if(ut===-1)return[...Ie,Fb(g.file,++gu.current)];const dt=Ie[ut],zn=Ie.slice();return zn[ut]=dt.saved===g.file.content&&!ca(dt)?{...dt,mtime:g.file.mtime,size:g.file.size,stale:!1}:Fb(g.file,++gu.current),zn}),Ee&&Sl(g.file.path);const De=bn.current;De&&De.path===g.file.path&&(bn.current=null,gn({...De,token:++Dt.current}));break}case"fs.media":{if(g.workspaceId!==xn.current)break;ci.current.delete(g.path),rl(Ee=>Ee.map(De=>De.path===g.path?{...De,mediaBase64:g.base64,mediaError:void 0}:De));break}case"fs.mediaFailed":{if(g.workspaceId!==xn.current)break;ci.current.delete(g.path),rl(Ee=>Ee.map(De=>De.path===g.path?{...De,mediaError:g.message}:De));break}case"fs.saved":{if(g.workspaceId!==xn.current)break;const Ee=ii.current.get(g.path);ii.current.delete(g.path);const De=Ee!==void 0;rl(ut=>ut.map(dt=>dt.path!==g.path?dt:De?{...dt,saved:Ee,mtime:g.mtime,size:g.size,stale:!1}:{...dt,stale:!0}));const Ie=fs.current.find(ut=>ut.path===g.path);!De&&Ie&&!ca(Ie)&&((q=s.current)==null||q.send({type:"fs.read",workspaceId:g.workspaceId,path:g.path})),(pe=s.current)==null||pe.send({type:"git.state",workspaceId:g.workspaceId});break}case"fs.result":{if(g.workspaceId!==xn.current)break;if(gl({ok:g.ok,message:g.message}),g.ok||ii.current.delete(g.path),g.conflict&&rl(De=>De.map(Ie=>Ie.path===g.path?{...Ie,stale:!0}:Ie)),ri.current===g.path){const De=ri.current;ri.current=null,g.ok&&(Ki.current.add(De),(Ye=s.current)==null||Ye.send({type:"fs.read",workspaceId:g.workspaceId,path:De}))}const Ee=ba.current;if(g.ok&&Ee&&Ee.to===g.path){ba.current=null;const De=Ie=>Ie===Ee.from?Ee.to:Ie.startsWith(`${Ee.from}/`)?Ee.to+Ie.slice(Ee.from.length):Ie;rl(Ie=>Ie.map(ut=>({...ut,path:De(ut.path)}))),Sl(Ie=>Ie===null?null:De(Ie)),mn(Ie=>Ie.map(De)),ml(Ie=>{const ut={};for(const[dt,zn]of Object.entries(Ie))dt===Ee.from||dt.startsWith(`${Ee.from}/`)||(ut[dt]=zn);return ut})}g.ok&&((Pt=s.current)==null||Pt.send({type:"git.state",workspaceId:g.workspaceId}));break}case"term.list":if(g.workspaceId!==xn.current)break;pa(g.terminals);break;case"term.opened":if(g.terminal.workspaceId!==xn.current)break;kl(null),pa(Ee=>{const De=Ee.findIndex(ut=>ut.id===g.terminal.id);if(De===-1)return[...Ee,g.terminal];const Ie=Ee.slice();return Ie[De]=g.terminal,Ie}),Gi.current&&(Gi.current=!1,ni(g.terminal.id));break;case"term.buffer":(yn=wl.current.get(g.id))==null||yn({kind:"buffer",data:g.data});break;case"term.data":(Ln=wl.current.get(g.id))==null||Ln({kind:"data",data:g.data});break;case"term.exit":pa(Ee=>Ee.map(De=>De.id===g.id?{...De,exitCode:g.exitCode}:De));break;case"term.closed":pa(Ee=>Ee.filter(De=>De.id!==g.id));break;case"mcp.list":g.sessionId===Kn.current&&dn(g.servers);break;case"plugin.list":if(g.sessionId!==Kn.current)break;Qt(g.plugins),Tn(g.marketplaces),sl(g.catalog);break;case"operation.result":g.sessionId===Kn.current&&bt(g.result);break;case"auth.status":W(g.status);break;case"relay.state":h(g.state);break;case"settings.state":we(g.settings);break;case"auth.login":ze(g.state),g.state.active&&$e(!0);break;case"session.closed":F(Ee=>Ee.map(De=>De.id===g.sessionId?{...De,state:"closed"}:De));break;case"error":console.error("[host]",g.message,g.context??""),(g.context==="workspace.open"||g.context==="workspace.create")&&(ai.current=null,wt(g.message)),(Fs=g.context)!=null&&Fs.startsWith("term.")&&kl(g.message);break}},[]),le=y.useCallback(g=>{var q;(q=s.current)==null||q.send(g)},[]);y.useEffect(()=>{G&&le({type:"session.list",workspaceId:G})},[G,le]),y.useEffect(()=>{l&&le({type:"session.pins"})},[l,le]),y.useEffect(()=>{l&&le({type:"settings.get"})},[l,le]),y.useEffect(()=>{if($i.current)return;const g=Vi.current;if(!g||!G)return;if(G!==g.workspaceId){$i.current=!0;return}if(D){$i.current=!0;return}if(M.length===0)return;const q=M.find(pe=>pw(pe,g));$i.current=!0,q&&di(q)},[M,G,D]),y.useEffect(()=>{!G||Xs||!us||le({type:"term.list",workspaceId:G})},[G,Xs,us,le]),y.useEffect(()=>{ni(g=>{var q;return g&&cs.some(pe=>pe.id===g)?g:((q=cs[0])==null?void 0:q.id)??null})},[cs]),y.useEffect(()=>{Me&&le({type:"workspace.roots"})},[Me,le]);const xa=y.useCallback(()=>{const g=Kn.current;g&&($l(!0),le({type:"usage.get",sessionId:g}),le({type:"context.get",sessionId:g}))},[le]);y.useEffect(()=>{if(!In)return;const g=window.setTimeout(()=>$l(!1),dw);return()=>window.clearTimeout(g)},[In]);const Jr=y.useMemo(()=>{const g=Math.max((st==null?void 0:st.fetchedAt)??0,(Pe==null?void 0:Pe.fetchedAt)??0);return g>0?g:null},[st==null?void 0:st.fetchedAt,Pe==null?void 0:Pe.fetchedAt]),mf="Обновить лимиты и контекст"+(Jr?`
|
|
132
|
+
обновлено в ${new Date(Jr).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:"");y.useEffect(()=>{if(En(null),!D)return;xa();const g=()=>{document.hidden||xa()},q=window.setInterval(g,fw),pe=()=>{document.hidden||xa()};return document.addEventListener("visibilitychange",pe),()=>{window.clearInterval(q),document.removeEventListener("visibilitychange",pe)}},[D,xa]),y.useEffect(()=>{if(!D){be(uh);return}be({...uh,loading:!0}),le({type:"session.history",sessionId:D})},[D,le]);const gf=y.useCallback(()=>{!D||se.loading||!db(se)||(be(g=>({...g,loading:!0})),le({type:"session.history",sessionId:D,before:zx(se)}))},[D,se,le]),Wr=y.useMemo(()=>p0(se.entries),[se.entries]),ke=y.useMemo(()=>M.find(g=>g.id===D)??null,[M,D]),ya=_.find(g=>g.id===G)??v.find(g=>g.id===G)??null;y.useEffect(()=>{if(!G||!D)return;const g={workspaceId:G,sessionId:D,claudeSessionId:(ke==null?void 0:ke.claudeSessionId)??null};try{localStorage.setItem(Cy,JSON.stringify(g))}catch{}},[G,D,ke==null?void 0:ke.claudeSessionId]);function bu(g){ai.current=g,wt(null),le({type:"workspace.open",path:g})}function xu(g,q,pe){wt(null),le({type:"workspace.create",parent:g,name:q,init:pe})}function yu(g){if(Zi.current=g,!g){Nn([]),Kt(!1);return}Kt(!0),le({type:"workspace.find",query:g})}function _u(g){Zi.current=g,rn(Ol),le({type:"workspace.find.agent",query:g})}function vu(){ht(!1),wt(null),$t(null),Nn([]),rn(Ol),rt(null),Zi.current="",ai.current=null}function Wl(){const g=Kn.current;g&&Jl.current&&le({type:"side.reset",sessionId:g}),Jl.current=null,Fl(null),ks(Ol),ga(null),Ul({}),ws.current=[]}function bf(g){le({type:"workspace.close",workspaceIds:g}),!(!G||!g.includes(G))&&(Wl(),J(null),ge(null),F([]),A([]),ue(Ol),xe(null),re(!1))}function xf(g,q){le({type:"session.archive",workspaceId:g,sessionIds:q}),D&&(q.includes(D)||ke!=null&&ke.claudeSessionId&&q.includes(ke.claudeSessionId))&&(Wl(),ge(null),ue(Ol),xe(null),re(!1))}function yf(g){le({type:"workspace.restore",workspaceIds:g})}function Su(g,q,pe){le({type:"folder.create",scope:g,name:q,workspaceId:pe})}function ju(g,q){le({type:"folder.rename",folderId:g,name:q})}function ui(g){le({type:"folder.delete",folderId:g})}function oi(g,q,pe,Ye){le({type:"folder.assign",scope:g,itemId:q,folderId:pe,workspaceId:Ye})}function _f(){G&&(Wl(),ge(null),xe(null),ue(Ol),re(!1),le({type:"session.start",workspaceId:G}),w(!1))}function fi(g){Wl(),er(),J(g),ge(null),ue(Ol),xe(null),re(!1),_l(null),Ht(null),ln(null),An(null),ys(""),Yn(!1),cn(null),he(!1),pa([]),ni(null)}function ku(g,q,pe){le({type:"session.pin",workspaceId:g,sessionIds:q,pinned:pe})}function wu(g){g.workspaceId!==G&&fi(g.workspaceId),di(g)}function di(g){if(w(!1),Wl(),ue(Ol),xe(null),re(!1),g.state==="closed"){ge(null),le({type:"session.start",workspaceId:g.workspaceId,resume:g.id});return}ge(g.id),le({type:"session.sync",sessionId:g.id,sinceSeq:0})}function Fi(g,q){le({type:"session.rename",sessionId:g.id,title:q,workspaceId:g.workspaceId}),F(pe=>pe.map(Ye=>Ye.id===g.id?{...Ye,title:q}:Ye))}function Pr(g){D&&(w(!1),bt(null),Qe(g),le({type:"mcp.list",sessionId:D}),le({type:"plugin.list",sessionId:D}))}const Nu={mcpAction:(g,q)=>{D&&(le({type:"mcp.action",sessionId:D,name:g,action:q}),Qe(null))},mcpAdd:(g,q)=>{D&&le({type:"mcp.add",sessionId:D,name:g,draft:q})},mcpRemove:g=>{D&&le({type:"mcp.remove",sessionId:D,name:g})},pluginInstall:g=>{D&&le({type:"plugin.install",sessionId:D,spec:g})},pluginUninstall:g=>{D&&le({type:"plugin.uninstall",sessionId:D,id:g})},pluginToggle:(g,q)=>{D&&le({type:"plugin.toggle",sessionId:D,id:g,enabled:q})},marketplaceAdd:g=>{D&&le({type:"marketplace.add",sessionId:D,source:g})},marketplaceRemove:g=>{D&&le({type:"marketplace.remove",sessionId:D,name:g})}};function ec(){w(!1),$e(!0),le({type:"auth.status"})}const tc={login:(g,q)=>le({type:"auth.login",mode:g,switchAccount:q}),submitCode:g=>le({type:"auth.code",code:g}),cancel:()=>le({type:"auth.cancel"}),logout:()=>le({type:"auth.logout"})};function vf(){w(!1),V(!0),le({type:"settings.get"})}function Sf(g){we(q=>q&&{...q,...g}),le({type:"settings.update",settings:g})}function jf(g){D&&le({type:"side.ask",sessionId:D,text:g})}function kf(){D&&(le({type:"side.reset",sessionId:D}),Jl.current=null,Fl(null),ks(Ol),ga(null),Ul({}),ws.current=[])}function Mn(g){const q=Jl.current;if(q){g(q);return}const pe=Kn.current;pe&&(ws.current.push(g),le({type:"side.open",sessionId:pe}))}function _a(){G&&le({type:"git.state",workspaceId:G})}function Tu(g){G&&(ln(g),le({type:"git.show",workspaceId:G,ref:g}))}function nc(g,q){An(null),zl({target:g,label:q})}function Eu(){!G||!Cn||(le({type:"git.checkout",workspaceId:G,target:Cn.target}),zl(null))}function Au(){G&&(An(null),le({type:"git.push",workspaceId:G}))}function lc(g){G&&(An(null),le({type:"git.pull",workspaceId:G,merge:g}))}function wf(){G&&(An(null),cn(null),Yn(!0),le({type:"github.status"}),le({type:"github.owners"}),le({type:"git.files",workspaceId:G}))}function va(g){G&&(An(null),le({type:"git.publish",workspaceId:G,...g}))}function sc(g){G&&(An(null),le({type:"git.remote",workspaceId:G,url:g}))}function hi(){An(null),he(!0)}function ac(g){le({type:"github.token",token:g}),le({type:"github.owners"})}function Cu(){le({type:"github.status"}),le({type:"github.owners"})}y.useEffect(()=>{if(!(!Ge||!G))for(const g of il)g in un||le({type:"fs.list",workspaceId:G,path:g})},[Ge,il,un,G,le]);function $s(g){mn(q=>q.includes(g)?q.filter(pe=>pe!==g):[...q,g])}function Sa(g){if(!g){jl(null);return}G&&le({type:"fs.search",workspaceId:G,query:g})}function ic(g){if(!g){Et(null);return}G&&le({type:"fs.grep",workspaceId:G,query:g})}const rc=y.useCallback((g,q)=>{N(Pt=>({...Pt,[g]:q}));const pe=xn.current;if(q===null||!pe)return;const Ye=q.lastIndexOf("/");if(Ye!==-1){le({type:"fs.list",workspaceId:pe,path:q.slice(0,Ye)});return}if(q===""){le({type:"fs.list",workspaceId:pe,path:""});return}le({type:"fs.search",workspaceId:pe,query:q,scope:g})},[le]),Qs=y.useMemo(()=>Tx(me.mention??null,I.mention??null,un),[me.mention,I.mention,un]),Ru=y.useMemo(()=>Tx(me.side??null,I.side??null,un),[me.side,I.side,un]);function Mu(g){cc(g.path,{line:g.line,column:g.column})}function Ou(g){const q=[];let pe=Ui(g.path);for(;q.push(pe),!!pe;)pe=Ui(pe);mn(Ye=>{const Pt=new Set(Ye);for(const yn of q)Pt.add(yn);return g.kind==="dir"&&Pt.add(g.path),[...Pt]}),g.kind==="file"&&cc(g.path)}function cc(g,q){if(fs.current.find(Ye=>Ye.path===g)){Sl(g),q&&gn({path:g,...q,token:++Dt.current});return}G&&(q&&(bn.current={path:g,...q}),Ki.current.add(g),le({type:"fs.read",workspaceId:G,path:g}))}function uc(g,q=!1){const pe=fs.current,Ye=pe.find(Ln=>Ln.path===g);if(Ye&&ca(Ye)&&!q){vs(g);return}vs(null);const Pt=pe.findIndex(Ln=>Ln.path===g),yn=pe.filter(Ln=>Ln.path!==g);rl(yn),Sl(Ln=>{var Fs;return Ln===g?((Fs=yn[Math.min(Pt,yn.length-1)])==null?void 0:Fs.path)??null:Ln})}function Ji(g,q=!1){const pe=fs.current.find(Ye=>Ye.path===g);!pe||!G||!q&&!ca(pe)||(ii.current.set(g,pe.text),le({type:"fs.write",workspaceId:G,path:g,content:pe.text,eol:pe.eol,encoding:pe.encoding,baseMtime:pe.mtime,...q?{force:!0}:{}}))}function Du(g){G&&le({type:"fs.read",workspaceId:G,path:g})}function Lu(g){G&&(ci.current.has(g)||(ci.current.add(g),le({type:"fs.readMedia",workspaceId:G,path:g})))}const oc=y.useRef(new Map);function Hl(g){const q=oc.current,pe=q.get(g);pe&&clearTimeout(pe);const Ye=(de==null?void 0:de.autoSaveAfterPauseMs)??0;Ye<=0||q.set(g,setTimeout(()=>{q.delete(g);const Pt=fs.current.find(yn=>yn.path===g);Pt&&ca(Pt)&&!Pt.stale&&Ji(g)},Ye))}function Wi(g,q,pe){if(!G)return;const Ye=g?`${g}/${pe}`:pe;gl(null),q==="file"&&(ri.current=Ye),le({type:"fs.create",workspaceId:G,path:Ye,kind:q})}function Nl(g,q){if(!G)return;const pe=Ui(g),Ye=pe?`${pe}/${q}`:q;gl(null),ba.current={from:g,to:Ye},le({type:"fs.rename",workspaceId:G,path:g,to:Ye})}function ja(g,q){if(!G)return;const pe=g.slice(g.lastIndexOf("/")+1),Ye=q?`${q}/${pe}`:pe;Ye!==g&&(gl(null),ba.current={from:g,to:Ye},le({type:"fs.rename",workspaceId:G,path:g,to:Ye}))}function fc(g,q){G&&(gl(null),le({type:"fs.copy",workspaceId:G,path:g,toDir:q}))}function Pi(g){G&&(gl(null),Rn(null),le({type:"fs.delete",workspaceId:G,path:g.path}),rl(q=>q.filter(pe=>pe.path!==g.path&&!pe.path.startsWith(`${g.path}/`))),Sl(q=>q&&(q===g.path||q.startsWith(`${g.path}/`))?null:q))}function er(){ml({}),mn([""]),rl([]),Sl(null),gl(null),jl(null),Et(null),N({}),fe({}),gn(null),Ki.current.clear(),ii.current.clear(),ci.current.clear(),bn.current=null,ba.current=null,ri.current=null}function dc(){!G||Xs||!us||(kl(null),Gi.current=!0,le({type:"term.open",workspaceId:G,cols:80,rows:24}))}function Zs(g){le({type:"term.close",id:g})}function zu(g,q){D&&le({type:"permission.respond",sessionId:D,requestId:g,decision:q})}function tr(g,q){D&&le({type:"permission.respond",sessionId:D,requestId:g,decision:"allow",answers:q})}function ka(g){D&&le({type:"permission.respond",sessionId:D,requestId:g,decision:"deny",reason:"Пользователь не стал отвечать на вопросы"})}function Nf(g,q){D&&le({type:"permission.respond",sessionId:D,requestId:g,decision:"allow",plan:q})}function bl(g){D&&le({type:"permission.respond",sessionId:D,requestId:g,decision:"deny",reason:"Пользователь просит продолжить планирование"})}y.useEffect(()=>{function g(q){if(q.key!=="Escape")return;if(qt!==null){const Ye=q.target;if(!(Ye instanceof HTMLElement&&Ye.closest(".termview, .editor, .sidepane"))){Fr(null);return}}if(!D||B.pending.length>0)return;const pe=q.target;pe instanceof HTMLElement&&pe.closest(".sidepane, .editor")||le({type:"control.interrupt",sessionId:D})}return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[D,B.pending.length,le,qt]),y.useEffect(()=>{function g(q){q.key!=="`"||!(q.ctrlKey||q.metaKey)||us&&(q.preventDefault(),js(pe=>!pe))}return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[us]);const nr=y.useMemo(()=>{const g=(Se==null?void 0:Se.commands)??[];return g.length===0?g:[...g,{name:"plugins",description:"Плагины и маркетплейсы — окно приложения",argumentHint:"",aliases:["plugin"]},...Nx]},[Se]);function Pl(g){const q=mw[g];return q?(Pr(q),!0):Nx.some(pe=>pe.name===g)?(ec(),g==="logout"&&tc.logout(),g==="switch-account"&&tc.login("claudeai",!0),!0):!1}const pi=(ke==null?void 0:ke.state)==="waiting_permission",cl=(ke==null?void 0:ke.state)==="reconnecting",On=(ke==null?void 0:ke.state)==="running"||cl||pi,Fn=B.pending[0]??null,hc=Fn?Oj(Fn.toolName,Fn.input):null;y.useEffect(()=>{!qn&&!Ge||!G||On||le({type:"git.state",workspaceId:G})},[qn,Ge,G,On,le]),y.useEffect(()=>{if(!(On||!G)){Ge&&ml(g=>{const q={};for(const[pe,Ye]of Object.entries(g))mu.current.includes(pe)||(q[pe]=Ye);return q});for(const g of fs.current)ca(g)||le({type:"fs.read",workspaceId:G,path:g.path})}},[On,G,Ge,le]);const mi=(ke==null?void 0:ke.cwd)??(Se==null?void 0:Se.cwd)??null,pc=(Se==null?void 0:Se.models)??[],Jn=(ke==null?void 0:ke.model)??(Se==null?void 0:Se.model)??null,{rows:Ks,selected:wa}=Ax(pc,Jn),Ns=os?{model:os.model,effort:os.effort,ultracode:os.ultracode,thinking:os.thinking,switchOnFlag:os.switchModelsOnFlag}:{model:Vs.model??Jn,effort:Vs.effort??(ke==null?void 0:ke.effort)??null,ultracode:Vs.ultracode??(ke==null?void 0:ke.ultracode)??!1,thinking:Vs.thinking??(ke==null?void 0:ke.thinking)??!0,switchOnFlag:Vs.switchOnFlag??(ke==null?void 0:ke.switchModelsOnFlag)??!0},Na=Ax(pc,Ns.model),Tl=(os==null?void 0:os.state)==="running",ul=ha?xt.find(g=>g.path===ha)??null:null,Ts=new Set(xt.filter(ca).map(g=>g.path)),ol=g=>i.jsx(Jk,{pane:g,width:Ll.widths[g],onResize:q=>Ll.setWidth(g,q),onReset:()=>Ll.reset(g)}),Wn=g=>oe?null:()=>df(g),es=Se&&i.jsx(Is,{title:"Режим прав",value:(ke==null?void 0:ke.permissionMode)??"default",options:Ux.map(g=>({value:g.value,label:g.value,hint:g.hint})),onChange:g=>{D&&le({type:"control.set_mode",sessionId:D,mode:g})}}),mc=Ks.length>0?i.jsx(jy,{models:Ks,value:wa,effort:(ke==null?void 0:ke.effort)??null,ultracode:(ke==null?void 0:ke.ultracode)??!1,thinking:(ke==null?void 0:ke.thinking)??!0,switchOnFlag:(ke==null?void 0:ke.switchModelsOnFlag)??!0,onModel:g=>{!D||!g||le({type:"control.set_model",sessionId:D,model:g})},onEffort:g=>{D&&le({type:"control.set_effort",sessionId:D,effort:g})},onUltracode:g=>{D&&le({type:"control.set_ultracode",sessionId:D,enabled:g})},onThinking:g=>{D&&le({type:"control.set_thinking",sessionId:D,enabled:g})},onSwitchOnFlag:g=>{D&&le({type:"control.set_flag_switch",sessionId:D,enabled:g})}}):Jn&&i.jsx("span",{className:"badge",children:Jn}),lr=On&&i.jsx("span",{className:pi?"badge badge--wait":"badge badge--live",children:pi?"ждёт":cl?"переподключается":"работает"}),sr=()=>{D&&le({type:"session.reconnect",sessionId:D})},Uu=cl?"Сессия уже поднимает новый процесс":On?"Недоступно, пока идёт ход":"Поднять сессии новый процесс — разговор сохранён",Dn=D&&(cl||(ke==null?void 0:ke.state)==="error")?i.jsxs("div",{className:cl?"relink":"relink relink--error",role:"status",children:[i.jsxs("span",{className:"relink__msg",children:[i.jsx("span",{className:"relink__dot","aria-hidden":"true"}),cl?"Связь оборвалась. Сессия поднимает новый процесс — разговор сохранён.":"Переподключиться не удалось. Разговор сохранён — сессия продолжит с этого места."]}),i.jsx("button",{className:"btn btn--sm",title:cl?"Не ждать паузы между попытками — попробовать сейчас":"Поднять сессии новый процесс и продолжить разговор",onClick:sr,children:cl?"Переподключить сейчас":"Переподключить"})]}):null,St=ke&&ke.totalCostUsd>0?`$${ke.totalCostUsd.toFixed(3)}`:null,et=i.jsx("button",{className:Kl?"pane-btn is-on":"pane-btn",title:"Вопрос на полях — спросить, не мешая работе","aria-label":"Вопрос на полях","aria-pressed":Kl,onClick:()=>Xi(g=>!g),children:i.jsx(jw,{})});return i.jsxs("div",{className:"app",style:Ll.style,children:[i.jsx(uS,{open:Ce,connected:l,status:c,workspaces:_,archivedWorkspaces:v,workspaceFolders:k,sessionFolders:z.filter(g=>g.workspaceId===G),pinnedFolders:te,sessions:M.filter(g=>g.workspaceId===G),archived:H.filter(g=>g.workspaceId===G),pinned:Z,activeWorkspaceId:G,activeSessionId:D,onPinSessions:ku,onSelectPinned:wu,onCloseWorkspaces:bf,onRestoreWorkspaces:yf,onArchiveSessions:xf,onUnarchiveSessions:g=>{G&&le({type:"session.unarchive",workspaceId:G,sessionIds:g})},onCreateFolder:Su,onRenameFolder:ju,onDeleteFolder:ui,onAssignToFolder:oi,onSelectWorkspace:fi,onSelectSession:di,onRenameSession:Fi,onOpenWorkspace:()=>ht(!0),onNewSession:_f,onOpenExtensions:D?()=>Pr("mcp"):null,account:Qn,onOpenAccount:ec,relay:d,onOpenRelay:x?null:()=>m(!0),onOpenSettings:vf,themeMode:da,onCycleTheme:qs}),ol("sidebar"),Ce&&i.jsx("div",{className:"scrim",onClick:()=>w(!1)}),i.jsx(M1,{open:Ge,tree:un,expanded:new Set(il),activePath:ha,dirty:Ts,gitChanges:(nn==null?void 0:nn.changed)??[],result:ti,searchResult:Ss,onSearch:Sa,onReveal:Ou,onToggle:$s,onOpen:cc,onCreate:Wi,onRename:Nl,onMove:ja,onCopy:fc,onDelete:Rn,onRefresh:()=>{gl(null),ml({}),_a()},onClose:()=>pt(!1),zoomed:qt==="files",onToggleZoom:Wn("files")}),Ge&&qt!=="files"&&ol("files"),i.jsx(G1,{open:Ne,result:Ue,onSearch:ic,onOpenMatch:Mu,onClose:()=>Oe(!1),zoomed:qt==="search",onToggleZoom:Wn("search")}),Ne&&qt!=="search"&&ol("search"),i.jsx(Zj,{open:qn,state:nn,result:is,selected:Ze,busy:vl,onRefresh:_a,onShow:Tu,onCheckout:nc,onPush:Au,onPull:lc,onPublish:wf,onConnectRemote:hi,onDismissResult:()=>An(null),onClose:()=>pl(!1),zoomed:qt==="git",onToggleZoom:Wn("git")}),qn&&qt!=="git"&&ol("git"),i.jsxs("main",{className:qt==="main"||qt==="terminal"?"main main--zoomed":"main",children:[i.jsxs("header",{className:"topbar",children:[i.jsx("button",{className:"btn btn--ghost menu-btn",onClick:()=>w(!0),children:"☰"}),i.jsx("button",{className:Ge?"pane-btn is-on":"pane-btn",title:"Файлы проекта","aria-label":"Файлы проекта","aria-pressed":Ge,onClick:()=>{pt(g=>!g),pl(!1),Oe(!1)},children:i.jsx(xw,{})}),i.jsx("button",{className:Ne?"pane-btn is-on":"pane-btn",title:"Поиск по тексту в проекте","aria-label":"Поиск по тексту в проекте","aria-pressed":Ne,onClick:()=>{Oe(g=>!g),pt(!1),pl(!1)},children:i.jsx(yw,{})}),i.jsx("button",{className:qn?"pane-btn is-on":"pane-btn",title:"История git","aria-label":"История git","aria-pressed":qn,onClick:()=>{pl(g=>!g),pt(!1),Oe(!1)},children:i.jsx(_w,{})}),us&&i.jsx("button",{className:Bt?"pane-btn is-on":"pane-btn",title:"Терминал (Ctrl+`)","aria-label":"Терминал","aria-pressed":Bt,onClick:()=>js(g=>!g),children:i.jsx(Sw,{})}),oe&&et,oe&&i.jsx("button",{className:ye?"pane-btn is-on":"pane-btn",title:"Ещё","aria-label":"Ещё","aria-haspopup":"menu","aria-pressed":ye,onClick:()=>je(!0),children:i.jsx(kw,{})}),i.jsxs("div",{className:"topbar__id",children:[Q&&ke?i.jsx(fa,{className:"rename--title",value:ke.title??"",onCommit:g=>{Fi(ke,g),re(!1)},onCancel:()=>re(!1)}):i.jsxs("div",{className:"topbar__head",children:[i.jsx("button",{className:"topbar__title",disabled:!ke||oe,title:ke&&!oe?"Переименовать сессию":void 0,onClick:()=>re(!0),children:(ke==null?void 0:ke.title)??"Claude Code Visual"}),ya&&i.jsx("span",{className:"topbar__project",title:ya.path,children:ya.name})]}),oe?lr:mi&&i.jsx(Sy,{path:mi})]}),!oe&&i.jsxs("div",{className:"topbar__tools",children:[i.jsx("button",{type:"button",className:In?"meters-refresh is-busy":"meters-refresh",title:mf,"aria-label":"Обновить лимиты и контекст","aria-busy":In,disabled:!D||In,onClick:xa,children:i.jsx(ww,{})}),i.jsx(wy,{usage:st}),i.jsx(Ay,{}),es,mc,lr,St&&i.jsx("span",{className:"badge badge--cost",children:St}),et]})]}),i.jsx(uw,{tokens:(Pe==null?void 0:Pe.tokens)??B.contextTokens,maxTokens:(Pe==null?void 0:Pe.maxTokens)??null,fetchedAt:(Pe==null?void 0:Pe.fetchedAt)??null}),oe&&ye&&i.jsx(kk,{onClose:()=>je(!1),permission:es,model:mc,usage:st,cwd:mi,costLabel:St,onRefresh:xa,refreshing:In,metersFetchedAt:Jr,onRename:ke?()=>{re(!0),je(!1)}:null}),xt.length>0&&i.jsx(rS,{files:xt,activePath:ha,busy:On,onSelect:Sl,onClose:g=>uc(g),zoomed:qt==="main",onToggleZoom:Wn("main")}),ul?i.jsx(aS,{file:ul,goto:(Wt==null?void 0:Wt.path)===ul.path?Wt:null,onChange:(g,q)=>{rl(pe=>pe.map(Ye=>Ye.path===g?{...Ye,text:q}:Ye)),Hl(g)},onSave:g=>Ji(g),onReload:Du,onOverwrite:g=>Ji(g,!0),onRequestMedia:Lu,onTogglePreview:g=>rl(q=>q.map(pe=>pe.path===g?{...pe,previewMode:!pe.previewMode}:pe))}):i.jsxs(i.Fragment,{children:[i.jsx(ap,{items:B.items,busy:On&&!cl,waiting:pi,history:Wr,historyHasMore:db(se),historyLoading:se.loading,onLoadHistory:gf,sessionId:D??void 0,onEditMessage:(g,q,pe)=>{D&&le({type:"prompt.edit",sessionId:D,userIndex:g,text:q,images:pe})}}),Dn,i.jsx(_y,{disabled:!D,busy:On&&!cl,placeholder:cl?"Промпт уйдёт, как только связь вернётся":void 0,commands:nr,sessionTitle:(ke==null?void 0:ke.title)??null,contextResult:Qs,draftKey:D,onContextSearch:g=>rc("mention",g),onCommand:Pl,onSend:(g,q)=>{D&&le({type:"prompt.send",sessionId:D,text:g,images:q})},onInterrupt:()=>{D&&le({type:"control.interrupt",sessionId:D})}})]}),Bt&&us&&i.jsxs(i.Fragment,{children:[!oe&&qt!=="terminal"&&i.jsx(Pk,{height:ma.height,onResize:ma.setHeight,onReset:ma.reset}),i.jsx(lw,{mobile:oe,zoomed:qt==="terminal",onToggleZoom:Wn("terminal"),terminals:cs,activeId:Kr,blocked:Xs,error:li,onDismissError:()=>kl(null),height:oe?Ys.height:ma.height,offset:oe?{top:Ys.offsetTop,left:Ys.offsetLeft}:void 0,onSelect:ni,onOpen:dc,onClose:Zs,onInput:(g,q)=>le({type:"term.input",id:g,data:q}),onResize:(g,q,pe)=>le({type:"term.resize",id:g,cols:q,rows:pe}),onAttach:g=>le({type:"term.attach",id:g}),onHide:()=>js(!1),registerSink:Yi})]})]}),i.jsx(mk,{open:Kl,items:si.items,busy:Tl,ready:D!==null,commands:nr,contextResult:Ru,draftKey:D,models:Na.rows,model:Na.selected,effort:Ns.effort,ultracode:Ns.ultracode,thinking:Ns.thinking,switchOnFlag:Ns.switchOnFlag,onContextSearch:g=>rc("side",g),onCommand:Pl,onModel:g=>{g&&(Ul(q=>({...q,model:g})),Mn(q=>le({type:"control.set_model",sessionId:q,model:g})))},onEffort:g=>{Ul(q=>({...q,effort:g,ultracode:!1})),Mn(q=>le({type:"control.set_effort",sessionId:q,effort:g}))},onUltracode:g=>{Ul(q=>({...q,ultracode:g,...g?{effort:"xhigh"}:{}})),Mn(q=>le({type:"control.set_ultracode",sessionId:q,enabled:g}))},onThinking:g=>{Ul(q=>({...q,thinking:g})),Mn(q=>le({type:"control.set_thinking",sessionId:q,enabled:g}))},onSwitchOnFlag:g=>{Ul(q=>({...q,switchOnFlag:g})),Mn(q=>le({type:"control.set_flag_switch",sessionId:q,enabled:g}))},onAsk:jf,onInterrupt:()=>{Zn&&le({type:"control.interrupt",sessionId:Zn})},onReset:kf,onClose:()=>Xi(!1),zoomed:qt==="ask",onToggleZoom:Wn("ask")}),Kl&&qt!=="ask"&&ol("ask"),(qn||Kl||Ge||Ne)&&i.jsx("div",{className:"scrim scrim--pane",onClick:()=>{pl(!1),Xi(!1),pt(!1),Oe(!1)}}),Gn&&i.jsx(Jj,{detail:Gn,local:((nn==null?void 0:nn.hasRemote)??!1)&&(nn==null?void 0:nn.commits.some(g=>g.hash===Gn.hash&&!g.pushed))===!0,onCheckout:nc,onClose:()=>{Ht(null),ln(null)}}),Cn&&i.jsxs(Vl,{title:"Переключить рабочее дерево?",onClose:()=>zl(null),actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:()=>zl(null),children:"Отмена"}),i.jsx("button",{className:"btn btn--warn",onClick:Eu,children:"Переключиться"})]}),children:[i.jsxs("p",{className:"modal__text",children:["git переключится на ",Cn.label,". Файлы в каталоге проекта изменятся — это тот же каталог, в котором работает агент."]}),On&&i.jsx("p",{className:"modal__text",children:"Сейчас идёт ход агента: он читает и правит файлы прямо сейчас."}),nn&&nn.changed.length>0&&i.jsxs("p",{className:"modal__text",children:["Незакоммиченных изменений: ",nn.changed.length,". Git откажется переключаться, если они будут затёрты."]})]}),Tt&&i.jsx(uk,{status:It,owners:Zl,files:Gs,defaultName:(ya==null?void 0:ya.name)??"",hasCommits:nn===null||nn.head!=="",busy:vl,result:is,onRefreshStatus:Cu,onSaveToken:ac,onPublish:va,onDismissResult:()=>An(null),onClose:()=>Yn(!1)}),T&&i.jsx(pk,{busy:vl,result:is,onSubmit:sc,onDismissResult:()=>An(null),onClose:()=>he(!1)}),_s&&i.jsx(Vl,{title:_s.kind==="dir"?"Удалить каталог?":"Удалить файл?",onClose:()=>Rn(null),actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:()=>Rn(null),children:"Отмена"}),i.jsx("button",{className:"btn btn--warn",onClick:()=>Pi(_s),children:"Удалить"})]}),children:i.jsxs("p",{className:"modal__text",children:[_s.path," будет удалён с диска",_s.kind==="dir"?" вместе со всем содержимым":"",". Корзины здесь нет: это тот же каталог, в котором работает агент."]})}),rs&&i.jsx(Vl,{title:"Закрыть без сохранения?",onClose:()=>vs(null),actions:i.jsxs(i.Fragment,{children:[i.jsx("button",{className:"btn",onClick:()=>vs(null),children:"Отмена"}),i.jsx("button",{className:"btn btn--warn",onClick:()=>uc(rs,!0),children:"Закрыть"}),i.jsx("button",{className:"btn btn--primary",onClick:()=>{Ji(rs),uc(rs,!0)},children:"Сохранить и закрыть"})]}),children:i.jsxs("p",{className:"modal__text",children:["В ",rs," есть несохранённые правки."]})}),Nt&&i.jsx(Nk,{tab:Nt,servers:We,plugins:Jt,marketplaces:Bn,catalog:hn,result:zt,actions:Nu,onTab:Qe,onClose:()=>Qe(null)}),Ut&&i.jsx(Dk,{status:Qn,login:_e,actions:tc,remote:x,runningSessions:M.filter(g=>g.state==="running"||g.state==="waiting_permission").length,onReconnect:D?()=>{sr(),$e(!1)}:null,reconnectBlocked:On,reconnectHint:Uu,onClose:()=>$e(!1)}),p&&i.jsx(Bk,{state:d,onPair:(g,q)=>le({type:"relay.pair",code:g,...q?{name:q}:{}}),onUnpair:()=>le({type:"relay.unpair"}),onClose:()=>m(!1)}),L&&i.jsx(Kk,{settings:de,models:(Se==null?void 0:Se.models)??[],relayState:d,local:Ko()==="local",onChange:Sf,onEnableShell:()=>le({type:"relay.shell.enable"}),onDisableShell:()=>le({type:"relay.shell.disable"}),onOpenRelay:()=>{V(!1),m(!0)},onClose:()=>V(!1)}),Me&&i.jsx(Uj,{candidates:lt,searching:Je,agentItems:ct.items,agentBusy:(Be==null?void 0:Be.state)==="running",error:Hn,roots:Ot,created:tn,onSearch:yu,onAskAgent:_u,onInterrupt:()=>{const g=Qi.current;g&&le({type:"control.interrupt",sessionId:g})},onSubmit:bu,onCreate:xu,onClose:vu}),Fn!=null&&Fn.questions&&Fn.questions.length>0?i.jsx(Tj,{request:{...Fn,questions:Fn.questions},queued:B.pending.length-1,onAnswer:tr,onDecline:ka}):Fn&&hc!==null?i.jsx(Cj,{request:Fn,plan:hc,queued:B.pending.length-1,onAccept:Nf,onDecline:bl}):Fn&&i.jsx(Nj,{request:Fn,queued:B.pending.length-1,onDecide:zu})]})}function xw(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.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"}),i.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 yw(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[i.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),i.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}function _w(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[i.jsx("circle",{cx:"4.5",cy:"3.5",r:"1.9"}),i.jsx("circle",{cx:"4.5",cy:"12.5",r:"1.9"}),i.jsx("circle",{cx:"11.5",cy:"8",r:"1.9"}),i.jsx("path",{d:"M4.5 5.4v5.2M6.4 3.9h2.2a1.6 1.6 0 0 1 1.6 1.6v.8"})]})}function vw(s,l){return Cx(s)===Cx(l)}function Cx(s){return s.replace(/[\\/]+/g,"/").replace(/\/+$/,"").toLowerCase()}function Sw(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("rect",{x:"1.6",y:"2.6",width:"12.8",height:"10.8",rx:"1.7"}),i.jsx("path",{d:"M4.3 6 6.6 8l-2.3 2"}),i.jsx("path",{d:"M8.2 10h3.1"})]})}function jw(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.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"}),i.jsx("path",{d:"M8.4 8.5v-.3c0-.7.9-.9.9-1.7a1 1 0 0 0-1.9-.4"})]})}function kw(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:[i.jsx("circle",{cx:"3.2",cy:"8",r:"1.5"}),i.jsx("circle",{cx:"8",cy:"8",r:"1.5"}),i.jsx("circle",{cx:"12.8",cy:"8",r:"1.5"})]})}function ww(){return i.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[i.jsx("path",{d:"M14 8a6 6 0 1 1-6-6c1.68 0 3.29.67 4.49 1.83L14 5.33"}),i.jsx("path",{d:"M14 2v3.33h-3.33"})]})}const Ry=document.getElementById("root");if(!Ry)throw new Error("#root not found");a0.createRoot(Ry).render(i.jsx(y.StrictMode,{children:i.jsx(bw,{})}));export{Fv as D,Yt as I,Vt as N,Ew as P,ss as T,xs as a,ey as b,Dl as c,Tw as d,ay as e,cu as f,m1 as h,Aw as p,Cw as s,Te as t};
|