@i14ks/ccv 0.3.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/ccv.mjs +72 -0
- package/package.json +1 -1
- package/web/assets/{codemirror-DNwOY4Od.js → codemirror-ixGO-cbX.js} +1 -1
- package/web/assets/{index-Cvz4rtnD.js → index-BuniMO1x.js} +1 -1
- package/web/assets/{index-Bh-gxu6Z.js → index-Byl4r_xt.js} +1 -1
- package/web/assets/{index-Cfccn-Ob.js → index-CELwK_ze.js} +1 -1
- package/web/assets/index-CQJq2xwX.css +1 -0
- package/web/assets/{index-6JwHpeCk.js → index-CXiddYxZ.js} +1 -1
- package/web/assets/{index-CKclwUJ-.js → index-CbrZsnLR.js} +1 -1
- package/web/assets/{index-DB9ZVtJ8.js → index-CtUwaQ4R.js} +1 -1
- package/web/assets/{index-9FstbMxt.js → index-CzWhd9WN.js} +1 -1
- package/web/assets/{index-BvcLb1wh.js → index-D1EGRMsF.js} +1 -1
- package/web/assets/{index-CzlH_Mh9.js → index-D2QcAee0.js} +1 -1
- package/web/assets/{index-r40StboH.js → index-D3avVSzn.js} +1 -1
- package/web/assets/{index--X3c59oq.js → index-DAN-BZ4M.js} +1 -1
- package/web/assets/{index-1vcRYewd.js → index-DcGZZXlE.js} +1 -1
- package/web/assets/{index-Bj3bZRgw.js → index-DqcI6biV.js} +1 -1
- package/web/assets/{index-9FU2NRHn.js → index-EHaCUl16.js} +1 -1
- package/web/assets/{index-BFoyQq0x.js → index-EaPgYsZb.js} +1 -1
- package/web/assets/{index-DtcfXsIX.js → index-GQ3tJswl.js} +1 -1
- package/web/assets/index-VtR2fk7J.js +128 -0
- package/web/assets/{index-C9MQTTvT.js → index-_Y-EJULt.js} +1 -1
- package/web/assets/{index-AptXdWK3.js → index-jausLDAl.js} +1 -1
- package/web/assets/{index-BFn7R550.js → index-u0GQ-BLb.js} +1 -1
- package/web/index.html +2 -2
- package/web/assets/index-D9UhxKGI.js +0 -126
- package/web/assets/index-DmJcZf8t.css +0 -1
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-EHaCUl16.js","./index-jausLDAl.js","./index-EaPgYsZb.js","./index-BHot-lnj.js","./index-891wE-Rj.js","./index-CELwK_ze.js","./index-_Y-EJULt.js","./index-BuniMO1x.js","./index-CXiddYxZ.js","./index-D2QcAee0.js","./index-GQ3tJswl.js","./index-D3avVSzn.js","./index-D1EGRMsF.js","./index-u0GQ-BLb.js","./index-DcGZZXlE.js","./index-DAN-BZ4M.js","./index-CtUwaQ4R.js","./index-CbrZsnLR.js","./index-CzWhd9WN.js","./index-DqcI6biV.js","./index-Byl4r_xt.js","./codemirror-ixGO-cbX.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 wx=Object.defineProperty;var qg=s=>{throw TypeError(s)};var Tx=(s,l,i)=>l in s?wx(s,l,{enumerable:!0,configurable:!0,writable:!0,value:i}):s[l]=i;var kt=(s,l,i)=>Tx(s,typeof l!="symbol"?l+"":l,i),zd=(s,l,i)=>l.has(s)||qg("Cannot "+i);var He=(s,l,i)=>(zd(s,l,"read from private field"),i?i.call(s):l.get(s)),It=(s,l,i)=>l.has(s)?qg("Cannot add the same private member more than once"):l instanceof WeakSet?l.add(s):l.set(s,i),ft=(s,l,i,r)=>(zd(s,l,"write to private field"),r?r.call(s,i):l.set(s,i),i),rn=(s,l,i)=>(zd(s,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"]'))r(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"&&r(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 r(o){if(o.ep)return;o.ep=!0;const d=i(o);fetch(o.href,d)}})();var Ld={exports:{}},xc={};/**
|
|
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 Gg;function Nx(){if(Gg)return xc;Gg=1;var s=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function i(r,o,d){var h=null;if(d!==void 0&&(h=""+d),o.key!==void 0&&(h=""+o.key),"key"in o){d={};for(var g in o)g!=="key"&&(d[g]=o[g])}else d=o;return o=d.ref,{$$typeof:s,type:r,key:h,ref:o!==void 0?o:null,props:d}}return xc.Fragment=l,xc.jsx=i,xc.jsxs=i,xc}var Yg;function jx(){return Yg||(Yg=1,Ld.exports=Nx()),Ld.exports}var c=jx(),Ud={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 Ig;function Ex(){if(Ig)return Ye;Ig=1;var s=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),h=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),b=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),k=Symbol.for("react.activity"),_=Symbol.iterator;function A(N){return N===null||typeof N!="object"?null:(N=_&&N[_]||N["@@iterator"],typeof N=="function"?N:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},L=Object.assign,O={};function F(N,I,ie){this.props=N,this.context=I,this.refs=O,this.updater=ie||T}F.prototype.isReactComponent={},F.prototype.setState=function(N,I){if(typeof N!="object"&&typeof N!="function"&&N!=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,N,I,"setState")},F.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function q(){}q.prototype=F.prototype;function Q(N,I,ie){this.props=N,this.context=I,this.refs=O,this.updater=ie||T}var E=Q.prototype=new q;E.constructor=Q,L(E,F.prototype),E.isPureReactComponent=!0;var V=Array.isArray;function D(){}var R={H:null,A:null,T:null,S:null},Z=Object.prototype.hasOwnProperty;function ce(N,I,ie){var re=ie.ref;return{$$typeof:s,type:N,key:I,ref:re!==void 0?re:null,props:ie}}function de(N,I){return ce(N.type,I,N.props)}function K(N){return typeof N=="object"&&N!==null&&N.$$typeof===s}function le(N){var I={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(ie){return I[ie]})}var me=/\/+/g;function Ae(N,I){return typeof N=="object"&&N!==null&&N.key!=null?le(""+N.key):I.toString(36)}function ve(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(D,D):(N.status="pending",N.then(function(I){N.status==="pending"&&(N.status="fulfilled",N.value=I)},function(I){N.status==="pending"&&(N.status="rejected",N.reason=I)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function z(N,I,ie,re,_e){var Te=typeof N;(Te==="undefined"||Te==="boolean")&&(N=null);var Me=!1;if(N===null)Me=!0;else switch(Te){case"bigint":case"string":case"number":Me=!0;break;case"object":switch(N.$$typeof){case s:case l:Me=!0;break;case x:return Me=N._init,z(Me(N._payload),I,ie,re,_e)}}if(Me)return _e=_e(N),Me=re===""?"."+Ae(N,0):re,V(_e)?(ie="",Me!=null&&(ie=Me.replace(me,"$&/")+"/"),z(_e,I,ie,"",function(at){return at})):_e!=null&&(K(_e)&&(_e=de(_e,ie+(_e.key==null||N&&N.key===_e.key?"":(""+_e.key).replace(me,"$&/")+"/")+Me)),I.push(_e)),1;Me=0;var et=re===""?".":re+":";if(V(N))for(var Ze=0;Ze<N.length;Ze++)re=N[Ze],Te=et+Ae(re,Ze),Me+=z(re,I,ie,Te,_e);else if(Ze=A(N),typeof Ze=="function")for(N=Ze.call(N),Ze=0;!(re=N.next()).done;)re=re.value,Te=et+Ae(re,Ze++),Me+=z(re,I,ie,Te,_e);else if(Te==="object"){if(typeof N.then=="function")return z(ve(N),I,ie,re,_e);throw I=String(N),Error("Objects are not valid as a React child (found: "+(I==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":I)+"). If you meant to render a collection of children, use an array instead.")}return Me}function ee(N,I,ie){if(N==null)return N;var re=[],_e=0;return z(N,re,"","",function(Te){return I.call(ie,Te,_e++)}),re}function P(N){if(N._status===-1){var I=N._result;I=I(),I.then(function(ie){(N._status===0||N._status===-1)&&(N._status=1,N._result=ie)},function(ie){(N._status===0||N._status===-1)&&(N._status=2,N._result=ie)}),N._status===-1&&(N._status=0,N._result=I)}if(N._status===1)return N._result.default;throw N._result}var xe=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var I=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof N=="object"&&N!==null&&typeof N.message=="string"?String(N.message):String(N),error:N});if(!window.dispatchEvent(I))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)},Ne={map:ee,forEach:function(N,I,ie){ee(N,function(){I.apply(this,arguments)},ie)},count:function(N){var I=0;return ee(N,function(){I++}),I},toArray:function(N){return ee(N,function(I){return I})||[]},only:function(N){if(!K(N))throw Error("React.Children.only expected to receive a single React element child.");return N}};return Ye.Activity=k,Ye.Children=Ne,Ye.Component=F,Ye.Fragment=i,Ye.Profiler=o,Ye.PureComponent=Q,Ye.StrictMode=r,Ye.Suspense=m,Ye.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=R,Ye.__COMPILER_RUNTIME={__proto__:null,c:function(N){return R.H.useMemoCache(N)}},Ye.cache=function(N){return function(){return N.apply(null,arguments)}},Ye.cacheSignal=function(){return null},Ye.cloneElement=function(N,I,ie){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var re=L({},N.props),_e=N.key;if(I!=null)for(Te in I.key!==void 0&&(_e=""+I.key),I)!Z.call(I,Te)||Te==="key"||Te==="__self"||Te==="__source"||Te==="ref"&&I.ref===void 0||(re[Te]=I[Te]);var Te=arguments.length-2;if(Te===1)re.children=ie;else if(1<Te){for(var Me=Array(Te),et=0;et<Te;et++)Me[et]=arguments[et+2];re.children=Me}return ce(N.type,_e,re)},Ye.createContext=function(N){return N={$$typeof:h,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:d,_context:N},N},Ye.createElement=function(N,I,ie){var re,_e={},Te=null;if(I!=null)for(re in I.key!==void 0&&(Te=""+I.key),I)Z.call(I,re)&&re!=="key"&&re!=="__self"&&re!=="__source"&&(_e[re]=I[re]);var Me=arguments.length-2;if(Me===1)_e.children=ie;else if(1<Me){for(var et=Array(Me),Ze=0;Ze<Me;Ze++)et[Ze]=arguments[Ze+2];_e.children=et}if(N&&N.defaultProps)for(re in Me=N.defaultProps,Me)_e[re]===void 0&&(_e[re]=Me[re]);return ce(N,Te,_e)},Ye.createRef=function(){return{current:null}},Ye.forwardRef=function(N){return{$$typeof:g,render:N}},Ye.isValidElement=K,Ye.lazy=function(N){return{$$typeof:x,_payload:{_status:-1,_result:N},_init:P}},Ye.memo=function(N,I){return{$$typeof:b,type:N,compare:I===void 0?null:I}},Ye.startTransition=function(N){var I=R.T,ie={};R.T=ie;try{var re=N(),_e=R.S;_e!==null&&_e(ie,re),typeof re=="object"&&re!==null&&typeof re.then=="function"&&re.then(D,xe)}catch(Te){xe(Te)}finally{I!==null&&ie.types!==null&&(I.types=ie.types),R.T=I}},Ye.unstable_useCacheRefresh=function(){return R.H.useCacheRefresh()},Ye.use=function(N){return R.H.use(N)},Ye.useActionState=function(N,I,ie){return R.H.useActionState(N,I,ie)},Ye.useCallback=function(N,I){return R.H.useCallback(N,I)},Ye.useContext=function(N){return R.H.useContext(N)},Ye.useDebugValue=function(){},Ye.useDeferredValue=function(N,I){return R.H.useDeferredValue(N,I)},Ye.useEffect=function(N,I){return R.H.useEffect(N,I)},Ye.useEffectEvent=function(N){return R.H.useEffectEvent(N)},Ye.useId=function(){return R.H.useId()},Ye.useImperativeHandle=function(N,I,ie){return R.H.useImperativeHandle(N,I,ie)},Ye.useInsertionEffect=function(N,I){return R.H.useInsertionEffect(N,I)},Ye.useLayoutEffect=function(N,I){return R.H.useLayoutEffect(N,I)},Ye.useMemo=function(N,I){return R.H.useMemo(N,I)},Ye.useOptimistic=function(N,I){return R.H.useOptimistic(N,I)},Ye.useReducer=function(N,I,ie){return R.H.useReducer(N,I,ie)},Ye.useRef=function(N){return R.H.useRef(N)},Ye.useState=function(N){return R.H.useState(N)},Ye.useSyncExternalStore=function(N,I,ie){return R.H.useSyncExternalStore(N,I,ie)},Ye.useTransition=function(){return R.H.useTransition()},Ye.version="19.2.8",Ye}var Xg;function _h(){return Xg||(Xg=1,Ud.exports=Ex()),Ud.exports}var S=_h(),Hd={exports:{}},_c={},Bd={exports:{}},qd={};/**
|
|
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 Vg;function Ax(){return Vg||(Vg=1,(function(s){function l(z,ee){var P=z.length;z.push(ee);e:for(;0<P;){var xe=P-1>>>1,Ne=z[xe];if(0<o(Ne,ee))z[xe]=ee,z[P]=Ne,P=xe;else break e}}function i(z){return z.length===0?null:z[0]}function r(z){if(z.length===0)return null;var ee=z[0],P=z.pop();if(P!==ee){z[0]=P;e:for(var xe=0,Ne=z.length,N=Ne>>>1;xe<N;){var I=2*(xe+1)-1,ie=z[I],re=I+1,_e=z[re];if(0>o(ie,P))re<Ne&&0>o(_e,ie)?(z[xe]=_e,z[re]=P,xe=re):(z[xe]=ie,z[I]=P,xe=I);else if(re<Ne&&0>o(_e,P))z[xe]=_e,z[re]=P,xe=re;else break e}}return ee}function o(z,ee){var P=z.sortIndex-ee.sortIndex;return P!==0?P:z.id-ee.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;s.unstable_now=function(){return d.now()}}else{var h=Date,g=h.now();s.unstable_now=function(){return h.now()-g}}var m=[],b=[],x=1,k=null,_=3,A=!1,T=!1,L=!1,O=!1,F=typeof setTimeout=="function"?setTimeout:null,q=typeof clearTimeout=="function"?clearTimeout:null,Q=typeof setImmediate<"u"?setImmediate:null;function E(z){for(var ee=i(b);ee!==null;){if(ee.callback===null)r(b);else if(ee.startTime<=z)r(b),ee.sortIndex=ee.expirationTime,l(m,ee);else break;ee=i(b)}}function V(z){if(L=!1,E(z),!T)if(i(m)!==null)T=!0,D||(D=!0,le());else{var ee=i(b);ee!==null&&ve(V,ee.startTime-z)}}var D=!1,R=-1,Z=5,ce=-1;function de(){return O?!0:!(s.unstable_now()-ce<Z)}function K(){if(O=!1,D){var z=s.unstable_now();ce=z;var ee=!0;try{e:{T=!1,L&&(L=!1,q(R),R=-1),A=!0;var P=_;try{t:{for(E(z),k=i(m);k!==null&&!(k.expirationTime>z&&de());){var xe=k.callback;if(typeof xe=="function"){k.callback=null,_=k.priorityLevel;var Ne=xe(k.expirationTime<=z);if(z=s.unstable_now(),typeof Ne=="function"){k.callback=Ne,E(z),ee=!0;break t}k===i(m)&&r(m),E(z)}else r(m);k=i(m)}if(k!==null)ee=!0;else{var N=i(b);N!==null&&ve(V,N.startTime-z),ee=!1}}break e}finally{k=null,_=P,A=!1}ee=void 0}}finally{ee?le():D=!1}}}var le;if(typeof Q=="function")le=function(){Q(K)};else if(typeof MessageChannel<"u"){var me=new MessageChannel,Ae=me.port2;me.port1.onmessage=K,le=function(){Ae.postMessage(null)}}else le=function(){F(K,0)};function ve(z,ee){R=F(function(){z(s.unstable_now())},ee)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(z){z.callback=null},s.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Z=0<z?Math.floor(1e3/z):5},s.unstable_getCurrentPriorityLevel=function(){return _},s.unstable_next=function(z){switch(_){case 1:case 2:case 3:var ee=3;break;default:ee=_}var P=_;_=ee;try{return z()}finally{_=P}},s.unstable_requestPaint=function(){O=!0},s.unstable_runWithPriority=function(z,ee){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var P=_;_=z;try{return ee()}finally{_=P}},s.unstable_scheduleCallback=function(z,ee,P){var xe=s.unstable_now();switch(typeof P=="object"&&P!==null?(P=P.delay,P=typeof P=="number"&&0<P?xe+P:xe):P=xe,z){case 1:var Ne=-1;break;case 2:Ne=250;break;case 5:Ne=1073741823;break;case 4:Ne=1e4;break;default:Ne=5e3}return Ne=P+Ne,z={id:x++,callback:ee,priorityLevel:z,startTime:P,expirationTime:Ne,sortIndex:-1},P>xe?(z.sortIndex=P,l(b,z),i(m)===null&&z===i(b)&&(L?(q(R),R=-1):L=!0,ve(V,P-xe))):(z.sortIndex=Ne,l(m,z),T||A||(T=!0,D||(D=!0,le()))),z},s.unstable_shouldYield=de,s.unstable_wrapCallback=function(z){var ee=_;return function(){var P=_;_=ee;try{return z.apply(this,arguments)}finally{_=P}}}})(qd)),qd}var Qg;function Cx(){return Qg||(Qg=1,Bd.exports=Ax()),Bd.exports}var Gd={exports:{}},Dn={};/**
|
|
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 $g;function Rx(){if($g)return Dn;$g=1;var s=_h();function l(m){var b="https://react.dev/errors/"+m;if(1<arguments.length){b+="?args[]="+encodeURIComponent(arguments[1]);for(var x=2;x<arguments.length;x++)b+="&args[]="+encodeURIComponent(arguments[x])}return"Minified React error #"+m+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var r={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,b,x){var k=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:k==null?null:""+k,children:m,containerInfo:b,implementation:x}}var h=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function g(m,b){if(m==="font")return"";if(typeof b=="string")return b==="use-credentials"?b:""}return Dn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Dn.createPortal=function(m,b){var x=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!b||b.nodeType!==1&&b.nodeType!==9&&b.nodeType!==11)throw Error(l(299));return d(m,b,null,x)},Dn.flushSync=function(m){var b=h.T,x=r.p;try{if(h.T=null,r.p=2,m)return m()}finally{h.T=b,r.p=x,r.d.f()}},Dn.preconnect=function(m,b){typeof m=="string"&&(b?(b=b.crossOrigin,b=typeof b=="string"?b==="use-credentials"?b:"":void 0):b=null,r.d.C(m,b))},Dn.prefetchDNS=function(m){typeof m=="string"&&r.d.D(m)},Dn.preinit=function(m,b){if(typeof m=="string"&&b&&typeof b.as=="string"){var x=b.as,k=g(x,b.crossOrigin),_=typeof b.integrity=="string"?b.integrity:void 0,A=typeof b.fetchPriority=="string"?b.fetchPriority:void 0;x==="style"?r.d.S(m,typeof b.precedence=="string"?b.precedence:void 0,{crossOrigin:k,integrity:_,fetchPriority:A}):x==="script"&&r.d.X(m,{crossOrigin:k,integrity:_,fetchPriority:A,nonce:typeof b.nonce=="string"?b.nonce:void 0})}},Dn.preinitModule=function(m,b){if(typeof m=="string")if(typeof b=="object"&&b!==null){if(b.as==null||b.as==="script"){var x=g(b.as,b.crossOrigin);r.d.M(m,{crossOrigin:x,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0})}}else b==null&&r.d.M(m)},Dn.preload=function(m,b){if(typeof m=="string"&&typeof b=="object"&&b!==null&&typeof b.as=="string"){var x=b.as,k=g(x,b.crossOrigin);r.d.L(m,x,{crossOrigin:k,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0,type:typeof b.type=="string"?b.type:void 0,fetchPriority:typeof b.fetchPriority=="string"?b.fetchPriority:void 0,referrerPolicy:typeof b.referrerPolicy=="string"?b.referrerPolicy:void 0,imageSrcSet:typeof b.imageSrcSet=="string"?b.imageSrcSet:void 0,imageSizes:typeof b.imageSizes=="string"?b.imageSizes:void 0,media:typeof b.media=="string"?b.media:void 0})}},Dn.preloadModule=function(m,b){if(typeof m=="string")if(b){var x=g(b.as,b.crossOrigin);r.d.m(m,{as:typeof b.as=="string"&&b.as!=="script"?b.as:void 0,crossOrigin:x,integrity:typeof b.integrity=="string"?b.integrity:void 0})}else r.d.m(m)},Dn.requestFormReset=function(m){r.d.r(m)},Dn.unstable_batchedUpdates=function(m,b){return m(b)},Dn.useFormState=function(m,b,x){return h.H.useFormState(m,b,x)},Dn.useFormStatus=function(){return h.H.useHostTransitionStatus()},Dn.version="19.2.8",Dn}var Zg;function Mx(){if(Zg)return Gd.exports;Zg=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(l){console.error(l)}}return s(),Gd.exports=Rx(),Gd.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 Kg;function Ox(){if(Kg)return _c;Kg=1;var s=Cx(),l=_h(),i=Mx();function r(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 g(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(r(188))}function b(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(r(188));return t!==e?null:e}for(var n=e,a=t;;){var u=n.return;if(u===null)break;var f=u.alternate;if(f===null){if(a=u.return,a!==null){n=a;continue}break}if(u.child===f.child){for(f=u.child;f;){if(f===n)return m(u),e;if(f===a)return m(u),t;f=f.sibling}throw Error(r(188))}if(n.return!==a.return)n=u,a=f;else{for(var p=!1,v=u.child;v;){if(v===n){p=!0,n=u,a=f;break}if(v===a){p=!0,a=u,n=f;break}v=v.sibling}if(!p){for(v=f.child;v;){if(v===n){p=!0,n=f,a=u;break}if(v===a){p=!0,a=f,n=u;break}v=v.sibling}if(!p)throw Error(r(189))}}if(n.alternate!==a)throw Error(r(190))}if(n.tag!==3)throw Error(r(188));return n.stateNode.current===n?e:t}function x(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=x(e),t!==null)return t;e=e.sibling}return null}var k=Object.assign,_=Symbol.for("react.element"),A=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),L=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),F=Symbol.for("react.profiler"),q=Symbol.for("react.consumer"),Q=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),V=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),Z=Symbol.for("react.lazy"),ce=Symbol.for("react.activity"),de=Symbol.for("react.memo_cache_sentinel"),K=Symbol.iterator;function le(e){return e===null||typeof e!="object"?null:(e=K&&e[K]||e["@@iterator"],typeof e=="function"?e:null)}var me=Symbol.for("react.client.reference");function Ae(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 F:return"Profiler";case O:return"StrictMode";case V:return"Suspense";case D:return"SuspenseList";case ce:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case T:return"Portal";case Q:return e.displayName||"Context";case q:return(e._context.displayName||"Context")+".Consumer";case E:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case R:return t=e.displayName||null,t!==null?t:Ae(e.type)||"Memo";case Z:t=e._payload,e=e._init;try{return Ae(e(t))}catch{}}return null}var ve=Array.isArray,z=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P={pending:!1,data:null,method:null,action:null},xe=[],Ne=-1;function N(e){return{current:e}}function I(e){0>Ne||(e.current=xe[Ne],xe[Ne]=null,Ne--)}function ie(e,t){Ne++,xe[Ne]=e.current,e.current=t}var re=N(null),_e=N(null),Te=N(null),Me=N(null);function et(e,t){switch(ie(Te,t),ie(_e,e),ie(re,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?ug(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=ug(t),e=og(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}I(re),ie(re,e)}function Ze(){I(re),I(_e),I(Te)}function at(e){e.memoizedState!==null&&ie(Me,e);var t=re.current,n=og(t,e.type);t!==n&&(ie(_e,e),ie(re,n))}function qe(e){_e.current===e&&(I(re),I(_e)),Me.current===e&&(I(Me),mc._currentValue=P)}var Nt,$e;function oe(e){if(Nt===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Nt=t&&t[1]||"",$e=-1<n.stack.indexOf(`
|
|
43
|
+
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
44
|
+
`+Nt+e+$e}var ye=!1;function tt(e,t){if(!e||ye)return"";ye=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var ne=function(){throw Error()};if(Object.defineProperty(ne.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ne,[])}catch(X){var G=X}Reflect.construct(e,[],ne)}else{try{ne.call()}catch(X){G=X}e.call(ne.prototype)}}else{try{throw Error()}catch(X){G=X}(ne=e())&&typeof ne.catch=="function"&&ne.catch(function(){})}}catch(X){if(X&&G&&typeof X.stack=="string")return[X.stack,G.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=a.DetermineComponentFrameRoot(),p=f[0],v=f[1];if(p&&v){var j=p.split(`
|
|
45
|
+
`),B=v.split(`
|
|
46
|
+
`);for(u=a=0;a<j.length&&!j[a].includes("DetermineComponentFrameRoot");)a++;for(;u<B.length&&!B[u].includes("DetermineComponentFrameRoot");)u++;if(a===j.length||u===B.length)for(a=j.length-1,u=B.length-1;1<=a&&0<=u&&j[a]!==B[u];)u--;for(;1<=a&&0<=u;a--,u--)if(j[a]!==B[u]){if(a!==1||u!==1)do if(a--,u--,0>u||j[a]!==B[u]){var W=`
|
|
47
|
+
`+j[a].replace(" at new "," at ");return e.displayName&&W.includes("<anonymous>")&&(W=W.replace("<anonymous>",e.displayName)),W}while(1<=a&&0<=u);break}}}finally{ye=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?oe(n):""}function Ft(e,t){switch(e.tag){case 26:case 27:case 5:return oe(e.type);case 16:return oe("Lazy");case 13:return e.child!==t&&t!==null?oe("Suspense Fallback"):oe("Suspense");case 19:return oe("SuspenseList");case 0:case 15:return tt(e.type,!1);case 11:return tt(e.type.render,!1);case 1:return tt(e.type,!0);case 31:return oe("Activity");default:return""}}function Ue(e){try{var t="",n=null;do t+=Ft(e,n),n=e,e=e.return;while(e);return t}catch(a){return`
|
|
48
|
+
Error generating stack: `+a.message+`
|
|
49
|
+
`+a.stack}}var un=Object.prototype.hasOwnProperty,mn=s.unstable_scheduleCallback,Sn=s.unstable_cancelCallback,Qn=s.unstable_shouldYield,kn=s.unstable_requestPaint,bt=s.unstable_now,Cn=s.unstable_getCurrentPriorityLevel,J=s.unstable_ImmediatePriority,fe=s.unstable_UserBlockingPriority,Re=s.unstable_NormalPriority,Ke=s.unstable_LowPriority,Lt=s.unstable_IdlePriority,Wt=s.log,Un=s.unstable_setDisableYieldValue,sl=null,Xt=null;function Hn(e){if(typeof Wt=="function"&&Un(e),Xt&&typeof Xt.setStrictMode=="function")try{Xt.setStrictMode(sl,e)}catch{}}var jt=Math.clz32?Math.clz32:he,Rn=Math.log,$=Math.LN2;function he(e){return e>>>=0,e===0?32:31-(Rn(e)/$|0)|0}var rt=256,ht=262144,gn=4194304;function il(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 va(e,t,n){var a=e.pendingLanes;if(a===0)return 0;var u=0,f=e.suspendedLanes,p=e.pingedLanes;e=e.warmLanes;var v=a&134217727;return v!==0?(a=v&~f,a!==0?u=il(a):(p&=v,p!==0?u=il(p):n||(n=v&~e,n!==0&&(u=il(n))))):(v=a&~f,v!==0?u=il(v):p!==0?u=il(p):n||(n=a&~e,n!==0&&(u=il(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 Bn(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function $n(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 on(){var e=gn;return gn<<=1,(gn&62914560)===0&&(gn=4194304),e}function Ut(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function vl(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Sa(e,t,n,a,u,f){var p=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 v=e.entanglements,j=e.expirationTimes,B=e.hiddenUpdates;for(n=p&~n;0<n;){var W=31-jt(n),ne=1<<W;v[W]=0,j[W]=-1;var G=B[W];if(G!==null)for(B[W]=null,W=0;W<G.length;W++){var X=G[W];X!==null&&(X.lane&=-536870913)}n&=~ne}a!==0&&ka(e,a,0),f!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=f&~(p&~t))}function ka(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-jt(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|n&261930}function Us(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var a=31-jt(n),u=1<<a;u&t|e[a]&t&&(e[a]|=t),n&=~u}}function zl(e,t){var n=t&-t;return n=(n&42)!==0?1:Ka(n),(n&(e.suspendedLanes|t))!==0?0:n}function Ka(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 Ll(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function wa(){var e=ee.p;return e!==0?e:(e=window.event,e===void 0?32:Og(e.type))}function rl(e,t){var n=ee.p;try{return ee.p=e,t()}finally{ee.p=n}}var Vt=Math.random().toString(36).slice(2),Et="__reactFiber$"+Vt,Be="__reactProps$"+Vt,fn="__reactContainer$"+Vt,Kl="__reactEvents$"+Vt,Ta="__reactListeners$"+Vt,Ul="__reactHandles$"+Vt,qn="__reactResources$"+Vt,cl="__reactMarker$"+Vt;function ul(e){delete e[Et],delete e[Be],delete e[Kl],delete e[Ta],delete e[Ul]}function Jl(e){var t=e[Et];if(t)return t;for(var n=e.parentNode;n;){if(t=n[fn]||n[Et]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=yg(e);e!==null;){if(n=e[Et])return n;e=yg(e)}return t}e=n,n=e.parentNode}return null}function Mn(e){if(e=e[Et]||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 ol(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(r(33))}function Pt(e){var t=e[qn];return t||(t=e[qn]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function pt(e){e[cl]=!0}var Gn=new Set,vi={};function Yn(e,t){fl(e,t),fl(e+"Capture",t)}function fl(e,t){for(vi[e]=t,e=0;e<t.length;e++)Gn.add(t[e])}var Hs=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]*$"),Fl={},Wl={};function Hl(e){return un.call(Wl,e)?!0:un.call(Fl,e)?!1:Hs.test(e)?Wl[e]=!0:(Fl[e]=!0,!1)}function In(e,t,n){if(Hl(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function dl(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 dn(e,t,n,a){if(a===null)e.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+a)}}function xt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ja(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Si(e,t,n){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var u=a.get,f=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(p){n=""+p,f.call(this,p)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return n},setValue:function(p){n=""+p},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Bl(e){if(!e._valueTracker){var t=Ja(e)?"checked":"value";e._valueTracker=Si(e,t,""+e[t])}}function Pl(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),a="";return e&&(a=Ja(e)?e.checked?"true":"false":e.value),e=a,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 Na=/[\n"\\]/g;function en(e){return e.replace(Na,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Bs(e,t,n,a,u,f,p,v){e.name="",p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"?e.type=p:e.removeAttribute("type"),t!=null?p==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+xt(t)):e.value!==""+xt(t)&&(e.value=""+xt(t)):p!=="submit"&&p!=="reset"||e.removeAttribute("value"),t!=null?hl(e,p,xt(t)):n!=null?hl(e,p,xt(n)):a!=null&&e.removeAttribute("value"),u==null&&f!=null&&(e.defaultChecked=!!f),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?e.name=""+xt(v):e.removeAttribute("name")}function ta(e,t,n,a,u,f,p,v){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)){Bl(e);return}n=n!=null?""+xt(n):"",t=t!=null?""+xt(t):n,v||t===e.value||(e.value=t),e.defaultValue=t}a=a??u,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=v?e.checked:!!a,e.defaultChecked=!!a,p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(e.name=p),Bl(e)}function hl(e,t,n){t==="number"&&ea(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Zn(e,t,n,a){if(e=e.options,t){t={};for(var u=0;u<n.length;u++)t["$"+n[u]]=!0;for(n=0;n<e.length;n++)u=t.hasOwnProperty("$"+e[n].value),e[n].selected!==u&&(e[n].selected=u),u&&a&&(e[n].defaultSelected=!0)}else{for(n=""+xt(n),t=null,u=0;u<e.length;u++){if(e[u].value===n){e[u].selected=!0,a&&(e[u].defaultSelected=!0);return}t!==null||e[u].disabled||(t=e[u])}t!==null&&(t.selected=!0)}}function ue(e,t,n){if(t!=null&&(t=""+xt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+xt(n):""}function w(e,t,n,a){if(t==null){if(a!=null){if(n!=null)throw Error(r(92));if(ve(a)){if(1<a.length)throw Error(r(93));a=a[0]}n=a}n==null&&(n=""),t=n}n=xt(t),e.defaultValue=n,a=e.textContent,a===n&&a!==""&&a!==null&&(e.value=a),Bl(e)}function U(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ae=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 Se(e,t,n){var a=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?a?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":a?e.setProperty(t,n):typeof n!="number"||n===0||ae.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Ce(e,t,n){if(t!=null&&typeof t!="object")throw Error(r(62));if(e=e.style,n!=null){for(var a in n)!n.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="");for(var u in t)a=t[u],t.hasOwnProperty(u)&&n[u]!==a&&Se(e,u,a)}else for(var f in t)t.hasOwnProperty(f)&&Se(e,f,t[f])}function ze(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 wt=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"]]),qt=/^[\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 hn(e){return qt.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function mt(){}var At=null;function Ht(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Sl=null,Kn=null;function Fa(e){var t=Mn(e);if(t&&(e=t.stateNode)){var n=e[Be]||null;e:switch(e=t.stateNode,t.type){case"input":if(Bs(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="'+en(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var a=n[t];if(a!==e&&a.form===e.form){var u=a[Be]||null;if(!u)throw Error(r(90));Bs(a,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(t=0;t<n.length;t++)a=n[t],a.form===e.form&&Pl(a)}break e;case"textarea":ue(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Zn(e,!!n.multiple,t,!1)}}}var Sr=!1;function kr(e,t,n){if(Sr)return e(t,n);Sr=!0;try{var a=e(t);return a}finally{if(Sr=!1,(Sl!==null||Kn!==null)&&(Ru(),Sl&&(t=Sl,e=Kn,Kn=Sl=null,Fa(t),e)))for(t=0;t<e.length;t++)Fa(e[t])}}function na(e,t){var n=e.stateNode;if(n===null)return null;var a=n[Be]||null;if(a===null)return null;n=a[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(r(231,t,typeof n));return n}var Ct=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),yn=!1;if(Ct)try{var Wa={};Object.defineProperty(Wa,"passive",{get:function(){yn=!0}}),window.addEventListener("test",Wa,Wa),window.removeEventListener("test",Wa,Wa)}catch{yn=!1}var bn=null,ki=null,ja=null;function qs(){if(ja)return ja;var e,t=ki,n=t.length,a,u="value"in bn?bn.value:bn.textContent,f=u.length;for(e=0;e<n&&t[e]===u[e];e++);var p=n-e;for(a=1;a<=p&&t[n-a]===u[f-a];a++);return ja=u.slice(e,1<a?1-a:void 0)}function la(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function kl(){return!0}function wr(){return!1}function tn(e){function t(n,a,u,f,p){this._reactName=n,this._targetInst=u,this.type=a,this.nativeEvent=f,this.target=p,this.currentTarget=null;for(var v in e)e.hasOwnProperty(v)&&(n=e[v],this[v]=n?n(f):f[v]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?kl:wr,this.isPropagationStopped=wr,this}return k(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=kl)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=kl)},persist:function(){},isPersistent:kl}),t}var wl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},aa=tn(wl),ql=k({},wl,{view:0,detail:0}),Lc=tn(ql),Tr,se,Tl,Pa=k({},ql,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Nr,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!==Tl&&(Tl&&e.type==="mousemove"?(Tr=e.screenX-Tl.screenX,se=e.screenY-Tl.screenY):se=Tr=0,Tl=e),Tr)},movementY:function(e){return"movementY"in e?e.movementY:se}}),Uc=tn(Pa),jo=k({},Pa,{dataTransfer:0}),Eo=tn(jo),ke=k({},ql,{relatedTarget:0}),Gs=tn(ke),Ao=k({},wl,{animationName:0,elapsedTime:0,pseudoElement:0}),Co=tn(Ao),Ro=k({},wl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Mo=tn(Ro),Oo=k({},wl,{data:0}),es=tn(Oo),Do={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},zo={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"},Lo={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Hc(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Lo[e])?!!t[e]:!1}function Nr(){return Hc}var Uo=k({},ql,{key:function(e){if(e.key){var t=Do[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=la(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?zo[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Nr,charCode:function(e){return e.type==="keypress"?la(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?la(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),jr=tn(Uo),Bc=k({},Pa,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Er=tn(Bc),Ho=k({},ql,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Nr}),qc=tn(Ho),Ar=k({},wl,{propertyName:0,elapsedTime:0,pseudoElement:0}),Bo=tn(Ar),qo=k({},Pa,{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}),Go=tn(qo),Yo=k({},wl,{newState:0,oldState:0}),Ys=tn(Yo),Gc=[9,13,27,32],Cr=Ct&&"CompositionEvent"in window,ts=null;Ct&&"documentMode"in document&&(ts=document.documentMode);var Io=Ct&&"TextEvent"in window&&!ts,Yc=Ct&&(!Cr||ts&&8<ts&&11>=ts),Ic=" ",Xc=!1;function Rr(e,t){switch(e){case"keyup":return Gc.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Vc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ns=!1;function Xo(e,t){switch(e){case"compositionend":return Vc(t);case"keypress":return t.which!==32?null:(Xc=!0,Ic);case"textInput":return e=t.data,e===Ic&&Xc?null:e;default:return null}}function Vo(e,t){if(ns)return e==="compositionend"||!Cr&&Rr(e,t)?(e=qs(),ja=ki=bn=null,ns=!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 Yc&&t.locale!=="ko"?null:t.data;default:return null}}var Mr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function wi(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Mr[e.type]:t==="textarea"}function Is(e,t,n,a){Sl?Kn?Kn.push(a):Kn=[a]:Sl=a,t=Hu(t,"onChange"),0<t.length&&(n=new aa("onChange","change",null,n,a),e.push({event:n,listeners:t}))}var Xs=null,Vs=null;function Qo(e){lg(e,0)}function Ti(e){var t=ol(e);if(Pl(t))return e}function Qc(e,t){if(e==="change")return t}var $c=!1;if(Ct){var Or;if(Ct){var Dr="oninput"in document;if(!Dr){var Zc=document.createElement("div");Zc.setAttribute("oninput","return;"),Dr=typeof Zc.oninput=="function"}Or=Dr}else Or=!1;$c=Or&&(!document.documentMode||9<document.documentMode)}function Kc(){Xs&&(Xs.detachEvent("onpropertychange",Jc),Vs=Xs=null)}function Jc(e){if(e.propertyName==="value"&&Ti(Vs)){var t=[];Is(t,Vs,e,Ht(e)),kr(Qo,t)}}function $o(e,t,n){e==="focusin"?(Kc(),Xs=t,Vs=n,Xs.attachEvent("onpropertychange",Jc)):e==="focusout"&&Kc()}function Zo(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ti(Vs)}function Fc(e,t){if(e==="click")return Ti(t)}function Wc(e,t){if(e==="input"||e==="change")return Ti(t)}function Ni(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Gt=typeof Object.is=="function"?Object.is:Ni;function Jn(e,t){if(Gt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;for(a=0;a<n.length;a++){var u=n[a];if(!un.call(t,u)||!Gt(e[u],t[u]))return!1}return!0}function ji(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function zr(e,t){var n=ji(e);e=0;for(var a;n;){if(n.nodeType===3){if(a=e+n.textContent.length,e<=t&&a>=t)return{node:n,offset:t-e};e=a}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=ji(n)}}function Qs(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Qs(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Lr(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 Ur(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 $s=Ct&&"documentMode"in document&&11>=document.documentMode,Ea=null,Hr=null,Aa=null,Br=!1;function ls(e,t,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Br||Ea==null||Ea!==ea(a)||(a=Ea,"selectionStart"in a&&Ur(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),Aa&&Jn(Aa,a)||(Aa=a,a=Hu(Hr,"onSelect"),0<a.length&&(t=new aa("onSelect","select",null,t,n),e.push({event:t,listeners:a}),t.target=Ea)))}function sa(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ca={animationend:sa("Animation","AnimationEnd"),animationiteration:sa("Animation","AnimationIteration"),animationstart:sa("Animation","AnimationStart"),transitionrun:sa("Transition","TransitionRun"),transitionstart:sa("Transition","TransitionStart"),transitioncancel:sa("Transition","TransitionCancel"),transitionend:sa("Transition","TransitionEnd")},Ei={},Ai={};Ct&&(Ai=document.createElement("div").style,"AnimationEvent"in window||(delete Ca.animationend.animation,delete Ca.animationiteration.animation,delete Ca.animationstart.animation),"TransitionEvent"in window||delete Ca.transitionend.transition);function ia(e){if(Ei[e])return Ei[e];if(!Ca[e])return e;var t=Ca[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Ai)return Ei[e]=t[n];return e}var qr=ia("animationend"),y=ia("animationiteration"),Y=ia("animationstart"),pe=ia("transitionrun"),Ve=ia("transitionstart"),Zt=ia("transitioncancel"),On=ia("transitionend"),Fn=new Map,Ee="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(" ");Ee.push("scrollEnd");function Oe(e,t){Fn.set(e,t),Yn(t,[e])}var Ge=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)},nt=[],Yt=0,Gl=0;function as(){for(var e=Yt,t=Gl=Yt=0;t<e;){var n=nt[t];nt[t++]=null;var a=nt[t];nt[t++]=null;var u=nt[t];nt[t++]=null;var f=nt[t];if(nt[t++]=null,a!==null&&u!==null){var p=a.pending;p===null?u.next=u:(u.next=p.next,p.next=u),a.pending=u}f!==0&&Hh(n,u,f)}}function Pc(e,t,n,a){nt[Yt++]=e,nt[Yt++]=t,nt[Yt++]=n,nt[Yt++]=a,Gl|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function Ko(e,t,n,a){return Pc(e,t,n,a),eu(e)}function Zs(e,t){return Pc(e,null,null,t),eu(e)}function Hh(e,t,n){e.lanes|=n;var a=e.alternate;a!==null&&(a.lanes|=n);for(var u=!1,f=e.return;f!==null;)f.childLanes|=n,a=f.alternate,a!==null&&(a.childLanes|=n),f.tag===22&&(e=f.stateNode,e===null||e._visibility&1||(u=!0)),e=f,f=f.return;return e.tag===3?(f=e.stateNode,u&&t!==null&&(u=31-jt(n),e=f.hiddenUpdates,a=e[u],a===null?e[u]=[t]:a.push(t),t.lane=n|536870912),f):null}function eu(e){if(50<cc)throw cc=0,sd=null,Error(r(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ci={};function r0(e,t,n,a){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function pl(e,t,n,a){return new r0(e,t,n,a)}function Jo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ra(e,t){var n=e.alternate;return n===null?(n=pl(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 Bh(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 tu(e,t,n,a,u,f){var p=0;if(a=e,typeof e=="function")Jo(e)&&(p=1);else if(typeof e=="string")p=dx(e,n,re.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ce:return e=pl(31,n,t,u),e.elementType=ce,e.lanes=f,e;case L:return Ks(n.children,u,f,t);case O:p=8,u|=24;break;case F:return e=pl(12,n,t,u|2),e.elementType=F,e.lanes=f,e;case V:return e=pl(13,n,t,u),e.elementType=V,e.lanes=f,e;case D:return e=pl(19,n,t,u),e.elementType=D,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Q:p=10;break e;case q:p=9;break e;case E:p=11;break e;case R:p=14;break e;case Z:p=16,a=null;break e}p=29,n=Error(r(130,e===null?"null":typeof e,"")),a=null}return t=pl(p,n,t,u),t.elementType=e,t.type=a,t.lanes=f,t}function Ks(e,t,n,a){return e=pl(7,e,a,t),e.lanes=n,e}function Fo(e,t,n){return e=pl(6,e,null,t),e.lanes=n,e}function qh(e){var t=pl(18,null,null,0);return t.stateNode=e,t}function Wo(e,t,n){return t=pl(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Gh=new WeakMap;function Nl(e,t){if(typeof e=="object"&&e!==null){var n=Gh.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Ue(t)},Gh.set(e,t),t)}return{value:e,source:t,stack:Ue(t)}}var Ri=[],Mi=0,nu=null,Gr=0,jl=[],El=0,ss=null,ra=1,ca="";function Ma(e,t){Ri[Mi++]=Gr,Ri[Mi++]=nu,nu=e,Gr=t}function Yh(e,t,n){jl[El++]=ra,jl[El++]=ca,jl[El++]=ss,ss=e;var a=ra;e=ca;var u=32-jt(a)-1;a&=~(1<<u),n+=1;var f=32-jt(t)+u;if(30<f){var p=u-u%5;f=(a&(1<<p)-1).toString(32),a>>=p,u-=p,ra=1<<32-jt(t)+u|n<<u|a,ca=f+e}else ra=1<<f|n<<u|a,ca=e}function Po(e){e.return!==null&&(Ma(e,1),Yh(e,1,0))}function ef(e){for(;e===nu;)nu=Ri[--Mi],Ri[Mi]=null,Gr=Ri[--Mi],Ri[Mi]=null;for(;e===ss;)ss=jl[--El],jl[El]=null,ca=jl[--El],jl[El]=null,ra=jl[--El],jl[El]=null}function Ih(e,t){jl[El++]=ra,jl[El++]=ca,jl[El++]=ss,ra=t.id,ca=t.overflow,ss=e}var wn=null,Rt=null,lt=!1,is=null,Al=!1,tf=Error(r(519));function rs(e){var t=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Yr(Nl(t,e)),tf}function Xh(e){var t=e.stateNode,n=e.type,a=e.memoizedProps;switch(t[Et]=e,t[Be]=a,n){case"dialog":Fe("cancel",t),Fe("close",t);break;case"iframe":case"object":case"embed":Fe("load",t);break;case"video":case"audio":for(n=0;n<oc.length;n++)Fe(oc[n],t);break;case"source":Fe("error",t);break;case"img":case"image":case"link":Fe("error",t),Fe("load",t);break;case"details":Fe("toggle",t);break;case"input":Fe("invalid",t),ta(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":Fe("invalid",t);break;case"textarea":Fe("invalid",t),w(t,a.value,a.defaultValue,a.children)}n=a.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||a.suppressHydrationWarning===!0||rg(t.textContent,n)?(a.popover!=null&&(Fe("beforetoggle",t),Fe("toggle",t)),a.onScroll!=null&&Fe("scroll",t),a.onScrollEnd!=null&&Fe("scrollend",t),a.onClick!=null&&(t.onclick=mt),t=!0):t=!1,t||rs(e,!0)}function Vh(e){for(wn=e.return;wn;)switch(wn.tag){case 5:case 31:case 13:Al=!1;return;case 27:case 3:Al=!0;return;default:wn=wn.return}}function Oi(e){if(e!==wn)return!1;if(!lt)return Vh(e),lt=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||_d(e.type,e.memoizedProps)),n=!n),n&&Rt&&rs(e),Vh(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));Rt=gg(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));Rt=gg(e)}else t===27?(t=Rt,vs(e.type)?(e=Td,Td=null,Rt=e):Rt=t):Rt=wn?Rl(e.stateNode.nextSibling):null;return!0}function Js(){Rt=wn=null,lt=!1}function nf(){var e=is;return e!==null&&(tl===null?tl=e:tl.push.apply(tl,e),is=null),e}function Yr(e){is===null?is=[e]:is.push(e)}var lf=N(null),Fs=null,Oa=null;function cs(e,t,n){ie(lf,t._currentValue),t._currentValue=n}function Da(e){e._currentValue=lf.current,I(lf)}function af(e,t,n){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===n)break;e=e.return}}function sf(e,t,n,a){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var f=u.dependencies;if(f!==null){var p=u.child;f=f.firstContext;e:for(;f!==null;){var v=f;f=u;for(var j=0;j<t.length;j++)if(v.context===t[j]){f.lanes|=n,v=f.alternate,v!==null&&(v.lanes|=n),af(f.return,n,e),a||(p=null);break e}f=v.next}}else if(u.tag===18){if(p=u.return,p===null)throw Error(r(341));p.lanes|=n,f=p.alternate,f!==null&&(f.lanes|=n),af(p,n,e),p=null}else p=u.child;if(p!==null)p.return=u;else for(p=u;p!==null;){if(p===e){p=null;break}if(u=p.sibling,u!==null){u.return=p.return,p=u;break}p=p.return}u=p}}function Di(e,t,n,a){e=null;for(var u=t,f=!1;u!==null;){if(!f){if((u.flags&524288)!==0)f=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var p=u.alternate;if(p===null)throw Error(r(387));if(p=p.memoizedProps,p!==null){var v=u.type;Gt(u.pendingProps.value,p.value)||(e!==null?e.push(v):e=[v])}}else if(u===Me.current){if(p=u.alternate,p===null)throw Error(r(387));p.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(mc):e=[mc])}u=u.return}e!==null&&sf(t,e,n,a),t.flags|=262144}function lu(e){for(e=e.firstContext;e!==null;){if(!Gt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ws(e){Fs=e,Oa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Tn(e){return Qh(Fs,e)}function au(e,t){return Fs===null&&Ws(e),Qh(e,t)}function Qh(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Oa===null){if(e===null)throw Error(r(308));Oa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Oa=Oa.next=t;return n}var c0=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,a){e.push(a)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},u0=s.unstable_scheduleCallback,o0=s.unstable_NormalPriority,nn={$$typeof:Q,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function rf(){return{controller:new c0,data:new Map,refCount:0}}function Ir(e){e.refCount--,e.refCount===0&&u0(o0,function(){e.controller.abort()})}var Xr=null,cf=0,zi=0,Li=null;function f0(e,t){if(Xr===null){var n=Xr=[];cf=0,zi=fd(),Li={status:"pending",value:void 0,then:function(a){n.push(a)}}}return cf++,t.then($h,$h),t}function $h(){if(--cf===0&&Xr!==null){Li!==null&&(Li.status="fulfilled");var e=Xr;Xr=null,zi=0,Li=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function d0(e,t){var n=[],a={status:"pending",value:null,reason:null,then:function(u){n.push(u)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var u=0;u<n.length;u++)(0,n[u])(t)},function(u){for(a.status="rejected",a.reason=u,u=0;u<n.length;u++)(0,n[u])(void 0)}),a}var Zh=z.S;z.S=function(e,t){Rm=bt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&f0(e,t),Zh!==null&&Zh(e,t)};var Ps=N(null);function uf(){var e=Ps.current;return e!==null?e:Tt.pooledCache}function su(e,t){t===null?ie(Ps,Ps.current):ie(Ps,t.pool)}function Kh(){var e=uf();return e===null?null:{parent:nn._currentValue,pool:e}}var Ui=Error(r(460)),of=Error(r(474)),iu=Error(r(542)),ru={then:function(){}};function Jh(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Fh(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,Ph(e),e;default:if(typeof t.status=="string")t.then(mt,mt);else{if(e=Tt,e!==null&&100<e.shellSuspendCounter)throw Error(r(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var u=t;u.status="fulfilled",u.value=a}},function(a){if(t.status==="pending"){var u=t;u.status="rejected",u.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ph(e),e}throw ti=t,Ui}}function ei(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(ti=n,Ui):n}}var ti=null;function Wh(){if(ti===null)throw Error(r(459));var e=ti;return ti=null,e}function Ph(e){if(e===Ui||e===iu)throw Error(r(483))}var Hi=null,Vr=0;function cu(e){var t=Vr;return Vr+=1,Hi===null&&(Hi=[]),Fh(Hi,e,t)}function Qr(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function uu(e,t){throw t.$$typeof===_?Error(r(525)):(e=Object.prototype.toString.call(t),Error(r(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function ep(e){function t(M,C){if(e){var H=M.deletions;H===null?(M.deletions=[C],M.flags|=16):H.push(C)}}function n(M,C){if(!e)return null;for(;C!==null;)t(M,C),C=C.sibling;return null}function a(M){for(var C=new Map;M!==null;)M.key!==null?C.set(M.key,M):C.set(M.index,M),M=M.sibling;return C}function u(M,C){return M=Ra(M,C),M.index=0,M.sibling=null,M}function f(M,C,H){return M.index=H,e?(H=M.alternate,H!==null?(H=H.index,H<C?(M.flags|=67108866,C):H):(M.flags|=67108866,C)):(M.flags|=1048576,C)}function p(M){return e&&M.alternate===null&&(M.flags|=67108866),M}function v(M,C,H,te){return C===null||C.tag!==6?(C=Fo(H,M.mode,te),C.return=M,C):(C=u(C,H),C.return=M,C)}function j(M,C,H,te){var De=H.type;return De===L?W(M,C,H.props.children,te,H.key):C!==null&&(C.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===Z&&ei(De)===C.type)?(C=u(C,H.props),Qr(C,H),C.return=M,C):(C=tu(H.type,H.key,H.props,null,M.mode,te),Qr(C,H),C.return=M,C)}function B(M,C,H,te){return C===null||C.tag!==4||C.stateNode.containerInfo!==H.containerInfo||C.stateNode.implementation!==H.implementation?(C=Wo(H,M.mode,te),C.return=M,C):(C=u(C,H.children||[]),C.return=M,C)}function W(M,C,H,te,De){return C===null||C.tag!==7?(C=Ks(H,M.mode,te,De),C.return=M,C):(C=u(C,H),C.return=M,C)}function ne(M,C,H){if(typeof C=="string"&&C!==""||typeof C=="number"||typeof C=="bigint")return C=Fo(""+C,M.mode,H),C.return=M,C;if(typeof C=="object"&&C!==null){switch(C.$$typeof){case A:return H=tu(C.type,C.key,C.props,null,M.mode,H),Qr(H,C),H.return=M,H;case T:return C=Wo(C,M.mode,H),C.return=M,C;case Z:return C=ei(C),ne(M,C,H)}if(ve(C)||le(C))return C=Ks(C,M.mode,H,null),C.return=M,C;if(typeof C.then=="function")return ne(M,cu(C),H);if(C.$$typeof===Q)return ne(M,au(M,C),H);uu(M,C)}return null}function G(M,C,H,te){var De=C!==null?C.key:null;if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return De!==null?null:v(M,C,""+H,te);if(typeof H=="object"&&H!==null){switch(H.$$typeof){case A:return H.key===De?j(M,C,H,te):null;case T:return H.key===De?B(M,C,H,te):null;case Z:return H=ei(H),G(M,C,H,te)}if(ve(H)||le(H))return De!==null?null:W(M,C,H,te,null);if(typeof H.then=="function")return G(M,C,cu(H),te);if(H.$$typeof===Q)return G(M,C,au(M,H),te);uu(M,H)}return null}function X(M,C,H,te,De){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return M=M.get(H)||null,v(C,M,""+te,De);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case A:return M=M.get(te.key===null?H:te.key)||null,j(C,M,te,De);case T:return M=M.get(te.key===null?H:te.key)||null,B(C,M,te,De);case Z:return te=ei(te),X(M,C,H,te,De)}if(ve(te)||le(te))return M=M.get(H)||null,W(C,M,te,De,null);if(typeof te.then=="function")return X(M,C,H,cu(te),De);if(te.$$typeof===Q)return X(M,C,H,au(C,te),De);uu(C,te)}return null}function we(M,C,H,te){for(var De=null,ct=null,je=C,Qe=C=0,Pe=null;je!==null&&Qe<H.length;Qe++){je.index>Qe?(Pe=je,je=null):Pe=je.sibling;var ut=G(M,je,H[Qe],te);if(ut===null){je===null&&(je=Pe);break}e&&je&&ut.alternate===null&&t(M,je),C=f(ut,C,Qe),ct===null?De=ut:ct.sibling=ut,ct=ut,je=Pe}if(Qe===H.length)return n(M,je),lt&&Ma(M,Qe),De;if(je===null){for(;Qe<H.length;Qe++)je=ne(M,H[Qe],te),je!==null&&(C=f(je,C,Qe),ct===null?De=je:ct.sibling=je,ct=je);return lt&&Ma(M,Qe),De}for(je=a(je);Qe<H.length;Qe++)Pe=X(je,M,Qe,H[Qe],te),Pe!==null&&(e&&Pe.alternate!==null&&je.delete(Pe.key===null?Qe:Pe.key),C=f(Pe,C,Qe),ct===null?De=Pe:ct.sibling=Pe,ct=Pe);return e&&je.forEach(function(Ns){return t(M,Ns)}),lt&&Ma(M,Qe),De}function Le(M,C,H,te){if(H==null)throw Error(r(151));for(var De=null,ct=null,je=C,Qe=C=0,Pe=null,ut=H.next();je!==null&&!ut.done;Qe++,ut=H.next()){je.index>Qe?(Pe=je,je=null):Pe=je.sibling;var Ns=G(M,je,ut.value,te);if(Ns===null){je===null&&(je=Pe);break}e&&je&&Ns.alternate===null&&t(M,je),C=f(Ns,C,Qe),ct===null?De=Ns:ct.sibling=Ns,ct=Ns,je=Pe}if(ut.done)return n(M,je),lt&&Ma(M,Qe),De;if(je===null){for(;!ut.done;Qe++,ut=H.next())ut=ne(M,ut.value,te),ut!==null&&(C=f(ut,C,Qe),ct===null?De=ut:ct.sibling=ut,ct=ut);return lt&&Ma(M,Qe),De}for(je=a(je);!ut.done;Qe++,ut=H.next())ut=X(je,M,Qe,ut.value,te),ut!==null&&(e&&ut.alternate!==null&&je.delete(ut.key===null?Qe:ut.key),C=f(ut,C,Qe),ct===null?De=ut:ct.sibling=ut,ct=ut);return e&&je.forEach(function(kx){return t(M,kx)}),lt&&Ma(M,Qe),De}function St(M,C,H,te){if(typeof H=="object"&&H!==null&&H.type===L&&H.key===null&&(H=H.props.children),typeof H=="object"&&H!==null){switch(H.$$typeof){case A:e:{for(var De=H.key;C!==null;){if(C.key===De){if(De=H.type,De===L){if(C.tag===7){n(M,C.sibling),te=u(C,H.props.children),te.return=M,M=te;break e}}else if(C.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===Z&&ei(De)===C.type){n(M,C.sibling),te=u(C,H.props),Qr(te,H),te.return=M,M=te;break e}n(M,C);break}else t(M,C);C=C.sibling}H.type===L?(te=Ks(H.props.children,M.mode,te,H.key),te.return=M,M=te):(te=tu(H.type,H.key,H.props,null,M.mode,te),Qr(te,H),te.return=M,M=te)}return p(M);case T:e:{for(De=H.key;C!==null;){if(C.key===De)if(C.tag===4&&C.stateNode.containerInfo===H.containerInfo&&C.stateNode.implementation===H.implementation){n(M,C.sibling),te=u(C,H.children||[]),te.return=M,M=te;break e}else{n(M,C);break}else t(M,C);C=C.sibling}te=Wo(H,M.mode,te),te.return=M,M=te}return p(M);case Z:return H=ei(H),St(M,C,H,te)}if(ve(H))return we(M,C,H,te);if(le(H)){if(De=le(H),typeof De!="function")throw Error(r(150));return H=De.call(H),Le(M,C,H,te)}if(typeof H.then=="function")return St(M,C,cu(H),te);if(H.$$typeof===Q)return St(M,C,au(M,H),te);uu(M,H)}return typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint"?(H=""+H,C!==null&&C.tag===6?(n(M,C.sibling),te=u(C,H),te.return=M,M=te):(n(M,C),te=Fo(H,M.mode,te),te.return=M,M=te),p(M)):n(M,C)}return function(M,C,H,te){try{Vr=0;var De=St(M,C,H,te);return Hi=null,De}catch(je){if(je===Ui||je===iu)throw je;var ct=pl(29,je,null,M.mode);return ct.lanes=te,ct.return=M,ct}finally{}}}var ni=ep(!0),tp=ep(!1),us=!1;function ff(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function df(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 os(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function fs(e,t,n){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(ot&2)!==0){var u=a.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),a.pending=t,t=eu(e),Hh(e,null,n),t}return Pc(e,a,t,n),eu(e)}function $r(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,Us(e,n)}}function hf(e,t){var n=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,n===a)){var u=null,f=null;if(n=n.firstBaseUpdate,n!==null){do{var p={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};f===null?u=f=p:f=f.next=p,n=n.next}while(n!==null);f===null?u=f=t:f=f.next=t}else u=f=t;n={baseState:a.baseState,firstBaseUpdate:u,lastBaseUpdate:f,shared:a.shared,callbacks:a.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var pf=!1;function Zr(){if(pf){var e=Li;if(e!==null)throw e}}function Kr(e,t,n,a){pf=!1;var u=e.updateQueue;us=!1;var f=u.firstBaseUpdate,p=u.lastBaseUpdate,v=u.shared.pending;if(v!==null){u.shared.pending=null;var j=v,B=j.next;j.next=null,p===null?f=B:p.next=B,p=j;var W=e.alternate;W!==null&&(W=W.updateQueue,v=W.lastBaseUpdate,v!==p&&(v===null?W.firstBaseUpdate=B:v.next=B,W.lastBaseUpdate=j))}if(f!==null){var ne=u.baseState;p=0,W=B=j=null,v=f;do{var G=v.lane&-536870913,X=G!==v.lane;if(X?(We&G)===G:(a&G)===G){G!==0&&G===zi&&(pf=!0),W!==null&&(W=W.next={lane:0,tag:v.tag,payload:v.payload,callback:null,next:null});e:{var we=e,Le=v;G=t;var St=n;switch(Le.tag){case 1:if(we=Le.payload,typeof we=="function"){ne=we.call(St,ne,G);break e}ne=we;break e;case 3:we.flags=we.flags&-65537|128;case 0:if(we=Le.payload,G=typeof we=="function"?we.call(St,ne,G):we,G==null)break e;ne=k({},ne,G);break e;case 2:us=!0}}G=v.callback,G!==null&&(e.flags|=64,X&&(e.flags|=8192),X=u.callbacks,X===null?u.callbacks=[G]:X.push(G))}else X={lane:G,tag:v.tag,payload:v.payload,callback:v.callback,next:null},W===null?(B=W=X,j=ne):W=W.next=X,p|=G;if(v=v.next,v===null){if(v=u.shared.pending,v===null)break;X=v,v=X.next,X.next=null,u.lastBaseUpdate=X,u.shared.pending=null}}while(!0);W===null&&(j=ne),u.baseState=j,u.firstBaseUpdate=B,u.lastBaseUpdate=W,f===null&&(u.shared.lanes=0),gs|=p,e.lanes=p,e.memoizedState=ne}}function np(e,t){if(typeof e!="function")throw Error(r(191,e));e.call(t)}function lp(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)np(n[e],t)}var Bi=N(null),ou=N(0);function ap(e,t){e=Ia,ie(ou,e),ie(Bi,t),Ia=e|t.baseLanes}function mf(){ie(ou,Ia),ie(Bi,Bi.current)}function gf(){Ia=ou.current,I(Bi),I(ou)}var ml=N(null),Cl=null;function ds(e){var t=e.alternate;ie(Kt,Kt.current&1),ie(ml,e),Cl===null&&(t===null||Bi.current!==null||t.memoizedState!==null)&&(Cl=e)}function yf(e){ie(Kt,Kt.current),ie(ml,e),Cl===null&&(Cl=e)}function sp(e){e.tag===22?(ie(Kt,Kt.current),ie(ml,e),Cl===null&&(Cl=e)):hs()}function hs(){ie(Kt,Kt.current),ie(ml,ml.current)}function gl(e){I(ml),Cl===e&&(Cl=null),I(Kt)}var Kt=N(0);function fu(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||kd(n)||wd(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 za=0,Xe=null,_t=null,ln=null,du=!1,qi=!1,li=!1,hu=0,Jr=0,Gi=null,h0=0;function Qt(){throw Error(r(321))}function bf(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Gt(e[n],t[n]))return!1;return!0}function xf(e,t,n,a,u,f){return za=f,Xe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,z.H=e===null||e.memoizedState===null?Yp:Df,li=!1,f=n(a,u),li=!1,qi&&(f=rp(t,n,a,u)),ip(e),f}function ip(e){z.H=Pr;var t=_t!==null&&_t.next!==null;if(za=0,ln=_t=Xe=null,du=!1,Jr=0,Gi=null,t)throw Error(r(300));e===null||an||(e=e.dependencies,e!==null&&lu(e)&&(an=!0))}function rp(e,t,n,a){Xe=e;var u=0;do{if(qi&&(Gi=null),Jr=0,qi=!1,25<=u)throw Error(r(301));if(u+=1,ln=_t=null,e.updateQueue!=null){var f=e.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}z.H=Ip,f=t(n,a)}while(qi);return f}function p0(){var e=z.H,t=e.useState()[0];return t=typeof t.then=="function"?Fr(t):t,e=e.useState()[0],(_t!==null?_t.memoizedState:null)!==e&&(Xe.flags|=1024),t}function _f(){var e=hu!==0;return hu=0,e}function vf(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Sf(e){if(du){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}du=!1}za=0,ln=_t=Xe=null,qi=!1,Jr=hu=0,Gi=null}function Xn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ln===null?Xe.memoizedState=ln=e:ln=ln.next=e,ln}function Jt(){if(_t===null){var e=Xe.alternate;e=e!==null?e.memoizedState:null}else e=_t.next;var t=ln===null?Xe.memoizedState:ln.next;if(t!==null)ln=t,_t=e;else{if(e===null)throw Xe.alternate===null?Error(r(467)):Error(r(310));_t=e,e={memoizedState:_t.memoizedState,baseState:_t.baseState,baseQueue:_t.baseQueue,queue:_t.queue,next:null},ln===null?Xe.memoizedState=ln=e:ln=ln.next=e}return ln}function pu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Fr(e){var t=Jr;return Jr+=1,Gi===null&&(Gi=[]),e=Fh(Gi,e,t),t=Xe,(ln===null?t.memoizedState:ln.next)===null&&(t=t.alternate,z.H=t===null||t.memoizedState===null?Yp:Df),e}function mu(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Fr(e);if(e.$$typeof===Q)return Tn(e)}throw Error(r(438,String(e)))}function kf(e){var t=null,n=Xe.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var a=Xe.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(u){return u.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=pu(),Xe.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),a=0;a<e;a++)n[a]=de;return t.index++,n}function La(e,t){return typeof t=="function"?t(e):t}function gu(e){var t=Jt();return wf(t,_t,e)}function wf(e,t,n){var a=e.queue;if(a===null)throw Error(r(311));a.lastRenderedReducer=n;var u=e.baseQueue,f=a.pending;if(f!==null){if(u!==null){var p=u.next;u.next=f.next,f.next=p}t.baseQueue=u=f,a.pending=null}if(f=e.baseState,u===null)e.memoizedState=f;else{t=u.next;var v=p=null,j=null,B=t,W=!1;do{var ne=B.lane&-536870913;if(ne!==B.lane?(We&ne)===ne:(za&ne)===ne){var G=B.revertLane;if(G===0)j!==null&&(j=j.next={lane:0,revertLane:0,gesture:null,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null}),ne===zi&&(W=!0);else if((za&G)===G){B=B.next,G===zi&&(W=!0);continue}else ne={lane:0,revertLane:B.revertLane,gesture:null,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null},j===null?(v=j=ne,p=f):j=j.next=ne,Xe.lanes|=G,gs|=G;ne=B.action,li&&n(f,ne),f=B.hasEagerState?B.eagerState:n(f,ne)}else G={lane:ne,revertLane:B.revertLane,gesture:B.gesture,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null},j===null?(v=j=G,p=f):j=j.next=G,Xe.lanes|=ne,gs|=ne;B=B.next}while(B!==null&&B!==t);if(j===null?p=f:j.next=v,!Gt(f,e.memoizedState)&&(an=!0,W&&(n=Li,n!==null)))throw n;e.memoizedState=f,e.baseState=p,e.baseQueue=j,a.lastRenderedState=f}return u===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function Tf(e){var t=Jt(),n=t.queue;if(n===null)throw Error(r(311));n.lastRenderedReducer=e;var a=n.dispatch,u=n.pending,f=t.memoizedState;if(u!==null){n.pending=null;var p=u=u.next;do f=e(f,p.action),p=p.next;while(p!==u);Gt(f,t.memoizedState)||(an=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),n.lastRenderedState=f}return[f,a]}function cp(e,t,n){var a=Xe,u=Jt(),f=lt;if(f){if(n===void 0)throw Error(r(407));n=n()}else n=t();var p=!Gt((_t||u).memoizedState,n);if(p&&(u.memoizedState=n,an=!0),u=u.queue,Ef(fp.bind(null,a,u,e),[e]),u.getSnapshot!==t||p||ln!==null&&ln.memoizedState.tag&1){if(a.flags|=2048,Yi(9,{destroy:void 0},op.bind(null,a,u,n,t),null),Tt===null)throw Error(r(349));f||(za&127)!==0||up(a,t,n)}return n}function up(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Xe.updateQueue,t===null?(t=pu(),Xe.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function op(e,t,n,a){t.value=n,t.getSnapshot=a,dp(t)&&hp(e)}function fp(e,t,n){return n(function(){dp(t)&&hp(e)})}function dp(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Gt(e,n)}catch{return!0}}function hp(e){var t=Zs(e,2);t!==null&&nl(t,e,2)}function Nf(e){var t=Xn();if(typeof e=="function"){var n=e;if(e=n(),li){Hn(!0);try{n()}finally{Hn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:La,lastRenderedState:e},t}function pp(e,t,n,a){return e.baseState=n,wf(e,_t,typeof a=="function"?a:La)}function m0(e,t,n,a,u){if(xu(e))throw Error(r(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(p){f.listeners.push(p)}};z.T!==null?n(!0):f.isTransition=!1,a(f),n=t.pending,n===null?(f.next=t.pending=f,mp(t,f)):(f.next=n.next,t.pending=n.next=f)}}function mp(e,t){var n=t.action,a=t.payload,u=e.state;if(t.isTransition){var f=z.T,p={};z.T=p;try{var v=n(u,a),j=z.S;j!==null&&j(p,v),gp(e,t,v)}catch(B){jf(e,t,B)}finally{f!==null&&p.types!==null&&(f.types=p.types),z.T=f}}else try{f=n(u,a),gp(e,t,f)}catch(B){jf(e,t,B)}}function gp(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(a){yp(e,t,a)},function(a){return jf(e,t,a)}):yp(e,t,n)}function yp(e,t,n){t.status="fulfilled",t.value=n,bp(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,mp(e,n)))}function jf(e,t,n){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=n,bp(t),t=t.next;while(t!==a)}e.action=null}function bp(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function xp(e,t){return t}function _p(e,t){if(lt){var n=Tt.formState;if(n!==null){e:{var a=Xe;if(lt){if(Rt){t:{for(var u=Rt,f=Al;u.nodeType!==8;){if(!f){u=null;break t}if(u=Rl(u.nextSibling),u===null){u=null;break t}}f=u.data,u=f==="F!"||f==="F"?u:null}if(u){Rt=Rl(u.nextSibling),a=u.data==="F!";break e}}rs(a)}a=!1}a&&(t=n[0])}}return n=Xn(),n.memoizedState=n.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xp,lastRenderedState:t},n.queue=a,n=Bp.bind(null,Xe,a),a.dispatch=n,a=Nf(!1),f=Of.bind(null,Xe,!1,a.queue),a=Xn(),u={state:t,dispatch:null,action:e,pending:null},a.queue=u,n=m0.bind(null,Xe,u,f,n),u.dispatch=n,a.memoizedState=e,[t,n,!1]}function vp(e){var t=Jt();return Sp(t,_t,e)}function Sp(e,t,n){if(t=wf(e,t,xp)[0],e=gu(La)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=Fr(t)}catch(p){throw p===Ui?iu:p}else a=t;t=Jt();var u=t.queue,f=u.dispatch;return n!==t.memoizedState&&(Xe.flags|=2048,Yi(9,{destroy:void 0},g0.bind(null,u,n),null)),[a,f,e]}function g0(e,t){e.action=t}function kp(e){var t=Jt(),n=_t;if(n!==null)return Sp(t,n,e);Jt(),t=t.memoizedState,n=Jt();var a=n.queue.dispatch;return n.memoizedState=e,[t,a,!1]}function Yi(e,t,n,a){return e={tag:e,create:n,deps:a,inst:t,next:null},t=Xe.updateQueue,t===null&&(t=pu(),Xe.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(a=n.next,n.next=e,e.next=a,t.lastEffect=e),e}function wp(){return Jt().memoizedState}function yu(e,t,n,a){var u=Xn();Xe.flags|=e,u.memoizedState=Yi(1|t,{destroy:void 0},n,a===void 0?null:a)}function bu(e,t,n,a){var u=Jt();a=a===void 0?null:a;var f=u.memoizedState.inst;_t!==null&&a!==null&&bf(a,_t.memoizedState.deps)?u.memoizedState=Yi(t,f,n,a):(Xe.flags|=e,u.memoizedState=Yi(1|t,f,n,a))}function Tp(e,t){yu(8390656,8,e,t)}function Ef(e,t){bu(2048,8,e,t)}function y0(e){Xe.flags|=4;var t=Xe.updateQueue;if(t===null)t=pu(),Xe.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Np(e){var t=Jt().memoizedState;return y0({ref:t,nextImpl:e}),function(){if((ot&2)!==0)throw Error(r(440));return t.impl.apply(void 0,arguments)}}function jp(e,t){return bu(4,2,e,t)}function Ep(e,t){return bu(4,4,e,t)}function Ap(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 Cp(e,t,n){n=n!=null?n.concat([e]):null,bu(4,4,Ap.bind(null,t,e),n)}function Af(){}function Rp(e,t){var n=Jt();t=t===void 0?null:t;var a=n.memoizedState;return t!==null&&bf(t,a[1])?a[0]:(n.memoizedState=[e,t],e)}function Mp(e,t){var n=Jt();t=t===void 0?null:t;var a=n.memoizedState;if(t!==null&&bf(t,a[1]))return a[0];if(a=e(),li){Hn(!0);try{e()}finally{Hn(!1)}}return n.memoizedState=[a,t],a}function Cf(e,t,n){return n===void 0||(za&1073741824)!==0&&(We&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Om(),Xe.lanes|=e,gs|=e,n)}function Op(e,t,n,a){return Gt(n,t)?n:Bi.current!==null?(e=Cf(e,n,a),Gt(e,t)||(an=!0),e):(za&42)===0||(za&1073741824)!==0&&(We&261930)===0?(an=!0,e.memoizedState=n):(e=Om(),Xe.lanes|=e,gs|=e,t)}function Dp(e,t,n,a,u){var f=ee.p;ee.p=f!==0&&8>f?f:8;var p=z.T,v={};z.T=v,Of(e,!1,t,n);try{var j=u(),B=z.S;if(B!==null&&B(v,j),j!==null&&typeof j=="object"&&typeof j.then=="function"){var W=d0(j,a);Wr(e,t,W,xl(e))}else Wr(e,t,a,xl(e))}catch(ne){Wr(e,t,{then:function(){},status:"rejected",reason:ne},xl())}finally{ee.p=f,p!==null&&v.types!==null&&(p.types=v.types),z.T=p}}function b0(){}function Rf(e,t,n,a){if(e.tag!==5)throw Error(r(476));var u=zp(e).queue;Dp(e,u,t,P,n===null?b0:function(){return Lp(e),n(a)})}function zp(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:P,baseState:P,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:La,lastRenderedState:P},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:La,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Lp(e){var t=zp(e);t.next===null&&(t=e.alternate.memoizedState),Wr(e,t.next.queue,{},xl())}function Mf(){return Tn(mc)}function Up(){return Jt().memoizedState}function Hp(){return Jt().memoizedState}function x0(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=xl();e=os(n);var a=fs(t,e,n);a!==null&&(nl(a,t,n),$r(a,t,n)),t={cache:rf()},e.payload=t;return}t=t.return}}function _0(e,t,n){var a=xl();n={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},xu(e)?qp(t,n):(n=Ko(e,t,n,a),n!==null&&(nl(n,e,a),Gp(n,t,a)))}function Bp(e,t,n){var a=xl();Wr(e,t,n,a)}function Wr(e,t,n,a){var u={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(xu(e))qp(t,u);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var p=t.lastRenderedState,v=f(p,n);if(u.hasEagerState=!0,u.eagerState=v,Gt(v,p))return Pc(e,t,u,0),Tt===null&&as(),!1}catch{}finally{}if(n=Ko(e,t,u,a),n!==null)return nl(n,e,a),Gp(n,t,a),!0}return!1}function Of(e,t,n,a){if(a={lane:2,revertLane:fd(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},xu(e)){if(t)throw Error(r(479))}else t=Ko(e,n,a,2),t!==null&&nl(t,e,2)}function xu(e){var t=e.alternate;return e===Xe||t!==null&&t===Xe}function qp(e,t){qi=du=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Gp(e,t,n){if((n&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,Us(e,n)}}var Pr={readContext:Tn,use:mu,useCallback:Qt,useContext:Qt,useEffect:Qt,useImperativeHandle:Qt,useLayoutEffect:Qt,useInsertionEffect:Qt,useMemo:Qt,useReducer:Qt,useRef:Qt,useState:Qt,useDebugValue:Qt,useDeferredValue:Qt,useTransition:Qt,useSyncExternalStore:Qt,useId:Qt,useHostTransitionStatus:Qt,useFormState:Qt,useActionState:Qt,useOptimistic:Qt,useMemoCache:Qt,useCacheRefresh:Qt};Pr.useEffectEvent=Qt;var Yp={readContext:Tn,use:mu,useCallback:function(e,t){return Xn().memoizedState=[e,t===void 0?null:t],e},useContext:Tn,useEffect:Tp,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,yu(4194308,4,Ap.bind(null,t,e),n)},useLayoutEffect:function(e,t){return yu(4194308,4,e,t)},useInsertionEffect:function(e,t){yu(4,2,e,t)},useMemo:function(e,t){var n=Xn();t=t===void 0?null:t;var a=e();if(li){Hn(!0);try{e()}finally{Hn(!1)}}return n.memoizedState=[a,t],a},useReducer:function(e,t,n){var a=Xn();if(n!==void 0){var u=n(t);if(li){Hn(!0);try{n(t)}finally{Hn(!1)}}}else u=t;return a.memoizedState=a.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},a.queue=e,e=e.dispatch=_0.bind(null,Xe,e),[a.memoizedState,e]},useRef:function(e){var t=Xn();return e={current:e},t.memoizedState=e},useState:function(e){e=Nf(e);var t=e.queue,n=Bp.bind(null,Xe,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Af,useDeferredValue:function(e,t){var n=Xn();return Cf(n,e,t)},useTransition:function(){var e=Nf(!1);return e=Dp.bind(null,Xe,e.queue,!0,!1),Xn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var a=Xe,u=Xn();if(lt){if(n===void 0)throw Error(r(407));n=n()}else{if(n=t(),Tt===null)throw Error(r(349));(We&127)!==0||up(a,t,n)}u.memoizedState=n;var f={value:n,getSnapshot:t};return u.queue=f,Tp(fp.bind(null,a,f,e),[e]),a.flags|=2048,Yi(9,{destroy:void 0},op.bind(null,a,f,n,t),null),n},useId:function(){var e=Xn(),t=Tt.identifierPrefix;if(lt){var n=ca,a=ra;n=(a&~(1<<32-jt(a)-1)).toString(32)+n,t="_"+t+"R_"+n,n=hu++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=h0++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Mf,useFormState:_p,useActionState:_p,useOptimistic:function(e){var t=Xn();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Of.bind(null,Xe,!0,n),n.dispatch=t,[e,t]},useMemoCache:kf,useCacheRefresh:function(){return Xn().memoizedState=x0.bind(null,Xe)},useEffectEvent:function(e){var t=Xn(),n={impl:e};return t.memoizedState=n,function(){if((ot&2)!==0)throw Error(r(440));return n.impl.apply(void 0,arguments)}}},Df={readContext:Tn,use:mu,useCallback:Rp,useContext:Tn,useEffect:Ef,useImperativeHandle:Cp,useInsertionEffect:jp,useLayoutEffect:Ep,useMemo:Mp,useReducer:gu,useRef:wp,useState:function(){return gu(La)},useDebugValue:Af,useDeferredValue:function(e,t){var n=Jt();return Op(n,_t.memoizedState,e,t)},useTransition:function(){var e=gu(La)[0],t=Jt().memoizedState;return[typeof e=="boolean"?e:Fr(e),t]},useSyncExternalStore:cp,useId:Up,useHostTransitionStatus:Mf,useFormState:vp,useActionState:vp,useOptimistic:function(e,t){var n=Jt();return pp(n,_t,e,t)},useMemoCache:kf,useCacheRefresh:Hp};Df.useEffectEvent=Np;var Ip={readContext:Tn,use:mu,useCallback:Rp,useContext:Tn,useEffect:Ef,useImperativeHandle:Cp,useInsertionEffect:jp,useLayoutEffect:Ep,useMemo:Mp,useReducer:Tf,useRef:wp,useState:function(){return Tf(La)},useDebugValue:Af,useDeferredValue:function(e,t){var n=Jt();return _t===null?Cf(n,e,t):Op(n,_t.memoizedState,e,t)},useTransition:function(){var e=Tf(La)[0],t=Jt().memoizedState;return[typeof e=="boolean"?e:Fr(e),t]},useSyncExternalStore:cp,useId:Up,useHostTransitionStatus:Mf,useFormState:kp,useActionState:kp,useOptimistic:function(e,t){var n=Jt();return _t!==null?pp(n,_t,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:kf,useCacheRefresh:Hp};Ip.useEffectEvent=Np;function zf(e,t,n,a){t=e.memoizedState,n=n(a,t),n=n==null?t:k({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Lf={enqueueSetState:function(e,t,n){e=e._reactInternals;var a=xl(),u=os(a);u.payload=t,n!=null&&(u.callback=n),t=fs(e,u,a),t!==null&&(nl(t,e,a),$r(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var a=xl(),u=os(a);u.tag=1,u.payload=t,n!=null&&(u.callback=n),t=fs(e,u,a),t!==null&&(nl(t,e,a),$r(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=xl(),a=os(n);a.tag=2,t!=null&&(a.callback=t),t=fs(e,a,n),t!==null&&(nl(t,e,n),$r(t,e,n))}};function Xp(e,t,n,a,u,f,p){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,f,p):t.prototype&&t.prototype.isPureReactComponent?!Jn(n,a)||!Jn(u,f):!0}function Vp(e,t,n,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,a),t.state!==e&&Lf.enqueueReplaceState(t,t.state,null)}function ai(e,t){var n=t;if("ref"in t){n={};for(var a in t)a!=="ref"&&(n[a]=t[a])}if(e=e.defaultProps){n===t&&(n=k({},n));for(var u in e)n[u]===void 0&&(n[u]=e[u])}return n}function Qp(e){Ge(e)}function $p(e){console.error(e)}function Zp(e){Ge(e)}function _u(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function Kp(e,t,n){try{var a=e.onCaughtError;a(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function Uf(e,t,n){return n=os(n),n.tag=3,n.payload={element:null},n.callback=function(){_u(e,t)},n}function Jp(e){return e=os(e),e.tag=3,e}function Fp(e,t,n,a){var u=n.type.getDerivedStateFromError;if(typeof u=="function"){var f=a.value;e.payload=function(){return u(f)},e.callback=function(){Kp(t,n,a)}}var p=n.stateNode;p!==null&&typeof p.componentDidCatch=="function"&&(e.callback=function(){Kp(t,n,a),typeof u!="function"&&(ys===null?ys=new Set([this]):ys.add(this));var v=a.stack;this.componentDidCatch(a.value,{componentStack:v!==null?v:""})})}function v0(e,t,n,a,u){if(n.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=n.alternate,t!==null&&Di(t,n,u,!0),n=ml.current,n!==null){switch(n.tag){case 31:case 13:return Cl===null?Mu():n.alternate===null&&$t===0&&($t=3),n.flags&=-257,n.flags|=65536,n.lanes=u,a===ru?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([a]):t.add(a),cd(e,a,u)),!1;case 22:return n.flags|=65536,a===ru?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([a]):n.add(a)),cd(e,a,u)),!1}throw Error(r(435,n.tag))}return cd(e,a,u),Mu(),!1}if(lt)return t=ml.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,a!==tf&&(e=Error(r(422),{cause:a}),Yr(Nl(e,n)))):(a!==tf&&(t=Error(r(423),{cause:a}),Yr(Nl(t,n))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,a=Nl(a,n),u=Uf(e.stateNode,a,u),hf(e,u),$t!==4&&($t=2)),!1;var f=Error(r(520),{cause:a});if(f=Nl(f,n),rc===null?rc=[f]:rc.push(f),$t!==4&&($t=2),t===null)return!0;a=Nl(a,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=u&-u,n.lanes|=e,e=Uf(n.stateNode,a,e),hf(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"&&(ys===null||!ys.has(f))))return n.flags|=65536,u&=-u,n.lanes|=u,u=Jp(u),Fp(u,e,n,a),hf(n,u),!1}n=n.return}while(n!==null);return!1}var Hf=Error(r(461)),an=!1;function Nn(e,t,n,a){t.child=e===null?tp(t,null,n,a):ni(t,e.child,n,a)}function Wp(e,t,n,a,u){n=n.render;var f=t.ref;if("ref"in a){var p={};for(var v in a)v!=="ref"&&(p[v]=a[v])}else p=a;return Ws(t),a=xf(e,t,n,p,f,u),v=_f(),e!==null&&!an?(vf(e,t,u),Ua(e,t,u)):(lt&&v&&Po(t),t.flags|=1,Nn(e,t,a,u),t.child)}function Pp(e,t,n,a,u){if(e===null){var f=n.type;return typeof f=="function"&&!Jo(f)&&f.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=f,em(e,t,f,a,u)):(e=tu(n.type,null,a,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!Qf(e,u)){var p=f.memoizedProps;if(n=n.compare,n=n!==null?n:Jn,n(p,a)&&e.ref===t.ref)return Ua(e,t,u)}return t.flags|=1,e=Ra(f,a),e.ref=t.ref,e.return=t,t.child=e}function em(e,t,n,a,u){if(e!==null){var f=e.memoizedProps;if(Jn(f,a)&&e.ref===t.ref)if(an=!1,t.pendingProps=a=f,Qf(e,u))(e.flags&131072)!==0&&(an=!0);else return t.lanes=e.lanes,Ua(e,t,u)}return Bf(e,t,n,a,u)}function tm(e,t,n,a){var u=a.children,f=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((t.flags&128)!==0){if(f=f!==null?f.baseLanes|n:n,e!==null){for(a=t.child=e.child,u=0;a!==null;)u=u|a.lanes|a.childLanes,a=a.sibling;a=u&~f}else a=0,t.child=null;return nm(e,t,f,n,a)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&su(t,f!==null?f.cachePool:null),f!==null?ap(t,f):mf(),sp(t);else return a=t.lanes=536870912,nm(e,t,f!==null?f.baseLanes|n:n,n,a)}else f!==null?(su(t,f.cachePool),ap(t,f),hs(),t.memoizedState=null):(e!==null&&su(t,null),mf(),hs());return Nn(e,t,u,n),t.child}function ec(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function nm(e,t,n,a,u){var f=uf();return f=f===null?null:{parent:nn._currentValue,pool:f},t.memoizedState={baseLanes:n,cachePool:f},e!==null&&su(t,null),mf(),sp(t),e!==null&&Di(e,t,a,!0),t.childLanes=u,null}function vu(e,t){return t=ku({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function lm(e,t,n){return ni(t,e.child,null,n),e=vu(t,t.pendingProps),e.flags|=2,gl(t),t.memoizedState=null,e}function S0(e,t,n){var a=t.pendingProps,u=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(lt){if(a.mode==="hidden")return e=vu(t,a),t.lanes=536870912,ec(null,e);if(yf(t),(e=Rt)?(e=mg(e,Al),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ss!==null?{id:ra,overflow:ca}:null,retryLane:536870912,hydrationErrors:null},n=qh(e),n.return=t,t.child=n,wn=t,Rt=null)):e=null,e===null)throw rs(t);return t.lanes=536870912,null}return vu(t,a)}var f=e.memoizedState;if(f!==null){var p=f.dehydrated;if(yf(t),u)if(t.flags&256)t.flags&=-257,t=lm(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(r(558));else if(an||Di(e,t,n,!1),u=(n&e.childLanes)!==0,an||u){if(a=Tt,a!==null&&(p=zl(a,n),p!==0&&p!==f.retryLane))throw f.retryLane=p,Zs(e,p),nl(a,e,p),Hf;Mu(),t=lm(e,t,n)}else e=f.treeContext,Rt=Rl(p.nextSibling),wn=t,lt=!0,is=null,Al=!1,e!==null&&Ih(t,e),t=vu(t,a),t.flags|=4096;return t}return e=Ra(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Su(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(r(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Bf(e,t,n,a,u){return Ws(t),n=xf(e,t,n,a,void 0,u),a=_f(),e!==null&&!an?(vf(e,t,u),Ua(e,t,u)):(lt&&a&&Po(t),t.flags|=1,Nn(e,t,n,u),t.child)}function am(e,t,n,a,u,f){return Ws(t),t.updateQueue=null,n=rp(t,a,n,u),ip(e),a=_f(),e!==null&&!an?(vf(e,t,f),Ua(e,t,f)):(lt&&a&&Po(t),t.flags|=1,Nn(e,t,n,f),t.child)}function sm(e,t,n,a,u){if(Ws(t),t.stateNode===null){var f=Ci,p=n.contextType;typeof p=="object"&&p!==null&&(f=Tn(p)),f=new n(a,f),t.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=Lf,t.stateNode=f,f._reactInternals=t,f=t.stateNode,f.props=a,f.state=t.memoizedState,f.refs={},ff(t),p=n.contextType,f.context=typeof p=="object"&&p!==null?Tn(p):Ci,f.state=t.memoizedState,p=n.getDerivedStateFromProps,typeof p=="function"&&(zf(t,n,p,a),f.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(p=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),p!==f.state&&Lf.enqueueReplaceState(f,f.state,null),Kr(t,a,f,u),Zr(),f.state=t.memoizedState),typeof f.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){f=t.stateNode;var v=t.memoizedProps,j=ai(n,v);f.props=j;var B=f.context,W=n.contextType;p=Ci,typeof W=="object"&&W!==null&&(p=Tn(W));var ne=n.getDerivedStateFromProps;W=typeof ne=="function"||typeof f.getSnapshotBeforeUpdate=="function",v=t.pendingProps!==v,W||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(v||B!==p)&&Vp(t,f,a,p),us=!1;var G=t.memoizedState;f.state=G,Kr(t,a,f,u),Zr(),B=t.memoizedState,v||G!==B||us?(typeof ne=="function"&&(zf(t,n,ne,a),B=t.memoizedState),(j=us||Xp(t,n,j,a,G,B,p))?(W||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(t.flags|=4194308)):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=B),f.props=a,f.state=B,f.context=p,a=j):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{f=t.stateNode,df(e,t),p=t.memoizedProps,W=ai(n,p),f.props=W,ne=t.pendingProps,G=f.context,B=n.contextType,j=Ci,typeof B=="object"&&B!==null&&(j=Tn(B)),v=n.getDerivedStateFromProps,(B=typeof v=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(p!==ne||G!==j)&&Vp(t,f,a,j),us=!1,G=t.memoizedState,f.state=G,Kr(t,a,f,u),Zr();var X=t.memoizedState;p!==ne||G!==X||us||e!==null&&e.dependencies!==null&&lu(e.dependencies)?(typeof v=="function"&&(zf(t,n,v,a),X=t.memoizedState),(W=us||Xp(t,n,W,a,G,X,j)||e!==null&&e.dependencies!==null&&lu(e.dependencies))?(B||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(a,X,j),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(a,X,j)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||p===e.memoizedProps&&G===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||p===e.memoizedProps&&G===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=X),f.props=a,f.state=X,f.context=j,a=W):(typeof f.componentDidUpdate!="function"||p===e.memoizedProps&&G===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||p===e.memoizedProps&&G===e.memoizedState||(t.flags|=1024),a=!1)}return f=a,Su(e,t),a=(t.flags&128)!==0,f||a?(f=t.stateNode,n=a&&typeof n.getDerivedStateFromError!="function"?null:f.render(),t.flags|=1,e!==null&&a?(t.child=ni(t,e.child,null,u),t.child=ni(t,null,n,u)):Nn(e,t,n,u),t.memoizedState=f.state,e=t.child):e=Ua(e,t,u),e}function im(e,t,n,a){return Js(),t.flags|=256,Nn(e,t,n,a),t.child}var qf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Gf(e){return{baseLanes:e,cachePool:Kh()}}function Yf(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=bl),e}function rm(e,t,n){var a=t.pendingProps,u=!1,f=(t.flags&128)!==0,p;if((p=f)||(p=e!==null&&e.memoizedState===null?!1:(Kt.current&2)!==0),p&&(u=!0,t.flags&=-129),p=(t.flags&32)!==0,t.flags&=-33,e===null){if(lt){if(u?ds(t):hs(),(e=Rt)?(e=mg(e,Al),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ss!==null?{id:ra,overflow:ca}:null,retryLane:536870912,hydrationErrors:null},n=qh(e),n.return=t,t.child=n,wn=t,Rt=null)):e=null,e===null)throw rs(t);return wd(e)?t.lanes=32:t.lanes=536870912,null}var v=a.children;return a=a.fallback,u?(hs(),u=t.mode,v=ku({mode:"hidden",children:v},u),a=Ks(a,u,n,null),v.return=t,a.return=t,v.sibling=a,t.child=v,a=t.child,a.memoizedState=Gf(n),a.childLanes=Yf(e,p,n),t.memoizedState=qf,ec(null,a)):(ds(t),If(t,v))}var j=e.memoizedState;if(j!==null&&(v=j.dehydrated,v!==null)){if(f)t.flags&256?(ds(t),t.flags&=-257,t=Xf(e,t,n)):t.memoizedState!==null?(hs(),t.child=e.child,t.flags|=128,t=null):(hs(),v=a.fallback,u=t.mode,a=ku({mode:"visible",children:a.children},u),v=Ks(v,u,n,null),v.flags|=2,a.return=t,v.return=t,a.sibling=v,t.child=a,ni(t,e.child,null,n),a=t.child,a.memoizedState=Gf(n),a.childLanes=Yf(e,p,n),t.memoizedState=qf,t=ec(null,a));else if(ds(t),wd(v)){if(p=v.nextSibling&&v.nextSibling.dataset,p)var B=p.dgst;p=B,a=Error(r(419)),a.stack="",a.digest=p,Yr({value:a,source:null,stack:null}),t=Xf(e,t,n)}else if(an||Di(e,t,n,!1),p=(n&e.childLanes)!==0,an||p){if(p=Tt,p!==null&&(a=zl(p,n),a!==0&&a!==j.retryLane))throw j.retryLane=a,Zs(e,a),nl(p,e,a),Hf;kd(v)||Mu(),t=Xf(e,t,n)}else kd(v)?(t.flags|=192,t.child=e.child,t=null):(e=j.treeContext,Rt=Rl(v.nextSibling),wn=t,lt=!0,is=null,Al=!1,e!==null&&Ih(t,e),t=If(t,a.children),t.flags|=4096);return t}return u?(hs(),v=a.fallback,u=t.mode,j=e.child,B=j.sibling,a=Ra(j,{mode:"hidden",children:a.children}),a.subtreeFlags=j.subtreeFlags&65011712,B!==null?v=Ra(B,v):(v=Ks(v,u,n,null),v.flags|=2),v.return=t,a.return=t,a.sibling=v,t.child=a,ec(null,a),a=t.child,v=e.child.memoizedState,v===null?v=Gf(n):(u=v.cachePool,u!==null?(j=nn._currentValue,u=u.parent!==j?{parent:j,pool:j}:u):u=Kh(),v={baseLanes:v.baseLanes|n,cachePool:u}),a.memoizedState=v,a.childLanes=Yf(e,p,n),t.memoizedState=qf,ec(e.child,a)):(ds(t),n=e.child,e=n.sibling,n=Ra(n,{mode:"visible",children:a.children}),n.return=t,n.sibling=null,e!==null&&(p=t.deletions,p===null?(t.deletions=[e],t.flags|=16):p.push(e)),t.child=n,t.memoizedState=null,n)}function If(e,t){return t=ku({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ku(e,t){return e=pl(22,e,null,t),e.lanes=0,e}function Xf(e,t,n){return ni(t,e.child,null,n),e=If(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function cm(e,t,n){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),af(e.return,t,n)}function Vf(e,t,n,a,u,f){var p=e.memoizedState;p===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:n,tailMode:u,treeForkCount:f}:(p.isBackwards=t,p.rendering=null,p.renderingStartTime=0,p.last=a,p.tail=n,p.tailMode=u,p.treeForkCount=f)}function um(e,t,n){var a=t.pendingProps,u=a.revealOrder,f=a.tail;a=a.children;var p=Kt.current,v=(p&2)!==0;if(v?(p=p&1|2,t.flags|=128):p&=1,ie(Kt,p),Nn(e,t,a,n),a=lt?Gr:0,!v&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&cm(e,n,t);else if(e.tag===19)cm(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&&fu(e)===null&&(u=n),n=n.sibling;n=u,n===null?(u=t.child,t.child=null):(u=n.sibling,n.sibling=null),Vf(t,!1,u,n,f,a);break;case"backwards":case"unstable_legacy-backwards":for(n=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&fu(e)===null){t.child=u;break}e=u.sibling,u.sibling=n,n=u,u=e}Vf(t,!0,n,null,f,a);break;case"together":Vf(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function Ua(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),gs|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Di(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(r(153));if(t.child!==null){for(e=t.child,n=Ra(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ra(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Qf(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&lu(e)))}function k0(e,t,n){switch(t.tag){case 3:et(t,t.stateNode.containerInfo),cs(t,nn,e.memoizedState.cache),Js();break;case 27:case 5:at(t);break;case 4:et(t,t.stateNode.containerInfo);break;case 10:cs(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,yf(t),null;break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(ds(t),t.flags|=128,null):(n&t.child.childLanes)!==0?rm(e,t,n):(ds(t),e=Ua(e,t,n),e!==null?e.sibling:null);ds(t);break;case 19:var u=(e.flags&128)!==0;if(a=(n&t.childLanes)!==0,a||(Di(e,t,n,!1),a=(n&t.childLanes)!==0),u){if(a)return um(e,t,n);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),ie(Kt,Kt.current),a)break;return null;case 22:return t.lanes=0,tm(e,t,n,t.pendingProps);case 24:cs(t,nn,e.memoizedState.cache)}return Ua(e,t,n)}function om(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)an=!0;else{if(!Qf(e,n)&&(t.flags&128)===0)return an=!1,k0(e,t,n);an=(e.flags&131072)!==0}else an=!1,lt&&(t.flags&1048576)!==0&&Yh(t,Gr,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=ei(t.elementType),t.type=e,typeof e=="function")Jo(e)?(a=ai(e,a),t.tag=1,t=sm(null,t,e,a,n)):(t.tag=0,t=Bf(null,t,e,a,n));else{if(e!=null){var u=e.$$typeof;if(u===E){t.tag=11,t=Wp(null,t,e,a,n);break e}else if(u===R){t.tag=14,t=Pp(null,t,e,a,n);break e}}throw t=Ae(e)||e,Error(r(306,t,""))}}return t;case 0:return Bf(e,t,t.type,t.pendingProps,n);case 1:return a=t.type,u=ai(a,t.pendingProps),sm(e,t,a,u,n);case 3:e:{if(et(t,t.stateNode.containerInfo),e===null)throw Error(r(387));a=t.pendingProps;var f=t.memoizedState;u=f.element,df(e,t),Kr(t,a,null,n);var p=t.memoizedState;if(a=p.cache,cs(t,nn,a),a!==f.cache&&sf(t,[nn],n,!0),Zr(),a=p.element,f.isDehydrated)if(f={element:a,isDehydrated:!1,cache:p.cache},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){t=im(e,t,a,n);break e}else if(a!==u){u=Nl(Error(r(424)),t),Yr(u),t=im(e,t,a,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Rt=Rl(e.firstChild),wn=t,lt=!0,is=null,Al=!0,n=tp(t,null,a,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Js(),a===u){t=Ua(e,t,n);break e}Nn(e,t,a,n)}t=t.child}return t;case 26:return Su(e,t),e===null?(n=vg(t.type,null,t.pendingProps,null))?t.memoizedState=n:lt||(n=t.type,e=t.pendingProps,a=Bu(Te.current).createElement(n),a[Et]=t,a[Be]=e,jn(a,n,e),pt(a),t.stateNode=a):t.memoizedState=vg(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return at(t),e===null&<&&(a=t.stateNode=bg(t.type,t.pendingProps,Te.current),wn=t,Al=!0,u=Rt,vs(t.type)?(Td=u,Rt=Rl(a.firstChild)):Rt=u),Nn(e,t,t.pendingProps.children,n),Su(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&<&&((u=a=Rt)&&(a=P0(a,t.type,t.pendingProps,Al),a!==null?(t.stateNode=a,wn=t,Rt=Rl(a.firstChild),Al=!1,u=!0):u=!1),u||rs(t)),at(t),u=t.type,f=t.pendingProps,p=e!==null?e.memoizedProps:null,a=f.children,_d(u,f)?a=null:p!==null&&_d(u,p)&&(t.flags|=32),t.memoizedState!==null&&(u=xf(e,t,p0,null,null,n),mc._currentValue=u),Su(e,t),Nn(e,t,a,n),t.child;case 6:return e===null&<&&((e=n=Rt)&&(n=ex(n,t.pendingProps,Al),n!==null?(t.stateNode=n,wn=t,Rt=null,e=!0):e=!1),e||rs(t)),null;case 13:return rm(e,t,n);case 4:return et(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=ni(t,null,a,n):Nn(e,t,a,n),t.child;case 11:return Wp(e,t,t.type,t.pendingProps,n);case 7:return Nn(e,t,t.pendingProps,n),t.child;case 8:return Nn(e,t,t.pendingProps.children,n),t.child;case 12:return Nn(e,t,t.pendingProps.children,n),t.child;case 10:return a=t.pendingProps,cs(t,t.type,a.value),Nn(e,t,a.children,n),t.child;case 9:return u=t.type._context,a=t.pendingProps.children,Ws(t),u=Tn(u),a=a(u),t.flags|=1,Nn(e,t,a,n),t.child;case 14:return Pp(e,t,t.type,t.pendingProps,n);case 15:return em(e,t,t.type,t.pendingProps,n);case 19:return um(e,t,n);case 31:return S0(e,t,n);case 22:return tm(e,t,n,t.pendingProps);case 24:return Ws(t),a=Tn(nn),e===null?(u=uf(),u===null&&(u=Tt,f=rf(),u.pooledCache=f,f.refCount++,f!==null&&(u.pooledCacheLanes|=n),u=f),t.memoizedState={parent:a,cache:u},ff(t),cs(t,nn,u)):((e.lanes&n)!==0&&(df(e,t),Kr(t,null,null,n),Zr()),u=e.memoizedState,f=t.memoizedState,u.parent!==a?(u={parent:a,cache:a},t.memoizedState=u,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=u),cs(t,nn,a)):(a=f.cache,cs(t,nn,a),a!==u.cache&&sf(t,[nn],n,!0))),Nn(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(r(156,t.tag))}function Ha(e){e.flags|=4}function $f(e,t,n,a,u){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(u&335544128)===u)if(e.stateNode.complete)e.flags|=8192;else if(Um())e.flags|=8192;else throw ti=ru,of}else e.flags&=-16777217}function fm(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Ng(t))if(Um())e.flags|=8192;else throw ti=ru,of}function wu(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?on():536870912,e.lanes|=t,Qi|=t)}function tc(e,t){if(!lt)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function Mt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,a=0;if(t)for(var u=e.child;u!==null;)n|=u.lanes|u.childLanes,a|=u.subtreeFlags&65011712,a|=u.flags&65011712,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)n|=u.lanes|u.childLanes,a|=u.subtreeFlags,a|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=a,e.childLanes=n,t}function w0(e,t,n){var a=t.pendingProps;switch(ef(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Mt(t),null;case 1:return Mt(t),null;case 3:return n=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Da(nn),Ze(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Oi(t)?Ha(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,nf())),Mt(t),null;case 26:var u=t.type,f=t.memoizedState;return e===null?(Ha(t),f!==null?(Mt(t),fm(t,f)):(Mt(t),$f(t,u,null,a,n))):f?f!==e.memoizedState?(Ha(t),Mt(t),fm(t,f)):(Mt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&Ha(t),Mt(t),$f(t,u,e,a,n)),null;case 27:if(qe(t),n=Te.current,u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&Ha(t);else{if(!a){if(t.stateNode===null)throw Error(r(166));return Mt(t),null}e=re.current,Oi(t)?Xh(t):(e=bg(u,a,n),t.stateNode=e,Ha(t))}return Mt(t),null;case 5:if(qe(t),u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&Ha(t);else{if(!a){if(t.stateNode===null)throw Error(r(166));return Mt(t),null}if(f=re.current,Oi(t))Xh(t);else{var p=Bu(Te.current);switch(f){case 1:f=p.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:f=p.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":f=p.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":f=p.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":f=p.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof a.is=="string"?p.createElement("select",{is:a.is}):p.createElement("select"),a.multiple?f.multiple=!0:a.size&&(f.size=a.size);break;default:f=typeof a.is=="string"?p.createElement(u,{is:a.is}):p.createElement(u)}}f[Et]=t,f[Be]=a;e:for(p=t.child;p!==null;){if(p.tag===5||p.tag===6)f.appendChild(p.stateNode);else if(p.tag!==4&&p.tag!==27&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===t)break e;for(;p.sibling===null;){if(p.return===null||p.return===t)break e;p=p.return}p.sibling.return=p.return,p=p.sibling}t.stateNode=f;e:switch(jn(f,u,a),u){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&Ha(t)}}return Mt(t),$f(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&Ha(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(r(166));if(e=Te.current,Oi(t)){if(e=t.stateNode,n=t.memoizedProps,a=null,u=wn,u!==null)switch(u.tag){case 27:case 5:a=u.memoizedProps}e[Et]=t,e=!!(e.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||rg(e.nodeValue,n)),e||rs(t,!0)}else e=Bu(e).createTextNode(a),e[Et]=t,t.stateNode=e}return Mt(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(a=Oi(t),n!==null){if(e===null){if(!a)throw Error(r(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(557));e[Et]=t}else Js(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Mt(t),e=!1}else n=nf(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(gl(t),t):(gl(t),null);if((t.flags&128)!==0)throw Error(r(558))}return Mt(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=Oi(t),a!==null&&a.dehydrated!==null){if(e===null){if(!u)throw Error(r(318));if(u=t.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(r(317));u[Et]=t}else Js(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Mt(t),u=!1}else u=nf(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(gl(t),t):(gl(t),null)}return gl(t),(t.flags&128)!==0?(t.lanes=n,t):(n=a!==null,e=e!==null&&e.memoizedState!==null,n&&(a=t.child,u=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(u=a.alternate.memoizedState.cachePool.pool),f=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(f=a.memoizedState.cachePool.pool),f!==u&&(a.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),wu(t,t.updateQueue),Mt(t),null);case 4:return Ze(),e===null&&md(t.stateNode.containerInfo),Mt(t),null;case 10:return Da(t.type),Mt(t),null;case 19:if(I(Kt),a=t.memoizedState,a===null)return Mt(t),null;if(u=(t.flags&128)!==0,f=a.rendering,f===null)if(u)tc(a,!1);else{if($t!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=fu(e),f!==null){for(t.flags|=128,tc(a,!1),e=f.updateQueue,t.updateQueue=e,wu(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Bh(n,e),n=n.sibling;return ie(Kt,Kt.current&1|2),lt&&Ma(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&bt()>Au&&(t.flags|=128,u=!0,tc(a,!1),t.lanes=4194304)}else{if(!u)if(e=fu(f),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,wu(t,e),tc(a,!0),a.tail===null&&a.tailMode==="hidden"&&!f.alternate&&!lt)return Mt(t),null}else 2*bt()-a.renderingStartTime>Au&&n!==536870912&&(t.flags|=128,u=!0,tc(a,!1),t.lanes=4194304);a.isBackwards?(f.sibling=t.child,t.child=f):(e=a.last,e!==null?e.sibling=f:t.child=f,a.last=f)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=bt(),e.sibling=null,n=Kt.current,ie(Kt,u?n&1|2:n&1),lt&&Ma(t,a.treeForkCount),e):(Mt(t),null);case 22:case 23:return gl(t),gf(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(n&536870912)!==0&&(t.flags&128)===0&&(Mt(t),t.subtreeFlags&6&&(t.flags|=8192)):Mt(t),n=t.updateQueue,n!==null&&wu(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==n&&(t.flags|=2048),e!==null&&I(Ps),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Da(nn),Mt(t),null;case 25:return null;case 30:return null}throw Error(r(156,t.tag))}function T0(e,t){switch(ef(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Da(nn),Ze(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return qe(t),null;case 31:if(t.memoizedState!==null){if(gl(t),t.alternate===null)throw Error(r(340));Js()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(gl(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));Js()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return I(Kt),null;case 4:return Ze(),null;case 10:return Da(t.type),null;case 22:case 23:return gl(t),gf(),e!==null&&I(Ps),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Da(nn),null;case 25:return null;default:return null}}function dm(e,t){switch(ef(t),t.tag){case 3:Da(nn),Ze();break;case 26:case 27:case 5:qe(t);break;case 4:Ze();break;case 31:t.memoizedState!==null&&gl(t);break;case 13:gl(t);break;case 19:I(Kt);break;case 10:Da(t.type);break;case 22:case 23:gl(t),gf(),e!==null&&I(Ps);break;case 24:Da(nn)}}function nc(e,t){try{var n=t.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var u=a.next;n=u;do{if((n.tag&e)===e){a=void 0;var f=n.create,p=n.inst;a=f(),p.destroy=a}n=n.next}while(n!==u)}}catch(v){yt(t,t.return,v)}}function ps(e,t,n){try{var a=t.updateQueue,u=a!==null?a.lastEffect:null;if(u!==null){var f=u.next;a=f;do{if((a.tag&e)===e){var p=a.inst,v=p.destroy;if(v!==void 0){p.destroy=void 0,u=t;var j=n,B=v;try{B()}catch(W){yt(u,j,W)}}}a=a.next}while(a!==f)}}catch(W){yt(t,t.return,W)}}function hm(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{lp(t,n)}catch(a){yt(e,e.return,a)}}}function pm(e,t,n){n.props=ai(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(a){yt(e,t,a)}}function lc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof n=="function"?e.refCleanup=n(a):n.current=a}}catch(u){yt(e,t,u)}}function ua(e,t){var n=e.ref,a=e.refCleanup;if(n!==null)if(typeof a=="function")try{a()}catch(u){yt(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){yt(e,t,u)}else n.current=null}function mm(e){var t=e.type,n=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&a.focus();break e;case"img":n.src?a.src=n.src:n.srcSet&&(a.srcset=n.srcSet)}}catch(u){yt(e,e.return,u)}}function Zf(e,t,n){try{var a=e.stateNode;$0(a,e.type,n,t),a[Be]=t}catch(u){yt(e,e.return,u)}}function gm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&vs(e.type)||e.tag===4}function Kf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||gm(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&&vs(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 Jf(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=mt));else if(a!==4&&(a===27&&vs(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Jf(e,t,n),e=e.sibling;e!==null;)Jf(e,t,n),e=e.sibling}function Tu(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(a!==4&&(a===27&&vs(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Tu(e,t,n),e=e.sibling;e!==null;)Tu(e,t,n),e=e.sibling}function ym(e){var t=e.stateNode,n=e.memoizedProps;try{for(var a=e.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);jn(t,a,n),t[Et]=e,t[Be]=n}catch(f){yt(e,e.return,f)}}var Ba=!1,sn=!1,Ff=!1,bm=typeof WeakSet=="function"?WeakSet:Set,xn=null;function N0(e,t){if(e=e.containerInfo,bd=Qu,e=Lr(e),Ur(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var a=n.getSelection&&n.getSelection();if(a&&a.rangeCount!==0){n=a.anchorNode;var u=a.anchorOffset,f=a.focusNode;a=a.focusOffset;try{n.nodeType,f.nodeType}catch{n=null;break e}var p=0,v=-1,j=-1,B=0,W=0,ne=e,G=null;t:for(;;){for(var X;ne!==n||u!==0&&ne.nodeType!==3||(v=p+u),ne!==f||a!==0&&ne.nodeType!==3||(j=p+a),ne.nodeType===3&&(p+=ne.nodeValue.length),(X=ne.firstChild)!==null;)G=ne,ne=X;for(;;){if(ne===e)break t;if(G===n&&++B===u&&(v=p),G===f&&++W===a&&(j=p),(X=ne.nextSibling)!==null)break;ne=G,G=ne.parentNode}ne=X}n=v===-1||j===-1?null:{start:v,end:j}}else n=null}n=n||{start:0,end:0}}else n=null;for(xd={focusedElem:e,selectionRange:n},Qu=!1,xn=t;xn!==null;)if(t=xn,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,xn=e;else for(;xn!==null;){switch(t=xn,f=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)u=e[n],u.ref.impl=u.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&f!==null){e=void 0,n=t,u=f.memoizedProps,f=f.memoizedState,a=n.stateNode;try{var we=ai(n.type,u);e=a.getSnapshotBeforeUpdate(we,f),a.__reactInternalSnapshotBeforeUpdate=e}catch(Le){yt(n,n.return,Le)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Sd(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Sd(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(r(163))}if(e=t.sibling,e!==null){e.return=t.return,xn=e;break}xn=t.return}}function xm(e,t,n){var a=n.flags;switch(n.tag){case 0:case 11:case 15:Ga(e,n),a&4&&nc(5,n);break;case 1:if(Ga(e,n),a&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(p){yt(n,n.return,p)}else{var u=ai(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(p){yt(n,n.return,p)}}a&64&&hm(n),a&512&&lc(n,n.return);break;case 3:if(Ga(e,n),a&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{lp(e,t)}catch(p){yt(n,n.return,p)}}break;case 27:t===null&&a&4&&ym(n);case 26:case 5:Ga(e,n),t===null&&a&4&&mm(n),a&512&&lc(n,n.return);break;case 12:Ga(e,n);break;case 31:Ga(e,n),a&4&&Sm(e,n);break;case 13:Ga(e,n),a&4&&km(e,n),a&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=z0.bind(null,n),tx(e,n))));break;case 22:if(a=n.memoizedState!==null||Ba,!a){t=t!==null&&t.memoizedState!==null||sn,u=Ba;var f=sn;Ba=a,(sn=t)&&!f?Ya(e,n,(n.subtreeFlags&8772)!==0):Ga(e,n),Ba=u,sn=f}break;case 30:break;default:Ga(e,n)}}function _m(e){var t=e.alternate;t!==null&&(e.alternate=null,_m(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ul(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 Bt=null,Wn=!1;function qa(e,t,n){for(n=n.child;n!==null;)vm(e,t,n),n=n.sibling}function vm(e,t,n){if(Xt&&typeof Xt.onCommitFiberUnmount=="function")try{Xt.onCommitFiberUnmount(sl,n)}catch{}switch(n.tag){case 26:sn||ua(n,t),qa(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:sn||ua(n,t);var a=Bt,u=Wn;vs(n.type)&&(Bt=n.stateNode,Wn=!1),qa(e,t,n),dc(n.stateNode),Bt=a,Wn=u;break;case 5:sn||ua(n,t);case 6:if(a=Bt,u=Wn,Bt=null,qa(e,t,n),Bt=a,Wn=u,Bt!==null)if(Wn)try{(Bt.nodeType===9?Bt.body:Bt.nodeName==="HTML"?Bt.ownerDocument.body:Bt).removeChild(n.stateNode)}catch(f){yt(n,t,f)}else try{Bt.removeChild(n.stateNode)}catch(f){yt(n,t,f)}break;case 18:Bt!==null&&(Wn?(e=Bt,hg(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),er(e)):hg(Bt,n.stateNode));break;case 4:a=Bt,u=Wn,Bt=n.stateNode.containerInfo,Wn=!0,qa(e,t,n),Bt=a,Wn=u;break;case 0:case 11:case 14:case 15:ps(2,n,t),sn||ps(4,n,t),qa(e,t,n);break;case 1:sn||(ua(n,t),a=n.stateNode,typeof a.componentWillUnmount=="function"&&pm(n,t,a)),qa(e,t,n);break;case 21:qa(e,t,n);break;case 22:sn=(a=sn)||n.memoizedState!==null,qa(e,t,n),sn=a;break;default:qa(e,t,n)}}function Sm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{er(e)}catch(n){yt(t,t.return,n)}}}function km(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{er(e)}catch(n){yt(t,t.return,n)}}function j0(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new bm),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new bm),t;default:throw Error(r(435,e.tag))}}function Nu(e,t){var n=j0(e);t.forEach(function(a){if(!n.has(a)){n.add(a);var u=L0.bind(null,e,a);a.then(u,u)}})}function Pn(e,t){var n=t.deletions;if(n!==null)for(var a=0;a<n.length;a++){var u=n[a],f=e,p=t,v=p;e:for(;v!==null;){switch(v.tag){case 27:if(vs(v.type)){Bt=v.stateNode,Wn=!1;break e}break;case 5:Bt=v.stateNode,Wn=!1;break e;case 3:case 4:Bt=v.stateNode.containerInfo,Wn=!0;break e}v=v.return}if(Bt===null)throw Error(r(160));vm(f,p,u),Bt=null,Wn=!1,f=u.alternate,f!==null&&(f.return=null),u.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)wm(t,e),t=t.sibling}var Yl=null;function wm(e,t){var n=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Pn(t,e),el(e),a&4&&(ps(3,e,e.return),nc(3,e),ps(5,e,e.return));break;case 1:Pn(t,e),el(e),a&512&&(sn||n===null||ua(n,n.return)),a&64&&Ba&&(e=e.updateQueue,e!==null&&(a=e.callbacks,a!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?a:n.concat(a))));break;case 26:var u=Yl;if(Pn(t,e),el(e),a&512&&(sn||n===null||ua(n,n.return)),a&4){var f=n!==null?n.memoizedState:null;if(a=e.memoizedState,n===null)if(a===null)if(e.stateNode===null){e:{a=e.type,n=e.memoizedProps,u=u.ownerDocument||u;t:switch(a){case"title":f=u.getElementsByTagName("title")[0],(!f||f[cl]||f[Et]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=u.createElement(a),u.head.insertBefore(f,u.querySelector("head > title"))),jn(f,a,n),f[Et]=e,pt(f),a=f;break e;case"link":var p=wg("link","href",u).get(a+(n.href||""));if(p){for(var v=0;v<p.length;v++)if(f=p[v],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)){p.splice(v,1);break t}}f=u.createElement(a),jn(f,a,n),u.head.appendChild(f);break;case"meta":if(p=wg("meta","content",u).get(a+(n.content||""))){for(v=0;v<p.length;v++)if(f=p[v],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)){p.splice(v,1);break t}}f=u.createElement(a),jn(f,a,n),u.head.appendChild(f);break;default:throw Error(r(468,a))}f[Et]=e,pt(f),a=f}e.stateNode=a}else Tg(u,e.type,e.stateNode);else e.stateNode=kg(u,a,e.memoizedProps);else f!==a?(f===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):f.count--,a===null?Tg(u,e.type,e.stateNode):kg(u,a,e.memoizedProps)):a===null&&e.stateNode!==null&&Zf(e,e.memoizedProps,n.memoizedProps)}break;case 27:Pn(t,e),el(e),a&512&&(sn||n===null||ua(n,n.return)),n!==null&&a&4&&Zf(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Pn(t,e),el(e),a&512&&(sn||n===null||ua(n,n.return)),e.flags&32){u=e.stateNode;try{U(u,"")}catch(we){yt(e,e.return,we)}}a&4&&e.stateNode!=null&&(u=e.memoizedProps,Zf(e,u,n!==null?n.memoizedProps:u)),a&1024&&(Ff=!0);break;case 6:if(Pn(t,e),el(e),a&4){if(e.stateNode===null)throw Error(r(162));a=e.memoizedProps,n=e.stateNode;try{n.nodeValue=a}catch(we){yt(e,e.return,we)}}break;case 3:if(Yu=null,u=Yl,Yl=qu(t.containerInfo),Pn(t,e),Yl=u,el(e),a&4&&n!==null&&n.memoizedState.isDehydrated)try{er(t.containerInfo)}catch(we){yt(e,e.return,we)}Ff&&(Ff=!1,Tm(e));break;case 4:a=Yl,Yl=qu(e.stateNode.containerInfo),Pn(t,e),el(e),Yl=a;break;case 12:Pn(t,e),el(e);break;case 31:Pn(t,e),el(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Nu(e,a)));break;case 13:Pn(t,e),el(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Eu=bt()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Nu(e,a)));break;case 22:u=e.memoizedState!==null;var j=n!==null&&n.memoizedState!==null,B=Ba,W=sn;if(Ba=B||u,sn=W||j,Pn(t,e),sn=W,Ba=B,el(e),a&8192)e:for(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,u&&(n===null||j||Ba||sn||si(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){j=n=t;try{if(f=j.stateNode,u)p=f.style,typeof p.setProperty=="function"?p.setProperty("display","none","important"):p.display="none";else{v=j.stateNode;var ne=j.memoizedProps.style,G=ne!=null&&ne.hasOwnProperty("display")?ne.display:null;v.style.display=G==null||typeof G=="boolean"?"":(""+G).trim()}}catch(we){yt(j,j.return,we)}}}else if(t.tag===6){if(n===null){j=t;try{j.stateNode.nodeValue=u?"":j.memoizedProps}catch(we){yt(j,j.return,we)}}}else if(t.tag===18){if(n===null){j=t;try{var X=j.stateNode;u?pg(X,!0):pg(j.stateNode,!1)}catch(we){yt(j,j.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}a&4&&(a=e.updateQueue,a!==null&&(n=a.retryQueue,n!==null&&(a.retryQueue=null,Nu(e,n))));break;case 19:Pn(t,e),el(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Nu(e,a)));break;case 30:break;case 21:break;default:Pn(t,e),el(e)}}function el(e){var t=e.flags;if(t&2){try{for(var n,a=e.return;a!==null;){if(gm(a)){n=a;break}a=a.return}if(n==null)throw Error(r(160));switch(n.tag){case 27:var u=n.stateNode,f=Kf(e);Tu(e,f,u);break;case 5:var p=n.stateNode;n.flags&32&&(U(p,""),n.flags&=-33);var v=Kf(e);Tu(e,v,p);break;case 3:case 4:var j=n.stateNode.containerInfo,B=Kf(e);Jf(e,B,j);break;default:throw Error(r(161))}}catch(W){yt(e,e.return,W)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Tm(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Tm(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Ga(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)xm(e,t.alternate,t),t=t.sibling}function si(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:ps(4,t,t.return),si(t);break;case 1:ua(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&pm(t,t.return,n),si(t);break;case 27:dc(t.stateNode);case 26:case 5:ua(t,t.return),si(t);break;case 22:t.memoizedState===null&&si(t);break;case 30:si(t);break;default:si(t)}e=e.sibling}}function Ya(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,u=e,f=t,p=f.flags;switch(f.tag){case 0:case 11:case 15:Ya(u,f,n),nc(4,f);break;case 1:if(Ya(u,f,n),a=f,u=a.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(B){yt(a,a.return,B)}if(a=f,u=a.updateQueue,u!==null){var v=a.stateNode;try{var j=u.shared.hiddenCallbacks;if(j!==null)for(u.shared.hiddenCallbacks=null,u=0;u<j.length;u++)np(j[u],v)}catch(B){yt(a,a.return,B)}}n&&p&64&&hm(f),lc(f,f.return);break;case 27:ym(f);case 26:case 5:Ya(u,f,n),n&&a===null&&p&4&&mm(f),lc(f,f.return);break;case 12:Ya(u,f,n);break;case 31:Ya(u,f,n),n&&p&4&&Sm(u,f);break;case 13:Ya(u,f,n),n&&p&4&&km(u,f);break;case 22:f.memoizedState===null&&Ya(u,f,n),lc(f,f.return);break;case 30:break;default:Ya(u,f,n)}t=t.sibling}}function Wf(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&&Ir(n))}function Pf(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ir(e))}function Il(e,t,n,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Nm(e,t,n,a),t=t.sibling}function Nm(e,t,n,a){var u=t.flags;switch(t.tag){case 0:case 11:case 15:Il(e,t,n,a),u&2048&&nc(9,t);break;case 1:Il(e,t,n,a);break;case 3:Il(e,t,n,a),u&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ir(e)));break;case 12:if(u&2048){Il(e,t,n,a),e=t.stateNode;try{var f=t.memoizedProps,p=f.id,v=f.onPostCommit;typeof v=="function"&&v(p,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(j){yt(t,t.return,j)}}else Il(e,t,n,a);break;case 31:Il(e,t,n,a);break;case 13:Il(e,t,n,a);break;case 23:break;case 22:f=t.stateNode,p=t.alternate,t.memoizedState!==null?f._visibility&2?Il(e,t,n,a):ac(e,t):f._visibility&2?Il(e,t,n,a):(f._visibility|=2,Ii(e,t,n,a,(t.subtreeFlags&10256)!==0||!1)),u&2048&&Wf(p,t);break;case 24:Il(e,t,n,a),u&2048&&Pf(t.alternate,t);break;default:Il(e,t,n,a)}}function Ii(e,t,n,a,u){for(u=u&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var f=e,p=t,v=n,j=a,B=p.flags;switch(p.tag){case 0:case 11:case 15:Ii(f,p,v,j,u),nc(8,p);break;case 23:break;case 22:var W=p.stateNode;p.memoizedState!==null?W._visibility&2?Ii(f,p,v,j,u):ac(f,p):(W._visibility|=2,Ii(f,p,v,j,u)),u&&B&2048&&Wf(p.alternate,p);break;case 24:Ii(f,p,v,j,u),u&&B&2048&&Pf(p.alternate,p);break;default:Ii(f,p,v,j,u)}t=t.sibling}}function ac(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,a=t,u=a.flags;switch(a.tag){case 22:ac(n,a),u&2048&&Wf(a.alternate,a);break;case 24:ac(n,a),u&2048&&Pf(a.alternate,a);break;default:ac(n,a)}t=t.sibling}}var sc=8192;function Xi(e,t,n){if(e.subtreeFlags&sc)for(e=e.child;e!==null;)jm(e,t,n),e=e.sibling}function jm(e,t,n){switch(e.tag){case 26:Xi(e,t,n),e.flags&sc&&e.memoizedState!==null&&hx(n,Yl,e.memoizedState,e.memoizedProps);break;case 5:Xi(e,t,n);break;case 3:case 4:var a=Yl;Yl=qu(e.stateNode.containerInfo),Xi(e,t,n),Yl=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=sc,sc=16777216,Xi(e,t,n),sc=a):Xi(e,t,n));break;default:Xi(e,t,n)}}function Em(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 ic(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];xn=a,Cm(a,e)}Em(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Am(e),e=e.sibling}function Am(e){switch(e.tag){case 0:case 11:case 15:ic(e),e.flags&2048&&ps(9,e,e.return);break;case 3:ic(e);break;case 12:ic(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,ju(e)):ic(e);break;default:ic(e)}}function ju(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];xn=a,Cm(a,e)}Em(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:ps(8,t,t.return),ju(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,ju(t));break;default:ju(t)}e=e.sibling}}function Cm(e,t){for(;xn!==null;){var n=xn;switch(n.tag){case 0:case 11:case 15:ps(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var a=n.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:Ir(n.memoizedState.cache)}if(a=n.child,a!==null)a.return=n,xn=a;else e:for(n=e;xn!==null;){a=xn;var u=a.sibling,f=a.return;if(_m(a),a===n){xn=null;break e}if(u!==null){u.return=f,xn=u;break e}xn=f}}}var E0={getCacheForType:function(e){var t=Tn(nn),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Tn(nn).controller.signal}},A0=typeof WeakMap=="function"?WeakMap:Map,ot=0,Tt=null,Je=null,We=0,gt=0,yl=null,ms=!1,Vi=!1,ed=!1,Ia=0,$t=0,gs=0,ii=0,td=0,bl=0,Qi=0,rc=null,tl=null,nd=!1,Eu=0,Rm=0,Au=1/0,Cu=null,ys=null,pn=0,bs=null,$i=null,Xa=0,ld=0,ad=null,Mm=null,cc=0,sd=null;function xl(){return(ot&2)!==0&&We!==0?We&-We:z.T!==null?fd():wa()}function Om(){if(bl===0)if((We&536870912)===0||lt){var e=ht;ht<<=1,(ht&3932160)===0&&(ht=262144),bl=e}else bl=536870912;return e=ml.current,e!==null&&(e.flags|=32),bl}function nl(e,t,n){(e===Tt&&(gt===2||gt===9)||e.cancelPendingCommit!==null)&&(Zi(e,0),xs(e,We,bl,!1)),vl(e,n),((ot&2)===0||e!==Tt)&&(e===Tt&&((ot&2)===0&&(ii|=n),$t===4&&xs(e,We,bl,!1)),oa(e))}function Dm(e,t,n){if((ot&6)!==0)throw Error(r(327));var a=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Bn(e,t),u=a?M0(e,t):rd(e,t,!0),f=a;do{if(u===0){Vi&&!a&&xs(e,t,0,!1);break}else{if(n=e.current.alternate,f&&!C0(n)){u=rd(e,t,!1),f=!1;continue}if(u===2){if(f=t,e.errorRecoveryDisabledLanes&f)var p=0;else p=e.pendingLanes&-536870913,p=p!==0?p:p&536870912?536870912:0;if(p!==0){t=p;e:{var v=e;u=rc;var j=v.current.memoizedState.isDehydrated;if(j&&(Zi(v,p).flags|=256),p=rd(v,p,!1),p!==2){if(ed&&!j){v.errorRecoveryDisabledLanes|=f,ii|=f,u=4;break e}f=tl,tl=u,f!==null&&(tl===null?tl=f:tl.push.apply(tl,f))}u=p}if(f=!1,u!==2)continue}}if(u===1){Zi(e,0),xs(e,t,0,!0);break}e:{switch(a=e,f=u,f){case 0:case 1:throw Error(r(345));case 4:if((t&4194048)!==t)break;case 6:xs(a,t,bl,!ms);break e;case 2:tl=null;break;case 3:case 5:break;default:throw Error(r(329))}if((t&62914560)===t&&(u=Eu+300-bt(),10<u)){if(xs(a,t,bl,!ms),va(a,0,!0)!==0)break e;Xa=t,a.timeoutHandle=fg(zm.bind(null,a,n,tl,Cu,nd,t,bl,ii,Qi,ms,f,"Throttled",-0,0),u);break e}zm(a,n,tl,Cu,nd,t,bl,ii,Qi,ms,f,null,-0,0)}}break}while(!0);oa(e)}function zm(e,t,n,a,u,f,p,v,j,B,W,ne,G,X){if(e.timeoutHandle=-1,ne=t.subtreeFlags,ne&8192||(ne&16785408)===16785408){ne={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:mt},jm(t,f,ne);var we=(f&62914560)===f?Eu-bt():(f&4194048)===f?Rm-bt():0;if(we=px(ne,we),we!==null){Xa=f,e.cancelPendingCommit=we(Im.bind(null,e,t,f,n,a,u,p,v,j,W,ne,null,G,X)),xs(e,f,p,!B);return}}Im(e,t,f,n,a,u,p,v,j)}function C0(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var a=0;a<n.length;a++){var u=n[a],f=u.getSnapshot;u=u.value;try{if(!Gt(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 xs(e,t,n,a){t&=~td,t&=~ii,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var u=t;0<u;){var f=31-jt(u),p=1<<f;a[f]=-1,u&=~p}n!==0&&ka(e,n,t)}function Ru(){return(ot&6)===0?(uc(0),!1):!0}function id(){if(Je!==null){if(gt===0)var e=Je.return;else e=Je,Oa=Fs=null,Sf(e),Hi=null,Vr=0,e=Je;for(;e!==null;)dm(e.alternate,e),e=e.return;Je=null}}function Zi(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,J0(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Xa=0,id(),Tt=e,Je=n=Ra(e.current,null),We=t,gt=0,yl=null,ms=!1,Vi=Bn(e,t),ed=!1,Qi=bl=td=ii=gs=$t=0,tl=rc=null,nd=!1,(t&8)!==0&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var u=31-jt(a),f=1<<u;t|=e[u],a&=~f}return Ia=t,as(),n}function Lm(e,t){Xe=null,z.H=Pr,t===Ui||t===iu?(t=Wh(),gt=3):t===of?(t=Wh(),gt=4):gt=t===Hf?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,yl=t,Je===null&&($t=1,_u(e,Nl(t,e.current)))}function Um(){var e=ml.current;return e===null?!0:(We&4194048)===We?Cl===null:(We&62914560)===We||(We&536870912)!==0?e===Cl:!1}function Hm(){var e=z.H;return z.H=Pr,e===null?Pr:e}function Bm(){var e=z.A;return z.A=E0,e}function Mu(){$t=4,ms||(We&4194048)!==We&&ml.current!==null||(Vi=!0),(gs&134217727)===0&&(ii&134217727)===0||Tt===null||xs(Tt,We,bl,!1)}function rd(e,t,n){var a=ot;ot|=2;var u=Hm(),f=Bm();(Tt!==e||We!==t)&&(Cu=null,Zi(e,t)),t=!1;var p=$t;e:do try{if(gt!==0&&Je!==null){var v=Je,j=yl;switch(gt){case 8:id(),p=6;break e;case 3:case 2:case 9:case 6:ml.current===null&&(t=!0);var B=gt;if(gt=0,yl=null,Ki(e,v,j,B),n&&Vi){p=0;break e}break;default:B=gt,gt=0,yl=null,Ki(e,v,j,B)}}R0(),p=$t;break}catch(W){Lm(e,W)}while(!0);return t&&e.shellSuspendCounter++,Oa=Fs=null,ot=a,z.H=u,z.A=f,Je===null&&(Tt=null,We=0,as()),p}function R0(){for(;Je!==null;)qm(Je)}function M0(e,t){var n=ot;ot|=2;var a=Hm(),u=Bm();Tt!==e||We!==t?(Cu=null,Au=bt()+500,Zi(e,t)):Vi=Bn(e,t);e:do try{if(gt!==0&&Je!==null){t=Je;var f=yl;t:switch(gt){case 1:gt=0,yl=null,Ki(e,t,f,1);break;case 2:case 9:if(Jh(f)){gt=0,yl=null,Gm(t);break}t=function(){gt!==2&>!==9||Tt!==e||(gt=7),oa(e)},f.then(t,t);break e;case 3:gt=7;break e;case 4:gt=5;break e;case 7:Jh(f)?(gt=0,yl=null,Gm(t)):(gt=0,yl=null,Ki(e,t,f,7));break;case 5:var p=null;switch(Je.tag){case 26:p=Je.memoizedState;case 5:case 27:var v=Je;if(p?Ng(p):v.stateNode.complete){gt=0,yl=null;var j=v.sibling;if(j!==null)Je=j;else{var B=v.return;B!==null?(Je=B,Ou(B)):Je=null}break t}}gt=0,yl=null,Ki(e,t,f,5);break;case 6:gt=0,yl=null,Ki(e,t,f,6);break;case 8:id(),$t=6;break e;default:throw Error(r(462))}}O0();break}catch(W){Lm(e,W)}while(!0);return Oa=Fs=null,z.H=a,z.A=u,ot=n,Je!==null?0:(Tt=null,We=0,as(),$t)}function O0(){for(;Je!==null&&!Qn();)qm(Je)}function qm(e){var t=om(e.alternate,e,Ia);e.memoizedProps=e.pendingProps,t===null?Ou(e):Je=t}function Gm(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=am(n,t,t.pendingProps,t.type,void 0,We);break;case 11:t=am(n,t,t.pendingProps,t.type.render,t.ref,We);break;case 5:Sf(t);default:dm(n,t),t=Je=Bh(t,Ia),t=om(n,t,Ia)}e.memoizedProps=e.pendingProps,t===null?Ou(e):Je=t}function Ki(e,t,n,a){Oa=Fs=null,Sf(t),Hi=null,Vr=0;var u=t.return;try{if(v0(e,u,t,n,We)){$t=1,_u(e,Nl(n,e.current)),Je=null;return}}catch(f){if(u!==null)throw Je=u,f;$t=1,_u(e,Nl(n,e.current)),Je=null;return}t.flags&32768?(lt||a===1?e=!0:Vi||(We&536870912)!==0?e=!1:(ms=e=!0,(a===2||a===9||a===3||a===6)&&(a=ml.current,a!==null&&a.tag===13&&(a.flags|=16384))),Ym(t,e)):Ou(t)}function Ou(e){var t=e;do{if((t.flags&32768)!==0){Ym(t,ms);return}e=t.return;var n=w0(t.alternate,t,Ia);if(n!==null){Je=n;return}if(t=t.sibling,t!==null){Je=t;return}Je=t=e}while(t!==null);$t===0&&($t=5)}function Ym(e,t){do{var n=T0(e.alternate,e);if(n!==null){n.flags&=32767,Je=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Je=e;return}Je=e=n}while(e!==null);$t=6,Je=null}function Im(e,t,n,a,u,f,p,v,j){e.cancelPendingCommit=null;do Du();while(pn!==0);if((ot&6)!==0)throw Error(r(327));if(t!==null){if(t===e.current)throw Error(r(177));if(f=t.lanes|t.childLanes,f|=Gl,Sa(e,n,f,p,v,j),e===Tt&&(Je=Tt=null,We=0),$i=t,bs=e,Xa=n,ld=f,ad=u,Mm=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,U0(Re,function(){return Zm(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=z.T,z.T=null,u=ee.p,ee.p=2,p=ot,ot|=4;try{N0(e,t,n)}finally{ot=p,ee.p=u,z.T=a}}pn=1,Xm(),Vm(),Qm()}}function Xm(){if(pn===1){pn=0;var e=bs,t=$i,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=z.T,z.T=null;var a=ee.p;ee.p=2;var u=ot;ot|=4;try{wm(t,e);var f=xd,p=Lr(e.containerInfo),v=f.focusedElem,j=f.selectionRange;if(p!==v&&v&&v.ownerDocument&&Qs(v.ownerDocument.documentElement,v)){if(j!==null&&Ur(v)){var B=j.start,W=j.end;if(W===void 0&&(W=B),"selectionStart"in v)v.selectionStart=B,v.selectionEnd=Math.min(W,v.value.length);else{var ne=v.ownerDocument||document,G=ne&&ne.defaultView||window;if(G.getSelection){var X=G.getSelection(),we=v.textContent.length,Le=Math.min(j.start,we),St=j.end===void 0?Le:Math.min(j.end,we);!X.extend&&Le>St&&(p=St,St=Le,Le=p);var M=zr(v,Le),C=zr(v,St);if(M&&C&&(X.rangeCount!==1||X.anchorNode!==M.node||X.anchorOffset!==M.offset||X.focusNode!==C.node||X.focusOffset!==C.offset)){var H=ne.createRange();H.setStart(M.node,M.offset),X.removeAllRanges(),Le>St?(X.addRange(H),X.extend(C.node,C.offset)):(H.setEnd(C.node,C.offset),X.addRange(H))}}}}for(ne=[],X=v;X=X.parentNode;)X.nodeType===1&&ne.push({element:X,left:X.scrollLeft,top:X.scrollTop});for(typeof v.focus=="function"&&v.focus(),v=0;v<ne.length;v++){var te=ne[v];te.element.scrollLeft=te.left,te.element.scrollTop=te.top}}Qu=!!bd,xd=bd=null}finally{ot=u,ee.p=a,z.T=n}}e.current=t,pn=2}}function Vm(){if(pn===2){pn=0;var e=bs,t=$i,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=z.T,z.T=null;var a=ee.p;ee.p=2;var u=ot;ot|=4;try{xm(e,t.alternate,t)}finally{ot=u,ee.p=a,z.T=n}}pn=3}}function Qm(){if(pn===4||pn===3){pn=0,kn();var e=bs,t=$i,n=Xa,a=Mm;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?pn=5:(pn=0,$i=bs=null,$m(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(ys=null),Ll(n),t=t.stateNode,Xt&&typeof Xt.onCommitFiberRoot=="function")try{Xt.onCommitFiberRoot(sl,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=z.T,u=ee.p,ee.p=2,z.T=null;try{for(var f=e.onRecoverableError,p=0;p<a.length;p++){var v=a[p];f(v.value,{componentStack:v.stack})}}finally{z.T=t,ee.p=u}}(Xa&3)!==0&&Du(),oa(e),u=e.pendingLanes,(n&261930)!==0&&(u&42)!==0?e===sd?cc++:(cc=0,sd=e):cc=0,uc(0)}}function $m(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ir(t)))}function Du(){return Xm(),Vm(),Qm(),Zm()}function Zm(){if(pn!==5)return!1;var e=bs,t=ld;ld=0;var n=Ll(Xa),a=z.T,u=ee.p;try{ee.p=32>n?32:n,z.T=null,n=ad,ad=null;var f=bs,p=Xa;if(pn=0,$i=bs=null,Xa=0,(ot&6)!==0)throw Error(r(331));var v=ot;if(ot|=4,Am(f.current),Nm(f,f.current,p,n),ot=v,uc(0,!1),Xt&&typeof Xt.onPostCommitFiberRoot=="function")try{Xt.onPostCommitFiberRoot(sl,f)}catch{}return!0}finally{ee.p=u,z.T=a,$m(e,t)}}function Km(e,t,n){t=Nl(n,t),t=Uf(e.stateNode,t,2),e=fs(e,t,2),e!==null&&(vl(e,2),oa(e))}function yt(e,t,n){if(e.tag===3)Km(e,e,n);else for(;t!==null;){if(t.tag===3){Km(t,e,n);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(ys===null||!ys.has(a))){e=Nl(n,e),n=Jp(2),a=fs(t,n,2),a!==null&&(Fp(n,a,t,e),vl(a,2),oa(a));break}}t=t.return}}function cd(e,t,n){var a=e.pingCache;if(a===null){a=e.pingCache=new A0;var u=new Set;a.set(t,u)}else u=a.get(t),u===void 0&&(u=new Set,a.set(t,u));u.has(n)||(ed=!0,u.add(n),e=D0.bind(null,e,t,n),t.then(e,e))}function D0(e,t,n){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Tt===e&&(We&n)===n&&($t===4||$t===3&&(We&62914560)===We&&300>bt()-Eu?(ot&2)===0&&Zi(e,0):td|=n,Qi===We&&(Qi=0)),oa(e)}function Jm(e,t){t===0&&(t=on()),e=Zs(e,t),e!==null&&(vl(e,t),oa(e))}function z0(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Jm(e,n)}function L0(e,t){var n=0;switch(e.tag){case 31:case 13:var a=e.stateNode,u=e.memoizedState;u!==null&&(n=u.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(r(314))}a!==null&&a.delete(t),Jm(e,n)}function U0(e,t){return mn(e,t)}var zu=null,Ji=null,ud=!1,Lu=!1,od=!1,_s=0;function oa(e){e!==Ji&&e.next===null&&(Ji===null?zu=Ji=e:Ji=Ji.next=e),Lu=!0,ud||(ud=!0,B0())}function uc(e,t){if(!od&&Lu){od=!0;do for(var n=!1,a=zu;a!==null;){if(e!==0){var u=a.pendingLanes;if(u===0)var f=0;else{var p=a.suspendedLanes,v=a.pingedLanes;f=(1<<31-jt(42|e)+1)-1,f&=u&~(p&~v),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(n=!0,eg(a,f))}else f=We,f=va(a,a===Tt?f:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(f&3)===0||Bn(a,f)||(n=!0,eg(a,f));a=a.next}while(n);od=!1}}function H0(){Fm()}function Fm(){Lu=ud=!1;var e=0;_s!==0&&K0()&&(e=_s);for(var t=bt(),n=null,a=zu;a!==null;){var u=a.next,f=Wm(a,t);f===0?(a.next=null,n===null?zu=u:n.next=u,u===null&&(Ji=n)):(n=a,(e!==0||(f&3)!==0)&&(Lu=!0)),a=u}pn!==0&&pn!==5||uc(e),_s!==0&&(_s=0)}function Wm(e,t){for(var n=e.suspendedLanes,a=e.pingedLanes,u=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var p=31-jt(f),v=1<<p,j=u[p];j===-1?((v&n)===0||(v&a)!==0)&&(u[p]=$n(v,t)):j<=t&&(e.expiredLanes|=v),f&=~v}if(t=Tt,n=We,n=va(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,n===0||e===t&&(gt===2||gt===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&Sn(a),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||Bn(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(a!==null&&Sn(a),Ll(n)){case 2:case 8:n=fe;break;case 32:n=Re;break;case 268435456:n=Lt;break;default:n=Re}return a=Pm.bind(null,e),n=mn(n,a),e.callbackPriority=t,e.callbackNode=n,t}return a!==null&&a!==null&&Sn(a),e.callbackPriority=2,e.callbackNode=null,2}function Pm(e,t){if(pn!==0&&pn!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Du()&&e.callbackNode!==n)return null;var a=We;return a=va(e,e===Tt?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(Dm(e,a,t),Wm(e,bt()),e.callbackNode!=null&&e.callbackNode===n?Pm.bind(null,e):null)}function eg(e,t){if(Du())return null;Dm(e,t,!0)}function B0(){F0(function(){(ot&6)!==0?mn(J,H0):Fm()})}function fd(){if(_s===0){var e=zi;e===0&&(e=rt,rt<<=1,(rt&261888)===0&&(rt=256)),_s=e}return _s}function tg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:hn(""+e)}function ng(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 q0(e,t,n,a,u){if(t==="submit"&&n&&n.stateNode===u){var f=tg((u[Be]||null).action),p=a.submitter;p&&(t=(t=p[Be]||null)?tg(t.formAction):p.getAttribute("formAction"),t!==null&&(f=t,p=null));var v=new aa("action","action",null,a,u);e.push({event:v,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(_s!==0){var j=p?ng(u,p):new FormData(u);Rf(n,{pending:!0,data:j,method:u.method,action:f},null,j)}}else typeof f=="function"&&(v.preventDefault(),j=p?ng(u,p):new FormData(u),Rf(n,{pending:!0,data:j,method:u.method,action:f},f,j))},currentTarget:u}]})}}for(var dd=0;dd<Ee.length;dd++){var hd=Ee[dd],G0=hd.toLowerCase(),Y0=hd[0].toUpperCase()+hd.slice(1);Oe(G0,"on"+Y0)}Oe(qr,"onAnimationEnd"),Oe(y,"onAnimationIteration"),Oe(Y,"onAnimationStart"),Oe("dblclick","onDoubleClick"),Oe("focusin","onFocus"),Oe("focusout","onBlur"),Oe(pe,"onTransitionRun"),Oe(Ve,"onTransitionStart"),Oe(Zt,"onTransitionCancel"),Oe(On,"onTransitionEnd"),fl("onMouseEnter",["mouseout","mouseover"]),fl("onMouseLeave",["mouseout","mouseover"]),fl("onPointerEnter",["pointerout","pointerover"]),fl("onPointerLeave",["pointerout","pointerover"]),Yn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Yn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Yn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Yn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Yn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Yn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var oc="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(" "),I0=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(oc));function lg(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var a=e[n],u=a.event;a=a.listeners;e:{var f=void 0;if(t)for(var p=a.length-1;0<=p;p--){var v=a[p],j=v.instance,B=v.currentTarget;if(v=v.listener,j!==f&&u.isPropagationStopped())break e;f=v,u.currentTarget=B;try{f(u)}catch(W){Ge(W)}u.currentTarget=null,f=j}else for(p=0;p<a.length;p++){if(v=a[p],j=v.instance,B=v.currentTarget,v=v.listener,j!==f&&u.isPropagationStopped())break e;f=v,u.currentTarget=B;try{f(u)}catch(W){Ge(W)}u.currentTarget=null,f=j}}}}function Fe(e,t){var n=t[Kl];n===void 0&&(n=t[Kl]=new Set);var a=e+"__bubble";n.has(a)||(ag(t,e,2,!1),n.add(a))}function pd(e,t,n){var a=0;t&&(a|=4),ag(n,e,a,t)}var Uu="_reactListening"+Math.random().toString(36).slice(2);function md(e){if(!e[Uu]){e[Uu]=!0,Gn.forEach(function(n){n!=="selectionchange"&&(I0.has(n)||pd(n,!1,e),pd(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Uu]||(t[Uu]=!0,pd("selectionchange",!1,t))}}function ag(e,t,n,a){switch(Og(t)){case 2:var u=yx;break;case 8:u=bx;break;default:u=Cd}n=u.bind(null,t,n,e),u=void 0,!yn||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(u=!0),a?u!==void 0?e.addEventListener(t,n,{capture:!0,passive:u}):e.addEventListener(t,n,!0):u!==void 0?e.addEventListener(t,n,{passive:u}):e.addEventListener(t,n,!1)}function gd(e,t,n,a,u){var f=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var p=a.tag;if(p===3||p===4){var v=a.stateNode.containerInfo;if(v===u)break;if(p===4)for(p=a.return;p!==null;){var j=p.tag;if((j===3||j===4)&&p.stateNode.containerInfo===u)return;p=p.return}for(;v!==null;){if(p=Jl(v),p===null)return;if(j=p.tag,j===5||j===6||j===26||j===27){a=f=p;continue e}v=v.parentNode}}a=a.return}kr(function(){var B=f,W=Ht(n),ne=[];e:{var G=Fn.get(e);if(G!==void 0){var X=aa,we=e;switch(e){case"keypress":if(la(n)===0)break e;case"keydown":case"keyup":X=jr;break;case"focusin":we="focus",X=Gs;break;case"focusout":we="blur",X=Gs;break;case"beforeblur":case"afterblur":X=Gs;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":X=Uc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":X=Eo;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":X=qc;break;case qr:case y:case Y:X=Co;break;case On:X=Bo;break;case"scroll":case"scrollend":X=Lc;break;case"wheel":X=Go;break;case"copy":case"cut":case"paste":X=Mo;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":X=Er;break;case"toggle":case"beforetoggle":X=Ys}var Le=(t&4)!==0,St=!Le&&(e==="scroll"||e==="scrollend"),M=Le?G!==null?G+"Capture":null:G;Le=[];for(var C=B,H;C!==null;){var te=C;if(H=te.stateNode,te=te.tag,te!==5&&te!==26&&te!==27||H===null||M===null||(te=na(C,M),te!=null&&Le.push(fc(C,te,H))),St)break;C=C.return}0<Le.length&&(G=new X(G,we,null,n,W),ne.push({event:G,listeners:Le}))}}if((t&7)===0){e:{if(G=e==="mouseover"||e==="pointerover",X=e==="mouseout"||e==="pointerout",G&&n!==At&&(we=n.relatedTarget||n.fromElement)&&(Jl(we)||we[fn]))break e;if((X||G)&&(G=W.window===W?W:(G=W.ownerDocument)?G.defaultView||G.parentWindow:window,X?(we=n.relatedTarget||n.toElement,X=B,we=we?Jl(we):null,we!==null&&(St=d(we),Le=we.tag,we!==St||Le!==5&&Le!==27&&Le!==6)&&(we=null)):(X=null,we=B),X!==we)){if(Le=Uc,te="onMouseLeave",M="onMouseEnter",C="mouse",(e==="pointerout"||e==="pointerover")&&(Le=Er,te="onPointerLeave",M="onPointerEnter",C="pointer"),St=X==null?G:ol(X),H=we==null?G:ol(we),G=new Le(te,C+"leave",X,n,W),G.target=St,G.relatedTarget=H,te=null,Jl(W)===B&&(Le=new Le(M,C+"enter",we,n,W),Le.target=H,Le.relatedTarget=St,te=Le),St=te,X&&we)t:{for(Le=X0,M=X,C=we,H=0,te=M;te;te=Le(te))H++;te=0;for(var De=C;De;De=Le(De))te++;for(;0<H-te;)M=Le(M),H--;for(;0<te-H;)C=Le(C),te--;for(;H--;){if(M===C||C!==null&&M===C.alternate){Le=M;break t}M=Le(M),C=Le(C)}Le=null}else Le=null;X!==null&&sg(ne,G,X,Le,!1),we!==null&&St!==null&&sg(ne,St,we,Le,!0)}}e:{if(G=B?ol(B):window,X=G.nodeName&&G.nodeName.toLowerCase(),X==="select"||X==="input"&&G.type==="file")var ct=Qc;else if(wi(G))if($c)ct=Wc;else{ct=Zo;var je=$o}else X=G.nodeName,!X||X.toLowerCase()!=="input"||G.type!=="checkbox"&&G.type!=="radio"?B&&ze(B.elementType)&&(ct=Qc):ct=Fc;if(ct&&(ct=ct(e,B))){Is(ne,ct,n,W);break e}je&&je(e,G,B),e==="focusout"&&B&&G.type==="number"&&B.memoizedProps.value!=null&&hl(G,"number",G.value)}switch(je=B?ol(B):window,e){case"focusin":(wi(je)||je.contentEditable==="true")&&(Ea=je,Hr=B,Aa=null);break;case"focusout":Aa=Hr=Ea=null;break;case"mousedown":Br=!0;break;case"contextmenu":case"mouseup":case"dragend":Br=!1,ls(ne,n,W);break;case"selectionchange":if($s)break;case"keydown":case"keyup":ls(ne,n,W)}var Qe;if(Cr)e:{switch(e){case"compositionstart":var Pe="onCompositionStart";break e;case"compositionend":Pe="onCompositionEnd";break e;case"compositionupdate":Pe="onCompositionUpdate";break e}Pe=void 0}else ns?Rr(e,n)&&(Pe="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(Pe="onCompositionStart");Pe&&(Yc&&n.locale!=="ko"&&(ns||Pe!=="onCompositionStart"?Pe==="onCompositionEnd"&&ns&&(Qe=qs()):(bn=W,ki="value"in bn?bn.value:bn.textContent,ns=!0)),je=Hu(B,Pe),0<je.length&&(Pe=new es(Pe,e,null,n,W),ne.push({event:Pe,listeners:je}),Qe?Pe.data=Qe:(Qe=Vc(n),Qe!==null&&(Pe.data=Qe)))),(Qe=Io?Xo(e,n):Vo(e,n))&&(Pe=Hu(B,"onBeforeInput"),0<Pe.length&&(je=new es("onBeforeInput","beforeinput",null,n,W),ne.push({event:je,listeners:Pe}),je.data=Qe)),q0(ne,e,B,n,W)}lg(ne,t)})}function fc(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Hu(e,t){for(var n=t+"Capture",a=[];e!==null;){var u=e,f=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||f===null||(u=na(e,n),u!=null&&a.unshift(fc(e,u,f)),u=na(e,t),u!=null&&a.push(fc(e,u,f))),e.tag===3)return a;e=e.return}return[]}function X0(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function sg(e,t,n,a,u){for(var f=t._reactName,p=[];n!==null&&n!==a;){var v=n,j=v.alternate,B=v.stateNode;if(v=v.tag,j!==null&&j===a)break;v!==5&&v!==26&&v!==27||B===null||(j=B,u?(B=na(n,f),B!=null&&p.unshift(fc(n,B,j))):u||(B=na(n,f),B!=null&&p.push(fc(n,B,j)))),n=n.return}p.length!==0&&e.push({event:t,listeners:p})}var V0=/\r\n?/g,Q0=/\u0000|\uFFFD/g;function ig(e){return(typeof e=="string"?e:""+e).replace(V0,`
|
|
50
|
+
`).replace(Q0,"")}function rg(e,t){return t=ig(t),ig(e)===t}function vt(e,t,n,a,u,f){switch(n){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||U(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&U(e,""+a);break;case"className":dl(e,"class",a);break;case"tabIndex":dl(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":dl(e,n,a);break;case"style":Ce(e,a,f);break;case"data":if(t!=="object"){dl(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=hn(""+a),e.setAttribute(n,a);break;case"action":case"formAction":if(typeof a=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof f=="function"&&(n==="formAction"?(t!=="input"&&vt(e,t,"name",u.name,u,null),vt(e,t,"formEncType",u.formEncType,u,null),vt(e,t,"formMethod",u.formMethod,u,null),vt(e,t,"formTarget",u.formTarget,u,null)):(vt(e,t,"encType",u.encType,u,null),vt(e,t,"method",u.method,u,null),vt(e,t,"target",u.target,u,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=hn(""+a),e.setAttribute(n,a);break;case"onClick":a!=null&&(e.onclick=mt);break;case"onScroll":a!=null&&Fe("scroll",e);break;case"onScrollEnd":a!=null&&Fe("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(r(61));if(n=a.__html,n!=null){if(u.children!=null)throw Error(r(60));e.innerHTML=n}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}n=hn(""+a),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,""+a):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":a===!0?e.setAttribute(n,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,a):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(n,a):e.removeAttribute(n);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(n):e.setAttribute(n,a);break;case"popover":Fe("beforetoggle",e),Fe("toggle",e),In(e,"popover",a);break;case"xlinkActuate":dn(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":dn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":dn(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":dn(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":dn(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":dn(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":dn(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":dn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":dn(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":In(e,"is",a);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=wt.get(n)||n,In(e,n,a))}}function yd(e,t,n,a,u,f){switch(n){case"style":Ce(e,a,f);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(r(61));if(n=a.__html,n!=null){if(u.children!=null)throw Error(r(60));e.innerHTML=n}}break;case"children":typeof a=="string"?U(e,a):(typeof a=="number"||typeof a=="bigint")&&U(e,""+a);break;case"onScroll":a!=null&&Fe("scroll",e);break;case"onScrollEnd":a!=null&&Fe("scrollend",e);break;case"onClick":a!=null&&(e.onclick=mt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!vi.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[Be]||null,f=f!=null?f[n]:null,typeof f=="function"&&e.removeEventListener(t,f,u),typeof a=="function")){typeof f!="function"&&f!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,a,u);break e}n in e?e[n]=a:a===!0?e.setAttribute(n,""):In(e,n,a)}}}function jn(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Fe("error",e),Fe("load",e);var a=!1,u=!1,f;for(f in n)if(n.hasOwnProperty(f)){var p=n[f];if(p!=null)switch(f){case"src":a=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,t));default:vt(e,t,f,p,n,null)}}u&&vt(e,t,"srcSet",n.srcSet,n,null),a&&vt(e,t,"src",n.src,n,null);return;case"input":Fe("invalid",e);var v=f=p=u=null,j=null,B=null;for(a in n)if(n.hasOwnProperty(a)){var W=n[a];if(W!=null)switch(a){case"name":u=W;break;case"type":p=W;break;case"checked":j=W;break;case"defaultChecked":B=W;break;case"value":f=W;break;case"defaultValue":v=W;break;case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(r(137,t));break;default:vt(e,t,a,W,n,null)}}ta(e,f,v,j,B,p,u,!1);return;case"select":Fe("invalid",e),a=p=f=null;for(u in n)if(n.hasOwnProperty(u)&&(v=n[u],v!=null))switch(u){case"value":f=v;break;case"defaultValue":p=v;break;case"multiple":a=v;default:vt(e,t,u,v,n,null)}t=f,n=p,e.multiple=!!a,t!=null?Zn(e,!!a,t,!1):n!=null&&Zn(e,!!a,n,!0);return;case"textarea":Fe("invalid",e),f=u=a=null;for(p in n)if(n.hasOwnProperty(p)&&(v=n[p],v!=null))switch(p){case"value":a=v;break;case"defaultValue":u=v;break;case"children":f=v;break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(r(91));break;default:vt(e,t,p,v,n,null)}w(e,a,u,f);return;case"option":for(j in n)if(n.hasOwnProperty(j)&&(a=n[j],a!=null))switch(j){case"selected":e.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:vt(e,t,j,a,n,null)}return;case"dialog":Fe("beforetoggle",e),Fe("toggle",e),Fe("cancel",e),Fe("close",e);break;case"iframe":case"object":Fe("load",e);break;case"video":case"audio":for(a=0;a<oc.length;a++)Fe(oc[a],e);break;case"image":Fe("error",e),Fe("load",e);break;case"details":Fe("toggle",e);break;case"embed":case"source":case"link":Fe("error",e),Fe("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(B in n)if(n.hasOwnProperty(B)&&(a=n[B],a!=null))switch(B){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,t));default:vt(e,t,B,a,n,null)}return;default:if(ze(t)){for(W in n)n.hasOwnProperty(W)&&(a=n[W],a!==void 0&&yd(e,t,W,a,n,void 0));return}}for(v in n)n.hasOwnProperty(v)&&(a=n[v],a!=null&&vt(e,t,v,a,n,null))}function $0(e,t,n,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,f=null,p=null,v=null,j=null,B=null,W=null;for(X in n){var ne=n[X];if(n.hasOwnProperty(X)&&ne!=null)switch(X){case"checked":break;case"value":break;case"defaultValue":j=ne;default:a.hasOwnProperty(X)||vt(e,t,X,null,a,ne)}}for(var G in a){var X=a[G];if(ne=n[G],a.hasOwnProperty(G)&&(X!=null||ne!=null))switch(G){case"type":f=X;break;case"name":u=X;break;case"checked":B=X;break;case"defaultChecked":W=X;break;case"value":p=X;break;case"defaultValue":v=X;break;case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(r(137,t));break;default:X!==ne&&vt(e,t,G,X,a,ne)}}Bs(e,p,v,j,B,W,f,u);return;case"select":X=p=v=G=null;for(f in n)if(j=n[f],n.hasOwnProperty(f)&&j!=null)switch(f){case"value":break;case"multiple":X=j;default:a.hasOwnProperty(f)||vt(e,t,f,null,a,j)}for(u in a)if(f=a[u],j=n[u],a.hasOwnProperty(u)&&(f!=null||j!=null))switch(u){case"value":G=f;break;case"defaultValue":v=f;break;case"multiple":p=f;default:f!==j&&vt(e,t,u,f,a,j)}t=v,n=p,a=X,G!=null?Zn(e,!!n,G,!1):!!a!=!!n&&(t!=null?Zn(e,!!n,t,!0):Zn(e,!!n,n?[]:"",!1));return;case"textarea":X=G=null;for(v in n)if(u=n[v],n.hasOwnProperty(v)&&u!=null&&!a.hasOwnProperty(v))switch(v){case"value":break;case"children":break;default:vt(e,t,v,null,a,u)}for(p in a)if(u=a[p],f=n[p],a.hasOwnProperty(p)&&(u!=null||f!=null))switch(p){case"value":G=u;break;case"defaultValue":X=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(r(91));break;default:u!==f&&vt(e,t,p,u,a,f)}ue(e,G,X);return;case"option":for(var we in n)if(G=n[we],n.hasOwnProperty(we)&&G!=null&&!a.hasOwnProperty(we))switch(we){case"selected":e.selected=!1;break;default:vt(e,t,we,null,a,G)}for(j in a)if(G=a[j],X=n[j],a.hasOwnProperty(j)&&G!==X&&(G!=null||X!=null))switch(j){case"selected":e.selected=G&&typeof G!="function"&&typeof G!="symbol";break;default:vt(e,t,j,G,a,X)}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 Le in n)G=n[Le],n.hasOwnProperty(Le)&&G!=null&&!a.hasOwnProperty(Le)&&vt(e,t,Le,null,a,G);for(B in a)if(G=a[B],X=n[B],a.hasOwnProperty(B)&&G!==X&&(G!=null||X!=null))switch(B){case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(r(137,t));break;default:vt(e,t,B,G,a,X)}return;default:if(ze(t)){for(var St in n)G=n[St],n.hasOwnProperty(St)&&G!==void 0&&!a.hasOwnProperty(St)&&yd(e,t,St,void 0,a,G);for(W in a)G=a[W],X=n[W],!a.hasOwnProperty(W)||G===X||G===void 0&&X===void 0||yd(e,t,W,G,a,X);return}}for(var M in n)G=n[M],n.hasOwnProperty(M)&&G!=null&&!a.hasOwnProperty(M)&&vt(e,t,M,null,a,G);for(ne in a)G=a[ne],X=n[ne],!a.hasOwnProperty(ne)||G===X||G==null&&X==null||vt(e,t,ne,G,a,X)}function cg(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Z0(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),a=0;a<n.length;a++){var u=n[a],f=u.transferSize,p=u.initiatorType,v=u.duration;if(f&&v&&cg(p)){for(p=0,v=u.responseEnd,a+=1;a<n.length;a++){var j=n[a],B=j.startTime;if(B>v)break;var W=j.transferSize,ne=j.initiatorType;W&&cg(ne)&&(j=j.responseEnd,p+=W*(j<v?1:(v-B)/(j-B)))}if(--a,t+=8*(f+p)/(u.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var bd=null,xd=null;function Bu(e){return e.nodeType===9?e:e.ownerDocument}function ug(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 og(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 _d(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 vd=null;function K0(){var e=window.event;return e&&e.type==="popstate"?e===vd?!1:(vd=e,!0):(vd=null,!1)}var fg=typeof setTimeout=="function"?setTimeout:void 0,J0=typeof clearTimeout=="function"?clearTimeout:void 0,dg=typeof Promise=="function"?Promise:void 0,F0=typeof queueMicrotask=="function"?queueMicrotask:typeof dg<"u"?function(e){return dg.resolve(null).then(e).catch(W0)}:fg;function W0(e){setTimeout(function(){throw e})}function vs(e){return e==="head"}function hg(e,t){var n=t,a=0;do{var u=n.nextSibling;if(e.removeChild(n),u&&u.nodeType===8)if(n=u.data,n==="/$"||n==="/&"){if(a===0){e.removeChild(u),er(t);return}a--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")a++;else if(n==="html")dc(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,dc(n);for(var f=n.firstChild;f;){var p=f.nextSibling,v=f.nodeName;f[cl]||v==="SCRIPT"||v==="STYLE"||v==="LINK"&&f.rel.toLowerCase()==="stylesheet"||n.removeChild(f),f=p}}else n==="body"&&dc(e.ownerDocument.body);n=u}while(n);er(t)}function pg(e,t){var n=e;e=0;do{var a=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=a}while(n)}function Sd(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":Sd(n),ul(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function P0(e,t,n,a){for(;e.nodeType===1;){var u=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[cl])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=Rl(e.nextSibling),e===null)break}return null}function ex(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Rl(e.nextSibling),e===null))return null;return e}function mg(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Rl(e.nextSibling),e===null))return null;return e}function kd(e){return e.data==="$?"||e.data==="$~"}function wd(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function tx(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var a=function(){t(),n.removeEventListener("DOMContentLoaded",a)};n.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function Rl(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 Td=null;function gg(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Rl(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function yg(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 bg(e,t,n){switch(t=Bu(n),e){case"html":if(e=t.documentElement,!e)throw Error(r(452));return e;case"head":if(e=t.head,!e)throw Error(r(453));return e;case"body":if(e=t.body,!e)throw Error(r(454));return e;default:throw Error(r(451))}}function dc(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ul(e)}var Ml=new Map,xg=new Set;function qu(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Va=ee.d;ee.d={f:nx,r:lx,D:ax,C:sx,L:ix,m:rx,X:ux,S:cx,M:ox};function nx(){var e=Va.f(),t=Ru();return e||t}function lx(e){var t=Mn(e);t!==null&&t.tag===5&&t.type==="form"?Lp(t):Va.r(e)}var Fi=typeof document>"u"?null:document;function _g(e,t,n){var a=Fi;if(a&&typeof t=="string"&&t){var u=en(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof n=="string"&&(u+='[crossorigin="'+n+'"]'),xg.has(u)||(xg.add(u),e={rel:e,crossOrigin:n,href:t},a.querySelector(u)===null&&(t=a.createElement("link"),jn(t,"link",e),pt(t),a.head.appendChild(t)))}}function ax(e){Va.D(e),_g("dns-prefetch",e,null)}function sx(e,t){Va.C(e,t),_g("preconnect",e,t)}function ix(e,t,n){Va.L(e,t,n);var a=Fi;if(a&&e&&t){var u='link[rel="preload"][as="'+en(t)+'"]';t==="image"&&n&&n.imageSrcSet?(u+='[imagesrcset="'+en(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(u+='[imagesizes="'+en(n.imageSizes)+'"]')):u+='[href="'+en(e)+'"]';var f=u;switch(t){case"style":f=Wi(e);break;case"script":f=Pi(e)}Ml.has(f)||(e=k({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Ml.set(f,e),a.querySelector(u)!==null||t==="style"&&a.querySelector(hc(f))||t==="script"&&a.querySelector(pc(f))||(t=a.createElement("link"),jn(t,"link",e),pt(t),a.head.appendChild(t)))}}function rx(e,t){Va.m(e,t);var n=Fi;if(n&&e){var a=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+en(a)+'"][href="'+en(e)+'"]',f=u;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=Pi(e)}if(!Ml.has(f)&&(e=k({rel:"modulepreload",href:e},t),Ml.set(f,e),n.querySelector(u)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(pc(f)))return}a=n.createElement("link"),jn(a,"link",e),pt(a),n.head.appendChild(a)}}}function cx(e,t,n){Va.S(e,t,n);var a=Fi;if(a&&e){var u=Pt(a).hoistableStyles,f=Wi(e);t=t||"default";var p=u.get(f);if(!p){var v={loading:0,preload:null};if(p=a.querySelector(hc(f)))v.loading=5;else{e=k({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Ml.get(f))&&Nd(e,n);var j=p=a.createElement("link");pt(j),jn(j,"link",e),j._p=new Promise(function(B,W){j.onload=B,j.onerror=W}),j.addEventListener("load",function(){v.loading|=1}),j.addEventListener("error",function(){v.loading|=2}),v.loading|=4,Gu(p,t,a)}p={type:"stylesheet",instance:p,count:1,state:v},u.set(f,p)}}}function ux(e,t){Va.X(e,t);var n=Fi;if(n&&e){var a=Pt(n).hoistableScripts,u=Pi(e),f=a.get(u);f||(f=n.querySelector(pc(u)),f||(e=k({src:e,async:!0},t),(t=Ml.get(u))&&jd(e,t),f=n.createElement("script"),pt(f),jn(f,"link",e),n.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},a.set(u,f))}}function ox(e,t){Va.M(e,t);var n=Fi;if(n&&e){var a=Pt(n).hoistableScripts,u=Pi(e),f=a.get(u);f||(f=n.querySelector(pc(u)),f||(e=k({src:e,async:!0,type:"module"},t),(t=Ml.get(u))&&jd(e,t),f=n.createElement("script"),pt(f),jn(f,"link",e),n.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},a.set(u,f))}}function vg(e,t,n,a){var u=(u=Te.current)?qu(u):null;if(!u)throw Error(r(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Wi(n.href),n=Pt(u).hoistableStyles,a=n.get(t),a||(a={type:"style",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Wi(n.href);var f=Pt(u).hoistableStyles,p=f.get(e);if(p||(u=u.ownerDocument||u,p={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,p),(f=u.querySelector(hc(e)))&&!f._p&&(p.instance=f,p.state.loading=5),Ml.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},Ml.set(e,n),f||fx(u,e,n,p.state))),t&&a===null)throw Error(r(528,""));return p}if(t&&a!==null)throw Error(r(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Pi(n),n=Pt(u).hoistableScripts,a=n.get(t),a||(a={type:"script",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,e))}}function Wi(e){return'href="'+en(e)+'"'}function hc(e){return'link[rel="stylesheet"]['+e+"]"}function Sg(e){return k({},e,{"data-precedence":e.precedence,precedence:null})}function fx(e,t,n,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),jn(t,"link",n),pt(t),e.head.appendChild(t))}function Pi(e){return'[src="'+en(e)+'"]'}function pc(e){return"script[async]"+e}function kg(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+en(n.href)+'"]');if(a)return t.instance=a,pt(a),a;var u=k({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),pt(a),jn(a,"style",u),Gu(a,n.precedence,e),t.instance=a;case"stylesheet":u=Wi(n.href);var f=e.querySelector(hc(u));if(f)return t.state.loading|=4,t.instance=f,pt(f),f;a=Sg(n),(u=Ml.get(u))&&Nd(a,u),f=(e.ownerDocument||e).createElement("link"),pt(f);var p=f;return p._p=new Promise(function(v,j){p.onload=v,p.onerror=j}),jn(f,"link",a),t.state.loading|=4,Gu(f,n.precedence,e),t.instance=f;case"script":return f=Pi(n.src),(u=e.querySelector(pc(f)))?(t.instance=u,pt(u),u):(a=n,(u=Ml.get(f))&&(a=k({},n),jd(a,u)),e=e.ownerDocument||e,u=e.createElement("script"),pt(u),jn(u,"link",a),e.head.appendChild(u),t.instance=u);case"void":return null;default:throw Error(r(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,Gu(a,n.precedence,e));return t.instance}function Gu(e,t,n){for(var a=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=a.length?a[a.length-1]:null,f=u,p=0;p<a.length;p++){var v=a[p];if(v.dataset.precedence===t)f=v;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 Nd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function jd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Yu=null;function wg(e,t,n){if(Yu===null){var a=new Map,u=Yu=new Map;u.set(n,a)}else u=Yu,a=u.get(n),a||(a=new Map,u.set(n,a));if(a.has(e))return a;for(a.set(e,null),n=n.getElementsByTagName(e),u=0;u<n.length;u++){var f=n[u];if(!(f[cl]||f[Et]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var p=f.getAttribute(t)||"";p=e+p;var v=a.get(p);v?v.push(f):a.set(p,[f])}}return a}function Tg(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function dx(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 Ng(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function hx(e,t,n,a){if(n.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var u=Wi(a.href),f=t.querySelector(hc(u));if(f){t=f._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Iu.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=f,pt(f);return}f=t.ownerDocument||t,a=Sg(a),(u=Ml.get(u))&&Nd(a,u),f=f.createElement("link"),pt(f);var p=f;p._p=new Promise(function(v,j){p.onload=v,p.onerror=j}),jn(f,"link",a),n.instance=f}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Iu.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Ed=0;function px(e,t){return e.stylesheets&&e.count===0&&Vu(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var a=setTimeout(function(){if(e.stylesheets&&Vu(e,e.stylesheets),e.unsuspend){var f=e.unsuspend;e.unsuspend=null,f()}},6e4+t);0<e.imgBytes&&Ed===0&&(Ed=62500*Z0());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Vu(e,e.stylesheets),e.unsuspend)){var f=e.unsuspend;e.unsuspend=null,f()}},(e.imgBytes>Ed?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(u)}}:null}function Iu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Vu(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Xu=null;function Vu(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Xu=new Map,t.forEach(mx,e),Xu=null,Iu.call(e))}function mx(e,t){if(!(t.state.loading&4)){var n=Xu.get(e);if(n)var a=n.get(null);else{n=new Map,Xu.set(e,n);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<u.length;f++){var p=u[f];(p.nodeName==="LINK"||p.getAttribute("media")!=="not all")&&(n.set(p.dataset.precedence,p),a=p)}a&&n.set(null,a)}u=t.instance,p=u.getAttribute("data-precedence"),f=n.get(p)||a,f===a&&n.set(null,u),n.set(p,u),this.count++,a=Iu.bind(this),u.addEventListener("load",a),u.addEventListener("error",a),f?f.parentNode.insertBefore(u,f.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),t.state.loading|=4}}var mc={$$typeof:Q,Provider:null,Consumer:null,_currentValue:P,_currentValue2:P,_threadCount:0};function gx(e,t,n,a,u,f,p,v,j){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=Ut(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ut(0),this.hiddenUpdates=Ut(null),this.identifierPrefix=a,this.onUncaughtError=u,this.onCaughtError=f,this.onRecoverableError=p,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=j,this.incompleteTransitions=new Map}function jg(e,t,n,a,u,f,p,v,j,B,W,ne){return e=new gx(e,t,n,p,j,B,W,ne,v),t=1,f===!0&&(t|=24),f=pl(3,null,null,t),e.current=f,f.stateNode=e,t=rf(),t.refCount++,e.pooledCache=t,t.refCount++,f.memoizedState={element:a,isDehydrated:n,cache:t},ff(f),e}function Eg(e){return e?(e=Ci,e):Ci}function Ag(e,t,n,a,u,f){u=Eg(u),a.context===null?a.context=u:a.pendingContext=u,a=os(t),a.payload={element:n},f=f===void 0?null:f,f!==null&&(a.callback=f),n=fs(e,a,t),n!==null&&(nl(n,e,t),$r(n,e,t))}function Cg(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Ad(e,t){Cg(e,t),(e=e.alternate)&&Cg(e,t)}function Rg(e){if(e.tag===13||e.tag===31){var t=Zs(e,67108864);t!==null&&nl(t,e,67108864),Ad(e,67108864)}}function Mg(e){if(e.tag===13||e.tag===31){var t=xl();t=Ka(t);var n=Zs(e,t);n!==null&&nl(n,e,t),Ad(e,t)}}var Qu=!0;function yx(e,t,n,a){var u=z.T;z.T=null;var f=ee.p;try{ee.p=2,Cd(e,t,n,a)}finally{ee.p=f,z.T=u}}function bx(e,t,n,a){var u=z.T;z.T=null;var f=ee.p;try{ee.p=8,Cd(e,t,n,a)}finally{ee.p=f,z.T=u}}function Cd(e,t,n,a){if(Qu){var u=Rd(a);if(u===null)gd(e,t,a,$u,n),Dg(e,a);else if(_x(u,e,t,n,a))a.stopPropagation();else if(Dg(e,a),t&4&&-1<xx.indexOf(e)){for(;u!==null;){var f=Mn(u);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var p=il(f.pendingLanes);if(p!==0){var v=f;for(v.pendingLanes|=2,v.entangledLanes|=2;p;){var j=1<<31-jt(p);v.entanglements[1]|=j,p&=~j}oa(f),(ot&6)===0&&(Au=bt()+500,uc(0))}}break;case 31:case 13:v=Zs(f,2),v!==null&&nl(v,f,2),Ru(),Ad(f,2)}if(f=Rd(a),f===null&&gd(e,t,a,$u,n),f===u)break;u=f}u!==null&&a.stopPropagation()}else gd(e,t,a,null,n)}}function Rd(e){return e=Ht(e),Md(e)}var $u=null;function Md(e){if($u=null,e=Jl(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=g(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 $u=e,null}function Og(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(Cn()){case J:return 2;case fe:return 8;case Re:case Ke:return 32;case Lt:return 268435456;default:return 32}default:return 32}}var Od=!1,Ss=null,ks=null,ws=null,gc=new Map,yc=new Map,Ts=[],xx="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 Dg(e,t){switch(e){case"focusin":case"focusout":Ss=null;break;case"dragenter":case"dragleave":ks=null;break;case"mouseover":case"mouseout":ws=null;break;case"pointerover":case"pointerout":gc.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":yc.delete(t.pointerId)}}function bc(e,t,n,a,u,f){return e===null||e.nativeEvent!==f?(e={blockedOn:t,domEventName:n,eventSystemFlags:a,nativeEvent:f,targetContainers:[u]},t!==null&&(t=Mn(t),t!==null&&Rg(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function _x(e,t,n,a,u){switch(t){case"focusin":return Ss=bc(Ss,e,t,n,a,u),!0;case"dragenter":return ks=bc(ks,e,t,n,a,u),!0;case"mouseover":return ws=bc(ws,e,t,n,a,u),!0;case"pointerover":var f=u.pointerId;return gc.set(f,bc(gc.get(f)||null,e,t,n,a,u)),!0;case"gotpointercapture":return f=u.pointerId,yc.set(f,bc(yc.get(f)||null,e,t,n,a,u)),!0}return!1}function zg(e){var t=Jl(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,rl(e.priority,function(){Mg(n)});return}}else if(t===31){if(t=g(n),t!==null){e.blockedOn=t,rl(e.priority,function(){Mg(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 Zu(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Rd(e.nativeEvent);if(n===null){n=e.nativeEvent;var a=new n.constructor(n.type,n);At=a,n.target.dispatchEvent(a),At=null}else return t=Mn(n),t!==null&&Rg(t),e.blockedOn=n,!1;t.shift()}return!0}function Lg(e,t,n){Zu(e)&&n.delete(t)}function vx(){Od=!1,Ss!==null&&Zu(Ss)&&(Ss=null),ks!==null&&Zu(ks)&&(ks=null),ws!==null&&Zu(ws)&&(ws=null),gc.forEach(Lg),yc.forEach(Lg)}function Ku(e,t){e.blockedOn===t&&(e.blockedOn=null,Od||(Od=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,vx)))}var Ju=null;function Ug(e){Ju!==e&&(Ju=e,s.unstable_scheduleCallback(s.unstable_NormalPriority,function(){Ju===e&&(Ju=null);for(var t=0;t<e.length;t+=3){var n=e[t],a=e[t+1],u=e[t+2];if(typeof a!="function"){if(Md(a||n)===null)continue;break}var f=Mn(n);f!==null&&(e.splice(t,3),t-=3,Rf(f,{pending:!0,data:u,method:n.method,action:a},a,u))}}))}function er(e){function t(j){return Ku(j,e)}Ss!==null&&Ku(Ss,e),ks!==null&&Ku(ks,e),ws!==null&&Ku(ws,e),gc.forEach(t),yc.forEach(t);for(var n=0;n<Ts.length;n++){var a=Ts[n];a.blockedOn===e&&(a.blockedOn=null)}for(;0<Ts.length&&(n=Ts[0],n.blockedOn===null);)zg(n),n.blockedOn===null&&Ts.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(a=0;a<n.length;a+=3){var u=n[a],f=n[a+1],p=u[Be]||null;if(typeof f=="function")p||Ug(n);else if(p){var v=null;if(f&&f.hasAttribute("formAction")){if(u=f,p=f[Be]||null)v=p.formAction;else if(Md(u)!==null)continue}else v=p.action;typeof v=="function"?n[a+1]=v:(n.splice(a,3),a-=3),Ug(n)}}}function Hg(){function e(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(p){return u=p})},focusReset:"manual",scroll:"manual"})}function t(){u!==null&&(u(),u=null),a||setTimeout(n,20)}function n(){if(!a&&!navigation.transition){var f=navigation.currentEntry;f&&f.url!=null&&navigation.navigate(f.url,{state:f.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var a=!1,u=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){a=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),u!==null&&(u(),u=null)}}}function Dd(e){this._internalRoot=e}Fu.prototype.render=Dd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(r(409));var n=t.current,a=xl();Ag(n,a,e,t,null,null)},Fu.prototype.unmount=Dd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ag(e.current,2,null,e,null,null),Ru(),t[fn]=null}};function Fu(e){this._internalRoot=e}Fu.prototype.unstable_scheduleHydration=function(e){if(e){var t=wa();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ts.length&&t!==0&&t<Ts[n].priority;n++);Ts.splice(n,0,e),n===0&&zg(e)}};var Bg=l.version;if(Bg!=="19.2.8")throw Error(r(527,Bg,"19.2.8"));ee.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(r(188)):(e=Object.keys(e).join(","),Error(r(268,e)));return e=b(t),e=e!==null?x(e):null,e=e===null?null:e.stateNode,e};var Sx={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:z,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Wu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Wu.isDisabled&&Wu.supportsFiber)try{sl=Wu.inject(Sx),Xt=Wu}catch{}}return _c.createRoot=function(e,t){if(!o(e))throw Error(r(299));var n=!1,a="",u=Qp,f=$p,p=Zp;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(u=t.onUncaughtError),t.onCaughtError!==void 0&&(f=t.onCaughtError),t.onRecoverableError!==void 0&&(p=t.onRecoverableError)),t=jg(e,1,!1,null,null,n,a,null,u,f,p,Hg),e[fn]=t.current,md(e),new Dd(t)},_c.hydrateRoot=function(e,t,n){if(!o(e))throw Error(r(299));var a=!1,u="",f=Qp,p=$p,v=Zp,j=null;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(u=n.identifierPrefix),n.onUncaughtError!==void 0&&(f=n.onUncaughtError),n.onCaughtError!==void 0&&(p=n.onCaughtError),n.onRecoverableError!==void 0&&(v=n.onRecoverableError),n.formState!==void 0&&(j=n.formState)),t=jg(e,1,!0,t,n??null,a,u,j,f,p,v,Hg),t.context=Eg(null),n=t.current,a=xl(),a=Ka(a),u=os(a),u.callback=null,fs(n,u,a),n=a,t.current.lanes=n,vl(t,n),oa(t),e[fn]=t.current,md(e),new Fu(t)},_c.version="19.2.8",_c}var Jg;function Dx(){if(Jg)return Hd.exports;Jg=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(l){console.error(l)}}return s(),Hd.exports=Ox(),Hd.exports}var zx=Dx();const ub=1;var Za,dr,hr,pr,mr,Oc,gr,wo,ob;class Lx{constructor(l){It(this,wo);It(this,Za,null);It(this,dr,new Set);It(this,hr,500);It(this,pr,null);It(this,mr,!1);It(this,Oc,null);It(this,gr,null);this.url=l}get statusText(){return this.connected?"Хост на связи":"Нет связи с хостом"}onStatus(l){ft(this,gr,l)}connect(){if(He(this,mr))return;const l=new WebSocket(this.url);ft(this,Za,l),l.addEventListener("open",()=>{var i,r;ft(this,hr,500),this.send({type:"hello",protocol:ub,clientName:"ccv-web"}),(i=He(this,Oc))==null||i.call(this),(r=He(this,gr))==null||r.call(this)}),l.addEventListener("message",i=>{let r;try{r=JSON.parse(String(i.data))}catch{return}for(const o of He(this,dr))o(r)}),l.addEventListener("close",()=>{var i;ft(this,Za,null),(i=He(this,gr))==null||i.call(this),rn(this,wo,ob).call(this)}),l.addEventListener("error",()=>l.close())}onReconnect(l){ft(this,Oc,l)}on(l){return He(this,dr).add(l),()=>He(this,dr).delete(l)}send(l){var i;((i=He(this,Za))==null?void 0:i.readyState)===WebSocket.OPEN&&He(this,Za).send(JSON.stringify(l))}get connected(){var l;return((l=He(this,Za))==null?void 0:l.readyState)===WebSocket.OPEN}close(){var l;ft(this,mr,!0),(l=He(this,Za))==null||l.close()}}Za=new WeakMap,dr=new WeakMap,hr=new WeakMap,pr=new WeakMap,mr=new WeakMap,Oc=new WeakMap,gr=new WeakMap,wo=new WeakSet,ob=function(){if(He(this,mr)||He(this,pr)!==null)return;const l=He(this,hr);ft(this,hr,Math.min(l*2,1e4)),ft(this,pr,window.setTimeout(()=>{ft(this,pr,null),this.connect()},l))};const Ux=1,fb="ccv:relay",fo="ccv:relay.host";function Hx(){try{const s=localStorage.getItem(fb);if(!s)return null;const l=JSON.parse(s);return typeof(l==null?void 0:l.token)!="string"||typeof l.expiresAt=="number"&&l.expiresAt<=Date.now()?null:l}catch{return null}}function db(){localStorage.removeItem(fb)}var ba,yr,xa,br,xr,Os,di,hi,Ds,pi,_r,mi,gi,Dt,As,rh,hb,oi,ch;class Bx{constructor(l){It(this,Dt);It(this,ba,null);It(this,yr,new Set);It(this,xa,null);It(this,br,null);It(this,xr,500);It(this,Os,null);It(this,di,!1);It(this,hi,!1);It(this,Ds,!1);It(this,pi,null);It(this,_r,"Подключаемся…");It(this,mi,0);It(this,gi,[]);this.session=l}get connected(){return He(this,hi)&&He(this,Ds)}get statusText(){return He(this,_r)}get hostId(){return He(this,pi)}on(l){return He(this,yr).add(l),()=>He(this,yr).delete(l)}onReconnect(l){ft(this,br,l)}onStatus(l){ft(this,xa,l)}connect(){He(this,di)||rn(this,Dt,rh).call(this)}send(l){if(!He(this,hi)){He(this,gi).length<64&&He(this,gi).push(l);return}rn(this,Dt,oi).call(this,{t:"client.frame",body:l})}close(){var l;ft(this,di,!0),He(this,Os)!==null&&window.clearTimeout(He(this,Os)),(l=He(this,ba))==null||l.close()}}ba=new WeakMap,yr=new WeakMap,xa=new WeakMap,br=new WeakMap,xr=new WeakMap,Os=new WeakMap,di=new WeakMap,hi=new WeakMap,Ds=new WeakMap,pi=new WeakMap,_r=new WeakMap,mi=new WeakMap,gi=new WeakMap,Dt=new WeakSet,As=function(l){var i;He(this,_r)!==l&&(ft(this,_r,l),(i=He(this,xa))==null||i.call(this))},rh=async function(){if(He(this,ba))return;if(!He(this,pi))try{ft(this,pi,await qx(this.session.token))}catch(r){rn(this,Dt,As).call(this,r instanceof Error?r.message:String(r)),rn(this,Dt,ch).call(this);return}const l=location.protocol==="https:"?"wss":"ws",i=new WebSocket(`${l}://${location.host}/relay/client`);ft(this,ba,i),i.addEventListener("open",()=>{rn(this,Dt,oi).call(this,{t:"client.hello",protocol:Ux,token:this.session.token})}),i.addEventListener("message",r=>{let o;try{o=JSON.parse(String(r.data))}catch{return}rn(this,Dt,hb).call(this,o)}),i.addEventListener("close",()=>{var r;ft(this,ba,null),ft(this,hi,!1),ft(this,Ds,!1),rn(this,Dt,As).call(this,"Нет связи с сервером"),(r=He(this,xa))==null||r.call(this),rn(this,Dt,ch).call(this)}),i.addEventListener("error",()=>i.close())},hb=function(l){var i,r,o,d,h,g,m;switch(l.t){case"client.ok":ft(this,xr,500),rn(this,Dt,oi).call(this,{t:"client.attach",hostId:He(this,pi)??"",...He(this,mi)>0?{sinceRseq:He(this,mi)}:{}});return;case"client.attached":ft(this,hi,!0),ft(this,Ds,l.online),ft(this,mi,l.rseq),rn(this,Dt,As).call(this,l.online?"Хост на связи":"Компьютер не на связи"),rn(this,Dt,oi).call(this,{t:"client.frame",body:{type:"hello",protocol:ub,clientName:"ccv-web-relay"}});const b=He(this,gi);ft(this,gi,[]);for(const x of b)rn(this,Dt,oi).call(this,{t:"client.frame",body:x});(i=He(this,br))==null||i.call(this),(r=He(this,xa))==null||r.call(this);return;case"host.frame":{l.rseq>0&&ft(this,mi,l.rseq);const x=l.body;for(const k of He(this,yr))k(x);return}case"host.online":ft(this,Ds,!0),rn(this,Dt,As).call(this,"Хост на связи"),(o=He(this,br))==null||o.call(this),(d=He(this,xa))==null||d.call(this);return;case"host.offline":ft(this,Ds,!1),rn(this,Dt,As).call(this,"Компьютер не на связи"),(h=He(this,xa))==null||h.call(this);return;case"ping":rn(this,Dt,oi).call(this,{t:"pong",nonce:l.nonce});return;case"error":if(l.code==="auth"){db(),location.href="/login";return}if(l.code==="not_found"){localStorage.removeItem(fo),rn(this,Dt,As).call(this,"Этот компьютер отвязан от аккаунта"),ft(this,di,!0),(g=He(this,ba))==null||g.close();return}l.code!=="offline"&&rn(this,Dt,As).call(this,l.message),(m=He(this,xa))==null||m.call(this);return}},oi=function(l){var i;((i=He(this,ba))==null?void 0:i.readyState)===WebSocket.OPEN&&He(this,ba).send(JSON.stringify(l))},ch=function(){if(He(this,di)||He(this,Os)!==null)return;const l=He(this,xr);ft(this,xr,Math.min(l*2,1e4)),ft(this,Os,window.setTimeout(()=>{ft(this,Os,null),rn(this,Dt,rh).call(this)},l))};async function qx(s){const l=new URLSearchParams(location.search).get("host");if(l)return localStorage.setItem(fo,l),l;const i=localStorage.getItem(fo);if(i)return i;const r=await fetch("/api/hosts",{headers:{authorization:`Bearer ${s}`}});if(r.status===401)throw db(),location.href="/login",new Error("нужен вход");const d=(await r.json()).hosts??[];if(d.length===1&&d[0])return localStorage.setItem(fo,d[0].id),d[0].id;throw location.href="/hosts",new Error("выберите компьютер")}function ho(){return location.pathname==="/app"||location.pathname.startsWith("/app/")?"relay":"local"}const Gx=`${location.protocol==="https:"?"wss":"ws"}://${location.host}/ws`;function Yx(){if(ho()==="local")return new Lx(Gx);const s=Hx();return s?new Bx(s):(location.replace(`/login?next=${encodeURIComponent(location.pathname+location.search)}`),null)}const ll={items:[],pending:[],lastSeq:0,contextTokens:null},Yd={entries:[],total:0,loading:!1};function pb(s){var l;return((l=s.entries[0])==null?void 0:l.seq)??1}function Fg(s){return s.total>0&&pb(s)>1}function Ix(s,l){const i=new Set(s.entries.map(o=>o.seq));return{entries:[...s.entries,...l.entries.filter(o=>!i.has(o.seq))].sort((o,d)=>o.seq-d.seq),total:l.total,loading:!1}}function Xx(s){return po(ll,s).items.map(l=>({...l,id:`h:${l.id}`}))}function po(s,l){let i=s;for(const r of l)r.seq<=i.lastSeq||(i={...Vx(i,r.event,r.seq),lastSeq:r.seq});return i}function Vx(s,l,i){var o,d;const r=s.items;switch(l.kind){case"user.message":return fa(s,{id:`u${i}`,kind:"user",text:l.text});case"assistant.delta":{const h=r.findIndex(m=>m.id===l.blockId);if(h===-1)return fa(s,{id:l.blockId,kind:"assistant",text:l.text,streaming:!0});const g=r[h];return tr(s,h,{...g,text:g.text+l.text})}case"assistant.text":{const h=r.findIndex(m=>m.id===l.blockId),g={id:l.blockId,kind:"assistant",text:l.text,streaming:!1};return h===-1?fa(s,g):tr(s,h,g)}case"thinking.delta":{const h=r.findIndex(m=>m.id===l.blockId);if(h===-1)return fa(s,{id:l.blockId,kind:"thinking",text:l.text});const g=r[h];return tr(s,h,{...g,text:g.text+l.text})}case"assistant.thinking":{const h=r.findIndex(m=>m.id===l.blockId),g={id:l.blockId,kind:"thinking",text:l.text};return h===-1?fa(s,g):tr(s,h,g)}case"tool.use":return fa(s,{id:`t${l.toolUseId}`,kind:"tool",toolUseId:l.toolUseId,name:l.name,input:l.input,result:null,isError:!1,awaitingPermission:!1});case"tool.result":{const h=r.findIndex(m=>m.kind==="tool"&&m.toolUseId===l.toolUseId);if(h===-1)return s;const g=r[h];return tr(s,h,{...g,result:l.content,isError:l.isError,awaitingPermission:!1})}case"permission.request":return{...s,pending:[...s.pending,{requestId:l.requestId,toolName:l.toolName,input:l.input,...l.reason?{reason:l.reason}:{},...l.questions?{questions:l.questions}:{},...l.toolUseId?{toolUseId:l.toolUseId}:{}}]};case"permission.resolved":{const h=s.pending.find(m=>m.requestId===l.requestId),g=s.pending.filter(m=>m.requestId!==l.requestId);if(l.answers&&(h!=null&&h.toolUseId)){const m=r.findIndex(b=>b.kind==="tool"&&b.toolUseId===h.toolUseId);if(m!==-1){const b=r[m];return tr({...s,pending:g},m,{...b,answers:l.answers})}}return l.decision==="allow"?{...s,pending:g}:fa({...s,pending:g},{id:`p${i}`,kind:"notice",tone:"info",text:`Отклонено${l.reason?`: ${l.reason}`:""}`})}case"result":{const h=s.items.map(m=>m.kind==="assistant"&&m.streaming?{...m,streaming:!1}:m),g=l.contextTokens??s.contextTokens;return fa({...s,items:h,contextTokens:g},{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"?s:fa(s,{id:`s${i}`,kind:"notice",tone:"info",text:"Контекст сжат"});case"error":return fa(s,{id:`e${i}`,kind:"notice",tone:"error",text:l.message});case"state":return s;default:return s}}function fa(s,l){return{...s,items:[...s.items,l]}}function tr(s,l,i){const r=s.items.slice();return r[l]=i,{...s,items:r}}const uh="ccv:theme",Id=["system","light","dark"];function Qx(){const[s,l]=S.useState($x);S.useEffect(()=>{const o=window.matchMedia("(prefers-color-scheme: dark)"),d=()=>{const h=s==="dark"||s==="system"&&o.matches;document.documentElement.dataset.theme=h?"dark":"light"};return d(),o.addEventListener("change",d),()=>o.removeEventListener("change",d)},[s]);const i=S.useCallback(o=>{try{localStorage.setItem(uh,o)}catch{}l(o)},[]),r=S.useCallback(()=>{l(o=>{const d=Id[(Id.indexOf(o)+1)%Id.length];try{localStorage.setItem(uh,d)}catch{}return d})},[]);return[s,i,r]}function $x(){try{const s=localStorage.getItem(uh);if(s==="light"||s==="dark"||s==="system")return s}catch{}return"system"}const mb=[{value:"default",hint:"спрашивать перед каждым действием"},{value:"acceptEdits",hint:"правки файлов без подтверждения"},{value:"plan",hint:"только чтение и план, без изменений"},{value:"auto",hint:"спрашивать только о рискованном — решает сам"},{value:"bypassPermissions",hint:"ничего не спрашивать"}],yi={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:"вопроса"}},Zx=320,gb="ccv:panes";function Kx(s){return`--${s}-w`}function yb(s,l){const i=yi[s];return Math.round(Math.min(i.max,Math.max(i.min,l)))}function Jx(){const s={};for(const l of Object.keys(yi))s[l]=yi[l].width;try{const l=localStorage.getItem(gb);if(l){const i=JSON.parse(l);for(const r of Object.keys(yi)){const o=i[r];typeof o=="number"&&Number.isFinite(o)&&(s[r]=yb(r,o))}}}catch{}return s}function Fx(){const[s,l]=S.useState(Jx),i=S.useCallback(h=>{try{localStorage.setItem(gb,JSON.stringify(h))}catch{}},[]),r=S.useCallback((h,g)=>{l(m=>{const b=yb(h,g);if(m[h]===b)return m;const x={...m,[h]:b};return i(x),x})},[i]),o=S.useCallback(h=>{l(g=>{const m={...g,[h]:yi[h].width};return i(m),m})},[i]),d={};for(const h of Object.keys(yi))d[Kx(h)]=`${s[h]}px`;return{widths:s,style:d,setWidth:r,reset:o}}const Xd=260,bb=120,Wx=200,Wg="ccv:terminal-h";function Pg(s,l){return Math.round(Math.min(l,Math.max(bb,s)))}function Px(){const[s,l]=S.useState(()=>{try{const d=localStorage.getItem(Wg);if(d){const h=Number(d);if(Number.isFinite(h))return Pg(h,1/0)}}catch{}return Xd}),i=S.useCallback(d=>{try{localStorage.setItem(Wg,String(d))}catch{}},[]),r=S.useCallback((d,h)=>{const g=Pg(d,h);l(m=>m===g?m:(i(g),g))},[i]),o=S.useCallback(()=>{l(Xd),i(Xd)},[i]);return{height:s,setHeight:r,reset:o}}function xb(s){const[l,i]=S.useState(()=>typeof window>"u"?!1:window.matchMedia(s).matches);return S.useEffect(()=>{const r=window.matchMedia(s),o=()=>i(r.matches);return o(),r.addEventListener("change",o),()=>r.removeEventListener("change",o)},[s]),l}const e_={height:0,offsetTop:0,offsetLeft:0};function ey(){if(typeof window>"u")return e_;const s=window.visualViewport;return s?{height:s.height,offsetTop:s.offsetTop,offsetLeft:s.offsetLeft}:{height:window.innerHeight,offsetTop:0,offsetLeft:0}}function t_(s){const[l,i]=S.useState(ey);return S.useEffect(()=>{if(!s)return;const r=window.visualViewport,o=()=>{const d=ey();i(h=>h.height===d.height&&h.offsetTop===d.offsetTop&&h.offsetLeft===d.offsetLeft?h:d)};return o(),r?(r.addEventListener("resize",o),r.addEventListener("scroll",o),()=>{r.removeEventListener("resize",o),r.removeEventListener("scroll",o)}):(window.addEventListener("resize",o),()=>window.removeEventListener("resize",o))},[s]),l}function vh(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var _i=vh();function _b(s){_i=s}var fi={exec:()=>null};function nr(s){let l=[];return i=>{let r=Math.max(0,Math.min(3,i-1)),o=l[r];return o||(o=s(r),l[r]=o),o}}function it(s,l=""){let i=typeof s=="string"?s:s.source,r={replace:(o,d)=>{let h=typeof d=="string"?d:d.source;return h=h.replace(zn.caret,"$1"),i=i.replace(o,h),r},getRegex:()=>new RegExp(i,l)};return r}var n_=((s="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+s)}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:s=>new RegExp(`^( {0,3}${s})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:nr(s=>new RegExp(`^ {0,${s}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:nr(s=>new RegExp(`^ {0,${s}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:nr(s=>new RegExp(`^ {0,${s}}(?:\`\`\`|~~~)`)),headingBeginRegex:nr(s=>new RegExp(`^ {0,${s}}#`)),htmlBeginRegex:nr(s=>new RegExp(`^ {0,${s}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:nr(s=>new RegExp(`^ {0,${s}}>`))},l_=/^(?:[ \t]*(?:\n|$))+/,a_=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,s_=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Dc=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,i_=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Sh=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,vb=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Sb=it(vb).replace(/bull/g,Sh).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(),r_=it(vb).replace(/bull/g,Sh).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(),kh=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,c_=/^[^\n]+/,wh=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,u_=it(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",wh).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),o_=it(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Sh).getRegex(),To="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",Th=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,f_=it("^ {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",Th).replace("tag",To).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),kb=s=>it(kh).replace("hr",Dc).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~~~)[^\\n]*\\n").replace("list",s).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",To).getRegex(),d_=kb(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),h_=kb(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),p_=it(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",h_).getRegex(),Nh={blockquote:p_,code:a_,def:u_,fences:s_,heading:i_,hr:Dc,html:f_,lheading:Sb,list:o_,newline:l_,paragraph:d_,table:fi,text:c_},ty=it("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Dc).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",To).getRegex(),m_={...Nh,lheading:r_,table:ty,paragraph:it(kh).replace("hr",Dc).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ty).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",To).getRegex()},g_={...Nh,html:it(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Th).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:fi,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:it(kh).replace("hr",Dc).replace("heading",` *#{1,6} *[^
|
|
51
|
+
]`).replace("lheading",Sb).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},y_=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,b_=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,wb=/^( {2,}|\\)\n(?!\s*$)/,x_=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,vr=/[\p{P}\p{S}]/u,No=/[\s\p{P}\p{S}]/u,jh=/[^\s\p{P}\p{S}]/u,__=it(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,No).getRegex(),Tb=/(?!~)[\p{P}\p{S}]/u,v_=/(?!~)[\s\p{P}\p{S}]/u,S_=/(?:[^\s\p{P}\p{S}]|~)/u,k_=it(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",n_?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Nb=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,w_=it(Nb,"u").replace(/punct/g,vr).getRegex(),T_=it(Nb,"u").replace(/punct/g,Tb).getRegex(),jb="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",N_=it(jb,"gu").replace(/notPunctSpace/g,jh).replace(/punctSpace/g,No).replace(/punct/g,vr).getRegex(),j_=it(jb,"gu").replace(/notPunctSpace/g,S_).replace(/punctSpace/g,v_).replace(/punct/g,Tb).getRegex(),E_=it("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,jh).replace(/punctSpace/g,No).replace(/punct/g,vr).getRegex(),A_=it(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,vr).getRegex(),C_="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",R_=it(C_,"gu").replace(/notPunctSpace/g,jh).replace(/punctSpace/g,No).replace(/punct/g,vr).getRegex(),M_=it(/\\(punct)/,"gu").replace(/punct/g,vr).getRegex(),O_=it(/^<(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(),D_=it(Th).replace("(?:-->|$)","-->").getRegex(),z_=it("^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",D_).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),go=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,L_=it(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",go).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Eb=it(/^!?\[(label)\]\[(ref)\]/).replace("label",go).replace("ref",wh).getRegex(),Ab=it(/^!?\[(ref)\](?:\[\])?/).replace("ref",wh).getRegex(),U_=it("reflink|nolink(?!\\()","g").replace("reflink",Eb).replace("nolink",Ab).getRegex(),ny=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Eh={_backpedal:fi,anyPunctuation:M_,autolink:O_,blockSkip:k_,br:wb,code:b_,del:fi,delLDelim:fi,delRDelim:fi,emStrongLDelim:w_,emStrongRDelimAst:N_,emStrongRDelimUnd:E_,escape:y_,link:L_,nolink:Ab,punctuation:__,reflink:Eb,reflinkSearch:U_,tag:z_,text:x_,url:fi},H_={...Eh,link:it(/^!?\[(label)\]\((.*?)\)/).replace("label",go).getRegex(),reflink:it(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",go).getRegex()},oh={...Eh,emStrongRDelimAst:j_,emStrongLDelim:T_,delLDelim:A_,delRDelim:R_,url:it(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",ny).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:it(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",ny).getRegex()},B_={...oh,br:it(wb).replace("{2,}","*").getRegex(),text:it(oh.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Pu={normal:Nh,gfm:m_,pedantic:g_},vc={normal:Eh,gfm:oh,breaks:B_,pedantic:H_},q_={"&":"&","<":"<",">":">",'"':""","'":"'"},ly=s=>q_[s];function ma(s,l){if(l){if(zn.escapeTest.test(s))return s.replace(zn.escapeReplace,ly)}else if(zn.escapeTestNoEncode.test(s))return s.replace(zn.escapeReplaceNoEncode,ly);return s}function ay(s){try{s=encodeURI(s).replace(zn.percentDecode,"%")}catch{return null}return s}function sy(s,l){var d;let i=s.replace(zn.findPipe,(h,g,m)=>{let b=!1,x=g;for(;--x>=0&&m[x]==="\\";)b=!b;return b?"|":" |"}),r=i.split(zn.splitPipe),o=0;if(r[0].trim()||r.shift(),r.length>0&&!((d=r.at(-1))!=null&&d.trim())&&r.pop(),l)if(r.length>l)r.splice(l);else for(;r.length<l;)r.push("");for(;o<r.length;o++)r[o]=r[o].trim().replace(zn.slashPipe,"|");return r}function js(s,l,i){let r=s.length;if(r===0)return"";let o=0;for(;o<r&&s.charAt(r-o-1)===l;)o++;return s.slice(0,r-o)}function iy(s){let l=s.split(`
|
|
52
|
+
`),i=l.length-1;for(;i>=0&&zn.blankLine.test(l[i]);)i--;return l.length-i<=2?s:l.slice(0,i+1).join(`
|
|
53
|
+
`)}function G_(s,l){if(s.indexOf(l[1])===-1)return-1;let i=0;for(let r=0;r<s.length;r++)if(s[r]==="\\")r++;else if(s[r]===l[0])i++;else if(s[r]===l[1]&&(i--,i<0))return r;return i>0?-2:-1}function Y_(s,l=0){let i=l,r="";for(let o of s)if(o===" "){let d=4-i%4;r+=" ".repeat(d),i+=d}else r+=o,i++;return r}function ry(s,l,i,r,o){let d=l.href,h=l.title||null,g=s[1].replace(o.other.outputLinkReplace,"$1");r.state.inLink=!0;let m={type:s[0].charAt(0)==="!"?"image":"link",raw:i,href:d,title:h,text:g,tokens:r.inlineTokens(g)};return r.state.inLink=!1,m}function I_(s,l,i){let r=s.match(i.other.indentCodeCompensation);if(r===null)return l;let o=r[1];return l.split(`
|
|
54
|
+
`).map(d=>{let h=d.match(i.other.beginningSpace);if(h===null)return d;let[g]=h;return g.length>=o.length?d.slice(o.length):d}).join(`
|
|
55
|
+
`)}var yo=class{constructor(s){kt(this,"options");kt(this,"rules");kt(this,"lexer");this.options=s||_i}space(s){let l=this.rules.block.newline.exec(s);if(l&&l[0].length>0)return{type:"space",raw:l[0]}}code(s){let l=this.rules.block.code.exec(s);if(l){let i=this.options.pedantic?l[0]:iy(l[0]),r=i.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:i,codeBlockStyle:"indented",text:r}}}fences(s){let l=this.rules.block.fences.exec(s);if(l){let i=l[0],r=I_(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:r}}}heading(s){let l=this.rules.block.heading.exec(s);if(l){let i=l[2].trim();if(this.rules.other.endingHash.test(i)){let r=js(i,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(i=r.trim())}return{type:"heading",raw:js(l[0],`
|
|
56
|
+
`),depth:l[1].length,text:i,tokens:this.lexer.inline(i)}}}hr(s){let l=this.rules.block.hr.exec(s);if(l)return{type:"hr",raw:js(l[0],`
|
|
57
|
+
`)}}blockquote(s){let l=this.rules.block.blockquote.exec(s);if(l){let i=js(l[0],`
|
|
58
|
+
`).split(`
|
|
59
|
+
`),r="",o="",d=[];for(;i.length>0;){let h=!1,g=[],m;for(m=0;m<i.length;m++)if(this.rules.other.blockquoteStart.test(i[m]))g.push(i[m]),h=!0;else if(!h)g.push(i[m]);else break;i=i.slice(m);let b=g.join(`
|
|
60
|
+
`),x=b.replace(this.rules.other.blockquoteSetextReplace,`
|
|
61
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|
62
|
+
${b}`:b,o=o?`${o}
|
|
63
|
+
${x}`:x;let k=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(x,d,!0),this.lexer.state.top=k,i.length===0)break;let _=d.at(-1);if((_==null?void 0:_.type)==="code")break;if((_==null?void 0:_.type)==="blockquote"){let A=_,T=A.raw+`
|
|
64
|
+
`+i.join(`
|
|
65
|
+
`),L=this.blockquote(T);d[d.length-1]=L,r=r.substring(0,r.length-A.raw.length)+L.raw,o=o.substring(0,o.length-A.text.length)+L.text;break}else if((_==null?void 0:_.type)==="list"){let A=_,T=A.raw+`
|
|
66
|
+
`+i.join(`
|
|
67
|
+
`),L=this.list(T);d[d.length-1]=L,r=r.substring(0,r.length-_.raw.length)+L.raw,o=o.substring(0,o.length-A.raw.length)+L.raw,i=T.substring(d.at(-1).raw.length).split(`
|
|
68
|
+
`);continue}}return{type:"blockquote",raw:r,tokens:d,text:o}}}list(s){let l=this.rules.block.list.exec(s);if(l){let i=l[1].trim(),r=i.length>1,o={type:"list",raw:"",ordered:r,start:r?+i.slice(0,-1):"",loose:!1,items:[]};i=r?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=r?i:"[*+-]");let d=this.rules.other.listItemRegex(i),h=!1;for(;s;){let m=!1,b="",x="";if(!(l=d.exec(s))||this.rules.block.hr.test(s))break;b=l[0],s=s.substring(b.length);let k=Y_(l[2].split(`
|
|
69
|
+
`,1)[0],l[1].length),_=s.split(`
|
|
70
|
+
`,1)[0],A=!k.trim(),T=0;if(this.options.pedantic?(T=2,x=k.trimStart()):A?T=l[1].length+1:(T=k.search(this.rules.other.nonSpaceChar),T=T>4?1:T,x=k.slice(T),T+=l[1].length),A&&this.rules.other.blankLine.test(_)&&(b+=_+`
|
|
71
|
+
`,s=s.substring(_.length+1),m=!0),!m){let L=this.rules.other.nextBulletRegex(T),O=this.rules.other.hrRegex(T),F=this.rules.other.fencesBeginRegex(T),q=this.rules.other.headingBeginRegex(T),Q=this.rules.other.htmlBeginRegex(T),E=this.rules.other.blockquoteBeginRegex(T);for(;s;){let V=s.split(`
|
|
72
|
+
`,1)[0],D;if(_=V,this.options.pedantic?(_=_.replace(this.rules.other.listReplaceNesting," "),D=_):D=_.replace(this.rules.other.tabCharGlobal," "),F.test(_)||q.test(_)||Q.test(_)||E.test(_)||L.test(_)||O.test(_))break;if(D.search(this.rules.other.nonSpaceChar)>=T||!_.trim())x+=`
|
|
73
|
+
`+D.slice(T);else{if(A||k.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||F.test(k)||q.test(k)||O.test(k))break;x+=`
|
|
74
|
+
`+_}A=!_.trim(),b+=V+`
|
|
75
|
+
`,s=s.substring(V.length+1),k=D.slice(T)}}o.loose||(h?o.loose=!0:this.rules.other.doubleBlankLine.test(b)&&(h=!0)),o.items.push({type:"list_item",raw:b,task:!!this.options.gfm&&this.rules.other.listIsTask.test(x),loose:!1,text:x,tokens:[]}),o.raw+=b}let g=o.items.at(-1);if(g)g.raw=g.raw.trimEnd(),g.text=g.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 b=m.tokens[0];if(m.task&&((b==null?void 0:b.type)==="text"||(b==null?void 0:b.type)==="paragraph")){m.text=m.text.replace(this.rules.other.listReplaceTask,""),b.raw=b.raw.replace(this.rules.other.listReplaceTask,""),b.text=b.text.replace(this.rules.other.listReplaceTask,"");for(let k=this.lexer.inlineQueue.length-1;k>=0;k--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[k].src)){this.lexer.inlineQueue[k].src=this.lexer.inlineQueue[k].src.replace(this.rules.other.listReplaceTask,"");break}let x=this.rules.other.listTaskCheckbox.exec(m.raw);if(x){let k={type:"checkbox",raw:x[0]+" ",checked:x[0]!=="[ ]"};m.checked=k.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=k.raw+m.tokens[0].raw,m.tokens[0].text=k.raw+m.tokens[0].text,m.tokens[0].tokens.unshift(k)):m.tokens.unshift({type:"paragraph",raw:k.raw,text:k.raw,tokens:[k]}):m.tokens.unshift(k)}}else m.task&&(m.task=!1);if(!o.loose){let x=m.tokens.filter(_=>_.type==="space"),k=x.length>0&&x.some(_=>this.rules.other.anyLine.test(_.raw));o.loose=k}}if(o.loose)for(let m of o.items){m.loose=!0;for(let b of m.tokens)b.type==="text"&&(b.type="paragraph")}return o}}html(s){let l=this.rules.block.html.exec(s);if(l){let i=iy(l[0]);return{type:"html",block:!0,raw:i,pre:l[1]==="pre"||l[1]==="script"||l[1]==="style",text:i}}}def(s){let l=this.rules.block.def.exec(s);if(l){let i=l[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=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:js(l[0],`
|
|
76
|
+
`),href:r,title:o}}}table(s){var h;let l=this.rules.block.table.exec(s);if(!l||!this.rules.other.tableDelimiter.test(l[2]))return;let i=sy(l[1]),r=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:js(l[0],`
|
|
78
|
+
`),header:[],align:[],rows:[]};if(i.length===r.length){for(let g of r)this.rules.other.tableAlignRight.test(g)?d.align.push("right"):this.rules.other.tableAlignCenter.test(g)?d.align.push("center"):this.rules.other.tableAlignLeft.test(g)?d.align.push("left"):d.align.push(null);for(let g=0;g<i.length;g++)d.header.push({text:i[g],tokens:this.lexer.inline(i[g]),header:!0,align:d.align[g]});for(let g of o)d.rows.push(sy(g,d.header.length).map((m,b)=>({text:m,tokens:this.lexer.inline(m),header:!1,align:d.align[b]})));return d}}lheading(s){let l=this.rules.block.lheading.exec(s);if(l){let i=l[1].trim();return{type:"heading",raw:js(l[0],`
|
|
79
|
+
`),depth:l[2].charAt(0)==="="?1:2,text:i,tokens:this.lexer.inline(i)}}}paragraph(s){let l=this.rules.block.paragraph.exec(s);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(s){let l=this.rules.block.text.exec(s);if(l)return{type:"text",raw:l[0],text:l[0],tokens:this.lexer.inline(l[0])}}escape(s){let l=this.rules.inline.escape.exec(s);if(l)return{type:"escape",raw:l[0],text:l[1]}}tag(s){let l=this.rules.inline.tag.exec(s);if(l)return!this.lexer.state.inLink&&this.rules.other.startATag.test(l[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(l[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(l[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(l[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:l[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:l[0]}}link(s){let l=this.rules.inline.link.exec(s);if(l){let i=l[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(i)){if(!this.rules.other.endAngleBracket.test(i))return;let d=js(i.slice(0,-1),"\\");if((i.length-d.length)%2===0)return}else{let d=G_(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 r=l[2],o="";if(this.options.pedantic){let d=this.rules.other.pedanticHrefTitle.exec(r);d&&(r=d[1],o=d[3])}else o=l[3]?l[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(i)?r=r.slice(1):r=r.slice(1,-1)),ry(l,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},l[0],this.lexer,this.rules)}}reflink(s,l){let i;if((i=this.rules.inline.reflink.exec(s))||(i=this.rules.inline.nolink.exec(s))){let r=(i[2]||i[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=l[r.toLowerCase()];if(!o){let d=i[0].charAt(0);return{type:"text",raw:d,text:d}}return ry(i,o,i[0],this.lexer,this.rules)}}emStrong(s,l,i=""){let r=this.rules.inline.emStrongLDelim.exec(s);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&i.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!i||this.rules.inline.punctuation.exec(i))){let o=[...r[0]].length-1,d,h,g=o,m=0,b=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(b.lastIndex=0,l=l.slice(-1*s.length+o);(r=b.exec(l))!==null;){if(d=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!d)continue;if(h=[...d].length,r[3]||r[4]){g+=h;continue}else if((r[5]||r[6])&&o%3&&!((o+h)%3)){m+=h;continue}if(g-=h,g>0)continue;h=Math.min(h,h+g+m);let x=[...r[0]][0].length,k=s.slice(0,o+r.index+x+h);if(Math.min(o,h)%2){let A=k.slice(1,-1);return{type:"em",raw:k,text:A,tokens:this.lexer.inlineTokens(A)}}let _=k.slice(2,-2);return{type:"strong",raw:k,text:_,tokens:this.lexer.inlineTokens(_)}}}}codespan(s){let l=this.rules.inline.code.exec(s);if(l){let i=l[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(i),o=this.rules.other.startingSpaceChar.test(i)&&this.rules.other.endingSpaceChar.test(i);return r&&o&&(i=i.substring(1,i.length-1)),{type:"codespan",raw:l[0],text:i}}}br(s){let l=this.rules.inline.br.exec(s);if(l)return{type:"br",raw:l[0]}}del(s,l,i=""){let r=this.rules.inline.delLDelim.exec(s);if(r&&(!r[1]||!i||this.rules.inline.punctuation.exec(i))){let o=[...r[0]].length-1,d,h,g=o,m=this.rules.inline.delRDelim;for(m.lastIndex=0,l=l.slice(-1*s.length+o);(r=m.exec(l))!==null;){if(d=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!d||(h=[...d].length,h!==o))continue;if(r[3]||r[4]){g+=h;continue}if(g-=h,g>0)continue;h=Math.min(h,h+g);let b=[...r[0]][0].length,x=s.slice(0,o+r.index+b+h),k=x.slice(o,-o);return{type:"del",raw:x,text:k,tokens:this.lexer.inlineTokens(k)}}}}autolink(s){let l=this.rules.inline.autolink.exec(s);if(l){let i,r;return l[2]==="@"?(i=l[1],r="mailto:"+i):(i=l[1],r=i),{type:"link",raw:l[0],text:i,href:r,tokens:[{type:"text",raw:i,text:i}]}}}url(s){var i;let l;if(l=this.rules.inline.url.exec(s)){let r,o;if(l[2]==="@")r=l[0],o="mailto:"+r;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]);r=l[0],l[1]==="www."?o="http://"+l[0]:o=l[0]}return{type:"link",raw:l[0],text:r,href:o,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(s){let l=this.rules.inline.text.exec(s);if(l){let i=this.lexer.state.inRawBlock;return{type:"text",raw:l[0],text:l[0],escaped:i}}}},Vl=class fh{constructor(l){kt(this,"tokens");kt(this,"options");kt(this,"state");kt(this,"inlineQueue");kt(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=l||_i,this.options.tokenizer=this.options.tokenizer||new yo,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:Pu.normal,inline:vc.normal};this.options.pedantic?(i.block=Pu.pedantic,i.inline=vc.pedantic):this.options.gfm&&(i.block=Pu.gfm,this.options.breaks?i.inline=vc.breaks:i.inline=vc.gfm),this.tokenizer.rules=i}static get rules(){return{block:Pu,inline:vc}}static lex(l,i){return new fh(i).lex(l)}static lexInline(l,i){return new fh(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 r=this.inlineQueue[i];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(l,i=[],r=!1){var d,h,g;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(x=>(m=x.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 x=i.at(-1);m.raw.length===1&&x!==void 0?x.raw+=`
|
|
82
|
+
`:i.push(m);continue}if(m=this.tokenizer.code(l)){l=l.substring(m.raw.length);let x=i.at(-1);(x==null?void 0:x.type)==="paragraph"||(x==null?void 0:x.type)==="text"?(x.raw+=(x.raw.endsWith(`
|
|
83
|
+
`)?"":`
|
|
84
|
+
`)+m.raw,x.text+=`
|
|
85
|
+
`+m.text,this.inlineQueue.at(-1).src=x.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 x=i.at(-1);(x==null?void 0:x.type)==="paragraph"||(x==null?void 0:x.type)==="text"?(x.raw+=(x.raw.endsWith(`
|
|
86
|
+
`)?"":`
|
|
87
|
+
`)+m.raw,x.text+=`
|
|
88
|
+
`+m.raw,this.inlineQueue.at(-1).src=x.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 b=l;if((g=this.options.extensions)!=null&&g.startBlock){let x=1/0,k=l.slice(1),_;this.options.extensions.startBlock.forEach(A=>{_=A.call({lexer:this},k),typeof _=="number"&&_>=0&&(x=Math.min(x,_))}),x<1/0&&x>=0&&(b=l.substring(0,x+1))}if(this.state.top&&(m=this.tokenizer.paragraph(b))){let x=i.at(-1);r&&(x==null?void 0:x.type)==="paragraph"?(x.raw+=(x.raw.endsWith(`
|
|
89
|
+
`)?"":`
|
|
90
|
+
`)+m.raw,x.text+=`
|
|
91
|
+
`+m.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=x.text):i.push(m),r=b.length!==l.length,l=l.substring(m.raw.length);continue}if(m=this.tokenizer.text(l)){l=l.substring(m.raw.length);let x=i.at(-1);(x==null?void 0:x.type)==="text"?(x.raw+=(x.raw.endsWith(`
|
|
92
|
+
`)?"":`
|
|
93
|
+
`)+m.raw,x.text+=`
|
|
94
|
+
`+m.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=x.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 g,m,b,x,k;this.tokenizer.lexer=this;let r=l;if(this.tokens.links){let _=Object.keys(this.tokens.links);_.length>0&&(r=r.replace(this.tokenizer.rules.inline.reflinkSearch,A=>_.includes(A.slice(A.lastIndexOf("[")+1,-1))?"["+"a".repeat(A.length-2)+"]":A))}r=r.replace(this.tokenizer.rules.inline.anyPunctuation,"++"),r=r.replace(this.tokenizer.rules.inline.blockSkip,(_,A,T)=>{let L=T?T.length:0;return _.slice(0,L)+"["+"a".repeat(_.length-L-2)+"]"}),r=((m=(g=this.options.hooks)==null?void 0:g.emStrongMask)==null?void 0:m.call({lexer:this},r))??r;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 _;if((x=(b=this.options.extensions)==null?void 0:b.inline)!=null&&x.some(T=>(_=T.call({lexer:this},l,i))?(l=l.substring(_.raw.length),i.push(_),!0):!1))continue;if(_=this.tokenizer.escape(l)){l=l.substring(_.raw.length),i.push(_);continue}if(_=this.tokenizer.tag(l)){l=l.substring(_.raw.length),i.push(_);continue}if(_=this.tokenizer.link(l)){l=l.substring(_.raw.length),i.push(_);continue}if(_=this.tokenizer.reflink(l,this.tokens.links)){l=l.substring(_.raw.length);let T=i.at(-1);_.type==="text"&&(T==null?void 0:T.type)==="text"?(T.raw+=_.raw,T.text+=_.text):i.push(_);continue}if(_=this.tokenizer.emStrong(l,r,d)){l=l.substring(_.raw.length),i.push(_);continue}if(_=this.tokenizer.codespan(l)){l=l.substring(_.raw.length),i.push(_);continue}if(_=this.tokenizer.br(l)){l=l.substring(_.raw.length),i.push(_);continue}if(_=this.tokenizer.del(l,r,d)){l=l.substring(_.raw.length),i.push(_);continue}if(_=this.tokenizer.autolink(l)){l=l.substring(_.raw.length),i.push(_);continue}if(!this.state.inLink&&(_=this.tokenizer.url(l))){l=l.substring(_.raw.length),i.push(_);continue}let A=l;if((k=this.options.extensions)!=null&&k.startInline){let T=1/0,L=l.slice(1),O;this.options.extensions.startInline.forEach(F=>{O=F.call({lexer:this},L),typeof O=="number"&&O>=0&&(T=Math.min(T,O))}),T<1/0&&T>=0&&(A=l.substring(0,T+1))}if(_=this.tokenizer.inlineText(A)){l=l.substring(_.raw.length),_.raw.slice(-1)!=="_"&&(d=_.raw.slice(-1)),o=!0;let T=i.at(-1);(T==null?void 0:T.type)==="text"?(T.raw+=_.raw,T.text+=_.text):i.push(_);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(s){kt(this,"options");kt(this,"parser");this.options=s||_i}space(s){return""}code({text:s,lang:l,escaped:i}){var d;let r=(d=(l||"").match(zn.notSpaceStart))==null?void 0:d[0],o=s.replace(zn.endingNewline,"")+`
|
|
95
|
+
`;return r?'<pre><code class="language-'+ma(r)+'">'+(i?o:ma(o,!0))+`</code></pre>
|
|
96
|
+
`:"<pre><code>"+(i?o:ma(o,!0))+`</code></pre>
|
|
97
|
+
`}blockquote({tokens:s}){return`<blockquote>
|
|
98
|
+
${this.parser.parse(s)}</blockquote>
|
|
99
|
+
`}html({text:s}){return s}def(s){return""}heading({tokens:s,depth:l}){return`<h${l}>${this.parser.parseInline(s)}</h${l}>
|
|
100
|
+
`}hr(s){return`<hr>
|
|
101
|
+
`}list(s){let l=s.ordered,i=s.start,r="";for(let h=0;h<s.items.length;h++){let g=s.items[h];r+=this.listitem(g)}let o=l?"ol":"ul",d=l&&i!==1?' start="'+i+'"':"";return"<"+o+d+`>
|
|
102
|
+
`+r+"</"+o+`>
|
|
103
|
+
`}listitem(s){return`<li>${this.parser.parse(s.tokens)}</li>
|
|
104
|
+
`}checkbox({checked:s}){return"<input "+(s?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:s}){return`<p>${this.parser.parseInline(s)}</p>
|
|
105
|
+
`}table(s){let l="",i="";for(let o=0;o<s.header.length;o++)i+=this.tablecell(s.header[o]);l+=this.tablerow({text:i});let r="";for(let o=0;o<s.rows.length;o++){let d=s.rows[o];i="";for(let h=0;h<d.length;h++)i+=this.tablecell(d[h]);r+=this.tablerow({text:i})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
|
|
106
|
+
<thead>
|
|
107
|
+
`+l+`</thead>
|
|
108
|
+
`+r+`</table>
|
|
109
|
+
`}tablerow({text:s}){return`<tr>
|
|
110
|
+
${s}</tr>
|
|
111
|
+
`}tablecell(s){let l=this.parser.parseInline(s.tokens),i=s.header?"th":"td";return(s.align?`<${i} align="${s.align}">`:`<${i}>`)+l+`</${i}>
|
|
112
|
+
`}strong({tokens:s}){return`<strong>${this.parser.parseInline(s)}</strong>`}em({tokens:s}){return`<em>${this.parser.parseInline(s)}</em>`}codespan({text:s}){return`<code>${ma(s,!0)}</code>`}br(s){return"<br>"}del({tokens:s}){return`<del>${this.parser.parseInline(s)}</del>`}link({href:s,title:l,tokens:i}){let r=this.parser.parseInline(i),o=ay(s);if(o===null)return r;s=o;let d='<a href="'+s+'"';return l&&(d+=' title="'+ma(l)+'"'),d+=">"+r+"</a>",d}image({href:s,title:l,text:i,tokens:r}){r&&(i=this.parser.parseInline(r,this.parser.textRenderer));let o=ay(s);if(o===null)return ma(i);s=o;let d=`<img src="${s}" alt="${ma(i)}"`;return l&&(d+=` title="${ma(l)}"`),d+=">",d}text(s){return"tokens"in s&&s.tokens?this.parser.parseInline(s.tokens):"escaped"in s&&s.escaped?s.text:ma(s.text)}},Ah=class{strong({text:s}){return s}em({text:s}){return s}codespan({text:s}){return s}del({text:s}){return s}html({text:s}){return s}text({text:s}){return s}link({text:s}){return""+s}image({text:s}){return""+s}br(){return""}checkbox({raw:s}){return s}},Ql=class dh{constructor(l){kt(this,"options");kt(this,"renderer");kt(this,"textRenderer");this.options=l||_i,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 Ah}static parse(l,i){return new dh(i).parse(l)}static parseInline(l,i){return new dh(i).parseInline(l)}parse(l){var r,o;this.renderer.parser=this;let i="";for(let d=0;d<l.length;d++){let h=l[d];if((o=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&o[h.type]){let m=h,b=this.options.extensions.renderers[m.type].call({parser:this},m);if(b!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(m.type)){i+=b||"";continue}}let g=h;switch(g.type){case"space":{i+=this.renderer.space(g);break}case"hr":{i+=this.renderer.hr(g);break}case"heading":{i+=this.renderer.heading(g);break}case"code":{i+=this.renderer.code(g);break}case"table":{i+=this.renderer.table(g);break}case"blockquote":{i+=this.renderer.blockquote(g);break}case"list":{i+=this.renderer.list(g);break}case"checkbox":{i+=this.renderer.checkbox(g);break}case"html":{i+=this.renderer.html(g);break}case"def":{i+=this.renderer.def(g);break}case"paragraph":{i+=this.renderer.paragraph(g);break}case"text":{i+=this.renderer.text(g);break}default:{let m='Token with "'+g.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 r="";for(let h=0;h<l.length;h++){let g=l[h];if((d=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&d[g.type]){let b=this.options.extensions.renderers[g.type].call({parser:this},g);if(b!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(g.type)){r+=b||"";continue}}let m=g;switch(m.type){case"escape":{r+=i.text(m);break}case"html":{r+=i.html(m);break}case"link":{r+=i.link(m);break}case"image":{r+=i.image(m);break}case"checkbox":{r+=i.checkbox(m);break}case"strong":{r+=i.strong(m);break}case"em":{r+=i.em(m);break}case"codespan":{r+=i.codespan(m);break}case"br":{r+=i.br(m);break}case"del":{r+=i.del(m);break}case"text":{r+=i.text(m);break}default:{let b='Token with "'+m.type+'" type was not found.';if(this.options.silent)return console.error(b),"";throw new Error(b)}}}return r}},oo,jc=(oo=class{constructor(s){kt(this,"options");kt(this,"block");this.options=s||_i}preprocess(s){return s}postprocess(s){return s}processAllTokens(s){return s}emStrongMask(s){return s}provideLexer(s=this.block){return s?Vl.lex:Vl.lexInline}provideParser(s=this.block){return s?Ql.parse:Ql.parseInline}},kt(oo,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),kt(oo,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),oo),X_=class{constructor(...s){kt(this,"defaults",vh());kt(this,"options",this.setOptions);kt(this,"parse",this.parseMarkdown(!0));kt(this,"parseInline",this.parseMarkdown(!1));kt(this,"Parser",Ql);kt(this,"Renderer",bo);kt(this,"TextRenderer",Ah);kt(this,"Lexer",Vl);kt(this,"Tokenizer",yo);kt(this,"Hooks",jc);this.use(...s)}walkTokens(s,l){var r,o;let i=[];for(let d of s)switch(i=i.concat(l.call(this,d)),d.type){case"table":{let h=d;for(let g of h.header)i=i.concat(this.walkTokens(g.tokens,l));for(let g of h.rows)for(let m of g)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=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&o[h.type]?this.defaults.extensions.childTokens[h.type].forEach(g=>{let m=h[g].flat(1/0);i=i.concat(this.walkTokens(m,l))}):h.tokens&&(i=i.concat(this.walkTokens(h.tokens,l)))}}return i}use(...s){let l=this.defaults.extensions||{renderers:{},childTokens:{}};return s.forEach(i=>{let r={...i};if(r.async=this.defaults.async||r.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 g=o.renderer.apply(this,h);return g===!1&&(g=d.apply(this,h)),g}: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)}),r.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,g=i.renderer[h],m=o[h];o[h]=(...b)=>{let x=g.apply(o,b);return x===!1&&(x=m.apply(o,b)),x||""}}r.renderer=o}if(i.tokenizer){let o=this.defaults.tokenizer||new yo(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,g=i.tokenizer[h],m=o[h];o[h]=(...b)=>{let x=g.apply(o,b);return x===!1&&(x=m.apply(o,b)),x}}r.tokenizer=o}if(i.hooks){let o=this.defaults.hooks||new jc;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,g=i.hooks[h],m=o[h];jc.passThroughHooks.has(d)?o[h]=b=>{if(this.defaults.async&&jc.passThroughHooksRespectAsync.has(d))return(async()=>{let k=await g.call(o,b);return m.call(o,k)})();let x=g.call(o,b);return m.call(o,x)}:o[h]=(...b)=>{if(this.defaults.async)return(async()=>{let k=await g.apply(o,b);return k===!1&&(k=await m.apply(o,b)),k})();let x=g.apply(o,b);return x===!1&&(x=m.apply(o,b)),x}}r.hooks=o}if(i.walkTokens){let o=this.defaults.walkTokens,d=i.walkTokens;r.walkTokens=function(h){let g=[];return g.push(d.call(this,h)),o&&(g=g.concat(o.call(this,h))),g}}this.defaults={...this.defaults,...r}}),this}setOptions(s){return this.defaults={...this.defaults,...s},this}lexer(s,l){return Vl.lex(s,l??this.defaults)}parser(s,l){return Ql.parse(s,l??this.defaults)}parseMarkdown(s){return(l,i)=>{let r={...i},o={...this.defaults,...r},d=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&r.async===!1)return d(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof l>"u"||l===null)return d(new Error("marked(): input parameter is undefined or null"));if(typeof l!="string")return d(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(l)+", string expected"));if(o.hooks&&(o.hooks.options=o,o.hooks.block=s),o.async)return(async()=>{let h=o.hooks?await o.hooks.preprocess(l):l,g=await(o.hooks?await o.hooks.provideLexer(s):s?Vl.lex:Vl.lexInline)(h,o),m=o.hooks?await o.hooks.processAllTokens(g):g;o.walkTokens&&await Promise.all(this.walkTokens(m,o.walkTokens));let b=await(o.hooks?await o.hooks.provideParser(s):s?Ql.parse:Ql.parseInline)(m,o);return o.hooks?await o.hooks.postprocess(b):b})().catch(d);try{o.hooks&&(l=o.hooks.preprocess(l));let h=(o.hooks?o.hooks.provideLexer(s):s?Vl.lex:Vl.lexInline)(l,o);o.hooks&&(h=o.hooks.processAllTokens(h)),o.walkTokens&&this.walkTokens(h,o.walkTokens);let g=(o.hooks?o.hooks.provideParser(s):s?Ql.parse:Ql.parseInline)(h,o);return o.hooks&&(g=o.hooks.postprocess(g)),g}catch(h){return d(h)}}}onError(s,l){return i=>{if(i.message+=`
|
|
113
|
+
Please report this to https://github.com/markedjs/marked.`,s){let r="<p>An error occurred:</p><pre>"+ma(i.message+"",!0)+"</pre>";return l?Promise.resolve(r):r}if(l)return Promise.reject(i);throw i}}},xi=new X_;function dt(s,l){return xi.parse(s,l)}dt.options=dt.setOptions=function(s){return xi.setOptions(s),dt.defaults=xi.defaults,_b(dt.defaults),dt};dt.getDefaults=vh;dt.defaults=_i;dt.use=function(...s){return xi.use(...s),dt.defaults=xi.defaults,_b(dt.defaults),dt};dt.walkTokens=function(s,l){return xi.walkTokens(s,l)};dt.parseInline=xi.parseInline;dt.Parser=Ql;dt.parser=Ql.parse;dt.Renderer=bo;dt.TextRenderer=Ah;dt.Lexer=Vl;dt.lexer=Vl.lex;dt.Tokenizer=yo;dt.Hooks=jc;dt.parse=dt;dt.options;dt.setOptions;dt.use;dt.walkTokens;dt.parseInline;Ql.parse;Vl.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 cy(s,l){(l==null||l>s.length)&&(l=s.length);for(var i=0,r=Array(l);i<l;i++)r[i]=s[i];return r}function V_(s){if(Array.isArray(s))return s}function Q_(s,l){var i=s==null?null:typeof Symbol<"u"&&s[Symbol.iterator]||s["@@iterator"];if(i!=null){var r,o,d,h,g=[],m=!0,b=!1;try{if(d=(i=i.call(s)).next,l!==0)for(;!(m=(r=d.call(i)).done)&&(g.push(r.value),g.length!==l);m=!0);}catch(x){b=!0,o=x}finally{try{if(!m&&i.return!=null&&(h=i.return(),Object(h)!==h))return}finally{if(b)throw o}}return g}}function $_(){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 Z_(s,l){return V_(s)||Q_(s,l)||K_(s,l)||$_()}function K_(s,l){if(s){if(typeof s=="string")return cy(s,l);var i={}.toString.call(s).slice(8,-1);return i==="Object"&&s.constructor&&(i=s.constructor.name),i==="Map"||i==="Set"?Array.from(s):i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?cy(s,l):void 0}}const Cb=Object.entries,uy=Object.setPrototypeOf,J_=Object.isFrozen,F_=Object.getPrototypeOf,W_=Object.getOwnPropertyDescriptor;let En=Object.freeze,An=Object.seal,ir=Object.create,Rb=typeof Reflect<"u"&&Reflect,hh=Rb.apply,ph=Rb.construct;En||(En=function(l){return l});An||(An=function(l){return l});hh||(hh=function(l,i){for(var r=arguments.length,o=new Array(r>2?r-2:0),d=2;d<r;d++)o[d-2]=arguments[d];return l.apply(i,o)});ph||(ph=function(l){for(var i=arguments.length,r=new Array(i>1?i-1:0),o=1;o<i;o++)r[o-1]=arguments[o];return new l(...r)});const lr=cn(Array.prototype.forEach),P_=cn(Array.prototype.lastIndexOf),oy=cn(Array.prototype.pop),ar=cn(Array.prototype.push),ev=cn(Array.prototype.splice),Ms=Array.isArray,Ec=cn(String.prototype.toLowerCase),Vd=cn(String.prototype.toString),fy=cn(String.prototype.match),Sc=cn(String.prototype.replace),dy=cn(String.prototype.indexOf),tv=cn(String.prototype.trim),nv=cn(Number.prototype.toString),lv=cn(Boolean.prototype.toString),hy=typeof BigInt>"u"?null:cn(BigInt.prototype.toString),py=typeof Symbol>"u"?null:cn(Symbol.prototype.toString),vn=cn(Object.prototype.hasOwnProperty),kc=cn(Object.prototype.toString),_n=cn(RegExp.prototype.test),ri=av(TypeError);function cn(s){return function(l){l instanceof RegExp&&(l.lastIndex=0);for(var i=arguments.length,r=new Array(i>1?i-1:0),o=1;o<i;o++)r[o-1]=arguments[o];return hh(s,l,r)}}function av(s){return function(){for(var l=arguments.length,i=new Array(l),r=0;r<l;r++)i[r]=arguments[r];return ph(s,i)}}function st(s,l){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ec;if(uy&&uy(s,null),!Ms(l))return s;let r=l.length;for(;r--;){let o=l[r];if(typeof o=="string"){const d=i(o);d!==o&&(J_(l)||(l[r]=d),o=d)}s[o]=!0}return s}function sv(s){for(let l=0;l<s.length;l++)vn(s,l)||(s[l]=null);return s}function Vn(s){const l=ir(null);for(const r of Cb(s)){var i=Z_(r,2);const o=i[0],d=i[1];vn(s,o)&&(Ms(d)?l[o]=sv(d):d&&typeof d=="object"&&d.constructor===Object?l[o]=Vn(d):l[o]=d)}return l}function iv(s){switch(typeof s){case"string":return s;case"number":return nv(s);case"boolean":return lv(s);case"bigint":return hy?hy(s):"0";case"symbol":return py?py(s):"Symbol()";case"undefined":return kc(s);case"function":case"object":{if(s===null)return kc(s);const l=s,i=ga(l,"toString");if(typeof i=="function"){const r=i(l);return typeof r=="string"?r:kc(r)}return kc(s)}default:return kc(s)}}function ga(s,l){for(;s!==null;){const r=W_(s,l);if(r){if(r.get)return cn(r.get);if(typeof r.value=="function")return cn(r.value)}s=F_(s)}function i(){return null}return i}function rv(s){try{return _n(s,""),!0}catch{return!1}}const my=En(["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"]),Qd=En(["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"]),$d=En(["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"]),cv=En(["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"]),Zd=En(["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"]),uv=En(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),gy=En(["#text"]),yy=En(["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"]),Kd=En(["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"]),by=En(["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"]),eo=En(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ov=An(/{{[\w\W]*|^[\w\W]*}}/g),fv=An(/<%[\w\W]*|^[\w\W]*%>/g),dv=An(/\${[\w\W]*/g),hv=An(/^data-[\-\w.\u00B7-\uFFFF]+$/),pv=An(/^aria-[\-\w]+$/),xy=An(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),mv=An(/^(?:\w+script|data):/i),gv=An(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),yv=An(/^html$/i),bv=An(/^[a-z][.\w]*(-[.\w]+)+$/i),_y=An(/<[/\w!]/g),vy=An(/<[/\w]/g),xv=An(/<\/no(script|embed|frames)/i),_v=An(/\/>/i),_l={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},vv=function(){return typeof window>"u"?null:window},Sv=function(l,i){if(typeof l!="object"||typeof l.createPolicy!="function")return null;let r=null;const o="data-tt-policy-suffix";i&&i.hasAttribute(o)&&(r=i.getAttribute(o));const d="dompurify"+(r?"#"+r:"");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}},Sy=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Es=function(l,i,r,o){return vn(l,i)&&Ms(l[i])?st(o.base?Vn(o.base):{},l[i],o.transform):r};function Mb(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:vv();const l=ue=>Mb(ue);if(l.version="3.4.12",l.removed=[],!s||!s.document||s.document.nodeType!==_l.document||!s.Element)return l.isSupported=!1,l;let i=s.document;const r=i,o=r.currentScript;s.DocumentFragment;const d=s.HTMLTemplateElement,h=s.Node,g=s.Element,m=s.NodeFilter,b=s.NamedNodeMap;b===void 0&&(s.NamedNodeMap||s.MozNamedAttrMap),s.HTMLFormElement;const x=s.DOMParser,k=s.trustedTypes,_=g.prototype,A=ga(_,"cloneNode"),T=ga(_,"remove"),L=ga(_,"nextSibling"),O=ga(_,"childNodes"),F=ga(_,"parentNode"),q=ga(_,"shadowRoot"),Q=ga(_,"attributes"),E=h&&h.prototype?ga(h.prototype,"nodeType"):null,V=h&&h.prototype?ga(h.prototype,"nodeName"):null;if(typeof d=="function"){const ue=i.createElement("template");ue.content&&ue.content.ownerDocument&&(i=ue.content.ownerDocument)}let D,R="",Z,ce=!1,de=0;const K=function(){if(de>0)throw ri('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.')},le=function(w){K(),de++;try{return D.createHTML(w)}finally{de--}},me=function(w){K(),de++;try{return D.createScriptURL(w)}finally{de--}},Ae=function(){return ce||(Z=Sv(k,o),ce=!0),Z},ve=i,z=ve.implementation,ee=ve.createNodeIterator,P=ve.createDocumentFragment,xe=ve.getElementsByTagName,Ne=r.importNode;let N=Sy();l.isSupported=typeof Cb=="function"&&typeof F=="function"&&z&&z.createHTMLDocument!==void 0;const I=ov,ie=fv,re=dv,_e=hv,Te=pv,Me=mv,et=gv,Ze=bv;let at=xy,qe=null;const Nt=st({},[...my,...Qd,...$d,...Zd,...gy]);let $e=null;const oe=st({},[...yy,...Kd,...by,...eo]);let ye=Object.seal(ir(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}})),tt=null,Ft=null;const Ue=Object.seal(ir(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let un=!0,mn=!0,Sn=!1,Qn=!0,kn=!1,bt=!0,Cn=!1,J=!1,fe=null,Re=null,Ke=!1,Lt=!1,Wt=!1,Un=!1,sl=!0,Xt=!1;const Hn="user-content-";let jt=!0,Rn=!1,$={},he=null;const rt=st({},["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 ht=null;const gn=st({},["audio","video","img","source","image","track"]);let il=null;const va=st({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Bn="http://www.w3.org/1998/Math/MathML",$n="http://www.w3.org/2000/svg",on="http://www.w3.org/1999/xhtml";let Ut=on,vl=!1,Sa=null;const ka=st({},[Bn,$n,on],Vd),Us=En(["mi","mo","mn","ms","mtext"]);let zl=st({},Us);const Ka=En(["annotation-xml"]);let Ll=st({},Ka);const wa=st({},["title","style","font","a","script"]);let rl=null;const Vt=["application/xhtml+xml","text/html"],Et="text/html";let Be=null,fn=null;const Kl=i.createElement("form"),Ta=function(w){return w instanceof RegExp||w instanceof Function},Ul=function(){let w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(fn&&fn===w)return;(!w||typeof w!="object")&&(w={}),w=Vn(w),rl=Vt.indexOf(w.PARSER_MEDIA_TYPE)===-1?Et:w.PARSER_MEDIA_TYPE,Be=rl==="application/xhtml+xml"?Vd:Ec,qe=Es(w,"ALLOWED_TAGS",Nt,{transform:Be}),$e=Es(w,"ALLOWED_ATTR",oe,{transform:Be}),Sa=Es(w,"ALLOWED_NAMESPACES",ka,{transform:Vd}),il=Es(w,"ADD_URI_SAFE_ATTR",va,{transform:Be,base:va}),ht=Es(w,"ADD_DATA_URI_TAGS",gn,{transform:Be,base:gn}),he=Es(w,"FORBID_CONTENTS",rt,{transform:Be}),tt=Es(w,"FORBID_TAGS",Vn({}),{transform:Be}),Ft=Es(w,"FORBID_ATTR",Vn({}),{transform:Be}),$=vn(w,"USE_PROFILES")?w.USE_PROFILES&&typeof w.USE_PROFILES=="object"?Vn(w.USE_PROFILES):w.USE_PROFILES:!1,un=w.ALLOW_ARIA_ATTR!==!1,mn=w.ALLOW_DATA_ATTR!==!1,Sn=w.ALLOW_UNKNOWN_PROTOCOLS||!1,Qn=w.ALLOW_SELF_CLOSE_IN_ATTR!==!1,kn=w.SAFE_FOR_TEMPLATES||!1,bt=w.SAFE_FOR_XML!==!1,Cn=w.WHOLE_DOCUMENT||!1,Lt=w.RETURN_DOM||!1,Wt=w.RETURN_DOM_FRAGMENT||!1,Un=w.RETURN_TRUSTED_TYPE||!1,Ke=w.FORCE_BODY||!1,sl=w.SANITIZE_DOM!==!1,Xt=w.SANITIZE_NAMED_PROPS||!1,jt=w.KEEP_CONTENT!==!1,Rn=w.IN_PLACE||!1,at=rv(w.ALLOWED_URI_REGEXP)?w.ALLOWED_URI_REGEXP:xy,Ut=typeof w.NAMESPACE=="string"?w.NAMESPACE:on,zl=vn(w,"MATHML_TEXT_INTEGRATION_POINTS")&&w.MATHML_TEXT_INTEGRATION_POINTS&&typeof w.MATHML_TEXT_INTEGRATION_POINTS=="object"?Vn(w.MATHML_TEXT_INTEGRATION_POINTS):st({},Us),Ll=vn(w,"HTML_INTEGRATION_POINTS")&&w.HTML_INTEGRATION_POINTS&&typeof w.HTML_INTEGRATION_POINTS=="object"?Vn(w.HTML_INTEGRATION_POINTS):st({},Ka);const U=vn(w,"CUSTOM_ELEMENT_HANDLING")&&w.CUSTOM_ELEMENT_HANDLING&&typeof w.CUSTOM_ELEMENT_HANDLING=="object"?Vn(w.CUSTOM_ELEMENT_HANDLING):ir(null);if(ye=ir(null),vn(U,"tagNameCheck")&&Ta(U.tagNameCheck)&&(ye.tagNameCheck=U.tagNameCheck),vn(U,"attributeNameCheck")&&Ta(U.attributeNameCheck)&&(ye.attributeNameCheck=U.attributeNameCheck),vn(U,"allowCustomizedBuiltInElements")&&typeof U.allowCustomizedBuiltInElements=="boolean"&&(ye.allowCustomizedBuiltInElements=U.allowCustomizedBuiltInElements),An(ye),kn&&(mn=!1),Wt&&(Lt=!0),$&&(qe=st({},gy),$e=ir(null),$.html===!0&&(st(qe,my),st($e,yy)),$.svg===!0&&(st(qe,Qd),st($e,Kd),st($e,eo)),$.svgFilters===!0&&(st(qe,$d),st($e,Kd),st($e,eo)),$.mathMl===!0&&(st(qe,Zd),st($e,by),st($e,eo))),Ue.tagCheck=null,Ue.attributeCheck=null,vn(w,"ADD_TAGS")&&(typeof w.ADD_TAGS=="function"?Ue.tagCheck=w.ADD_TAGS:Ms(w.ADD_TAGS)&&(qe===Nt&&(qe=Vn(qe)),st(qe,w.ADD_TAGS,Be))),vn(w,"ADD_ATTR")&&(typeof w.ADD_ATTR=="function"?Ue.attributeCheck=w.ADD_ATTR:Ms(w.ADD_ATTR)&&($e===oe&&($e=Vn($e)),st($e,w.ADD_ATTR,Be))),vn(w,"ADD_URI_SAFE_ATTR")&&Ms(w.ADD_URI_SAFE_ATTR)&&st(il,w.ADD_URI_SAFE_ATTR,Be),vn(w,"FORBID_CONTENTS")&&Ms(w.FORBID_CONTENTS)&&(he===rt&&(he=Vn(he)),st(he,w.FORBID_CONTENTS,Be)),vn(w,"ADD_FORBID_CONTENTS")&&Ms(w.ADD_FORBID_CONTENTS)&&(he===rt&&(he=Vn(he)),st(he,w.ADD_FORBID_CONTENTS,Be)),jt&&(qe["#text"]=!0),Cn&&st(qe,["html","head","body"]),qe.table&&(st(qe,["tbody"]),delete tt.tbody),w.TRUSTED_TYPES_POLICY){if(typeof w.TRUSTED_TYPES_POLICY.createHTML!="function")throw ri('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof w.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ri('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const ae=D;D=w.TRUSTED_TYPES_POLICY;try{R=le("")}catch(Se){throw D=ae,Se}}else w.TRUSTED_TYPES_POLICY===null?(D=void 0,R=""):(D===void 0&&(D=Ae()),D&&typeof R=="string"&&(R=le("")));En&&En(w),fn=w},qn=st({},[...Qd,...$d,...cv]),cl=st({},[...Zd,...uv]),ul=function(w,U,ae){return U.namespaceURI===on?w==="svg":U.namespaceURI===Bn?w==="svg"&&(ae==="annotation-xml"||zl[ae]):!!qn[w]},Jl=function(w,U,ae){return U.namespaceURI===on?w==="math":U.namespaceURI===$n?w==="math"&&Ll[ae]:!!cl[w]},Mn=function(w,U,ae){return U.namespaceURI===$n&&!Ll[ae]||U.namespaceURI===Bn&&!zl[ae]?!1:!cl[w]&&(wa[w]||!qn[w])},ol=function(w){let U=F(w);(!U||!U.tagName)&&(U={namespaceURI:Ut,tagName:"template"});const ae=Ec(w.tagName),Se=Ec(U.tagName);return Sa[w.namespaceURI]?w.namespaceURI===$n?ul(ae,U,Se):w.namespaceURI===Bn?Jl(ae,U,Se):w.namespaceURI===on?Mn(ae,U,Se):!!(rl==="application/xhtml+xml"&&Sa[w.namespaceURI]):!1},Pt=function(w){ar(l.removed,{element:w});try{F(w).removeChild(w)}catch{if(T(w),!F(w))throw ri("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},pt=function(w){Yn(w);const U=O(w);if(U){const Se=[];lr(U,Ce=>{ar(Se,Ce)}),lr(Se,Ce=>{try{T(Ce)}catch{}})}const ae=Q(w);if(ae)for(let Se=ae.length-1;Se>=0;--Se){const Ce=ae[Se],ze=Ce&&Ce.name;if(typeof ze=="string")try{w.removeAttribute(ze)}catch{}}},Gn=function(w,U){try{ar(l.removed,{attribute:U.getAttributeNode(w),from:U})}catch{ar(l.removed,{attribute:null,from:U})}if(U.removeAttribute(w),w==="is")if(Lt||Wt)try{Pt(U)}catch{}else try{U.setAttribute(w,"")}catch{}},vi=function(w){const U=Q(w);if(U)for(let ae=U.length-1;ae>=0;--ae){const Se=U[ae],Ce=Se&&Se.name;if(!(typeof Ce!="string"||$e[Be(Ce)]))try{w.removeAttribute(Ce)}catch{}}},Yn=function(w){const U=[w];for(;U.length>0;){const ae=U.pop();(E?E(ae):ae.nodeType)===_l.element&&vi(ae);const Ce=O(ae);if(Ce)for(let ze=Ce.length-1;ze>=0;--ze)U.push(Ce[ze])}},fl=function(w){if(!bt)return;const U=[w];for(;U.length>0;){const ae=U.pop(),Se=E?E(ae):ae.nodeType;if(Se===_l.processingInstruction||Se===_l.comment&&_n(vy,ae.data)){try{T(ae)}catch{}continue}if(Se===_l.element){const ze=ae,wt=Be(V?V(ae):ae.nodeName);try{ze.hasAttribute&&ze.hasAttribute("patchsrc")&&ze.removeAttribute("patchsrc"),ze.hasAttribute&&ze.hasAttribute("for")&&wt!=="label"&&wt!=="output"&&ze.removeAttribute("for")}catch{}}const Ce=O(ae);if(Ce)for(let ze=Ce.length-1;ze>=0;--ze)U.push(Ce[ze])}},Hs=function(w){let U=null,ae=null;if(Ke)w="<remove></remove>"+w;else{const ze=fy(w,/^[\r\n\t ]+/);ae=ze&&ze[0]}rl==="application/xhtml+xml"&&Ut===on&&(w='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+w+"</body></html>");const Se=D?le(w):w;if(Ut===on)try{U=new x().parseFromString(Se,rl)}catch{}if(!U||!U.documentElement){U=z.createDocument(Ut,"template",null);try{U.documentElement.innerHTML=vl?R:Se}catch{}}const Ce=U.body||U.documentElement;return w&&ae&&Ce.insertBefore(i.createTextNode(ae),Ce.childNodes[0]||null),Ut===on?xe.call(U,Cn?"html":"body")[0]:Cn?U.documentElement:Ce},Fl=function(w){return ee.call(w.ownerDocument||w,w,m.SHOW_ELEMENT|m.SHOW_COMMENT|m.SHOW_TEXT|m.SHOW_PROCESSING_INSTRUCTION|m.SHOW_CDATA_SECTION,null)},Wl=function(w){return w=Sc(w,I," "),w=Sc(w,ie," "),w=Sc(w,re," "),w},Hl=function(w){var U;w.normalize();const ae=ee.call(w.ownerDocument||w,w,m.SHOW_TEXT|m.SHOW_COMMENT|m.SHOW_CDATA_SECTION|m.SHOW_PROCESSING_INSTRUCTION,null);let Se=ae.nextNode();for(;Se;)Se.data=Wl(Se.data),Se=ae.nextNode();const Ce=(U=w.querySelectorAll)===null||U===void 0?void 0:U.call(w,"template");Ce&&lr(Ce,ze=>{dl(ze.content)&&Hl(ze.content)})},In=function(w){const U=V?V(w):null;return typeof U!="string"||Be(U)!=="form"?!1:typeof w.nodeName!="string"||typeof w.textContent!="string"||typeof w.removeChild!="function"||w.attributes!==Q(w)||typeof w.removeAttribute!="function"||typeof w.setAttribute!="function"||typeof w.namespaceURI!="string"||typeof w.insertBefore!="function"||typeof w.hasChildNodes!="function"||w.nodeType!==E(w)||w.childNodes!==O(w)},dl=function(w){if(!E||typeof w!="object"||w===null)return!1;try{return E(w)===_l.documentFragment}catch{return!1}},dn=function(w){if(!E||typeof w!="object"||w===null)return!1;try{return typeof E(w)=="number"}catch{return!1}};function xt(ue,w,U){ue.length!==0&&lr(ue,ae=>{ae.call(l,w,U,fn)})}const Ja=function(w,U){return!!(bt&&w.hasChildNodes()&&!dn(w.firstElementChild)&&_n(_y,w.textContent)&&_n(_y,w.innerHTML)||bt&&w.namespaceURI===on&&U==="style"&&dn(w.firstElementChild)||w.nodeType===_l.processingInstruction||bt&&w.nodeType===_l.comment&&_n(vy,w.data))},Si=function(w,U){if(!tt[U]&&Na(U)&&(ye.tagNameCheck instanceof RegExp&&_n(ye.tagNameCheck,U)||ye.tagNameCheck instanceof Function&&ye.tagNameCheck(U)))return!1;if(jt&&!he[U]){const ae=F(w),Se=O(w);if(Se&&ae){const Ce=Se.length;for(let ze=Ce-1;ze>=0;--ze){const wt=Rn?Se[ze]:A(Se[ze],!0);ae.insertBefore(wt,L(w))}}}return Pt(w),!0},Bl=function(w,U){if(xt(N.beforeSanitizeElements,w,null),w!==U&&F(w)===null)return!0;if(In(w))return Pt(w),!0;const ae=Be(V?V(w):w.nodeName);if(xt(N.uponSanitizeElement,w,{tagName:ae,allowedTags:qe}),w!==U&&F(w)===null)return!0;if(Ja(w,ae))return Pt(w),!0;if(tt[ae]||!(Ue.tagCheck instanceof Function&&Ue.tagCheck(ae))&&!qe[ae]){const Ce=Si(w,ae);return Ce===!1&&xt(N.afterSanitizeElements,w,null),Ce}if((E?E(w):w.nodeType)===_l.element&&!ol(w)||(ae==="noscript"||ae==="noembed"||ae==="noframes")&&_n(xv,w.innerHTML))return Pt(w),!0;if(kn&&w.nodeType===_l.text){const Ce=Wl(w.textContent);w.textContent!==Ce&&(ar(l.removed,{element:w.cloneNode()}),w.textContent=Ce)}return xt(N.afterSanitizeElements,w,null),!1},Pl=function(w,U,ae){if(Ft[U]||bt&&U==="patchsrc"||bt&&U==="for"&&w!=="label"&&w!=="output"||sl&&(U==="id"||U==="name")&&(ae in i||ae in Kl))return!1;const Se=$e[U]||Ue.attributeCheck instanceof Function&&Ue.attributeCheck(U,w);if(!(mn&&_n(_e,U))){if(!(un&&_n(Te,U))){if(Se){if(!il[U]){if(!_n(at,Sc(ae,et,""))){if(!((U==="src"||U==="xlink:href"||U==="href")&&w!=="script"&&dy(ae,"data:")===0&&ht[w])){if(!(Sn&&!_n(Me,Sc(ae,et,"")))){if(ae)return!1}}}}}else if(!(Na(w)&&(ye.tagNameCheck instanceof RegExp&&_n(ye.tagNameCheck,w)||ye.tagNameCheck instanceof Function&&ye.tagNameCheck(w))&&(ye.attributeNameCheck instanceof RegExp&&_n(ye.attributeNameCheck,U)||ye.attributeNameCheck instanceof Function&&ye.attributeNameCheck(U,w))||U==="is"&&ye.allowCustomizedBuiltInElements&&(ye.tagNameCheck instanceof RegExp&&_n(ye.tagNameCheck,ae)||ye.tagNameCheck instanceof Function&&ye.tagNameCheck(ae))))return!1}}return!0},ea=st({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Na=function(w){return!ea[Ec(w)]&&_n(Ze,w)},en=function(w,U,ae,Se){if(D&&typeof k=="object"&&typeof k.getAttributeType=="function"&&!ae)switch(k.getAttributeType(w,U)){case"TrustedHTML":return le(Se);case"TrustedScriptURL":return me(Se)}return Se},Bs=function(w,U,ae,Se){try{ae?w.setAttributeNS(ae,U,Se):w.setAttribute(U,Se),In(w)?Pt(w):oy(l.removed)}catch{Gn(U,w)}},ta=function(w){xt(N.beforeSanitizeAttributes,w,null);const U=w.attributes;if(!U||In(w))return;const ae={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:$e,forceKeepAttr:void 0};let Se=U.length;const Ce=Be(w.nodeName);for(;Se--;){const ze=U[Se],wt=ze.name,qt=ze.namespaceURI,hn=ze.value,mt=Be(wt),At=hn;let Ht=wt==="value"?At:tv(At);if(ae.attrName=mt,ae.attrValue=Ht,ae.keepAttr=!0,ae.forceKeepAttr=void 0,xt(N.uponSanitizeAttribute,w,ae),Ht=ae.attrValue,Xt&&(mt==="id"||mt==="name")&&dy(Ht,Hn)!==0&&(Gn(wt,w),Ht=Hn+Ht),bt&&_n(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Ht)){Gn(wt,w);continue}if(mt==="attributename"&&fy(Ht,"href")){Gn(wt,w);continue}if(!ae.forceKeepAttr){if(!ae.keepAttr){Gn(wt,w);continue}if(!Qn&&_n(_v,Ht)){Gn(wt,w);continue}if(kn&&(Ht=Wl(Ht)),!Pl(Ce,mt,Ht)){Gn(wt,w);continue}Ht=en(Ce,mt,qt,Ht),Ht!==At&&Bs(w,wt,qt,Ht)}}xt(N.afterSanitizeAttributes,w,null)},hl=function(w){let U=null;const ae=Fl(w);for(xt(N.beforeSanitizeShadowDOM,w,null);U=ae.nextNode();)if(xt(N.uponSanitizeShadowNode,U,null),Bl(U,w),ta(U),dl(U.content)&&hl(U.content),(E?E(U):U.nodeType)===_l.element){const Ce=q(U);dl(Ce)&&(Zn(Ce),hl(Ce))}xt(N.afterSanitizeShadowDOM,w,null)},Zn=function(w){const U=[{node:w,shadow:null}];for(;U.length>0;){const ae=U.pop();if(ae.shadow){hl(ae.shadow);continue}const Se=ae.node,ze=(E?E(Se):Se.nodeType)===_l.element,wt=O(Se);if(wt)for(let qt=wt.length-1;qt>=0;--qt)U.push({node:wt[qt],shadow:null});if(ze){const qt=V?V(Se):null;if(typeof qt=="string"&&Be(qt)==="template"){const hn=Se.content;dl(hn)&&U.push({node:hn,shadow:null})}}if(ze){const qt=q(Se);dl(qt)&&U.push({node:null,shadow:qt},{node:qt,shadow:null})}}};return l.sanitize=function(ue){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},U=null,ae=null,Se=null,Ce=null;if(vl=!ue,vl&&(ue="<!-->"),typeof ue!="string"&&!dn(ue)&&(ue=iv(ue),typeof ue!="string"))throw ri("dirty is not a string, aborting");if(!l.isSupported)return ue;J?(qe=fe,$e=Re):Ul(w),(N.uponSanitizeElement.length>0||N.uponSanitizeAttribute.length>0)&&(qe=Vn(qe)),N.uponSanitizeAttribute.length>0&&($e=Vn($e)),l.removed=[];const ze=Rn&&typeof ue!="string"&&dn(ue);if(ze){fl(ue);const mt=V?V(ue):ue.nodeName;if(typeof mt=="string"){const At=Be(mt);if(!qe[At]||tt[At])throw pt(ue),ri("root node is forbidden and cannot be sanitized in-place")}if(In(ue))throw pt(ue),ri("root node is clobbered and cannot be sanitized in-place");try{Zn(ue)}catch(At){throw pt(ue),At}}else if(dn(ue))U=Hs("<!---->"),ae=U.ownerDocument.importNode(ue,!0),ae.nodeType===_l.element&&ae.nodeName==="BODY"||ae.nodeName==="HTML"?U=ae:U.appendChild(ae),Zn(ae);else{if(!Lt&&!kn&&!Cn&&ue.indexOf("<")===-1)return D&&Un?le(ue):ue;if(U=Hs(ue),!U)return Lt?null:Un?R:""}U&&Ke&&Pt(U.firstChild);const wt=ze?ue:U,qt=Fl(wt);try{for(;Se=qt.nextNode();)Bl(Se,wt),ta(Se),dl(Se.content)&&hl(Se.content)}catch(mt){throw ze&&(pt(ue),lr(l.removed,At=>{At.element&&Yn(At.element)})),mt}if(ze)return lr(l.removed,mt=>{mt.element&&Yn(mt.element)}),kn&&Hl(ue),ue;if(Lt){if(kn&&Hl(U),Wt)for(Ce=P.call(U.ownerDocument);U.firstChild;)Ce.appendChild(U.firstChild);else Ce=U;return($e.shadowroot||$e.shadowrootmode)&&(Ce=Ne.call(r,Ce,!0)),Ce}let hn=Cn?U.outerHTML:U.innerHTML;return Cn&&qe["!doctype"]&&U.ownerDocument&&U.ownerDocument.doctype&&U.ownerDocument.doctype.name&&_n(yv,U.ownerDocument.doctype.name)&&(hn="<!DOCTYPE "+U.ownerDocument.doctype.name+`>
|
|
115
|
+
`+hn),kn&&(hn=Wl(hn)),D&&Un?le(hn):hn},l.setConfig=function(){let ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ul(ue),J=!0,fe=qe,Re=$e},l.clearConfig=function(){fn=null,J=!1,fe=null,Re=null,D=Z,R=""},l.isValidAttribute=function(ue,w,U){fn||Ul({});const ae=Be(ue),Se=Be(w);return Pl(ae,Se,U)},l.addHook=function(ue,w){typeof w=="function"&&vn(N,ue)&&ar(N[ue],w)},l.removeHook=function(ue,w){if(vn(N,ue)){if(w!==void 0){const U=P_(N[ue],w);return U===-1?void 0:ev(N[ue],U,1)[0]}return oy(N[ue])}},l.removeHooks=function(ue){vn(N,ue)&&(N[ue]=[])},l.removeAllHooks=function(){N=Sy()},l}var kv=Mb();const wv=1024;let Tv=0;class Dl{constructor(l,i){this.from=l,this.to=i}}class zt{constructor(l={}){this.id=Tv++,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 r=l(i);return r===void 0?null:[this,r]}}}zt.closedBy=new zt({deserialize:s=>s.split(" ")});zt.openedBy=new zt({deserialize:s=>s.split(" ")});zt.group=new zt({deserialize:s=>s.split(" ")});zt.isolate=new zt({deserialize:s=>{if(s&&s!="rtl"&&s!="ltr"&&s!="auto")throw new RangeError("Invalid value for isolate: "+s);return s||"auto"}});zt.contextHash=new zt({perNode:!0});zt.lookAhead=new zt({perNode:!0});zt.mounted=new zt({perNode:!0});class ur{constructor(l,i,r,o=!1){this.tree=l,this.overlay=i,this.parser=r,this.bracketed=o}static get(l){return l&&l.props&&l.props[zt.mounted.id]}}const Nv=Object.create(null);class Zl{constructor(l,i,r,o=0){this.name=l,this.props=i,this.id=r,this.flags=o}static define(l){let i=l.props&&l.props.length?Object.create(null):Nv,r=(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,r);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(zt.group);return i?i.indexOf(l)>-1:!1}return this.id==l}static match(l){let i=Object.create(null);for(let r in l)for(let o of r.split(" "))i[o]=l[r];return r=>{for(let o=r.prop(zt.group),d=-1;d<(o?o.length:0);d++){let h=i[d<0?r.name:o[d]];if(h)return h}}}}Zl.none=new Zl("",Object.create(null),0,8);class Ob{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 r of this.types){let o=null;for(let d of l){let h=d(r);if(h){o||(o=Object.assign({},r.props));let g=h[1],m=h[0];m.combine&&m.id in o&&(g=m.combine(o[m.id],g)),o[m.id]=g}}i.push(o?new Zl(r.name,o,r.id,r.flags):r)}return new Ob(i)}}const to=new WeakMap,ky=new WeakMap;var Ot;(function(s){s[s.ExcludeBuffers=1]="ExcludeBuffers",s[s.IncludeAnonymous=2]="IncludeAnonymous",s[s.IgnoreMounts=4]="IgnoreMounts",s[s.IgnoreOverlays=8]="IgnoreOverlays",s[s.EnterBracketed=16]="EnterBracketed"})(Ot||(Ot={}));class al{constructor(l,i,r,o,d){if(this.type=l,this.children=i,this.positions=r,this.length=o,this.props=null,d&&d.length){this.props=Object.create(null);for(let[h,g]of d)this.props[typeof h=="number"?h:h.id]=g}}toString(){let l=ur.get(this);if(l&&!l.overlay)return l.tree.toString();let i="";for(let r of this.children){let o=r.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 xo(this.topNode,l)}cursorAt(l,i=0,r=0){let o=to.get(this)||this.topNode,d=new xo(o);return d.moveTo(l,i),to.set(this,d._tree),d}get topNode(){return new Ln(this,0,0,null)}resolve(l,i=0){let r=Ac(to.get(this)||this.topNode,l,i,!1);return to.set(this,r),r}resolveInner(l,i=0){let r=Ac(ky.get(this)||this.topNode,l,i,!0);return ky.set(this,r),r}resolveStack(l,i=0){return Av(this,l,i)}iterate(l){let{enter:i,leave:r,from:o=0,to:d=this.length}=l,h=l.mode||0,g=(h&Ot.IncludeAnonymous)>0;for(let m=this.cursor(h|Ot.IncludeAnonymous);;){let b=!1;if(m.from<=d&&m.to>=o&&(!g&&m.type.isAnonymous||i(m)!==!1)){if(m.firstChild())continue;b=!0}for(;b&&r&&(g||!m.type.isAnonymous)&&r(m),!m.nextSibling();){if(!m.parent())return;b=!0}}}prop(l){return l.perNode?this.props?this.props[l.id]:void 0:this.type.prop(l)}get propValues(){let l=[];if(this.props)for(let i in this.props)l.push([+i,this.props[i]]);return l}balance(l={}){return this.children.length<=8?this:Mh(Zl.none,this.children,this.positions,0,this.children.length,0,this.length,(i,r,o)=>new al(this.type,i,r,o,this.propValues),l.makeTree||((i,r,o)=>new al(Zl.none,i,r,o)))}static build(l){return Cv(l)}}al.empty=new al(Zl.none,[],[],0);class Ch{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 Ch(this.buffer,this.index)}}class Ls{constructor(l,i,r){this.buffer=l,this.length=i,this.set=r}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],r=this.buffer[l+3],o=this.set.types[i],d=o.name;if(/\W/.test(d)&&!o.isError&&(d=JSON.stringify(d)),l+=4,r==l)return d;let h=[];for(;l<r;)h.push(this.childString(l)),l=this.buffer[l+3];return d+"("+h.join(",")+")"}findChild(l,i,r,o,d){let{buffer:h}=this,g=-1;for(let m=l;m!=i&&!(Db(d,o,h[m+1],h[m+2])&&(g=m,r>0));m=h[m+3]);return g}slice(l,i,r){let o=this.buffer,d=new Uint16Array(i-l),h=0;for(let g=l,m=0;g<i;){d[m++]=o[g++],d[m++]=o[g++]-r;let b=d[m++]=o[g++]-r;d[m++]=o[g++]-l,h=Math.max(h,b)}return new Ls(d,h,this.set)}}function Db(s,l,i,r){switch(s){case-2:return i<l;case-1:return r>=l&&i<l;case 0:return i<l&&r>l;case 1:return i<=l&&r>l;case 2:return r>l;case 4:return!0}}function Ac(s,l,i,r){for(var o;s.from==s.to||(i<1?s.from>=l:s.from>l)||(i>-1?s.to<=l:s.to<l);){let h=!r&&s instanceof Ln&&s.index<0?null:s.parent;if(!h)return s;s=h}let d=r?0:Ot.IgnoreOverlays;if(r)for(let h=s,g=h.parent;g;h=g,g=h.parent)h instanceof Ln&&h.index<0&&((o=g.enter(l,i,d))===null||o===void 0?void 0:o.from)!=h.from&&(s=g);for(;;){let h=s.enter(l,i,d);if(!h)return s;s=h}}class zb{cursor(l=0){return new xo(this,l)}getChild(l,i=null,r=null){let o=wy(this,l,i,r);return o.length?o[0]:null}getChildren(l,i=null,r=null){return wy(this,l,i,r)}resolve(l,i=0){return Ac(this,l,i,!1)}resolveInner(l,i=0){return Ac(this,l,i,!0)}matchContext(l){return mh(this.parent,l)}enterUnfinishedNodesBefore(l){let i=this.childBefore(l),r=this;for(;i;){let o=i.lastChild;if(!o||o.to!=i.to)break;o.type.isError&&o.from==o.to?(r=i,i=o.prevSibling):i=o}return r}get node(){return this}get next(){return this.parent}}class Ln extends zb{constructor(l,i,r,o){super(),this._tree=l,this.from=i,this.index=r,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,r,o,d=0){for(let h=this;;){for(let{children:g,positions:m}=h._tree,b=i>0?g.length:-1;l!=b;l+=i){let x=g[l],k=m[l]+h.from,_;if(!(!(d&Ot.EnterBracketed&&x instanceof al&&(_=ur.get(x))&&!_.overlay&&_.bracketed&&r>=k&&r<=k+x.length)&&!Db(o,r,k,k+x.length))){if(x instanceof Ls){if(d&Ot.ExcludeBuffers)continue;let A=x.findChild(0,x.buffer.length,i,r-k,o);if(A>-1)return new _a(new jv(h,x,l,k),null,A)}else if(d&Ot.IncludeAnonymous||!x.type.isAnonymous||Rh(x)){let A;if(!(d&Ot.IgnoreMounts)&&(A=ur.get(x))&&!A.overlay)return new Ln(A.tree,k,l,h);let T=new Ln(x,k,l,h);return d&Ot.IncludeAnonymous||!T.type.isAnonymous?T:T.nextChild(i<0?x.children.length-1:0,i,r,o,d)}}}if(d&Ot.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,r=0){let o;if(!(r&Ot.IgnoreOverlays)&&(o=ur.get(this._tree))&&o.overlay){let d=l-this.from,h=r&Ot.EnterBracketed&&o.bracketed;for(let{from:g,to:m}of o.overlay)if((i>0||h?g<=d:g<d)&&(i<0||h?m>=d:m>d))return new Ln(o.tree,o.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,l,i,r)}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 wy(s,l,i,r){let o=s.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(r!=null&&o.type.is(r))return d;if(o.type.is(l)&&d.push(o.node),!o.nextSibling())return r==null?d:[]}}function mh(s,l,i=l.length-1){for(let r=s;i>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(l[i]&&l[i]!=r.name)return!1;i--}}return!0}class jv{constructor(l,i,r,o){this.parent=l,this.buffer=i,this.index=r,this.start=o}}class _a extends zb{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,r){super(),this.context=l,this._parent=i,this.index=r,this.type=l.buffer.set.types[l.buffer.buffer[r]]}child(l,i,r){let{buffer:o}=this.context,d=o.findChild(this.index+4,o.buffer[this.index+3],l,i-this.context.start,r);return d<0?null:new _a(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,r=0){if(r&Ot.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 _a(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 _a(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 _a(this.context,this._parent,l.findChild(i,this.index,-1,0,4))}get tree(){return null}toTree(){let l=[],i=[],{buffer:r}=this.context,o=this.index+4,d=r.buffer[this.index+3];if(d>o){let h=r.buffer[this.index+1];l.push(r.slice(o,d,h)),i.push(0)}return new al(this.type,l,i,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Lb(s){if(!s.length)return null;let l=0,i=s[0];for(let d=1;d<s.length;d++){let h=s[d];(h.from>i.from||h.to<i.to)&&(i=h,l=d)}let r=i instanceof Ln&&i.index<0?null:i.parent,o=s.slice();return r?o[l]=r:o.splice(l,1),new Ev(o,i)}class Ev{constructor(l,i){this.heads=l,this.node=i}get next(){return Lb(this.heads)}}function Av(s,l,i){let r=s.resolveInner(l,i),o=null;for(let d=r instanceof Ln?r:r.context.parent;d;d=d.parent)if(d.index<0){let h=d.parent;(o||(o=[r])).push(h.resolve(l,i)),d=h}else{let h=ur.get(d.tree);if(h&&h.overlay&&h.overlay[0].from<=l&&h.overlay[h.overlay.length-1].to>=l){let g=new Ln(h.tree,h.overlay[0].from+d.from,-1,d);(o||(o=[r])).push(Ac(g,l,i,!1))}}return o?Lb(o):r}class xo{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&~Ot.EnterBracketed,l instanceof Ln)this.yieldNode(l);else{this._tree=l.context.parent,this.buffer=l.context;for(let r=l._parent;r;r=r._parent)this.stack.unshift(r.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:r,buffer:o}=this.buffer;return this.type=i||o.set.types[o.buffer[l]],this.from=r+o.buffer[l+1],this.to=r+o.buffer[l+2],!0}yield(l){return l?l instanceof Ln?(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,r){if(!this.buffer)return this.yield(this._tree.nextChild(l<0?this._tree._tree.children.length-1:0,l,i,r,this.mode));let{buffer:o}=this.buffer,d=o.findChild(this.index+4,o.buffer[this.index+3],l,i-this.buffer.start,r);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,r=this.mode){return this.buffer?r&Ot.ExcludeBuffers?!1:this.enterChild(1,l,i):this.yield(this._tree.enter(l,i,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Ot.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let l=this.mode&Ot.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,r=this.stack.length-1;if(l<0){let o=r<0?0:this.stack[r]+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<(r<0?i.buffer.length:i.buffer[this.stack[r]+3]))return this.yieldBuf(o)}return r<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,r,{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:r}=o)}else({index:i,_parent:r}=this._tree);for(;r;{index:i,_parent:r}=r)if(i>-1)for(let d=i+l,h=l<0?-1:r._tree.children.length;d!=h;d+=l){let g=r._tree.children[d];if(this.mode&Ot.IncludeAnonymous||g instanceof Ls||!g.type.isAnonymous||Rh(g))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,r=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,r=d+1;break e}o=this.stack[--d]}for(let o=r;o<this.stack.length;o++)i=new _a(this.buffer,i,this.stack[o]);return this.bufferNode=new _a(this.buffer,i,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(l,i){for(let r=0;;){let o=!1;if(this.type.isAnonymous||l(this)!==!1){if(this.firstChild()){r++;continue}this.type.isAnonymous||(o=!0)}for(;;){if(o&&i&&i(this),o=this.type.isAnonymous,!r)return;if(this.nextSibling())break;this.parent(),r--,o=!0}}}matchContext(l){if(!this.buffer)return mh(this.node.parent,l);let{buffer:i}=this.buffer,{types:r}=i.set;for(let o=l.length-1,d=this.stack.length-1;o>=0;d--){if(d<0)return mh(this._tree,l,o);let h=r[i.buffer[this.stack[d]]];if(!h.isAnonymous){if(l[o]&&l[o]!=h.name)return!1;o--}}return!0}}function Rh(s){return s.children.some(l=>l instanceof Ls||!l.type.isAnonymous||Rh(l))}function Cv(s){var l;let{buffer:i,nodeSet:r,maxBufferLength:o=wv,reused:d=[],minRepeatType:h=r.types.length}=s,g=Array.isArray(i)?new Ch(i,i.length):i,m=r.types,b=0,x=0;function k(V,D,R,Z,ce,de){let{id:K,start:le,end:me,size:Ae}=g,ve=x,z=b;if(Ae<0)if(g.next(),Ae==-1){let N=d[K];R.push(N),Z.push(le-V);return}else if(Ae==-3){b=K;return}else if(Ae==-4){x=K;return}else throw new RangeError(`Unrecognized record size: ${Ae}`);let ee=m[K],P,xe,Ne=le-V;if(me-le<=o&&(xe=O(g.pos-D,ce))){let N=new Uint16Array(xe.size-xe.skip),I=g.pos-xe.size,ie=N.length;for(;g.pos>I;)ie=F(xe.start,N,ie);P=new Ls(N,me-xe.start,r),Ne=xe.start-V}else{let N=g.pos-Ae;g.next();let I=[],ie=[],re=K>=h?K:-1,_e=0,Te=me;for(;g.pos>N;)re>=0&&g.id==re&&g.size>=0?(g.end<=Te-o&&(T(I,ie,le,_e,g.end,Te,re,ve,z),_e=I.length,Te=g.end),g.next()):de>2500?_(le,N,I,ie):k(le,N,I,ie,re,de+1);if(re>=0&&_e>0&&_e<I.length&&T(I,ie,le,_e,le,Te,re,ve,z),I.reverse(),ie.reverse(),re>-1&&_e>0){let Me=A(ee,z);P=Mh(ee,I,ie,0,I.length,0,me-le,Me,Me)}else P=L(ee,I,ie,me-le,ve-me,z)}R.push(P),Z.push(Ne)}function _(V,D,R,Z){let ce=[],de=0,K=-1;for(;g.pos>D;){let{id:le,start:me,end:Ae,size:ve}=g;if(ve>4)g.next();else{if(K>-1&&me<K)break;K<0&&(K=Ae-o),ce.push(le,me,Ae),de++,g.next()}}if(de){let le=new Uint16Array(de*4),me=ce[ce.length-2];for(let Ae=ce.length-3,ve=0;Ae>=0;Ae-=3)le[ve++]=ce[Ae],le[ve++]=ce[Ae+1]-me,le[ve++]=ce[Ae+2]-me,le[ve++]=ve;R.push(new Ls(le,ce[2]-me,r)),Z.push(me-V)}}function A(V,D){return(R,Z,ce)=>{let de=0,K=R.length-1,le,me;if(K>=0&&(le=R[K])instanceof al){if(!K&&le.type==V&&le.length==ce)return le;(me=le.prop(zt.lookAhead))&&(de=Z[K]+le.length+me)}return L(V,R,Z,ce,de,D)}}function T(V,D,R,Z,ce,de,K,le,me){let Ae=[],ve=[];for(;V.length>Z;)Ae.push(V.pop()),ve.push(D.pop()+R-ce);V.push(L(r.types[K],Ae,ve,de-ce,le-de,me)),D.push(ce-R)}function L(V,D,R,Z,ce,de,K){if(de){let le=[zt.contextHash,de];K=K?[le].concat(K):[le]}if(ce>25){let le=[zt.lookAhead,ce];K=K?[le].concat(K):[le]}return new al(V,D,R,Z,K)}function O(V,D){let R=g.fork(),Z=0,ce=0,de=0,K=R.end-o,le={size:0,start:0,skip:0};e:for(let me=R.pos-V;R.pos>me;){let Ae=R.size;if(R.id==D&&Ae>=0){le.size=Z,le.start=ce,le.skip=de,de+=4,Z+=4,R.next();continue}let ve=R.pos-Ae;if(Ae<0||ve<me||R.start<K)break;let z=R.id>=h?4:0,ee=R.start;for(R.next();R.pos>ve;){if(R.size<0)if(R.size==-3||R.size==-4)z+=4;else break e;else R.id>=h&&(z+=4);R.next()}ce=ee,Z+=Ae,de+=z}return(D<0||Z==V)&&(le.size=Z,le.start=ce,le.skip=de),le.size>4?le:void 0}function F(V,D,R){let{id:Z,start:ce,end:de,size:K}=g;if(g.next(),K>=0&&Z<h){let le=R;if(K>4){let me=g.pos-(K-4);for(;g.pos>me;)R=F(V,D,R)}D[--R]=le,D[--R]=de-V,D[--R]=ce-V,D[--R]=Z}else K==-3?b=Z:K==-4&&(x=Z);return R}let q=[],Q=[];for(;g.pos>0;)k(s.start||0,s.bufferStart||0,q,Q,-1,0);let E=(l=s.length)!==null&&l!==void 0?l:q.length?Q[0]+q[0].length:0;return new al(m[s.topID],q.reverse(),Q.reverse(),E)}const Ty=new WeakMap;function mo(s,l){if(!s.isAnonymous||l instanceof Ls||l.type!=s)return 1;let i=Ty.get(l);if(i==null){i=1;for(let r of l.children){if(r.type!=s||!(r instanceof al)){i=1;break}i+=mo(s,r)}Ty.set(l,i)}return i}function Mh(s,l,i,r,o,d,h,g,m){let b=0;for(let T=r;T<o;T++)b+=mo(s,l[T]);let x=Math.ceil(b*1.5/8),k=[],_=[];function A(T,L,O,F,q){for(let Q=O;Q<F;){let E=Q,V=L[Q],D=mo(s,T[Q]);for(Q++;Q<F;Q++){let R=mo(s,T[Q]);if(D+R>=x)break;D+=R}if(Q==E+1){if(D>x){let R=T[E];A(R.children,R.positions,0,R.children.length,L[E]+q);continue}k.push(T[E])}else{let R=L[Q-1]+T[Q-1].length-V;k.push(Mh(s,T,L,E,Q,V,R,null,m))}_.push(V+q-d)}}return A(l,i,r,o,0),(g||m)(k,_,h)}class cw{constructor(){this.map=new WeakMap}setBuffer(l,i,r){let o=this.map.get(l);o||this.map.set(l,o=new Map),o.set(i,r)}getBuffer(l,i){let r=this.map.get(l);return r&&r.get(i)}set(l,i){l instanceof _a?this.setBuffer(l.context.buffer,l.index,i):l instanceof Ln&&this.map.set(l.tree,i)}get(l){return l instanceof _a?this.getBuffer(l.context.buffer,l.index):l instanceof Ln?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 Cc{constructor(l,i,r,o,d=!1,h=!1){this.from=l,this.to=i,this.tree=r,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=[],r=!1){let o=[new Cc(0,l.length,l,0,!1,r)];for(let d of i)d.to>l.length&&o.push(d);return o}static applyChanges(l,i,r=128){if(!i.length)return l;let o=[],d=1,h=l.length?l[0]:null;for(let g=0,m=0,b=0;;g++){let x=g<i.length?i[g]:null,k=x?x.fromA:1e9;if(k-m>=r)for(;h&&h.from<k;){let _=h;if(m>=_.from||k<=_.to||b){let A=Math.max(_.from,m)-b,T=Math.min(_.to,k)-b;_=A>=T?null:new Cc(A,T,_.tree,_.offset+b,g>0,!!x)}if(_&&o.push(_),h.to>k)break;h=d<l.length?l[d++]:null}if(!x)break;m=x.toA,b=x.toA-x.toB}return o}}class uw{startParse(l,i,r){return typeof l=="string"&&(l=new Rv(l)),r=r?r.length?r.map(o=>new Dl(o.from,o.to)):[new Dl(0,0)]:[new Dl(0,l.length)],this.createParse(l,i||[],r)}parse(l,i,r){let o=this.startParse(l,i,r);for(;;){let d=o.advance();if(d)return d}}}class Rv{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 ow(s){return(l,i,r,o)=>new Ov(l,s,i,r,o)}class Ny{constructor(l,i,r,o,d,h){this.parser=l,this.parse=i,this.overlay=r,this.bracketed=o,this.target=d,this.from=h}}function jy(s){if(!s.length||s.some(l=>l.from>=l.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(s))}class Mv{constructor(l,i,r,o,d,h,g,m){this.parser=l,this.predicate=i,this.mounts=r,this.index=o,this.start=d,this.bracketed=h,this.target=g,this.prev=m,this.depth=0,this.ranges=[]}}const gh=new zt({perNode:!0});class Ov{constructor(l,i,r,o,d){this.nest=i,this.input=r,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 r=this.baseParse.advance();if(!r)return null;if(this.baseParse=null,this.baseTree=r,this.startInner(),this.stoppedAt!=null)for(let o of this.inner)o.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let r=this.baseTree;return this.stoppedAt!=null&&(r=new al(r.type,r.children,r.positions,r.length,r.propValues.concat([[gh,this.stoppedAt]]))),r}let l=this.inner[this.innerDone],i=l.parse.advance();if(i){this.innerDone++;let r=Object.assign(Object.create(null),l.target.props);r[zt.mounted.id]=new ur(i,l.overlay,l.parser,l.bracketed),l.target.props=r}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 Lv(this.fragments),i=null,r=null,o=new xo(new Ln(this.baseTree,this.ranges[0].from,0,null),Ot.IncludeAnonymous|Ot.IgnoreMounts);e:for(let d,h;;){let g=!0,m;if(this.stoppedAt!=null&&o.from>=this.stoppedAt)g=!1;else if(l.hasNode(o)){if(i){let b=i.mounts.find(x=>x.frag.from<=o.from&&x.frag.to>=o.to&&x.mount.overlay);if(b)for(let x of b.mount.overlay){let k=x.from+b.pos,_=x.to+b.pos;k>=o.from&&_<=o.to&&!i.ranges.some(A=>A.from<_&&A.to>k)&&i.ranges.push({from:k,to:_})}}g=!1}else if(r&&(h=Dv(r.ranges,o.from,o.to)))g=h!=2;else if(!o.type.isAnonymous&&(d=this.nest(o,this.input))&&(o.from<o.to||!d.overlay)){o.tree||(zv(o),i&&i.depth++,r&&r.depth++);let b=l.findMounts(o.from,d.parser);if(typeof d.overlay=="function")i=new Mv(d.parser,d.overlay,b,this.inner.length,o.from,!!d.bracketed,o.tree,i);else{let x=Cy(this.ranges,d.overlay||(o.from<o.to?[new Dl(o.from,o.to)]:[]));x.length&&jy(x),(x.length||!d.overlay)&&this.inner.push(new Ny(d.parser,x.length?d.parser.startParse(this.input,Ry(b,x),x):d.parser.startParse(""),d.overlay?d.overlay.map(k=>new Dl(k.from-o.from,k.to-o.from)):null,!!d.bracketed,o.tree,x.length?x[0].from:o.from)),d.overlay?x.length&&(r={ranges:x,depth:0,prev:r}):g=!1}}else if(i&&(m=i.predicate(o))&&(m===!0&&(m=new Dl(o.from,o.to)),m.from<m.to)){let b=i.ranges.length-1;b>=0&&i.ranges[b].to==m.from?i.ranges[b]={from:i.ranges[b].from,to:m.to}:i.ranges.push(m)}if(g&&o.firstChild())i&&i.depth++,r&&r.depth++;else for(;!o.nextSibling();){if(!o.parent())break e;if(i&&!--i.depth){let b=Cy(this.ranges,i.ranges);b.length&&(jy(b),this.inner.splice(i.index,0,new Ny(i.parser,i.parser.startParse(this.input,Ry(i.mounts,b),b),i.ranges.map(x=>new Dl(x.from-i.start,x.to-i.start)),i.bracketed,i.target,b[0].from))),i=i.prev}r&&!--r.depth&&(r=r.prev)}}}}function Dv(s,l,i){for(let r of s){if(r.from>=i)break;if(r.to>l)return r.from<=l&&r.to>=i?2:1}return 0}function Ey(s,l,i,r,o,d){if(l<i){let h=s.buffer[l+1];r.push(s.slice(l,i,h)),o.push(h-d)}}function zv(s){let{node:l}=s,i=[],r=l.context.buffer;do i.push(s.index),s.parent();while(!s.tree);let o=s.tree,d=o.children.indexOf(r),h=o.children[d],g=h.buffer,m=[d];function b(x,k,_,A,T,L){let O=i[L],F=[],q=[];Ey(h,x,O,F,q,A);let Q=g[O+1],E=g[O+2];m.push(F.length);let V=L?b(O+4,g[O+3],h.set.types[g[O]],Q,E-Q,L-1):l.toTree();return F.push(V),q.push(Q-A),Ey(h,g[O+3],k,F,q,A),new al(_,F,q,T)}o.children[d]=b(0,g.length,Zl.none,0,h.length,i.length-1);for(let x of m){let k=s.tree.children[x],_=s.tree.positions[x];s.yield(new Ln(k,_+s.from,x,s._tree))}}class Ay{constructor(l,i){this.offset=i,this.done=!1,this.cursor=l.cursor(Ot.IncludeAnonymous|Ot.IgnoreMounts)}moveTo(l){let{cursor:i}=this,r=l-this.offset;for(;!this.done&&i.from<r;)if(!(i.to>=l&&i.enter(r,1,Ot.IgnoreOverlays|Ot.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 al)i=i.children[0];else break}return!1}}class Lv{constructor(l){var i;if(this.fragments=l,this.curTo=0,this.fragI=0,l.length){let r=this.curFrag=l[0];this.curTo=(i=r.tree.prop(gh))!==null&&i!==void 0?i:r.to,this.inner=new Ay(r.tree,-r.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(gh))!==null&&l!==void 0?l:i.to,this.inner=new Ay(i.tree,-i.offset)}}findMounts(l,i){var r;let o=[];if(this.inner){this.inner.cursor.moveTo(l,1);for(let d=this.inner.cursor.node;d;d=d.parent){let h=(r=d.tree)===null||r===void 0?void 0:r.prop(zt.mounted);if(h&&h.parser==i)for(let g=this.fragI;g<this.fragments.length;g++){let m=this.fragments[g];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 Cy(s,l){let i=null,r=l;for(let o=1,d=0;o<s.length;o++){let h=s[o-1].to,g=s[o].from;for(;d<r.length;d++){let m=r[d];if(m.from>=g)break;m.to<=h||(i||(r=i=l.slice()),m.from<h?(i[d]=new Dl(m.from,h),m.to>g&&i.splice(d+1,0,new Dl(g,m.to))):m.to>g?i[d--]=new Dl(g,m.to):i.splice(d--,1))}}return r}function Uv(s,l,i,r){let o=0,d=0,h=!1,g=!1,m=-1e9,b=[];for(;;){let x=o==s.length?1e9:h?s[o].to:s[o].from,k=d==l.length?1e9:g?l[d].to:l[d].from;if(h!=g){let _=Math.max(m,i),A=Math.min(x,k,r);_<A&&b.push(new Dl(_,A))}if(m=Math.min(x,k),m==1e9)break;x==m&&(h?(h=!1,o++):h=!0),k==m&&(g?(g=!1,d++):g=!0)}return b}function Ry(s,l){let i=[];for(let{pos:r,mount:o,frag:d}of s){let h=r+(o.overlay?o.overlay[0].from:0),g=h+o.tree.length,m=Math.max(d.from,h),b=Math.min(d.to,g);if(o.overlay){let x=o.overlay.map(_=>new Dl(_.from+r,_.to+r)),k=Uv(l,x,m,b);for(let _=0,A=m;;_++){let T=_==k.length,L=T?b:k[_].from;if(L>A&&i.push(new Cc(A,L,o.tree,-h,d.from>=A||d.openStart,d.to<=L||d.openEnd)),T)break;A=k[_].to}}else i.push(new Cc(m,b,o.tree,-h,d.from>=h||d.openStart,d.to<=g||d.openEnd))}return i}let Hv=0;class Ol{constructor(l,i,r,o){this.name=l,this.set=i,this.base=r,this.modified=o,this.id=Hv++}toString(){let{name:l}=this;for(let i of this.modified)i.name&&(l=`${i.name}(${l})`);return l}static define(l,i){let r=typeof l=="string"?l:"?";if(l instanceof Ol&&(i=l),i!=null&&i.base)throw new Error("Can not derive from a modified tag");let o=new Ol(r,[],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 _o(l);return r=>r.modified.indexOf(i)>-1?r:_o.get(r.base||r,r.modified.concat(i).sort((o,d)=>o.id-d.id))}}let Bv=0;class _o{constructor(l){this.name=l,this.instances=[],this.id=Bv++}static get(l,i){if(!i.length)return l;let r=i[0].instances.find(g=>g.base==l&&qv(i,g.modified));if(r)return r;let o=[],d=new Ol(l.name,o,l,i);for(let g of i)g.instances.push(d);let h=Gv(i);for(let g of l.set)if(!g.modified.length)for(let m of h)o.push(_o.get(g,m));return d}}function qv(s,l){return s.length==l.length&&s.every((i,r)=>i==l[r])}function Gv(s){let l=[[]];for(let i=0;i<s.length;i++)for(let r=0,o=l.length;r<o;r++)l.push(l[r].concat(s[i]));return l.sort((i,r)=>r.length-i.length)}function fw(s){let l=Object.create(null);for(let i in s){let r=s[i];Array.isArray(r)||(r=[r]);for(let o of i.split(" "))if(o){let d=[],h=2,g=o;for(let k=0;;){if(g=="..."&&k>0&&k+3==o.length){h=1;break}let _=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(g);if(!_)throw new RangeError("Invalid path: "+o);if(d.push(_[0]=="*"?"":_[0][0]=='"'?JSON.parse(_[0]):_[0]),k+=_[0].length,k==o.length)break;let A=o[k++];if(k==o.length&&A=="!"){h=0;break}if(A!="/")throw new RangeError("Invalid path: "+o);g=o.slice(k)}let m=d.length-1,b=d[m];if(!b)throw new RangeError("Invalid path: "+o);let x=new Rc(r,h,m>0?d.slice(0,m):null);l[b]=x.sort(l[b])}}return Ub.add(l)}const Ub=new zt({combine(s,l){let i,r,o;for(;s||l;){if(!s||l&&s.depth>=l.depth?(o=l,l=l.next):(o=s,s=s.next),i&&i.mode==o.mode&&!o.context&&!i.context)continue;let d=new Rc(o.tags,o.mode,o.context);i?i.next=d:r=d,i=d}return r}});class Rc{constructor(l,i,r,o){this.tags=l,this.mode=i,this.context=r,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}}Rc.empty=new Rc([],2,null);function Hb(s,l){let i=Object.create(null);for(let d of s)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:r,all:o=null}=l||{};return{style:d=>{let h=o;for(let g of d)for(let m of g.set){let b=i[m.id];if(b){h=h?h+" "+b:b;break}}return h},scope:r}}function Yv(s,l){let i=null;for(let r of s){let o=r.style(l);o&&(i=i?i+" "+o:o)}return i}function Iv(s,l,i,r=0,o=s.length){let d=new Vv(r,Array.isArray(l)?l:[l],i);d.highlightRange(s.cursor(),r,o,"",d.highlighters),d.flush(o)}function Xv(s,l,i,r,o,d=0,h=s.length){let g=d;function m(b,x){if(!(b<=g)){for(let k=s.slice(g,b),_=0;;){let A=k.indexOf(`
|
|
116
|
+
`,_),T=A<0?k.length:A;if(T>_&&r(k.slice(_,T),x),A<0)break;o(),_=A+1}g=b}}Iv(l,i,(b,x,k)=>{m(b,""),m(x,k)},d,h),m(h,"")}class Vv{constructor(l,i,r){this.at=l,this.highlighters=i,this.span=r,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,r,o,d){let{type:h,from:g,to:m}=l;if(g>=r||m<=i)return;h.isTop&&(d=this.highlighters.filter(A=>!A.scope||A.scope(h)));let b=o,x=Qv(l)||Rc.empty,k=Yv(d,x.tags);if(k&&(b&&(b+=" "),b+=k,x.mode==1&&(o+=(o?" ":"")+k)),this.startSpan(Math.max(i,g),b),x.opaque)return;let _=l.tree&&l.tree.prop(zt.mounted);if(_&&_.overlay){let A=l.node.enter(_.overlay[0].from+g,1),T=this.highlighters.filter(O=>!O.scope||O.scope(_.tree.type)),L=l.firstChild();for(let O=0,F=g;;O++){let q=O<_.overlay.length?_.overlay[O]:null,Q=q?q.from+g:m,E=Math.max(i,F),V=Math.min(r,Q);if(E<V&&L)for(;l.from<V&&(this.highlightRange(l,E,V,o,d),this.startSpan(Math.min(V,l.to),b),!(l.to>=Q||!l.nextSibling())););if(!q||Q>r)break;F=q.to+g,F>i&&(this.highlightRange(A.cursor(),Math.max(i,q.from+g),Math.min(r,F),"",T),this.startSpan(Math.min(r,F),b))}L&&l.parent()}else if(l.firstChild()){_&&(o="");do if(!(l.to<=i)){if(l.from>=r)break;this.highlightRange(l,i,r,o,d),this.startSpan(Math.min(r,l.to),b)}while(l.nextSibling());l.parent()}}}function Qv(s){let l=s.type.prop(Ub);for(;l&&l.context&&!s.matchContext(l.context);)l=l.next;return l||null}const ge=Ol.define,no=ge(),Cs=ge(),My=ge(Cs),Oy=ge(Cs),Rs=ge(),lo=ge(Rs),Jd=ge(Rs),ya=ge(),ci=ge(ya),da=ge(),ha=ge(),yh=ge(),wc=ge(yh),ao=ge(),be={comment:no,lineComment:ge(no),blockComment:ge(no),docComment:ge(no),name:Cs,variableName:ge(Cs),typeName:My,tagName:ge(My),propertyName:Oy,attributeName:ge(Oy),className:ge(Cs),labelName:ge(Cs),namespace:ge(Cs),macroName:ge(Cs),literal:Rs,string:lo,docString:ge(lo),character:ge(lo),attributeValue:ge(lo),number:Jd,integer:ge(Jd),float:ge(Jd),bool:ge(Rs),regexp:ge(Rs),escape:ge(Rs),color:ge(Rs),url:ge(Rs),keyword:da,self:ge(da),null:ge(da),atom:ge(da),unit:ge(da),modifier:ge(da),operatorKeyword:ge(da),controlKeyword:ge(da),definitionKeyword:ge(da),moduleKeyword:ge(da),operator:ha,derefOperator:ge(ha),arithmeticOperator:ge(ha),logicOperator:ge(ha),bitwiseOperator:ge(ha),compareOperator:ge(ha),updateOperator:ge(ha),definitionOperator:ge(ha),typeOperator:ge(ha),controlOperator:ge(ha),punctuation:yh,separator:ge(yh),bracket:wc,angleBracket:ge(wc),squareBracket:ge(wc),paren:ge(wc),brace:ge(wc),content:ya,heading:ci,heading1:ge(ci),heading2:ge(ci),heading3:ge(ci),heading4:ge(ci),heading5:ge(ci),heading6:ge(ci),contentSeparator:ge(ya),list:ge(ya),quote:ge(ya),emphasis:ge(ya),strong:ge(ya),link:ge(ya),monospace:ge(ya),strikethrough:ge(ya),inserted:ge(),deleted:ge(),changed:ge(),invalid:ge(),meta:ao,documentMeta:ge(ao),annotation:ge(ao),processingInstruction:ge(ao),definition:Ol.defineModifier("definition"),constant:Ol.defineModifier("constant"),function:Ol.defineModifier("function"),standard:Ol.defineModifier("standard"),local:Ol.defineModifier("local"),special:Ol.defineModifier("special")};for(let s in be){let l=be[s];l instanceof Ol&&(l.name=s)}Hb([{tag:be.link,class:"tok-link"},{tag:be.heading,class:"tok-heading"},{tag:be.emphasis,class:"tok-emphasis"},{tag:be.strong,class:"tok-strong"},{tag:be.keyword,class:"tok-keyword"},{tag:be.atom,class:"tok-atom"},{tag:be.bool,class:"tok-bool"},{tag:be.url,class:"tok-url"},{tag:be.labelName,class:"tok-labelName"},{tag:be.inserted,class:"tok-inserted"},{tag:be.deleted,class:"tok-deleted"},{tag:be.literal,class:"tok-literal"},{tag:be.string,class:"tok-string"},{tag:be.number,class:"tok-number"},{tag:[be.regexp,be.escape,be.special(be.string)],class:"tok-string2"},{tag:be.variableName,class:"tok-variableName"},{tag:be.local(be.variableName),class:"tok-variableName tok-local"},{tag:be.definition(be.variableName),class:"tok-variableName tok-definition"},{tag:be.special(be.variableName),class:"tok-variableName2"},{tag:be.definition(be.propertyName),class:"tok-propertyName tok-definition"},{tag:be.typeName,class:"tok-typeName"},{tag:be.namespace,class:"tok-namespace"},{tag:be.className,class:"tok-className"},{tag:be.macroName,class:"tok-macroName"},{tag:be.propertyName,class:"tok-propertyName"},{tag:be.operator,class:"tok-operator"},{tag:be.comment,class:"tok-comment"},{tag:be.meta,class:"tok-meta"},{tag:be.invalid,class:"tok-invalid"},{tag:be.punctuation,class:"tok-punctuation"}]);const $v="modulepreload",Zv=function(s,l){return new URL(s,l).href},Dy={},Ie=function(l,i,r){let o=Promise.resolve();if(i&&i.length>0){let h=function(x){return Promise.all(x.map(k=>Promise.resolve(k).then(_=>({status:"fulfilled",value:_}),_=>({status:"rejected",reason:_}))))};const g=document.getElementsByTagName("link"),m=document.querySelector("meta[property=csp-nonce]"),b=(m==null?void 0:m.nonce)||(m==null?void 0:m.getAttribute("nonce"));o=h(i.map(x=>{if(x=Zv(x,r),x in Dy)return;Dy[x]=!0;const k=x.endsWith(".css"),_=k?'[rel="stylesheet"]':"";if(!!r)for(let L=g.length-1;L>=0;L--){const O=g[L];if(O.href===x&&(!k||O.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${x}"]${_}`))return;const T=document.createElement("link");if(T.rel=k?"stylesheet":$v,k||(T.as="script"),T.crossOrigin="",T.href=x,b&&T.setAttribute("nonce",b),document.head.appendChild(T),k)return new Promise((L,O)=>{T.addEventListener("load",L),T.addEventListener("error",()=>O(new Error(`Unable to preload CSS for ${x}`)))})}))}function d(h){const g=new Event("vite:preloadError",{cancelable:!0});if(g.payload=h,window.dispatchEvent(g),!g.defaultPrevented)throw h}return o.then(h=>{for(const g of h||[])g.status==="rejected"&&d(g.reason);return l().catch(d)})},Bb={js:async()=>(await Ie(async()=>{const{javascript:s}=await import("./index-EHaCUl16.js");return{javascript:s}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({jsx:!0}),cjs:async()=>(await Ie(async()=>{const{javascript:s}=await import("./index-EHaCUl16.js");return{javascript:s}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript(),mjs:async()=>(await Ie(async()=>{const{javascript:s}=await import("./index-EHaCUl16.js");return{javascript:s}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript(),jsx:async()=>(await Ie(async()=>{const{javascript:s}=await import("./index-EHaCUl16.js");return{javascript:s}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({jsx:!0}),ts:async()=>(await Ie(async()=>{const{javascript:s}=await import("./index-EHaCUl16.js");return{javascript:s}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),mts:async()=>(await Ie(async()=>{const{javascript:s}=await import("./index-EHaCUl16.js");return{javascript:s}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),cts:async()=>(await Ie(async()=>{const{javascript:s}=await import("./index-EHaCUl16.js");return{javascript:s}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0}),tsx:async()=>(await Ie(async()=>{const{javascript:s}=await import("./index-EHaCUl16.js");return{javascript:s}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)).javascript({typescript:!0,jsx:!0}),json:async()=>(await Ie(async()=>{const{json:s}=await import("./index-_Y-EJULt.js");return{json:s}},__vite__mapDeps([6,1,2,3,4]),import.meta.url)).json(),jsonc:async()=>(await Ie(async()=>{const{json:s}=await import("./index-_Y-EJULt.js");return{json:s}},__vite__mapDeps([6,1,2,3,4]),import.meta.url)).json(),css:async()=>(await Ie(async()=>{const{css:s}=await import("./index-BuniMO1x.js");return{css:s}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),scss:async()=>(await Ie(async()=>{const{css:s}=await import("./index-BuniMO1x.js");return{css:s}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),less:async()=>(await Ie(async()=>{const{css:s}=await import("./index-BuniMO1x.js");return{css:s}},__vite__mapDeps([7,1,2,3,4]),import.meta.url)).css(),html:async()=>(await Ie(async()=>{const{html:s}=await import("./index-CXiddYxZ.js");return{html:s}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),htm:async()=>(await Ie(async()=>{const{html:s}=await import("./index-CXiddYxZ.js");return{html:s}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),vue:async()=>(await Ie(async()=>{const{html:s}=await import("./index-CXiddYxZ.js");return{html:s}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),svelte:async()=>(await Ie(async()=>{const{html:s}=await import("./index-CXiddYxZ.js");return{html:s}},__vite__mapDeps([8,1,7,2,3,4,0,5]),import.meta.url)).html(),md:async()=>(await Ie(async()=>{const{markdown:s}=await import("./index-D2QcAee0.js");return{markdown:s}},__vite__mapDeps([9,3,4,2,5,8,1,7,0]),import.meta.url)).markdown(),markdown:async()=>(await Ie(async()=>{const{markdown:s}=await import("./index-D2QcAee0.js");return{markdown:s}},__vite__mapDeps([9,3,4,2,5,8,1,7,0]),import.meta.url)).markdown(),py:async()=>(await Ie(async()=>{const{python:s}=await import("./index-GQ3tJswl.js");return{python:s}},__vite__mapDeps([10,1,2,3,4,5]),import.meta.url)).python(),pyi:async()=>(await Ie(async()=>{const{python:s}=await import("./index-GQ3tJswl.js");return{python:s}},__vite__mapDeps([10,1,2,3,4,5]),import.meta.url)).python(),yaml:async()=>(await Ie(async()=>{const{yaml:s}=await import("./index-D3avVSzn.js");return{yaml:s}},__vite__mapDeps([11,1,2,3,4]),import.meta.url)).yaml(),yml:async()=>(await Ie(async()=>{const{yaml:s}=await import("./index-D3avVSzn.js");return{yaml:s}},__vite__mapDeps([11,1,2,3,4]),import.meta.url)).yaml(),rs:async()=>(await Ie(async()=>{const{rust:s}=await import("./index-D1EGRMsF.js");return{rust:s}},__vite__mapDeps([12,1,2,3,4]),import.meta.url)).rust(),c:async()=>(await Ie(async()=>{const{cpp:s}=await import("./index-u0GQ-BLb.js");return{cpp:s}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),h:async()=>(await Ie(async()=>{const{cpp:s}=await import("./index-u0GQ-BLb.js");return{cpp:s}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),cc:async()=>(await Ie(async()=>{const{cpp:s}=await import("./index-u0GQ-BLb.js");return{cpp:s}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),cpp:async()=>(await Ie(async()=>{const{cpp:s}=await import("./index-u0GQ-BLb.js");return{cpp:s}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),hpp:async()=>(await Ie(async()=>{const{cpp:s}=await import("./index-u0GQ-BLb.js");return{cpp:s}},__vite__mapDeps([13,1,2,3,4]),import.meta.url)).cpp(),java:async()=>(await Ie(async()=>{const{java:s}=await import("./index-DcGZZXlE.js");return{java:s}},__vite__mapDeps([14,1,2,3,4]),import.meta.url)).java(),go:async()=>(await Ie(async()=>{const{go:s}=await import("./index-DAN-BZ4M.js");return{go:s}},__vite__mapDeps([15,1,2,3,4,5]),import.meta.url)).go(),php:async()=>(await Ie(async()=>{const{php:s}=await import("./index-CtUwaQ4R.js");return{php:s}},__vite__mapDeps([16,1,8,7,2,3,4,0,5]),import.meta.url)).php(),sql:async()=>(await Ie(async()=>{const{sql:s}=await import("./index-CbrZsnLR.js");return{sql:s}},__vite__mapDeps([17,2,3,4,1,5]),import.meta.url)).sql(),xml:async()=>(await Ie(async()=>{const{xml:s}=await import("./index-CzWhd9WN.js");return{xml:s}},__vite__mapDeps([18,1,2,3,4]),import.meta.url)).xml(),svg:async()=>(await Ie(async()=>{const{xml:s}=await import("./index-CzWhd9WN.js");return{xml:s}},__vite__mapDeps([18,1,2,3,4]),import.meta.url)).xml()},Kv={".mcp.json":"json",dockerfile:"yaml",makefile:"yaml"},Jv={javascript:"js",node:"js",typescript:"ts",python:"py",python3:"py",yml:"yaml",rust:"rs",golang:"go","c++":"cpp",cplusplus:"cpp"};async function Fv(s){const l=Jv[s.toLowerCase()]??s.toLowerCase(),i=Bb[l];return i?i().catch(()=>null):null}async function Wv(s){const l=(s.split("/").pop()??"").toLowerCase(),i=Kv[l]??l.split(".").pop()??"",r=Bb[i];return r?r().catch(()=>null):null}const Pv=Hb([{tag:[be.keyword,be.modifier,be.controlKeyword,be.moduleKeyword],class:"cmh-key"},{tag:[be.propertyName],class:"cmh-prop"},{tag:[be.function(be.variableName),be.labelName],class:"cmh-fn"},{tag:[be.color,be.constant(be.name),be.standard(be.name),be.bool],class:"cmh-const"},{tag:[be.typeName,be.className,be.changed,be.annotation,be.self,be.namespace],class:"cmh-type"},{tag:[be.number,be.integer,be.float],class:"cmh-num"},{tag:[be.string,be.special(be.string),be.regexp],class:"cmh-str"},{tag:[be.operator,be.operatorKeyword,be.escape],class:"cmh-op"},{tag:[be.meta,be.comment],class:"cmh-comment"},{tag:be.invalid,class:"cmh-invalid"}]);function so(s){return s.replace(/[&<>]/g,l=>l==="&"?"&":l==="<"?"<":">")}async function e1(s,l){const i=l?await Fv(l):null;if(!i)return so(s);try{const r=i.language.parser.parse(s);let o="";return Xv(s,r,Pv,(d,h)=>{o+=h?`<span class="${h}">${so(d)}</span>`:so(d)},()=>{o+=`
|
|
117
|
+
`}),o}catch{return so(s)}}dt.setOptions({gfm:!0,breaks:!1});function qb(s){var i;const l=(i=s.split(".").pop())==null?void 0:i.toLowerCase();return l==="md"||l==="markdown"}async function Gb(s){const l=await dt.parse(s,{async:!0,walkTokens:async i=>{if(i.type!=="code")return;const r=i;r.text=await e1(r.text,r.lang??""),r.escaped=!0}});return kv.sanitize(l)}function zy(s,l){return{path:s.path,text:s.content,saved:s.content,eol:s.eol,mtime:s.mtime,size:s.size,binary:s.binary,tooLarge:s.tooLarge,stale:!1,revision:l,previewMode:qb(s.path)}}function Qa(s){return!s.binary&&!s.tooLarge&&s.text!==s.saved}function t1(s){return s.split("/").pop()??s}function or(s){const l=s.lastIndexOf("/");return l===-1?"":s.slice(0,l)}function Fd(s){return s<1024?`${s} Б`:s<1024*1024?`${(s/1024).toFixed(1)} КБ`:`${(s/1024/1024).toFixed(1)} МБ`}const n1=3500,l1=9e3,a1=220;function zc({result:s}){const[l,i]=S.useState(s),[r,o]=S.useState(!1);return S.useEffect(()=>{if(!s){i(null),o(!1);return}i(s),o(!1);const d=s.ok?n1:l1,h=setTimeout(()=>o(!0),d),g=setTimeout(()=>i(null),d+a1);return()=>{clearTimeout(h),clearTimeout(g)}},[s]),l?c.jsx("div",{className:"oplog "+(l.ok?"oplog--ok":"oplog--bad")+(r?" oplog--leaving":""),role:"status","aria-live":l.ok?"polite":"assertive",children:l.message}):null}function Mc({value:s,className:l,placeholder:i="Название сессии",onCommit:r,onCancel:o}){const[d,h]=S.useState(s),g=S.useRef(null);S.useEffect(()=>{var b;(b=g.current)==null||b.select()},[]);function m(){const b=d.trim();if(!b||b===s)return o();r(b)}return c.jsx("input",{ref:g,className:l?`rename ${l}`:"rename",value:d,autoFocus:!0,spellCheck:!1,placeholder:i,onChange:b=>h(b.target.value),onBlur:m,onKeyDown:b=>{b.stopPropagation(),b.key==="Enter"?(b.preventDefault(),m()):b.key==="Escape"&&(b.preventDefault(),o())}})}const ui="application/x-ccv-fs-path",s1=200;function i1({open:s,tree:l,expanded:i,activePath:r,dirty:o,gitChanges:d,result:h,searchResult:g,onSearch:m,onReveal:b,onToggle:x,onOpen:k,onCreate:_,onRename:A,onMove:T,onDelete:L,onRefresh:O,onClose:F}){const[q,Q]=S.useState(""),[E,V]=S.useState(null),[D,R]=S.useState(null),[Z,ce]=S.useState(null),[de,K]=S.useState(null),le=S.useMemo(()=>o1(d),[d]);function me(oe){return!(!Z||oe===Z.path||Z.kind==="dir"&&oe.startsWith(`${Z.path}/`)||oe===or(Z.path))}function Ae(oe){return ye=>{ye.dataTransfer.effectAllowed="move",ye.dataTransfer.setData(ui,oe.path),ce({path:oe.path,kind:oe.kind})}}function ve(){ce(null),K(null)}function z(oe){return ye=>{ye.dataTransfer.types.includes(ui)&&(ye.stopPropagation(),!(oe.kind!=="dir"||!me(oe.path))&&(ye.preventDefault(),K(oe.path)))}}function ee(oe){return ye=>{if(!ye.dataTransfer.types.includes(ui)||(ye.stopPropagation(),oe.kind!=="dir"||!me(oe.path)))return;ye.preventDefault();const tt=ye.dataTransfer.getData(ui);K(null),tt&&T(tt,oe.path)}}function P(oe){!oe.dataTransfer.types.includes(ui)||!me("")||(oe.preventDefault(),K(""))}function xe(oe){if(!oe.dataTransfer.types.includes(ui)||!me(""))return;oe.preventDefault();const ye=oe.dataTransfer.getData(ui);K(null),ye&&T(ye,"")}const[Ne,N]=S.useState(""),I=Ne.trim(),ie=I.length>0,re=S.useRef(null),_e=S.useRef(m);_e.current=m;function Te(oe){N(oe),re.current&&clearTimeout(re.current);const ye=oe.trim();if(!ye){_e.current("");return}re.current=setTimeout(()=>_e.current(ye),s1)}function Me(oe){re.current&&clearTimeout(re.current),N(""),_e.current(""),Q(oe.path),b(oe)}const et=ie&&(g==null?void 0:g.query)===I?g:null;function Ze(){if(q==="")return"";const oe=u1(l,q);if((oe==null?void 0:oe.kind)==="dir")return q;const ye=q.lastIndexOf("/");return ye===-1?"":q.slice(0,ye)}function at(oe){const ye=Ze();ye&&!i.has(ye)&&x(ye),R({parent:ye,kind:oe})}const qe=ie?[]:Nt("",0);function Nt(oe,ye){const tt=l[oe],Ft=[];if(D&&D.parent===oe&&Ft.push(c.jsxs("div",{className:"fsrow fsrow--draft",style:$a(ye),children:[c.jsx("span",{className:"fsrow__icon",children:D.kind==="dir"?c.jsx(So,{}):c.jsx(ko,{})}),c.jsx(Mc,{className:"rename--file",value:"",placeholder:D.kind==="dir"?"имя каталога":"имя файла",onCommit:Ue=>{R(null),_(oe,D.kind,Ue)},onCancel:()=>R(null)})]},`draft:${oe}`)),!tt)return Ft.push(c.jsx("p",{className:"fsrow__pending",style:$a(ye),children:"читаем…"},`wait:${oe}`)),Ft;tt.length===0&&!D&&Ft.push(c.jsx("p",{className:"fsrow__pending",style:$a(ye),children:"пусто"},`empty:${oe}`));for(const Ue of tt){const un=Ue.kind==="dir"&&i.has(Ue.path);Ft.push(E===Ue.path?c.jsxs("div",{className:"fsrow fsrow--draft",style:$a(ye),children:[c.jsx("span",{className:"fsrow__icon",children:Ue.kind==="dir"?c.jsx(So,{open:un}):c.jsx(ko,{})}),c.jsx(Mc,{className:"rename--file",value:Ue.name,placeholder:"новое имя",onCommit:mn=>{V(null),A(Ue.path,mn)},onCancel:()=>V(null)})]},Ue.path):c.jsx(r1,{entry:Ue,depth:ye,open:un,active:Ue.path===r,selected:Ue.path===q,dirty:o.has(Ue.path),gitStatus:le.get(Ue.path),dragging:(Z==null?void 0:Z.path)===Ue.path,dropTarget:de===Ue.path,onClick:()=>{Q(Ue.path),Ue.kind==="dir"?x(Ue.path):k(Ue.path)},onRename:()=>V(Ue.path),onDelete:()=>L(Ue),onDragStart:Ae(Ue),onDragEnd:ve,onDragOver:z(Ue),onDrop:ee(Ue)},Ue.path)),un&&Ft.push(...Nt(Ue.path,ye+1))}return Ft}function $e(){if(!et)return[c.jsx("p",{className:"fsrow__pending",style:$a(0),children:"ищем…"},"search:wait")];if(et.entries.length===0)return[c.jsx("p",{className:"fsrow__pending",style:$a(0),children:"ничего не найдено"},"search:empty")];const oe=et.entries.map(ye=>c.jsx(c1,{entry:ye,gitStatus:le.get(ye.path),onClick:()=>Me(ye)},ye.path));return et.truncated&&oe.push(c.jsxs("p",{className:"fsrow__pending",style:$a(0),children:["показаны первые ",et.entries.length," — уточните запрос"]},"search:truncated")),oe}return c.jsxs("aside",{className:s?"sidepane sidepane--files sidepane--open":"sidepane sidepane--files","aria-label":"Файлы проекта",children:[c.jsxs("div",{className:"sidepane__head",children:[c.jsx(p1,{}),c.jsx("span",{className:"sidepane__title",children:"Файлы"}),c.jsx("button",{className:"sidepane__btn",title:"Новый файл","aria-label":"Новый файл",onClick:()=>at("file"),children:c.jsx(d1,{})}),c.jsx("button",{className:"sidepane__btn",title:"Новый каталог","aria-label":"Новый каталог",onClick:()=>at("dir"),children:c.jsx(h1,{})}),c.jsx("button",{className:"sidepane__btn",title:"Перечитать дерево","aria-label":"Перечитать дерево",onClick:O,children:"↻"}),c.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель файлов",onClick:F,children:"✕"})]}),c.jsxs("div",{className:"fssearch",children:[c.jsx(m1,{}),c.jsx("input",{className:"fssearch__input",type:"text",value:Ne,spellCheck:!1,placeholder:"Поиск файлов и папок…","aria-label":"Поиск файлов и папок",onChange:oe=>Te(oe.target.value),onKeyDown:oe=>{oe.stopPropagation(),oe.key==="Escape"&&(oe.preventDefault(),Ne?Te(""):oe.currentTarget.blur())}}),Ne&&c.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>Te(""),children:"✕"})]}),c.jsx("div",{className:"sidepane__scroll fstree"+(de===""?" fstree--drop-target":""),onDragOver:P,onDrop:xe,children:ie?$e():qe}),c.jsx(zc,{result:h})]})}function r1({entry:s,depth:l,open:i,active:r,selected:o,dirty:d,gitStatus:h,dragging:g,dropTarget:m,onClick:b,onRename:x,onDelete:k,onDragStart:_,onDragEnd:A,onDragOver:T,onDrop:L}){const O="fsrow"+(r?" is-open":"")+(o&&!r?" is-selected":"")+(s.ignored?" fsrow--ignored":"")+(g?" fsrow--dragging":"")+(m?" fsrow--drop-target":"");return c.jsxs("div",{className:O,style:$a(l),draggable:!0,onDragStart:_,onDragEnd:A,onDragOver:T,onDrop:L,children:[c.jsxs("button",{className:"fsrow__main",onClick:b,title:Yb(s),children:[c.jsx("span",{className:"fsrow__icon"+vo("fsrow__icon",h),children:s.kind==="dir"?c.jsx(So,{open:i}):c.jsx(ko,{})}),c.jsx("span",{className:"fsrow__name"+vo("fsrow__name",h),children:s.name}),s.ignored&&c.jsx("span",{className:"fsrow__tag",title:"Игнорируется git (.gitignore)",children:"git-ignore"}),d&&c.jsx("span",{className:"fsrow__dot",title:"Есть несохранённые правки"})]}),c.jsx("button",{className:"fsrow__act",title:"Переименовать","aria-label":`Переименовать ${s.name}`,onClick:x,children:"✎"}),c.jsx("button",{className:"fsrow__act",title:"Удалить","aria-label":`Удалить ${s.name}`,onClick:k,children:"✕"})]})}function c1({entry:s,gitStatus:l,onClick:i}){const r=s.path.slice(0,s.path.length-s.name.length-1);return c.jsxs("button",{className:"fsrow fsrow--search"+(s.ignored?" fsrow--ignored":""),style:$a(0),onClick:i,title:Yb(s),children:[c.jsx("span",{className:"fsrow__icon"+vo("fsrow__icon",l),children:s.kind==="dir"?c.jsx(So,{}):c.jsx(ko,{})}),c.jsx("span",{className:"fsrow__name"+vo("fsrow__name",l),children:s.name}),s.ignored&&c.jsx("span",{className:"fsrow__tag",children:"git-ignore"}),r&&c.jsx("span",{className:"fsrow__path",children:r})]})}function Yb(s){return s.ignored?`${s.path} — игнорируется git (.gitignore)`:s.path}function $a(s){return{"--depth":s}}function u1(s,l){var o;const i=l.lastIndexOf("/"),r=i===-1?"":l.slice(0,i);return((o=s[r])==null?void 0:o.find(d=>d.path===l))??null}function o1(s){const l=new Map,i={added:1,modified:2},r=(o,d)=>{const h=l.get(o);(!h||i[d]>i[h])&&l.set(o,d)};for(const o of s){const d=f1(o.status);if(!d)continue;r(o.path,d);let h=or(o.path);for(;r(h,d),!!h;)h=or(h)}return l}function f1(s){if(s==="??")return"added";const[l="",i=""]=s;return l==="A"||l==="R"||l==="C"?"added":l==="M"||i==="M"?"modified":null}function vo(s,l){return l?` ${s}--git-${l}`:""}function So({open:s=!1}){return c.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,"aria-hidden":"true",children:s?c.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"}):c.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 ko(){return c.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,strokeLinejoin:"round","aria-hidden":"true",children:[c.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"}),c.jsx("path",{d:"M9 2v3.2h3.3"})]})}function d1(){return c.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,"aria-hidden":"true",children:[c.jsxs("g",{transform:"translate(-1.3,-1.6) scale(0.78)",strokeLinejoin:"round",children:[c.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"}),c.jsx("path",{d:"M9 2v3.2h3.3"})]}),c.jsx("path",{d:"M12.2 10.3v3.8M10.3 12.2h3.8",strokeLinecap:"round"})]})}function h1(){return c.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.3,"aria-hidden":"true",children:[c.jsx("g",{transform:"translate(-1.3,-1.6) scale(0.78)",children:c.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"})}),c.jsx("path",{d:"M12.2 10.3v3.8M10.3 12.2h3.8",strokeLinecap:"round"})]})}function p1(){return c.jsxs("svg",{className:"sidepane__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[c.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"}),c.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 c.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[c.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),c.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}const g1=200;function y1({open:s,result:l,onSearch:i,onOpenMatch:r,onClose:o}){const[d,h]=S.useState(""),g=d.trim(),m=g.length>0,b=S.useRef(null),x=S.useRef(i);x.current=i;function k(T){h(T),b.current&&clearTimeout(b.current);const L=T.trim();if(!L){x.current("");return}b.current=setTimeout(()=>x.current(L),g1)}const _=m&&(l==null?void 0:l.query)===g?l:null;function A(){if(!_)return[c.jsx("p",{className:"fsrow__pending",children:"ищем…"},"grep:wait")];if(_.matches.length===0)return[c.jsx("p",{className:"fsrow__pending",children:"ничего не найдено"},"grep:empty")];const T=[];let L="";for(const O of _.matches)O.path!==L&&(L=O.path,T.push(c.jsx("p",{className:"searchgroup__path",title:O.path,children:O.path},`path:${O.path}`))),T.push(c.jsx(b1,{match:O,onClick:()=>r(O)},`${O.path}:${O.line}:${O.column}`));return _.truncated&&T.push(c.jsxs("p",{className:"fsrow__pending",children:["показаны первые ",_.matches.length," — уточните запрос"]},"grep:truncated")),T}return c.jsxs("aside",{className:s?"sidepane sidepane--search sidepane--open":"sidepane sidepane--search","aria-label":"Поиск по тексту в проекте",children:[c.jsxs("div",{className:"sidepane__head",children:[c.jsx(x1,{}),c.jsx("span",{className:"sidepane__title",children:"Поиск по тексту"}),c.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель поиска",onClick:o,children:"✕"})]}),c.jsxs("div",{className:"fssearch",children:[c.jsx(_1,{}),c.jsx("input",{className:"fssearch__input",type:"text",value:d,spellCheck:!1,placeholder:"Поиск по тексту во всех файлах…","aria-label":"Поиск по тексту во всех файлах",onChange:T=>k(T.target.value),onKeyDown:T=>{T.stopPropagation(),T.key==="Escape"&&(T.preventDefault(),d?k(""):T.currentTarget.blur())}}),d&&c.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>k(""),children:"✕"})]}),c.jsx("div",{className:"sidepane__scroll fstree",children:m?A():c.jsx("p",{className:"sidepane__empty",children:"Введите текст, чтобы найти его во всех файлах проекта."})})]})}function b1({match:s,onClick:l}){const i=s.lineText.slice(0,s.column-1),r=s.lineText.slice(s.column-1,s.column-1+s.matchLength),o=s.lineText.slice(s.column-1+s.matchLength);return c.jsxs("button",{className:"searchmatch",onClick:l,title:`${s.path}:${s.line}`,children:[c.jsx("span",{className:"searchmatch__line",children:s.line}),c.jsxs("span",{className:"searchmatch__text",children:[i,c.jsx("mark",{children:r}),o]})]})}function x1(){return c.jsxs("svg",{className:"sidepane__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[c.jsx("circle",{cx:"6.8",cy:"6.8",r:"4.3"}),c.jsx("path",{d:"M13.2 13.2 10.1 10.1"})]})}function _1(){return c.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[c.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),c.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}let io=null;function v1(){return io||(io=Promise.all([Ie(()=>import("./index-DqcI6biV.js"),__vite__mapDeps([19,4,3,2,20,5]),import.meta.url),Ie(()=>import("./index-891wE-Rj.js").then(s=>s.v),__vite__mapDeps([4,3]),import.meta.url),Ie(()=>import("./index-BHot-lnj.js"),[],import.meta.url),Ie(()=>import("./index-Byl4r_xt.js"),__vite__mapDeps([20,3,4,2]),import.meta.url),Ie(()=>import("./codemirror-ixGO-cbX.js"),__vite__mapDeps([21,2,3,4]),import.meta.url)]).then(([s,l,i,r,o])=>({EditorView:l.EditorView,EditorState:i.EditorState,Compartment:i.Compartment,EditorSelection:i.EditorSelection,Prec:i.Prec,keymap:l.keymap,indentWithTab:r.indentWithTab,basicSetup:s.basicSetup,editorTheme:o.editorTheme,editorHighlight:o.editorHighlight})).catch(s=>{throw io=null,s})),io}function S1({path:s,doc:l,revision:i,goto:r,onChange:o,onSave:d}){const h=S.useRef(null),g=S.useRef(null),m=S.useRef(null),b=S.useRef(new Map),x=S.useRef(new Map),k=S.useRef(new Set),_=S.useRef(null),A=S.useRef(o),T=S.useRef(d),L=S.useRef(s),O=S.useRef(i),F=S.useRef(l);A.current=o,T.current=d,L.current=s,O.current=i,F.current=l;const[q,Q]=S.useState("loading"),[E,V]=S.useState(!1);function D(Z,ce,de,K,le){const me=b.current.get(K),Ae=x.current.get(K)===le;if(me&&Ae)de.setState(me);else{const z=Z.EditorState.create({doc:F.current,extensions:[Z.basicSetup,Z.Prec.highest(Z.keymap.of([{key:"Mod-s",preventDefault:!0,run:()=>(T.current(L.current),!0)}])),Z.keymap.of([Z.indentWithTab]),ce.of([]),Z.editorTheme,Z.editorHighlight,Z.EditorView.updateListener.of(ee=>{ee.docChanged&&A.current(L.current,ee.state.doc.toString())})]});b.current.set(K,z),x.current.set(K,le),de.setState(z),k.current.delete(K)}if(k.current.has(K))return()=>{};let ve=!1;return Wv(K).then(z=>{ve||!z||L.current!==K||(de.dispatch({effects:ce.reconfigure(z)}),b.current.set(K,de.state),k.current.add(K))}),()=>{ve=!0}}S.useEffect(()=>{if(!h.current)return;let ce=!1,de=null,K=null;Q("loading"),V(!1);const le=window.setTimeout(()=>{ce||V(!0)},200);return(async()=>{let me;try{me=await v1()}catch{window.clearTimeout(le),ce||Q("error");return}if(ce||!h.current)return;window.clearTimeout(le);const Ae=new me.Compartment;_.current=Ae,m.current=me,K=new me.EditorView({parent:h.current}),g.current=K,de=D(me,Ae,K,L.current,O.current),Q("ready")})(),()=>{ce=!0,window.clearTimeout(le),de==null||de(),K==null||K.destroy(),g.current===K&&(g.current=null),m.current=null,_.current=null}},[]),S.useEffect(()=>{const Z=m.current,ce=g.current,de=_.current;if(!(!Z||!ce||!de))return D(Z,de,ce,s,i)},[s,i]);const R=S.useRef(0);return S.useEffect(()=>{const Z=g.current,ce=m.current;if(!Z||!ce||!r||r.token===R.current)return;R.current=r.token;const de=Z.state.doc.lines,K=Math.min(Math.max(r.line,1),de),le=Z.state.doc.line(K),me=Math.min(le.from+Math.max(r.column-1,0),le.to);Z.dispatch({selection:ce.EditorSelection.cursor(me),effects:ce.EditorView.scrollIntoView(me,{y:"center"})}),Z.focus()},[r]),S.useEffect(()=>()=>{const Z=g.current;Z&&b.current.set(s,Z.state)},[s]),c.jsxs("div",{className:"editor__code",children:[c.jsx("div",{ref:h,className:"editor__code-surface"+(q==="ready"?"":" is-hidden")}),q==="loading"&&E&&c.jsxs("div",{className:"editor__state work",role:"status",children:[c.jsxs("div",{className:"work__dots",children:[c.jsx("span",{className:"work__dot"}),c.jsx("span",{className:"work__dot"}),c.jsx("span",{className:"work__dot"})]}),c.jsx("span",{className:"work__label",children:"Загружается редактор…"})]}),q==="error"&&c.jsxs("div",{className:"editor__fallback",children:[c.jsxs("div",{className:"editor__fallback-banner",role:"alert",children:[c.jsx("span",{children:"Редактор не загрузился — ниже только просмотр, без сохранения правок."}),c.jsx("button",{className:"btn btn--sm btn--primary",onClick:()=>window.location.reload(),children:"Перезагрузить страницу"})]}),c.jsx("pre",{className:"editor__fallback-text",children:l})]})]})}function k1({file:s,goto:l,onChange:i,onSave:r,onReload:o,onOverwrite:d,onTogglePreview:h}){const g=Qa(s),m=qb(s.path)&&!s.binary&&!s.tooLarge;return c.jsxs("div",{className:"editor",children:[c.jsxs("div",{className:"editor__bar",children:[c.jsx("span",{className:"editor__path",title:s.path,children:s.path}),c.jsxs("span",{className:"editor__meta",children:[Fd(s.size),s.eol==="crlf"&&" · CRLF"]}),m&&c.jsxs("div",{className:"editor__viewtoggle",role:"tablist","aria-label":"Режим просмотра",children:[c.jsx("button",{className:"btn btn--sm"+(s.previewMode?" is-on":""),role:"tab","aria-selected":s.previewMode,onClick:()=>!s.previewMode&&h(s.path),children:"Просмотр"}),c.jsx("button",{className:"btn btn--sm"+(s.previewMode?"":" is-on"),role:"tab","aria-selected":!s.previewMode,onClick:()=>s.previewMode&&h(s.path),children:"Код"})]}),c.jsx("button",{className:"btn btn--sm",disabled:!g,title:"Сохранить (Ctrl+S)",onClick:()=>r(s.path),children:g?"Сохранить":"Сохранено"})]}),s.stale&&c.jsxs("div",{className:"editor__warn",children:[c.jsxs("span",{children:["Файл изменился на диске",g?" — а здесь есть несохранённые правки.":"."]}),c.jsx("button",{className:"btn btn--sm",onClick:()=>o(s.path),children:"Взять с диска"}),g&&c.jsx("button",{className:"btn btn--sm btn--danger",onClick:()=>d(s.path),children:"Сохранить поверх"})]}),s.binary?c.jsxs("p",{className:"editor__empty",children:["Это не текстовый файл — редактировать его здесь нечем. ",Fd(s.size)," на диске."]}):s.tooLarge?c.jsxs("p",{className:"editor__empty",children:["Файл слишком велик для редактора (",Fd(s.size),"). Такие правит агент, а не браузер."]}):m&&s.previewMode?c.jsx(w1,{text:s.text}):c.jsx(S1,{path:s.path,doc:s.text,revision:s.revision,goto:l,onChange:i,onSave:r})]})}function w1({text:s}){const[l,i]=S.useState("");return S.useEffect(()=>{let r=!1;return Gb(s).then(o=>{r||i(o)}),()=>{r=!0}},[s]),c.jsx("div",{className:"markdown-preview",dangerouslySetInnerHTML:{__html:l}})}function T1({files:s,activePath:l,busy:i,onSelect:r,onClose:o}){return c.jsxs("div",{className:"worktabs",role:"tablist",children:[c.jsxs("button",{className:"worktab"+(l===null?" is-on":""),role:"tab","aria-selected":l===null,onClick:()=>r(null),children:[c.jsx("span",{className:"worktab__name",children:"Разговор"}),i&&c.jsx("span",{className:"worktab__dot worktab__dot--busy",title:"Агент работает"})]}),s.map(d=>c.jsxs("div",{className:"worktab"+(d.path===l?" is-on":""),role:"tab","aria-selected":d.path===l,children:[c.jsx("button",{className:"worktab__name",title:d.path,onClick:()=>r(d.path),children:t1(d.path)}),Qa(d)?c.jsx("button",{className:"worktab__dot",title:"Не сохранено — закрыть","aria-label":`Закрыть ${d.path}`,onClick:()=>o(d.path)}):c.jsx("button",{className:"worktab__close",title:"Закрыть","aria-label":`Закрыть ${d.path}`,onClick:()=>o(d.path),children:"✕"})]},d.path))]})}function Wd({x:s,y:l,items:i,note:r,onClose:o}){const d=S.useRef(null),[h,g]=S.useState({left:s,top:l}),[m,b]=S.useState(()=>{const _=i.findIndex(A=>!A.disabled);return _===-1?0:_});S.useLayoutEffect(()=>{const _=d.current;if(!_)return;const A=_.getBoundingClientRect(),T=8,L=Math.max(T,Math.min(s,window.innerWidth-A.width-T)),O=Math.max(T,Math.min(l,window.innerHeight-A.height-T));g({left:L,top:O})},[s,l]),S.useLayoutEffect(()=>{var _;(_=d.current)==null||_.focus()},[]),S.useLayoutEffect(()=>{function _(T){var L;(L=d.current)!=null&&L.contains(T.target)||o()}function A(){o()}return document.addEventListener("mousedown",_),document.addEventListener("scroll",A,!0),()=>{document.removeEventListener("mousedown",_),document.removeEventListener("scroll",A,!0)}},[o]);function x(_){_.disabled||(_.onSelect(),o())}function k(_){if(_.key==="Escape"){_.preventDefault(),_.stopPropagation(),o();return}const A=i.map((T,L)=>({item:T,index:L})).filter(T=>!T.item.disabled);if(A.length!==0){if(_.key==="ArrowDown"||_.key==="ArrowUp"){_.preventDefault();const T=_.key==="ArrowDown"?1:-1,L=A.findIndex(F=>F.index===m),O=A[(((L===-1?0:L)+T)%A.length+A.length)%A.length];O&&b(O.index);return}if(_.key==="Enter"||_.key===" "){_.preventDefault();const T=i[m];T&&x(T)}}}return c.jsxs("div",{ref:d,className:"ctxmenu",style:{left:h.left,top:h.top},role:"menu",tabIndex:-1,onKeyDown:k,children:[r&&c.jsx("div",{className:"ctxmenu__note",children:r}),i.map((_,A)=>c.jsxs("button",{type:"button",role:"menuitem","aria-disabled":_.disabled,className:"ctxmenu__item"+(A===m?" is-cursor":""),onMouseEnter:()=>b(A),onClick:()=>x(_),children:[c.jsx("span",{className:"ctxmenu__label",children:_.label}),_.hint&&c.jsx("span",{className:"ctxmenu__hint",children:_.hint})]},_.id))]})}const Ib="ccv:sidebar.collapsed",Xb="ccv:sidebar.mode",N1=500,Ly="транскрипт остаётся на диске — сессию можно вернуть из архива в любой момент.";function j1({open:s,connected:l,status:i,workspaces:r,sessions:o,archived:d,pinned:h,activeWorkspaceId:g,activeSessionId:m,onSelectWorkspace:b,onSelectSession:x,onRenameSession:k,onPinSessions:_,onSelectPinned:A,onCloseWorkspaces:T,onArchiveSessions:L,onUnarchiveSessions:O,onOpenWorkspace:F,onNewSession:q,onOpenExtensions:Q,account:E,onOpenAccount:V,relay:D,onOpenRelay:R,onOpenSettings:Z,themeMode:ce,onCycleTheme:de}){const[K,le]=S.useState(null),[me,Ae]=S.useState(""),[ve,z]=S.useState(C1),[ee,P]=S.useState(R1);function xe(){P($=>{const he=$==="pinned"?"default":"pinned";try{localStorage.setItem(Xb,he)}catch{}return he})}const Ne=me.trim().toLowerCase(),N=Ne!=="",I=S.useMemo(()=>N?r.filter($=>$.name.toLowerCase().includes(Ne)||$.path.toLowerCase().includes(Ne)):r,[r,Ne,N]),ie=S.useMemo(()=>N?o.filter($=>($.title??"").toLowerCase().includes(Ne)):o,[o,Ne,N]),re=S.useMemo(()=>N?d.filter($=>($.title??"").toLowerCase().includes(Ne)):d,[d,Ne,N]),_e=$=>{var he;return((he=r.find(rt=>rt.id===$))==null?void 0:he.name)??"—"},Te=$=>{var he;return(he=r.find(rt=>rt.id===$))==null?void 0:he.path},Me=S.useMemo(()=>N?h.filter($=>($.title??"").toLowerCase().includes(Ne)||_e($.workspaceId).toLowerCase().includes(Ne)):h,[h,r,Ne,N]);function et($){z(he=>{const rt=he.includes($)?he.filter(ht=>ht!==$):[...he,$];try{localStorage.setItem(Ib,JSON.stringify(rt))}catch{}return rt})}const Ze=$=>!ve.includes($),at=Hy(I),qe=Hy(ie),[Nt,$e]=S.useState(null),[oe,ye]=S.useState(null),[tt,Ft]=S.useState(null),Ue=S.useRef(null);function un($,he){const rt=$.touches[0];if(!rt)return;const ht={timer:0,x:rt.clientX,y:rt.clientY,el:$.currentTarget,fired:!1};ht.timer=window.setTimeout(()=>{ht.fired=!0,he(ht.x,ht.y,ht.el)},N1),Ue.current=ht}function mn($){const he=Ue.current,rt=$.touches[0];!he||!rt||Math.hypot(rt.clientX-he.x,rt.clientY-he.y)>10&&(window.clearTimeout(he.timer),Ue.current=null)}function Sn($){const he=Ue.current;he&&(window.clearTimeout(he.timer),he.fired&&$.preventDefault())}function Qn(){var $;return($=Ue.current)!=null&&$.fired?(Ue.current=null,!0):!1}function kn(){const $=Nt==null?void 0:Nt.opener;$e(null),$!=null&&$.isConnected&&$.focus()}function bt(){const $=oe==null?void 0:oe.opener;ye(null),$!=null&&$.isConnected&&$.focus()}function Cn(){const $=tt==null?void 0:tt.opener;Ft(null),$!=null&&$.isConnected&&$.focus()}function J($){return{onContextMenu:he=>{he.preventDefault(),$e({x:he.clientX,y:he.clientY,opener:he.currentTarget,ids:at.targetsFor($)})},onTouchStart:he=>un(he,(rt,ht,gn)=>$e({x:rt,y:ht,opener:gn,ids:at.targetsFor($)})),onTouchMove:mn,onTouchEnd:Sn,onTouchCancel:Sn}}function fe($){return{onContextMenu:he=>{he.preventDefault(),ye({x:he.clientX,y:he.clientY,opener:he.currentTarget,ids:qe.targetsFor($)})},onTouchStart:he=>un(he,(rt,ht,gn)=>ye({x:rt,y:ht,opener:gn,ids:qe.targetsFor($)})),onTouchMove:mn,onTouchEnd:Sn,onTouchCancel:Sn}}function Re($){return{onContextMenu:he=>{he.preventDefault(),Ft({x:he.clientX,y:he.clientY,opener:he.currentTarget,ids:[$.id]})},onTouchStart:he=>un(he,(rt,ht,gn)=>Ft({x:rt,y:ht,opener:gn,ids:[$.id]})),onTouchMove:mn,onTouchEnd:Sn,onTouchCancel:Sn}}const Ke=o.filter($=>$.state!=="closed").length,Lt=Nt?[{id:"close",label:Nt.ids.length>1?`Закрыть проекты (${Nt.ids.length})`:"Закрыть проект",onSelect:()=>{T(Nt.ids),at.clear()}}]:[],Wt=Nt?"закрытие не удаляет проект: каталог и история сессий остаются на диске — открыть его снова можно кнопкой «+ Проект»."+(g&&Nt.ids.includes(g)&&Ke>0?` в нём сейчас незавершённых сессий: ${Ke} — при закрытии они остановятся на хосте.`:""):void 0,Un=oe?ie.find($=>$.id===oe.ids[0]):void 0,sl=(Un==null?void 0:Un.pinned)!==!0,Xt=oe?[...oe.ids.length===1?[{id:"rename",label:"Переименовать",onSelect:()=>le(oe.ids[0])}]:[],{id:"pin",label:sl?oe.ids.length>1?`Закрепить (${oe.ids.length})`:"Закрепить":oe.ids.length>1?`Открепить (${oe.ids.length})`:"Открепить",onSelect:()=>{Un&&_(Un.workspaceId,oe.ids,sl),qe.clear()}},{id:"archive",label:oe.ids.length>1?`Убрать в архив (${oe.ids.length})`:"Убрать в архив",onSelect:()=>{L(g,oe.ids),qe.clear()}}]:[],Hn=oe?Ly:void 0,jt=tt?Me.find($=>$.id===tt.ids[0]):void 0,Rn=tt?[{id:"rename",label:"Переименовать",onSelect:()=>le(tt.ids[0])},{id:"unpin",label:"Открепить",onSelect:()=>{jt&&_(jt.workspaceId,[jt.id],!1)}},{id:"archive",label:"Убрать в архив",onSelect:()=>{jt&&L(jt.workspaceId,[jt.id])}}]:[];return c.jsxs("aside",{className:s?"sidebar sidebar--open":"sidebar",children:[c.jsxs("div",{className:"sidebar__head",children:[c.jsx("span",{className:l?"dot dot--on":"dot",title:i}),c.jsx("span",{className:"brand",children:"Claude Code Visual"}),c.jsx("button",{className:"theme-btn","aria-pressed":ee==="pinned",title:ee==="pinned"?"Показать все проекты и сессии":"Показать только закреплённые","aria-label":ee==="pinned"?"Панель закреплённых сессий включена. Показать все проекты и сессии":"Показать только закреплённые сессии",onClick:xe,children:c.jsx(Vb,{})}),c.jsx("button",{className:"theme-btn",title:`Тема: ${By[ce]}`,"aria-label":`Тема: ${By[ce]}. Переключить`,onClick:de,children:c.jsx(M1,{mode:ce})})]}),c.jsxs("div",{className:"fssearch fssearch--sidebar",children:[c.jsx(A1,{}),c.jsx("input",{className:"fssearch__input",type:"text",value:me,spellCheck:!1,placeholder:"Проект или сессия…","aria-label":"Поиск по проектам и сессиям",onChange:$=>Ae($.target.value),onKeyDown:$=>{$.stopPropagation(),$.key==="Escape"&&($.preventDefault(),me?Ae(""):$.currentTarget.blur())}}),me&&c.jsx("button",{className:"fssearch__clear",title:"Очистить поиск","aria-label":"Очистить поиск",onClick:()=>Ae(""),children:"✕"})]}),c.jsx("div",{className:"sidebar__scroll",children:ee==="pinned"?c.jsxs(c.Fragment,{children:[Me.length===0&&c.jsx("div",{className:"row",children:c.jsx("span",{className:"row__meta",children:N?"Ничего не найдено":"закрепите сессию через её меню (правый клик или долгое нажатие) — она останется под рукой из любого проекта"})}),Me.map($=>c.jsx("div",{className:$.id===m?"row row--active":"row",...K===$.id?{}:{title:"Действия со строкой — правый клик или долгое нажатие",...Re($)},children:K===$.id?c.jsx("div",{className:"row__main",children:c.jsx(Mc,{value:$.title??"",onCommit:he=>{k($,he),le(null)},onCancel:()=>le(null)})}):c.jsxs("button",{className:"row__main",onClick:()=>{Qn()||A($)},children:[c.jsx(eh,{title:$.title??"Без названия",pinned:!1,projectName:_e($.workspaceId),projectPath:Te($.workspaceId)}),c.jsx(qy,{session:$,tail:new Date($.updatedAt).toLocaleString()})]})},$.id))]}):c.jsxs(c.Fragment,{children:[c.jsx(Pd,{title:"Проекты",count:I.length,open:Ze("workspaces"),onToggle:()=>et("workspaces")}),Ze("workspaces")&&c.jsxs(c.Fragment,{children:[I.length===0&&c.jsx("div",{className:"row",children:c.jsx("span",{className:"row__meta",children:N?"Ничего не найдено":"Пока ни одного"})}),I.map($=>c.jsx("div",{className:Uy($.id===g,at.selected.includes($.id)),...J($),children:c.jsxs("button",{className:"row__main",onClick:he=>{Qn()||at.click(he,$,()=>b($.id))},children:[c.jsxs("span",{className:"row__title",children:[$.name,$.hasClaudeMd&&" ·"]}),c.jsx("span",{className:"row__meta",title:$.path,children:$.path})]})},$.id))]}),g&&c.jsxs(c.Fragment,{children:[c.jsx(Pd,{title:"Сессии",count:ie.length,open:Ze("sessions"),onToggle:()=>et("sessions")}),Ze("sessions")&&c.jsxs(c.Fragment,{children:[ie.length===0&&c.jsx("div",{className:"row",children:c.jsx("span",{className:"row__meta",children:N?"Ничего не найдено":"Пока ни одной"})}),ie.map($=>c.jsx("div",{className:Uy($.id===m,qe.selected.includes($.id)),...K===$.id?{}:fe($),children:K===$.id?c.jsx("div",{className:"row__main",children:c.jsx(Mc,{value:$.title??"",onCommit:he=>{k($,he),le(null)},onCancel:()=>le(null)})}):c.jsxs(c.Fragment,{children:[c.jsxs("button",{className:"row__main",onClick:he=>{Qn()||qe.click(he,$,()=>x($))},children:[c.jsx(eh,{title:$.title??"Без названия",pinned:$.pinned===!0,projectName:_e($.workspaceId),projectPath:Te($.workspaceId)}),c.jsx(qy,{session:$,tail:new Date($.updatedAt).toLocaleString()})]}),c.jsx("button",{className:"row__edit",title:"Переименовать","aria-label":"Переименовать сессию",onClick:()=>{Qn()||le($.id)},children:"✎"})]})},$.id))]}),d.length>0&&c.jsxs(c.Fragment,{children:[c.jsx(Pd,{title:"Архив",count:re.length,open:Ze("archive"),onToggle:()=>et("archive"),hint:"сессии без обращения дольше двух суток уезжают сюда сами; ничего не удаляется"}),Ze("archive")&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"row",children:c.jsx("span",{className:"row__meta",children:"сюда сами уезжают сессии без обращения дольше двух суток; транскрипт остаётся на диске, ничего не удаляется"})}),re.length===0&&c.jsx("div",{className:"row",children:c.jsx("span",{className:"row__meta",children:N?"Ничего не найдено":"Пока пусто"})}),re.map($=>c.jsxs("div",{className:$.id===m?"row row--active":"row",children:[c.jsxs("button",{className:"row__main",onClick:()=>x($),children:[c.jsx(eh,{title:$.title??"Без названия",pinned:!1,projectName:_e($.workspaceId),projectPath:Te($.workspaceId)}),c.jsx("span",{className:"row__meta",children:U1($)})]}),c.jsx("button",{className:"row__restore",title:"Вернуть сессию из архива",onClick:()=>O([$.id]),children:"Вернуть"})]},$.id))]})]})]})]})}),c.jsxs("div",{className:"sidebar__foot",children:[c.jsxs("button",{className:"account-btn sidebar__wide",title:"Аккаунт Claude",onClick:V,children:[c.jsx("span",{className:E!=null&&E.loggedIn?"dot dot--on":"dot"}),c.jsx("span",{className:"account-btn__id",children:E===null?"Аккаунт":E.loggedIn?E.email||"Вход выполнен":"Войти в аккаунт"}),(E==null?void 0:E.plan)&&c.jsx("span",{className:"chip",children:E.plan})]}),R&&c.jsxs("button",{className:"account-btn sidebar__wide",title:"Доступ с телефона и из браузера",onClick:R,children:[c.jsx("span",{className:D!=null&&D.connected?"dot dot--on":"dot"}),c.jsx("span",{className:"account-btn__id",children:D===null?"Удалённый доступ":D.paired?D.connected?D.name||"Удалённый доступ включён":"Удалённый доступ · нет связи":"Удалённый доступ"}),(D==null?void 0:D.connected)&&D.clients>0&&c.jsx("span",{className:"chip",children:D.clients})]}),c.jsx("button",{className:"btn btn--ghost sidebar__wide",disabled:!Q,title:"MCP-серверы и плагины",onClick:()=>Q==null?void 0:Q(),children:"Расширения"}),c.jsx("button",{className:"btn btn--ghost sidebar__wide",title:"Настройки приложения",onClick:Z,children:"Настройки"}),c.jsx("button",{className:"btn btn--ghost",onClick:F,children:"+ Проект"}),c.jsx("button",{className:"btn btn--primary",onClick:q,disabled:!g,children:"+ Сессия"})]}),Nt&&c.jsx(Wd,{x:Nt.x,y:Nt.y,items:Lt,note:Wt,onClose:kn}),oe&&c.jsx(Wd,{x:oe.x,y:oe.y,items:Xt,note:Hn,onClose:bt}),tt&&c.jsx(Wd,{x:tt.x,y:tt.y,items:Rn,note:Ly,onClose:Cn})]})}function Uy(s,l){const i=["row"];return s&&i.push("row--active"),l&&i.push("row--selected"),i.join(" ")}function Hy(s){const[l,i]=S.useState([]),r=S.useRef(null);function o(){i([]),r.current=null}function d(g,m,b){if(g.ctrlKey||g.metaKey){i(x=>x.includes(m.id)?x.filter(k=>k!==m.id):[...x,m.id]),r.current=m.id;return}if(g.shiftKey&&r.current){const x=s.findIndex(_=>_.id===r.current),k=s.findIndex(_=>_.id===m.id);if(x!==-1&&k!==-1){const[_,A]=x<k?[x,k]:[k,x];i(s.slice(_,A+1).map(T=>T.id));return}}o(),r.current=m.id,b()}function h(g){return l.includes(g.id)?l:(i([g.id]),r.current=g.id,[g.id])}return{selected:l,click:d,targetsFor:h,clear:o}}function Pd({title:s,count:l,open:i,onToggle:r,hint:o}){const d=i?`Свернуть «${s}»`:`Развернуть «${s}»`;return c.jsxs("button",{className:"sidebar__section sidebar__section--btn","aria-expanded":i,title:o?`${d} — ${o}`:d,onClick:r,children:[c.jsx(E1,{open:i}),c.jsx("span",{className:"sidebar__section-name",children:s}),c.jsx("span",{className:"sidebar__count",children:l})]})}function E1({open:s}){return c.jsx("svg",{className:s?"sidebar__chev sidebar__chev--open":"sidebar__chev",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:c.jsx("path",{d:"M6 3.5 10.5 8 6 12.5"})})}function Vb({className:s}){return c.jsxs("svg",{className:s,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[c.jsx("rect",{x:"4.5",y:"2.4",width:"7",height:"4.2",rx:"1.6"}),c.jsx("path",{d:"M5.4 6.6 8 12.2 10.6 6.6"}),c.jsx("path",{d:"M8 12.2v1.4"})]})}function A1(){return c.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[c.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),c.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}function C1(){try{const s=localStorage.getItem(Ib);if(s===null)return["archive"];const l=JSON.parse(s);return Array.isArray(l)?l.filter(i=>i==="workspaces"||i==="sessions"||i==="archive"):["archive"]}catch{return["archive"]}}function R1(){try{return localStorage.getItem(Xb)==="pinned"?"pinned":"default"}catch{return"default"}}const By={system:"как в системе",light:"светлая",dark:"тёмная"};function M1({mode:s}){const l={viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0};return s==="dark"?c.jsx("svg",{...l,children:c.jsx("path",{d:"M13.2 9.7A5.4 5.4 0 0 1 6.3 2.8a5.6 5.6 0 1 0 6.9 6.9Z"})}):s==="light"?c.jsxs("svg",{...l,children:[c.jsx("circle",{cx:"8",cy:"8",r:"3.1"}),c.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"})]}):c.jsxs("svg",{...l,children:[c.jsx("rect",{x:"1.8",y:"2.6",width:"12.4",height:"8.4",rx:"1.4"}),c.jsx("path",{d:"M5.6 13.4h4.8"})]})}function O1(s){switch(s.state){case"running":return"работает";case"waiting_permission":return"ждёт разрешения";case"idle":return D1(s.lastTurn);case"starting":return"запускается";case"error":return"ошибка";case"closed":return"на диске"}}function D1(s){switch(s){case"interrupted":return"прервана";case"stopped":return"остановлена";case"failed":return"оборвалась";case"completed":return"готова";case null:return"ждёт задачу"}}function z1(s){switch(s.state){case"running":return"running";case"starting":return"starting";case"waiting_permission":return"waiting";case"idle":return L1(s.lastTurn);case"error":return"error";case"closed":return"closed"}}function L1(s){switch(s){case"interrupted":case"stopped":return"halted";case"failed":return"error";case"completed":return"ready";case null:return"fresh"}}function qy({session:s,tail:l}){return c.jsxs("span",{className:"row__meta",children:[c.jsxs("span",{className:`row__state row__state--${z1(s)}`,children:[c.jsx("span",{className:"row__state-dot","aria-hidden":"true"}),O1(s)]})," · ",l]})}function eh({title:s,pinned:l,projectName:i,projectPath:r}){return c.jsxs("span",{className:"row__head",children:[c.jsxs("span",{className:"row__title",children:[l&&c.jsx(Vb,{className:"row__pin"}),s]}),c.jsx("span",{className:"row__project",title:r,children:i})]})}function U1(s){const l=s.archivedAuto?"сама, по сроку молчания":"убрана вручную";return s.archivedAt?`${new Date(s.archivedAt).toLocaleString()} · ${l}`:l}const Gy=3,H1=15e5;function Qb(s,l){if(!l||typeof l!="object")return null;const i=l,r=typeof i.file_path=="string"?i.file_path:"";if(!r)return null;if(s==="Write"){if(typeof i.content!="string")return null;const o=th(i.content).map(d=>({type:"add",text:d}));return{kind:"create",filePath:r,rows:o,added:o.length,removed:0,note:"файл записывается целиком"}}if(s==="Edit"){if(typeof i.old_string!="string"||typeof i.new_string!="string")return null;const o=Y1(B1(th(i.old_string),th(i.new_string)));return{kind:"edit",filePath:r,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 th(s){if(s==="")return[];const l=s.split(/\r?\n/);return l.length>1&&l[l.length-1]===""&&l.pop(),l}function B1(s,l){let i=0;for(;i<s.length&&i<l.length&&s[i]===l[i];)i++;let r=s.length,o=l.length;for(;r>i&&o>i&&s[r-1]===l[o-1];)r--,o--;const d=h=>({type:"ctx",text:h});return[...s.slice(0,i).map(d),...q1(s.slice(i,r),l.slice(i,o)),...s.slice(r).map(d)]}function q1(s,l){if(s.length===0&&l.length===0)return[];if(s.length===0)return l.map(x=>({type:"add",text:x}));if(l.length===0)return s.map(x=>({type:"del",text:x}));if((s.length+1)*(l.length+1)>H1)return[...s.map(x=>({type:"del",text:x})),...l.map(x=>({type:"add",text:x}))];const i=s.length,r=l.length,o=r+1,d=new Uint32Array((i+1)*o),h=(x,k)=>d[x*o+k]??0;for(let x=i-1;x>=0;x--)for(let k=r-1;k>=0;k--)d[x*o+k]=s[x]===l[k]?h(x+1,k+1)+1:Math.max(h(x+1,k),h(x,k+1));const g=[];let m=0,b=0;for(;m<i&&b<r;){const x=s[m],k=l[b];x===k?(g.push({type:"ctx",text:x}),m++,b++):h(m+1,b)>=h(m,b+1)?(g.push({type:"del",text:x}),m++):(g.push({type:"add",text:k}),b++)}for(;m<i;)g.push({type:"del",text:s[m++]});for(;b<r;)g.push({type:"add",text:l[b++]});return G1(g)}function G1(s){const l=[];let i=[];function r(){l.push(...i.filter(o=>o.type==="del")),l.push(...i.filter(o=>o.type==="add")),i=[]}for(const o of s)o.type==="ctx"?(r(),l.push(o)):i.push(o);return r(),l}function Y1(s){if(!s.some(d=>d.type!=="ctx"))return s;const l=s.map(()=>!1);s.forEach((d,h)=>{if(d.type!=="ctx")for(let g=Math.max(0,h-Gy);g<=Math.min(s.length-1,h+Gy);g++)l[g]=!0});const i=[];let r=[];function o(){r.length===1?i.push(...r):r.length>1&&i.push({type:"gap",text:`⋯ ${r.length} ${I1(r.length)} без изменений`}),r=[]}return s.forEach((d,h)=>{l[h]?(o(),i.push(d)):r.push(d)}),o(),i}function I1(s){const l=s%100;if(l>=11&&l<=14)return"строк";switch(s%10){case 1:return"строка";case 2:case 3:case 4:return"строки";default:return"строк"}}async function Oh(s){try{return await navigator.clipboard.writeText(s),!0}catch{}const l=document.createElement("textarea");l.value=s,l.setAttribute("readonly",""),l.style.position="fixed",l.style.opacity="0",document.body.appendChild(l);try{return l.select(),document.execCommand("copy")}catch{return!1}finally{l.remove()}}const Dh=1600,bi="Копировать",fr="Скопировано";function $b({text:s,hint:l,className:i}){const[r,o]=S.useState(!1);return S.useEffect(()=>{if(!r)return;const d=setTimeout(()=>o(!1),Dh);return()=>clearTimeout(d)},[r]),S.useEffect(()=>o(!1),[s]),c.jsx("button",{type:"button",className:"copybtn"+(r?" copybtn--done":"")+(i?` ${i}`:""),"aria-label":r?fr:`${bi} ${l}`,title:r?fr:`${bi} ${l}`,onClick:()=>{Oh(s).then(d=>{d&&o(!0)})},children:r?fr:bi})}function zh({diff:s}){return c.jsxs("div",{className:"diff",children:[c.jsxs("div",{className:"diff__head",children:[c.jsx("span",{className:"diff__path",title:s.filePath,children:s.filePath}),c.jsxs("span",{className:"diff__stat",children:[s.added>0&&c.jsxs("span",{className:"diff__stat--add",children:["+",s.added]}),s.removed>0&&c.jsxs("span",{className:"diff__stat--del",children:["−",s.removed]})]})]}),s.note&&c.jsx("div",{className:"diff__note",children:s.note}),c.jsx("div",{className:"diff__body",children:s.rows.length===0?c.jsx("div",{className:"diff__row diff__row--gap",children:c.jsx("span",{className:"diff__text",children:"пустое содержимое"})}):s.rows.map((l,i)=>c.jsxs("div",{className:`diff__row diff__row--${l.type}`,children:[c.jsx("span",{className:"diff__mark","aria-hidden":"true",children:l.type==="add"?"+":l.type==="del"?"−":""}),c.jsx("span",{className:"diff__text",children:l.text===""?" ":l.text})]},i))})]})}function X1({waiting:s}){const[l,i]=S.useState(0);return S.useEffect(()=>{const r=window.setInterval(()=>i(o=>o+1),1e3);return()=>window.clearInterval(r)},[]),c.jsxs("div",{className:s?"work work--wait":"work",children:[c.jsxs("span",{className:"work__dots","aria-hidden":"true",children:[c.jsx("span",{className:"work__dot"}),c.jsx("span",{className:"work__dot"}),c.jsx("span",{className:"work__dot"})]}),c.jsx("span",{className:"work__label",children:s?"ждёт разрешения":"думает"}),!s&&c.jsxs("span",{className:"work__time",children:[l," с"]})]})}function Lh({items:s,busy:l,waiting:i,history:r=[],historyHasMore:o=!1,historyLoading:d=!1,onLoadHistory:h,sessionId:g,empty:m="Сессия пуста. Опишите задачу — Claude Code работает в каталоге проекта с полным набором инструментов."}){const b=S.useRef(null),x=S.useRef(null),k=S.useRef(!0),_=S.useRef(null),A=S.useRef(null),T=S.useRef(!1);S.useEffect(()=>{k.current=!0,_.current=null,T.current=!1,A.current!==null&&(clearTimeout(A.current),A.current=null)},[g]),S.useEffect(()=>{const F=b.current,q=x.current;if(!F||!q)return;function Q(D){!F||D===F.scrollTop||(T.current=!0,F.scrollTop=D)}function E(){if(!F)return;const D=_.current;if(D){const R=Iy(F,D.id);if(R){const Z=R.getBoundingClientRect().top-F.getBoundingClientRect().top;Q(F.scrollTop+(Z-D.top))}A.current!==null&&clearTimeout(A.current),A.current=setTimeout(()=>{_.current=null},500);return}k.current&&Q(F.scrollHeight)}const V=new ResizeObserver(E);return V.observe(q),()=>{V.disconnect(),A.current!==null&&clearTimeout(A.current)}},[]);function L(){const F=b.current;if(F){if(T.current){T.current=!1;return}k.current=F.scrollHeight-F.scrollTop-F.clientHeight<80}}function O(){if(d)return;const F=b.current,q=r[0];if(F&&q){const Q=Iy(F,q.id);Q&&(_.current={id:q.id,top:Q.getBoundingClientRect().top-F.getBoundingClientRect().top})}h==null||h()}return c.jsx("div",{className:"transcript",ref:b,onScroll:L,children:c.jsxs("div",{className:"stream",ref:x,children:[o&&c.jsx("button",{type:"button",className:"transcript__more",onClick:O,disabled:d,children:d?"Загружаем…":"Показать более раннее"}),r.map(F=>c.jsx(Yy,{item:F},F.id)),r.length>0&&s.length>0&&c.jsx("div",{className:"transcript__divider",children:c.jsx("span",{children:"дальше — сессия открыта заново"})}),r.length===0&&s.length===0&&c.jsx("p",{className:"empty",children:m}),s.map(F=>c.jsx(Yy,{item:F},F.id)),l&&c.jsx(X1,{waiting:i})]})})}function Yy({item:s}){switch(s.kind){case"user":return c.jsx("div",{className:"msg--user","data-item-id":s.id,children:s.text});case"assistant":return c.jsxs("div",{className:"msg--assistant","data-item-id":s.id,children:[c.jsx(V1,{text:s.text}),s.streaming&&c.jsx("span",{className:"caret"}),s.text.trim()!==""&&c.jsx("div",{className:"msg--assistant__foot",children:c.jsx($b,{text:s.text,hint:"ответ целиком"})})]});case"thinking":return c.jsx("div",{className:"thinking","data-item-id":s.id,children:s.text});case"tool":return c.jsx($1,{item:s});case"result":return c.jsxs("div",{className:"result-line","data-item-id":s.id,children:[c.jsx("span",{children:s.isError?"✗ "+s.subtype:"✓ готово"}),c.jsxs("span",{children:[(s.durationMs/1e3).toFixed(1)," с"]}),s.costUsd!==null&&c.jsxs("span",{children:["$",s.costUsd.toFixed(4)]}),c.jsxs("span",{children:["↑",Vy(s.inputTokens)," ↓",Vy(s.outputTokens)]})]});case"notice":return c.jsx("div",{className:s.tone==="error"?"notice notice--error":"notice","data-item-id":s.id,children:s.text})}}function Iy(s,l){const i=s.querySelectorAll("[data-item-id]");for(const r of i)if(r.dataset.itemId===l)return r;return null}function V1({text:s}){const[l,i]=S.useState(""),r=S.useRef([]);S.useEffect(()=>{let d=!1;return Gb(s).then(h=>{d||i(Q1(h))}),()=>{d=!0}},[s]),S.useEffect(()=>{const d=r.current;return()=>d.forEach(h=>clearTimeout(h))},[]);function o(d){var m,b;const h=d.target.closest(".codeblock__copy");if(!(h instanceof HTMLElement))return;const g=((b=(m=h.parentElement)==null?void 0:m.querySelector("pre"))==null?void 0:b.textContent)??"";g!==""&&Oh(g).then(x=>{if(!x)return;h.textContent=fr,h.setAttribute("aria-label",fr),h.classList.add("copybtn--done");const k=window.setTimeout(()=>{h.isConnected&&(h.textContent=bi,h.setAttribute("aria-label",bh),h.classList.remove("copybtn--done"))},Dh);r.current.push(k)})}return c.jsx("div",{className:"markdown-preview msg--assistant__body",onClick:o,dangerouslySetInnerHTML:{__html:l}})}const bh=`${bi} блок кода`;function Q1(s){if(!s.includes("<pre"))return s;const l=new DOMParser().parseFromString(s,"text/html");for(const i of l.body.querySelectorAll("pre")){const r=l.createElement("div");r.className="codeblock",i.replaceWith(r),r.append(i);const o=l.createElement("button");o.type="button",o.className="copybtn codeblock__copy",o.setAttribute("aria-label",bh),o.title=bh,o.textContent=bi,r.append(o)}return l.body.innerHTML}function $1({item:s}){const[l,i]=S.useState(!1),r=s.result===null,o=Qb(s.name,s.input),d=s.name==="AskUserQuestion"?J1(s.input):null;return c.jsxs("div",{className:"tool"+(s.isError?" tool--error":"")+(s.awaitingPermission?" tool--wait":""),"data-item-id":s.id,children:[c.jsxs("button",{className:"tool__head",onClick:()=>i(h=>!h),children:[c.jsx("span",{className:"tool__name",children:s.name}),c.jsx("span",{className:"tool__arg",children:d?K1(d):Z1(s.input)}),c.jsx("span",{className:"tool__status",children:r?"…":s.isError?"ошибка":l?"▴":"▾"})]}),l&&c.jsxs("div",{className:"tool__body",children:[d?c.jsx(F1,{questions:d,answers:s.answers}):o?c.jsx(zh,{diff:o}):c.jsx(Xy,{text:JSON.stringify(s.input,null,2),hint:"аргументы вызова"}),s.result!==null&&(!d||s.isError)&&c.jsx(Xy,{text:s.result,hint:"результат вызова",style:{marginTop:10}})]})]})}function Xy({text:s,hint:l,style:i}){return c.jsxs("div",{className:"codeblock",style:i,children:[c.jsx("pre",{className:"code",children:s}),c.jsx($b,{text:s,hint:l,className:"codeblock__copy"})]})}function Z1(s){if(!s||typeof s!="object")return"";const l=s;for(const i of["file_path","command","pattern","path","url","prompt"]){const r=l[i];if(typeof r=="string")return r.replace(/\s+/g," ").slice(0,160)}return JSON.stringify(l).slice(0,160)}function K1(s){var i;const l=s.map(r=>r.header).filter(r=>r.length>0);return l.length===s.length?l.join(" · "):((i=s[0])==null?void 0:i.question.replace(/\s+/g," ").slice(0,160))??""}function J1(s){if(typeof s!="object"||s===null)return null;const l=s.questions;if(!Array.isArray(l)||l.length===0)return null;const i=[];for(const r of l){if(typeof r!="object"||r===null)return null;const{question:o,header:d,options:h,multiSelect:g}=r;if(typeof o!="string"||!Array.isArray(h)||h.length===0)return null;const m=[];for(const b of h){if(typeof b!="object"||b===null)return null;const{label:x,description:k,preview:_}=b;if(typeof x!="string"||typeof k!="string")return null;m.push({label:x,description:k,...typeof _=="string"?{preview:_}:{}})}i.push({question:o,header:typeof d=="string"?d:"",options:m,multiSelect:g===!0})}return i}function F1({questions:s,answers:l}){return c.jsx("div",{className:"tool__questions",children:s.map((i,r)=>c.jsxs("div",{className:"tool__question",children:[c.jsxs("div",{className:"tool__question-head",children:[i.header&&c.jsx("span",{className:"chip chip--accent",children:i.header}),c.jsx("span",{className:"tool__question-text",children:i.question})]}),c.jsx("div",{className:"tool__question-answer",children:l!=null&&l[i.question]?c.jsx("span",{className:"tool__answer-value",children:l[i.question]}):c.jsx("span",{className:"tool__answer-empty",children:"не отвечено"})})]},r))})}function Vy(s){return s>=1e3?`${(s/1e3).toFixed(1)}k`:String(s)}const W1="ccv.dictation.lang",Qy="ru-RU";function P1(s){try{return Function.prototype.toString.call(s).includes("[native code]")}catch{return!1}}function $y(){const s=window,l=[s.SpeechRecognition,s.webkitSpeechRecognition].filter(r=>typeof r=="function"),i=l.find(P1);return!i&&l.length>0&&Xl("распознавание подменено: родной реализации в странице нет"),i??l[0]??null}function Zb(){var s;try{return((s=localStorage.getItem(W1))==null?void 0:s.trim())||Qy}catch{return Qy}}function Xl(s,l){l===void 0?console.debug(`[dictation] ${s}`):console.debug(`[dictation] ${s}`,l)}const eS=3,tS=400,nS=5,lS=250,aS=2e3,sS=2e4;async function iS(){try{return(await navigator.permissions.query({name:"microphone"})).state==="granted"}catch{return!1}}const rS={"not-allowed":"Браузер не дал доступ к микрофону","service-not-allowed":"Браузер не дал доступ к микрофону","audio-capture":"Микрофон не найден",network:"Сервис распознавания недоступен","language-not-supported":`Распознавание не знает языка ${Zb()}`};function cS(s){const[l]=S.useState(()=>$y()!==null),[i,r]=S.useState(!1),[o,d]=S.useState(null),h=S.useRef(null),g=S.useRef(!1),m=S.useRef(!1),b=S.useRef(s),x=S.useRef({openedAt:0,audio:!1,heard:!1,everHeard:!1,silent:0,dead:0,lastError:"",warned:!1}),k=S.useRef(null),_=S.useRef(!1),A=S.useRef(null),T=S.useCallback(()=>{A.current&&clearTimeout(A.current),A.current=null},[]),L=S.useCallback(()=>{T();const E=async V=>{if(A.current=null,!(!g.current||_.current)){if(!V&&!await iS()){if(Xl("ждём ответа на запрос доступа к микрофону"),!g.current||_.current)return;A.current=setTimeout(()=>void E(!0),sS);return}Xl("движок не ответил на start()"),g.current=!1,r(!1),d("Распознавание не отвечает — проверьте расширения браузера и доступ к микрофону")}};A.current=setTimeout(()=>void E(!1),aS)},[T]);S.useEffect(()=>{b.current=s}),S.useEffect(()=>{const E=$y();if(!E)return;const V=new E;return V.lang=Zb(),V.continuous=!0,V.interimResults=!0,V.onstart=()=>{Xl("сессия открыта"),_.current=!0,T(),r(!0)},V.onaudiostart=()=>{Xl("пошёл звук с микрофона"),x.current.audio=!0},V.onresult=D=>{var de;if(m.current)return;let R="",Z="";for(let K=D.resultIndex;K<D.results.length;K++){const le=D.results[K];if(!le)continue;const me=((de=le[0])==null?void 0:de.transcript)??"";le.isFinal?R+=me:Z+=me}const ce=x.current;ce.heard=!0,ce.everHeard=!0,Xl("распознано",{final:R,interim:Z}),b.current(R,Z)},V.onerror=D=>{x.current.lastError=D.error,Xl("ошибка движка",D.error),!(D.error==="no-speech"||D.error==="aborted")&&(g.current=!1,r(!1),d(rS[D.error]??`Распознавание не работает: ${D.error}`))},V.onend=()=>{m.current=!1,_.current=!1;const D=x.current,R=Date.now()-D.openedAt;if(Xl("сессия закрыта",{мс:R,звук:D.audio,слова:D.heard,ошибка:D.lastError||null}),!g.current){r(!1);return}if(D.dead=!D.audio&&R<tS?D.dead+1:0,D.dead>=nS){g.current=!1,r(!1),d(D.lastError?`Распознавание не работает: ${D.lastError}`:"Распознавание закрывается сразу после запуска — проверьте доступ к микрофону в настройках сайта");return}D.silent=D.heard?0:D.silent+1,!D.everHeard&&!D.warned&&D.silent>=eS&&(D.warned=!0,d(D.audio?"Микрофон слушает, но речь не распознаётся — проверьте язык диктовки и уровень звука":"С микрофона не идёт звук — проверьте устройство ввода в настройках сайта в браузере")),k.current=setTimeout(()=>{if(k.current=null,!!g.current){D.openedAt=Date.now(),D.audio=!1,D.heard=!1,D.lastError="",L();try{V.start()}catch{}}},lS)},h.current=V,()=>{g.current=!1,k.current&&clearTimeout(k.current),k.current=null,T(),V.onend=null,V.onresult=null,V.onerror=null,V.onstart=null,V.onaudiostart=null,V.abort(),h.current=null}},[]);const O=S.useCallback(()=>{var E;if(g.current){if(g.current=!1,Xl("выключение микрофона"),k.current&&clearTimeout(k.current),k.current=null,T(),!_.current){r(!1);return}(E=h.current)==null||E.stop()}},[]),F=S.useCallback(()=>{const E=h.current;if(E){if(!window.isSecureContext){d("Микрофон доступен только по https или с localhost");return}d(null),g.current=!0,m.current=!1,k.current&&clearTimeout(k.current),k.current=null,x.current={openedAt:Date.now(),audio:!1,heard:!1,everHeard:!1,silent:0,dead:0,lastError:"",warned:!1},r(!0),Xl("включение микрофона",{язык:E.lang}),L();try{E.start()}catch(V){Xl("start() не прошёл",V)}}},[L]),q=S.useCallback(()=>{g.current?O():F()},[F,O]),Q=S.useCallback(()=>{var E;g.current&&_.current&&(m.current=!0,(E=h.current)==null||E.abort())},[]);return{supported:l,listening:i,error:o,toggle:q,stop:O,drop:Q}}const uS="(max-width: 860px)",Zy=/^\/(\S*)$/,oS=new Set(["model","permissions"]);function fS(s){return oS.has(s.name)||s.name.startsWith("__")}const dS=new Set(["clear","rename"]),Ky=/(?:^|\s)@([^\s@]*)$/,hS=200,pS=100,mS=190;function Kb({disabled:s,busy:l,commands:i,sessionTitle:r,contextResult:o,className:d,placeholder:h,sendLabel:g="Отправить",autoFocus:m=!1,onContextSearch:b,onCommand:x,onSend:k,onInterrupt:_,onEscape:A}){var Cn;const T=xb(uS),[L,O]=S.useState(""),[F,q]=S.useState(!1),[Q,E]=S.useState(0),V=S.useRef(null),D=S.useRef(null),R=S.useRef(null),[Z,ce]=S.useState(0),[de,K]=S.useState([]),[le,me]=S.useState(-1),Ae=S.useRef(""),[ve,z]=S.useState(""),ee=cS(S.useCallback((J,fe)=>{J&&O(Re=>nh(Re,J)),z(fe.trim())},[])),P=ve?nh(L,ve):L;S.useEffect(()=>{ee.listening||ve===""||(O(J=>nh(J,ve)),z(""))},[ee.listening,ve]),S.useEffect(()=>{var J;m&&((J=V.current)==null||J.focus())},[m]);const xe=s?"Выберите сессию":h??"Опишите задачу… («/» — команды, «@» — файлы)",Ne=S.useRef(0),N=S.useCallback(J=>{const fe=parseFloat(getComputedStyle(J).maxHeight),Re=Number.isFinite(fe)&&fe>0?fe:mS;J.style.height="auto";const Ke=J.scrollHeight;J.style.height=`${Math.min(Ke,Re)}px`,J.style.overflowY=Ke>Re?"auto":"hidden";const Lt=R.current;Lt&&(R.current=null,J.setSelectionRange(Lt[0],Lt[1]))},[]);S.useEffect(()=>{const J=V.current;J&&N(J)},[P,xe,s,N]),S.useEffect(()=>{const J=V.current;if(!J)return;const fe=new ResizeObserver(([Re])=>{const Ke=Re==null?void 0:Re.contentRect.width;Ke===void 0||Math.abs(Ke-Ne.current)<1||(Ne.current=Ke,N(J))});return fe.observe(J),()=>fe.disconnect()},[N]);const I=ee.stop;S.useEffect(()=>{s&&I()},[s,I]);const ie=S.useMemo(()=>ee.error?{ok:!1,message:ee.error}:null,[ee.error]),re=S.useMemo(()=>{var Re;const J=(Re=Zy.exec(L))==null?void 0:Re[1];if(J===void 0)return[];const fe=J.toLowerCase();return i.filter(Ke=>!fS(Ke)&&lh(Ke,fe)<Jb).sort((Ke,Lt)=>lh(Ke,fe)-lh(Lt,fe))},[L,i]),_e=!F&&re.length>0,Te=Math.min(Q,re.length-1),Me=F?null:((Cn=Ky.exec(P.slice(0,Z)))==null?void 0:Cn[1])??null,et=S.useRef(b);et.current=b,S.useEffect(()=>{if(Me===null||Me===""||Me.endsWith("/")){et.current(Me);return}const J=setTimeout(()=>et.current(Me),hS);return()=>clearTimeout(J)},[Me]);const Ze=Me!==null&&(o==null?void 0:o.query)===Me,at=Ze?o.entries:[],qe=Me!==null,Nt=qe&&!Ze,$e=Math.min(Q,Math.max(at.length-1,0));S.useEffect(()=>{var fe,Re;if(!_e&&!qe)return;const J=_e?Te:$e;(Re=(fe=D.current)==null?void 0:fe.children[J])==null||Re.scrollIntoView({block:"nearest"})},[_e,qe,Te,$e]);function oe(J,fe){var Re;O(J),ce(fe),R.current=[fe,fe],E(0),q(!1),ve!==""&&(z(""),ee.drop()),(Re=V.current)==null||Re.focus()}function ye(){O(""),z(""),E(0),ce(0),q(!1),me(-1),Ae.current="",ee.drop()}function tt(J){const fe=J.trim();!fe||s||(k(fe),K(Re=>[fe,...Re.filter(Ke=>Ke!==fe)].slice(0,pS)),ye())}function Ft(J){if(J<-1||J>=de.length)return;le===-1&&(Ae.current=L);const fe=J===-1?Ae.current:de[J]??"";me(J),oe(fe,fe.length)}function Ue(){var Ke;const J=((Ke=V.current)==null?void 0:Ke.selectionStart)??P.length,Re=`${J>0&&!/\s$/.test(P.slice(0,J))?" ":""}@`;oe(P.slice(0,J)+Re+P.slice(J),J+Re.length)}function un(J){var Lt;const fe=(Lt=Ky.exec(P.slice(0,Z)))==null?void 0:Lt[1];if(fe===void 0)return;const Re=Z-fe.length-1,Ke=J.kind==="dir"?`@${J.path}/`:`@${J.path} `;oe(P.slice(0,Re)+Ke+P.slice(Z),Re+Ke.length)}function mn(){var fe;const J=(fe=Zy.exec(P.trim()))==null?void 0:fe[1];if(J&&x(J)){ye();return}tt(P)}function Sn(J,fe){O(J),ce(fe),E(0),q(!1),me(-1),ve!==""&&(z(""),ee.drop())}function Qn(J){var Ke;const fe=dS.has(J.name)?r:null,Re=`/${J.name} `;O(Re+(fe??"")),ce(Re.length+((fe==null?void 0:fe.length)??0)),fe&&(R.current=[Re.length,Re.length+fe.length]),E(0),(Ke=V.current)==null||Ke.focus()}function kn(J){if(x(J.name)){O(""),E(0),q(!1);return}J.argumentHint?Qn(J):tt(`/${J.name}`)}function bt(J){if(_e){if(J.key==="ArrowDown")return J.preventDefault(),E(fe=>(Math.min(fe,re.length-1)+1)%re.length);if(J.key==="ArrowUp"){J.preventDefault();const fe=re.length-1;return E(Re=>(Math.min(Re,fe)+fe)%re.length)}if(J.key==="Enter"&&!J.shiftKey){J.preventDefault();const fe=re[Te];fe&&kn(fe);return}if(J.key==="Tab"){J.preventDefault();const fe=re[Te];fe&&Qn(fe);return}if(J.key==="Escape"){J.preventDefault(),J.stopPropagation(),q(!0);return}}if(qe){if(J.key==="ArrowDown"&&at.length>0)return J.preventDefault(),E(fe=>(Math.min(fe,at.length-1)+1)%at.length);if(J.key==="ArrowUp"&&at.length>0){J.preventDefault();const fe=at.length-1;return E(Re=>(Math.min(Re,fe)+fe)%at.length)}if(J.key==="Enter"&&!J.shiftKey||J.key==="Tab"){const fe=at[$e];if(fe){J.preventDefault(),un(fe);return}if(J.key==="Tab")return}if(J.key==="Escape"){J.preventDefault(),J.stopPropagation(),q(!0);return}}if((J.key==="ArrowUp"||J.key==="ArrowDown")&&!J.shiftKey){const fe=J.currentTarget,Re=fe.selectionStart;if(fe.selectionEnd===Re){const Ke=J.key==="ArrowUp",Lt=Ke?!P.slice(0,Re).includes(`
|
|
118
|
+
`):!P.slice(Re).includes(`
|
|
119
|
+
`),Wt=Ke?le+1:le-1;if(Lt&&Wt>=-1&&Wt<de.length){J.preventDefault(),Ft(Wt);return}}}if(J.key==="Escape"&&A){J.preventDefault(),J.stopPropagation(),A();return}J.key==="Enter"&&!J.shiftKey&&!T&&(J.preventDefault(),mn())}return c.jsx("div",{className:d?`composer ${d}`:"composer",children:c.jsxs("div",{className:"composer__inner",children:[c.jsx(zc,{result:ie}),qe&&!_e&&c.jsxs("div",{className:"cmdmenu",role:"listbox",ref:D,children:[at.map((J,fe)=>c.jsxs("button",{role:"option","aria-selected":fe===$e,className:fe===$e?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>E(fe),onMouseDown:Re=>{Re.preventDefault(),un(J)},children:[c.jsxs("span",{className:"cmdmenu__name",children:[J.name,J.kind==="dir"?"/":""]}),c.jsx("span",{className:"cmdmenu__desc",children:J.path}),J.ignored&&c.jsx("span",{className:"cmdmenu__tag",children:"git-ignore"})]},J.path)),at.length===0&&c.jsx("div",{className:"cmdmenu__empty",children:Nt?"ищем…":Me?"Ничего не нашлось":"Наберите имя файла или каталога"})]}),_e&&c.jsx("div",{className:"cmdmenu",role:"listbox",ref:D,children:re.map((J,fe)=>c.jsxs("button",{role:"option","aria-selected":fe===Te,className:fe===Te?"cmdmenu__row is-on":"cmdmenu__row",onMouseEnter:()=>E(fe),onMouseDown:Re=>{Re.preventDefault(),kn(J)},children:[c.jsxs("span",{className:"cmdmenu__name",children:["/",J.name]}),J.argumentHint&&c.jsx("span",{className:"cmdmenu__hint",children:J.argumentHint}),c.jsx("span",{className:"cmdmenu__desc",children:J.description})]},J.name))}),c.jsxs("div",{className:"composer__field",children:[c.jsx("button",{type:"button",className:"addbtn",title:"Добавить контекст — файл проекта («@»)","aria-label":"Добавить контекст",disabled:s,onClick:Ue,children:c.jsx(bS,{})}),c.jsx("textarea",{ref:V,value:P,disabled:s,placeholder:xe,onChange:J=>Sn(J.target.value,J.target.selectionStart),onSelect:J=>ce(J.currentTarget.selectionStart),onKeyDown:bt}),ee.supported&&c.jsx("button",{type:"button",className:ee.listening?"micbtn is-on":"micbtn",title:ee.listening?"Остановить диктовку":"Продиктовать промпт","aria-label":ee.listening?"Остановить диктовку":"Продиктовать промпт","aria-pressed":ee.listening,disabled:s,onClick:ee.toggle,children:c.jsx(_S,{on:ee.listening})}),l?c.jsx("button",{className:"btn",onClick:_,title:"Прервать (Esc)",children:"Стоп"}):c.jsxs("button",{className:"btn btn--primary sendbtn",onClick:mn,disabled:s||P.trim()==="","aria-label":g,title:g,children:[c.jsx("span",{className:"sendbtn__label",children:g}),c.jsx(xS,{})]})]})]})})}function nh(s,l){const i=l.trim();if(i==="")return s;const r=xh(i).slice(gS(s,i)).join(" ");return r===""?s:s===""||/\s$/.test(s)?s+r:`${s} ${r}`}function gS(s,l){const i=xh(s),r=xh(l);for(let o=Math.min(i.length,r.length);o>0;o--)if(i.slice(i.length-o).every((d,h)=>yS(d,r[h]??"")))return o;return 0}function xh(s){return s.split(/\s+/).filter(l=>l!=="")}function yS(s,l){const i=r=>r.toLowerCase().replace(/[.,!?;:…]+$/u,"");return i(s)===i(l)}function bS(){return c.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round","aria-hidden":"true",children:c.jsx("path",{d:"M8 3.4v9.2M3.4 8h9.2"})})}function xS(){return c.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:c.jsx("path",{d:"M8 12.5V3.5M4 7.5 8 3.5l4 4"})})}function _S({on:s}){return c.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[c.jsx("rect",{x:"5.9",y:"1.7",width:"4.2",height:"7.6",rx:"2.1",fill:s?"currentColor":"none"}),c.jsx("path",{d:"M3.3 7.3v.8a4.7 4.7 0 0 0 9.4 0v-.8"}),c.jsx("path",{d:"M8 12.8v1.5"})]})}const Jb=4;function lh(s,l){const i=s.name.toLowerCase();return i===l?0:i.startsWith(l)?1:s.aliases.some(r=>r.toLowerCase().startsWith(l))?2:i.includes(l)?3:Jb}function vS({request:s,queued:l,onDecide:i}){const r=Qb(s.toolName,s.input);return c.jsx("div",{className:"modal-backdrop modal-backdrop--sheet",children:c.jsxs("div",{className:"sheet",role:"dialog","aria-modal":"true",children:[c.jsxs("div",{className:"sheet__head",children:["Разрешить действие?",l>0&&` (ещё ${l} в очереди)`]}),c.jsxs("div",{className:"sheet__body",children:[c.jsx("div",{className:"sheet__tool",children:s.toolName}),s.reason&&c.jsx("p",{className:"sheet__reason",children:s.reason}),r?c.jsx(zh,{diff:r}):c.jsx("pre",{className:"code",children:JSON.stringify(s.input,null,2)})]}),c.jsxs("div",{className:"sheet__actions",children:[c.jsx("button",{className:"btn",onClick:()=>i(s.requestId,"deny"),children:"Отклонить"}),c.jsx("button",{className:"btn btn--warn",autoFocus:!0,onClick:()=>i(s.requestId,"allow"),children:"Разрешить"})]})]})})}function SS({request:s,queued:l,onAnswer:i,onDecline:r}){const{questions:o}=s,[d,h]=S.useState(()=>o.map(()=>new Set)),[g,m]=S.useState(()=>o.map(()=>"")),[b,x]=S.useState(()=>Jy(o));S.useEffect(()=>{h(o.map(()=>new Set)),m(o.map(()=>"")),x(Jy(o))},[s.requestId]);const k=S.useMemo(()=>wS(o,d,g),[o,d,g]),_=k!==null;function A(Q,E){var V,D;(D=(V=o[Q])==null?void 0:V.options[E])!=null&&D.preview&&x(R=>{const Z=R.slice();return Z[Q]=E,Z})}function T(Q,E,V){h(D=>{const R=D.slice(),Z=new Set(R[Q]);return V?Z.has(E)?Z.delete(E):Z.add(E):Z.has(E)||(Z.clear(),Z.add(E)),R[Q]=Z,R}),E!=="other"&&A(Q,E)}function L(Q,E){m(V=>{const D=V.slice();return D[Q]=E,D})}function O(){k&&i(s.requestId,k)}function F(Q){Q.key==="Enter"&&(Q.target.closest("button")||_&&(Q.preventDefault(),O()))}function q(Q){var R;if(!["ArrowDown","ArrowUp","ArrowRight","ArrowLeft"].includes(Q.key))return;const E=Array.from(Q.currentTarget.querySelectorAll("button.qsheet__option")),V=E.indexOf(document.activeElement);if(V===-1)return;Q.preventDefault();const D=Q.key==="ArrowDown"||Q.key==="ArrowRight"?1:-1;(R=E[(V+D+E.length)%E.length])==null||R.focus()}return c.jsx("div",{className:"modal-backdrop modal-backdrop--sheet",children:c.jsxs("div",{className:"qsheet",role:"dialog","aria-modal":"true","aria-label":"Вопрос от Claude",onKeyDown:F,children:[c.jsxs("div",{className:"qsheet__head",children:[c.jsx("span",{className:"qsheet__head-icon","aria-hidden":"true",children:"?"}),c.jsxs("span",{children:[o.length===1?"Уточняющий вопрос":`Уточняющие вопросы (${o.length})`,l>0&&` — ещё ${l} в очереди`]})]}),c.jsxs("div",{className:"qsheet__body",children:[s.reason&&c.jsx("p",{className:"qsheet__reason",children:s.reason}),o.map((Q,E)=>c.jsx(kS,{q:Q,qi:E,selected:d[E]??new Set,otherText:g[E]??"",previewIndex:b[E]??null,onToggle:T,onFocusOption:A,onOtherText:L,onOptionsKeyDown:q},E))]}),c.jsxs("div",{className:"qsheet__actions",children:[c.jsx("button",{className:"btn",onClick:()=>r(s.requestId),children:"Не отвечать"}),c.jsx("button",{className:"btn btn--primary",disabled:!_,onClick:O,children:"Ответить"})]})]})})}function kS({q:s,qi:l,selected:i,otherText:r,previewIndex:o,onToggle:d,onFocusOption:h,onOtherText:g,onOptionsKeyDown:m}){var A;const b=s.options.some(T=>T.preview),x=o!==null?(A=s.options[o])==null?void 0:A.preview:void 0,k=i.has("other"),_=s.multiSelect?"checkbox":"radio";return c.jsxs("div",{className:"qsheet__question",children:[c.jsxs("div",{className:"qsheet__qhead",children:[c.jsx("span",{className:"chip chip--accent",children:s.header}),c.jsx("span",{className:"qsheet__qtext",children:s.question})]}),c.jsxs("div",{className:"qsheet__options"+(s.multiSelect?"":" qsheet__options--radio"),role:s.multiSelect?"group":"radiogroup","aria-label":s.question,onKeyDown:m,children:[s.options.map((T,L)=>{const O=i.has(L);return c.jsxs("button",{type:"button",role:_,"aria-checked":O,className:"qsheet__option"+(O?" is-selected":""),onClick:()=>d(l,L,s.multiSelect),onFocus:()=>h(l,L),onMouseEnter:()=>h(l,L),children:[c.jsx("span",{className:"qsheet__opt-mark","aria-hidden":"true"}),c.jsxs("span",{className:"qsheet__opt-body",children:[c.jsx("span",{className:"qsheet__opt-label",children:T.label}),c.jsx("span",{className:"qsheet__opt-desc",children:T.description})]})]},L)}),c.jsxs("div",{className:"qsheet__other",children:[c.jsxs("button",{type:"button",role:_,"aria-checked":k,className:"qsheet__option qsheet__option--other"+(k?" is-selected":""),onClick:()=>d(l,"other",s.multiSelect),children:[c.jsx("span",{className:"qsheet__opt-mark","aria-hidden":"true"}),c.jsxs("span",{className:"qsheet__opt-body",children:[c.jsx("span",{className:"qsheet__opt-label",children:"Другое"}),c.jsx("span",{className:"qsheet__opt-desc",children:"Свой вариант ответа"})]})]}),k&&c.jsx("input",{type:"text",className:"qsheet__other-input",placeholder:"Впишите свой вариант…","aria-label":`Свой вариант ответа на вопрос «${s.question}»`,value:r,onChange:T=>g(l,T.target.value),autoFocus:!0})]})]}),b&&c.jsx("pre",{className:"qsheet__preview",children:x??""})]})}function Jy(s){return s.map(l=>{const i=l.options.findIndex(r=>r.preview);return i===-1?null:i})}function wS(s,l,i){const r={};for(let o=0;o<s.length;o++){const d=s[o];if(!d)continue;const h=l[o]??new Set,g=[];for(let m=0;m<d.options.length;m++){const b=d.options[m];b&&h.has(m)&&g.push(b.label)}if(h.has("other")){const m=(i[o]??"").trim();m&&g.push(m)}if(g.length===0)return null;r[d.question]=g.join(", ")}return r}function Fb({path:s}){const[l,i]=S.useState(!1),[r,o]=S.useState(!1),d=S.useRef(null);S.useEffect(()=>{if(!l)return;function g(m){var b;(b=d.current)!=null&&b.contains(m.target)||i(!1)}return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[l]),S.useEffect(()=>{if(!r)return;const g=setTimeout(()=>o(!1),Dh);return()=>clearTimeout(g)},[r]),S.useEffect(()=>i(!1),[s]);async function h(){await Oh(s)&&o(!0)}return c.jsxs("div",{ref:d,className:"cwd",children:[c.jsxs("button",{type:"button",className:"cwd__toggle","aria-expanded":l,title:l?"Свернуть путь":`Полный путь: ${s}`,onClick:()=>i(g=>!g),onKeyDown:g=>{g.key!=="Escape"||!l||(g.preventDefault(),g.stopPropagation(),i(!1))},children:[c.jsx(TS,{open:l}),c.jsx("span",{className:"cwd__short",children:s})]}),l&&c.jsxs("div",{className:"cwd__pop",children:[c.jsx("span",{className:"cwd__full",children:s}),c.jsx("button",{type:"button",className:"btn btn--ghost cwd__copy",onClick:()=>void h(),children:r?fr:bi})]})]})}function TS({open:s}){return c.jsx("svg",{className:s?"cwd__chev cwd__chev--open":"cwd__chev",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:c.jsx("path",{d:"M6 3.5 10.5 8 6 12.5"})})}function zs({value:s,options:l,onChange:i,className:r,title:o,ariaLabel:d,placeholder:h="—"}){const[g,m]=S.useState(!1),[b,x]=S.useState(0),k=S.useRef(null),_=S.useRef(null),A=l.find(O=>O.value===s)??null;S.useEffect(()=>{if(!g)return;const O=l.findIndex(F=>F.value===s);x(O===-1?0:O)},[g]),S.useEffect(()=>{if(!g)return;function O(F){var q;(q=k.current)!=null&&q.contains(F.target)||m(!1)}return document.addEventListener("mousedown",O),()=>document.removeEventListener("mousedown",O)},[g]),S.useEffect(()=>{var O,F;g&&((F=(O=_.current)==null?void 0:O.querySelector(".is-cursor"))==null||F.scrollIntoView({block:"nearest"}))},[g,b]),S.useEffect(()=>{if(!g)return;const O=_.current,F=NS(k.current);if(!O||!F)return;const q=O.getBoundingClientRect().bottom-F.getBoundingClientRect().bottom;q>0&&(F.scrollTop+=Math.min(q+8,O.offsetHeight))},[g]);function T(O){m(!1),O.value!==s&&i(O.value)}function L(O){if(O.key==="Escape"){if(!g)return;O.preventDefault(),O.stopPropagation(),m(!1);return}if(O.key==="ArrowDown"||O.key==="ArrowUp"){if(O.preventDefault(),!g)return m(!0);const F=O.key==="ArrowDown"?1:l.length-1;return x(q=>(q+F)%l.length)}if(O.key==="Enter"||O.key===" "){if(O.preventDefault(),!g)return m(!0);const F=l[b];F&&T(F)}}return c.jsxs("div",{ref:k,className:"select"+(g?" select--open":"")+(r?` ${r}`:""),children:[c.jsxs("button",{type:"button",className:"select__trigger",title:o,"aria-label":d??o,"aria-haspopup":"listbox","aria-expanded":g,onClick:()=>m(O=>!O),onKeyDown:L,children:[c.jsx("span",{className:"select__value",children:(A==null?void 0:A.label)??h}),c.jsx(jS,{})]}),g&&c.jsx("div",{ref:_,className:"select__menu",role:"listbox","aria-label":d??o,children:l.map((O,F)=>c.jsxs("button",{type:"button",role:"option","aria-selected":O.value===s,className:"select__option"+(F===b?" is-cursor":"")+(O.value===s?" is-on":""),onMouseEnter:()=>x(F),onClick:()=>T(O),children:[c.jsx("span",{className:"select__check","aria-hidden":"true",children:O.value===s?"✓":""}),c.jsx("span",{className:"select__label",children:O.label}),O.hint&&c.jsx("span",{className:"select__hint",children:O.hint})]},O.value))})]})}function NS(s){let l=(s==null?void 0:s.parentElement)??null;for(;l;){if(l.scrollHeight>l.clientHeight&&getComputedStyle(l).overflowY!=="visible")return l;l=l.parentElement}return null}function jS(){return c.jsx("svg",{className:"select__chev",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:c.jsx("path",{d:"M3 4.5 6 7.5 9 4.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}const ES=["low","medium","high"];function Wb({models:s,value:l,effort:i,ultracode:r,thinking:o,switchOnFlag:d,className:h,onModel:g,onEffort:m,onUltracode:b,onThinking:x,onSwitchOnFlag:k}){const[_,A]=S.useState(!1),[T,L]=S.useState(0),O=S.useRef(null),F=S.useRef(null),q=s.find(R=>R.value===l)??null,Q=q&&q.supportsEffort?q.effortLevels.length>0?q.effortLevels:ES:[],E=Q.includes("xhigh");S.useEffect(()=>{if(!_)return;const R=s.findIndex(Z=>Z.value===l);L(R===-1?0:R)},[_]),S.useEffect(()=>{if(!_)return;function R(Z){var ce;(ce=O.current)!=null&&ce.contains(Z.target)||A(!1)}return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[_]),S.useEffect(()=>{var R,Z;_&&((Z=(R=F.current)==null?void 0:R.querySelector(".is-cursor"))==null||Z.scrollIntoView({block:"nearest"}))},[_,T]);function V(R){A(!1),R.value!==l&&g(R.value)}function D(R){if(R.key==="Escape"){if(!_)return;R.preventDefault(),R.stopPropagation(),A(!1);return}if(R.key==="ArrowDown"||R.key==="ArrowUp"){if(R.preventDefault(),!_)return A(!0);if(s.length===0)return;const Z=R.key==="ArrowDown"?1:s.length-1;return L(ce=>(ce+Z)%s.length)}if(R.key==="Enter"||R.key===" "){if(R.preventDefault(),!_)return A(!0);const Z=s[T];Z&&V(Z)}}return c.jsxs("div",{ref:O,className:"select"+(_?" select--open":"")+(h?` ${h}`:""),children:[c.jsxs("button",{type:"button",className:"select__trigger",title:"Модель, усилие и размышления","aria-label":"Модель, усилие и размышления","aria-haspopup":"menu","aria-expanded":_,onClick:()=>A(R=>!R),onKeyDown:D,children:[c.jsx("span",{className:"select__value",children:(q==null?void 0:q.displayName)??l??"—"}),r?c.jsx("span",{className:"select__suffix select__suffix--hot",children:"ultracode"}):Q.length>0&&i&&c.jsx("span",{className:"select__suffix",children:i}),c.jsx(AS,{})]}),_&&c.jsxs("div",{ref:F,className:"select__menu modelmenu",role:"menu",children:[c.jsx("div",{className:"modelmenu__head",children:"Модель"}),s.map((R,Z)=>c.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":R.value===l,className:"select__option"+(Z===T?" is-cursor":"")+(R.value===l?" is-on":""),onMouseEnter:()=>L(Z),onClick:()=>V(R),children:[c.jsx("span",{className:"select__check","aria-hidden":"true",children:R.value===l?"✓":""}),c.jsx("span",{className:"select__label",children:R.displayName}),R.description&&c.jsx("span",{className:"select__hint",children:R.description})]},R.value)),Q.length>0&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"modelmenu__sep",role:"separator"}),c.jsxs("div",{className:"modelmenu__row",children:[c.jsxs("span",{className:"modelmenu__label",children:["Усилие",c.jsx("span",{className:"modelmenu__desc",children:"насколько усердно модель думает"})]}),c.jsx("span",{className:"modelmenu__levels",children:Q.map(R=>c.jsx("button",{type:"button",role:"menuitemradio","aria-checked":R===i,className:R===i?"modelmenu__level is-on":"modelmenu__level",onClick:()=>m(R),children:R},R))})]}),E&&c.jsx(ah,{label:"Ultracode",desc:"xhigh и постоянная оркестрация подагентами",on:r,onToggle:()=>b(!r)})]}),c.jsx("div",{className:"modelmenu__sep",role:"separator"}),(q==null?void 0:q.supportsThinking)!==!1&&c.jsx(ah,{label:"Размышления",desc:"расширенное обдумывание перед ответом",on:o,onToggle:()=>x(!o)}),c.jsx(ah,{label:"Менять модель по флагу",desc:"иначе помеченный ход встаёт на паузу",on:d,onToggle:()=>k(!d)})]})]})}function ah({label:s,desc:l,on:i,onToggle:r}){return c.jsxs("button",{type:"button",role:"menuitemcheckbox","aria-checked":i,className:"modelmenu__row modelmenu__row--btn",onClick:r,children:[c.jsxs("span",{className:"modelmenu__label",children:[s,c.jsx("span",{className:"modelmenu__desc",children:l})]}),c.jsx("span",{className:i?"switch is-on":"switch","aria-hidden":"true",children:c.jsx("span",{className:"switch__knob"})})]})}function AS(){return c.jsx("svg",{className:"select__chev",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:c.jsx("path",{d:"M3 4.5 6 7.5 9 4.5",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}function $l({title:s,children:l,actions:i,className:r,sheet:o=!1,onClose:d}){const h=S.useRef(null);return S.useEffect(()=>{function g(m){if(m.key==="Escape"){m.preventDefault(),m.stopPropagation(),d();return}if(m.key!=="Tab")return;const b=h.current;if(!b)return;const x=b.querySelectorAll('button, input, textarea, select, a[href], [tabindex]:not([tabindex="-1"])'),k=x[0],_=x[x.length-1];!k||!_||(m.shiftKey&&document.activeElement===k?(m.preventDefault(),_.focus()):!m.shiftKey&&document.activeElement===_&&(m.preventDefault(),k.focus()))}return document.addEventListener("keydown",g,!0),()=>document.removeEventListener("keydown",g,!0)},[d]),c.jsx("div",{className:o?"modal-backdrop modal-backdrop--sheet":"modal-backdrop",onMouseDown:g=>{g.target===g.currentTarget&&d()},children:c.jsxs("div",{ref:h,className:r?`modal ${r}`:"modal",role:"dialog","aria-modal":"true","aria-label":s,children:[c.jsxs("div",{className:"modal__head",children:[c.jsx("h2",{className:"modal__title",children:s}),c.jsx("button",{className:"modal__close","aria-label":"Закрыть",onClick:d,children:"✕"})]}),c.jsx("div",{className:"modal__body",children:l}),i&&c.jsx("div",{className:"modal__actions",children:i})]})})}function CS({candidates:s,searching:l,agentItems:i,agentBusy:r,error:o,roots:d,created:h,onSearch:g,onAskAgent:m,onInterrupt:b,onSubmit:x,onCreate:k,onClose:_}){const[A,T]=S.useState("open"),[L,O]=S.useState(""),[F,q]=S.useState(!1),[Q,E]=S.useState(""),[V,D]=S.useState(""),[R,Z]=S.useState({git:!0,claudeMd:!0,readme:!0}),ce=L.trim(),de=ce!=="",K=Q.trim(),le=V.trim(),me=K!==""&&le!=="";S.useEffect(()=>{Q===""&&d.length>0&&E(d[0])},[d]);const Ae=S.useRef(g);Ae.current=g,S.useEffect(()=>{if(A!=="open")return;const P=L.trim(),xe=setTimeout(()=>Ae.current(P),200);return()=>clearTimeout(xe)},[L,A]);function ve(){de&&x(ce)}function z(){me&&k(K,le,R)}function ee(){de&&(q(!0),m(ce))}return h?c.jsxs($l,{title:"Новый проект",onClose:_,actions:c.jsx("button",{className:"btn btn--primary",onClick:_,autoFocus:!0,children:"Понятно"}),children:[c.jsx("p",{className:"modal__text",children:"Каталог создан и открыт как проект, но часть шагов не удалась."}),c.jsx("p",{className:"newproj__preview",children:h.path}),c.jsx("div",{className:"modal__error",children:c.jsx("ul",{className:"newproj__warnings",children:h.warnings.map(P=>c.jsx("li",{children:P},P))})}),c.jsx("p",{className:"modal__text modal__text--dim",children:"Проект открыт и работает — недостающее можно добавить руками, в дереве файлов или из терминала."})]}):c.jsxs($l,{title:"Новый проект",className:F&&A==="open"?"modal--wide":void 0,onClose:_,actions:c.jsxs(c.Fragment,{children:[c.jsx("button",{className:"btn",onClick:_,children:"Отмена"}),A==="open"?c.jsxs(c.Fragment,{children:[r?c.jsx("button",{className:"btn",onClick:b,children:"Остановить"}):c.jsx("button",{className:"btn",disabled:!de,onClick:ee,title:"Найти по описанию",children:"Попросить агента"}),c.jsx("button",{className:"btn btn--primary",disabled:!de,onClick:ve,children:"Открыть"})]}):c.jsx("button",{className:"btn btn--primary",disabled:!me,onClick:z,children:"Создать"})]}),children:[c.jsxs("div",{className:"tabs",children:[c.jsx(Fy,{label:"Открыть",on:A==="open",onClick:()=>T("open")}),c.jsx(Fy,{label:"Создать",on:A==="create",onClick:()=>T("create")})]}),A==="open"?c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"modal__text",children:"Каталог, в котором будет работать агент. Введите путь или часть имени — подходящие каталоги появятся ниже."}),c.jsx("label",{className:"field",htmlFor:"workspace-path",children:"Путь или название"}),c.jsx("input",{id:"workspace-path",className:"input input--mono",value:L,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"C:\\Projects\\my-app",onChange:P=>O(P.target.value),onKeyDown:P=>{P.key==="Enter"&&(P.preventDefault(),ve())}}),o&&c.jsx("p",{className:"modal__error",children:o}),s.length>0&&c.jsx("ul",{className:"finds",children:s.map(P=>c.jsx("li",{children:c.jsxs("button",{className:"find",disabled:P.open,title:P.open?"Этот проект уже открыт":P.path,onClick:()=>O(P.path),onDoubleClick:()=>x(P.path),children:[c.jsx("span",{className:"find__name",children:P.name}),c.jsx("span",{className:"find__path",children:P.path}),c.jsx("span",{className:"find__note",children:OS(P)})]})},P.path))}),s.length===0&&de&&!l&&!F&&c.jsx("p",{className:"modal__text modal__text--dim",children:"Ничего похожего среди каталогов, где вы работали. Если помните не имя, а суть проекта — опишите его и нажмите «Попросить агента». Проекта ещё нет вовсе — рядом вкладка «Создать»."}),F&&c.jsx("div",{className:"finds__agent",children:c.jsx(Lh,{items:i,busy:r,waiting:!1,empty:"Агент ищет…"})})]}):c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"modal__text",children:"Пустой каталог для нового проекта. Дальше в нём работает агент — с первого промпта, без отдельной настройки."}),c.jsx("label",{className:"field",htmlFor:"workspace-parent",children:"Где создать"}),c.jsx("input",{id:"workspace-parent",className:"input input--mono",value:Q,spellCheck:!1,autoComplete:"off",placeholder:"C:\\Projects",onChange:P=>E(P.target.value)}),d.length>0&&c.jsx("div",{className:"newproj__roots",children:d.map(P=>c.jsx("button",{type:"button",className:P===K?"newproj__root is-on":"newproj__root",title:P,onClick:()=>E(P),children:MS(P)},P))}),c.jsx("label",{className:"field newproj__field",htmlFor:"workspace-name",children:"Имя проекта"}),c.jsx("input",{id:"workspace-name",className:"input input--mono",value:V,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"my-app",onChange:P=>D(P.target.value),onKeyDown:P=>{P.key==="Enter"&&(P.preventDefault(),z())}}),c.jsx("p",{className:"newproj__preview",children:me?RS(K,le):"Каталог появится здесь"}),o&&c.jsx("p",{className:"modal__error",children:o}),c.jsxs("div",{className:"newproj__opts",children:[c.jsx(sh,{label:"git init",desc:"панель истории работает сразу",on:R.git,onToggle:()=>Z(P=>({...P,git:!P.git}))}),c.jsx(sh,{label:"CLAUDE.md",desc:"заготовка инструкций для агента",on:R.claudeMd,onToggle:()=>Z(P=>({...P,claudeMd:!P.claudeMd}))}),c.jsx(sh,{label:"README.md",desc:"по нему проект потом узнаёт поиск",on:R.readme,onToggle:()=>Z(P=>({...P,readme:!P.readme}))})]})]})]})}function Fy({label:s,on:l,onClick:i}){return c.jsx("button",{type:"button",className:l?"tabs__tab is-on":"tabs__tab","aria-pressed":l,onClick:i,children:s})}function sh({label:s,desc:l,on:i,onToggle:r}){return c.jsxs("button",{type:"button",role:"checkbox","aria-checked":i,className:"newproj__opt",onClick:r,children:[c.jsxs("span",{className:"newproj__optlabel",children:[s,c.jsx("span",{className:"newproj__optdesc",children:l})]}),c.jsx("span",{className:i?"switch is-on":"switch","aria-hidden":"true",children:c.jsx("span",{className:"switch__knob"})})]})}function RS(s,l){const i=s.includes("\\")?"\\":"/";return s.replace(/[\\/]+$/,"")+i+l}function MS(s){const l=s.includes("\\")?"\\":"/",i=s.split(/[\\/]/).filter(Boolean);return i.length<=2?s:`…${l}${i.slice(-2).join(l)}`}function OS(s){return s.open?"уже открыт":s.why?s.why:s.sessions===0?"рядом с вашими проектами":`${DS(s.sessions)}${zS(s.lastUsedAt)}`}function DS(s){const l=s%10,i=s%100;return i>=11&&i<=14?`${s} сессий`:l===1?`${s} сессия`:l>=2&&l<=4?`${s} сессии`:`${s} сессий`}function zS(s){if(!s)return"";const l=Math.floor((Date.now()-s)/864e5);return l<=0?" · сегодня":l===1?" · вчера":l<30?` · ${l} дн. назад`:` · ${new Date(s).toLocaleDateString("ru-RU")}`}const Uh=7;function LS(s){const l=[],i=[];let r=1;for(const o of s){const d=l.slice();let h=l.indexOf(o.hash);h===-1&&(h=Wy(l),l[h]=o.hash);const[g,...m]=o.parents;l[h]=g??null;const b=[];g!==void 0&&b.push({from:h,to:h});for(const _ of m){let A=l.indexOf(_);A===-1&&(A=Wy(l),l[A]=_),b.push({from:h,to:A})}const x=[];for(let _=0;_<d.length;_++)d[_]===o.hash&&(x.push({from:_,to:h}),_!==h&&(l[_]=null));const k=[];for(let _=0;_<d.length;_++){const A=d[_];!A||A===o.hash||_===h||l[_]===A&&k.push(_)}US(l),r=Math.max(r,l.length,h+1),i.push({commit:o,col:h,up:x,down:b,through:k})}return{rows:i,columns:Math.min(r,Uh)}}function Wy(s){const l=s.indexOf(null);return l!==-1?l:(s.push(null),s.length-1)}function US(s){for(;s.length>0&&s[s.length-1]===null;)s.pop()}const Pb=1500;function HS(s){const l=[];let i=!1;for(const r of s.patch.split(`
|
|
120
|
+
`)){if(l.length>=Pb){i=!0;break}if(r.startsWith("@@"))l.push({type:"gap",text:BS(r)});else if(r.startsWith("+"))l.push({type:"add",text:r.slice(1)});else if(r.startsWith("-"))l.push({type:"del",text:r.slice(1)});else{if(r.startsWith("\\"))continue;(r!==""||l.length>0)&&l.push({type:"ctx",text:r.startsWith(" ")?r.slice(1):r})}}return{kind:"patch",filePath:s.path||s.oldPath,rows:l,added:s.added,removed:s.removed,note:qS(s,i)}}function BS(s){const l=/^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@ ?(.*)$/.exec(s);if(!l)return s;const i=Number(l[1]),r=l[2]===void 0?1:Number(l[2]),o=(l[3]??"").trim(),d=r>1?`строки ${i}–${i+r-1}`:`строка ${i}`;return o?`⋯ ${d} · ${o}`:`⋯ ${d}`}function qS(s,l){const i=[];return s.status==="added"&&i.push("новый файл"),s.status==="deleted"&&i.push("файл удалён"),s.status==="renamed"&&i.push(`переименован из ${s.oldPath}`),s.binary?i.push("двоичный файл"):s.patch===""&&i.push("содержимое не показано"),l&&i.push(`показаны первые ${Pb} строк`),i.length>0?i.join(" · "):null}function GS({open:s,state:l,result:i,selected:r,onRefresh:o,onShow:d,onCheckout:h,onClose:g}){const m=LS((l==null?void 0:l.commits)??[]),b=[...l!=null&&l.detached?[{value:"",label:`отделён · ${l.head.slice(0,8)}`}]:[],...((l==null?void 0:l.branches)??[]).map(x=>({value:x.name,label:x.name,hint:x.hash.slice(0,8)}))];return c.jsxs("aside",{className:s?"sidepane sidepane--git sidepane--open":"sidepane sidepane--git","aria-label":"История git",children:[c.jsxs("div",{className:"sidepane__head",children:[c.jsx(QS,{}),c.jsx("span",{className:"sidepane__title",children:"История"}),c.jsx("button",{className:"sidepane__btn",title:"Обновить","aria-label":"Обновить историю",onClick:o,children:"↻"}),c.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель истории",onClick:g,children:"✕"})]}),l===null?c.jsx("p",{className:"sidepane__empty",children:"Читаем репозиторий…"}):l.available?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"gitbar",children:[c.jsx(zs,{className:"gitbar__branch",title:"Ветка — выбрать значит переключиться",value:l.detached?"":l.branch,options:b,onChange:x=>{x&&h(x,`ветку ${x}`)}}),l.ahead>0&&c.jsxs("span",{className:"chip",title:`${l.ahead} — столько коммитов не отправлено`,children:["↑",l.ahead]}),l.behind>0&&c.jsxs("span",{className:"chip",title:`${l.behind} — столько коммитов не забрано`,children:["↓",l.behind]})]}),l.detached&&c.jsx("p",{className:"gitbar__note",children:"HEAD отделён от ветки. Выберите ветку в списке, чтобы вернуться."}),c.jsxs("div",{className:"sidepane__scroll",children:[c.jsx("button",{className:"gitrow gitrow--work"+(r===""?" is-on":""),onClick:()=>d(""),children:c.jsxs("span",{className:"gitrow__body",children:[c.jsx("span",{className:"gitrow__subject",children:l.changed.length>0?`Рабочее дерево · ${l.changed.length} ${KS(l.changed.length)}`:"Рабочее дерево чистое"}),c.jsx("span",{className:"gitrow__meta",children:l.changed.length>0?l.changed.slice(0,4).map(x=>ZS(x.path)).join(", "):"незакоммиченных изменений нет"})]})}),m.rows.map(x=>c.jsx(YS,{row:x,columns:m.columns,head:x.commit.hash===l.head,local:l.hasRemote&&!x.commit.pushed,active:r===x.commit.hash,onOpen:()=>d(x.commit.hash)},x.commit.hash)),m.rows.length===0&&c.jsx("p",{className:"sidepane__empty",children:"В репозитории ещё нет коммитов"})]})]}):c.jsx("p",{className:"sidepane__empty",children:l.message||"Это не git-репозиторий"}),c.jsx(zc,{result:i})]})}const Tc=50,Py=13;function YS({row:s,columns:l,head:i,local:r,active:o,onOpen:d}){const{commit:h}=s,g=h.refs.map($S).filter(Boolean);return c.jsxs("button",{className:"gitrow"+(o?" is-on":""),title:r?"Коммит ещё не отправлен на удалённый репозиторий":void 0,onClick:d,children:[c.jsx(IS,{row:s,columns:l,head:i,local:r}),c.jsxs("span",{className:"gitrow__body",children:[c.jsxs("span",{className:"gitrow__subject",children:[g.map(m=>c.jsx("span",{className:"gitrow__ref",children:m},m)),h.subject]}),c.jsxs("span",{className:"gitrow__meta",children:[h.shortHash," · ",h.author," · ",JS(h.date),r&&c.jsx("span",{className:"gitrow__local",children:"· не отправлен"})]})]})]})}function IS({row:s,columns:l,head:i,local:r}){const o=l*Py+6,d=Tc/2,h=b=>8+Math.min(b,Uh-1)*Py,g=r?"3.5 2.5":void 0,m=ro(s.col);return c.jsxs("svg",{className:"gitgraph",width:o,height:Tc,viewBox:`0 0 ${o} ${Tc}`,"aria-hidden":"true",children:[s.through.map(b=>c.jsx("line",{x1:h(b),y1:0,x2:h(b),y2:Tc,style:{stroke:ro(b)}},`t${b}`)),s.up.map((b,x)=>c.jsx("path",{d:`M${h(b.from)} 0 L${h(b.from)} ${d-12} L${h(b.to)} ${d}`,fill:"none",style:{stroke:ro(b.from),strokeDasharray:g}},`u${x}`)),s.down.map((b,x)=>c.jsx("path",{d:`M${h(b.from)} ${d} L${h(b.to)} ${d+12} L${h(b.to)} ${Tc}`,fill:"none",style:{stroke:ro(b.to),strokeDasharray:g}},`d${x}`)),i&&c.jsx("circle",{className:"gitgraph__head",cx:h(s.col),cy:d,r:s.commit.parents.length>1?7.4:6.6}),c.jsx("circle",{className:"gitgraph__dot",cx:h(s.col),cy:d,r:s.commit.parents.length>1?4.6:3.6,style:{stroke:m,fill:r?void 0:m}})]})}function ro(s){return`var(--lane-${s%Uh})`}function XS({detail:s,local:l,onCheckout:i,onClose:r}){const o=s.hash==="";return c.jsxs($l,{className:"modal--wide",title:o?"Незакоммиченные изменения":`Коммит ${s.shortHash}`,onClose:r,actions:c.jsxs(c.Fragment,{children:[!o&&c.jsx("button",{className:"btn",onClick:()=>i(s.hash,`коммит ${s.shortHash} (HEAD отделится от ветки)`),children:"Переключиться сюда"}),c.jsx("button",{className:"btn btn--primary",onClick:r,children:"Закрыть"})]}),children:[!o&&c.jsxs("div",{className:"commit__head",children:[c.jsx("p",{className:"commit__subject",children:s.subject}),c.jsxs("p",{className:"commit__meta",children:[s.author,s.email&&` <${s.email}>`," · ",FS(s.date)," ·"," ",c.jsx("span",{className:"commit__hash",children:s.hash})]}),l&&c.jsx("p",{className:"commit__meta commit__meta--local",children:"Не отправлен: этого коммита нет ни в одной удалённой ветке."}),s.parents.length>0&&c.jsxs("p",{className:"commit__meta",children:[s.parents.length>1?"слияние: ":"родитель: ",s.parents.map(d=>d.slice(0,8)).join(", ")]}),s.body&&c.jsx("pre",{className:"commit__body",children:s.body})]}),s.truncated&&c.jsx("p",{className:"modal__text",children:"Изменения слишком велики — часть патча не показана."}),s.files.length===0?c.jsx("p",{className:"modal__text",children:"Изменений нет."}):s.files.map(d=>c.jsx(VS,{file:d,defaultOpen:s.files.length<=3},d.path+d.oldPath))]})}function VS({file:s,defaultOpen:l}){const[i,r]=S.useState(l);return c.jsxs("div",{className:"commit__file",children:[c.jsxs("button",{className:"commit__filehead",onClick:()=>r(o=>!o),children:[c.jsx("span",{className:"commit__filepath",children:s.path||s.oldPath}),c.jsxs("span",{className:"diff__stat",children:[s.added>0&&c.jsxs("span",{className:"diff__stat--add",children:["+",s.added]}),s.removed>0&&c.jsxs("span",{className:"diff__stat--del",children:["−",s.removed]})]}),c.jsx("span",{className:"tool__status",children:i?"▴":"▾"})]}),i&&c.jsx(zh,{diff:HS(s)})]})}function QS(){return c.jsxs("svg",{className:"sidepane__icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[c.jsx("circle",{cx:"4.5",cy:"3.5",r:"1.9"}),c.jsx("circle",{cx:"4.5",cy:"12.5",r:"1.9"}),c.jsx("circle",{cx:"11.5",cy:"8",r:"1.9"}),c.jsx("path",{d:"M4.5 5.4v5.2M6.4 3.9h2.2a1.6 1.6 0 0 1 1.6 1.6v.8"})]})}function $S(s){return s.replace(/^HEAD -> /,"").replace(/^tag: /,"⌂ ").trim()}function ZS(s){const l=s.split("/");return l[l.length-1]??s}function KS(s){const l=s%100;if(l>=11&&l<=14)return"файлов";switch(s%10){case 1:return"файл";case 2:case 3:case 4:return"файла";default:return"файлов"}}function JS(s){const l=Date.parse(s);if(Number.isNaN(l))return s;const i=Math.round((Date.now()-l)/6e4);if(i<1)return"только что";if(i<60)return`${i} мин назад`;const r=Math.round(i/60);if(r<24)return`${r} ч назад`;const o=Math.round(r/24);return o<30?`${o} дн назад`:new Date(l).toLocaleDateString()}function FS(s){const l=Date.parse(s);return Number.isNaN(l)?s:new Date(l).toLocaleString()}function WS({open:s,items:l,busy:i,ready:r,commands:o,contextResult:d,models:h,model:g,effort:m,ultracode:b,thinking:x,switchOnFlag:k,onContextSearch:_,onCommand:A,onModel:T,onEffort:L,onUltracode:O,onThinking:F,onSwitchOnFlag:q,onAsk:Q,onInterrupt:E,onReset:V,onClose:D}){return c.jsxs("aside",{className:s?"sidepane sidepane--ask sidepane--open":"sidepane sidepane--ask","aria-label":"Вопрос на полях",children:[c.jsxs("div",{className:"sidepane__head",children:[c.jsx(PS,{}),c.jsx("span",{className:"sidepane__title",children:"Вопрос на полях"}),c.jsx("button",{className:"sidepane__btn",title:"Начать заново — следующий вопрос возьмёт свежий контекст","aria-label":"Начать боковой разговор заново",disabled:l.length===0,onClick:V,children:"↻"}),c.jsx("button",{className:"sidepane__btn",title:"Закрыть панель","aria-label":"Закрыть панель вопроса",onClick:D,children:"✕"})]}),h.length>0&&c.jsxs("div",{className:"sidepane__tools",children:[c.jsx(Wb,{className:"select--compact",models:h,value:g,effort:m,ultracode:b,thinking:x,switchOnFlag:k,onModel:T,onEffort:L,onUltracode:O,onThinking:F,onSwitchOnFlag:q}),c.jsx("span",{className:"sidepane__note",title:"Боковой вопрос работает только на чтение",children:"только чтение"})]}),c.jsx(Lh,{items:l,busy:i,waiting:!1,empty:r?"Спросите о том, что происходит: вопрос уйдёт в сторону от основного разговора и не попадёт в его контекст. Отвечающий видит сессию и проект, но ничего не меняет.":"Откройте сессию — вопрос задаётся о ней."}),c.jsx(Kb,{className:"composer--side",disabled:!r,busy:i,commands:o,sessionTitle:null,contextResult:d,placeholder:"Спросить, не мешая работе…",sendLabel:"Спросить",autoFocus:s,onContextSearch:_,onCommand:A,onSend:Q,onInterrupt:E,onEscape:i?E:D})]})}function PS(){return c.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:[c.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"}),c.jsx("path",{d:"M8.4 8.5v-.3c0-.7.9-.9.9-1.7a1 1 0 0 0-1.9-.4"})]})}const ek=75,tk=90;function e0({usage:s}){if(!(s!=null&&s.available))return null;const l=[];return s.fiveHour&&l.push({key:"five",label:"5 ч",window:s.fiveHour}),s.sevenDay&&l.push({key:"week",label:"нед",window:s.sevenDay}),l.length===0?null:c.jsx("div",{className:"usage",title:ak(s),"aria-label":`Расход лимитов плана${s.plan?` ${s.plan}`:""}`,children:l.map(i=>c.jsx(nk,{label:i.label,window:i.window},i.key))})}function nk({label:s,window:l}){const i=Math.round(l.utilization),r=sk(l.resetsAt);return c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"usage__label",children:s}),c.jsx("span",{className:"usage__track",role:"progressbar","aria-label":s,"aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,children:c.jsx("span",{className:`usage__fill${lk(i)}`,style:{width:`${i}%`}})}),c.jsxs("span",{className:"usage__pct",children:[i,"%"]}),c.jsx("span",{className:"usage__reset",title:l0(l.resetsAt)||void 0,children:r&&`↻ ${r}`})]})}function lk(s){return s>=tk?" usage__fill--over":s>=ek?" usage__fill--warn":""}function ak(s){const l=[s.plan?`Лимиты плана ${s.plan}`:"Лимиты плана"],i=(r,o)=>{if(!o)return;const d=l0(o.resetsAt);l.push(`${r}: ${Math.round(o.utilization)}%${d?`, ${d}`:""}`)};return i("5 часов",s.fiveHour),i("Неделя",s.sevenDay),i("Неделя, Opus",s.sevenDayOpus),l.join(`
|
|
121
|
+
`)}function t0(s){if(!s)return null;const l=new Date(s);return Number.isNaN(l.getTime())?null:l}function n0(s){return s.getTime()-Date.now()<1440*60*1e3}function sk(s){const l=t0(s);return l?n0(l)?l.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):l.toLocaleDateString(void 0,{day:"numeric",month:"short"}):""}function l0(s){const l=t0(s);return l?`обнулится ${n0(l)?`в ${l.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:l.toLocaleDateString(void 0,{day:"numeric",month:"long"})}`:""}function a0(){const[s,l]=S.useState(()=>new Date);return S.useEffect(()=>{let i=0;const r=()=>{const d=new Date;l(d),i=window.setTimeout(r,6e4-(d.getSeconds()*1e3+d.getMilliseconds()))};r();const o=()=>{document.hidden||(window.clearTimeout(i),r())};return document.addEventListener("visibilitychange",o),()=>{window.clearTimeout(i),document.removeEventListener("visibilitychange",o)}},[]),c.jsxs("time",{className:"clock",dateTime:s.toISOString(),title:ik(s),children:[c.jsx("span",{className:"clock__time",children:s.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}),c.jsx("span",{className:"clock__date",children:s.toLocaleDateString(void 0,{weekday:"short",day:"numeric",month:"short"})})]})}function ik(s){return s.toLocaleDateString(void 0,{weekday:"long",day:"numeric",month:"long",year:"numeric"})}function rk({onClose:s,permission:l,model:i,usage:r,cwd:o,costLabel:d,onRefresh:h,refreshing:g,metersFetchedAt:m,onRename:b}){return c.jsx($l,{title:"Настройки сессии",className:"modal--sheet",sheet:!0,onClose:s,children:c.jsxs("div",{className:"sessionmenu",children:[l&&c.jsx(sr,{label:"Режим прав",children:l}),c.jsx(sr,{label:"Модель",children:i}),(r==null?void 0:r.available)&&(r.fiveHour||r.sevenDay)&&c.jsx(sr,{label:"Лимиты плана",children:c.jsx(e0,{usage:r})}),c.jsxs("button",{type:"button",className:g?"sessionmenu__refresh is-busy":"sessionmenu__refresh","aria-busy":g,disabled:g,onClick:h,children:[c.jsx(ck,{}),c.jsxs("span",{className:"sessionmenu__refresh-text",children:["Обновить показания",m&&c.jsxs("span",{className:"sessionmenu__refresh-time",children:["обновлено в"," ",new Date(m).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})]})]})]}),c.jsx(sr,{label:"Время",children:c.jsx(a0,{})}),d&&c.jsx(sr,{label:"Стоимость хода",children:c.jsx("span",{className:"badge badge--cost",children:d})}),o&&c.jsx(sr,{label:"Каталог проекта",children:c.jsx(Fb,{path:o})}),b&&c.jsx("button",{type:"button",className:"sessionmenu__rename",onClick:b,children:"Переименовать сессию"})]})})}function sr({label:s,children:l}){return c.jsxs("div",{className:"sessionmenu__row",children:[c.jsx("span",{className:"sessionmenu__label",children:s}),l]})}function ck(){return c.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[c.jsx("path",{d:"M14 8a6 6 0 1 1-6-6c1.68 0 3.29.67 4.49 1.83L14 5.33"}),c.jsx("path",{d:"M14 2v3.33h-3.33"})]})}function uk({tab:s,servers:l,plugins:i,marketplaces:r,catalog:o,result:d,actions:h,onTab:g,onClose:m}){const b=[{id:"mcp",label:"MCP-серверы",count:l.length},{id:"plugins",label:"Плагины",count:i.length},{id:"catalog",label:"Каталог",count:o.length}];return c.jsxs($l,{title:"Расширения",className:"modal--wide",onClose:m,children:[c.jsx("div",{className:"tabs",role:"tablist",children:b.map(x=>c.jsxs("button",{role:"tab","aria-selected":s===x.id,className:s===x.id?"tabs__tab is-on":"tabs__tab",onClick:()=>g(x.id),children:[x.label,c.jsx("span",{className:"tabs__count",children:x.count})]},x.id))}),s==="mcp"&&c.jsx(ok,{servers:l,actions:h}),s==="plugins"&&c.jsx(mk,{plugins:i,marketplaces:r,actions:h}),s==="catalog"&&c.jsx(gk,{catalog:o,hasMarketplaces:r.length>0,actions:h,onMarketplaces:()=>g("plugins")}),c.jsx(zc,{result:d})]})}function ok({servers:s,actions:l}){const[i,r]=S.useState(!1);return c.jsxs(c.Fragment,{children:[s.length===0&&!i&&c.jsxs("p",{className:"modal__text",children:["Ни одного MCP-сервера. Добавленный здесь попадёт в ",c.jsx("code",{children:".mcp.json"})," ","проекта — его увидит и консольный ",c.jsx("code",{children:"claude mcp list"}),"."]}),c.jsx("ul",{className:"extlist",children:s.map(o=>c.jsxs("li",{className:"extlist__row",children:[c.jsxs("div",{className:"extlist__head",children:[c.jsx("span",{className:"extlist__name",children:o.name}),c.jsx("span",{className:`chip chip--${dk(o.status)}`,children:fk[o.status]}),o.scope&&c.jsx("span",{className:"chip",children:o.scope}),o.transport&&c.jsx("span",{className:"chip",children:o.transport})]}),o.target&&c.jsx("div",{className:"extlist__meta",title:o.target,children:o.target}),o.error&&c.jsx("div",{className:"extlist__error",children:o.error}),o.tools.length>0&&c.jsxs("div",{className:"extlist__meta",children:["Инструментов: ",o.tools.length," · ",o.tools.slice(0,6).join(", "),o.tools.length>6&&"…"]}),c.jsxs("div",{className:"extlist__actions",children:[c.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>l.mcpAction(o.name,"reconnect"),children:"Переподключить"}),o.status==="disabled"?c.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>l.mcpAction(o.name,"enable"),children:"Включить"}):c.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>l.mcpAction(o.name,"disable"),children:"Выключить"}),o.editable&&c.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>l.mcpRemove(o.name),children:"Удалить"})]})]},o.name))}),i?c.jsx(hk,{onCancel:()=>r(!1),onSubmit:(o,d)=>{l.mcpAdd(o,d),r(!1)}}):c.jsx("div",{className:"extbar",children:c.jsx("button",{className:"btn btn--primary",onClick:()=>r(!0),children:"+ Сервер"})})]})}const fk={connected:"подключён",failed:"ошибка","needs-auth":"нужна авторизация",pending:"подключается",disabled:"выключен",unknown:"неизвестно"};function dk(s){return s==="connected"?"ok":s==="failed"?"bad":s==="needs-auth"?"warn":"mute"}function hk({onSubmit:s,onCancel:l}){const[i,r]=S.useState(""),[o,d]=S.useState("stdio"),[h,g]=S.useState(""),[m,b]=S.useState(""),[x,k]=S.useState(""),_=o==="stdio",A=i.trim()!==""&&(_?h.trim()!=="":m.trim()!=="");function T(){if(A)if(_){const[L,...O]=pk(h);s(i.trim(),{transport:"stdio",command:L??"",args:O,env:eb(x)})}else s(i.trim(),{transport:o,url:m.trim(),headers:eb(x)})}return c.jsxs("div",{className:"extform extform--card",children:[c.jsx("label",{className:"field",htmlFor:"mcp-name",children:"Имя сервера"}),c.jsx("input",{id:"mcp-name",className:"input input--mono",value:i,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"context7",onChange:L=>r(L.target.value)}),c.jsx("label",{className:"field",children:"Транспорт"}),c.jsx(zs,{title:"Транспорт",value:o,options:[{value:"stdio",label:"stdio",hint:"локальный процесс"},{value:"http",label:"http",hint:"удалённый сервер"},{value:"sse",label:"sse",hint:"удалённый, поток событий"}],onChange:L=>d(L)}),_?c.jsxs(c.Fragment,{children:[c.jsx("label",{className:"field",htmlFor:"mcp-command",children:"Команда с аргументами"}),c.jsx("input",{id:"mcp-command",className:"input input--mono",value:h,spellCheck:!1,autoComplete:"off",placeholder:"npx -y @upstash/context7-mcp",onChange:L=>g(L.target.value)})]}):c.jsxs(c.Fragment,{children:[c.jsx("label",{className:"field",htmlFor:"mcp-url",children:"URL"}),c.jsx("input",{id:"mcp-url",className:"input input--mono",value:m,spellCheck:!1,autoComplete:"off",placeholder:"https://mcp.example.dev/mcp",onChange:L=>b(L.target.value)})]}),c.jsxs("label",{className:"field",htmlFor:"mcp-pairs",children:[_?"Переменные окружения":"Заголовки"," — по одной на строку, необязательно"]}),c.jsx("textarea",{id:"mcp-pairs",className:"input input--mono input--area",value:x,spellCheck:!1,placeholder:_?"API_KEY=xxx":"Authorization: Bearer xxx",onChange:L=>k(L.target.value)}),c.jsxs("div",{className:"extbar",children:[c.jsx("button",{className:"btn",onClick:l,children:"Отмена"}),c.jsx("button",{className:"btn btn--primary",disabled:!A,onClick:T,children:"Подключить"})]})]})}function eb(s){const l={};for(const i of s.split(`
|
|
122
|
+
`)){const r=i.trim();if(!r)continue;const o=r.indexOf("="),d=r.indexOf(":"),h=o===-1?d:d===-1?o:Math.min(o,d);h<=0||(l[r.slice(0,h).trim()]=r.slice(h+1).trim())}return l}function pk(s){return(s.trim().match(/"[^"]*"|'[^']*'|\S+/g)??[]).map(l=>l.replace(/^["']|["']$/g,""))}function mk({plugins:s,marketplaces:l,actions:i}){const[r,o]=S.useState("");return c.jsxs(c.Fragment,{children:[s.length===0&&c.jsx("p",{className:"modal__text",children:"Ни одного установленного плагина. Что можно поставить — на вкладке «Каталог»."}),c.jsx("ul",{className:"extlist",children:s.map(d=>c.jsxs("li",{className:"extlist__row",children:[c.jsxs("div",{className:"extlist__head",children:[c.jsx("span",{className:"extlist__name",children:d.name}),c.jsx("span",{className:d.enabled?"chip chip--ok":"chip chip--mute",children:d.enabled?"включён":"выключен"}),d.version&&d.version!=="unknown"&&c.jsx("span",{className:"chip",children:d.version}),d.scope&&c.jsx("span",{className:"chip",children:d.scope})]}),d.marketplace&&c.jsx("div",{className:"extlist__meta",children:d.marketplace}),d.mcpServers.length>0&&c.jsxs("div",{className:"extlist__meta",children:["MCP-серверы: ",d.mcpServers.join(", ")]}),c.jsxs("div",{className:"extlist__actions",children:[c.jsx("button",{className:"btn btn--ghost btn--sm",onClick:()=>i.pluginToggle(d.id,!d.enabled),children:d.enabled?"Выключить":"Включить"}),c.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>i.pluginUninstall(d.id),children:"Удалить"})]})]},d.id))}),c.jsx("div",{className:"sidebar__section",children:"Маркетплейсы"}),c.jsx("ul",{className:"extlist",children:l.map(d=>c.jsxs("li",{className:"extlist__row",children:[c.jsx("div",{className:"extlist__head",children:c.jsx("span",{className:"extlist__name",children:d.name})}),d.source&&c.jsx("div",{className:"extlist__meta",children:d.source}),c.jsx("div",{className:"extlist__actions",children:c.jsx("button",{className:"btn btn--ghost btn--sm btn--danger",onClick:()=>i.marketplaceRemove(d.name),children:"Отключить"})})]},d.name))}),c.jsxs("div",{className:"extform__row",children:[c.jsx("input",{className:"input input--mono",value:r,spellCheck:!1,autoComplete:"off","aria-label":"Источник маркетплейса",placeholder:"owner/repo, URL или путь",onChange:d=>o(d.target.value),onKeyDown:d=>{d.key!=="Enter"||r.trim()===""||(d.preventDefault(),i.marketplaceAdd(r.trim()),o(""))}}),c.jsx("button",{className:"btn",disabled:r.trim()==="",onClick:()=>{i.marketplaceAdd(r.trim()),o("")},children:"Добавить"})]})]})}const Nc=30;function gk({catalog:s,hasMarketplaces:l,actions:i,onMarketplaces:r}){const[o,d]=S.useState(""),[h,g]=S.useState(""),[m,b]=S.useState(Nc),[x,k]=S.useState(""),_=S.useMemo(()=>[...new Set(s.map(L=>L.category).filter(Boolean))].sort(),[s]),A=S.useMemo(()=>{const T=o.trim().toLowerCase();return s.filter(L=>h&&L.category!==h?!1:T?`${L.name} ${L.displayName} ${L.description} ${L.author}`.toLowerCase().includes(T):!0)},[s,o,h]);return s.length===0?c.jsxs("p",{className:"modal__text",children:[l?"Маркетплейсы подключены, но их каталог ещё не выкачан. Попробуйте открыть окно ещё раз через минуту.":"Ни одного маркетплейса — ставить нечего."," ",c.jsx("button",{className:"linkish",onClick:r,children:"Подключить маркетплейс"})]}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"catalog__filters",children:[c.jsx("input",{className:"input",value:o,spellCheck:!1,autoComplete:"off","aria-label":"Поиск по каталогу",placeholder:"Поиск: имя, описание, автор",onChange:T=>{d(T.target.value),b(Nc)}}),c.jsx(zs,{title:"Категория",value:h,options:[{value:"",label:"все категории"},..._.map(T=>({value:T,label:T}))],onChange:T=>{g(T),b(Nc)}})]}),A.length===0?c.jsx("p",{className:"modal__text",children:"Ничего не нашлось."}):c.jsx("ul",{className:"extlist",children:A.slice(0,m).map(T=>c.jsxs("li",{className:"extlist__row",children:[c.jsxs("div",{className:"extlist__head",children:[c.jsx("span",{className:"extlist__name",children:T.name}),T.installed&&c.jsx("span",{className:"chip chip--ok",children:"установлен"}),T.version&&c.jsx("span",{className:"chip",children:T.version}),T.category&&c.jsx("span",{className:"chip",children:T.category})]}),T.description&&c.jsx("div",{className:"catalog__desc",children:T.description}),c.jsxs("div",{className:"extlist__meta",children:[T.author&&`${T.author} · `,T.marketplace]}),c.jsxs("div",{className:"extlist__actions",children:[c.jsx("button",{className:"btn btn--ghost btn--sm",disabled:T.installed,onClick:()=>i.pluginInstall(T.id),children:T.installed?"Уже стоит":"Установить"}),T.homepage&&c.jsx("a",{className:"btn btn--ghost btn--sm",href:T.homepage,target:"_blank",rel:"noreferrer",children:"Страница"})]})]},T.id))}),A.length>m&&c.jsx("div",{className:"extbar",children:c.jsxs("button",{className:"btn",onClick:()=>b(T=>T+Nc),children:["Ещё ",Math.min(Nc,A.length-m)," из ",A.length-m]})}),c.jsxs("div",{className:"extform",children:[c.jsx("label",{className:"field",htmlFor:"plugin-spec",children:"Или установить по имени — если нужного в каталоге нет"}),c.jsxs("div",{className:"extform__row",children:[c.jsx("input",{id:"plugin-spec",className:"input input--mono",value:x,spellCheck:!1,autoComplete:"off",placeholder:"имя или имя@маркетплейс",onChange:T=>k(T.target.value),onKeyDown:T=>{T.key!=="Enter"||x.trim()===""||(T.preventDefault(),i.pluginInstall(x.trim()),k(""))}}),c.jsx("button",{className:"btn",disabled:x.trim()==="",onClick:()=>{i.pluginInstall(x.trim()),k("")},children:"Установить"})]})]})]})}function yk({status:s,login:l,actions:i,runningSessions:r,onClose:o}){const[d,h]=S.useState(""),[g,m]=S.useState(!1),[b,x]=S.useState(!1),k=S.useMemo(()=>{if(l.error)return{ok:!1,message:l.error};const T=l.output.trim();return T===""?null:{ok:!0,message:T}},[l.error,l.output]);function _(){d.trim()!==""&&(i.submitCode(d.trim()),h(""))}function A(){if(r>0){m(!1),x(!0);return}i.login("claudeai",!0)}return c.jsxs($l,{title:"Аккаунт",onClose:o,children:[s===null?c.jsx("p",{className:"modal__text",children:"Спрашиваем у хоста…"}):s.loggedIn?c.jsxs("div",{className:"account",children:[c.jsx("div",{className:"account__id",children:s.email||"Вход выполнен"}),c.jsxs("div",{className:"account__chips",children:[c.jsx("span",{className:"chip chip--ok",children:xk[s.method]??s.method}),s.plan&&c.jsx("span",{className:"chip",children:s.plan})]}),s.organization&&c.jsx("div",{className:"extlist__meta",children:s.organization})]}):c.jsxs("p",{className:"modal__text",children:["Вход не выполнен. Сессии не запустятся, пока аккаунт не подключён — или пока в окружении хоста нет ",c.jsx("code",{children:"ANTHROPIC_API_KEY"}),"."]}),l.active?c.jsx(_k,{login:l,code:d,onCode:h,onSubmit:_,onCancel:i.cancel}):c.jsxs(c.Fragment,{children:[c.jsx(zc,{result:k}),b&&c.jsx("p",{className:"account__warn",role:"alert",children:bk(r)}),c.jsx("div",{className:"extbar",children:s!=null&&s.loggedIn?c.jsxs(c.Fragment,{children:[b?c.jsxs(c.Fragment,{children:[c.jsx("button",{className:"btn",onClick:()=>x(!1),children:"Отмена"}),c.jsx("button",{className:"btn btn--warn",autoFocus:!0,onClick:()=>{x(!1),i.login("claudeai",!0)},children:"Всё равно сменить"})]}):c.jsx("button",{className:"btn",onClick:A,children:"Сменить аккаунт"}),g?c.jsx("button",{className:"btn btn--danger",autoFocus:!0,onClick:()=>{m(!1),i.logout()},children:"Точно выйти?"}):c.jsx("button",{className:"btn",onClick:()=>{x(!1),m(!0)},children:"Выйти"})]}):c.jsxs(c.Fragment,{children:[c.jsx("button",{className:"btn",onClick:()=>i.login("console",!1),children:"Через Console"}),c.jsx("button",{className:"btn btn--primary",onClick:()=>i.login("claudeai",!1),children:"Войти"})]})})]})]})}function bk(s){const l=s%10,i=s%100,r=l===1&&i!==11,o=r?"сессия":l>=2&&l<=4&&(i<12||i>14)?"сессии":"сессий";return`${s} ${o} сейчас ${r?"работает":"работают"} — смена аккаунта может ${r?"её":"их"} прервать.`}const xk={"claude.ai":"подписка Claude",console:"Anthropic Console",apiKey:"API-ключ",none:"нет"};function _k({login:s,code:l,onCode:i,onSubmit:r,onCancel:o}){return c.jsxs("div",{className:"account__flow",children:[s.url?c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"field",children:"Откройте ссылку и подтвердите вход"}),c.jsx("a",{className:"account__link",href:s.url,target:"_blank",rel:"noreferrer",children:s.url})]}):c.jsx("p",{className:"modal__text",children:"Запускаем вход…"}),s.awaitingCode&&c.jsxs(c.Fragment,{children:[c.jsx("label",{className:"field",htmlFor:"auth-code",children:"Код со страницы авторизации"}),c.jsxs("div",{className:"extform__row",children:[c.jsx("input",{id:"auth-code",className:"input input--mono",value:l,autoFocus:!0,spellCheck:!1,autoComplete:"off",placeholder:"вставьте код",onChange:d=>i(d.target.value),onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),r())}}),c.jsx("button",{className:"btn btn--primary",disabled:l.trim()==="",onClick:r,children:"Готово"})]})]}),s.output.trim()!==""&&c.jsx("pre",{className:"account__log",children:s.output.trim()}),c.jsx("div",{className:"extbar",children:c.jsx("button",{className:"btn",onClick:o,children:"Отменить вход"})})]})}function vk({state:s,onPair:l,onUnpair:i,onClose:r}){const[o,d]=S.useState(""),[h,g]=S.useState(""),[m,b]=S.useState(!1),x=S.useRef(null),k=(s==null?void 0:s.paired)===!0;S.useEffect(()=>{var A;k||(A=x.current)==null||A.focus()},[k]),S.useEffect(()=>{b(!1),k&&d("")},[k,s==null?void 0:s.error]);const _=(s==null?void 0:s.url)??"https://claudevisual.com";return c.jsx($l,{title:"Удалённый доступ",onClose:r,children:k?c.jsxs("div",{className:"relay",children:[c.jsxs("p",{className:"relay__lede",children:["Компьютер связан с аккаунтом на ",c.jsx("b",{children:tb(_)}),". Открывайте его оттуда с любого устройства — с телефона в том числе."]}),c.jsxs("dl",{className:"relay__facts",children:[c.jsxs("div",{children:[c.jsx("dt",{children:"Имя"}),c.jsx("dd",{children:(s==null?void 0:s.name)??"—"})]}),c.jsxs("div",{children:[c.jsx("dt",{children:"Связь"}),c.jsxs("dd",{children:[c.jsx("span",{className:s!=null&&s.connected?"dot dot--on":"dot"})," ",s!=null&&s.connected?"на связи":"нет связи, пробуем переподключиться"]})]}),c.jsxs("div",{children:[c.jsx("dt",{children:"Подключено"}),c.jsxs("dd",{children:[(s==null?void 0:s.clients)??0," вкладок"]})]})]}),(s==null?void 0:s.error)&&c.jsx("p",{className:"relay__error",children:s.error}),c.jsx("p",{className:"relay__note",children:"Терминал с удалённых устройств настраивается в настройках приложения, раздел «Терминал»."}),c.jsx("p",{className:"relay__note",children:"Отвязка гасит токен этой машины: чтобы вернуть доступ, понадобится новый код. Сессии Claude Code это не трогает."}),c.jsx("button",{className:"btn btn--danger",onClick:i,children:"Отвязать компьютер"})]}):c.jsxs("div",{className:"relay",children:[c.jsx("p",{className:"relay__lede",children:"Чтобы работать с этим компьютером из браузера и с телефона, свяжите его с аккаунтом."}),c.jsxs("ol",{className:"relay__steps",children:[c.jsxs("li",{children:["Откройте ",c.jsx("b",{children:tb(_)})," и войдите (или зарегистрируйтесь)."]}),c.jsxs("li",{children:["Нажмите ",c.jsx("b",{children:"«Подключить ПК»"})," — появится код из восьми знаков."]}),c.jsx("li",{children:"Введите его сюда."})]}),c.jsxs("form",{className:"relay__form",onSubmit:A=>{A.preventDefault(),o.trim()&&(b(!0),l(o.trim(),h.trim()))},children:[c.jsxs("label",{className:"field",children:[c.jsx("span",{children:"Код сопряжения"}),c.jsx("input",{ref:x,className:"input relay__code",value:o,onChange:A=>d(A.target.value.toUpperCase()),placeholder:"XXXX-XXXX",autoComplete:"off",spellCheck:!1,maxLength:12})]}),c.jsxs("label",{className:"field",children:[c.jsx("span",{children:"Как назвать этот компьютер"}),c.jsx("input",{className:"input",value:h,onChange:A=>g(A.target.value),placeholder:"имя машины",autoComplete:"off",maxLength:64})]}),(s==null?void 0:s.error)&&c.jsx("p",{className:"relay__error",children:s.error}),c.jsx("button",{className:"btn btn--primary",type:"submit",disabled:!o.trim()||m,children:m?"Связываем…":"Связать"})]})]})})}function tb(s){try{return new URL(s).host}catch{return s}}const ih="",Sk=[{value:"opus",label:"Opus",hint:"полный список моделей виден, когда открыта сессия"},{value:"sonnet",label:"Sonnet",hint:"полный список моделей виден, когда открыта сессия"},{value:"haiku",label:"Haiku",hint:"полный список моделей виден, когда открыта сессия"}],kk=mb.map(s=>({value:s.value,label:s.value,hint:s.hint})),co=3600*1e3,wk=[{value:"6h",label:"6 часов"},{value:"24h",label:"Сутки"},{value:"48h",label:"Двое суток"},{value:"168h",label:"Неделя"},{value:"never",label:"Никогда"}],rr={"6h":6*co,"24h":24*co,"48h":48*co,"168h":168*co,never:0};function Tk(s){return rr[s]??rr["48h"]}function Nk(s){const l=Object.entries(rr).find(([,i])=>i===s);return l?l[0]:Object.keys(rr).reduce((i,r)=>Math.abs(rr[r]-s)<Math.abs(rr[i]-s)?r:i)}const jk=[{value:"off",label:"Выключено"},{value:"500",label:"0.5 с"},{value:"1500",label:"1.5 с"},{value:"3000",label:"3 с"},{value:"10000",label:"10 с"}],cr={off:0,500:500,1500:1500,3e3:3e3,1e4:1e4};function Ek(s){return cr[s]??cr.off}function Ak(s){const l=Object.entries(cr).find(([,i])=>i===s);return l?l[0]:Object.keys(cr).reduce((i,r)=>Math.abs(cr[r]-s)<Math.abs(cr[i]-s)?r:i)}const Ck=[{value:"project",title:"Только текущий проект",description:"Агент молча пишет файлы в открытом проекте и в ~/.claude — настройках самого Claude Code. Чужой проект и любая новая папка — только с явного разрешения."},{value:"projects",title:"Папка с проектами",description:"То же плюс каталог, где лежат открытые проекты, — то есть и соседний проект тоже. Всё остальное — с разрешения."},{value:"all",title:"Все папки на компьютере",description:"Агент пишет файлы куда угодно на диске — вопросов про место записи не будет.",risky:!0}];function Rk({settings:s,models:l,relayState:i,local:r,onChange:o,onEnableShell:d,onDisableShell:h,onOpenRelay:g,onClose:m}){const b=s===null,x=!b&&s.terminalEnabled===!0,k=!x,_=S.useMemo(()=>{const T=[{value:ih,label:"Как в Claude Code",hint:"модель определят настройки самого Claude Code"},...l.length>0?l.map(L=>({value:L.value,label:L.displayName,hint:L.description})):Sk];return s&&s.startModel!==null&&!T.some(L=>L.value===s.startModel)&&T.push({value:s.startModel,label:s.startModel}),T},[l,s]);function A(){var T,L;return(i==null?void 0:i.paired)!==!0?c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"settings__hint",children:"Компьютер не связан с аккаунтом — включать удалённый доступ пока не к чему: без пары ни телефон, ни другое устройство этот компьютер вообще не видят."}),c.jsx("button",{type:"button",className:"btn",disabled:k,onClick:g,children:"Связать компьютер"})]}):(T=i.shell)!=null&&T.enabled?c.jsxs(c.Fragment,{children:[c.jsxs("p",{className:"settings__hint",children:["Разрешён: с телефона и любого другого устройства этого аккаунта можно открыть терминал и выполнить на этом компьютере что угодно — как если бы сидели за ним.",i.shell.confirmedAt&&` Включено ${new Date(i.shell.confirmedAt).toLocaleString()}.`]}),c.jsx("button",{type:"button",className:"btn btn--danger",disabled:k,onClick:h,children:"Запретить"})]}):(L=i.shell)!=null&&L.pending?c.jsxs(c.Fragment,{children:[c.jsxs("p",{className:"settings__hint",children:["Письмо ушло на ",c.jsx("b",{children:i.shell.email}),". Перейдите по ссылке из него — терминал заработает удалённо."]}),c.jsx("p",{className:"settings__hint",children:"Повторная отправка ограничена раз в минуту — если жали кнопку только что, письмо не придёт и от повторного нажатия тоже. Если сейчас доберётесь до самого компьютера, там разрешение включится сразу, без письма."}),c.jsx("button",{type:"button",className:"btn",disabled:k,onClick:d,children:"Отправить письмо ещё раз"})]}):c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"settings__hint",children:"Сейчас с телефона можно смотреть разговоры и файлы, но не запускать команды. Разрешение даёт полный доступ к терминалу этого компьютера: с телефона станет можно выполнить любую команду, как в обычной консоли за этой машиной."}),r?c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"settings__hint",children:"Включится сразу — вы уже за этим компьютером, подтверждать доступ к нему нечем и незачем."}),c.jsx("button",{type:"button",className:"btn",disabled:k,onClick:d,children:"Разрешить с телефона"})]}):c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"settings__hint",children:"Отсюда мгновенно не включится: на почту аккаунта уйдёт письмо, и терминал заработает только после перехода по ссылке из него."}),c.jsx("button",{type:"button",className:"btn",disabled:k,onClick:d,children:"Прислать письмо"})]})]})}return c.jsx($l,{title:"Настройки",onClose:m,children:c.jsxs("div",{className:"settings",children:[c.jsxs("section",{className:"settings__section",children:[c.jsx("h3",{className:"settings__heading",children:"Архивация молчащих сессий"}),c.jsx("p",{className:"settings__hint",children:"Сессия, к которой долго не возвращались, сама уезжает в архив — на диске ничего не удаляется, транскрипт остаётся, и её можно вернуть обратно в любой момент."}),b?c.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):c.jsx(zs,{className:"settings__select",value:Nk(s.autoArchiveAfterMs),options:wk,onChange:T=>o({autoArchiveAfterMs:Tk(T)}),ariaLabel:"Через сколько молчащая сессия уезжает в архив"})]}),c.jsxs("section",{className:"settings__section",children:[c.jsx("h3",{className:"settings__heading",children:"Автосохранение"}),c.jsx("p",{className:"settings__hint",children:"Открытый файл сам уезжает на диск, если немного постоять без ввода — ручное сохранение, кнопкой или Ctrl+S, при этом всегда работает как обычно, независимо от этой настройки."}),b?c.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):c.jsx(zs,{className:"settings__select",value:Ak(s.autoSaveAfterPauseMs),options:jk,onChange:T=>o({autoSaveAfterPauseMs:Ek(T)}),ariaLabel:"Пауза перед автосохранением открытого файла"})]}),c.jsxs("section",{className:"settings__section",children:[c.jsx("h3",{className:"settings__heading",children:"Старт новой сессии"}),c.jsx("p",{className:"settings__hint",children:"Модель и режим прав, с которыми поднимается новая сессия. Уже открытую это не меняет — у неё свои переключатели в шапке."}),c.jsxs("div",{className:"settings__field",children:[c.jsx("span",{className:"settings__field-label",children:"Модель"}),b?c.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):c.jsx(zs,{className:"settings__select",value:s.startModel??ih,options:_,onChange:T=>o({startModel:T===ih?null:T}),ariaLabel:"Модель, с которой поднимается новая сессия"})]}),c.jsxs("div",{className:"settings__field",children:[c.jsx("span",{className:"settings__field-label",children:"Режим прав при старте"}),b?c.jsx("div",{className:"settings__select-skeleton","aria-hidden":"true",children:"Загрузка…"}):c.jsx(zs,{className:"settings__select",value:s.startPermissionMode,options:kk,onChange:T=>o({startPermissionMode:T}),ariaLabel:"Режим прав, с которым поднимается новая сессия"})]})]}),c.jsxs("section",{className:"settings__section",children:[c.jsx("h3",{className:"settings__heading",children:"Доступ к папкам"}),c.jsx("p",{className:"settings__hint",children:"Это про то, где агент пишет файлы (Write, Edit, NotebookEdit), не спрашивая разрешения, — не про чтение: читает он в любом случае. Ничего не запрещается наглухо — выход за выбранную границу просто превращается в обычный запрос прав, который остаётся подтвердить или отклонить."}),c.jsx("div",{className:"access",role:"radiogroup","aria-label":"Доступ к папкам",children:Ck.map(T=>{const L=!b&&s.folderAccess===T.value;return c.jsxs("button",{type:"button",role:"radio","aria-checked":L,disabled:b,className:"access__card"+(L?" is-on":"")+(T.risky?" access__card--risky":""),onClick:()=>o({folderAccess:T.value}),children:[c.jsx("span",{className:"access__radio","aria-hidden":"true"}),c.jsxs("span",{className:"access__body",children:[c.jsxs("span",{className:"access__title",children:[T.title,T.risky&&c.jsx("span",{className:"access__risk",children:"самое широкое"})]}),c.jsx("span",{className:"access__desc",children:T.description})]})]},T.value)})})]}),c.jsxs("section",{className:"settings__section",children:[c.jsxs("div",{className:"settings__switch-row",children:[c.jsxs("div",{className:"settings__switch-copy",children:[c.jsx("h3",{className:"settings__heading",children:"Терминал"}),c.jsx("p",{className:"settings__hint",children:"Панель терминала под лентой разговора: команда, которую там набрали, выполняется прямо на этом компьютере с правами вашего пользователя — не в песочнице агента, как Bash-инструмент в разговоре. Выключите — и все открытые вкладки терминала закроются, а процессы в них не переживут закрытия."})]}),b?c.jsx("div",{className:"settings__switch-skeleton","aria-hidden":"true"}):c.jsx("button",{type:"button",role:"switch","aria-checked":x,"aria-label":"Терминал",className:x?"switch is-on":"switch",onClick:()=>o({terminalEnabled:!x}),children:c.jsx("span",{className:"switch__knob"})})]}),c.jsxs("div",{className:"settings__nested"+(k?" is-disabled":""),children:[c.jsx("h4",{className:"settings__nested-heading",children:"Удалённый доступ к терминалу"}),b?c.jsx("p",{className:"settings__hint",children:"Загрузка…"}):c.jsxs(c.Fragment,{children:[k&&c.jsx("p",{className:"settings__hint",children:"Сначала включите терминал выше — удалённый доступ выдаётся к тому, что на этой машине уже разрешено, а не поверх выключенного рубильника."}),A()]})]})]})]})})}const Mk=16;function Ok({pane:s,width:l,onResize:i,onReset:r}){const o=yi[s],d=S.useRef(null);function h(x){if(x.button!==0)return;const k=document.querySelector(".main"),_=k?Math.max(0,k.getBoundingClientRect().width-Zx):0;d.current={x:x.clientX,width:l,max:Math.min(o.max,l+_)},x.currentTarget.setPointerCapture(x.pointerId),document.body.classList.add("is-resizing"),x.preventDefault()}function g(x){const k=d.current;if(!k)return;const _=o.side==="left"?x.clientX-k.x:k.x-x.clientX;i(Math.min(k.max,k.width+_))}function m(x){d.current&&(d.current=null,x.currentTarget.hasPointerCapture(x.pointerId)&&x.currentTarget.releasePointerCapture(x.pointerId),document.body.classList.remove("is-resizing"))}function b(x){const k=x.key==="ArrowRight"?1:x.key==="ArrowLeft"?-1:0;k!==0&&(x.preventDefault(),i(l+k*Mk*(o.side==="left"?1:-1)))}return c.jsx("div",{className:`pane-resizer pane-resizer--${s} pane-resizer--${o.side}`,role:"separator","aria-orientation":"vertical","aria-label":`Ширина панели ${o.label}`,"aria-valuenow":l,"aria-valuemin":o.min,"aria-valuemax":o.max,tabIndex:0,title:"Потяните, чтобы изменить ширину; двойной щелчок — ширина по умолчанию",onPointerDown:h,onPointerMove:g,onPointerUp:m,onPointerCancel:m,onDoubleClick:r,onKeyDown:b,children:c.jsx("span",{className:"pane-resizer__line","aria-hidden":"true"})})}const Dk=16;function zk({height:s,onResize:l,onReset:i}){const r=S.useRef(null);function o(){const b=document.querySelector(".main .transcript, .main .editor");if(!b)return 1/0;const x=b.getBoundingClientRect().height-Wx;return Math.round(s+Math.max(0,x))}function d(b){b.button===0&&(r.current={y:b.clientY,height:s,max:o()},b.currentTarget.setPointerCapture(b.pointerId),document.body.classList.add("is-resizing-row"),b.preventDefault())}function h(b){const x=r.current;if(!x)return;const k=x.y-b.clientY;l(x.height+k,x.max)}function g(b){r.current&&(r.current=null,b.currentTarget.hasPointerCapture(b.pointerId)&&b.currentTarget.releasePointerCapture(b.pointerId),document.body.classList.remove("is-resizing-row"))}function m(b){const x=b.key==="ArrowUp"?1:b.key==="ArrowDown"?-1:0;x!==0&&(b.preventDefault(),l(s+x*Dk,o()))}return c.jsx("div",{className:"term-resizer",role:"separator","aria-orientation":"horizontal","aria-label":"Высота панели терминала","aria-valuenow":s,"aria-valuemin":bb,tabIndex:0,title:"Потяните, чтобы изменить высоту; двойной щелчок — высота по умолчанию",onPointerDown:d,onPointerMove:h,onPointerUp:g,onPointerCancel:g,onDoubleClick:i,onKeyDown:m,children:c.jsx("span",{className:"term-resizer__line","aria-hidden":"true"})})}function nb(){const s=document.documentElement,l=getComputedStyle(s),i=q=>l.getPropertyValue(q).trim(),r=i("--surface"),o=i("--text"),d=i("--text-2"),h=i("--muted"),g=i("--accent"),m=i("--accent-fg"),b=i("--select"),x=i("--danger"),k=i("--ok"),_=i("--warn"),A=i("--cm-fn"),T=i("--cm-key"),L=i("--cm-type"),O=lb(o,r,55),F=q=>lb(q,"#ffffff",25);return{background:r,foreground:o,cursor:g,cursorAccent:m,selectionBackground:b,black:O,brightBlack:h,red:x,brightRed:F(x),green:k,brightGreen:F(k),yellow:_,brightYellow:F(_),blue:A,brightBlue:F(A),magenta:T,brightMagenta:F(T),cyan:L,brightCyan:F(L),white:d,brightWhite:o}}function Lk(){return getComputedStyle(document.documentElement).getPropertyValue("--mono").trim()}let pa=null;function Uk(s){return pa||(pa=document.createElement("span"),pa.style.position="fixed",pa.style.width="0",pa.style.height="0",pa.style.opacity="0",pa.style.pointerEvents="none",document.body.appendChild(pa)),pa.style.color=s,getComputedStyle(pa).color}function lb(s,l,i){return Uk(`color-mix(in srgb, ${s} ${100-i}%, ${l} ${i}%)`)}let uo=null;function Hk(){return uo||(uo=Promise.all([Ie(()=>import("./xterm-D6Mng-DB.js").then(s=>s.x),__vite__mapDeps([22,23]),import.meta.url),Ie(()=>import("./addon-fit-CevVMrUA.js").then(s=>s.a),__vite__mapDeps([24,23]),import.meta.url),Ie(()=>import("./addon-web-links-CnB65OV_.js").then(s=>s.a),__vite__mapDeps([25,23]),import.meta.url),Ie(()=>Promise.resolve({}),__vite__mapDeps([26]),import.meta.url)]).then(([s,l,i])=>({Terminal:s.Terminal,FitAddon:l.FitAddon,WebLinksAddon:i.WebLinksAddon})).catch(s=>{throw uo=null,s})),uo}function Bk({terminals:s,activeId:l,blocked:i,height:r,offset:o,mobile:d=!1,onSelect:h,onOpen:g,onClose:m,onInput:b,onResize:x,onAttach:k,onHide:_,registerSink:A}){const[T,L]=S.useState(()=>nb());return S.useEffect(()=>{const O=new MutationObserver(()=>L(nb()));return O.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>O.disconnect()},[]),c.jsxs("div",{className:d?"termpanel termpanel--mobile":"termpanel",style:d?{height:r,top:(o==null?void 0:o.top)??0,left:(o==null?void 0:o.left)??0}:{height:r},children:[c.jsxs("div",{className:"termpanel__tabbar",children:[c.jsx("div",{className:"termpanel__tabs",role:"tablist","aria-label":"Открытые терминалы",children:s.map(O=>c.jsxs("div",{role:"tab","aria-selected":O.id===l,className:"termtab"+(O.id===l?" is-on":"")+(O.exitCode!==null?" termtab--exited":""),children:[c.jsx("button",{className:"termtab__name",title:O.cwd,onClick:()=>h(O.id),children:O.title}),O.exitCode!==null&&c.jsx("span",{className:"termtab__code",title:`Оболочка завершилась с кодом ${O.exitCode}`,children:O.exitCode}),c.jsx("button",{className:"termtab__close",title:"Закрыть терминал","aria-label":`Закрыть терминал «${O.title}»`,onClick:()=>m(O.id),children:"✕"})]},O.id))}),c.jsx("button",{className:"termpanel__add",title:"Новый терминал","aria-label":"Новый терминал",disabled:i,onClick:g,children:"+"}),c.jsx("div",{className:"termpanel__spacer"}),c.jsx("button",{className:"termpanel__hide",title:"Скрыть панель","aria-label":"Скрыть панель терминала",onClick:_,children:"✕"})]}),c.jsxs("div",{className:"termpanel__body",children:[i?c.jsxs("div",{className:"termpanel__empty",children:[c.jsx("p",{children:"Терминал с удалённых устройств выключен"}),c.jsx("p",{className:"termpanel__hint",children:"Откройте «Удалённый доступ» → «Прислать письмо»: на почту аккаунта придёт ссылка, и после перехода по ней терминал заработает прямо здесь. Если сейчас доберётесь до самого компьютера — там разрешение включается сразу, без письма."})]}):s.length===0&&c.jsxs("div",{className:"termpanel__empty",children:[c.jsx("p",{children:"Терминалов не открыто"}),c.jsx("button",{className:"btn btn--primary",onClick:g,children:"Открыть терминал"})]}),s.map(O=>c.jsx(qk,{id:O.id,exitCode:O.exitCode,active:O.id===l,theme:T,mobile:d,onInput:b,onResize:x,onAttach:k,registerSink:A},O.id))]})]})}function qk({id:s,exitCode:l,active:i,theme:r,mobile:o,onInput:d,onResize:h,onAttach:g,registerSink:m}){const b=S.useRef(null),x=S.useRef(null),k=S.useRef(!1),_=S.useRef(o);_.current=o;const A=S.useRef(r),T=S.useRef(l),[L,O]=S.useState("loading"),[F,q]=S.useState(!1);return S.useEffect(()=>{if(!b.current)return;let E=!1,V=null;O("loading"),q(!1);const D=window.setTimeout(()=>{E||q(!0)},200);return(async()=>{let R;try{R=await Hk()}catch{window.clearTimeout(D),E||O("error");return}if(E||!b.current)return;window.clearTimeout(D);const{Terminal:Z,FitAddon:ce,WebLinksAddon:de}=R,K=new Z({fontFamily:Lk()||"monospace",fontSize:13,lineHeight:1.2,cursorBlink:!0,cursorStyle:"bar",scrollback:5e3,theme:A.current}),le=new ce;K.loadAddon(le),K.loadAddon(new de),K.open(b.current),x.current=K,K.attachCustomKeyEventHandler(xe=>{if(xe.type!=="keydown"||!(xe.ctrlKey||xe.metaKey))return!0;if(xe.key==="`")return!1;if(xe.key==="c"||xe.key==="C"){const N=K.getSelection();return N?(navigator.clipboard.writeText(N),!1):!xe.shiftKey}return xe.shiftKey&&(xe.key==="v"||xe.key==="V")?(navigator.clipboard.readText().then(N=>{N&&K.paste(N)}),!1):!0});const me=K.onData(xe=>d(s,xe));let Ae={cols:K.cols,rows:K.rows},ve=null;const z=K.onResize(({cols:xe,rows:Ne})=>{ve!==null&&window.clearTimeout(ve),ve=window.setTimeout(()=>{ve=null,!(xe===Ae.cols&&Ne===Ae.rows)&&(Ae={cols:xe,rows:Ne},h(s,xe,Ne))},100)}),ee=new ResizeObserver(()=>{try{le.fit()}catch{return}_.current&&K.scrollToBottom()});ee.observe(b.current);const P=m(s,xe=>{xe.kind==="buffer"&&K.reset(),K.write(xe.data)});g(s),T.current!==null&&!k.current&&(k.current=!0,K.write(`\r
|
|
123
|
+
\x1B[2m— Процесс завершён (код ${T.current}) —\x1B[0m\r
|
|
124
|
+
`)),i&&K.focus(),V=()=>{ve!==null&&window.clearTimeout(ve),ee.disconnect(),me.dispose(),z.dispose(),P(),K.dispose(),x.current=null},O("ready")})(),()=>{E=!0,window.clearTimeout(D),V==null||V(),V=null}},[s]),S.useEffect(()=>{if(!o)return;const Q=b.current;if(!Q)return;let E=null,V=0,D=!1;const R=K=>{K.pointerType==="mouse"||E!==null||(E=K.pointerId,V=K.clientY,D=!1)},Z=K=>{if(K.pointerId!==E)return;const le=V-K.clientY;if(!D){if(Math.abs(le)<4)return;D=!0,Q.setPointerCapture(K.pointerId)}V=K.clientY;const me=Q.querySelector(".xterm-viewport");me&&(me.scrollTop+=le)},ce=K=>{K.pointerId===E&&(Q.hasPointerCapture(K.pointerId)&&Q.releasePointerCapture(K.pointerId),E=null,D=!1)},de=K=>K.stopPropagation();return Q.addEventListener("pointerdown",R),Q.addEventListener("pointermove",Z),Q.addEventListener("pointerup",ce),Q.addEventListener("pointercancel",ce),Q.addEventListener("touchmove",de,{capture:!0}),()=>{Q.removeEventListener("pointerdown",R),Q.removeEventListener("pointermove",Z),Q.removeEventListener("pointerup",ce),Q.removeEventListener("pointercancel",ce),Q.removeEventListener("touchmove",de,{capture:!0}),E!==null&&Q.hasPointerCapture(E)&&Q.releasePointerCapture(E)}},[o]),S.useEffect(()=>{A.current=r,x.current&&(x.current.options.theme=r)},[r]),S.useEffect(()=>{var Q;i&&((Q=x.current)==null||Q.focus())},[i]),S.useEffect(()=>{if(T.current=l,l===null){k.current=!1;return}if(k.current)return;const Q=x.current;Q&&(k.current=!0,Q.write(`\r
|
|
125
|
+
\x1B[2m— Процесс завершён (код ${l}) —\x1B[0m\r
|
|
126
|
+
`))},[l]),c.jsxs("div",{className:"termview"+(i?" is-active":""),children:[c.jsx("div",{ref:b,className:"termview__surface"+(L==="ready"?"":" is-hidden")}),L==="loading"&&F&&c.jsxs("div",{className:"termview__state work",role:"status",children:[c.jsxs("div",{className:"work__dots",children:[c.jsx("span",{className:"work__dot"}),c.jsx("span",{className:"work__dot"}),c.jsx("span",{className:"work__dot"})]}),c.jsx("span",{className:"work__label",children:"Загружается терминал…"})]}),L==="error"&&c.jsxs("div",{className:"termview__state termview__state--error",role:"alert",children:[c.jsx("p",{children:"Не удалось загрузить терминал"}),c.jsx("p",{className:"termpanel__hint",children:"Соединение оборвалось раньше, чем приехал нужный модуль — на мобильном relay это обычное дело на слабой сети. Ниже — перезагрузка страницы, а не тихий повтор: открытые терминалы и их содержимое приедут обратно с хоста, а вот черновик в поле ввода внизу — нет."}),c.jsx("button",{className:"btn btn--primary",onClick:()=>window.location.reload(),children:"Перезагрузить страницу"})]})]})}const Gk=2e5,Yk=75,Ik=90;function Xk({tokens:s,maxTokens:l,fetchedAt:i}){if(s===null)return null;const r=l??Gk,o=Math.min(100,Math.round(s/r*100)),d=`${s.toLocaleString()} из ${r.toLocaleString()} токенов${i?`
|
|
127
|
+
обновлено в ${new Date(i).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:""}`;return c.jsxs("div",{className:"contextbar","aria-label":`Занято контекста: ${o}%`,title:d,children:[c.jsx("span",{className:"contextbar__label",children:"контекст"}),c.jsx("span",{className:"contextbar__track",role:"progressbar","aria-valuenow":o,"aria-valuemin":0,"aria-valuemax":100,children:c.jsx("span",{className:`contextbar__fill${Vk(o)}`,style:{width:`${o}%`}})}),c.jsxs("span",{className:"contextbar__pct",children:[o,"%"]})]})}function Vk(s){return s>=Ik?" contextbar__fill--over":s>=Yk?" contextbar__fill--warn":""}const s0="ccv:last-session",Qk=300*1e3,$k=1e4;function Zk(){try{const s=localStorage.getItem(s0);if(!s)return null;const l=JSON.parse(s);if(typeof l!="object"||l===null)return null;const{workspaceId:i,sessionId:r,claudeSessionId:o}=l;return typeof i!="string"||typeof r!="string"?null:{workspaceId:i,sessionId:r,claudeSessionId:typeof o=="string"?o:null}}catch{return null}}function Kk(s,l){return s.id===l.sessionId?!0:l.claudeSessionId?s.id===l.claudeSessionId||s.claudeSessionId===l.claudeSessionId:!1}const Jk={mcp:"mcp",plugins:"plugins",plugin:"plugins"},ab=[{name:"login",description:"Войти в аккаунт Claude — окно приложения",argumentHint:"",aliases:["signin","вход"]},{name:"switch-account",description:"Сменить аккаунт: выйти и войти заново",argumentHint:"",aliases:["account","аккаунт"]},{name:"logout",description:"Выйти из аккаунта Claude",argumentHint:"",aliases:["signout","выход"]}],Fk={active:!1,url:"",awaitingCode:!1,output:"",error:null};function sb(s,l,i){if(s===null)return null;const r=s.lastIndexOf("/");if(r===-1&&s!=="")return l;const o=i[r===-1?"":s.slice(0,r)];if(!o)return null;const d=s.slice(r+1).toLowerCase();return d===""?{query:s,entries:o}:{query:s,entries:o.filter(h=>h.name.toLowerCase().includes(d)).sort((h,g)=>ib(h.name,d)-ib(g.name,d))}}function ib(s,l){return s.toLowerCase().startsWith(l)?0:1}function rb(s,l){const i=s.find(o=>o.value===l)??s.find(o=>o.resolvedModel===l),r=l&&!i?l:null;return{rows:[...r?[{value:r,resolvedModel:r,displayName:r,description:"задана в настройках",supportsEffort:!1,effortLevels:[],supportsThinking:!0,supportsAutoMode:!1}]:[],...s],selected:(i==null?void 0:i.value)??r??(s.some(o=>o.value==="default")?"default":"")}}function Wk(){var qr;const s=S.useRef(null),[l,i]=S.useState(!1),[r,o]=S.useState("Нет связи с хостом"),[d,h]=S.useState(null),[g,m]=S.useState(!1),b=S.useMemo(()=>ho()==="relay",[]),[x,k]=S.useState([]),[_,A]=S.useState([]),[T,L]=S.useState([]),[O,F]=S.useState([]),[q,Q]=S.useState(null),[E,V]=S.useState(null),[D,R]=S.useState(null),[Z,ce]=S.useState(ll),[de,K]=S.useState(Yd),[le,me]=S.useState(!1),[Ae,ve]=S.useState(!1),z=xb("(max-width: 860px)"),[ee,P]=S.useState(!1);S.useEffect(()=>{z||P(!1)},[z]);const[xe,Ne]=S.useState(!1),[N,I]=S.useState([]),[ie,re]=S.useState(!1),[_e,Te]=S.useState(ll),[Me,et]=S.useState(null),[Ze,at]=S.useState(null),[qe,Nt]=S.useState([]),[$e,oe]=S.useState(null),[ye,tt]=S.useState(null),[Ft,Ue]=S.useState([]),[un,mn]=S.useState([]),[Sn,Qn]=S.useState([]),[kn,bt]=S.useState([]),[Cn,J]=S.useState(null),[fe,Re]=S.useState(!1),[Ke,Lt]=S.useState(null),[Wt,Un]=S.useState(null),[sl,Xt]=S.useState(!1),[Hn,jt]=S.useState(Fk),[Rn,$]=S.useState(null),[he,rt]=S.useState(null),[ht,gn]=S.useState(!1),[il,,va]=Qx(),Bn=Fx(),[$n,on]=S.useState(!1),[Ut,vl]=S.useState(null),[Sa,ka]=S.useState(null),[Us,zl]=S.useState(null),[Ka,Ll]=S.useState(null),[wa,rl]=S.useState(null),[Vt,Et]=S.useState(!1),[Be,fn]=S.useState({}),[Kl,Ta]=S.useState([""]),[Ul,qn]=S.useState([]),[cl,ul]=S.useState(null),[Jl,Mn]=S.useState(null),[ol,Pt]=S.useState(null),[pt,Gn]=S.useState(null),[vi,Yn]=S.useState(null),[fl,Hs]=S.useState({}),[Fl,Wl]=S.useState({}),[Hl,In]=S.useState(!1),[dl,dn]=S.useState(null),[xt,Ja]=S.useState(null),Si=S.useRef(0),Bl=S.useRef(null),[Pl,ea]=S.useState(!1),[Na,en]=S.useState([]),[Bs,ta]=S.useState(null),hl=Px(),Zn=t_(z&&Pl),ue=S.useRef(new Map),w=(Wt==null?void 0:Wt.terminalEnabled)===!0,U=ho()==="relay"&&((qr=d==null?void 0:d.shell)==null?void 0:qr.enabled)!==!0,ae=S.useRef(!1),Se=S.useCallback((y,Y)=>(ue.current.set(y,Y),()=>{ue.current.get(y)===Y&&ue.current.delete(y)}),[]),[Ce,ze]=S.useState(!1),[wt,qt]=S.useState(null),[hn,mt]=S.useState(ll),[At,Ht]=S.useState(null),[Sl,Kn]=S.useState({}),Fa=S.useRef([]),[Sr]=S.useState(Zk),kr=S.useRef(Sr),na=S.useRef(!1),Ct=S.useRef(null),yn=S.useRef(null),Wa=S.useRef(0);Ct.current=E,yn.current=q,Wa.current=Z.lastSeq;const bn=S.useRef(null),ki=S.useRef(0);ki.current=hn.lastSeq;const ja=S.useRef(null),qs=S.useRef(""),la=S.useRef(null),kl=S.useRef([]),wr=S.useRef([""]);kl.current=Ul,wr.current=Kl;const tn=S.useRef(new Map),wl=S.useRef(new Set),aa=S.useRef(null),ql=S.useRef(null),Lc=S.useRef(0);S.useEffect(()=>{const y=Yx();if(!y)return;s.current=y;const Y=()=>{i(y.connected),o(y.statusText)};y.onStatus(Y),y.onReconnect(()=>{Y();const Zt=Ct.current;Zt&&y.send({type:"session.sync",sessionId:Zt,sinceSeq:Wa.current});const On=bn.current;On&&y.send({type:"session.sync",sessionId:On,sinceSeq:ki.current})});const pe=y.on(Zt=>Tr(Zt));y.connect();const Ve=window.setInterval(()=>{Y(),y.connected&&y.send({type:"ping",nonce:Date.now()})},15e3);return()=>{pe(),window.clearInterval(Ve),y.close()}},[]);const Tr=S.useCallback(y=>{var Y,pe,Ve,Zt,On,Fn;switch(y.type){case"hello.ok":i(!0);break;case"workspace.list":{k(y.workspaces),Q(Ge=>{var Gl;if(Ge)return Ge;const nt=kr.current,Yt=nt&&y.workspaces.find(as=>as.id===nt.workspaceId);return(Yt==null?void 0:Yt.id)??((Gl=y.workspaces[0])==null?void 0:Gl.id)??null});const Ee=la.current;if(!Ee)break;const Oe=y.workspaces.find(Ge=>nw(Ge.path,Ee));if(!Oe)break;la.current=null,Ne(!1),Q(Oe.id);break}case"workspace.candidates":if(y.query.trim()!==qs.current)break;I(y.candidates),y.source==="host"&&re(!1);break;case"finder.opened":ja.current=y.sessionId;break;case"workspace.roots":Nt(y.roots);break;case"workspace.created":if(Q(y.workspace.id),y.warnings.length===0){Ne(!1),at(null);break}oe({path:y.workspace.path,warnings:y.warnings});break;case"session.list":if(y.workspaceId!==yn.current)break;A(y.sessions),L(y.archived);break;case"session.pinned":F(y.sessions);break;case"session.summary":if(y.session.id===ja.current){et(y.session);break}if(y.session.parentSessionId){y.session.id===bn.current&&Ht(y.session);break}A(Ee=>{const Oe=Ee.findIndex(nt=>nt.id===y.session.id);if(Oe===-1)return[y.session,...Ee];const Ge=Ee.slice();return Ge[Oe]=y.session,Ge}),F(Ee=>{const Oe=Ee.findIndex(nt=>nt.id===y.session.id);if(Oe===-1)return Ee;const Ge=Ee.slice();return Ge[Oe]={...y.session,pinned:!0,...Ee[Oe].pinnedAt?{pinnedAt:Ee[Oe].pinnedAt}:{}},Ge}),V(Ee=>Ee??y.session.id);break;case"usage.state":y.sessionId===Ct.current&&($(y.usage),gn(!1));break;case"context.state":y.sessionId===Ct.current&&(rt(y.context),gn(!1));break;case"session.capabilities":y.sessionId===Ct.current&&R(y.capabilities);break;case"session.events":if(y.sessionId===bn.current){mt(Ee=>po(Ee,y.entries));break}if(y.sessionId===ja.current){Te(Ee=>po(Ee,y.entries));break}if(y.sessionId!==Ct.current)break;ce(Ee=>po(Ee,y.entries));break;case"session.history":if(y.sessionId!==Ct.current)break;K(Ee=>Ix(Ee,y));break;case"side.opened":{if(y.parentSessionId!==Ct.current)break;bn.current=y.sessionId,qt(y.sessionId);const Ee=Fa.current;Fa.current=[];for(const Oe of Ee)Oe(y.sessionId);break}case"side.closed":if(y.parentSessionId!==Ct.current)break;bn.current=null,qt(null),mt(ll),Ht(null);break;case"git.state":if(y.workspaceId!==yn.current)break;vl(y.state);break;case"git.commit":if(y.workspaceId!==yn.current)break;ka(y.detail);break;case"git.result":if(y.workspaceId!==yn.current)break;Ll({ok:y.ok,message:y.message}),y.ok&&(ka(null),zl(null));break;case"fs.dir":if(y.workspaceId!==yn.current)break;fn(Ee=>({...Ee,[y.path]:y.entries}));break;case"fs.search":if(y.workspaceId!==yn.current)break;if(y.scope!=="tree"){const Ee=y.scope;Wl(Oe=>({...Oe,[Ee]:{query:y.query,entries:y.entries}}));break}Yn({query:y.query,entries:y.entries,truncated:y.truncated});break;case"fs.grep":if(y.workspaceId!==yn.current)break;dn({query:y.query,matches:y.matches,truncated:y.truncated});break;case"fs.file":{if(y.workspaceId!==yn.current)break;const Ee=wl.current.delete(y.file.path);qn(Ge=>{const nt=Ge.findIndex(as=>as.path===y.file.path);if(nt===-1)return[...Ge,zy(y.file,++Lc.current)];const Yt=Ge[nt],Gl=Ge.slice();return Gl[nt]=Yt.saved===y.file.content&&!Qa(Yt)?{...Yt,mtime:y.file.mtime,size:y.file.size,stale:!1}:zy(y.file,++Lc.current),Gl}),Ee&&ul(y.file.path);const Oe=Bl.current;Oe&&Oe.path===y.file.path&&(Bl.current=null,Ja({...Oe,token:++Si.current}));break}case"fs.saved":{if(y.workspaceId!==yn.current)break;const Ee=tn.current.get(y.path);tn.current.delete(y.path);const Oe=Ee!==void 0;qn(nt=>nt.map(Yt=>Yt.path!==y.path?Yt:Oe?{...Yt,saved:Ee,mtime:y.mtime,size:y.size,stale:!1}:{...Yt,stale:!0}));const Ge=kl.current.find(nt=>nt.path===y.path);!Oe&&Ge&&!Qa(Ge)&&((Y=s.current)==null||Y.send({type:"fs.read",workspaceId:y.workspaceId,path:y.path})),(pe=s.current)==null||pe.send({type:"git.state",workspaceId:y.workspaceId});break}case"fs.result":{if(y.workspaceId!==yn.current)break;if(Mn({ok:y.ok,message:y.message}),y.ok||tn.current.delete(y.path),y.conflict&&qn(Oe=>Oe.map(Ge=>Ge.path===y.path?{...Ge,stale:!0}:Ge)),ql.current===y.path){const Oe=ql.current;ql.current=null,y.ok&&(wl.current.add(Oe),(Ve=s.current)==null||Ve.send({type:"fs.read",workspaceId:y.workspaceId,path:Oe}))}const Ee=aa.current;if(y.ok&&Ee&&Ee.to===y.path){aa.current=null;const Oe=Ge=>Ge===Ee.from?Ee.to:Ge.startsWith(`${Ee.from}/`)?Ee.to+Ge.slice(Ee.from.length):Ge;qn(Ge=>Ge.map(nt=>({...nt,path:Oe(nt.path)}))),ul(Ge=>Ge===null?null:Oe(Ge)),Ta(Ge=>Ge.map(Oe)),fn(Ge=>{const nt={};for(const[Yt,Gl]of Object.entries(Ge))Yt===Ee.from||Yt.startsWith(`${Ee.from}/`)||(nt[Yt]=Gl);return nt})}y.ok&&((Zt=s.current)==null||Zt.send({type:"git.state",workspaceId:y.workspaceId}));break}case"term.list":if(y.workspaceId!==yn.current)break;en(y.terminals);break;case"term.opened":if(y.terminal.workspaceId!==yn.current)break;en(Ee=>{const Oe=Ee.findIndex(nt=>nt.id===y.terminal.id);if(Oe===-1)return[...Ee,y.terminal];const Ge=Ee.slice();return Ge[Oe]=y.terminal,Ge}),ae.current&&(ae.current=!1,ta(y.terminal.id));break;case"term.buffer":(On=ue.current.get(y.id))==null||On({kind:"buffer",data:y.data});break;case"term.data":(Fn=ue.current.get(y.id))==null||Fn({kind:"data",data:y.data});break;case"term.exit":en(Ee=>Ee.map(Oe=>Oe.id===y.id?{...Oe,exitCode:y.exitCode}:Oe));break;case"term.closed":en(Ee=>Ee.filter(Oe=>Oe.id!==y.id));break;case"mcp.list":y.sessionId===Ct.current&&Ue(y.servers);break;case"plugin.list":if(y.sessionId!==Ct.current)break;mn(y.plugins),Qn(y.marketplaces),bt(y.catalog);break;case"operation.result":y.sessionId===Ct.current&&J(y.result);break;case"auth.status":Lt(y.status);break;case"relay.state":h(y.state);break;case"settings.state":Un(y.settings);break;case"auth.login":jt(y.state),y.state.active&&Re(!0);break;case"session.closed":A(Ee=>Ee.map(Oe=>Oe.id===y.sessionId?{...Oe,state:"closed"}:Oe));break;case"error":console.error("[host]",y.message,y.context??""),(y.context==="workspace.open"||y.context==="workspace.create")&&(la.current=null,at(y.message));break}},[]),se=S.useCallback(y=>{var Y;(Y=s.current)==null||Y.send(y)},[]);S.useEffect(()=>{q&&se({type:"session.list",workspaceId:q})},[q,se]),S.useEffect(()=>{l&&se({type:"session.pins"})},[l,se]),S.useEffect(()=>{l&&se({type:"settings.get"})},[l,se]),S.useEffect(()=>{if(na.current)return;const y=kr.current;if(!y||!q)return;if(q!==y.workspaceId){na.current=!0;return}if(E){na.current=!0;return}if(_.length===0)return;const Y=_.find(pe=>Kk(pe,y));na.current=!0,Y&&jr(Y)},[_,q,E]),S.useEffect(()=>{!q||U||!w||se({type:"term.list",workspaceId:q})},[q,U,w,se]),S.useEffect(()=>{ta(y=>{var Y;return y&&Na.some(pe=>pe.id===y)?y:((Y=Na[0])==null?void 0:Y.id)??null})},[Na]),S.useEffect(()=>{xe&&se({type:"workspace.roots"})},[xe,se]);const Tl=S.useCallback(()=>{const y=Ct.current;y&&(gn(!0),se({type:"usage.get",sessionId:y}),se({type:"context.get",sessionId:y}))},[se]);S.useEffect(()=>{if(!ht)return;const y=window.setTimeout(()=>gn(!1),$k);return()=>window.clearTimeout(y)},[ht]);const Pa=S.useMemo(()=>{const y=Math.max((Rn==null?void 0:Rn.fetchedAt)??0,(he==null?void 0:he.fetchedAt)??0);return y>0?y:null},[Rn==null?void 0:Rn.fetchedAt,he==null?void 0:he.fetchedAt]),Uc="Обновить лимиты и контекст"+(Pa?`
|
|
128
|
+
обновлено в ${new Date(Pa).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:"");S.useEffect(()=>{if(rt(null),!E)return;Tl();const y=()=>{document.hidden||Tl()},Y=window.setInterval(y,Qk),pe=()=>{document.hidden||Tl()};return document.addEventListener("visibilitychange",pe),()=>{window.clearInterval(Y),document.removeEventListener("visibilitychange",pe)}},[E,Tl]),S.useEffect(()=>{if(!E){K(Yd);return}K({...Yd,loading:!0}),se({type:"session.history",sessionId:E})},[E,se]);const jo=S.useCallback(()=>{!E||de.loading||!Fg(de)||(K(y=>({...y,loading:!0})),se({type:"session.history",sessionId:E,before:pb(de)}))},[E,de,se]),Eo=S.useMemo(()=>Xx(de.entries),[de.entries]),ke=S.useMemo(()=>_.find(y=>y.id===E)??null,[_,E]),Gs=x.find(y=>y.id===q)??null;S.useEffect(()=>{if(!q||!E)return;const y={workspaceId:q,sessionId:E,claudeSessionId:(ke==null?void 0:ke.claudeSessionId)??null};try{localStorage.setItem(s0,JSON.stringify(y))}catch{}},[q,E,ke==null?void 0:ke.claudeSessionId]);function Ao(y){la.current=y,at(null),se({type:"workspace.open",path:y})}function Co(y,Y,pe){at(null),se({type:"workspace.create",parent:y,name:Y,init:pe})}function Ro(y){if(qs.current=y,!y){I([]),re(!1);return}re(!0),se({type:"workspace.find",query:y})}function Mo(y){qs.current=y,Te(ll),se({type:"workspace.find.agent",query:y})}function Oo(){Ne(!1),at(null),oe(null),I([]),Te(ll),et(null),qs.current="",la.current=null}function es(){const y=Ct.current;y&&bn.current&&se({type:"side.reset",sessionId:y}),bn.current=null,qt(null),mt(ll),Ht(null),Kn({}),Fa.current=[]}function Do(y){se({type:"workspace.close",workspaceIds:y}),!(!q||!y.includes(q))&&(es(),Q(null),V(null),A([]),L([]),ce(ll),R(null),ve(!1))}function zo(y,Y){se({type:"session.archive",workspaceId:y,sessionIds:Y}),E&&(Y.includes(E)||ke!=null&&ke.claudeSessionId&&Y.includes(ke.claudeSessionId))&&(es(),V(null),ce(ll),R(null),ve(!1))}function Lo(){q&&(es(),V(null),R(null),ce(ll),ve(!1),se({type:"session.start",workspaceId:q}),me(!1))}function Hc(y){es(),Dr(),Q(y),V(null),ce(ll),R(null),ve(!1),vl(null),ka(null),zl(null),Ll(null),en([]),ta(null)}function Nr(y,Y,pe){se({type:"session.pin",workspaceId:y,sessionIds:Y,pinned:pe})}function Uo(y){y.workspaceId!==q&&Hc(y.workspaceId),jr(y)}function jr(y){if(me(!1),es(),ce(ll),R(null),ve(!1),y.state==="closed"){V(null),se({type:"session.start",workspaceId:y.workspaceId,resume:y.id});return}V(y.id),se({type:"session.sync",sessionId:y.id,sinceSeq:0})}function Bc(y,Y){se({type:"session.rename",sessionId:y.id,title:Y,workspaceId:y.workspaceId}),A(pe=>pe.map(Ve=>Ve.id===y.id?{...Ve,title:Y}:Ve))}function Er(y){E&&(me(!1),J(null),tt(y),se({type:"mcp.list",sessionId:E}),se({type:"plugin.list",sessionId:E}))}const Ho={mcpAction:(y,Y)=>{E&&(se({type:"mcp.action",sessionId:E,name:y,action:Y}),tt(null))},mcpAdd:(y,Y)=>{E&&se({type:"mcp.add",sessionId:E,name:y,draft:Y})},mcpRemove:y=>{E&&se({type:"mcp.remove",sessionId:E,name:y})},pluginInstall:y=>{E&&se({type:"plugin.install",sessionId:E,spec:y})},pluginUninstall:y=>{E&&se({type:"plugin.uninstall",sessionId:E,id:y})},pluginToggle:(y,Y)=>{E&&se({type:"plugin.toggle",sessionId:E,id:y,enabled:Y})},marketplaceAdd:y=>{E&&se({type:"marketplace.add",sessionId:E,source:y})},marketplaceRemove:y=>{E&&se({type:"marketplace.remove",sessionId:E,name:y})}};function qc(){me(!1),Re(!0),se({type:"auth.status"})}const Ar={login:(y,Y)=>se({type:"auth.login",mode:y,switchAccount:Y}),submitCode:y=>se({type:"auth.code",code:y}),cancel:()=>se({type:"auth.cancel"}),logout:()=>se({type:"auth.logout"})};function Bo(){me(!1),Xt(!0),se({type:"settings.get"})}function qo(y){Un(Y=>Y&&{...Y,...y}),se({type:"settings.update",settings:y})}function Go(y){E&&se({type:"side.ask",sessionId:E,text:y})}function Yo(){E&&(se({type:"side.reset",sessionId:E}),bn.current=null,qt(null),mt(ll),Ht(null),Kn({}),Fa.current=[])}function Ys(y){const Y=bn.current;if(Y){y(Y);return}const pe=Ct.current;pe&&(Fa.current.push(y),se({type:"side.open",sessionId:pe}))}function Gc(){q&&se({type:"git.state",workspaceId:q})}function Cr(y){q&&(zl(y),se({type:"git.show",workspaceId:q,ref:y}))}function ts(y,Y){Ll(null),rl({target:y,label:Y})}function Io(){!q||!wa||(se({type:"git.checkout",workspaceId:q,target:wa.target}),rl(null))}S.useEffect(()=>{if(!(!Vt||!q))for(const y of Kl)y in Be||se({type:"fs.list",workspaceId:q,path:y})},[Vt,Kl,Be,q,se]);function Yc(y){Ta(Y=>Y.includes(y)?Y.filter(pe=>pe!==y):[...Y,y])}function Ic(y){if(!y){Yn(null);return}q&&se({type:"fs.search",workspaceId:q,query:y})}function Xc(y){if(!y){dn(null);return}q&&se({type:"fs.grep",workspaceId:q,query:y})}const Rr=S.useCallback((y,Y)=>{Hs(Zt=>({...Zt,[y]:Y}));const pe=yn.current;if(Y===null||!pe)return;const Ve=Y.lastIndexOf("/");if(Ve!==-1){se({type:"fs.list",workspaceId:pe,path:Y.slice(0,Ve)});return}if(Y===""){se({type:"fs.list",workspaceId:pe,path:""});return}se({type:"fs.search",workspaceId:pe,query:Y,scope:y})},[se]),Vc=S.useMemo(()=>sb(fl.mention??null,Fl.mention??null,Be),[fl.mention,Fl.mention,Be]),ns=S.useMemo(()=>sb(fl.side??null,Fl.side??null,Be),[fl.side,Fl.side,Be]);function Xo(y){Mr(y.path,{line:y.line,column:y.column})}function Vo(y){const Y=[];let pe=or(y.path);for(;Y.push(pe),!!pe;)pe=or(pe);Ta(Ve=>{const Zt=new Set(Ve);for(const On of Y)Zt.add(On);return y.kind==="dir"&&Zt.add(y.path),[...Zt]}),y.kind==="file"&&Mr(y.path)}function Mr(y,Y){if(kl.current.find(Ve=>Ve.path===y)){ul(y),Y&&Ja({path:y,...Y,token:++Si.current});return}q&&(Y&&(Bl.current={path:y,...Y}),wl.current.add(y),se({type:"fs.read",workspaceId:q,path:y}))}function wi(y,Y=!1){const pe=kl.current,Ve=pe.find(Fn=>Fn.path===y);if(Ve&&Qa(Ve)&&!Y){Gn(y);return}Gn(null);const Zt=pe.findIndex(Fn=>Fn.path===y),On=pe.filter(Fn=>Fn.path!==y);qn(On),ul(Fn=>{var Ee;return Fn===y?((Ee=On[Math.min(Zt,On.length-1)])==null?void 0:Ee.path)??null:Fn})}function Is(y,Y=!1){const pe=kl.current.find(Ve=>Ve.path===y);!pe||!q||!Y&&!Qa(pe)||(tn.current.set(y,pe.text),se({type:"fs.write",workspaceId:q,path:y,content:pe.text,eol:pe.eol,baseMtime:pe.mtime,...Y?{force:!0}:{}}))}function Xs(y){q&&se({type:"fs.read",workspaceId:q,path:y})}const Vs=S.useRef(new Map);function Qo(y){const Y=Vs.current,pe=Y.get(y);pe&&clearTimeout(pe);const Ve=(Wt==null?void 0:Wt.autoSaveAfterPauseMs)??0;Ve<=0||Y.set(y,setTimeout(()=>{Y.delete(y);const Zt=kl.current.find(On=>On.path===y);Zt&&Qa(Zt)&&!Zt.stale&&Is(y)},Ve))}function Ti(y,Y,pe){if(!q)return;const Ve=y?`${y}/${pe}`:pe;Mn(null),Y==="file"&&(ql.current=Ve),se({type:"fs.create",workspaceId:q,path:Ve,kind:Y})}function Qc(y,Y){if(!q)return;const pe=or(y),Ve=pe?`${pe}/${Y}`:Y;Mn(null),aa.current={from:y,to:Ve},se({type:"fs.rename",workspaceId:q,path:y,to:Ve})}function $c(y,Y){if(!q)return;const pe=y.slice(y.lastIndexOf("/")+1),Ve=Y?`${Y}/${pe}`:pe;Ve!==y&&(Mn(null),aa.current={from:y,to:Ve},se({type:"fs.rename",workspaceId:q,path:y,to:Ve}))}function Or(y){q&&(Mn(null),Pt(null),se({type:"fs.delete",workspaceId:q,path:y.path}),qn(Y=>Y.filter(pe=>pe.path!==y.path&&!pe.path.startsWith(`${y.path}/`))),ul(Y=>Y&&(Y===y.path||Y.startsWith(`${y.path}/`))?null:Y))}function Dr(){fn({}),Ta([""]),qn([]),ul(null),Mn(null),Yn(null),dn(null),Hs({}),Wl({}),Ja(null),wl.current.clear(),tn.current.clear(),Bl.current=null,aa.current=null,ql.current=null}function Zc(){!q||U||!w||(ae.current=!0,se({type:"term.open",workspaceId:q,cols:80,rows:24}))}function Kc(y){se({type:"term.close",id:y})}function Jc(y,Y){E&&se({type:"permission.respond",sessionId:E,requestId:y,decision:Y})}function $o(y,Y){E&&se({type:"permission.respond",sessionId:E,requestId:y,decision:"allow",answers:Y})}function Zo(y){E&&se({type:"permission.respond",sessionId:E,requestId:y,decision:"deny",reason:"Пользователь не стал отвечать на вопросы"})}S.useEffect(()=>{function y(Y){if(Y.key!=="Escape"||!E||Z.pending.length>0)return;const pe=Y.target;pe instanceof HTMLElement&&pe.closest(".sidepane, .editor")||se({type:"control.interrupt",sessionId:E})}return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[E,Z.pending.length,se]),S.useEffect(()=>{function y(Y){Y.key!=="`"||!(Y.ctrlKey||Y.metaKey)||w&&(Y.preventDefault(),ea(pe=>!pe))}return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[w]);const Fc=S.useMemo(()=>{const y=(D==null?void 0:D.commands)??[];return y.length===0?y:[...y,{name:"plugins",description:"Плагины и маркетплейсы — окно приложения",argumentHint:"",aliases:["plugin"]},...ab]},[D]);function Wc(y){const Y=Jk[y];return Y?(Er(Y),!0):ab.some(pe=>pe.name===y)?(qc(),y==="logout"&&Ar.logout(),y==="switch-account"&&Ar.login("claudeai",!0),!0):!1}const Ni=(ke==null?void 0:ke.state)==="waiting_permission",Gt=(ke==null?void 0:ke.state)==="running"||Ni,Jn=Z.pending[0]??null;S.useEffect(()=>{!$n&&!Vt||!q||Gt||se({type:"git.state",workspaceId:q})},[$n,Vt,q,Gt,se]),S.useEffect(()=>{if(!(Gt||!q)){Vt&&fn(y=>{const Y={};for(const[pe,Ve]of Object.entries(y))wr.current.includes(pe)||(Y[pe]=Ve);return Y});for(const y of kl.current)Qa(y)||se({type:"fs.read",workspaceId:q,path:y.path})}},[Gt,q,Vt,se]);const ji=(ke==null?void 0:ke.cwd)??(D==null?void 0:D.cwd)??null,zr=(D==null?void 0:D.models)??[],Qs=(ke==null?void 0:ke.model)??(D==null?void 0:D.model)??null,{rows:Lr,selected:Ur}=rb(zr,Qs),$s=At?{model:At.model,effort:At.effort,ultracode:At.ultracode,thinking:At.thinking,switchOnFlag:At.switchModelsOnFlag}:{model:Sl.model??Qs,effort:Sl.effort??(ke==null?void 0:ke.effort)??null,ultracode:Sl.ultracode??(ke==null?void 0:ke.ultracode)??!1,thinking:Sl.thinking??(ke==null?void 0:ke.thinking)??!0,switchOnFlag:Sl.switchOnFlag??(ke==null?void 0:ke.switchModelsOnFlag)??!0},Ea=rb(zr,$s.model),Hr=(At==null?void 0:At.state)==="running",Aa=cl?Ul.find(y=>y.path===cl)??null:null,Br=new Set(Ul.filter(Qa).map(y=>y.path)),ls=y=>c.jsx(Ok,{pane:y,width:Bn.widths[y],onResize:Y=>Bn.setWidth(y,Y),onReset:()=>Bn.reset(y)}),sa=D&&c.jsx(zs,{title:"Режим прав",value:(ke==null?void 0:ke.permissionMode)??"default",options:mb.map(y=>({value:y.value,label:y.value,hint:y.hint})),onChange:y=>{E&&se({type:"control.set_mode",sessionId:E,mode:y})}}),Ca=Lr.length>0?c.jsx(Wb,{models:Lr,value:Ur,effort:(ke==null?void 0:ke.effort)??null,ultracode:(ke==null?void 0:ke.ultracode)??!1,thinking:(ke==null?void 0:ke.thinking)??!0,switchOnFlag:(ke==null?void 0:ke.switchModelsOnFlag)??!0,onModel:y=>{!E||!y||se({type:"control.set_model",sessionId:E,model:y})},onEffort:y=>{E&&se({type:"control.set_effort",sessionId:E,effort:y})},onUltracode:y=>{E&&se({type:"control.set_ultracode",sessionId:E,enabled:y})},onThinking:y=>{E&&se({type:"control.set_thinking",sessionId:E,enabled:y})},onSwitchOnFlag:y=>{E&&se({type:"control.set_flag_switch",sessionId:E,enabled:y})}}):Qs&&c.jsx("span",{className:"badge",children:Qs}),Ei=Gt&&c.jsx("span",{className:Ni?"badge badge--wait":"badge badge--live",children:Ni?"ждёт":"работает"}),Ai=ke&&ke.totalCostUsd>0?`$${ke.totalCostUsd.toFixed(3)}`:null,ia=c.jsx("button",{className:Ce?"pane-btn is-on":"pane-btn",title:"Вопрос на полях — спросить, не мешая работе","aria-label":"Вопрос на полях","aria-pressed":Ce,onClick:()=>ze(y=>!y),children:c.jsx(aw,{})});return c.jsxs("div",{className:"app",style:Bn.style,children:[c.jsx(j1,{open:le,connected:l,status:r,workspaces:x,sessions:_.filter(y=>y.workspaceId===q),archived:T.filter(y=>y.workspaceId===q),pinned:O,activeWorkspaceId:q,activeSessionId:E,onPinSessions:Nr,onSelectPinned:Uo,onCloseWorkspaces:Do,onArchiveSessions:zo,onUnarchiveSessions:y=>{q&&se({type:"session.unarchive",workspaceId:q,sessionIds:y})},onSelectWorkspace:Hc,onSelectSession:jr,onRenameSession:Bc,onOpenWorkspace:()=>Ne(!0),onNewSession:Lo,onOpenExtensions:E?()=>Er("mcp"):null,account:Ke,onOpenAccount:qc,relay:d,onOpenRelay:b?null:()=>m(!0),onOpenSettings:Bo,themeMode:il,onCycleTheme:va}),ls("sidebar"),le&&c.jsx("div",{className:"scrim",onClick:()=>me(!1)}),c.jsx(i1,{open:Vt,tree:Be,expanded:new Set(Kl),activePath:cl,dirty:Br,gitChanges:(Ut==null?void 0:Ut.changed)??[],result:Jl,searchResult:vi,onSearch:Ic,onReveal:Vo,onToggle:Yc,onOpen:Mr,onCreate:Ti,onRename:Qc,onMove:$c,onDelete:Pt,onRefresh:()=>{Mn(null),fn({}),Gc()},onClose:()=>Et(!1)}),Vt&&ls("files"),c.jsx(y1,{open:Hl,result:dl,onSearch:Xc,onOpenMatch:Xo,onClose:()=>In(!1)}),Hl&&ls("search"),c.jsx(GS,{open:$n,state:Ut,result:Ka,selected:Us,onRefresh:Gc,onShow:Cr,onCheckout:ts,onClose:()=>on(!1)}),$n&&ls("git"),c.jsxs("main",{className:"main",children:[c.jsxs("header",{className:"topbar",children:[c.jsx("button",{className:"btn btn--ghost menu-btn",onClick:()=>me(!0),children:"☰"}),c.jsx("button",{className:Vt?"pane-btn is-on":"pane-btn",title:"Файлы проекта","aria-label":"Файлы проекта","aria-pressed":Vt,onClick:()=>{Et(y=>!y),on(!1),In(!1)},children:c.jsx(Pk,{})}),c.jsx("button",{className:Hl?"pane-btn is-on":"pane-btn",title:"Поиск по тексту в проекте","aria-label":"Поиск по тексту в проекте","aria-pressed":Hl,onClick:()=>{In(y=>!y),Et(!1),on(!1)},children:c.jsx(ew,{})}),c.jsx("button",{className:$n?"pane-btn is-on":"pane-btn",title:"История git","aria-label":"История git","aria-pressed":$n,onClick:()=>{on(y=>!y),Et(!1),In(!1)},children:c.jsx(tw,{})}),w&&c.jsx("button",{className:Pl?"pane-btn is-on":"pane-btn",title:"Терминал (Ctrl+`)","aria-label":"Терминал","aria-pressed":Pl,onClick:()=>ea(y=>!y),children:c.jsx(lw,{})}),z&&ia,z&&c.jsx("button",{className:ee?"pane-btn is-on":"pane-btn",title:"Ещё","aria-label":"Ещё","aria-haspopup":"menu","aria-pressed":ee,onClick:()=>P(!0),children:c.jsx(sw,{})}),c.jsxs("div",{className:"topbar__id",children:[Ae&&ke?c.jsx(Mc,{className:"rename--title",value:ke.title??"",onCommit:y=>{Bc(ke,y),ve(!1)},onCancel:()=>ve(!1)}):c.jsxs("div",{className:"topbar__head",children:[c.jsx("button",{className:"topbar__title",disabled:!ke||z,title:ke&&!z?"Переименовать сессию":void 0,onClick:()=>ve(!0),children:(ke==null?void 0:ke.title)??"Claude Code Visual"}),Gs&&c.jsx("span",{className:"topbar__project",title:Gs.path,children:Gs.name})]}),z?Ei:ji&&c.jsx(Fb,{path:ji})]}),!z&&c.jsxs("div",{className:"topbar__tools",children:[c.jsx("button",{type:"button",className:ht?"meters-refresh is-busy":"meters-refresh",title:Uc,"aria-label":"Обновить лимиты и контекст","aria-busy":ht,disabled:!E||ht,onClick:Tl,children:c.jsx(iw,{})}),c.jsx(e0,{usage:Rn}),c.jsx(a0,{}),sa,Ca,Ei,Ai&&c.jsx("span",{className:"badge badge--cost",children:Ai}),ia]})]}),c.jsx(Xk,{tokens:(he==null?void 0:he.tokens)??Z.contextTokens,maxTokens:(he==null?void 0:he.maxTokens)??null,fetchedAt:(he==null?void 0:he.fetchedAt)??null}),z&&ee&&c.jsx(rk,{onClose:()=>P(!1),permission:sa,model:Ca,usage:Rn,cwd:ji,costLabel:Ai,onRefresh:Tl,refreshing:ht,metersFetchedAt:Pa,onRename:ke?()=>{ve(!0),P(!1)}:null}),Ul.length>0&&c.jsx(T1,{files:Ul,activePath:cl,busy:Gt,onSelect:ul,onClose:y=>wi(y)}),Aa?c.jsx(k1,{file:Aa,goto:(xt==null?void 0:xt.path)===Aa.path?xt:null,onChange:(y,Y)=>{qn(pe=>pe.map(Ve=>Ve.path===y?{...Ve,text:Y}:Ve)),Qo(y)},onSave:y=>Is(y),onReload:Xs,onOverwrite:y=>Is(y,!0),onTogglePreview:y=>qn(Y=>Y.map(pe=>pe.path===y?{...pe,previewMode:!pe.previewMode}:pe))}):c.jsxs(c.Fragment,{children:[c.jsx(Lh,{items:Z.items,busy:Gt,waiting:Ni,history:Eo,historyHasMore:Fg(de),historyLoading:de.loading,onLoadHistory:jo,sessionId:E??void 0}),c.jsx(Kb,{disabled:!E,busy:Gt,commands:Fc,sessionTitle:(ke==null?void 0:ke.title)??null,contextResult:Vc,onContextSearch:y=>Rr("mention",y),onCommand:Wc,onSend:y=>{E&&se({type:"prompt.send",sessionId:E,text:y})},onInterrupt:()=>{E&&se({type:"control.interrupt",sessionId:E})}})]}),Pl&&w&&c.jsxs(c.Fragment,{children:[!z&&c.jsx(zk,{height:hl.height,onResize:hl.setHeight,onReset:hl.reset}),c.jsx(Bk,{mobile:z,terminals:Na,activeId:Bs,blocked:U,height:z?Zn.height:hl.height,offset:z?{top:Zn.offsetTop,left:Zn.offsetLeft}:void 0,onSelect:ta,onOpen:Zc,onClose:Kc,onInput:(y,Y)=>se({type:"term.input",id:y,data:Y}),onResize:(y,Y,pe)=>se({type:"term.resize",id:y,cols:Y,rows:pe}),onAttach:y=>se({type:"term.attach",id:y}),onHide:()=>ea(!1),registerSink:Se})]})]}),c.jsx(WS,{open:Ce,items:hn.items,busy:Hr,ready:E!==null,commands:Fc,contextResult:ns,models:Ea.rows,model:Ea.selected,effort:$s.effort,ultracode:$s.ultracode,thinking:$s.thinking,switchOnFlag:$s.switchOnFlag,onContextSearch:y=>Rr("side",y),onCommand:Wc,onModel:y=>{y&&(Kn(Y=>({...Y,model:y})),Ys(Y=>se({type:"control.set_model",sessionId:Y,model:y})))},onEffort:y=>{Kn(Y=>({...Y,effort:y,ultracode:!1})),Ys(Y=>se({type:"control.set_effort",sessionId:Y,effort:y}))},onUltracode:y=>{Kn(Y=>({...Y,ultracode:y,...y?{effort:"xhigh"}:{}})),Ys(Y=>se({type:"control.set_ultracode",sessionId:Y,enabled:y}))},onThinking:y=>{Kn(Y=>({...Y,thinking:y})),Ys(Y=>se({type:"control.set_thinking",sessionId:Y,enabled:y}))},onSwitchOnFlag:y=>{Kn(Y=>({...Y,switchOnFlag:y})),Ys(Y=>se({type:"control.set_flag_switch",sessionId:Y,enabled:y}))},onAsk:Go,onInterrupt:()=>{wt&&se({type:"control.interrupt",sessionId:wt})},onReset:Yo,onClose:()=>ze(!1)}),Ce&&ls("ask"),($n||Ce||Vt||Hl)&&c.jsx("div",{className:"scrim scrim--pane",onClick:()=>{on(!1),ze(!1),Et(!1),In(!1)}}),Sa&&c.jsx(XS,{detail:Sa,local:((Ut==null?void 0:Ut.hasRemote)??!1)&&(Ut==null?void 0:Ut.commits.some(y=>y.hash===Sa.hash&&!y.pushed))===!0,onCheckout:ts,onClose:()=>{ka(null),zl(null)}}),wa&&c.jsxs($l,{title:"Переключить рабочее дерево?",onClose:()=>rl(null),actions:c.jsxs(c.Fragment,{children:[c.jsx("button",{className:"btn",onClick:()=>rl(null),children:"Отмена"}),c.jsx("button",{className:"btn btn--warn",onClick:Io,children:"Переключиться"})]}),children:[c.jsxs("p",{className:"modal__text",children:["git переключится на ",wa.label,". Файлы в каталоге проекта изменятся — это тот же каталог, в котором работает агент."]}),Gt&&c.jsx("p",{className:"modal__text",children:"Сейчас идёт ход агента: он читает и правит файлы прямо сейчас."}),Ut&&Ut.changed.length>0&&c.jsxs("p",{className:"modal__text",children:["Незакоммиченных изменений: ",Ut.changed.length,". Git откажется переключаться, если они будут затёрты."]})]}),ol&&c.jsx($l,{title:ol.kind==="dir"?"Удалить каталог?":"Удалить файл?",onClose:()=>Pt(null),actions:c.jsxs(c.Fragment,{children:[c.jsx("button",{className:"btn",onClick:()=>Pt(null),children:"Отмена"}),c.jsx("button",{className:"btn btn--warn",onClick:()=>Or(ol),children:"Удалить"})]}),children:c.jsxs("p",{className:"modal__text",children:[ol.path," будет удалён с диска",ol.kind==="dir"?" вместе со всем содержимым":"",". Корзины здесь нет: это тот же каталог, в котором работает агент."]})}),pt&&c.jsx($l,{title:"Закрыть без сохранения?",onClose:()=>Gn(null),actions:c.jsxs(c.Fragment,{children:[c.jsx("button",{className:"btn",onClick:()=>Gn(null),children:"Отмена"}),c.jsx("button",{className:"btn btn--warn",onClick:()=>wi(pt,!0),children:"Закрыть"}),c.jsx("button",{className:"btn btn--primary",onClick:()=>{Is(pt),wi(pt,!0)},children:"Сохранить и закрыть"})]}),children:c.jsxs("p",{className:"modal__text",children:["В ",pt," есть несохранённые правки."]})}),ye&&c.jsx(uk,{tab:ye,servers:Ft,plugins:un,marketplaces:Sn,catalog:kn,result:Cn,actions:Ho,onTab:tt,onClose:()=>tt(null)}),fe&&c.jsx(yk,{status:Ke,login:Hn,actions:Ar,runningSessions:_.filter(y=>y.state==="running"||y.state==="waiting_permission").length,onClose:()=>Re(!1)}),g&&c.jsx(vk,{state:d,onPair:(y,Y)=>se({type:"relay.pair",code:y,...Y?{name:Y}:{}}),onUnpair:()=>se({type:"relay.unpair"}),onClose:()=>m(!1)}),sl&&c.jsx(Rk,{settings:Wt,models:(D==null?void 0:D.models)??[],relayState:d,local:ho()==="local",onChange:qo,onEnableShell:()=>se({type:"relay.shell.enable"}),onDisableShell:()=>se({type:"relay.shell.disable"}),onOpenRelay:()=>{Xt(!1),m(!0)},onClose:()=>Xt(!1)}),xe&&c.jsx(CS,{candidates:N,searching:ie,agentItems:_e.items,agentBusy:(Me==null?void 0:Me.state)==="running",error:Ze,roots:qe,created:$e,onSearch:Ro,onAskAgent:Mo,onInterrupt:()=>{const y=ja.current;y&&se({type:"control.interrupt",sessionId:y})},onSubmit:Ao,onCreate:Co,onClose:Oo}),Jn!=null&&Jn.questions&&Jn.questions.length>0?c.jsx(SS,{request:{...Jn,questions:Jn.questions},queued:Z.pending.length-1,onAnswer:$o,onDecline:Zo}):Jn&&c.jsx(vS,{request:Jn,queued:Z.pending.length-1,onDecide:Jc})]})}function Pk(){return c.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[c.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"}),c.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 ew(){return c.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,"aria-hidden":"true",children:[c.jsx("circle",{cx:"7",cy:"7",r:"4.3"}),c.jsx("path",{d:"M13.2 13.2 10.1 10.1",strokeLinecap:"round"})]})}function tw(){return c.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round","aria-hidden":"true",children:[c.jsx("circle",{cx:"4.5",cy:"3.5",r:"1.9"}),c.jsx("circle",{cx:"4.5",cy:"12.5",r:"1.9"}),c.jsx("circle",{cx:"11.5",cy:"8",r:"1.9"}),c.jsx("path",{d:"M4.5 5.4v5.2M6.4 3.9h2.2a1.6 1.6 0 0 1 1.6 1.6v.8"})]})}function nw(s,l){return cb(s)===cb(l)}function cb(s){return s.replace(/[\\/]+/g,"/").replace(/\/+$/,"").toLowerCase()}function lw(){return c.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[c.jsx("rect",{x:"1.6",y:"2.6",width:"12.8",height:"10.8",rx:"1.7"}),c.jsx("path",{d:"M4.3 6 6.6 8l-2.3 2"}),c.jsx("path",{d:"M8.2 10h3.1"})]})}function aw(){return c.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[c.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"}),c.jsx("path",{d:"M8.4 8.5v-.3c0-.7.9-.9.9-1.7a1 1 0 0 0-1.9-.4"})]})}function sw(){return c.jsxs("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:[c.jsx("circle",{cx:"3.2",cy:"8",r:"1.5"}),c.jsx("circle",{cx:"8",cy:"8",r:"1.5"}),c.jsx("circle",{cx:"12.8",cy:"8",r:"1.5"})]})}function iw(){return c.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[c.jsx("path",{d:"M14 8a6 6 0 1 1-6-6c1.68 0 3.29.67 4.49 1.83L14 5.33"}),c.jsx("path",{d:"M14 2v3.33h-3.33"})]})}const i0=document.getElementById("root");if(!i0)throw new Error("#root not found");zx.createRoot(i0).render(c.jsx(S.StrictMode,{children:c.jsx(Wk,{})}));export{wv as D,Ot as I,zt as N,uw as P,Ol as T,Zl as a,Ob as b,al as c,cw as d,Hb as e,Cc as f,Iv as h,ow as p,fw as s,be as t};
|