@i14ks/ccv 0.9.5 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/bundle/ccv.mjs +64 -0
  2. package/package.json +1 -1
  3. package/web/assets/{codemirror-BrML4DhQ.js → codemirror-DKsnpugS.js} +1 -1
  4. package/web/assets/{index-CIOcaugJ.js → index-AUibZMHd.js} +1 -1
  5. package/web/assets/{index-BH51XSCv.js → index-B7Kjuy7B.js} +1 -1
  6. package/web/assets/{index-BMlMiQH4.js → index-BCiq-pRA.js} +1 -1
  7. package/web/assets/index-BVL_B_hC.js +132 -0
  8. package/web/assets/{index-kYR8PJFy.js → index-BaxFm2-f.js} +1 -1
  9. package/web/assets/{index-DueUeK4W.js → index-BwqyDurx.js} +1 -1
  10. package/web/assets/{index-CzJCmwIj.js → index-C3yVGgV2.js} +1 -1
  11. package/web/assets/{index-MEYLoAjh.js → index-CNmvdMxt.js} +1 -1
  12. package/web/assets/{index-BMtQHCPD.js → index-CT4Ig6AX.js} +1 -1
  13. package/web/assets/{index-CJJjf7QW.js → index-CZMbzOzb.js} +1 -1
  14. package/web/assets/{index-MtnHR_Fv.js → index-CiZ3hw4e.js} +1 -1
  15. package/web/assets/{index-B11vIedv.js → index-ClY-NTKp.js} +1 -1
  16. package/web/assets/{index-ZDWxlF_B.js → index-Cw4Jg8_d.js} +1 -1
  17. package/web/assets/{index-ZQEm-9IM.js → index-MFoRbG31.js} +1 -1
  18. package/web/assets/{index-BZMuV7wL.js → index-NZmn_bzd.js} +1 -1
  19. package/web/assets/index-c0zvhlqR.css +1 -0
  20. package/web/assets/{index-BmDgU61K.js → index-cSZKYcZu.js} +1 -1
  21. package/web/assets/{index-BCuOAg0C.js → index-nV6tsVmQ.js} +1 -1
  22. package/web/assets/{index-Cg-P0Yp1.js → index-u3kUuJkV.js} +1 -1
  23. package/web/assets/{index-TS7xklzI.js → index-vmz_RdEe.js} +1 -1
  24. package/web/assets/{index-BnX4KThz.js → index-yzGIJ5xe.js} +1 -1
  25. package/web/index.html +2 -2
  26. package/web/assets/index-D0UlXcXr.css +0 -1
  27. package/web/assets/index-DhmD70Mu.js +0 -132
@@ -1,132 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-BZMuV7wL.js","./index-MtnHR_Fv.js","./index-DueUeK4W.js","./index-BHot-lnj.js","./index-891wE-Rj.js","./index-ZQEm-9IM.js","./index-BnX4KThz.js","./index-MEYLoAjh.js","./index-BmDgU61K.js","./index-CzJCmwIj.js","./index-B11vIedv.js","./index-CIOcaugJ.js","./index-Cg-P0Yp1.js","./index-BH51XSCv.js","./index-CJJjf7QW.js","./index-TS7xklzI.js","./index-BCuOAg0C.js","./index-BMlMiQH4.js","./index-BMtQHCPD.js","./index-ZDWxlF_B.js","./index-kYR8PJFy.js","./codemirror-BrML4DhQ.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 q_=Object.defineProperty;var Kg=a=>{throw TypeError(a)};var I_=(a,l,i)=>l in a?q_(a,l,{enumerable:!0,configurable:!0,writable:!0,value:i}):a[l]=i;var Nt=(a,l,i)=>I_(a,typeof l!="symbol"?l+"":l,i),Zd=(a,l,i)=>l.has(a)||Kg("Cannot "+i);var He=(a,l,i)=>(Zd(a,l,"read from private field"),i?i.call(a):l.get(a)),Zt=(a,l,i)=>l.has(a)?Kg("Cannot add the same private member more than once"):l instanceof WeakSet?l.add(a):l.set(a,i),pt=(a,l,i,c)=>(Zd(a,l,"write to private field"),c?c.call(a,i):l.set(a,i),i),Sn=(a,l,i)=>(Zd(a,l,"access private method"),i);(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 i(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=i(o);fetch(o.href,d)}})();var Kd={exports:{}},Oc={};/**
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 Jg;function G_(){if(Jg)return Oc;Jg=1;var a=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function i(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:a,type:c,key:h,ref:o!==void 0?o:null,props:d}}return Oc.Fragment=l,Oc.jsx=i,Oc.jsxs=i,Oc}var Fg;function Y_(){return Fg||(Fg=1,Kd.exports=G_()),Kd.exports}var r=Y_(),Jd={exports:{}},Ye={};/**
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 Wg;function X_(){if(Wg)return Ye;Wg=1;var a=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),i=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"),y=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),v=Symbol.iterator;function R(k){return k===null||typeof k!="object"?null:(k=v&&k[v]||k["@@iterator"],typeof k=="function"?k:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},L=Object.assign,B={};function P(k,$,ce){this.props=k,this.context=$,this.refs=B,this.updater=ce||T}P.prototype.isReactComponent={},P.prototype.setState=function(k,$){if(typeof k!="object"&&typeof k!="function"&&k!=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,k,$,"setState")},P.prototype.forceUpdate=function(k){this.updater.enqueueForceUpdate(this,k,"forceUpdate")};function M(){}M.prototype=P.prototype;function Z(k,$,ce){this.props=k,this.context=$,this.refs=B,this.updater=ce||T}var N=Z.prototype=new M;N.constructor=Z,L(N,P.prototype),N.isPureReactComponent=!0;var K=Array.isArray;function z(){}var A={H:null,A:null,T:null,S:null},V=Object.prototype.hasOwnProperty;function te(k,$,ce){var he=ce.ref;return{$$typeof:a,type:k,key:$,ref:he!==void 0?he:null,props:ce}}function oe(k,$){return te(k.type,$,k.props)}function F(k){return typeof k=="object"&&k!==null&&k.$$typeof===a}function ae(k){var $={"=":"=0",":":"=2"};return"$"+k.replace(/[=:]/g,function(ce){return $[ce]})}var me=/\/+/g;function Te(k,$){return typeof k=="object"&&k!==null&&k.key!=null?ae(""+k.key):$.toString(36)}function be(k){switch(k.status){case"fulfilled":return k.value;case"rejected":throw k.reason;default:switch(typeof k.status=="string"?k.then(z,z):(k.status="pending",k.then(function($){k.status==="pending"&&(k.status="fulfilled",k.value=$)},function($){k.status==="pending"&&(k.status="rejected",k.reason=$)})),k.status){case"fulfilled":return k.value;case"rejected":throw k.reason}}throw k}function U(k,$,ce,he,Ne){var ye=typeof k;(ye==="undefined"||ye==="boolean")&&(k=null);var Ae=!1;if(k===null)Ae=!0;else switch(ye){case"bigint":case"string":case"number":Ae=!0;break;case"object":switch(k.$$typeof){case a:case l:Ae=!0;break;case y:return Ae=k._init,U(Ae(k._payload),$,ce,he,Ne)}}if(Ae)return Ne=Ne(k),Ae=he===""?"."+Te(k,0):he,K(Ne)?(ce="",Ae!=null&&(ce=Ae.replace(me,"$&/")+"/"),U(Ne,$,ce,"",function(Ot){return Ot})):Ne!=null&&(F(Ne)&&(Ne=oe(Ne,ce+(Ne.key==null||k&&k.key===Ne.key?"":(""+Ne.key).replace(me,"$&/")+"/")+Ae)),$.push(Ne)),1;Ae=0;var st=he===""?".":he+":";if(K(k))for(var Qe=0;Qe<k.length;Qe++)he=k[Qe],ye=st+Te(he,Qe),Ae+=U(he,$,ce,ye,Ne);else if(Qe=R(k),typeof Qe=="function")for(k=Qe.call(k),Qe=0;!(he=k.next()).done;)he=he.value,ye=st+Te(he,Qe++),Ae+=U(he,$,ce,ye,Ne);else if(ye==="object"){if(typeof k.then=="function")return U(be(k),$,ce,he,Ne);throw $=String(k),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(k).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return Ae}function re(k,$,ce){if(k==null)return k;var he=[],Ne=0;return U(k,he,"","",function(ye){return $.call(ce,ye,Ne++)}),he}function se(k){if(k._status===-1){var $=k._result;$=$(),$.then(function(ce){(k._status===0||k._status===-1)&&(k._status=1,k._result=ce)},function(ce){(k._status===0||k._status===-1)&&(k._status=2,k._result=ce)}),k._status===-1&&(k._status=0,k._result=$)}if(k._status===1)return k._result.default;throw k._result}var pe=typeof reportError=="function"?reportError:function(k){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof k=="object"&&k!==null&&typeof k.message=="string"?String(k.message):String(k),error:k});if(!window.dispatchEvent($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",k);return}console.error(k)},ke={map:re,forEach:function(k,$,ce){re(k,function(){$.apply(this,arguments)},ce)},count:function(k){var $=0;return re(k,function(){$++}),$},toArray:function(k){return re(k,function($){return $})||[]},only:function(k){if(!F(k))throw Error("React.Children.only expected to receive a single React element child.");return k}};return Ye.Activity=j,Ye.Children=ke,Ye.Component=P,Ye.Fragment=i,Ye.Profiler=o,Ye.PureComponent=Z,Ye.StrictMode=c,Ye.Suspense=m,Ye.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A,Ye.__COMPILER_RUNTIME={__proto__:null,c:function(k){return A.H.useMemoCache(k)}},Ye.cache=function(k){return function(){return k.apply(null,arguments)}},Ye.cacheSignal=function(){return null},Ye.cloneElement=function(k,$,ce){if(k==null)throw Error("The argument must be a React element, but you passed "+k+".");var he=L({},k.props),Ne=k.key;if($!=null)for(ye in $.key!==void 0&&(Ne=""+$.key),$)!V.call($,ye)||ye==="key"||ye==="__self"||ye==="__source"||ye==="ref"&&$.ref===void 0||(he[ye]=$[ye]);var ye=arguments.length-2;if(ye===1)he.children=ce;else if(1<ye){for(var Ae=Array(ye),st=0;st<ye;st++)Ae[st]=arguments[st+2];he.children=Ae}return te(k.type,Ne,he)},Ye.createContext=function(k){return k={$$typeof:h,_currentValue:k,_currentValue2:k,_threadCount:0,Provider:null,Consumer:null},k.Provider=k,k.Consumer={$$typeof:d,_context:k},k},Ye.createElement=function(k,$,ce){var he,Ne={},ye=null;if($!=null)for(he in $.key!==void 0&&(ye=""+$.key),$)V.call($,he)&&he!=="key"&&he!=="__self"&&he!=="__source"&&(Ne[he]=$[he]);var Ae=arguments.length-2;if(Ae===1)Ne.children=ce;else if(1<Ae){for(var st=Array(Ae),Qe=0;Qe<Ae;Qe++)st[Qe]=arguments[Qe+2];Ne.children=st}if(k&&k.defaultProps)for(he in Ae=k.defaultProps,Ae)Ne[he]===void 0&&(Ne[he]=Ae[he]);return te(k,ye,Ne)},Ye.createRef=function(){return{current:null}},Ye.forwardRef=function(k){return{$$typeof:p,render:k}},Ye.isValidElement=F,Ye.lazy=function(k){return{$$typeof:y,_payload:{_status:-1,_result:k},_init:se}},Ye.memo=function(k,$){return{$$typeof:x,type:k,compare:$===void 0?null:$}},Ye.startTransition=function(k){var $=A.T,ce={};A.T=ce;try{var he=k(),Ne=A.S;Ne!==null&&Ne(ce,he),typeof he=="object"&&he!==null&&typeof he.then=="function"&&he.then(z,pe)}catch(ye){pe(ye)}finally{$!==null&&ce.types!==null&&($.types=ce.types),A.T=$}},Ye.unstable_useCacheRefresh=function(){return A.H.useCacheRefresh()},Ye.use=function(k){return A.H.use(k)},Ye.useActionState=function(k,$,ce){return A.H.useActionState(k,$,ce)},Ye.useCallback=function(k,$){return A.H.useCallback(k,$)},Ye.useContext=function(k){return A.H.useContext(k)},Ye.useDebugValue=function(){},Ye.useDeferredValue=function(k,$){return A.H.useDeferredValue(k,$)},Ye.useEffect=function(k,$){return A.H.useEffect(k,$)},Ye.useEffectEvent=function(k){return A.H.useEffectEvent(k)},Ye.useId=function(){return A.H.useId()},Ye.useImperativeHandle=function(k,$,ce){return A.H.useImperativeHandle(k,$,ce)},Ye.useInsertionEffect=function(k,$){return A.H.useInsertionEffect(k,$)},Ye.useLayoutEffect=function(k,$){return A.H.useLayoutEffect(k,$)},Ye.useMemo=function(k,$){return A.H.useMemo(k,$)},Ye.useOptimistic=function(k,$){return A.H.useOptimistic(k,$)},Ye.useReducer=function(k,$,ce){return A.H.useReducer(k,$,ce)},Ye.useRef=function(k){return A.H.useRef(k)},Ye.useState=function(k){return A.H.useState(k)},Ye.useSyncExternalStore=function(k,$,ce){return A.H.useSyncExternalStore(k,$,ce)},Ye.useTransition=function(){return A.H.useTransition()},Ye.version="19.2.8",Ye}var Pg;function Dh(){return Pg||(Pg=1,Jd.exports=X_()),Jd.exports}var _=Dh(),Fd={exports:{}},Dc={},Wd={exports:{}},Pd={};/**
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 eb;function V_(){return eb||(eb=1,(function(a){function l(U,re){var se=U.length;U.push(re);e:for(;0<se;){var pe=se-1>>>1,ke=U[pe];if(0<o(ke,re))U[pe]=re,U[se]=ke,se=pe;else break e}}function i(U){return U.length===0?null:U[0]}function c(U){if(U.length===0)return null;var re=U[0],se=U.pop();if(se!==re){U[0]=se;e:for(var pe=0,ke=U.length,k=ke>>>1;pe<k;){var $=2*(pe+1)-1,ce=U[$],he=$+1,Ne=U[he];if(0>o(ce,se))he<ke&&0>o(Ne,ce)?(U[pe]=Ne,U[he]=se,pe=he):(U[pe]=ce,U[$]=se,pe=$);else if(he<ke&&0>o(Ne,se))U[pe]=Ne,U[he]=se,pe=he;else break e}}return re}function o(U,re){var se=U.sortIndex-re.sortIndex;return se!==0?se:U.id-re.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;a.unstable_now=function(){return d.now()}}else{var h=Date,p=h.now();a.unstable_now=function(){return h.now()-p}}var m=[],x=[],y=1,j=null,v=3,R=!1,T=!1,L=!1,B=!1,P=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,Z=typeof setImmediate<"u"?setImmediate:null;function N(U){for(var re=i(x);re!==null;){if(re.callback===null)c(x);else if(re.startTime<=U)c(x),re.sortIndex=re.expirationTime,l(m,re);else break;re=i(x)}}function K(U){if(L=!1,N(U),!T)if(i(m)!==null)T=!0,z||(z=!0,ae());else{var re=i(x);re!==null&&be(K,re.startTime-U)}}var z=!1,A=-1,V=5,te=-1;function oe(){return B?!0:!(a.unstable_now()-te<V)}function F(){if(B=!1,z){var U=a.unstable_now();te=U;var re=!0;try{e:{T=!1,L&&(L=!1,M(A),A=-1),R=!0;var se=v;try{t:{for(N(U),j=i(m);j!==null&&!(j.expirationTime>U&&oe());){var pe=j.callback;if(typeof pe=="function"){j.callback=null,v=j.priorityLevel;var ke=pe(j.expirationTime<=U);if(U=a.unstable_now(),typeof ke=="function"){j.callback=ke,N(U),re=!0;break t}j===i(m)&&c(m),N(U)}else c(m);j=i(m)}if(j!==null)re=!0;else{var k=i(x);k!==null&&be(K,k.startTime-U),re=!1}}break e}finally{j=null,v=se,R=!1}re=void 0}}finally{re?ae():z=!1}}}var ae;if(typeof Z=="function")ae=function(){Z(F)};else if(typeof MessageChannel<"u"){var me=new MessageChannel,Te=me.port2;me.port1.onmessage=F,ae=function(){Te.postMessage(null)}}else ae=function(){P(F,0)};function be(U,re){A=P(function(){U(a.unstable_now())},re)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(U){U.callback=null},a.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):V=0<U?Math.floor(1e3/U):5},a.unstable_getCurrentPriorityLevel=function(){return v},a.unstable_next=function(U){switch(v){case 1:case 2:case 3:var re=3;break;default:re=v}var se=v;v=re;try{return U()}finally{v=se}},a.unstable_requestPaint=function(){B=!0},a.unstable_runWithPriority=function(U,re){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var se=v;v=U;try{return re()}finally{v=se}},a.unstable_scheduleCallback=function(U,re,se){var pe=a.unstable_now();switch(typeof se=="object"&&se!==null?(se=se.delay,se=typeof se=="number"&&0<se?pe+se:pe):se=pe,U){case 1:var ke=-1;break;case 2:ke=250;break;case 5:ke=1073741823;break;case 4:ke=1e4;break;default:ke=5e3}return ke=se+ke,U={id:y++,callback:re,priorityLevel:U,startTime:se,expirationTime:ke,sortIndex:-1},se>pe?(U.sortIndex=se,l(x,U),i(m)===null&&U===i(x)&&(L?(M(A),A=-1):L=!0,be(K,se-pe))):(U.sortIndex=ke,l(m,U),T||R||(T=!0,z||(z=!0,ae()))),U},a.unstable_shouldYield=oe,a.unstable_wrapCallback=function(U){var re=v;return function(){var se=v;v=re;try{return U.apply(this,arguments)}finally{v=se}}}})(Pd)),Pd}var tb;function $_(){return tb||(tb=1,Wd.exports=V_()),Wd.exports}var eh={exports:{}},Qn={};/**
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 nb;function Q_(){if(nb)return Qn;nb=1;var a=Dh();function l(m){var x="https://react.dev/errors/"+m;if(1<arguments.length){x+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)x+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+m+"; visit "+x+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var c={d:{f:i,r:function(){throw Error(l(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for("react.portal");function d(m,x,y){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:y}}var h=a.__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 Qn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,Qn.createPortal=function(m,x){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!x||x.nodeType!==1&&x.nodeType!==9&&x.nodeType!==11)throw Error(l(299));return d(m,x,null,y)},Qn.flushSync=function(m){var x=h.T,y=c.p;try{if(h.T=null,c.p=2,m)return m()}finally{h.T=x,c.p=y,c.d.f()}},Qn.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))},Qn.prefetchDNS=function(m){typeof m=="string"&&c.d.D(m)},Qn.preinit=function(m,x){if(typeof m=="string"&&x&&typeof x.as=="string"){var y=x.as,j=p(y,x.crossOrigin),v=typeof x.integrity=="string"?x.integrity:void 0,R=typeof x.fetchPriority=="string"?x.fetchPriority:void 0;y==="style"?c.d.S(m,typeof x.precedence=="string"?x.precedence:void 0,{crossOrigin:j,integrity:v,fetchPriority:R}):y==="script"&&c.d.X(m,{crossOrigin:j,integrity:v,fetchPriority:R,nonce:typeof x.nonce=="string"?x.nonce:void 0})}},Qn.preinitModule=function(m,x){if(typeof m=="string")if(typeof x=="object"&&x!==null){if(x.as==null||x.as==="script"){var y=p(x.as,x.crossOrigin);c.d.M(m,{crossOrigin:y,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0})}}else x==null&&c.d.M(m)},Qn.preload=function(m,x){if(typeof m=="string"&&typeof x=="object"&&x!==null&&typeof x.as=="string"){var y=x.as,j=p(y,x.crossOrigin);c.d.L(m,y,{crossOrigin:j,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0,type:typeof x.type=="string"?x.type:void 0,fetchPriority:typeof x.fetchPriority=="string"?x.fetchPriority:void 0,referrerPolicy:typeof x.referrerPolicy=="string"?x.referrerPolicy:void 0,imageSrcSet:typeof x.imageSrcSet=="string"?x.imageSrcSet:void 0,imageSizes:typeof x.imageSizes=="string"?x.imageSizes:void 0,media:typeof x.media=="string"?x.media:void 0})}},Qn.preloadModule=function(m,x){if(typeof m=="string")if(x){var y=p(x.as,x.crossOrigin);c.d.m(m,{as:typeof x.as=="string"&&x.as!=="script"?x.as:void 0,crossOrigin:y,integrity:typeof x.integrity=="string"?x.integrity:void 0})}else c.d.m(m)},Qn.requestFormReset=function(m){c.d.r(m)},Qn.unstable_batchedUpdates=function(m,x){return m(x)},Qn.useFormState=function(m,x,y){return h.H.useFormState(m,x,y)},Qn.useFormStatus=function(){return h.H.useHostTransitionStatus()},Qn.version="19.2.8",Qn}var lb;function Z_(){if(lb)return eh.exports;lb=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(l){console.error(l)}}return a(),eh.exports=Q_(),eh.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 ab;function K_(){if(ab)return Dc;ab=1;var a=$_(),l=Dh(),i=Z_();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,s=t;;){var u=n.return;if(u===null)break;var f=u.alternate;if(f===null){if(s=u.return,s!==null){n=s;continue}break}if(u.child===f.child){for(f=u.child;f;){if(f===n)return m(u),e;if(f===s)return m(u),t;f=f.sibling}throw Error(c(188))}if(n.return!==s.return)n=u,s=f;else{for(var g=!1,S=u.child;S;){if(S===n){g=!0,n=u,s=f;break}if(S===s){g=!0,s=u,n=f;break}S=S.sibling}if(!g){for(S=f.child;S;){if(S===n){g=!0,n=f,s=u;break}if(S===s){g=!0,s=f,n=u;break}S=S.sibling}if(!g)throw Error(c(189))}}if(n.alternate!==s)throw Error(c(190))}if(n.tag!==3)throw Error(c(188));return n.stateNode.current===n?e:t}function y(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=y(e),t!==null)return t;e=e.sibling}return null}var j=Object.assign,v=Symbol.for("react.element"),R=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),L=Symbol.for("react.fragment"),B=Symbol.for("react.strict_mode"),P=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),Z=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),K=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),te=Symbol.for("react.activity"),oe=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function ae(e){return e===null||typeof e!="object"?null:(e=F&&e[F]||e["@@iterator"],typeof e=="function"?e:null)}var me=Symbol.for("react.client.reference");function Te(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===me?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case L:return"Fragment";case P:return"Profiler";case B:return"StrictMode";case K:return"Suspense";case z:return"SuspenseList";case te:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case T:return"Portal";case Z:return e.displayName||"Context";case M:return(e._context.displayName||"Context")+".Consumer";case N: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:Te(e.type)||"Memo";case V:t=e._payload,e=e._init;try{return Te(e(t))}catch{}}return null}var be=Array.isArray,U=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,se={pending:!1,data:null,method:null,action:null},pe=[],ke=-1;function k(e){return{current:e}}function $(e){0>ke||(e.current=pe[ke],pe[ke]=null,ke--)}function ce(e,t){ke++,pe[ke]=e.current,e.current=t}var he=k(null),Ne=k(null),ye=k(null),Ae=k(null);function st(e,t){switch(ce(ye,t),ce(Ne,e),ce(he,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?xg(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=xg(t),e=yg(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}$(he),ce(he,e)}function Qe(){$(he),$(Ne),$(ye)}function Ot(e){e.memoizedState!==null&&ce(Ae,e);var t=he.current,n=yg(t,e.type);t!==n&&(ce(Ne,e),ce(he,n))}function qe(e){Ne.current===e&&($(he),$(Ne)),Ae.current===e&&($(Ae),Ac._currentValue=se)}var xt,et;function Je(e){if(xt===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);xt=t&&t[1]||"",et=-1<n.stack.indexOf(`
43
- at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
44
- `+xt+e+et}var Fe=!1;function it(e,t){if(!e||Fe)return"";Fe=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(t){var ie=function(){throw Error()};if(Object.defineProperty(ie.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ie,[])}catch(W){var Q=W}Reflect.construct(e,[],ie)}else{try{ie.call()}catch(W){Q=W}e.call(ie.prototype)}}else{try{throw Error()}catch(W){Q=W}(ie=e())&&typeof ie.catch=="function"&&ie.catch(function(){})}}catch(W){if(W&&Q&&typeof W.stack=="string")return[W.stack,Q.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=s.DetermineComponentFrameRoot(),g=f[0],S=f[1];if(g&&S){var C=g.split(`
45
- `),X=S.split(`
46
- `);for(u=s=0;s<C.length&&!C[s].includes("DetermineComponentFrameRoot");)s++;for(;u<X.length&&!X[u].includes("DetermineComponentFrameRoot");)u++;if(s===C.length||u===X.length)for(s=C.length-1,u=X.length-1;1<=s&&0<=u&&C[s]!==X[u];)u--;for(;1<=s&&0<=u;s--,u--)if(C[s]!==X[u]){if(s!==1||u!==1)do if(s--,u--,0>u||C[s]!==X[u]){var ee=`
47
- `+C[s].replace(" at new "," at ");return e.displayName&&ee.includes("<anonymous>")&&(ee=ee.replace("<anonymous>",e.displayName)),ee}while(1<=s&&0<=u);break}}}finally{Fe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Je(n):""}function Jn(e,t){switch(e.tag){case 26:case 27:case 5:return Je(e.type);case 16:return Je("Lazy");case 13:return e.child!==t&&t!==null?Je("Suspense Fallback"):Je("Suspense");case 19:return Je("SuspenseList");case 0:case 15:return it(e.type,!1);case 11:return it(e.type.render,!1);case 1:return it(e.type,!0);case 31:return Je("Activity");default:return""}}function Bt(e){try{var t="",n=null;do t+=Jn(e,n),n=e,e=e.return;while(e);return t}catch(s){return`
48
- Error generating stack: `+s.message+`
49
- `+s.stack}}var qt=Object.prototype.hasOwnProperty,Kt=a.unstable_scheduleCallback,It=a.unstable_cancelCallback,Gt=a.unstable_shouldYield,Qt=a.unstable_requestPaint,rt=a.unstable_now,wt=a.unstable_getCurrentPriorityLevel,en=a.unstable_ImmediatePriority,En=a.unstable_UserBlockingPriority,Ct=a.unstable_NormalPriority,kn=a.unstable_LowPriority,An=a.unstable_IdlePriority,Dt=a.log,fn=a.unstable_setDisableYieldValue,Jt=null,Tt=null;function dn(e){if(typeof Dt=="function"&&fn(e),Tt&&typeof Tt.setStrictMode=="function")try{Tt.setStrictMode(Jt,e)}catch{}}var ot=Math.clz32?Math.clz32:Y,tn=Math.log,E=Math.LN2;function Y(e){return e>>>=0,e===0?32:31-(tn(e)/E|0)|0}var _e=256,O=262144,J=4194304;function xe(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 Be(e,t,n){var s=e.pendingLanes;if(s===0)return 0;var u=0,f=e.suspendedLanes,g=e.pingedLanes;e=e.warmLanes;var S=s&134217727;return S!==0?(s=S&~f,s!==0?u=xe(s):(g&=S,g!==0?u=xe(g):n||(n=S&~e,n!==0&&(u=xe(n))))):(S=s&~f,S!==0?u=xe(S):g!==0?u=xe(g):n||(n=s&~e,n!==0&&(u=xe(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 Et(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Nn(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 wn(){var e=J;return J<<=1,(J&62914560)===0&&(J=4194304),e}function Rt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function wl(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Sa(e,t,n,s,u,f){var g=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=g&~n;0<n;){var ee=31-ot(n),ie=1<<ee;S[ee]=0,C[ee]=-1;var Q=X[ee];if(Q!==null)for(X[ee]=null,ee=0;ee<Q.length;ee++){var W=Q[ee];W!==null&&(W.lane&=-536870913)}n&=~ie}s!==0&&ja(e,s,0),f!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=f&~(g&~t))}function ja(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-ot(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|n&261930}function Gs(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var s=31-ot(n),u=1<<s;u&t|e[s]&t&&(e[s]|=t),n&=~u}}function Hl(e,t){var n=t&-t;return n=(n&42)!==0?1:Kl(n),(n&(e.suspendedLanes|t))!==0?0:n}function Kl(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 hn(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function ka(){var e=re.p;return e!==0?e:(e=window.event,e===void 0?32:Gg(e.type))}function ml(e,t){var n=re.p;try{return re.p=e,t()}finally{re.p=n}}var ll=Math.random().toString(36).slice(2),Ft="__reactFiber$"+ll,Ke="__reactProps$"+ll,Fn="__reactContainer$"+ll,Ys="__reactEvents$"+ll,Hi="__reactListeners$"+ll,Xs="__reactHandles$"+ll,Jl="__reactResources$"+ll,Fl="__reactMarker$"+ll;function Na(e){delete e[Ft],delete e[Ke],delete e[Ys],delete e[Hi],delete e[Xs]}function Wl(e){var t=e[Ft];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Fn]||n[Ft]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=wg(e);e!==null;){if(n=e[Ft])return n;e=wg(e)}return t}e=n,n=e.parentNode}return null}function gl(e){if(e=e[Ft]||e[Fn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function nn(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function ln(e){var t=e[Jl];return t||(t=e[Jl]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function ft(e){e[Fl]=!0}var Xn=new Set,wa={};function Vn(e,t){$n(e,t),$n(e+"Capture",t)}function $n(e,t){for(wa[e]=t,e=0;e<t.length;e++)Xn.add(t[e])}var al=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]*$"),Pl={},Wn={};function Vs(e){return qt.call(Wn,e)?!0:qt.call(Pl,e)?!1:al.test(e)?Wn[e]=!0:(Pl[e]=!0,!1)}function Cn(e,t,n){if(Vs(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var s=t.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function zn(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 pn(e,t,n,s){if(s===null)e.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+s)}}function yt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ta(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Br(e,t,n){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var u=s.get,f=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(g){n=""+g,f.call(this,g)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return n},setValue:function(g){n=""+g},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ea(e){if(!e._valueTracker){var t=Ta(e)?"checked":"value";e._valueTracker=Br(e,t,""+e[t])}}function ta(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),s="";return e&&(s=Ta(e)?e.checked?"true":"false":e.value),e=s,e!==n?(t.setValue(e),!0):!1}function Ea(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 Aa=/[\n"\\]/g;function Ln(e){return e.replace(Aa,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function bl(e,t,n,s,u,f,g,S){e.name="",g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?e.type=g:e.removeAttribute("type"),t!=null?g==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+yt(t)):e.value!==""+yt(t)&&(e.value=""+yt(t)):g!=="submit"&&g!=="reset"||e.removeAttribute("value"),t!=null?na(e,g,yt(t)):n!=null?na(e,g,yt(n)):s!=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=""+yt(S):e.removeAttribute("name")}function Bl(e,t,n,s,u,f,g,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)){ea(e);return}n=n!=null?""+yt(n):"",t=t!=null?""+yt(t):n,S||t===e.value||(e.value=t),e.defaultValue=t}s=s??u,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=S?e.checked:!!s,e.defaultChecked=!!s,g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(e.name=g),ea(e)}function na(e,t,n){t==="number"&&Ea(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function sl(e,t,n,s){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&&s&&(e[n].defaultSelected=!0)}else{for(n=""+yt(n),t=null,u=0;u<e.length;u++){if(e[u].value===n){e[u].selected=!0,s&&(e[u].defaultSelected=!0);return}t!==null||e[u].disabled||(t=e[u])}t!==null&&(t.selected=!0)}}function de(e,t,n){if(t!=null&&(t=""+yt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+yt(n):""}function w(e,t,n,s){if(t==null){if(s!=null){if(n!=null)throw Error(c(92));if(be(s)){if(1<s.length)throw Error(c(93));s=s[0]}n=s}n==null&&(n=""),t=n}n=yt(t),e.defaultValue=n,s=e.textContent,s===n&&s!==""&&s!==null&&(e.value=s),ea(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 ue=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function ve(e,t,n){var s=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?s?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":s?e.setProperty(t,n):typeof n!="number"||n===0||ue.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Re(e,t,n){if(t!=null&&typeof t!="object")throw Error(c(62));if(e=e.style,n!=null){for(var s in n)!n.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var u in t)s=t[u],t.hasOwnProperty(u)&&n[u]!==s&&ve(e,u,s)}else for(var f in t)t.hasOwnProperty(f)&&ve(e,f,t[f])}function Oe(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 mt=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"]]),mn=/^[\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 an(e){return mn.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Mt(){}var gn=null;function Yt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var la=null,Tl=null;function aa(e){var t=gl(e);if(t&&(e=t.stateNode)){var n=e[Ke]||null;e:switch(e=t.stateNode,t.type){case"input":if(bl(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="'+Ln(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var s=n[t];if(s!==e&&s.form===e.form){var u=s[Ke]||null;if(!u)throw Error(c(90));bl(s,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(t=0;t<n.length;t++)s=n[t],s.form===e.form&&ta(s)}break e;case"textarea":de(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&sl(e,!!n.multiple,t,!1)}}}var ts=!1;function Bi(e,t,n){if(ts)return e(t,n);ts=!0;try{var s=e(t);return s}finally{if(ts=!1,(la!==null||Tl!==null)&&(Wu(),la&&(t=la,e=Tl,Tl=la=null,aa(t),e)))for(t=0;t<e.length;t++)aa(e[t])}}function $s(e,t){var n=e.stateNode;if(n===null)return null;var s=n[Ke]||null;if(s===null)return null;n=s[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":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(c(231,t,typeof n));return n}var Un=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Qs=!1;if(Un)try{var ns={};Object.defineProperty(ns,"passive",{get:function(){Qs=!0}}),window.addEventListener("test",ns,ns),window.removeEventListener("test",ns,ns)}catch{Qs=!1}var xl=null,qi=null,Ca=null;function El(){if(Ca)return Ca;var e,t=qi,n=t.length,s,u="value"in xl?xl.value:xl.textContent,f=u.length;for(e=0;e<n&&t[e]===u[e];e++);var g=n-e;for(s=1;s<=g&&t[n-s]===u[f-s];s++);return Ca=u.slice(e,1<s?1-s:void 0)}function Ra(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 sa(){return!0}function ia(){return!1}function bn(e){function t(n,s,u,f,g){this._reactName=n,this._targetInst=u,this.type=s,this.nativeEvent=f,this.target=g,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)?sa:ia,this.isPropagationStopped=ia,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=sa)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=sa)},persist:function(){},isPersistent:sa}),t}var gt={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ls=bn(gt),Zs=j({},gt,{view:0,detail:0}),Ko=bn(Zs),Ii,as,sn,rn=j({},Zs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ne,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!==sn&&(sn&&e.type==="mousemove"?(Ii=e.screenX-sn.screenX,as=e.screenY-sn.screenY):as=Ii=0,sn=e),Ii)},movementY:function(e){return"movementY"in e?e.movementY:as}}),qr=bn(rn),Wc=j({},rn,{dataTransfer:0}),ql=bn(Wc),Pc=j({},Zs,{relatedTarget:0}),ss=bn(Pc),Gi=j({},gt,{animationName:0,elapsedTime:0,pseudoElement:0}),Ks=bn(Gi),Ma=j({},gt,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),eu=bn(Ma),Js=j({},gt,{data:0}),Fs=bn(Js),Ws={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ps={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"},tu={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Jo(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=tu[e])?!!t[e]:!1}function ne(){return Jo}var is=j({},Zs,{key:function(e){if(e.key){var t=Ws[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ra(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Ps[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ne,charCode:function(e){return e.type==="keypress"?Ra(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ra(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Ir=bn(is),Fo=j({},rn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),nu=bn(Fo),Wo=j({},Zs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ne}),Se=bn(Wo),rs=j({},gt,{propertyName:0,elapsedTime:0,pseudoElement:0}),Po=bn(rs),ef=j({},rn,{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}),tf=bn(ef),nf=j({},gt,{newState:0,oldState:0}),lf=bn(nf),ei=[9,13,27,32],Gr=Un&&"CompositionEvent"in window,ti=null;Un&&"documentMode"in document&&(ti=document.documentMode);var af=Un&&"TextEvent"in window&&!ti,Yr=Un&&(!Gr||ti&&8<ti&&11>=ti),lu=" ",au=!1;function Yi(e,t){switch(e){case"keyup":return ei.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Xr(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Oa=!1;function sf(e,t){switch(e){case"compositionend":return Xr(t);case"keypress":return t.which!==32?null:(au=!0,lu);case"textInput":return e=t.data,e===lu&&au?null:e;default:return null}}function su(e,t){if(Oa)return e==="compositionend"||!Gr&&Yi(e,t)?(e=El(),Ca=qi=xl=null,Oa=!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 Yr&&t.locale!=="ko"?null:t.data;default:return null}}var Vr={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 iu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Vr[e.type]:t==="textarea"}function ru(e,t,n,s){la?Tl?Tl.push(s):Tl=[s]:la=s,t=so(t,"onChange"),0<t.length&&(n=new ls("onChange","change",null,n,s),e.push({event:n,listeners:t}))}var ni=null,li=null;function ai(e){dg(e,0)}function si(e){var t=nn(e);if(ta(t))return e}function cu(e,t){if(e==="change")return t}var $r=!1;if(Un){var Qr;if(Un){var Zr="oninput"in document;if(!Zr){var uu=document.createElement("div");uu.setAttribute("oninput","return;"),Zr=typeof uu.oninput=="function"}Qr=Zr}else Qr=!1;$r=Qr&&(!document.documentMode||9<document.documentMode)}function ou(){ni&&(ni.detachEvent("onpropertychange",fu),li=ni=null)}function fu(e){if(e.propertyName==="value"&&si(li)){var t=[];ru(t,li,e,Yt(e)),Bi(ai,t)}}function rf(e,t,n){e==="focusin"?(ou(),ni=t,li=n,ni.attachEvent("onpropertychange",fu)):e==="focusout"&&ou()}function cf(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return si(li)}function uf(e,t){if(e==="click")return si(t)}function of(e,t){if(e==="input"||e==="change")return si(t)}function ff(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Pn=typeof Object.is=="function"?Object.is:ff;function ii(e,t){if(Pn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(s=0;s<n.length;s++){var u=n[s];if(!qt.call(t,u)||!Pn(e[u],t[u]))return!1}return!0}function Kr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function du(e,t){var n=Kr(e);e=0;for(var s;n;){if(n.nodeType===3){if(s=e+n.textContent.length,e<=t&&s>=t)return{node:n,offset:t-e};e=s}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Kr(n)}}function hu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?hu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function pu(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ea(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=Ea(e.document)}return t}function Jr(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 Fr=Un&&"documentMode"in document&&11>=document.documentMode,ra=null,cs=null,ri=null,Wr=!1;function mu(e,t,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Wr||ra==null||ra!==Ea(s)||(s=ra,"selectionStart"in s&&Jr(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),ri&&ii(ri,s)||(ri=s,s=so(cs,"onSelect"),0<s.length&&(t=new ls("onSelect","select",null,t,n),e.push({event:t,listeners:s}),t.target=ra)))}function Da(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var us={animationend:Da("Animation","AnimationEnd"),animationiteration:Da("Animation","AnimationIteration"),animationstart:Da("Animation","AnimationStart"),transitionrun:Da("Transition","TransitionRun"),transitionstart:Da("Transition","TransitionStart"),transitioncancel:Da("Transition","TransitionCancel"),transitionend:Da("Transition","TransitionEnd")},Pr={},gu={};Un&&(gu=document.createElement("div").style,"AnimationEvent"in window||(delete us.animationend.animation,delete us.animationiteration.animation,delete us.animationstart.animation),"TransitionEvent"in window||delete us.transitionend.transition);function za(e){if(Pr[e])return Pr[e];if(!us[e])return e;var t=us[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in gu)return Pr[e]=t[n];return e}var bu=za("animationend"),xu=za("animationiteration"),yu=za("animationstart"),df=za("transitionrun"),hf=za("transitionstart"),pf=za("transitioncancel"),_u=za("transitionend"),vu=new Map,Xi="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(" ");Xi.push("scrollEnd");function il(e,t){vu.set(e,t),Vn(t,[e])}var La=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)},Xt=[],Rn=0,Hn=0;function ci(){for(var e=Rn,t=Hn=Rn=0;t<e;){var n=Xt[t];Xt[t++]=null;var s=Xt[t];Xt[t++]=null;var u=Xt[t];Xt[t++]=null;var f=Xt[t];if(Xt[t++]=null,s!==null&&u!==null){var g=s.pending;g===null?u.next=u:(u.next=g.next,g.next=u),s.pending=u}f!==0&&ec(n,u,f)}}function os(e,t,n,s){Xt[Rn++]=e,Xt[Rn++]=t,Xt[Rn++]=n,Xt[Rn++]=s,Hn|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function Vi(e,t,n,s){return os(e,t,n,s),$i(e)}function Al(e,t){return os(e,null,null,t),$i(e)}function ec(e,t,n){e.lanes|=n;var s=e.alternate;s!==null&&(s.lanes|=n);for(var u=!1,f=e.return;f!==null;)f.childLanes|=n,s=f.alternate,s!==null&&(s.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-ot(n),e=f.hiddenUpdates,s=e[u],s===null?e[u]=[t]:s.push(t),t.lane=n|536870912),f):null}function $i(e){if(50<Sc)throw Sc=0,xd=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Cl={};function Su(e,t,n,s){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=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function el(e,t,n,s){return new Su(e,t,n,s)}function ui(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Il(e,t){var n=e.alternate;return n===null?(n=el(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 fs(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 Gl(e,t,n,s,u,f){var g=0;if(s=e,typeof e=="function")ui(e)&&(g=1);else if(typeof e=="string")g=E_(e,n,he.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case te:return e=el(31,n,t,u),e.elementType=te,e.lanes=f,e;case L:return ca(n.children,u,f,t);case B:g=8,u|=24;break;case P:return e=el(12,n,t,u|2),e.elementType=P,e.lanes=f,e;case K:return e=el(13,n,t,u),e.elementType=K,e.lanes=f,e;case z:return e=el(19,n,t,u),e.elementType=z,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Z:g=10;break e;case M:g=9;break e;case N:g=11;break e;case A:g=14;break e;case V:g=16,s=null;break e}g=29,n=Error(c(130,e===null?"null":typeof e,"")),s=null}return t=el(g,n,t,u),t.elementType=e,t.type=s,t.lanes=f,t}function ca(e,t,n,s){return e=el(7,e,s,t),e.lanes=n,e}function Qi(e,t,n){return e=el(6,e,null,t),e.lanes=n,e}function tc(e){var t=el(18,null,null,0);return t.stateNode=e,t}function Zi(e,t,n){return t=el(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var ju=new WeakMap;function rl(e,t){if(typeof e=="object"&&e!==null){var n=ju.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Bt(t)},ju.set(e,t),t)}return{value:e,source:t,stack:Bt(t)}}var ua=[],Ua=0,oi=null,b=0,q=[],fe=0,De=null,dt=1,Vt="";function cn(e,t){ua[Ua++]=b,ua[Ua++]=oi,oi=e,b=t}function ds(e,t,n){q[fe++]=dt,q[fe++]=Vt,q[fe++]=De,De=e;var s=dt;e=Vt;var u=32-ot(s)-1;s&=~(1<<u),n+=1;var f=32-ot(t)+u;if(30<f){var g=u-u%5;f=(s&(1<<g)-1).toString(32),s>>=g,u-=g,dt=1<<32-ot(t)+u|n<<u|s,Vt=f+e}else dt=1<<f|n<<u|s,Vt=e}function Ce(e){e.return!==null&&(cn(e,1),ds(e,1,0))}function Le(e){for(;e===oi;)oi=ua[--Ua],ua[Ua]=null,b=ua[--Ua],ua[Ua]=null;for(;e===De;)De=q[--fe],q[fe]=null,Vt=q[--fe],q[fe]=null,dt=q[--fe],q[fe]=null}function Ie(e,t){q[fe++]=dt,q[fe++]=Vt,q[fe++]=De,dt=t.id,Vt=t.overflow,De=e}var Ve=null,Ue=null,Ge=!1,Rl=null,Ml=!1,mf=Error(c(519));function hs(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw nc(rl(t,e)),mf}function Ph(e){var t=e.stateNode,n=e.type,s=e.memoizedProps;switch(t[Ft]=e,t[Ke]=s,n){case"dialog":Pe("cancel",t),Pe("close",t);break;case"iframe":case"object":case"embed":Pe("load",t);break;case"video":case"audio":for(n=0;n<kc.length;n++)Pe(kc[n],t);break;case"source":Pe("error",t);break;case"img":case"image":case"link":Pe("error",t),Pe("load",t);break;case"details":Pe("toggle",t);break;case"input":Pe("invalid",t),Bl(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":Pe("invalid",t);break;case"textarea":Pe("invalid",t),w(t,s.value,s.defaultValue,s.children)}n=s.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||s.suppressHydrationWarning===!0||gg(t.textContent,n)?(s.popover!=null&&(Pe("beforetoggle",t),Pe("toggle",t)),s.onScroll!=null&&Pe("scroll",t),s.onScrollEnd!=null&&Pe("scrollend",t),s.onClick!=null&&(t.onclick=Mt),t=!0):t=!1,t||hs(e,!0)}function ep(e){for(Ve=e.return;Ve;)switch(Ve.tag){case 5:case 31:case 13:Ml=!1;return;case 27:case 3:Ml=!0;return;default:Ve=Ve.return}}function Ki(e){if(e!==Ve)return!1;if(!Ge)return ep(e),Ge=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Od(e.type,e.memoizedProps)),n=!n),n&&Ue&&hs(e),ep(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));Ue=Ng(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));Ue=Ng(e)}else t===27?(t=Ue,Ts(e.type)?(e=Hd,Hd=null,Ue=e):Ue=t):Ue=Ve?Dl(e.stateNode.nextSibling):null;return!0}function fi(){Ue=Ve=null,Ge=!1}function gf(){var e=Rl;return e!==null&&(fl===null?fl=e:fl.push.apply(fl,e),Rl=null),e}function nc(e){Rl===null?Rl=[e]:Rl.push(e)}var bf=k(null),di=null,Ha=null;function ps(e,t,n){ce(bf,t._currentValue),t._currentValue=n}function Ba(e){e._currentValue=bf.current,$(bf)}function xf(e,t,n){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===n)break;e=e.return}}function yf(e,t,n,s){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var f=u.dependencies;if(f!==null){var g=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),xf(f.return,n,e),s||(g=null);break e}f=S.next}}else if(u.tag===18){if(g=u.return,g===null)throw Error(c(341));g.lanes|=n,f=g.alternate,f!==null&&(f.lanes|=n),xf(g,n,e),g=null}else g=u.child;if(g!==null)g.return=u;else for(g=u;g!==null;){if(g===e){g=null;break}if(u=g.sibling,u!==null){u.return=g.return,g=u;break}g=g.return}u=g}}function Ji(e,t,n,s){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 g=u.alternate;if(g===null)throw Error(c(387));if(g=g.memoizedProps,g!==null){var S=u.type;Pn(u.pendingProps.value,g.value)||(e!==null?e.push(S):e=[S])}}else if(u===Ae.current){if(g=u.alternate,g===null)throw Error(c(387));g.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(Ac):e=[Ac])}u=u.return}e!==null&&yf(t,e,n,s),t.flags|=262144}function ku(e){for(e=e.firstContext;e!==null;){if(!Pn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function hi(e){di=e,Ha=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Bn(e){return tp(di,e)}function Nu(e,t){return di===null&&hi(e),tp(e,t)}function tp(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Ha===null){if(e===null)throw Error(c(308));Ha=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ha=Ha.next=t;return n}var ky=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,s){e.push(s)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},Ny=a.unstable_scheduleCallback,wy=a.unstable_NormalPriority,xn={$$typeof:Z,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function _f(){return{controller:new ky,data:new Map,refCount:0}}function lc(e){e.refCount--,e.refCount===0&&Ny(wy,function(){e.controller.abort()})}var ac=null,vf=0,Fi=0,Wi=null;function Ty(e,t){if(ac===null){var n=ac=[];vf=0,Fi=kd(),Wi={status:"pending",value:void 0,then:function(s){n.push(s)}}}return vf++,t.then(np,np),t}function np(){if(--vf===0&&ac!==null){Wi!==null&&(Wi.status="fulfilled");var e=ac;ac=null,Fi=0,Wi=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ey(e,t){var n=[],s={status:"pending",value:null,reason:null,then:function(u){n.push(u)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var u=0;u<n.length;u++)(0,n[u])(t)},function(u){for(s.status="rejected",s.reason=u,u=0;u<n.length;u++)(0,n[u])(void 0)}),s}var lp=U.S;U.S=function(e,t){qm=rt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Ty(e,t),lp!==null&&lp(e,t)};var pi=k(null);function Sf(){var e=pi.current;return e!==null?e:At.pooledCache}function wu(e,t){t===null?ce(pi,pi.current):ce(pi,t.pool)}function ap(){var e=Sf();return e===null?null:{parent:xn._currentValue,pool:e}}var Pi=Error(c(460)),jf=Error(c(474)),Tu=Error(c(542)),Eu={then:function(){}};function sp(e){return e=e.status,e==="fulfilled"||e==="rejected"}function ip(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Mt,Mt),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,cp(e),e;default:if(typeof t.status=="string")t.then(Mt,Mt);else{if(e=At,e!==null&&100<e.shellSuspendCounter)throw Error(c(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var u=t;u.status="fulfilled",u.value=s}},function(s){if(t.status==="pending"){var u=t;u.status="rejected",u.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,cp(e),e}throw gi=t,Pi}}function mi(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(gi=n,Pi):n}}var gi=null;function rp(){if(gi===null)throw Error(c(459));var e=gi;return gi=null,e}function cp(e){if(e===Pi||e===Tu)throw Error(c(483))}var er=null,sc=0;function Au(e){var t=sc;return sc+=1,er===null&&(er=[]),ip(er,e,t)}function ic(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Cu(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 up(e){function t(H,D){if(e){var G=H.deletions;G===null?(H.deletions=[D],H.flags|=16):G.push(D)}}function n(H,D){if(!e)return null;for(;D!==null;)t(H,D),D=D.sibling;return null}function s(H){for(var D=new Map;H!==null;)H.key!==null?D.set(H.key,H):D.set(H.index,H),H=H.sibling;return D}function u(H,D){return H=Il(H,D),H.index=0,H.sibling=null,H}function f(H,D,G){return H.index=G,e?(G=H.alternate,G!==null?(G=G.index,G<D?(H.flags|=67108866,D):G):(H.flags|=67108866,D)):(H.flags|=1048576,D)}function g(H){return e&&H.alternate===null&&(H.flags|=67108866),H}function S(H,D,G,le){return D===null||D.tag!==6?(D=Qi(G,H.mode,le),D.return=H,D):(D=u(D,G),D.return=H,D)}function C(H,D,G,le){var Me=G.type;return Me===L?ee(H,D,G.props.children,le,G.key):D!==null&&(D.elementType===Me||typeof Me=="object"&&Me!==null&&Me.$$typeof===V&&mi(Me)===D.type)?(D=u(D,G.props),ic(D,G),D.return=H,D):(D=Gl(G.type,G.key,G.props,null,H.mode,le),ic(D,G),D.return=H,D)}function X(H,D,G,le){return D===null||D.tag!==4||D.stateNode.containerInfo!==G.containerInfo||D.stateNode.implementation!==G.implementation?(D=Zi(G,H.mode,le),D.return=H,D):(D=u(D,G.children||[]),D.return=H,D)}function ee(H,D,G,le,Me){return D===null||D.tag!==7?(D=ca(G,H.mode,le,Me),D.return=H,D):(D=u(D,G),D.return=H,D)}function ie(H,D,G){if(typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint")return D=Qi(""+D,H.mode,G),D.return=H,D;if(typeof D=="object"&&D!==null){switch(D.$$typeof){case R:return G=Gl(D.type,D.key,D.props,null,H.mode,G),ic(G,D),G.return=H,G;case T:return D=Zi(D,H.mode,G),D.return=H,D;case V:return D=mi(D),ie(H,D,G)}if(be(D)||ae(D))return D=ca(D,H.mode,G,null),D.return=H,D;if(typeof D.then=="function")return ie(H,Au(D),G);if(D.$$typeof===Z)return ie(H,Nu(H,D),G);Cu(H,D)}return null}function Q(H,D,G,le){var Me=D!==null?D.key:null;if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return Me!==null?null:S(H,D,""+G,le);if(typeof G=="object"&&G!==null){switch(G.$$typeof){case R:return G.key===Me?C(H,D,G,le):null;case T:return G.key===Me?X(H,D,G,le):null;case V:return G=mi(G),Q(H,D,G,le)}if(be(G)||ae(G))return Me!==null?null:ee(H,D,G,le,null);if(typeof G.then=="function")return Q(H,D,Au(G),le);if(G.$$typeof===Z)return Q(H,D,Nu(H,G),le);Cu(H,G)}return null}function W(H,D,G,le,Me){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return H=H.get(G)||null,S(D,H,""+le,Me);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case R:return H=H.get(le.key===null?G:le.key)||null,C(D,H,le,Me);case T:return H=H.get(le.key===null?G:le.key)||null,X(D,H,le,Me);case V:return le=mi(le),W(H,D,G,le,Me)}if(be(le)||ae(le))return H=H.get(G)||null,ee(D,H,le,Me,null);if(typeof le.then=="function")return W(H,D,G,Au(le),Me);if(le.$$typeof===Z)return W(H,D,G,Nu(D,le),Me);Cu(D,le)}return null}function we(H,D,G,le){for(var Me=null,ct=null,Ee=D,Ze=D=0,nt=null;Ee!==null&&Ze<G.length;Ze++){Ee.index>Ze?(nt=Ee,Ee=null):nt=Ee.sibling;var ut=Q(H,Ee,G[Ze],le);if(ut===null){Ee===null&&(Ee=nt);break}e&&Ee&&ut.alternate===null&&t(H,Ee),D=f(ut,D,Ze),ct===null?Me=ut:ct.sibling=ut,ct=ut,Ee=nt}if(Ze===G.length)return n(H,Ee),Ge&&cn(H,Ze),Me;if(Ee===null){for(;Ze<G.length;Ze++)Ee=ie(H,G[Ze],le),Ee!==null&&(D=f(Ee,D,Ze),ct===null?Me=Ee:ct.sibling=Ee,ct=Ee);return Ge&&cn(H,Ze),Me}for(Ee=s(Ee);Ze<G.length;Ze++)nt=W(Ee,H,Ze,G[Ze],le),nt!==null&&(e&&nt.alternate!==null&&Ee.delete(nt.key===null?Ze:nt.key),D=f(nt,D,Ze),ct===null?Me=nt:ct.sibling=nt,ct=nt);return e&&Ee.forEach(function(Ms){return t(H,Ms)}),Ge&&cn(H,Ze),Me}function ze(H,D,G,le){if(G==null)throw Error(c(151));for(var Me=null,ct=null,Ee=D,Ze=D=0,nt=null,ut=G.next();Ee!==null&&!ut.done;Ze++,ut=G.next()){Ee.index>Ze?(nt=Ee,Ee=null):nt=Ee.sibling;var Ms=Q(H,Ee,ut.value,le);if(Ms===null){Ee===null&&(Ee=nt);break}e&&Ee&&Ms.alternate===null&&t(H,Ee),D=f(Ms,D,Ze),ct===null?Me=Ms:ct.sibling=Ms,ct=Ms,Ee=nt}if(ut.done)return n(H,Ee),Ge&&cn(H,Ze),Me;if(Ee===null){for(;!ut.done;Ze++,ut=G.next())ut=ie(H,ut.value,le),ut!==null&&(D=f(ut,D,Ze),ct===null?Me=ut:ct.sibling=ut,ct=ut);return Ge&&cn(H,Ze),Me}for(Ee=s(Ee);!ut.done;Ze++,ut=G.next())ut=W(Ee,H,Ze,ut.value,le),ut!==null&&(e&&ut.alternate!==null&&Ee.delete(ut.key===null?Ze:ut.key),D=f(ut,D,Ze),ct===null?Me=ut:ct.sibling=ut,ct=ut);return e&&Ee.forEach(function(B_){return t(H,B_)}),Ge&&cn(H,Ze),Me}function kt(H,D,G,le){if(typeof G=="object"&&G!==null&&G.type===L&&G.key===null&&(G=G.props.children),typeof G=="object"&&G!==null){switch(G.$$typeof){case R:e:{for(var Me=G.key;D!==null;){if(D.key===Me){if(Me=G.type,Me===L){if(D.tag===7){n(H,D.sibling),le=u(D,G.props.children),le.return=H,H=le;break e}}else if(D.elementType===Me||typeof Me=="object"&&Me!==null&&Me.$$typeof===V&&mi(Me)===D.type){n(H,D.sibling),le=u(D,G.props),ic(le,G),le.return=H,H=le;break e}n(H,D);break}else t(H,D);D=D.sibling}G.type===L?(le=ca(G.props.children,H.mode,le,G.key),le.return=H,H=le):(le=Gl(G.type,G.key,G.props,null,H.mode,le),ic(le,G),le.return=H,H=le)}return g(H);case T:e:{for(Me=G.key;D!==null;){if(D.key===Me)if(D.tag===4&&D.stateNode.containerInfo===G.containerInfo&&D.stateNode.implementation===G.implementation){n(H,D.sibling),le=u(D,G.children||[]),le.return=H,H=le;break e}else{n(H,D);break}else t(H,D);D=D.sibling}le=Zi(G,H.mode,le),le.return=H,H=le}return g(H);case V:return G=mi(G),kt(H,D,G,le)}if(be(G))return we(H,D,G,le);if(ae(G)){if(Me=ae(G),typeof Me!="function")throw Error(c(150));return G=Me.call(G),ze(H,D,G,le)}if(typeof G.then=="function")return kt(H,D,Au(G),le);if(G.$$typeof===Z)return kt(H,D,Nu(H,G),le);Cu(H,G)}return typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint"?(G=""+G,D!==null&&D.tag===6?(n(H,D.sibling),le=u(D,G),le.return=H,H=le):(n(H,D),le=Qi(G,H.mode,le),le.return=H,H=le),g(H)):n(H,D)}return function(H,D,G,le){try{sc=0;var Me=kt(H,D,G,le);return er=null,Me}catch(Ee){if(Ee===Pi||Ee===Tu)throw Ee;var ct=el(29,Ee,null,H.mode);return ct.lanes=le,ct.return=H,ct}finally{}}}var bi=up(!0),op=up(!1),ms=!1;function kf(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Nf(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 gs(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function bs(e,t,n){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(ht&2)!==0){var u=s.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),s.pending=t,t=$i(e),ec(e,null,n),t}return os(e,s,t,n),$i(e)}function rc(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,Gs(e,n)}}function wf(e,t){var n=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,n===s)){var u=null,f=null;if(n=n.firstBaseUpdate,n!==null){do{var g={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};f===null?u=f=g:f=f.next=g,n=n.next}while(n!==null);f===null?u=f=t:f=f.next=t}else u=f=t;n={baseState:s.baseState,firstBaseUpdate:u,lastBaseUpdate:f,shared:s.shared,callbacks:s.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Tf=!1;function cc(){if(Tf){var e=Wi;if(e!==null)throw e}}function uc(e,t,n,s){Tf=!1;var u=e.updateQueue;ms=!1;var f=u.firstBaseUpdate,g=u.lastBaseUpdate,S=u.shared.pending;if(S!==null){u.shared.pending=null;var C=S,X=C.next;C.next=null,g===null?f=X:g.next=X,g=C;var ee=e.alternate;ee!==null&&(ee=ee.updateQueue,S=ee.lastBaseUpdate,S!==g&&(S===null?ee.firstBaseUpdate=X:S.next=X,ee.lastBaseUpdate=C))}if(f!==null){var ie=u.baseState;g=0,ee=X=C=null,S=f;do{var Q=S.lane&-536870913,W=Q!==S.lane;if(W?(tt&Q)===Q:(s&Q)===Q){Q!==0&&Q===Fi&&(Tf=!0),ee!==null&&(ee=ee.next={lane:0,tag:S.tag,payload:S.payload,callback:null,next:null});e:{var we=e,ze=S;Q=t;var kt=n;switch(ze.tag){case 1:if(we=ze.payload,typeof we=="function"){ie=we.call(kt,ie,Q);break e}ie=we;break e;case 3:we.flags=we.flags&-65537|128;case 0:if(we=ze.payload,Q=typeof we=="function"?we.call(kt,ie,Q):we,Q==null)break e;ie=j({},ie,Q);break e;case 2:ms=!0}}Q=S.callback,Q!==null&&(e.flags|=64,W&&(e.flags|=8192),W=u.callbacks,W===null?u.callbacks=[Q]:W.push(Q))}else W={lane:Q,tag:S.tag,payload:S.payload,callback:S.callback,next:null},ee===null?(X=ee=W,C=ie):ee=ee.next=W,g|=Q;if(S=S.next,S===null){if(S=u.shared.pending,S===null)break;W=S,S=W.next,W.next=null,u.lastBaseUpdate=W,u.shared.pending=null}}while(!0);ee===null&&(C=ie),u.baseState=C,u.firstBaseUpdate=X,u.lastBaseUpdate=ee,f===null&&(u.shared.lanes=0),Ss|=g,e.lanes=g,e.memoizedState=ie}}function fp(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function dp(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)fp(n[e],t)}var tr=k(null),Ru=k(0);function hp(e,t){e=Za,ce(Ru,e),ce(tr,t),Za=e|t.baseLanes}function Ef(){ce(Ru,Za),ce(tr,tr.current)}function Af(){Za=Ru.current,$(tr),$(Ru)}var yl=k(null),Ol=null;function xs(e){var t=e.alternate;ce(un,un.current&1),ce(yl,e),Ol===null&&(t===null||tr.current!==null||t.memoizedState!==null)&&(Ol=e)}function Cf(e){ce(un,un.current),ce(yl,e),Ol===null&&(Ol=e)}function pp(e){e.tag===22?(ce(un,un.current),ce(yl,e),Ol===null&&(Ol=e)):ys()}function ys(){ce(un,un.current),ce(yl,yl.current)}function _l(e){$(yl),Ol===e&&(Ol=null),$(un)}var un=k(0);function Mu(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Ld(n)||Ud(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 qa=0,$e=null,St=null,yn=null,Ou=!1,nr=!1,xi=!1,Du=0,oc=0,lr=null,Ay=0;function Wt(){throw Error(c(321))}function Rf(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Pn(e[n],t[n]))return!1;return!0}function Mf(e,t,n,s,u,f){return qa=f,$e=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,U.H=e===null||e.memoizedState===null?Fp:Qf,xi=!1,f=n(s,u),xi=!1,nr&&(f=gp(t,n,s,u)),mp(e),f}function mp(e){U.H=hc;var t=St!==null&&St.next!==null;if(qa=0,yn=St=$e=null,Ou=!1,oc=0,lr=null,t)throw Error(c(300));e===null||_n||(e=e.dependencies,e!==null&&ku(e)&&(_n=!0))}function gp(e,t,n,s){$e=e;var u=0;do{if(nr&&(lr=null),oc=0,nr=!1,25<=u)throw Error(c(301));if(u+=1,yn=St=null,e.updateQueue!=null){var f=e.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}U.H=Wp,f=t(n,s)}while(nr);return f}function Cy(){var e=U.H,t=e.useState()[0];return t=typeof t.then=="function"?fc(t):t,e=e.useState()[0],(St!==null?St.memoizedState:null)!==e&&($e.flags|=1024),t}function Of(){var e=Du!==0;return Du=0,e}function Df(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function zf(e){if(Ou){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ou=!1}qa=0,yn=St=$e=null,nr=!1,oc=Du=0,lr=null}function tl(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return yn===null?$e.memoizedState=yn=e:yn=yn.next=e,yn}function on(){if(St===null){var e=$e.alternate;e=e!==null?e.memoizedState:null}else e=St.next;var t=yn===null?$e.memoizedState:yn.next;if(t!==null)yn=t,St=e;else{if(e===null)throw $e.alternate===null?Error(c(467)):Error(c(310));St=e,e={memoizedState:St.memoizedState,baseState:St.baseState,baseQueue:St.baseQueue,queue:St.queue,next:null},yn===null?$e.memoizedState=yn=e:yn=yn.next=e}return yn}function zu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function fc(e){var t=oc;return oc+=1,lr===null&&(lr=[]),e=ip(lr,e,t),t=$e,(yn===null?t.memoizedState:yn.next)===null&&(t=t.alternate,U.H=t===null||t.memoizedState===null?Fp:Qf),e}function Lu(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return fc(e);if(e.$$typeof===Z)return Bn(e)}throw Error(c(438,String(e)))}function Lf(e){var t=null,n=$e.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var s=$e.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(u){return u.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=zu(),$e.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),s=0;s<e;s++)n[s]=oe;return t.index++,n}function Ia(e,t){return typeof t=="function"?t(e):t}function Uu(e){var t=on();return Uf(t,St,e)}function Uf(e,t,n){var s=e.queue;if(s===null)throw Error(c(311));s.lastRenderedReducer=n;var u=e.baseQueue,f=s.pending;if(f!==null){if(u!==null){var g=u.next;u.next=f.next,f.next=g}t.baseQueue=u=f,s.pending=null}if(f=e.baseState,u===null)e.memoizedState=f;else{t=u.next;var S=g=null,C=null,X=t,ee=!1;do{var ie=X.lane&-536870913;if(ie!==X.lane?(tt&ie)===ie:(qa&ie)===ie){var Q=X.revertLane;if(Q===0)C!==null&&(C=C.next={lane:0,revertLane:0,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null}),ie===Fi&&(ee=!0);else if((qa&Q)===Q){X=X.next,Q===Fi&&(ee=!0);continue}else ie={lane:0,revertLane:X.revertLane,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},C===null?(S=C=ie,g=f):C=C.next=ie,$e.lanes|=Q,Ss|=Q;ie=X.action,xi&&n(f,ie),f=X.hasEagerState?X.eagerState:n(f,ie)}else Q={lane:ie,revertLane:X.revertLane,gesture:X.gesture,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},C===null?(S=C=Q,g=f):C=C.next=Q,$e.lanes|=ie,Ss|=ie;X=X.next}while(X!==null&&X!==t);if(C===null?g=f:C.next=S,!Pn(f,e.memoizedState)&&(_n=!0,ee&&(n=Wi,n!==null)))throw n;e.memoizedState=f,e.baseState=g,e.baseQueue=C,s.lastRenderedState=f}return u===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function Hf(e){var t=on(),n=t.queue;if(n===null)throw Error(c(311));n.lastRenderedReducer=e;var s=n.dispatch,u=n.pending,f=t.memoizedState;if(u!==null){n.pending=null;var g=u=u.next;do f=e(f,g.action),g=g.next;while(g!==u);Pn(f,t.memoizedState)||(_n=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),n.lastRenderedState=f}return[f,s]}function bp(e,t,n){var s=$e,u=on(),f=Ge;if(f){if(n===void 0)throw Error(c(407));n=n()}else n=t();var g=!Pn((St||u).memoizedState,n);if(g&&(u.memoizedState=n,_n=!0),u=u.queue,If(_p.bind(null,s,u,e),[e]),u.getSnapshot!==t||g||yn!==null&&yn.memoizedState.tag&1){if(s.flags|=2048,ar(9,{destroy:void 0},yp.bind(null,s,u,n,t),null),At===null)throw Error(c(349));f||(qa&127)!==0||xp(s,t,n)}return n}function xp(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=$e.updateQueue,t===null?(t=zu(),$e.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function yp(e,t,n,s){t.value=n,t.getSnapshot=s,vp(t)&&Sp(e)}function _p(e,t,n){return n(function(){vp(t)&&Sp(e)})}function vp(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Pn(e,n)}catch{return!0}}function Sp(e){var t=Al(e,2);t!==null&&dl(t,e,2)}function Bf(e){var t=tl();if(typeof e=="function"){var n=e;if(e=n(),xi){dn(!0);try{n()}finally{dn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ia,lastRenderedState:e},t}function jp(e,t,n,s){return e.baseState=n,Uf(e,St,typeof s=="function"?s:Ia)}function Ry(e,t,n,s,u){if(qu(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(g){f.listeners.push(g)}};U.T!==null?n(!0):f.isTransition=!1,s(f),n=t.pending,n===null?(f.next=t.pending=f,kp(t,f)):(f.next=n.next,t.pending=n.next=f)}}function kp(e,t){var n=t.action,s=t.payload,u=e.state;if(t.isTransition){var f=U.T,g={};U.T=g;try{var S=n(u,s),C=U.S;C!==null&&C(g,S),Np(e,t,S)}catch(X){qf(e,t,X)}finally{f!==null&&g.types!==null&&(f.types=g.types),U.T=f}}else try{f=n(u,s),Np(e,t,f)}catch(X){qf(e,t,X)}}function Np(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(s){wp(e,t,s)},function(s){return qf(e,t,s)}):wp(e,t,n)}function wp(e,t,n){t.status="fulfilled",t.value=n,Tp(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,kp(e,n)))}function qf(e,t,n){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=n,Tp(t),t=t.next;while(t!==s)}e.action=null}function Tp(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ep(e,t){return t}function Ap(e,t){if(Ge){var n=At.formState;if(n!==null){e:{var s=$e;if(Ge){if(Ue){t:{for(var u=Ue,f=Ml;u.nodeType!==8;){if(!f){u=null;break t}if(u=Dl(u.nextSibling),u===null){u=null;break t}}f=u.data,u=f==="F!"||f==="F"?u:null}if(u){Ue=Dl(u.nextSibling),s=u.data==="F!";break e}}hs(s)}s=!1}s&&(t=n[0])}}return n=tl(),n.memoizedState=n.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ep,lastRenderedState:t},n.queue=s,n=Zp.bind(null,$e,s),s.dispatch=n,s=Bf(!1),f=$f.bind(null,$e,!1,s.queue),s=tl(),u={state:t,dispatch:null,action:e,pending:null},s.queue=u,n=Ry.bind(null,$e,u,f,n),u.dispatch=n,s.memoizedState=e,[t,n,!1]}function Cp(e){var t=on();return Rp(t,St,e)}function Rp(e,t,n){if(t=Uf(e,t,Ep)[0],e=Uu(Ia)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=fc(t)}catch(g){throw g===Pi?Tu:g}else s=t;t=on();var u=t.queue,f=u.dispatch;return n!==t.memoizedState&&($e.flags|=2048,ar(9,{destroy:void 0},My.bind(null,u,n),null)),[s,f,e]}function My(e,t){e.action=t}function Mp(e){var t=on(),n=St;if(n!==null)return Rp(t,n,e);on(),t=t.memoizedState,n=on();var s=n.queue.dispatch;return n.memoizedState=e,[t,s,!1]}function ar(e,t,n,s){return e={tag:e,create:n,deps:s,inst:t,next:null},t=$e.updateQueue,t===null&&(t=zu(),$e.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(s=n.next,n.next=e,e.next=s,t.lastEffect=e),e}function Op(){return on().memoizedState}function Hu(e,t,n,s){var u=tl();$e.flags|=e,u.memoizedState=ar(1|t,{destroy:void 0},n,s===void 0?null:s)}function Bu(e,t,n,s){var u=on();s=s===void 0?null:s;var f=u.memoizedState.inst;St!==null&&s!==null&&Rf(s,St.memoizedState.deps)?u.memoizedState=ar(t,f,n,s):($e.flags|=e,u.memoizedState=ar(1|t,f,n,s))}function Dp(e,t){Hu(8390656,8,e,t)}function If(e,t){Bu(2048,8,e,t)}function Oy(e){$e.flags|=4;var t=$e.updateQueue;if(t===null)t=zu(),$e.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function zp(e){var t=on().memoizedState;return Oy({ref:t,nextImpl:e}),function(){if((ht&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function Lp(e,t){return Bu(4,2,e,t)}function Up(e,t){return Bu(4,4,e,t)}function Hp(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 Bp(e,t,n){n=n!=null?n.concat([e]):null,Bu(4,4,Hp.bind(null,t,e),n)}function Gf(){}function qp(e,t){var n=on();t=t===void 0?null:t;var s=n.memoizedState;return t!==null&&Rf(t,s[1])?s[0]:(n.memoizedState=[e,t],e)}function Ip(e,t){var n=on();t=t===void 0?null:t;var s=n.memoizedState;if(t!==null&&Rf(t,s[1]))return s[0];if(s=e(),xi){dn(!0);try{e()}finally{dn(!1)}}return n.memoizedState=[s,t],s}function Yf(e,t,n){return n===void 0||(qa&1073741824)!==0&&(tt&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Gm(),$e.lanes|=e,Ss|=e,n)}function Gp(e,t,n,s){return Pn(n,t)?n:tr.current!==null?(e=Yf(e,n,s),Pn(e,t)||(_n=!0),e):(qa&42)===0||(qa&1073741824)!==0&&(tt&261930)===0?(_n=!0,e.memoizedState=n):(e=Gm(),$e.lanes|=e,Ss|=e,t)}function Yp(e,t,n,s,u){var f=re.p;re.p=f!==0&&8>f?f:8;var g=U.T,S={};U.T=S,$f(e,!1,t,n);try{var C=u(),X=U.S;if(X!==null&&X(S,C),C!==null&&typeof C=="object"&&typeof C.then=="function"){var ee=Ey(C,s);dc(e,t,ee,jl(e))}else dc(e,t,s,jl(e))}catch(ie){dc(e,t,{then:function(){},status:"rejected",reason:ie},jl())}finally{re.p=f,g!==null&&S.types!==null&&(g.types=S.types),U.T=g}}function Dy(){}function Xf(e,t,n,s){if(e.tag!==5)throw Error(c(476));var u=Xp(e).queue;Yp(e,u,t,se,n===null?Dy:function(){return Vp(e),n(s)})}function Xp(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:Ia,lastRenderedState:se},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ia,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Vp(e){var t=Xp(e);t.next===null&&(t=e.alternate.memoizedState),dc(e,t.next.queue,{},jl())}function Vf(){return Bn(Ac)}function $p(){return on().memoizedState}function Qp(){return on().memoizedState}function zy(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=jl();e=gs(n);var s=bs(t,e,n);s!==null&&(dl(s,t,n),rc(s,t,n)),t={cache:_f()},e.payload=t;return}t=t.return}}function Ly(e,t,n){var s=jl();n={lane:s,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},qu(e)?Kp(t,n):(n=Vi(e,t,n,s),n!==null&&(dl(n,e,s),Jp(n,t,s)))}function Zp(e,t,n){var s=jl();dc(e,t,n,s)}function dc(e,t,n,s){var u={lane:s,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(qu(e))Kp(t,u);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var g=t.lastRenderedState,S=f(g,n);if(u.hasEagerState=!0,u.eagerState=S,Pn(S,g))return os(e,t,u,0),At===null&&ci(),!1}catch{}finally{}if(n=Vi(e,t,u,s),n!==null)return dl(n,e,s),Jp(n,t,s),!0}return!1}function $f(e,t,n,s){if(s={lane:2,revertLane:kd(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},qu(e)){if(t)throw Error(c(479))}else t=Vi(e,n,s,2),t!==null&&dl(t,e,2)}function qu(e){var t=e.alternate;return e===$e||t!==null&&t===$e}function Kp(e,t){nr=Ou=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Jp(e,t,n){if((n&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,Gs(e,n)}}var hc={readContext:Bn,use:Lu,useCallback:Wt,useContext:Wt,useEffect:Wt,useImperativeHandle:Wt,useLayoutEffect:Wt,useInsertionEffect:Wt,useMemo:Wt,useReducer:Wt,useRef:Wt,useState:Wt,useDebugValue:Wt,useDeferredValue:Wt,useTransition:Wt,useSyncExternalStore:Wt,useId:Wt,useHostTransitionStatus:Wt,useFormState:Wt,useActionState:Wt,useOptimistic:Wt,useMemoCache:Wt,useCacheRefresh:Wt};hc.useEffectEvent=Wt;var Fp={readContext:Bn,use:Lu,useCallback:function(e,t){return tl().memoizedState=[e,t===void 0?null:t],e},useContext:Bn,useEffect:Dp,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Hu(4194308,4,Hp.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Hu(4194308,4,e,t)},useInsertionEffect:function(e,t){Hu(4,2,e,t)},useMemo:function(e,t){var n=tl();t=t===void 0?null:t;var s=e();if(xi){dn(!0);try{e()}finally{dn(!1)}}return n.memoizedState=[s,t],s},useReducer:function(e,t,n){var s=tl();if(n!==void 0){var u=n(t);if(xi){dn(!0);try{n(t)}finally{dn(!1)}}}else u=t;return s.memoizedState=s.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},s.queue=e,e=e.dispatch=Ly.bind(null,$e,e),[s.memoizedState,e]},useRef:function(e){var t=tl();return e={current:e},t.memoizedState=e},useState:function(e){e=Bf(e);var t=e.queue,n=Zp.bind(null,$e,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Gf,useDeferredValue:function(e,t){var n=tl();return Yf(n,e,t)},useTransition:function(){var e=Bf(!1);return e=Yp.bind(null,$e,e.queue,!0,!1),tl().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var s=$e,u=tl();if(Ge){if(n===void 0)throw Error(c(407));n=n()}else{if(n=t(),At===null)throw Error(c(349));(tt&127)!==0||xp(s,t,n)}u.memoizedState=n;var f={value:n,getSnapshot:t};return u.queue=f,Dp(_p.bind(null,s,f,e),[e]),s.flags|=2048,ar(9,{destroy:void 0},yp.bind(null,s,f,n,t),null),n},useId:function(){var e=tl(),t=At.identifierPrefix;if(Ge){var n=Vt,s=dt;n=(s&~(1<<32-ot(s)-1)).toString(32)+n,t="_"+t+"R_"+n,n=Du++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=Ay++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Vf,useFormState:Ap,useActionState:Ap,useOptimistic:function(e){var t=tl();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=$f.bind(null,$e,!0,n),n.dispatch=t,[e,t]},useMemoCache:Lf,useCacheRefresh:function(){return tl().memoizedState=zy.bind(null,$e)},useEffectEvent:function(e){var t=tl(),n={impl:e};return t.memoizedState=n,function(){if((ht&2)!==0)throw Error(c(440));return n.impl.apply(void 0,arguments)}}},Qf={readContext:Bn,use:Lu,useCallback:qp,useContext:Bn,useEffect:If,useImperativeHandle:Bp,useInsertionEffect:Lp,useLayoutEffect:Up,useMemo:Ip,useReducer:Uu,useRef:Op,useState:function(){return Uu(Ia)},useDebugValue:Gf,useDeferredValue:function(e,t){var n=on();return Gp(n,St.memoizedState,e,t)},useTransition:function(){var e=Uu(Ia)[0],t=on().memoizedState;return[typeof e=="boolean"?e:fc(e),t]},useSyncExternalStore:bp,useId:$p,useHostTransitionStatus:Vf,useFormState:Cp,useActionState:Cp,useOptimistic:function(e,t){var n=on();return jp(n,St,e,t)},useMemoCache:Lf,useCacheRefresh:Qp};Qf.useEffectEvent=zp;var Wp={readContext:Bn,use:Lu,useCallback:qp,useContext:Bn,useEffect:If,useImperativeHandle:Bp,useInsertionEffect:Lp,useLayoutEffect:Up,useMemo:Ip,useReducer:Hf,useRef:Op,useState:function(){return Hf(Ia)},useDebugValue:Gf,useDeferredValue:function(e,t){var n=on();return St===null?Yf(n,e,t):Gp(n,St.memoizedState,e,t)},useTransition:function(){var e=Hf(Ia)[0],t=on().memoizedState;return[typeof e=="boolean"?e:fc(e),t]},useSyncExternalStore:bp,useId:$p,useHostTransitionStatus:Vf,useFormState:Mp,useActionState:Mp,useOptimistic:function(e,t){var n=on();return St!==null?jp(n,St,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Lf,useCacheRefresh:Qp};Wp.useEffectEvent=zp;function Zf(e,t,n,s){t=e.memoizedState,n=n(s,t),n=n==null?t:j({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Kf={enqueueSetState:function(e,t,n){e=e._reactInternals;var s=jl(),u=gs(s);u.payload=t,n!=null&&(u.callback=n),t=bs(e,u,s),t!==null&&(dl(t,e,s),rc(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var s=jl(),u=gs(s);u.tag=1,u.payload=t,n!=null&&(u.callback=n),t=bs(e,u,s),t!==null&&(dl(t,e,s),rc(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=jl(),s=gs(n);s.tag=2,t!=null&&(s.callback=t),t=bs(e,s,n),t!==null&&(dl(t,e,n),rc(t,e,n))}};function Pp(e,t,n,s,u,f,g){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,f,g):t.prototype&&t.prototype.isPureReactComponent?!ii(n,s)||!ii(u,f):!0}function em(e,t,n,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,s),t.state!==e&&Kf.enqueueReplaceState(t,t.state,null)}function yi(e,t){var n=t;if("ref"in t){n={};for(var s in t)s!=="ref"&&(n[s]=t[s])}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 tm(e){La(e)}function nm(e){console.error(e)}function lm(e){La(e)}function Iu(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function am(e,t,n){try{var s=e.onCaughtError;s(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function Jf(e,t,n){return n=gs(n),n.tag=3,n.payload={element:null},n.callback=function(){Iu(e,t)},n}function sm(e){return e=gs(e),e.tag=3,e}function im(e,t,n,s){var u=n.type.getDerivedStateFromError;if(typeof u=="function"){var f=s.value;e.payload=function(){return u(f)},e.callback=function(){am(t,n,s)}}var g=n.stateNode;g!==null&&typeof g.componentDidCatch=="function"&&(e.callback=function(){am(t,n,s),typeof u!="function"&&(js===null?js=new Set([this]):js.add(this));var S=s.stack;this.componentDidCatch(s.value,{componentStack:S!==null?S:""})})}function Uy(e,t,n,s,u){if(n.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=n.alternate,t!==null&&Ji(t,n,u,!0),n=yl.current,n!==null){switch(n.tag){case 31:case 13:return Ol===null?Pu():n.alternate===null&&Pt===0&&(Pt=3),n.flags&=-257,n.flags|=65536,n.lanes=u,s===Eu?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([s]):t.add(s),vd(e,s,u)),!1;case 22:return n.flags|=65536,s===Eu?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([s])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([s]):n.add(s)),vd(e,s,u)),!1}throw Error(c(435,n.tag))}return vd(e,s,u),Pu(),!1}if(Ge)return t=yl.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,s!==mf&&(e=Error(c(422),{cause:s}),nc(rl(e,n)))):(s!==mf&&(t=Error(c(423),{cause:s}),nc(rl(t,n))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,s=rl(s,n),u=Jf(e.stateNode,s,u),wf(e,u),Pt!==4&&(Pt=2)),!1;var f=Error(c(520),{cause:s});if(f=rl(f,n),vc===null?vc=[f]:vc.push(f),Pt!==4&&(Pt=2),t===null)return!0;s=rl(s,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=u&-u,n.lanes|=e,e=Jf(n.stateNode,s,e),wf(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"&&(js===null||!js.has(f))))return n.flags|=65536,u&=-u,n.lanes|=u,u=sm(u),im(u,e,n,s),wf(n,u),!1}n=n.return}while(n!==null);return!1}var Ff=Error(c(461)),_n=!1;function qn(e,t,n,s){t.child=e===null?op(t,null,n,s):bi(t,e.child,n,s)}function rm(e,t,n,s,u){n=n.render;var f=t.ref;if("ref"in s){var g={};for(var S in s)S!=="ref"&&(g[S]=s[S])}else g=s;return hi(t),s=Mf(e,t,n,g,f,u),S=Of(),e!==null&&!_n?(Df(e,t,u),Ga(e,t,u)):(Ge&&S&&Ce(t),t.flags|=1,qn(e,t,s,u),t.child)}function cm(e,t,n,s,u){if(e===null){var f=n.type;return typeof f=="function"&&!ui(f)&&f.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=f,um(e,t,f,s,u)):(e=Gl(n.type,null,s,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!sd(e,u)){var g=f.memoizedProps;if(n=n.compare,n=n!==null?n:ii,n(g,s)&&e.ref===t.ref)return Ga(e,t,u)}return t.flags|=1,e=Il(f,s),e.ref=t.ref,e.return=t,t.child=e}function um(e,t,n,s,u){if(e!==null){var f=e.memoizedProps;if(ii(f,s)&&e.ref===t.ref)if(_n=!1,t.pendingProps=s=f,sd(e,u))(e.flags&131072)!==0&&(_n=!0);else return t.lanes=e.lanes,Ga(e,t,u)}return Wf(e,t,n,s,u)}function om(e,t,n,s){var u=s.children,f=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((t.flags&128)!==0){if(f=f!==null?f.baseLanes|n:n,e!==null){for(s=t.child=e.child,u=0;s!==null;)u=u|s.lanes|s.childLanes,s=s.sibling;s=u&~f}else s=0,t.child=null;return fm(e,t,f,n,s)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&wu(t,f!==null?f.cachePool:null),f!==null?hp(t,f):Ef(),pp(t);else return s=t.lanes=536870912,fm(e,t,f!==null?f.baseLanes|n:n,n,s)}else f!==null?(wu(t,f.cachePool),hp(t,f),ys(),t.memoizedState=null):(e!==null&&wu(t,null),Ef(),ys());return qn(e,t,u,n),t.child}function pc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function fm(e,t,n,s,u){var f=Sf();return f=f===null?null:{parent:xn._currentValue,pool:f},t.memoizedState={baseLanes:n,cachePool:f},e!==null&&wu(t,null),Ef(),pp(t),e!==null&&Ji(e,t,s,!0),t.childLanes=u,null}function Gu(e,t){return t=Xu({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function dm(e,t,n){return bi(t,e.child,null,n),e=Gu(t,t.pendingProps),e.flags|=2,_l(t),t.memoizedState=null,e}function Hy(e,t,n){var s=t.pendingProps,u=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ge){if(s.mode==="hidden")return e=Gu(t,s),t.lanes=536870912,pc(null,e);if(Cf(t),(e=Ue)?(e=kg(e,Ml),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:De!==null?{id:dt,overflow:Vt}:null,retryLane:536870912,hydrationErrors:null},n=tc(e),n.return=t,t.child=n,Ve=t,Ue=null)):e=null,e===null)throw hs(t);return t.lanes=536870912,null}return Gu(t,s)}var f=e.memoizedState;if(f!==null){var g=f.dehydrated;if(Cf(t),u)if(t.flags&256)t.flags&=-257,t=dm(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(c(558));else if(_n||Ji(e,t,n,!1),u=(n&e.childLanes)!==0,_n||u){if(s=At,s!==null&&(g=Hl(s,n),g!==0&&g!==f.retryLane))throw f.retryLane=g,Al(e,g),dl(s,e,g),Ff;Pu(),t=dm(e,t,n)}else e=f.treeContext,Ue=Dl(g.nextSibling),Ve=t,Ge=!0,Rl=null,Ml=!1,e!==null&&Ie(t,e),t=Gu(t,s),t.flags|=4096;return t}return e=Il(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Yu(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 Wf(e,t,n,s,u){return hi(t),n=Mf(e,t,n,s,void 0,u),s=Of(),e!==null&&!_n?(Df(e,t,u),Ga(e,t,u)):(Ge&&s&&Ce(t),t.flags|=1,qn(e,t,n,u),t.child)}function hm(e,t,n,s,u,f){return hi(t),t.updateQueue=null,n=gp(t,s,n,u),mp(e),s=Of(),e!==null&&!_n?(Df(e,t,f),Ga(e,t,f)):(Ge&&s&&Ce(t),t.flags|=1,qn(e,t,n,f),t.child)}function pm(e,t,n,s,u){if(hi(t),t.stateNode===null){var f=Cl,g=n.contextType;typeof g=="object"&&g!==null&&(f=Bn(g)),f=new n(s,f),t.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=Kf,t.stateNode=f,f._reactInternals=t,f=t.stateNode,f.props=s,f.state=t.memoizedState,f.refs={},kf(t),g=n.contextType,f.context=typeof g=="object"&&g!==null?Bn(g):Cl,f.state=t.memoizedState,g=n.getDerivedStateFromProps,typeof g=="function"&&(Zf(t,n,g,s),f.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(g=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),g!==f.state&&Kf.enqueueReplaceState(f,f.state,null),uc(t,s,f,u),cc(),f.state=t.memoizedState),typeof f.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){f=t.stateNode;var S=t.memoizedProps,C=yi(n,S);f.props=C;var X=f.context,ee=n.contextType;g=Cl,typeof ee=="object"&&ee!==null&&(g=Bn(ee));var ie=n.getDerivedStateFromProps;ee=typeof ie=="function"||typeof f.getSnapshotBeforeUpdate=="function",S=t.pendingProps!==S,ee||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(S||X!==g)&&em(t,f,s,g),ms=!1;var Q=t.memoizedState;f.state=Q,uc(t,s,f,u),cc(),X=t.memoizedState,S||Q!==X||ms?(typeof ie=="function"&&(Zf(t,n,ie,s),X=t.memoizedState),(C=ms||Pp(t,n,C,s,Q,X,g))?(ee||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=s,t.memoizedState=X),f.props=s,f.state=X,f.context=g,s=C):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{f=t.stateNode,Nf(e,t),g=t.memoizedProps,ee=yi(n,g),f.props=ee,ie=t.pendingProps,Q=f.context,X=n.contextType,C=Cl,typeof X=="object"&&X!==null&&(C=Bn(X)),S=n.getDerivedStateFromProps,(X=typeof S=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(g!==ie||Q!==C)&&em(t,f,s,C),ms=!1,Q=t.memoizedState,f.state=Q,uc(t,s,f,u),cc();var W=t.memoizedState;g!==ie||Q!==W||ms||e!==null&&e.dependencies!==null&&ku(e.dependencies)?(typeof S=="function"&&(Zf(t,n,S,s),W=t.memoizedState),(ee=ms||Pp(t,n,ee,s,Q,W,C)||e!==null&&e.dependencies!==null&&ku(e.dependencies))?(X||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(s,W,C),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(s,W,C)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||g===e.memoizedProps&&Q===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||g===e.memoizedProps&&Q===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=W),f.props=s,f.state=W,f.context=C,s=ee):(typeof f.componentDidUpdate!="function"||g===e.memoizedProps&&Q===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||g===e.memoizedProps&&Q===e.memoizedState||(t.flags|=1024),s=!1)}return f=s,Yu(e,t),s=(t.flags&128)!==0,f||s?(f=t.stateNode,n=s&&typeof n.getDerivedStateFromError!="function"?null:f.render(),t.flags|=1,e!==null&&s?(t.child=bi(t,e.child,null,u),t.child=bi(t,null,n,u)):qn(e,t,n,u),t.memoizedState=f.state,e=t.child):e=Ga(e,t,u),e}function mm(e,t,n,s){return fi(),t.flags|=256,qn(e,t,n,s),t.child}var Pf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ed(e){return{baseLanes:e,cachePool:ap()}}function td(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Sl),e}function gm(e,t,n){var s=t.pendingProps,u=!1,f=(t.flags&128)!==0,g;if((g=f)||(g=e!==null&&e.memoizedState===null?!1:(un.current&2)!==0),g&&(u=!0,t.flags&=-129),g=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ge){if(u?xs(t):ys(),(e=Ue)?(e=kg(e,Ml),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:De!==null?{id:dt,overflow:Vt}:null,retryLane:536870912,hydrationErrors:null},n=tc(e),n.return=t,t.child=n,Ve=t,Ue=null)):e=null,e===null)throw hs(t);return Ud(e)?t.lanes=32:t.lanes=536870912,null}var S=s.children;return s=s.fallback,u?(ys(),u=t.mode,S=Xu({mode:"hidden",children:S},u),s=ca(s,u,n,null),S.return=t,s.return=t,S.sibling=s,t.child=S,s=t.child,s.memoizedState=ed(n),s.childLanes=td(e,g,n),t.memoizedState=Pf,pc(null,s)):(xs(t),nd(t,S))}var C=e.memoizedState;if(C!==null&&(S=C.dehydrated,S!==null)){if(f)t.flags&256?(xs(t),t.flags&=-257,t=ld(e,t,n)):t.memoizedState!==null?(ys(),t.child=e.child,t.flags|=128,t=null):(ys(),S=s.fallback,u=t.mode,s=Xu({mode:"visible",children:s.children},u),S=ca(S,u,n,null),S.flags|=2,s.return=t,S.return=t,s.sibling=S,t.child=s,bi(t,e.child,null,n),s=t.child,s.memoizedState=ed(n),s.childLanes=td(e,g,n),t.memoizedState=Pf,t=pc(null,s));else if(xs(t),Ud(S)){if(g=S.nextSibling&&S.nextSibling.dataset,g)var X=g.dgst;g=X,s=Error(c(419)),s.stack="",s.digest=g,nc({value:s,source:null,stack:null}),t=ld(e,t,n)}else if(_n||Ji(e,t,n,!1),g=(n&e.childLanes)!==0,_n||g){if(g=At,g!==null&&(s=Hl(g,n),s!==0&&s!==C.retryLane))throw C.retryLane=s,Al(e,s),dl(g,e,s),Ff;Ld(S)||Pu(),t=ld(e,t,n)}else Ld(S)?(t.flags|=192,t.child=e.child,t=null):(e=C.treeContext,Ue=Dl(S.nextSibling),Ve=t,Ge=!0,Rl=null,Ml=!1,e!==null&&Ie(t,e),t=nd(t,s.children),t.flags|=4096);return t}return u?(ys(),S=s.fallback,u=t.mode,C=e.child,X=C.sibling,s=Il(C,{mode:"hidden",children:s.children}),s.subtreeFlags=C.subtreeFlags&65011712,X!==null?S=Il(X,S):(S=ca(S,u,n,null),S.flags|=2),S.return=t,s.return=t,s.sibling=S,t.child=s,pc(null,s),s=t.child,S=e.child.memoizedState,S===null?S=ed(n):(u=S.cachePool,u!==null?(C=xn._currentValue,u=u.parent!==C?{parent:C,pool:C}:u):u=ap(),S={baseLanes:S.baseLanes|n,cachePool:u}),s.memoizedState=S,s.childLanes=td(e,g,n),t.memoizedState=Pf,pc(e.child,s)):(xs(t),n=e.child,e=n.sibling,n=Il(n,{mode:"visible",children:s.children}),n.return=t,n.sibling=null,e!==null&&(g=t.deletions,g===null?(t.deletions=[e],t.flags|=16):g.push(e)),t.child=n,t.memoizedState=null,n)}function nd(e,t){return t=Xu({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Xu(e,t){return e=el(22,e,null,t),e.lanes=0,e}function ld(e,t,n){return bi(t,e.child,null,n),e=nd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function bm(e,t,n){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),xf(e.return,t,n)}function ad(e,t,n,s,u,f){var g=e.memoizedState;g===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:n,tailMode:u,treeForkCount:f}:(g.isBackwards=t,g.rendering=null,g.renderingStartTime=0,g.last=s,g.tail=n,g.tailMode=u,g.treeForkCount=f)}function xm(e,t,n){var s=t.pendingProps,u=s.revealOrder,f=s.tail;s=s.children;var g=un.current,S=(g&2)!==0;if(S?(g=g&1|2,t.flags|=128):g&=1,ce(un,g),qn(e,t,s,n),s=Ge?b:0,!S&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&bm(e,n,t);else if(e.tag===19)bm(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&&Mu(e)===null&&(u=n),n=n.sibling;n=u,n===null?(u=t.child,t.child=null):(u=n.sibling,n.sibling=null),ad(t,!1,u,n,f,s);break;case"backwards":case"unstable_legacy-backwards":for(n=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&Mu(e)===null){t.child=u;break}e=u.sibling,u.sibling=n,n=u,u=e}ad(t,!0,n,null,f,s);break;case"together":ad(t,!1,null,null,void 0,s);break;default:t.memoizedState=null}return t.child}function Ga(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ss|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Ji(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=Il(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Il(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function sd(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&ku(e)))}function By(e,t,n){switch(t.tag){case 3:st(t,t.stateNode.containerInfo),ps(t,xn,e.memoizedState.cache),fi();break;case 27:case 5:Ot(t);break;case 4:st(t,t.stateNode.containerInfo);break;case 10:ps(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Cf(t),null;break;case 13:var s=t.memoizedState;if(s!==null)return s.dehydrated!==null?(xs(t),t.flags|=128,null):(n&t.child.childLanes)!==0?gm(e,t,n):(xs(t),e=Ga(e,t,n),e!==null?e.sibling:null);xs(t);break;case 19:var u=(e.flags&128)!==0;if(s=(n&t.childLanes)!==0,s||(Ji(e,t,n,!1),s=(n&t.childLanes)!==0),u){if(s)return xm(e,t,n);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),ce(un,un.current),s)break;return null;case 22:return t.lanes=0,om(e,t,n,t.pendingProps);case 24:ps(t,xn,e.memoizedState.cache)}return Ga(e,t,n)}function ym(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)_n=!0;else{if(!sd(e,n)&&(t.flags&128)===0)return _n=!1,By(e,t,n);_n=(e.flags&131072)!==0}else _n=!1,Ge&&(t.flags&1048576)!==0&&ds(t,b,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=mi(t.elementType),t.type=e,typeof e=="function")ui(e)?(s=yi(e,s),t.tag=1,t=pm(null,t,e,s,n)):(t.tag=0,t=Wf(null,t,e,s,n));else{if(e!=null){var u=e.$$typeof;if(u===N){t.tag=11,t=rm(null,t,e,s,n);break e}else if(u===A){t.tag=14,t=cm(null,t,e,s,n);break e}}throw t=Te(e)||e,Error(c(306,t,""))}}return t;case 0:return Wf(e,t,t.type,t.pendingProps,n);case 1:return s=t.type,u=yi(s,t.pendingProps),pm(e,t,s,u,n);case 3:e:{if(st(t,t.stateNode.containerInfo),e===null)throw Error(c(387));s=t.pendingProps;var f=t.memoizedState;u=f.element,Nf(e,t),uc(t,s,null,n);var g=t.memoizedState;if(s=g.cache,ps(t,xn,s),s!==f.cache&&yf(t,[xn],n,!0),cc(),s=g.element,f.isDehydrated)if(f={element:s,isDehydrated:!1,cache:g.cache},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){t=mm(e,t,s,n);break e}else if(s!==u){u=rl(Error(c(424)),t),nc(u),t=mm(e,t,s,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(Ue=Dl(e.firstChild),Ve=t,Ge=!0,Rl=null,Ml=!0,n=op(t,null,s,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(fi(),s===u){t=Ga(e,t,n);break e}qn(e,t,s,n)}t=t.child}return t;case 26:return Yu(e,t),e===null?(n=Cg(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ge||(n=t.type,e=t.pendingProps,s=io(ye.current).createElement(n),s[Ft]=t,s[Ke]=e,In(s,n,e),ft(s),t.stateNode=s):t.memoizedState=Cg(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ot(t),e===null&&Ge&&(s=t.stateNode=Tg(t.type,t.pendingProps,ye.current),Ve=t,Ml=!0,u=Ue,Ts(t.type)?(Hd=u,Ue=Dl(s.firstChild)):Ue=u),qn(e,t,t.pendingProps.children,n),Yu(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ge&&((u=s=Ue)&&(s=m_(s,t.type,t.pendingProps,Ml),s!==null?(t.stateNode=s,Ve=t,Ue=Dl(s.firstChild),Ml=!1,u=!0):u=!1),u||hs(t)),Ot(t),u=t.type,f=t.pendingProps,g=e!==null?e.memoizedProps:null,s=f.children,Od(u,f)?s=null:g!==null&&Od(u,g)&&(t.flags|=32),t.memoizedState!==null&&(u=Mf(e,t,Cy,null,null,n),Ac._currentValue=u),Yu(e,t),qn(e,t,s,n),t.child;case 6:return e===null&&Ge&&((e=n=Ue)&&(n=g_(n,t.pendingProps,Ml),n!==null?(t.stateNode=n,Ve=t,Ue=null,e=!0):e=!1),e||hs(t)),null;case 13:return gm(e,t,n);case 4:return st(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=bi(t,null,s,n):qn(e,t,s,n),t.child;case 11:return rm(e,t,t.type,t.pendingProps,n);case 7:return qn(e,t,t.pendingProps,n),t.child;case 8:return qn(e,t,t.pendingProps.children,n),t.child;case 12:return qn(e,t,t.pendingProps.children,n),t.child;case 10:return s=t.pendingProps,ps(t,t.type,s.value),qn(e,t,s.children,n),t.child;case 9:return u=t.type._context,s=t.pendingProps.children,hi(t),u=Bn(u),s=s(u),t.flags|=1,qn(e,t,s,n),t.child;case 14:return cm(e,t,t.type,t.pendingProps,n);case 15:return um(e,t,t.type,t.pendingProps,n);case 19:return xm(e,t,n);case 31:return Hy(e,t,n);case 22:return om(e,t,n,t.pendingProps);case 24:return hi(t),s=Bn(xn),e===null?(u=Sf(),u===null&&(u=At,f=_f(),u.pooledCache=f,f.refCount++,f!==null&&(u.pooledCacheLanes|=n),u=f),t.memoizedState={parent:s,cache:u},kf(t),ps(t,xn,u)):((e.lanes&n)!==0&&(Nf(e,t),uc(t,null,null,n),cc()),u=e.memoizedState,f=t.memoizedState,u.parent!==s?(u={parent:s,cache:s},t.memoizedState=u,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=u),ps(t,xn,s)):(s=f.cache,ps(t,xn,s),s!==u.cache&&yf(t,[xn],n,!0))),qn(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function Ya(e){e.flags|=4}function id(e,t,n,s,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($m())e.flags|=8192;else throw gi=Eu,jf}else e.flags&=-16777217}function _m(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!zg(t))if($m())e.flags|=8192;else throw gi=Eu,jf}function Vu(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?wn():536870912,e.lanes|=t,cr|=t)}function mc(e,t){if(!Ge)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 s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function zt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,s=0;if(t)for(var u=e.child;u!==null;)n|=u.lanes|u.childLanes,s|=u.subtreeFlags&65011712,s|=u.flags&65011712,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)n|=u.lanes|u.childLanes,s|=u.subtreeFlags,s|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=s,e.childLanes=n,t}function qy(e,t,n){var s=t.pendingProps;switch(Le(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return zt(t),null;case 1:return zt(t),null;case 3:return n=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),Ba(xn),Qe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ki(t)?Ya(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,gf())),zt(t),null;case 26:var u=t.type,f=t.memoizedState;return e===null?(Ya(t),f!==null?(zt(t),_m(t,f)):(zt(t),id(t,u,null,s,n))):f?f!==e.memoizedState?(Ya(t),zt(t),_m(t,f)):(zt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&Ya(t),zt(t),id(t,u,e,s,n)),null;case 27:if(qe(t),n=ye.current,u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Ya(t);else{if(!s){if(t.stateNode===null)throw Error(c(166));return zt(t),null}e=he.current,Ki(t)?Ph(t):(e=Tg(u,s,n),t.stateNode=e,Ya(t))}return zt(t),null;case 5:if(qe(t),u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Ya(t);else{if(!s){if(t.stateNode===null)throw Error(c(166));return zt(t),null}if(f=he.current,Ki(t))Ph(t);else{var g=io(ye.current);switch(f){case 1:f=g.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:f=g.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":f=g.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":f=g.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":f=g.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof s.is=="string"?g.createElement("select",{is:s.is}):g.createElement("select"),s.multiple?f.multiple=!0:s.size&&(f.size=s.size);break;default:f=typeof s.is=="string"?g.createElement(u,{is:s.is}):g.createElement(u)}}f[Ft]=t,f[Ke]=s;e:for(g=t.child;g!==null;){if(g.tag===5||g.tag===6)f.appendChild(g.stateNode);else if(g.tag!==4&&g.tag!==27&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===t)break e;for(;g.sibling===null;){if(g.return===null||g.return===t)break e;g=g.return}g.sibling.return=g.return,g=g.sibling}t.stateNode=f;e:switch(In(f,u,s),u){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&Ya(t)}}return zt(t),id(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&Ya(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(c(166));if(e=ye.current,Ki(t)){if(e=t.stateNode,n=t.memoizedProps,s=null,u=Ve,u!==null)switch(u.tag){case 27:case 5:s=u.memoizedProps}e[Ft]=t,e=!!(e.nodeValue===n||s!==null&&s.suppressHydrationWarning===!0||gg(e.nodeValue,n)),e||hs(t,!0)}else e=io(e).createTextNode(s),e[Ft]=t,t.stateNode=e}return zt(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(s=Ki(t),n!==null){if(e===null){if(!s)throw Error(c(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(557));e[Ft]=t}else fi(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;zt(t),e=!1}else n=gf(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(_l(t),t):(_l(t),null);if((t.flags&128)!==0)throw Error(c(558))}return zt(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=Ki(t),s!==null&&s.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[Ft]=t}else fi(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;zt(t),u=!1}else u=gf(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(_l(t),t):(_l(t),null)}return _l(t),(t.flags&128)!==0?(t.lanes=n,t):(n=s!==null,e=e!==null&&e.memoizedState!==null,n&&(s=t.child,u=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(u=s.alternate.memoizedState.cachePool.pool),f=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(f=s.memoizedState.cachePool.pool),f!==u&&(s.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Vu(t,t.updateQueue),zt(t),null);case 4:return Qe(),e===null&&Ed(t.stateNode.containerInfo),zt(t),null;case 10:return Ba(t.type),zt(t),null;case 19:if($(un),s=t.memoizedState,s===null)return zt(t),null;if(u=(t.flags&128)!==0,f=s.rendering,f===null)if(u)mc(s,!1);else{if(Pt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=Mu(e),f!==null){for(t.flags|=128,mc(s,!1),e=f.updateQueue,t.updateQueue=e,Vu(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)fs(n,e),n=n.sibling;return ce(un,un.current&1|2),Ge&&cn(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&rt()>Ju&&(t.flags|=128,u=!0,mc(s,!1),t.lanes=4194304)}else{if(!u)if(e=Mu(f),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,Vu(t,e),mc(s,!0),s.tail===null&&s.tailMode==="hidden"&&!f.alternate&&!Ge)return zt(t),null}else 2*rt()-s.renderingStartTime>Ju&&n!==536870912&&(t.flags|=128,u=!0,mc(s,!1),t.lanes=4194304);s.isBackwards?(f.sibling=t.child,t.child=f):(e=s.last,e!==null?e.sibling=f:t.child=f,s.last=f)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=rt(),e.sibling=null,n=un.current,ce(un,u?n&1|2:n&1),Ge&&cn(t,s.treeForkCount),e):(zt(t),null);case 22:case 23:return _l(t),Af(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?(n&536870912)!==0&&(t.flags&128)===0&&(zt(t),t.subtreeFlags&6&&(t.flags|=8192)):zt(t),n=t.updateQueue,n!==null&&Vu(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==n&&(t.flags|=2048),e!==null&&$(pi),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ba(xn),zt(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function Iy(e,t){switch(Le(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ba(xn),Qe(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return qe(t),null;case 31:if(t.memoizedState!==null){if(_l(t),t.alternate===null)throw Error(c(340));fi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(_l(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));fi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return $(un),null;case 4:return Qe(),null;case 10:return Ba(t.type),null;case 22:case 23:return _l(t),Af(),e!==null&&$(pi),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ba(xn),null;case 25:return null;default:return null}}function vm(e,t){switch(Le(t),t.tag){case 3:Ba(xn),Qe();break;case 26:case 27:case 5:qe(t);break;case 4:Qe();break;case 31:t.memoizedState!==null&&_l(t);break;case 13:_l(t);break;case 19:$(un);break;case 10:Ba(t.type);break;case 22:case 23:_l(t),Af(),e!==null&&$(pi);break;case 24:Ba(xn)}}function gc(e,t){try{var n=t.updateQueue,s=n!==null?n.lastEffect:null;if(s!==null){var u=s.next;n=u;do{if((n.tag&e)===e){s=void 0;var f=n.create,g=n.inst;s=f(),g.destroy=s}n=n.next}while(n!==u)}}catch(S){vt(t,t.return,S)}}function _s(e,t,n){try{var s=t.updateQueue,u=s!==null?s.lastEffect:null;if(u!==null){var f=u.next;s=f;do{if((s.tag&e)===e){var g=s.inst,S=g.destroy;if(S!==void 0){g.destroy=void 0,u=t;var C=n,X=S;try{X()}catch(ee){vt(u,C,ee)}}}s=s.next}while(s!==f)}}catch(ee){vt(t,t.return,ee)}}function Sm(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{dp(t,n)}catch(s){vt(e,e.return,s)}}}function jm(e,t,n){n.props=yi(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(s){vt(e,t,s)}}function bc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof n=="function"?e.refCleanup=n(s):n.current=s}}catch(u){vt(e,t,u)}}function oa(e,t){var n=e.ref,s=e.refCleanup;if(n!==null)if(typeof s=="function")try{s()}catch(u){vt(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){vt(e,t,u)}else n.current=null}function km(e){var t=e.type,n=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&s.focus();break e;case"img":n.src?s.src=n.src:n.srcSet&&(s.srcset=n.srcSet)}}catch(u){vt(e,e.return,u)}}function rd(e,t,n){try{var s=e.stateNode;u_(s,e.type,n,t),s[Ke]=t}catch(u){vt(e,e.return,u)}}function Nm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ts(e.type)||e.tag===4}function cd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Nm(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&&Ts(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 ud(e,t,n){var s=e.tag;if(s===5||s===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=Mt));else if(s!==4&&(s===27&&Ts(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(ud(e,t,n),e=e.sibling;e!==null;)ud(e,t,n),e=e.sibling}function $u(e,t,n){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(s!==4&&(s===27&&Ts(e.type)&&(n=e.stateNode),e=e.child,e!==null))for($u(e,t,n),e=e.sibling;e!==null;)$u(e,t,n),e=e.sibling}function wm(e){var t=e.stateNode,n=e.memoizedProps;try{for(var s=e.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);In(t,s,n),t[Ft]=e,t[Ke]=n}catch(f){vt(e,e.return,f)}}var Xa=!1,vn=!1,od=!1,Tm=typeof WeakSet=="function"?WeakSet:Set,Mn=null;function Gy(e,t){if(e=e.containerInfo,Rd=po,e=pu(e),Jr(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var s=n.getSelection&&n.getSelection();if(s&&s.rangeCount!==0){n=s.anchorNode;var u=s.anchorOffset,f=s.focusNode;s=s.focusOffset;try{n.nodeType,f.nodeType}catch{n=null;break e}var g=0,S=-1,C=-1,X=0,ee=0,ie=e,Q=null;t:for(;;){for(var W;ie!==n||u!==0&&ie.nodeType!==3||(S=g+u),ie!==f||s!==0&&ie.nodeType!==3||(C=g+s),ie.nodeType===3&&(g+=ie.nodeValue.length),(W=ie.firstChild)!==null;)Q=ie,ie=W;for(;;){if(ie===e)break t;if(Q===n&&++X===u&&(S=g),Q===f&&++ee===s&&(C=g),(W=ie.nextSibling)!==null)break;ie=Q,Q=ie.parentNode}ie=W}n=S===-1||C===-1?null:{start:S,end:C}}else n=null}n=n||{start:0,end:0}}else n=null;for(Md={focusedElem:e,selectionRange:n},po=!1,Mn=t;Mn!==null;)if(t=Mn,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Mn=e;else for(;Mn!==null;){switch(t=Mn,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,s=n.stateNode;try{var we=yi(n.type,u);e=s.getSnapshotBeforeUpdate(we,f),s.__reactInternalSnapshotBeforeUpdate=e}catch(ze){vt(n,n.return,ze)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)zd(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":zd(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,Mn=e;break}Mn=t.return}}function Em(e,t,n){var s=n.flags;switch(n.tag){case 0:case 11:case 15:$a(e,n),s&4&&gc(5,n);break;case 1:if($a(e,n),s&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(g){vt(n,n.return,g)}else{var u=yi(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(g){vt(n,n.return,g)}}s&64&&Sm(n),s&512&&bc(n,n.return);break;case 3:if($a(e,n),s&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{dp(e,t)}catch(g){vt(n,n.return,g)}}break;case 27:t===null&&s&4&&wm(n);case 26:case 5:$a(e,n),t===null&&s&4&&km(n),s&512&&bc(n,n.return);break;case 12:$a(e,n);break;case 31:$a(e,n),s&4&&Rm(e,n);break;case 13:$a(e,n),s&4&&Mm(e,n),s&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Fy.bind(null,n),b_(e,n))));break;case 22:if(s=n.memoizedState!==null||Xa,!s){t=t!==null&&t.memoizedState!==null||vn,u=Xa;var f=vn;Xa=s,(vn=t)&&!f?Qa(e,n,(n.subtreeFlags&8772)!==0):$a(e,n),Xa=u,vn=f}break;case 30:break;default:$a(e,n)}}function Am(e){var t=e.alternate;t!==null&&(e.alternate=null,Am(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Na(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 $t=null,cl=!1;function Va(e,t,n){for(n=n.child;n!==null;)Cm(e,t,n),n=n.sibling}function Cm(e,t,n){if(Tt&&typeof Tt.onCommitFiberUnmount=="function")try{Tt.onCommitFiberUnmount(Jt,n)}catch{}switch(n.tag){case 26:vn||oa(n,t),Va(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:vn||oa(n,t);var s=$t,u=cl;Ts(n.type)&&($t=n.stateNode,cl=!1),Va(e,t,n),wc(n.stateNode),$t=s,cl=u;break;case 5:vn||oa(n,t);case 6:if(s=$t,u=cl,$t=null,Va(e,t,n),$t=s,cl=u,$t!==null)if(cl)try{($t.nodeType===9?$t.body:$t.nodeName==="HTML"?$t.ownerDocument.body:$t).removeChild(n.stateNode)}catch(f){vt(n,t,f)}else try{$t.removeChild(n.stateNode)}catch(f){vt(n,t,f)}break;case 18:$t!==null&&(cl?(e=$t,Sg(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),gr(e)):Sg($t,n.stateNode));break;case 4:s=$t,u=cl,$t=n.stateNode.containerInfo,cl=!0,Va(e,t,n),$t=s,cl=u;break;case 0:case 11:case 14:case 15:_s(2,n,t),vn||_s(4,n,t),Va(e,t,n);break;case 1:vn||(oa(n,t),s=n.stateNode,typeof s.componentWillUnmount=="function"&&jm(n,t,s)),Va(e,t,n);break;case 21:Va(e,t,n);break;case 22:vn=(s=vn)||n.memoizedState!==null,Va(e,t,n),vn=s;break;default:Va(e,t,n)}}function Rm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{gr(e)}catch(n){vt(t,t.return,n)}}}function Mm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{gr(e)}catch(n){vt(t,t.return,n)}}function Yy(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Tm),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Tm),t;default:throw Error(c(435,e.tag))}}function Qu(e,t){var n=Yy(e);t.forEach(function(s){if(!n.has(s)){n.add(s);var u=Wy.bind(null,e,s);s.then(u,u)}})}function ul(e,t){var n=t.deletions;if(n!==null)for(var s=0;s<n.length;s++){var u=n[s],f=e,g=t,S=g;e:for(;S!==null;){switch(S.tag){case 27:if(Ts(S.type)){$t=S.stateNode,cl=!1;break e}break;case 5:$t=S.stateNode,cl=!1;break e;case 3:case 4:$t=S.stateNode.containerInfo,cl=!0;break e}S=S.return}if($t===null)throw Error(c(160));Cm(f,g,u),$t=null,cl=!1,f=u.alternate,f!==null&&(f.return=null),u.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Om(t,e),t=t.sibling}var Yl=null;function Om(e,t){var n=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ul(t,e),ol(e),s&4&&(_s(3,e,e.return),gc(3,e),_s(5,e,e.return));break;case 1:ul(t,e),ol(e),s&512&&(vn||n===null||oa(n,n.return)),s&64&&Xa&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?s:n.concat(s))));break;case 26:var u=Yl;if(ul(t,e),ol(e),s&512&&(vn||n===null||oa(n,n.return)),s&4){var f=n!==null?n.memoizedState:null;if(s=e.memoizedState,n===null)if(s===null)if(e.stateNode===null){e:{s=e.type,n=e.memoizedProps,u=u.ownerDocument||u;t:switch(s){case"title":f=u.getElementsByTagName("title")[0],(!f||f[Fl]||f[Ft]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=u.createElement(s),u.head.insertBefore(f,u.querySelector("head > title"))),In(f,s,n),f[Ft]=e,ft(f),s=f;break e;case"link":var g=Og("link","href",u).get(s+(n.href||""));if(g){for(var S=0;S<g.length;S++)if(f=g[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)){g.splice(S,1);break t}}f=u.createElement(s),In(f,s,n),u.head.appendChild(f);break;case"meta":if(g=Og("meta","content",u).get(s+(n.content||""))){for(S=0;S<g.length;S++)if(f=g[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)){g.splice(S,1);break t}}f=u.createElement(s),In(f,s,n),u.head.appendChild(f);break;default:throw Error(c(468,s))}f[Ft]=e,ft(f),s=f}e.stateNode=s}else Dg(u,e.type,e.stateNode);else e.stateNode=Mg(u,s,e.memoizedProps);else f!==s?(f===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):f.count--,s===null?Dg(u,e.type,e.stateNode):Mg(u,s,e.memoizedProps)):s===null&&e.stateNode!==null&&rd(e,e.memoizedProps,n.memoizedProps)}break;case 27:ul(t,e),ol(e),s&512&&(vn||n===null||oa(n,n.return)),n!==null&&s&4&&rd(e,e.memoizedProps,n.memoizedProps);break;case 5:if(ul(t,e),ol(e),s&512&&(vn||n===null||oa(n,n.return)),e.flags&32){u=e.stateNode;try{I(u,"")}catch(we){vt(e,e.return,we)}}s&4&&e.stateNode!=null&&(u=e.memoizedProps,rd(e,u,n!==null?n.memoizedProps:u)),s&1024&&(od=!0);break;case 6:if(ul(t,e),ol(e),s&4){if(e.stateNode===null)throw Error(c(162));s=e.memoizedProps,n=e.stateNode;try{n.nodeValue=s}catch(we){vt(e,e.return,we)}}break;case 3:if(uo=null,u=Yl,Yl=ro(t.containerInfo),ul(t,e),Yl=u,ol(e),s&4&&n!==null&&n.memoizedState.isDehydrated)try{gr(t.containerInfo)}catch(we){vt(e,e.return,we)}od&&(od=!1,Dm(e));break;case 4:s=Yl,Yl=ro(e.stateNode.containerInfo),ul(t,e),ol(e),Yl=s;break;case 12:ul(t,e),ol(e);break;case 31:ul(t,e),ol(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Qu(e,s)));break;case 13:ul(t,e),ol(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Ku=rt()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Qu(e,s)));break;case 22:u=e.memoizedState!==null;var C=n!==null&&n.memoizedState!==null,X=Xa,ee=vn;if(Xa=X||u,vn=ee||C,ul(t,e),vn=ee,Xa=X,ol(e),s&8192)e:for(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,u&&(n===null||C||Xa||vn||_i(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){C=n=t;try{if(f=C.stateNode,u)g=f.style,typeof g.setProperty=="function"?g.setProperty("display","none","important"):g.display="none";else{S=C.stateNode;var ie=C.memoizedProps.style,Q=ie!=null&&ie.hasOwnProperty("display")?ie.display:null;S.style.display=Q==null||typeof Q=="boolean"?"":(""+Q).trim()}}catch(we){vt(C,C.return,we)}}}else if(t.tag===6){if(n===null){C=t;try{C.stateNode.nodeValue=u?"":C.memoizedProps}catch(we){vt(C,C.return,we)}}}else if(t.tag===18){if(n===null){C=t;try{var W=C.stateNode;u?jg(W,!0):jg(C.stateNode,!1)}catch(we){vt(C,C.return,we)}}}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}s&4&&(s=e.updateQueue,s!==null&&(n=s.retryQueue,n!==null&&(s.retryQueue=null,Qu(e,n))));break;case 19:ul(t,e),ol(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Qu(e,s)));break;case 30:break;case 21:break;default:ul(t,e),ol(e)}}function ol(e){var t=e.flags;if(t&2){try{for(var n,s=e.return;s!==null;){if(Nm(s)){n=s;break}s=s.return}if(n==null)throw Error(c(160));switch(n.tag){case 27:var u=n.stateNode,f=cd(e);$u(e,f,u);break;case 5:var g=n.stateNode;n.flags&32&&(I(g,""),n.flags&=-33);var S=cd(e);$u(e,S,g);break;case 3:case 4:var C=n.stateNode.containerInfo,X=cd(e);ud(e,X,C);break;default:throw Error(c(161))}}catch(ee){vt(e,e.return,ee)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Dm(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Dm(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function $a(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Em(e,t.alternate,t),t=t.sibling}function _i(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:_s(4,t,t.return),_i(t);break;case 1:oa(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&jm(t,t.return,n),_i(t);break;case 27:wc(t.stateNode);case 26:case 5:oa(t,t.return),_i(t);break;case 22:t.memoizedState===null&&_i(t);break;case 30:_i(t);break;default:_i(t)}e=e.sibling}}function Qa(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var s=t.alternate,u=e,f=t,g=f.flags;switch(f.tag){case 0:case 11:case 15:Qa(u,f,n),gc(4,f);break;case 1:if(Qa(u,f,n),s=f,u=s.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(X){vt(s,s.return,X)}if(s=f,u=s.updateQueue,u!==null){var S=s.stateNode;try{var C=u.shared.hiddenCallbacks;if(C!==null)for(u.shared.hiddenCallbacks=null,u=0;u<C.length;u++)fp(C[u],S)}catch(X){vt(s,s.return,X)}}n&&g&64&&Sm(f),bc(f,f.return);break;case 27:wm(f);case 26:case 5:Qa(u,f,n),n&&s===null&&g&4&&km(f),bc(f,f.return);break;case 12:Qa(u,f,n);break;case 31:Qa(u,f,n),n&&g&4&&Rm(u,f);break;case 13:Qa(u,f,n),n&&g&4&&Mm(u,f);break;case 22:f.memoizedState===null&&Qa(u,f,n),bc(f,f.return);break;case 30:break;default:Qa(u,f,n)}t=t.sibling}}function fd(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&lc(n))}function dd(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&lc(e))}function Xl(e,t,n,s){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)zm(e,t,n,s),t=t.sibling}function zm(e,t,n,s){var u=t.flags;switch(t.tag){case 0:case 11:case 15:Xl(e,t,n,s),u&2048&&gc(9,t);break;case 1:Xl(e,t,n,s);break;case 3:Xl(e,t,n,s),u&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&lc(e)));break;case 12:if(u&2048){Xl(e,t,n,s),e=t.stateNode;try{var f=t.memoizedProps,g=f.id,S=f.onPostCommit;typeof S=="function"&&S(g,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(C){vt(t,t.return,C)}}else Xl(e,t,n,s);break;case 31:Xl(e,t,n,s);break;case 13:Xl(e,t,n,s);break;case 23:break;case 22:f=t.stateNode,g=t.alternate,t.memoizedState!==null?f._visibility&2?Xl(e,t,n,s):xc(e,t):f._visibility&2?Xl(e,t,n,s):(f._visibility|=2,sr(e,t,n,s,(t.subtreeFlags&10256)!==0||!1)),u&2048&&fd(g,t);break;case 24:Xl(e,t,n,s),u&2048&&dd(t.alternate,t);break;default:Xl(e,t,n,s)}}function sr(e,t,n,s,u){for(u=u&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var f=e,g=t,S=n,C=s,X=g.flags;switch(g.tag){case 0:case 11:case 15:sr(f,g,S,C,u),gc(8,g);break;case 23:break;case 22:var ee=g.stateNode;g.memoizedState!==null?ee._visibility&2?sr(f,g,S,C,u):xc(f,g):(ee._visibility|=2,sr(f,g,S,C,u)),u&&X&2048&&fd(g.alternate,g);break;case 24:sr(f,g,S,C,u),u&&X&2048&&dd(g.alternate,g);break;default:sr(f,g,S,C,u)}t=t.sibling}}function xc(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,s=t,u=s.flags;switch(s.tag){case 22:xc(n,s),u&2048&&fd(s.alternate,s);break;case 24:xc(n,s),u&2048&&dd(s.alternate,s);break;default:xc(n,s)}t=t.sibling}}var yc=8192;function ir(e,t,n){if(e.subtreeFlags&yc)for(e=e.child;e!==null;)Lm(e,t,n),e=e.sibling}function Lm(e,t,n){switch(e.tag){case 26:ir(e,t,n),e.flags&yc&&e.memoizedState!==null&&A_(n,Yl,e.memoizedState,e.memoizedProps);break;case 5:ir(e,t,n);break;case 3:case 4:var s=Yl;Yl=ro(e.stateNode.containerInfo),ir(e,t,n),Yl=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=yc,yc=16777216,ir(e,t,n),yc=s):ir(e,t,n));break;default:ir(e,t,n)}}function Um(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 _c(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var s=t[n];Mn=s,Bm(s,e)}Um(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Hm(e),e=e.sibling}function Hm(e){switch(e.tag){case 0:case 11:case 15:_c(e),e.flags&2048&&_s(9,e,e.return);break;case 3:_c(e);break;case 12:_c(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Zu(e)):_c(e);break;default:_c(e)}}function Zu(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var s=t[n];Mn=s,Bm(s,e)}Um(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:_s(8,t,t.return),Zu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Zu(t));break;default:Zu(t)}e=e.sibling}}function Bm(e,t){for(;Mn!==null;){var n=Mn;switch(n.tag){case 0:case 11:case 15:_s(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var s=n.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:lc(n.memoizedState.cache)}if(s=n.child,s!==null)s.return=n,Mn=s;else e:for(n=e;Mn!==null;){s=Mn;var u=s.sibling,f=s.return;if(Am(s),s===n){Mn=null;break e}if(u!==null){u.return=f,Mn=u;break e}Mn=f}}}var Xy={getCacheForType:function(e){var t=Bn(xn),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Bn(xn).controller.signal}},Vy=typeof WeakMap=="function"?WeakMap:Map,ht=0,At=null,We=null,tt=0,_t=0,vl=null,vs=!1,rr=!1,hd=!1,Za=0,Pt=0,Ss=0,vi=0,pd=0,Sl=0,cr=0,vc=null,fl=null,md=!1,Ku=0,qm=0,Ju=1/0,Fu=null,js=null,Tn=0,ks=null,ur=null,Ka=0,gd=0,bd=null,Im=null,Sc=0,xd=null;function jl(){return(ht&2)!==0&&tt!==0?tt&-tt:U.T!==null?kd():ka()}function Gm(){if(Sl===0)if((tt&536870912)===0||Ge){var e=O;O<<=1,(O&3932160)===0&&(O=262144),Sl=e}else Sl=536870912;return e=yl.current,e!==null&&(e.flags|=32),Sl}function dl(e,t,n){(e===At&&(_t===2||_t===9)||e.cancelPendingCommit!==null)&&(or(e,0),Ns(e,tt,Sl,!1)),wl(e,n),((ht&2)===0||e!==At)&&(e===At&&((ht&2)===0&&(vi|=n),Pt===4&&Ns(e,tt,Sl,!1)),fa(e))}function Ym(e,t,n){if((ht&6)!==0)throw Error(c(327));var s=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Et(e,t),u=s?Zy(e,t):_d(e,t,!0),f=s;do{if(u===0){rr&&!s&&Ns(e,t,0,!1);break}else{if(n=e.current.alternate,f&&!$y(n)){u=_d(e,t,!1),f=!1;continue}if(u===2){if(f=t,e.errorRecoveryDisabledLanes&f)var g=0;else g=e.pendingLanes&-536870913,g=g!==0?g:g&536870912?536870912:0;if(g!==0){t=g;e:{var S=e;u=vc;var C=S.current.memoizedState.isDehydrated;if(C&&(or(S,g).flags|=256),g=_d(S,g,!1),g!==2){if(hd&&!C){S.errorRecoveryDisabledLanes|=f,vi|=f,u=4;break e}f=fl,fl=u,f!==null&&(fl===null?fl=f:fl.push.apply(fl,f))}u=g}if(f=!1,u!==2)continue}}if(u===1){or(e,0),Ns(e,t,0,!0);break}e:{switch(s=e,f=u,f){case 0:case 1:throw Error(c(345));case 4:if((t&4194048)!==t)break;case 6:Ns(s,t,Sl,!vs);break e;case 2:fl=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(u=Ku+300-rt(),10<u)){if(Ns(s,t,Sl,!vs),Be(s,0,!0)!==0)break e;Ka=t,s.timeoutHandle=_g(Xm.bind(null,s,n,fl,Fu,md,t,Sl,vi,cr,vs,f,"Throttled",-0,0),u);break e}Xm(s,n,fl,Fu,md,t,Sl,vi,cr,vs,f,null,-0,0)}}break}while(!0);fa(e)}function Xm(e,t,n,s,u,f,g,S,C,X,ee,ie,Q,W){if(e.timeoutHandle=-1,ie=t.subtreeFlags,ie&8192||(ie&16785408)===16785408){ie={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Mt},Lm(t,f,ie);var we=(f&62914560)===f?Ku-rt():(f&4194048)===f?qm-rt():0;if(we=C_(ie,we),we!==null){Ka=f,e.cancelPendingCommit=we(Wm.bind(null,e,t,f,n,s,u,g,S,C,ee,ie,null,Q,W)),Ns(e,f,g,!X);return}}Wm(e,t,f,n,s,u,g,S,C)}function $y(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 s=0;s<n.length;s++){var u=n[s],f=u.getSnapshot;u=u.value;try{if(!Pn(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 Ns(e,t,n,s){t&=~pd,t&=~vi,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var u=t;0<u;){var f=31-ot(u),g=1<<f;s[f]=-1,u&=~g}n!==0&&ja(e,n,t)}function Wu(){return(ht&6)===0?(jc(0),!1):!0}function yd(){if(We!==null){if(_t===0)var e=We.return;else e=We,Ha=di=null,zf(e),er=null,sc=0,e=We;for(;e!==null;)vm(e.alternate,e),e=e.return;We=null}}function or(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,d_(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Ka=0,yd(),At=e,We=n=Il(e.current,null),tt=t,_t=0,vl=null,vs=!1,rr=Et(e,t),hd=!1,cr=Sl=pd=vi=Ss=Pt=0,fl=vc=null,md=!1,(t&8)!==0&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var u=31-ot(s),f=1<<u;t|=e[u],s&=~f}return Za=t,ci(),n}function Vm(e,t){$e=null,U.H=hc,t===Pi||t===Tu?(t=rp(),_t=3):t===jf?(t=rp(),_t=4):_t=t===Ff?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,vl=t,We===null&&(Pt=1,Iu(e,rl(t,e.current)))}function $m(){var e=yl.current;return e===null?!0:(tt&4194048)===tt?Ol===null:(tt&62914560)===tt||(tt&536870912)!==0?e===Ol:!1}function Qm(){var e=U.H;return U.H=hc,e===null?hc:e}function Zm(){var e=U.A;return U.A=Xy,e}function Pu(){Pt=4,vs||(tt&4194048)!==tt&&yl.current!==null||(rr=!0),(Ss&134217727)===0&&(vi&134217727)===0||At===null||Ns(At,tt,Sl,!1)}function _d(e,t,n){var s=ht;ht|=2;var u=Qm(),f=Zm();(At!==e||tt!==t)&&(Fu=null,or(e,t)),t=!1;var g=Pt;e:do try{if(_t!==0&&We!==null){var S=We,C=vl;switch(_t){case 8:yd(),g=6;break e;case 3:case 2:case 9:case 6:yl.current===null&&(t=!0);var X=_t;if(_t=0,vl=null,fr(e,S,C,X),n&&rr){g=0;break e}break;default:X=_t,_t=0,vl=null,fr(e,S,C,X)}}Qy(),g=Pt;break}catch(ee){Vm(e,ee)}while(!0);return t&&e.shellSuspendCounter++,Ha=di=null,ht=s,U.H=u,U.A=f,We===null&&(At=null,tt=0,ci()),g}function Qy(){for(;We!==null;)Km(We)}function Zy(e,t){var n=ht;ht|=2;var s=Qm(),u=Zm();At!==e||tt!==t?(Fu=null,Ju=rt()+500,or(e,t)):rr=Et(e,t);e:do try{if(_t!==0&&We!==null){t=We;var f=vl;t:switch(_t){case 1:_t=0,vl=null,fr(e,t,f,1);break;case 2:case 9:if(sp(f)){_t=0,vl=null,Jm(t);break}t=function(){_t!==2&&_t!==9||At!==e||(_t=7),fa(e)},f.then(t,t);break e;case 3:_t=7;break e;case 4:_t=5;break e;case 7:sp(f)?(_t=0,vl=null,Jm(t)):(_t=0,vl=null,fr(e,t,f,7));break;case 5:var g=null;switch(We.tag){case 26:g=We.memoizedState;case 5:case 27:var S=We;if(g?zg(g):S.stateNode.complete){_t=0,vl=null;var C=S.sibling;if(C!==null)We=C;else{var X=S.return;X!==null?(We=X,eo(X)):We=null}break t}}_t=0,vl=null,fr(e,t,f,5);break;case 6:_t=0,vl=null,fr(e,t,f,6);break;case 8:yd(),Pt=6;break e;default:throw Error(c(462))}}Ky();break}catch(ee){Vm(e,ee)}while(!0);return Ha=di=null,U.H=s,U.A=u,ht=n,We!==null?0:(At=null,tt=0,ci(),Pt)}function Ky(){for(;We!==null&&!Gt();)Km(We)}function Km(e){var t=ym(e.alternate,e,Za);e.memoizedProps=e.pendingProps,t===null?eo(e):We=t}function Jm(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=hm(n,t,t.pendingProps,t.type,void 0,tt);break;case 11:t=hm(n,t,t.pendingProps,t.type.render,t.ref,tt);break;case 5:zf(t);default:vm(n,t),t=We=fs(t,Za),t=ym(n,t,Za)}e.memoizedProps=e.pendingProps,t===null?eo(e):We=t}function fr(e,t,n,s){Ha=di=null,zf(t),er=null,sc=0;var u=t.return;try{if(Uy(e,u,t,n,tt)){Pt=1,Iu(e,rl(n,e.current)),We=null;return}}catch(f){if(u!==null)throw We=u,f;Pt=1,Iu(e,rl(n,e.current)),We=null;return}t.flags&32768?(Ge||s===1?e=!0:rr||(tt&536870912)!==0?e=!1:(vs=e=!0,(s===2||s===9||s===3||s===6)&&(s=yl.current,s!==null&&s.tag===13&&(s.flags|=16384))),Fm(t,e)):eo(t)}function eo(e){var t=e;do{if((t.flags&32768)!==0){Fm(t,vs);return}e=t.return;var n=qy(t.alternate,t,Za);if(n!==null){We=n;return}if(t=t.sibling,t!==null){We=t;return}We=t=e}while(t!==null);Pt===0&&(Pt=5)}function Fm(e,t){do{var n=Iy(e.alternate,e);if(n!==null){n.flags&=32767,We=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){We=e;return}We=e=n}while(e!==null);Pt=6,We=null}function Wm(e,t,n,s,u,f,g,S,C){e.cancelPendingCommit=null;do to();while(Tn!==0);if((ht&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));if(f=t.lanes|t.childLanes,f|=Hn,Sa(e,n,f,g,S,C),e===At&&(We=At=null,tt=0),ur=t,ks=e,Ka=n,gd=f,bd=u,Im=s,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Py(Ct,function(){return lg(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||s){s=U.T,U.T=null,u=re.p,re.p=2,g=ht,ht|=4;try{Gy(e,t,n)}finally{ht=g,re.p=u,U.T=s}}Tn=1,Pm(),eg(),tg()}}function Pm(){if(Tn===1){Tn=0;var e=ks,t=ur,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=U.T,U.T=null;var s=re.p;re.p=2;var u=ht;ht|=4;try{Om(t,e);var f=Md,g=pu(e.containerInfo),S=f.focusedElem,C=f.selectionRange;if(g!==S&&S&&S.ownerDocument&&hu(S.ownerDocument.documentElement,S)){if(C!==null&&Jr(S)){var X=C.start,ee=C.end;if(ee===void 0&&(ee=X),"selectionStart"in S)S.selectionStart=X,S.selectionEnd=Math.min(ee,S.value.length);else{var ie=S.ownerDocument||document,Q=ie&&ie.defaultView||window;if(Q.getSelection){var W=Q.getSelection(),we=S.textContent.length,ze=Math.min(C.start,we),kt=C.end===void 0?ze:Math.min(C.end,we);!W.extend&&ze>kt&&(g=kt,kt=ze,ze=g);var H=du(S,ze),D=du(S,kt);if(H&&D&&(W.rangeCount!==1||W.anchorNode!==H.node||W.anchorOffset!==H.offset||W.focusNode!==D.node||W.focusOffset!==D.offset)){var G=ie.createRange();G.setStart(H.node,H.offset),W.removeAllRanges(),ze>kt?(W.addRange(G),W.extend(D.node,D.offset)):(G.setEnd(D.node,D.offset),W.addRange(G))}}}}for(ie=[],W=S;W=W.parentNode;)W.nodeType===1&&ie.push({element:W,left:W.scrollLeft,top:W.scrollTop});for(typeof S.focus=="function"&&S.focus(),S=0;S<ie.length;S++){var le=ie[S];le.element.scrollLeft=le.left,le.element.scrollTop=le.top}}po=!!Rd,Md=Rd=null}finally{ht=u,re.p=s,U.T=n}}e.current=t,Tn=2}}function eg(){if(Tn===2){Tn=0;var e=ks,t=ur,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=U.T,U.T=null;var s=re.p;re.p=2;var u=ht;ht|=4;try{Em(e,t.alternate,t)}finally{ht=u,re.p=s,U.T=n}}Tn=3}}function tg(){if(Tn===4||Tn===3){Tn=0,Qt();var e=ks,t=ur,n=Ka,s=Im;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Tn=5:(Tn=0,ur=ks=null,ng(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(js=null),hn(n),t=t.stateNode,Tt&&typeof Tt.onCommitFiberRoot=="function")try{Tt.onCommitFiberRoot(Jt,t,void 0,(t.current.flags&128)===128)}catch{}if(s!==null){t=U.T,u=re.p,re.p=2,U.T=null;try{for(var f=e.onRecoverableError,g=0;g<s.length;g++){var S=s[g];f(S.value,{componentStack:S.stack})}}finally{U.T=t,re.p=u}}(Ka&3)!==0&&to(),fa(e),u=e.pendingLanes,(n&261930)!==0&&(u&42)!==0?e===xd?Sc++:(Sc=0,xd=e):Sc=0,jc(0)}}function ng(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,lc(t)))}function to(){return Pm(),eg(),tg(),lg()}function lg(){if(Tn!==5)return!1;var e=ks,t=gd;gd=0;var n=hn(Ka),s=U.T,u=re.p;try{re.p=32>n?32:n,U.T=null,n=bd,bd=null;var f=ks,g=Ka;if(Tn=0,ur=ks=null,Ka=0,(ht&6)!==0)throw Error(c(331));var S=ht;if(ht|=4,Hm(f.current),zm(f,f.current,g,n),ht=S,jc(0,!1),Tt&&typeof Tt.onPostCommitFiberRoot=="function")try{Tt.onPostCommitFiberRoot(Jt,f)}catch{}return!0}finally{re.p=u,U.T=s,ng(e,t)}}function ag(e,t,n){t=rl(n,t),t=Jf(e.stateNode,t,2),e=bs(e,t,2),e!==null&&(wl(e,2),fa(e))}function vt(e,t,n){if(e.tag===3)ag(e,e,n);else for(;t!==null;){if(t.tag===3){ag(t,e,n);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(js===null||!js.has(s))){e=rl(n,e),n=sm(2),s=bs(t,n,2),s!==null&&(im(n,s,t,e),wl(s,2),fa(s));break}}t=t.return}}function vd(e,t,n){var s=e.pingCache;if(s===null){s=e.pingCache=new Vy;var u=new Set;s.set(t,u)}else u=s.get(t),u===void 0&&(u=new Set,s.set(t,u));u.has(n)||(hd=!0,u.add(n),e=Jy.bind(null,e,t,n),t.then(e,e))}function Jy(e,t,n){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,At===e&&(tt&n)===n&&(Pt===4||Pt===3&&(tt&62914560)===tt&&300>rt()-Ku?(ht&2)===0&&or(e,0):pd|=n,cr===tt&&(cr=0)),fa(e)}function sg(e,t){t===0&&(t=wn()),e=Al(e,t),e!==null&&(wl(e,t),fa(e))}function Fy(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),sg(e,n)}function Wy(e,t){var n=0;switch(e.tag){case 31:case 13:var s=e.stateNode,u=e.memoizedState;u!==null&&(n=u.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(c(314))}s!==null&&s.delete(t),sg(e,n)}function Py(e,t){return Kt(e,t)}var no=null,dr=null,Sd=!1,lo=!1,jd=!1,ws=0;function fa(e){e!==dr&&e.next===null&&(dr===null?no=dr=e:dr=dr.next=e),lo=!0,Sd||(Sd=!0,t_())}function jc(e,t){if(!jd&&lo){jd=!0;do for(var n=!1,s=no;s!==null;){if(e!==0){var u=s.pendingLanes;if(u===0)var f=0;else{var g=s.suspendedLanes,S=s.pingedLanes;f=(1<<31-ot(42|e)+1)-1,f&=u&~(g&~S),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(n=!0,ug(s,f))}else f=tt,f=Be(s,s===At?f:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(f&3)===0||Et(s,f)||(n=!0,ug(s,f));s=s.next}while(n);jd=!1}}function e_(){ig()}function ig(){lo=Sd=!1;var e=0;ws!==0&&f_()&&(e=ws);for(var t=rt(),n=null,s=no;s!==null;){var u=s.next,f=rg(s,t);f===0?(s.next=null,n===null?no=u:n.next=u,u===null&&(dr=n)):(n=s,(e!==0||(f&3)!==0)&&(lo=!0)),s=u}Tn!==0&&Tn!==5||jc(e),ws!==0&&(ws=0)}function rg(e,t){for(var n=e.suspendedLanes,s=e.pingedLanes,u=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var g=31-ot(f),S=1<<g,C=u[g];C===-1?((S&n)===0||(S&s)!==0)&&(u[g]=Nn(S,t)):C<=t&&(e.expiredLanes|=S),f&=~S}if(t=At,n=tt,n=Be(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,n===0||e===t&&(_t===2||_t===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&It(s),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||Et(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(s!==null&&It(s),hn(n)){case 2:case 8:n=En;break;case 32:n=Ct;break;case 268435456:n=An;break;default:n=Ct}return s=cg.bind(null,e),n=Kt(n,s),e.callbackPriority=t,e.callbackNode=n,t}return s!==null&&s!==null&&It(s),e.callbackPriority=2,e.callbackNode=null,2}function cg(e,t){if(Tn!==0&&Tn!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(to()&&e.callbackNode!==n)return null;var s=tt;return s=Be(e,e===At?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Ym(e,s,t),rg(e,rt()),e.callbackNode!=null&&e.callbackNode===n?cg.bind(null,e):null)}function ug(e,t){if(to())return null;Ym(e,t,!0)}function t_(){h_(function(){(ht&6)!==0?Kt(en,e_):ig()})}function kd(){if(ws===0){var e=Fi;e===0&&(e=_e,_e<<=1,(_e&261888)===0&&(_e=256)),ws=e}return ws}function og(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:an(""+e)}function fg(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 n_(e,t,n,s,u){if(t==="submit"&&n&&n.stateNode===u){var f=og((u[Ke]||null).action),g=s.submitter;g&&(t=(t=g[Ke]||null)?og(t.formAction):g.getAttribute("formAction"),t!==null&&(f=t,g=null));var S=new ls("action","action",null,s,u);e.push({event:S,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(ws!==0){var C=g?fg(u,g):new FormData(u);Xf(n,{pending:!0,data:C,method:u.method,action:f},null,C)}}else typeof f=="function"&&(S.preventDefault(),C=g?fg(u,g):new FormData(u),Xf(n,{pending:!0,data:C,method:u.method,action:f},f,C))},currentTarget:u}]})}}for(var Nd=0;Nd<Xi.length;Nd++){var wd=Xi[Nd],l_=wd.toLowerCase(),a_=wd[0].toUpperCase()+wd.slice(1);il(l_,"on"+a_)}il(bu,"onAnimationEnd"),il(xu,"onAnimationIteration"),il(yu,"onAnimationStart"),il("dblclick","onDoubleClick"),il("focusin","onFocus"),il("focusout","onBlur"),il(df,"onTransitionRun"),il(hf,"onTransitionStart"),il(pf,"onTransitionCancel"),il(_u,"onTransitionEnd"),$n("onMouseEnter",["mouseout","mouseover"]),$n("onMouseLeave",["mouseout","mouseover"]),$n("onPointerEnter",["pointerout","pointerover"]),$n("onPointerLeave",["pointerout","pointerover"]),Vn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Vn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Vn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Vn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Vn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Vn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var kc="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(" "),s_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(kc));function dg(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var s=e[n],u=s.event;s=s.listeners;e:{var f=void 0;if(t)for(var g=s.length-1;0<=g;g--){var S=s[g],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(ee){La(ee)}u.currentTarget=null,f=C}else for(g=0;g<s.length;g++){if(S=s[g],C=S.instance,X=S.currentTarget,S=S.listener,C!==f&&u.isPropagationStopped())break e;f=S,u.currentTarget=X;try{f(u)}catch(ee){La(ee)}u.currentTarget=null,f=C}}}}function Pe(e,t){var n=t[Ys];n===void 0&&(n=t[Ys]=new Set);var s=e+"__bubble";n.has(s)||(hg(t,e,2,!1),n.add(s))}function Td(e,t,n){var s=0;t&&(s|=4),hg(n,e,s,t)}var ao="_reactListening"+Math.random().toString(36).slice(2);function Ed(e){if(!e[ao]){e[ao]=!0,Xn.forEach(function(n){n!=="selectionchange"&&(s_.has(n)||Td(n,!1,e),Td(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ao]||(t[ao]=!0,Td("selectionchange",!1,t))}}function hg(e,t,n,s){switch(Gg(t)){case 2:var u=O_;break;case 8:u=D_;break;default:u=Yd}n=u.bind(null,t,n,e),u=void 0,!Qs||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(u=!0),s?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 Ad(e,t,n,s,u){var f=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var g=s.tag;if(g===3||g===4){var S=s.stateNode.containerInfo;if(S===u)break;if(g===4)for(g=s.return;g!==null;){var C=g.tag;if((C===3||C===4)&&g.stateNode.containerInfo===u)return;g=g.return}for(;S!==null;){if(g=Wl(S),g===null)return;if(C=g.tag,C===5||C===6||C===26||C===27){s=f=g;continue e}S=S.parentNode}}s=s.return}Bi(function(){var X=f,ee=Yt(n),ie=[];e:{var Q=vu.get(e);if(Q!==void 0){var W=ls,we=e;switch(e){case"keypress":if(Ra(n)===0)break e;case"keydown":case"keyup":W=Ir;break;case"focusin":we="focus",W=ss;break;case"focusout":we="blur",W=ss;break;case"beforeblur":case"afterblur":W=ss;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":W=qr;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":W=ql;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":W=Se;break;case bu:case xu:case yu:W=Ks;break;case _u:W=Po;break;case"scroll":case"scrollend":W=Ko;break;case"wheel":W=tf;break;case"copy":case"cut":case"paste":W=eu;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":W=nu;break;case"toggle":case"beforetoggle":W=lf}var ze=(t&4)!==0,kt=!ze&&(e==="scroll"||e==="scrollend"),H=ze?Q!==null?Q+"Capture":null:Q;ze=[];for(var D=X,G;D!==null;){var le=D;if(G=le.stateNode,le=le.tag,le!==5&&le!==26&&le!==27||G===null||H===null||(le=$s(D,H),le!=null&&ze.push(Nc(D,le,G))),kt)break;D=D.return}0<ze.length&&(Q=new W(Q,we,null,n,ee),ie.push({event:Q,listeners:ze}))}}if((t&7)===0){e:{if(Q=e==="mouseover"||e==="pointerover",W=e==="mouseout"||e==="pointerout",Q&&n!==gn&&(we=n.relatedTarget||n.fromElement)&&(Wl(we)||we[Fn]))break e;if((W||Q)&&(Q=ee.window===ee?ee:(Q=ee.ownerDocument)?Q.defaultView||Q.parentWindow:window,W?(we=n.relatedTarget||n.toElement,W=X,we=we?Wl(we):null,we!==null&&(kt=d(we),ze=we.tag,we!==kt||ze!==5&&ze!==27&&ze!==6)&&(we=null)):(W=null,we=X),W!==we)){if(ze=qr,le="onMouseLeave",H="onMouseEnter",D="mouse",(e==="pointerout"||e==="pointerover")&&(ze=nu,le="onPointerLeave",H="onPointerEnter",D="pointer"),kt=W==null?Q:nn(W),G=we==null?Q:nn(we),Q=new ze(le,D+"leave",W,n,ee),Q.target=kt,Q.relatedTarget=G,le=null,Wl(ee)===X&&(ze=new ze(H,D+"enter",we,n,ee),ze.target=G,ze.relatedTarget=kt,le=ze),kt=le,W&&we)t:{for(ze=i_,H=W,D=we,G=0,le=H;le;le=ze(le))G++;le=0;for(var Me=D;Me;Me=ze(Me))le++;for(;0<G-le;)H=ze(H),G--;for(;0<le-G;)D=ze(D),le--;for(;G--;){if(H===D||D!==null&&H===D.alternate){ze=H;break t}H=ze(H),D=ze(D)}ze=null}else ze=null;W!==null&&pg(ie,Q,W,ze,!1),we!==null&&kt!==null&&pg(ie,kt,we,ze,!0)}}e:{if(Q=X?nn(X):window,W=Q.nodeName&&Q.nodeName.toLowerCase(),W==="select"||W==="input"&&Q.type==="file")var ct=cu;else if(iu(Q))if($r)ct=of;else{ct=cf;var Ee=rf}else W=Q.nodeName,!W||W.toLowerCase()!=="input"||Q.type!=="checkbox"&&Q.type!=="radio"?X&&Oe(X.elementType)&&(ct=cu):ct=uf;if(ct&&(ct=ct(e,X))){ru(ie,ct,n,ee);break e}Ee&&Ee(e,Q,X),e==="focusout"&&X&&Q.type==="number"&&X.memoizedProps.value!=null&&na(Q,"number",Q.value)}switch(Ee=X?nn(X):window,e){case"focusin":(iu(Ee)||Ee.contentEditable==="true")&&(ra=Ee,cs=X,ri=null);break;case"focusout":ri=cs=ra=null;break;case"mousedown":Wr=!0;break;case"contextmenu":case"mouseup":case"dragend":Wr=!1,mu(ie,n,ee);break;case"selectionchange":if(Fr)break;case"keydown":case"keyup":mu(ie,n,ee)}var Ze;if(Gr)e:{switch(e){case"compositionstart":var nt="onCompositionStart";break e;case"compositionend":nt="onCompositionEnd";break e;case"compositionupdate":nt="onCompositionUpdate";break e}nt=void 0}else Oa?Yi(e,n)&&(nt="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(nt="onCompositionStart");nt&&(Yr&&n.locale!=="ko"&&(Oa||nt!=="onCompositionStart"?nt==="onCompositionEnd"&&Oa&&(Ze=El()):(xl=ee,qi="value"in xl?xl.value:xl.textContent,Oa=!0)),Ee=so(X,nt),0<Ee.length&&(nt=new Fs(nt,e,null,n,ee),ie.push({event:nt,listeners:Ee}),Ze?nt.data=Ze:(Ze=Xr(n),Ze!==null&&(nt.data=Ze)))),(Ze=af?sf(e,n):su(e,n))&&(nt=so(X,"onBeforeInput"),0<nt.length&&(Ee=new Fs("onBeforeInput","beforeinput",null,n,ee),ie.push({event:Ee,listeners:nt}),Ee.data=Ze)),n_(ie,e,X,n,ee)}dg(ie,t)})}function Nc(e,t,n){return{instance:e,listener:t,currentTarget:n}}function so(e,t){for(var n=t+"Capture",s=[];e!==null;){var u=e,f=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||f===null||(u=$s(e,n),u!=null&&s.unshift(Nc(e,u,f)),u=$s(e,t),u!=null&&s.push(Nc(e,u,f))),e.tag===3)return s;e=e.return}return[]}function i_(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function pg(e,t,n,s,u){for(var f=t._reactName,g=[];n!==null&&n!==s;){var S=n,C=S.alternate,X=S.stateNode;if(S=S.tag,C!==null&&C===s)break;S!==5&&S!==26&&S!==27||X===null||(C=X,u?(X=$s(n,f),X!=null&&g.unshift(Nc(n,X,C))):u||(X=$s(n,f),X!=null&&g.push(Nc(n,X,C)))),n=n.return}g.length!==0&&e.push({event:t,listeners:g})}var r_=/\r\n?/g,c_=/\u0000|\uFFFD/g;function mg(e){return(typeof e=="string"?e:""+e).replace(r_,`
50
- `).replace(c_,"")}function gg(e,t){return t=mg(t),mg(e)===t}function jt(e,t,n,s,u,f){switch(n){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||I(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&I(e,""+s);break;case"className":zn(e,"class",s);break;case"tabIndex":zn(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":zn(e,n,s);break;case"style":Re(e,s,f);break;case"data":if(t!=="object"){zn(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(n);break}s=an(""+s),e.setAttribute(n,s);break;case"action":case"formAction":if(typeof s=="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"&&jt(e,t,"name",u.name,u,null),jt(e,t,"formEncType",u.formEncType,u,null),jt(e,t,"formMethod",u.formMethod,u,null),jt(e,t,"formTarget",u.formTarget,u,null)):(jt(e,t,"encType",u.encType,u,null),jt(e,t,"method",u.method,u,null),jt(e,t,"target",u.target,u,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(n);break}s=an(""+s),e.setAttribute(n,s);break;case"onClick":s!=null&&(e.onclick=Mt);break;case"onScroll":s!=null&&Pe("scroll",e);break;case"onScrollEnd":s!=null&&Pe("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(c(61));if(n=s.__html,n!=null){if(u.children!=null)throw Error(c(60));e.innerHTML=n}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}n=an(""+s),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":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,""+s):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":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":s===!0?e.setAttribute(n,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,s):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(n,s):e.removeAttribute(n);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(n):e.setAttribute(n,s);break;case"popover":Pe("beforetoggle",e),Pe("toggle",e),Cn(e,"popover",s);break;case"xlinkActuate":pn(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":pn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":pn(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":pn(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":pn(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":pn(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":pn(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":pn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":pn(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":Cn(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=mt.get(n)||n,Cn(e,n,s))}}function Cd(e,t,n,s,u,f){switch(n){case"style":Re(e,s,f);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(c(61));if(n=s.__html,n!=null){if(u.children!=null)throw Error(c(60));e.innerHTML=n}}break;case"children":typeof s=="string"?I(e,s):(typeof s=="number"||typeof s=="bigint")&&I(e,""+s);break;case"onScroll":s!=null&&Pe("scroll",e);break;case"onScrollEnd":s!=null&&Pe("scrollend",e);break;case"onClick":s!=null&&(e.onclick=Mt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!wa.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[Ke]||null,f=f!=null?f[n]:null,typeof f=="function"&&e.removeEventListener(t,f,u),typeof s=="function")){typeof f!="function"&&f!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,s,u);break e}n in e?e[n]=s:s===!0?e.setAttribute(n,""):Cn(e,n,s)}}}function In(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Pe("error",e),Pe("load",e);var s=!1,u=!1,f;for(f in n)if(n.hasOwnProperty(f)){var g=n[f];if(g!=null)switch(f){case"src":s=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:jt(e,t,f,g,n,null)}}u&&jt(e,t,"srcSet",n.srcSet,n,null),s&&jt(e,t,"src",n.src,n,null);return;case"input":Pe("invalid",e);var S=f=g=u=null,C=null,X=null;for(s in n)if(n.hasOwnProperty(s)){var ee=n[s];if(ee!=null)switch(s){case"name":u=ee;break;case"type":g=ee;break;case"checked":C=ee;break;case"defaultChecked":X=ee;break;case"value":f=ee;break;case"defaultValue":S=ee;break;case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(c(137,t));break;default:jt(e,t,s,ee,n,null)}}Bl(e,f,S,C,X,g,u,!1);return;case"select":Pe("invalid",e),s=g=f=null;for(u in n)if(n.hasOwnProperty(u)&&(S=n[u],S!=null))switch(u){case"value":f=S;break;case"defaultValue":g=S;break;case"multiple":s=S;default:jt(e,t,u,S,n,null)}t=f,n=g,e.multiple=!!s,t!=null?sl(e,!!s,t,!1):n!=null&&sl(e,!!s,n,!0);return;case"textarea":Pe("invalid",e),f=u=s=null;for(g in n)if(n.hasOwnProperty(g)&&(S=n[g],S!=null))switch(g){case"value":s=S;break;case"defaultValue":u=S;break;case"children":f=S;break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(c(91));break;default:jt(e,t,g,S,n,null)}w(e,s,u,f);return;case"option":for(C in n)if(n.hasOwnProperty(C)&&(s=n[C],s!=null))switch(C){case"selected":e.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:jt(e,t,C,s,n,null)}return;case"dialog":Pe("beforetoggle",e),Pe("toggle",e),Pe("cancel",e),Pe("close",e);break;case"iframe":case"object":Pe("load",e);break;case"video":case"audio":for(s=0;s<kc.length;s++)Pe(kc[s],e);break;case"image":Pe("error",e),Pe("load",e);break;case"details":Pe("toggle",e);break;case"embed":case"source":case"link":Pe("error",e),Pe("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)&&(s=n[X],s!=null))switch(X){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:jt(e,t,X,s,n,null)}return;default:if(Oe(t)){for(ee in n)n.hasOwnProperty(ee)&&(s=n[ee],s!==void 0&&Cd(e,t,ee,s,n,void 0));return}}for(S in n)n.hasOwnProperty(S)&&(s=n[S],s!=null&&jt(e,t,S,s,n,null))}function u_(e,t,n,s){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,g=null,S=null,C=null,X=null,ee=null;for(W in n){var ie=n[W];if(n.hasOwnProperty(W)&&ie!=null)switch(W){case"checked":break;case"value":break;case"defaultValue":C=ie;default:s.hasOwnProperty(W)||jt(e,t,W,null,s,ie)}}for(var Q in s){var W=s[Q];if(ie=n[Q],s.hasOwnProperty(Q)&&(W!=null||ie!=null))switch(Q){case"type":f=W;break;case"name":u=W;break;case"checked":X=W;break;case"defaultChecked":ee=W;break;case"value":g=W;break;case"defaultValue":S=W;break;case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(c(137,t));break;default:W!==ie&&jt(e,t,Q,W,s,ie)}}bl(e,g,S,C,X,ee,f,u);return;case"select":W=g=S=Q=null;for(f in n)if(C=n[f],n.hasOwnProperty(f)&&C!=null)switch(f){case"value":break;case"multiple":W=C;default:s.hasOwnProperty(f)||jt(e,t,f,null,s,C)}for(u in s)if(f=s[u],C=n[u],s.hasOwnProperty(u)&&(f!=null||C!=null))switch(u){case"value":Q=f;break;case"defaultValue":S=f;break;case"multiple":g=f;default:f!==C&&jt(e,t,u,f,s,C)}t=S,n=g,s=W,Q!=null?sl(e,!!n,Q,!1):!!s!=!!n&&(t!=null?sl(e,!!n,t,!0):sl(e,!!n,n?[]:"",!1));return;case"textarea":W=Q=null;for(S in n)if(u=n[S],n.hasOwnProperty(S)&&u!=null&&!s.hasOwnProperty(S))switch(S){case"value":break;case"children":break;default:jt(e,t,S,null,s,u)}for(g in s)if(u=s[g],f=n[g],s.hasOwnProperty(g)&&(u!=null||f!=null))switch(g){case"value":Q=u;break;case"defaultValue":W=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(c(91));break;default:u!==f&&jt(e,t,g,u,s,f)}de(e,Q,W);return;case"option":for(var we in n)if(Q=n[we],n.hasOwnProperty(we)&&Q!=null&&!s.hasOwnProperty(we))switch(we){case"selected":e.selected=!1;break;default:jt(e,t,we,null,s,Q)}for(C in s)if(Q=s[C],W=n[C],s.hasOwnProperty(C)&&Q!==W&&(Q!=null||W!=null))switch(C){case"selected":e.selected=Q&&typeof Q!="function"&&typeof Q!="symbol";break;default:jt(e,t,C,Q,s,W)}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 ze in n)Q=n[ze],n.hasOwnProperty(ze)&&Q!=null&&!s.hasOwnProperty(ze)&&jt(e,t,ze,null,s,Q);for(X in s)if(Q=s[X],W=n[X],s.hasOwnProperty(X)&&Q!==W&&(Q!=null||W!=null))switch(X){case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(c(137,t));break;default:jt(e,t,X,Q,s,W)}return;default:if(Oe(t)){for(var kt in n)Q=n[kt],n.hasOwnProperty(kt)&&Q!==void 0&&!s.hasOwnProperty(kt)&&Cd(e,t,kt,void 0,s,Q);for(ee in s)Q=s[ee],W=n[ee],!s.hasOwnProperty(ee)||Q===W||Q===void 0&&W===void 0||Cd(e,t,ee,Q,s,W);return}}for(var H in n)Q=n[H],n.hasOwnProperty(H)&&Q!=null&&!s.hasOwnProperty(H)&&jt(e,t,H,null,s,Q);for(ie in s)Q=s[ie],W=n[ie],!s.hasOwnProperty(ie)||Q===W||Q==null&&W==null||jt(e,t,ie,Q,s,W)}function bg(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function o_(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),s=0;s<n.length;s++){var u=n[s],f=u.transferSize,g=u.initiatorType,S=u.duration;if(f&&S&&bg(g)){for(g=0,S=u.responseEnd,s+=1;s<n.length;s++){var C=n[s],X=C.startTime;if(X>S)break;var ee=C.transferSize,ie=C.initiatorType;ee&&bg(ie)&&(C=C.responseEnd,g+=ee*(C<S?1:(S-X)/(C-X)))}if(--s,t+=8*(f+g)/(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 Rd=null,Md=null;function io(e){return e.nodeType===9?e:e.ownerDocument}function xg(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 yg(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 Od(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 Dd=null;function f_(){var e=window.event;return e&&e.type==="popstate"?e===Dd?!1:(Dd=e,!0):(Dd=null,!1)}var _g=typeof setTimeout=="function"?setTimeout:void 0,d_=typeof clearTimeout=="function"?clearTimeout:void 0,vg=typeof Promise=="function"?Promise:void 0,h_=typeof queueMicrotask=="function"?queueMicrotask:typeof vg<"u"?function(e){return vg.resolve(null).then(e).catch(p_)}:_g;function p_(e){setTimeout(function(){throw e})}function Ts(e){return e==="head"}function Sg(e,t){var n=t,s=0;do{var u=n.nextSibling;if(e.removeChild(n),u&&u.nodeType===8)if(n=u.data,n==="/$"||n==="/&"){if(s===0){e.removeChild(u),gr(t);return}s--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")s++;else if(n==="html")wc(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,wc(n);for(var f=n.firstChild;f;){var g=f.nextSibling,S=f.nodeName;f[Fl]||S==="SCRIPT"||S==="STYLE"||S==="LINK"&&f.rel.toLowerCase()==="stylesheet"||n.removeChild(f),f=g}}else n==="body"&&wc(e.ownerDocument.body);n=u}while(n);gr(t)}function jg(e,t){var n=e;e=0;do{var s=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||""),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=s}while(n)}function zd(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":zd(n),Na(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function m_(e,t,n,s){for(;e.nodeType===1;){var u=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[Fl])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=Dl(e.nextSibling),e===null)break}return null}function g_(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Dl(e.nextSibling),e===null))return null;return e}function kg(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Dl(e.nextSibling),e===null))return null;return e}function Ld(e){return e.data==="$?"||e.data==="$~"}function Ud(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function b_(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var s=function(){t(),n.removeEventListener("DOMContentLoaded",s)};n.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function Dl(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 Hd=null;function Ng(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Dl(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function wg(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 Tg(e,t,n){switch(t=io(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 wc(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Na(e)}var zl=new Map,Eg=new Set;function ro(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ja=re.d;re.d={f:x_,r:y_,D:__,C:v_,L:S_,m:j_,X:N_,S:k_,M:w_};function x_(){var e=Ja.f(),t=Wu();return e||t}function y_(e){var t=gl(e);t!==null&&t.tag===5&&t.type==="form"?Vp(t):Ja.r(e)}var hr=typeof document>"u"?null:document;function Ag(e,t,n){var s=hr;if(s&&typeof t=="string"&&t){var u=Ln(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof n=="string"&&(u+='[crossorigin="'+n+'"]'),Eg.has(u)||(Eg.add(u),e={rel:e,crossOrigin:n,href:t},s.querySelector(u)===null&&(t=s.createElement("link"),In(t,"link",e),ft(t),s.head.appendChild(t)))}}function __(e){Ja.D(e),Ag("dns-prefetch",e,null)}function v_(e,t){Ja.C(e,t),Ag("preconnect",e,t)}function S_(e,t,n){Ja.L(e,t,n);var s=hr;if(s&&e&&t){var u='link[rel="preload"][as="'+Ln(t)+'"]';t==="image"&&n&&n.imageSrcSet?(u+='[imagesrcset="'+Ln(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(u+='[imagesizes="'+Ln(n.imageSizes)+'"]')):u+='[href="'+Ln(e)+'"]';var f=u;switch(t){case"style":f=pr(e);break;case"script":f=mr(e)}zl.has(f)||(e=j({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),zl.set(f,e),s.querySelector(u)!==null||t==="style"&&s.querySelector(Tc(f))||t==="script"&&s.querySelector(Ec(f))||(t=s.createElement("link"),In(t,"link",e),ft(t),s.head.appendChild(t)))}}function j_(e,t){Ja.m(e,t);var n=hr;if(n&&e){var s=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+Ln(s)+'"][href="'+Ln(e)+'"]',f=u;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=mr(e)}if(!zl.has(f)&&(e=j({rel:"modulepreload",href:e},t),zl.set(f,e),n.querySelector(u)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Ec(f)))return}s=n.createElement("link"),In(s,"link",e),ft(s),n.head.appendChild(s)}}}function k_(e,t,n){Ja.S(e,t,n);var s=hr;if(s&&e){var u=ln(s).hoistableStyles,f=pr(e);t=t||"default";var g=u.get(f);if(!g){var S={loading:0,preload:null};if(g=s.querySelector(Tc(f)))S.loading=5;else{e=j({rel:"stylesheet",href:e,"data-precedence":t},n),(n=zl.get(f))&&Bd(e,n);var C=g=s.createElement("link");ft(C),In(C,"link",e),C._p=new Promise(function(X,ee){C.onload=X,C.onerror=ee}),C.addEventListener("load",function(){S.loading|=1}),C.addEventListener("error",function(){S.loading|=2}),S.loading|=4,co(g,t,s)}g={type:"stylesheet",instance:g,count:1,state:S},u.set(f,g)}}}function N_(e,t){Ja.X(e,t);var n=hr;if(n&&e){var s=ln(n).hoistableScripts,u=mr(e),f=s.get(u);f||(f=n.querySelector(Ec(u)),f||(e=j({src:e,async:!0},t),(t=zl.get(u))&&qd(e,t),f=n.createElement("script"),ft(f),In(f,"link",e),n.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},s.set(u,f))}}function w_(e,t){Ja.M(e,t);var n=hr;if(n&&e){var s=ln(n).hoistableScripts,u=mr(e),f=s.get(u);f||(f=n.querySelector(Ec(u)),f||(e=j({src:e,async:!0,type:"module"},t),(t=zl.get(u))&&qd(e,t),f=n.createElement("script"),ft(f),In(f,"link",e),n.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},s.set(u,f))}}function Cg(e,t,n,s){var u=(u=ye.current)?ro(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=pr(n.href),n=ln(u).hoistableStyles,s=n.get(t),s||(s={type:"style",instance:null,count:0,state:null},n.set(t,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=pr(n.href);var f=ln(u).hoistableStyles,g=f.get(e);if(g||(u=u.ownerDocument||u,g={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,g),(f=u.querySelector(Tc(e)))&&!f._p&&(g.instance=f,g.state.loading=5),zl.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},zl.set(e,n),f||T_(u,e,n,g.state))),t&&s===null)throw Error(c(528,""));return g}if(t&&s!==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=mr(n),n=ln(u).hoistableScripts,s=n.get(t),s||(s={type:"script",instance:null,count:0,state:null},n.set(t,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,e))}}function pr(e){return'href="'+Ln(e)+'"'}function Tc(e){return'link[rel="stylesheet"]['+e+"]"}function Rg(e){return j({},e,{"data-precedence":e.precedence,precedence:null})}function T_(e,t,n,s){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?s.loading=1:(t=e.createElement("link"),s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2}),In(t,"link",n),ft(t),e.head.appendChild(t))}function mr(e){return'[src="'+Ln(e)+'"]'}function Ec(e){return"script[async]"+e}function Mg(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+Ln(n.href)+'"]');if(s)return t.instance=s,ft(s),s;var u=j({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),ft(s),In(s,"style",u),co(s,n.precedence,e),t.instance=s;case"stylesheet":u=pr(n.href);var f=e.querySelector(Tc(u));if(f)return t.state.loading|=4,t.instance=f,ft(f),f;s=Rg(n),(u=zl.get(u))&&Bd(s,u),f=(e.ownerDocument||e).createElement("link"),ft(f);var g=f;return g._p=new Promise(function(S,C){g.onload=S,g.onerror=C}),In(f,"link",s),t.state.loading|=4,co(f,n.precedence,e),t.instance=f;case"script":return f=mr(n.src),(u=e.querySelector(Ec(f)))?(t.instance=u,ft(u),u):(s=n,(u=zl.get(f))&&(s=j({},n),qd(s,u)),e=e.ownerDocument||e,u=e.createElement("script"),ft(u),In(u,"link",s),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&&(s=t.instance,t.state.loading|=4,co(s,n.precedence,e));return t.instance}function co(e,t,n){for(var s=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=s.length?s[s.length-1]:null,f=u,g=0;g<s.length;g++){var S=s[g];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 Bd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function qd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var uo=null;function Og(e,t,n){if(uo===null){var s=new Map,u=uo=new Map;u.set(n,s)}else u=uo,s=u.get(n),s||(s=new Map,u.set(n,s));if(s.has(e))return s;for(s.set(e,null),n=n.getElementsByTagName(e),u=0;u<n.length;u++){var f=n[u];if(!(f[Fl]||f[Ft]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var g=f.getAttribute(t)||"";g=e+g;var S=s.get(g);S?S.push(f):s.set(g,[f])}}return s}function Dg(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function E_(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 zg(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function A_(e,t,n,s){if(n.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var u=pr(s.href),f=t.querySelector(Tc(u));if(f){t=f._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=oo.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=f,ft(f);return}f=t.ownerDocument||t,s=Rg(s),(u=zl.get(u))&&Bd(s,u),f=f.createElement("link"),ft(f);var g=f;g._p=new Promise(function(S,C){g.onload=S,g.onerror=C}),In(f,"link",s),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=oo.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Id=0;function C_(e,t){return e.stylesheets&&e.count===0&&ho(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var s=setTimeout(function(){if(e.stylesheets&&ho(e,e.stylesheets),e.unsuspend){var f=e.unsuspend;e.unsuspend=null,f()}},6e4+t);0<e.imgBytes&&Id===0&&(Id=62500*o_());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ho(e,e.stylesheets),e.unsuspend)){var f=e.unsuspend;e.unsuspend=null,f()}},(e.imgBytes>Id?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(u)}}:null}function oo(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ho(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var fo=null;function ho(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,fo=new Map,t.forEach(R_,e),fo=null,oo.call(e))}function R_(e,t){if(!(t.state.loading&4)){var n=fo.get(e);if(n)var s=n.get(null);else{n=new Map,fo.set(e,n);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<u.length;f++){var g=u[f];(g.nodeName==="LINK"||g.getAttribute("media")!=="not all")&&(n.set(g.dataset.precedence,g),s=g)}s&&n.set(null,s)}u=t.instance,g=u.getAttribute("data-precedence"),f=n.get(g)||s,f===s&&n.set(null,u),n.set(g,u),this.count++,s=oo.bind(this),u.addEventListener("load",s),u.addEventListener("error",s),f?f.parentNode.insertBefore(u,f.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),t.state.loading|=4}}var Ac={$$typeof:Z,Provider:null,Consumer:null,_currentValue:se,_currentValue2:se,_threadCount:0};function M_(e,t,n,s,u,f,g,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=Rt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Rt(0),this.hiddenUpdates=Rt(null),this.identifierPrefix=s,this.onUncaughtError=u,this.onCaughtError=f,this.onRecoverableError=g,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=C,this.incompleteTransitions=new Map}function Lg(e,t,n,s,u,f,g,S,C,X,ee,ie){return e=new M_(e,t,n,g,C,X,ee,ie,S),t=1,f===!0&&(t|=24),f=el(3,null,null,t),e.current=f,f.stateNode=e,t=_f(),t.refCount++,e.pooledCache=t,t.refCount++,f.memoizedState={element:s,isDehydrated:n,cache:t},kf(f),e}function Ug(e){return e?(e=Cl,e):Cl}function Hg(e,t,n,s,u,f){u=Ug(u),s.context===null?s.context=u:s.pendingContext=u,s=gs(t),s.payload={element:n},f=f===void 0?null:f,f!==null&&(s.callback=f),n=bs(e,s,t),n!==null&&(dl(n,e,t),rc(n,e,t))}function Bg(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Gd(e,t){Bg(e,t),(e=e.alternate)&&Bg(e,t)}function qg(e){if(e.tag===13||e.tag===31){var t=Al(e,67108864);t!==null&&dl(t,e,67108864),Gd(e,67108864)}}function Ig(e){if(e.tag===13||e.tag===31){var t=jl();t=Kl(t);var n=Al(e,t);n!==null&&dl(n,e,t),Gd(e,t)}}var po=!0;function O_(e,t,n,s){var u=U.T;U.T=null;var f=re.p;try{re.p=2,Yd(e,t,n,s)}finally{re.p=f,U.T=u}}function D_(e,t,n,s){var u=U.T;U.T=null;var f=re.p;try{re.p=8,Yd(e,t,n,s)}finally{re.p=f,U.T=u}}function Yd(e,t,n,s){if(po){var u=Xd(s);if(u===null)Ad(e,t,s,mo,n),Yg(e,s);else if(L_(u,e,t,n,s))s.stopPropagation();else if(Yg(e,s),t&4&&-1<z_.indexOf(e)){for(;u!==null;){var f=gl(u);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var g=xe(f.pendingLanes);if(g!==0){var S=f;for(S.pendingLanes|=2,S.entangledLanes|=2;g;){var C=1<<31-ot(g);S.entanglements[1]|=C,g&=~C}fa(f),(ht&6)===0&&(Ju=rt()+500,jc(0))}}break;case 31:case 13:S=Al(f,2),S!==null&&dl(S,f,2),Wu(),Gd(f,2)}if(f=Xd(s),f===null&&Ad(e,t,s,mo,n),f===u)break;u=f}u!==null&&s.stopPropagation()}else Ad(e,t,s,null,n)}}function Xd(e){return e=Yt(e),Vd(e)}var mo=null;function Vd(e){if(mo=null,e=Wl(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 mo=e,null}function Gg(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(wt()){case en:return 2;case En:return 8;case Ct:case kn:return 32;case An:return 268435456;default:return 32}default:return 32}}var $d=!1,Es=null,As=null,Cs=null,Cc=new Map,Rc=new Map,Rs=[],z_="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 Yg(e,t){switch(e){case"focusin":case"focusout":Es=null;break;case"dragenter":case"dragleave":As=null;break;case"mouseover":case"mouseout":Cs=null;break;case"pointerover":case"pointerout":Cc.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Rc.delete(t.pointerId)}}function Mc(e,t,n,s,u,f){return e===null||e.nativeEvent!==f?(e={blockedOn:t,domEventName:n,eventSystemFlags:s,nativeEvent:f,targetContainers:[u]},t!==null&&(t=gl(t),t!==null&&qg(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function L_(e,t,n,s,u){switch(t){case"focusin":return Es=Mc(Es,e,t,n,s,u),!0;case"dragenter":return As=Mc(As,e,t,n,s,u),!0;case"mouseover":return Cs=Mc(Cs,e,t,n,s,u),!0;case"pointerover":var f=u.pointerId;return Cc.set(f,Mc(Cc.get(f)||null,e,t,n,s,u)),!0;case"gotpointercapture":return f=u.pointerId,Rc.set(f,Mc(Rc.get(f)||null,e,t,n,s,u)),!0}return!1}function Xg(e){var t=Wl(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,ml(e.priority,function(){Ig(n)});return}}else if(t===31){if(t=p(n),t!==null){e.blockedOn=t,ml(e.priority,function(){Ig(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 go(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Xd(e.nativeEvent);if(n===null){n=e.nativeEvent;var s=new n.constructor(n.type,n);gn=s,n.target.dispatchEvent(s),gn=null}else return t=gl(n),t!==null&&qg(t),e.blockedOn=n,!1;t.shift()}return!0}function Vg(e,t,n){go(e)&&n.delete(t)}function U_(){$d=!1,Es!==null&&go(Es)&&(Es=null),As!==null&&go(As)&&(As=null),Cs!==null&&go(Cs)&&(Cs=null),Cc.forEach(Vg),Rc.forEach(Vg)}function bo(e,t){e.blockedOn===t&&(e.blockedOn=null,$d||($d=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,U_)))}var xo=null;function $g(e){xo!==e&&(xo=e,a.unstable_scheduleCallback(a.unstable_NormalPriority,function(){xo===e&&(xo=null);for(var t=0;t<e.length;t+=3){var n=e[t],s=e[t+1],u=e[t+2];if(typeof s!="function"){if(Vd(s||n)===null)continue;break}var f=gl(n);f!==null&&(e.splice(t,3),t-=3,Xf(f,{pending:!0,data:u,method:n.method,action:s},s,u))}}))}function gr(e){function t(C){return bo(C,e)}Es!==null&&bo(Es,e),As!==null&&bo(As,e),Cs!==null&&bo(Cs,e),Cc.forEach(t),Rc.forEach(t);for(var n=0;n<Rs.length;n++){var s=Rs[n];s.blockedOn===e&&(s.blockedOn=null)}for(;0<Rs.length&&(n=Rs[0],n.blockedOn===null);)Xg(n),n.blockedOn===null&&Rs.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(s=0;s<n.length;s+=3){var u=n[s],f=n[s+1],g=u[Ke]||null;if(typeof f=="function")g||$g(n);else if(g){var S=null;if(f&&f.hasAttribute("formAction")){if(u=f,g=f[Ke]||null)S=g.formAction;else if(Vd(u)!==null)continue}else S=g.action;typeof S=="function"?n[s+1]=S:(n.splice(s,3),s-=3),$g(n)}}}function Qg(){function e(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(g){return u=g})},focusReset:"manual",scroll:"manual"})}function t(){u!==null&&(u(),u=null),s||setTimeout(n,20)}function n(){if(!s&&!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 s=!1,u=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),u!==null&&(u(),u=null)}}}function Qd(e){this._internalRoot=e}yo.prototype.render=Qd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var n=t.current,s=jl();Hg(n,s,e,t,null,null)},yo.prototype.unmount=Qd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Hg(e.current,2,null,e,null,null),Wu(),t[Fn]=null}};function yo(e){this._internalRoot=e}yo.prototype.unstable_scheduleHydration=function(e){if(e){var t=ka();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Rs.length&&t!==0&&t<Rs[n].priority;n++);Rs.splice(n,0,e),n===0&&Xg(e)}};var Zg=l.version;if(Zg!=="19.2.8")throw Error(c(527,Zg,"19.2.8"));re.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(c(188)):(e=Object.keys(e).join(","),Error(c(268,e)));return e=x(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var H_={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:U,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var _o=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!_o.isDisabled&&_o.supportsFiber)try{Jt=_o.inject(H_),Tt=_o}catch{}}return Dc.createRoot=function(e,t){if(!o(e))throw Error(c(299));var n=!1,s="",u=tm,f=nm,g=lm;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(u=t.onUncaughtError),t.onCaughtError!==void 0&&(f=t.onCaughtError),t.onRecoverableError!==void 0&&(g=t.onRecoverableError)),t=Lg(e,1,!1,null,null,n,s,null,u,f,g,Qg),e[Fn]=t.current,Ed(e),new Qd(t)},Dc.hydrateRoot=function(e,t,n){if(!o(e))throw Error(c(299));var s=!1,u="",f=tm,g=nm,S=lm,C=null;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(u=n.identifierPrefix),n.onUncaughtError!==void 0&&(f=n.onUncaughtError),n.onCaughtError!==void 0&&(g=n.onCaughtError),n.onRecoverableError!==void 0&&(S=n.onRecoverableError),n.formState!==void 0&&(C=n.formState)),t=Lg(e,1,!0,t,n??null,s,u,C,f,g,S,Qg),t.context=Ug(null),n=t.current,s=jl(),s=Kl(s),u=gs(s),u.callback=null,bs(n,u,s),n=s,t.current.lanes=n,wl(t,n),fa(t),e[Fn]=t.current,Ed(e),new yo(t)},Dc.version="19.2.8",Dc}var sb;function J_(){if(sb)return Fd.exports;sb=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(l){console.error(l)}}return a(),Fd.exports=K_(),Fd.exports}var F_=J_();const wx=1;var Pa,Tr,Er,Ar,Cr,Jc,Rr,Vo,Tx;class W_{constructor(l){Zt(this,Vo);Zt(this,Pa,null);Zt(this,Tr,new Set);Zt(this,Er,500);Zt(this,Ar,null);Zt(this,Cr,!1);Zt(this,Jc,null);Zt(this,Rr,null);this.url=l}get statusText(){return this.connected?"Хост на связи":"Нет связи с хостом"}onStatus(l){pt(this,Rr,l)}connect(){if(He(this,Cr))return;const l=new WebSocket(this.url);pt(this,Pa,l),l.addEventListener("open",()=>{var i,c;pt(this,Er,500),this.send({type:"hello",protocol:wx,clientName:"ccv-web"}),(i=He(this,Jc))==null||i.call(this),(c=He(this,Rr))==null||c.call(this)}),l.addEventListener("message",i=>{let c;try{c=JSON.parse(String(i.data))}catch{return}for(const o of He(this,Tr))o(c)}),l.addEventListener("close",()=>{var i;pt(this,Pa,null),(i=He(this,Rr))==null||i.call(this),Sn(this,Vo,Tx).call(this)}),l.addEventListener("error",()=>l.close())}onReconnect(l){pt(this,Jc,l)}on(l){return He(this,Tr).add(l),()=>He(this,Tr).delete(l)}send(l){var i;((i=He(this,Pa))==null?void 0:i.readyState)===WebSocket.OPEN&&He(this,Pa).send(JSON.stringify(l))}get connected(){var l;return((l=He(this,Pa))==null?void 0:l.readyState)===WebSocket.OPEN}close(){var l;pt(this,Cr,!0),(l=He(this,Pa))==null||l.close()}}Pa=new WeakMap,Tr=new WeakMap,Er=new WeakMap,Ar=new WeakMap,Cr=new WeakMap,Jc=new WeakMap,Rr=new WeakMap,Vo=new WeakSet,Tx=function(){if(He(this,Cr)||He(this,Ar)!==null)return;const l=He(this,Er);pt(this,Er,Math.min(l*2,1e4)),pt(this,Ar,window.setTimeout(()=>{pt(this,Ar,null),this.connect()},l))};const P_=1,Ex="ccv:relay",Oo="ccv:relay.host";function e0(){try{const a=localStorage.getItem(Ex);if(!a)return null;const l=JSON.parse(a);return typeof(l==null?void 0:l.token)!="string"||typeof l.expiresAt=="number"&&l.expiresAt<=Date.now()?null:l}catch{return null}}function Ax(){localStorage.removeItem(Ex)}var ya,Mr,_a,Or,Dr,Bs,Ti,Ei,qs,Ai,zr,Ci,Ri,Ut,zs,_h,Cx,Ni,vh;class t0{constructor(l){Zt(this,Ut);Zt(this,ya,null);Zt(this,Mr,new Set);Zt(this,_a,null);Zt(this,Or,null);Zt(this,Dr,500);Zt(this,Bs,null);Zt(this,Ti,!1);Zt(this,Ei,!1);Zt(this,qs,!1);Zt(this,Ai,null);Zt(this,zr,"Подключаемся…");Zt(this,Ci,0);Zt(this,Ri,[]);this.session=l}get connected(){return He(this,Ei)&&He(this,qs)}get statusText(){return He(this,zr)}get hostId(){return He(this,Ai)}on(l){return He(this,Mr).add(l),()=>He(this,Mr).delete(l)}onReconnect(l){pt(this,Or,l)}onStatus(l){pt(this,_a,l)}connect(){He(this,Ti)||Sn(this,Ut,_h).call(this)}send(l){if(!He(this,Ei)){He(this,Ri).length<64&&He(this,Ri).push(l);return}Sn(this,Ut,Ni).call(this,{t:"client.frame",body:l})}close(){var l;pt(this,Ti,!0),He(this,Bs)!==null&&window.clearTimeout(He(this,Bs)),(l=He(this,ya))==null||l.close()}}ya=new WeakMap,Mr=new WeakMap,_a=new WeakMap,Or=new WeakMap,Dr=new WeakMap,Bs=new WeakMap,Ti=new WeakMap,Ei=new WeakMap,qs=new WeakMap,Ai=new WeakMap,zr=new WeakMap,Ci=new WeakMap,Ri=new WeakMap,Ut=new WeakSet,zs=function(l){var i;He(this,zr)!==l&&(pt(this,zr,l),(i=He(this,_a))==null||i.call(this))},_h=async function(){if(He(this,ya))return;if(!He(this,Ai))try{pt(this,Ai,await n0(this.session.token))}catch(c){Sn(this,Ut,zs).call(this,c instanceof Error?c.message:String(c)),Sn(this,Ut,vh).call(this);return}const l=location.protocol==="https:"?"wss":"ws",i=new WebSocket(`${l}://${location.host}/relay/client`);pt(this,ya,i),i.addEventListener("open",()=>{Sn(this,Ut,Ni).call(this,{t:"client.hello",protocol:P_,token:this.session.token})}),i.addEventListener("message",c=>{let o;try{o=JSON.parse(String(c.data))}catch{return}Sn(this,Ut,Cx).call(this,o)}),i.addEventListener("close",()=>{var c;pt(this,ya,null),pt(this,Ei,!1),pt(this,qs,!1),Sn(this,Ut,zs).call(this,"Нет связи с сервером"),(c=He(this,_a))==null||c.call(this),Sn(this,Ut,vh).call(this)}),i.addEventListener("error",()=>i.close())},Cx=function(l){var i,c,o,d,h,p,m;switch(l.t){case"client.ok":pt(this,Dr,500),Sn(this,Ut,Ni).call(this,{t:"client.attach",hostId:He(this,Ai)??"",...He(this,Ci)>0?{sinceRseq:He(this,Ci)}:{}});return;case"client.attached":pt(this,Ei,!0),pt(this,qs,l.online),pt(this,Ci,l.rseq),Sn(this,Ut,zs).call(this,l.online?"Хост на связи":"Компьютер не на связи"),Sn(this,Ut,Ni).call(this,{t:"client.frame",body:{type:"hello",protocol:wx,clientName:"ccv-web-relay"}});const x=He(this,Ri);pt(this,Ri,[]);for(const y of x)Sn(this,Ut,Ni).call(this,{t:"client.frame",body:y});(i=He(this,Or))==null||i.call(this),(c=He(this,_a))==null||c.call(this);return;case"host.frame":{l.rseq>0&&pt(this,Ci,l.rseq);const y=l.body;for(const j of He(this,Mr))j(y);return}case"host.online":pt(this,qs,!0),Sn(this,Ut,zs).call(this,"Хост на связи"),(o=He(this,Or))==null||o.call(this),(d=He(this,_a))==null||d.call(this);return;case"host.offline":pt(this,qs,!1),Sn(this,Ut,zs).call(this,"Компьютер не на связи"),(h=He(this,_a))==null||h.call(this);return;case"ping":Sn(this,Ut,Ni).call(this,{t:"pong",nonce:l.nonce});return;case"error":if(l.code==="auth"){Ax(),location.href="/login";return}if(l.code==="not_found"){localStorage.removeItem(Oo),Sn(this,Ut,zs).call(this,"Этот компьютер отвязан от аккаунта"),pt(this,Ti,!0),(p=He(this,ya))==null||p.close();return}l.code!=="offline"&&Sn(this,Ut,zs).call(this,l.message),(m=He(this,_a))==null||m.call(this);return}},Ni=function(l){var i;((i=He(this,ya))==null?void 0:i.readyState)===WebSocket.OPEN&&He(this,ya).send(JSON.stringify(l))},vh=function(){if(He(this,Ti)||He(this,Bs)!==null)return;const l=He(this,Dr);pt(this,Dr,Math.min(l*2,1e4)),pt(this,Bs,window.setTimeout(()=>{pt(this,Bs,null),Sn(this,Ut,_h).call(this)},l))};async function n0(a){const l=new URLSearchParams(location.search).get("host");if(l)return localStorage.setItem(Oo,l),l;const i=localStorage.getItem(Oo);if(i)return i;const c=await fetch("/api/hosts",{headers:{authorization:`Bearer ${a}`}});if(c.status===401)throw Ax(),location.href="/login",new Error("нужен вход");const d=(await c.json()).hosts??[];if(d.length===1&&d[0])return localStorage.setItem(Oo,d[0].id),d[0].id;throw location.href="/hosts",new Error("выберите компьютер")}function Do(){return location.pathname==="/app"||location.pathname.startsWith("/app/")?"relay":"local"}const l0=`${location.protocol==="https:"?"wss":"ws"}://${location.host}/ws`;function a0(){if(Do()==="local")return new W_(l0);const a=e0();return a?new t0(a):(location.replace(`/login?next=${encodeURIComponent(location.pathname+location.search)}`),null)}const hl={items:[],pending:[],lastSeq:0,contextTokens:null},th={entries:[],total:0,loading:!1};function Rx(a){var l;return((l=a.entries[0])==null?void 0:l.seq)??1}function ib(a){return a.total>0&&Rx(a)>1}function s0(a,l){const i=new Set(a.entries.map(o=>o.seq));return{entries:[...a.entries,...l.entries.filter(o=>!i.has(o.seq))].sort((o,d)=>o.seq-d.seq),total:l.total,loading:!1}}function i0(a){return zo(hl,a).items.map(l=>({...l,id:`h:${l.id}`}))}function zo(a,l){let i=a;for(const c of l)c.seq<=i.lastSeq||(i={...r0(i,c.event,c.seq),lastSeq:c.seq});return i}function r0(a,l,i){var o,d;const c=a.items;switch(l.kind){case"user.message":return da(a,{id:`u${i}`,kind:"user",text:l.text,images:l.images});case"assistant.delta":{const h=c.findIndex(m=>m.id===l.blockId);if(h===-1)return da(a,{id:l.blockId,kind:"assistant",text:l.text,streaming:!0});const p=c[h];return br(a,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?da(a,p):br(a,h,p)}case"thinking.delta":{const h=c.findIndex(m=>m.id===l.blockId);if(h===-1)return da(a,{id:l.blockId,kind:"thinking",text:l.text});const p=c[h];return br(a,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?da(a,p):br(a,h,p)}case"tool.use":return da(a,{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 a;const p=c[h];return br(a,h,{...p,result:l.content,isError:l.isError,awaitingPermission:!1})}case"permission.request":return{...a,pending:[...a.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=a.pending.find(m=>m.requestId===l.requestId),p=a.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 br({...a,pending:p},m,{...x,answers:l.answers})}}return l.decision==="allow"?{...a,pending:p}:da({...a,pending:p},{id:`p${i}`,kind:"notice",tone:"info",text:`Отклонено${l.reason?`: ${l.reason}`:""}`})}case"result":{const h=a.items.map(m=>m.kind==="assistant"&&m.streaming?{...m,streaming:!1}:m),p=l.contextTokens??a.contextTokens;return da({...a,items:h,contextTokens:p},{id:`r${i}`,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"?a:da(a,{id:`s${i}`,kind:"notice",tone:"info",text:"Контекст сжат"});case"error":return da(a,{id:`e${i}`,kind:"notice",tone:"error",text:l.message});case"state":return a;case"rewound":return a;default:return a}}function c0(a,l){let i=0;for(let c=0;c<a.length;c++)if(a[c].event.kind==="user.message"){if(i===l)return a.slice(0,c);i++}return a}function u0(a,l,i){const c=l-i;if(c<=0)return[];let o=0;for(let d=0;d<a.length;d++)if(a[d].kind==="user"){if(o===c)return a.slice(0,d);o++}return a}function da(a,l){return{...a,items:[...a.items,l]}}function br(a,l,i){const c=a.items.slice();return c[l]=i,{...a,items:c}}const Sh="ccv:theme",nh=["system","light","dark"];function o0(){const[a,l]=_.useState(f0);_.useEffect(()=>{const o=window.matchMedia("(prefers-color-scheme: dark)"),d=()=>{const h=a==="dark"||a==="system"&&o.matches;document.documentElement.dataset.theme=h?"dark":"light"};return d(),o.addEventListener("change",d),()=>o.removeEventListener("change",d)},[a]);const i=_.useCallback(o=>{try{localStorage.setItem(Sh,o)}catch{}l(o)},[]),c=_.useCallback(()=>{l(o=>{const d=nh[(nh.indexOf(o)+1)%nh.length];try{localStorage.setItem(Sh,d)}catch{}return d})},[]);return[a,i,c]}function f0(){try{const a=localStorage.getItem(Sh);if(a==="light"||a==="dark"||a==="system")return a}catch{}return"system"}const Mx=[{value:"default",hint:"спрашивать перед каждым действием"},{value:"acceptEdits",hint:"правки файлов без подтверждения"},{value:"plan",hint:"только чтение и план, без изменений"},{value:"auto",hint:"спрашивать только о рискованном — решает сам"},{value:"bypassPermissions",hint:"ничего не спрашивать"}],Mi={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:"вопроса"}},d0=320,Ox="ccv:panes";function h0(a){return`--${a}-w`}function Dx(a,l){const i=Mi[a];return Math.round(Math.min(i.max,Math.max(i.min,l)))}function p0(){const a={};for(const l of Object.keys(Mi))a[l]=Mi[l].width;try{const l=localStorage.getItem(Ox);if(l){const i=JSON.parse(l);for(const c of Object.keys(Mi)){const o=i[c];typeof o=="number"&&Number.isFinite(o)&&(a[c]=Dx(c,o))}}}catch{}return a}function m0(){const[a,l]=_.useState(p0),i=_.useCallback(h=>{try{localStorage.setItem(Ox,JSON.stringify(h))}catch{}},[]),c=_.useCallback((h,p)=>{l(m=>{const x=Dx(h,p);if(m[h]===x)return m;const y={...m,[h]:x};return i(y),y})},[i]),o=_.useCallback(h=>{l(p=>{const m={...p,[h]:Mi[h].width};return i(m),m})},[i]),d={};for(const h of Object.keys(Mi))d[h0(h)]=`${a[h]}px`;return{widths:a,style:d,setWidth:c,reset:o}}const lh=260,zx=120,g0=200,rb="ccv:terminal-h";function cb(a,l){return Math.round(Math.min(l,Math.max(zx,a)))}function b0(){const[a,l]=_.useState(()=>{try{const d=localStorage.getItem(rb);if(d){const h=Number(d);if(Number.isFinite(h))return cb(h,1/0)}}catch{}return lh}),i=_.useCallback(d=>{try{localStorage.setItem(rb,String(d))}catch{}},[]),c=_.useCallback((d,h)=>{const p=cb(d,h);l(m=>m===p?m:(i(p),p))},[i]),o=_.useCallback(()=>{l(lh),i(lh)},[i]);return{height:a,setHeight:c,reset:o}}function $o(a){const[l,i]=_.useState(()=>typeof window>"u"?!1:window.matchMedia(a).matches);return _.useEffect(()=>{const c=window.matchMedia(a),o=()=>i(c.matches);return o(),c.addEventListener("change",o),()=>c.removeEventListener("change",o)},[a]),l}const x0={height:0,offsetTop:0,offsetLeft:0};function ub(){if(typeof window>"u")return x0;const a=window.visualViewport;return a?{height:a.height,offsetTop:a.offsetTop,offsetLeft:a.offsetLeft}:{height:window.innerHeight,offsetTop:0,offsetLeft:0}}function y0(a){const[l,i]=_.useState(ub);return _.useEffect(()=>{if(!a)return;const c=window.visualViewport,o=()=>{const d=ub();i(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))},[a]),l}function zh(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Li=zh();function Lx(a){Li=a}var wi={exec:()=>null};function xr(a){let l=[];return i=>{let c=Math.max(0,Math.min(3,i-1)),o=l[c];return o||(o=a(c),l[c]=o),o}}function at(a,l=""){let i=typeof a=="string"?a:a.source,c={replace:(o,d)=>{let h=typeof d=="string"?d:d.source;return h=h.replace(Zn.caret,"$1"),i=i.replace(o,h),c},getRegex:()=>new RegExp(i,l)};return c}var _0=((a="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+a)}catch{return!1}})(),Zn={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:a=>new RegExp(`^( {0,3}${a})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:xr(a=>new RegExp(`^ {0,${a}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:xr(a=>new RegExp(`^ {0,${a}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:xr(a=>new RegExp(`^ {0,${a}}(?:\`\`\`|~~~)`)),headingBeginRegex:xr(a=>new RegExp(`^ {0,${a}}#`)),htmlBeginRegex:xr(a=>new RegExp(`^ {0,${a}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:xr(a=>new RegExp(`^ {0,${a}}>`))},v0=/^(?:[ \t]*(?:\n|$))+/,S0=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,j0=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Fc=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,k0=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Lh=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Ux=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Hx=at(Ux).replace(/bull/g,Lh).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(),N0=at(Ux).replace(/bull/g,Lh).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(),Uh=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,w0=/^[^\n]+/,Hh=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,T0=at(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Hh).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),E0=at(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Lh).getRegex(),Qo="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",Bh=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,A0=at("^ {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",Bh).replace("tag",Qo).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Bx=a=>at(Uh).replace("hr",Fc).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",a).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Qo).getRegex(),C0=Bx(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),R0=Bx(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),M0=at(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",R0).getRegex(),qh={blockquote:M0,code:S0,def:T0,fences:j0,heading:k0,hr:Fc,html:A0,lheading:Hx,list:E0,newline:v0,paragraph:C0,table:wi,text:w0},ob=at("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Fc).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",Qo).getRegex(),O0={...qh,lheading:N0,table:ob,paragraph:at(Uh).replace("hr",Fc).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ob).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",Qo).getRegex()},D0={...qh,html:at(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Bh).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:wi,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:at(Uh).replace("hr",Fc).replace("heading",` *#{1,6} *[^
51
- ]`).replace("lheading",Hx).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},z0=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,L0=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,qx=/^( {2,}|\\)\n(?!\s*$)/,U0=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Ur=/[\p{P}\p{S}]/u,Zo=/[\s\p{P}\p{S}]/u,Ih=/[^\s\p{P}\p{S}]/u,H0=at(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Zo).getRegex(),Ix=/(?!~)[\p{P}\p{S}]/u,B0=/(?!~)[\s\p{P}\p{S}]/u,q0=/(?:[^\s\p{P}\p{S}]|~)/u,I0=at(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",_0?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Gx=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,G0=at(Gx,"u").replace(/punct/g,Ur).getRegex(),Y0=at(Gx,"u").replace(/punct/g,Ix).getRegex(),Yx="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",X0=at(Yx,"gu").replace(/notPunctSpace/g,Ih).replace(/punctSpace/g,Zo).replace(/punct/g,Ur).getRegex(),V0=at(Yx,"gu").replace(/notPunctSpace/g,q0).replace(/punctSpace/g,B0).replace(/punct/g,Ix).getRegex(),$0=at("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ih).replace(/punctSpace/g,Zo).replace(/punct/g,Ur).getRegex(),Q0=at(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Ur).getRegex(),Z0="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",K0=at(Z0,"gu").replace(/notPunctSpace/g,Ih).replace(/punctSpace/g,Zo).replace(/punct/g,Ur).getRegex(),J0=at(/\\(punct)/,"gu").replace(/punct/g,Ur).getRegex(),F0=at(/^<(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(),W0=at(Bh).replace("(?:-->|$)","-->").getRegex(),P0=at("^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",W0).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Uo=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,ev=at(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Uo).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Xx=at(/^!?\[(label)\]\[(ref)\]/).replace("label",Uo).replace("ref",Hh).getRegex(),Vx=at(/^!?\[(ref)\](?:\[\])?/).replace("ref",Hh).getRegex(),tv=at("reflink|nolink(?!\\()","g").replace("reflink",Xx).replace("nolink",Vx).getRegex(),fb=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Gh={_backpedal:wi,anyPunctuation:J0,autolink:F0,blockSkip:I0,br:qx,code:L0,del:wi,delLDelim:wi,delRDelim:wi,emStrongLDelim:G0,emStrongRDelimAst:X0,emStrongRDelimUnd:$0,escape:z0,link:ev,nolink:Vx,punctuation:H0,reflink:Xx,reflinkSearch:tv,tag:P0,text:U0,url:wi},nv={...Gh,link:at(/^!?\[(label)\]\((.*?)\)/).replace("label",Uo).getRegex(),reflink:at(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Uo).getRegex()},jh={...Gh,emStrongRDelimAst:V0,emStrongLDelim:Y0,delLDelim:Q0,delRDelim:K0,url:at(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",fb).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:at(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",fb).getRegex()},lv={...jh,br:at(qx).replace("{2,}","*").getRegex(),text:at(jh.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},vo={normal:qh,gfm:O0,pedantic:D0},zc={normal:Gh,gfm:jh,breaks:lv,pedantic:nv},av={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},db=a=>av[a];function ga(a,l){if(l){if(Zn.escapeTest.test(a))return a.replace(Zn.escapeReplace,db)}else if(Zn.escapeTestNoEncode.test(a))return a.replace(Zn.escapeReplaceNoEncode,db);return a}function hb(a){try{a=encodeURI(a).replace(Zn.percentDecode,"%")}catch{return null}return a}function pb(a,l){var d;let i=a.replace(Zn.findPipe,(h,p,m)=>{let x=!1,y=p;for(;--y>=0&&m[y]==="\\";)x=!x;return x?"|":" |"}),c=i.split(Zn.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(Zn.slashPipe,"|");return c}function Os(a,l,i){let c=a.length;if(c===0)return"";let o=0;for(;o<c&&a.charAt(c-o-1)===l;)o++;return a.slice(0,c-o)}function mb(a){let l=a.split(`
52
- `),i=l.length-1;for(;i>=0&&Zn.blankLine.test(l[i]);)i--;return l.length-i<=2?a:l.slice(0,i+1).join(`
53
- `)}function sv(a,l){if(a.indexOf(l[1])===-1)return-1;let i=0;for(let c=0;c<a.length;c++)if(a[c]==="\\")c++;else if(a[c]===l[0])i++;else if(a[c]===l[1]&&(i--,i<0))return c;return i>0?-2:-1}function iv(a,l=0){let i=l,c="";for(let o of a)if(o===" "){let d=4-i%4;c+=" ".repeat(d),i+=d}else c+=o,i++;return c}function gb(a,l,i,c,o){let d=l.href,h=l.title||null,p=a[1].replace(o.other.outputLinkReplace,"$1");c.state.inLink=!0;let m={type:a[0].charAt(0)==="!"?"image":"link",raw:i,href:d,title:h,text:p,tokens:c.inlineTokens(p)};return c.state.inLink=!1,m}function rv(a,l,i){let c=a.match(i.other.indentCodeCompensation);if(c===null)return l;let o=c[1];return l.split(`
54
- `).map(d=>{let h=d.match(i.other.beginningSpace);if(h===null)return d;let[p]=h;return p.length>=o.length?d.slice(o.length):d}).join(`
55
- `)}var Ho=class{constructor(a){Nt(this,"options");Nt(this,"rules");Nt(this,"lexer");this.options=a||Li}space(a){let l=this.rules.block.newline.exec(a);if(l&&l[0].length>0)return{type:"space",raw:l[0]}}code(a){let l=this.rules.block.code.exec(a);if(l){let i=this.options.pedantic?l[0]:mb(l[0]),c=i.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:i,codeBlockStyle:"indented",text:c}}}fences(a){let l=this.rules.block.fences.exec(a);if(l){let i=l[0],c=rv(i,l[3]||"",this.rules);return{type:"code",raw:i,lang:l[2]?l[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):l[2],text:c}}}heading(a){let l=this.rules.block.heading.exec(a);if(l){let i=l[2].trim();if(this.rules.other.endingHash.test(i)){let c=Os(i,"#");(this.options.pedantic||!c||this.rules.other.endingSpaceChar.test(c))&&(i=c.trim())}return{type:"heading",raw:Os(l[0],`
56
- `),depth:l[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(a){let l=this.rules.block.hr.exec(a);if(l)return{type:"hr",raw:Os(l[0],`
57
- `)}}blockquote(a){let l=this.rules.block.blockquote.exec(a);if(l){let i=Os(l[0],`
58
- `).split(`
59
- `),c="",o="",d=[];for(;i.length>0;){let h=!1,p=[],m;for(m=0;m<i.length;m++)if(this.rules.other.blockquoteStart.test(i[m]))p.push(i[m]),h=!0;else if(!h)p.push(i[m]);else break;i=i.slice(m);let x=p.join(`
60
- `),y=x.replace(this.rules.other.blockquoteSetextReplace,`
61
- $1`).replace(this.rules.other.blockquoteSetextReplace2,"");c=c?`${c}
62
- ${x}`:x,o=o?`${o}
63
- ${y}`:y;let j=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(y,d,!0),this.lexer.state.top=j,i.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 R=v,T=R.raw+`
64
- `+i.join(`
65
- `),L=this.blockquote(T);d[d.length-1]=L,c=c.substring(0,c.length-R.raw.length)+L.raw,o=o.substring(0,o.length-R.text.length)+L.text;break}else if((v==null?void 0:v.type)==="list"){let R=v,T=R.raw+`
66
- `+i.join(`
67
- `),L=this.list(T);d[d.length-1]=L,c=c.substring(0,c.length-v.raw.length)+L.raw,o=o.substring(0,o.length-R.raw.length)+L.raw,i=T.substring(d.at(-1).raw.length).split(`
68
- `);continue}}return{type:"blockquote",raw:c,tokens:d,text:o}}}list(a){let l=this.rules.block.list.exec(a);if(l){let i=l[1].trim(),c=i.length>1,o={type:"list",raw:"",ordered:c,start:c?+i.slice(0,-1):"",loose:!1,items:[]};i=c?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=c?i:"[*+-]");let d=this.rules.other.listItemRegex(i),h=!1;for(;a;){let m=!1,x="",y="";if(!(l=d.exec(a))||this.rules.block.hr.test(a))break;x=l[0],a=a.substring(x.length);let j=iv(l[2].split(`
69
- `,1)[0],l[1].length),v=a.split(`
70
- `,1)[0],R=!j.trim(),T=0;if(this.options.pedantic?(T=2,y=j.trimStart()):R?T=l[1].length+1:(T=j.search(this.rules.other.nonSpaceChar),T=T>4?1:T,y=j.slice(T),T+=l[1].length),R&&this.rules.other.blankLine.test(v)&&(x+=v+`
71
- `,a=a.substring(v.length+1),m=!0),!m){let L=this.rules.other.nextBulletRegex(T),B=this.rules.other.hrRegex(T),P=this.rules.other.fencesBeginRegex(T),M=this.rules.other.headingBeginRegex(T),Z=this.rules.other.htmlBeginRegex(T),N=this.rules.other.blockquoteBeginRegex(T);for(;a;){let K=a.split(`
72
- `,1)[0],z;if(v=K,this.options.pedantic?(v=v.replace(this.rules.other.listReplaceNesting," "),z=v):z=v.replace(this.rules.other.tabCharGlobal," "),P.test(v)||M.test(v)||Z.test(v)||N.test(v)||L.test(v)||B.test(v))break;if(z.search(this.rules.other.nonSpaceChar)>=T||!v.trim())y+=`
73
- `+z.slice(T);else{if(R||j.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||P.test(j)||M.test(j)||B.test(j))break;y+=`
74
- `+v}R=!v.trim(),x+=K+`
75
- `,a=a.substring(K.length+1),j=z.slice(T)}}o.loose||(h?o.loose=!0:this.rules.other.doubleBlankLine.test(x)&&(h=!0)),o.items.push({type:"list_item",raw:x,task:!!this.options.gfm&&this.rules.other.listIsTask.test(y),loose:!1,text:y,tokens:[]}),o.raw+=x}let 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 y=this.rules.other.listTaskCheckbox.exec(m.raw);if(y){let j={type:"checkbox",raw:y[0]+" ",checked:y[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 y=m.tokens.filter(v=>v.type==="space"),j=y.length>0&&y.some(v=>this.rules.other.anyLine.test(v.raw));o.loose=j}}if(o.loose)for(let m of o.items){m.loose=!0;for(let x of m.tokens)x.type==="text"&&(x.type="paragraph")}return o}}html(a){let l=this.rules.block.html.exec(a);if(l){let i=mb(l[0]);return{type:"html",block:!0,raw:i,pre:l[1]==="pre"||l[1]==="script"||l[1]==="style",text:i}}}def(a){let l=this.rules.block.def.exec(a);if(l){let i=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:i,raw:Os(l[0],`
76
- `),href:c,title:o}}}table(a){var h;let l=this.rules.block.table.exec(a);if(!l||!this.rules.other.tableDelimiter.test(l[2]))return;let i=pb(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:Os(l[0],`
78
- `),header:[],align:[],rows:[]};if(i.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<i.length;p++)d.header.push({text:i[p],tokens:this.lexer.inline(i[p]),header:!0,align:d.align[p]});for(let p of o)d.rows.push(pb(p,d.header.length).map((m,x)=>({text:m,tokens:this.lexer.inline(m),header:!1,align:d.align[x]})));return d}}lheading(a){let l=this.rules.block.lheading.exec(a);if(l){let i=l[1].trim();return{type:"heading",raw:Os(l[0],`
79
- `),depth:l[2].charAt(0)==="="?1:2,text:i,tokens:this.lexer.inline(i)}}}paragraph(a){let l=this.rules.block.paragraph.exec(a);if(l){let i=l[1].charAt(l[1].length-1)===`
80
- `?l[1].slice(0,-1):l[1];return{type:"paragraph",raw:l[0],text:i,tokens:this.lexer.inline(i)}}}text(a){let l=this.rules.block.text.exec(a);if(l)return{type:"text",raw:l[0],text:l[0],tokens:this.lexer.inline(l[0])}}escape(a){let l=this.rules.inline.escape.exec(a);if(l)return{type:"escape",raw:l[0],text:l[1]}}tag(a){let l=this.rules.inline.tag.exec(a);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(a){let l=this.rules.inline.link.exec(a);if(l){let i=l[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(i)){if(!this.rules.other.endAngleBracket.test(i))return;let d=Os(i.slice(0,-1),"\\");if((i.length-d.length)%2===0)return}else{let d=sv(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(i)?c=c.slice(1):c=c.slice(1,-1)),gb(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(a,l){let i;if((i=this.rules.inline.reflink.exec(a))||(i=this.rules.inline.nolink.exec(a))){let c=(i[2]||i[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=l[c.toLowerCase()];if(!o){let d=i[0].charAt(0);return{type:"text",raw:d,text:d}}return gb(i,o,i[0],this.lexer,this.rules)}}emStrong(a,l,i=""){let c=this.rules.inline.emStrongLDelim.exec(a);if(!(!c||!c[1]&&!c[2]&&!c[3]&&!c[4]||c[4]&&i.match(this.rules.other.unicodeAlphaNumeric))&&(!(c[1]||c[3])||!i||this.rules.inline.punctuation.exec(i))){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*a.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 y=[...c[0]][0].length,j=a.slice(0,o+c.index+y+h);if(Math.min(o,h)%2){let R=j.slice(1,-1);return{type:"em",raw:j,text:R,tokens:this.lexer.inlineTokens(R)}}let v=j.slice(2,-2);return{type:"strong",raw:j,text:v,tokens:this.lexer.inlineTokens(v)}}}}codespan(a){let l=this.rules.inline.code.exec(a);if(l){let i=l[2].replace(this.rules.other.newLineCharGlobal," "),c=this.rules.other.nonSpaceChar.test(i),o=this.rules.other.startingSpaceChar.test(i)&&this.rules.other.endingSpaceChar.test(i);return c&&o&&(i=i.substring(1,i.length-1)),{type:"codespan",raw:l[0],text:i}}}br(a){let l=this.rules.inline.br.exec(a);if(l)return{type:"br",raw:l[0]}}del(a,l,i=""){let c=this.rules.inline.delLDelim.exec(a);if(c&&(!c[1]||!i||this.rules.inline.punctuation.exec(i))){let o=[...c[0]].length-1,d,h,p=o,m=this.rules.inline.delRDelim;for(m.lastIndex=0,l=l.slice(-1*a.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,y=a.slice(0,o+c.index+x+h),j=y.slice(o,-o);return{type:"del",raw:y,text:j,tokens:this.lexer.inlineTokens(j)}}}}autolink(a){let l=this.rules.inline.autolink.exec(a);if(l){let i,c;return l[2]==="@"?(i=l[1],c="mailto:"+i):(i=l[1],c=i),{type:"link",raw:l[0],text:i,href:c,tokens:[{type:"text",raw:i,text:i}]}}}url(a){var i;let l;if(l=this.rules.inline.url.exec(a)){let c,o;if(l[2]==="@")c=l[0],o="mailto:"+c;else{let d;do d=l[0],l[0]=((i=this.rules.inline._backpedal.exec(l[0]))==null?void 0:i[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(a){let l=this.rules.inline.text.exec(a);if(l){let i=this.lexer.state.inRawBlock;return{type:"text",raw:l[0],text:l[0],escaped:i}}}},$l=class kh{constructor(l){Nt(this,"tokens");Nt(this,"options");Nt(this,"state");Nt(this,"inlineQueue");Nt(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=l||Li,this.options.tokenizer=this.options.tokenizer||new Ho,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 i={other:Zn,block:vo.normal,inline:zc.normal};this.options.pedantic?(i.block=vo.pedantic,i.inline=zc.pedantic):this.options.gfm&&(i.block=vo.gfm,this.options.breaks?i.inline=zc.breaks:i.inline=zc.gfm),this.tokenizer.rules=i}static get rules(){return{block:vo,inline:zc}}static lex(l,i){return new kh(i).lex(l)}static lexInline(l,i){return new kh(i).inlineTokens(l)}lex(l){l=l.replace(Zn.carriageReturn,`
81
- `),this.blockTokens(l,this.tokens);for(let i=0;i<this.inlineQueue.length;i++){let c=this.inlineQueue[i];this.inlineTokens(c.src,c.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(l,i=[],c=!1){var d,h,p;this.tokenizer.lexer=this,this.options.pedantic&&(l=l.replace(Zn.tabCharGlobal," ").replace(Zn.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(y=>(m=y.call({lexer:this},l,i))?(l=l.substring(m.raw.length),i.push(m),!0):!1))continue;if(m=this.tokenizer.space(l)){l=l.substring(m.raw.length);let y=i.at(-1);m.raw.length===1&&y!==void 0?y.raw+=`
82
- `:i.push(m);continue}if(m=this.tokenizer.code(l)){l=l.substring(m.raw.length);let y=i.at(-1);(y==null?void 0:y.type)==="paragraph"||(y==null?void 0:y.type)==="text"?(y.raw+=(y.raw.endsWith(`
83
- `)?"":`
84
- `)+m.raw,y.text+=`
85
- `+m.text,this.inlineQueue.at(-1).src=y.text):i.push(m);continue}if(m=this.tokenizer.fences(l)){l=l.substring(m.raw.length),i.push(m);continue}if(m=this.tokenizer.heading(l)){l=l.substring(m.raw.length),i.push(m);continue}if(m=this.tokenizer.hr(l)){l=l.substring(m.raw.length),i.push(m);continue}if(m=this.tokenizer.blockquote(l)){l=l.substring(m.raw.length),i.push(m);continue}if(m=this.tokenizer.list(l)){l=l.substring(m.raw.length),i.push(m);continue}if(m=this.tokenizer.html(l)){l=l.substring(m.raw.length),i.push(m);continue}if(m=this.tokenizer.def(l)){l=l.substring(m.raw.length);let y=i.at(-1);(y==null?void 0:y.type)==="paragraph"||(y==null?void 0:y.type)==="text"?(y.raw+=(y.raw.endsWith(`
86
- `)?"":`
87
- `)+m.raw,y.text+=`
88
- `+m.raw,this.inlineQueue.at(-1).src=y.text):this.tokens.links[m.tag]||(this.tokens.links[m.tag]={href:m.href,title:m.title},i.push(m));continue}if(m=this.tokenizer.table(l)){l=l.substring(m.raw.length),i.push(m);continue}if(m=this.tokenizer.lheading(l)){l=l.substring(m.raw.length),i.push(m);continue}let x=l;if((p=this.options.extensions)!=null&&p.startBlock){let y=1/0,j=l.slice(1),v;this.options.extensions.startBlock.forEach(R=>{v=R.call({lexer:this},j),typeof v=="number"&&v>=0&&(y=Math.min(y,v))}),y<1/0&&y>=0&&(x=l.substring(0,y+1))}if(this.state.top&&(m=this.tokenizer.paragraph(x))){let y=i.at(-1);c&&(y==null?void 0:y.type)==="paragraph"?(y.raw+=(y.raw.endsWith(`
89
- `)?"":`
90
- `)+m.raw,y.text+=`
91
- `+m.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=y.text):i.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 y=i.at(-1);(y==null?void 0:y.type)==="text"?(y.raw+=(y.raw.endsWith(`
92
- `)?"":`
93
- `)+m.raw,y.text+=`
94
- `+m.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=y.text):i.push(m);continue}if(l){this.infiniteLoopError(l.charCodeAt(0));break}}return this.state.top=!0,i}inline(l,i=[]){return this.inlineQueue.push({src:l,tokens:i}),i}inlineTokens(l,i=[]){var p,m,x,y,j;this.tokenizer.lexer=this;let c=l;if(this.tokens.links){let v=Object.keys(this.tokens.links);v.length>0&&(c=c.replace(this.tokenizer.rules.inline.reflinkSearch,R=>v.includes(R.slice(R.lastIndexOf("[")+1,-1))?"["+"a".repeat(R.length-2)+"]":R))}c=c.replace(this.tokenizer.rules.inline.anyPunctuation,"++"),c=c.replace(this.tokenizer.rules.inline.blockSkip,(v,R,T)=>{let L=T?T.length:0;return v.slice(0,L)+"["+"a".repeat(v.length-L-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((y=(x=this.options.extensions)==null?void 0:x.inline)!=null&&y.some(T=>(v=T.call({lexer:this},l,i))?(l=l.substring(v.raw.length),i.push(v),!0):!1))continue;if(v=this.tokenizer.escape(l)){l=l.substring(v.raw.length),i.push(v);continue}if(v=this.tokenizer.tag(l)){l=l.substring(v.raw.length),i.push(v);continue}if(v=this.tokenizer.link(l)){l=l.substring(v.raw.length),i.push(v);continue}if(v=this.tokenizer.reflink(l,this.tokens.links)){l=l.substring(v.raw.length);let T=i.at(-1);v.type==="text"&&(T==null?void 0:T.type)==="text"?(T.raw+=v.raw,T.text+=v.text):i.push(v);continue}if(v=this.tokenizer.emStrong(l,c,d)){l=l.substring(v.raw.length),i.push(v);continue}if(v=this.tokenizer.codespan(l)){l=l.substring(v.raw.length),i.push(v);continue}if(v=this.tokenizer.br(l)){l=l.substring(v.raw.length),i.push(v);continue}if(v=this.tokenizer.del(l,c,d)){l=l.substring(v.raw.length),i.push(v);continue}if(v=this.tokenizer.autolink(l)){l=l.substring(v.raw.length),i.push(v);continue}if(!this.state.inLink&&(v=this.tokenizer.url(l))){l=l.substring(v.raw.length),i.push(v);continue}let R=l;if((j=this.options.extensions)!=null&&j.startInline){let T=1/0,L=l.slice(1),B;this.options.extensions.startInline.forEach(P=>{B=P.call({lexer:this},L),typeof B=="number"&&B>=0&&(T=Math.min(T,B))}),T<1/0&&T>=0&&(R=l.substring(0,T+1))}if(v=this.tokenizer.inlineText(R)){l=l.substring(v.raw.length),v.raw.slice(-1)!=="_"&&(d=v.raw.slice(-1)),o=!0;let T=i.at(-1);(T==null?void 0:T.type)==="text"?(T.raw+=v.raw,T.text+=v.text):i.push(v);continue}if(l){this.infiniteLoopError(l.charCodeAt(0));break}}return i}infiniteLoopError(l){let i="Infinite loop on byte: "+l;if(this.options.silent)console.error(i);else throw new Error(i)}},Bo=class{constructor(a){Nt(this,"options");Nt(this,"parser");this.options=a||Li}space(a){return""}code({text:a,lang:l,escaped:i}){var d;let c=(d=(l||"").match(Zn.notSpaceStart))==null?void 0:d[0],o=a.replace(Zn.endingNewline,"")+`
95
- `;return c?'<pre><code class="language-'+ga(c)+'">'+(i?o:ga(o,!0))+`</code></pre>
96
- `:"<pre><code>"+(i?o:ga(o,!0))+`</code></pre>
97
- `}blockquote({tokens:a}){return`<blockquote>
98
- ${this.parser.parse(a)}</blockquote>
99
- `}html({text:a}){return a}def(a){return""}heading({tokens:a,depth:l}){return`<h${l}>${this.parser.parseInline(a)}</h${l}>
100
- `}hr(a){return`<hr>
101
- `}list(a){let l=a.ordered,i=a.start,c="";for(let h=0;h<a.items.length;h++){let p=a.items[h];c+=this.listitem(p)}let o=l?"ol":"ul",d=l&&i!==1?' start="'+i+'"':"";return"<"+o+d+`>
102
- `+c+"</"+o+`>
103
- `}listitem(a){return`<li>${this.parser.parse(a.tokens)}</li>
104
- `}checkbox({checked:a}){return"<input "+(a?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:a}){return`<p>${this.parser.parseInline(a)}</p>
105
- `}table(a){let l="",i="";for(let o=0;o<a.header.length;o++)i+=this.tablecell(a.header[o]);l+=this.tablerow({text:i});let c="";for(let o=0;o<a.rows.length;o++){let d=a.rows[o];i="";for(let h=0;h<d.length;h++)i+=this.tablecell(d[h]);c+=this.tablerow({text:i})}return c&&(c=`<tbody>${c}</tbody>`),`<table>
106
- <thead>
107
- `+l+`</thead>
108
- `+c+`</table>
109
- `}tablerow({text:a}){return`<tr>
110
- ${a}</tr>
111
- `}tablecell(a){let l=this.parser.parseInline(a.tokens),i=a.header?"th":"td";return(a.align?`<${i} align="${a.align}">`:`<${i}>`)+l+`</${i}>
112
- `}strong({tokens:a}){return`<strong>${this.parser.parseInline(a)}</strong>`}em({tokens:a}){return`<em>${this.parser.parseInline(a)}</em>`}codespan({text:a}){return`<code>${ga(a,!0)}</code>`}br(a){return"<br>"}del({tokens:a}){return`<del>${this.parser.parseInline(a)}</del>`}link({href:a,title:l,tokens:i}){let c=this.parser.parseInline(i),o=hb(a);if(o===null)return c;a=o;let d='<a href="'+a+'"';return l&&(d+=' title="'+ga(l)+'"'),d+=">"+c+"</a>",d}image({href:a,title:l,text:i,tokens:c}){c&&(i=this.parser.parseInline(c,this.parser.textRenderer));let o=hb(a);if(o===null)return ga(i);a=o;let d=`<img src="${a}" alt="${ga(i)}"`;return l&&(d+=` title="${ga(l)}"`),d+=">",d}text(a){return"tokens"in a&&a.tokens?this.parser.parseInline(a.tokens):"escaped"in a&&a.escaped?a.text:ga(a.text)}},Yh=class{strong({text:a}){return a}em({text:a}){return a}codespan({text:a}){return a}del({text:a}){return a}html({text:a}){return a}text({text:a}){return a}link({text:a}){return""+a}image({text:a}){return""+a}br(){return""}checkbox({raw:a}){return a}},Ql=class Nh{constructor(l){Nt(this,"options");Nt(this,"renderer");Nt(this,"textRenderer");this.options=l||Li,this.options.renderer=this.options.renderer||new Bo,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Yh}static parse(l,i){return new Nh(i).parse(l)}static parseInline(l,i){return new Nh(i).parseInline(l)}parse(l){var c,o;this.renderer.parser=this;let i="";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)){i+=x||"";continue}}let p=h;switch(p.type){case"space":{i+=this.renderer.space(p);break}case"hr":{i+=this.renderer.hr(p);break}case"heading":{i+=this.renderer.heading(p);break}case"code":{i+=this.renderer.code(p);break}case"table":{i+=this.renderer.table(p);break}case"blockquote":{i+=this.renderer.blockquote(p);break}case"list":{i+=this.renderer.list(p);break}case"checkbox":{i+=this.renderer.checkbox(p);break}case"html":{i+=this.renderer.html(p);break}case"def":{i+=this.renderer.def(p);break}case"paragraph":{i+=this.renderer.paragraph(p);break}case"text":{i+=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 i}parseInline(l,i=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+=i.text(m);break}case"html":{c+=i.html(m);break}case"link":{c+=i.link(m);break}case"image":{c+=i.image(m);break}case"checkbox":{c+=i.checkbox(m);break}case"strong":{c+=i.strong(m);break}case"em":{c+=i.em(m);break}case"codespan":{c+=i.codespan(m);break}case"br":{c+=i.br(m);break}case"del":{c+=i.del(m);break}case"text":{c+=i.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}},Mo,Ic=(Mo=class{constructor(a){Nt(this,"options");Nt(this,"block");this.options=a||Li}preprocess(a){return a}postprocess(a){return a}processAllTokens(a){return a}emStrongMask(a){return a}provideLexer(a=this.block){return a?$l.lex:$l.lexInline}provideParser(a=this.block){return a?Ql.parse:Ql.parseInline}},Nt(Mo,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),Nt(Mo,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Mo),cv=class{constructor(...a){Nt(this,"defaults",zh());Nt(this,"options",this.setOptions);Nt(this,"parse",this.parseMarkdown(!0));Nt(this,"parseInline",this.parseMarkdown(!1));Nt(this,"Parser",Ql);Nt(this,"Renderer",Bo);Nt(this,"TextRenderer",Yh);Nt(this,"Lexer",$l);Nt(this,"Tokenizer",Ho);Nt(this,"Hooks",Ic);this.use(...a)}walkTokens(a,l){var c,o;let i=[];for(let d of a)switch(i=i.concat(l.call(this,d)),d.type){case"table":{let h=d;for(let p of h.header)i=i.concat(this.walkTokens(p.tokens,l));for(let p of h.rows)for(let m of p)i=i.concat(this.walkTokens(m.tokens,l));break}case"list":{let h=d;i=i.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);i=i.concat(this.walkTokens(m,l))}):h.tokens&&(i=i.concat(this.walkTokens(h.tokens,l)))}}return i}use(...a){let l=this.defaults.extensions||{renderers:{},childTokens:{}};return a.forEach(i=>{let c={...i};if(c.async=this.defaults.async||c.async||!1,i.extensions&&(i.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),i.renderer){let o=this.defaults.renderer||new Bo(this.defaults);for(let d in i.renderer){if(!(d in o))throw new Error(`renderer '${d}' does not exist`);if(["options","parser"].includes(d))continue;let h=d,p=i.renderer[h],m=o[h];o[h]=(...x)=>{let y=p.apply(o,x);return y===!1&&(y=m.apply(o,x)),y||""}}c.renderer=o}if(i.tokenizer){let o=this.defaults.tokenizer||new Ho(this.defaults);for(let d in i.tokenizer){if(!(d in o))throw new Error(`tokenizer '${d}' does not exist`);if(["options","rules","lexer"].includes(d))continue;let h=d,p=i.tokenizer[h],m=o[h];o[h]=(...x)=>{let y=p.apply(o,x);return y===!1&&(y=m.apply(o,x)),y}}c.tokenizer=o}if(i.hooks){let o=this.defaults.hooks||new Ic;for(let d in i.hooks){if(!(d in o))throw new Error(`hook '${d}' does not exist`);if(["options","block"].includes(d))continue;let h=d,p=i.hooks[h],m=o[h];Ic.passThroughHooks.has(d)?o[h]=x=>{if(this.defaults.async&&Ic.passThroughHooksRespectAsync.has(d))return(async()=>{let j=await p.call(o,x);return m.call(o,j)})();let y=p.call(o,x);return m.call(o,y)}: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 y=p.apply(o,x);return y===!1&&(y=m.apply(o,x)),y}}c.hooks=o}if(i.walkTokens){let o=this.defaults.walkTokens,d=i.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(a){return this.defaults={...this.defaults,...a},this}lexer(a,l){return $l.lex(a,l??this.defaults)}parser(a,l){return Ql.parse(a,l??this.defaults)}parseMarkdown(a){return(l,i)=>{let c={...i},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=a),o.async)return(async()=>{let h=o.hooks?await o.hooks.preprocess(l):l,p=await(o.hooks?await o.hooks.provideLexer(a):a?$l.lex:$l.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(a):a?Ql.parse:Ql.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(a):a?$l.lex:$l.lexInline)(l,o);o.hooks&&(h=o.hooks.processAllTokens(h)),o.walkTokens&&this.walkTokens(h,o.walkTokens);let p=(o.hooks?o.hooks.provideParser(a):a?Ql.parse:Ql.parseInline)(h,o);return o.hooks&&(p=o.hooks.postprocess(p)),p}catch(h){return d(h)}}}onError(a,l){return i=>{if(i.message+=`
113
- Please report this to https://github.com/markedjs/marked.`,a){let c="<p>An error occurred:</p><pre>"+ga(i.message+"",!0)+"</pre>";return l?Promise.resolve(c):c}if(l)return Promise.reject(i);throw i}}},zi=new cv;function bt(a,l){return zi.parse(a,l)}bt.options=bt.setOptions=function(a){return zi.setOptions(a),bt.defaults=zi.defaults,Lx(bt.defaults),bt};bt.getDefaults=zh;bt.defaults=Li;bt.use=function(...a){return zi.use(...a),bt.defaults=zi.defaults,Lx(bt.defaults),bt};bt.walkTokens=function(a,l){return zi.walkTokens(a,l)};bt.parseInline=zi.parseInline;bt.Parser=Ql;bt.parser=Ql.parse;bt.Renderer=Bo;bt.TextRenderer=Yh;bt.Lexer=$l;bt.lexer=$l.lex;bt.Tokenizer=Ho;bt.Hooks=Ic;bt.parse=bt;bt.options;bt.setOptions;bt.use;bt.walkTokens;bt.parseInline;Ql.parse;$l.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 bb(a,l){(l==null||l>a.length)&&(l=a.length);for(var i=0,c=Array(l);i<l;i++)c[i]=a[i];return c}function uv(a){if(Array.isArray(a))return a}function ov(a,l){var i=a==null?null:typeof Symbol<"u"&&a[Symbol.iterator]||a["@@iterator"];if(i!=null){var c,o,d,h,p=[],m=!0,x=!1;try{if(d=(i=i.call(a)).next,l!==0)for(;!(m=(c=d.call(i)).done)&&(p.push(c.value),p.length!==l);m=!0);}catch(y){x=!0,o=y}finally{try{if(!m&&i.return!=null&&(h=i.return(),Object(h)!==h))return}finally{if(x)throw o}}return p}}function fv(){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 dv(a,l){return uv(a)||ov(a,l)||hv(a,l)||fv()}function hv(a,l){if(a){if(typeof a=="string")return bb(a,l);var i={}.toString.call(a).slice(8,-1);return i==="Object"&&a.constructor&&(i=a.constructor.name),i==="Map"||i==="Set"?Array.from(a):i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?bb(a,l):void 0}}const $x=Object.entries,xb=Object.setPrototypeOf,pv=Object.isFrozen,mv=Object.getPrototypeOf,gv=Object.getOwnPropertyDescriptor;let Gn=Object.freeze,Yn=Object.seal,Sr=Object.create,Qx=typeof Reflect<"u"&&Reflect,wh=Qx.apply,Th=Qx.construct;Gn||(Gn=function(l){return l});Yn||(Yn=function(l){return l});wh||(wh=function(l,i){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(i,o)});Th||(Th=function(l){for(var i=arguments.length,c=new Array(i>1?i-1:0),o=1;o<i;o++)c[o-1]=arguments[o];return new l(...c)});const yr=jn(Array.prototype.forEach),bv=jn(Array.prototype.lastIndexOf),yb=jn(Array.prototype.pop),_r=jn(Array.prototype.push),xv=jn(Array.prototype.splice),Hs=Array.isArray,Gc=jn(String.prototype.toLowerCase),ah=jn(String.prototype.toString),_b=jn(String.prototype.match),Lc=jn(String.prototype.replace),vb=jn(String.prototype.indexOf),yv=jn(String.prototype.trim),_v=jn(Number.prototype.toString),vv=jn(Boolean.prototype.toString),Sb=typeof BigInt>"u"?null:jn(BigInt.prototype.toString),jb=typeof Symbol>"u"?null:jn(Symbol.prototype.toString),Dn=jn(Object.prototype.hasOwnProperty),Uc=jn(Object.prototype.toString),On=jn(RegExp.prototype.test),Si=Sv(TypeError);function jn(a){return function(l){l instanceof RegExp&&(l.lastIndex=0);for(var i=arguments.length,c=new Array(i>1?i-1:0),o=1;o<i;o++)c[o-1]=arguments[o];return wh(a,l,c)}}function Sv(a){return function(){for(var l=arguments.length,i=new Array(l),c=0;c<l;c++)i[c]=arguments[c];return Th(a,i)}}function lt(a,l){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Gc;if(xb&&xb(a,null),!Hs(l))return a;let c=l.length;for(;c--;){let o=l[c];if(typeof o=="string"){const d=i(o);d!==o&&(pv(l)||(l[c]=d),o=d)}a[o]=!0}return a}function jv(a){for(let l=0;l<a.length;l++)Dn(a,l)||(a[l]=null);return a}function nl(a){const l=Sr(null);for(const c of $x(a)){var i=dv(c,2);const o=i[0],d=i[1];Dn(a,o)&&(Hs(d)?l[o]=jv(d):d&&typeof d=="object"&&d.constructor===Object?l[o]=nl(d):l[o]=d)}return l}function kv(a){switch(typeof a){case"string":return a;case"number":return _v(a);case"boolean":return vv(a);case"bigint":return Sb?Sb(a):"0";case"symbol":return jb?jb(a):"Symbol()";case"undefined":return Uc(a);case"function":case"object":{if(a===null)return Uc(a);const l=a,i=ba(l,"toString");if(typeof i=="function"){const c=i(l);return typeof c=="string"?c:Uc(c)}return Uc(a)}default:return Uc(a)}}function ba(a,l){for(;a!==null;){const c=gv(a,l);if(c){if(c.get)return jn(c.get);if(typeof c.value=="function")return jn(c.value)}a=mv(a)}function i(){return null}return i}function Nv(a){try{return On(a,""),!0}catch{return!1}}const kb=Gn(["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"]),sh=Gn(["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"]),ih=Gn(["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"]),wv=Gn(["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"]),rh=Gn(["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"]),Tv=Gn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Nb=Gn(["#text"]),wb=Gn(["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"]),ch=Gn(["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"]),Tb=Gn(["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"]),So=Gn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Ev=Yn(/{{[\w\W]*|^[\w\W]*}}/g),Av=Yn(/<%[\w\W]*|^[\w\W]*%>/g),Cv=Yn(/\${[\w\W]*/g),Rv=Yn(/^data-[\-\w.\u00B7-\uFFFF]+$/),Mv=Yn(/^aria-[\-\w]+$/),Eb=Yn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ov=Yn(/^(?:\w+script|data):/i),Dv=Yn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),zv=Yn(/^html$/i),Lv=Yn(/^[a-z][.\w]*(-[.\w]+)+$/i),Ab=Yn(/<[/\w!]/g),Cb=Yn(/<[/\w]/g),Uv=Yn(/<\/no(script|embed|frames)/i),Hv=Yn(/\/>/i),kl={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Bv=function(){return typeof window>"u"?null:window},qv=function(l,i){if(typeof l!="object"||typeof l.createPolicy!="function")return null;let c=null;const o="data-tt-policy-suffix";i&&i.hasAttribute(o)&&(c=i.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}},Rb=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Ds=function(l,i,c,o){return Dn(l,i)&&Hs(l[i])?lt(o.base?nl(o.base):{},l[i],o.transform):c};function Zx(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Bv();const l=de=>Zx(de);if(l.version="3.4.12",l.removed=[],!a||!a.document||a.document.nodeType!==kl.document||!a.Element)return l.isSupported=!1,l;let i=a.document;const c=i,o=c.currentScript;a.DocumentFragment;const d=a.HTMLTemplateElement,h=a.Node,p=a.Element,m=a.NodeFilter,x=a.NamedNodeMap;x===void 0&&(a.NamedNodeMap||a.MozNamedAttrMap),a.HTMLFormElement;const y=a.DOMParser,j=a.trustedTypes,v=p.prototype,R=ba(v,"cloneNode"),T=ba(v,"remove"),L=ba(v,"nextSibling"),B=ba(v,"childNodes"),P=ba(v,"parentNode"),M=ba(v,"shadowRoot"),Z=ba(v,"attributes"),N=h&&h.prototype?ba(h.prototype,"nodeType"):null,K=h&&h.prototype?ba(h.prototype,"nodeName"):null;if(typeof d=="function"){const de=i.createElement("template");de.content&&de.content.ownerDocument&&(i=de.content.ownerDocument)}let z,A="",V,te=!1,oe=0;const F=function(){if(oe>0)throw Si('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},ae=function(w){F(),oe++;try{return z.createHTML(w)}finally{oe--}},me=function(w){F(),oe++;try{return z.createScriptURL(w)}finally{oe--}},Te=function(){return te||(V=qv(j,o),te=!0),V},be=i,U=be.implementation,re=be.createNodeIterator,se=be.createDocumentFragment,pe=be.getElementsByTagName,ke=c.importNode;let k=Rb();l.isSupported=typeof $x=="function"&&typeof P=="function"&&U&&U.createHTMLDocument!==void 0;const $=Ev,ce=Av,he=Cv,Ne=Rv,ye=Mv,Ae=Ov,st=Dv,Qe=Lv;let Ot=Eb,qe=null;const xt=lt({},[...kb,...sh,...ih,...rh,...Nb]);let et=null;const Je=lt({},[...wb,...ch,...Tb,...So]);let Fe=Object.seal(Sr(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}})),it=null,Jn=null;const Bt=Object.seal(Sr(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let qt=!0,Kt=!0,It=!1,Gt=!0,Qt=!1,rt=!0,wt=!1,en=!1,En=null,Ct=null,kn=!1,An=!1,Dt=!1,fn=!1,Jt=!0,Tt=!1;const dn="user-content-";let ot=!0,tn=!1,E={},Y=null;const _e=lt({},["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 O=null;const J=lt({},["audio","video","img","source","image","track"]);let xe=null;const Be=lt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Et="http://www.w3.org/1998/Math/MathML",Nn="http://www.w3.org/2000/svg",wn="http://www.w3.org/1999/xhtml";let Rt=wn,wl=!1,Sa=null;const ja=lt({},[Et,Nn,wn],ah),Gs=Gn(["mi","mo","mn","ms","mtext"]);let Hl=lt({},Gs);const Kl=Gn(["annotation-xml"]);let hn=lt({},Kl);const ka=lt({},["title","style","font","a","script"]);let ml=null;const ll=["application/xhtml+xml","text/html"],Ft="text/html";let Ke=null,Fn=null;const Ys=i.createElement("form"),Hi=function(w){return w instanceof RegExp||w instanceof Function},Xs=function(){let w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Fn&&Fn===w)return;(!w||typeof w!="object")&&(w={}),w=nl(w),ml=ll.indexOf(w.PARSER_MEDIA_TYPE)===-1?Ft:w.PARSER_MEDIA_TYPE,Ke=ml==="application/xhtml+xml"?ah:Gc,qe=Ds(w,"ALLOWED_TAGS",xt,{transform:Ke}),et=Ds(w,"ALLOWED_ATTR",Je,{transform:Ke}),Sa=Ds(w,"ALLOWED_NAMESPACES",ja,{transform:ah}),xe=Ds(w,"ADD_URI_SAFE_ATTR",Be,{transform:Ke,base:Be}),O=Ds(w,"ADD_DATA_URI_TAGS",J,{transform:Ke,base:J}),Y=Ds(w,"FORBID_CONTENTS",_e,{transform:Ke}),it=Ds(w,"FORBID_TAGS",nl({}),{transform:Ke}),Jn=Ds(w,"FORBID_ATTR",nl({}),{transform:Ke}),E=Dn(w,"USE_PROFILES")?w.USE_PROFILES&&typeof w.USE_PROFILES=="object"?nl(w.USE_PROFILES):w.USE_PROFILES:!1,qt=w.ALLOW_ARIA_ATTR!==!1,Kt=w.ALLOW_DATA_ATTR!==!1,It=w.ALLOW_UNKNOWN_PROTOCOLS||!1,Gt=w.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Qt=w.SAFE_FOR_TEMPLATES||!1,rt=w.SAFE_FOR_XML!==!1,wt=w.WHOLE_DOCUMENT||!1,An=w.RETURN_DOM||!1,Dt=w.RETURN_DOM_FRAGMENT||!1,fn=w.RETURN_TRUSTED_TYPE||!1,kn=w.FORCE_BODY||!1,Jt=w.SANITIZE_DOM!==!1,Tt=w.SANITIZE_NAMED_PROPS||!1,ot=w.KEEP_CONTENT!==!1,tn=w.IN_PLACE||!1,Ot=Nv(w.ALLOWED_URI_REGEXP)?w.ALLOWED_URI_REGEXP:Eb,Rt=typeof w.NAMESPACE=="string"?w.NAMESPACE:wn,Hl=Dn(w,"MATHML_TEXT_INTEGRATION_POINTS")&&w.MATHML_TEXT_INTEGRATION_POINTS&&typeof w.MATHML_TEXT_INTEGRATION_POINTS=="object"?nl(w.MATHML_TEXT_INTEGRATION_POINTS):lt({},Gs),hn=Dn(w,"HTML_INTEGRATION_POINTS")&&w.HTML_INTEGRATION_POINTS&&typeof w.HTML_INTEGRATION_POINTS=="object"?nl(w.HTML_INTEGRATION_POINTS):lt({},Kl);const I=Dn(w,"CUSTOM_ELEMENT_HANDLING")&&w.CUSTOM_ELEMENT_HANDLING&&typeof w.CUSTOM_ELEMENT_HANDLING=="object"?nl(w.CUSTOM_ELEMENT_HANDLING):Sr(null);if(Fe=Sr(null),Dn(I,"tagNameCheck")&&Hi(I.tagNameCheck)&&(Fe.tagNameCheck=I.tagNameCheck),Dn(I,"attributeNameCheck")&&Hi(I.attributeNameCheck)&&(Fe.attributeNameCheck=I.attributeNameCheck),Dn(I,"allowCustomizedBuiltInElements")&&typeof I.allowCustomizedBuiltInElements=="boolean"&&(Fe.allowCustomizedBuiltInElements=I.allowCustomizedBuiltInElements),Yn(Fe),Qt&&(Kt=!1),Dt&&(An=!0),E&&(qe=lt({},Nb),et=Sr(null),E.html===!0&&(lt(qe,kb),lt(et,wb)),E.svg===!0&&(lt(qe,sh),lt(et,ch),lt(et,So)),E.svgFilters===!0&&(lt(qe,ih),lt(et,ch),lt(et,So)),E.mathMl===!0&&(lt(qe,rh),lt(et,Tb),lt(et,So))),Bt.tagCheck=null,Bt.attributeCheck=null,Dn(w,"ADD_TAGS")&&(typeof w.ADD_TAGS=="function"?Bt.tagCheck=w.ADD_TAGS:Hs(w.ADD_TAGS)&&(qe===xt&&(qe=nl(qe)),lt(qe,w.ADD_TAGS,Ke))),Dn(w,"ADD_ATTR")&&(typeof w.ADD_ATTR=="function"?Bt.attributeCheck=w.ADD_ATTR:Hs(w.ADD_ATTR)&&(et===Je&&(et=nl(et)),lt(et,w.ADD_ATTR,Ke))),Dn(w,"ADD_URI_SAFE_ATTR")&&Hs(w.ADD_URI_SAFE_ATTR)&&lt(xe,w.ADD_URI_SAFE_ATTR,Ke),Dn(w,"FORBID_CONTENTS")&&Hs(w.FORBID_CONTENTS)&&(Y===_e&&(Y=nl(Y)),lt(Y,w.FORBID_CONTENTS,Ke)),Dn(w,"ADD_FORBID_CONTENTS")&&Hs(w.ADD_FORBID_CONTENTS)&&(Y===_e&&(Y=nl(Y)),lt(Y,w.ADD_FORBID_CONTENTS,Ke)),ot&&(qe["#text"]=!0),wt&&lt(qe,["html","head","body"]),qe.table&&(lt(qe,["tbody"]),delete it.tbody),w.TRUSTED_TYPES_POLICY){if(typeof w.TRUSTED_TYPES_POLICY.createHTML!="function")throw Si('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof w.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Si('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const ue=z;z=w.TRUSTED_TYPES_POLICY;try{A=ae("")}catch(ve){throw z=ue,ve}}else w.TRUSTED_TYPES_POLICY===null?(z=void 0,A=""):(z===void 0&&(z=Te()),z&&typeof A=="string"&&(A=ae("")));Gn&&Gn(w),Fn=w},Jl=lt({},[...sh,...ih,...wv]),Fl=lt({},[...rh,...Tv]),Na=function(w,I,ue){return I.namespaceURI===wn?w==="svg":I.namespaceURI===Et?w==="svg"&&(ue==="annotation-xml"||Hl[ue]):!!Jl[w]},Wl=function(w,I,ue){return I.namespaceURI===wn?w==="math":I.namespaceURI===Nn?w==="math"&&hn[ue]:!!Fl[w]},gl=function(w,I,ue){return I.namespaceURI===Nn&&!hn[ue]||I.namespaceURI===Et&&!Hl[ue]?!1:!Fl[w]&&(ka[w]||!Jl[w])},nn=function(w){let I=P(w);(!I||!I.tagName)&&(I={namespaceURI:Rt,tagName:"template"});const ue=Gc(w.tagName),ve=Gc(I.tagName);return Sa[w.namespaceURI]?w.namespaceURI===Nn?Na(ue,I,ve):w.namespaceURI===Et?Wl(ue,I,ve):w.namespaceURI===wn?gl(ue,I,ve):!!(ml==="application/xhtml+xml"&&Sa[w.namespaceURI]):!1},ln=function(w){_r(l.removed,{element:w});try{P(w).removeChild(w)}catch{if(T(w),!P(w))throw Si("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},ft=function(w){Vn(w);const I=B(w);if(I){const ve=[];yr(I,Re=>{_r(ve,Re)}),yr(ve,Re=>{try{T(Re)}catch{}})}const ue=Z(w);if(ue)for(let ve=ue.length-1;ve>=0;--ve){const Re=ue[ve],Oe=Re&&Re.name;if(typeof Oe=="string")try{w.removeAttribute(Oe)}catch{}}},Xn=function(w,I){try{_r(l.removed,{attribute:I.getAttributeNode(w),from:I})}catch{_r(l.removed,{attribute:null,from:I})}if(I.removeAttribute(w),w==="is")if(An||Dt)try{ln(I)}catch{}else try{I.setAttribute(w,"")}catch{}},wa=function(w){const I=Z(w);if(I)for(let ue=I.length-1;ue>=0;--ue){const ve=I[ue],Re=ve&&ve.name;if(!(typeof Re!="string"||et[Ke(Re)]))try{w.removeAttribute(Re)}catch{}}},Vn=function(w){const I=[w];for(;I.length>0;){const ue=I.pop();(N?N(ue):ue.nodeType)===kl.element&&wa(ue);const Re=B(ue);if(Re)for(let Oe=Re.length-1;Oe>=0;--Oe)I.push(Re[Oe])}},$n=function(w){if(!rt)return;const I=[w];for(;I.length>0;){const ue=I.pop(),ve=N?N(ue):ue.nodeType;if(ve===kl.processingInstruction||ve===kl.comment&&On(Cb,ue.data)){try{T(ue)}catch{}continue}if(ve===kl.element){const Oe=ue,mt=Ke(K?K(ue):ue.nodeName);try{Oe.hasAttribute&&Oe.hasAttribute("patchsrc")&&Oe.removeAttribute("patchsrc"),Oe.hasAttribute&&Oe.hasAttribute("for")&&mt!=="label"&&mt!=="output"&&Oe.removeAttribute("for")}catch{}}const Re=B(ue);if(Re)for(let Oe=Re.length-1;Oe>=0;--Oe)I.push(Re[Oe])}},al=function(w){let I=null,ue=null;if(kn)w="<remove></remove>"+w;else{const Oe=_b(w,/^[\r\n\t ]+/);ue=Oe&&Oe[0]}ml==="application/xhtml+xml"&&Rt===wn&&(w='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+w+"</body></html>");const ve=z?ae(w):w;if(Rt===wn)try{I=new y().parseFromString(ve,ml)}catch{}if(!I||!I.documentElement){I=U.createDocument(Rt,"template",null);try{I.documentElement.innerHTML=wl?A:ve}catch{}}const Re=I.body||I.documentElement;return w&&ue&&Re.insertBefore(i.createTextNode(ue),Re.childNodes[0]||null),Rt===wn?pe.call(I,wt?"html":"body")[0]:wt?I.documentElement:Re},Pl=function(w){return re.call(w.ownerDocument||w,w,m.SHOW_ELEMENT|m.SHOW_COMMENT|m.SHOW_TEXT|m.SHOW_PROCESSING_INSTRUCTION|m.SHOW_CDATA_SECTION,null)},Wn=function(w){return w=Lc(w,$," "),w=Lc(w,ce," "),w=Lc(w,he," "),w},Vs=function(w){var I;w.normalize();const ue=re.call(w.ownerDocument||w,w,m.SHOW_TEXT|m.SHOW_COMMENT|m.SHOW_CDATA_SECTION|m.SHOW_PROCESSING_INSTRUCTION,null);let ve=ue.nextNode();for(;ve;)ve.data=Wn(ve.data),ve=ue.nextNode();const Re=(I=w.querySelectorAll)===null||I===void 0?void 0:I.call(w,"template");Re&&yr(Re,Oe=>{zn(Oe.content)&&Vs(Oe.content)})},Cn=function(w){const I=K?K(w):null;return typeof I!="string"||Ke(I)!=="form"?!1:typeof w.nodeName!="string"||typeof w.textContent!="string"||typeof w.removeChild!="function"||w.attributes!==Z(w)||typeof w.removeAttribute!="function"||typeof w.setAttribute!="function"||typeof w.namespaceURI!="string"||typeof w.insertBefore!="function"||typeof w.hasChildNodes!="function"||w.nodeType!==N(w)||w.childNodes!==B(w)},zn=function(w){if(!N||typeof w!="object"||w===null)return!1;try{return N(w)===kl.documentFragment}catch{return!1}},pn=function(w){if(!N||typeof w!="object"||w===null)return!1;try{return typeof N(w)=="number"}catch{return!1}};function yt(de,w,I){de.length!==0&&yr(de,ue=>{ue.call(l,w,I,Fn)})}const Ta=function(w,I){return!!(rt&&w.hasChildNodes()&&!pn(w.firstElementChild)&&On(Ab,w.textContent)&&On(Ab,w.innerHTML)||rt&&w.namespaceURI===wn&&I==="style"&&pn(w.firstElementChild)||w.nodeType===kl.processingInstruction||rt&&w.nodeType===kl.comment&&On(Cb,w.data))},Br=function(w,I){if(!it[I]&&Aa(I)&&(Fe.tagNameCheck instanceof RegExp&&On(Fe.tagNameCheck,I)||Fe.tagNameCheck instanceof Function&&Fe.tagNameCheck(I)))return!1;if(ot&&!Y[I]){const ue=P(w),ve=B(w);if(ve&&ue){const Re=ve.length;for(let Oe=Re-1;Oe>=0;--Oe){const mt=tn?ve[Oe]:R(ve[Oe],!0);ue.insertBefore(mt,L(w))}}}return ln(w),!0},ea=function(w,I){if(yt(k.beforeSanitizeElements,w,null),w!==I&&P(w)===null)return!0;if(Cn(w))return ln(w),!0;const ue=Ke(K?K(w):w.nodeName);if(yt(k.uponSanitizeElement,w,{tagName:ue,allowedTags:qe}),w!==I&&P(w)===null)return!0;if(Ta(w,ue))return ln(w),!0;if(it[ue]||!(Bt.tagCheck instanceof Function&&Bt.tagCheck(ue))&&!qe[ue]){const Re=Br(w,ue);return Re===!1&&yt(k.afterSanitizeElements,w,null),Re}if((N?N(w):w.nodeType)===kl.element&&!nn(w)||(ue==="noscript"||ue==="noembed"||ue==="noframes")&&On(Uv,w.innerHTML))return ln(w),!0;if(Qt&&w.nodeType===kl.text){const Re=Wn(w.textContent);w.textContent!==Re&&(_r(l.removed,{element:w.cloneNode()}),w.textContent=Re)}return yt(k.afterSanitizeElements,w,null),!1},ta=function(w,I,ue){if(Jn[I]||rt&&I==="patchsrc"||rt&&I==="for"&&w!=="label"&&w!=="output"||Jt&&(I==="id"||I==="name")&&(ue in i||ue in Ys))return!1;const ve=et[I]||Bt.attributeCheck instanceof Function&&Bt.attributeCheck(I,w);if(!(Kt&&On(Ne,I))){if(!(qt&&On(ye,I))){if(ve){if(!xe[I]){if(!On(Ot,Lc(ue,st,""))){if(!((I==="src"||I==="xlink:href"||I==="href")&&w!=="script"&&vb(ue,"data:")===0&&O[w])){if(!(It&&!On(Ae,Lc(ue,st,"")))){if(ue)return!1}}}}}else if(!(Aa(w)&&(Fe.tagNameCheck instanceof RegExp&&On(Fe.tagNameCheck,w)||Fe.tagNameCheck instanceof Function&&Fe.tagNameCheck(w))&&(Fe.attributeNameCheck instanceof RegExp&&On(Fe.attributeNameCheck,I)||Fe.attributeNameCheck instanceof Function&&Fe.attributeNameCheck(I,w))||I==="is"&&Fe.allowCustomizedBuiltInElements&&(Fe.tagNameCheck instanceof RegExp&&On(Fe.tagNameCheck,ue)||Fe.tagNameCheck instanceof Function&&Fe.tagNameCheck(ue))))return!1}}return!0},Ea=lt({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Aa=function(w){return!Ea[Gc(w)]&&On(Qe,w)},Ln=function(w,I,ue,ve){if(z&&typeof j=="object"&&typeof j.getAttributeType=="function"&&!ue)switch(j.getAttributeType(w,I)){case"TrustedHTML":return ae(ve);case"TrustedScriptURL":return me(ve)}return ve},bl=function(w,I,ue,ve){try{ue?w.setAttributeNS(ue,I,ve):w.setAttribute(I,ve),Cn(w)?ln(w):yb(l.removed)}catch{Xn(I,w)}},Bl=function(w){yt(k.beforeSanitizeAttributes,w,null);const I=w.attributes;if(!I||Cn(w))return;const ue={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:et,forceKeepAttr:void 0};let ve=I.length;const Re=Ke(w.nodeName);for(;ve--;){const Oe=I[ve],mt=Oe.name,mn=Oe.namespaceURI,an=Oe.value,Mt=Ke(mt),gn=an;let Yt=mt==="value"?gn:yv(gn);if(ue.attrName=Mt,ue.attrValue=Yt,ue.keepAttr=!0,ue.forceKeepAttr=void 0,yt(k.uponSanitizeAttribute,w,ue),Yt=ue.attrValue,Tt&&(Mt==="id"||Mt==="name")&&vb(Yt,dn)!==0&&(Xn(mt,w),Yt=dn+Yt),rt&&On(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Yt)){Xn(mt,w);continue}if(Mt==="attributename"&&_b(Yt,"href")){Xn(mt,w);continue}if(!ue.forceKeepAttr){if(!ue.keepAttr){Xn(mt,w);continue}if(!Gt&&On(Hv,Yt)){Xn(mt,w);continue}if(Qt&&(Yt=Wn(Yt)),!ta(Re,Mt,Yt)){Xn(mt,w);continue}Yt=Ln(Re,Mt,mn,Yt),Yt!==gn&&bl(w,mt,mn,Yt)}}yt(k.afterSanitizeAttributes,w,null)},na=function(w){let I=null;const ue=Pl(w);for(yt(k.beforeSanitizeShadowDOM,w,null);I=ue.nextNode();)if(yt(k.uponSanitizeShadowNode,I,null),ea(I,w),Bl(I),zn(I.content)&&na(I.content),(N?N(I):I.nodeType)===kl.element){const Re=M(I);zn(Re)&&(sl(Re),na(Re))}yt(k.afterSanitizeShadowDOM,w,null)},sl=function(w){const I=[{node:w,shadow:null}];for(;I.length>0;){const ue=I.pop();if(ue.shadow){na(ue.shadow);continue}const ve=ue.node,Oe=(N?N(ve):ve.nodeType)===kl.element,mt=B(ve);if(mt)for(let mn=mt.length-1;mn>=0;--mn)I.push({node:mt[mn],shadow:null});if(Oe){const mn=K?K(ve):null;if(typeof mn=="string"&&Ke(mn)==="template"){const an=ve.content;zn(an)&&I.push({node:an,shadow:null})}}if(Oe){const mn=M(ve);zn(mn)&&I.push({node:null,shadow:mn},{node:mn,shadow:null})}}};return l.sanitize=function(de){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},I=null,ue=null,ve=null,Re=null;if(wl=!de,wl&&(de="<!-->"),typeof de!="string"&&!pn(de)&&(de=kv(de),typeof de!="string"))throw Si("dirty is not a string, aborting");if(!l.isSupported)return de;en?(qe=En,et=Ct):Xs(w),(k.uponSanitizeElement.length>0||k.uponSanitizeAttribute.length>0)&&(qe=nl(qe)),k.uponSanitizeAttribute.length>0&&(et=nl(et)),l.removed=[];const Oe=tn&&typeof de!="string"&&pn(de);if(Oe){$n(de);const Mt=K?K(de):de.nodeName;if(typeof Mt=="string"){const gn=Ke(Mt);if(!qe[gn]||it[gn])throw ft(de),Si("root node is forbidden and cannot be sanitized in-place")}if(Cn(de))throw ft(de),Si("root node is clobbered and cannot be sanitized in-place");try{sl(de)}catch(gn){throw ft(de),gn}}else if(pn(de))I=al("<!---->"),ue=I.ownerDocument.importNode(de,!0),ue.nodeType===kl.element&&ue.nodeName==="BODY"||ue.nodeName==="HTML"?I=ue:I.appendChild(ue),sl(ue);else{if(!An&&!Qt&&!wt&&de.indexOf("<")===-1)return z&&fn?ae(de):de;if(I=al(de),!I)return An?null:fn?A:""}I&&kn&&ln(I.firstChild);const mt=Oe?de:I,mn=Pl(mt);try{for(;ve=mn.nextNode();)ea(ve,mt),Bl(ve),zn(ve.content)&&na(ve.content)}catch(Mt){throw Oe&&(ft(de),yr(l.removed,gn=>{gn.element&&Vn(gn.element)})),Mt}if(Oe)return yr(l.removed,Mt=>{Mt.element&&Vn(Mt.element)}),Qt&&Vs(de),de;if(An){if(Qt&&Vs(I),Dt)for(Re=se.call(I.ownerDocument);I.firstChild;)Re.appendChild(I.firstChild);else Re=I;return(et.shadowroot||et.shadowrootmode)&&(Re=ke.call(c,Re,!0)),Re}let an=wt?I.outerHTML:I.innerHTML;return wt&&qe["!doctype"]&&I.ownerDocument&&I.ownerDocument.doctype&&I.ownerDocument.doctype.name&&On(zv,I.ownerDocument.doctype.name)&&(an="<!DOCTYPE "+I.ownerDocument.doctype.name+`>
115
- `+an),Qt&&(an=Wn(an)),z&&fn?ae(an):an},l.setConfig=function(){let de=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Xs(de),en=!0,En=qe,Ct=et},l.clearConfig=function(){Fn=null,en=!1,En=null,Ct=null,z=V,A=""},l.isValidAttribute=function(de,w,I){Fn||Xs({});const ue=Ke(de),ve=Ke(w);return ta(ue,ve,I)},l.addHook=function(de,w){typeof w=="function"&&Dn(k,de)&&_r(k[de],w)},l.removeHook=function(de,w){if(Dn(k,de)){if(w!==void 0){const I=bv(k[de],w);return I===-1?void 0:xv(k[de],I,1)[0]}return yb(k[de])}},l.removeHooks=function(de){Dn(k,de)&&(k[de]=[])},l.removeAllHooks=function(){k=Rb()},l}var Iv=Zx();const Gv=1024;let Yv=0;class Ul{constructor(l,i){this.from=l,this.to=i}}class Ht{constructor(l={}){this.id=Yv++,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=Zl.match(l)),i=>{let c=l(i);return c===void 0?null:[this,c]}}}Ht.closedBy=new Ht({deserialize:a=>a.split(" ")});Ht.openedBy=new Ht({deserialize:a=>a.split(" ")});Ht.group=new Ht({deserialize:a=>a.split(" ")});Ht.isolate=new Ht({deserialize:a=>{if(a&&a!="rtl"&&a!="ltr"&&a!="auto")throw new RangeError("Invalid value for isolate: "+a);return a||"auto"}});Ht.contextHash=new Ht({perNode:!0});Ht.lookAhead=new Ht({perNode:!0});Ht.mounted=new Ht({perNode:!0});class Nr{constructor(l,i,c,o=!1){this.tree=l,this.overlay=i,this.parser=c,this.bracketed=o}static get(l){return l&&l.props&&l.props[Ht.mounted.id]}}const Xv=Object.create(null);class Zl{constructor(l,i,c,o=0){this.name=l,this.props=i,this.id=c,this.flags=o}static define(l){let i=l.props&&l.props.length?Object.create(null):Xv,c=(l.top?1:0)|(l.skipped?2:0)|(l.error?4:0)|(l.name==null?8:0),o=new Zl(l.name||"",i,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");i[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 i=this.prop(Ht.group);return i?i.indexOf(l)>-1:!1}return this.id==l}static match(l){let i=Object.create(null);for(let c in l)for(let o of c.split(" "))i[o]=l[c];return c=>{for(let o=c.prop(Ht.group),d=-1;d<(o?o.length:0);d++){let h=i[d<0?c.name:o[d]];if(h)return h}}}}Zl.none=new Zl("",Object.create(null),0,8);class Kx{constructor(l){this.types=l;for(let i=0;i<l.length;i++)if(l[i].id!=i)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...l){let i=[];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}}i.push(o?new Zl(c.name,o,c.id,c.flags):c)}return new Kx(i)}}const jo=new WeakMap,Mb=new WeakMap;var Lt;(function(a){a[a.ExcludeBuffers=1]="ExcludeBuffers",a[a.IncludeAnonymous=2]="IncludeAnonymous",a[a.IgnoreMounts=4]="IgnoreMounts",a[a.IgnoreOverlays=8]="IgnoreOverlays",a[a.EnterBracketed=16]="EnterBracketed"})(Lt||(Lt={}));class pl{constructor(l,i,c,o,d){if(this.type=l,this.children=i,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=Nr.get(this);if(l&&!l.overlay)return l.tree.toString();let i="";for(let c of this.children){let o=c.toString();o&&(i&&(i+=","),i+=o)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(i.length?"("+i+")":""):i}cursor(l=0){return new qo(this.topNode,l)}cursorAt(l,i=0,c=0){let o=jo.get(this)||this.topNode,d=new qo(o);return d.moveTo(l,i),jo.set(this,d._tree),d}get topNode(){return new Kn(this,0,0,null)}resolve(l,i=0){let c=$c(jo.get(this)||this.topNode,l,i,!1);return jo.set(this,c),c}resolveInner(l,i=0){let c=$c(Mb.get(this)||this.topNode,l,i,!0);return Mb.set(this,c),c}resolveStack(l,i=0){return Qv(this,l,i)}iterate(l){let{enter:i,leave:c,from:o=0,to:d=this.length}=l,h=l.mode||0,p=(h&Lt.IncludeAnonymous)>0;for(let m=this.cursor(h|Lt.IncludeAnonymous);;){let x=!1;if(m.from<=d&&m.to>=o&&(!p&&m.type.isAnonymous||i(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 i in this.props)l.push([+i,this.props[i]]);return l}balance(l={}){return this.children.length<=8?this:$h(Zl.none,this.children,this.positions,0,this.children.length,0,this.length,(i,c,o)=>new pl(this.type,i,c,o,this.propValues),l.makeTree||((i,c,o)=>new pl(Zl.none,i,c,o)))}static build(l){return Zv(l)}}pl.empty=new pl(Zl.none,[],[],0);class Xh{constructor(l,i){this.buffer=l,this.index=i}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 Xh(this.buffer,this.index)}}class Is{constructor(l,i,c){this.buffer=l,this.length=i,this.set=c}get type(){return Zl.none}toString(){let l=[];for(let i=0;i<this.buffer.length;)l.push(this.childString(i)),i=this.buffer[i+3];return l.join(",")}childString(l){let i=this.buffer[l],c=this.buffer[l+3],o=this.set.types[i],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,i,c,o,d){let{buffer:h}=this,p=-1;for(let m=l;m!=i&&!(Jx(d,o,h[m+1],h[m+2])&&(p=m,c>0));m=h[m+3]);return p}slice(l,i,c){let o=this.buffer,d=new Uint16Array(i-l),h=0;for(let p=l,m=0;p<i;){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 Is(d,h,this.set)}}function Jx(a,l,i,c){switch(a){case-2:return i<l;case-1:return c>=l&&i<l;case 0:return i<l&&c>l;case 1:return i<=l&&c>l;case 2:return c>l;case 4:return!0}}function $c(a,l,i,c){for(var o;a.from==a.to||(i<1?a.from>=l:a.from>l)||(i>-1?a.to<=l:a.to<l);){let h=!c&&a instanceof Kn&&a.index<0?null:a.parent;if(!h)return a;a=h}let d=c?0:Lt.IgnoreOverlays;if(c)for(let h=a,p=h.parent;p;h=p,p=h.parent)h instanceof Kn&&h.index<0&&((o=p.enter(l,i,d))===null||o===void 0?void 0:o.from)!=h.from&&(a=p);for(;;){let h=a.enter(l,i,d);if(!h)return a;a=h}}class Fx{cursor(l=0){return new qo(this,l)}getChild(l,i=null,c=null){let o=Ob(this,l,i,c);return o.length?o[0]:null}getChildren(l,i=null,c=null){return Ob(this,l,i,c)}resolve(l,i=0){return $c(this,l,i,!1)}resolveInner(l,i=0){return $c(this,l,i,!0)}matchContext(l){return Eh(this.parent,l)}enterUnfinishedNodesBefore(l){let i=this.childBefore(l),c=this;for(;i;){let o=i.lastChild;if(!o||o.to!=i.to)break;o.type.isError&&o.from==o.to?(c=i,i=o.prevSibling):i=o}return c}get node(){return this}get next(){return this.parent}}class Kn extends Fx{constructor(l,i,c,o){super(),this._tree=l,this.from=i,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,i,c,o,d=0){for(let h=this;;){for(let{children:p,positions:m}=h._tree,x=i>0?p.length:-1;l!=x;l+=i){let y=p[l],j=m[l]+h.from,v;if(!(!(d&Lt.EnterBracketed&&y instanceof pl&&(v=Nr.get(y))&&!v.overlay&&v.bracketed&&c>=j&&c<=j+y.length)&&!Jx(o,c,j,j+y.length))){if(y instanceof Is){if(d&Lt.ExcludeBuffers)continue;let R=y.findChild(0,y.buffer.length,i,c-j,o);if(R>-1)return new va(new Vv(h,y,l,j),null,R)}else if(d&Lt.IncludeAnonymous||!y.type.isAnonymous||Vh(y)){let R;if(!(d&Lt.IgnoreMounts)&&(R=Nr.get(y))&&!R.overlay)return new Kn(R.tree,j,l,h);let T=new Kn(y,j,l,h);return d&Lt.IncludeAnonymous||!T.type.isAnonymous?T:T.nextChild(i<0?y.children.length-1:0,i,c,o,d)}}}if(d&Lt.IncludeAnonymous||!h.type.isAnonymous||(h.index>=0?l=h.index+i:l=i<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,i,c=0){let o;if(!(c&Lt.IgnoreOverlays)&&(o=Nr.get(this._tree))&&o.overlay){let d=l-this.from,h=c&Lt.EnterBracketed&&o.bracketed;for(let{from:p,to:m}of o.overlay)if((i>0||h?p<=d:p<d)&&(i<0||h?m>=d:m>d))return new Kn(o.tree,o.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,l,i,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 Ob(a,l,i,c){let o=a.cursor(),d=[];if(!o.firstChild())return d;if(i!=null){for(let h=!1;!h;)if(h=o.type.is(i),!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 Eh(a,l,i=l.length-1){for(let c=a;i>=0;c=c.parent){if(!c)return!1;if(!c.type.isAnonymous){if(l[i]&&l[i]!=c.name)return!1;i--}}return!0}class Vv{constructor(l,i,c,o){this.parent=l,this.buffer=i,this.index=c,this.start=o}}class va extends Fx{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,i,c){super(),this.context=l,this._parent=i,this.index=c,this.type=l.buffer.set.types[l.buffer.buffer[c]]}child(l,i,c){let{buffer:o}=this.context,d=o.findChild(this.index+4,o.buffer[this.index+3],l,i-this.context.start,c);return d<0?null:new va(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,i,c=0){if(c&Lt.ExcludeBuffers)return null;let{buffer:o}=this.context,d=o.findChild(this.index+4,o.buffer[this.index+3],i>0?1:-1,l-this.context.start,i);return d<0?null:new va(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,i=l.buffer[this.index+3];return i<(this._parent?l.buffer[this._parent.index+3]:l.buffer.length)?new va(this.context,this._parent,i):this.externalSibling(1)}get prevSibling(){let{buffer:l}=this.context,i=this._parent?this._parent.index+4:0;return this.index==i?this.externalSibling(-1):new va(this.context,this._parent,l.findChild(i,this.index,-1,0,4))}get tree(){return null}toTree(){let l=[],i=[],{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)),i.push(0)}return new pl(this.type,l,i,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Wx(a){if(!a.length)return null;let l=0,i=a[0];for(let d=1;d<a.length;d++){let h=a[d];(h.from>i.from||h.to<i.to)&&(i=h,l=d)}let c=i instanceof Kn&&i.index<0?null:i.parent,o=a.slice();return c?o[l]=c:o.splice(l,1),new $v(o,i)}class $v{constructor(l,i){this.heads=l,this.node=i}get next(){return Wx(this.heads)}}function Qv(a,l,i){let c=a.resolveInner(l,i),o=null;for(let d=c instanceof Kn?c:c.context.parent;d;d=d.parent)if(d.index<0){let h=d.parent;(o||(o=[c])).push(h.resolve(l,i)),d=h}else{let h=Nr.get(d.tree);if(h&&h.overlay&&h.overlay[0].from<=l&&h.overlay[h.overlay.length-1].to>=l){let p=new Kn(h.tree,h.overlay[0].from+d.from,-1,d);(o||(o=[c])).push($c(p,l,i,!1))}}return o?Wx(o):c}class qo{get name(){return this.type.name}constructor(l,i=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=i&~Lt.EnterBracketed,l instanceof Kn)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,i){this.index=l;let{start:c,buffer:o}=this.buffer;return this.type=i||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 Kn?(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,i,c){if(!this.buffer)return this.yield(this._tree.nextChild(l<0?this._tree._tree.children.length-1:0,l,i,c,this.mode));let{buffer:o}=this.buffer,d=o.findChild(this.index+4,o.buffer[this.index+3],l,i-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,i,c=this.mode){return this.buffer?c&Lt.ExcludeBuffers?!1:this.enterChild(1,l,i):this.yield(this._tree.enter(l,i,c))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Lt.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let l=this.mode&Lt.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:i}=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(i.findChild(o,this.index,-1,0,4))}else{let o=i.buffer[this.index+3];if(o<(c<0?i.buffer.length:i.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 i,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:i,parent:c}=o)}else({index:i,_parent:c}=this._tree);for(;c;{index:i,_parent:c}=c)if(i>-1)for(let d=i+l,h=l<0?-1:c._tree.children.length;d!=h;d+=l){let p=c._tree.children[d];if(this.mode&Lt.IncludeAnonymous||p instanceof Is||!p.type.isAnonymous||Vh(p))return!1}return!0}move(l,i){if(i&&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,i=0){for(;(this.from==this.to||(i<1?this.from>=l:this.from>l)||(i>-1?this.to<=l:this.to<l))&&this.parent(););for(;this.enterChild(1,l,i););return this}get node(){if(!this.buffer)return this._tree;let l=this.bufferNode,i=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;i=h,c=d+1;break e}o=this.stack[--d]}for(let o=c;o<this.stack.length;o++)i=new va(this.buffer,i,this.stack[o]);return this.bufferNode=new va(this.buffer,i,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(l,i){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&&i&&i(this),o=this.type.isAnonymous,!c)return;if(this.nextSibling())break;this.parent(),c--,o=!0}}}matchContext(l){if(!this.buffer)return Eh(this.node.parent,l);let{buffer:i}=this.buffer,{types:c}=i.set;for(let o=l.length-1,d=this.stack.length-1;o>=0;d--){if(d<0)return Eh(this._tree,l,o);let h=c[i.buffer[this.stack[d]]];if(!h.isAnonymous){if(l[o]&&l[o]!=h.name)return!1;o--}}return!0}}function Vh(a){return a.children.some(l=>l instanceof Is||!l.type.isAnonymous||Vh(l))}function Zv(a){var l;let{buffer:i,nodeSet:c,maxBufferLength:o=Gv,reused:d=[],minRepeatType:h=c.types.length}=a,p=Array.isArray(i)?new Xh(i,i.length):i,m=c.types,x=0,y=0;function j(K,z,A,V,te,oe){let{id:F,start:ae,end:me,size:Te}=p,be=y,U=x;if(Te<0)if(p.next(),Te==-1){let k=d[F];A.push(k),V.push(ae-K);return}else if(Te==-3){x=F;return}else if(Te==-4){y=F;return}else throw new RangeError(`Unrecognized record size: ${Te}`);let re=m[F],se,pe,ke=ae-K;if(me-ae<=o&&(pe=B(p.pos-z,te))){let k=new Uint16Array(pe.size-pe.skip),$=p.pos-pe.size,ce=k.length;for(;p.pos>$;)ce=P(pe.start,k,ce);se=new Is(k,me-pe.start,c),ke=pe.start-K}else{let k=p.pos-Te;p.next();let $=[],ce=[],he=F>=h?F:-1,Ne=0,ye=me;for(;p.pos>k;)he>=0&&p.id==he&&p.size>=0?(p.end<=ye-o&&(T($,ce,ae,Ne,p.end,ye,he,be,U),Ne=$.length,ye=p.end),p.next()):oe>2500?v(ae,k,$,ce):j(ae,k,$,ce,he,oe+1);if(he>=0&&Ne>0&&Ne<$.length&&T($,ce,ae,Ne,ae,ye,he,be,U),$.reverse(),ce.reverse(),he>-1&&Ne>0){let Ae=R(re,U);se=$h(re,$,ce,0,$.length,0,me-ae,Ae,Ae)}else se=L(re,$,ce,me-ae,be-me,U)}A.push(se),V.push(ke)}function v(K,z,A,V){let te=[],oe=0,F=-1;for(;p.pos>z;){let{id:ae,start:me,end:Te,size:be}=p;if(be>4)p.next();else{if(F>-1&&me<F)break;F<0&&(F=Te-o),te.push(ae,me,Te),oe++,p.next()}}if(oe){let ae=new Uint16Array(oe*4),me=te[te.length-2];for(let Te=te.length-3,be=0;Te>=0;Te-=3)ae[be++]=te[Te],ae[be++]=te[Te+1]-me,ae[be++]=te[Te+2]-me,ae[be++]=be;A.push(new Is(ae,te[2]-me,c)),V.push(me-K)}}function R(K,z){return(A,V,te)=>{let oe=0,F=A.length-1,ae,me;if(F>=0&&(ae=A[F])instanceof pl){if(!F&&ae.type==K&&ae.length==te)return ae;(me=ae.prop(Ht.lookAhead))&&(oe=V[F]+ae.length+me)}return L(K,A,V,te,oe,z)}}function T(K,z,A,V,te,oe,F,ae,me){let Te=[],be=[];for(;K.length>V;)Te.push(K.pop()),be.push(z.pop()+A-te);K.push(L(c.types[F],Te,be,oe-te,ae-oe,me)),z.push(te-A)}function L(K,z,A,V,te,oe,F){if(oe){let ae=[Ht.contextHash,oe];F=F?[ae].concat(F):[ae]}if(te>25){let ae=[Ht.lookAhead,te];F=F?[ae].concat(F):[ae]}return new pl(K,z,A,V,F)}function B(K,z){let A=p.fork(),V=0,te=0,oe=0,F=A.end-o,ae={size:0,start:0,skip:0};e:for(let me=A.pos-K;A.pos>me;){let Te=A.size;if(A.id==z&&Te>=0){ae.size=V,ae.start=te,ae.skip=oe,oe+=4,V+=4,A.next();continue}let be=A.pos-Te;if(Te<0||be<me||A.start<F)break;let U=A.id>=h?4:0,re=A.start;for(A.next();A.pos>be;){if(A.size<0)if(A.size==-3||A.size==-4)U+=4;else break e;else A.id>=h&&(U+=4);A.next()}te=re,V+=Te,oe+=U}return(z<0||V==K)&&(ae.size=V,ae.start=te,ae.skip=oe),ae.size>4?ae:void 0}function P(K,z,A){let{id:V,start:te,end:oe,size:F}=p;if(p.next(),F>=0&&V<h){let ae=A;if(F>4){let me=p.pos-(F-4);for(;p.pos>me;)A=P(K,z,A)}z[--A]=ae,z[--A]=oe-K,z[--A]=te-K,z[--A]=V}else F==-3?x=V:F==-4&&(y=V);return A}let M=[],Z=[];for(;p.pos>0;)j(a.start||0,a.bufferStart||0,M,Z,-1,0);let N=(l=a.length)!==null&&l!==void 0?l:M.length?Z[0]+M[0].length:0;return new pl(m[a.topID],M.reverse(),Z.reverse(),N)}const Db=new WeakMap;function Lo(a,l){if(!a.isAnonymous||l instanceof Is||l.type!=a)return 1;let i=Db.get(l);if(i==null){i=1;for(let c of l.children){if(c.type!=a||!(c instanceof pl)){i=1;break}i+=Lo(a,c)}Db.set(l,i)}return i}function $h(a,l,i,c,o,d,h,p,m){let x=0;for(let T=c;T<o;T++)x+=Lo(a,l[T]);let y=Math.ceil(x*1.5/8),j=[],v=[];function R(T,L,B,P,M){for(let Z=B;Z<P;){let N=Z,K=L[Z],z=Lo(a,T[Z]);for(Z++;Z<P;Z++){let A=Lo(a,T[Z]);if(z+A>=y)break;z+=A}if(Z==N+1){if(z>y){let A=T[N];R(A.children,A.positions,0,A.children.length,L[N]+M);continue}j.push(T[N])}else{let A=L[Z-1]+T[Z-1].length-K;j.push($h(a,T,L,N,Z,K,A,null,m))}v.push(K+M-d)}}return R(l,i,c,o,0),(p||m)(j,v,h)}class nN{constructor(){this.map=new WeakMap}setBuffer(l,i,c){let o=this.map.get(l);o||this.map.set(l,o=new Map),o.set(i,c)}getBuffer(l,i){let c=this.map.get(l);return c&&c.get(i)}set(l,i){l instanceof va?this.setBuffer(l.context.buffer,l.index,i):l instanceof Kn&&this.map.set(l.tree,i)}get(l){return l instanceof va?this.getBuffer(l.context.buffer,l.index):l instanceof Kn?this.map.get(l.tree):void 0}cursorSet(l,i){l.buffer?this.setBuffer(l.buffer.buffer,l.index,i):this.map.set(l.tree,i)}cursorGet(l){return l.buffer?this.getBuffer(l.buffer.buffer,l.index):this.map.get(l.tree)}}class Qc{constructor(l,i,c,o,d=!1,h=!1){this.from=l,this.to=i,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,i=[],c=!1){let o=[new Qc(0,l.length,l,0,!1,c)];for(let d of i)d.to>l.length&&o.push(d);return o}static applyChanges(l,i,c=128){if(!i.length)return l;let o=[],d=1,h=l.length?l[0]:null;for(let p=0,m=0,x=0;;p++){let y=p<i.length?i[p]:null,j=y?y.fromA:1e9;if(j-m>=c)for(;h&&h.from<j;){let v=h;if(m>=v.from||j<=v.to||x){let R=Math.max(v.from,m)-x,T=Math.min(v.to,j)-x;v=R>=T?null:new Qc(R,T,v.tree,v.offset+x,p>0,!!y)}if(v&&o.push(v),h.to>j)break;h=d<l.length?l[d++]:null}if(!y)break;m=y.toA,x=y.toA-y.toB}return o}}class lN{startParse(l,i,c){return typeof l=="string"&&(l=new Kv(l)),c=c?c.length?c.map(o=>new Ul(o.from,o.to)):[new Ul(0,0)]:[new Ul(0,l.length)],this.createParse(l,i||[],c)}parse(l,i,c){let o=this.startParse(l,i,c);for(;;){let d=o.advance();if(d)return d}}}class Kv{constructor(l){this.string=l}get length(){return this.string.length}chunk(l){return this.string.slice(l)}get lineChunks(){return!1}read(l,i){return this.string.slice(l,i)}}function aN(a){return(l,i,c,o)=>new Fv(l,a,i,c,o)}class zb{constructor(l,i,c,o,d,h){this.parser=l,this.parse=i,this.overlay=c,this.bracketed=o,this.target=d,this.from=h}}function Lb(a){if(!a.length||a.some(l=>l.from>=l.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(a))}class Jv{constructor(l,i,c,o,d,h,p,m){this.parser=l,this.predicate=i,this.mounts=c,this.index=o,this.start=d,this.bracketed=h,this.target=p,this.prev=m,this.depth=0,this.ranges=[]}}const Ah=new Ht({perNode:!0});class Fv{constructor(l,i,c,o,d){this.nest=i,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 pl(c.type,c.children,c.positions,c.length,c.propValues.concat([[Ah,this.stoppedAt]]))),c}let l=this.inner[this.innerDone],i=l.parse.advance();if(i){this.innerDone++;let c=Object.assign(Object.create(null),l.target.props);c[Ht.mounted.id]=new Nr(i,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 i=this.innerDone;i<this.inner.length;i++)this.inner[i].from<l&&(l=Math.min(l,this.inner[i].parse.parsedPos));return l}stopAt(l){if(this.stoppedAt=l,this.baseParse)this.baseParse.stopAt(l);else for(let i=this.innerDone;i<this.inner.length;i++)this.inner[i].parse.stopAt(l)}startInner(){let l=new e1(this.fragments),i=null,c=null,o=new qo(new Kn(this.baseTree,this.ranges[0].from,0,null),Lt.IncludeAnonymous|Lt.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(i){let x=i.mounts.find(y=>y.frag.from<=o.from&&y.frag.to>=o.to&&y.mount.overlay);if(x)for(let y of x.mount.overlay){let j=y.from+x.pos,v=y.to+x.pos;j>=o.from&&v<=o.to&&!i.ranges.some(R=>R.from<v&&R.to>j)&&i.ranges.push({from:j,to:v})}}p=!1}else if(c&&(h=Wv(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||(Pv(o),i&&i.depth++,c&&c.depth++);let x=l.findMounts(o.from,d.parser);if(typeof d.overlay=="function")i=new Jv(d.parser,d.overlay,x,this.inner.length,o.from,!!d.bracketed,o.tree,i);else{let y=Bb(this.ranges,d.overlay||(o.from<o.to?[new Ul(o.from,o.to)]:[]));y.length&&Lb(y),(y.length||!d.overlay)&&this.inner.push(new zb(d.parser,y.length?d.parser.startParse(this.input,qb(x,y),y):d.parser.startParse(""),d.overlay?d.overlay.map(j=>new Ul(j.from-o.from,j.to-o.from)):null,!!d.bracketed,o.tree,y.length?y[0].from:o.from)),d.overlay?y.length&&(c={ranges:y,depth:0,prev:c}):p=!1}}else if(i&&(m=i.predicate(o))&&(m===!0&&(m=new Ul(o.from,o.to)),m.from<m.to)){let x=i.ranges.length-1;x>=0&&i.ranges[x].to==m.from?i.ranges[x]={from:i.ranges[x].from,to:m.to}:i.ranges.push(m)}if(p&&o.firstChild())i&&i.depth++,c&&c.depth++;else for(;!o.nextSibling();){if(!o.parent())break e;if(i&&!--i.depth){let x=Bb(this.ranges,i.ranges);x.length&&(Lb(x),this.inner.splice(i.index,0,new zb(i.parser,i.parser.startParse(this.input,qb(i.mounts,x),x),i.ranges.map(y=>new Ul(y.from-i.start,y.to-i.start)),i.bracketed,i.target,x[0].from))),i=i.prev}c&&!--c.depth&&(c=c.prev)}}}}function Wv(a,l,i){for(let c of a){if(c.from>=i)break;if(c.to>l)return c.from<=l&&c.to>=i?2:1}return 0}function Ub(a,l,i,c,o,d){if(l<i){let h=a.buffer[l+1];c.push(a.slice(l,i,h)),o.push(h-d)}}function Pv(a){let{node:l}=a,i=[],c=l.context.buffer;do i.push(a.index),a.parent();while(!a.tree);let o=a.tree,d=o.children.indexOf(c),h=o.children[d],p=h.buffer,m=[d];function x(y,j,v,R,T,L){let B=i[L],P=[],M=[];Ub(h,y,B,P,M,R);let Z=p[B+1],N=p[B+2];m.push(P.length);let K=L?x(B+4,p[B+3],h.set.types[p[B]],Z,N-Z,L-1):l.toTree();return P.push(K),M.push(Z-R),Ub(h,p[B+3],j,P,M,R),new pl(v,P,M,T)}o.children[d]=x(0,p.length,Zl.none,0,h.length,i.length-1);for(let y of m){let j=a.tree.children[y],v=a.tree.positions[y];a.yield(new Kn(j,v+a.from,y,a._tree))}}class Hb{constructor(l,i){this.offset=i,this.done=!1,this.cursor=l.cursor(Lt.IncludeAnonymous|Lt.IgnoreMounts)}moveTo(l){let{cursor:i}=this,c=l-this.offset;for(;!this.done&&i.from<c;)if(!(i.to>=l&&i.enter(c,1,Lt.IgnoreOverlays|Lt.ExcludeBuffers)))if(i.to<=l)i.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 i=this.cursor.tree;;){if(i==l.tree)return!0;if(i.children.length&&i.positions[0]==0&&i.children[0]instanceof pl)i=i.children[0];else break}return!1}}class e1{constructor(l){var i;if(this.fragments=l,this.curTo=0,this.fragI=0,l.length){let c=this.curFrag=l[0];this.curTo=(i=c.tree.prop(Ah))!==null&&i!==void 0?i:c.to,this.inner=new Hb(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 i=this.curFrag=this.fragments[this.fragI];this.curTo=(l=i.tree.prop(Ah))!==null&&l!==void 0?l:i.to,this.inner=new Hb(i.tree,-i.offset)}}findMounts(l,i){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(Ht.mounted);if(h&&h.parser==i)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 Bb(a,l){let i=null,c=l;for(let o=1,d=0;o<a.length;o++){let h=a[o-1].to,p=a[o].from;for(;d<c.length;d++){let m=c[d];if(m.from>=p)break;m.to<=h||(i||(c=i=l.slice()),m.from<h?(i[d]=new Ul(m.from,h),m.to>p&&i.splice(d+1,0,new Ul(p,m.to))):m.to>p?i[d--]=new Ul(p,m.to):i.splice(d--,1))}}return c}function t1(a,l,i,c){let o=0,d=0,h=!1,p=!1,m=-1e9,x=[];for(;;){let y=o==a.length?1e9:h?a[o].to:a[o].from,j=d==l.length?1e9:p?l[d].to:l[d].from;if(h!=p){let v=Math.max(m,i),R=Math.min(y,j,c);v<R&&x.push(new Ul(v,R))}if(m=Math.min(y,j),m==1e9)break;y==m&&(h?(h=!1,o++):h=!0),j==m&&(p?(p=!1,d++):p=!0)}return x}function qb(a,l){let i=[];for(let{pos:c,mount:o,frag:d}of a){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 y=o.overlay.map(v=>new Ul(v.from+c,v.to+c)),j=t1(l,y,m,x);for(let v=0,R=m;;v++){let T=v==j.length,L=T?x:j[v].from;if(L>R&&i.push(new Qc(R,L,o.tree,-h,d.from>=R||d.openStart,d.to<=L||d.openEnd)),T)break;R=j[v].to}}else i.push(new Qc(m,x,o.tree,-h,d.from>=h||d.openStart,d.to<=p||d.openEnd))}return i}let n1=0;class Ll{constructor(l,i,c,o){this.name=l,this.set=i,this.base=c,this.modified=o,this.id=n1++}toString(){let{name:l}=this;for(let i of this.modified)i.name&&(l=`${i.name}(${l})`);return l}static define(l,i){let c=typeof l=="string"?l:"?";if(l instanceof Ll&&(i=l),i!=null&&i.base)throw new Error("Can not derive from a modified tag");let o=new Ll(c,[],null,[]);if(o.set.push(o),i)for(let d of i.set)o.set.push(d);return o}static defineModifier(l){let i=new Io(l);return c=>c.modified.indexOf(i)>-1?c:Io.get(c.base||c,c.modified.concat(i).sort((o,d)=>o.id-d.id))}}let l1=0;class Io{constructor(l){this.name=l,this.instances=[],this.id=l1++}static get(l,i){if(!i.length)return l;let c=i[0].instances.find(p=>p.base==l&&a1(i,p.modified));if(c)return c;let o=[],d=new Ll(l.name,o,l,i);for(let p of i)p.instances.push(d);let h=s1(i);for(let p of l.set)if(!p.modified.length)for(let m of h)o.push(Io.get(p,m));return d}}function a1(a,l){return a.length==l.length&&a.every((i,c)=>i==l[c])}function s1(a){let l=[[]];for(let i=0;i<a.length;i++)for(let c=0,o=l.length;c<o;c++)l.push(l[c].concat(a[i]));return l.sort((i,c)=>c.length-i.length)}function sN(a){let l=Object.create(null);for(let i in a){let c=a[i];Array.isArray(c)||(c=[c]);for(let o of i.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 R=o[j++];if(j==o.length&&R=="!"){h=0;break}if(R!="/")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 y=new Zc(c,h,m>0?d.slice(0,m):null);l[x]=y.sort(l[x])}}return Px.add(l)}const Px=new Ht({combine(a,l){let i,c,o;for(;a||l;){if(!a||l&&a.depth>=l.depth?(o=l,l=l.next):(o=a,a=a.next),i&&i.mode==o.mode&&!o.context&&!i.context)continue;let d=new Zc(o.tags,o.mode,o.context);i?i.next=d:c=d,i=d}return c}});class Zc{constructor(l,i,c,o){this.tags=l,this.mode=i,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}}Zc.empty=new Zc([],2,null);function ey(a,l){let i=Object.create(null);for(let d of a)if(!Array.isArray(d.tag))i[d.tag.id]=d.class;else for(let h of d.tag)i[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=i[m.id];if(x){h=h?h+" "+x:x;break}}return h},scope:c}}function i1(a,l){let i=null;for(let c of a){let o=c.style(l);o&&(i=i?i+" "+o:o)}return i}function r1(a,l,i,c=0,o=a.length){let d=new u1(c,Array.isArray(l)?l:[l],i);d.highlightRange(a.cursor(),c,o,"",d.highlighters),d.flush(o)}function c1(a,l,i,c,o,d=0,h=a.length){let p=d;function m(x,y){if(!(x<=p)){for(let j=a.slice(p,x),v=0;;){let R=j.indexOf(`
116
- `,v),T=R<0?j.length:R;if(T>v&&c(j.slice(v,T),y),R<0)break;o(),v=R+1}p=x}}r1(l,i,(x,y,j)=>{m(x,""),m(y,j)},d,h),m(h,"")}class u1{constructor(l,i,c){this.at=l,this.highlighters=i,this.span=c,this.class=""}startSpan(l,i){i!=this.class&&(this.flush(l),l>this.at&&(this.at=l),this.class=i)}flush(l){l>this.at&&this.class&&this.span(this.at,l,this.class)}highlightRange(l,i,c,o,d){let{type:h,from:p,to:m}=l;if(p>=c||m<=i)return;h.isTop&&(d=this.highlighters.filter(R=>!R.scope||R.scope(h)));let x=o,y=o1(l)||Zc.empty,j=i1(d,y.tags);if(j&&(x&&(x+=" "),x+=j,y.mode==1&&(o+=(o?" ":"")+j)),this.startSpan(Math.max(i,p),x),y.opaque)return;let v=l.tree&&l.tree.prop(Ht.mounted);if(v&&v.overlay){let R=l.node.enter(v.overlay[0].from+p,1),T=this.highlighters.filter(B=>!B.scope||B.scope(v.tree.type)),L=l.firstChild();for(let B=0,P=p;;B++){let M=B<v.overlay.length?v.overlay[B]:null,Z=M?M.from+p:m,N=Math.max(i,P),K=Math.min(c,Z);if(N<K&&L)for(;l.from<K&&(this.highlightRange(l,N,K,o,d),this.startSpan(Math.min(K,l.to),x),!(l.to>=Z||!l.nextSibling())););if(!M||Z>c)break;P=M.to+p,P>i&&(this.highlightRange(R.cursor(),Math.max(i,M.from+p),Math.min(c,P),"",T),this.startSpan(Math.min(c,P),x))}L&&l.parent()}else if(l.firstChild()){v&&(o="");do if(!(l.to<=i)){if(l.from>=c)break;this.highlightRange(l,i,c,o,d),this.startSpan(Math.min(c,l.to),x)}while(l.nextSibling());l.parent()}}}function o1(a){let l=a.type.prop(Px);for(;l&&l.context&&!a.matchContext(l.context);)l=l.next;return l||null}const ge=Ll.define,ko=ge(),Ls=ge(),Ib=ge(Ls),Gb=ge(Ls),Us=ge(),No=ge(Us),uh=ge(Us),xa=ge(),ji=ge(xa),ha=ge(),pa=ge(),Ch=ge(),Hc=ge(Ch),wo=ge(),je={comment:ko,lineComment:ge(ko),blockComment:ge(ko),docComment:ge(ko),name:Ls,variableName:ge(Ls),typeName:Ib,tagName:ge(Ib),propertyName:Gb,attributeName:ge(Gb),className:ge(Ls),labelName:ge(Ls),namespace:ge(Ls),macroName:ge(Ls),literal:Us,string:No,docString:ge(No),character:ge(No),attributeValue:ge(No),number:uh,integer:ge(uh),float:ge(uh),bool:ge(Us),regexp:ge(Us),escape:ge(Us),color:ge(Us),url:ge(Us),keyword:ha,self:ge(ha),null:ge(ha),atom:ge(ha),unit:ge(ha),modifier:ge(ha),operatorKeyword:ge(ha),controlKeyword:ge(ha),definitionKeyword:ge(ha),moduleKeyword:ge(ha),operator:pa,derefOperator:ge(pa),arithmeticOperator:ge(pa),logicOperator:ge(pa),bitwiseOperator:ge(pa),compareOperator:ge(pa),updateOperator:ge(pa),definitionOperator:ge(pa),typeOperator:ge(pa),controlOperator:ge(pa),punctuation:Ch,separator:ge(Ch),bracket:Hc,angleBracket:ge(Hc),squareBracket:ge(Hc),paren:ge(Hc),brace:ge(Hc),content:xa,heading:ji,heading1:ge(ji),heading2:ge(ji),heading3:ge(ji),heading4:ge(ji),heading5:ge(ji),heading6:ge(ji),contentSeparator:ge(xa),list:ge(xa),quote:ge(xa),emphasis:ge(xa),strong:ge(xa),link:ge(xa),monospace:ge(xa),strikethrough:ge(xa),inserted:ge(),deleted:ge(),changed:ge(),invalid:ge(),meta:wo,documentMeta:ge(wo),annotation:ge(wo),processingInstruction:ge(wo),definition:Ll.defineModifier("definition"),constant:Ll.defineModifier("constant"),function:Ll.defineModifier("function"),standard:Ll.defineModifier("standard"),local:Ll.defineModifier("local"),special:Ll.defineModifier("special")};for(let a in je){let l=je[a];l instanceof Ll&&(l.name=a)}ey([{tag:je.link,class:"tok-link"},{tag:je.heading,class:"tok-heading"},{tag:je.emphasis,class:"tok-emphasis"},{tag:je.strong,class:"tok-strong"},{tag:je.keyword,class:"tok-keyword"},{tag:je.atom,class:"tok-atom"},{tag:je.bool,class:"tok-bool"},{tag:je.url,class:"tok-url"},{tag:je.labelName,class:"tok-labelName"},{tag:je.inserted,class:"tok-inserted"},{tag:je.deleted,class:"tok-deleted"},{tag:je.literal,class:"tok-literal"},{tag:je.string,class:"tok-string"},{tag:je.number,class:"tok-number"},{tag:[je.regexp,je.escape,je.special(je.string)],class:"tok-string2"},{tag:je.variableName,class:"tok-variableName"},{tag:je.local(je.variableName),class:"tok-variableName tok-local"},{tag:je.definition(je.variableName),class:"tok-variableName tok-definition"},{tag:je.special(je.variableName),class:"tok-variableName2"},{tag:je.definition(je.propertyName),class:"tok-propertyName tok-definition"},{tag:je.typeName,class:"tok-typeName"},{tag:je.namespace,class:"tok-namespace"},{tag:je.className,class:"tok-className"},{tag:je.macroName,class:"tok-macroName"},{tag:je.propertyName,class:"tok-propertyName"},{tag:je.operator,class:"tok-operator"},{tag:je.comment,class:"tok-comment"},{tag:je.meta,class:"tok-meta"},{tag:je.invalid,class:"tok-invalid"},{tag:je.punctuation,class:"tok-punctuation"}]);const f1="modulepreload",d1=function(a,l){return new URL(a,l).href},Yb={},Xe=function(l,i,c){let o=Promise.resolve();if(i&&i.length>0){let h=function(y){return Promise.all(y.map(j=>Promise.resolve(j).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};const 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(i.map(y=>{if(y=d1(y,c),y in Yb)return;Yb[y]=!0;const j=y.endsWith(".css"),v=j?'[rel="stylesheet"]':"";if(!!c)for(let L=p.length-1;L>=0;L--){const B=p[L];if(B.href===y&&(!j||B.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${y}"]${v}`))return;const T=document.createElement("link");if(T.rel=j?"stylesheet":f1,j||(T.as="script"),T.crossOrigin="",T.href=y,x&&T.setAttribute("nonce",x),document.head.appendChild(T),j)return new Promise((L,B)=>{T.addEventListener("load",L),T.addEventListener("error",()=>B(new Error(`Unable to preload CSS for ${y}`)))})}))}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)})},ty={js:async()=>(await Xe(async()=>{const{javascript:a}=await import("./index-BZMuV7wL.js");return{javascript:a}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({jsx:!0}),cjs:async()=>(await Xe(async()=>{const{javascript:a}=await import("./index-BZMuV7wL.js");return{javascript:a}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript(),mjs:async()=>(await Xe(async()=>{const{javascript:a}=await import("./index-BZMuV7wL.js");return{javascript:a}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript(),jsx:async()=>(await Xe(async()=>{const{javascript:a}=await import("./index-BZMuV7wL.js");return{javascript:a}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({jsx:!0}),ts:async()=>(await Xe(async()=>{const{javascript:a}=await import("./index-BZMuV7wL.js");return{javascript:a}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),mts:async()=>(await Xe(async()=>{const{javascript:a}=await import("./index-BZMuV7wL.js");return{javascript:a}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),cts:async()=>(await Xe(async()=>{const{javascript:a}=await import("./index-BZMuV7wL.js");return{javascript:a}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),tsx:async()=>(await Xe(async()=>{const{javascript:a}=await import("./index-BZMuV7wL.js");return{javascript:a}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0,jsx:!0}),json:async()=>(await Xe(async()=>{const{json:a}=await import("./index-BnX4KThz.js");return{json:a}},__vite__mapDeps([6,1,2,3,4]),import.meta.url)).json(),jsonc:async()=>(await Xe(async()=>{const{json:a}=await import("./index-BnX4KThz.js");return{json:a}},__vite__mapDeps([6,1,2,3,4]),import.meta.url)).json(),css:async()=>(await Xe(async()=>{const{css:a}=await import("./index-MEYLoAjh.js");return{css:a}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),scss:async()=>(await Xe(async()=>{const{css:a}=await import("./index-MEYLoAjh.js");return{css:a}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),less:async()=>(await Xe(async()=>{const{css:a}=await import("./index-MEYLoAjh.js");return{css:a}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),html:async()=>(await Xe(async()=>{const{html:a}=await import("./index-BmDgU61K.js");return{html:a}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),htm:async()=>(await Xe(async()=>{const{html:a}=await import("./index-BmDgU61K.js");return{html:a}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),vue:async()=>(await Xe(async()=>{const{html:a}=await import("./index-BmDgU61K.js");return{html:a}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),svelte:async()=>(await Xe(async()=>{const{html:a}=await import("./index-BmDgU61K.js");return{html:a}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),md:async()=>(await Xe(async()=>{const{markdown:a}=await import("./index-CzJCmwIj.js");return{markdown:a}},__vite__mapDeps([9,3,4,2,5,8,1,7,0]),import.meta.url)).markdown(),markdown:async()=>(await Xe(async()=>{const{markdown:a}=await import("./index-CzJCmwIj.js");return{markdown:a}},__vite__mapDeps([9,3,4,2,5,8,1,7,0]),import.meta.url)).markdown(),py:async()=>(await Xe(async()=>{const{python:a}=await import("./index-B11vIedv.js");return{python:a}},__vite__mapDeps([10,1,2,3,4,5]),import.meta.url)).python(),pyi:async()=>(await Xe(async()=>{const{python:a}=await import("./index-B11vIedv.js");return{python:a}},__vite__mapDeps([10,1,2,3,4,5]),import.meta.url)).python(),yaml:async()=>(await Xe(async()=>{const{yaml:a}=await import("./index-CIOcaugJ.js");return{yaml:a}},__vite__mapDeps([11,1,2,3,4]),import.meta.url)).yaml(),yml:async()=>(await Xe(async()=>{const{yaml:a}=await import("./index-CIOcaugJ.js");return{yaml:a}},__vite__mapDeps([11,1,2,3,4]),import.meta.url)).yaml(),rs:async()=>(await Xe(async()=>{const{rust:a}=await import("./index-Cg-P0Yp1.js");return{rust:a}},__vite__mapDeps([12,1,2,3,4]),import.meta.url)).rust(),c:async()=>(await Xe(async()=>{const{cpp:a}=await import("./index-BH51XSCv.js");return{cpp:a}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),h:async()=>(await Xe(async()=>{const{cpp:a}=await import("./index-BH51XSCv.js");return{cpp:a}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),cc:async()=>(await Xe(async()=>{const{cpp:a}=await import("./index-BH51XSCv.js");return{cpp:a}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),cpp:async()=>(await Xe(async()=>{const{cpp:a}=await import("./index-BH51XSCv.js");return{cpp:a}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),hpp:async()=>(await Xe(async()=>{const{cpp:a}=await import("./index-BH51XSCv.js");return{cpp:a}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),java:async()=>(await Xe(async()=>{const{java:a}=await import("./index-CJJjf7QW.js");return{java:a}},__vite__mapDeps([14,1,2,3,4]),import.meta.url)).java(),go:async()=>(await Xe(async()=>{const{go:a}=await import("./index-TS7xklzI.js");return{go:a}},__vite__mapDeps([15,1,2,3,4,5]),import.meta.url)).go(),php:async()=>(await Xe(async()=>{const{php:a}=await import("./index-BCuOAg0C.js");return{php:a}},__vite__mapDeps([16,1,8,7,2,3,4,0,5]),import.meta.url)).php(),sql:async()=>(await Xe(async()=>{const{sql:a}=await import("./index-BMlMiQH4.js");return{sql:a}},__vite__mapDeps([17,2,3,4,1,5]),import.meta.url)).sql(),xml:async()=>(await Xe(async()=>{const{xml:a}=await import("./index-BMtQHCPD.js");return{xml:a}},__vite__mapDeps([18,1,2,3,4]),import.meta.url)).xml(),svg:async()=>(await Xe(async()=>{const{xml:a}=await import("./index-BMtQHCPD.js");return{xml:a}},__vite__mapDeps([18,1,2,3,4]),import.meta.url)).xml()},h1={".mcp.json":"json",dockerfile:"yaml",makefile:"yaml"},p1={javascript:"js",node:"js",typescript:"ts",python:"py",python3:"py",yml:"yaml",rust:"rs",golang:"go","c++":"cpp",cplusplus:"cpp"};async function m1(a){const l=p1[a.toLowerCase()]??a.toLowerCase(),i=ty[l];return i?i().catch(()=>null):null}async function g1(a){const l=(a.split("/").pop()??"").toLowerCase(),i=h1[l]??l.split(".").pop()??"",c=ty[i];return c?c().catch(()=>null):null}const b1=ey([{tag:[je.keyword,je.modifier,je.controlKeyword,je.moduleKeyword],class:"cmh-key"},{tag:[je.propertyName],class:"cmh-prop"},{tag:[je.function(je.variableName),je.labelName],class:"cmh-fn"},{tag:[je.color,je.constant(je.name),je.standard(je.name),je.bool],class:"cmh-const"},{tag:[je.typeName,je.className,je.changed,je.annotation,je.self,je.namespace],class:"cmh-type"},{tag:[je.number,je.integer,je.float],class:"cmh-num"},{tag:[je.string,je.special(je.string),je.regexp],class:"cmh-str"},{tag:[je.operator,je.operatorKeyword,je.escape],class:"cmh-op"},{tag:[je.meta,je.comment],class:"cmh-comment"},{tag:je.invalid,class:"cmh-invalid"}]);function To(a){return a.replace(/[&<>]/g,l=>l==="&"?"&amp;":l==="<"?"&lt;":"&gt;")}async function x1(a,l){const i=l?await m1(l):null;if(!i)return To(a);try{const c=i.language.parser.parse(a);let o="";return c1(a,c,b1,(d,h)=>{o+=h?`<span class="${h}">${To(d)}</span>`:To(d)},()=>{o+=`
117
- `}),o}catch{return To(a)}}bt.setOptions({gfm:!0,breaks:!1});function ny(a){var i;const l=(i=a.split(".").pop())==null?void 0:i.toLowerCase();return l==="md"||l==="markdown"}async function Qh(a){const l=await bt.parse(a,{async:!0,walkTokens:async i=>{if(i.type!=="code")return;const c=i;c.text=await x1(c.text,c.lang??""),c.escaped=!0}});return Iv.sanitize(l)}function Xb(a,l){return{path:a.path,text:a.content,saved:a.content,eol:a.eol,encoding:a.encoding,mtime:a.mtime,size:a.size,binary:a.binary,tooLarge:a.tooLarge,stale:!1,revision:l,previewMode:ny(a.path)}}function Fa(a){return!a.binary&&!a.tooLarge&&a.text!==a.saved}function y1(a){return a.split("/").pop()??a}function Oi(a){const l=a.lastIndexOf("/");return l===-1?"":a.slice(0,l)}function oh(a){return a<1024?`${a} Б`:a<1024*1024?`${(a/1024).toFixed(1)} КБ`:`${(a/1024/1024).toFixed(1)} МБ`}function Yc({x:a,y:l,items:i,note:c,onClose:o}){const d=_.useRef(null),[h,p]=_.useState({left:a,top:l}),[m,x]=_.useState(()=>{const v=i.findIndex(R=>!R.disabled);return v===-1?0:v});_.useLayoutEffect(()=>{const v=d.current;if(!v)return;const R=v.getBoundingClientRect(),T=8,L=Math.max(T,Math.min(a,window.innerWidth-R.width-T)),B=Math.max(T,Math.min(l,window.innerHeight-R.height-T));p({left:L,top:B})},[a,l]),_.useLayoutEffect(()=>{var v;(v=d.current)==null||v.focus()},[]),_.useLayoutEffect(()=>{function v(T){var L;(L=d.current)!=null&&L.contains(T.target)||o()}function R(){o()}return document.addEventListener("mousedown",v),document.addEventListener("scroll",R,!0),()=>{document.removeEventListener("mousedown",v),document.removeEventListener("scroll",R,!0)}},[o]);function y(v){v.disabled||(v.onSelect(),o())}function j(v){if(v.key==="Escape"){v.preventDefault(),v.stopPropagation(),o();return}const R=i.map((T,L)=>({item:T,index:L})).filter(T=>!T.item.disabled);if(R.length!==0){if(v.key==="ArrowDown"||v.key==="ArrowUp"){v.preventDefault();const T=v.key==="ArrowDown"?1:-1,L=R.findIndex(P=>P.index===m),B=R[(((L===-1?0:L)+T)%R.length+R.length)%R.length];B&&x(B.index);return}if(v.key==="Enter"||v.key===" "){v.preventDefault();const T=i[m];T&&y(T)}}}return r.jsxs("div",{ref:d,className:"ctxmenu",style:{left:h.left,top:h.top},role:"menu",tabIndex:-1,onKeyDown:j,children:[c&&r.jsx("div",{className:"ctxmenu__note",children:c}),i.map((v,R)=>r.jsxs("button",{type:"button",role:"menuitem","aria-disabled":v.disabled,className:"ctxmenu__item"+(R===m?" is-cursor":""),onMouseEnter:()=>x(R),onClick:()=>y(v),children:[r.jsx("span",{className:"ctxmenu__label",children:v.label}),v.hint&&r.jsx("span",{className:"ctxmenu__hint",children:v.hint})]},v.id))]})}const _1=3500,v1=9e3,Vb=220;function Ui({result:a,onDismiss:l}){const[i,c]=_.useState(a),[o,d]=_.useState(!1);if(_.useEffect(()=>{if(!a){c(null),d(!1);return}if(c(a),d(!1),a.url)return;const p=a.ok?_1:v1,m=setTimeout(()=>d(!0),p),x=setTimeout(()=>c(null),p+Vb);return()=>{clearTimeout(m),clearTimeout(x)}},[a]),!i)return null;const h=()=>{d(!0),setTimeout(()=>{c(null),l==null||l()},Vb)};return r.jsxs("div",{className:"oplog "+(i.ok?"oplog--ok":"oplog--bad")+(o?" oplog--leaving":"")+(i.url?" oplog--dismissible":""),role:"status","aria-live":i.ok?"polite":"assertive",children:[i.message,i.url&&r.jsxs("a",{className:"oplog__link",href:i.url,target:"_blank",rel:"noreferrer",onClick:p=>p.stopPropagation(),children:[i.url.replace(/^https?:\/\//,"")," ↗"]}),i.url&&l&&r.jsx("button",{type:"button",className:"oplog__dismiss",title:"Закрыть","aria-label":"Закрыть сообщение",onClick:h,children:"✕"})]})}function Kc({value:a,className:l,placeholder:i="Название сессии",onCommit:c,onCancel:o}){const[d,h]=_.useState(a),p=_.useRef(null);_.useEffect(()=>{var x;(x=p.current)==null||x.select()},[]);function m(){const x=d.trim();if(!x||x===a)return o();c(x)}return r.jsx("input",{ref:p,className:l?`rename ${l}`:"rename",value:d,autoFocus:!0,spellCheck:!1,placeholder:i,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 Hr({active:a}){return a?r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("path",{d:"M2 5h3V2"}),r.jsx("path",{d:"M14 5h-3V2"}),r.jsx("path",{d:"M2 11h3v3"}),r.jsx("path",{d:"M14 11h-3v3"})]}):r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("path",{d:"M5 2H2v3"}),r.jsx("path",{d:"M11 2h3v3"}),r.jsx("path",{d:"M2 11v3h3"}),r.jsx("path",{d:"M14 11v3h-3"})]})}const S1=500,ki="application/x-ccv-fs-path",j1=200;function k1({open:a,tree:l,expanded:i,activePath:c,dirty:o,gitChanges:d,result:h,searchResult:p,onSearch:m,onReveal:x,onToggle:y,onOpen:j,onCreate:v,onRename:R,onMove:T,onCopy:L,onDelete:B,onRefresh:P,onClose:M,zoomed:Z,onToggleZoom:N}){const[K,z]=_.useState(""),[A,V]=_.useState(null),[te,oe]=_.useState(null),[F,ae]=_.useState(null),[me,Te]=_.useState(null),[be,U]=_.useState(null),[re,se]=_.useState(null),pe=$o("(hover: hover)"),ke=_.useRef(null),k=_.useMemo(()=>T1(d),[d]);function $(E){return!(!F||E===F.path||F.kind==="dir"&&E.startsWith(`${F.path}/`)||E===Oi(F.path))}function ce(E){return!(!be||E===be.path||be.kind==="dir"&&E.startsWith(`${be.path}/`)||be.mode==="cut"&&E===Oi(be.path))}function he(E){U({path:E.path,kind:E.kind,mode:"copy"})}function Ne(E){U({path:E.path,kind:E.kind,mode:"cut"})}function ye(E){!be||!ce(E)||(E&&!i.has(E)&&y(E),be.mode==="cut"?(T(be.path,E),U(null)):L(be.path,E))}function Ae(E,Y){const _e=E.touches[0];if(!_e)return;const O={timer:0,x:_e.clientX,y:_e.clientY,el:E.currentTarget,fired:!1};O.timer=window.setTimeout(()=>{O.fired=!0,Y(O.x,O.y,O.el)},S1),ke.current=O}function st(E){const Y=ke.current,_e=E.touches[0];!Y||!_e||Math.hypot(_e.clientX-Y.x,_e.clientY-Y.y)>10&&(window.clearTimeout(Y.timer),ke.current=null)}function Qe(E){const Y=ke.current;Y&&(window.clearTimeout(Y.timer),Y.fired&&E.preventDefault())}function Ot(){var E;return(E=ke.current)!=null&&E.fired?(ke.current=null,!0):!1}function qe(E,Y,_e,O){z((O==null?void 0:O.path)??""),se({x:E,y:Y,opener:_e,entry:O})}function xt(){const E=re==null?void 0:re.opener;se(null),E!=null&&E.isConnected&&E.focus()}function et(E){return{onContextMenu:Y=>{Y.preventDefault(),qe(Y.clientX,Y.clientY,Y.currentTarget,E)},onTouchStart:Y=>Ae(Y,(_e,O,J)=>qe(_e,O,J,E)),onTouchMove:st,onTouchEnd:Qe,onTouchCancel:Qe}}function Je(E){E.target===E.currentTarget&&(E.preventDefault(),qe(E.clientX,E.clientY,E.currentTarget,null))}function Fe(E){E.target===E.currentTarget&&Ae(E,(Y,_e,O)=>qe(Y,_e,O,null))}function it(E){if(!(E.ctrlKey||E.metaKey)||E.target instanceof HTMLInputElement)return;const Y=E.key.toLowerCase();if(Y==="v"){E.preventDefault(),ye(fn());return}if(!K)return;const _e=$b(l,K);_e&&(Y==="c"?(E.preventDefault(),he(_e)):Y==="x"&&(E.preventDefault(),Ne(_e)))}function Jn(E){return Y=>{Y.dataTransfer.effectAllowed="move",Y.dataTransfer.setData(ki,E.path),ae({path:E.path,kind:E.kind})}}function Bt(){ae(null),Te(null)}function qt(E){return Y=>{Y.dataTransfer.types.includes(ki)&&(Y.stopPropagation(),!(E.kind!=="dir"||!$(E.path))&&(Y.preventDefault(),Te(E.path)))}}function Kt(E){return Y=>{if(!Y.dataTransfer.types.includes(ki)||(Y.stopPropagation(),E.kind!=="dir"||!$(E.path)))return;Y.preventDefault();const _e=Y.dataTransfer.getData(ki);Te(null),_e&&T(_e,E.path)}}function It(E){!E.dataTransfer.types.includes(ki)||!$("")||(E.preventDefault(),Te(""))}function Gt(E){if(!E.dataTransfer.types.includes(ki)||!$(""))return;E.preventDefault();const Y=E.dataTransfer.getData(ki);Te(null),Y&&T(Y,"")}const[Qt,rt]=_.useState(""),wt=Qt.trim(),en=wt.length>0,En=_.useRef(null),Ct=_.useRef(m);Ct.current=m;function kn(E){rt(E),En.current&&clearTimeout(En.current);const Y=E.trim();if(!Y){Ct.current("");return}En.current=setTimeout(()=>Ct.current(Y),j1)}function An(E){En.current&&clearTimeout(En.current),rt(""),Ct.current(""),z(E.path),x(E)}const Dt=en&&(p==null?void 0:p.query)===wt?p:null;function fn(){if(K==="")return"";const E=$b(l,K);if((E==null?void 0:E.kind)==="dir")return K;const Y=K.lastIndexOf("/");return Y===-1?"":K.slice(0,Y)}function Jt(E,Y){const _e=Y??fn();_e&&!i.has(_e)&&y(_e),oe({parent:_e,kind:E})}function Tt(){if(!re)return[];const E=O=>pe?O:void 0;if(!re.entry)return[{id:"paste",label:"Вставить в корень проекта",hint:E("Ctrl+V"),disabled:!ce(""),onSelect:()=>ye("")},{id:"new-file",label:"Создать файл",onSelect:()=>Jt("file","")},{id:"new-dir",label:"Создать каталог",onSelect:()=>Jt("dir","")}];const Y=re.entry,_e=[Y.kind==="file"?{id:"open",label:"Открыть",onSelect:()=>j(Y.path)}:{id:"toggle",label:i.has(Y.path)?"Свернуть":"Развернуть",onSelect:()=>y(Y.path)},{id:"copy",label:"Копировать",hint:E("Ctrl+C"),onSelect:()=>he(Y)},{id:"cut",label:"Вырезать",hint:E("Ctrl+X"),onSelect:()=>Ne(Y)}];return Y.kind==="dir"&&(_e.push({id:"paste",label:"Вставить",hint:E("Ctrl+V"),disabled:!ce(Y.path),onSelect:()=>ye(Y.path)}),_e.push({id:"new-file",label:"Создать файл",onSelect:()=>Jt("file",Y.path)}),_e.push({id:"new-dir",label:"Создать каталог",onSelect:()=>Jt("dir",Y.path)})),_e.push({id:"rename",label:"Переименовать",onSelect:()=>V(Y.path)}),_e.push({id:"delete",label:"Удалить",onSelect:()=>B(Y)}),_e}const dn=en?[]:ot("",0);function ot(E,Y){const _e=l[E],O=[];if(te&&te.parent===E&&O.push(r.jsxs("div",{className:"fsrow fsrow--draft",style:Wa(Y),children:[r.jsx("span",{className:"fsrow__icon",children:te.kind==="dir"?r.jsx(Yo,{}):r.jsx(Xo,{})}),r.jsx(Kc,{className:"rename--file",value:"",placeholder:te.kind==="dir"?"имя каталога":"имя файла",onCommit:J=>{oe(null),v(E,te.kind,J)},onCancel:()=>oe(null)})]},`draft:${E}`)),!_e)return O.push(r.jsx("p",{className:"fsrow__pending",style:Wa(Y),children:"читаем…"},`wait:${E}`)),O;_e.length===0&&!te&&O.push(r.jsx("p",{className:"fsrow__pending",style:Wa(Y),children:"пусто"},`empty:${E}`));for(const J of _e){const xe=J.kind==="dir"&&i.has(J.path);O.push(A===J.path?r.jsxs("div",{className:"fsrow fsrow--draft",style:Wa(Y),children:[r.jsx("span",{className:"fsrow__icon",children:J.kind==="dir"?r.jsx(Yo,{open:xe}):r.jsx(Xo,{})}),r.jsx(Kc,{className:"rename--file",value:J.name,placeholder:"новое имя",onCommit:Be=>{V(null),R(J.path,Be)},onCancel:()=>V(null)})]},J.path):r.jsx(N1,{entry:J,depth:Y,open:xe,active:J.path===c,selected:J.path===K,dirty:o.has(J.path),gitStatus:k.get(J.path),dragging:(F==null?void 0:F.path)===J.path,dropTarget:me===J.path,cut:(be==null?void 0:be.mode)==="cut"&&be.path===J.path,onClick:()=>{Ot()||(z(J.path),J.kind==="dir"?y(J.path):j(J.path))},onRename:()=>V(J.path),onDelete:()=>B(J),onDragStart:Jn(J),onDragEnd:Bt,onDragOver:qt(J),onDrop:Kt(J),...et(J)},J.path)),xe&&O.push(...ot(J.path,Y+1))}return O}function tn(){if(!Dt)return[r.jsx("p",{className:"fsrow__pending",style:Wa(0),children:"ищем…"},"search:wait")];if(Dt.entries.length===0)return[r.jsx("p",{className:"fsrow__pending",style:Wa(0),children:"ничего не найдено"},"search:empty")];const E=Dt.entries.map(Y=>r.jsx(w1,{entry:Y,gitStatus:k.get(Y.path),onClick:()=>An(Y)},Y.path));return Dt.truncated&&E.push(r.jsxs("p",{className:"fsrow__pending",style:Wa(0),children:["показаны первые ",Dt.entries.length," — уточните запрос"]},"search:truncated")),E}return r.jsxs("aside",{className:(a?"sidepane sidepane--files sidepane--open":"sidepane sidepane--files")+(Z?" sidepane--zoomed":""),"aria-label":"Файлы проекта",onKeyDown:it,children:[r.jsxs("div",{className:"sidepane__head",onDoubleClick:E=>{N&&(E.target.closest("button")||N())},children:[r.jsx(R1,{}),r.jsx("span",{className:"sidepane__title",children:"Файлы"}),r.jsx("button",{className:"sidepane__btn",title:"Новый файл","aria-label":"Новый файл",onClick:()=>Jt("file"),children:r.jsx(A1,{})}),r.jsx("button",{className:"sidepane__btn",title:"Новый каталог","aria-label":"Новый каталог",onClick:()=>Jt("dir"),children:r.jsx(C1,{})}),r.jsx("button",{className:"sidepane__btn",title:"Перечитать дерево","aria-label":"Перечитать дерево",onClick:P,children:"↻"}),N&&r.jsx("button",{className:"sidepane__btn",title:Z?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":Z?"Свернуть панель файлов":"Развернуть панель файлов на весь экран","aria-pressed":Z,onClick:N,children:r.jsx(Hr,{active:Z})}),r.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель файлов",onClick:M,children:"✕"})]}),r.jsxs("div",{className:"fssearch",children:[r.jsx(M1,{}),r.jsx("input",{className:"fssearch__input",type:"text",value:Qt,spellCheck:!1,placeholder:"Поиск файлов и папок…","aria-label":"Поиск файлов и папок",onChange:E=>kn(E.target.value),onKeyDown:E=>{E.stopPropagation(),E.key==="Escape"&&(E.preventDefault(),Qt?kn(""):E.currentTarget.blur())}}),Qt&&r.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>kn(""),children:"✕"})]}),r.jsx("div",{className:"sidepane__scroll fstree"+(me===""?" fstree--drop-target":""),tabIndex:-1,onDragOver:It,onDrop:Gt,onContextMenu:Je,onTouchStart:Fe,onTouchMove:st,onTouchEnd:Qe,onTouchCancel:Qe,children:en?tn():dn}),r.jsx(Ui,{result:h}),re&&r.jsx(Yc,{x:re.x,y:re.y,items:Tt(),onClose:xt})]})}function N1({entry:a,depth:l,open:i,active:c,selected:o,dirty:d,gitStatus:h,dragging:p,dropTarget:m,cut:x,onClick:y,onRename:j,onDelete:v,onDragStart:R,onDragEnd:T,onDragOver:L,onDrop:B,onContextMenu:P,onTouchStart:M,onTouchMove:Z,onTouchEnd:N,onTouchCancel:K}){const z="fsrow"+(c?" is-open":"")+(o&&!c?" is-selected":"")+(a.ignored?" fsrow--ignored":"")+(p?" fsrow--dragging":"")+(m?" fsrow--drop-target":"")+(x?" fsrow--cut":"");return r.jsxs("div",{className:z,style:Wa(l),draggable:!0,onDragStart:R,onDragEnd:T,onDragOver:L,onDrop:B,onContextMenu:P,onTouchStart:M,onTouchMove:Z,onTouchEnd:N,onTouchCancel:K,children:[r.jsxs("button",{className:"fsrow__main",onClick:y,title:ly(a),children:[r.jsx("span",{className:"fsrow__icon"+Go("fsrow__icon",h),children:a.kind==="dir"?r.jsx(Yo,{open:i}):r.jsx(Xo,{})}),r.jsx("span",{className:"fsrow__name"+Go("fsrow__name",h),children:a.name}),a.ignored&&r.jsx("span",{className:"fsrow__tag",title:"Игнорируется git (.gitignore)",children:"git-ignore"}),d&&r.jsx("span",{className:"fsrow__dot",title:"Есть несохранённые правки"})]}),r.jsx("button",{className:"fsrow__act",title:"Переименовать","aria-label":`Переименовать ${a.name}`,onClick:j,children:"✎"}),r.jsx("button",{className:"fsrow__act",title:"Удалить","aria-label":`Удалить ${a.name}`,onClick:v,children:"✕"})]})}function w1({entry:a,gitStatus:l,onClick:i}){const c=a.path.slice(0,a.path.length-a.name.length-1);return r.jsxs("button",{className:"fsrow fsrow--search"+(a.ignored?" fsrow--ignored":""),style:Wa(0),onClick:i,title:ly(a),children:[r.jsx("span",{className:"fsrow__icon"+Go("fsrow__icon",l),children:a.kind==="dir"?r.jsx(Yo,{}):r.jsx(Xo,{})}),r.jsx("span",{className:"fsrow__name"+Go("fsrow__name",l),children:a.name}),a.ignored&&r.jsx("span",{className:"fsrow__tag",children:"git-ignore"}),c&&r.jsx("span",{className:"fsrow__path",children:c})]})}function ly(a){return a.ignored?`${a.path} — игнорируется git (.gitignore)`:a.path}function Wa(a){return{"--depth":a}}function $b(a,l){var o;const i=l.lastIndexOf("/"),c=i===-1?"":l.slice(0,i);return((o=a[c])==null?void 0:o.find(d=>d.path===l))??null}function T1(a){const l=new Map,i={added:1,modified:2},c=(o,d)=>{const h=l.get(o);(!h||i[d]>i[h])&&l.set(o,d)};for(const o of a){const d=E1(o.status);if(!d)continue;c(o.path,d);let h=Oi(o.path);for(;c(h,d),!!h;)h=Oi(h)}return l}function E1(a){if(a==="??")return"added";const[l="",i=""]=a;return l==="A"||l==="R"||l==="C"?"added":l==="M"||i==="M"?"modified":null}function Go(a,l){return l?` ${a}--git-${l}`:""}function Yo({open:a=!1}){return r.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,"aria-hidden":"true",children:a?r.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"}):r.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 Xo(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,strokeLinejoin:"round","aria-hidden":"true",children:[r.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"}),r.jsx("path",{d:"M9 2v3.2h3.3"})]})}function A1(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,"aria-hidden":"true",children:[r.jsxs("g",{transform:"translate(-1.3,-1.6) scale(0.78)",strokeLinejoin:"round",children:[r.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"}),r.jsx("path",{d:"M9 2v3.2h3.3"})]}),r.jsx("path",{d:"M12.2 10.3v3.8M10.3 12.2h3.8",strokeLinecap:"round"})]})}function C1(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,"aria-hidden":"true",children:[r.jsx("g",{transform:"translate(-1.3,-1.6) scale(0.78)",children:r.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"})}),r.jsx("path",{d:"M12.2 10.3v3.8M10.3 12.2h3.8",strokeLinecap:"round"})]})}function R1(){return r.jsxs("svg",{className:"sidepane__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[r.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"}),r.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 M1(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[r.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),r.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}const O1=200;function D1({open:a,result:l,onSearch:i,onOpenMatch:c,onClose:o,zoomed:d,onToggleZoom:h}){const[p,m]=_.useState(""),x=p.trim(),y=x.length>0,j=_.useRef(null),v=_.useRef(i);v.current=i;function R(B){m(B),j.current&&clearTimeout(j.current);const P=B.trim();if(!P){v.current("");return}j.current=setTimeout(()=>v.current(P),O1)}const T=y&&(l==null?void 0:l.query)===x?l:null;function L(){if(!T)return[r.jsx("p",{className:"fsrow__pending",children:"ищем…"},"grep:wait")];if(T.matches.length===0)return[r.jsx("p",{className:"fsrow__pending",children:"ничего не найдено"},"grep:empty")];const B=[];let P="";for(const M of T.matches)M.path!==P&&(P=M.path,B.push(r.jsx("p",{className:"searchgroup__path",title:M.path,children:M.path},`path:${M.path}`))),B.push(r.jsx(z1,{match:M,onClick:()=>c(M)},`${M.path}:${M.line}:${M.column}`));return T.truncated&&B.push(r.jsxs("p",{className:"fsrow__pending",children:["показаны первые ",T.matches.length," — уточните запрос"]},"grep:truncated")),B}return r.jsxs("aside",{className:(a?"sidepane sidepane--search sidepane--open":"sidepane sidepane--search")+(d?" sidepane--zoomed":""),"aria-label":"Поиск по тексту в проекте",children:[r.jsxs("div",{className:"sidepane__head",onDoubleClick:B=>{h&&(B.target.closest("button")||h())},children:[r.jsx(L1,{}),r.jsx("span",{className:"sidepane__title",children:"Поиск по тексту"}),h&&r.jsx("button",{className:"sidepane__btn",title:d?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":d?"Свернуть панель поиска":"Развернуть панель поиска на весь экран","aria-pressed":d,onClick:h,children:r.jsx(Hr,{active:d})}),r.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель поиска",onClick:o,children:"✕"})]}),r.jsxs("div",{className:"fssearch",children:[r.jsx(U1,{}),r.jsx("input",{className:"fssearch__input",type:"text",value:p,spellCheck:!1,placeholder:"Поиск по тексту во всех файлах…","aria-label":"Поиск по тексту во всех файлах",onChange:B=>R(B.target.value),onKeyDown:B=>{B.stopPropagation(),B.key==="Escape"&&(B.preventDefault(),p?R(""):B.currentTarget.blur())}}),p&&r.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>R(""),children:"✕"})]}),r.jsx("div",{className:"sidepane__scroll fstree",children:y?L():r.jsx("p",{className:"sidepane__empty",children:"Введите текст, чтобы найти его во всех файлах проекта."})})]})}function z1({match:a,onClick:l}){const i=a.lineText.slice(0,a.column-1),c=a.lineText.slice(a.column-1,a.column-1+a.matchLength),o=a.lineText.slice(a.column-1+a.matchLength);return r.jsxs("button",{className:"searchmatch",onClick:l,title:`${a.path}:${a.line}`,children:[r.jsx("span",{className:"searchmatch__line",children:a.line}),r.jsxs("span",{className:"searchmatch__text",children:[i,r.jsx("mark",{children:c}),o]})]})}function L1(){return r.jsxs("svg",{className:"sidepane__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[r.jsx("circle",{cx:"6.8",cy:"6.8",r:"4.3"}),r.jsx("path",{d:"M13.2 13.2 10.1 10.1"})]})}function U1(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[r.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),r.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}let Eo=null;function H1(){return Eo||(Eo=Promise.all([Xe(()=>import("./index-ZDWxlF_B.js"),__vite__mapDeps([19,4,3,2,20,5]),import.meta.url),Xe(()=>import("./index-891wE-Rj.js").then(a=>a.v),__vite__mapDeps([4,3]),import.meta.url),Xe(()=>import("./index-BHot-lnj.js"),[],import.meta.url),Xe(()=>import("./index-kYR8PJFy.js"),__vite__mapDeps([20,3,4,2]),import.meta.url),Xe(()=>import("./codemirror-BrML4DhQ.js"),__vite__mapDeps([21,2,3,4]),import.meta.url)]).then(([a,l,i,c,o])=>({EditorView:l.EditorView,EditorState:i.EditorState,Compartment:i.Compartment,EditorSelection:i.EditorSelection,Prec:i.Prec,keymap:l.keymap,indentWithTab:c.indentWithTab,basicSetup:a.basicSetup,editorTheme:o.editorTheme,editorHighlight:o.editorHighlight})).catch(a=>{throw Eo=null,a})),Eo}function B1({path:a,doc:l,revision:i,goto:c,onChange:o,onSave:d}){const h=_.useRef(null),p=_.useRef(null),m=_.useRef(null),x=_.useRef(new Map),y=_.useRef(new Map),j=_.useRef(new Set),v=_.useRef(null),R=_.useRef(o),T=_.useRef(d),L=_.useRef(a),B=_.useRef(i),P=_.useRef(l);R.current=o,T.current=d,L.current=a,B.current=i,P.current=l;const[M,Z]=_.useState("loading"),[N,K]=_.useState(!1);function z(V,te,oe,F,ae){const me=x.current.get(F),Te=y.current.get(F)===ae;if(me&&Te)oe.setState(me);else{const U=V.EditorState.create({doc:P.current,extensions:[V.basicSetup,V.Prec.highest(V.keymap.of([{key:"Mod-s",preventDefault:!0,run:()=>(T.current(L.current),!0)}])),V.keymap.of([V.indentWithTab]),te.of([]),V.editorTheme,V.editorHighlight,V.EditorView.updateListener.of(re=>{re.docChanged&&R.current(L.current,re.state.doc.toString())})]});x.current.set(F,U),y.current.set(F,ae),oe.setState(U),j.current.delete(F)}if(j.current.has(F))return()=>{};let be=!1;return g1(F).then(U=>{be||!U||L.current!==F||(oe.dispatch({effects:te.reconfigure(U)}),x.current.set(F,oe.state),j.current.add(F))}),()=>{be=!0}}_.useEffect(()=>{if(!h.current)return;let te=!1,oe=null,F=null;Z("loading"),K(!1);const ae=window.setTimeout(()=>{te||K(!0)},200);return(async()=>{let me;try{me=await H1()}catch{window.clearTimeout(ae),te||Z("error");return}if(te||!h.current)return;window.clearTimeout(ae);const Te=new me.Compartment;v.current=Te,m.current=me,F=new me.EditorView({parent:h.current}),p.current=F,oe=z(me,Te,F,L.current,B.current),Z("ready")})(),()=>{te=!0,window.clearTimeout(ae),oe==null||oe(),F==null||F.destroy(),p.current===F&&(p.current=null),m.current=null,v.current=null}},[]),_.useEffect(()=>{const V=m.current,te=p.current,oe=v.current;if(!(!V||!te||!oe))return z(V,oe,te,a,i)},[a,i]);const A=_.useRef(0);return _.useEffect(()=>{const V=p.current,te=m.current;if(!V||!te||!c||c.token===A.current)return;A.current=c.token;const oe=V.state.doc.lines,F=Math.min(Math.max(c.line,1),oe),ae=V.state.doc.line(F),me=Math.min(ae.from+Math.max(c.column-1,0),ae.to);V.dispatch({selection:te.EditorSelection.cursor(me),effects:te.EditorView.scrollIntoView(me,{y:"center"})}),V.focus()},[c]),_.useEffect(()=>()=>{const V=p.current;V&&x.current.set(a,V.state)},[a]),r.jsxs("div",{className:"editor__code",children:[r.jsx("div",{ref:h,className:"editor__code-surface"+(M==="ready"?"":" is-hidden")}),M==="loading"&&N&&r.jsxs("div",{className:"editor__state work",role:"status",children:[r.jsxs("div",{className:"work__dots",children:[r.jsx("span",{className:"work__dot"}),r.jsx("span",{className:"work__dot"}),r.jsx("span",{className:"work__dot"})]}),r.jsx("span",{className:"work__label",children:"Загружается редактор…"})]}),M==="error"&&r.jsxs("div",{className:"editor__fallback",children:[r.jsxs("div",{className:"editor__fallback-banner",role:"alert",children:[r.jsx("span",{children:"Редактор не загрузился — ниже только просмотр, без сохранения правок."}),r.jsx("button",{className:"btn btn--sm btn--primary",onClick:()=>window.location.reload(),children:"Перезагрузить страницу"})]}),r.jsx("pre",{className:"editor__fallback-text",children:l})]})]})}function q1({file:a,goto:l,onChange:i,onSave:c,onReload:o,onOverwrite:d,onTogglePreview:h}){const p=Fa(a),m=ny(a.path)&&!a.binary&&!a.tooLarge;return r.jsxs("div",{className:"editor",children:[r.jsxs("div",{className:"editor__bar",children:[r.jsx("span",{className:"editor__path",title:a.path,children:a.path}),r.jsxs("span",{className:"editor__meta",children:[oh(a.size),a.eol==="crlf"&&" · CRLF"]}),m&&r.jsxs("div",{className:"editor__viewtoggle",role:"tablist","aria-label":"Режим просмотра",children:[r.jsx("button",{className:"btn btn--sm"+(a.previewMode?" is-on":""),role:"tab","aria-selected":a.previewMode,onClick:()=>!a.previewMode&&h(a.path),children:"Просмотр"}),r.jsx("button",{className:"btn btn--sm"+(a.previewMode?"":" is-on"),role:"tab","aria-selected":!a.previewMode,onClick:()=>a.previewMode&&h(a.path),children:"Код"})]}),r.jsx("button",{className:"btn btn--sm",disabled:!p,title:"Сохранить (Ctrl+S)",onClick:()=>c(a.path),children:p?"Сохранить":"Сохранено"})]}),a.stale&&r.jsxs("div",{className:"editor__warn",children:[r.jsxs("span",{children:["Файл изменился на диске",p?" — а здесь есть несохранённые правки.":"."]}),r.jsx("button",{className:"btn btn--sm",onClick:()=>o(a.path),children:"Взять с диска"}),p&&r.jsx("button",{className:"btn btn--sm btn--danger",onClick:()=>d(a.path),children:"Сохранить поверх"})]}),a.binary?r.jsxs("p",{className:"editor__empty",children:["Это не текстовый файл — редактировать его здесь нечем. ",oh(a.size)," на диске."]}):a.tooLarge?r.jsxs("p",{className:"editor__empty",children:["Файл слишком велик для редактора (",oh(a.size),"). Такие правит агент, а не браузер."]}):m&&a.previewMode?r.jsx(I1,{text:a.text}):r.jsx(B1,{path:a.path,doc:a.text,revision:a.revision,goto:l,onChange:i,onSave:c})]})}function I1({text:a}){const[l,i]=_.useState("");return _.useEffect(()=>{let c=!1;return Qh(a).then(o=>{c||i(o)}),()=>{c=!0}},[a]),r.jsx("div",{className:"markdown-preview",dangerouslySetInnerHTML:{__html:l}})}function G1({files:a,activePath:l,busy:i,onSelect:c,onClose:o,zoomed:d,onToggleZoom:h}){return r.jsxs("div",{className:"worktabs",role:"tablist",onDoubleClick:p=>{h&&(p.target.closest("button")||h())},children:[r.jsxs("button",{className:"worktab"+(l===null?" is-on":""),role:"tab","aria-selected":l===null,onClick:()=>c(null),onDoubleClick:()=>h==null?void 0:h(),children:[r.jsx("span",{className:"worktab__name",children:"Разговор"}),i&&r.jsx("span",{className:"worktab__dot worktab__dot--busy",title:"Агент работает"})]}),a.map(p=>r.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:[r.jsx("button",{className:"worktab__name",title:p.path,onClick:()=>c(p.path),children:y1(p.path)}),Fa(p)?r.jsx("button",{className:"worktab__dot",title:"Не сохранено — закрыть","aria-label":`Закрыть ${p.path}`,onClick:()=>o(p.path)}):r.jsx("button",{className:"worktab__close",title:"Закрыть","aria-label":`Закрыть ${p.path}`,onClick:()=>o(p.path),children:"✕"})]},p.path)),r.jsx("div",{className:"worktabs__spacer"}),h&&r.jsx("button",{className:"worktabs__zoom",title:d?"Свернуть — то же самое, что двойной клик по вкладке":"Развернуть на весь экран — то же самое, что двойной клик по вкладке","aria-label":d?"Свернуть колонку разговора":"Развернуть колонку разговора на весь экран","aria-pressed":d,onClick:h,children:r.jsx(Hr,{active:d})})]})}const ay="ccv:sidebar.collapsed",sy="ccv:sidebar.mode",Y1=500,Qb="транскрипт остаётся на диске — сессию можно вернуть из архива в любой момент.";function X1({open:a,connected:l,status:i,workspaces:c,sessions:o,archived:d,pinned:h,activeWorkspaceId:p,activeSessionId:m,onSelectWorkspace:x,onSelectSession:y,onRenameSession:j,onPinSessions:v,onSelectPinned:R,onCloseWorkspaces:T,onArchiveSessions:L,onUnarchiveSessions:B,onOpenWorkspace:P,onNewSession:M,onOpenExtensions:Z,account:N,onOpenAccount:K,relay:z,onOpenRelay:A,onOpenSettings:V,themeMode:te,onCycleTheme:oe}){const[F,ae]=_.useState(null),[me,Te]=_.useState(""),[be,U]=_.useState(Q1),[re,se]=_.useState(Z1);function pe(){se(E=>{const Y=E==="pinned"?"default":"pinned";try{localStorage.setItem(sy,Y)}catch{}return Y})}const ke=me.trim().toLowerCase(),k=ke!=="",$=_.useMemo(()=>k?c.filter(E=>E.name.toLowerCase().includes(ke)||E.path.toLowerCase().includes(ke)):c,[c,ke,k]),ce=_.useMemo(()=>k?o.filter(E=>(E.title??"").toLowerCase().includes(ke)):o,[o,ke,k]),he=_.useMemo(()=>k?d.filter(E=>(E.title??"").toLowerCase().includes(ke)):d,[d,ke,k]),Ne=E=>{var Y;return((Y=c.find(_e=>_e.id===E))==null?void 0:Y.name)??"—"},ye=E=>{var Y;return(Y=c.find(_e=>_e.id===E))==null?void 0:Y.path},Ae=_.useMemo(()=>k?h.filter(E=>(E.title??"").toLowerCase().includes(ke)||Ne(E.workspaceId).toLowerCase().includes(ke)):h,[h,c,ke,k]);function st(E){U(Y=>{const _e=Y.includes(E)?Y.filter(O=>O!==E):[...Y,E];try{localStorage.setItem(ay,JSON.stringify(_e))}catch{}return _e})}const Qe=E=>!be.includes(E),Ot=Kb($),qe=Kb(ce),[xt,et]=_.useState(null),[Je,Fe]=_.useState(null),[it,Jn]=_.useState(null),Bt=_.useRef(null);function qt(E,Y){const _e=E.touches[0];if(!_e)return;const O={timer:0,x:_e.clientX,y:_e.clientY,el:E.currentTarget,fired:!1};O.timer=window.setTimeout(()=>{O.fired=!0,Y(O.x,O.y,O.el)},Y1),Bt.current=O}function Kt(E){const Y=Bt.current,_e=E.touches[0];!Y||!_e||Math.hypot(_e.clientX-Y.x,_e.clientY-Y.y)>10&&(window.clearTimeout(Y.timer),Bt.current=null)}function It(E){const Y=Bt.current;Y&&(window.clearTimeout(Y.timer),Y.fired&&E.preventDefault())}function Gt(){var E;return(E=Bt.current)!=null&&E.fired?(Bt.current=null,!0):!1}function Qt(){const E=xt==null?void 0:xt.opener;et(null),E!=null&&E.isConnected&&E.focus()}function rt(){const E=Je==null?void 0:Je.opener;Fe(null),E!=null&&E.isConnected&&E.focus()}function wt(){const E=it==null?void 0:it.opener;Jn(null),E!=null&&E.isConnected&&E.focus()}function en(E){return{onContextMenu:Y=>{Y.preventDefault(),et({x:Y.clientX,y:Y.clientY,opener:Y.currentTarget,ids:Ot.targetsFor(E)})},onTouchStart:Y=>qt(Y,(_e,O,J)=>et({x:_e,y:O,opener:J,ids:Ot.targetsFor(E)})),onTouchMove:Kt,onTouchEnd:It,onTouchCancel:It}}function En(E){return{onContextMenu:Y=>{Y.preventDefault(),Fe({x:Y.clientX,y:Y.clientY,opener:Y.currentTarget,ids:qe.targetsFor(E)})},onTouchStart:Y=>qt(Y,(_e,O,J)=>Fe({x:_e,y:O,opener:J,ids:qe.targetsFor(E)})),onTouchMove:Kt,onTouchEnd:It,onTouchCancel:It}}function Ct(E){return{onContextMenu:Y=>{Y.preventDefault(),Jn({x:Y.clientX,y:Y.clientY,opener:Y.currentTarget,ids:[E.id]})},onTouchStart:Y=>qt(Y,(_e,O,J)=>Jn({x:_e,y:O,opener:J,ids:[E.id]})),onTouchMove:Kt,onTouchEnd:It,onTouchCancel:It}}const kn=o.filter(E=>E.state!=="closed").length,An=xt?[{id:"close",label:xt.ids.length>1?`Закрыть проекты (${xt.ids.length})`:"Закрыть проект",onSelect:()=>{T(xt.ids),Ot.clear()}}]:[],Dt=xt?"закрытие не удаляет проект: каталог и история сессий остаются на диске — открыть его снова можно кнопкой «+ Проект»."+(p&&xt.ids.includes(p)&&kn>0?` в нём сейчас незавершённых сессий: ${kn} — при закрытии они остановятся на хосте.`:""):void 0,fn=Je?ce.find(E=>E.id===Je.ids[0]):void 0,Jt=(fn==null?void 0:fn.pinned)!==!0,Tt=Je?[...Je.ids.length===1?[{id:"rename",label:"Переименовать",onSelect:()=>ae(Je.ids[0])}]:[],{id:"pin",label:Jt?Je.ids.length>1?`Закрепить (${Je.ids.length})`:"Закрепить":Je.ids.length>1?`Открепить (${Je.ids.length})`:"Открепить",onSelect:()=>{fn&&v(fn.workspaceId,Je.ids,Jt),qe.clear()}},{id:"archive",label:Je.ids.length>1?`Убрать в архив (${Je.ids.length})`:"Убрать в архив",onSelect:()=>{L(p,Je.ids),qe.clear()}}]:[],dn=Je?Qb:void 0,ot=it?Ae.find(E=>E.id===it.ids[0]):void 0,tn=it?[{id:"rename",label:"Переименовать",onSelect:()=>ae(it.ids[0])},{id:"unpin",label:"Открепить",onSelect:()=>{ot&&v(ot.workspaceId,[ot.id],!1)}},{id:"archive",label:"Убрать в архив",onSelect:()=>{ot&&L(ot.workspaceId,[ot.id])}}]:[];return r.jsxs("aside",{className:a?"sidebar sidebar--open":"sidebar",children:[r.jsxs("div",{className:"sidebar__head",children:[r.jsx("span",{className:l?"dot dot--on":"dot",title:i}),r.jsx("span",{className:"brand",children:"Claude Code Visual"}),r.jsx("button",{className:"theme-btn","aria-pressed":re==="pinned",title:re==="pinned"?"Показать все проекты и сессии":"Показать только закреплённые","aria-label":re==="pinned"?"Панель закреплённых сессий включена. Показать все проекты и сессии":"Показать только закреплённые сессии",onClick:pe,children:r.jsx(iy,{})}),r.jsx("button",{className:"theme-btn",title:`Тема: ${Jb[te]}`,"aria-label":`Тема: ${Jb[te]}. Переключить`,onClick:oe,children:r.jsx(K1,{mode:te})})]}),r.jsxs("div",{className:"fssearch fssearch--sidebar",children:[r.jsx($1,{}),r.jsx("input",{className:"fssearch__input",type:"text",value:me,spellCheck:!1,placeholder:"Проект или сессия…","aria-label":"Поиск по проектам и сессиям",onChange:E=>Te(E.target.value),onKeyDown:E=>{E.stopPropagation(),E.key==="Escape"&&(E.preventDefault(),me?Te(""):E.currentTarget.blur())}}),me&&r.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>Te(""),children:"✕"})]}),r.jsx("div",{className:"sidebar__scroll",children:re==="pinned"?r.jsxs(r.Fragment,{children:[Ae.length===0&&r.jsx("div",{className:"row",children:r.jsx("span",{className:"row__meta",children:k?"Ничего не найдено":"закрепите сессию через её меню (правый клик или долгое нажатие) — она останется под рукой из любого проекта"})}),Ae.map(E=>r.jsx("div",{className:E.id===m?"row row--active":"row",...F===E.id?{}:{title:"Действия со строкой — правый клик или долгое нажатие",...Ct(E)},children:F===E.id?r.jsx("div",{className:"row__main",children:r.jsx(Kc,{value:E.title??"",onCommit:Y=>{j(E,Y),ae(null)},onCancel:()=>ae(null)})}):r.jsxs("button",{className:"row__main",onClick:()=>{Gt()||R(E)},children:[r.jsx(dh,{title:E.title??"Без названия",pinned:!1,projectName:Ne(E.workspaceId),projectPath:ye(E.workspaceId)}),r.jsx(Fb,{session:E,tail:new Date(E.updatedAt).toLocaleString()})]})},E.id))]}):r.jsxs(r.Fragment,{children:[r.jsx(fh,{title:"Проекты",count:$.length,open:Qe("workspaces"),onToggle:()=>st("workspaces")}),Qe("workspaces")&&r.jsxs(r.Fragment,{children:[$.length===0&&r.jsx("div",{className:"row",children:r.jsx("span",{className:"row__meta",children:k?"Ничего не найдено":"Пока ни одного"})}),$.map(E=>r.jsx("div",{className:Zb(E.id===p,Ot.selected.includes(E.id)),...en(E),children:r.jsxs("button",{className:"row__main",onClick:Y=>{Gt()||Ot.click(Y,E,()=>x(E.id))},children:[r.jsxs("span",{className:"row__title",children:[E.name,E.hasClaudeMd&&" ·"]}),r.jsx("span",{className:"row__meta",title:E.path,children:E.path})]})},E.id))]}),p&&r.jsxs(r.Fragment,{children:[r.jsx(fh,{title:"Сессии",count:ce.length,open:Qe("sessions"),onToggle:()=>st("sessions")}),Qe("sessions")&&r.jsxs(r.Fragment,{children:[ce.length===0&&r.jsx("div",{className:"row",children:r.jsx("span",{className:"row__meta",children:k?"Ничего не найдено":"Пока ни одной"})}),ce.map(E=>r.jsx("div",{className:Zb(E.id===m,qe.selected.includes(E.id)),...F===E.id?{}:En(E),children:F===E.id?r.jsx("div",{className:"row__main",children:r.jsx(Kc,{value:E.title??"",onCommit:Y=>{j(E,Y),ae(null)},onCancel:()=>ae(null)})}):r.jsxs(r.Fragment,{children:[r.jsxs("button",{className:"row__main",onClick:Y=>{Gt()||qe.click(Y,E,()=>y(E))},children:[r.jsx(dh,{title:E.title??"Без названия",pinned:E.pinned===!0,projectName:Ne(E.workspaceId),projectPath:ye(E.workspaceId)}),r.jsx(Fb,{session:E,tail:new Date(E.updatedAt).toLocaleString()})]}),r.jsx("button",{className:"row__edit",title:"Переименовать","aria-label":"Переименовать сессию",onClick:()=>{Gt()||ae(E.id)},children:"✎"})]})},E.id))]}),d.length>0&&r.jsxs(r.Fragment,{children:[r.jsx(fh,{title:"Архив",count:he.length,open:Qe("archive"),onToggle:()=>st("archive"),hint:"сессии без обращения дольше двух суток уезжают сюда сами; ничего не удаляется"}),Qe("archive")&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"row",children:r.jsx("span",{className:"row__meta",children:"сюда сами уезжают сессии без обращения дольше двух суток; транскрипт остаётся на диске, ничего не удаляется"})}),he.length===0&&r.jsx("div",{className:"row",children:r.jsx("span",{className:"row__meta",children:k?"Ничего не найдено":"Пока пусто"})}),he.map(E=>r.jsxs("div",{className:E.id===m?"row row--active":"row",children:[r.jsxs("button",{className:"row__main",onClick:()=>y(E),children:[r.jsx(dh,{title:E.title??"Без названия",pinned:!1,projectName:Ne(E.workspaceId),projectPath:ye(E.workspaceId)}),r.jsx("span",{className:"row__meta",children:eS(E)})]}),r.jsx("button",{className:"row__restore",title:"Вернуть сессию из архива",onClick:()=>B([E.id]),children:"Вернуть"})]},E.id))]})]})]})]})}),r.jsxs("div",{className:"sidebar__foot",children:[r.jsxs("button",{className:"account-btn sidebar__wide",title:"Аккаунт Claude",onClick:K,children:[r.jsx("span",{className:N!=null&&N.loggedIn?"dot dot--on":"dot"}),r.jsx("span",{className:"account-btn__id",children:N===null?"Аккаунт":N.loggedIn?N.email||"Вход выполнен":"Войти в аккаунт"}),(N==null?void 0:N.plan)&&r.jsx("span",{className:"chip",children:N.plan})]}),A&&r.jsxs("button",{className:"account-btn sidebar__wide",title:"Доступ с телефона и из браузера",onClick:A,children:[r.jsx("span",{className:z!=null&&z.connected?"dot dot--on":"dot"}),r.jsx("span",{className:"account-btn__id",children:z===null?"Удалённый доступ":z.paired?z.connected?z.name||"Удалённый доступ включён":"Удалённый доступ · нет связи":"Удалённый доступ"}),(z==null?void 0:z.connected)&&z.clients>0&&r.jsx("span",{className:"chip",children:z.clients})]}),r.jsx("button",{className:"btn btn--ghost sidebar__wide",disabled:!Z,title:"MCP-серверы и плагины",onClick:()=>Z==null?void 0:Z(),children:"Расширения"}),r.jsx("button",{className:"btn btn--ghost sidebar__wide",title:"Настройки приложения",onClick:V,children:"Настройки"}),r.jsx("button",{className:"btn btn--ghost",onClick:P,children:"+ Проект"}),r.jsx("button",{className:"btn btn--primary",onClick:M,disabled:!p,children:"+ Сессия"})]}),xt&&r.jsx(Yc,{x:xt.x,y:xt.y,items:An,note:Dt,onClose:Qt}),Je&&r.jsx(Yc,{x:Je.x,y:Je.y,items:Tt,note:dn,onClose:rt}),it&&r.jsx(Yc,{x:it.x,y:it.y,items:tn,note:Qb,onClose:wt})]})}function Zb(a,l){const i=["row"];return a&&i.push("row--active"),l&&i.push("row--selected"),i.join(" ")}function Kb(a){const[l,i]=_.useState([]),c=_.useRef(null);function o(){i([]),c.current=null}function d(p,m,x){if(p.ctrlKey||p.metaKey){i(y=>y.includes(m.id)?y.filter(j=>j!==m.id):[...y,m.id]),c.current=m.id;return}if(p.shiftKey&&c.current){const y=a.findIndex(v=>v.id===c.current),j=a.findIndex(v=>v.id===m.id);if(y!==-1&&j!==-1){const[v,R]=y<j?[y,j]:[j,y];i(a.slice(v,R+1).map(T=>T.id));return}}o(),c.current=m.id,x()}function h(p){return l.includes(p.id)?l:(i([p.id]),c.current=p.id,[p.id])}return{selected:l,click:d,targetsFor:h,clear:o}}function fh({title:a,count:l,open:i,onToggle:c,hint:o}){const d=i?`Свернуть «${a}»`:`Развернуть «${a}»`;return r.jsxs("button",{className:"sidebar__section sidebar__section--btn","aria-expanded":i,title:o?`${d} — ${o}`:d,onClick:c,children:[r.jsx(V1,{open:i}),r.jsx("span",{className:"sidebar__section-name",children:a}),r.jsx("span",{className:"sidebar__count",children:l})]})}function V1({open:a}){return r.jsx("svg",{className:a?"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:r.jsx("path",{d:"M6 3.5 10.5 8 6 12.5"})})}function iy({className:a}){return r.jsxs("svg",{className:a,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("rect",{x:"4.5",y:"2.4",width:"7",height:"4.2",rx:"1.6"}),r.jsx("path",{d:"M5.4 6.6 8 12.2 10.6 6.6"}),r.jsx("path",{d:"M8 12.2v1.4"})]})}function $1(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[r.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),r.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}function Q1(){try{const a=localStorage.getItem(ay);if(a===null)return["archive"];const l=JSON.parse(a);return Array.isArray(l)?l.filter(i=>i==="workspaces"||i==="sessions"||i==="archive"):["archive"]}catch{return["archive"]}}function Z1(){try{return localStorage.getItem(sy)==="pinned"?"pinned":"default"}catch{return"default"}}const Jb={system:"как в системе",light:"светлая",dark:"тёмная"};function K1({mode:a}){const l={viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0};return a==="dark"?r.jsx("svg",{...l,children:r.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"})}):a==="light"?r.jsxs("svg",{...l,children:[r.jsx("circle",{cx:"8",cy:"8",r:"3.1"}),r.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"})]}):r.jsxs("svg",{...l,children:[r.jsx("rect",{x:"1.8",y:"2.6",width:"12.4",height:"8.4",rx:"1.4"}),r.jsx("path",{d:"M5.6 13.4h4.8"})]})}function J1(a){switch(a.state){case"running":return"работает";case"waiting_permission":return"ждёт разрешения";case"idle":return a.backgroundWork?"работает в фоне":F1(a.lastTurn);case"starting":return"запускается";case"reconnecting":return"переподключается";case"error":return"ошибка";case"closed":return"на диске"}}function F1(a){switch(a){case"interrupted":return"прервана";case"stopped":return"остановлена";case"failed":return"оборвалась";case"completed":return"готова";case null:return"ждёт задачу"}}function W1(a){switch(a.state){case"running":return"running";case"starting":return"starting";case"reconnecting":return"reconnecting";case"waiting_permission":return"waiting";case"idle":return a.backgroundWork?"background":P1(a.lastTurn);case"error":return"error";case"closed":return"closed"}}function P1(a){switch(a){case"interrupted":case"stopped":return"halted";case"failed":return"error";case"completed":return"ready";case null:return"fresh"}}function Fb({session:a,tail:l}){return r.jsxs("span",{className:"row__meta",children:[r.jsxs("span",{className:`row__state row__state--${W1(a)}`,children:[r.jsx("span",{className:"row__state-dot","aria-hidden":"true"}),J1(a)]})," · ",l]})}function dh({title:a,pinned:l,projectName:i,projectPath:c}){return r.jsxs("span",{className:"row__head",children:[r.jsxs("span",{className:"row__title",children:[l&&r.jsx(iy,{className:"row__pin"}),a]}),r.jsx("span",{className:"row__project",title:c,children:i})]})}function eS(a){const l=a.archivedAuto?"сама, по сроку молчания":"убрана вручную";return a.archivedAt?`${new Date(a.archivedAt).toLocaleString()} · ${l}`:l}const Wb=3,tS=15e5;function ry(a,l){if(!l||typeof l!="object")return null;const i=l,c=typeof i.file_path=="string"?i.file_path:"";if(!c)return null;if(a==="Write"){if(typeof i.content!="string")return null;const o=hh(i.content).map(d=>({type:"add",text:d}));return{kind:"create",filePath:c,rows:o,added:o.length,removed:0,note:"файл записывается целиком"}}if(a==="Edit"){if(typeof i.old_string!="string"||typeof i.new_string!="string")return null;const o=sS(nS(hh(i.old_string),hh(i.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:i.replace_all===!0?"все вхождения":null}}return null}function hh(a){if(a==="")return[];const l=a.split(/\r?\n/);return l.length>1&&l[l.length-1]===""&&l.pop(),l}function nS(a,l){let i=0;for(;i<a.length&&i<l.length&&a[i]===l[i];)i++;let c=a.length,o=l.length;for(;c>i&&o>i&&a[c-1]===l[o-1];)c--,o--;const d=h=>({type:"ctx",text:h});return[...a.slice(0,i).map(d),...lS(a.slice(i,c),l.slice(i,o)),...a.slice(c).map(d)]}function lS(a,l){if(a.length===0&&l.length===0)return[];if(a.length===0)return l.map(y=>({type:"add",text:y}));if(l.length===0)return a.map(y=>({type:"del",text:y}));if((a.length+1)*(l.length+1)>tS)return[...a.map(y=>({type:"del",text:y})),...l.map(y=>({type:"add",text:y}))];const i=a.length,c=l.length,o=c+1,d=new Uint32Array((i+1)*o),h=(y,j)=>d[y*o+j]??0;for(let y=i-1;y>=0;y--)for(let j=c-1;j>=0;j--)d[y*o+j]=a[y]===l[j]?h(y+1,j+1)+1:Math.max(h(y+1,j),h(y,j+1));const p=[];let m=0,x=0;for(;m<i&&x<c;){const y=a[m],j=l[x];y===j?(p.push({type:"ctx",text:y}),m++,x++):h(m+1,x)>=h(m,x+1)?(p.push({type:"del",text:y}),m++):(p.push({type:"add",text:j}),x++)}for(;m<i;)p.push({type:"del",text:a[m++]});for(;x<c;)p.push({type:"add",text:l[x++]});return aS(p)}function aS(a){const l=[];let i=[];function c(){l.push(...i.filter(o=>o.type==="del")),l.push(...i.filter(o=>o.type==="add")),i=[]}for(const o of a)o.type==="ctx"?(c(),l.push(o)):i.push(o);return c(),l}function sS(a){if(!a.some(d=>d.type!=="ctx"))return a;const l=a.map(()=>!1);a.forEach((d,h)=>{if(d.type!=="ctx")for(let p=Math.max(0,h-Wb);p<=Math.min(a.length-1,h+Wb);p++)l[p]=!0});const i=[];let c=[];function o(){c.length===1?i.push(...c):c.length>1&&i.push({type:"gap",text:`⋯ ${c.length} ${iS(c.length)} без изменений`}),c=[]}return a.forEach((d,h)=>{l[h]?(o(),i.push(d)):c.push(d)}),o(),i}function iS(a){const l=a%100;if(l>=11&&l<=14)return"строк";switch(a%10){case 1:return"строка";case 2:case 3:case 4:return"строки";default:return"строк"}}async function Lr(a){try{return await navigator.clipboard.writeText(a),!0}catch{}const l=document.createElement("textarea");l.value=a,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 Rh(){try{return await navigator.clipboard.readText()}catch{return null}}const Zh=1600,Di="Копировать",wr="Скопировано";function Kh({text:a,hint:l,className:i}){const[c,o]=_.useState(!1);return _.useEffect(()=>{if(!c)return;const d=setTimeout(()=>o(!1),Zh);return()=>clearTimeout(d)},[c]),_.useEffect(()=>o(!1),[a]),r.jsx("button",{type:"button",className:"copybtn"+(c?" copybtn--done":"")+(i?` ${i}`:""),"aria-label":c?wr:`${Di} ${l}`,title:c?wr:`${Di} ${l}`,onClick:()=>{Lr(a).then(d=>{d&&o(!0)})},children:c?wr:Di})}function Jh({diff:a}){return r.jsxs("div",{className:"diff",children:[r.jsxs("div",{className:"diff__head",children:[r.jsx("span",{className:"diff__path",title:a.filePath,children:a.filePath}),r.jsxs("span",{className:"diff__stat",children:[a.added>0&&r.jsxs("span",{className:"diff__stat--add",children:["+",a.added]}),a.removed>0&&r.jsxs("span",{className:"diff__stat--del",children:["−",a.removed]})]})]}),a.note&&r.jsx("div",{className:"diff__note",children:a.note}),r.jsx("div",{className:"diff__body",children:a.rows.length===0?r.jsx("div",{className:"diff__row diff__row--gap",children:r.jsx("span",{className:"diff__text",children:"пустое содержимое"})}):a.rows.map((l,i)=>r.jsxs("div",{className:`diff__row diff__row--${l.type}`,children:[r.jsx("span",{className:"diff__mark","aria-hidden":"true",children:l.type==="add"?"+":l.type==="del"?"−":""}),r.jsx("span",{className:"diff__text",children:l.text===""?" ":l.text})]},i))})]})}function rS({waiting:a}){const[l,i]=_.useState(0);return _.useEffect(()=>{const c=window.setInterval(()=>i(o=>o+1),1e3);return()=>window.clearInterval(c)},[]),r.jsxs("div",{className:a?"work work--wait":"work",children:[r.jsxs("span",{className:"work__dots","aria-hidden":"true",children:[r.jsx("span",{className:"work__dot"}),r.jsx("span",{className:"work__dot"}),r.jsx("span",{className:"work__dot"})]}),r.jsx("span",{className:"work__label",children:a?"ждёт разрешения":"думает"}),!a&&r.jsxs("span",{className:"work__time",children:[l," с"]})]})}function Fh({items:a,busy:l,waiting:i,history:c=[],historyHasMore:o=!1,historyLoading:d=!1,onLoadHistory:h,sessionId:p,onEditMessage:m,empty:x="Сессия пуста. Опишите задачу — Claude Code работает в каталоге проекта с полным набором инструментов."}){const y=_.useRef(null),j=_.useRef(null),v=_.useRef(!0),R=_.useRef(null),T=_.useRef(null),L=_.useRef(!1);_.useEffect(()=>{v.current=!0,R.current=null,L.current=!1,T.current!==null&&(clearTimeout(T.current),T.current=null)},[p]),_.useEffect(()=>{const N=y.current,K=j.current;if(!N||!K)return;function z(te){!N||te===N.scrollTop||(L.current=!0,N.scrollTop=te)}function A(){if(!N)return;const te=R.current;if(te){const oe=ex(N,te.id);if(oe){const F=oe.getBoundingClientRect().top-N.getBoundingClientRect().top;z(N.scrollTop+(F-te.top))}T.current!==null&&clearTimeout(T.current),T.current=setTimeout(()=>{R.current=null},500);return}v.current&&z(N.scrollHeight)}const V=new ResizeObserver(A);return V.observe(K),()=>{V.disconnect(),T.current!==null&&clearTimeout(T.current)}},[]);function B(){const N=y.current;if(N){if(L.current){L.current=!1;return}v.current=N.scrollHeight-N.scrollTop-N.clientHeight<80}}function P(){if(d)return;const N=y.current,K=c[0];if(N&&K){const z=ex(N,K.id);z&&(R.current={id:K.id,top:z.getBoundingClientRect().top-N.getBoundingClientRect().top})}h==null||h()}let M=0;function Z(N){return N.kind==="user"?M++:-1}return r.jsx("div",{className:"transcript",ref:y,onScroll:B,children:r.jsxs("div",{className:"stream",ref:j,children:[o&&r.jsx("button",{type:"button",className:"transcript__more",onClick:P,disabled:d,children:d?"Загружаем…":"Показать более раннее"}),c.map(N=>r.jsx(Pb,{item:N,userIndex:Z(N),onEditMessage:m},N.id)),c.length>0&&a.length>0&&r.jsx("div",{className:"transcript__divider",children:r.jsx("span",{children:"дальше — сессия открыта заново"})}),c.length===0&&a.length===0&&r.jsx("p",{className:"empty",children:x}),a.map(N=>r.jsx(Pb,{item:N,userIndex:Z(N),onEditMessage:m},N.id)),l&&r.jsx(rS,{waiting:i})]})})}function Pb({item:a,userIndex:l,onEditMessage:i}){switch(a.kind){case"user":return r.jsx(uS,{item:a,userIndex:l,onEditMessage:i});case"assistant":return r.jsxs("div",{className:"msg--assistant","data-item-id":a.id,children:[r.jsx(oS,{text:a.text}),a.streaming&&r.jsx("span",{className:"caret"}),a.text.trim()!==""&&r.jsx("div",{className:"msg--assistant__foot",children:r.jsx(Kh,{text:a.text,hint:"ответ целиком"})})]});case"thinking":return r.jsx("div",{className:"thinking","data-item-id":a.id,children:a.text});case"tool":return r.jsx(dS,{item:a});case"result":return r.jsxs("div",{className:"result-line","data-item-id":a.id,children:[r.jsx("span",{children:a.isError?"✗ "+a.subtype:"✓ готово"}),r.jsxs("span",{children:[(a.durationMs/1e3).toFixed(1)," с"]}),a.costUsd!==null&&r.jsxs("span",{children:["$",a.costUsd.toFixed(4)]}),r.jsxs("span",{children:["↑",nx(a.inputTokens)," ↓",nx(a.outputTokens)]})]});case"notice":return r.jsx("div",{className:a.tone==="error"?"notice notice--error":"notice","data-item-id":a.id,children:a.text})}}const cS=500;function uS({item:a,userIndex:l,onEditMessage:i}){const[c,o]=_.useState(null),[d,h]=_.useState(!1),[p,m]=_.useState(a.text),x=_.useRef(null),y=$o("(max-width: 860px)"),j=_.useRef(null);function v(A,V){o({x:A,y:V})}function R(A){A.preventDefault(),v(A.clientX,A.clientY)}function T(A){const V=A.touches[0];if(!V)return;const te={timer:0,x:V.clientX,y:V.clientY,fired:!1};te.timer=window.setTimeout(()=>{te.fired=!0,v(te.x,te.y)},cS),j.current=te}function L(A){const V=j.current,te=A.touches[0];!V||!te||Math.hypot(te.clientX-V.x,te.clientY-V.y)>10&&(window.clearTimeout(V.timer),j.current=null)}function B(A){const V=j.current;V&&(window.clearTimeout(V.timer),V.fired&&A.preventDefault())}function P(){m(a.text),h(!0)}function M(){h(!1)}function Z(){const A=p.trim();A===""&&!(a.images&&a.images.length>0)||(i==null||i(l,A,a.images),h(!1))}_.useEffect(()=>{const A=x.current;!A||!d||(A.style.height="auto",A.style.height=`${A.scrollHeight}px`)},[p,d]),_.useEffect(()=>{if(!d)return;const A=x.current;A&&(A.focus(),A.setSelectionRange(A.value.length,A.value.length))},[d]);function N(A){if(A.key==="Escape"){A.preventDefault(),A.stopPropagation(),M();return}A.key==="Enter"&&!A.shiftKey&&!y&&(A.preventDefault(),Z())}const K=a.images&&a.images.length>0&&r.jsx("div",{className:"msg--user__images",children:a.images.map((A,V)=>r.jsx("img",{className:"msg--user__image",src:`data:${A.mediaType};base64,${A.data}`,alt:"Вложение"},V))});if(d){const A=p.trim()!==""||!!(a.images&&a.images.length>0);return r.jsxs("div",{className:"msg--user msg--user--editing","data-item-id":a.id,children:[K,r.jsxs("div",{className:"msg--user__edit",children:[r.jsx("textarea",{ref:x,className:"msg--user__edit-field",value:p,onChange:V=>m(V.target.value),onKeyDown:N,rows:1}),r.jsxs("div",{className:"msg--user__edit-actions",children:[r.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:M,children:"Отмена"}),r.jsx("button",{type:"button",className:"btn btn--sm btn--primary",onClick:Z,disabled:!A,children:"Сохранить"})]})]})]})}const z=[{id:"copy",label:"Копировать",onSelect:()=>void Lr(a.text)},...i?[{id:"edit",label:"Изменить",onSelect:P}]:[]];return r.jsxs("div",{className:"msg--user","data-item-id":a.id,onContextMenu:R,onTouchStart:T,onTouchMove:L,onTouchEnd:B,onTouchCancel:B,children:[K,a.text,c&&r.jsx(Yc,{x:c.x,y:c.y,items:z,onClose:()=>o(null)})]})}function ex(a,l){const i=a.querySelectorAll("[data-item-id]");for(const c of i)if(c.dataset.itemId===l)return c;return null}function oS({text:a}){const[l,i]=_.useState(""),c=_.useRef([]);_.useEffect(()=>{let d=!1;return Qh(a).then(h=>{d||i(fS(h))}),()=>{d=!0}},[a]),_.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!==""&&Lr(p).then(y=>{if(!y)return;h.textContent=wr,h.setAttribute("aria-label",wr),h.classList.add("copybtn--done");const j=window.setTimeout(()=>{h.isConnected&&(h.textContent=Di,h.setAttribute("aria-label",Mh),h.classList.remove("copybtn--done"))},Zh);c.current.push(j)})}return r.jsx("div",{className:"markdown-preview msg--assistant__body",onClick:o,dangerouslySetInnerHTML:{__html:l}})}const Mh=`${Di} блок кода`;function fS(a){if(!a.includes("<pre"))return a;const l=new DOMParser().parseFromString(a,"text/html");for(const i of l.body.querySelectorAll("pre")){const c=l.createElement("div");c.className="codeblock",i.replaceWith(c),c.append(i);const o=l.createElement("button");o.type="button",o.className="copybtn codeblock__copy",o.setAttribute("aria-label",Mh),o.title=Mh,o.textContent=Di,c.append(o)}return l.body.innerHTML}function dS({item:a}){const[l,i]=_.useState(!1),c=a.result===null,o=ry(a.name,a.input),d=a.name==="AskUserQuestion"?mS(a.input):null;return r.jsxs("div",{className:"tool"+(a.isError?" tool--error":"")+(a.awaitingPermission?" tool--wait":""),"data-item-id":a.id,children:[r.jsxs("button",{className:"tool__head",onClick:()=>i(h=>!h),children:[r.jsx("span",{className:"tool__name",children:a.name}),r.jsx("span",{className:"tool__arg",children:d?pS(d):hS(a.input)}),r.jsx("span",{className:"tool__status",children:c?"…":a.isError?"ошибка":l?"▴":"▾"})]}),l&&r.jsxs("div",{className:"tool__body",children:[d?r.jsx(gS,{questions:d,answers:a.answers}):o?r.jsx(Jh,{diff:o}):r.jsx(tx,{text:JSON.stringify(a.input,null,2),hint:"аргументы вызова"}),a.result!==null&&(!d||a.isError)&&r.jsx(tx,{text:a.result,hint:"результат вызова",style:{marginTop:10}})]})]})}function tx({text:a,hint:l,style:i}){return r.jsxs("div",{className:"codeblock",style:i,children:[r.jsx("pre",{className:"code",children:a}),r.jsx(Kh,{text:a,hint:l,className:"codeblock__copy"})]})}function hS(a){if(!a||typeof a!="object")return"";const l=a;for(const i of["file_path","command","pattern","path","url","prompt"]){const c=l[i];if(typeof c=="string")return c.replace(/\s+/g," ").slice(0,160)}return JSON.stringify(l).slice(0,160)}function pS(a){var i;const l=a.map(c=>c.header).filter(c=>c.length>0);return l.length===a.length?l.join(" · "):((i=a[0])==null?void 0:i.question.replace(/\s+/g," ").slice(0,160))??""}function mS(a){if(typeof a!="object"||a===null)return null;const l=a.questions;if(!Array.isArray(l)||l.length===0)return null;const i=[];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:y,description:j,preview:v}=x;if(typeof y!="string"||typeof j!="string")return null;m.push({label:y,description:j,...typeof v=="string"?{preview:v}:{}})}i.push({question:o,header:typeof d=="string"?d:"",options:m,multiSelect:p===!0})}return i}function gS({questions:a,answers:l}){return r.jsx("div",{className:"tool__questions",children:a.map((i,c)=>r.jsxs("div",{className:"tool__question",children:[r.jsxs("div",{className:"tool__question-head",children:[i.header&&r.jsx("span",{className:"chip chip--accent",children:i.header}),r.jsx("span",{className:"tool__question-text",children:i.question})]}),r.jsx("div",{className:"tool__question-answer",children:l!=null&&l[i.question]?r.jsx("span",{className:"tool__answer-value",children:l[i.question]}):r.jsx("span",{className:"tool__answer-empty",children:"не отвечено"})})]},c))})}function nx(a){return a>=1e3?`${(a/1e3).toFixed(1)}k`:String(a)}const bS="ccv.dictation.lang",lx="ru-RU";function xS(a){try{return Function.prototype.toString.call(a).includes("[native code]")}catch{return!1}}function ax(){const a=window,l=[a.SpeechRecognition,a.webkitSpeechRecognition].filter(c=>typeof c=="function"),i=l.find(xS);return!i&&l.length>0&&Vl("распознавание подменено: родной реализации в странице нет"),i??l[0]??null}function cy(){var a;try{return((a=localStorage.getItem(bS))==null?void 0:a.trim())||lx}catch{return lx}}function Vl(a,l){l===void 0?console.debug(`[dictation] ${a}`):console.debug(`[dictation] ${a}`,l)}const yS=3,_S=400,vS=5,SS=250,jS=2e3,kS=2e4;async function NS(){try{return(await navigator.permissions.query({name:"microphone"})).state==="granted"}catch{return!1}}const wS={"not-allowed":"Браузер не дал доступ к микрофону","service-not-allowed":"Браузер не дал доступ к микрофону","audio-capture":"Микрофон не найден",network:"Сервис распознавания недоступен","language-not-supported":`Распознавание не знает языка ${cy()}`};function TS(a){const[l]=_.useState(()=>ax()!==null),[i,c]=_.useState(!1),[o,d]=_.useState(null),h=_.useRef(null),p=_.useRef(!1),m=_.useRef(!1),x=_.useRef(a),y=_.useRef({openedAt:0,audio:!1,heard:!1,everHeard:!1,silent:0,dead:0,lastError:"",warned:!1}),j=_.useRef(null),v=_.useRef(!1),R=_.useRef(null),T=_.useCallback(()=>{R.current&&clearTimeout(R.current),R.current=null},[]),L=_.useCallback(()=>{T();const N=async K=>{if(R.current=null,!(!p.current||v.current)){if(!K&&!await NS()){if(Vl("ждём ответа на запрос доступа к микрофону"),!p.current||v.current)return;R.current=setTimeout(()=>void N(!0),kS);return}Vl("движок не ответил на start()"),p.current=!1,c(!1),d("Распознавание не отвечает — проверьте расширения браузера и доступ к микрофону")}};R.current=setTimeout(()=>void N(!1),jS)},[T]);_.useEffect(()=>{x.current=a}),_.useEffect(()=>{const N=ax();if(!N)return;const K=new N;return K.lang=cy(),K.continuous=!0,K.interimResults=!0,K.onstart=()=>{Vl("сессия открыта"),v.current=!0,T(),c(!0)},K.onaudiostart=()=>{Vl("пошёл звук с микрофона"),y.current.audio=!0},K.onresult=z=>{var oe;if(m.current)return;let A="",V="";for(let F=z.resultIndex;F<z.results.length;F++){const ae=z.results[F];if(!ae)continue;const me=((oe=ae[0])==null?void 0:oe.transcript)??"";ae.isFinal?A+=me:V+=me}const te=y.current;te.heard=!0,te.everHeard=!0,Vl("распознано",{final:A,interim:V}),x.current(A,V)},K.onerror=z=>{y.current.lastError=z.error,Vl("ошибка движка",z.error),!(z.error==="no-speech"||z.error==="aborted")&&(p.current=!1,c(!1),d(wS[z.error]??`Распознавание не работает: ${z.error}`))},K.onend=()=>{m.current=!1,v.current=!1;const z=y.current,A=Date.now()-z.openedAt;if(Vl("сессия закрыта",{мс:A,звук:z.audio,слова:z.heard,ошибка:z.lastError||null}),!p.current){c(!1);return}if(z.dead=!z.audio&&A<_S?z.dead+1:0,z.dead>=vS){p.current=!1,c(!1),d(z.lastError?`Распознавание не работает: ${z.lastError}`:"Распознавание закрывается сразу после запуска — проверьте доступ к микрофону в настройках сайта");return}z.silent=z.heard?0:z.silent+1,!z.everHeard&&!z.warned&&z.silent>=yS&&(z.warned=!0,d(z.audio?"Микрофон слушает, но речь не распознаётся — проверьте язык диктовки и уровень звука":"С микрофона не идёт звук — проверьте устройство ввода в настройках сайта в браузере")),j.current=setTimeout(()=>{if(j.current=null,!!p.current){z.openedAt=Date.now(),z.audio=!1,z.heard=!1,z.lastError="",L();try{K.start()}catch{}}},SS)},h.current=K,()=>{p.current=!1,j.current&&clearTimeout(j.current),j.current=null,T(),K.onend=null,K.onresult=null,K.onerror=null,K.onstart=null,K.onaudiostart=null,K.abort(),h.current=null}},[]);const B=_.useCallback(()=>{var N;if(p.current){if(p.current=!1,Vl("выключение микрофона"),j.current&&clearTimeout(j.current),j.current=null,T(),!v.current){c(!1);return}(N=h.current)==null||N.stop()}},[]),P=_.useCallback(()=>{const N=h.current;if(N){if(!window.isSecureContext){d("Микрофон доступен только по https или с localhost");return}d(null),p.current=!0,m.current=!1,j.current&&clearTimeout(j.current),j.current=null,y.current={openedAt:Date.now(),audio:!1,heard:!1,everHeard:!1,silent:0,dead:0,lastError:"",warned:!1},c(!0),Vl("включение микрофона",{язык:N.lang}),L();try{N.start()}catch(K){Vl("start() не прошёл",K)}}},[L]),M=_.useCallback(()=>{p.current?B():P()},[P,B]),Z=_.useCallback(()=>{var N;p.current&&v.current&&(m.current=!0,(N=h.current)==null||N.abort())},[]);return{supported:l,listening:i,error:o,toggle:M,stop:B,drop:Z}}const uy="ccv:drafts",ES=40,AS=2e4,CS=500;let Xc=null,Vc=null;function oy(){if(Xc)return Xc;const a=new Map;try{const l=localStorage.getItem(uy);if(l){const i=JSON.parse(l);if(typeof i=="object"&&i!==null)for(const[c,o]of Object.entries(i))typeof o=="string"&&o!==""&&a.set(c,o)}}catch{}return Xc=a,window.addEventListener("pagehide",fy),a}function ph(a){return oy().get(a)??""}function RS(a,l){const i=oy(),c=l.slice(0,AS),o=i.has(a);if(o&&i.delete(a),c!=="")i.set(a,c);else if(!o)return;for(;i.size>ES;){const d=i.keys().next();if(d.done)break;i.delete(d.value)}MS()}function MS(){Vc===null&&(Vc=window.setTimeout(fy,CS))}function fy(){if(Vc!==null&&window.clearTimeout(Vc),Vc=null,!!Xc)try{localStorage.setItem(uy,JSON.stringify(Object.fromEntries(Xc)))}catch{}}const OS="(max-width: 860px)",sx=/^\/(\S*)$/,DS=new Set(["model","permissions"]);function zS(a){return DS.has(a.name)||a.name.startsWith("__")}const LS=new Set(["clear","rename"]),ix=/(?:^|\s)@([^\s@]*)$/,US=200,HS=100,BS=190,qS=5,IS=20*1024*1024,GS=1568,YS=.85;let rx=0;async function XS(a){var j,v;if(!a.type.startsWith("image/")||a.size>IS)return null;const l=await VS(a);if(!l)return null;const{width:i,height:c}=l;if(i<=0||c<=0)return null;const o=Math.min(1,GS/Math.max(i,c)),d=document.createElement("canvas");d.width=Math.max(1,Math.round(i*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=a.type==="image/png",m=p?"image/png":"image/jpeg",x=d.toDataURL(m,p?void 0:YS),y=x.slice(x.indexOf(",")+1);return y?(rx+=1,{id:`att${rx}`,mediaType:m,data:y,previewUrl:x}):null}async function VS(a){if(typeof createImageBitmap=="function")try{const l=await createImageBitmap(a);return{image:l,width:l.width,height:l.height}}catch{}return new Promise(l=>{const i=URL.createObjectURL(a),c=new Image;c.onload=()=>{URL.revokeObjectURL(i),l({image:c,width:c.naturalWidth,height:c.naturalHeight})},c.onerror=()=>{URL.revokeObjectURL(i),l(null)},c.src=i})}function dy({disabled:a,busy:l,commands:i,sessionTitle:c,contextResult:o,className:d,placeholder:h,draftKey:p,sendLabel:m="Отправить",autoFocus:x=!1,attachmentsEnabled:y=!0,onContextSearch:j,onCommand:v,onSend:R,onInterrupt:T,onEscape:L}){var _e;const B=$o(OS),[P,M]=_.useState(()=>p?ph(p):""),[Z,N]=_.useState(!1),[K,z]=_.useState(0),A=_.useRef(null),V=_.useRef(null),te=_.useRef(null),[oe,F]=_.useState(()=>p?ph(p).length:0),[ae,me]=_.useState([]),Te=_.useRef(null),be=_.useCallback(O=>{!y||O.length===0||Promise.all(O.map(XS)).then(J=>{const xe=J.filter(Be=>Be!==null);xe.length!==0&&me(Be=>[...Be,...xe].slice(0,qS))})},[y]);function U(O){me(J=>J.filter(xe=>xe.id!==O))}function re(O){var Be;if(!y)return;const J=(Be=O.clipboardData)==null?void 0:Be.items;if(!J)return;const xe=[];for(const Et of J){if(!Et.type.startsWith("image/"))continue;const Nn=Et.getAsFile();Nn&&xe.push(Nn)}xe.length!==0&&(O.preventDefault(),be(xe))}function se(O){const J=O.target.files?Array.from(O.target.files):[];O.target.value="",be(J)}_.useEffect(()=>{y||me([])},[y]);const[pe,ke]=_.useState([]),[k,$]=_.useState(-1),ce=_.useRef(""),[he,Ne]=_.useState(""),ye=TS(_.useCallback((O,J)=>{O&&M(xe=>mh(xe,O)),Ne(J.trim())},[])),Ae=he?mh(P,he):P;_.useEffect(()=>{ye.listening||he===""||(M(O=>mh(O,he)),Ne(""))},[ye.listening,he]),_.useEffect(()=>{var O;x&&((O=A.current)==null||O.focus())},[x]);const st=_.useRef(new Map),Qe=_.useRef(new Map),Ot=_.useRef(p),qe=_.useRef({text:P,caret:oe});qe.current={text:P,caret:oe};const xt=_.useCallback((O,J,xe)=>{J===""?(st.current.delete(O),Qe.current.delete(O)):(st.current.set(O,J),Qe.current.set(O,xe)),RS(O,J)},[]),et=ye.drop;_.useLayoutEffect(()=>{const O=Ot.current;if(O===p)return;Ot.current=p,O&&xt(O,qe.current.text,qe.current.caret);const J=p?st.current.get(p)??ph(p):"",xe=p?Qe.current.get(p):void 0,Be=Math.min(xe??J.length,J.length);M(J),F(Be),te.current=[Be,Be],Ne(""),z(0),N(!1),$(-1),ce.current="",me([]),et()},[p,xt,et]),_.useEffect(()=>{p&&xt(p,P,oe)},[p,P,oe,xt]);const Je=a?"Выберите сессию":h??"Опишите задачу… («/» — команды, «@» — файлы)",Fe=_.useRef(0),it=_.useCallback(O=>{const J=parseFloat(getComputedStyle(O).maxHeight),xe=Number.isFinite(J)&&J>0?J:BS;O.style.height="auto";const Be=O.scrollHeight;O.style.height=`${Math.min(Be,xe)}px`,O.style.overflowY=Be>xe?"auto":"hidden"},[]);_.useEffect(()=>{const O=A.current;O&&it(O)},[Ae,Je,a,it]),_.useLayoutEffect(()=>{const O=A.current,J=te.current;!O||!J||(te.current=null,O.setSelectionRange(J[0],J[1]))}),_.useEffect(()=>{const O=A.current;if(!O)return;const J=new ResizeObserver(([xe])=>{const Be=xe==null?void 0:xe.contentRect.width;Be===void 0||Math.abs(Be-Fe.current)<1||(Fe.current=Be,it(O))});return J.observe(O),()=>J.disconnect()},[it]);const Jn=ye.stop;_.useEffect(()=>{a&&Jn()},[a,Jn]);const Bt=_.useMemo(()=>ye.error?{ok:!1,message:ye.error}:null,[ye.error]),qt=_.useMemo(()=>{var xe;const O=(xe=sx.exec(P))==null?void 0:xe[1];if(O===void 0)return[];const J=O.toLowerCase();return i.filter(Be=>!zS(Be)&&gh(Be,J)<hy).sort((Be,Et)=>gh(Be,J)-gh(Et,J))},[P,i]),Kt=!Z&&qt.length>0,It=Math.min(K,qt.length-1),Gt=Z?null:((_e=ix.exec(Ae.slice(0,oe)))==null?void 0:_e[1])??null,Qt=_.useRef(j);Qt.current=j,_.useEffect(()=>{if(Gt===null||Gt===""||Gt.endsWith("/")){Qt.current(Gt);return}const O=setTimeout(()=>Qt.current(Gt),US);return()=>clearTimeout(O)},[Gt]);const rt=Gt!==null&&(o==null?void 0:o.query)===Gt,wt=rt?o.entries:[],en=Gt!==null,En=en&&!rt,Ct=Math.min(K,Math.max(wt.length-1,0));_.useEffect(()=>{var J,xe;if(!Kt&&!en)return;const O=Kt?It:Ct;(xe=(J=V.current)==null?void 0:J.children[O])==null||xe.scrollIntoView({block:"nearest"})},[Kt,en,It,Ct]);function kn(O,J){var xe;M(O),F(J),te.current=[J,J],z(0),N(!1),he!==""&&(Ne(""),ye.drop()),(xe=A.current)==null||xe.focus()}function An(){M(""),Ne(""),z(0),F(0),N(!1),$(-1),ce.current="",me([]),ye.drop(),p&&xt(p,"",0)}function Dt(O){const J=O.trim();J===""&&ae.length===0||a||(R(J,ae.length>0?ae.map(xe=>({mediaType:xe.mediaType,data:xe.data})):void 0),J!==""&&ke(xe=>[J,...xe.filter(Be=>Be!==J)].slice(0,HS)),An())}function fn(O){if(O<-1||O>=pe.length)return;k===-1&&(ce.current=P);const J=O===-1?ce.current:pe[O]??"";$(O),kn(J,J.length)}function Jt(){var Be;const O=((Be=A.current)==null?void 0:Be.selectionStart)??Ae.length,xe=`${O>0&&!/\s$/.test(Ae.slice(0,O))?" ":""}@`;kn(Ae.slice(0,O)+xe+Ae.slice(O),O+xe.length)}function Tt(O){var Et;const J=(Et=ix.exec(Ae.slice(0,oe)))==null?void 0:Et[1];if(J===void 0)return;const xe=oe-J.length-1,Be=O.kind==="dir"?`@${O.path}/`:`@${O.path} `;kn(Ae.slice(0,xe)+Be+Ae.slice(oe),xe+Be.length)}function dn(){var J;const O=(J=sx.exec(Ae.trim()))==null?void 0:J[1];if(O&&v(O)){An();return}Dt(Ae)}function ot(O,J){M(O),F(J),z(0),N(!1),$(-1),he!==""&&(Ne(""),ye.drop())}function tn(O){var Be;const J=LS.has(O.name)?c:null,xe=`/${O.name} `;M(xe+(J??"")),F(xe.length+((J==null?void 0:J.length)??0)),J&&(te.current=[xe.length,xe.length+J.length]),z(0),(Be=A.current)==null||Be.focus()}function E(O){if(v(O.name)){M(""),z(0),N(!1);return}O.argumentHint?tn(O):Dt(`/${O.name}`)}function Y(O){if(Kt){if(O.key==="ArrowDown")return O.preventDefault(),z(J=>(Math.min(J,qt.length-1)+1)%qt.length);if(O.key==="ArrowUp"){O.preventDefault();const J=qt.length-1;return z(xe=>(Math.min(xe,J)+J)%qt.length)}if(O.key==="Enter"&&!O.shiftKey){O.preventDefault();const J=qt[It];J&&E(J);return}if(O.key==="Tab"){O.preventDefault();const J=qt[It];J&&tn(J);return}if(O.key==="Escape"){O.preventDefault(),O.stopPropagation(),N(!0);return}}if(en){if(O.key==="ArrowDown"&&wt.length>0)return O.preventDefault(),z(J=>(Math.min(J,wt.length-1)+1)%wt.length);if(O.key==="ArrowUp"&&wt.length>0){O.preventDefault();const J=wt.length-1;return z(xe=>(Math.min(xe,J)+J)%wt.length)}if(O.key==="Enter"&&!O.shiftKey||O.key==="Tab"){const J=wt[Ct];if(J){O.preventDefault(),Tt(J);return}if(O.key==="Tab")return}if(O.key==="Escape"){O.preventDefault(),O.stopPropagation(),N(!0);return}}if((O.key==="ArrowUp"||O.key==="ArrowDown")&&!O.shiftKey){const J=O.currentTarget,xe=J.selectionStart;if(J.selectionEnd===xe){const Et=O.key==="ArrowUp"?k+1:k-1;Et>=-1&&Et<pe.length&&requestAnimationFrame(()=>{J.selectionStart===xe&&J.selectionEnd===xe&&fn(Et)})}}if(O.key==="Escape"&&L){O.preventDefault(),O.stopPropagation(),L();return}O.key==="Enter"&&!O.shiftKey&&!B&&(O.preventDefault(),dn())}return r.jsx("div",{className:d?`composer ${d}`:"composer",children:r.jsxs("div",{className:"composer__inner",children:[r.jsx(Ui,{result:Bt}),en&&!Kt&&r.jsxs("div",{className:"cmdmenu",role:"listbox",ref:V,children:[wt.map((O,J)=>r.jsxs("button",{role:"option","aria-selected":J===Ct,className:J===Ct?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>z(J),onMouseDown:xe=>{xe.preventDefault(),Tt(O)},children:[r.jsxs("span",{className:"cmdmenu__name",children:[O.name,O.kind==="dir"?"/":""]}),r.jsx("span",{className:"cmdmenu__desc",children:O.path}),O.ignored&&r.jsx("span",{className:"cmdmenu__tag",children:"git-ignore"})]},O.path)),wt.length===0&&r.jsx("div",{className:"cmdmenu__empty",children:En?"ищем…":Gt?"Ничего не нашлось":"Наберите имя файла или каталога"})]}),Kt&&r.jsx("div",{className:"cmdmenu",role:"listbox",ref:V,children:qt.map((O,J)=>r.jsxs("button",{role:"option","aria-selected":J===It,className:J===It?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>z(J),onMouseDown:xe=>{xe.preventDefault(),E(O)},children:[r.jsxs("span",{className:"cmdmenu__name",children:["/",O.name]}),O.argumentHint&&r.jsx("span",{className:"cmdmenu__hint",children:O.argumentHint}),r.jsx("span",{className:"cmdmenu__desc",children:O.description})]},O.name))}),ae.length>0&&r.jsx("div",{className:"composer__attachments",children:ae.map(O=>r.jsxs("div",{className:"composer__thumb",children:[r.jsx("img",{src:O.previewUrl,alt:"Вложение"}),r.jsx("button",{type:"button",className:"composer__thumb-remove","aria-label":"Удалить вложение",onClick:()=>U(O.id),children:r.jsx(FS,{})})]},O.id))}),r.jsxs("div",{className:"composer__field",children:[r.jsx("button",{type:"button",className:"addbtn",title:"Добавить контекст — файл проекта («@»)","aria-label":"Добавить контекст",disabled:a,onClick:Jt,children:r.jsx(ZS,{})}),y&&r.jsxs(r.Fragment,{children:[r.jsx("input",{ref:Te,type:"file",accept:"image/*",multiple:!0,className:"composer__fileinput",tabIndex:-1,"aria-hidden":"true",onChange:se}),r.jsx("button",{type:"button",className:"attachbtn",title:"Прикрепить изображение","aria-label":"Прикрепить изображение",disabled:a,onClick:()=>{var O;return(O=Te.current)==null?void 0:O.click()},children:r.jsx(JS,{})})]}),r.jsx("textarea",{ref:A,value:Ae,disabled:a,placeholder:Je,onChange:O=>ot(O.target.value,O.target.selectionStart),onSelect:O=>F(O.currentTarget.selectionStart),onKeyDown:Y,onPaste:re}),ye.supported&&r.jsx("button",{type:"button",className:ye.listening?"micbtn is-on":"micbtn",title:ye.listening?"Остановить диктовку":"Продиктовать промпт","aria-label":ye.listening?"Остановить диктовку":"Продиктовать промпт","aria-pressed":ye.listening,disabled:a,onClick:ye.toggle,children:r.jsx(WS,{on:ye.listening})}),l?r.jsx("button",{className:"btn",onClick:T,title:"Прервать (Esc)",children:"Стоп"}):r.jsxs("button",{className:"btn btn--primary sendbtn",onClick:dn,disabled:a||Ae.trim()===""&&ae.length===0,"aria-label":m,title:m,children:[r.jsx("span",{className:"sendbtn__label",children:m}),r.jsx(KS,{})]})]})]})})}function mh(a,l){const i=l.trim();if(i==="")return a;const c=Oh(i).slice($S(a,i)).join(" ");return c===""?a:a===""||/\s$/.test(a)?a+c:`${a} ${c}`}function $S(a,l){const i=Oh(a),c=Oh(l);for(let o=Math.min(i.length,c.length);o>0;o--)if(i.slice(i.length-o).every((d,h)=>QS(d,c[h]??"")))return o;return 0}function Oh(a){return a.split(/\s+/).filter(l=>l!=="")}function QS(a,l){const i=c=>c.toLowerCase().replace(/[.,!?;:…]+$/u,"");return i(a)===i(l)}function ZS(){return r.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round","aria-hidden":"true",children:r.jsx("path",{d:"M8 3.4v9.2M3.4 8h9.2"})})}function KS(){return r.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:r.jsx("path",{d:"M8 12.5V3.5M4 7.5 8 3.5l4 4"})})}function JS(){return r.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:r.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 FS(){return r.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round","aria-hidden":"true",children:r.jsx("path",{d:"M4 4l8 8M12 4l-8 8"})})}function WS({on:a}){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("rect",{x:"5.9",y:"1.7",width:"4.2",height:"7.6",rx:"2.1",fill:a?"currentColor":"none"}),r.jsx("path",{d:"M3.3 7.3v.8a4.7 4.7 0 0 0 9.4 0v-.8"}),r.jsx("path",{d:"M8 12.8v1.5"})]})}const hy=4;function gh(a,l){const i=a.name.toLowerCase();return i===l?0:i.startsWith(l)?1:a.aliases.some(c=>c.toLowerCase().startsWith(l))?2:i.includes(l)?3:hy}function PS({request:a,queued:l,onDecide:i}){const c=ry(a.toolName,a.input);return r.jsx("div",{className:"modal-backdrop modal-backdrop--sheet",children:r.jsxs("div",{className:"sheet",role:"dialog","aria-modal":"true",children:[r.jsxs("div",{className:"sheet__head",children:["Разрешить действие?",l>0&&` (ещё ${l} в очереди)`]}),r.jsxs("div",{className:"sheet__body",children:[r.jsx("div",{className:"sheet__tool",children:a.toolName}),a.reason&&r.jsx("p",{className:"sheet__reason",children:a.reason}),c?r.jsx(Jh,{diff:c}):r.jsx("pre",{className:"code",children:JSON.stringify(a.input,null,2)})]}),r.jsxs("div",{className:"sheet__actions",children:[r.jsx("button",{className:"btn",onClick:()=>i(a.requestId,"deny"),children:"Отклонить"}),r.jsx("button",{className:"btn btn--warn",autoFocus:!0,onClick:()=>i(a.requestId,"allow"),children:"Разрешить"})]})]})})}function ej({request:a,queued:l,onAnswer:i,onDecline:c}){const{questions:o}=a,[d,h]=_.useState(()=>o.map(()=>new Set)),[p,m]=_.useState(()=>o.map(()=>"")),[x,y]=_.useState(()=>cx(o));_.useEffect(()=>{h(o.map(()=>new Set)),m(o.map(()=>"")),y(cx(o))},[a.requestId]);const j=_.useMemo(()=>nj(o,d,p),[o,d,p]),v=j!==null;function R(Z,N){var K,z;(z=(K=o[Z])==null?void 0:K.options[N])!=null&&z.preview&&y(A=>{const V=A.slice();return V[Z]=N,V})}function T(Z,N,K){h(z=>{const A=z.slice(),V=new Set(A[Z]);return K?V.has(N)?V.delete(N):V.add(N):V.has(N)||(V.clear(),V.add(N)),A[Z]=V,A}),N!=="other"&&R(Z,N)}function L(Z,N){m(K=>{const z=K.slice();return z[Z]=N,z})}function B(){j&&i(a.requestId,j)}function P(Z){Z.key==="Enter"&&(Z.target.closest("button")||v&&(Z.preventDefault(),B()))}function M(Z){var A;if(!["ArrowDown","ArrowUp","ArrowRight","ArrowLeft"].includes(Z.key))return;const N=Array.from(Z.currentTarget.querySelectorAll("button.qsheet__option")),K=N.indexOf(document.activeElement);if(K===-1)return;Z.preventDefault();const z=Z.key==="ArrowDown"||Z.key==="ArrowRight"?1:-1;(A=N[(K+z+N.length)%N.length])==null||A.focus()}return r.jsx("div",{className:"modal-backdrop modal-backdrop--sheet",children:r.jsxs("div",{className:"qsheet",role:"dialog","aria-modal":"true","aria-label":"Вопрос от Claude",onKeyDown:P,children:[r.jsxs("div",{className:"qsheet__head",children:[r.jsx("span",{className:"qsheet__head-icon","aria-hidden":"true",children:"?"}),r.jsxs("span",{children:[o.length===1?"Уточняющий вопрос":`Уточняющие вопросы (${o.length})`,l>0&&` — ещё ${l} в очереди`]})]}),r.jsxs("div",{className:"qsheet__body",children:[a.reason&&r.jsx("p",{className:"qsheet__reason",children:a.reason}),o.map((Z,N)=>r.jsx(tj,{q:Z,qi:N,selected:d[N]??new Set,otherText:p[N]??"",previewIndex:x[N]??null,onToggle:T,onFocusOption:R,onOtherText:L,onOptionsKeyDown:M},N))]}),r.jsxs("div",{className:"qsheet__actions",children:[r.jsx("button",{className:"btn",onClick:()=>c(a.requestId),children:"Не отвечать"}),r.jsx("button",{className:"btn btn--primary",disabled:!v,onClick:B,children:"Ответить"})]})]})})}function tj({q:a,qi:l,selected:i,otherText:c,previewIndex:o,onToggle:d,onFocusOption:h,onOtherText:p,onOptionsKeyDown:m}){var R;const x=a.options.some(T=>T.preview),y=o!==null?(R=a.options[o])==null?void 0:R.preview:void 0,j=i.has("other"),v=a.multiSelect?"checkbox":"radio";return r.jsxs("div",{className:"qsheet__question",children:[r.jsxs("div",{className:"qsheet__qhead",children:[r.jsx("span",{className:"chip chip--accent",children:a.header}),r.jsx("span",{className:"qsheet__qtext",children:a.question})]}),r.jsxs("div",{className:"qsheet__options"+(a.multiSelect?"":" qsheet__options--radio"),role:a.multiSelect?"group":"radiogroup","aria-label":a.question,onKeyDown:m,children:[a.options.map((T,L)=>{const B=i.has(L);return r.jsxs("button",{type:"button",role:v,"aria-checked":B,className:"qsheet__option"+(B?" is-selected":""),onClick:()=>d(l,L,a.multiSelect),onFocus:()=>h(l,L),onMouseEnter:()=>h(l,L),children:[r.jsx("span",{className:"qsheet__opt-mark","aria-hidden":"true"}),r.jsxs("span",{className:"qsheet__opt-body",children:[r.jsx("span",{className:"qsheet__opt-label",children:T.label}),r.jsx("span",{className:"qsheet__opt-desc",children:T.description})]})]},L)}),r.jsxs("div",{className:"qsheet__other",children:[r.jsxs("button",{type:"button",role:v,"aria-checked":j,className:"qsheet__option qsheet__option--other"+(j?" is-selected":""),onClick:()=>d(l,"other",a.multiSelect),children:[r.jsx("span",{className:"qsheet__opt-mark","aria-hidden":"true"}),r.jsxs("span",{className:"qsheet__opt-body",children:[r.jsx("span",{className:"qsheet__opt-label",children:"Другое"}),r.jsx("span",{className:"qsheet__opt-desc",children:"Свой вариант ответа"})]})]}),j&&r.jsx("input",{type:"text",className:"qsheet__other-input",placeholder:"Впишите свой вариант…","aria-label":`Свой вариант ответа на вопрос «${a.question}»`,value:c,onChange:T=>p(l,T.target.value),autoFocus:!0})]})]}),x&&r.jsx("pre",{className:"qsheet__preview",children:y??""})]})}function cx(a){return a.map(l=>{const i=l.options.findIndex(c=>c.preview);return i===-1?null:i})}function nj(a,l,i){const c={};for(let o=0;o<a.length;o++){const d=a[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=(i[o]??"").trim();m&&p.push(m)}if(p.length===0)return null;c[d.question]=p.join(", ")}return c}function lj({request:a,plan:l,queued:i,onAccept:c,onDecline:o}){const[d,h]=_.useState(l),[p,m]=_.useState("preview");_.useEffect(()=>{h(l),m("preview")},[a.requestId,l]);const x=d.trim().length>0;function y(){x&&c(a.requestId,d)}return r.jsx("div",{className:"modal-backdrop modal-backdrop--sheet",children:r.jsxs("div",{className:"plansheet",role:"dialog","aria-modal":"true","aria-label":"План агента",children:[r.jsxs("div",{className:"plansheet__head",children:[r.jsx("span",{className:"plansheet__head-icon","aria-hidden":"true",children:r.jsx(sj,{})}),r.jsxs("span",{className:"plansheet__head-text",children:["План на согласование",i>0&&` — ещё ${i} в очереди`]}),r.jsxs("div",{className:"plansheet__viewtoggle",role:"tablist","aria-label":"Режим просмотра",children:[r.jsx("button",{className:"btn btn--sm"+(p==="preview"?" is-on":""),role:"tab","aria-selected":p==="preview",onClick:()=>m("preview"),children:"Просмотр"}),r.jsx("button",{className:"btn btn--sm"+(p==="source"?" is-on":""),role:"tab","aria-selected":p==="source",onClick:()=>m("source"),children:"Код"})]})]}),r.jsxs("div",{className:"plansheet__body",children:[a.reason&&r.jsx("p",{className:"plansheet__reason",children:a.reason}),r.jsx("div",{className:"plansheet__content",children:p==="preview"?r.jsx(aj,{text:d}):r.jsx("textarea",{className:"plansheet__source",value:d,onChange:j=>h(j.target.value),spellCheck:!1,"aria-label":"Текст плана — можно отредактировать перед тем, как согласиться",autoFocus:!0})})]}),r.jsxs("div",{className:"plansheet__actions",children:[r.jsx("button",{className:"btn",onClick:()=>o(a.requestId),children:"Доработать"}),r.jsx("button",{className:"btn btn--ok",disabled:!x,autoFocus:!0,onClick:y,children:"Одобрить план"})]})]})})}function aj({text:a}){const[l,i]=_.useState("");return _.useEffect(()=>{let c=!1;return Qh(a).then(o=>{c||i(o)}),()=>{c=!0}},[a]),r.jsx("div",{className:"markdown-preview plansheet__preview",dangerouslySetInnerHTML:{__html:l}})}function sj(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.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"}),r.jsx("path",{d:"M9.5 2.5v2.5a.5.5 0 0 0 .5.5h3"}),r.jsx("path",{d:"M5.6 8.6 7 10l3-3.2"})]})}function ij(a,l){if(a!=="ExitPlanMode"||!l||typeof l!="object")return null;const i=l.plan;return typeof i=="string"?i:null}function py({path:a}){const[l,i]=_.useState(!1),[c,o]=_.useState(!1),d=_.useRef(null);_.useEffect(()=>{if(!l)return;function p(m){var x;(x=d.current)!=null&&x.contains(m.target)||i(!1)}return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[l]),_.useEffect(()=>{if(!c)return;const p=setTimeout(()=>o(!1),Zh);return()=>clearTimeout(p)},[c]),_.useEffect(()=>i(!1),[a]);async function h(){await Lr(a)&&o(!0)}return r.jsxs("div",{ref:d,className:"cwd",children:[r.jsxs("button",{type:"button",className:"cwd__toggle","aria-expanded":l,title:l?"Свернуть путь":`Полный путь: ${a}`,onClick:()=>i(p=>!p),onKeyDown:p=>{p.key!=="Escape"||!l||(p.preventDefault(),p.stopPropagation(),i(!1))},children:[r.jsx(rj,{open:l}),r.jsx("span",{className:"cwd__short",children:a})]}),l&&r.jsxs("div",{className:"cwd__pop",children:[r.jsx("span",{className:"cwd__full",children:a}),r.jsx("button",{type:"button",className:"btn btn--ghost cwd__copy",onClick:()=>void h(),children:c?wr:Di})]})]})}function rj({open:a}){return r.jsx("svg",{className:a?"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:r.jsx("path",{d:"M6 3.5 10.5 8 6 12.5"})})}function es({value:a,options:l,onChange:i,className:c,title:o,ariaLabel:d,placeholder:h="—"}){const[p,m]=_.useState(!1),[x,y]=_.useState(0),j=_.useRef(null),v=_.useRef(null),R=l.find(B=>B.value===a)??null;_.useEffect(()=>{if(!p)return;const B=l.findIndex(P=>P.value===a);y(B===-1?0:B)},[p]),_.useEffect(()=>{if(!p)return;function B(P){var M;(M=j.current)!=null&&M.contains(P.target)||m(!1)}return document.addEventListener("mousedown",B),()=>document.removeEventListener("mousedown",B)},[p]),_.useEffect(()=>{var B,P;p&&((P=(B=v.current)==null?void 0:B.querySelector(".is-cursor"))==null||P.scrollIntoView({block:"nearest"}))},[p,x]),_.useEffect(()=>{if(!p)return;const B=v.current,P=cj(j.current);if(!B||!P)return;const M=B.getBoundingClientRect().bottom-P.getBoundingClientRect().bottom;M>0&&(P.scrollTop+=Math.min(M+8,B.offsetHeight))},[p]);function T(B){m(!1),B.value!==a&&i(B.value)}function L(B){if(B.key==="Escape"){if(!p)return;B.preventDefault(),B.stopPropagation(),m(!1);return}if(B.key==="ArrowDown"||B.key==="ArrowUp"){if(B.preventDefault(),!p)return m(!0);const P=B.key==="ArrowDown"?1:l.length-1;return y(M=>(M+P)%l.length)}if(B.key==="Enter"||B.key===" "){if(B.preventDefault(),!p)return m(!0);const P=l[x];P&&T(P)}}return r.jsxs("div",{ref:j,className:"select"+(p?" select--open":"")+(c?` ${c}`:""),children:[r.jsxs("button",{type:"button",className:"select__trigger",title:o,"aria-label":d??o,"aria-haspopup":"listbox","aria-expanded":p,onClick:()=>m(B=>!B),onKeyDown:L,children:[r.jsx("span",{className:"select__value",children:(R==null?void 0:R.label)??h}),r.jsx(uj,{})]}),p&&r.jsx("div",{ref:v,className:"select__menu",role:"listbox","aria-label":d??o,children:l.map((B,P)=>r.jsxs("button",{type:"button",role:"option","aria-selected":B.value===a,className:"select__option"+(P===x?" is-cursor":"")+(B.value===a?" is-on":""),onMouseEnter:()=>y(P),onClick:()=>T(B),children:[r.jsx("span",{className:"select__check","aria-hidden":"true",children:B.value===a?"✓":""}),r.jsx("span",{className:"select__label",children:B.label}),B.hint&&r.jsx("span",{className:"select__hint",children:B.hint})]},B.value))})]})}function cj(a){let l=(a==null?void 0:a.parentElement)??null;for(;l;){if(l.scrollHeight>l.clientHeight&&getComputedStyle(l).overflowY!=="visible")return l;l=l.parentElement}return null}function uj(){return r.jsx("svg",{className:"select__chev",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:r.jsx("path",{d:"M3 4.5 6 7.5 9 4.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}const oj=["low","medium","high"];function my({models:a,value:l,effort:i,ultracode:c,thinking:o,switchOnFlag:d,className:h,onModel:p,onEffort:m,onUltracode:x,onThinking:y,onSwitchOnFlag:j}){const[v,R]=_.useState(!1),[T,L]=_.useState(0),B=_.useRef(null),P=_.useRef(null),M=a.find(A=>A.value===l)??null,Z=M&&M.supportsEffort?M.effortLevels.length>0?M.effortLevels:oj:[],N=Z.includes("xhigh");_.useEffect(()=>{if(!v)return;const A=a.findIndex(V=>V.value===l);L(A===-1?0:A)},[v]),_.useEffect(()=>{if(!v)return;function A(V){var te;(te=B.current)!=null&&te.contains(V.target)||R(!1)}return document.addEventListener("mousedown",A),()=>document.removeEventListener("mousedown",A)},[v]),_.useEffect(()=>{var A,V;v&&((V=(A=P.current)==null?void 0:A.querySelector(".is-cursor"))==null||V.scrollIntoView({block:"nearest"}))},[v,T]);function K(A){R(!1),A.value!==l&&p(A.value)}function z(A){if(A.key==="Escape"){if(!v)return;A.preventDefault(),A.stopPropagation(),R(!1);return}if(A.key==="ArrowDown"||A.key==="ArrowUp"){if(A.preventDefault(),!v)return R(!0);if(a.length===0)return;const V=A.key==="ArrowDown"?1:a.length-1;return L(te=>(te+V)%a.length)}if(A.key==="Enter"||A.key===" "){if(A.preventDefault(),!v)return R(!0);const V=a[T];V&&K(V)}}return r.jsxs("div",{ref:B,className:"select"+(v?" select--open":"")+(h?` ${h}`:""),children:[r.jsxs("button",{type:"button",className:"select__trigger",title:"Модель, усилие и размышления","aria-label":"Модель, усилие и размышления","aria-haspopup":"menu","aria-expanded":v,onClick:()=>R(A=>!A),onKeyDown:z,children:[r.jsx("span",{className:"select__value",children:(M==null?void 0:M.displayName)??l??"—"}),c?r.jsx("span",{className:"select__suffix select__suffix--hot",children:"ultracode"}):Z.length>0&&i&&r.jsx("span",{className:"select__suffix",children:i}),r.jsx(fj,{})]}),v&&r.jsxs("div",{ref:P,className:"select__menu modelmenu",role:"menu",children:[r.jsx("div",{className:"modelmenu__head",children:"Модель"}),a.map((A,V)=>r.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":A.value===l,className:"select__option"+(V===T?" is-cursor":"")+(A.value===l?" is-on":""),onMouseEnter:()=>L(V),onClick:()=>K(A),children:[r.jsx("span",{className:"select__check","aria-hidden":"true",children:A.value===l?"✓":""}),r.jsx("span",{className:"select__label",children:A.displayName}),A.description&&r.jsx("span",{className:"select__hint",children:A.description})]},A.value)),Z.length>0&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"modelmenu__sep",role:"separator"}),r.jsxs("div",{className:"modelmenu__row",children:[r.jsxs("span",{className:"modelmenu__label",children:["Усилие",r.jsx("span",{className:"modelmenu__desc",children:"насколько усердно модель думает"})]}),r.jsx("span",{className:"modelmenu__levels",children:Z.map(A=>r.jsx("button",{type:"button",role:"menuitemradio","aria-checked":A===i,className:A===i?"modelmenu__level is-on":"modelmenu__level",onClick:()=>m(A),children:A},A))})]}),N&&r.jsx(bh,{label:"Ultracode",desc:"xhigh и постоянная оркестрация подагентами",on:c,onToggle:()=>x(!c)})]}),r.jsx("div",{className:"modelmenu__sep",role:"separator"}),(M==null?void 0:M.supportsThinking)!==!1&&r.jsx(bh,{label:"Размышления",desc:"расширенное обдумывание перед ответом",on:o,onToggle:()=>y(!o)}),r.jsx(bh,{label:"Менять модель по флагу",desc:"иначе помеченный ход встаёт на паузу",on:d,onToggle:()=>j(!d)})]})]})}function bh({label:a,desc:l,on:i,onToggle:c}){return r.jsxs("button",{type:"button",role:"menuitemcheckbox","aria-checked":i,className:"modelmenu__row modelmenu__row--btn",onClick:c,children:[r.jsxs("span",{className:"modelmenu__label",children:[a,r.jsx("span",{className:"modelmenu__desc",children:l})]}),r.jsx("span",{className:i?"switch is-on":"switch","aria-hidden":"true",children:r.jsx("span",{className:"switch__knob"})})]})}function fj(){return r.jsx("svg",{className:"select__chev",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:r.jsx("path",{d:"M3 4.5 6 7.5 9 4.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function Nl({title:a,children:l,actions:i,className:c,sheet:o=!1,onClose:d}){const h=_.useRef(null);return _.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 y=x.querySelectorAll('button, input, textarea, select, a[href], [tabindex]:not([tabindex="-1"])'),j=y[0],v=y[y.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]),r.jsx("div",{className:o?"modal-backdrop modal-backdrop--sheet":"modal-backdrop",onMouseDown:p=>{p.target===p.currentTarget&&d()},children:r.jsxs("div",{ref:h,className:c?`modal ${c}`:"modal",role:"dialog","aria-modal":"true","aria-label":a,children:[r.jsxs("div",{className:"modal__head",children:[r.jsx("h2",{className:"modal__title",children:a}),r.jsx("button",{className:"modal__close","aria-label":"Закрыть",onClick:d,children:"✕"})]}),r.jsx("div",{className:"modal__body",children:l}),i&&r.jsx("div",{className:"modal__actions",children:i})]})})}function dj({candidates:a,searching:l,agentItems:i,agentBusy:c,error:o,roots:d,created:h,onSearch:p,onAskAgent:m,onInterrupt:x,onSubmit:y,onCreate:j,onClose:v}){const[R,T]=_.useState("open"),[L,B]=_.useState(""),[P,M]=_.useState(!1),[Z,N]=_.useState(""),[K,z]=_.useState(""),[A,V]=_.useState({git:!0,claudeMd:!0,readme:!0}),te=L.trim(),oe=te!=="",F=Z.trim(),ae=K.trim(),me=F!==""&&ae!=="";_.useEffect(()=>{Z===""&&d.length>0&&N(d[0])},[d]);const Te=_.useRef(p);Te.current=p,_.useEffect(()=>{if(R!=="open")return;const se=L.trim(),pe=setTimeout(()=>Te.current(se),200);return()=>clearTimeout(pe)},[L,R]);function be(){oe&&y(te)}function U(){me&&j(F,ae,A)}function re(){oe&&(M(!0),m(te))}return h?r.jsxs(Nl,{title:"Новый проект",onClose:v,actions:r.jsx("button",{className:"btn btn--primary",onClick:v,autoFocus:!0,children:"Понятно"}),children:[r.jsx("p",{className:"modal__text",children:"Каталог создан и открыт как проект, но часть шагов не удалась."}),r.jsx("p",{className:"newproj__preview",children:h.path}),r.jsx("div",{className:"modal__error",children:r.jsx("ul",{className:"newproj__warnings",children:h.warnings.map(se=>r.jsx("li",{children:se},se))})}),r.jsx("p",{className:"modal__text modal__text--dim",children:"Проект открыт и работает — недостающее можно добавить руками, в дереве файлов или из терминала."})]}):r.jsxs(Nl,{title:"Новый проект",className:P&&R==="open"?"modal--wide":void 0,onClose:v,actions:r.jsxs(r.Fragment,{children:[r.jsx("button",{className:"btn",onClick:v,children:"Отмена"}),R==="open"?r.jsxs(r.Fragment,{children:[c?r.jsx("button",{className:"btn",onClick:x,children:"Остановить"}):r.jsx("button",{className:"btn",disabled:!oe,onClick:re,title:"Найти по описанию",children:"Попросить агента"}),r.jsx("button",{className:"btn btn--primary",disabled:!oe,onClick:be,children:"Открыть"})]}):r.jsx("button",{className:"btn btn--primary",disabled:!me,onClick:U,children:"Создать"})]}),children:[r.jsxs("div",{className:"tabs",children:[r.jsx(ux,{label:"Открыть",on:R==="open",onClick:()=>T("open")}),r.jsx(ux,{label:"Создать",on:R==="create",onClick:()=>T("create")})]}),R==="open"?r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"modal__text",children:"Каталог, в котором будет работать агент. Введите путь или часть имени — подходящие каталоги появятся ниже."}),r.jsx("label",{className:"field",htmlFor:"workspace-path",children:"Путь или название"}),r.jsx("input",{id:"workspace-path",className:"input input--mono",value:L,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"C:\\Projects\\my-app",onChange:se=>B(se.target.value),onKeyDown:se=>{se.key==="Enter"&&(se.preventDefault(),be())}}),o&&r.jsx("p",{className:"modal__error",children:o}),a.length>0&&r.jsx("ul",{className:"finds",children:a.map(se=>r.jsx("li",{children:r.jsxs("button",{className:"find",disabled:se.open,title:se.open?"Этот проект уже открыт":se.path,onClick:()=>B(se.path),onDoubleClick:()=>y(se.path),children:[r.jsx("span",{className:"find__name",children:se.name}),r.jsx("span",{className:"find__path",children:se.path}),r.jsx("span",{className:"find__note",children:mj(se)})]})},se.path))}),a.length===0&&oe&&!l&&!P&&r.jsx("p",{className:"modal__text modal__text--dim",children:"Ничего похожего среди каталогов, где вы работали. Если помните не имя, а суть проекта — опишите его и нажмите «Попросить агента». Проекта ещё нет вовсе — рядом вкладка «Создать»."}),P&&r.jsx("div",{className:"finds__agent",children:r.jsx(Fh,{items:i,busy:c,waiting:!1,empty:"Агент ищет…"})})]}):r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"modal__text",children:"Пустой каталог для нового проекта. Дальше в нём работает агент — с первого промпта, без отдельной настройки."}),r.jsx("label",{className:"field",htmlFor:"workspace-parent",children:"Где создать"}),r.jsx("input",{id:"workspace-parent",className:"input input--mono",value:Z,spellCheck:!1,autoComplete:"off",placeholder:"C:\\Projects",onChange:se=>N(se.target.value)}),d.length>0&&r.jsx("div",{className:"newproj__roots",children:d.map(se=>r.jsx("button",{type:"button",className:se===F?"newproj__root is-on":"newproj__root",title:se,onClick:()=>N(se),children:pj(se)},se))}),r.jsx("label",{className:"field newproj__field",htmlFor:"workspace-name",children:"Имя проекта"}),r.jsx("input",{id:"workspace-name",className:"input input--mono",value:K,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"my-app",onChange:se=>z(se.target.value),onKeyDown:se=>{se.key==="Enter"&&(se.preventDefault(),U())}}),r.jsx("p",{className:"newproj__preview",children:me?hj(F,ae):"Каталог появится здесь"}),o&&r.jsx("p",{className:"modal__error",children:o}),r.jsxs("div",{className:"newproj__opts",children:[r.jsx(xh,{label:"git init",desc:"панель истории работает сразу",on:A.git,onToggle:()=>V(se=>({...se,git:!se.git}))}),r.jsx(xh,{label:"CLAUDE.md",desc:"заготовка инструкций для агента",on:A.claudeMd,onToggle:()=>V(se=>({...se,claudeMd:!se.claudeMd}))}),r.jsx(xh,{label:"README.md",desc:"по нему проект потом узнаёт поиск",on:A.readme,onToggle:()=>V(se=>({...se,readme:!se.readme}))})]})]})]})}function ux({label:a,on:l,onClick:i}){return r.jsx("button",{type:"button",className:l?"tabs__tab is-on":"tabs__tab","aria-pressed":l,onClick:i,children:a})}function xh({label:a,desc:l,on:i,onToggle:c}){return r.jsxs("button",{type:"button",role:"checkbox","aria-checked":i,className:"newproj__opt",onClick:c,children:[r.jsxs("span",{className:"newproj__optlabel",children:[a,r.jsx("span",{className:"newproj__optdesc",children:l})]}),r.jsx("span",{className:i?"switch is-on":"switch","aria-hidden":"true",children:r.jsx("span",{className:"switch__knob"})})]})}function hj(a,l){const i=a.includes("\\")?"\\":"/";return a.replace(/[\\/]+$/,"")+i+l}function pj(a){const l=a.includes("\\")?"\\":"/",i=a.split(/[\\/]/).filter(Boolean);return i.length<=2?a:`…${l}${i.slice(-2).join(l)}`}function mj(a){return a.open?"уже открыт":a.why?a.why:a.sessions===0?"рядом с вашими проектами":`${gj(a.sessions)}${bj(a.lastUsedAt)}`}function gj(a){const l=a%10,i=a%100;return i>=11&&i<=14?`${a} сессий`:l===1?`${a} сессия`:l>=2&&l<=4?`${a} сессии`:`${a} сессий`}function bj(a){if(!a)return"";const l=Math.floor((Date.now()-a)/864e5);return l<=0?" · сегодня":l===1?" · вчера":l<30?` · ${l} дн. назад`:` · ${new Date(a).toLocaleDateString("ru-RU")}`}const Wh=7;function xj(a){const l=[],i=[];let c=1;for(const o of a){const d=l.slice();let h=l.indexOf(o.hash);h===-1&&(h=ox(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 R=l.indexOf(v);R===-1&&(R=ox(l),l[R]=v),x.push({from:h,to:R})}const y=[];for(let v=0;v<d.length;v++)d[v]===o.hash&&(y.push({from:v,to:h}),v!==h&&(l[v]=null));const j=[];for(let v=0;v<d.length;v++){const R=d[v];!R||R===o.hash||v===h||l[v]===R&&j.push(v)}yj(l),c=Math.max(c,l.length,h+1),i.push({commit:o,col:h,up:y,down:x,through:j})}return{rows:i,columns:Math.min(c,Wh)}}function ox(a){const l=a.indexOf(null);return l!==-1?l:(a.push(null),a.length-1)}function yj(a){for(;a.length>0&&a[a.length-1]===null;)a.pop()}const gy=1500;function _j(a){const l=[];let i=!1;for(const c of a.patch.split(`
118
- `)){if(l.length>=gy){i=!0;break}if(c.startsWith("@@"))l.push({type:"gap",text:vj(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:a.path||a.oldPath,rows:l,added:a.added,removed:a.removed,note:Sj(a,i)}}function vj(a){const l=/^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@ ?(.*)$/.exec(a);if(!l)return a;const i=Number(l[1]),c=l[2]===void 0?1:Number(l[2]),o=(l[3]??"").trim(),d=c>1?`строки ${i}–${i+c-1}`:`строка ${i}`;return o?`⋯ ${d} · ${o}`:`⋯ ${d}`}function Sj(a,l){const i=[];return a.status==="added"&&i.push("новый файл"),a.status==="deleted"&&i.push("файл удалён"),a.status==="renamed"&&i.push(`переименован из ${a.oldPath}`),a.binary?i.push("двоичный файл"):a.patch===""&&i.push("содержимое не показано"),l&&i.push(`показаны первые ${gy} строк`),i.length>0?i.join(" · "):null}function jj({open:a,state:l,result:i,selected:c,busy:o,onRefresh:d,onShow:h,onCheckout:p,onPush:m,onPull:x,onPublish:y,onConnectRemote:j,onDismissResult:v,onClose:R,zoomed:T,onToggleZoom:L}){const B=xj((l==null?void 0:l.commits)??[]),P=[...l!=null&&l.detached?[{value:"",label:`отделён · ${l.head.slice(0,8)}`}]:[],...((l==null?void 0:l.branches)??[]).map(M=>({value:M.name,label:M.name,hint:M.hash.slice(0,8)}))];return r.jsxs("aside",{className:(a?"sidepane sidepane--git sidepane--open":"sidepane sidepane--git")+(T?" sidepane--zoomed":""),"aria-label":"История git",children:[r.jsxs("div",{className:"sidepane__head",onDoubleClick:M=>{L&&(M.target.closest("button")||L())},children:[r.jsx(Ej,{}),r.jsx("span",{className:"sidepane__title",children:"История"}),r.jsx("button",{className:"sidepane__btn",title:"Обновить","aria-label":"Обновить историю",onClick:d,children:"↻"}),L&&r.jsx("button",{className:"sidepane__btn",title:T?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":T?"Свернуть панель истории":"Развернуть панель истории на весь экран","aria-pressed":T,onClick:L,children:r.jsx(Hr,{active:T})}),r.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель истории",onClick:R,children:"✕"})]}),l===null?r.jsx("p",{className:"sidepane__empty",children:"Читаем репозиторий…"}):l.available?r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"gitbar",children:r.jsx(es,{className:"gitbar__branch",title:"Ветка — выбрать значит переключиться",value:l.detached?"":l.branch,options:P,onChange:M=>{M&&p(M,`ветку ${M}`)}})}),l.detached&&r.jsx("p",{className:"gitbar__note",children:"HEAD отделён от ветки. Выберите ветку в списке, чтобы вернуться."}),r.jsx("div",{className:"gitbar__actions",children:o?r.jsxs("p",{className:"gitbar__busy",children:[r.jsx(Mj,{}),o]}):l.hasRemote?r.jsxs(r.Fragment,{children:[r.jsxs("button",{type:"button",className:"btn btn--sm",title:"Отправить текущую ветку в origin",onClick:m,children:[r.jsx(Aj,{}),"Отправить",l.ahead>0&&r.jsx("span",{className:"gitbar__count",children:l.ahead})]}),r.jsxs("div",{className:"gitbar__group",children:[r.jsxs("button",{type:"button",className:"btn btn--sm",title:"Забрать с origin и перемотать вперёд (git pull --ff-only)",onClick:()=>x(!0),children:[r.jsx(Cj,{}),"Забрать",l.behind>0&&r.jsx("span",{className:"gitbar__count",children:l.behind})]}),r.jsx("button",{type:"button",className:"btn btn--sm btn--ghost gitbar__check",title:"Только проверить — git fetch, рабочее дерево не меняется","aria-label":"Проверить, что нового на origin, без изменений на диске",onClick:()=>x(!1),children:r.jsx(Rj,{})})]})]}):r.jsxs(r.Fragment,{children:[r.jsxs("button",{type:"button",className:"btn btn--sm btn--primary",title:"Создать репозиторий на GitHub и отправить в него ветку",onClick:y,children:[r.jsx(dx,{}),"Опубликовать на GitHub"]}),r.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",title:"Прописать origin на уже существующий репозиторий",onClick:j,children:"уже есть репозиторий"})]})}),r.jsxs("div",{className:"sidepane__scroll",children:[r.jsx("button",{className:"gitrow gitrow--work"+(c===""?" is-on":""),onClick:()=>h(""),children:r.jsxs("span",{className:"gitrow__body",children:[r.jsx("span",{className:"gitrow__subject",children:l.changed.length>0?`Рабочее дерево · ${l.changed.length} ${zj(l.changed.length)}`:"Рабочее дерево чистое"}),r.jsx("span",{className:"gitrow__meta",children:l.changed.length>0?l.changed.slice(0,4).map(M=>Dj(M.path)).join(", "):"незакоммиченных изменений нет"})]})}),B.rows.map(M=>r.jsx(kj,{row:M,columns:B.columns,head:M.commit.hash===l.head,local:l.hasRemote&&!M.commit.pushed,active:c===M.commit.hash,onOpen:()=>h(M.commit.hash)},M.commit.hash)),B.rows.length===0&&r.jsx("p",{className:"sidepane__empty",children:"В репозитории ещё нет коммитов"})]})]}):r.jsxs("div",{className:"gitempty",children:[r.jsx("p",{className:"gitempty__text",children:l.message||"Это не git-репозиторий"}),l.noRepo&&r.jsxs(r.Fragment,{children:[r.jsxs("button",{type:"button",className:"btn btn--sm btn--primary gitempty__btn",onClick:y,children:[r.jsx(dx,{}),"Опубликовать на GitHub"]}),r.jsx("p",{className:"gitempty__hint",children:"Заведёт репозиторий, сделает первый коммит и отправит его на GitHub."})]})]}),r.jsx(Ui,{result:i,onDismiss:v})]})}const Bc=50,fx=13;function kj({row:a,columns:l,head:i,local:c,active:o,onOpen:d}){const{commit:h}=a,p=h.refs.map(Oj).filter(Boolean);return r.jsxs("button",{className:"gitrow"+(o?" is-on":""),title:c?"Коммит ещё не отправлен на удалённый репозиторий":void 0,onClick:d,children:[r.jsx(Nj,{row:a,columns:l,head:i,local:c}),r.jsxs("span",{className:"gitrow__body",children:[r.jsxs("span",{className:"gitrow__subject",children:[p.map(m=>r.jsx("span",{className:"gitrow__ref",children:m},m)),h.subject]}),r.jsxs("span",{className:"gitrow__meta",children:[h.shortHash," · ",h.author," · ",Lj(h.date),c&&r.jsx("span",{className:"gitrow__local",children:"· не отправлен"})]})]})]})}function Nj({row:a,columns:l,head:i,local:c}){const o=l*fx+6,d=Bc/2,h=x=>8+Math.min(x,Wh-1)*fx,p=c?"3.5 2.5":void 0,m=Ao(a.col);return r.jsxs("svg",{className:"gitgraph",width:o,height:Bc,viewBox:`0 0 ${o} ${Bc}`,"aria-hidden":"true",children:[a.through.map(x=>r.jsx("line",{x1:h(x),y1:0,x2:h(x),y2:Bc,style:{stroke:Ao(x)}},`t${x}`)),a.up.map((x,y)=>r.jsx("path",{d:`M${h(x.from)} 0 L${h(x.from)} ${d-12} L${h(x.to)} ${d}`,fill:"none",style:{stroke:Ao(x.from),strokeDasharray:p}},`u${y}`)),a.down.map((x,y)=>r.jsx("path",{d:`M${h(x.from)} ${d} L${h(x.to)} ${d+12} L${h(x.to)} ${Bc}`,fill:"none",style:{stroke:Ao(x.to),strokeDasharray:p}},`d${y}`)),i&&r.jsx("circle",{className:"gitgraph__head",cx:h(a.col),cy:d,r:a.commit.parents.length>1?7.4:6.6}),r.jsx("circle",{className:"gitgraph__dot",cx:h(a.col),cy:d,r:a.commit.parents.length>1?4.6:3.6,style:{stroke:m,fill:c?void 0:m}})]})}function Ao(a){return`var(--lane-${a%Wh})`}function wj({detail:a,local:l,onCheckout:i,onClose:c}){const o=a.hash==="";return r.jsxs(Nl,{className:"modal--wide",title:o?"Незакоммиченные изменения":`Коммит ${a.shortHash}`,onClose:c,actions:r.jsxs(r.Fragment,{children:[!o&&r.jsx("button",{className:"btn",onClick:()=>i(a.hash,`коммит ${a.shortHash} (HEAD отделится от ветки)`),children:"Переключиться сюда"}),r.jsx("button",{className:"btn btn--primary",onClick:c,children:"Закрыть"})]}),children:[!o&&r.jsxs("div",{className:"commit__head",children:[r.jsx("p",{className:"commit__subject",children:a.subject}),r.jsxs("p",{className:"commit__meta",children:[a.author,a.email&&` <${a.email}>`," · ",Uj(a.date)," ·"," ",r.jsx("span",{className:"commit__hash",children:a.hash})]}),l&&r.jsx("p",{className:"commit__meta commit__meta--local",children:"Не отправлен: этого коммита нет ни в одной удалённой ветке."}),a.parents.length>0&&r.jsxs("p",{className:"commit__meta",children:[a.parents.length>1?"слияние: ":"родитель: ",a.parents.map(d=>d.slice(0,8)).join(", ")]}),a.body&&r.jsx("pre",{className:"commit__body",children:a.body})]}),a.truncated&&r.jsx("p",{className:"modal__text",children:"Изменения слишком велики — часть патча не показана."}),a.files.length===0?r.jsx("p",{className:"modal__text",children:"Изменений нет."}):a.files.map(d=>r.jsx(Tj,{file:d,defaultOpen:a.files.length<=3},d.path+d.oldPath))]})}function Tj({file:a,defaultOpen:l}){const[i,c]=_.useState(l);return r.jsxs("div",{className:"commit__file",children:[r.jsxs("button",{className:"commit__filehead",onClick:()=>c(o=>!o),children:[r.jsx("span",{className:"commit__filepath",children:a.path||a.oldPath}),r.jsxs("span",{className:"diff__stat",children:[a.added>0&&r.jsxs("span",{className:"diff__stat--add",children:["+",a.added]}),a.removed>0&&r.jsxs("span",{className:"diff__stat--del",children:["−",a.removed]})]}),r.jsx("span",{className:"tool__status",children:i?"▴":"▾"})]}),i&&r.jsx(Jh,{diff:_j(a)})]})}function Ej(){return r.jsxs("svg",{className:"sidepane__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[r.jsx("circle",{cx:"4.5",cy:"3.5",r:"1.9"}),r.jsx("circle",{cx:"4.5",cy:"12.5",r:"1.9"}),r.jsx("circle",{cx:"11.5",cy:"8",r:"1.9"}),r.jsx("path",{d:"M4.5 5.4v5.2M6.4 3.9h2.2a1.6 1.6 0 0 1 1.6 1.6v.8"})]})}function Aj(){return r.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:r.jsx("path",{d:"M8 13V3M4.5 6.5 8 3l3.5 3.5"})})}function Cj(){return r.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:r.jsx("path",{d:"M8 3v10M4.5 9.5 8 13l3.5-3.5"})})}function Rj(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("circle",{cx:"7",cy:"7",r:"4"}),r.jsx("path",{d:"m13 13-2.6-2.6"})]})}function dx(){return r.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:r.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 Mj(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[r.jsx("path",{d:"M14 8a6 6 0 1 1-6-6c1.68 0 3.29.67 4.49 1.83L14 5.33"}),r.jsx("path",{d:"M14 2v3.33h-3.33"})]})}function Oj(a){return a.replace(/^HEAD -> /,"").replace(/^tag: /,"⌂ ").trim()}function Dj(a){const l=a.split("/");return l[l.length-1]??a}function zj(a){const l=a%100;if(l>=11&&l<=14)return"файлов";switch(a%10){case 1:return"файл";case 2:case 3:case 4:return"файла";default:return"файлов"}}function Lj(a){const l=Date.parse(a);if(Number.isNaN(l))return a;const i=Math.round((Date.now()-l)/6e4);if(i<1)return"только что";if(i<60)return`${i} мин назад`;const c=Math.round(i/60);if(c<24)return`${c} ч назад`;const o=Math.round(c/24);return o<30?`${o} дн назад`:new Date(l).toLocaleDateString()}function Uj(a){const l=Date.parse(a);return Number.isNaN(l)?a:new Date(l).toLocaleString()}function hx(a){return a.replace(/[^A-Za-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")}function Hj({status:a,owners:l,files:i,defaultName:c,hasCommits:o,busy:d,result:h,onRefreshStatus:p,onSaveToken:m,onPublish:x,onDismissResult:y,onClose:j}){var se;const[v,R]=_.useState(()=>hx(c)),[T,L]=_.useState(""),[B,P]=_.useState(""),[M,Z]=_.useState(!0),[N,K]=_.useState("Первый коммит"),[z,A]=_.useState(null),[V,te]=_.useState("");_.useEffect(()=>{!T&&l.length>0&&L(l[0].login)},[T,l]),_.useEffect(()=>{i&&z===null&&A(new Set(i.files))},[i,z]);const oe=(a==null?void 0:a.connected)===!0,F=l.map(pe=>({value:pe.login,label:pe.login,hint:pe.kind==="org"?"организация":void 0})),ae=_.useMemo(()=>{if(!i)return[];const pe=V.trim().toLowerCase();return pe?i.files.filter(ke=>ke.toLowerCase().includes(pe)):i.files},[i,V]),me=(z==null?void 0:z.size)??0,Te=oe&&v.trim()!==""&&T!==""&&d===""&&(o||me>0);function be(pe){A(ke=>{const k=new Set(ke??[]);return k.has(pe)?k.delete(pe):k.add(pe),k})}function U(pe){A(ke=>{const k=new Set(ke??[]);for(const $ of ae)pe?k.add($):k.delete($);return k})}function re(){if(!Te)return;const pe=(i==null?void 0:i.files)??[];x({owner:T,name:v.trim(),description:B.trim(),private:M,include:o?[]:pe.filter(ke=>z==null?void 0:z.has(ke)),ignore:o?[]:pe.filter(ke=>!(z!=null&&z.has(ke))),message:o?"":N.trim()||"Первый коммит"})}return r.jsxs(Nl,{className:"modal--wide",title:"Опубликовать на GitHub",onClose:j,actions:r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",className:"btn",onClick:j,children:"Отмена"}),r.jsx("button",{type:"button",className:"btn btn--primary",disabled:!Te,onClick:re,children:d||"Опубликовать"})]}),children:[r.jsx(Bj,{status:a,onRefreshStatus:p,onSaveToken:m}),r.jsxs("div",{className:"publish__section",children:[r.jsx("h3",{className:"publish__heading",children:"Репозиторий"}),r.jsxs("label",{className:"field publish__field",children:[r.jsx("span",{children:"Имя"}),r.jsx("input",{className:"input input--mono",value:v,spellCheck:!1,autoComplete:"off",onChange:pe=>R(hx(pe.target.value))})]}),v.trim()===""&&r.jsx("p",{className:"modal__error",children:"Имя репозитория не может быть пустым."}),r.jsxs("label",{className:"field publish__field",children:[r.jsx("span",{children:"Владелец"}),l.length>1?r.jsx(es,{className:"settings__select",value:T,options:F,onChange:L,placeholder:"выберите владельца",ariaLabel:"Владелец репозитория"}):r.jsx("p",{className:"publish__static",children:((se=l[0])==null?void 0:se.login)??"—"})]}),r.jsxs("label",{className:"field publish__field",children:[r.jsx("span",{children:"Описание (необязательно)"}),r.jsx("input",{className:"input",value:B,placeholder:"о чём проект — одной строкой",onChange:pe=>P(pe.target.value)})]}),r.jsxs("div",{className:"field publish__field",children:[r.jsx("span",{children:"Видимость"}),r.jsxs("div",{className:"access",role:"radiogroup","aria-label":"Видимость репозитория",children:[r.jsx(px,{title:"Приватный",desc:"Виден только вам и тем, кого вы пригласите. Стоит по умолчанию: репозиторий с чужим кодом, случайно ставший публичным, потом не отозвать.",on:M,onClick:()=>Z(!0)}),r.jsx(px,{title:"Публичный",desc:"Виден всем в интернете — код, история коммитов, всё содержимое.",risky:!0,on:!M,onClick:()=>Z(!1)})]})]})]}),!o&&r.jsxs("div",{className:"publish__section",children:[r.jsx("h3",{className:"publish__heading",children:"Файлы первого коммита"}),i===null?r.jsx("p",{className:"modal__text",children:"Читаем файлы…"}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"publish__filehead",children:[r.jsxs("span",{className:"publish__filecount",children:[me," из ",i.files.length," файлов"]}),r.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>U(!0),children:"Отметить все"}),r.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>U(!1),children:"Снять все"})]}),i.files.length>8&&r.jsx("input",{className:"input publish__filter",value:V,placeholder:"Фильтр по пути…",spellCheck:!1,onChange:pe=>te(pe.target.value)}),r.jsx("div",{className:"publish__filelist",children:ae.length===0?r.jsx("p",{className:"modal__text publish__filesempty",children:"Ничего не найдено по фильтру."}):ae.map(pe=>r.jsxs("button",{type:"button",role:"checkbox","aria-checked":(z==null?void 0:z.has(pe))===!0,className:"publish__file",onClick:()=>be(pe),children:[r.jsx("span",{className:"publish__box"+(z!=null&&z.has(pe)?" is-on":""),"aria-hidden":"true",children:(z==null?void 0:z.has(pe))&&"✓"}),r.jsx("span",{className:"publish__filepath",children:pe})]},pe))}),i.truncated&&r.jsx("p",{className:"publish__truncated",children:"Каталог больше, чем показано здесь, — часть файлов в список не попала. Их всё равно можно закоммитить потом обычным образом."}),r.jsxs("label",{className:"field publish__field",children:[r.jsx("span",{children:"Сообщение коммита"}),r.jsx("input",{className:"input",value:N,onChange:pe=>K(pe.target.value)})]})]})]}),r.jsx(Ui,{result:h,onDismiss:y})]})}function px({title:a,desc:l,on:i,risky:c,onClick:o}){return r.jsxs("button",{type:"button",role:"radio","aria-checked":i,className:"access__card"+(i?" is-on":"")+(c?" access__card--risky":""),onClick:o,children:[r.jsx("span",{className:"access__radio","aria-hidden":"true"}),r.jsxs("span",{className:"access__body",children:[r.jsxs("span",{className:"access__title",children:[a,c&&r.jsx("span",{className:"access__risk",children:"видно всем"})]}),r.jsx("span",{className:"access__desc",children:l})]})]})}function Bj({status:a,onRefreshStatus:l,onSaveToken:i}){const[c,o]=_.useState(""),[d,h]=_.useState(!1);return r.jsxs("div",{className:"publish__section publish__section--first",children:[r.jsx("h3",{className:"publish__heading",children:"Учётная запись GitHub"}),a===null?r.jsx("p",{className:"modal__text",children:"Проверяем подключение…"}):a.connected?r.jsxs("div",{className:"publish__account",children:[r.jsx("span",{className:"chip chip--ok",children:a.login}),r.jsx("span",{className:"publish__accountvia",children:a.source==="gh"?"через GitHub CLI":"по личному токену"}),a.source==="token"&&r.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:()=>i(""),children:"Отключить токен"})]}):r.jsxs("div",{className:"publish__connect",children:[a.ghInstalled&&r.jsxs("p",{className:"modal__text",children:["В системе установлен ",r.jsx("code",{children:"gh"}),", но вход в нём не выполнен. Можно вместо токена выполнить ",r.jsx("code",{children:"gh auth login"})," в панели терминала и нажать «Проверить снова» — либо ввести личный токен ниже."]}),r.jsxs("label",{className:"field publish__field",children:[r.jsx("span",{children:"Личный токен GitHub"}),r.jsx(qj,{value:c,onChange:o,visible:d,onToggleVisible:()=>h(p=>!p),placeholder:"ghp_…"})]}),r.jsxs("p",{className:"publish__tokenhint",children:["Нужен токен с доступом ",r.jsx("code",{children:"repo"})," — им приложение создаст репозиторий и отправит в него код."," ",r.jsx("a",{href:"https://github.com/settings/tokens/new?scopes=repo&description=Claude%20Code%20Visual",target:"_blank",rel:"noreferrer",children:"Создать токен на GitHub ↗"})]}),a.message&&r.jsx("p",{className:"modal__error",children:a.message}),r.jsxs("div",{className:"extbar",children:[r.jsx("button",{type:"button",className:"btn btn--sm btn--ghost",onClick:l,children:"Проверить снова"}),r.jsx("button",{type:"button",className:"btn btn--sm btn--primary",disabled:c.trim()==="",onClick:()=>i(c.trim()),children:"Сохранить токен"})]})]})]})}function qj({value:a,onChange:l,visible:i,onToggleVisible:c,placeholder:o,autoFocus:d}){return r.jsxs("div",{className:"pwfield",children:[r.jsx("input",{className:"input input--mono pwfield__input",type:i?"text":"password",value:a,placeholder:o,spellCheck:!1,autoComplete:"off",autoFocus:d,onChange:h=>l(h.target.value)}),r.jsx("button",{type:"button",className:"pwfield__toggle","aria-label":i?"Скрыть токен":"Показать токен","aria-pressed":i,onClick:c,children:i?r.jsx(Gj,{}):r.jsx(Ij,{})})]})}function Ij(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("path",{d:"M1 8s2.5-5 7-5 7 5 7 5-2.5 5-7 5-7-5-7-5Z"}),r.jsx("circle",{cx:"8",cy:"8",r:"2.1"})]})}function Gj(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("path",{d:"M1 8s2.5-5 7-5 7 5 7 5-2.5 5-7 5-7-5-7-5Z"}),r.jsx("circle",{cx:"8",cy:"8",r:"2.1"}),r.jsx("path",{d:"M2 14 14 2"})]})}function Yj({busy:a,result:l,onSubmit:i,onDismissResult:c,onClose:o}){const[d,h]=_.useState(""),p=/^(https?|ssh|git):\/\/\S+/i.test(d.trim())||/^[\w.-]+@[\w.-]+:.+/.test(d.trim());return r.jsxs(Nl,{title:"Подключить существующий репозиторий",onClose:o,actions:r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",className:"btn",onClick:o,children:"Отмена"}),r.jsx("button",{type:"button",className:"btn btn--primary",disabled:!p||a!=="",onClick:()=>i(d.trim()),children:a||"Подключить"})]}),children:[r.jsxs("p",{className:"modal__text",children:["Пропишет этот адрес как ",r.jsx("code",{children:"origin"})," текущего репозитория. Ничего не отправляется само — после этого в панели появятся обычные «Отправить» и «Забрать»."]}),r.jsxs("label",{className:"field",children:[r.jsx("span",{children:"Адрес репозитория"}),r.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&&a===""&&i(d.trim())}})]}),r.jsxs("p",{className:"modal__text modal__text--dim",children:["Подходят адреса вида ",r.jsx("code",{children:"https://…"}),", ",r.jsx("code",{children:"ssh://…"}),", ",r.jsx("code",{children:"git://…"})," и"," ",r.jsx("code",{children:"git@host:path"}),"."]}),r.jsx(Ui,{result:l,onDismiss:c})]})}function Xj({open:a,items:l,busy:i,ready:c,commands:o,contextResult:d,draftKey:h,models:p,model:m,effort:x,ultracode:y,thinking:j,switchOnFlag:v,onContextSearch:R,onCommand:T,onModel:L,onEffort:B,onUltracode:P,onThinking:M,onSwitchOnFlag:Z,onAsk:N,onInterrupt:K,onReset:z,onClose:A,zoomed:V,onToggleZoom:te}){return r.jsxs("aside",{className:(a?"sidepane sidepane--ask sidepane--open":"sidepane sidepane--ask")+(V?" sidepane--zoomed":""),"aria-label":"Вопрос на полях",children:[r.jsxs("div",{className:"sidepane__head",onDoubleClick:oe=>{te&&(oe.target.closest("button")||te())},children:[r.jsx(Vj,{}),r.jsx("span",{className:"sidepane__title",children:"Вопрос на полях"}),r.jsx("button",{className:"sidepane__btn",title:"Начать заново — следующий вопрос возьмёт свежий контекст","aria-label":"Начать боковой разговор заново",disabled:l.length===0,onClick:z,children:"↻"}),te&&r.jsx("button",{className:"sidepane__btn",title:V?"Свернуть панель — то же самое, что двойной клик по шапке":"Развернуть панель на весь экран — то же самое, что двойной клик по шапке","aria-label":V?"Свернуть панель вопроса":"Развернуть панель вопроса на весь экран","aria-pressed":V,onClick:te,children:r.jsx(Hr,{active:V})}),r.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель вопроса",onClick:A,children:"✕"})]}),p.length>0&&r.jsxs("div",{className:"sidepane__tools",children:[r.jsx(my,{className:"select--compact",models:p,value:m,effort:x,ultracode:y,thinking:j,switchOnFlag:v,onModel:L,onEffort:B,onUltracode:P,onThinking:M,onSwitchOnFlag:Z}),r.jsx("span",{className:"sidepane__note",title:"Боковой вопрос работает только на чтение",children:"только чтение"})]}),r.jsx(Fh,{items:l,busy:i,waiting:!1,empty:c?"Спросите о том, что происходит: вопрос уйдёт в сторону от основного разговора и не попадёт в его контекст. Отвечающий видит сессию и проект, но ничего не меняет.":"Откройте сессию — вопрос задаётся о ней."}),r.jsx(dy,{className:"composer--side",disabled:!c,busy:i,commands:o,sessionTitle:null,contextResult:d,draftKey:h?`side:${h}`:null,placeholder:"Спросить, не мешая работе…",sendLabel:"Спросить",autoFocus:a,attachmentsEnabled:!1,onContextSearch:R,onCommand:T,onSend:N,onInterrupt:K,onEscape:i?K:A})]})}function Vj(){return r.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:[r.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"}),r.jsx("path",{d:"M8.4 8.5v-.3c0-.7.9-.9.9-1.7a1 1 0 0 0-1.9-.4"})]})}const $j=75,Qj=90;function by({usage:a}){if(!(a!=null&&a.available))return null;const l=[];return a.fiveHour&&l.push({key:"five",label:"5 ч",window:a.fiveHour}),a.sevenDay&&l.push({key:"week",label:"нед",window:a.sevenDay}),l.length===0?null:r.jsx("div",{className:"usage",title:Jj(a),"aria-label":`Расход лимитов плана${a.plan?` ${a.plan}`:""}`,children:l.map(i=>r.jsx(Zj,{label:i.label,window:i.window},i.key))})}function Zj({label:a,window:l}){const i=Math.round(l.utilization),c=Fj(l.resetsAt);return r.jsxs(r.Fragment,{children:[r.jsx("span",{className:"usage__label",children:a}),r.jsx("span",{className:"usage__track",role:"progressbar","aria-label":a,"aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,children:r.jsx("span",{className:`usage__fill${Kj(i)}`,style:{width:`${i}%`}})}),r.jsxs("span",{className:"usage__pct",children:[i,"%"]}),r.jsx("span",{className:"usage__reset",title:_y(l.resetsAt)||void 0,children:c&&`↻ ${c}`})]})}function Kj(a){return a>=Qj?" usage__fill--over":a>=$j?" usage__fill--warn":""}function Jj(a){const l=[a.plan?`Лимиты плана ${a.plan}`:"Лимиты плана"],i=(c,o)=>{if(!o)return;const d=_y(o.resetsAt);l.push(`${c}: ${Math.round(o.utilization)}%${d?`, ${d}`:""}`)};return i("5 часов",a.fiveHour),i("Неделя",a.sevenDay),i("Неделя, Opus",a.sevenDayOpus),l.join(`
119
- `)}function xy(a){if(!a)return null;const l=new Date(a);return Number.isNaN(l.getTime())?null:l}function yy(a){return a.getTime()-Date.now()<1440*60*1e3}function Fj(a){const l=xy(a);return l?yy(l)?l.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):l.toLocaleDateString(void 0,{day:"numeric",month:"short"}):""}function _y(a){const l=xy(a);return l?`обнулится ${yy(l)?`в ${l.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:l.toLocaleDateString(void 0,{day:"numeric",month:"long"})}`:""}function vy(){const[a,l]=_.useState(()=>new Date);return _.useEffect(()=>{let i=0;const c=()=>{const d=new Date;l(d),i=window.setTimeout(c,6e4-(d.getSeconds()*1e3+d.getMilliseconds()))};c();const o=()=>{document.hidden||(window.clearTimeout(i),c())};return document.addEventListener("visibilitychange",o),()=>{window.clearTimeout(i),document.removeEventListener("visibilitychange",o)}},[]),r.jsxs("time",{className:"clock",dateTime:a.toISOString(),title:Wj(a),children:[r.jsx("span",{className:"clock__time",children:a.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}),r.jsx("span",{className:"clock__date",children:a.toLocaleDateString(void 0,{weekday:"short",day:"numeric",month:"short"})})]})}function Wj(a){return a.toLocaleDateString(void 0,{weekday:"long",day:"numeric",month:"long",year:"numeric"})}function Pj({onClose:a,permission:l,model:i,usage:c,cwd:o,costLabel:d,onRefresh:h,refreshing:p,metersFetchedAt:m,onRename:x}){return r.jsx(Nl,{title:"Настройки сессии",className:"modal--sheet",sheet:!0,onClose:a,children:r.jsxs("div",{className:"sessionmenu",children:[l&&r.jsx(vr,{label:"Режим прав",children:l}),r.jsx(vr,{label:"Модель",children:i}),(c==null?void 0:c.available)&&(c.fiveHour||c.sevenDay)&&r.jsx(vr,{label:"Лимиты плана",children:r.jsx(by,{usage:c})}),r.jsxs("button",{type:"button",className:p?"sessionmenu__refresh is-busy":"sessionmenu__refresh","aria-busy":p,disabled:p,onClick:h,children:[r.jsx(ek,{}),r.jsxs("span",{className:"sessionmenu__refresh-text",children:["Обновить показания",m&&r.jsxs("span",{className:"sessionmenu__refresh-time",children:["обновлено в"," ",new Date(m).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})]})]})]}),r.jsx(vr,{label:"Время",children:r.jsx(vy,{})}),d&&r.jsx(vr,{label:"Стоимость хода",children:r.jsx("span",{className:"badge badge--cost",children:d})}),o&&r.jsx(vr,{label:"Каталог проекта",children:r.jsx(py,{path:o})}),x&&r.jsx("button",{type:"button",className:"sessionmenu__rename",onClick:x,children:"Переименовать сессию"})]})})}function vr({label:a,children:l}){return r.jsxs("div",{className:"sessionmenu__row",children:[r.jsx("span",{className:"sessionmenu__label",children:a}),l]})}function ek(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("path",{d:"M14 8a6 6 0 1 1-6-6c1.68 0 3.29.67 4.49 1.83L14 5.33"}),r.jsx("path",{d:"M14 2v3.33h-3.33"})]})}function tk({tab:a,servers:l,plugins:i,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:i.length},{id:"catalog",label:"Каталог",count:o.length}];return r.jsxs(Nl,{title:"Расширения",className:"modal--wide",onClose:m,children:[r.jsx("div",{className:"tabs",role:"tablist",children:x.map(y=>r.jsxs("button",{role:"tab","aria-selected":a===y.id,className:a===y.id?"tabs__tab is-on":"tabs__tab",onClick:()=>p(y.id),children:[y.label,r.jsx("span",{className:"tabs__count",children:y.count})]},y.id))}),a==="mcp"&&r.jsx(nk,{servers:l,actions:h}),a==="plugins"&&r.jsx(rk,{plugins:i,marketplaces:c,actions:h}),a==="catalog"&&r.jsx(ck,{catalog:o,hasMarketplaces:c.length>0,actions:h,onMarketplaces:()=>p("plugins")}),r.jsx(Ui,{result:d})]})}function nk({servers:a,actions:l}){const[i,c]=_.useState(!1);return r.jsxs(r.Fragment,{children:[a.length===0&&!i&&r.jsxs("p",{className:"modal__text",children:["Ни одного MCP-сервера. Добавленный здесь попадёт в ",r.jsx("code",{children:".mcp.json"})," ","проекта — его увидит и консольный ",r.jsx("code",{children:"claude mcp list"}),"."]}),r.jsx("ul",{className:"extlist",children:a.map(o=>r.jsxs("li",{className:"extlist__row",children:[r.jsxs("div",{className:"extlist__head",children:[r.jsx("span",{className:"extlist__name",children:o.name}),r.jsx("span",{className:`chip chip--${ak(o.status)}`,children:lk[o.status]}),o.scope&&r.jsx("span",{className:"chip",children:o.scope}),o.transport&&r.jsx("span",{className:"chip",children:o.transport})]}),o.target&&r.jsx("div",{className:"extlist__meta",title:o.target,children:o.target}),o.error&&r.jsx("div",{className:"extlist__error",children:o.error}),o.tools.length>0&&r.jsxs("div",{className:"extlist__meta",children:["Инструментов: ",o.tools.length," · ",o.tools.slice(0,6).join(", "),o.tools.length>6&&"…"]}),r.jsxs("div",{className:"extlist__actions",children:[r.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>l.mcpAction(o.name,"reconnect"),children:"Переподключить"}),o.status==="disabled"?r.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>l.mcpAction(o.name,"enable"),children:"Включить"}):r.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>l.mcpAction(o.name,"disable"),children:"Выключить"}),o.editable&&r.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>l.mcpRemove(o.name),children:"Удалить"})]})]},o.name))}),i?r.jsx(sk,{onCancel:()=>c(!1),onSubmit:(o,d)=>{l.mcpAdd(o,d),c(!1)}}):r.jsx("div",{className:"extbar",children:r.jsx("button",{className:"btn btn--primary",onClick:()=>c(!0),children:"+ Сервер"})})]})}const lk={connected:"подключён",failed:"ошибка","needs-auth":"нужна авторизация",pending:"подключается",disabled:"выключен",unknown:"неизвестно"};function ak(a){return a==="connected"?"ok":a==="failed"?"bad":a==="needs-auth"?"warn":"mute"}function sk({onSubmit:a,onCancel:l}){const[i,c]=_.useState(""),[o,d]=_.useState("stdio"),[h,p]=_.useState(""),[m,x]=_.useState(""),[y,j]=_.useState(""),v=o==="stdio",R=i.trim()!==""&&(v?h.trim()!=="":m.trim()!=="");function T(){if(R)if(v){const[L,...B]=ik(h);a(i.trim(),{transport:"stdio",command:L??"",args:B,env:mx(y)})}else a(i.trim(),{transport:o,url:m.trim(),headers:mx(y)})}return r.jsxs("div",{className:"extform extform--card",children:[r.jsx("label",{className:"field",htmlFor:"mcp-name",children:"Имя сервера"}),r.jsx("input",{id:"mcp-name",className:"input input--mono",value:i,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"context7",onChange:L=>c(L.target.value)}),r.jsx("label",{className:"field",children:"Транспорт"}),r.jsx(es,{title:"Транспорт",value:o,options:[{value:"stdio",label:"stdio",hint:"локальный процесс"},{value:"http",label:"http",hint:"удалённый сервер"},{value:"sse",label:"sse",hint:"удалённый, поток событий"}],onChange:L=>d(L)}),v?r.jsxs(r.Fragment,{children:[r.jsx("label",{className:"field",htmlFor:"mcp-command",children:"Команда с аргументами"}),r.jsx("input",{id:"mcp-command",className:"input input--mono",value:h,spellCheck:!1,autoComplete:"off",placeholder:"npx -y @upstash/context7-mcp",onChange:L=>p(L.target.value)})]}):r.jsxs(r.Fragment,{children:[r.jsx("label",{className:"field",htmlFor:"mcp-url",children:"URL"}),r.jsx("input",{id:"mcp-url",className:"input input--mono",value:m,spellCheck:!1,autoComplete:"off",placeholder:"https://mcp.example.dev/mcp",onChange:L=>x(L.target.value)})]}),r.jsxs("label",{className:"field",htmlFor:"mcp-pairs",children:[v?"Переменные окружения":"Заголовки"," — по одной на строку, необязательно"]}),r.jsx("textarea",{id:"mcp-pairs",className:"input input--mono input--area",value:y,spellCheck:!1,placeholder:v?"API_KEY=xxx":"Authorization: Bearer xxx",onChange:L=>j(L.target.value)}),r.jsxs("div",{className:"extbar",children:[r.jsx("button",{className:"btn",onClick:l,children:"Отмена"}),r.jsx("button",{className:"btn btn--primary",disabled:!R,onClick:T,children:"Подключить"})]})]})}function mx(a){const l={};for(const i of a.split(`
120
- `)){const c=i.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 ik(a){return(a.trim().match(/"[^"]*"|'[^']*'|\S+/g)??[]).map(l=>l.replace(/^["']|["']$/g,""))}function rk({plugins:a,marketplaces:l,actions:i}){const[c,o]=_.useState("");return r.jsxs(r.Fragment,{children:[a.length===0&&r.jsx("p",{className:"modal__text",children:"Ни одного установленного плагина. Что можно поставить — на вкладке «Каталог»."}),r.jsx("ul",{className:"extlist",children:a.map(d=>r.jsxs("li",{className:"extlist__row",children:[r.jsxs("div",{className:"extlist__head",children:[r.jsx("span",{className:"extlist__name",children:d.name}),r.jsx("span",{className:d.enabled?"chip chip--ok":"chip chip--mute",children:d.enabled?"включён":"выключен"}),d.version&&d.version!=="unknown"&&r.jsx("span",{className:"chip",children:d.version}),d.scope&&r.jsx("span",{className:"chip",children:d.scope})]}),d.marketplace&&r.jsx("div",{className:"extlist__meta",children:d.marketplace}),d.mcpServers.length>0&&r.jsxs("div",{className:"extlist__meta",children:["MCP-серверы: ",d.mcpServers.join(", ")]}),r.jsxs("div",{className:"extlist__actions",children:[r.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>i.pluginToggle(d.id,!d.enabled),children:d.enabled?"Выключить":"Включить"}),r.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>i.pluginUninstall(d.id),children:"Удалить"})]})]},d.id))}),r.jsx("div",{className:"sidebar__section",children:"Маркетплейсы"}),r.jsx("ul",{className:"extlist",children:l.map(d=>r.jsxs("li",{className:"extlist__row",children:[r.jsx("div",{className:"extlist__head",children:r.jsx("span",{className:"extlist__name",children:d.name})}),d.source&&r.jsx("div",{className:"extlist__meta",children:d.source}),r.jsx("div",{className:"extlist__actions",children:r.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>i.marketplaceRemove(d.name),children:"Отключить"})})]},d.name))}),r.jsxs("div",{className:"extform__row",children:[r.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(),i.marketplaceAdd(c.trim()),o(""))}}),r.jsx("button",{className:"btn",disabled:c.trim()==="",onClick:()=>{i.marketplaceAdd(c.trim()),o("")},children:"Добавить"})]})]})}const qc=30;function ck({catalog:a,hasMarketplaces:l,actions:i,onMarketplaces:c}){const[o,d]=_.useState(""),[h,p]=_.useState(""),[m,x]=_.useState(qc),[y,j]=_.useState(""),v=_.useMemo(()=>[...new Set(a.map(L=>L.category).filter(Boolean))].sort(),[a]),R=_.useMemo(()=>{const T=o.trim().toLowerCase();return a.filter(L=>h&&L.category!==h?!1:T?`${L.name} ${L.displayName} ${L.description} ${L.author}`.toLowerCase().includes(T):!0)},[a,o,h]);return a.length===0?r.jsxs("p",{className:"modal__text",children:[l?"Маркетплейсы подключены, но их каталог ещё не выкачан. Попробуйте открыть окно ещё раз через минуту.":"Ни одного маркетплейса — ставить нечего."," ",r.jsx("button",{className:"linkish",onClick:c,children:"Подключить маркетплейс"})]}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"catalog__filters",children:[r.jsx("input",{className:"input",value:o,spellCheck:!1,autoComplete:"off","aria-label":"Поиск по каталогу",placeholder:"Поиск: имя, описание, автор",onChange:T=>{d(T.target.value),x(qc)}}),r.jsx(es,{title:"Категория",value:h,options:[{value:"",label:"все категории"},...v.map(T=>({value:T,label:T}))],onChange:T=>{p(T),x(qc)}})]}),R.length===0?r.jsx("p",{className:"modal__text",children:"Ничего не нашлось."}):r.jsx("ul",{className:"extlist",children:R.slice(0,m).map(T=>r.jsxs("li",{className:"extlist__row",children:[r.jsxs("div",{className:"extlist__head",children:[r.jsx("span",{className:"extlist__name",children:T.name}),T.installed&&r.jsx("span",{className:"chip chip--ok",children:"установлен"}),T.version&&r.jsx("span",{className:"chip",children:T.version}),T.category&&r.jsx("span",{className:"chip",children:T.category})]}),T.description&&r.jsx("div",{className:"catalog__desc",children:T.description}),r.jsxs("div",{className:"extlist__meta",children:[T.author&&`${T.author} · `,T.marketplace]}),r.jsxs("div",{className:"extlist__actions",children:[r.jsx("button",{className:"btn btn--ghost btn--sm",disabled:T.installed,onClick:()=>i.pluginInstall(T.id),children:T.installed?"Уже стоит":"Установить"}),T.homepage&&r.jsx("a",{className:"btn btn--ghost btn--sm",href:T.homepage,target:"_blank",rel:"noreferrer",children:"Страница"})]})]},T.id))}),R.length>m&&r.jsx("div",{className:"extbar",children:r.jsxs("button",{className:"btn",onClick:()=>x(T=>T+qc),children:["Ещё ",Math.min(qc,R.length-m)," из ",R.length-m]})}),r.jsxs("div",{className:"extform",children:[r.jsx("label",{className:"field",htmlFor:"plugin-spec",children:"Или установить по имени — если нужного в каталоге нет"}),r.jsxs("div",{className:"extform__row",children:[r.jsx("input",{id:"plugin-spec",className:"input input--mono",value:y,spellCheck:!1,autoComplete:"off",placeholder:"имя или имя@маркетплейс",onChange:T=>j(T.target.value),onKeyDown:T=>{T.key!=="Enter"||y.trim()===""||(T.preventDefault(),i.pluginInstall(y.trim()),j(""))}}),r.jsx("button",{className:"btn",disabled:y.trim()==="",onClick:()=>{i.pluginInstall(y.trim()),j("")},children:"Установить"})]})]})]})}function uk({status:a,login:l,actions:i,remote:c,runningSessions:o,onReconnect:d,reconnectBlocked:h,reconnectHint:p,onClose:m}){const[x,y]=_.useState(""),[j,v]=_.useState(!1),[R,T]=_.useState(!1),L=d!==null&&(a==null?void 0:a.loggedIn)===!0&&!R&&!j,B=_.useMemo(()=>{if(l.error)return{ok:!1,message:l.error};const Z=l.output.trim();return Z===""?null:{ok:!0,message:Z}},[l.error,l.output]);function P(Z=x){const N=Z.trim();N!==""&&(i.submitCode(N),y(""))}function M(){if(o>0){v(!1),T(!0);return}i.login("claudeai",!0)}return r.jsxs(Nl,{title:"Аккаунт",onClose:m,children:[a===null?r.jsx("p",{className:"modal__text",children:"Спрашиваем у хоста…"}):a.loggedIn?r.jsxs("div",{className:"account",children:[r.jsx("div",{className:"account__id",children:a.email||"Вход выполнен"}),r.jsxs("div",{className:"account__chips",children:[r.jsx("span",{className:"chip chip--ok",children:dk[a.method]??a.method}),a.plan&&r.jsx("span",{className:"chip",children:a.plan})]}),a.organization&&r.jsx("div",{className:"extlist__meta",children:a.organization})]}):r.jsxs("p",{className:"modal__text",children:["Вход не выполнен. Сессии не запустятся, пока аккаунт не подключён — или пока в окружении хоста нет ",r.jsx("code",{children:"ANTHROPIC_API_KEY"}),"."]}),l.active?r.jsx(hk,{login:l,remote:c,code:x,onCode:y,onSubmit:P,onCancel:i.cancel}):r.jsxs(r.Fragment,{children:[r.jsx(Ui,{result:B}),R&&r.jsx("p",{className:"account__warn",role:"alert",children:ok(o)}),L&&h&&r.jsx("p",{className:"account__note",children:p}),r.jsx("div",{className:`extbar${a!=null&&a.loggedIn?" account__bar":""}`,children:a!=null&&a.loggedIn?r.jsxs(r.Fragment,{children:[L&&r.jsxs("button",{type:"button",className:"btn account__relink",title:`Переподключить сессию
121
- ${p}`,"aria-label":"Переподключить сессию",disabled:h,onClick:d,children:[r.jsx(fk,{}),"Переподключить"]}),R?r.jsxs(r.Fragment,{children:[r.jsx("button",{className:"btn",onClick:()=>T(!1),children:"Отмена"}),r.jsx("button",{className:"btn btn--warn",autoFocus:!0,onClick:()=>{T(!1),i.login("claudeai",!0)},children:"Всё равно сменить"})]}):r.jsx("button",{className:"btn",onClick:M,children:"Сменить аккаунт"}),j?r.jsx("button",{className:"btn btn--danger",autoFocus:!0,onClick:()=>{v(!1),i.logout()},children:"Точно выйти?"}):r.jsx("button",{className:"btn",onClick:()=>{T(!1),v(!0)},children:"Выйти"})]}):r.jsxs(r.Fragment,{children:[r.jsx("button",{className:"btn",onClick:()=>i.login("console",!1),children:"Через Console"}),r.jsx("button",{className:"btn btn--primary",onClick:()=>i.login("claudeai",!1),children:"Войти"})]})})]})]})}function ok(a){const l=a%10,i=a%100,c=l===1&&i!==11,o=c?"сессия":l>=2&&l<=4&&(i<12||i>14)?"сессии":"сессий";return`${a} ${o} сейчас ${c?"работает":"работают"} — смена аккаунта может ${c?"её":"их"} прервать.`}function fk(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("path",{d:"M14 8a6 6 0 1 1-6-6c1.68 0 3.29.67 4.49 1.83L14 5.33"}),r.jsx("path",{d:"M14 2v3.33h-3.33"})]})}const dk={"claude.ai":"подписка Claude",console:"Anthropic Console",apiKey:"API-ключ",none:"нет"};function hk({login:a,remote:l,code:i,onCode:c,onSubmit:o,onCancel:d}){var T;const[h,p]=_.useState(null),m=_.useRef(""),x=_.useRef({code:i,onCode:c,onSubmit:o});x.current={code:i,onCode:c,onSubmit:o};const y=_.useCallback(async L=>{const{code:B,onCode:P,onSubmit:M}=x.current;if(L&&B.trim()!=="")return;const Z=await Rh();if(Z===null){L||p("Не получилось прочитать буфер — вставьте код в поле руками.");return}const N=Z.trim();if(!gx(N)){L||p("В буфере не похоже на код: нужен он целиком, вместе с частью после «#». Подойдёт и адрес страницы, на которую увёл браузер, — его тоже разберём.");return}if(L){if(m.current===N)return;m.current=N}p(null),P(N),M(N)},[]);_.useEffect(()=>{if(!a.awaitingCode)return;const L=()=>{document.visibilityState==="visible"&&y(!0)};return document.addEventListener("visibilitychange",L),()=>document.removeEventListener("visibilitychange",L)},[a.awaitingCode,y]);const j=typeof((T=navigator.clipboard)==null?void 0:T.readText)=="function",v=i.trim()!==""&&!gx(i),R=h??(v?"Похоже, скопирована только часть кода — нужен он целиком, вместе с частью после «#».":null);return r.jsxs("div",{className:"account__flow",children:[a.url?l?r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"field",children:"Подтвердите вход на странице Anthropic"}),r.jsx("a",{className:"btn btn--primary account__go",href:a.url,target:"_blank",rel:"noreferrer",children:"Открыть страницу входа"}),r.jsx("p",{className:"account__step",children:"После кнопки «Authorize» там появится код — скопируйте его и вернитесь сюда."}),r.jsxs("div",{className:"account__raw",children:[r.jsx("span",{className:"account__rawurl",children:a.url}),r.jsx(Kh,{text:a.url,hint:"ссылку входа"})]})]}):r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"field",children:"Подтвердите вход в открывшемся браузере"}),r.jsx("p",{className:"account__step",children:"Хост открыл страницу входа на этом же компьютере — там достаточно нажать «Authorize», остальное произойдёт само."}),r.jsxs("details",{className:"account__fallback",children:[r.jsx("summary",{children:"Браузер не открылся"}),r.jsx("p",{className:"account__step",children:"Тогда откройте ссылку сами: страница покажет код, и его нужно будет вставить ниже."}),r.jsx("a",{className:"account__link",href:a.url,target:"_blank",rel:"noreferrer",children:a.url})]})]}):r.jsx("p",{className:"modal__text",children:"Запускаем вход…"}),a.awaitingCode&&r.jsxs(r.Fragment,{children:[r.jsx("label",{className:"field",htmlFor:"auth-code",children:"Код со страницы авторизации"}),r.jsxs("div",{className:"extform__row account__coderow",children:[r.jsx("input",{id:"auth-code",className:"input input--mono",value:i,autoFocus:!l,spellCheck:!1,autoComplete:"off",placeholder:"код#state",onChange:L=>{p(null),c(L.target.value)},onKeyDown:L=>{L.key==="Enter"&&(L.preventDefault(),o())}}),j&&r.jsx("button",{type:"button",className:"btn",onClick:()=>void y(!1),children:"Вставить код"}),r.jsx("button",{type:"button",className:"btn btn--primary",disabled:i.trim()==="",onClick:()=>o(),children:"Готово"})]}),R&&r.jsx("p",{className:"account__note account__note--code",children:R})]}),a.output.trim()!==""&&r.jsx("pre",{className:"account__log",children:a.output.trim()}),r.jsx("div",{className:"extbar",children:r.jsx("button",{className:"btn",onClick:d,children:"Отменить вход"})})]})}function gx(a){const l=a.trim();if(/^https?:\/\//i.test(l))return/[?#&]code=/.test(l);const[i,c]=l.split("#");return!!i&&!!c&&!/\s/.test(l)}function pk({state:a,onPair:l,onUnpair:i,onClose:c}){const[o,d]=_.useState(""),[h,p]=_.useState(""),[m,x]=_.useState(!1),y=_.useRef(null),j=(a==null?void 0:a.paired)===!0;_.useEffect(()=>{var R;j||(R=y.current)==null||R.focus()},[j]),_.useEffect(()=>{x(!1),j&&d("")},[j,a==null?void 0:a.error]);const v=(a==null?void 0:a.url)??"https://claudevisual.com";return r.jsx(Nl,{title:"Удалённый доступ",onClose:c,children:j?r.jsxs("div",{className:"relay",children:[r.jsxs("p",{className:"relay__lede",children:["Компьютер связан с аккаунтом на ",r.jsx("b",{children:bx(v)}),". Открывайте его оттуда с любого устройства — с телефона в том числе."]}),r.jsxs("dl",{className:"relay__facts",children:[r.jsxs("div",{children:[r.jsx("dt",{children:"Имя"}),r.jsx("dd",{children:(a==null?void 0:a.name)??"—"})]}),r.jsxs("div",{children:[r.jsx("dt",{children:"Связь"}),r.jsxs("dd",{children:[r.jsx("span",{className:a!=null&&a.connected?"dot dot--on":"dot"})," ",a!=null&&a.connected?"на связи":"нет связи, пробуем переподключиться"]})]}),r.jsxs("div",{children:[r.jsx("dt",{children:"Подключено"}),r.jsxs("dd",{children:[(a==null?void 0:a.clients)??0," вкладок"]})]})]}),(a==null?void 0:a.error)&&r.jsx("p",{className:"relay__error",children:a.error}),r.jsx("p",{className:"relay__note",children:"Терминал с удалённых устройств настраивается в настройках приложения, раздел «Терминал»."}),r.jsx("p",{className:"relay__note",children:"Отвязка гасит токен этой машины: чтобы вернуть доступ, понадобится новый код. Сессии Claude Code это не трогает."}),r.jsx("button",{className:"btn btn--danger",onClick:i,children:"Отвязать компьютер"})]}):r.jsxs("div",{className:"relay",children:[r.jsx("p",{className:"relay__lede",children:"Чтобы работать с этим компьютером из браузера и с телефона, свяжите его с аккаунтом."}),r.jsxs("ol",{className:"relay__steps",children:[r.jsxs("li",{children:["Откройте ",r.jsx("b",{children:bx(v)})," и войдите (или зарегистрируйтесь)."]}),r.jsxs("li",{children:["Нажмите ",r.jsx("b",{children:"«Подключить ПК»"})," — появится код из восьми знаков."]}),r.jsx("li",{children:"Введите его сюда."})]}),r.jsxs("form",{className:"relay__form",onSubmit:R=>{R.preventDefault(),o.trim()&&(x(!0),l(o.trim(),h.trim()))},children:[r.jsxs("label",{className:"field",children:[r.jsx("span",{children:"Код сопряжения"}),r.jsx("input",{ref:y,className:"input relay__code",value:o,onChange:R=>d(R.target.value.toUpperCase()),placeholder:"XXXX-XXXX",autoComplete:"off",spellCheck:!1,maxLength:12})]}),r.jsxs("label",{className:"field",children:[r.jsx("span",{children:"Как назвать этот компьютер"}),r.jsx("input",{className:"input",value:h,onChange:R=>p(R.target.value),placeholder:"имя машины",autoComplete:"off",maxLength:64})]}),(a==null?void 0:a.error)&&r.jsx("p",{className:"relay__error",children:a.error}),r.jsx("button",{className:"btn btn--primary",type:"submit",disabled:!o.trim()||m,children:m?"Связываем…":"Связать"})]})]})})}function bx(a){try{return new URL(a).host}catch{return a}}const yh="",mk=[{value:"opus",label:"Opus",hint:"полный список моделей виден, когда открыта сессия"},{value:"sonnet",label:"Sonnet",hint:"полный список моделей виден, когда открыта сессия"},{value:"haiku",label:"Haiku",hint:"полный список моделей виден, когда открыта сессия"}],gk=Mx.map(a=>({value:a.value,label:a.value,hint:a.hint})),Co=3600*1e3,bk=[{value:"6h",label:"6 часов"},{value:"24h",label:"Сутки"},{value:"48h",label:"Двое суток"},{value:"168h",label:"Неделя"},{value:"never",label:"Никогда"}],jr={"6h":6*Co,"24h":24*Co,"48h":48*Co,"168h":168*Co,never:0};function xk(a){return jr[a]??jr["48h"]}function yk(a){const l=Object.entries(jr).find(([,i])=>i===a);return l?l[0]:Object.keys(jr).reduce((i,c)=>Math.abs(jr[c]-a)<Math.abs(jr[i]-a)?c:i)}const _k=[{value:"off",label:"Выключено"},{value:"500",label:"0.5 с"},{value:"1500",label:"1.5 с"},{value:"3000",label:"3 с"},{value:"10000",label:"10 с"}],kr={off:0,500:500,1500:1500,3e3:3e3,1e4:1e4};function vk(a){return kr[a]??kr.off}function Sk(a){const l=Object.entries(kr).find(([,i])=>i===a);return l?l[0]:Object.keys(kr).reduce((i,c)=>Math.abs(kr[c]-a)<Math.abs(kr[i]-a)?c:i)}const jk=[{value:"project",title:"Только текущий проект",description:"Агент молча пишет файлы в открытом проекте и в ~/.claude — настройках самого Claude Code. Чужой проект и любая новая папка — только с явного разрешения."},{value:"projects",title:"Папка с проектами",description:"То же плюс каталог, где лежат открытые проекты, — то есть и соседний проект тоже. Всё остальное — с разрешения."},{value:"all",title:"Все папки на компьютере",description:"Агент пишет файлы куда угодно на диске — вопросов про место записи не будет.",risky:!0}];function kk({settings:a,models:l,relayState:i,local:c,onChange:o,onEnableShell:d,onDisableShell:h,onOpenRelay:p,onClose:m}){const x=a===null,y=!x&&a.terminalEnabled===!0,j=!y,v=_.useMemo(()=>{const T=[{value:yh,label:"Как в Claude Code",hint:"модель определят настройки самого Claude Code"},...l.length>0?l.map(L=>({value:L.value,label:L.displayName,hint:L.description})):mk];return a&&a.startModel!==null&&!T.some(L=>L.value===a.startModel)&&T.push({value:a.startModel,label:a.startModel}),T},[l,a]);function R(){var T,L;return(i==null?void 0:i.paired)!==!0?r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"settings__hint",children:"Компьютер не связан с аккаунтом — включать удалённый доступ пока не к чему: без пары ни телефон, ни другое устройство этот компьютер вообще не видят."}),r.jsx("button",{type:"button",className:"btn",disabled:j,onClick:p,children:"Связать компьютер"})]}):(T=i.shell)!=null&&T.enabled?r.jsxs(r.Fragment,{children:[r.jsxs("p",{className:"settings__hint",children:["Разрешён: с телефона и любого другого устройства этого аккаунта можно открыть терминал и выполнить на этом компьютере что угодно — как если бы сидели за ним.",i.shell.confirmedAt&&` Включено ${new Date(i.shell.confirmedAt).toLocaleString()}.`]}),r.jsx("button",{type:"button",className:"btn btn--danger",disabled:j,onClick:h,children:"Запретить"})]}):(L=i.shell)!=null&&L.pending?r.jsxs(r.Fragment,{children:[r.jsxs("p",{className:"settings__hint",children:["Письмо ушло на ",r.jsx("b",{children:i.shell.email}),". Перейдите по ссылке из него — терминал заработает удалённо."]}),r.jsx("p",{className:"settings__hint",children:"Повторная отправка ограничена раз в минуту — если жали кнопку только что, письмо не придёт и от повторного нажатия тоже. Если сейчас доберётесь до самого компьютера, там разрешение включится сразу, без письма."}),r.jsx("button",{type:"button",className:"btn",disabled:j,onClick:d,children:"Отправить письмо ещё раз"})]}):r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"settings__hint",children:"Сейчас с телефона можно смотреть разговоры и файлы, но не запускать команды. Разрешение даёт полный доступ к терминалу этого компьютера: с телефона станет можно выполнить любую команду, как в обычной консоли за этой машиной."}),c?r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"settings__hint",children:"Включится сразу — вы уже за этим компьютером, подтверждать доступ к нему нечем и незачем."}),r.jsx("button",{type:"button",className:"btn",disabled:j,onClick:d,children:"Разрешить с телефона"})]}):r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"settings__hint",children:"Отсюда мгновенно не включится: на почту аккаунта уйдёт письмо, и терминал заработает только после перехода по ссылке из него."}),r.jsx("button",{type:"button",className:"btn",disabled:j,onClick:d,children:"Прислать письмо"})]})]})}return r.jsx(Nl,{title:"Настройки",onClose:m,children:r.jsxs("div",{className:"settings",children:[r.jsxs("section",{className:"settings__section",children:[r.jsx("h3",{className:"settings__heading",children:"Архивация молчащих сессий"}),r.jsx("p",{className:"settings__hint",children:"Сессия, к которой долго не возвращались, сама уезжает в архив — на диске ничего не удаляется, транскрипт остаётся, и её можно вернуть обратно в любой момент."}),x?r.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):r.jsx(es,{className:"settings__select",value:yk(a.autoArchiveAfterMs),options:bk,onChange:T=>o({autoArchiveAfterMs:xk(T)}),ariaLabel:"Через сколько молчащая сессия уезжает в архив"})]}),r.jsxs("section",{className:"settings__section",children:[r.jsx("h3",{className:"settings__heading",children:"Автосохранение"}),r.jsx("p",{className:"settings__hint",children:"Открытый файл сам уезжает на диск, если немного постоять без ввода — ручное сохранение, кнопкой или Ctrl+S, при этом всегда работает как обычно, независимо от этой настройки."}),x?r.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):r.jsx(es,{className:"settings__select",value:Sk(a.autoSaveAfterPauseMs),options:_k,onChange:T=>o({autoSaveAfterPauseMs:vk(T)}),ariaLabel:"Пауза перед автосохранением открытого файла"})]}),r.jsxs("section",{className:"settings__section",children:[r.jsx("h3",{className:"settings__heading",children:"Старт новой сессии"}),r.jsx("p",{className:"settings__hint",children:"Модель и режим прав, с которыми поднимается новая сессия. Уже открытую это не меняет — у неё свои переключатели в шапке."}),r.jsxs("div",{className:"settings__field",children:[r.jsx("span",{className:"settings__field-label",children:"Модель"}),x?r.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):r.jsx(es,{className:"settings__select",value:a.startModel??yh,options:v,onChange:T=>o({startModel:T===yh?null:T}),ariaLabel:"Модель, с которой поднимается новая сессия"})]}),r.jsxs("div",{className:"settings__field",children:[r.jsx("span",{className:"settings__field-label",children:"Режим прав при старте"}),x?r.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):r.jsx(es,{className:"settings__select",value:a.startPermissionMode,options:gk,onChange:T=>o({startPermissionMode:T}),ariaLabel:"Режим прав, с которым поднимается новая сессия"})]})]}),r.jsxs("section",{className:"settings__section",children:[r.jsx("h3",{className:"settings__heading",children:"Доступ к папкам"}),r.jsx("p",{className:"settings__hint",children:"Это про то, где агент пишет файлы (Write, Edit, NotebookEdit), не спрашивая разрешения, — не про чтение: читает он в любом случае. Ничего не запрещается наглухо — выход за выбранную границу просто превращается в обычный запрос прав, который остаётся подтвердить или отклонить."}),r.jsx("div",{className:"access",role:"radiogroup","aria-label":"Доступ к папкам",children:jk.map(T=>{const L=!x&&a.folderAccess===T.value;return r.jsxs("button",{type:"button",role:"radio","aria-checked":L,disabled:x,className:"access__card"+(L?" is-on":"")+(T.risky?" access__card--risky":""),onClick:()=>o({folderAccess:T.value}),children:[r.jsx("span",{className:"access__radio","aria-hidden":"true"}),r.jsxs("span",{className:"access__body",children:[r.jsxs("span",{className:"access__title",children:[T.title,T.risky&&r.jsx("span",{className:"access__risk",children:"самое широкое"})]}),r.jsx("span",{className:"access__desc",children:T.description})]})]},T.value)})})]}),r.jsxs("section",{className:"settings__section",children:[r.jsxs("div",{className:"settings__switch-row",children:[r.jsxs("div",{className:"settings__switch-copy",children:[r.jsx("h3",{className:"settings__heading",children:"Терминал"}),r.jsx("p",{className:"settings__hint",children:"Панель терминала под лентой разговора: команда, которую там набрали, выполняется прямо на этом компьютере с правами вашего пользователя — не в песочнице агента, как Bash-инструмент в разговоре. Выключите — и все открытые вкладки терминала закроются, а процессы в них не переживут закрытия."})]}),x?r.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):r.jsx("button",{type:"button",role:"switch","aria-checked":y,"aria-label":"Терминал",className:y?"switch is-on":"switch",onClick:()=>o({terminalEnabled:!y}),children:r.jsx("span",{className:"switch__knob"})})]}),r.jsxs("div",{className:"settings__nested"+(j?" is-disabled":""),children:[r.jsx("h4",{className:"settings__nested-heading",children:"Удалённый доступ к терминалу"}),x?r.jsx("p",{className:"settings__hint",children:"Загрузка…"}):r.jsxs(r.Fragment,{children:[j&&r.jsx("p",{className:"settings__hint",children:"Сначала включите терминал выше — удалённый доступ выдаётся к тому, что на этой машине уже разрешено, а не поверх выключенного рубильника."}),R()]})]})]})]})})}const Nk=16;function wk({pane:a,width:l,onResize:i,onReset:c}){const o=Mi[a],d=_.useRef(null);function h(y){if(y.button!==0)return;const j=document.querySelector(".main"),v=j?Math.max(0,j.getBoundingClientRect().width-d0):0;d.current={x:y.clientX,width:l,max:Math.min(o.max,l+v)},y.currentTarget.setPointerCapture(y.pointerId),document.body.classList.add("is-resizing"),y.preventDefault()}function p(y){const j=d.current;if(!j)return;const v=o.side==="left"?y.clientX-j.x:j.x-y.clientX;i(Math.min(j.max,j.width+v))}function m(y){d.current&&(d.current=null,y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),document.body.classList.remove("is-resizing"))}function x(y){const j=y.key==="ArrowRight"?1:y.key==="ArrowLeft"?-1:0;j!==0&&(y.preventDefault(),i(l+j*Nk*(o.side==="left"?1:-1)))}return r.jsx("div",{className:`pane-resizer pane-resizer--${a} 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:r.jsx("span",{className:"pane-resizer__line","aria-hidden":"true"})})}const Tk=16;function Ek({height:a,onResize:l,onReset:i}){const c=_.useRef(null);function o(){const x=document.querySelector(".main .transcript, .main .editor");if(!x)return 1/0;const y=x.getBoundingClientRect().height-g0;return Math.round(a+Math.max(0,y))}function d(x){x.button===0&&(c.current={y:x.clientY,height:a,max:o()},x.currentTarget.setPointerCapture(x.pointerId),document.body.classList.add("is-resizing-row"),x.preventDefault())}function h(x){const y=c.current;if(!y)return;const j=y.y-x.clientY;l(y.height+j,y.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 y=x.key==="ArrowUp"?1:x.key==="ArrowDown"?-1:0;y!==0&&(x.preventDefault(),l(a+y*Tk,o()))}return r.jsx("div",{className:"term-resizer",role:"separator","aria-orientation":"horizontal","aria-label":"Высота панели терминала","aria-valuenow":a,"aria-valuemin":zx,tabIndex:0,title:"Потяните, чтобы изменить высоту; двойной щелчок — высота по умолчанию",onPointerDown:d,onPointerMove:h,onPointerUp:p,onPointerCancel:p,onDoubleClick:i,onKeyDown:m,children:r.jsx("span",{className:"term-resizer__line","aria-hidden":"true"})})}function xx(){const a=document.documentElement,l=getComputedStyle(a),i=M=>l.getPropertyValue(M).trim(),c=i("--surface"),o=i("--text"),d=i("--text-2"),h=i("--muted"),p=i("--accent"),m=i("--accent-fg"),x=i("--select"),y=i("--danger"),j=i("--ok"),v=i("--warn"),R=i("--cm-fn"),T=i("--cm-key"),L=i("--cm-type"),B=yx(o,c,55),P=M=>yx(M,"#ffffff",25);return{background:c,foreground:o,cursor:p,cursorAccent:m,selectionBackground:x,black:B,brightBlack:h,red:y,brightRed:P(y),green:j,brightGreen:P(j),yellow:v,brightYellow:P(v),blue:R,brightBlue:P(R),magenta:T,brightMagenta:P(T),cyan:L,brightCyan:P(L),white:d,brightWhite:o}}function Ak(){return getComputedStyle(document.documentElement).getPropertyValue("--mono").trim()}let ma=null;function Ck(a){return ma||(ma=document.createElement("span"),ma.style.position="fixed",ma.style.width="0",ma.style.height="0",ma.style.opacity="0",ma.style.pointerEvents="none",document.body.appendChild(ma)),ma.style.color=a,getComputedStyle(ma).color}function yx(a,l,i){return Ck(`color-mix(in srgb, ${a} ${100-i}%, ${l} ${i}%)`)}let Ro=null;function Rk(){return Ro||(Ro=Promise.all([Xe(()=>import("./xterm-D6Mng-DB.js").then(a=>a.x),__vite__mapDeps([22,23]),import.meta.url),Xe(()=>import("./addon-fit-CevVMrUA.js").then(a=>a.a),__vite__mapDeps([24,23]),import.meta.url),Xe(()=>import("./addon-web-links-CnB65OV_.js").then(a=>a.a),__vite__mapDeps([25,23]),import.meta.url),Xe(()=>Promise.resolve({}),__vite__mapDeps([26]),import.meta.url)]).then(([a,l,i])=>({Terminal:a.Terminal,FitAddon:l.FitAddon,WebLinksAddon:i.WebLinksAddon})).catch(a=>{throw Ro=null,a})),Ro}function Mk({terminals:a,activeId:l,blocked:i,error:c,onDismissError:o,height:d,offset:h,mobile:p=!1,zoomed:m,onToggleZoom:x,onSelect:y,onOpen:j,onClose:v,onInput:R,onResize:T,onAttach:L,onHide:B,registerSink:P}){const[M,Z]=_.useState(()=>xx());return _.useEffect(()=>{const N=new MutationObserver(()=>Z(xx()));return N.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>N.disconnect()},[]),r.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:[r.jsxs("div",{className:"termpanel__tabbar",onDoubleClick:N=>{x&&(N.target.closest("button")||x())},children:[r.jsx("div",{className:"termpanel__tabs",role:"tablist","aria-label":"Открытые терминалы",children:a.map(N=>r.jsxs("div",{role:"tab","aria-selected":N.id===l,className:"termtab"+(N.id===l?" is-on":"")+(N.exitCode!==null?" termtab--exited":""),onDoubleClick:K=>{x&&(K.target.closest(".termtab__close")||x())},children:[r.jsx("button",{className:"termtab__name",title:N.cwd,onClick:()=>y(N.id),children:N.title}),N.exitCode!==null&&r.jsx("span",{className:"termtab__code",title:`Оболочка завершилась с кодом ${N.exitCode}`,children:N.exitCode}),r.jsx("button",{className:"termtab__close",title:"Закрыть терминал","aria-label":`Закрыть терминал «${N.title}»`,onClick:()=>v(N.id),children:"✕"})]},N.id))}),r.jsx("button",{className:"termpanel__add",title:"Новый терминал","aria-label":"Новый терминал",disabled:i,onClick:j,children:"+"}),r.jsx("div",{className:"termpanel__spacer"}),x&&r.jsx("button",{className:"termpanel__zoom",title:m?"Свернуть терминал — то же самое, что двойной клик по вкладке":"Развернуть терминал на весь экран — то же самое, что двойной клик по вкладке","aria-label":m?"Свернуть терминал":"Развернуть терминал на весь экран","aria-pressed":m,onClick:x,children:r.jsx(Hr,{active:m})}),r.jsx("button",{className:"termpanel__hide",title:"Скрыть панель","aria-label":"Скрыть панель терминала",onClick:B,children:"✕"})]}),c&&a.length>0&&r.jsx(_x,{message:c,strip:!0,onRetry:null,onDismiss:o}),r.jsxs("div",{className:"termpanel__body",children:[c&&a.length===0?r.jsx(_x,{message:c,onRetry:i?null:j,onDismiss:o}):i?r.jsxs("div",{className:"termpanel__empty",children:[r.jsx("p",{children:"Терминал с удалённых устройств выключен"}),r.jsx("p",{className:"termpanel__hint",children:"Откройте «Удалённый доступ» → «Прислать письмо»: на почту аккаунта придёт ссылка, и после перехода по ней терминал заработает прямо здесь. Если сейчас доберётесь до самого компьютера — там разрешение включается сразу, без письма."})]}):a.length===0&&r.jsxs("div",{className:"termpanel__empty",children:[r.jsx("p",{children:"Терминалов не открыто"}),r.jsx("button",{className:"btn btn--primary",onClick:j,children:"Открыть терминал"})]}),a.map(N=>r.jsx(Dk,{id:N.id,exitCode:N.exitCode,active:N.id===l,theme:M,mobile:p,onInput:R,onResize:T,onAttach:L,registerSink:P},N.id))]})]})}function _x({message:a,strip:l=!1,onRetry:i,onDismiss:c}){const{lede:o,hint:d,details:h}=Ok(a);return r.jsxs("div",{className:l?"termfail termfail--strip":"termfail",role:"alert",children:[r.jsxs("div",{className:"termfail__text",children:[r.jsx("p",{className:"termfail__lede",children:o}),d&&r.jsx("p",{className:"termfail__hint",children:d}),h&&r.jsxs("details",{className:"termfail__details",children:[r.jsx("summary",{children:"Подробности"}),r.jsx("pre",{children:h})]})]}),r.jsxs("div",{className:"termfail__bar",children:[i&&r.jsx("button",{className:"btn btn--primary",onClick:i,children:"Открыть терминал"}),r.jsx("button",{className:"btn",onClick:c,children:"Понятно"})]})]})}function Ok(a){const[l="",...i]=a.trim().split(`
122
-
123
- `),c=l.split(`
124
- `).map(o=>o.trim()).filter(o=>o!=="");return{lede:c[0]??a.trim(),hint:c.slice(1).join(" "),details:i.join(`
125
-
126
- `).trim()}}function Dk({id:a,exitCode:l,active:i,theme:c,mobile:o,onInput:d,onResize:h,onAttach:p,registerSink:m}){const x=_.useRef(null),y=_.useRef(null),j=_.useRef(!1),v=_.useRef(o);v.current=o;const R=_.useRef(c),T=_.useRef(l),[L,B]=_.useState("loading"),[P,M]=_.useState(!1);return _.useEffect(()=>{if(!x.current)return;let N=!1,K=null;B("loading"),M(!1);const z=window.setTimeout(()=>{N||M(!0)},200);return(async()=>{var ke;let A;try{A=await Rk()}catch{window.clearTimeout(z),N||B("error");return}if(N||!x.current)return;window.clearTimeout(z);const{Terminal:V,FitAddon:te,WebLinksAddon:oe}=A,F=new V({fontFamily:Ak()||"monospace",fontSize:13,lineHeight:1.2,cursorBlink:!0,cursorStyle:"bar",scrollback:5e3,theme:R.current}),ae=new te;F.loadAddon(ae),F.loadAddon(new oe),F.open(x.current),y.current=F,F.attachCustomKeyEventHandler(k=>{if(k.type!=="keydown"||!(k.ctrlKey||k.metaKey))return!0;if(k.key==="`")return k.preventDefault(),!1;if(k.key==="c"||k.key==="C"){const ce=F.getSelection();return ce?(k.preventDefault(),Lr(ce),!1):!k.shiftKey}return k.key==="v"||k.key==="V"?(k.preventDefault(),Rh().then(ce=>{ce&&F.paste(ce)}),!1):!0});const me=k=>{k.preventDefault();const $=F.getSelection();if($){Lr($),F.clearSelection();return}Rh().then(ce=>{ce&&F.paste(ce)})};(ke=F.element)==null||ke.addEventListener("contextmenu",me);const Te=F.onData(k=>d(a,k));let be={cols:F.cols,rows:F.rows},U=null;const re=F.onResize(({cols:k,rows:$})=>{U!==null&&window.clearTimeout(U),U=window.setTimeout(()=>{U=null,!(k===be.cols&&$===be.rows)&&(be={cols:k,rows:$},h(a,k,$))},100)}),se=new ResizeObserver(()=>{try{ae.fit()}catch{return}v.current&&F.scrollToBottom()});se.observe(x.current);const pe=m(a,k=>{k.kind==="buffer"&&F.reset(),F.write(k.data)});p(a),T.current!==null&&!j.current&&(j.current=!0,F.write(`\r
127
- \x1B[2m— Процесс завершён (код ${T.current}) —\x1B[0m\r
128
- `)),i&&F.focus(),K=()=>{var k;U!==null&&window.clearTimeout(U),se.disconnect(),(k=F.element)==null||k.removeEventListener("contextmenu",me),Te.dispose(),re.dispose(),pe(),F.dispose(),y.current=null},B("ready")})(),()=>{N=!0,window.clearTimeout(z),K==null||K(),K=null}},[a]),_.useEffect(()=>{if(!o)return;const Z=x.current;if(!Z)return;let N=null,K=0,z=!1;const A=F=>{F.pointerType==="mouse"||N!==null||(N=F.pointerId,K=F.clientY,z=!1)},V=F=>{if(F.pointerId!==N)return;const ae=K-F.clientY;if(!z){if(Math.abs(ae)<4)return;z=!0,Z.setPointerCapture(F.pointerId)}K=F.clientY;const me=Z.querySelector(".xterm-viewport");me&&(me.scrollTop+=ae)},te=F=>{F.pointerId===N&&(Z.hasPointerCapture(F.pointerId)&&Z.releasePointerCapture(F.pointerId),N=null,z=!1)},oe=F=>F.stopPropagation();return Z.addEventListener("pointerdown",A),Z.addEventListener("pointermove",V),Z.addEventListener("pointerup",te),Z.addEventListener("pointercancel",te),Z.addEventListener("touchmove",oe,{capture:!0}),()=>{Z.removeEventListener("pointerdown",A),Z.removeEventListener("pointermove",V),Z.removeEventListener("pointerup",te),Z.removeEventListener("pointercancel",te),Z.removeEventListener("touchmove",oe,{capture:!0}),N!==null&&Z.hasPointerCapture(N)&&Z.releasePointerCapture(N)}},[o]),_.useEffect(()=>{R.current=c,y.current&&(y.current.options.theme=c)},[c]),_.useEffect(()=>{var Z;i&&((Z=y.current)==null||Z.focus())},[i]),_.useEffect(()=>{if(T.current=l,l===null){j.current=!1;return}if(j.current)return;const Z=y.current;Z&&(j.current=!0,Z.write(`\r
129
- \x1B[2m— Процесс завершён (код ${l}) —\x1B[0m\r
130
- `))},[l]),r.jsxs("div",{className:"termview"+(i?" is-active":""),children:[r.jsx("div",{ref:x,className:"termview__surface"+(L==="ready"?"":" is-hidden")}),L==="loading"&&P&&r.jsxs("div",{className:"termview__state work",role:"status",children:[r.jsxs("div",{className:"work__dots",children:[r.jsx("span",{className:"work__dot"}),r.jsx("span",{className:"work__dot"}),r.jsx("span",{className:"work__dot"})]}),r.jsx("span",{className:"work__label",children:"Загружается терминал…"})]}),L==="error"&&r.jsxs("div",{className:"termview__state termview__state--error",role:"alert",children:[r.jsx("p",{children:"Не удалось загрузить терминал"}),r.jsx("p",{className:"termpanel__hint",children:"Соединение оборвалось раньше, чем приехал нужный модуль — на мобильном relay это обычное дело на слабой сети. Ниже — перезагрузка страницы, а не тихий повтор: открытые терминалы и их содержимое приедут обратно с хоста, а вот черновик в поле ввода внизу — нет."}),r.jsx("button",{className:"btn btn--primary",onClick:()=>window.location.reload(),children:"Перезагрузить страницу"})]})]})}const zk=2e5,Lk=75,Uk=90;function Hk({tokens:a,maxTokens:l,fetchedAt:i}){if(a===null)return null;const c=l??zk,o=Math.min(100,Math.round(a/c*100)),d=`${a.toLocaleString()} из ${c.toLocaleString()} токенов${i?`
131
- обновлено в ${new Date(i).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:""}`;return r.jsxs("div",{className:"contextbar","aria-label":`Занято контекста: ${o}%`,title:d,children:[r.jsx("span",{className:"contextbar__label",children:"контекст"}),r.jsx("span",{className:"contextbar__track",role:"progressbar","aria-valuenow":o,"aria-valuemin":0,"aria-valuemax":100,children:r.jsx("span",{className:`contextbar__fill${Bk(o)}`,style:{width:`${o}%`}})}),r.jsxs("span",{className:"contextbar__pct",children:[o,"%"]})]})}function Bk(a){return a>=Uk?" contextbar__fill--over":a>=Lk?" contextbar__fill--warn":""}const Sy="ccv:last-session",qk=300*1e3,Ik=1e4;function Gk(){try{const a=localStorage.getItem(Sy);if(!a)return null;const l=JSON.parse(a);if(typeof l!="object"||l===null)return null;const{workspaceId:i,sessionId:c,claudeSessionId:o}=l;return typeof i!="string"||typeof c!="string"?null:{workspaceId:i,sessionId:c,claudeSessionId:typeof o=="string"?o:null}}catch{return null}}function Yk(a,l){return a.id===l.sessionId?!0:l.claudeSessionId?a.id===l.claudeSessionId||a.claudeSessionId===l.claudeSessionId:!1}const Xk={mcp:"mcp",plugins:"plugins",plugin:"plugins"},vx=[{name:"login",description:"Войти в аккаунт Claude — окно приложения",argumentHint:"",aliases:["signin","вход"]},{name:"switch-account",description:"Сменить аккаунт: выйти и войти заново",argumentHint:"",aliases:["account","аккаунт"]},{name:"logout",description:"Выйти из аккаунта Claude",argumentHint:"",aliases:["signout","выход"]}],Vk={active:!1,url:"",awaitingCode:!1,output:"",error:null};function Sx(a,l,i){if(a===null)return null;const c=a.lastIndexOf("/");if(c===-1&&a!=="")return l;const o=i[c===-1?"":a.slice(0,c)];if(!o)return null;const d=a.slice(c+1).toLowerCase();return d===""?{query:a,entries:o}:{query:a,entries:o.filter(h=>h.name.toLowerCase().includes(d)).sort((h,p)=>jx(h.name,d)-jx(p.name,d))}}function jx(a,l){return a.toLowerCase().startsWith(l)?0:1}function kx(a,l){const i=a.find(o=>o.value===l)??a.find(o=>o.resolvedModel===l),c=l&&!i?l:null;return{rows:[...c?[{value:c,resolvedModel:c,displayName:c,description:"задана в настройках",supportsEffort:!1,effortLevels:[],supportsThinking:!0,supportsAutoMode:!1}]:[],...a],selected:(i==null?void 0:i.value)??c??(a.some(o=>o.value==="default")?"default":"")}}function $k(){var oi;const a=_.useRef(null),[l,i]=_.useState(!1),[c,o]=_.useState("Нет связи с хостом"),[d,h]=_.useState(null),[p,m]=_.useState(!1),x=_.useMemo(()=>Do()==="relay",[]),[y,j]=_.useState([]),[v,R]=_.useState([]),[T,L]=_.useState([]),[B,P]=_.useState([]),[M,Z]=_.useState(null),[N,K]=_.useState(null),[z,A]=_.useState(null),[V,te]=_.useState(hl),[oe,F]=_.useState(th),[ae,me]=_.useState(!1),[Te,be]=_.useState(!1),U=$o("(max-width: 860px)"),[re,se]=_.useState(!1);_.useEffect(()=>{U||se(!1)},[U]);const[pe,ke]=_.useState(!1),[k,$]=_.useState([]),[ce,he]=_.useState(!1),[Ne,ye]=_.useState(hl),[Ae,st]=_.useState(null),[Qe,Ot]=_.useState(null),[qe,xt]=_.useState([]),[et,Je]=_.useState(null),[Fe,it]=_.useState(null),[Jn,Bt]=_.useState([]),[qt,Kt]=_.useState([]),[It,Gt]=_.useState([]),[Qt,rt]=_.useState([]),[wt,en]=_.useState(null),[En,Ct]=_.useState(!1),[kn,An]=_.useState(null),[Dt,fn]=_.useState(null),[Jt,Tt]=_.useState(!1),[dn,ot]=_.useState(Vk),[tn,E]=_.useState(null),[Y,_e]=_.useState(null),[O,J]=_.useState(!1),[xe,,Be]=o0(),Et=m0(),[Nn,wn]=_.useState(!1),[Rt,wl]=_.useState(null),[Sa,ja]=_.useState(null),[Gs,Hl]=_.useState(null),[Kl,hn]=_.useState(null),[ka,ml]=_.useState(null),[ll,Ft]=_.useState(""),[Ke,Fn]=_.useState(null),[Ys,Hi]=_.useState([]),[Xs,Jl]=_.useState(!1),[Fl,Na]=_.useState(null),[Wl,gl]=_.useState(!1),[nn,ln]=_.useState(!1),[ft,Xn]=_.useState({}),[wa,Vn]=_.useState([""]),[$n,al]=_.useState([]),[Pl,Wn]=_.useState(null),[Vs,Cn]=_.useState(null),[zn,pn]=_.useState(null),[yt,Ta]=_.useState(null),[Br,ea]=_.useState(null),[ta,Ea]=_.useState({}),[Aa,Ln]=_.useState({}),[bl,Bl]=_.useState(!1),[na,sl]=_.useState(null),[de,w]=_.useState(null),I=_.useRef(0),ue=_.useRef(null),[ve,Re]=_.useState(!1),[Oe,mt]=_.useState([]),[mn,an]=_.useState(null),[Mt,gn]=_.useState(null),Yt=b0(),la=y0(U&&ve),Tl=_.useRef(new Map),aa=(Dt==null?void 0:Dt.terminalEnabled)===!0,ts=Do()==="relay"&&((oi=d==null?void 0:d.shell)==null?void 0:oi.enabled)!==!0,Bi=_.useRef(!1),$s=_.useCallback((b,q)=>(Tl.current.set(b,q),()=>{Tl.current.get(b)===q&&Tl.current.delete(b)}),[]),[Un,Qs]=_.useState(!1),[ns,xl]=_.useState(null),[qi,Ca]=_.useState(hl),[El,Ra]=_.useState(null),[sa,ia]=_.useState({}),bn=_.useRef([]),[gt,ls]=_.useState(null);function Zs(b){ls(q=>q===b?null:b)}_.useEffect(()=>{(U||gt==="terminal"&&!ve||gt==="files"&&!nn||gt==="search"&&!bl||gt==="git"&&!Nn||gt==="ask"&&!Un||gt==="main"&&$n.length===0)&&ls(null)},[gt,U,ve,nn,bl,Nn,Un,$n.length]);const[Ko]=_.useState(Gk),Ii=_.useRef(Ko),as=_.useRef(!1),sn=_.useRef(null),rn=_.useRef(null),qr=_.useRef(0);sn.current=N,rn.current=M,qr.current=V.lastSeq;const Wc=_.useRef(oe);Wc.current=oe;const ql=_.useRef(null),Pc=_.useRef(0);Pc.current=qi.lastSeq;const ss=_.useRef(null),Gi=_.useRef(""),Ks=_.useRef(null),Ma=_.useRef([]),eu=_.useRef([""]);Ma.current=$n,eu.current=wa;const Js=_.useRef(new Map),Fs=_.useRef(new Set),Ws=_.useRef(null),Ps=_.useRef(null),tu=_.useRef(0);_.useEffect(()=>{const b=a0();if(!b)return;a.current=b;const q=()=>{i(b.connected),o(b.statusText)};b.onStatus(q),b.onReconnect(()=>{q();const dt=sn.current;dt&&b.send({type:"session.sync",sessionId:dt,sinceSeq:qr.current});const Vt=ql.current;Vt&&b.send({type:"session.sync",sessionId:Vt,sinceSeq:Pc.current})});const fe=b.on(dt=>Jo(dt));b.connect();const De=window.setInterval(()=>{q(),b.connected&&b.send({type:"ping",nonce:Date.now()})},15e3);return()=>{fe(),window.clearInterval(De),b.close()}},[]);const Jo=_.useCallback(b=>{var q,fe,De,dt,Vt,cn,ds;switch(b.type){case"hello.ok":i(!0);break;case"workspace.list":{j(b.workspaces),Z(Ie=>{var Ge;if(Ie)return Ie;const Ve=Ii.current,Ue=Ve&&b.workspaces.find(Rl=>Rl.id===Ve.workspaceId);return(Ue==null?void 0:Ue.id)??((Ge=b.workspaces[0])==null?void 0:Ge.id)??null});const Ce=Ks.current;if(!Ce)break;const Le=b.workspaces.find(Ie=>Jk(Ie.path,Ce));if(!Le)break;Ks.current=null,ke(!1),Z(Le.id);break}case"workspace.candidates":if(b.query.trim()!==Gi.current)break;$(b.candidates),b.source==="host"&&he(!1);break;case"finder.opened":ss.current=b.sessionId;break;case"workspace.roots":xt(b.roots);break;case"workspace.created":if(Z(b.workspace.id),b.warnings.length===0){ke(!1),Ot(null);break}Je({path:b.workspace.path,warnings:b.warnings});break;case"session.list":if(b.workspaceId!==rn.current)break;R(b.sessions),L(b.archived);break;case"session.pinned":P(b.sessions);break;case"session.summary":if(b.session.id===ss.current){st(b.session);break}if(b.session.parentSessionId){b.session.id===ql.current&&Ra(b.session);break}R(Ce=>{const Le=Ce.findIndex(Ve=>Ve.id===b.session.id);if(Le===-1)return[b.session,...Ce];const Ie=Ce.slice();return Ie[Le]=b.session,Ie}),P(Ce=>{const Le=Ce.findIndex(Ve=>Ve.id===b.session.id);if(Le===-1)return Ce;const Ie=Ce.slice();return Ie[Le]={...b.session,pinned:!0,...Ce[Le].pinnedAt?{pinnedAt:Ce[Le].pinnedAt}:{}},Ie}),K(Ce=>Ce??b.session.id);break;case"usage.state":b.sessionId===sn.current&&(E(b.usage),J(!1));break;case"context.state":b.sessionId===sn.current&&(_e(b.context),J(!1));break;case"session.capabilities":b.sessionId===sn.current&&A(b.capabilities);break;case"session.events":if(b.sessionId===ql.current){Ca(Ce=>zo(Ce,b.entries));break}if(b.sessionId===ss.current){ye(Ce=>zo(Ce,b.entries));break}if(b.sessionId!==sn.current)break;for(const Ce of b.entries){if(Ce.event.kind!=="rewound")continue;const Le=Ce.event.toUserIndex,Ie=c0(Wc.current.entries,Le),Ve=Ie.reduce((Ue,Ge)=>Ge.event.kind==="user.message"?Ue+1:Ue,0);F(Ue=>({...Ue,entries:Ie})),te(Ue=>({...Ue,items:u0(Ue.items,Le,Ve)}))}te(Ce=>zo(Ce,b.entries));break;case"session.history":if(b.sessionId!==sn.current)break;F(Ce=>s0(Ce,b));break;case"side.opened":{if(b.parentSessionId!==sn.current)break;ql.current=b.sessionId,xl(b.sessionId);const Ce=bn.current;bn.current=[];for(const Le of Ce)Le(b.sessionId);break}case"side.closed":if(b.parentSessionId!==sn.current)break;ql.current=null,xl(null),Ca(hl),Ra(null);break;case"git.state":if(b.workspaceId!==rn.current)break;wl(b.state);break;case"git.commit":if(b.workspaceId!==rn.current)break;ja(b.detail);break;case"git.result":if(b.workspaceId!==rn.current)break;hn({ok:b.ok,message:b.message,url:b.url}),b.ok&&(ja(null),Hl(null),Jl(!1),gl(!1));break;case"git.busy":if(b.workspaceId!==rn.current)break;Ft(b.label);break;case"git.files":if(b.workspaceId!==rn.current)break;Na({files:b.files,truncated:b.truncated});break;case"github.status":Fn(b.status);break;case"github.owners":Hi(b.owners);break;case"fs.dir":if(b.workspaceId!==rn.current)break;Xn(Ce=>({...Ce,[b.path]:b.entries}));break;case"fs.search":if(b.workspaceId!==rn.current)break;if(b.scope!=="tree"){const Ce=b.scope;Ln(Le=>({...Le,[Ce]:{query:b.query,entries:b.entries}}));break}ea({query:b.query,entries:b.entries,truncated:b.truncated});break;case"fs.grep":if(b.workspaceId!==rn.current)break;sl({query:b.query,matches:b.matches,truncated:b.truncated});break;case"fs.file":{if(b.workspaceId!==rn.current)break;const Ce=Fs.current.delete(b.file.path);al(Ie=>{const Ve=Ie.findIndex(Rl=>Rl.path===b.file.path);if(Ve===-1)return[...Ie,Xb(b.file,++tu.current)];const Ue=Ie[Ve],Ge=Ie.slice();return Ge[Ve]=Ue.saved===b.file.content&&!Fa(Ue)?{...Ue,mtime:b.file.mtime,size:b.file.size,stale:!1}:Xb(b.file,++tu.current),Ge}),Ce&&Wn(b.file.path);const Le=ue.current;Le&&Le.path===b.file.path&&(ue.current=null,w({...Le,token:++I.current}));break}case"fs.saved":{if(b.workspaceId!==rn.current)break;const Ce=Js.current.get(b.path);Js.current.delete(b.path);const Le=Ce!==void 0;al(Ve=>Ve.map(Ue=>Ue.path!==b.path?Ue:Le?{...Ue,saved:Ce,mtime:b.mtime,size:b.size,stale:!1}:{...Ue,stale:!0}));const Ie=Ma.current.find(Ve=>Ve.path===b.path);!Le&&Ie&&!Fa(Ie)&&((q=a.current)==null||q.send({type:"fs.read",workspaceId:b.workspaceId,path:b.path})),(fe=a.current)==null||fe.send({type:"git.state",workspaceId:b.workspaceId});break}case"fs.result":{if(b.workspaceId!==rn.current)break;if(Cn({ok:b.ok,message:b.message}),b.ok||Js.current.delete(b.path),b.conflict&&al(Le=>Le.map(Ie=>Ie.path===b.path?{...Ie,stale:!0}:Ie)),Ps.current===b.path){const Le=Ps.current;Ps.current=null,b.ok&&(Fs.current.add(Le),(De=a.current)==null||De.send({type:"fs.read",workspaceId:b.workspaceId,path:Le}))}const Ce=Ws.current;if(b.ok&&Ce&&Ce.to===b.path){Ws.current=null;const Le=Ie=>Ie===Ce.from?Ce.to:Ie.startsWith(`${Ce.from}/`)?Ce.to+Ie.slice(Ce.from.length):Ie;al(Ie=>Ie.map(Ve=>({...Ve,path:Le(Ve.path)}))),Wn(Ie=>Ie===null?null:Le(Ie)),Vn(Ie=>Ie.map(Le)),Xn(Ie=>{const Ve={};for(const[Ue,Ge]of Object.entries(Ie))Ue===Ce.from||Ue.startsWith(`${Ce.from}/`)||(Ve[Ue]=Ge);return Ve})}b.ok&&((dt=a.current)==null||dt.send({type:"git.state",workspaceId:b.workspaceId}));break}case"term.list":if(b.workspaceId!==rn.current)break;mt(b.terminals);break;case"term.opened":if(b.terminal.workspaceId!==rn.current)break;gn(null),mt(Ce=>{const Le=Ce.findIndex(Ve=>Ve.id===b.terminal.id);if(Le===-1)return[...Ce,b.terminal];const Ie=Ce.slice();return Ie[Le]=b.terminal,Ie}),Bi.current&&(Bi.current=!1,an(b.terminal.id));break;case"term.buffer":(Vt=Tl.current.get(b.id))==null||Vt({kind:"buffer",data:b.data});break;case"term.data":(cn=Tl.current.get(b.id))==null||cn({kind:"data",data:b.data});break;case"term.exit":mt(Ce=>Ce.map(Le=>Le.id===b.id?{...Le,exitCode:b.exitCode}:Le));break;case"term.closed":mt(Ce=>Ce.filter(Le=>Le.id!==b.id));break;case"mcp.list":b.sessionId===sn.current&&Bt(b.servers);break;case"plugin.list":if(b.sessionId!==sn.current)break;Kt(b.plugins),Gt(b.marketplaces),rt(b.catalog);break;case"operation.result":b.sessionId===sn.current&&en(b.result);break;case"auth.status":An(b.status);break;case"relay.state":h(b.state);break;case"settings.state":fn(b.settings);break;case"auth.login":ot(b.state),b.state.active&&Ct(!0);break;case"session.closed":R(Ce=>Ce.map(Le=>Le.id===b.sessionId?{...Le,state:"closed"}:Le));break;case"error":console.error("[host]",b.message,b.context??""),(b.context==="workspace.open"||b.context==="workspace.create")&&(Ks.current=null,Ot(b.message)),(ds=b.context)!=null&&ds.startsWith("term.")&&gn(b.message);break}},[]),ne=_.useCallback(b=>{var q;(q=a.current)==null||q.send(b)},[]);_.useEffect(()=>{M&&ne({type:"session.list",workspaceId:M})},[M,ne]),_.useEffect(()=>{l&&ne({type:"session.pins"})},[l,ne]),_.useEffect(()=>{l&&ne({type:"settings.get"})},[l,ne]),_.useEffect(()=>{if(as.current)return;const b=Ii.current;if(!b||!M)return;if(M!==b.workspaceId){as.current=!0;return}if(N){as.current=!0;return}if(v.length===0)return;const q=v.find(fe=>Yk(fe,b));as.current=!0,q&&Yi(q)},[v,M,N]),_.useEffect(()=>{!M||ts||!aa||ne({type:"term.list",workspaceId:M})},[M,ts,aa,ne]),_.useEffect(()=>{an(b=>{var q;return b&&Oe.some(fe=>fe.id===b)?b:((q=Oe[0])==null?void 0:q.id)??null})},[Oe]),_.useEffect(()=>{pe&&ne({type:"workspace.roots"})},[pe,ne]);const is=_.useCallback(()=>{const b=sn.current;b&&(J(!0),ne({type:"usage.get",sessionId:b}),ne({type:"context.get",sessionId:b}))},[ne]);_.useEffect(()=>{if(!O)return;const b=window.setTimeout(()=>J(!1),Ik);return()=>window.clearTimeout(b)},[O]);const Ir=_.useMemo(()=>{const b=Math.max((tn==null?void 0:tn.fetchedAt)??0,(Y==null?void 0:Y.fetchedAt)??0);return b>0?b:null},[tn==null?void 0:tn.fetchedAt,Y==null?void 0:Y.fetchedAt]),Fo="Обновить лимиты и контекст"+(Ir?`
132
- обновлено в ${new Date(Ir).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:"");_.useEffect(()=>{if(_e(null),!N)return;is();const b=()=>{document.hidden||is()},q=window.setInterval(b,qk),fe=()=>{document.hidden||is()};return document.addEventListener("visibilitychange",fe),()=>{window.clearInterval(q),document.removeEventListener("visibilitychange",fe)}},[N,is]),_.useEffect(()=>{if(!N){F(th);return}F({...th,loading:!0}),ne({type:"session.history",sessionId:N})},[N,ne]);const nu=_.useCallback(()=>{!N||oe.loading||!ib(oe)||(F(b=>({...b,loading:!0})),ne({type:"session.history",sessionId:N,before:Rx(oe)}))},[N,oe,ne]),Wo=_.useMemo(()=>i0(oe.entries),[oe.entries]),Se=_.useMemo(()=>v.find(b=>b.id===N)??null,[v,N]),rs=y.find(b=>b.id===M)??null;_.useEffect(()=>{if(!M||!N)return;const b={workspaceId:M,sessionId:N,claudeSessionId:(Se==null?void 0:Se.claudeSessionId)??null};try{localStorage.setItem(Sy,JSON.stringify(b))}catch{}},[M,N,Se==null?void 0:Se.claudeSessionId]);function Po(b){Ks.current=b,Ot(null),ne({type:"workspace.open",path:b})}function ef(b,q,fe){Ot(null),ne({type:"workspace.create",parent:b,name:q,init:fe})}function tf(b){if(Gi.current=b,!b){$([]),he(!1);return}he(!0),ne({type:"workspace.find",query:b})}function nf(b){Gi.current=b,ye(hl),ne({type:"workspace.find.agent",query:b})}function lf(){ke(!1),Ot(null),Je(null),$([]),ye(hl),st(null),Gi.current="",Ks.current=null}function ei(){const b=sn.current;b&&ql.current&&ne({type:"side.reset",sessionId:b}),ql.current=null,xl(null),Ca(hl),Ra(null),ia({}),bn.current=[]}function Gr(b){ne({type:"workspace.close",workspaceIds:b}),!(!M||!b.includes(M))&&(ei(),Z(null),K(null),R([]),L([]),te(hl),A(null),be(!1))}function ti(b,q){ne({type:"session.archive",workspaceId:b,sessionIds:q}),N&&(q.includes(N)||Se!=null&&Se.claudeSessionId&&q.includes(Se.claudeSessionId))&&(ei(),K(null),te(hl),A(null),be(!1))}function af(){M&&(ei(),K(null),A(null),te(hl),be(!1),ne({type:"session.start",workspaceId:M}),me(!1))}function Yr(b){ei(),bu(),Z(b),K(null),te(hl),A(null),be(!1),wl(null),ja(null),Hl(null),hn(null),Ft(""),Jl(!1),Na(null),gl(!1),mt([]),an(null)}function lu(b,q,fe){ne({type:"session.pin",workspaceId:b,sessionIds:q,pinned:fe})}function au(b){b.workspaceId!==M&&Yr(b.workspaceId),Yi(b)}function Yi(b){if(me(!1),ei(),te(hl),A(null),be(!1),b.state==="closed"){K(null),ne({type:"session.start",workspaceId:b.workspaceId,resume:b.id});return}K(b.id),ne({type:"session.sync",sessionId:b.id,sinceSeq:0})}function Xr(b,q){ne({type:"session.rename",sessionId:b.id,title:q,workspaceId:b.workspaceId}),R(fe=>fe.map(De=>De.id===b.id?{...De,title:q}:De))}function Oa(b){N&&(me(!1),en(null),it(b),ne({type:"mcp.list",sessionId:N}),ne({type:"plugin.list",sessionId:N}))}const sf={mcpAction:(b,q)=>{N&&(ne({type:"mcp.action",sessionId:N,name:b,action:q}),it(null))},mcpAdd:(b,q)=>{N&&ne({type:"mcp.add",sessionId:N,name:b,draft:q})},mcpRemove:b=>{N&&ne({type:"mcp.remove",sessionId:N,name:b})},pluginInstall:b=>{N&&ne({type:"plugin.install",sessionId:N,spec:b})},pluginUninstall:b=>{N&&ne({type:"plugin.uninstall",sessionId:N,id:b})},pluginToggle:(b,q)=>{N&&ne({type:"plugin.toggle",sessionId:N,id:b,enabled:q})},marketplaceAdd:b=>{N&&ne({type:"marketplace.add",sessionId:N,source:b})},marketplaceRemove:b=>{N&&ne({type:"marketplace.remove",sessionId:N,name:b})}};function su(){me(!1),Ct(!0),ne({type:"auth.status"})}const Vr={login:(b,q)=>ne({type:"auth.login",mode:b,switchAccount:q}),submitCode:b=>ne({type:"auth.code",code:b}),cancel:()=>ne({type:"auth.cancel"}),logout:()=>ne({type:"auth.logout"})};function iu(){me(!1),Tt(!0),ne({type:"settings.get"})}function ru(b){fn(q=>q&&{...q,...b}),ne({type:"settings.update",settings:b})}function ni(b){N&&ne({type:"side.ask",sessionId:N,text:b})}function li(){N&&(ne({type:"side.reset",sessionId:N}),ql.current=null,xl(null),Ca(hl),Ra(null),ia({}),bn.current=[])}function ai(b){const q=ql.current;if(q){b(q);return}const fe=sn.current;fe&&(bn.current.push(b),ne({type:"side.open",sessionId:fe}))}function si(){M&&ne({type:"git.state",workspaceId:M})}function cu(b){M&&(Hl(b),ne({type:"git.show",workspaceId:M,ref:b}))}function $r(b,q){hn(null),ml({target:b,label:q})}function Qr(){!M||!ka||(ne({type:"git.checkout",workspaceId:M,target:ka.target}),ml(null))}function Zr(){M&&(hn(null),ne({type:"git.push",workspaceId:M}))}function uu(b){M&&(hn(null),ne({type:"git.pull",workspaceId:M,merge:b}))}function ou(){M&&(hn(null),Na(null),Jl(!0),ne({type:"github.status"}),ne({type:"github.owners"}),ne({type:"git.files",workspaceId:M}))}function fu(b){M&&(hn(null),ne({type:"git.publish",workspaceId:M,...b}))}function rf(b){M&&(hn(null),ne({type:"git.remote",workspaceId:M,url:b}))}function cf(){hn(null),gl(!0)}function uf(b){ne({type:"github.token",token:b}),ne({type:"github.owners"})}function of(){ne({type:"github.status"}),ne({type:"github.owners"})}_.useEffect(()=>{if(!(!nn||!M))for(const b of wa)b in ft||ne({type:"fs.list",workspaceId:M,path:b})},[nn,wa,ft,M,ne]);function ff(b){Vn(q=>q.includes(b)?q.filter(fe=>fe!==b):[...q,b])}function Pn(b){if(!b){ea(null);return}M&&ne({type:"fs.search",workspaceId:M,query:b})}function ii(b){if(!b){sl(null);return}M&&ne({type:"fs.grep",workspaceId:M,query:b})}const Kr=_.useCallback((b,q)=>{Ea(dt=>({...dt,[b]:q}));const fe=rn.current;if(q===null||!fe)return;const De=q.lastIndexOf("/");if(De!==-1){ne({type:"fs.list",workspaceId:fe,path:q.slice(0,De)});return}if(q===""){ne({type:"fs.list",workspaceId:fe,path:""});return}ne({type:"fs.search",workspaceId:fe,query:q,scope:b})},[ne]),du=_.useMemo(()=>Sx(ta.mention??null,Aa.mention??null,ft),[ta.mention,Aa.mention,ft]),hu=_.useMemo(()=>Sx(ta.side??null,Aa.side??null,ft),[ta.side,Aa.side,ft]);function pu(b){Fr(b.path,{line:b.line,column:b.column})}function Jr(b){const q=[];let fe=Oi(b.path);for(;q.push(fe),!!fe;)fe=Oi(fe);Vn(De=>{const dt=new Set(De);for(const Vt of q)dt.add(Vt);return b.kind==="dir"&&dt.add(b.path),[...dt]}),b.kind==="file"&&Fr(b.path)}function Fr(b,q){if(Ma.current.find(De=>De.path===b)){Wn(b),q&&w({path:b,...q,token:++I.current});return}M&&(q&&(ue.current={path:b,...q}),Fs.current.add(b),ne({type:"fs.read",workspaceId:M,path:b}))}function ra(b,q=!1){const fe=Ma.current,De=fe.find(cn=>cn.path===b);if(De&&Fa(De)&&!q){Ta(b);return}Ta(null);const dt=fe.findIndex(cn=>cn.path===b),Vt=fe.filter(cn=>cn.path!==b);al(Vt),Wn(cn=>{var ds;return cn===b?((ds=Vt[Math.min(dt,Vt.length-1)])==null?void 0:ds.path)??null:cn})}function cs(b,q=!1){const fe=Ma.current.find(De=>De.path===b);!fe||!M||!q&&!Fa(fe)||(Js.current.set(b,fe.text),ne({type:"fs.write",workspaceId:M,path:b,content:fe.text,eol:fe.eol,encoding:fe.encoding,baseMtime:fe.mtime,...q?{force:!0}:{}}))}function ri(b){M&&ne({type:"fs.read",workspaceId:M,path:b})}const Wr=_.useRef(new Map);function mu(b){const q=Wr.current,fe=q.get(b);fe&&clearTimeout(fe);const De=(Dt==null?void 0:Dt.autoSaveAfterPauseMs)??0;De<=0||q.set(b,setTimeout(()=>{q.delete(b);const dt=Ma.current.find(Vt=>Vt.path===b);dt&&Fa(dt)&&!dt.stale&&cs(b)},De))}function Da(b,q,fe){if(!M)return;const De=b?`${b}/${fe}`:fe;Cn(null),q==="file"&&(Ps.current=De),ne({type:"fs.create",workspaceId:M,path:De,kind:q})}function us(b,q){if(!M)return;const fe=Oi(b),De=fe?`${fe}/${q}`:q;Cn(null),Ws.current={from:b,to:De},ne({type:"fs.rename",workspaceId:M,path:b,to:De})}function Pr(b,q){if(!M)return;const fe=b.slice(b.lastIndexOf("/")+1),De=q?`${q}/${fe}`:fe;De!==b&&(Cn(null),Ws.current={from:b,to:De},ne({type:"fs.rename",workspaceId:M,path:b,to:De}))}function gu(b,q){M&&(Cn(null),ne({type:"fs.copy",workspaceId:M,path:b,toDir:q}))}function za(b){M&&(Cn(null),pn(null),ne({type:"fs.delete",workspaceId:M,path:b.path}),al(q=>q.filter(fe=>fe.path!==b.path&&!fe.path.startsWith(`${b.path}/`))),Wn(q=>q&&(q===b.path||q.startsWith(`${b.path}/`))?null:q))}function bu(){Xn({}),Vn([""]),al([]),Wn(null),Cn(null),ea(null),sl(null),Ea({}),Ln({}),w(null),Fs.current.clear(),Js.current.clear(),ue.current=null,Ws.current=null,Ps.current=null}function xu(){!M||ts||!aa||(gn(null),Bi.current=!0,ne({type:"term.open",workspaceId:M,cols:80,rows:24}))}function yu(b){ne({type:"term.close",id:b})}function df(b,q){N&&ne({type:"permission.respond",sessionId:N,requestId:b,decision:q})}function hf(b,q){N&&ne({type:"permission.respond",sessionId:N,requestId:b,decision:"allow",answers:q})}function pf(b){N&&ne({type:"permission.respond",sessionId:N,requestId:b,decision:"deny",reason:"Пользователь не стал отвечать на вопросы"})}function _u(b,q){N&&ne({type:"permission.respond",sessionId:N,requestId:b,decision:"allow",plan:q})}function vu(b){N&&ne({type:"permission.respond",sessionId:N,requestId:b,decision:"deny",reason:"Пользователь просит продолжить планирование"})}_.useEffect(()=>{function b(q){if(q.key!=="Escape")return;if(gt!==null){const De=q.target;if(!(De instanceof HTMLElement&&De.closest(".termview, .editor, .sidepane"))){ls(null);return}}if(!N||V.pending.length>0)return;const fe=q.target;fe instanceof HTMLElement&&fe.closest(".sidepane, .editor")||ne({type:"control.interrupt",sessionId:N})}return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[N,V.pending.length,ne,gt]),_.useEffect(()=>{function b(q){q.key!=="`"||!(q.ctrlKey||q.metaKey)||aa&&(q.preventDefault(),Re(fe=>!fe))}return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[aa]);const Xi=_.useMemo(()=>{const b=(z==null?void 0:z.commands)??[];return b.length===0?b:[...b,{name:"plugins",description:"Плагины и маркетплейсы — окно приложения",argumentHint:"",aliases:["plugin"]},...vx]},[z]);function il(b){const q=Xk[b];return q?(Oa(q),!0):vx.some(fe=>fe.name===b)?(su(),b==="logout"&&Vr.logout(),b==="switch-account"&&Vr.login("claudeai",!0),!0):!1}const La=(Se==null?void 0:Se.state)==="waiting_permission",Xt=(Se==null?void 0:Se.state)==="reconnecting",Rn=(Se==null?void 0:Se.state)==="running"||Xt||La,Hn=V.pending[0]??null,ci=Hn?ij(Hn.toolName,Hn.input):null;_.useEffect(()=>{!Nn&&!nn||!M||Rn||ne({type:"git.state",workspaceId:M})},[Nn,nn,M,Rn,ne]),_.useEffect(()=>{if(!(Rn||!M)){nn&&Xn(b=>{const q={};for(const[fe,De]of Object.entries(b))eu.current.includes(fe)||(q[fe]=De);return q});for(const b of Ma.current)Fa(b)||ne({type:"fs.read",workspaceId:M,path:b.path})}},[Rn,M,nn,ne]);const os=(Se==null?void 0:Se.cwd)??(z==null?void 0:z.cwd)??null,Vi=(z==null?void 0:z.models)??[],Al=(Se==null?void 0:Se.model)??(z==null?void 0:z.model)??null,{rows:ec,selected:$i}=kx(Vi,Al),Cl=El?{model:El.model,effort:El.effort,ultracode:El.ultracode,thinking:El.thinking,switchOnFlag:El.switchModelsOnFlag}:{model:sa.model??Al,effort:sa.effort??(Se==null?void 0:Se.effort)??null,ultracode:sa.ultracode??(Se==null?void 0:Se.ultracode)??!1,thinking:sa.thinking??(Se==null?void 0:Se.thinking)??!0,switchOnFlag:sa.switchOnFlag??(Se==null?void 0:Se.switchModelsOnFlag)??!0},Su=kx(Vi,Cl.model),el=(El==null?void 0:El.state)==="running",ui=Pl?$n.find(b=>b.path===Pl)??null:null,Il=new Set($n.filter(Fa).map(b=>b.path)),fs=b=>r.jsx(wk,{pane:b,width:Et.widths[b],onResize:q=>Et.setWidth(b,q),onReset:()=>Et.reset(b)}),Gl=b=>U?null:()=>Zs(b),ca=z&&r.jsx(es,{title:"Режим прав",value:(Se==null?void 0:Se.permissionMode)??"default",options:Mx.map(b=>({value:b.value,label:b.value,hint:b.hint})),onChange:b=>{N&&ne({type:"control.set_mode",sessionId:N,mode:b})}}),Qi=ec.length>0?r.jsx(my,{models:ec,value:$i,effort:(Se==null?void 0:Se.effort)??null,ultracode:(Se==null?void 0:Se.ultracode)??!1,thinking:(Se==null?void 0:Se.thinking)??!0,switchOnFlag:(Se==null?void 0:Se.switchModelsOnFlag)??!0,onModel:b=>{!N||!b||ne({type:"control.set_model",sessionId:N,model:b})},onEffort:b=>{N&&ne({type:"control.set_effort",sessionId:N,effort:b})},onUltracode:b=>{N&&ne({type:"control.set_ultracode",sessionId:N,enabled:b})},onThinking:b=>{N&&ne({type:"control.set_thinking",sessionId:N,enabled:b})},onSwitchOnFlag:b=>{N&&ne({type:"control.set_flag_switch",sessionId:N,enabled:b})}}):Al&&r.jsx("span",{className:"badge",children:Al}),tc=Rn&&r.jsx("span",{className:La?"badge badge--wait":"badge badge--live",children:La?"ждёт":Xt?"переподключается":"работает"}),Zi=()=>{N&&ne({type:"session.reconnect",sessionId:N})},ju=Xt?"Сессия уже поднимает новый процесс":Rn?"Недоступно, пока идёт ход":"Поднять сессии новый процесс — разговор сохранён",rl=N&&(Xt||(Se==null?void 0:Se.state)==="error")?r.jsxs("div",{className:Xt?"relink":"relink relink--error",role:"status",children:[r.jsxs("span",{className:"relink__msg",children:[r.jsx("span",{className:"relink__dot","aria-hidden":"true"}),Xt?"Связь оборвалась. Сессия поднимает новый процесс — разговор сохранён.":"Переподключиться не удалось. Разговор сохранён — сессия продолжит с этого места."]}),r.jsx("button",{className:"btn btn--sm",title:Xt?"Не ждать паузы между попытками — попробовать сейчас":"Поднять сессии новый процесс и продолжить разговор",onClick:Zi,children:Xt?"Переподключить сейчас":"Переподключить"})]}):null,ua=Se&&Se.totalCostUsd>0?`$${Se.totalCostUsd.toFixed(3)}`:null,Ua=r.jsx("button",{className:Un?"pane-btn is-on":"pane-btn",title:"Вопрос на полях — спросить, не мешая работе","aria-label":"Вопрос на полях","aria-pressed":Un,onClick:()=>Qs(b=>!b),children:r.jsx(Wk,{})});return r.jsxs("div",{className:"app",style:Et.style,children:[r.jsx(X1,{open:ae,connected:l,status:c,workspaces:y,sessions:v.filter(b=>b.workspaceId===M),archived:T.filter(b=>b.workspaceId===M),pinned:B,activeWorkspaceId:M,activeSessionId:N,onPinSessions:lu,onSelectPinned:au,onCloseWorkspaces:Gr,onArchiveSessions:ti,onUnarchiveSessions:b=>{M&&ne({type:"session.unarchive",workspaceId:M,sessionIds:b})},onSelectWorkspace:Yr,onSelectSession:Yi,onRenameSession:Xr,onOpenWorkspace:()=>ke(!0),onNewSession:af,onOpenExtensions:N?()=>Oa("mcp"):null,account:kn,onOpenAccount:su,relay:d,onOpenRelay:x?null:()=>m(!0),onOpenSettings:iu,themeMode:xe,onCycleTheme:Be}),fs("sidebar"),ae&&r.jsx("div",{className:"scrim",onClick:()=>me(!1)}),r.jsx(k1,{open:nn,tree:ft,expanded:new Set(wa),activePath:Pl,dirty:Il,gitChanges:(Rt==null?void 0:Rt.changed)??[],result:Vs,searchResult:Br,onSearch:Pn,onReveal:Jr,onToggle:ff,onOpen:Fr,onCreate:Da,onRename:us,onMove:Pr,onCopy:gu,onDelete:pn,onRefresh:()=>{Cn(null),Xn({}),si()},onClose:()=>ln(!1),zoomed:gt==="files",onToggleZoom:Gl("files")}),nn&&gt!=="files"&&fs("files"),r.jsx(D1,{open:bl,result:na,onSearch:ii,onOpenMatch:pu,onClose:()=>Bl(!1),zoomed:gt==="search",onToggleZoom:Gl("search")}),bl&&gt!=="search"&&fs("search"),r.jsx(jj,{open:Nn,state:Rt,result:Kl,selected:Gs,busy:ll,onRefresh:si,onShow:cu,onCheckout:$r,onPush:Zr,onPull:uu,onPublish:ou,onConnectRemote:cf,onDismissResult:()=>hn(null),onClose:()=>wn(!1),zoomed:gt==="git",onToggleZoom:Gl("git")}),Nn&&gt!=="git"&&fs("git"),r.jsxs("main",{className:gt==="main"||gt==="terminal"?"main main--zoomed":"main",children:[r.jsxs("header",{className:"topbar",children:[r.jsx("button",{className:"btn btn--ghost menu-btn",onClick:()=>me(!0),children:"☰"}),r.jsx("button",{className:nn?"pane-btn is-on":"pane-btn",title:"Файлы проекта","aria-label":"Файлы проекта","aria-pressed":nn,onClick:()=>{ln(b=>!b),wn(!1),Bl(!1)},children:r.jsx(Qk,{})}),r.jsx("button",{className:bl?"pane-btn is-on":"pane-btn",title:"Поиск по тексту в проекте","aria-label":"Поиск по тексту в проекте","aria-pressed":bl,onClick:()=>{Bl(b=>!b),ln(!1),wn(!1)},children:r.jsx(Zk,{})}),r.jsx("button",{className:Nn?"pane-btn is-on":"pane-btn",title:"История git","aria-label":"История git","aria-pressed":Nn,onClick:()=>{wn(b=>!b),ln(!1),Bl(!1)},children:r.jsx(Kk,{})}),aa&&r.jsx("button",{className:ve?"pane-btn is-on":"pane-btn",title:"Терминал (Ctrl+`)","aria-label":"Терминал","aria-pressed":ve,onClick:()=>Re(b=>!b),children:r.jsx(Fk,{})}),U&&Ua,U&&r.jsx("button",{className:re?"pane-btn is-on":"pane-btn",title:"Ещё","aria-label":"Ещё","aria-haspopup":"menu","aria-pressed":re,onClick:()=>se(!0),children:r.jsx(Pk,{})}),r.jsxs("div",{className:"topbar__id",children:[Te&&Se?r.jsx(Kc,{className:"rename--title",value:Se.title??"",onCommit:b=>{Xr(Se,b),be(!1)},onCancel:()=>be(!1)}):r.jsxs("div",{className:"topbar__head",children:[r.jsx("button",{className:"topbar__title",disabled:!Se||U,title:Se&&!U?"Переименовать сессию":void 0,onClick:()=>be(!0),children:(Se==null?void 0:Se.title)??"Claude Code Visual"}),rs&&r.jsx("span",{className:"topbar__project",title:rs.path,children:rs.name})]}),U?tc:os&&r.jsx(py,{path:os})]}),!U&&r.jsxs("div",{className:"topbar__tools",children:[r.jsx("button",{type:"button",className:O?"meters-refresh is-busy":"meters-refresh",title:Fo,"aria-label":"Обновить лимиты и контекст","aria-busy":O,disabled:!N||O,onClick:is,children:r.jsx(eN,{})}),r.jsx(by,{usage:tn}),r.jsx(vy,{}),ca,Qi,tc,ua&&r.jsx("span",{className:"badge badge--cost",children:ua}),Ua]})]}),r.jsx(Hk,{tokens:(Y==null?void 0:Y.tokens)??V.contextTokens,maxTokens:(Y==null?void 0:Y.maxTokens)??null,fetchedAt:(Y==null?void 0:Y.fetchedAt)??null}),U&&re&&r.jsx(Pj,{onClose:()=>se(!1),permission:ca,model:Qi,usage:tn,cwd:os,costLabel:ua,onRefresh:is,refreshing:O,metersFetchedAt:Ir,onRename:Se?()=>{be(!0),se(!1)}:null}),$n.length>0&&r.jsx(G1,{files:$n,activePath:Pl,busy:Rn,onSelect:Wn,onClose:b=>ra(b),zoomed:gt==="main",onToggleZoom:Gl("main")}),ui?r.jsx(q1,{file:ui,goto:(de==null?void 0:de.path)===ui.path?de:null,onChange:(b,q)=>{al(fe=>fe.map(De=>De.path===b?{...De,text:q}:De)),mu(b)},onSave:b=>cs(b),onReload:ri,onOverwrite:b=>cs(b,!0),onTogglePreview:b=>al(q=>q.map(fe=>fe.path===b?{...fe,previewMode:!fe.previewMode}:fe))}):r.jsxs(r.Fragment,{children:[r.jsx(Fh,{items:V.items,busy:Rn&&!Xt,waiting:La,history:Wo,historyHasMore:ib(oe),historyLoading:oe.loading,onLoadHistory:nu,sessionId:N??void 0,onEditMessage:(b,q,fe)=>{N&&ne({type:"prompt.edit",sessionId:N,userIndex:b,text:q,images:fe})}}),rl,r.jsx(dy,{disabled:!N,busy:Rn&&!Xt,placeholder:Xt?"Промпт уйдёт, как только связь вернётся":void 0,commands:Xi,sessionTitle:(Se==null?void 0:Se.title)??null,contextResult:du,draftKey:N,onContextSearch:b=>Kr("mention",b),onCommand:il,onSend:(b,q)=>{N&&ne({type:"prompt.send",sessionId:N,text:b,images:q})},onInterrupt:()=>{N&&ne({type:"control.interrupt",sessionId:N})}})]}),ve&&aa&&r.jsxs(r.Fragment,{children:[!U&&gt!=="terminal"&&r.jsx(Ek,{height:Yt.height,onResize:Yt.setHeight,onReset:Yt.reset}),r.jsx(Mk,{mobile:U,zoomed:gt==="terminal",onToggleZoom:Gl("terminal"),terminals:Oe,activeId:mn,blocked:ts,error:Mt,onDismissError:()=>gn(null),height:U?la.height:Yt.height,offset:U?{top:la.offsetTop,left:la.offsetLeft}:void 0,onSelect:an,onOpen:xu,onClose:yu,onInput:(b,q)=>ne({type:"term.input",id:b,data:q}),onResize:(b,q,fe)=>ne({type:"term.resize",id:b,cols:q,rows:fe}),onAttach:b=>ne({type:"term.attach",id:b}),onHide:()=>Re(!1),registerSink:$s})]})]}),r.jsx(Xj,{open:Un,items:qi.items,busy:el,ready:N!==null,commands:Xi,contextResult:hu,draftKey:N,models:Su.rows,model:Su.selected,effort:Cl.effort,ultracode:Cl.ultracode,thinking:Cl.thinking,switchOnFlag:Cl.switchOnFlag,onContextSearch:b=>Kr("side",b),onCommand:il,onModel:b=>{b&&(ia(q=>({...q,model:b})),ai(q=>ne({type:"control.set_model",sessionId:q,model:b})))},onEffort:b=>{ia(q=>({...q,effort:b,ultracode:!1})),ai(q=>ne({type:"control.set_effort",sessionId:q,effort:b}))},onUltracode:b=>{ia(q=>({...q,ultracode:b,...b?{effort:"xhigh"}:{}})),ai(q=>ne({type:"control.set_ultracode",sessionId:q,enabled:b}))},onThinking:b=>{ia(q=>({...q,thinking:b})),ai(q=>ne({type:"control.set_thinking",sessionId:q,enabled:b}))},onSwitchOnFlag:b=>{ia(q=>({...q,switchOnFlag:b})),ai(q=>ne({type:"control.set_flag_switch",sessionId:q,enabled:b}))},onAsk:ni,onInterrupt:()=>{ns&&ne({type:"control.interrupt",sessionId:ns})},onReset:li,onClose:()=>Qs(!1),zoomed:gt==="ask",onToggleZoom:Gl("ask")}),Un&&gt!=="ask"&&fs("ask"),(Nn||Un||nn||bl)&&r.jsx("div",{className:"scrim scrim--pane",onClick:()=>{wn(!1),Qs(!1),ln(!1),Bl(!1)}}),Sa&&r.jsx(wj,{detail:Sa,local:((Rt==null?void 0:Rt.hasRemote)??!1)&&(Rt==null?void 0:Rt.commits.some(b=>b.hash===Sa.hash&&!b.pushed))===!0,onCheckout:$r,onClose:()=>{ja(null),Hl(null)}}),ka&&r.jsxs(Nl,{title:"Переключить рабочее дерево?",onClose:()=>ml(null),actions:r.jsxs(r.Fragment,{children:[r.jsx("button",{className:"btn",onClick:()=>ml(null),children:"Отмена"}),r.jsx("button",{className:"btn btn--warn",onClick:Qr,children:"Переключиться"})]}),children:[r.jsxs("p",{className:"modal__text",children:["git переключится на ",ka.label,". Файлы в каталоге проекта изменятся — это тот же каталог, в котором работает агент."]}),Rn&&r.jsx("p",{className:"modal__text",children:"Сейчас идёт ход агента: он читает и правит файлы прямо сейчас."}),Rt&&Rt.changed.length>0&&r.jsxs("p",{className:"modal__text",children:["Незакоммиченных изменений: ",Rt.changed.length,". Git откажется переключаться, если они будут затёрты."]})]}),Xs&&r.jsx(Hj,{status:Ke,owners:Ys,files:Fl,defaultName:(rs==null?void 0:rs.name)??"",hasCommits:Rt===null||Rt.head!=="",busy:ll,result:Kl,onRefreshStatus:of,onSaveToken:uf,onPublish:fu,onDismissResult:()=>hn(null),onClose:()=>Jl(!1)}),Wl&&r.jsx(Yj,{busy:ll,result:Kl,onSubmit:rf,onDismissResult:()=>hn(null),onClose:()=>gl(!1)}),zn&&r.jsx(Nl,{title:zn.kind==="dir"?"Удалить каталог?":"Удалить файл?",onClose:()=>pn(null),actions:r.jsxs(r.Fragment,{children:[r.jsx("button",{className:"btn",onClick:()=>pn(null),children:"Отмена"}),r.jsx("button",{className:"btn btn--warn",onClick:()=>za(zn),children:"Удалить"})]}),children:r.jsxs("p",{className:"modal__text",children:[zn.path," будет удалён с диска",zn.kind==="dir"?" вместе со всем содержимым":"",". Корзины здесь нет: это тот же каталог, в котором работает агент."]})}),yt&&r.jsx(Nl,{title:"Закрыть без сохранения?",onClose:()=>Ta(null),actions:r.jsxs(r.Fragment,{children:[r.jsx("button",{className:"btn",onClick:()=>Ta(null),children:"Отмена"}),r.jsx("button",{className:"btn btn--warn",onClick:()=>ra(yt,!0),children:"Закрыть"}),r.jsx("button",{className:"btn btn--primary",onClick:()=>{cs(yt),ra(yt,!0)},children:"Сохранить и закрыть"})]}),children:r.jsxs("p",{className:"modal__text",children:["В ",yt," есть несохранённые правки."]})}),Fe&&r.jsx(tk,{tab:Fe,servers:Jn,plugins:qt,marketplaces:It,catalog:Qt,result:wt,actions:sf,onTab:it,onClose:()=>it(null)}),En&&r.jsx(uk,{status:kn,login:dn,actions:Vr,remote:x,runningSessions:v.filter(b=>b.state==="running"||b.state==="waiting_permission").length,onReconnect:N?()=>{Zi(),Ct(!1)}:null,reconnectBlocked:Rn,reconnectHint:ju,onClose:()=>Ct(!1)}),p&&r.jsx(pk,{state:d,onPair:(b,q)=>ne({type:"relay.pair",code:b,...q?{name:q}:{}}),onUnpair:()=>ne({type:"relay.unpair"}),onClose:()=>m(!1)}),Jt&&r.jsx(kk,{settings:Dt,models:(z==null?void 0:z.models)??[],relayState:d,local:Do()==="local",onChange:ru,onEnableShell:()=>ne({type:"relay.shell.enable"}),onDisableShell:()=>ne({type:"relay.shell.disable"}),onOpenRelay:()=>{Tt(!1),m(!0)},onClose:()=>Tt(!1)}),pe&&r.jsx(dj,{candidates:k,searching:ce,agentItems:Ne.items,agentBusy:(Ae==null?void 0:Ae.state)==="running",error:Qe,roots:qe,created:et,onSearch:tf,onAskAgent:nf,onInterrupt:()=>{const b=ss.current;b&&ne({type:"control.interrupt",sessionId:b})},onSubmit:Po,onCreate:ef,onClose:lf}),Hn!=null&&Hn.questions&&Hn.questions.length>0?r.jsx(ej,{request:{...Hn,questions:Hn.questions},queued:V.pending.length-1,onAnswer:hf,onDecline:pf}):Hn&&ci!==null?r.jsx(lj,{request:Hn,plan:ci,queued:V.pending.length-1,onAccept:_u,onDecline:vu}):Hn&&r.jsx(PS,{request:Hn,queued:V.pending.length-1,onDecide:df})]})}function Qk(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.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"}),r.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 Zk(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[r.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),r.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}function Kk(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[r.jsx("circle",{cx:"4.5",cy:"3.5",r:"1.9"}),r.jsx("circle",{cx:"4.5",cy:"12.5",r:"1.9"}),r.jsx("circle",{cx:"11.5",cy:"8",r:"1.9"}),r.jsx("path",{d:"M4.5 5.4v5.2M6.4 3.9h2.2a1.6 1.6 0 0 1 1.6 1.6v.8"})]})}function Jk(a,l){return Nx(a)===Nx(l)}function Nx(a){return a.replace(/[\\/]+/g,"/").replace(/\/+$/,"").toLowerCase()}function Fk(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("rect",{x:"1.6",y:"2.6",width:"12.8",height:"10.8",rx:"1.7"}),r.jsx("path",{d:"M4.3 6 6.6 8l-2.3 2"}),r.jsx("path",{d:"M8.2 10h3.1"})]})}function Wk(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.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"}),r.jsx("path",{d:"M8.4 8.5v-.3c0-.7.9-.9.9-1.7a1 1 0 0 0-1.9-.4"})]})}function Pk(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:[r.jsx("circle",{cx:"3.2",cy:"8",r:"1.5"}),r.jsx("circle",{cx:"8",cy:"8",r:"1.5"}),r.jsx("circle",{cx:"12.8",cy:"8",r:"1.5"})]})}function eN(){return r.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[r.jsx("path",{d:"M14 8a6 6 0 1 1-6-6c1.68 0 3.29.67 4.49 1.83L14 5.33"}),r.jsx("path",{d:"M14 2v3.33h-3.33"})]})}const jy=document.getElementById("root");if(!jy)throw new Error("#root not found");F_.createRoot(jy).render(r.jsx(_.StrictMode,{children:r.jsx($k,{})}));export{Gv as D,Lt as I,Ht as N,lN as P,Ll as T,Zl as a,Kx as b,pl as c,nN as d,ey as e,Qc as f,r1 as h,aN as p,sN as s,je as t};