vibe-coding-master 0.3.32 → 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.
@@ -0,0 +1,94 @@
1
+ var Y0=Object.defineProperty;var W0=(n,r,s)=>r in n?Y0(n,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[r]=s;var rm=(n,r,s)=>W0(n,typeof r!="symbol"?r+"":r,s);(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))o(d);new MutationObserver(d=>{for(const _ of d)if(_.type==="childList")for(const f of _.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&o(f)}).observe(document,{childList:!0,subtree:!0});function s(d){const _={};return d.integrity&&(_.integrity=d.integrity),d.referrerPolicy&&(_.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?_.credentials="include":d.crossOrigin==="anonymous"?_.credentials="omit":_.credentials="same-origin",_}function o(d){if(d.ep)return;d.ep=!0;const _=s(d);fetch(d.href,_)}})();function bg(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var fu={exports:{}},cl={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var sm;function X0(){if(sm)return cl;sm=1;var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function s(o,d,_){var f=null;if(_!==void 0&&(f=""+_),d.key!==void 0&&(f=""+d.key),"key"in d){_={};for(var a in d)a!=="key"&&(_[a]=d[a])}else _=d;return d=_.ref,{$$typeof:n,type:o,key:f,ref:d!==void 0?d:null,props:_}}return cl.Fragment=r,cl.jsx=s,cl.jsxs=s,cl}var lm;function Q0(){return lm||(lm=1,fu.exports=X0()),fu.exports}var D=Q0(),du={exports:{}},je={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var am;function Z0(){if(am)return je;am=1;var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),f=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),u=Symbol.for("react.activity"),y=Symbol.iterator;function w(z){return z===null||typeof z!="object"?null:(z=y&&z[y]||z["@@iterator"],typeof z=="function"?z:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,b={};function S(z,G,H){this.props=z,this.context=G,this.refs=b,this.updater=H||k}S.prototype.isReactComponent={},S.prototype.setState=function(z,G){if(typeof z!="object"&&typeof z!="function"&&z!=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,z,G,"setState")},S.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function g(){}g.prototype=S.prototype;function v(z,G,H){this.props=z,this.context=G,this.refs=b,this.updater=H||k}var E=v.prototype=new g;E.constructor=v,x(E,S.prototype),E.isPureReactComponent=!0;var L=Array.isArray;function R(){}var T={H:null,A:null,T:null,S:null},A=Object.prototype.hasOwnProperty;function M(z,G,H){var te=H.ref;return{$$typeof:n,type:z,key:G,ref:te!==void 0?te:null,props:H}}function j(z,G){return M(z.type,G,z.props)}function I(z){return typeof z=="object"&&z!==null&&z.$$typeof===n}function U(z){var G={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(H){return G[H]})}var F=/\/+/g;function K(z,G){return typeof z=="object"&&z!==null&&z.key!=null?U(""+z.key):G.toString(36)}function W(z){switch(z.status){case"fulfilled":return z.value;case"rejected":throw z.reason;default:switch(typeof z.status=="string"?z.then(R,R):(z.status="pending",z.then(function(G){z.status==="pending"&&(z.status="fulfilled",z.value=G)},function(G){z.status==="pending"&&(z.status="rejected",z.reason=G)})),z.status){case"fulfilled":return z.value;case"rejected":throw z.reason}}throw z}function V(z,G,H,te,he){var me=typeof z;(me==="undefined"||me==="boolean")&&(z=null);var Y=!1;if(z===null)Y=!0;else switch(me){case"bigint":case"string":case"number":Y=!0;break;case"object":switch(z.$$typeof){case n:case r:Y=!0;break;case m:return Y=z._init,V(Y(z._payload),G,H,te,he)}}if(Y)return he=he(z),Y=te===""?"."+K(z,0):te,L(he)?(H="",Y!=null&&(H=Y.replace(F,"$&/")+"/"),V(he,G,H,"",function(J){return J})):he!=null&&(I(he)&&(he=j(he,H+(he.key==null||z&&z.key===he.key?"":(""+he.key).replace(F,"$&/")+"/")+Y)),G.push(he)),1;Y=0;var q=te===""?".":te+":";if(L(z))for(var oe=0;oe<z.length;oe++)te=z[oe],me=q+K(te,oe),Y+=V(te,G,H,me,he);else if(oe=w(z),typeof oe=="function")for(z=oe.call(z),oe=0;!(te=z.next()).done;)te=te.value,me=q+K(te,oe++),Y+=V(te,G,H,me,he);else if(me==="object"){if(typeof z.then=="function")return V(W(z),G,H,te,he);throw G=String(z),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return Y}function $(z,G,H){if(z==null)return z;var te=[],he=0;return V(z,te,"","",function(me){return G.call(H,me,he++)}),te}function ee(z){if(z._status===-1){var G=z._result;G=G(),G.then(function(H){(z._status===0||z._status===-1)&&(z._status=1,z._result=H)},function(H){(z._status===0||z._status===-1)&&(z._status=2,z._result=H)}),z._status===-1&&(z._status=0,z._result=G)}if(z._status===1)return z._result.default;throw z._result}var N=typeof reportError=="function"?reportError:function(z){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof z=="object"&&z!==null&&typeof z.message=="string"?String(z.message):String(z),error:z});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",z);return}console.error(z)},B={map:$,forEach:function(z,G,H){$(z,function(){G.apply(this,arguments)},H)},count:function(z){var G=0;return $(z,function(){G++}),G},toArray:function(z){return $(z,function(G){return G})||[]},only:function(z){if(!I(z))throw Error("React.Children.only expected to receive a single React element child.");return z}};return je.Activity=u,je.Children=B,je.Component=S,je.Fragment=s,je.Profiler=d,je.PureComponent=v,je.StrictMode=o,je.Suspense=c,je.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,je.__COMPILER_RUNTIME={__proto__:null,c:function(z){return T.H.useMemoCache(z)}},je.cache=function(z){return function(){return z.apply(null,arguments)}},je.cacheSignal=function(){return null},je.cloneElement=function(z,G,H){if(z==null)throw Error("The argument must be a React element, but you passed "+z+".");var te=x({},z.props),he=z.key;if(G!=null)for(me in G.key!==void 0&&(he=""+G.key),G)!A.call(G,me)||me==="key"||me==="__self"||me==="__source"||me==="ref"&&G.ref===void 0||(te[me]=G[me]);var me=arguments.length-2;if(me===1)te.children=H;else if(1<me){for(var Y=Array(me),q=0;q<me;q++)Y[q]=arguments[q+2];te.children=Y}return M(z.type,he,te)},je.createContext=function(z){return z={$$typeof:f,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null},z.Provider=z,z.Consumer={$$typeof:_,_context:z},z},je.createElement=function(z,G,H){var te,he={},me=null;if(G!=null)for(te in G.key!==void 0&&(me=""+G.key),G)A.call(G,te)&&te!=="key"&&te!=="__self"&&te!=="__source"&&(he[te]=G[te]);var Y=arguments.length-2;if(Y===1)he.children=H;else if(1<Y){for(var q=Array(Y),oe=0;oe<Y;oe++)q[oe]=arguments[oe+2];he.children=q}if(z&&z.defaultProps)for(te in Y=z.defaultProps,Y)he[te]===void 0&&(he[te]=Y[te]);return M(z,me,he)},je.createRef=function(){return{current:null}},je.forwardRef=function(z){return{$$typeof:a,render:z}},je.isValidElement=I,je.lazy=function(z){return{$$typeof:m,_payload:{_status:-1,_result:z},_init:ee}},je.memo=function(z,G){return{$$typeof:h,type:z,compare:G===void 0?null:G}},je.startTransition=function(z){var G=T.T,H={};T.T=H;try{var te=z(),he=T.S;he!==null&&he(H,te),typeof te=="object"&&te!==null&&typeof te.then=="function"&&te.then(R,N)}catch(me){N(me)}finally{G!==null&&H.types!==null&&(G.types=H.types),T.T=G}},je.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},je.use=function(z){return T.H.use(z)},je.useActionState=function(z,G,H){return T.H.useActionState(z,G,H)},je.useCallback=function(z,G){return T.H.useCallback(z,G)},je.useContext=function(z){return T.H.useContext(z)},je.useDebugValue=function(){},je.useDeferredValue=function(z,G){return T.H.useDeferredValue(z,G)},je.useEffect=function(z,G){return T.H.useEffect(z,G)},je.useEffectEvent=function(z){return T.H.useEffectEvent(z)},je.useId=function(){return T.H.useId()},je.useImperativeHandle=function(z,G,H){return T.H.useImperativeHandle(z,G,H)},je.useInsertionEffect=function(z,G){return T.H.useInsertionEffect(z,G)},je.useLayoutEffect=function(z,G){return T.H.useLayoutEffect(z,G)},je.useMemo=function(z,G){return T.H.useMemo(z,G)},je.useOptimistic=function(z,G){return T.H.useOptimistic(z,G)},je.useReducer=function(z,G,H){return T.H.useReducer(z,G,H)},je.useRef=function(z){return T.H.useRef(z)},je.useState=function(z){return T.H.useState(z)},je.useSyncExternalStore=function(z,G,H){return T.H.useSyncExternalStore(z,G,H)},je.useTransition=function(){return T.H.useTransition()},je.version="19.2.6",je}var om;function Qu(){return om||(om=1,du.exports=Z0()),du.exports}var re=Qu(),pu={exports:{}},ul={},mu={exports:{}},gu={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var cm;function J0(){return cm||(cm=1,(function(n){function r(V,$){var ee=V.length;V.push($);e:for(;0<ee;){var N=ee-1>>>1,B=V[N];if(0<d(B,$))V[N]=$,V[ee]=B,ee=N;else break e}}function s(V){return V.length===0?null:V[0]}function o(V){if(V.length===0)return null;var $=V[0],ee=V.pop();if(ee!==$){V[0]=ee;e:for(var N=0,B=V.length,z=B>>>1;N<z;){var G=2*(N+1)-1,H=V[G],te=G+1,he=V[te];if(0>d(H,ee))te<B&&0>d(he,H)?(V[N]=he,V[te]=ee,N=te):(V[N]=H,V[G]=ee,N=G);else if(te<B&&0>d(he,ee))V[N]=he,V[te]=ee,N=te;else break e}}return $}function d(V,$){var ee=V.sortIndex-$.sortIndex;return ee!==0?ee:V.id-$.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var _=performance;n.unstable_now=function(){return _.now()}}else{var f=Date,a=f.now();n.unstable_now=function(){return f.now()-a}}var c=[],h=[],m=1,u=null,y=3,w=!1,k=!1,x=!1,b=!1,S=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;function E(V){for(var $=s(h);$!==null;){if($.callback===null)o(h);else if($.startTime<=V)o(h),$.sortIndex=$.expirationTime,r(c,$);else break;$=s(h)}}function L(V){if(x=!1,E(V),!k)if(s(c)!==null)k=!0,R||(R=!0,U());else{var $=s(h);$!==null&&W(L,$.startTime-V)}}var R=!1,T=-1,A=5,M=-1;function j(){return b?!0:!(n.unstable_now()-M<A)}function I(){if(b=!1,R){var V=n.unstable_now();M=V;var $=!0;try{e:{k=!1,x&&(x=!1,g(T),T=-1),w=!0;var ee=y;try{t:{for(E(V),u=s(c);u!==null&&!(u.expirationTime>V&&j());){var N=u.callback;if(typeof N=="function"){u.callback=null,y=u.priorityLevel;var B=N(u.expirationTime<=V);if(V=n.unstable_now(),typeof B=="function"){u.callback=B,E(V),$=!0;break t}u===s(c)&&o(c),E(V)}else o(c);u=s(c)}if(u!==null)$=!0;else{var z=s(h);z!==null&&W(L,z.startTime-V),$=!1}}break e}finally{u=null,y=ee,w=!1}$=void 0}}finally{$?U():R=!1}}}var U;if(typeof v=="function")U=function(){v(I)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,K=F.port2;F.port1.onmessage=I,U=function(){K.postMessage(null)}}else U=function(){S(I,0)};function W(V,$){T=S(function(){V(n.unstable_now())},$)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(V){V.callback=null},n.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<V?Math.floor(1e3/V):5},n.unstable_getCurrentPriorityLevel=function(){return y},n.unstable_next=function(V){switch(y){case 1:case 2:case 3:var $=3;break;default:$=y}var ee=y;y=$;try{return V()}finally{y=ee}},n.unstable_requestPaint=function(){b=!0},n.unstable_runWithPriority=function(V,$){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var ee=y;y=V;try{return $()}finally{y=ee}},n.unstable_scheduleCallback=function(V,$,ee){var N=n.unstable_now();switch(typeof ee=="object"&&ee!==null?(ee=ee.delay,ee=typeof ee=="number"&&0<ee?N+ee:N):ee=N,V){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=ee+B,V={id:m++,callback:$,priorityLevel:V,startTime:ee,expirationTime:B,sortIndex:-1},ee>N?(V.sortIndex=ee,r(h,V),s(c)===null&&V===s(h)&&(x?(g(T),T=-1):x=!0,W(L,ee-N))):(V.sortIndex=B,r(c,V),k||w||(k=!0,R||(R=!0,U()))),V},n.unstable_shouldYield=j,n.unstable_wrapCallback=function(V){var $=y;return function(){var ee=y;y=$;try{return V.apply(this,arguments)}finally{y=ee}}}})(gu)),gu}var um;function e1(){return um||(um=1,mu.exports=J0()),mu.exports}var _u={exports:{}},Vt={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var hm;function t1(){if(hm)return Vt;hm=1;var n=Qu();function r(c){var h="https://react.dev/errors/"+c;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)h+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+c+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var o={d:{f:s,r:function(){throw Error(r(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},d=Symbol.for("react.portal");function _(c,h,m){var u=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:u==null?null:""+u,children:c,containerInfo:h,implementation:m}}var f=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function a(c,h){if(c==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Vt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,Vt.createPortal=function(c,h){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(r(299));return _(c,h,null,m)},Vt.flushSync=function(c){var h=f.T,m=o.p;try{if(f.T=null,o.p=2,c)return c()}finally{f.T=h,o.p=m,o.d.f()}},Vt.preconnect=function(c,h){typeof c=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,o.d.C(c,h))},Vt.prefetchDNS=function(c){typeof c=="string"&&o.d.D(c)},Vt.preinit=function(c,h){if(typeof c=="string"&&h&&typeof h.as=="string"){var m=h.as,u=a(m,h.crossOrigin),y=typeof h.integrity=="string"?h.integrity:void 0,w=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;m==="style"?o.d.S(c,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:u,integrity:y,fetchPriority:w}):m==="script"&&o.d.X(c,{crossOrigin:u,integrity:y,fetchPriority:w,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Vt.preinitModule=function(c,h){if(typeof c=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var m=a(h.as,h.crossOrigin);o.d.M(c,{crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&o.d.M(c)},Vt.preload=function(c,h){if(typeof c=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var m=h.as,u=a(m,h.crossOrigin);o.d.L(c,m,{crossOrigin:u,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Vt.preloadModule=function(c,h){if(typeof c=="string")if(h){var m=a(h.as,h.crossOrigin);o.d.m(c,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else o.d.m(c)},Vt.requestFormReset=function(c){o.d.r(c)},Vt.unstable_batchedUpdates=function(c,h){return c(h)},Vt.useFormState=function(c,h,m){return f.H.useFormState(c,h,m)},Vt.useFormStatus=function(){return f.H.useHostTransitionStatus()},Vt.version="19.2.6",Vt}var fm;function n1(){if(fm)return _u.exports;fm=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),_u.exports=t1(),_u.exports}/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var dm;function i1(){if(dm)return ul;dm=1;var n=e1(),r=Qu(),s=n1();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i])}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 d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function _(e){var t=e,i=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(i=t.return),e=t.return;while(e)}return t.tag===3?i:null}function f(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 a(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 c(e){if(_(e)!==e)throw Error(o(188))}function h(e){var t=e.alternate;if(!t){if(t=_(e),t===null)throw Error(o(188));return t!==e?null:e}for(var i=e,l=t;;){var p=i.return;if(p===null)break;var C=p.alternate;if(C===null){if(l=p.return,l!==null){i=l;continue}break}if(p.child===C.child){for(C=p.child;C;){if(C===i)return c(p),e;if(C===l)return c(p),t;C=C.sibling}throw Error(o(188))}if(i.return!==l.return)i=p,l=C;else{for(var O=!1,P=p.child;P;){if(P===i){O=!0,i=p,l=C;break}if(P===l){O=!0,l=p,i=C;break}P=P.sibling}if(!O){for(P=C.child;P;){if(P===i){O=!0,i=C,l=p;break}if(P===l){O=!0,l=C,i=p;break}P=P.sibling}if(!O)throw Error(o(189))}}if(i.alternate!==l)throw Error(o(190))}if(i.tag!==3)throw Error(o(188));return i.stateNode.current===i?e:t}function m(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=m(e),t!==null)return t;e=e.sibling}return null}var u=Object.assign,y=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),g=Symbol.for("react.consumer"),v=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),M=Symbol.for("react.activity"),j=Symbol.for("react.memo_cache_sentinel"),I=Symbol.iterator;function U(e){return e===null||typeof e!="object"?null:(e=I&&e[I]||e["@@iterator"],typeof e=="function"?e:null)}var F=Symbol.for("react.client.reference");function K(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===F?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case x:return"Fragment";case S:return"Profiler";case b:return"StrictMode";case L:return"Suspense";case R:return"SuspenseList";case M:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case k:return"Portal";case v:return e.displayName||"Context";case g: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 T:return t=e.displayName||null,t!==null?t:K(e.type)||"Memo";case A:t=e._payload,e=e._init;try{return K(e(t))}catch{}}return null}var W=Array.isArray,V=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee={pending:!1,data:null,method:null,action:null},N=[],B=-1;function z(e){return{current:e}}function G(e){0>B||(e.current=N[B],N[B]=null,B--)}function H(e,t){B++,N[B]=e.current,e.current=t}var te=z(null),he=z(null),me=z(null),Y=z(null);function q(e,t){switch(H(me,t),H(he,e),H(te,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Ap(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Ap(t),e=Tp(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}G(te),H(te,e)}function oe(){G(te),G(he),G(me)}function J(e){e.memoizedState!==null&&H(Y,e);var t=te.current,i=Tp(t,e.type);t!==i&&(H(he,e),H(te,i))}function ie(e){he.current===e&&(G(te),G(he)),Y.current===e&&(G(Y),sl._currentValue=ee)}var de,Ce;function xe(e){if(de===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);de=t&&t[1]||"",Ce=-1<i.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+de+e+Ce}var Ke=!1;function it(e,t){if(!e||Ke)return"";Ke=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var ge=function(){throw Error()};if(Object.defineProperty(ge.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ge,[])}catch(ce){var ae=ce}Reflect.construct(e,[],ge)}else{try{ge.call()}catch(ce){ae=ce}e.call(ge.prototype)}}else{try{throw Error()}catch(ce){ae=ce}(ge=e())&&typeof ge.catch=="function"&&ge.catch(function(){})}}catch(ce){if(ce&&ae&&typeof ce.stack=="string")return[ce.stack,ae.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var C=l.DetermineComponentFrameRoot(),O=C[0],P=C[1];if(O&&P){var X=O.split(`
44
+ `),le=P.split(`
45
+ `);for(p=l=0;l<X.length&&!X[l].includes("DetermineComponentFrameRoot");)l++;for(;p<le.length&&!le[p].includes("DetermineComponentFrameRoot");)p++;if(l===X.length||p===le.length)for(l=X.length-1,p=le.length-1;1<=l&&0<=p&&X[l]!==le[p];)p--;for(;1<=l&&0<=p;l--,p--)if(X[l]!==le[p]){if(l!==1||p!==1)do if(l--,p--,0>p||X[l]!==le[p]){var fe=`
46
+ `+X[l].replace(" at new "," at ");return e.displayName&&fe.includes("<anonymous>")&&(fe=fe.replace("<anonymous>",e.displayName)),fe}while(1<=l&&0<=p);break}}}finally{Ke=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?xe(i):""}function Re(e,t){switch(e.tag){case 26:case 27:case 5:return xe(e.type);case 16:return xe("Lazy");case 13:return e.child!==t&&t!==null?xe("Suspense Fallback"):xe("Suspense");case 19:return xe("SuspenseList");case 0:case 15:return it(e.type,!1);case 11:return it(e.type.render,!1);case 1:return it(e.type,!0);case 31:return xe("Activity");default:return""}}function Jt(e){try{var t="",i=null;do t+=Re(e,i),i=e,e=e.return;while(e);return t}catch(l){return`
47
+ Error generating stack: `+l.message+`
48
+ `+l.stack}}var Wt=Object.prototype.hasOwnProperty,Bt=n.unstable_scheduleCallback,Ct=n.unstable_cancelCallback,Xt=n.unstable_shouldYield,vt=n.unstable_requestPaint,rt=n.unstable_now,kt=n.unstable_getCurrentPriorityLevel,ue=n.unstable_ImmediatePriority,Se=n.unstable_UserBlockingPriority,ke=n.unstable_NormalPriority,De=n.unstable_LowPriority,Be=n.unstable_IdlePriority,ht=n.log,Ie=n.unstable_setDisableYieldValue,gt=null,Ye=null;function wt(e){if(typeof ht=="function"&&Ie(e),Ye&&typeof Ye.setStrictMode=="function")try{Ye.setStrictMode(gt,e)}catch{}}var Xe=Math.clz32?Math.clz32:un,zt=Math.log,At=Math.LN2;function un(e){return e>>>=0,e===0?32:31-(zt(e)/At|0)|0}var _i=256,Ue=262144,$n=4194304;function Sn(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 Zi(e,t,i){var l=e.pendingLanes;if(l===0)return 0;var p=0,C=e.suspendedLanes,O=e.pingedLanes;e=e.warmLanes;var P=l&134217727;return P!==0?(l=P&~C,l!==0?p=Sn(l):(O&=P,O!==0?p=Sn(O):i||(i=P&~e,i!==0&&(p=Sn(i))))):(P=l&~C,P!==0?p=Sn(P):O!==0?p=Sn(O):i||(i=l&~e,i!==0&&(p=Sn(i)))),p===0?0:t!==0&&t!==p&&(t&C)===0&&(C=p&-p,i=t&-t,C>=i||C===32&&(i&4194048)!==0)?t:p}function Ji(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function wr(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 vs(){var e=$n;return $n<<=1,($n&62914560)===0&&($n=4194304),e}function xr(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function Nt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function El(e,t,i,l,p,C){var O=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var P=e.entanglements,X=e.expirationTimes,le=e.hiddenUpdates;for(i=O&~i;0<i;){var fe=31-Xe(i),ge=1<<fe;P[fe]=0,X[fe]=-1;var ae=le[fe];if(ae!==null)for(le[fe]=null,fe=0;fe<ae.length;fe++){var ce=ae[fe];ce!==null&&(ce.lane&=-536870913)}i&=~ge}l!==0&&Ln(e,l,0),C!==0&&p===0&&e.tag!==0&&(e.suspendedLanes|=C&~(O&~t))}function Ln(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-Xe(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|i&261930}function vi(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var l=31-Xe(i),p=1<<l;p&t|e[l]&t&&(e[l]|=t),i&=~p}}function er(e,t){var i=t&-t;return i=(i&42)!==0?1:ye(i),(i&(e.suspendedLanes|t))!==0?0:i}function ye(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 It(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function kl(){var e=$.p;return e!==0?e:(e=window.event,e===void 0?32:Qp(e.type))}function Al(e,t){var i=$.p;try{return $.p=e,t()}finally{$.p=i}}var yt=Math.random().toString(36).slice(2),st="__reactFiber$"+yt,Ut="__reactProps$"+yt,Kn="__reactContainer$"+yt,tr="__reactEvents$"+yt,lo="__reactListeners$"+yt,Er="__reactHandles$"+yt,Tl="__reactResources$"+yt,nr="__reactMarker$"+yt;function ys(e){delete e[st],delete e[Ut],delete e[tr],delete e[lo],delete e[Er]}function yi(e){var t=e[st];if(t)return t;for(var i=e.parentNode;i;){if(t=i[Kn]||i[st]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=jp(e);e!==null;){if(i=e[st])return i;e=jp(e)}return t}e=i,i=e.parentNode}return null}function Si(e){if(e=e[st]||e[Kn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function bn(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function Cn(e){var t=e[Tl];return t||(t=e[Tl]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function ft(e){e[nr]=!0}var kr=new Set,Rl={};function On(e,t){In(e,t),In(e+"Capture",t)}function In(e,t){for(Rl[e]=t,e=0;e<t.length;e++)kr.add(t[e])}var bi=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]*$"),ir={},Ci={};function Yn(e){return Wt.call(Ci,e)?!0:Wt.call(ir,e)?!1:bi.test(e)?Ci[e]=!0:(ir[e]=!0,!1)}function Oe(e,t,i){if(Yn(t))if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+i)}}function Ar(e,t,i){if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+i)}}function Bn(e,t,i,l){if(l===null)e.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(t,i,""+l)}}function en(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Dl(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ss(e,t,i){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var p=l.get,C=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return p.call(this)},set:function(O){i=""+O,C.call(this,O)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return i},setValue:function(O){i=""+O},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Tr(e){if(!e._valueTracker){var t=Dl(e)?"checked":"value";e._valueTracker=Ss(e,t,""+e[t])}}function Q(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),l="";return e&&(l=Dl(e)?e.checked?"true":"false":e.value),e=l,e!==i?(t.setValue(e),!0):!1}function _e(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 Tt=/[\n"\\]/g;function Je(e){return e.replace(Tt,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Wn(e,t,i,l,p,C,O,P){e.name="",O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?e.type=O:e.removeAttribute("type"),t!=null?O==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+en(t)):e.value!==""+en(t)&&(e.value=""+en(t)):O!=="submit"&&O!=="reset"||e.removeAttribute("value"),t!=null?bs(e,O,en(t)):i!=null?bs(e,O,en(i)):l!=null&&e.removeAttribute("value"),p==null&&C!=null&&(e.defaultChecked=!!C),p!=null&&(e.checked=p&&typeof p!="function"&&typeof p!="symbol"),P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?e.name=""+en(P):e.removeAttribute("name")}function Xn(e,t,i,l,p,C,O,P){if(C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(e.type=C),t!=null||i!=null){if(!(C!=="submit"&&C!=="reset"||t!=null)){Tr(e);return}i=i!=null?""+en(i):"",t=t!=null?""+en(t):i,P||t===e.value||(e.value=t),e.defaultValue=t}l=l??p,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=P?e.checked:!!l,e.defaultChecked=!!l,O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"&&(e.name=O),Tr(e)}function bs(e,t,i){t==="number"&&_e(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function Rr(e,t,i,l){if(e=e.options,t){t={};for(var p=0;p<i.length;p++)t["$"+i[p]]=!0;for(i=0;i<e.length;i++)p=t.hasOwnProperty("$"+e[i].value),e[i].selected!==p&&(e[i].selected=p),p&&l&&(e[i].defaultSelected=!0)}else{for(i=""+en(i),t=null,p=0;p<e.length;p++){if(e[p].value===i){e[p].selected=!0,l&&(e[p].defaultSelected=!0);return}t!==null||e[p].disabled||(t=e[p])}t!==null&&(t.selected=!0)}}function bh(e,t,i){if(t!=null&&(t=""+en(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+en(i):""}function Ch(e,t,i,l){if(t==null){if(l!=null){if(i!=null)throw Error(o(92));if(W(l)){if(1<l.length)throw Error(o(93));l=l[0]}i=l}i==null&&(i=""),t=i}i=en(t),e.defaultValue=i,l=e.textContent,l===i&&l!==""&&l!==null&&(e.value=l),Tr(e)}function Dr(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var q_=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 wh(e,t,i){var l=t.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,i):typeof i!="number"||i===0||q_.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function xh(e,t,i){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,i!=null){for(var l in i)!i.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var p in t)l=t[p],t.hasOwnProperty(p)&&i[p]!==l&&wh(e,p,l)}else for(var C in t)t.hasOwnProperty(C)&&wh(e,C,t[C])}function ao(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 G_=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"]]),V_=/^[\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 Ml(e){return V_.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Qn(){}var oo=null;function co(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Mr=null,Lr=null;function Eh(e){var t=Si(e);if(t&&(e=t.stateNode)){var i=e[Ut]||null;e:switch(e=t.stateNode,t.type){case"input":if(Wn(e,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),t=i.name,i.type==="radio"&&t!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+Je(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var l=i[t];if(l!==e&&l.form===e.form){var p=l[Ut]||null;if(!p)throw Error(o(90));Wn(l,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(t=0;t<i.length;t++)l=i[t],l.form===e.form&&Q(l)}break e;case"textarea":bh(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&Rr(e,!!i.multiple,t,!1)}}}var uo=!1;function kh(e,t,i){if(uo)return e(t,i);uo=!0;try{var l=e(t);return l}finally{if(uo=!1,(Mr!==null||Lr!==null)&&(va(),Mr&&(t=Mr,e=Lr,Lr=Mr=null,Eh(t),e)))for(t=0;t<e.length;t++)Eh(e[t])}}function Cs(e,t){var i=e.stateNode;if(i===null)return null;var l=i[Ut]||null;if(l===null)return null;i=l[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":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(o(231,t,typeof i));return i}var Zn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ho=!1;if(Zn)try{var ws={};Object.defineProperty(ws,"passive",{get:function(){ho=!0}}),window.addEventListener("test",ws,ws),window.removeEventListener("test",ws,ws)}catch{ho=!1}var wi=null,fo=null,Ll=null;function Ah(){if(Ll)return Ll;var e,t=fo,i=t.length,l,p="value"in wi?wi.value:wi.textContent,C=p.length;for(e=0;e<i&&t[e]===p[e];e++);var O=i-e;for(l=1;l<=O&&t[i-l]===p[C-l];l++);return Ll=p.slice(e,1<l?1-l:void 0)}function Ol(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 Bl(){return!0}function Th(){return!1}function tn(e){function t(i,l,p,C,O){this._reactName=i,this._targetInst=p,this.type=l,this.nativeEvent=C,this.target=O,this.currentTarget=null;for(var P in e)e.hasOwnProperty(P)&&(i=e[P],this[P]=i?i(C):C[P]);return this.isDefaultPrevented=(C.defaultPrevented!=null?C.defaultPrevented:C.returnValue===!1)?Bl:Th,this.isPropagationStopped=Th,this}return u(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Bl)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Bl)},persist:function(){},isPersistent:Bl}),t}var rr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},jl=tn(rr),xs=u({},rr,{view:0,detail:0}),$_=tn(xs),po,mo,Es,Nl=u({},xs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:_o,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!==Es&&(Es&&e.type==="mousemove"?(po=e.screenX-Es.screenX,mo=e.screenY-Es.screenY):mo=po=0,Es=e),po)},movementY:function(e){return"movementY"in e?e.movementY:mo}}),Rh=tn(Nl),K_=u({},Nl,{dataTransfer:0}),Y_=tn(K_),W_=u({},xs,{relatedTarget:0}),go=tn(W_),X_=u({},rr,{animationName:0,elapsedTime:0,pseudoElement:0}),Q_=tn(X_),Z_=u({},rr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),J_=tn(Z_),ev=u({},rr,{data:0}),Dh=tn(ev),tv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},nv={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"},iv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function rv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=iv[e])?!!t[e]:!1}function _o(){return rv}var sv=u({},xs,{key:function(e){if(e.key){var t=tv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ol(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?nv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:_o,charCode:function(e){return e.type==="keypress"?Ol(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ol(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),lv=tn(sv),av=u({},Nl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Mh=tn(av),ov=u({},xs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:_o}),cv=tn(ov),uv=u({},rr,{propertyName:0,elapsedTime:0,pseudoElement:0}),hv=tn(uv),fv=u({},Nl,{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}),dv=tn(fv),pv=u({},rr,{newState:0,oldState:0}),mv=tn(pv),gv=[9,13,27,32],vo=Zn&&"CompositionEvent"in window,ks=null;Zn&&"documentMode"in document&&(ks=document.documentMode);var _v=Zn&&"TextEvent"in window&&!ks,Lh=Zn&&(!vo||ks&&8<ks&&11>=ks),Oh=" ",Bh=!1;function jh(e,t){switch(e){case"keyup":return gv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Nh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Or=!1;function vv(e,t){switch(e){case"compositionend":return Nh(t);case"keypress":return t.which!==32?null:(Bh=!0,Oh);case"textInput":return e=t.data,e===Oh&&Bh?null:e;default:return null}}function yv(e,t){if(Or)return e==="compositionend"||!vo&&jh(e,t)?(e=Ah(),Ll=fo=wi=null,Or=!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 Lh&&t.locale!=="ko"?null:t.data;default:return null}}var Sv={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 Hh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Sv[e.type]:t==="textarea"}function zh(e,t,i,l){Mr?Lr?Lr.push(l):Lr=[l]:Mr=l,t=Ea(t,"onChange"),0<t.length&&(i=new jl("onChange","change",null,i,l),e.push({event:i,listeners:t}))}var As=null,Ts=null;function bv(e){bp(e,0)}function Hl(e){var t=bn(e);if(Q(t))return e}function Ih(e,t){if(e==="change")return t}var Uh=!1;if(Zn){var yo;if(Zn){var So="oninput"in document;if(!So){var Ph=document.createElement("div");Ph.setAttribute("oninput","return;"),So=typeof Ph.oninput=="function"}yo=So}else yo=!1;Uh=yo&&(!document.documentMode||9<document.documentMode)}function Fh(){As&&(As.detachEvent("onpropertychange",qh),Ts=As=null)}function qh(e){if(e.propertyName==="value"&&Hl(Ts)){var t=[];zh(t,Ts,e,co(e)),kh(bv,t)}}function Cv(e,t,i){e==="focusin"?(Fh(),As=t,Ts=i,As.attachEvent("onpropertychange",qh)):e==="focusout"&&Fh()}function wv(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Hl(Ts)}function xv(e,t){if(e==="click")return Hl(t)}function Ev(e,t){if(e==="input"||e==="change")return Hl(t)}function kv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var hn=typeof Object.is=="function"?Object.is:kv;function Rs(e,t){if(hn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),l=Object.keys(t);if(i.length!==l.length)return!1;for(l=0;l<i.length;l++){var p=i[l];if(!Wt.call(t,p)||!hn(e[p],t[p]))return!1}return!0}function Gh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Vh(e,t){var i=Gh(e);e=0;for(var l;i;){if(i.nodeType===3){if(l=e+i.textContent.length,e<=t&&l>=t)return{node:i,offset:t-e};e=l}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=Gh(i)}}function $h(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?$h(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Kh(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=_e(e.document);t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=_e(e.document)}return t}function bo(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 Av=Zn&&"documentMode"in document&&11>=document.documentMode,Br=null,Co=null,Ds=null,wo=!1;function Yh(e,t,i){var l=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;wo||Br==null||Br!==_e(l)||(l=Br,"selectionStart"in l&&bo(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Ds&&Rs(Ds,l)||(Ds=l,l=Ea(Co,"onSelect"),0<l.length&&(t=new jl("onSelect","select",null,t,i),e.push({event:t,listeners:l}),t.target=Br)))}function sr(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var jr={animationend:sr("Animation","AnimationEnd"),animationiteration:sr("Animation","AnimationIteration"),animationstart:sr("Animation","AnimationStart"),transitionrun:sr("Transition","TransitionRun"),transitionstart:sr("Transition","TransitionStart"),transitioncancel:sr("Transition","TransitionCancel"),transitionend:sr("Transition","TransitionEnd")},xo={},Wh={};Zn&&(Wh=document.createElement("div").style,"AnimationEvent"in window||(delete jr.animationend.animation,delete jr.animationiteration.animation,delete jr.animationstart.animation),"TransitionEvent"in window||delete jr.transitionend.transition);function lr(e){if(xo[e])return xo[e];if(!jr[e])return e;var t=jr[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in Wh)return xo[e]=t[i];return e}var Xh=lr("animationend"),Qh=lr("animationiteration"),Zh=lr("animationstart"),Tv=lr("transitionrun"),Rv=lr("transitionstart"),Dv=lr("transitioncancel"),Jh=lr("transitionend"),ef=new Map,Eo="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(" ");Eo.push("scrollEnd");function jn(e,t){ef.set(e,t),On(t,[e])}var zl=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)},wn=[],Nr=0,ko=0;function Il(){for(var e=Nr,t=ko=Nr=0;t<e;){var i=wn[t];wn[t++]=null;var l=wn[t];wn[t++]=null;var p=wn[t];wn[t++]=null;var C=wn[t];if(wn[t++]=null,l!==null&&p!==null){var O=l.pending;O===null?p.next=p:(p.next=O.next,O.next=p),l.pending=p}C!==0&&tf(i,p,C)}}function Ul(e,t,i,l){wn[Nr++]=e,wn[Nr++]=t,wn[Nr++]=i,wn[Nr++]=l,ko|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function Ao(e,t,i,l){return Ul(e,t,i,l),Pl(e)}function ar(e,t){return Ul(e,null,null,t),Pl(e)}function tf(e,t,i){e.lanes|=i;var l=e.alternate;l!==null&&(l.lanes|=i);for(var p=!1,C=e.return;C!==null;)C.childLanes|=i,l=C.alternate,l!==null&&(l.childLanes|=i),C.tag===22&&(e=C.stateNode,e===null||e._visibility&1||(p=!0)),e=C,C=C.return;return e.tag===3?(C=e.stateNode,p&&t!==null&&(p=31-Xe(i),e=C.hiddenUpdates,l=e[p],l===null?e[p]=[t]:l.push(t),t.lane=i|536870912),C):null}function Pl(e){if(50<Zs)throw Zs=0,Nc=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Hr={};function Mv(e,t,i,l){this.tag=e,this.key=i,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=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function fn(e,t,i,l){return new Mv(e,t,i,l)}function To(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Jn(e,t){var i=e.alternate;return i===null?(i=fn(e.tag,t,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=t,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&65011712,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,t=e.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i.refCleanup=e.refCleanup,i}function nf(e,t){e.flags&=65011714;var i=e.alternate;return i===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=i.childLanes,e.lanes=i.lanes,e.child=i.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=i.memoizedProps,e.memoizedState=i.memoizedState,e.updateQueue=i.updateQueue,e.type=i.type,t=i.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Fl(e,t,i,l,p,C){var O=0;if(l=e,typeof e=="function")To(e)&&(O=1);else if(typeof e=="string")O=N0(e,i,te.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case M:return e=fn(31,i,t,p),e.elementType=M,e.lanes=C,e;case x:return or(i.children,p,C,t);case b:O=8,p|=24;break;case S:return e=fn(12,i,t,p|2),e.elementType=S,e.lanes=C,e;case L:return e=fn(13,i,t,p),e.elementType=L,e.lanes=C,e;case R:return e=fn(19,i,t,p),e.elementType=R,e.lanes=C,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case v:O=10;break e;case g:O=9;break e;case E:O=11;break e;case T:O=14;break e;case A:O=16,l=null;break e}O=29,i=Error(o(130,e===null?"null":typeof e,"")),l=null}return t=fn(O,i,t,p),t.elementType=e,t.type=l,t.lanes=C,t}function or(e,t,i,l){return e=fn(7,e,l,t),e.lanes=i,e}function Ro(e,t,i){return e=fn(6,e,null,t),e.lanes=i,e}function rf(e){var t=fn(18,null,null,0);return t.stateNode=e,t}function Do(e,t,i){return t=fn(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var sf=new WeakMap;function xn(e,t){if(typeof e=="object"&&e!==null){var i=sf.get(e);return i!==void 0?i:(t={value:e,source:t,stack:Jt(t)},sf.set(e,t),t)}return{value:e,source:t,stack:Jt(t)}}var zr=[],Ir=0,ql=null,Ms=0,En=[],kn=0,xi=null,Un=1,Pn="";function ei(e,t){zr[Ir++]=Ms,zr[Ir++]=ql,ql=e,Ms=t}function lf(e,t,i){En[kn++]=Un,En[kn++]=Pn,En[kn++]=xi,xi=e;var l=Un;e=Pn;var p=32-Xe(l)-1;l&=~(1<<p),i+=1;var C=32-Xe(t)+p;if(30<C){var O=p-p%5;C=(l&(1<<O)-1).toString(32),l>>=O,p-=O,Un=1<<32-Xe(t)+p|i<<p|l,Pn=C+e}else Un=1<<C|i<<p|l,Pn=e}function Mo(e){e.return!==null&&(ei(e,1),lf(e,1,0))}function Lo(e){for(;e===ql;)ql=zr[--Ir],zr[Ir]=null,Ms=zr[--Ir],zr[Ir]=null;for(;e===xi;)xi=En[--kn],En[kn]=null,Pn=En[--kn],En[kn]=null,Un=En[--kn],En[kn]=null}function af(e,t){En[kn++]=Un,En[kn++]=Pn,En[kn++]=xi,Un=t.id,Pn=t.overflow,xi=e}var Pt=null,pt=null,$e=!1,Ei=null,An=!1,Oo=Error(o(519));function ki(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ls(xn(t,e)),Oo}function of(e){var t=e.stateNode,i=e.type,l=e.memoizedProps;switch(t[st]=e,t[Ut]=l,i){case"dialog":Fe("cancel",t),Fe("close",t);break;case"iframe":case"object":case"embed":Fe("load",t);break;case"video":case"audio":for(i=0;i<el.length;i++)Fe(el[i],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),Xn(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Fe("invalid",t);break;case"textarea":Fe("invalid",t),Ch(t,l.value,l.defaultValue,l.children)}i=l.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||t.textContent===""+i||l.suppressHydrationWarning===!0||Ep(t.textContent,i)?(l.popover!=null&&(Fe("beforetoggle",t),Fe("toggle",t)),l.onScroll!=null&&Fe("scroll",t),l.onScrollEnd!=null&&Fe("scrollend",t),l.onClick!=null&&(t.onclick=Qn),t=!0):t=!1,t||ki(e,!0)}function cf(e){for(Pt=e.return;Pt;)switch(Pt.tag){case 5:case 31:case 13:An=!1;return;case 27:case 3:An=!0;return;default:Pt=Pt.return}}function Ur(e){if(e!==Pt)return!1;if(!$e)return cf(e),$e=!0,!1;var t=e.tag,i;if((i=t!==3&&t!==27)&&((i=t===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||Qc(e.type,e.memoizedProps)),i=!i),i&&pt&&ki(e),cf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));pt=Bp(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));pt=Bp(e)}else t===27?(t=pt,Ui(e.type)?(e=nu,nu=null,pt=e):pt=t):pt=Pt?Rn(e.stateNode.nextSibling):null;return!0}function cr(){pt=Pt=null,$e=!1}function Bo(){var e=Ei;return e!==null&&(ln===null?ln=e:ln.push.apply(ln,e),Ei=null),e}function Ls(e){Ei===null?Ei=[e]:Ei.push(e)}var jo=z(null),ur=null,ti=null;function Ai(e,t,i){H(jo,t._currentValue),t._currentValue=i}function ni(e){e._currentValue=jo.current,G(jo)}function No(e,t,i){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===i)break;e=e.return}}function Ho(e,t,i,l){var p=e.child;for(p!==null&&(p.return=e);p!==null;){var C=p.dependencies;if(C!==null){var O=p.child;C=C.firstContext;e:for(;C!==null;){var P=C;C=p;for(var X=0;X<t.length;X++)if(P.context===t[X]){C.lanes|=i,P=C.alternate,P!==null&&(P.lanes|=i),No(C.return,i,e),l||(O=null);break e}C=P.next}}else if(p.tag===18){if(O=p.return,O===null)throw Error(o(341));O.lanes|=i,C=O.alternate,C!==null&&(C.lanes|=i),No(O,i,e),O=null}else O=p.child;if(O!==null)O.return=p;else for(O=p;O!==null;){if(O===e){O=null;break}if(p=O.sibling,p!==null){p.return=O.return,O=p;break}O=O.return}p=O}}function Pr(e,t,i,l){e=null;for(var p=t,C=!1;p!==null;){if(!C){if((p.flags&524288)!==0)C=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var O=p.alternate;if(O===null)throw Error(o(387));if(O=O.memoizedProps,O!==null){var P=p.type;hn(p.pendingProps.value,O.value)||(e!==null?e.push(P):e=[P])}}else if(p===Y.current){if(O=p.alternate,O===null)throw Error(o(387));O.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(e!==null?e.push(sl):e=[sl])}p=p.return}e!==null&&Ho(t,e,i,l),t.flags|=262144}function Gl(e){for(e=e.firstContext;e!==null;){if(!hn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function hr(e){ur=e,ti=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ft(e){return uf(ur,e)}function Vl(e,t){return ur===null&&hr(e),uf(e,t)}function uf(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},ti===null){if(e===null)throw Error(o(308));ti=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ti=ti.next=t;return i}var Lv=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(i,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(i){return i()})}},Ov=n.unstable_scheduleCallback,Bv=n.unstable_NormalPriority,Rt={$$typeof:v,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function zo(){return{controller:new Lv,data:new Map,refCount:0}}function Os(e){e.refCount--,e.refCount===0&&Ov(Bv,function(){e.controller.abort()})}var Bs=null,Io=0,Fr=0,qr=null;function jv(e,t){if(Bs===null){var i=Bs=[];Io=0,Fr=Fc(),qr={status:"pending",value:void 0,then:function(l){i.push(l)}}}return Io++,t.then(hf,hf),t}function hf(){if(--Io===0&&Bs!==null){qr!==null&&(qr.status="fulfilled");var e=Bs;Bs=null,Fr=0,qr=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Nv(e,t){var i=[],l={status:"pending",value:null,reason:null,then:function(p){i.push(p)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var p=0;p<i.length;p++)(0,i[p])(t)},function(p){for(l.status="rejected",l.reason=p,p=0;p<i.length;p++)(0,i[p])(void 0)}),l}var ff=V.S;V.S=function(e,t){Wd=rt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&jv(e,t),ff!==null&&ff(e,t)};var fr=z(null);function Uo(){var e=fr.current;return e!==null?e:ct.pooledCache}function $l(e,t){t===null?H(fr,fr.current):H(fr,t.pool)}function df(){var e=Uo();return e===null?null:{parent:Rt._currentValue,pool:e}}var Gr=Error(o(460)),Po=Error(o(474)),Kl=Error(o(542)),Yl={then:function(){}};function pf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function mf(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(Qn,Qn),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,_f(e),e;default:if(typeof t.status=="string")t.then(Qn,Qn);else{if(e=ct,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var p=t;p.status="fulfilled",p.value=l}},function(l){if(t.status==="pending"){var p=t;p.status="rejected",p.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,_f(e),e}throw pr=t,Gr}}function dr(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(pr=i,Gr):i}}var pr=null;function gf(){if(pr===null)throw Error(o(459));var e=pr;return pr=null,e}function _f(e){if(e===Gr||e===Kl)throw Error(o(483))}var Vr=null,js=0;function Wl(e){var t=js;return js+=1,Vr===null&&(Vr=[]),mf(Vr,e,t)}function Ns(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Xl(e,t){throw t.$$typeof===y?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function vf(e){function t(ne,Z){if(e){var se=ne.deletions;se===null?(ne.deletions=[Z],ne.flags|=16):se.push(Z)}}function i(ne,Z){if(!e)return null;for(;Z!==null;)t(ne,Z),Z=Z.sibling;return null}function l(ne){for(var Z=new Map;ne!==null;)ne.key!==null?Z.set(ne.key,ne):Z.set(ne.index,ne),ne=ne.sibling;return Z}function p(ne,Z){return ne=Jn(ne,Z),ne.index=0,ne.sibling=null,ne}function C(ne,Z,se){return ne.index=se,e?(se=ne.alternate,se!==null?(se=se.index,se<Z?(ne.flags|=67108866,Z):se):(ne.flags|=67108866,Z)):(ne.flags|=1048576,Z)}function O(ne){return e&&ne.alternate===null&&(ne.flags|=67108866),ne}function P(ne,Z,se,pe){return Z===null||Z.tag!==6?(Z=Ro(se,ne.mode,pe),Z.return=ne,Z):(Z=p(Z,se),Z.return=ne,Z)}function X(ne,Z,se,pe){var Te=se.type;return Te===x?fe(ne,Z,se.props.children,pe,se.key):Z!==null&&(Z.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===A&&dr(Te)===Z.type)?(Z=p(Z,se.props),Ns(Z,se),Z.return=ne,Z):(Z=Fl(se.type,se.key,se.props,null,ne.mode,pe),Ns(Z,se),Z.return=ne,Z)}function le(ne,Z,se,pe){return Z===null||Z.tag!==4||Z.stateNode.containerInfo!==se.containerInfo||Z.stateNode.implementation!==se.implementation?(Z=Do(se,ne.mode,pe),Z.return=ne,Z):(Z=p(Z,se.children||[]),Z.return=ne,Z)}function fe(ne,Z,se,pe,Te){return Z===null||Z.tag!==7?(Z=or(se,ne.mode,pe,Te),Z.return=ne,Z):(Z=p(Z,se),Z.return=ne,Z)}function ge(ne,Z,se){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return Z=Ro(""+Z,ne.mode,se),Z.return=ne,Z;if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case w:return se=Fl(Z.type,Z.key,Z.props,null,ne.mode,se),Ns(se,Z),se.return=ne,se;case k:return Z=Do(Z,ne.mode,se),Z.return=ne,Z;case A:return Z=dr(Z),ge(ne,Z,se)}if(W(Z)||U(Z))return Z=or(Z,ne.mode,se,null),Z.return=ne,Z;if(typeof Z.then=="function")return ge(ne,Wl(Z),se);if(Z.$$typeof===v)return ge(ne,Vl(ne,Z),se);Xl(ne,Z)}return null}function ae(ne,Z,se,pe){var Te=Z!==null?Z.key:null;if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return Te!==null?null:P(ne,Z,""+se,pe);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case w:return se.key===Te?X(ne,Z,se,pe):null;case k:return se.key===Te?le(ne,Z,se,pe):null;case A:return se=dr(se),ae(ne,Z,se,pe)}if(W(se)||U(se))return Te!==null?null:fe(ne,Z,se,pe,null);if(typeof se.then=="function")return ae(ne,Z,Wl(se),pe);if(se.$$typeof===v)return ae(ne,Z,Vl(ne,se),pe);Xl(ne,se)}return null}function ce(ne,Z,se,pe,Te){if(typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint")return ne=ne.get(se)||null,P(Z,ne,""+pe,Te);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case w:return ne=ne.get(pe.key===null?se:pe.key)||null,X(Z,ne,pe,Te);case k:return ne=ne.get(pe.key===null?se:pe.key)||null,le(Z,ne,pe,Te);case A:return pe=dr(pe),ce(ne,Z,se,pe,Te)}if(W(pe)||U(pe))return ne=ne.get(se)||null,fe(Z,ne,pe,Te,null);if(typeof pe.then=="function")return ce(ne,Z,se,Wl(pe),Te);if(pe.$$typeof===v)return ce(ne,Z,se,Vl(Z,pe),Te);Xl(Z,pe)}return null}function Ee(ne,Z,se,pe){for(var Te=null,Qe=null,Ae=Z,He=Z=0,Ve=null;Ae!==null&&He<se.length;He++){Ae.index>He?(Ve=Ae,Ae=null):Ve=Ae.sibling;var Ze=ae(ne,Ae,se[He],pe);if(Ze===null){Ae===null&&(Ae=Ve);break}e&&Ae&&Ze.alternate===null&&t(ne,Ae),Z=C(Ze,Z,He),Qe===null?Te=Ze:Qe.sibling=Ze,Qe=Ze,Ae=Ve}if(He===se.length)return i(ne,Ae),$e&&ei(ne,He),Te;if(Ae===null){for(;He<se.length;He++)Ae=ge(ne,se[He],pe),Ae!==null&&(Z=C(Ae,Z,He),Qe===null?Te=Ae:Qe.sibling=Ae,Qe=Ae);return $e&&ei(ne,He),Te}for(Ae=l(Ae);He<se.length;He++)Ve=ce(Ae,ne,He,se[He],pe),Ve!==null&&(e&&Ve.alternate!==null&&Ae.delete(Ve.key===null?He:Ve.key),Z=C(Ve,Z,He),Qe===null?Te=Ve:Qe.sibling=Ve,Qe=Ve);return e&&Ae.forEach(function(Vi){return t(ne,Vi)}),$e&&ei(ne,He),Te}function Le(ne,Z,se,pe){if(se==null)throw Error(o(151));for(var Te=null,Qe=null,Ae=Z,He=Z=0,Ve=null,Ze=se.next();Ae!==null&&!Ze.done;He++,Ze=se.next()){Ae.index>He?(Ve=Ae,Ae=null):Ve=Ae.sibling;var Vi=ae(ne,Ae,Ze.value,pe);if(Vi===null){Ae===null&&(Ae=Ve);break}e&&Ae&&Vi.alternate===null&&t(ne,Ae),Z=C(Vi,Z,He),Qe===null?Te=Vi:Qe.sibling=Vi,Qe=Vi,Ae=Ve}if(Ze.done)return i(ne,Ae),$e&&ei(ne,He),Te;if(Ae===null){for(;!Ze.done;He++,Ze=se.next())Ze=ge(ne,Ze.value,pe),Ze!==null&&(Z=C(Ze,Z,He),Qe===null?Te=Ze:Qe.sibling=Ze,Qe=Ze);return $e&&ei(ne,He),Te}for(Ae=l(Ae);!Ze.done;He++,Ze=se.next())Ze=ce(Ae,ne,He,Ze.value,pe),Ze!==null&&(e&&Ze.alternate!==null&&Ae.delete(Ze.key===null?He:Ze.key),Z=C(Ze,Z,He),Qe===null?Te=Ze:Qe.sibling=Ze,Qe=Ze);return e&&Ae.forEach(function(K0){return t(ne,K0)}),$e&&ei(ne,He),Te}function ot(ne,Z,se,pe){if(typeof se=="object"&&se!==null&&se.type===x&&se.key===null&&(se=se.props.children),typeof se=="object"&&se!==null){switch(se.$$typeof){case w:e:{for(var Te=se.key;Z!==null;){if(Z.key===Te){if(Te=se.type,Te===x){if(Z.tag===7){i(ne,Z.sibling),pe=p(Z,se.props.children),pe.return=ne,ne=pe;break e}}else if(Z.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===A&&dr(Te)===Z.type){i(ne,Z.sibling),pe=p(Z,se.props),Ns(pe,se),pe.return=ne,ne=pe;break e}i(ne,Z);break}else t(ne,Z);Z=Z.sibling}se.type===x?(pe=or(se.props.children,ne.mode,pe,se.key),pe.return=ne,ne=pe):(pe=Fl(se.type,se.key,se.props,null,ne.mode,pe),Ns(pe,se),pe.return=ne,ne=pe)}return O(ne);case k:e:{for(Te=se.key;Z!==null;){if(Z.key===Te)if(Z.tag===4&&Z.stateNode.containerInfo===se.containerInfo&&Z.stateNode.implementation===se.implementation){i(ne,Z.sibling),pe=p(Z,se.children||[]),pe.return=ne,ne=pe;break e}else{i(ne,Z);break}else t(ne,Z);Z=Z.sibling}pe=Do(se,ne.mode,pe),pe.return=ne,ne=pe}return O(ne);case A:return se=dr(se),ot(ne,Z,se,pe)}if(W(se))return Ee(ne,Z,se,pe);if(U(se)){if(Te=U(se),typeof Te!="function")throw Error(o(150));return se=Te.call(se),Le(ne,Z,se,pe)}if(typeof se.then=="function")return ot(ne,Z,Wl(se),pe);if(se.$$typeof===v)return ot(ne,Z,Vl(ne,se),pe);Xl(ne,se)}return typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint"?(se=""+se,Z!==null&&Z.tag===6?(i(ne,Z.sibling),pe=p(Z,se),pe.return=ne,ne=pe):(i(ne,Z),pe=Ro(se,ne.mode,pe),pe.return=ne,ne=pe),O(ne)):i(ne,Z)}return function(ne,Z,se,pe){try{js=0;var Te=ot(ne,Z,se,pe);return Vr=null,Te}catch(Ae){if(Ae===Gr||Ae===Kl)throw Ae;var Qe=fn(29,Ae,null,ne.mode);return Qe.lanes=pe,Qe.return=ne,Qe}finally{}}}var mr=vf(!0),yf=vf(!1),Ti=!1;function Fo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function qo(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 Ri(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Di(e,t,i){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(et&2)!==0){var p=l.pending;return p===null?t.next=t:(t.next=p.next,p.next=t),l.pending=t,t=Pl(e),tf(e,null,i),t}return Ul(e,l,t,i),Pl(e)}function Hs(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,i|=l,t.lanes=i,vi(e,i)}}function Go(e,t){var i=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,i===l)){var p=null,C=null;if(i=i.firstBaseUpdate,i!==null){do{var O={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};C===null?p=C=O:C=C.next=O,i=i.next}while(i!==null);C===null?p=C=t:C=C.next=t}else p=C=t;i={baseState:l.baseState,firstBaseUpdate:p,lastBaseUpdate:C,shared:l.shared,callbacks:l.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}var Vo=!1;function zs(){if(Vo){var e=qr;if(e!==null)throw e}}function Is(e,t,i,l){Vo=!1;var p=e.updateQueue;Ti=!1;var C=p.firstBaseUpdate,O=p.lastBaseUpdate,P=p.shared.pending;if(P!==null){p.shared.pending=null;var X=P,le=X.next;X.next=null,O===null?C=le:O.next=le,O=X;var fe=e.alternate;fe!==null&&(fe=fe.updateQueue,P=fe.lastBaseUpdate,P!==O&&(P===null?fe.firstBaseUpdate=le:P.next=le,fe.lastBaseUpdate=X))}if(C!==null){var ge=p.baseState;O=0,fe=le=X=null,P=C;do{var ae=P.lane&-536870913,ce=ae!==P.lane;if(ce?(Ge&ae)===ae:(l&ae)===ae){ae!==0&&ae===Fr&&(Vo=!0),fe!==null&&(fe=fe.next={lane:0,tag:P.tag,payload:P.payload,callback:null,next:null});e:{var Ee=e,Le=P;ae=t;var ot=i;switch(Le.tag){case 1:if(Ee=Le.payload,typeof Ee=="function"){ge=Ee.call(ot,ge,ae);break e}ge=Ee;break e;case 3:Ee.flags=Ee.flags&-65537|128;case 0:if(Ee=Le.payload,ae=typeof Ee=="function"?Ee.call(ot,ge,ae):Ee,ae==null)break e;ge=u({},ge,ae);break e;case 2:Ti=!0}}ae=P.callback,ae!==null&&(e.flags|=64,ce&&(e.flags|=8192),ce=p.callbacks,ce===null?p.callbacks=[ae]:ce.push(ae))}else ce={lane:ae,tag:P.tag,payload:P.payload,callback:P.callback,next:null},fe===null?(le=fe=ce,X=ge):fe=fe.next=ce,O|=ae;if(P=P.next,P===null){if(P=p.shared.pending,P===null)break;ce=P,P=ce.next,ce.next=null,p.lastBaseUpdate=ce,p.shared.pending=null}}while(!0);fe===null&&(X=ge),p.baseState=X,p.firstBaseUpdate=le,p.lastBaseUpdate=fe,C===null&&(p.shared.lanes=0),ji|=O,e.lanes=O,e.memoizedState=ge}}function Sf(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function bf(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)Sf(i[e],t)}var $r=z(null),Ql=z(0);function Cf(e,t){e=hi,H(Ql,e),H($r,t),hi=e|t.baseLanes}function $o(){H(Ql,hi),H($r,$r.current)}function Ko(){hi=Ql.current,G($r),G(Ql)}var dn=z(null),Tn=null;function Mi(e){var t=e.alternate;H(xt,xt.current&1),H(dn,e),Tn===null&&(t===null||$r.current!==null||t.memoizedState!==null)&&(Tn=e)}function Yo(e){H(xt,xt.current),H(dn,e),Tn===null&&(Tn=e)}function wf(e){e.tag===22?(H(xt,xt.current),H(dn,e),Tn===null&&(Tn=e)):Li()}function Li(){H(xt,xt.current),H(dn,dn.current)}function pn(e){G(dn),Tn===e&&(Tn=null),G(xt)}var xt=z(0);function Zl(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||eu(i)||tu(i)))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 ii=0,Ne=null,lt=null,Dt=null,Jl=!1,Kr=!1,gr=!1,ea=0,Us=0,Yr=null,Hv=0;function St(){throw Error(o(321))}function Wo(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!hn(e[i],t[i]))return!1;return!0}function Xo(e,t,i,l,p,C){return ii=C,Ne=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,V.H=e===null||e.memoizedState===null?ld:hc,gr=!1,C=i(l,p),gr=!1,Kr&&(C=Ef(t,i,l,p)),xf(e),C}function xf(e){V.H=qs;var t=lt!==null&&lt.next!==null;if(ii=0,Dt=lt=Ne=null,Jl=!1,Us=0,Yr=null,t)throw Error(o(300));e===null||Mt||(e=e.dependencies,e!==null&&Gl(e)&&(Mt=!0))}function Ef(e,t,i,l){Ne=e;var p=0;do{if(Kr&&(Yr=null),Us=0,Kr=!1,25<=p)throw Error(o(301));if(p+=1,Dt=lt=null,e.updateQueue!=null){var C=e.updateQueue;C.lastEffect=null,C.events=null,C.stores=null,C.memoCache!=null&&(C.memoCache.index=0)}V.H=ad,C=t(i,l)}while(Kr);return C}function zv(){var e=V.H,t=e.useState()[0];return t=typeof t.then=="function"?Ps(t):t,e=e.useState()[0],(lt!==null?lt.memoizedState:null)!==e&&(Ne.flags|=1024),t}function Qo(){var e=ea!==0;return ea=0,e}function Zo(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function Jo(e){if(Jl){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Jl=!1}ii=0,Dt=lt=Ne=null,Kr=!1,Us=ea=0,Yr=null}function Qt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Dt===null?Ne.memoizedState=Dt=e:Dt=Dt.next=e,Dt}function Et(){if(lt===null){var e=Ne.alternate;e=e!==null?e.memoizedState:null}else e=lt.next;var t=Dt===null?Ne.memoizedState:Dt.next;if(t!==null)Dt=t,lt=e;else{if(e===null)throw Ne.alternate===null?Error(o(467)):Error(o(310));lt=e,e={memoizedState:lt.memoizedState,baseState:lt.baseState,baseQueue:lt.baseQueue,queue:lt.queue,next:null},Dt===null?Ne.memoizedState=Dt=e:Dt=Dt.next=e}return Dt}function ta(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ps(e){var t=Us;return Us+=1,Yr===null&&(Yr=[]),e=mf(Yr,e,t),t=Ne,(Dt===null?t.memoizedState:Dt.next)===null&&(t=t.alternate,V.H=t===null||t.memoizedState===null?ld:hc),e}function na(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ps(e);if(e.$$typeof===v)return Ft(e)}throw Error(o(438,String(e)))}function ec(e){var t=null,i=Ne.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var l=Ne.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(p){return p.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),i===null&&(i=ta(),Ne.updateQueue=i),i.memoCache=t,i=t.data[t.index],i===void 0)for(i=t.data[t.index]=Array(e),l=0;l<e;l++)i[l]=j;return t.index++,i}function ri(e,t){return typeof t=="function"?t(e):t}function ia(e){var t=Et();return tc(t,lt,e)}function tc(e,t,i){var l=e.queue;if(l===null)throw Error(o(311));l.lastRenderedReducer=i;var p=e.baseQueue,C=l.pending;if(C!==null){if(p!==null){var O=p.next;p.next=C.next,C.next=O}t.baseQueue=p=C,l.pending=null}if(C=e.baseState,p===null)e.memoizedState=C;else{t=p.next;var P=O=null,X=null,le=t,fe=!1;do{var ge=le.lane&-536870913;if(ge!==le.lane?(Ge&ge)===ge:(ii&ge)===ge){var ae=le.revertLane;if(ae===0)X!==null&&(X=X.next={lane:0,revertLane:0,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null}),ge===Fr&&(fe=!0);else if((ii&ae)===ae){le=le.next,ae===Fr&&(fe=!0);continue}else ge={lane:0,revertLane:le.revertLane,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},X===null?(P=X=ge,O=C):X=X.next=ge,Ne.lanes|=ae,ji|=ae;ge=le.action,gr&&i(C,ge),C=le.hasEagerState?le.eagerState:i(C,ge)}else ae={lane:ge,revertLane:le.revertLane,gesture:le.gesture,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},X===null?(P=X=ae,O=C):X=X.next=ae,Ne.lanes|=ge,ji|=ge;le=le.next}while(le!==null&&le!==t);if(X===null?O=C:X.next=P,!hn(C,e.memoizedState)&&(Mt=!0,fe&&(i=qr,i!==null)))throw i;e.memoizedState=C,e.baseState=O,e.baseQueue=X,l.lastRenderedState=C}return p===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function nc(e){var t=Et(),i=t.queue;if(i===null)throw Error(o(311));i.lastRenderedReducer=e;var l=i.dispatch,p=i.pending,C=t.memoizedState;if(p!==null){i.pending=null;var O=p=p.next;do C=e(C,O.action),O=O.next;while(O!==p);hn(C,t.memoizedState)||(Mt=!0),t.memoizedState=C,t.baseQueue===null&&(t.baseState=C),i.lastRenderedState=C}return[C,l]}function kf(e,t,i){var l=Ne,p=Et(),C=$e;if(C){if(i===void 0)throw Error(o(407));i=i()}else i=t();var O=!hn((lt||p).memoizedState,i);if(O&&(p.memoizedState=i,Mt=!0),p=p.queue,sc(Rf.bind(null,l,p,e),[e]),p.getSnapshot!==t||O||Dt!==null&&Dt.memoizedState.tag&1){if(l.flags|=2048,Wr(9,{destroy:void 0},Tf.bind(null,l,p,i,t),null),ct===null)throw Error(o(349));C||(ii&127)!==0||Af(l,t,i)}return i}function Af(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=Ne.updateQueue,t===null?(t=ta(),Ne.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function Tf(e,t,i,l){t.value=i,t.getSnapshot=l,Df(t)&&Mf(e)}function Rf(e,t,i){return i(function(){Df(t)&&Mf(e)})}function Df(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!hn(e,i)}catch{return!0}}function Mf(e){var t=ar(e,2);t!==null&&an(t,e,2)}function ic(e){var t=Qt();if(typeof e=="function"){var i=e;if(e=i(),gr){wt(!0);try{i()}finally{wt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ri,lastRenderedState:e},t}function Lf(e,t,i,l){return e.baseState=i,tc(e,lt,typeof l=="function"?l:ri)}function Iv(e,t,i,l,p){if(la(e))throw Error(o(485));if(e=t.action,e!==null){var C={payload:p,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(O){C.listeners.push(O)}};V.T!==null?i(!0):C.isTransition=!1,l(C),i=t.pending,i===null?(C.next=t.pending=C,Of(t,C)):(C.next=i.next,t.pending=i.next=C)}}function Of(e,t){var i=t.action,l=t.payload,p=e.state;if(t.isTransition){var C=V.T,O={};V.T=O;try{var P=i(p,l),X=V.S;X!==null&&X(O,P),Bf(e,t,P)}catch(le){rc(e,t,le)}finally{C!==null&&O.types!==null&&(C.types=O.types),V.T=C}}else try{C=i(p,l),Bf(e,t,C)}catch(le){rc(e,t,le)}}function Bf(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(l){jf(e,t,l)},function(l){return rc(e,t,l)}):jf(e,t,i)}function jf(e,t,i){t.status="fulfilled",t.value=i,Nf(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,Of(e,i)))}function rc(e,t,i){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=i,Nf(t),t=t.next;while(t!==l)}e.action=null}function Nf(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Hf(e,t){return t}function zf(e,t){if($e){var i=ct.formState;if(i!==null){e:{var l=Ne;if($e){if(pt){t:{for(var p=pt,C=An;p.nodeType!==8;){if(!C){p=null;break t}if(p=Rn(p.nextSibling),p===null){p=null;break t}}C=p.data,p=C==="F!"||C==="F"?p:null}if(p){pt=Rn(p.nextSibling),l=p.data==="F!";break e}}ki(l)}l=!1}l&&(t=i[0])}}return i=Qt(),i.memoizedState=i.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hf,lastRenderedState:t},i.queue=l,i=id.bind(null,Ne,l),l.dispatch=i,l=ic(!1),C=uc.bind(null,Ne,!1,l.queue),l=Qt(),p={state:t,dispatch:null,action:e,pending:null},l.queue=p,i=Iv.bind(null,Ne,p,C,i),p.dispatch=i,l.memoizedState=e,[t,i,!1]}function If(e){var t=Et();return Uf(t,lt,e)}function Uf(e,t,i){if(t=tc(e,t,Hf)[0],e=ia(ri)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=Ps(t)}catch(O){throw O===Gr?Kl:O}else l=t;t=Et();var p=t.queue,C=p.dispatch;return i!==t.memoizedState&&(Ne.flags|=2048,Wr(9,{destroy:void 0},Uv.bind(null,p,i),null)),[l,C,e]}function Uv(e,t){e.action=t}function Pf(e){var t=Et(),i=lt;if(i!==null)return Uf(t,i,e);Et(),t=t.memoizedState,i=Et();var l=i.queue.dispatch;return i.memoizedState=e,[t,l,!1]}function Wr(e,t,i,l){return e={tag:e,create:i,deps:l,inst:t,next:null},t=Ne.updateQueue,t===null&&(t=ta(),Ne.updateQueue=t),i=t.lastEffect,i===null?t.lastEffect=e.next=e:(l=i.next,i.next=e,e.next=l,t.lastEffect=e),e}function Ff(){return Et().memoizedState}function ra(e,t,i,l){var p=Qt();Ne.flags|=e,p.memoizedState=Wr(1|t,{destroy:void 0},i,l===void 0?null:l)}function sa(e,t,i,l){var p=Et();l=l===void 0?null:l;var C=p.memoizedState.inst;lt!==null&&l!==null&&Wo(l,lt.memoizedState.deps)?p.memoizedState=Wr(t,C,i,l):(Ne.flags|=e,p.memoizedState=Wr(1|t,C,i,l))}function qf(e,t){ra(8390656,8,e,t)}function sc(e,t){sa(2048,8,e,t)}function Pv(e){Ne.flags|=4;var t=Ne.updateQueue;if(t===null)t=ta(),Ne.updateQueue=t,t.events=[e];else{var i=t.events;i===null?t.events=[e]:i.push(e)}}function Gf(e){var t=Et().memoizedState;return Pv({ref:t,nextImpl:e}),function(){if((et&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function Vf(e,t){return sa(4,2,e,t)}function $f(e,t){return sa(4,4,e,t)}function Kf(e,t){if(typeof t=="function"){e=e();var i=t(e);return function(){typeof i=="function"?i():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Yf(e,t,i){i=i!=null?i.concat([e]):null,sa(4,4,Kf.bind(null,t,e),i)}function lc(){}function Wf(e,t){var i=Et();t=t===void 0?null:t;var l=i.memoizedState;return t!==null&&Wo(t,l[1])?l[0]:(i.memoizedState=[e,t],e)}function Xf(e,t){var i=Et();t=t===void 0?null:t;var l=i.memoizedState;if(t!==null&&Wo(t,l[1]))return l[0];if(l=e(),gr){wt(!0);try{e()}finally{wt(!1)}}return i.memoizedState=[l,t],l}function ac(e,t,i){return i===void 0||(ii&1073741824)!==0&&(Ge&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=Qd(),Ne.lanes|=e,ji|=e,i)}function Qf(e,t,i,l){return hn(i,t)?i:$r.current!==null?(e=ac(e,i,l),hn(e,t)||(Mt=!0),e):(ii&42)===0||(ii&1073741824)!==0&&(Ge&261930)===0?(Mt=!0,e.memoizedState=i):(e=Qd(),Ne.lanes|=e,ji|=e,t)}function Zf(e,t,i,l,p){var C=$.p;$.p=C!==0&&8>C?C:8;var O=V.T,P={};V.T=P,uc(e,!1,t,i);try{var X=p(),le=V.S;if(le!==null&&le(P,X),X!==null&&typeof X=="object"&&typeof X.then=="function"){var fe=Nv(X,l);Fs(e,t,fe,_n(e))}else Fs(e,t,l,_n(e))}catch(ge){Fs(e,t,{then:function(){},status:"rejected",reason:ge},_n())}finally{$.p=C,O!==null&&P.types!==null&&(O.types=P.types),V.T=O}}function Fv(){}function oc(e,t,i,l){if(e.tag!==5)throw Error(o(476));var p=Jf(e).queue;Zf(e,p,t,ee,i===null?Fv:function(){return ed(e),i(l)})}function Jf(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ee,baseState:ee,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ri,lastRenderedState:ee},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ri,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ed(e){var t=Jf(e);t.next===null&&(t=e.alternate.memoizedState),Fs(e,t.next.queue,{},_n())}function cc(){return Ft(sl)}function td(){return Et().memoizedState}function nd(){return Et().memoizedState}function qv(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=_n();e=Ri(i);var l=Di(t,e,i);l!==null&&(an(l,t,i),Hs(l,t,i)),t={cache:zo()},e.payload=t;return}t=t.return}}function Gv(e,t,i){var l=_n();i={lane:l,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},la(e)?rd(t,i):(i=Ao(e,t,i,l),i!==null&&(an(i,e,l),sd(i,t,l)))}function id(e,t,i){var l=_n();Fs(e,t,i,l)}function Fs(e,t,i,l){var p={lane:l,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(la(e))rd(t,p);else{var C=e.alternate;if(e.lanes===0&&(C===null||C.lanes===0)&&(C=t.lastRenderedReducer,C!==null))try{var O=t.lastRenderedState,P=C(O,i);if(p.hasEagerState=!0,p.eagerState=P,hn(P,O))return Ul(e,t,p,0),ct===null&&Il(),!1}catch{}finally{}if(i=Ao(e,t,p,l),i!==null)return an(i,e,l),sd(i,t,l),!0}return!1}function uc(e,t,i,l){if(l={lane:2,revertLane:Fc(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},la(e)){if(t)throw Error(o(479))}else t=Ao(e,i,l,2),t!==null&&an(t,e,2)}function la(e){var t=e.alternate;return e===Ne||t!==null&&t===Ne}function rd(e,t){Kr=Jl=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function sd(e,t,i){if((i&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,i|=l,t.lanes=i,vi(e,i)}}var qs={readContext:Ft,use:na,useCallback:St,useContext:St,useEffect:St,useImperativeHandle:St,useLayoutEffect:St,useInsertionEffect:St,useMemo:St,useReducer:St,useRef:St,useState:St,useDebugValue:St,useDeferredValue:St,useTransition:St,useSyncExternalStore:St,useId:St,useHostTransitionStatus:St,useFormState:St,useActionState:St,useOptimistic:St,useMemoCache:St,useCacheRefresh:St};qs.useEffectEvent=St;var ld={readContext:Ft,use:na,useCallback:function(e,t){return Qt().memoizedState=[e,t===void 0?null:t],e},useContext:Ft,useEffect:qf,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,ra(4194308,4,Kf.bind(null,t,e),i)},useLayoutEffect:function(e,t){return ra(4194308,4,e,t)},useInsertionEffect:function(e,t){ra(4,2,e,t)},useMemo:function(e,t){var i=Qt();t=t===void 0?null:t;var l=e();if(gr){wt(!0);try{e()}finally{wt(!1)}}return i.memoizedState=[l,t],l},useReducer:function(e,t,i){var l=Qt();if(i!==void 0){var p=i(t);if(gr){wt(!0);try{i(t)}finally{wt(!1)}}}else p=t;return l.memoizedState=l.baseState=p,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:p},l.queue=e,e=e.dispatch=Gv.bind(null,Ne,e),[l.memoizedState,e]},useRef:function(e){var t=Qt();return e={current:e},t.memoizedState=e},useState:function(e){e=ic(e);var t=e.queue,i=id.bind(null,Ne,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:lc,useDeferredValue:function(e,t){var i=Qt();return ac(i,e,t)},useTransition:function(){var e=ic(!1);return e=Zf.bind(null,Ne,e.queue,!0,!1),Qt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var l=Ne,p=Qt();if($e){if(i===void 0)throw Error(o(407));i=i()}else{if(i=t(),ct===null)throw Error(o(349));(Ge&127)!==0||Af(l,t,i)}p.memoizedState=i;var C={value:i,getSnapshot:t};return p.queue=C,qf(Rf.bind(null,l,C,e),[e]),l.flags|=2048,Wr(9,{destroy:void 0},Tf.bind(null,l,C,i,t),null),i},useId:function(){var e=Qt(),t=ct.identifierPrefix;if($e){var i=Pn,l=Un;i=(l&~(1<<32-Xe(l)-1)).toString(32)+i,t="_"+t+"R_"+i,i=ea++,0<i&&(t+="H"+i.toString(32)),t+="_"}else i=Hv++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:cc,useFormState:zf,useActionState:zf,useOptimistic:function(e){var t=Qt();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=uc.bind(null,Ne,!0,i),i.dispatch=t,[e,t]},useMemoCache:ec,useCacheRefresh:function(){return Qt().memoizedState=qv.bind(null,Ne)},useEffectEvent:function(e){var t=Qt(),i={impl:e};return t.memoizedState=i,function(){if((et&2)!==0)throw Error(o(440));return i.impl.apply(void 0,arguments)}}},hc={readContext:Ft,use:na,useCallback:Wf,useContext:Ft,useEffect:sc,useImperativeHandle:Yf,useInsertionEffect:Vf,useLayoutEffect:$f,useMemo:Xf,useReducer:ia,useRef:Ff,useState:function(){return ia(ri)},useDebugValue:lc,useDeferredValue:function(e,t){var i=Et();return Qf(i,lt.memoizedState,e,t)},useTransition:function(){var e=ia(ri)[0],t=Et().memoizedState;return[typeof e=="boolean"?e:Ps(e),t]},useSyncExternalStore:kf,useId:td,useHostTransitionStatus:cc,useFormState:If,useActionState:If,useOptimistic:function(e,t){var i=Et();return Lf(i,lt,e,t)},useMemoCache:ec,useCacheRefresh:nd};hc.useEffectEvent=Gf;var ad={readContext:Ft,use:na,useCallback:Wf,useContext:Ft,useEffect:sc,useImperativeHandle:Yf,useInsertionEffect:Vf,useLayoutEffect:$f,useMemo:Xf,useReducer:nc,useRef:Ff,useState:function(){return nc(ri)},useDebugValue:lc,useDeferredValue:function(e,t){var i=Et();return lt===null?ac(i,e,t):Qf(i,lt.memoizedState,e,t)},useTransition:function(){var e=nc(ri)[0],t=Et().memoizedState;return[typeof e=="boolean"?e:Ps(e),t]},useSyncExternalStore:kf,useId:td,useHostTransitionStatus:cc,useFormState:Pf,useActionState:Pf,useOptimistic:function(e,t){var i=Et();return lt!==null?Lf(i,lt,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:ec,useCacheRefresh:nd};ad.useEffectEvent=Gf;function fc(e,t,i,l){t=e.memoizedState,i=i(l,t),i=i==null?t:u({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var dc={enqueueSetState:function(e,t,i){e=e._reactInternals;var l=_n(),p=Ri(l);p.payload=t,i!=null&&(p.callback=i),t=Di(e,p,l),t!==null&&(an(t,e,l),Hs(t,e,l))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var l=_n(),p=Ri(l);p.tag=1,p.payload=t,i!=null&&(p.callback=i),t=Di(e,p,l),t!==null&&(an(t,e,l),Hs(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=_n(),l=Ri(i);l.tag=2,t!=null&&(l.callback=t),t=Di(e,l,i),t!==null&&(an(t,e,i),Hs(t,e,i))}};function od(e,t,i,l,p,C,O){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,C,O):t.prototype&&t.prototype.isPureReactComponent?!Rs(i,l)||!Rs(p,C):!0}function cd(e,t,i,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,l),t.state!==e&&dc.enqueueReplaceState(t,t.state,null)}function _r(e,t){var i=t;if("ref"in t){i={};for(var l in t)l!=="ref"&&(i[l]=t[l])}if(e=e.defaultProps){i===t&&(i=u({},i));for(var p in e)i[p]===void 0&&(i[p]=e[p])}return i}function ud(e){zl(e)}function hd(e){console.error(e)}function fd(e){zl(e)}function aa(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function dd(e,t,i){try{var l=e.onCaughtError;l(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function pc(e,t,i){return i=Ri(i),i.tag=3,i.payload={element:null},i.callback=function(){aa(e,t)},i}function pd(e){return e=Ri(e),e.tag=3,e}function md(e,t,i,l){var p=i.type.getDerivedStateFromError;if(typeof p=="function"){var C=l.value;e.payload=function(){return p(C)},e.callback=function(){dd(t,i,l)}}var O=i.stateNode;O!==null&&typeof O.componentDidCatch=="function"&&(e.callback=function(){dd(t,i,l),typeof p!="function"&&(Ni===null?Ni=new Set([this]):Ni.add(this));var P=l.stack;this.componentDidCatch(l.value,{componentStack:P!==null?P:""})})}function Vv(e,t,i,l,p){if(i.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=i.alternate,t!==null&&Pr(t,i,p,!0),i=dn.current,i!==null){switch(i.tag){case 31:case 13:return Tn===null?ya():i.alternate===null&&bt===0&&(bt=3),i.flags&=-257,i.flags|=65536,i.lanes=p,l===Yl?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([l]):t.add(l),Ic(e,l,p)),!1;case 22:return i.flags|=65536,l===Yl?i.flags|=16384:(t=i.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},i.updateQueue=t):(i=t.retryQueue,i===null?t.retryQueue=new Set([l]):i.add(l)),Ic(e,l,p)),!1}throw Error(o(435,i.tag))}return Ic(e,l,p),ya(),!1}if($e)return t=dn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=p,l!==Oo&&(e=Error(o(422),{cause:l}),Ls(xn(e,i)))):(l!==Oo&&(t=Error(o(423),{cause:l}),Ls(xn(t,i))),e=e.current.alternate,e.flags|=65536,p&=-p,e.lanes|=p,l=xn(l,i),p=pc(e.stateNode,l,p),Go(e,p),bt!==4&&(bt=2)),!1;var C=Error(o(520),{cause:l});if(C=xn(C,i),Qs===null?Qs=[C]:Qs.push(C),bt!==4&&(bt=2),t===null)return!0;l=xn(l,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=p&-p,i.lanes|=e,e=pc(i.stateNode,l,e),Go(i,e),!1;case 1:if(t=i.type,C=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||C!==null&&typeof C.componentDidCatch=="function"&&(Ni===null||!Ni.has(C))))return i.flags|=65536,p&=-p,i.lanes|=p,p=pd(p),md(p,e,i,l),Go(i,p),!1}i=i.return}while(i!==null);return!1}var mc=Error(o(461)),Mt=!1;function qt(e,t,i,l){t.child=e===null?yf(t,null,i,l):mr(t,e.child,i,l)}function gd(e,t,i,l,p){i=i.render;var C=t.ref;if("ref"in l){var O={};for(var P in l)P!=="ref"&&(O[P]=l[P])}else O=l;return hr(t),l=Xo(e,t,i,O,C,p),P=Qo(),e!==null&&!Mt?(Zo(e,t,p),si(e,t,p)):($e&&P&&Mo(t),t.flags|=1,qt(e,t,l,p),t.child)}function _d(e,t,i,l,p){if(e===null){var C=i.type;return typeof C=="function"&&!To(C)&&C.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=C,vd(e,t,C,l,p)):(e=Fl(i.type,null,l,t,t.mode,p),e.ref=t.ref,e.return=t,t.child=e)}if(C=e.child,!wc(e,p)){var O=C.memoizedProps;if(i=i.compare,i=i!==null?i:Rs,i(O,l)&&e.ref===t.ref)return si(e,t,p)}return t.flags|=1,e=Jn(C,l),e.ref=t.ref,e.return=t,t.child=e}function vd(e,t,i,l,p){if(e!==null){var C=e.memoizedProps;if(Rs(C,l)&&e.ref===t.ref)if(Mt=!1,t.pendingProps=l=C,wc(e,p))(e.flags&131072)!==0&&(Mt=!0);else return t.lanes=e.lanes,si(e,t,p)}return gc(e,t,i,l,p)}function yd(e,t,i,l){var p=l.children,C=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((t.flags&128)!==0){if(C=C!==null?C.baseLanes|i:i,e!==null){for(l=t.child=e.child,p=0;l!==null;)p=p|l.lanes|l.childLanes,l=l.sibling;l=p&~C}else l=0,t.child=null;return Sd(e,t,C,i,l)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&$l(t,C!==null?C.cachePool:null),C!==null?Cf(t,C):$o(),wf(t);else return l=t.lanes=536870912,Sd(e,t,C!==null?C.baseLanes|i:i,i,l)}else C!==null?($l(t,C.cachePool),Cf(t,C),Li(),t.memoizedState=null):(e!==null&&$l(t,null),$o(),Li());return qt(e,t,p,i),t.child}function Gs(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Sd(e,t,i,l,p){var C=Uo();return C=C===null?null:{parent:Rt._currentValue,pool:C},t.memoizedState={baseLanes:i,cachePool:C},e!==null&&$l(t,null),$o(),wf(t),e!==null&&Pr(e,t,l,!0),t.childLanes=p,null}function oa(e,t){return t=ua({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function bd(e,t,i){return mr(t,e.child,null,i),e=oa(t,t.pendingProps),e.flags|=2,pn(t),t.memoizedState=null,e}function $v(e,t,i){var l=t.pendingProps,p=(t.flags&128)!==0;if(t.flags&=-129,e===null){if($e){if(l.mode==="hidden")return e=oa(t,l),t.lanes=536870912,Gs(null,e);if(Yo(t),(e=pt)?(e=Op(e,An),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:xi!==null?{id:Un,overflow:Pn}:null,retryLane:536870912,hydrationErrors:null},i=rf(e),i.return=t,t.child=i,Pt=t,pt=null)):e=null,e===null)throw ki(t);return t.lanes=536870912,null}return oa(t,l)}var C=e.memoizedState;if(C!==null){var O=C.dehydrated;if(Yo(t),p)if(t.flags&256)t.flags&=-257,t=bd(e,t,i);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(Mt||Pr(e,t,i,!1),p=(i&e.childLanes)!==0,Mt||p){if(l=ct,l!==null&&(O=er(l,i),O!==0&&O!==C.retryLane))throw C.retryLane=O,ar(e,O),an(l,e,O),mc;ya(),t=bd(e,t,i)}else e=C.treeContext,pt=Rn(O.nextSibling),Pt=t,$e=!0,Ei=null,An=!1,e!==null&&af(t,e),t=oa(t,l),t.flags|=4096;return t}return e=Jn(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function ca(e,t){var i=t.ref;if(i===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(o(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function gc(e,t,i,l,p){return hr(t),i=Xo(e,t,i,l,void 0,p),l=Qo(),e!==null&&!Mt?(Zo(e,t,p),si(e,t,p)):($e&&l&&Mo(t),t.flags|=1,qt(e,t,i,p),t.child)}function Cd(e,t,i,l,p,C){return hr(t),t.updateQueue=null,i=Ef(t,l,i,p),xf(e),l=Qo(),e!==null&&!Mt?(Zo(e,t,C),si(e,t,C)):($e&&l&&Mo(t),t.flags|=1,qt(e,t,i,C),t.child)}function wd(e,t,i,l,p){if(hr(t),t.stateNode===null){var C=Hr,O=i.contextType;typeof O=="object"&&O!==null&&(C=Ft(O)),C=new i(l,C),t.memoizedState=C.state!==null&&C.state!==void 0?C.state:null,C.updater=dc,t.stateNode=C,C._reactInternals=t,C=t.stateNode,C.props=l,C.state=t.memoizedState,C.refs={},Fo(t),O=i.contextType,C.context=typeof O=="object"&&O!==null?Ft(O):Hr,C.state=t.memoizedState,O=i.getDerivedStateFromProps,typeof O=="function"&&(fc(t,i,O,l),C.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof C.getSnapshotBeforeUpdate=="function"||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(O=C.state,typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount(),O!==C.state&&dc.enqueueReplaceState(C,C.state,null),Is(t,l,C,p),zs(),C.state=t.memoizedState),typeof C.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){C=t.stateNode;var P=t.memoizedProps,X=_r(i,P);C.props=X;var le=C.context,fe=i.contextType;O=Hr,typeof fe=="object"&&fe!==null&&(O=Ft(fe));var ge=i.getDerivedStateFromProps;fe=typeof ge=="function"||typeof C.getSnapshotBeforeUpdate=="function",P=t.pendingProps!==P,fe||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(P||le!==O)&&cd(t,C,l,O),Ti=!1;var ae=t.memoizedState;C.state=ae,Is(t,l,C,p),zs(),le=t.memoizedState,P||ae!==le||Ti?(typeof ge=="function"&&(fc(t,i,ge,l),le=t.memoizedState),(X=Ti||od(t,i,X,l,ae,le,O))?(fe||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount()),typeof C.componentDidMount=="function"&&(t.flags|=4194308)):(typeof C.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=le),C.props=l,C.state=le,C.context=O,l=X):(typeof C.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{C=t.stateNode,qo(e,t),O=t.memoizedProps,fe=_r(i,O),C.props=fe,ge=t.pendingProps,ae=C.context,le=i.contextType,X=Hr,typeof le=="object"&&le!==null&&(X=Ft(le)),P=i.getDerivedStateFromProps,(le=typeof P=="function"||typeof C.getSnapshotBeforeUpdate=="function")||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(O!==ge||ae!==X)&&cd(t,C,l,X),Ti=!1,ae=t.memoizedState,C.state=ae,Is(t,l,C,p),zs();var ce=t.memoizedState;O!==ge||ae!==ce||Ti||e!==null&&e.dependencies!==null&&Gl(e.dependencies)?(typeof P=="function"&&(fc(t,i,P,l),ce=t.memoizedState),(fe=Ti||od(t,i,fe,l,ae,ce,X)||e!==null&&e.dependencies!==null&&Gl(e.dependencies))?(le||typeof C.UNSAFE_componentWillUpdate!="function"&&typeof C.componentWillUpdate!="function"||(typeof C.componentWillUpdate=="function"&&C.componentWillUpdate(l,ce,X),typeof C.UNSAFE_componentWillUpdate=="function"&&C.UNSAFE_componentWillUpdate(l,ce,X)),typeof C.componentDidUpdate=="function"&&(t.flags|=4),typeof C.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof C.componentDidUpdate!="function"||O===e.memoizedProps&&ae===e.memoizedState||(t.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||O===e.memoizedProps&&ae===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=ce),C.props=l,C.state=ce,C.context=X,l=fe):(typeof C.componentDidUpdate!="function"||O===e.memoizedProps&&ae===e.memoizedState||(t.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||O===e.memoizedProps&&ae===e.memoizedState||(t.flags|=1024),l=!1)}return C=l,ca(e,t),l=(t.flags&128)!==0,C||l?(C=t.stateNode,i=l&&typeof i.getDerivedStateFromError!="function"?null:C.render(),t.flags|=1,e!==null&&l?(t.child=mr(t,e.child,null,p),t.child=mr(t,null,i,p)):qt(e,t,i,p),t.memoizedState=C.state,e=t.child):e=si(e,t,p),e}function xd(e,t,i,l){return cr(),t.flags|=256,qt(e,t,i,l),t.child}var _c={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function vc(e){return{baseLanes:e,cachePool:df()}}function yc(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=gn),e}function Ed(e,t,i){var l=t.pendingProps,p=!1,C=(t.flags&128)!==0,O;if((O=C)||(O=e!==null&&e.memoizedState===null?!1:(xt.current&2)!==0),O&&(p=!0,t.flags&=-129),O=(t.flags&32)!==0,t.flags&=-33,e===null){if($e){if(p?Mi(t):Li(),(e=pt)?(e=Op(e,An),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:xi!==null?{id:Un,overflow:Pn}:null,retryLane:536870912,hydrationErrors:null},i=rf(e),i.return=t,t.child=i,Pt=t,pt=null)):e=null,e===null)throw ki(t);return tu(e)?t.lanes=32:t.lanes=536870912,null}var P=l.children;return l=l.fallback,p?(Li(),p=t.mode,P=ua({mode:"hidden",children:P},p),l=or(l,p,i,null),P.return=t,l.return=t,P.sibling=l,t.child=P,l=t.child,l.memoizedState=vc(i),l.childLanes=yc(e,O,i),t.memoizedState=_c,Gs(null,l)):(Mi(t),Sc(t,P))}var X=e.memoizedState;if(X!==null&&(P=X.dehydrated,P!==null)){if(C)t.flags&256?(Mi(t),t.flags&=-257,t=bc(e,t,i)):t.memoizedState!==null?(Li(),t.child=e.child,t.flags|=128,t=null):(Li(),P=l.fallback,p=t.mode,l=ua({mode:"visible",children:l.children},p),P=or(P,p,i,null),P.flags|=2,l.return=t,P.return=t,l.sibling=P,t.child=l,mr(t,e.child,null,i),l=t.child,l.memoizedState=vc(i),l.childLanes=yc(e,O,i),t.memoizedState=_c,t=Gs(null,l));else if(Mi(t),tu(P)){if(O=P.nextSibling&&P.nextSibling.dataset,O)var le=O.dgst;O=le,l=Error(o(419)),l.stack="",l.digest=O,Ls({value:l,source:null,stack:null}),t=bc(e,t,i)}else if(Mt||Pr(e,t,i,!1),O=(i&e.childLanes)!==0,Mt||O){if(O=ct,O!==null&&(l=er(O,i),l!==0&&l!==X.retryLane))throw X.retryLane=l,ar(e,l),an(O,e,l),mc;eu(P)||ya(),t=bc(e,t,i)}else eu(P)?(t.flags|=192,t.child=e.child,t=null):(e=X.treeContext,pt=Rn(P.nextSibling),Pt=t,$e=!0,Ei=null,An=!1,e!==null&&af(t,e),t=Sc(t,l.children),t.flags|=4096);return t}return p?(Li(),P=l.fallback,p=t.mode,X=e.child,le=X.sibling,l=Jn(X,{mode:"hidden",children:l.children}),l.subtreeFlags=X.subtreeFlags&65011712,le!==null?P=Jn(le,P):(P=or(P,p,i,null),P.flags|=2),P.return=t,l.return=t,l.sibling=P,t.child=l,Gs(null,l),l=t.child,P=e.child.memoizedState,P===null?P=vc(i):(p=P.cachePool,p!==null?(X=Rt._currentValue,p=p.parent!==X?{parent:X,pool:X}:p):p=df(),P={baseLanes:P.baseLanes|i,cachePool:p}),l.memoizedState=P,l.childLanes=yc(e,O,i),t.memoizedState=_c,Gs(e.child,l)):(Mi(t),i=e.child,e=i.sibling,i=Jn(i,{mode:"visible",children:l.children}),i.return=t,i.sibling=null,e!==null&&(O=t.deletions,O===null?(t.deletions=[e],t.flags|=16):O.push(e)),t.child=i,t.memoizedState=null,i)}function Sc(e,t){return t=ua({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ua(e,t){return e=fn(22,e,null,t),e.lanes=0,e}function bc(e,t,i){return mr(t,e.child,null,i),e=Sc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function kd(e,t,i){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),No(e.return,t,i)}function Cc(e,t,i,l,p,C){var O=e.memoizedState;O===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:i,tailMode:p,treeForkCount:C}:(O.isBackwards=t,O.rendering=null,O.renderingStartTime=0,O.last=l,O.tail=i,O.tailMode=p,O.treeForkCount=C)}function Ad(e,t,i){var l=t.pendingProps,p=l.revealOrder,C=l.tail;l=l.children;var O=xt.current,P=(O&2)!==0;if(P?(O=O&1|2,t.flags|=128):O&=1,H(xt,O),qt(e,t,l,i),l=$e?Ms:0,!P&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&kd(e,i,t);else if(e.tag===19)kd(e,i,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(p){case"forwards":for(i=t.child,p=null;i!==null;)e=i.alternate,e!==null&&Zl(e)===null&&(p=i),i=i.sibling;i=p,i===null?(p=t.child,t.child=null):(p=i.sibling,i.sibling=null),Cc(t,!1,p,i,C,l);break;case"backwards":case"unstable_legacy-backwards":for(i=null,p=t.child,t.child=null;p!==null;){if(e=p.alternate,e!==null&&Zl(e)===null){t.child=p;break}e=p.sibling,p.sibling=i,i=p,p=e}Cc(t,!0,i,null,C,l);break;case"together":Cc(t,!1,null,null,void 0,l);break;default:t.memoizedState=null}return t.child}function si(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),ji|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(Pr(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,i=Jn(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=Jn(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function wc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Gl(e)))}function Kv(e,t,i){switch(t.tag){case 3:q(t,t.stateNode.containerInfo),Ai(t,Rt,e.memoizedState.cache),cr();break;case 27:case 5:J(t);break;case 4:q(t,t.stateNode.containerInfo);break;case 10:Ai(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Yo(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(Mi(t),t.flags|=128,null):(i&t.child.childLanes)!==0?Ed(e,t,i):(Mi(t),e=si(e,t,i),e!==null?e.sibling:null);Mi(t);break;case 19:var p=(e.flags&128)!==0;if(l=(i&t.childLanes)!==0,l||(Pr(e,t,i,!1),l=(i&t.childLanes)!==0),p){if(l)return Ad(e,t,i);t.flags|=128}if(p=t.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),H(xt,xt.current),l)break;return null;case 22:return t.lanes=0,yd(e,t,i,t.pendingProps);case 24:Ai(t,Rt,e.memoizedState.cache)}return si(e,t,i)}function Td(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)Mt=!0;else{if(!wc(e,i)&&(t.flags&128)===0)return Mt=!1,Kv(e,t,i);Mt=(e.flags&131072)!==0}else Mt=!1,$e&&(t.flags&1048576)!==0&&lf(t,Ms,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=dr(t.elementType),t.type=e,typeof e=="function")To(e)?(l=_r(e,l),t.tag=1,t=wd(null,t,e,l,i)):(t.tag=0,t=gc(null,t,e,l,i));else{if(e!=null){var p=e.$$typeof;if(p===E){t.tag=11,t=gd(null,t,e,l,i);break e}else if(p===T){t.tag=14,t=_d(null,t,e,l,i);break e}}throw t=K(e)||e,Error(o(306,t,""))}}return t;case 0:return gc(e,t,t.type,t.pendingProps,i);case 1:return l=t.type,p=_r(l,t.pendingProps),wd(e,t,l,p,i);case 3:e:{if(q(t,t.stateNode.containerInfo),e===null)throw Error(o(387));l=t.pendingProps;var C=t.memoizedState;p=C.element,qo(e,t),Is(t,l,null,i);var O=t.memoizedState;if(l=O.cache,Ai(t,Rt,l),l!==C.cache&&Ho(t,[Rt],i,!0),zs(),l=O.element,C.isDehydrated)if(C={element:l,isDehydrated:!1,cache:O.cache},t.updateQueue.baseState=C,t.memoizedState=C,t.flags&256){t=xd(e,t,l,i);break e}else if(l!==p){p=xn(Error(o(424)),t),Ls(p),t=xd(e,t,l,i);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(pt=Rn(e.firstChild),Pt=t,$e=!0,Ei=null,An=!0,i=yf(t,null,l,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(cr(),l===p){t=si(e,t,i);break e}qt(e,t,l,i)}t=t.child}return t;case 26:return ca(e,t),e===null?(i=Ip(t.type,null,t.pendingProps,null))?t.memoizedState=i:$e||(i=t.type,e=t.pendingProps,l=ka(me.current).createElement(i),l[st]=t,l[Ut]=e,Gt(l,i,e),ft(l),t.stateNode=l):t.memoizedState=Ip(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return J(t),e===null&&$e&&(l=t.stateNode=Np(t.type,t.pendingProps,me.current),Pt=t,An=!0,p=pt,Ui(t.type)?(nu=p,pt=Rn(l.firstChild)):pt=p),qt(e,t,t.pendingProps.children,i),ca(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&$e&&((p=l=pt)&&(l=w0(l,t.type,t.pendingProps,An),l!==null?(t.stateNode=l,Pt=t,pt=Rn(l.firstChild),An=!1,p=!0):p=!1),p||ki(t)),J(t),p=t.type,C=t.pendingProps,O=e!==null?e.memoizedProps:null,l=C.children,Qc(p,C)?l=null:O!==null&&Qc(p,O)&&(t.flags|=32),t.memoizedState!==null&&(p=Xo(e,t,zv,null,null,i),sl._currentValue=p),ca(e,t),qt(e,t,l,i),t.child;case 6:return e===null&&$e&&((e=i=pt)&&(i=x0(i,t.pendingProps,An),i!==null?(t.stateNode=i,Pt=t,pt=null,e=!0):e=!1),e||ki(t)),null;case 13:return Ed(e,t,i);case 4:return q(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=mr(t,null,l,i):qt(e,t,l,i),t.child;case 11:return gd(e,t,t.type,t.pendingProps,i);case 7:return qt(e,t,t.pendingProps,i),t.child;case 8:return qt(e,t,t.pendingProps.children,i),t.child;case 12:return qt(e,t,t.pendingProps.children,i),t.child;case 10:return l=t.pendingProps,Ai(t,t.type,l.value),qt(e,t,l.children,i),t.child;case 9:return p=t.type._context,l=t.pendingProps.children,hr(t),p=Ft(p),l=l(p),t.flags|=1,qt(e,t,l,i),t.child;case 14:return _d(e,t,t.type,t.pendingProps,i);case 15:return vd(e,t,t.type,t.pendingProps,i);case 19:return Ad(e,t,i);case 31:return $v(e,t,i);case 22:return yd(e,t,i,t.pendingProps);case 24:return hr(t),l=Ft(Rt),e===null?(p=Uo(),p===null&&(p=ct,C=zo(),p.pooledCache=C,C.refCount++,C!==null&&(p.pooledCacheLanes|=i),p=C),t.memoizedState={parent:l,cache:p},Fo(t),Ai(t,Rt,p)):((e.lanes&i)!==0&&(qo(e,t),Is(t,null,null,i),zs()),p=e.memoizedState,C=t.memoizedState,p.parent!==l?(p={parent:l,cache:l},t.memoizedState=p,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=p),Ai(t,Rt,l)):(l=C.cache,Ai(t,Rt,l),l!==p.cache&&Ho(t,[Rt],i,!0))),qt(e,t,t.pendingProps.children,i),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function li(e){e.flags|=4}function xc(e,t,i,l,p){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(p&335544128)===p)if(e.stateNode.complete)e.flags|=8192;else if(tp())e.flags|=8192;else throw pr=Yl,Po}else e.flags&=-16777217}function Rd(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Gp(t))if(tp())e.flags|=8192;else throw pr=Yl,Po}function ha(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?vs():536870912,e.lanes|=t,Jr|=t)}function Vs(e,t){if(!$e)switch(e.tailMode){case"hidden":t=e.tail;for(var i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function mt(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,l=0;if(t)for(var p=e.child;p!==null;)i|=p.lanes|p.childLanes,l|=p.subtreeFlags&65011712,l|=p.flags&65011712,p.return=e,p=p.sibling;else for(p=e.child;p!==null;)i|=p.lanes|p.childLanes,l|=p.subtreeFlags,l|=p.flags,p.return=e,p=p.sibling;return e.subtreeFlags|=l,e.childLanes=i,t}function Yv(e,t,i){var l=t.pendingProps;switch(Lo(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 i=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),ni(Rt),oe(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Ur(t)?li(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Bo())),mt(t),null;case 26:var p=t.type,C=t.memoizedState;return e===null?(li(t),C!==null?(mt(t),Rd(t,C)):(mt(t),xc(t,p,null,l,i))):C?C!==e.memoizedState?(li(t),mt(t),Rd(t,C)):(mt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&li(t),mt(t),xc(t,p,e,l,i)),null;case 27:if(ie(t),i=me.current,p=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&li(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return mt(t),null}e=te.current,Ur(t)?of(t):(e=Np(p,l,i),t.stateNode=e,li(t))}return mt(t),null;case 5:if(ie(t),p=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&li(t);else{if(!l){if(t.stateNode===null)throw Error(o(166));return mt(t),null}if(C=te.current,Ur(t))of(t);else{var O=ka(me.current);switch(C){case 1:C=O.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:C=O.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":C=O.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":C=O.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":C=O.createElement("div"),C.innerHTML="<script><\/script>",C=C.removeChild(C.firstChild);break;case"select":C=typeof l.is=="string"?O.createElement("select",{is:l.is}):O.createElement("select"),l.multiple?C.multiple=!0:l.size&&(C.size=l.size);break;default:C=typeof l.is=="string"?O.createElement(p,{is:l.is}):O.createElement(p)}}C[st]=t,C[Ut]=l;e:for(O=t.child;O!==null;){if(O.tag===5||O.tag===6)C.appendChild(O.stateNode);else if(O.tag!==4&&O.tag!==27&&O.child!==null){O.child.return=O,O=O.child;continue}if(O===t)break e;for(;O.sibling===null;){if(O.return===null||O.return===t)break e;O=O.return}O.sibling.return=O.return,O=O.sibling}t.stateNode=C;e:switch(Gt(C,p,l),p){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&li(t)}}return mt(t),xc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&li(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(o(166));if(e=me.current,Ur(t)){if(e=t.stateNode,i=t.memoizedProps,l=null,p=Pt,p!==null)switch(p.tag){case 27:case 5:l=p.memoizedProps}e[st]=t,e=!!(e.nodeValue===i||l!==null&&l.suppressHydrationWarning===!0||Ep(e.nodeValue,i)),e||ki(t,!0)}else e=ka(e).createTextNode(l),e[st]=t,t.stateNode=e}return mt(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(l=Ur(t),i!==null){if(e===null){if(!l)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[st]=t}else cr(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;mt(t),e=!1}else i=Bo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?(pn(t),t):(pn(t),null);if((t.flags&128)!==0)throw Error(o(558))}return mt(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(p=Ur(t),l!==null&&l.dehydrated!==null){if(e===null){if(!p)throw Error(o(318));if(p=t.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(o(317));p[st]=t}else cr(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;mt(t),p=!1}else p=Bo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=p),p=!0;if(!p)return t.flags&256?(pn(t),t):(pn(t),null)}return pn(t),(t.flags&128)!==0?(t.lanes=i,t):(i=l!==null,e=e!==null&&e.memoizedState!==null,i&&(l=t.child,p=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(p=l.alternate.memoizedState.cachePool.pool),C=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(C=l.memoizedState.cachePool.pool),C!==p&&(l.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),ha(t,t.updateQueue),mt(t),null);case 4:return oe(),e===null&&$c(t.stateNode.containerInfo),mt(t),null;case 10:return ni(t.type),mt(t),null;case 19:if(G(xt),l=t.memoizedState,l===null)return mt(t),null;if(p=(t.flags&128)!==0,C=l.rendering,C===null)if(p)Vs(l,!1);else{if(bt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(C=Zl(e),C!==null){for(t.flags|=128,Vs(l,!1),e=C.updateQueue,t.updateQueue=e,ha(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)nf(i,e),i=i.sibling;return H(xt,xt.current&1|2),$e&&ei(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&rt()>ga&&(t.flags|=128,p=!0,Vs(l,!1),t.lanes=4194304)}else{if(!p)if(e=Zl(C),e!==null){if(t.flags|=128,p=!0,e=e.updateQueue,t.updateQueue=e,ha(t,e),Vs(l,!0),l.tail===null&&l.tailMode==="hidden"&&!C.alternate&&!$e)return mt(t),null}else 2*rt()-l.renderingStartTime>ga&&i!==536870912&&(t.flags|=128,p=!0,Vs(l,!1),t.lanes=4194304);l.isBackwards?(C.sibling=t.child,t.child=C):(e=l.last,e!==null?e.sibling=C:t.child=C,l.last=C)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=rt(),e.sibling=null,i=xt.current,H(xt,p?i&1|2:i&1),$e&&ei(t,l.treeForkCount),e):(mt(t),null);case 22:case 23:return pn(t),Ko(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(i&536870912)!==0&&(t.flags&128)===0&&(mt(t),t.subtreeFlags&6&&(t.flags|=8192)):mt(t),i=t.updateQueue,i!==null&&ha(t,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==i&&(t.flags|=2048),e!==null&&G(fr),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),ni(Rt),mt(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function Wv(e,t){switch(Lo(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ni(Rt),oe(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ie(t),null;case 31:if(t.memoizedState!==null){if(pn(t),t.alternate===null)throw Error(o(340));cr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(pn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));cr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return G(xt),null;case 4:return oe(),null;case 10:return ni(t.type),null;case 22:case 23:return pn(t),Ko(),e!==null&&G(fr),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ni(Rt),null;case 25:return null;default:return null}}function Dd(e,t){switch(Lo(t),t.tag){case 3:ni(Rt),oe();break;case 26:case 27:case 5:ie(t);break;case 4:oe();break;case 31:t.memoizedState!==null&&pn(t);break;case 13:pn(t);break;case 19:G(xt);break;case 10:ni(t.type);break;case 22:case 23:pn(t),Ko(),e!==null&&G(fr);break;case 24:ni(Rt)}}function $s(e,t){try{var i=t.updateQueue,l=i!==null?i.lastEffect:null;if(l!==null){var p=l.next;i=p;do{if((i.tag&e)===e){l=void 0;var C=i.create,O=i.inst;l=C(),O.destroy=l}i=i.next}while(i!==p)}}catch(P){nt(t,t.return,P)}}function Oi(e,t,i){try{var l=t.updateQueue,p=l!==null?l.lastEffect:null;if(p!==null){var C=p.next;l=C;do{if((l.tag&e)===e){var O=l.inst,P=O.destroy;if(P!==void 0){O.destroy=void 0,p=t;var X=i,le=P;try{le()}catch(fe){nt(p,X,fe)}}}l=l.next}while(l!==C)}}catch(fe){nt(t,t.return,fe)}}function Md(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{bf(t,i)}catch(l){nt(e,e.return,l)}}}function Ld(e,t,i){i.props=_r(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(l){nt(e,t,l)}}function Ks(e,t){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof i=="function"?e.refCleanup=i(l):i.current=l}}catch(p){nt(e,t,p)}}function Fn(e,t){var i=e.ref,l=e.refCleanup;if(i!==null)if(typeof l=="function")try{l()}catch(p){nt(e,t,p)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(p){nt(e,t,p)}else i.current=null}function Od(e){var t=e.type,i=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":i.autoFocus&&l.focus();break e;case"img":i.src?l.src=i.src:i.srcSet&&(l.srcset=i.srcSet)}}catch(p){nt(e,e.return,p)}}function Ec(e,t,i){try{var l=e.stateNode;_0(l,e.type,i,t),l[Ut]=t}catch(p){nt(e,e.return,p)}}function Bd(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ui(e.type)||e.tag===4}function kc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Bd(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&&Ui(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 Ac(e,t,i){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(e,t):(t=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,t.appendChild(e),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=Qn));else if(l!==4&&(l===27&&Ui(e.type)&&(i=e.stateNode,t=null),e=e.child,e!==null))for(Ac(e,t,i),e=e.sibling;e!==null;)Ac(e,t,i),e=e.sibling}function fa(e,t,i){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?i.insertBefore(e,t):i.appendChild(e);else if(l!==4&&(l===27&&Ui(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(fa(e,t,i),e=e.sibling;e!==null;)fa(e,t,i),e=e.sibling}function jd(e){var t=e.stateNode,i=e.memoizedProps;try{for(var l=e.type,p=t.attributes;p.length;)t.removeAttributeNode(p[0]);Gt(t,l,i),t[st]=e,t[Ut]=i}catch(C){nt(e,e.return,C)}}var ai=!1,Lt=!1,Tc=!1,Nd=typeof WeakSet=="function"?WeakSet:Set,Ht=null;function Xv(e,t){if(e=e.containerInfo,Wc=Oa,e=Kh(e),bo(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var l=i.getSelection&&i.getSelection();if(l&&l.rangeCount!==0){i=l.anchorNode;var p=l.anchorOffset,C=l.focusNode;l=l.focusOffset;try{i.nodeType,C.nodeType}catch{i=null;break e}var O=0,P=-1,X=-1,le=0,fe=0,ge=e,ae=null;t:for(;;){for(var ce;ge!==i||p!==0&&ge.nodeType!==3||(P=O+p),ge!==C||l!==0&&ge.nodeType!==3||(X=O+l),ge.nodeType===3&&(O+=ge.nodeValue.length),(ce=ge.firstChild)!==null;)ae=ge,ge=ce;for(;;){if(ge===e)break t;if(ae===i&&++le===p&&(P=O),ae===C&&++fe===l&&(X=O),(ce=ge.nextSibling)!==null)break;ge=ae,ae=ge.parentNode}ge=ce}i=P===-1||X===-1?null:{start:P,end:X}}else i=null}i=i||{start:0,end:0}}else i=null;for(Xc={focusedElem:e,selectionRange:i},Oa=!1,Ht=t;Ht!==null;)if(t=Ht,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ht=e;else for(;Ht!==null;){switch(t=Ht,C=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(i=0;i<e.length;i++)p=e[i],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&C!==null){e=void 0,i=t,p=C.memoizedProps,C=C.memoizedState,l=i.stateNode;try{var Ee=_r(i.type,p);e=l.getSnapshotBeforeUpdate(Ee,C),l.__reactInternalSnapshotBeforeUpdate=e}catch(Le){nt(i,i.return,Le)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,i=e.nodeType,i===9)Jc(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Jc(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(o(163))}if(e=t.sibling,e!==null){e.return=t.return,Ht=e;break}Ht=t.return}}function Hd(e,t,i){var l=i.flags;switch(i.tag){case 0:case 11:case 15:ci(e,i),l&4&&$s(5,i);break;case 1:if(ci(e,i),l&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(O){nt(i,i.return,O)}else{var p=_r(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(p,t,e.__reactInternalSnapshotBeforeUpdate)}catch(O){nt(i,i.return,O)}}l&64&&Md(i),l&512&&Ks(i,i.return);break;case 3:if(ci(e,i),l&64&&(e=i.updateQueue,e!==null)){if(t=null,i.child!==null)switch(i.child.tag){case 27:case 5:t=i.child.stateNode;break;case 1:t=i.child.stateNode}try{bf(e,t)}catch(O){nt(i,i.return,O)}}break;case 27:t===null&&l&4&&jd(i);case 26:case 5:ci(e,i),t===null&&l&4&&Od(i),l&512&&Ks(i,i.return);break;case 12:ci(e,i);break;case 31:ci(e,i),l&4&&Ud(e,i);break;case 13:ci(e,i),l&4&&Pd(e,i),l&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=s0.bind(null,i),E0(e,i))));break;case 22:if(l=i.memoizedState!==null||ai,!l){t=t!==null&&t.memoizedState!==null||Lt,p=ai;var C=Lt;ai=l,(Lt=t)&&!C?ui(e,i,(i.subtreeFlags&8772)!==0):ci(e,i),ai=p,Lt=C}break;case 30:break;default:ci(e,i)}}function zd(e){var t=e.alternate;t!==null&&(e.alternate=null,zd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ys(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var _t=null,nn=!1;function oi(e,t,i){for(i=i.child;i!==null;)Id(e,t,i),i=i.sibling}function Id(e,t,i){if(Ye&&typeof Ye.onCommitFiberUnmount=="function")try{Ye.onCommitFiberUnmount(gt,i)}catch{}switch(i.tag){case 26:Lt||Fn(i,t),oi(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:Lt||Fn(i,t);var l=_t,p=nn;Ui(i.type)&&(_t=i.stateNode,nn=!1),oi(e,t,i),nl(i.stateNode),_t=l,nn=p;break;case 5:Lt||Fn(i,t);case 6:if(l=_t,p=nn,_t=null,oi(e,t,i),_t=l,nn=p,_t!==null)if(nn)try{(_t.nodeType===9?_t.body:_t.nodeName==="HTML"?_t.ownerDocument.body:_t).removeChild(i.stateNode)}catch(C){nt(i,t,C)}else try{_t.removeChild(i.stateNode)}catch(C){nt(i,t,C)}break;case 18:_t!==null&&(nn?(e=_t,Mp(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),as(e)):Mp(_t,i.stateNode));break;case 4:l=_t,p=nn,_t=i.stateNode.containerInfo,nn=!0,oi(e,t,i),_t=l,nn=p;break;case 0:case 11:case 14:case 15:Oi(2,i,t),Lt||Oi(4,i,t),oi(e,t,i);break;case 1:Lt||(Fn(i,t),l=i.stateNode,typeof l.componentWillUnmount=="function"&&Ld(i,t,l)),oi(e,t,i);break;case 21:oi(e,t,i);break;case 22:Lt=(l=Lt)||i.memoizedState!==null,oi(e,t,i),Lt=l;break;default:oi(e,t,i)}}function Ud(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{as(e)}catch(i){nt(t,t.return,i)}}}function Pd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{as(e)}catch(i){nt(t,t.return,i)}}function Qv(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Nd),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Nd),t;default:throw Error(o(435,e.tag))}}function da(e,t){var i=Qv(e);t.forEach(function(l){if(!i.has(l)){i.add(l);var p=l0.bind(null,e,l);l.then(p,p)}})}function rn(e,t){var i=t.deletions;if(i!==null)for(var l=0;l<i.length;l++){var p=i[l],C=e,O=t,P=O;e:for(;P!==null;){switch(P.tag){case 27:if(Ui(P.type)){_t=P.stateNode,nn=!1;break e}break;case 5:_t=P.stateNode,nn=!1;break e;case 3:case 4:_t=P.stateNode.containerInfo,nn=!0;break e}P=P.return}if(_t===null)throw Error(o(160));Id(C,O,p),_t=null,nn=!1,C=p.alternate,C!==null&&(C.return=null),p.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Fd(t,e),t=t.sibling}var Nn=null;function Fd(e,t){var i=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:rn(t,e),sn(e),l&4&&(Oi(3,e,e.return),$s(3,e),Oi(5,e,e.return));break;case 1:rn(t,e),sn(e),l&512&&(Lt||i===null||Fn(i,i.return)),l&64&&ai&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?l:i.concat(l))));break;case 26:var p=Nn;if(rn(t,e),sn(e),l&512&&(Lt||i===null||Fn(i,i.return)),l&4){var C=i!==null?i.memoizedState:null;if(l=e.memoizedState,i===null)if(l===null)if(e.stateNode===null){e:{l=e.type,i=e.memoizedProps,p=p.ownerDocument||p;t:switch(l){case"title":C=p.getElementsByTagName("title")[0],(!C||C[nr]||C[st]||C.namespaceURI==="http://www.w3.org/2000/svg"||C.hasAttribute("itemprop"))&&(C=p.createElement(l),p.head.insertBefore(C,p.querySelector("head > title"))),Gt(C,l,i),C[st]=e,ft(C),l=C;break e;case"link":var O=Fp("link","href",p).get(l+(i.href||""));if(O){for(var P=0;P<O.length;P++)if(C=O[P],C.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&C.getAttribute("rel")===(i.rel==null?null:i.rel)&&C.getAttribute("title")===(i.title==null?null:i.title)&&C.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){O.splice(P,1);break t}}C=p.createElement(l),Gt(C,l,i),p.head.appendChild(C);break;case"meta":if(O=Fp("meta","content",p).get(l+(i.content||""))){for(P=0;P<O.length;P++)if(C=O[P],C.getAttribute("content")===(i.content==null?null:""+i.content)&&C.getAttribute("name")===(i.name==null?null:i.name)&&C.getAttribute("property")===(i.property==null?null:i.property)&&C.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&C.getAttribute("charset")===(i.charSet==null?null:i.charSet)){O.splice(P,1);break t}}C=p.createElement(l),Gt(C,l,i),p.head.appendChild(C);break;default:throw Error(o(468,l))}C[st]=e,ft(C),l=C}e.stateNode=l}else qp(p,e.type,e.stateNode);else e.stateNode=Pp(p,l,e.memoizedProps);else C!==l?(C===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):C.count--,l===null?qp(p,e.type,e.stateNode):Pp(p,l,e.memoizedProps)):l===null&&e.stateNode!==null&&Ec(e,e.memoizedProps,i.memoizedProps)}break;case 27:rn(t,e),sn(e),l&512&&(Lt||i===null||Fn(i,i.return)),i!==null&&l&4&&Ec(e,e.memoizedProps,i.memoizedProps);break;case 5:if(rn(t,e),sn(e),l&512&&(Lt||i===null||Fn(i,i.return)),e.flags&32){p=e.stateNode;try{Dr(p,"")}catch(Ee){nt(e,e.return,Ee)}}l&4&&e.stateNode!=null&&(p=e.memoizedProps,Ec(e,p,i!==null?i.memoizedProps:p)),l&1024&&(Tc=!0);break;case 6:if(rn(t,e),sn(e),l&4){if(e.stateNode===null)throw Error(o(162));l=e.memoizedProps,i=e.stateNode;try{i.nodeValue=l}catch(Ee){nt(e,e.return,Ee)}}break;case 3:if(Ra=null,p=Nn,Nn=Aa(t.containerInfo),rn(t,e),Nn=p,sn(e),l&4&&i!==null&&i.memoizedState.isDehydrated)try{as(t.containerInfo)}catch(Ee){nt(e,e.return,Ee)}Tc&&(Tc=!1,qd(e));break;case 4:l=Nn,Nn=Aa(e.stateNode.containerInfo),rn(t,e),sn(e),Nn=l;break;case 12:rn(t,e),sn(e);break;case 31:rn(t,e),sn(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,da(e,l)));break;case 13:rn(t,e),sn(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(ma=rt()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,da(e,l)));break;case 22:p=e.memoizedState!==null;var X=i!==null&&i.memoizedState!==null,le=ai,fe=Lt;if(ai=le||p,Lt=fe||X,rn(t,e),Lt=fe,ai=le,sn(e),l&8192)e:for(t=e.stateNode,t._visibility=p?t._visibility&-2:t._visibility|1,p&&(i===null||X||ai||Lt||vr(e)),i=null,t=e;;){if(t.tag===5||t.tag===26){if(i===null){X=i=t;try{if(C=X.stateNode,p)O=C.style,typeof O.setProperty=="function"?O.setProperty("display","none","important"):O.display="none";else{P=X.stateNode;var ge=X.memoizedProps.style,ae=ge!=null&&ge.hasOwnProperty("display")?ge.display:null;P.style.display=ae==null||typeof ae=="boolean"?"":(""+ae).trim()}}catch(Ee){nt(X,X.return,Ee)}}}else if(t.tag===6){if(i===null){X=t;try{X.stateNode.nodeValue=p?"":X.memoizedProps}catch(Ee){nt(X,X.return,Ee)}}}else if(t.tag===18){if(i===null){X=t;try{var ce=X.stateNode;p?Lp(ce,!0):Lp(X.stateNode,!1)}catch(Ee){nt(X,X.return,Ee)}}}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;i===t&&(i=null),t=t.return}i===t&&(i=null),t.sibling.return=t.return,t=t.sibling}l&4&&(l=e.updateQueue,l!==null&&(i=l.retryQueue,i!==null&&(l.retryQueue=null,da(e,i))));break;case 19:rn(t,e),sn(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,da(e,l)));break;case 30:break;case 21:break;default:rn(t,e),sn(e)}}function sn(e){var t=e.flags;if(t&2){try{for(var i,l=e.return;l!==null;){if(Bd(l)){i=l;break}l=l.return}if(i==null)throw Error(o(160));switch(i.tag){case 27:var p=i.stateNode,C=kc(e);fa(e,C,p);break;case 5:var O=i.stateNode;i.flags&32&&(Dr(O,""),i.flags&=-33);var P=kc(e);fa(e,P,O);break;case 3:case 4:var X=i.stateNode.containerInfo,le=kc(e);Ac(e,le,X);break;default:throw Error(o(161))}}catch(fe){nt(e,e.return,fe)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function qd(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;qd(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ci(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Hd(e,t.alternate,t),t=t.sibling}function vr(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Oi(4,t,t.return),vr(t);break;case 1:Fn(t,t.return);var i=t.stateNode;typeof i.componentWillUnmount=="function"&&Ld(t,t.return,i),vr(t);break;case 27:nl(t.stateNode);case 26:case 5:Fn(t,t.return),vr(t);break;case 22:t.memoizedState===null&&vr(t);break;case 30:vr(t);break;default:vr(t)}e=e.sibling}}function ui(e,t,i){for(i=i&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,p=e,C=t,O=C.flags;switch(C.tag){case 0:case 11:case 15:ui(p,C,i),$s(4,C);break;case 1:if(ui(p,C,i),l=C,p=l.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(le){nt(l,l.return,le)}if(l=C,p=l.updateQueue,p!==null){var P=l.stateNode;try{var X=p.shared.hiddenCallbacks;if(X!==null)for(p.shared.hiddenCallbacks=null,p=0;p<X.length;p++)Sf(X[p],P)}catch(le){nt(l,l.return,le)}}i&&O&64&&Md(C),Ks(C,C.return);break;case 27:jd(C);case 26:case 5:ui(p,C,i),i&&l===null&&O&4&&Od(C),Ks(C,C.return);break;case 12:ui(p,C,i);break;case 31:ui(p,C,i),i&&O&4&&Ud(p,C);break;case 13:ui(p,C,i),i&&O&4&&Pd(p,C);break;case 22:C.memoizedState===null&&ui(p,C,i),Ks(C,C.return);break;case 30:break;default:ui(p,C,i)}t=t.sibling}}function Rc(e,t){var i=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==i&&(e!=null&&e.refCount++,i!=null&&Os(i))}function Dc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Os(e))}function Hn(e,t,i,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Gd(e,t,i,l),t=t.sibling}function Gd(e,t,i,l){var p=t.flags;switch(t.tag){case 0:case 11:case 15:Hn(e,t,i,l),p&2048&&$s(9,t);break;case 1:Hn(e,t,i,l);break;case 3:Hn(e,t,i,l),p&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Os(e)));break;case 12:if(p&2048){Hn(e,t,i,l),e=t.stateNode;try{var C=t.memoizedProps,O=C.id,P=C.onPostCommit;typeof P=="function"&&P(O,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(X){nt(t,t.return,X)}}else Hn(e,t,i,l);break;case 31:Hn(e,t,i,l);break;case 13:Hn(e,t,i,l);break;case 23:break;case 22:C=t.stateNode,O=t.alternate,t.memoizedState!==null?C._visibility&2?Hn(e,t,i,l):Ys(e,t):C._visibility&2?Hn(e,t,i,l):(C._visibility|=2,Xr(e,t,i,l,(t.subtreeFlags&10256)!==0||!1)),p&2048&&Rc(O,t);break;case 24:Hn(e,t,i,l),p&2048&&Dc(t.alternate,t);break;default:Hn(e,t,i,l)}}function Xr(e,t,i,l,p){for(p=p&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var C=e,O=t,P=i,X=l,le=O.flags;switch(O.tag){case 0:case 11:case 15:Xr(C,O,P,X,p),$s(8,O);break;case 23:break;case 22:var fe=O.stateNode;O.memoizedState!==null?fe._visibility&2?Xr(C,O,P,X,p):Ys(C,O):(fe._visibility|=2,Xr(C,O,P,X,p)),p&&le&2048&&Rc(O.alternate,O);break;case 24:Xr(C,O,P,X,p),p&&le&2048&&Dc(O.alternate,O);break;default:Xr(C,O,P,X,p)}t=t.sibling}}function Ys(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,l=t,p=l.flags;switch(l.tag){case 22:Ys(i,l),p&2048&&Rc(l.alternate,l);break;case 24:Ys(i,l),p&2048&&Dc(l.alternate,l);break;default:Ys(i,l)}t=t.sibling}}var Ws=8192;function Qr(e,t,i){if(e.subtreeFlags&Ws)for(e=e.child;e!==null;)Vd(e,t,i),e=e.sibling}function Vd(e,t,i){switch(e.tag){case 26:Qr(e,t,i),e.flags&Ws&&e.memoizedState!==null&&H0(i,Nn,e.memoizedState,e.memoizedProps);break;case 5:Qr(e,t,i);break;case 3:case 4:var l=Nn;Nn=Aa(e.stateNode.containerInfo),Qr(e,t,i),Nn=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=Ws,Ws=16777216,Qr(e,t,i),Ws=l):Qr(e,t,i));break;default:Qr(e,t,i)}}function $d(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 Xs(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var l=t[i];Ht=l,Yd(l,e)}$d(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Kd(e),e=e.sibling}function Kd(e){switch(e.tag){case 0:case 11:case 15:Xs(e),e.flags&2048&&Oi(9,e,e.return);break;case 3:Xs(e);break;case 12:Xs(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,pa(e)):Xs(e);break;default:Xs(e)}}function pa(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var l=t[i];Ht=l,Yd(l,e)}$d(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Oi(8,t,t.return),pa(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,pa(t));break;default:pa(t)}e=e.sibling}}function Yd(e,t){for(;Ht!==null;){var i=Ht;switch(i.tag){case 0:case 11:case 15:Oi(8,i,t);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var l=i.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:Os(i.memoizedState.cache)}if(l=i.child,l!==null)l.return=i,Ht=l;else e:for(i=e;Ht!==null;){l=Ht;var p=l.sibling,C=l.return;if(zd(l),l===i){Ht=null;break e}if(p!==null){p.return=C,Ht=p;break e}Ht=C}}}var Zv={getCacheForType:function(e){var t=Ft(Rt),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return Ft(Rt).controller.signal}},Jv=typeof WeakMap=="function"?WeakMap:Map,et=0,ct=null,Pe=null,Ge=0,tt=0,mn=null,Bi=!1,Zr=!1,Mc=!1,hi=0,bt=0,ji=0,yr=0,Lc=0,gn=0,Jr=0,Qs=null,ln=null,Oc=!1,ma=0,Wd=0,ga=1/0,_a=null,Ni=null,jt=0,Hi=null,es=null,fi=0,Bc=0,jc=null,Xd=null,Zs=0,Nc=null;function _n(){return(et&2)!==0&&Ge!==0?Ge&-Ge:V.T!==null?Fc():kl()}function Qd(){if(gn===0)if((Ge&536870912)===0||$e){var e=Ue;Ue<<=1,(Ue&3932160)===0&&(Ue=262144),gn=e}else gn=536870912;return e=dn.current,e!==null&&(e.flags|=32),gn}function an(e,t,i){(e===ct&&(tt===2||tt===9)||e.cancelPendingCommit!==null)&&(ts(e,0),zi(e,Ge,gn,!1)),Nt(e,i),((et&2)===0||e!==ct)&&(e===ct&&((et&2)===0&&(yr|=i),bt===4&&zi(e,Ge,gn,!1)),qn(e))}function Zd(e,t,i){if((et&6)!==0)throw Error(o(327));var l=!i&&(t&127)===0&&(t&e.expiredLanes)===0||Ji(e,t),p=l?n0(e,t):zc(e,t,!0),C=l;do{if(p===0){Zr&&!l&&zi(e,t,0,!1);break}else{if(i=e.current.alternate,C&&!e0(i)){p=zc(e,t,!1),C=!1;continue}if(p===2){if(C=t,e.errorRecoveryDisabledLanes&C)var O=0;else O=e.pendingLanes&-536870913,O=O!==0?O:O&536870912?536870912:0;if(O!==0){t=O;e:{var P=e;p=Qs;var X=P.current.memoizedState.isDehydrated;if(X&&(ts(P,O).flags|=256),O=zc(P,O,!1),O!==2){if(Mc&&!X){P.errorRecoveryDisabledLanes|=C,yr|=C,p=4;break e}C=ln,ln=p,C!==null&&(ln===null?ln=C:ln.push.apply(ln,C))}p=O}if(C=!1,p!==2)continue}}if(p===1){ts(e,0),zi(e,t,0,!0);break}e:{switch(l=e,C=p,C){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:zi(l,t,gn,!Bi);break e;case 2:ln=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(p=ma+300-rt(),10<p)){if(zi(l,t,gn,!Bi),Zi(l,0,!0)!==0)break e;fi=t,l.timeoutHandle=Rp(Jd.bind(null,l,i,ln,_a,Oc,t,gn,yr,Jr,Bi,C,"Throttled",-0,0),p);break e}Jd(l,i,ln,_a,Oc,t,gn,yr,Jr,Bi,C,null,-0,0)}}break}while(!0);qn(e)}function Jd(e,t,i,l,p,C,O,P,X,le,fe,ge,ae,ce){if(e.timeoutHandle=-1,ge=t.subtreeFlags,ge&8192||(ge&16785408)===16785408){ge={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Qn},Vd(t,C,ge);var Ee=(C&62914560)===C?ma-rt():(C&4194048)===C?Wd-rt():0;if(Ee=z0(ge,Ee),Ee!==null){fi=C,e.cancelPendingCommit=Ee(ap.bind(null,e,t,C,i,l,p,O,P,X,fe,ge,null,ae,ce)),zi(e,C,O,!le);return}}ap(e,t,C,i,l,p,O,P,X)}function e0(e){for(var t=e;;){var i=t.tag;if((i===0||i===11||i===15)&&t.flags&16384&&(i=t.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var l=0;l<i.length;l++){var p=i[l],C=p.getSnapshot;p=p.value;try{if(!hn(C(),p))return!1}catch{return!1}}if(i=t.child,t.subtreeFlags&16384&&i!==null)i.return=t,t=i;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 zi(e,t,i,l){t&=~Lc,t&=~yr,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var p=t;0<p;){var C=31-Xe(p),O=1<<C;l[C]=-1,p&=~O}i!==0&&Ln(e,i,t)}function va(){return(et&6)===0?(Js(0),!1):!0}function Hc(){if(Pe!==null){if(tt===0)var e=Pe.return;else e=Pe,ti=ur=null,Jo(e),Vr=null,js=0,e=Pe;for(;e!==null;)Dd(e.alternate,e),e=e.return;Pe=null}}function ts(e,t){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,S0(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),fi=0,Hc(),ct=e,Pe=i=Jn(e.current,null),Ge=t,tt=0,mn=null,Bi=!1,Zr=Ji(e,t),Mc=!1,Jr=gn=Lc=yr=ji=bt=0,ln=Qs=null,Oc=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var p=31-Xe(l),C=1<<p;t|=e[p],l&=~C}return hi=t,Il(),i}function ep(e,t){Ne=null,V.H=qs,t===Gr||t===Kl?(t=gf(),tt=3):t===Po?(t=gf(),tt=4):tt=t===mc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,mn=t,Pe===null&&(bt=1,aa(e,xn(t,e.current)))}function tp(){var e=dn.current;return e===null?!0:(Ge&4194048)===Ge?Tn===null:(Ge&62914560)===Ge||(Ge&536870912)!==0?e===Tn:!1}function np(){var e=V.H;return V.H=qs,e===null?qs:e}function ip(){var e=V.A;return V.A=Zv,e}function ya(){bt=4,Bi||(Ge&4194048)!==Ge&&dn.current!==null||(Zr=!0),(ji&134217727)===0&&(yr&134217727)===0||ct===null||zi(ct,Ge,gn,!1)}function zc(e,t,i){var l=et;et|=2;var p=np(),C=ip();(ct!==e||Ge!==t)&&(_a=null,ts(e,t)),t=!1;var O=bt;e:do try{if(tt!==0&&Pe!==null){var P=Pe,X=mn;switch(tt){case 8:Hc(),O=6;break e;case 3:case 2:case 9:case 6:dn.current===null&&(t=!0);var le=tt;if(tt=0,mn=null,ns(e,P,X,le),i&&Zr){O=0;break e}break;default:le=tt,tt=0,mn=null,ns(e,P,X,le)}}t0(),O=bt;break}catch(fe){ep(e,fe)}while(!0);return t&&e.shellSuspendCounter++,ti=ur=null,et=l,V.H=p,V.A=C,Pe===null&&(ct=null,Ge=0,Il()),O}function t0(){for(;Pe!==null;)rp(Pe)}function n0(e,t){var i=et;et|=2;var l=np(),p=ip();ct!==e||Ge!==t?(_a=null,ga=rt()+500,ts(e,t)):Zr=Ji(e,t);e:do try{if(tt!==0&&Pe!==null){t=Pe;var C=mn;t:switch(tt){case 1:tt=0,mn=null,ns(e,t,C,1);break;case 2:case 9:if(pf(C)){tt=0,mn=null,sp(t);break}t=function(){tt!==2&&tt!==9||ct!==e||(tt=7),qn(e)},C.then(t,t);break e;case 3:tt=7;break e;case 4:tt=5;break e;case 7:pf(C)?(tt=0,mn=null,sp(t)):(tt=0,mn=null,ns(e,t,C,7));break;case 5:var O=null;switch(Pe.tag){case 26:O=Pe.memoizedState;case 5:case 27:var P=Pe;if(O?Gp(O):P.stateNode.complete){tt=0,mn=null;var X=P.sibling;if(X!==null)Pe=X;else{var le=P.return;le!==null?(Pe=le,Sa(le)):Pe=null}break t}}tt=0,mn=null,ns(e,t,C,5);break;case 6:tt=0,mn=null,ns(e,t,C,6);break;case 8:Hc(),bt=6;break e;default:throw Error(o(462))}}i0();break}catch(fe){ep(e,fe)}while(!0);return ti=ur=null,V.H=l,V.A=p,et=i,Pe!==null?0:(ct=null,Ge=0,Il(),bt)}function i0(){for(;Pe!==null&&!Xt();)rp(Pe)}function rp(e){var t=Td(e.alternate,e,hi);e.memoizedProps=e.pendingProps,t===null?Sa(e):Pe=t}function sp(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=Cd(i,t,t.pendingProps,t.type,void 0,Ge);break;case 11:t=Cd(i,t,t.pendingProps,t.type.render,t.ref,Ge);break;case 5:Jo(t);default:Dd(i,t),t=Pe=nf(t,hi),t=Td(i,t,hi)}e.memoizedProps=e.pendingProps,t===null?Sa(e):Pe=t}function ns(e,t,i,l){ti=ur=null,Jo(t),Vr=null,js=0;var p=t.return;try{if(Vv(e,p,t,i,Ge)){bt=1,aa(e,xn(i,e.current)),Pe=null;return}}catch(C){if(p!==null)throw Pe=p,C;bt=1,aa(e,xn(i,e.current)),Pe=null;return}t.flags&32768?($e||l===1?e=!0:Zr||(Ge&536870912)!==0?e=!1:(Bi=e=!0,(l===2||l===9||l===3||l===6)&&(l=dn.current,l!==null&&l.tag===13&&(l.flags|=16384))),lp(t,e)):Sa(t)}function Sa(e){var t=e;do{if((t.flags&32768)!==0){lp(t,Bi);return}e=t.return;var i=Yv(t.alternate,t,hi);if(i!==null){Pe=i;return}if(t=t.sibling,t!==null){Pe=t;return}Pe=t=e}while(t!==null);bt===0&&(bt=5)}function lp(e,t){do{var i=Wv(e.alternate,e);if(i!==null){i.flags&=32767,Pe=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){Pe=e;return}Pe=e=i}while(e!==null);bt=6,Pe=null}function ap(e,t,i,l,p,C,O,P,X){e.cancelPendingCommit=null;do ba();while(jt!==0);if((et&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(C=t.lanes|t.childLanes,C|=ko,El(e,i,C,O,P,X),e===ct&&(Pe=ct=null,Ge=0),es=t,Hi=e,fi=i,Bc=C,jc=p,Xd=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,a0(ke,function(){return fp(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=V.T,V.T=null,p=$.p,$.p=2,O=et,et|=4;try{Xv(e,t,i)}finally{et=O,$.p=p,V.T=l}}jt=1,op(),cp(),up()}}function op(){if(jt===1){jt=0;var e=Hi,t=es,i=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||i){i=V.T,V.T=null;var l=$.p;$.p=2;var p=et;et|=4;try{Fd(t,e);var C=Xc,O=Kh(e.containerInfo),P=C.focusedElem,X=C.selectionRange;if(O!==P&&P&&P.ownerDocument&&$h(P.ownerDocument.documentElement,P)){if(X!==null&&bo(P)){var le=X.start,fe=X.end;if(fe===void 0&&(fe=le),"selectionStart"in P)P.selectionStart=le,P.selectionEnd=Math.min(fe,P.value.length);else{var ge=P.ownerDocument||document,ae=ge&&ge.defaultView||window;if(ae.getSelection){var ce=ae.getSelection(),Ee=P.textContent.length,Le=Math.min(X.start,Ee),ot=X.end===void 0?Le:Math.min(X.end,Ee);!ce.extend&&Le>ot&&(O=ot,ot=Le,Le=O);var ne=Vh(P,Le),Z=Vh(P,ot);if(ne&&Z&&(ce.rangeCount!==1||ce.anchorNode!==ne.node||ce.anchorOffset!==ne.offset||ce.focusNode!==Z.node||ce.focusOffset!==Z.offset)){var se=ge.createRange();se.setStart(ne.node,ne.offset),ce.removeAllRanges(),Le>ot?(ce.addRange(se),ce.extend(Z.node,Z.offset)):(se.setEnd(Z.node,Z.offset),ce.addRange(se))}}}}for(ge=[],ce=P;ce=ce.parentNode;)ce.nodeType===1&&ge.push({element:ce,left:ce.scrollLeft,top:ce.scrollTop});for(typeof P.focus=="function"&&P.focus(),P=0;P<ge.length;P++){var pe=ge[P];pe.element.scrollLeft=pe.left,pe.element.scrollTop=pe.top}}Oa=!!Wc,Xc=Wc=null}finally{et=p,$.p=l,V.T=i}}e.current=t,jt=2}}function cp(){if(jt===2){jt=0;var e=Hi,t=es,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=V.T,V.T=null;var l=$.p;$.p=2;var p=et;et|=4;try{Hd(e,t.alternate,t)}finally{et=p,$.p=l,V.T=i}}jt=3}}function up(){if(jt===4||jt===3){jt=0,vt();var e=Hi,t=es,i=fi,l=Xd;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?jt=5:(jt=0,es=Hi=null,hp(e,e.pendingLanes));var p=e.pendingLanes;if(p===0&&(Ni=null),It(i),t=t.stateNode,Ye&&typeof Ye.onCommitFiberRoot=="function")try{Ye.onCommitFiberRoot(gt,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=V.T,p=$.p,$.p=2,V.T=null;try{for(var C=e.onRecoverableError,O=0;O<l.length;O++){var P=l[O];C(P.value,{componentStack:P.stack})}}finally{V.T=t,$.p=p}}(fi&3)!==0&&ba(),qn(e),p=e.pendingLanes,(i&261930)!==0&&(p&42)!==0?e===Nc?Zs++:(Zs=0,Nc=e):Zs=0,Js(0)}}function hp(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Os(t)))}function ba(){return op(),cp(),up(),fp()}function fp(){if(jt!==5)return!1;var e=Hi,t=Bc;Bc=0;var i=It(fi),l=V.T,p=$.p;try{$.p=32>i?32:i,V.T=null,i=jc,jc=null;var C=Hi,O=fi;if(jt=0,es=Hi=null,fi=0,(et&6)!==0)throw Error(o(331));var P=et;if(et|=4,Kd(C.current),Gd(C,C.current,O,i),et=P,Js(0,!1),Ye&&typeof Ye.onPostCommitFiberRoot=="function")try{Ye.onPostCommitFiberRoot(gt,C)}catch{}return!0}finally{$.p=p,V.T=l,hp(e,t)}}function dp(e,t,i){t=xn(i,t),t=pc(e.stateNode,t,2),e=Di(e,t,2),e!==null&&(Nt(e,2),qn(e))}function nt(e,t,i){if(e.tag===3)dp(e,e,i);else for(;t!==null;){if(t.tag===3){dp(t,e,i);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Ni===null||!Ni.has(l))){e=xn(i,e),i=pd(2),l=Di(t,i,2),l!==null&&(md(i,l,t,e),Nt(l,2),qn(l));break}}t=t.return}}function Ic(e,t,i){var l=e.pingCache;if(l===null){l=e.pingCache=new Jv;var p=new Set;l.set(t,p)}else p=l.get(t),p===void 0&&(p=new Set,l.set(t,p));p.has(i)||(Mc=!0,p.add(i),e=r0.bind(null,e,t,i),t.then(e,e))}function r0(e,t,i){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,ct===e&&(Ge&i)===i&&(bt===4||bt===3&&(Ge&62914560)===Ge&&300>rt()-ma?(et&2)===0&&ts(e,0):Lc|=i,Jr===Ge&&(Jr=0)),qn(e)}function pp(e,t){t===0&&(t=vs()),e=ar(e,t),e!==null&&(Nt(e,t),qn(e))}function s0(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),pp(e,i)}function l0(e,t){var i=0;switch(e.tag){case 31:case 13:var l=e.stateNode,p=e.memoizedState;p!==null&&(i=p.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(o(314))}l!==null&&l.delete(t),pp(e,i)}function a0(e,t){return Bt(e,t)}var Ca=null,is=null,Uc=!1,wa=!1,Pc=!1,Ii=0;function qn(e){e!==is&&e.next===null&&(is===null?Ca=is=e:is=is.next=e),wa=!0,Uc||(Uc=!0,c0())}function Js(e,t){if(!Pc&&wa){Pc=!0;do for(var i=!1,l=Ca;l!==null;){if(e!==0){var p=l.pendingLanes;if(p===0)var C=0;else{var O=l.suspendedLanes,P=l.pingedLanes;C=(1<<31-Xe(42|e)+1)-1,C&=p&~(O&~P),C=C&201326741?C&201326741|1:C?C|2:0}C!==0&&(i=!0,vp(l,C))}else C=Ge,C=Zi(l,l===ct?C:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(C&3)===0||Ji(l,C)||(i=!0,vp(l,C));l=l.next}while(i);Pc=!1}}function o0(){mp()}function mp(){wa=Uc=!1;var e=0;Ii!==0&&y0()&&(e=Ii);for(var t=rt(),i=null,l=Ca;l!==null;){var p=l.next,C=gp(l,t);C===0?(l.next=null,i===null?Ca=p:i.next=p,p===null&&(is=i)):(i=l,(e!==0||(C&3)!==0)&&(wa=!0)),l=p}jt!==0&&jt!==5||Js(e),Ii!==0&&(Ii=0)}function gp(e,t){for(var i=e.suspendedLanes,l=e.pingedLanes,p=e.expirationTimes,C=e.pendingLanes&-62914561;0<C;){var O=31-Xe(C),P=1<<O,X=p[O];X===-1?((P&i)===0||(P&l)!==0)&&(p[O]=wr(P,t)):X<=t&&(e.expiredLanes|=P),C&=~P}if(t=ct,i=Ge,i=Zi(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,i===0||e===t&&(tt===2||tt===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&Ct(l),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||Ji(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(l!==null&&Ct(l),It(i)){case 2:case 8:i=Se;break;case 32:i=ke;break;case 268435456:i=Be;break;default:i=ke}return l=_p.bind(null,e),i=Bt(i,l),e.callbackPriority=t,e.callbackNode=i,t}return l!==null&&l!==null&&Ct(l),e.callbackPriority=2,e.callbackNode=null,2}function _p(e,t){if(jt!==0&&jt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(ba()&&e.callbackNode!==i)return null;var l=Ge;return l=Zi(e,e===ct?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(Zd(e,l,t),gp(e,rt()),e.callbackNode!=null&&e.callbackNode===i?_p.bind(null,e):null)}function vp(e,t){if(ba())return null;Zd(e,t,!0)}function c0(){b0(function(){(et&6)!==0?Bt(ue,o0):mp()})}function Fc(){if(Ii===0){var e=Fr;e===0&&(e=_i,_i<<=1,(_i&261888)===0&&(_i=256)),Ii=e}return Ii}function yp(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ml(""+e)}function Sp(e,t){var i=t.ownerDocument.createElement("input");return i.name=t.name,i.value=t.value,e.id&&i.setAttribute("form",e.id),t.parentNode.insertBefore(i,t),e=new FormData(e),i.parentNode.removeChild(i),e}function u0(e,t,i,l,p){if(t==="submit"&&i&&i.stateNode===p){var C=yp((p[Ut]||null).action),O=l.submitter;O&&(t=(t=O[Ut]||null)?yp(t.formAction):O.getAttribute("formAction"),t!==null&&(C=t,O=null));var P=new jl("action","action",null,l,p);e.push({event:P,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Ii!==0){var X=O?Sp(p,O):new FormData(p);oc(i,{pending:!0,data:X,method:p.method,action:C},null,X)}}else typeof C=="function"&&(P.preventDefault(),X=O?Sp(p,O):new FormData(p),oc(i,{pending:!0,data:X,method:p.method,action:C},C,X))},currentTarget:p}]})}}for(var qc=0;qc<Eo.length;qc++){var Gc=Eo[qc],h0=Gc.toLowerCase(),f0=Gc[0].toUpperCase()+Gc.slice(1);jn(h0,"on"+f0)}jn(Xh,"onAnimationEnd"),jn(Qh,"onAnimationIteration"),jn(Zh,"onAnimationStart"),jn("dblclick","onDoubleClick"),jn("focusin","onFocus"),jn("focusout","onBlur"),jn(Tv,"onTransitionRun"),jn(Rv,"onTransitionStart"),jn(Dv,"onTransitionCancel"),jn(Jh,"onTransitionEnd"),In("onMouseEnter",["mouseout","mouseover"]),In("onMouseLeave",["mouseout","mouseover"]),In("onPointerEnter",["pointerout","pointerover"]),In("onPointerLeave",["pointerout","pointerover"]),On("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),On("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),On("onBeforeInput",["compositionend","keypress","textInput","paste"]),On("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),On("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),On("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var el="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(" "),d0=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(el));function bp(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var l=e[i],p=l.event;l=l.listeners;e:{var C=void 0;if(t)for(var O=l.length-1;0<=O;O--){var P=l[O],X=P.instance,le=P.currentTarget;if(P=P.listener,X!==C&&p.isPropagationStopped())break e;C=P,p.currentTarget=le;try{C(p)}catch(fe){zl(fe)}p.currentTarget=null,C=X}else for(O=0;O<l.length;O++){if(P=l[O],X=P.instance,le=P.currentTarget,P=P.listener,X!==C&&p.isPropagationStopped())break e;C=P,p.currentTarget=le;try{C(p)}catch(fe){zl(fe)}p.currentTarget=null,C=X}}}}function Fe(e,t){var i=t[tr];i===void 0&&(i=t[tr]=new Set);var l=e+"__bubble";i.has(l)||(Cp(t,e,2,!1),i.add(l))}function Vc(e,t,i){var l=0;t&&(l|=4),Cp(i,e,l,t)}var xa="_reactListening"+Math.random().toString(36).slice(2);function $c(e){if(!e[xa]){e[xa]=!0,kr.forEach(function(i){i!=="selectionchange"&&(d0.has(i)||Vc(i,!1,e),Vc(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[xa]||(t[xa]=!0,Vc("selectionchange",!1,t))}}function Cp(e,t,i,l){switch(Qp(t)){case 2:var p=P0;break;case 8:p=F0;break;default:p=au}i=p.bind(null,t,i,e),p=void 0,!ho||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(p=!0),l?p!==void 0?e.addEventListener(t,i,{capture:!0,passive:p}):e.addEventListener(t,i,!0):p!==void 0?e.addEventListener(t,i,{passive:p}):e.addEventListener(t,i,!1)}function Kc(e,t,i,l,p){var C=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var O=l.tag;if(O===3||O===4){var P=l.stateNode.containerInfo;if(P===p)break;if(O===4)for(O=l.return;O!==null;){var X=O.tag;if((X===3||X===4)&&O.stateNode.containerInfo===p)return;O=O.return}for(;P!==null;){if(O=yi(P),O===null)return;if(X=O.tag,X===5||X===6||X===26||X===27){l=C=O;continue e}P=P.parentNode}}l=l.return}kh(function(){var le=C,fe=co(i),ge=[];e:{var ae=ef.get(e);if(ae!==void 0){var ce=jl,Ee=e;switch(e){case"keypress":if(Ol(i)===0)break e;case"keydown":case"keyup":ce=lv;break;case"focusin":Ee="focus",ce=go;break;case"focusout":Ee="blur",ce=go;break;case"beforeblur":case"afterblur":ce=go;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ce=Rh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ce=Y_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ce=cv;break;case Xh:case Qh:case Zh:ce=Q_;break;case Jh:ce=hv;break;case"scroll":case"scrollend":ce=$_;break;case"wheel":ce=dv;break;case"copy":case"cut":case"paste":ce=J_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ce=Mh;break;case"toggle":case"beforetoggle":ce=mv}var Le=(t&4)!==0,ot=!Le&&(e==="scroll"||e==="scrollend"),ne=Le?ae!==null?ae+"Capture":null:ae;Le=[];for(var Z=le,se;Z!==null;){var pe=Z;if(se=pe.stateNode,pe=pe.tag,pe!==5&&pe!==26&&pe!==27||se===null||ne===null||(pe=Cs(Z,ne),pe!=null&&Le.push(tl(Z,pe,se))),ot)break;Z=Z.return}0<Le.length&&(ae=new ce(ae,Ee,null,i,fe),ge.push({event:ae,listeners:Le}))}}if((t&7)===0){e:{if(ae=e==="mouseover"||e==="pointerover",ce=e==="mouseout"||e==="pointerout",ae&&i!==oo&&(Ee=i.relatedTarget||i.fromElement)&&(yi(Ee)||Ee[Kn]))break e;if((ce||ae)&&(ae=fe.window===fe?fe:(ae=fe.ownerDocument)?ae.defaultView||ae.parentWindow:window,ce?(Ee=i.relatedTarget||i.toElement,ce=le,Ee=Ee?yi(Ee):null,Ee!==null&&(ot=_(Ee),Le=Ee.tag,Ee!==ot||Le!==5&&Le!==27&&Le!==6)&&(Ee=null)):(ce=null,Ee=le),ce!==Ee)){if(Le=Rh,pe="onMouseLeave",ne="onMouseEnter",Z="mouse",(e==="pointerout"||e==="pointerover")&&(Le=Mh,pe="onPointerLeave",ne="onPointerEnter",Z="pointer"),ot=ce==null?ae:bn(ce),se=Ee==null?ae:bn(Ee),ae=new Le(pe,Z+"leave",ce,i,fe),ae.target=ot,ae.relatedTarget=se,pe=null,yi(fe)===le&&(Le=new Le(ne,Z+"enter",Ee,i,fe),Le.target=se,Le.relatedTarget=ot,pe=Le),ot=pe,ce&&Ee)t:{for(Le=p0,ne=ce,Z=Ee,se=0,pe=ne;pe;pe=Le(pe))se++;pe=0;for(var Te=Z;Te;Te=Le(Te))pe++;for(;0<se-pe;)ne=Le(ne),se--;for(;0<pe-se;)Z=Le(Z),pe--;for(;se--;){if(ne===Z||Z!==null&&ne===Z.alternate){Le=ne;break t}ne=Le(ne),Z=Le(Z)}Le=null}else Le=null;ce!==null&&wp(ge,ae,ce,Le,!1),Ee!==null&&ot!==null&&wp(ge,ot,Ee,Le,!0)}}e:{if(ae=le?bn(le):window,ce=ae.nodeName&&ae.nodeName.toLowerCase(),ce==="select"||ce==="input"&&ae.type==="file")var Qe=Ih;else if(Hh(ae))if(Uh)Qe=Ev;else{Qe=wv;var Ae=Cv}else ce=ae.nodeName,!ce||ce.toLowerCase()!=="input"||ae.type!=="checkbox"&&ae.type!=="radio"?le&&ao(le.elementType)&&(Qe=Ih):Qe=xv;if(Qe&&(Qe=Qe(e,le))){zh(ge,Qe,i,fe);break e}Ae&&Ae(e,ae,le),e==="focusout"&&le&&ae.type==="number"&&le.memoizedProps.value!=null&&bs(ae,"number",ae.value)}switch(Ae=le?bn(le):window,e){case"focusin":(Hh(Ae)||Ae.contentEditable==="true")&&(Br=Ae,Co=le,Ds=null);break;case"focusout":Ds=Co=Br=null;break;case"mousedown":wo=!0;break;case"contextmenu":case"mouseup":case"dragend":wo=!1,Yh(ge,i,fe);break;case"selectionchange":if(Av)break;case"keydown":case"keyup":Yh(ge,i,fe)}var He;if(vo)e:{switch(e){case"compositionstart":var Ve="onCompositionStart";break e;case"compositionend":Ve="onCompositionEnd";break e;case"compositionupdate":Ve="onCompositionUpdate";break e}Ve=void 0}else Or?jh(e,i)&&(Ve="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Ve="onCompositionStart");Ve&&(Lh&&i.locale!=="ko"&&(Or||Ve!=="onCompositionStart"?Ve==="onCompositionEnd"&&Or&&(He=Ah()):(wi=fe,fo="value"in wi?wi.value:wi.textContent,Or=!0)),Ae=Ea(le,Ve),0<Ae.length&&(Ve=new Dh(Ve,e,null,i,fe),ge.push({event:Ve,listeners:Ae}),He?Ve.data=He:(He=Nh(i),He!==null&&(Ve.data=He)))),(He=_v?vv(e,i):yv(e,i))&&(Ve=Ea(le,"onBeforeInput"),0<Ve.length&&(Ae=new Dh("onBeforeInput","beforeinput",null,i,fe),ge.push({event:Ae,listeners:Ve}),Ae.data=He)),u0(ge,e,le,i,fe)}bp(ge,t)})}function tl(e,t,i){return{instance:e,listener:t,currentTarget:i}}function Ea(e,t){for(var i=t+"Capture",l=[];e!==null;){var p=e,C=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||C===null||(p=Cs(e,i),p!=null&&l.unshift(tl(e,p,C)),p=Cs(e,t),p!=null&&l.push(tl(e,p,C))),e.tag===3)return l;e=e.return}return[]}function p0(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function wp(e,t,i,l,p){for(var C=t._reactName,O=[];i!==null&&i!==l;){var P=i,X=P.alternate,le=P.stateNode;if(P=P.tag,X!==null&&X===l)break;P!==5&&P!==26&&P!==27||le===null||(X=le,p?(le=Cs(i,C),le!=null&&O.unshift(tl(i,le,X))):p||(le=Cs(i,C),le!=null&&O.push(tl(i,le,X)))),i=i.return}O.length!==0&&e.push({event:t,listeners:O})}var m0=/\r\n?/g,g0=/\u0000|\uFFFD/g;function xp(e){return(typeof e=="string"?e:""+e).replace(m0,`
49
+ `).replace(g0,"")}function Ep(e,t){return t=xp(t),xp(e)===t}function at(e,t,i,l,p,C){switch(i){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||Dr(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&Dr(e,""+l);break;case"className":Ar(e,"class",l);break;case"tabIndex":Ar(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Ar(e,i,l);break;case"style":xh(e,l,C);break;case"data":if(t!=="object"){Ar(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||i!=="href")){e.removeAttribute(i);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(i);break}l=Ml(""+l),e.setAttribute(i,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(i,"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 C=="function"&&(i==="formAction"?(t!=="input"&&at(e,t,"name",p.name,p,null),at(e,t,"formEncType",p.formEncType,p,null),at(e,t,"formMethod",p.formMethod,p,null),at(e,t,"formTarget",p.formTarget,p,null)):(at(e,t,"encType",p.encType,p,null),at(e,t,"method",p.method,p,null),at(e,t,"target",p.target,p,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(i);break}l=Ml(""+l),e.setAttribute(i,l);break;case"onClick":l!=null&&(e.onclick=Qn);break;case"onScroll":l!=null&&Fe("scroll",e);break;case"onScrollEnd":l!=null&&Fe("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(i=l.__html,i!=null){if(p.children!=null)throw Error(o(60));e.innerHTML=i}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}i=Ml(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(i,""+l):e.removeAttribute(i);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":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":l===!0?e.setAttribute(i,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(i,l):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(i,l):e.removeAttribute(i);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(i):e.setAttribute(i,l);break;case"popover":Fe("beforetoggle",e),Fe("toggle",e),Oe(e,"popover",l);break;case"xlinkActuate":Bn(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Bn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Bn(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Bn(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Bn(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Bn(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Bn(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Bn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Bn(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Oe(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=G_.get(i)||i,Oe(e,i,l))}}function Yc(e,t,i,l,p,C){switch(i){case"style":xh(e,l,C);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(o(61));if(i=l.__html,i!=null){if(p.children!=null)throw Error(o(60));e.innerHTML=i}}break;case"children":typeof l=="string"?Dr(e,l):(typeof l=="number"||typeof l=="bigint")&&Dr(e,""+l);break;case"onScroll":l!=null&&Fe("scroll",e);break;case"onScrollEnd":l!=null&&Fe("scrollend",e);break;case"onClick":l!=null&&(e.onclick=Qn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Rl.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(p=i.endsWith("Capture"),t=i.slice(2,p?i.length-7:void 0),C=e[Ut]||null,C=C!=null?C[i]:null,typeof C=="function"&&e.removeEventListener(t,C,p),typeof l=="function")){typeof C!="function"&&C!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(t,l,p);break e}i in e?e[i]=l:l===!0?e.setAttribute(i,""):Oe(e,i,l)}}}function Gt(e,t,i){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 l=!1,p=!1,C;for(C in i)if(i.hasOwnProperty(C)){var O=i[C];if(O!=null)switch(C){case"src":l=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:at(e,t,C,O,i,null)}}p&&at(e,t,"srcSet",i.srcSet,i,null),l&&at(e,t,"src",i.src,i,null);return;case"input":Fe("invalid",e);var P=C=O=p=null,X=null,le=null;for(l in i)if(i.hasOwnProperty(l)){var fe=i[l];if(fe!=null)switch(l){case"name":p=fe;break;case"type":O=fe;break;case"checked":X=fe;break;case"defaultChecked":le=fe;break;case"value":C=fe;break;case"defaultValue":P=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(o(137,t));break;default:at(e,t,l,fe,i,null)}}Xn(e,C,P,X,le,O,p,!1);return;case"select":Fe("invalid",e),l=O=C=null;for(p in i)if(i.hasOwnProperty(p)&&(P=i[p],P!=null))switch(p){case"value":C=P;break;case"defaultValue":O=P;break;case"multiple":l=P;default:at(e,t,p,P,i,null)}t=C,i=O,e.multiple=!!l,t!=null?Rr(e,!!l,t,!1):i!=null&&Rr(e,!!l,i,!0);return;case"textarea":Fe("invalid",e),C=p=l=null;for(O in i)if(i.hasOwnProperty(O)&&(P=i[O],P!=null))switch(O){case"value":l=P;break;case"defaultValue":p=P;break;case"children":C=P;break;case"dangerouslySetInnerHTML":if(P!=null)throw Error(o(91));break;default:at(e,t,O,P,i,null)}Ch(e,l,p,C);return;case"option":for(X in i)if(i.hasOwnProperty(X)&&(l=i[X],l!=null))switch(X){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:at(e,t,X,l,i,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(l=0;l<el.length;l++)Fe(el[l],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(le in i)if(i.hasOwnProperty(le)&&(l=i[le],l!=null))switch(le){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:at(e,t,le,l,i,null)}return;default:if(ao(t)){for(fe in i)i.hasOwnProperty(fe)&&(l=i[fe],l!==void 0&&Yc(e,t,fe,l,i,void 0));return}}for(P in i)i.hasOwnProperty(P)&&(l=i[P],l!=null&&at(e,t,P,l,i,null))}function _0(e,t,i,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,C=null,O=null,P=null,X=null,le=null,fe=null;for(ce in i){var ge=i[ce];if(i.hasOwnProperty(ce)&&ge!=null)switch(ce){case"checked":break;case"value":break;case"defaultValue":X=ge;default:l.hasOwnProperty(ce)||at(e,t,ce,null,l,ge)}}for(var ae in l){var ce=l[ae];if(ge=i[ae],l.hasOwnProperty(ae)&&(ce!=null||ge!=null))switch(ae){case"type":C=ce;break;case"name":p=ce;break;case"checked":le=ce;break;case"defaultChecked":fe=ce;break;case"value":O=ce;break;case"defaultValue":P=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(o(137,t));break;default:ce!==ge&&at(e,t,ae,ce,l,ge)}}Wn(e,O,P,X,le,fe,C,p);return;case"select":ce=O=P=ae=null;for(C in i)if(X=i[C],i.hasOwnProperty(C)&&X!=null)switch(C){case"value":break;case"multiple":ce=X;default:l.hasOwnProperty(C)||at(e,t,C,null,l,X)}for(p in l)if(C=l[p],X=i[p],l.hasOwnProperty(p)&&(C!=null||X!=null))switch(p){case"value":ae=C;break;case"defaultValue":P=C;break;case"multiple":O=C;default:C!==X&&at(e,t,p,C,l,X)}t=P,i=O,l=ce,ae!=null?Rr(e,!!i,ae,!1):!!l!=!!i&&(t!=null?Rr(e,!!i,t,!0):Rr(e,!!i,i?[]:"",!1));return;case"textarea":ce=ae=null;for(P in i)if(p=i[P],i.hasOwnProperty(P)&&p!=null&&!l.hasOwnProperty(P))switch(P){case"value":break;case"children":break;default:at(e,t,P,null,l,p)}for(O in l)if(p=l[O],C=i[O],l.hasOwnProperty(O)&&(p!=null||C!=null))switch(O){case"value":ae=p;break;case"defaultValue":ce=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(o(91));break;default:p!==C&&at(e,t,O,p,l,C)}bh(e,ae,ce);return;case"option":for(var Ee in i)if(ae=i[Ee],i.hasOwnProperty(Ee)&&ae!=null&&!l.hasOwnProperty(Ee))switch(Ee){case"selected":e.selected=!1;break;default:at(e,t,Ee,null,l,ae)}for(X in l)if(ae=l[X],ce=i[X],l.hasOwnProperty(X)&&ae!==ce&&(ae!=null||ce!=null))switch(X){case"selected":e.selected=ae&&typeof ae!="function"&&typeof ae!="symbol";break;default:at(e,t,X,ae,l,ce)}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 i)ae=i[Le],i.hasOwnProperty(Le)&&ae!=null&&!l.hasOwnProperty(Le)&&at(e,t,Le,null,l,ae);for(le in l)if(ae=l[le],ce=i[le],l.hasOwnProperty(le)&&ae!==ce&&(ae!=null||ce!=null))switch(le){case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(o(137,t));break;default:at(e,t,le,ae,l,ce)}return;default:if(ao(t)){for(var ot in i)ae=i[ot],i.hasOwnProperty(ot)&&ae!==void 0&&!l.hasOwnProperty(ot)&&Yc(e,t,ot,void 0,l,ae);for(fe in l)ae=l[fe],ce=i[fe],!l.hasOwnProperty(fe)||ae===ce||ae===void 0&&ce===void 0||Yc(e,t,fe,ae,l,ce);return}}for(var ne in i)ae=i[ne],i.hasOwnProperty(ne)&&ae!=null&&!l.hasOwnProperty(ne)&&at(e,t,ne,null,l,ae);for(ge in l)ae=l[ge],ce=i[ge],!l.hasOwnProperty(ge)||ae===ce||ae==null&&ce==null||at(e,t,ge,ae,l,ce)}function kp(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function v0(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,i=performance.getEntriesByType("resource"),l=0;l<i.length;l++){var p=i[l],C=p.transferSize,O=p.initiatorType,P=p.duration;if(C&&P&&kp(O)){for(O=0,P=p.responseEnd,l+=1;l<i.length;l++){var X=i[l],le=X.startTime;if(le>P)break;var fe=X.transferSize,ge=X.initiatorType;fe&&kp(ge)&&(X=X.responseEnd,O+=fe*(X<P?1:(P-le)/(X-le)))}if(--l,t+=8*(C+O)/(p.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 Wc=null,Xc=null;function ka(e){return e.nodeType===9?e:e.ownerDocument}function Ap(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 Tp(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 Qc(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 Zc=null;function y0(){var e=window.event;return e&&e.type==="popstate"?e===Zc?!1:(Zc=e,!0):(Zc=null,!1)}var Rp=typeof setTimeout=="function"?setTimeout:void 0,S0=typeof clearTimeout=="function"?clearTimeout:void 0,Dp=typeof Promise=="function"?Promise:void 0,b0=typeof queueMicrotask=="function"?queueMicrotask:typeof Dp<"u"?function(e){return Dp.resolve(null).then(e).catch(C0)}:Rp;function C0(e){setTimeout(function(){throw e})}function Ui(e){return e==="head"}function Mp(e,t){var i=t,l=0;do{var p=i.nextSibling;if(e.removeChild(i),p&&p.nodeType===8)if(i=p.data,i==="/$"||i==="/&"){if(l===0){e.removeChild(p),as(t);return}l--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")l++;else if(i==="html")nl(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,nl(i);for(var C=i.firstChild;C;){var O=C.nextSibling,P=C.nodeName;C[nr]||P==="SCRIPT"||P==="STYLE"||P==="LINK"&&C.rel.toLowerCase()==="stylesheet"||i.removeChild(C),C=O}}else i==="body"&&nl(e.ownerDocument.body);i=p}while(i);as(t)}function Lp(e,t){var i=e;e=0;do{var l=i.nextSibling;if(i.nodeType===1?t?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(t?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),l&&l.nodeType===8)if(i=l.data,i==="/$"){if(e===0)break;e--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||e++;i=l}while(i)}function Jc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var i=t;switch(t=t.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":Jc(i),ys(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function w0(e,t,i,l){for(;e.nodeType===1;){var p=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[nr])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(C=e.getAttribute("rel"),C==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(C!==p.rel||e.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||e.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||e.getAttribute("title")!==(p.title==null?null:p.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(C=e.getAttribute("src"),(C!==(p.src==null?null:p.src)||e.getAttribute("type")!==(p.type==null?null:p.type)||e.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&C&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var C=p.name==null?null:""+p.name;if(p.type==="hidden"&&e.getAttribute("name")===C)return e}else return e;if(e=Rn(e.nextSibling),e===null)break}return null}function x0(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=Rn(e.nextSibling),e===null))return null;return e}function Op(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Rn(e.nextSibling),e===null))return null;return e}function eu(e){return e.data==="$?"||e.data==="$~"}function tu(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function E0(e,t){var i=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||i.readyState!=="loading")t();else{var l=function(){t(),i.removeEventListener("DOMContentLoaded",l)};i.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function Rn(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 nu=null;function Bp(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(t===0)return Rn(e.nextSibling);t--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||t++}e=e.nextSibling}return null}function jp(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(t===0)return e;t--}else i!=="/$"&&i!=="/&"||t++}e=e.previousSibling}return null}function Np(e,t,i){switch(t=ka(i),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function nl(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ys(e)}var Dn=new Map,Hp=new Set;function Aa(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var di=$.d;$.d={f:k0,r:A0,D:T0,C:R0,L:D0,m:M0,X:O0,S:L0,M:B0};function k0(){var e=di.f(),t=va();return e||t}function A0(e){var t=Si(e);t!==null&&t.tag===5&&t.type==="form"?ed(t):di.r(e)}var rs=typeof document>"u"?null:document;function zp(e,t,i){var l=rs;if(l&&typeof t=="string"&&t){var p=Je(t);p='link[rel="'+e+'"][href="'+p+'"]',typeof i=="string"&&(p+='[crossorigin="'+i+'"]'),Hp.has(p)||(Hp.add(p),e={rel:e,crossOrigin:i,href:t},l.querySelector(p)===null&&(t=l.createElement("link"),Gt(t,"link",e),ft(t),l.head.appendChild(t)))}}function T0(e){di.D(e),zp("dns-prefetch",e,null)}function R0(e,t){di.C(e,t),zp("preconnect",e,t)}function D0(e,t,i){di.L(e,t,i);var l=rs;if(l&&e&&t){var p='link[rel="preload"][as="'+Je(t)+'"]';t==="image"&&i&&i.imageSrcSet?(p+='[imagesrcset="'+Je(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(p+='[imagesizes="'+Je(i.imageSizes)+'"]')):p+='[href="'+Je(e)+'"]';var C=p;switch(t){case"style":C=ss(e);break;case"script":C=ls(e)}Dn.has(C)||(e=u({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),Dn.set(C,e),l.querySelector(p)!==null||t==="style"&&l.querySelector(il(C))||t==="script"&&l.querySelector(rl(C))||(t=l.createElement("link"),Gt(t,"link",e),ft(t),l.head.appendChild(t)))}}function M0(e,t){di.m(e,t);var i=rs;if(i&&e){var l=t&&typeof t.as=="string"?t.as:"script",p='link[rel="modulepreload"][as="'+Je(l)+'"][href="'+Je(e)+'"]',C=p;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":C=ls(e)}if(!Dn.has(C)&&(e=u({rel:"modulepreload",href:e},t),Dn.set(C,e),i.querySelector(p)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(rl(C)))return}l=i.createElement("link"),Gt(l,"link",e),ft(l),i.head.appendChild(l)}}}function L0(e,t,i){di.S(e,t,i);var l=rs;if(l&&e){var p=Cn(l).hoistableStyles,C=ss(e);t=t||"default";var O=p.get(C);if(!O){var P={loading:0,preload:null};if(O=l.querySelector(il(C)))P.loading=5;else{e=u({rel:"stylesheet",href:e,"data-precedence":t},i),(i=Dn.get(C))&&iu(e,i);var X=O=l.createElement("link");ft(X),Gt(X,"link",e),X._p=new Promise(function(le,fe){X.onload=le,X.onerror=fe}),X.addEventListener("load",function(){P.loading|=1}),X.addEventListener("error",function(){P.loading|=2}),P.loading|=4,Ta(O,t,l)}O={type:"stylesheet",instance:O,count:1,state:P},p.set(C,O)}}}function O0(e,t){di.X(e,t);var i=rs;if(i&&e){var l=Cn(i).hoistableScripts,p=ls(e),C=l.get(p);C||(C=i.querySelector(rl(p)),C||(e=u({src:e,async:!0},t),(t=Dn.get(p))&&ru(e,t),C=i.createElement("script"),ft(C),Gt(C,"link",e),i.head.appendChild(C)),C={type:"script",instance:C,count:1,state:null},l.set(p,C))}}function B0(e,t){di.M(e,t);var i=rs;if(i&&e){var l=Cn(i).hoistableScripts,p=ls(e),C=l.get(p);C||(C=i.querySelector(rl(p)),C||(e=u({src:e,async:!0,type:"module"},t),(t=Dn.get(p))&&ru(e,t),C=i.createElement("script"),ft(C),Gt(C,"link",e),i.head.appendChild(C)),C={type:"script",instance:C,count:1,state:null},l.set(p,C))}}function Ip(e,t,i,l){var p=(p=me.current)?Aa(p):null;if(!p)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(t=ss(i.href),i=Cn(p).hoistableStyles,l=i.get(t),l||(l={type:"style",instance:null,count:0,state:null},i.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=ss(i.href);var C=Cn(p).hoistableStyles,O=C.get(e);if(O||(p=p.ownerDocument||p,O={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},C.set(e,O),(C=p.querySelector(il(e)))&&!C._p&&(O.instance=C,O.state.loading=5),Dn.has(e)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},Dn.set(e,i),C||j0(p,e,i,O.state))),t&&l===null)throw Error(o(528,""));return O}if(t&&l!==null)throw Error(o(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=ls(i),i=Cn(p).hoistableScripts,l=i.get(t),l||(l={type:"script",instance:null,count:0,state:null},i.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function ss(e){return'href="'+Je(e)+'"'}function il(e){return'link[rel="stylesheet"]['+e+"]"}function Up(e){return u({},e,{"data-precedence":e.precedence,precedence:null})}function j0(e,t,i,l){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=e.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),Gt(t,"link",i),ft(t),e.head.appendChild(t))}function ls(e){return'[src="'+Je(e)+'"]'}function rl(e){return"script[async]"+e}function Pp(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+Je(i.href)+'"]');if(l)return t.instance=l,ft(l),l;var p=u({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),ft(l),Gt(l,"style",p),Ta(l,i.precedence,e),t.instance=l;case"stylesheet":p=ss(i.href);var C=e.querySelector(il(p));if(C)return t.state.loading|=4,t.instance=C,ft(C),C;l=Up(i),(p=Dn.get(p))&&iu(l,p),C=(e.ownerDocument||e).createElement("link"),ft(C);var O=C;return O._p=new Promise(function(P,X){O.onload=P,O.onerror=X}),Gt(C,"link",l),t.state.loading|=4,Ta(C,i.precedence,e),t.instance=C;case"script":return C=ls(i.src),(p=e.querySelector(rl(C)))?(t.instance=p,ft(p),p):(l=i,(p=Dn.get(C))&&(l=u({},i),ru(l,p)),e=e.ownerDocument||e,p=e.createElement("script"),ft(p),Gt(p,"link",l),e.head.appendChild(p),t.instance=p);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,Ta(l,i.precedence,e));return t.instance}function Ta(e,t,i){for(var l=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=l.length?l[l.length-1]:null,C=p,O=0;O<l.length;O++){var P=l[O];if(P.dataset.precedence===t)C=P;else if(C!==p)break}C?C.parentNode.insertBefore(e,C.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function iu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function ru(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Ra=null;function Fp(e,t,i){if(Ra===null){var l=new Map,p=Ra=new Map;p.set(i,l)}else p=Ra,l=p.get(i),l||(l=new Map,p.set(i,l));if(l.has(e))return l;for(l.set(e,null),i=i.getElementsByTagName(e),p=0;p<i.length;p++){var C=i[p];if(!(C[nr]||C[st]||e==="link"&&C.getAttribute("rel")==="stylesheet")&&C.namespaceURI!=="http://www.w3.org/2000/svg"){var O=C.getAttribute(t)||"";O=e+O;var P=l.get(O);P?P.push(C):l.set(O,[C])}}return l}function qp(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function N0(e,t,i){if(i===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 Gp(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function H0(e,t,i,l){if(i.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var p=ss(l.href),C=t.querySelector(il(p));if(C){t=C._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Da.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=C,ft(C);return}C=t.ownerDocument||t,l=Up(l),(p=Dn.get(p))&&iu(l,p),C=C.createElement("link"),ft(C);var O=C;O._p=new Promise(function(P,X){O.onload=P,O.onerror=X}),Gt(C,"link",l),i.instance=C}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,t),(t=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=Da.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var su=0;function z0(e,t){return e.stylesheets&&e.count===0&&La(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var l=setTimeout(function(){if(e.stylesheets&&La(e,e.stylesheets),e.unsuspend){var C=e.unsuspend;e.unsuspend=null,C()}},6e4+t);0<e.imgBytes&&su===0&&(su=62500*v0());var p=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&La(e,e.stylesheets),e.unsuspend)){var C=e.unsuspend;e.unsuspend=null,C()}},(e.imgBytes>su?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(p)}}:null}function Da(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)La(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Ma=null;function La(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ma=new Map,t.forEach(I0,e),Ma=null,Da.call(e))}function I0(e,t){if(!(t.state.loading&4)){var i=Ma.get(e);if(i)var l=i.get(null);else{i=new Map,Ma.set(e,i);for(var p=e.querySelectorAll("link[data-precedence],style[data-precedence]"),C=0;C<p.length;C++){var O=p[C];(O.nodeName==="LINK"||O.getAttribute("media")!=="not all")&&(i.set(O.dataset.precedence,O),l=O)}l&&i.set(null,l)}p=t.instance,O=p.getAttribute("data-precedence"),C=i.get(O)||l,C===l&&i.set(null,p),i.set(O,p),this.count++,l=Da.bind(this),p.addEventListener("load",l),p.addEventListener("error",l),C?C.parentNode.insertBefore(p,C.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(p,e.firstChild)),t.state.loading|=4}}var sl={$$typeof:v,Provider:null,Consumer:null,_currentValue:ee,_currentValue2:ee,_threadCount:0};function U0(e,t,i,l,p,C,O,P,X){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=xr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xr(0),this.hiddenUpdates=xr(null),this.identifierPrefix=l,this.onUncaughtError=p,this.onCaughtError=C,this.onRecoverableError=O,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=X,this.incompleteTransitions=new Map}function Vp(e,t,i,l,p,C,O,P,X,le,fe,ge){return e=new U0(e,t,i,O,X,le,fe,ge,P),t=1,C===!0&&(t|=24),C=fn(3,null,null,t),e.current=C,C.stateNode=e,t=zo(),t.refCount++,e.pooledCache=t,t.refCount++,C.memoizedState={element:l,isDehydrated:i,cache:t},Fo(C),e}function $p(e){return e?(e=Hr,e):Hr}function Kp(e,t,i,l,p,C){p=$p(p),l.context===null?l.context=p:l.pendingContext=p,l=Ri(t),l.payload={element:i},C=C===void 0?null:C,C!==null&&(l.callback=C),i=Di(e,l,t),i!==null&&(an(i,e,t),Hs(i,e,t))}function Yp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function lu(e,t){Yp(e,t),(e=e.alternate)&&Yp(e,t)}function Wp(e){if(e.tag===13||e.tag===31){var t=ar(e,67108864);t!==null&&an(t,e,67108864),lu(e,67108864)}}function Xp(e){if(e.tag===13||e.tag===31){var t=_n();t=ye(t);var i=ar(e,t);i!==null&&an(i,e,t),lu(e,t)}}var Oa=!0;function P0(e,t,i,l){var p=V.T;V.T=null;var C=$.p;try{$.p=2,au(e,t,i,l)}finally{$.p=C,V.T=p}}function F0(e,t,i,l){var p=V.T;V.T=null;var C=$.p;try{$.p=8,au(e,t,i,l)}finally{$.p=C,V.T=p}}function au(e,t,i,l){if(Oa){var p=ou(l);if(p===null)Kc(e,t,l,Ba,i),Zp(e,l);else if(G0(p,e,t,i,l))l.stopPropagation();else if(Zp(e,l),t&4&&-1<q0.indexOf(e)){for(;p!==null;){var C=Si(p);if(C!==null)switch(C.tag){case 3:if(C=C.stateNode,C.current.memoizedState.isDehydrated){var O=Sn(C.pendingLanes);if(O!==0){var P=C;for(P.pendingLanes|=2,P.entangledLanes|=2;O;){var X=1<<31-Xe(O);P.entanglements[1]|=X,O&=~X}qn(C),(et&6)===0&&(ga=rt()+500,Js(0))}}break;case 31:case 13:P=ar(C,2),P!==null&&an(P,C,2),va(),lu(C,2)}if(C=ou(l),C===null&&Kc(e,t,l,Ba,i),C===p)break;p=C}p!==null&&l.stopPropagation()}else Kc(e,t,l,null,i)}}function ou(e){return e=co(e),cu(e)}var Ba=null;function cu(e){if(Ba=null,e=yi(e),e!==null){var t=_(e);if(t===null)e=null;else{var i=t.tag;if(i===13){if(e=f(t),e!==null)return e;e=null}else if(i===31){if(e=a(t),e!==null)return e;e=null}else if(i===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Ba=e,null}function Qp(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(kt()){case ue:return 2;case Se:return 8;case ke:case De:return 32;case Be:return 268435456;default:return 32}default:return 32}}var uu=!1,Pi=null,Fi=null,qi=null,ll=new Map,al=new Map,Gi=[],q0="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 Zp(e,t){switch(e){case"focusin":case"focusout":Pi=null;break;case"dragenter":case"dragleave":Fi=null;break;case"mouseover":case"mouseout":qi=null;break;case"pointerover":case"pointerout":ll.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":al.delete(t.pointerId)}}function ol(e,t,i,l,p,C){return e===null||e.nativeEvent!==C?(e={blockedOn:t,domEventName:i,eventSystemFlags:l,nativeEvent:C,targetContainers:[p]},t!==null&&(t=Si(t),t!==null&&Wp(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,p!==null&&t.indexOf(p)===-1&&t.push(p),e)}function G0(e,t,i,l,p){switch(t){case"focusin":return Pi=ol(Pi,e,t,i,l,p),!0;case"dragenter":return Fi=ol(Fi,e,t,i,l,p),!0;case"mouseover":return qi=ol(qi,e,t,i,l,p),!0;case"pointerover":var C=p.pointerId;return ll.set(C,ol(ll.get(C)||null,e,t,i,l,p)),!0;case"gotpointercapture":return C=p.pointerId,al.set(C,ol(al.get(C)||null,e,t,i,l,p)),!0}return!1}function Jp(e){var t=yi(e.target);if(t!==null){var i=_(t);if(i!==null){if(t=i.tag,t===13){if(t=f(i),t!==null){e.blockedOn=t,Al(e.priority,function(){Xp(i)});return}}else if(t===31){if(t=a(i),t!==null){e.blockedOn=t,Al(e.priority,function(){Xp(i)});return}}else if(t===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ja(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=ou(e.nativeEvent);if(i===null){i=e.nativeEvent;var l=new i.constructor(i.type,i);oo=l,i.target.dispatchEvent(l),oo=null}else return t=Si(i),t!==null&&Wp(t),e.blockedOn=i,!1;t.shift()}return!0}function em(e,t,i){ja(e)&&i.delete(t)}function V0(){uu=!1,Pi!==null&&ja(Pi)&&(Pi=null),Fi!==null&&ja(Fi)&&(Fi=null),qi!==null&&ja(qi)&&(qi=null),ll.forEach(em),al.forEach(em)}function Na(e,t){e.blockedOn===t&&(e.blockedOn=null,uu||(uu=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,V0)))}var Ha=null;function tm(e){Ha!==e&&(Ha=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Ha===e&&(Ha=null);for(var t=0;t<e.length;t+=3){var i=e[t],l=e[t+1],p=e[t+2];if(typeof l!="function"){if(cu(l||i)===null)continue;break}var C=Si(i);C!==null&&(e.splice(t,3),t-=3,oc(C,{pending:!0,data:p,method:i.method,action:l},l,p))}}))}function as(e){function t(X){return Na(X,e)}Pi!==null&&Na(Pi,e),Fi!==null&&Na(Fi,e),qi!==null&&Na(qi,e),ll.forEach(t),al.forEach(t);for(var i=0;i<Gi.length;i++){var l=Gi[i];l.blockedOn===e&&(l.blockedOn=null)}for(;0<Gi.length&&(i=Gi[0],i.blockedOn===null);)Jp(i),i.blockedOn===null&&Gi.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(l=0;l<i.length;l+=3){var p=i[l],C=i[l+1],O=p[Ut]||null;if(typeof C=="function")O||tm(i);else if(O){var P=null;if(C&&C.hasAttribute("formAction")){if(p=C,O=C[Ut]||null)P=O.formAction;else if(cu(p)!==null)continue}else P=O.action;typeof P=="function"?i[l+1]=P:(i.splice(l,3),l-=3),tm(i)}}}function nm(){function e(C){C.canIntercept&&C.info==="react-transition"&&C.intercept({handler:function(){return new Promise(function(O){return p=O})},focusReset:"manual",scroll:"manual"})}function t(){p!==null&&(p(),p=null),l||setTimeout(i,20)}function i(){if(!l&&!navigation.transition){var C=navigation.currentEntry;C&&C.url!=null&&navigation.navigate(C.url,{state:C.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,p=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(i,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),p!==null&&(p(),p=null)}}}function hu(e){this._internalRoot=e}za.prototype.render=hu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var i=t.current,l=_n();Kp(i,l,e,t,null,null)},za.prototype.unmount=hu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Kp(e.current,2,null,e,null,null),va(),t[Kn]=null}};function za(e){this._internalRoot=e}za.prototype.unstable_scheduleHydration=function(e){if(e){var t=kl();e={blockedOn:null,target:e,priority:t};for(var i=0;i<Gi.length&&t!==0&&t<Gi[i].priority;i++);Gi.splice(i,0,e),i===0&&Jp(e)}};var im=r.version;if(im!=="19.2.6")throw Error(o(527,im,"19.2.6"));$.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=h(t),e=e!==null?m(e):null,e=e===null?null:e.stateNode,e};var $0={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:V,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ia=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ia.isDisabled&&Ia.supportsFiber)try{gt=Ia.inject($0),Ye=Ia}catch{}}return ul.createRoot=function(e,t){if(!d(e))throw Error(o(299));var i=!1,l="",p=ud,C=hd,O=fd;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(p=t.onUncaughtError),t.onCaughtError!==void 0&&(C=t.onCaughtError),t.onRecoverableError!==void 0&&(O=t.onRecoverableError)),t=Vp(e,1,!1,null,null,i,l,null,p,C,O,nm),e[Kn]=t.current,$c(e),new hu(t)},ul.hydrateRoot=function(e,t,i){if(!d(e))throw Error(o(299));var l=!1,p="",C=ud,O=hd,P=fd,X=null;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(p=i.identifierPrefix),i.onUncaughtError!==void 0&&(C=i.onUncaughtError),i.onCaughtError!==void 0&&(O=i.onCaughtError),i.onRecoverableError!==void 0&&(P=i.onRecoverableError),i.formState!==void 0&&(X=i.formState)),t=Vp(e,1,!0,t,i??null,l,p,X,C,O,P,nm),t.context=$p(null),i=t.current,l=_n(),l=ye(l),p=Ri(l),p.callback=null,Di(i,p,l),i=l,t.current.lanes=i,Nt(t,i),qn(t),e[Kn]=t.current,$c(e),new za(t)},ul.version="19.2.6",ul}var pm;function r1(){if(pm)return pu.exports;pm=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),pu.exports=i1(),pu.exports}var s1=r1();const ms=function(n,r){let d=n;const _=ml[r];let f=null,a=0,c=null;const h=[],m={},u=function(T,A){a=d*4+17,f=(function(M){const j=new Array(M);for(let I=0;I<M;I+=1){j[I]=new Array(M);for(let U=0;U<M;U+=1)j[I][U]=null}return j})(a),y(0,0),y(a-7,0),y(0,a-7),x(),k(),S(T,A),d>=7&&b(T),c==null&&(c=E(d,_,h)),g(c,A)},y=function(T,A){for(let M=-1;M<=7;M+=1)if(!(T+M<=-1||a<=T+M))for(let j=-1;j<=7;j+=1)A+j<=-1||a<=A+j||(0<=M&&M<=6&&(j==0||j==6)||0<=j&&j<=6&&(M==0||M==6)||2<=M&&M<=4&&2<=j&&j<=4?f[T+M][A+j]=!0:f[T+M][A+j]=!1)},w=function(){let T=0,A=0;for(let M=0;M<8;M+=1){u(!0,M);const j=Ki.getLostPoint(m);(M==0||T>j)&&(T=j,A=M)}return A},k=function(){for(let T=8;T<a-8;T+=1)f[T][6]==null&&(f[T][6]=T%2==0);for(let T=8;T<a-8;T+=1)f[6][T]==null&&(f[6][T]=T%2==0)},x=function(){const T=Ki.getPatternPosition(d);for(let A=0;A<T.length;A+=1)for(let M=0;M<T.length;M+=1){const j=T[A],I=T[M];if(f[j][I]==null)for(let U=-2;U<=2;U+=1)for(let F=-2;F<=2;F+=1)U==-2||U==2||F==-2||F==2||U==0&&F==0?f[j+U][I+F]=!0:f[j+U][I+F]=!1}},b=function(T){const A=Ki.getBCHTypeNumber(d);for(let M=0;M<18;M+=1){const j=!T&&(A>>M&1)==1;f[Math.floor(M/3)][M%3+a-8-3]=j}for(let M=0;M<18;M+=1){const j=!T&&(A>>M&1)==1;f[M%3+a-8-3][Math.floor(M/3)]=j}},S=function(T,A){const M=_<<3|A,j=Ki.getBCHTypeInfo(M);for(let I=0;I<15;I+=1){const U=!T&&(j>>I&1)==1;I<6?f[I][8]=U:I<8?f[I+1][8]=U:f[a-15+I][8]=U}for(let I=0;I<15;I+=1){const U=!T&&(j>>I&1)==1;I<8?f[8][a-I-1]=U:I<9?f[8][15-I-1+1]=U:f[8][15-I-1]=U}f[a-8][8]=!T},g=function(T,A){let M=-1,j=a-1,I=7,U=0;const F=Ki.getMaskFunction(A);for(let K=a-1;K>0;K-=2)for(K==6&&(K-=1);;){for(let W=0;W<2;W+=1)if(f[j][K-W]==null){let V=!1;U<T.length&&(V=(T[U]>>>I&1)==1),F(j,K-W)&&(V=!V),f[j][K-W]=V,I-=1,I==-1&&(U+=1,I=7)}if(j+=M,j<0||a<=j){j-=M,M=-M;break}}},v=function(T,A){let M=0,j=0,I=0;const U=new Array(A.length),F=new Array(A.length);for(let $=0;$<A.length;$+=1){const ee=A[$].dataCount,N=A[$].totalCount-ee;j=Math.max(j,ee),I=Math.max(I,N),U[$]=new Array(ee);for(let H=0;H<U[$].length;H+=1)U[$][H]=255&T.getBuffer()[H+M];M+=ee;const B=Ki.getErrorCorrectPolynomial(N),G=yl(U[$],B.getLength()-1).mod(B);F[$]=new Array(B.getLength()-1);for(let H=0;H<F[$].length;H+=1){const te=H+G.getLength()-F[$].length;F[$][H]=te>=0?G.getAt(te):0}}let K=0;for(let $=0;$<A.length;$+=1)K+=A[$].totalCount;const W=new Array(K);let V=0;for(let $=0;$<j;$+=1)for(let ee=0;ee<A.length;ee+=1)$<U[ee].length&&(W[V]=U[ee][$],V+=1);for(let $=0;$<I;$+=1)for(let ee=0;ee<A.length;ee+=1)$<F[ee].length&&(W[V]=F[ee][$],V+=1);return W},E=function(T,A,M){const j=mm.getRSBlocks(T,A),I=gm();for(let F=0;F<M.length;F+=1){const K=M[F];I.put(K.getMode(),4),I.put(K.getLength(),Ki.getLengthInBits(K.getMode(),T)),K.write(I)}let U=0;for(let F=0;F<j.length;F+=1)U+=j[F].dataCount;if(I.getLengthInBits()>U*8)throw"code length overflow. ("+I.getLengthInBits()+">"+U*8+")";for(I.getLengthInBits()+4<=U*8&&I.put(0,4);I.getLengthInBits()%8!=0;)I.putBit(!1);for(;!(I.getLengthInBits()>=U*8||(I.put(236,8),I.getLengthInBits()>=U*8));)I.put(17,8);return v(I,j)};m.addData=function(T,A){A=A||"Byte";let M=null;switch(A){case"Numeric":M=l1(T);break;case"Alphanumeric":M=a1(T);break;case"Byte":M=o1(T);break;case"Kanji":M=c1(T);break;default:throw"mode:"+A}h.push(M),c=null},m.isDark=function(T,A){if(T<0||a<=T||A<0||a<=A)throw T+","+A;return f[T][A]},m.getModuleCount=function(){return a},m.make=function(){if(d<1){let T=1;for(;T<40;T++){const A=mm.getRSBlocks(T,_),M=gm();for(let I=0;I<h.length;I++){const U=h[I];M.put(U.getMode(),4),M.put(U.getLength(),Ki.getLengthInBits(U.getMode(),T)),U.write(M)}let j=0;for(let I=0;I<A.length;I++)j+=A[I].dataCount;if(M.getLengthInBits()<=j*8)break}d=T}u(!1,w())},m.createTableTag=function(T,A){T=T||2,A=typeof A>"u"?T*4:A;let M="";M+='<table style="',M+=" border-width: 0px; border-style: none;",M+=" border-collapse: collapse;",M+=" padding: 0px; margin: "+A+"px;",M+='">',M+="<tbody>";for(let j=0;j<m.getModuleCount();j+=1){M+="<tr>";for(let I=0;I<m.getModuleCount();I+=1)M+='<td style="',M+=" border-width: 0px; border-style: none;",M+=" border-collapse: collapse;",M+=" padding: 0px; margin: 0px;",M+=" width: "+T+"px;",M+=" height: "+T+"px;",M+=" background-color: ",M+=m.isDark(j,I)?"#000000":"#ffffff",M+=";",M+='"/>';M+="</tr>"}return M+="</tbody>",M+="</table>",M},m.createSvgTag=function(T,A,M,j){let I={};typeof arguments[0]=="object"&&(I=arguments[0],T=I.cellSize,A=I.margin,M=I.alt,j=I.title),T=T||2,A=typeof A>"u"?T*4:A,M=typeof M=="string"?{text:M}:M||{},M.text=M.text||null,M.id=M.text?M.id||"qrcode-description":null,j=typeof j=="string"?{text:j}:j||{},j.text=j.text||null,j.id=j.text?j.id||"qrcode-title":null;const U=m.getModuleCount()*T+A*2;let F,K,W,V,$="",ee;for(ee="l"+T+",0 0,"+T+" -"+T+",0 0,-"+T+"z ",$+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',$+=I.scalable?"":' width="'+U+'px" height="'+U+'px"',$+=' viewBox="0 0 '+U+" "+U+'" ',$+=' preserveAspectRatio="xMinYMin meet"',$+=j.text||M.text?' role="img" aria-labelledby="'+L([j.id,M.id].join(" ").trim())+'"':"",$+=">",$+=j.text?'<title id="'+L(j.id)+'">'+L(j.text)+"</title>":"",$+=M.text?'<description id="'+L(M.id)+'">'+L(M.text)+"</description>":"",$+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',$+='<path d="',W=0;W<m.getModuleCount();W+=1)for(V=W*T+A,F=0;F<m.getModuleCount();F+=1)m.isDark(W,F)&&(K=F*T+A,$+="M"+K+","+V+ee);return $+='" stroke="transparent" fill="black"/>',$+="</svg>",$},m.createDataURL=function(T,A){T=T||2,A=typeof A>"u"?T*4:A;const M=m.getModuleCount()*T+A*2,j=A,I=M-A;return d1(M,M,function(U,F){if(j<=U&&U<I&&j<=F&&F<I){const K=Math.floor((U-j)/T),W=Math.floor((F-j)/T);return m.isDark(W,K)?0:1}else return 1})},m.createImgTag=function(T,A,M){T=T||2,A=typeof A>"u"?T*4:A;const j=m.getModuleCount()*T+A*2;let I="";return I+="<img",I+=' src="',I+=m.createDataURL(T,A),I+='"',I+=' width="',I+=j,I+='"',I+=' height="',I+=j,I+='"',M&&(I+=' alt="',I+=L(M),I+='"'),I+="/>",I};const L=function(T){let A="";for(let M=0;M<T.length;M+=1){const j=T.charAt(M);switch(j){case"<":A+="&lt;";break;case">":A+="&gt;";break;case"&":A+="&amp;";break;case'"':A+="&quot;";break;default:A+=j;break}}return A},R=function(T){T=typeof T>"u"?2:T;const M=m.getModuleCount()*1+T*2,j=T,I=M-T;let U,F,K,W,V;const $={"██":"█","█ ":"▀"," █":"▄"," ":" "},ee={"██":"▀","█ ":"▀"," █":" "," ":" "};let N="";for(U=0;U<M;U+=2){for(K=Math.floor((U-j)/1),W=Math.floor((U+1-j)/1),F=0;F<M;F+=1)V="█",j<=F&&F<I&&j<=U&&U<I&&m.isDark(K,Math.floor((F-j)/1))&&(V=" "),j<=F&&F<I&&j<=U+1&&U+1<I&&m.isDark(W,Math.floor((F-j)/1))?V+=" ":V+="█",N+=T<1&&U+1>=I?ee[V]:$[V];N+=`
50
+ `}return M%2&&T>0?N.substring(0,N.length-M-1)+Array(M+1).join("▀"):N.substring(0,N.length-1)};return m.createASCII=function(T,A){if(T=T||1,T<2)return R(A);T-=1,A=typeof A>"u"?T*2:A;const M=m.getModuleCount()*T+A*2,j=A,I=M-A;let U,F,K,W;const V=Array(T+1).join("██"),$=Array(T+1).join(" ");let ee="",N="";for(U=0;U<M;U+=1){for(K=Math.floor((U-j)/T),N="",F=0;F<M;F+=1)W=1,j<=F&&F<I&&j<=U&&U<I&&m.isDark(K,Math.floor((F-j)/T))&&(W=0),N+=W?V:$;for(K=0;K<T;K+=1)ee+=N+`
51
+ `}return ee.substring(0,ee.length-1)},m.renderTo2dContext=function(T,A){A=A||2;const M=m.getModuleCount();for(let j=0;j<M;j++)for(let I=0;I<M;I++)T.fillStyle=m.isDark(j,I)?"black":"white",T.fillRect(I*A,j*A,A,A)},m};ms.stringToBytes=function(n){const r=[];for(let s=0;s<n.length;s+=1){const o=n.charCodeAt(s);r.push(o&255)}return r};ms.createStringToBytes=function(n,r){const s=(function(){const d=h1(n),_=function(){const c=d.read();if(c==-1)throw"eof";return c};let f=0;const a={};for(;;){const c=d.read();if(c==-1)break;const h=_(),m=_(),u=_(),y=String.fromCharCode(c<<8|h),w=m<<8|u;a[y]=w,f+=1}if(f!=r)throw f+" != "+r;return a})(),o=63;return function(d){const _=[];for(let f=0;f<d.length;f+=1){const a=d.charCodeAt(f);if(a<128)_.push(a);else{const c=s[d.charAt(f)];typeof c=="number"?(c&255)==c?_.push(c):(_.push(c>>>8),_.push(c&255)):_.push(o)}}return _}};const $t={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},ml={L:1,M:0,Q:3,H:2},$i={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},Ki=(function(){const n=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],r=1335,s=7973,o=21522,d={},_=function(f){let a=0;for(;f!=0;)a+=1,f>>>=1;return a};return d.getBCHTypeInfo=function(f){let a=f<<10;for(;_(a)-_(r)>=0;)a^=r<<_(a)-_(r);return(f<<10|a)^o},d.getBCHTypeNumber=function(f){let a=f<<12;for(;_(a)-_(s)>=0;)a^=s<<_(a)-_(s);return f<<12|a},d.getPatternPosition=function(f){return n[f-1]},d.getMaskFunction=function(f){switch(f){case $i.PATTERN000:return function(a,c){return(a+c)%2==0};case $i.PATTERN001:return function(a,c){return a%2==0};case $i.PATTERN010:return function(a,c){return c%3==0};case $i.PATTERN011:return function(a,c){return(a+c)%3==0};case $i.PATTERN100:return function(a,c){return(Math.floor(a/2)+Math.floor(c/3))%2==0};case $i.PATTERN101:return function(a,c){return a*c%2+a*c%3==0};case $i.PATTERN110:return function(a,c){return(a*c%2+a*c%3)%2==0};case $i.PATTERN111:return function(a,c){return(a*c%3+(a+c)%2)%2==0};default:throw"bad maskPattern:"+f}},d.getErrorCorrectPolynomial=function(f){let a=yl([1],0);for(let c=0;c<f;c+=1)a=a.multiply(yl([1,Wi.gexp(c)],0));return a},d.getLengthInBits=function(f,a){if(1<=a&&a<10)switch(f){case $t.MODE_NUMBER:return 10;case $t.MODE_ALPHA_NUM:return 9;case $t.MODE_8BIT_BYTE:return 8;case $t.MODE_KANJI:return 8;default:throw"mode:"+f}else if(a<27)switch(f){case $t.MODE_NUMBER:return 12;case $t.MODE_ALPHA_NUM:return 11;case $t.MODE_8BIT_BYTE:return 16;case $t.MODE_KANJI:return 10;default:throw"mode:"+f}else if(a<41)switch(f){case $t.MODE_NUMBER:return 14;case $t.MODE_ALPHA_NUM:return 13;case $t.MODE_8BIT_BYTE:return 16;case $t.MODE_KANJI:return 12;default:throw"mode:"+f}else throw"type:"+a},d.getLostPoint=function(f){const a=f.getModuleCount();let c=0;for(let u=0;u<a;u+=1)for(let y=0;y<a;y+=1){let w=0;const k=f.isDark(u,y);for(let x=-1;x<=1;x+=1)if(!(u+x<0||a<=u+x))for(let b=-1;b<=1;b+=1)y+b<0||a<=y+b||x==0&&b==0||k==f.isDark(u+x,y+b)&&(w+=1);w>5&&(c+=3+w-5)}for(let u=0;u<a-1;u+=1)for(let y=0;y<a-1;y+=1){let w=0;f.isDark(u,y)&&(w+=1),f.isDark(u+1,y)&&(w+=1),f.isDark(u,y+1)&&(w+=1),f.isDark(u+1,y+1)&&(w+=1),(w==0||w==4)&&(c+=3)}for(let u=0;u<a;u+=1)for(let y=0;y<a-6;y+=1)f.isDark(u,y)&&!f.isDark(u,y+1)&&f.isDark(u,y+2)&&f.isDark(u,y+3)&&f.isDark(u,y+4)&&!f.isDark(u,y+5)&&f.isDark(u,y+6)&&(c+=40);for(let u=0;u<a;u+=1)for(let y=0;y<a-6;y+=1)f.isDark(y,u)&&!f.isDark(y+1,u)&&f.isDark(y+2,u)&&f.isDark(y+3,u)&&f.isDark(y+4,u)&&!f.isDark(y+5,u)&&f.isDark(y+6,u)&&(c+=40);let h=0;for(let u=0;u<a;u+=1)for(let y=0;y<a;y+=1)f.isDark(y,u)&&(h+=1);const m=Math.abs(100*h/a/a-50)/5;return c+=m*10,c},d})(),Wi=(function(){const n=new Array(256),r=new Array(256);for(let o=0;o<8;o+=1)n[o]=1<<o;for(let o=8;o<256;o+=1)n[o]=n[o-4]^n[o-5]^n[o-6]^n[o-8];for(let o=0;o<255;o+=1)r[n[o]]=o;const s={};return s.glog=function(o){if(o<1)throw"glog("+o+")";return r[o]},s.gexp=function(o){for(;o<0;)o+=255;for(;o>=256;)o-=255;return n[o]},s})(),yl=function(n,r){if(typeof n.length>"u")throw n.length+"/"+r;const s=(function(){let d=0;for(;d<n.length&&n[d]==0;)d+=1;const _=new Array(n.length-d+r);for(let f=0;f<n.length-d;f+=1)_[f]=n[f+d];return _})(),o={};return o.getAt=function(d){return s[d]},o.getLength=function(){return s.length},o.multiply=function(d){const _=new Array(o.getLength()+d.getLength()-1);for(let f=0;f<o.getLength();f+=1)for(let a=0;a<d.getLength();a+=1)_[f+a]^=Wi.gexp(Wi.glog(o.getAt(f))+Wi.glog(d.getAt(a)));return yl(_,0)},o.mod=function(d){if(o.getLength()-d.getLength()<0)return o;const _=Wi.glog(o.getAt(0))-Wi.glog(d.getAt(0)),f=new Array(o.getLength());for(let a=0;a<o.getLength();a+=1)f[a]=o.getAt(a);for(let a=0;a<d.getLength();a+=1)f[a]^=Wi.gexp(Wi.glog(d.getAt(a))+_);return yl(f,0).mod(d)},o},mm=(function(){const n=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],r=function(d,_){const f={};return f.totalCount=d,f.dataCount=_,f},s={},o=function(d,_){switch(_){case ml.L:return n[(d-1)*4+0];case ml.M:return n[(d-1)*4+1];case ml.Q:return n[(d-1)*4+2];case ml.H:return n[(d-1)*4+3];default:return}};return s.getRSBlocks=function(d,_){const f=o(d,_);if(typeof f>"u")throw"bad rs block @ typeNumber:"+d+"/errorCorrectionLevel:"+_;const a=f.length/3,c=[];for(let h=0;h<a;h+=1){const m=f[h*3+0],u=f[h*3+1],y=f[h*3+2];for(let w=0;w<m;w+=1)c.push(r(u,y))}return c},s})(),gm=function(){const n=[];let r=0;const s={};return s.getBuffer=function(){return n},s.getAt=function(o){const d=Math.floor(o/8);return(n[d]>>>7-o%8&1)==1},s.put=function(o,d){for(let _=0;_<d;_+=1)s.putBit((o>>>d-_-1&1)==1)},s.getLengthInBits=function(){return r},s.putBit=function(o){const d=Math.floor(r/8);n.length<=d&&n.push(0),o&&(n[d]|=128>>>r%8),r+=1},s},l1=function(n){const r=$t.MODE_NUMBER,s=n,o={};o.getMode=function(){return r},o.getLength=function(f){return s.length},o.write=function(f){const a=s;let c=0;for(;c+2<a.length;)f.put(d(a.substring(c,c+3)),10),c+=3;c<a.length&&(a.length-c==1?f.put(d(a.substring(c,c+1)),4):a.length-c==2&&f.put(d(a.substring(c,c+2)),7))};const d=function(f){let a=0;for(let c=0;c<f.length;c+=1)a=a*10+_(f.charAt(c));return a},_=function(f){if("0"<=f&&f<="9")return f.charCodeAt(0)-48;throw"illegal char :"+f};return o},a1=function(n){const r=$t.MODE_ALPHA_NUM,s=n,o={};o.getMode=function(){return r},o.getLength=function(_){return s.length},o.write=function(_){const f=s;let a=0;for(;a+1<f.length;)_.put(d(f.charAt(a))*45+d(f.charAt(a+1)),11),a+=2;a<f.length&&_.put(d(f.charAt(a)),6)};const d=function(_){if("0"<=_&&_<="9")return _.charCodeAt(0)-48;if("A"<=_&&_<="Z")return _.charCodeAt(0)-65+10;switch(_){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+_}};return o},o1=function(n){const r=$t.MODE_8BIT_BYTE,s=ms.stringToBytes(n),o={};return o.getMode=function(){return r},o.getLength=function(d){return s.length},o.write=function(d){for(let _=0;_<s.length;_+=1)d.put(s[_],8)},o},c1=function(n){const r=$t.MODE_KANJI,s=ms.stringToBytes;(function(_,f){const a=s(_);if(a.length!=2||(a[0]<<8|a[1])!=f)throw"sjis not supported."})("友",38726);const o=s(n),d={};return d.getMode=function(){return r},d.getLength=function(_){return~~(o.length/2)},d.write=function(_){const f=o;let a=0;for(;a+1<f.length;){let c=(255&f[a])<<8|255&f[a+1];if(33088<=c&&c<=40956)c-=33088;else if(57408<=c&&c<=60351)c-=49472;else throw"illegal char at "+(a+1)+"/"+c;c=(c>>>8&255)*192+(c&255),_.put(c,13),a+=2}if(a<f.length)throw"illegal char at "+(a+1)},d},Cg=function(){const n=[],r={};return r.writeByte=function(s){n.push(s&255)},r.writeShort=function(s){r.writeByte(s),r.writeByte(s>>>8)},r.writeBytes=function(s,o,d){o=o||0,d=d||s.length;for(let _=0;_<d;_+=1)r.writeByte(s[_+o])},r.writeString=function(s){for(let o=0;o<s.length;o+=1)r.writeByte(s.charCodeAt(o))},r.toByteArray=function(){return n},r.toString=function(){let s="";s+="[";for(let o=0;o<n.length;o+=1)o>0&&(s+=","),s+=n[o];return s+="]",s},r},u1=function(){let n=0,r=0,s=0,o="";const d={},_=function(a){o+=String.fromCharCode(f(a&63))},f=function(a){if(a<0)throw"n:"+a;if(a<26)return 65+a;if(a<52)return 97+(a-26);if(a<62)return 48+(a-52);if(a==62)return 43;if(a==63)return 47;throw"n:"+a};return d.writeByte=function(a){for(n=n<<8|a&255,r+=8,s+=1;r>=6;)_(n>>>r-6),r-=6},d.flush=function(){if(r>0&&(_(n<<6-r),n=0,r=0),s%3!=0){const a=3-s%3;for(let c=0;c<a;c+=1)o+="="}},d.toString=function(){return o},d},h1=function(n){const r=n;let s=0,o=0,d=0;const _={};_.read=function(){for(;d<8;){if(s>=r.length){if(d==0)return-1;throw"unexpected end of file./"+d}const c=r.charAt(s);if(s+=1,c=="=")return d=0,-1;if(c.match(/^\s$/))continue;o=o<<6|f(c.charCodeAt(0)),d+=6}const a=o>>>d-8&255;return d-=8,a};const f=function(a){if(65<=a&&a<=90)return a-65;if(97<=a&&a<=122)return a-97+26;if(48<=a&&a<=57)return a-48+52;if(a==43)return 62;if(a==47)return 63;throw"c:"+a};return _},f1=function(n,r){const s=n,o=r,d=new Array(n*r),_={};_.setPixel=function(h,m,u){d[m*s+h]=u},_.write=function(h){h.writeString("GIF87a"),h.writeShort(s),h.writeShort(o),h.writeByte(128),h.writeByte(0),h.writeByte(0),h.writeByte(0),h.writeByte(0),h.writeByte(0),h.writeByte(255),h.writeByte(255),h.writeByte(255),h.writeString(","),h.writeShort(0),h.writeShort(0),h.writeShort(s),h.writeShort(o),h.writeByte(0);const m=2,u=a(m);h.writeByte(m);let y=0;for(;u.length-y>255;)h.writeByte(255),h.writeBytes(u,y,255),y+=255;h.writeByte(u.length-y),h.writeBytes(u,y,u.length-y),h.writeByte(0),h.writeString(";")};const f=function(h){const m=h;let u=0,y=0;const w={};return w.write=function(k,x){if(k>>>x)throw"length over";for(;u+x>=8;)m.writeByte(255&(k<<u|y)),x-=8-u,k>>>=8-u,y=0,u=0;y=k<<u|y,u=u+x},w.flush=function(){u>0&&m.writeByte(y)},w},a=function(h){const m=1<<h,u=(1<<h)+1;let y=h+1;const w=c();for(let g=0;g<m;g+=1)w.add(String.fromCharCode(g));w.add(String.fromCharCode(m)),w.add(String.fromCharCode(u));const k=Cg(),x=f(k);x.write(m,y);let b=0,S=String.fromCharCode(d[b]);for(b+=1;b<d.length;){const g=String.fromCharCode(d[b]);b+=1,w.contains(S+g)?S=S+g:(x.write(w.indexOf(S),y),w.size()<4095&&(w.size()==1<<y&&(y+=1),w.add(S+g)),S=g)}return x.write(w.indexOf(S),y),x.write(u,y),x.flush(),k.toByteArray()},c=function(){const h={};let m=0;const u={};return u.add=function(y){if(u.contains(y))throw"dup key:"+y;h[y]=m,m+=1},u.size=function(){return m},u.indexOf=function(y){return h[y]},u.contains=function(y){return typeof h[y]<"u"},u};return _},d1=function(n,r,s){const o=f1(n,r);for(let a=0;a<r;a+=1)for(let c=0;c<n;c+=1)o.setPixel(c,a,s(c,a));const d=Cg();o.write(d);const _=u1(),f=d.toByteArray();for(let a=0;a<f.length;a+=1)_.writeByte(f[a]);return _.flush(),"data:image/gif;base64,"+_};ms.stringToBytes;const ds=[{name:"project-manager",label:"Project Manager",commandAgent:"project-manager",dispatchable:!1},{name:"architect",label:"Architect",commandAgent:"architect",dispatchable:!0},{name:"coder",label:"Coder",commandAgent:"coder",dispatchable:!0},{name:"reviewer",label:"Reviewer",commandAgent:"reviewer",dispatchable:!0}],wg={name:"gate-reviewer",label:"Gate Reviewer",commandAgent:"gate-reviewer",dispatchable:!1},Zu=[...ds,wg],p1={name:"translator",label:"Translator",commandAgent:"translator",dispatchable:!1},m1={name:"harness-engineer",label:"Harness Engineer",commandAgent:"harness-engineer",dispatchable:!1},xg=[p1,m1],Ju=[...Zu,...xg],g1=ds.map(n=>n.name),Eg=Zu.map(n=>n.name);xg.map(n=>n.name);Ju.map(n=>n.name);Ju.filter(n=>n.dispatchable).map(n=>n.name);function _1(n){return Eg.includes(n)}const v1="zh-CN",y1="pm-final-only",kg=[{value:"zh-CN",label:"Chinese"},{value:"ja",label:"Japanese"},{value:"ko",label:"Korean"},{value:"fr",label:"French"},{value:"de",label:"German"},{value:"es",label:"Spanish"}],S1=[{value:"pm-final-only",label:"PM final reply"},{value:"final-only",label:"Each role final reply"},{value:"all",label:"All replies"}];function b1(){const n={};for(const r of Eg)n[r]={permissionMode:"default",model:"default",effort:"default"};return{version:1,roles:n,autoOrchestration:!0}}function C1({sidebar:n,children:r}){const[s,o]=re.useState(!1);return D.jsxs("div",{className:s?"app-shell is-sidebar-collapsed":"app-shell",children:[D.jsxs("aside",{className:"app-sidebar",children:[D.jsx("button",{className:"sidebar-toggle",type:"button","aria-label":s?"Expand sidebar":"Collapse sidebar",title:s?"Expand sidebar":"Collapse sidebar",onClick:()=>o(d=>!d)}),D.jsx("div",{className:"sidebar-content",children:n})]}),D.jsx("main",{className:"app-main",children:r})]})}const ve={getAppPreferences(){return we("/api/settings/preferences")},updateAppPreferences(n){return we("/api/settings/preferences",{method:"PUT",body:JSON.stringify(n)})},getRuntimeDiagnostics(){return we("/api/diagnostics/runtime")},getCurrentProject(){return we("/api/projects/current")},pullCurrentProject(){return we("/api/projects/current/pull",{method:"POST"})},getRecentRepositoryPaths(){return we("/api/projects/recent")},connectProject(n){return we("/api/projects/connect",{method:"POST",body:JSON.stringify(n)})},listTasks(){return we("/api/tasks")},createTask(n){return we("/api/tasks",{method:"POST",body:JSON.stringify(n)})},cleanupTask(n,r={}){return we(`/api/tasks/${encodeURIComponent(n)}/cleanup`,{method:"POST",body:JSON.stringify(r)})},getHarnessStatus(){return we("/api/projects/harness")},applyHarness(){return we("/api/projects/harness/apply",{method:"POST"})},getHarnessFileContent(n){const r=new URLSearchParams({path:n});return we(`/api/projects/harness/file?${r.toString()}`)},updateHarnessFileContent(n,r){const s=new URLSearchParams({path:n});return we(`/api/projects/harness/file?${s.toString()}`,{method:"PUT",body:JSON.stringify(r)})},commitAndRebaseHarnessTask(n,r){return we(`/api/projects/harness/tasks/${encodeURIComponent(n)}/commit-and-rebase`,{method:"POST",body:JSON.stringify(r)})},getHarnessBootstrapStatus(){return we("/api/projects/harness/bootstrap")},startHarnessBootstrap(n={}){return we("/api/projects/harness/bootstrap/start",{method:"POST",body:JSON.stringify(n)})},restartHarnessBootstrap(n={}){return we("/api/projects/harness/bootstrap/restart",{method:"POST",body:JSON.stringify(n)})},stopHarnessBootstrap(){return we("/api/projects/harness/bootstrap/stop",{method:"POST"})},runHarnessBootstrap(){return we("/api/projects/harness/bootstrap/run",{method:"POST"})},getHarnessEngineerSession(){return we("/api/projects/harness/engineer/session")},ensureHarnessEngineerSession(n={}){return we("/api/projects/harness/engineer/session/ensure",{method:"POST",body:JSON.stringify(n)})},startHarnessEngineerSession(n={}){return we("/api/projects/harness/engineer/session/start",{method:"POST",body:JSON.stringify(n)})},resumeHarnessEngineerSession(n={}){return we("/api/projects/harness/engineer/session/resume",{method:"POST",body:JSON.stringify(n)})},restartHarnessEngineerSession(n={}){return we("/api/projects/harness/engineer/session/restart",{method:"POST",body:JSON.stringify(n)})},stopHarnessEngineerSession(){return we("/api/projects/harness/engineer/session/stop",{method:"POST"})},notifyHarnessEngineerHarnessUpdated(){return we("/api/projects/harness/engineer/session/notify-harness",{method:"POST"})},getTaskStatus(n){return we(`/api/tasks/${encodeURIComponent(n)}/status`)},listSessions(n){return we(`/api/tasks/${encodeURIComponent(n)}/sessions`)},startRoleSession(n,r,s={}){return we(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/start`,{method:"POST",body:JSON.stringify(s)})},stopRoleSession(n,r){return we(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/stop`,{method:"POST"})},restartRoleSession(n,r,s={}){return we(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/restart`,{method:"POST",body:JSON.stringify(s)})},resumeRoleSession(n,r,s={}){return we(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/resume`,{method:"POST",body:JSON.stringify(s)})},notifyRoleHarnessUpdated(n,r){return we(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/notify-harness`,{method:"POST"})},dispatchRoleCommand(n,r){return we(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/dispatch`,{method:"POST"})},listMessages(n){return we(`/api/tasks/${encodeURIComponent(n)}/messages`)},markAllMessagesDone(n){return we(`/api/tasks/${encodeURIComponent(n)}/messages/mark-all-done`,{method:"POST"})},deleteMessageHistory(n){return we(`/api/tasks/${encodeURIComponent(n)}/messages/history`,{method:"DELETE"})},getOrchestrationState(n){return we(`/api/tasks/${encodeURIComponent(n)}/orchestration`)},updateOrchestrationState(n,r){return we(`/api/tasks/${encodeURIComponent(n)}/orchestration`,{method:"PUT",body:JSON.stringify(r)})},getSessionRoundState(n){return we(`/api/tasks/${encodeURIComponent(n)}/round`)},getGateReviewState(n){return we(`/api/tasks/${encodeURIComponent(n)}/gate-review`)},updateGateReviewSettings(n,r){return we(`/api/tasks/${encodeURIComponent(n)}/gate-review/settings`,{method:"PUT",body:JSON.stringify(r)})},requestGateReviewGate(n,r){return we(`/api/tasks/${encodeURIComponent(n)}/gate-review/${r}/request`,{method:"POST"})},retryGateReviewGate(n,r){return we(`/api/tasks/${encodeURIComponent(n)}/gate-review/${r}/retry`,{method:"POST"})},skipGateReviewGate(n,r,s){return we(`/api/tasks/${encodeURIComponent(n)}/gate-review/${r}/skip`,{method:"POST",body:JSON.stringify(s)})},overrideGateReviewGate(n,r,s){return we(`/api/tasks/${encodeURIComponent(n)}/gate-review/${r}/override`,{method:"POST",body:JSON.stringify(s)})},getGateReviewReport(n,r){return we(`/api/tasks/${encodeURIComponent(n)}/gate-review/${r}/report`)},startTranslationSession(n,r){return we(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/translation/start`,{method:"POST"})},pollTranslationSession(n,r,s){const o=new URLSearchParams({after:String(r)});return s!==void 0&&o.set("limit",String(s)),we(`/api/translation/sessions/${encodeURIComponent(n)}/events?${o.toString()}`)},translateUserInput(n,r,s){return we(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/translation/input`,{method:"POST",body:JSON.stringify(s)})},sendTranslatedInput(n,r,s){return we(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/translation/send`,{method:"POST",body:JSON.stringify(s)})},clearTranslationSession(n){return we(`/api/translation/sessions/${encodeURIComponent(n)}/clear`,{method:"POST"})},stopTranslationSession(n){return we(`/api/translation/sessions/${encodeURIComponent(n)}/stop`,{method:"POST"})},notifyTranslatorHarnessUpdated(){return we("/api/projects/translation/session/notify-harness",{method:"POST"})},retryTranslation(n,r){return we(`/api/translation/sessions/${encodeURIComponent(n)}/retry/${encodeURIComponent(r)}`,{method:"POST"})},ignoreTranslationFailures(n){return we(`/api/translation/sessions/${encodeURIComponent(n)}/failures/ignore`,{method:"POST"})},retryTranslationFailures(n){return we(`/api/translation/sessions/${encodeURIComponent(n)}/failures/retry`,{method:"POST"})},getTranslationState(){return we("/api/translation/state")},getTranslatorSession(){return we("/api/translation/session")},ensureTranslatorSession(n={}){return we("/api/translation/session/ensure",{method:"POST",body:JSON.stringify(n)})},startTranslatorSession(n={}){return we("/api/translation/session/start",{method:"POST",body:JSON.stringify(n)})},resumeTranslatorSession(n={}){return we("/api/translation/session/resume",{method:"POST",body:JSON.stringify(n)})},restartTranslatorSession(n={}){return we("/api/translation/session/restart",{method:"POST",body:JSON.stringify(n)})},stopTranslatorSession(){return we("/api/translation/session/stop",{method:"POST"})},browseTranslationSourceFiles(n={}){const r=new URLSearchParams;n.path&&r.set("path",n.path),n.query&&r.set("query",n.query),n.limit!==void 0&&r.set("limit",String(n.limit));const s=r.toString()?`?${r.toString()}`:"";return we(`/api/translation/source-files${s}`)},createFileTranslation(n){return we("/api/translation/files",{method:"POST",body:JSON.stringify(n)})},readFileTranslation(n){return we(`/api/translation/files/${encodeURIComponent(n)}`)},createTranslationBootstrap(n){return we("/api/translation/bootstrap",{method:"POST",body:JSON.stringify(n)})},createTranslationMemoryUpdate(n){return we("/api/translation/memory-update",{method:"POST",body:JSON.stringify(n)})},promoteTranslation(n,r){return we(`/api/translation/files/${encodeURIComponent(n)}/promote`,{method:"POST",body:JSON.stringify({targetPath:r})})},getGatewayStatus(){return we("/api/gateway/status")},updateGatewaySettings(n){return we("/api/gateway/settings",{method:"PUT",body:JSON.stringify(n)})},startGatewayQrLogin(){return we("/api/gateway/qr/start",{method:"POST"})},checkGatewayQrLogin(n={}){return we("/api/gateway/qr/check",{method:"POST",body:JSON.stringify(n)})},resetGatewayBinding(){return we("/api/gateway/binding/reset",{method:"POST"})}};async function we(n,r={}){var d,_,f;const s=new Headers(r.headers);r.body!==void 0&&r.body!==null&&!s.has("content-type")&&s.set("content-type","application/json");const o=await fetch(n,{...r,headers:s});if(!o.ok){const a=await o.json().catch(()=>null),c=(d=a==null?void 0:a.error)!=null&&d.hint?`${a.error.message} ${a.error.hint}`:((_=a==null?void 0:a.error)==null?void 0:_.message)??`Request failed: ${o.status}`,h=(f=a==null?void 0:a.error)==null?void 0:f.runtime,m=h?` [backend ${h.version??"unknown"} pid=${h.pid??"unknown"} cwd=${h.cwd??"unknown"}]`:"";throw new Error(`${c}${m}`)}return o.json()}var vu={exports:{}},_m;function w1(){return _m||(_m=1,(function(n,r){(function(s,o){n.exports=o()})(self,(()=>(()=>{var s={};return(()=>{var o=s;Object.defineProperty(o,"__esModule",{value:!0}),o.FitAddon=void 0,o.FitAddon=class{activate(d){this._terminal=d}dispose(){}fit(){const d=this.proposeDimensions();if(!d||!this._terminal||isNaN(d.cols)||isNaN(d.rows))return;const _=this._terminal._core;this._terminal.rows===d.rows&&this._terminal.cols===d.cols||(_._renderService.clear(),this._terminal.resize(d.cols,d.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const d=this._terminal._core,_=d._renderService.dimensions;if(_.css.cell.width===0||_.css.cell.height===0)return;const f=this._terminal.options.scrollback===0?0:d.viewport.scrollBarWidth,a=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(a.getPropertyValue("height")),h=Math.max(0,parseInt(a.getPropertyValue("width"))),m=window.getComputedStyle(this._terminal.element),u=c-(parseInt(m.getPropertyValue("padding-top"))+parseInt(m.getPropertyValue("padding-bottom"))),y=h-(parseInt(m.getPropertyValue("padding-right"))+parseInt(m.getPropertyValue("padding-left")))-f;return{cols:Math.max(2,Math.floor(y/_.css.cell.width)),rows:Math.max(1,Math.floor(u/_.css.cell.height))}}}})(),s})()))})(vu)),vu.exports}var x1=w1(),yu={exports:{}},vm;function E1(){return vm||(vm=1,(function(n,r){(function(s,o){n.exports=o()})(self,(()=>(()=>{var s={6:(f,a)=>{function c(m){try{const u=new URL(m),y=u.password&&u.username?`${u.protocol}//${u.username}:${u.password}@${u.host}`:u.username?`${u.protocol}//${u.username}@${u.host}`:`${u.protocol}//${u.host}`;return m.toLocaleLowerCase().startsWith(y.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(a,"__esModule",{value:!0}),a.LinkComputer=a.WebLinkProvider=void 0,a.WebLinkProvider=class{constructor(m,u,y,w={}){this._terminal=m,this._regex=u,this._handler=y,this._options=w}provideLinks(m,u){const y=h.computeLink(m,this._regex,this._terminal,this._handler);u(this._addCallbacks(y))}_addCallbacks(m){return m.map((u=>(u.leave=this._options.leave,u.hover=(y,w)=>{if(this._options.hover){const{range:k}=u;this._options.hover(y,w,k)}},u)))}};class h{static computeLink(u,y,w,k){const x=new RegExp(y.source,(y.flags||"")+"g"),[b,S]=h._getWindowedLineStrings(u-1,w),g=b.join("");let v;const E=[];for(;v=x.exec(g);){const L=v[0];if(!c(L))continue;const[R,T]=h._mapStrIdx(w,S,0,v.index),[A,M]=h._mapStrIdx(w,R,T,L.length);if(R===-1||T===-1||A===-1||M===-1)continue;const j={start:{x:T+1,y:R+1},end:{x:M,y:A+1}};E.push({range:j,text:L,activate:k})}return E}static _getWindowedLineStrings(u,y){let w,k=u,x=u,b=0,S="";const g=[];if(w=y.buffer.active.getLine(u)){const v=w.translateToString(!0);if(w.isWrapped&&v[0]!==" "){for(b=0;(w=y.buffer.active.getLine(--k))&&b<2048&&(S=w.translateToString(!0),b+=S.length,g.push(S),w.isWrapped&&S.indexOf(" ")===-1););g.reverse()}for(g.push(v),b=0;(w=y.buffer.active.getLine(++x))&&w.isWrapped&&b<2048&&(S=w.translateToString(!0),b+=S.length,g.push(S),S.indexOf(" ")===-1););}return[g,k]}static _mapStrIdx(u,y,w,k){const x=u.buffer.active,b=x.getNullCell();let S=w;for(;k;){const g=x.getLine(y);if(!g)return[-1,-1];for(let v=S;v<g.length;++v){g.getCell(v,b);const E=b.getChars();if(b.getWidth()&&(k-=E.length||1,v===g.length-1&&E==="")){const L=x.getLine(y+1);L&&L.isWrapped&&(L.getCell(0,b),b.getWidth()===2&&(k+=1))}if(k<0)return[y,v]}y++,S=0}return[y,S]}}a.LinkComputer=h}},o={};function d(f){var a=o[f];if(a!==void 0)return a.exports;var c=o[f]={exports:{}};return s[f](c,c.exports,d),c.exports}var _={};return(()=>{var f=_;Object.defineProperty(f,"__esModule",{value:!0}),f.WebLinksAddon=void 0;const a=d(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function h(m,u){const y=window.open();if(y){try{y.opener=null}catch{}y.location.href=u}else console.warn("Opening link blocked as opener could not be cleared")}f.WebLinksAddon=class{constructor(m=h,u={}){this._handler=m,this._options=u}activate(m){this._terminal=m;const u=this._options,y=u.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new a.WebLinkProvider(this._terminal,y,this._handler,u))}dispose(){var m;(m=this._linkProvider)==null||m.dispose()}}})(),_})()))})(yu)),yu.exports}var k1=E1(),Su={exports:{}},ym;function A1(){return ym||(ym=1,(function(n,r){(function(s,o){n.exports=o()})(globalThis,(()=>(()=>{var s={4567:function(f,a,c){var h=this&&this.__decorate||function(g,v,E,L){var R,T=arguments.length,A=T<3?v:L===null?L=Object.getOwnPropertyDescriptor(v,E):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(g,v,E,L);else for(var M=g.length-1;M>=0;M--)(R=g[M])&&(A=(T<3?R(A):T>3?R(v,E,A):R(v,E))||A);return T>3&&A&&Object.defineProperty(v,E,A),A},m=this&&this.__param||function(g,v){return function(E,L){v(E,L,g)}};Object.defineProperty(a,"__esModule",{value:!0}),a.AccessibilityManager=void 0;const u=c(9042),y=c(9924),w=c(844),k=c(4725),x=c(2585),b=c(3656);let S=a.AccessibilityManager=class extends w.Disposable{constructor(g,v,E,L){super(),this._terminal=g,this._coreBrowserService=E,this._renderService=L,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let R=0;R<this._terminal.rows;R++)this._rowElements[R]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[R]);if(this._topBoundaryFocusListener=R=>this._handleBoundaryFocus(R,0),this._bottomBoundaryFocusListener=R=>this._handleBoundaryFocus(R,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new y.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((R=>this._handleResize(R.rows)))),this.register(this._terminal.onRender((R=>this._refreshRows(R.start,R.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((R=>this._handleChar(R)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
52
+ `)))),this.register(this._terminal.onA11yTab((R=>this._handleTab(R)))),this.register(this._terminal.onKey((R=>this._handleKey(R.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,b.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,w.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(g){for(let v=0;v<g;v++)this._handleChar(" ")}_handleChar(g){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==g&&(this._charsToAnnounce+=g):this._charsToAnnounce+=g,g===`
53
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=u.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(g){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(g)||this._charsToConsume.push(g)}_refreshRows(g,v){this._liveRegionDebouncer.refresh(g,v,this._terminal.rows)}_renderRows(g,v){const E=this._terminal.buffer,L=E.lines.length.toString();for(let R=g;R<=v;R++){const T=E.lines.get(E.ydisp+R),A=[],M=(T==null?void 0:T.translateToString(!0,void 0,void 0,A))||"",j=(E.ydisp+R+1).toString(),I=this._rowElements[R];I&&(M.length===0?(I.innerText=" ",this._rowColumns.set(I,[0,1])):(I.textContent=M,this._rowColumns.set(I,A)),I.setAttribute("aria-posinset",j),I.setAttribute("aria-setsize",L))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(g,v){const E=g.target,L=this._rowElements[v===0?1:this._rowElements.length-2];if(E.getAttribute("aria-posinset")===(v===0?"1":`${this._terminal.buffer.lines.length}`)||g.relatedTarget!==L)return;let R,T;if(v===0?(R=E,T=this._rowElements.pop(),this._rowContainer.removeChild(T)):(R=this._rowElements.shift(),T=E,this._rowContainer.removeChild(R)),R.removeEventListener("focus",this._topBoundaryFocusListener),T.removeEventListener("focus",this._bottomBoundaryFocusListener),v===0){const A=this._createAccessibilityTreeNode();this._rowElements.unshift(A),this._rowContainer.insertAdjacentElement("afterbegin",A)}else{const A=this._createAccessibilityTreeNode();this._rowElements.push(A),this._rowContainer.appendChild(A)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(v===0?-1:1),this._rowElements[v===0?1:this._rowElements.length-2].focus(),g.preventDefault(),g.stopImmediatePropagation()}_handleSelectionChange(){var M;if(this._rowElements.length===0)return;const g=document.getSelection();if(!g)return;if(g.isCollapsed)return void(this._rowContainer.contains(g.anchorNode)&&this._terminal.clearSelection());if(!g.anchorNode||!g.focusNode)return void console.error("anchorNode and/or focusNode are null");let v={node:g.anchorNode,offset:g.anchorOffset},E={node:g.focusNode,offset:g.focusOffset};if((v.node.compareDocumentPosition(E.node)&Node.DOCUMENT_POSITION_PRECEDING||v.node===E.node&&v.offset>E.offset)&&([v,E]=[E,v]),v.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(v={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(v.node))return;const L=this._rowElements.slice(-1)[0];if(E.node.compareDocumentPosition(L)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(E={node:L,offset:((M=L.textContent)==null?void 0:M.length)??0}),!this._rowContainer.contains(E.node))return;const R=({node:j,offset:I})=>{const U=j instanceof Text?j.parentNode:j;let F=parseInt(U==null?void 0:U.getAttribute("aria-posinset"),10)-1;if(isNaN(F))return console.warn("row is invalid. Race condition?"),null;const K=this._rowColumns.get(U);if(!K)return console.warn("columns is null. Race condition?"),null;let W=I<K.length?K[I]:K.slice(-1)[0]+1;return W>=this._terminal.cols&&(++F,W=0),{row:F,column:W}},T=R(v),A=R(E);if(T&&A){if(T.row>A.row||T.row===A.row&&T.column>=A.column)throw new Error("invalid range");this._terminal.select(T.column,T.row,(A.row-T.row)*this._terminal.cols-T.column+A.column)}}_handleResize(g){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let v=this._rowContainer.children.length;v<this._terminal.rows;v++)this._rowElements[v]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[v]);for(;this._rowElements.length>g;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const g=this._coreBrowserService.mainDocument.createElement("div");return g.setAttribute("role","listitem"),g.tabIndex=-1,this._refreshRowDimensions(g),g}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let g=0;g<this._terminal.rows;g++)this._refreshRowDimensions(this._rowElements[g])}}_refreshRowDimensions(g){g.style.height=`${this._renderService.dimensions.css.cell.height}px`}};a.AccessibilityManager=S=h([m(1,x.IInstantiationService),m(2,k.ICoreBrowserService),m(3,k.IRenderService)],S)},3614:(f,a)=>{function c(y){return y.replace(/\r?\n/g,"\r")}function h(y,w){return w?"\x1B[200~"+y+"\x1B[201~":y}function m(y,w,k,x){y=h(y=c(y),k.decPrivateModes.bracketedPasteMode&&x.rawOptions.ignoreBracketedPasteMode!==!0),k.triggerDataEvent(y,!0),w.value=""}function u(y,w,k){const x=k.getBoundingClientRect(),b=y.clientX-x.left-10,S=y.clientY-x.top-10;w.style.width="20px",w.style.height="20px",w.style.left=`${b}px`,w.style.top=`${S}px`,w.style.zIndex="1000",w.focus()}Object.defineProperty(a,"__esModule",{value:!0}),a.rightClickHandler=a.moveTextAreaUnderMouseCursor=a.paste=a.handlePasteEvent=a.copyHandler=a.bracketTextForPaste=a.prepareTextForTerminal=void 0,a.prepareTextForTerminal=c,a.bracketTextForPaste=h,a.copyHandler=function(y,w){y.clipboardData&&y.clipboardData.setData("text/plain",w.selectionText),y.preventDefault()},a.handlePasteEvent=function(y,w,k,x){y.stopPropagation(),y.clipboardData&&m(y.clipboardData.getData("text/plain"),w,k,x)},a.paste=m,a.moveTextAreaUnderMouseCursor=u,a.rightClickHandler=function(y,w,k,x,b){u(y,w,k),b&&x.rightClickSelect(y),w.value=x.selectionText,w.select()}},7239:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorContrastCache=void 0;const h=c(1505);a.ColorContrastCache=class{constructor(){this._color=new h.TwoKeyMap,this._css=new h.TwoKeyMap}setCss(m,u,y){this._css.set(m,u,y)}getCss(m,u){return this._css.get(m,u)}setColor(m,u,y){this._color.set(m,u,y)}getColor(m,u){return this._color.get(m,u)}clear(){this._color.clear(),this._css.clear()}}},3656:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.addDisposableDomListener=void 0,a.addDisposableDomListener=function(c,h,m,u){c.addEventListener(h,m,u);let y=!1;return{dispose:()=>{y||(y=!0,c.removeEventListener(h,m,u))}}}},3551:function(f,a,c){var h=this&&this.__decorate||function(S,g,v,E){var L,R=arguments.length,T=R<3?g:E===null?E=Object.getOwnPropertyDescriptor(g,v):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(S,g,v,E);else for(var A=S.length-1;A>=0;A--)(L=S[A])&&(T=(R<3?L(T):R>3?L(g,v,T):L(g,v))||T);return R>3&&T&&Object.defineProperty(g,v,T),T},m=this&&this.__param||function(S,g){return function(v,E){g(v,E,S)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Linkifier=void 0;const u=c(3656),y=c(8460),w=c(844),k=c(2585),x=c(4725);let b=a.Linkifier=class extends w.Disposable{get currentLink(){return this._currentLink}constructor(S,g,v,E,L){super(),this._element=S,this._mouseService=g,this._renderService=v,this._bufferService=E,this._linkProviderService=L,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new y.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new y.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,w.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,w.toDisposable)((()=>{var R;this._lastMouseEvent=void 0,(R=this._activeProviderReplies)==null||R.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,u.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,u.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(S){this._lastMouseEvent=S;const g=this._positionFromMouseEvent(S,this._element,this._mouseService);if(!g)return;this._isMouseOut=!1;const v=S.composedPath();for(let E=0;E<v.length;E++){const L=v[E];if(L.classList.contains("xterm"))break;if(L.classList.contains("xterm-hover"))return}this._lastBufferCell&&g.x===this._lastBufferCell.x&&g.y===this._lastBufferCell.y||(this._handleHover(g),this._lastBufferCell=g)}_handleHover(S){if(this._activeLine!==S.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(S,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,S)||(this._clearCurrentLink(),this._askForLink(S,!0))}_askForLink(S,g){var E,L;this._activeProviderReplies&&g||((E=this._activeProviderReplies)==null||E.forEach((R=>{R==null||R.forEach((T=>{T.link.dispose&&T.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=S.y);let v=!1;for(const[R,T]of this._linkProviderService.linkProviders.entries())g?(L=this._activeProviderReplies)!=null&&L.get(R)&&(v=this._checkLinkProviderResult(R,S,v)):T.provideLinks(S.y,(A=>{var j,I;if(this._isMouseOut)return;const M=A==null?void 0:A.map((U=>({link:U})));(j=this._activeProviderReplies)==null||j.set(R,M),v=this._checkLinkProviderResult(R,S,v),((I=this._activeProviderReplies)==null?void 0:I.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(S.y,this._activeProviderReplies)}))}_removeIntersectingLinks(S,g){const v=new Set;for(let E=0;E<g.size;E++){const L=g.get(E);if(L)for(let R=0;R<L.length;R++){const T=L[R],A=T.link.range.start.y<S?0:T.link.range.start.x,M=T.link.range.end.y>S?this._bufferService.cols:T.link.range.end.x;for(let j=A;j<=M;j++){if(v.has(j)){L.splice(R--,1);break}v.add(j)}}}}_checkLinkProviderResult(S,g,v){var R;if(!this._activeProviderReplies)return v;const E=this._activeProviderReplies.get(S);let L=!1;for(let T=0;T<S;T++)this._activeProviderReplies.has(T)&&!this._activeProviderReplies.get(T)||(L=!0);if(!L&&E){const T=E.find((A=>this._linkAtPosition(A.link,g)));T&&(v=!0,this._handleNewLink(T))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!v)for(let T=0;T<this._activeProviderReplies.size;T++){const A=(R=this._activeProviderReplies.get(T))==null?void 0:R.find((M=>this._linkAtPosition(M.link,g)));if(A){v=!0,this._handleNewLink(A);break}}return v}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(S){if(!this._currentLink)return;const g=this._positionFromMouseEvent(S,this._element,this._mouseService);g&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,g)&&this._currentLink.link.activate(S,this._currentLink.link.text)}_clearCurrentLink(S,g){this._currentLink&&this._lastMouseEvent&&(!S||!g||this._currentLink.link.range.start.y>=S&&this._currentLink.link.range.end.y<=g)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,w.disposeArray)(this._linkCacheDisposables))}_handleNewLink(S){if(!this._lastMouseEvent)return;const g=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);g&&this._linkAtPosition(S.link,g)&&(this._currentLink=S,this._currentLink.state={decorations:{underline:S.link.decorations===void 0||S.link.decorations.underline,pointerCursor:S.link.decorations===void 0||S.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,S.link,this._lastMouseEvent),S.link.decorations={},Object.defineProperties(S.link.decorations,{pointerCursor:{get:()=>{var v,E;return(E=(v=this._currentLink)==null?void 0:v.state)==null?void 0:E.decorations.pointerCursor},set:v=>{var E;(E=this._currentLink)!=null&&E.state&&this._currentLink.state.decorations.pointerCursor!==v&&(this._currentLink.state.decorations.pointerCursor=v,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",v))}},underline:{get:()=>{var v,E;return(E=(v=this._currentLink)==null?void 0:v.state)==null?void 0:E.decorations.underline},set:v=>{var E,L,R;(E=this._currentLink)!=null&&E.state&&((R=(L=this._currentLink)==null?void 0:L.state)==null?void 0:R.decorations.underline)!==v&&(this._currentLink.state.decorations.underline=v,this._currentLink.state.isHovered&&this._fireUnderlineEvent(S.link,v))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((v=>{if(!this._currentLink)return;const E=v.start===0?0:v.start+1+this._bufferService.buffer.ydisp,L=this._bufferService.buffer.ydisp+1+v.end;if(this._currentLink.link.range.start.y>=E&&this._currentLink.link.range.end.y<=L&&(this._clearCurrentLink(E,L),this._lastMouseEvent)){const R=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);R&&this._askForLink(R,!1)}}))))}_linkHover(S,g,v){var E;(E=this._currentLink)!=null&&E.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(g,!0),this._currentLink.state.decorations.pointerCursor&&S.classList.add("xterm-cursor-pointer")),g.hover&&g.hover(v,g.text)}_fireUnderlineEvent(S,g){const v=S.range,E=this._bufferService.buffer.ydisp,L=this._createLinkUnderlineEvent(v.start.x-1,v.start.y-E-1,v.end.x,v.end.y-E-1,void 0);(g?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(L)}_linkLeave(S,g,v){var E;(E=this._currentLink)!=null&&E.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(g,!1),this._currentLink.state.decorations.pointerCursor&&S.classList.remove("xterm-cursor-pointer")),g.leave&&g.leave(v,g.text)}_linkAtPosition(S,g){const v=S.range.start.y*this._bufferService.cols+S.range.start.x,E=S.range.end.y*this._bufferService.cols+S.range.end.x,L=g.y*this._bufferService.cols+g.x;return v<=L&&L<=E}_positionFromMouseEvent(S,g,v){const E=v.getCoords(S,g,this._bufferService.cols,this._bufferService.rows);if(E)return{x:E[0],y:E[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(S,g,v,E,L){return{x1:S,y1:g,x2:v,y2:E,cols:this._bufferService.cols,fg:L}}};a.Linkifier=b=h([m(1,x.IMouseService),m(2,x.IRenderService),m(3,k.IBufferService),m(4,x.ILinkProviderService)],b)},9042:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.tooMuchOutput=a.promptLabel=void 0,a.promptLabel="Terminal input",a.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(f,a,c){var h=this&&this.__decorate||function(x,b,S,g){var v,E=arguments.length,L=E<3?b:g===null?g=Object.getOwnPropertyDescriptor(b,S):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(x,b,S,g);else for(var R=x.length-1;R>=0;R--)(v=x[R])&&(L=(E<3?v(L):E>3?v(b,S,L):v(b,S))||L);return E>3&&L&&Object.defineProperty(b,S,L),L},m=this&&this.__param||function(x,b){return function(S,g){b(S,g,x)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkProvider=void 0;const u=c(511),y=c(2585);let w=a.OscLinkProvider=class{constructor(x,b,S){this._bufferService=x,this._optionsService=b,this._oscLinkService=S}provideLinks(x,b){var M;const S=this._bufferService.buffer.lines.get(x-1);if(!S)return void b(void 0);const g=[],v=this._optionsService.rawOptions.linkHandler,E=new u.CellData,L=S.getTrimmedLength();let R=-1,T=-1,A=!1;for(let j=0;j<L;j++)if(T!==-1||S.hasContent(j)){if(S.loadCell(j,E),E.hasExtendedAttrs()&&E.extended.urlId){if(T===-1){T=j,R=E.extended.urlId;continue}A=E.extended.urlId!==R}else T!==-1&&(A=!0);if(A||T!==-1&&j===L-1){const I=(M=this._oscLinkService.getLinkData(R))==null?void 0:M.uri;if(I){const U={start:{x:T+1,y:x},end:{x:j+(A||j!==L-1?0:1),y:x}};let F=!1;if(!(v!=null&&v.allowNonHttpProtocols))try{const K=new URL(I);["http:","https:"].includes(K.protocol)||(F=!0)}catch{F=!0}F||g.push({text:I,range:U,activate:(K,W)=>v?v.activate(K,W,U):k(0,W),hover:(K,W)=>{var V;return(V=v==null?void 0:v.hover)==null?void 0:V.call(v,K,W,U)},leave:(K,W)=>{var V;return(V=v==null?void 0:v.leave)==null?void 0:V.call(v,K,W,U)}})}A=!1,E.hasExtendedAttrs()&&E.extended.urlId?(T=j,R=E.extended.urlId):(T=-1,R=-1)}}b(g)}};function k(x,b){if(confirm(`Do you want to navigate to ${b}?
54
+
55
+ WARNING: This link could potentially be dangerous`)){const S=window.open();if(S){try{S.opener=null}catch{}S.location.href=b}else console.warn("Opening link blocked as opener could not be cleared")}}a.OscLinkProvider=w=h([m(0,y.IBufferService),m(1,y.IOptionsService),m(2,y.IOscLinkService)],w)},6193:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.RenderDebouncer=void 0,a.RenderDebouncer=class{constructor(c,h){this._renderCallback=c,this._coreBrowserService=h,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(c){return this._refreshCallbacks.push(c),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(c,h,m){this._rowCount=m,c=c!==void 0?c:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const c=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,h),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},3236:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Terminal=void 0;const h=c(3614),m=c(3656),u=c(3551),y=c(9042),w=c(3730),k=c(1680),x=c(3107),b=c(5744),S=c(2950),g=c(1296),v=c(428),E=c(4269),L=c(5114),R=c(8934),T=c(3230),A=c(9312),M=c(4725),j=c(6731),I=c(8055),U=c(8969),F=c(8460),K=c(844),W=c(6114),V=c(8437),$=c(2584),ee=c(7399),N=c(5941),B=c(9074),z=c(2585),G=c(5435),H=c(4567),te=c(779);class he extends U.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(Y={}){super(Y),this.browser=W,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new K.MutableDisposable),this._onCursorMove=this.register(new F.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new F.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new F.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new F.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new F.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new F.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new F.EventEmitter),this._onBlur=this.register(new F.EventEmitter),this._onA11yCharEmitter=this.register(new F.EventEmitter),this._onA11yTabEmitter=this.register(new F.EventEmitter),this._onWillOpen=this.register(new F.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(B.DecorationService),this._instantiationService.setService(z.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(te.LinkProviderService),this._instantiationService.setService(M.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(w.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((q,oe)=>this.refresh(q,oe)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((q=>this._reportWindowsOptions(q)))),this.register(this._inputHandler.onColor((q=>this._handleColorEvent(q)))),this.register((0,F.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,F.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,F.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,F.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((q=>this._afterResize(q.cols,q.rows)))),this.register((0,K.toDisposable)((()=>{var q,oe;this._customKeyEventHandler=void 0,(oe=(q=this.element)==null?void 0:q.parentNode)==null||oe.removeChild(this.element)})))}_handleColorEvent(Y){if(this._themeService)for(const q of Y){let oe,J="";switch(q.index){case 256:oe="foreground",J="10";break;case 257:oe="background",J="11";break;case 258:oe="cursor",J="12";break;default:oe="ansi",J="4;"+q.index}switch(q.type){case 0:const ie=I.color.toColorRGB(oe==="ansi"?this._themeService.colors.ansi[q.index]:this._themeService.colors[oe]);this.coreService.triggerDataEvent(`${$.C0.ESC}]${J};${(0,N.toRgbString)(ie)}${$.C1_ESCAPED.ST}`);break;case 1:if(oe==="ansi")this._themeService.modifyColors((de=>de.ansi[q.index]=I.channels.toColor(...q.color)));else{const de=oe;this._themeService.modifyColors((Ce=>Ce[de]=I.channels.toColor(...q.color)))}break;case 2:this._themeService.restoreColor(q.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(Y){Y?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(H.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(Y){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent($.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var Y;return(Y=this.textarea)==null?void 0:Y.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent($.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const Y=this.buffer.ybase+this.buffer.y,q=this.buffer.lines.get(Y);if(!q)return;const oe=Math.min(this.buffer.x,this.cols-1),J=this._renderService.dimensions.css.cell.height,ie=q.getWidth(oe),de=this._renderService.dimensions.css.cell.width*ie,Ce=this.buffer.y*this._renderService.dimensions.css.cell.height,xe=oe*this._renderService.dimensions.css.cell.width;this.textarea.style.left=xe+"px",this.textarea.style.top=Ce+"px",this.textarea.style.width=de+"px",this.textarea.style.height=J+"px",this.textarea.style.lineHeight=J+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,m.addDisposableDomListener)(this.element,"copy",(q=>{this.hasSelection()&&(0,h.copyHandler)(q,this._selectionService)})));const Y=q=>(0,h.handlePasteEvent)(q,this.textarea,this.coreService,this.optionsService);this.register((0,m.addDisposableDomListener)(this.textarea,"paste",Y)),this.register((0,m.addDisposableDomListener)(this.element,"paste",Y)),W.isFirefox?this.register((0,m.addDisposableDomListener)(this.element,"mousedown",(q=>{q.button===2&&(0,h.rightClickHandler)(q,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,m.addDisposableDomListener)(this.element,"contextmenu",(q=>{(0,h.rightClickHandler)(q,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),W.isLinux&&this.register((0,m.addDisposableDomListener)(this.element,"auxclick",(q=>{q.button===1&&(0,h.moveTextAreaUnderMouseCursor)(q,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,m.addDisposableDomListener)(this.textarea,"keyup",(Y=>this._keyUp(Y)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keydown",(Y=>this._keyDown(Y)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"keypress",(Y=>this._keyPress(Y)),!0)),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionupdate",(Y=>this._compositionHelper.compositionupdate(Y)))),this.register((0,m.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,m.addDisposableDomListener)(this.textarea,"input",(Y=>this._inputEvent(Y)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(Y){var oe;if(!Y)throw new Error("Terminal requires a parent element.");if(Y.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((oe=this.element)==null?void 0:oe.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=Y.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),Y.appendChild(this.element);const q=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),q.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,m.addDisposableDomListener)(this.screenElement,"mousemove",(J=>this.updateCursorStyle(J)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),q.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",y.promptLabel),W.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(L.CoreBrowserService,this.textarea,Y.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(M.ICoreBrowserService,this._coreBrowserService),this.register((0,m.addDisposableDomListener)(this.textarea,"focus",(J=>this._handleTextAreaFocus(J)))),this.register((0,m.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(v.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(M.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(j.ThemeService),this._instantiationService.setService(M.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(E.CharacterJoinerService),this._instantiationService.setService(M.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(T.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(M.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((J=>this._onRender.fire(J)))),this.onResize((J=>this._renderService.resize(J.cols,J.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(S.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(R.MouseService),this._instantiationService.setService(M.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(u.Linkifier,this.screenElement)),this.element.appendChild(q);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(k.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((J=>this.scrollLines(J.amount,J.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(A.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(M.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((J=>this.scrollLines(J.amount,J.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((J=>this._renderService.handleSelectionChanged(J.start,J.end,J.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((J=>{this.textarea.value=J,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((J=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,m.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(x.BufferDecorationRenderer,this.screenElement)),this.register((0,m.addDisposableDomListener)(this.element,"mousedown",(J=>this._selectionService.handleMouseDown(J)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(H.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(J=>this._handleScreenReaderModeOptionChange(J)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(b.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(J=>{!this._overviewRulerRenderer&&J&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(b.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(g.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const Y=this,q=this.element;function oe(de){const Ce=Y._mouseService.getMouseReportCoords(de,Y.screenElement);if(!Ce)return!1;let xe,Ke;switch(de.overrideType||de.type){case"mousemove":Ke=32,de.buttons===void 0?(xe=3,de.button!==void 0&&(xe=de.button<3?de.button:3)):xe=1&de.buttons?0:4&de.buttons?1:2&de.buttons?2:3;break;case"mouseup":Ke=0,xe=de.button<3?de.button:3;break;case"mousedown":Ke=1,xe=de.button<3?de.button:3;break;case"wheel":if(Y._customWheelEventHandler&&Y._customWheelEventHandler(de)===!1||Y.viewport.getLinesScrolled(de)===0)return!1;Ke=de.deltaY<0?0:1,xe=4;break;default:return!1}return!(Ke===void 0||xe===void 0||xe>4)&&Y.coreMouseService.triggerMouseEvent({col:Ce.col,row:Ce.row,x:Ce.x,y:Ce.y,button:xe,action:Ke,ctrl:de.ctrlKey,alt:de.altKey,shift:de.shiftKey})}const J={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ie={mouseup:de=>(oe(de),de.buttons||(this._document.removeEventListener("mouseup",J.mouseup),J.mousedrag&&this._document.removeEventListener("mousemove",J.mousedrag)),this.cancel(de)),wheel:de=>(oe(de),this.cancel(de,!0)),mousedrag:de=>{de.buttons&&oe(de)},mousemove:de=>{de.buttons||oe(de)}};this.register(this.coreMouseService.onProtocolChange((de=>{de?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(de)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&de?J.mousemove||(q.addEventListener("mousemove",ie.mousemove),J.mousemove=ie.mousemove):(q.removeEventListener("mousemove",J.mousemove),J.mousemove=null),16&de?J.wheel||(q.addEventListener("wheel",ie.wheel,{passive:!1}),J.wheel=ie.wheel):(q.removeEventListener("wheel",J.wheel),J.wheel=null),2&de?J.mouseup||(J.mouseup=ie.mouseup):(this._document.removeEventListener("mouseup",J.mouseup),J.mouseup=null),4&de?J.mousedrag||(J.mousedrag=ie.mousedrag):(this._document.removeEventListener("mousemove",J.mousedrag),J.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,m.addDisposableDomListener)(q,"mousedown",(de=>{if(de.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(de))return oe(de),J.mouseup&&this._document.addEventListener("mouseup",J.mouseup),J.mousedrag&&this._document.addEventListener("mousemove",J.mousedrag),this.cancel(de)}))),this.register((0,m.addDisposableDomListener)(q,"wheel",(de=>{if(!J.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(de)===!1)return!1;if(!this.buffer.hasScrollback){const Ce=this.viewport.getLinesScrolled(de);if(Ce===0)return;const xe=$.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(de.deltaY<0?"A":"B");let Ke="";for(let it=0;it<Math.abs(Ce);it++)Ke+=xe;return this.coreService.triggerDataEvent(Ke,!0),this.cancel(de,!0)}return this.viewport.handleWheel(de)?this.cancel(de):void 0}}),{passive:!1})),this.register((0,m.addDisposableDomListener)(q,"touchstart",(de=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(de),this.cancel(de)}),{passive:!0})),this.register((0,m.addDisposableDomListener)(q,"touchmove",(de=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(de)?void 0:this.cancel(de)}),{passive:!1}))}refresh(Y,q){var oe;(oe=this._renderService)==null||oe.refreshRows(Y,q)}updateCursorStyle(Y){var q;(q=this._selectionService)!=null&&q.shouldColumnSelect(Y)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(Y,q,oe=0){var J;oe===1?(super.scrollLines(Y,q,oe),this.refresh(0,this.rows-1)):(J=this.viewport)==null||J.scrollLines(Y)}paste(Y){(0,h.paste)(Y,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(Y){this._customKeyEventHandler=Y}attachCustomWheelEventHandler(Y){this._customWheelEventHandler=Y}registerLinkProvider(Y){return this._linkProviderService.registerLinkProvider(Y)}registerCharacterJoiner(Y){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const q=this._characterJoinerService.register(Y);return this.refresh(0,this.rows-1),q}deregisterCharacterJoiner(Y){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(Y)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(Y){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+Y)}registerDecoration(Y){return this._decorationService.registerDecoration(Y)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(Y,q,oe){this._selectionService.setSelection(Y,q,oe)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var Y;(Y=this._selectionService)==null||Y.clearSelection()}selectAll(){var Y;(Y=this._selectionService)==null||Y.selectAll()}selectLines(Y,q){var oe;(oe=this._selectionService)==null||oe.selectLines(Y,q)}_keyDown(Y){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(Y)===!1)return!1;const q=this.browser.isMac&&this.options.macOptionIsMeta&&Y.altKey;if(!q&&!this._compositionHelper.keydown(Y))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;q||Y.key!=="Dead"&&Y.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const oe=(0,ee.evaluateKeyboardEvent)(Y,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(Y),oe.type===3||oe.type===2){const J=this.rows-1;return this.scrollLines(oe.type===2?-J:J),this.cancel(Y,!0)}return oe.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,Y)||(oe.cancel&&this.cancel(Y,!0),!oe.key||!!(Y.key&&!Y.ctrlKey&&!Y.altKey&&!Y.metaKey&&Y.key.length===1&&Y.key.charCodeAt(0)>=65&&Y.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(oe.key!==$.C0.ETX&&oe.key!==$.C0.CR||(this.textarea.value=""),this._onKey.fire({key:oe.key,domEvent:Y}),this._showCursor(),this.coreService.triggerDataEvent(oe.key,!0),!this.optionsService.rawOptions.screenReaderMode||Y.altKey||Y.ctrlKey?this.cancel(Y,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(Y,q){const oe=Y.isMac&&!this.options.macOptionIsMeta&&q.altKey&&!q.ctrlKey&&!q.metaKey||Y.isWindows&&q.altKey&&q.ctrlKey&&!q.metaKey||Y.isWindows&&q.getModifierState("AltGraph");return q.type==="keypress"?oe:oe&&(!q.keyCode||q.keyCode>47)}_keyUp(Y){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(Y)===!1||((function(q){return q.keyCode===16||q.keyCode===17||q.keyCode===18})(Y)||this.focus(),this.updateCursorStyle(Y),this._keyPressHandled=!1)}_keyPress(Y){let q;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(Y)===!1)return!1;if(this.cancel(Y),Y.charCode)q=Y.charCode;else if(Y.which===null||Y.which===void 0)q=Y.keyCode;else{if(Y.which===0||Y.charCode===0)return!1;q=Y.which}return!(!q||(Y.altKey||Y.ctrlKey||Y.metaKey)&&!this._isThirdLevelShift(this.browser,Y)||(q=String.fromCharCode(q),this._onKey.fire({key:q,domEvent:Y}),this._showCursor(),this.coreService.triggerDataEvent(q,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(Y){if(Y.data&&Y.inputType==="insertText"&&(!Y.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const q=Y.data;return this.coreService.triggerDataEvent(q,!0),this.cancel(Y),!0}return!1}resize(Y,q){Y!==this.cols||q!==this.rows?super.resize(Y,q):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(Y,q){var oe,J;(oe=this._charSizeService)==null||oe.measure(),(J=this.viewport)==null||J.syncScrollArea(!0)}clear(){var Y;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let q=1;q<this.rows;q++)this.buffer.lines.push(this.buffer.getBlankLine(V.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(Y=this.viewport)==null||Y.reset(),this.refresh(0,this.rows-1)}}reset(){var q,oe;this.options.rows=this.rows,this.options.cols=this.cols;const Y=this._customKeyEventHandler;this._setup(),super.reset(),(q=this._selectionService)==null||q.reset(),this._decorationService.reset(),(oe=this.viewport)==null||oe.reset(),this._customKeyEventHandler=Y,this.refresh(0,this.rows-1)}clearTextureAtlas(){var Y;(Y=this._renderService)==null||Y.clearTextureAtlas()}_reportFocus(){var Y;(Y=this.element)!=null&&Y.classList.contains("focus")?this.coreService.triggerDataEvent($.C0.ESC+"[I"):this.coreService.triggerDataEvent($.C0.ESC+"[O")}_reportWindowsOptions(Y){if(this._renderService)switch(Y){case G.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const q=this._renderService.dimensions.css.canvas.width.toFixed(0),oe=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${$.C0.ESC}[4;${oe};${q}t`);break;case G.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const J=this._renderService.dimensions.css.cell.width.toFixed(0),ie=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${$.C0.ESC}[6;${ie};${J}t`)}}cancel(Y,q){if(this.options.cancelEvents||q)return Y.preventDefault(),Y.stopPropagation(),!1}}a.Terminal=he},9924:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TimeBasedDebouncer=void 0,a.TimeBasedDebouncer=class{constructor(c,h=1e3){this._renderCallback=c,this._debounceThresholdMS=h,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,h,m){this._rowCount=m,c=c!==void 0?c:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h;const u=Date.now();if(u-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=u,this._innerRefresh();else if(!this._additionalRefreshRequested){const y=u-this._lastRefreshMs,w=this._debounceThresholdMS-y;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),w)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,h)}}},1680:function(f,a,c){var h=this&&this.__decorate||function(S,g,v,E){var L,R=arguments.length,T=R<3?g:E===null?E=Object.getOwnPropertyDescriptor(g,v):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(S,g,v,E);else for(var A=S.length-1;A>=0;A--)(L=S[A])&&(T=(R<3?L(T):R>3?L(g,v,T):L(g,v))||T);return R>3&&T&&Object.defineProperty(g,v,T),T},m=this&&this.__param||function(S,g){return function(v,E){g(v,E,S)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Viewport=void 0;const u=c(3656),y=c(4725),w=c(8460),k=c(844),x=c(2585);let b=a.Viewport=class extends k.Disposable{constructor(S,g,v,E,L,R,T,A){super(),this._viewportElement=S,this._scrollArea=g,this._bufferService=v,this._optionsService=E,this._charSizeService=L,this._renderService=R,this._coreBrowserService=T,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new w.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,u.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((M=>this._activeBuffer=M.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((M=>this._renderDimensions=M))),this._handleThemeChange(A.colors),this.register(A.onChangeColors((M=>this._handleThemeChange(M)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(S){this._viewportElement.style.backgroundColor=S.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(S){if(S)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const g=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==g&&(this._lastRecordedBufferHeight=g,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const S=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==S&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=S),this._refreshAnimationFrame=null}syncScrollArea(S=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(S);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(S)}_handleScroll(S){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const g=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:g,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const S=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(S*(this._smoothScrollState.target-this._smoothScrollState.origin)),S<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(S,g){const v=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(g<0&&this._viewportElement.scrollTop!==0||g>0&&v<this._lastRecordedBufferHeight)||(S.cancelable&&S.preventDefault(),!1)}handleWheel(S){const g=this._getPixelsScrolled(S);return g!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+g:this._smoothScrollState.target+=g,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=g,this._bubbleScroll(S,g))}scrollLines(S){if(S!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const g=S*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+g,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:S,suppressScrollEvent:!1})}_getPixelsScrolled(S){if(S.deltaY===0||S.shiftKey)return 0;let g=this._applyScrollModifier(S.deltaY,S);return S.deltaMode===WheelEvent.DOM_DELTA_LINE?g*=this._currentRowHeight:S.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(g*=this._currentRowHeight*this._bufferService.rows),g}getBufferElements(S,g){var A;let v,E="";const L=[],R=g??this._bufferService.buffer.lines.length,T=this._bufferService.buffer.lines;for(let M=S;M<R;M++){const j=T.get(M);if(!j)continue;const I=(A=T.get(M+1))==null?void 0:A.isWrapped;if(E+=j.translateToString(!I),!I||M===T.length-1){const U=document.createElement("div");U.textContent=E,L.push(U),E.length>0&&(v=U),E=""}}return{bufferElements:L,cursorElement:v}}getLinesScrolled(S){if(S.deltaY===0||S.shiftKey)return 0;let g=this._applyScrollModifier(S.deltaY,S);return S.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(g/=this._currentRowHeight+0,this._wheelPartialScroll+=g,g=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):S.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(g*=this._bufferService.rows),g}_applyScrollModifier(S,g){const v=this._optionsService.rawOptions.fastScrollModifier;return v==="alt"&&g.altKey||v==="ctrl"&&g.ctrlKey||v==="shift"&&g.shiftKey?S*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:S*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(S){this._lastTouchY=S.touches[0].pageY}handleTouchMove(S){const g=this._lastTouchY-S.touches[0].pageY;return this._lastTouchY=S.touches[0].pageY,g!==0&&(this._viewportElement.scrollTop+=g,this._bubbleScroll(S,g))}};a.Viewport=b=h([m(2,x.IBufferService),m(3,x.IOptionsService),m(4,y.ICharSizeService),m(5,y.IRenderService),m(6,y.ICoreBrowserService),m(7,y.IThemeService)],b)},3107:function(f,a,c){var h=this&&this.__decorate||function(x,b,S,g){var v,E=arguments.length,L=E<3?b:g===null?g=Object.getOwnPropertyDescriptor(b,S):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(x,b,S,g);else for(var R=x.length-1;R>=0;R--)(v=x[R])&&(L=(E<3?v(L):E>3?v(b,S,L):v(b,S))||L);return E>3&&L&&Object.defineProperty(b,S,L),L},m=this&&this.__param||function(x,b){return function(S,g){b(S,g,x)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferDecorationRenderer=void 0;const u=c(4725),y=c(844),w=c(2585);let k=a.BufferDecorationRenderer=class extends y.Disposable{constructor(x,b,S,g,v){super(),this._screenElement=x,this._bufferService=b,this._coreBrowserService=S,this._decorationService=g,this._renderService=v,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((E=>this._removeDecoration(E)))),this.register((0,y.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const x of this._decorationService.decorations)this._renderDecoration(x);this._dimensionsChanged=!1}_renderDecoration(x){this._refreshStyle(x),this._dimensionsChanged&&this._refreshXPosition(x)}_createElement(x){var g;const b=this._coreBrowserService.mainDocument.createElement("div");b.classList.add("xterm-decoration"),b.classList.toggle("xterm-decoration-top-layer",((g=x==null?void 0:x.options)==null?void 0:g.layer)==="top"),b.style.width=`${Math.round((x.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,b.style.height=(x.options.height||1)*this._renderService.dimensions.css.cell.height+"px",b.style.top=(x.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",b.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const S=x.options.x??0;return S&&S>this._bufferService.cols&&(b.style.display="none"),this._refreshXPosition(x,b),b}_refreshStyle(x){const b=x.marker.line-this._bufferService.buffers.active.ydisp;if(b<0||b>=this._bufferService.rows)x.element&&(x.element.style.display="none",x.onRenderEmitter.fire(x.element));else{let S=this._decorationElements.get(x);S||(S=this._createElement(x),x.element=S,this._decorationElements.set(x,S),this._container.appendChild(S),x.onDispose((()=>{this._decorationElements.delete(x),S.remove()}))),S.style.top=b*this._renderService.dimensions.css.cell.height+"px",S.style.display=this._altBufferIsActive?"none":"block",x.onRenderEmitter.fire(S)}}_refreshXPosition(x,b=x.element){if(!b)return;const S=x.options.x??0;(x.options.anchor||"left")==="right"?b.style.right=S?S*this._renderService.dimensions.css.cell.width+"px":"":b.style.left=S?S*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(x){var b;(b=this._decorationElements.get(x))==null||b.remove(),this._decorationElements.delete(x),x.dispose()}};a.BufferDecorationRenderer=k=h([m(1,w.IBufferService),m(2,u.ICoreBrowserService),m(3,w.IDecorationService),m(4,u.IRenderService)],k)},5871:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorZoneStore=void 0,a.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(c){if(c.options.overviewRulerOptions){for(const h of this._zones)if(h.color===c.options.overviewRulerOptions.color&&h.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(h,c.marker.line))return;if(this._lineAdjacentToZone(h,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(h,c.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=c.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=c.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=c.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=c.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:c.options.overviewRulerOptions.color,position:c.options.overviewRulerOptions.position,startBufferLine:c.marker.line,endBufferLine:c.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(c){this._linePadding=c}_lineIntersectsZone(c,h){return h>=c.startBufferLine&&h<=c.endBufferLine}_lineAdjacentToZone(c,h,m){return h>=c.startBufferLine-this._linePadding[m||"full"]&&h<=c.endBufferLine+this._linePadding[m||"full"]}_addLineToZone(c,h){c.startBufferLine=Math.min(c.startBufferLine,h),c.endBufferLine=Math.max(c.endBufferLine,h)}}},5744:function(f,a,c){var h=this&&this.__decorate||function(v,E,L,R){var T,A=arguments.length,M=A<3?E:R===null?R=Object.getOwnPropertyDescriptor(E,L):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(v,E,L,R);else for(var j=v.length-1;j>=0;j--)(T=v[j])&&(M=(A<3?T(M):A>3?T(E,L,M):T(E,L))||M);return A>3&&M&&Object.defineProperty(E,L,M),M},m=this&&this.__param||function(v,E){return function(L,R){E(L,R,v)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OverviewRulerRenderer=void 0;const u=c(5871),y=c(4725),w=c(844),k=c(2585),x={full:0,left:0,center:0,right:0},b={full:0,left:0,center:0,right:0},S={full:0,left:0,center:0,right:0};let g=a.OverviewRulerRenderer=class extends w.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(v,E,L,R,T,A,M){var I;super(),this._viewportElement=v,this._screenElement=E,this._bufferService=L,this._decorationService=R,this._renderService=T,this._optionsService=A,this._coreBrowserService=M,this._colorZoneStore=new u.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(I=this._viewportElement.parentElement)==null||I.insertBefore(this._canvas,this._viewportElement);const j=this._canvas.getContext("2d");if(!j)throw new Error("Ctx cannot be null");this._ctx=j,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,w.toDisposable)((()=>{var U;(U=this._canvas)==null||U.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const v=Math.floor(this._canvas.width/3),E=Math.ceil(this._canvas.width/3);b.full=this._canvas.width,b.left=v,b.center=E,b.right=v,this._refreshDrawHeightConstants(),S.full=0,S.left=0,S.center=b.left,S.right=b.left+b.center}_refreshDrawHeightConstants(){x.full=Math.round(2*this._coreBrowserService.dpr);const v=this._canvas.height/this._bufferService.buffer.lines.length,E=Math.round(Math.max(Math.min(v,12),6)*this._coreBrowserService.dpr);x.left=E,x.center=E,x.right=E}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*x.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const E of this._decorationService.decorations)this._colorZoneStore.addDecoration(E);this._ctx.lineWidth=1;const v=this._colorZoneStore.zones;for(const E of v)E.position!=="full"&&this._renderColorZone(E);for(const E of v)E.position==="full"&&this._renderColorZone(E);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(v){this._ctx.fillStyle=v.color,this._ctx.fillRect(S[v.position||"full"],Math.round((this._canvas.height-1)*(v.startBufferLine/this._bufferService.buffers.active.lines.length)-x[v.position||"full"]/2),b[v.position||"full"],Math.round((this._canvas.height-1)*((v.endBufferLine-v.startBufferLine)/this._bufferService.buffers.active.lines.length)+x[v.position||"full"]))}_queueRefresh(v,E){this._shouldUpdateDimensions=v||this._shouldUpdateDimensions,this._shouldUpdateAnchor=E||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};a.OverviewRulerRenderer=g=h([m(2,k.IBufferService),m(3,k.IDecorationService),m(4,y.IRenderService),m(5,k.IOptionsService),m(6,y.ICoreBrowserService)],g)},2950:function(f,a,c){var h=this&&this.__decorate||function(x,b,S,g){var v,E=arguments.length,L=E<3?b:g===null?g=Object.getOwnPropertyDescriptor(b,S):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(x,b,S,g);else for(var R=x.length-1;R>=0;R--)(v=x[R])&&(L=(E<3?v(L):E>3?v(b,S,L):v(b,S))||L);return E>3&&L&&Object.defineProperty(b,S,L),L},m=this&&this.__param||function(x,b){return function(S,g){b(S,g,x)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CompositionHelper=void 0;const u=c(4725),y=c(2585),w=c(2584);let k=a.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(x,b,S,g,v,E){this._textarea=x,this._compositionView=b,this._bufferService=S,this._optionsService=g,this._coreService=v,this._renderService=E,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(x){this._compositionView.textContent=x.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(x){if(this._isComposing||this._isSendingComposition){if(x.keyCode===229||x.keyCode===16||x.keyCode===17||x.keyCode===18)return!1;this._finalizeComposition(!1)}return x.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(x){if(this._compositionView.classList.remove("active"),this._isComposing=!1,x){const b={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let S;this._isSendingComposition=!1,b.start+=this._dataAlreadySent.length,S=this._isComposing?this._textarea.value.substring(b.start,b.end):this._textarea.value.substring(b.start),S.length>0&&this._coreService.triggerDataEvent(S,!0)}}),0)}else{this._isSendingComposition=!1;const b=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(b,!0)}}_handleAnyTextareaChanges(){const x=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const b=this._textarea.value,S=b.replace(x,"");this._dataAlreadySent=S,b.length>x.length?this._coreService.triggerDataEvent(S,!0):b.length<x.length?this._coreService.triggerDataEvent(`${w.C0.DEL}`,!0):b.length===x.length&&b!==x&&this._coreService.triggerDataEvent(b,!0)}}),0)}updateCompositionElements(x){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const b=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),S=this._renderService.dimensions.css.cell.height,g=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,v=b*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=v+"px",this._compositionView.style.top=g+"px",this._compositionView.style.height=S+"px",this._compositionView.style.lineHeight=S+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const E=this._compositionView.getBoundingClientRect();this._textarea.style.left=v+"px",this._textarea.style.top=g+"px",this._textarea.style.width=Math.max(E.width,1)+"px",this._textarea.style.height=Math.max(E.height,1)+"px",this._textarea.style.lineHeight=E.height+"px"}x||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};a.CompositionHelper=k=h([m(2,y.IBufferService),m(3,y.IOptionsService),m(4,y.ICoreService),m(5,u.IRenderService)],k)},9806:(f,a)=>{function c(h,m,u){const y=u.getBoundingClientRect(),w=h.getComputedStyle(u),k=parseInt(w.getPropertyValue("padding-left")),x=parseInt(w.getPropertyValue("padding-top"));return[m.clientX-y.left-k,m.clientY-y.top-x]}Object.defineProperty(a,"__esModule",{value:!0}),a.getCoords=a.getCoordsRelativeToElement=void 0,a.getCoordsRelativeToElement=c,a.getCoords=function(h,m,u,y,w,k,x,b,S){if(!k)return;const g=c(h,m,u);return g?(g[0]=Math.ceil((g[0]+(S?x/2:0))/x),g[1]=Math.ceil(g[1]/b),g[0]=Math.min(Math.max(g[0],1),y+(S?1:0)),g[1]=Math.min(Math.max(g[1],1),w),g):void 0}},9504:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.moveToCellSequence=void 0;const h=c(2584);function m(b,S,g,v){const E=b-u(b,g),L=S-u(S,g),R=Math.abs(E-L)-(function(T,A,M){let j=0;const I=T-u(T,M),U=A-u(A,M);for(let F=0;F<Math.abs(I-U);F++){const K=y(T,A)==="A"?-1:1,W=M.buffer.lines.get(I+K*F);W!=null&&W.isWrapped&&j++}return j})(b,S,g);return x(R,k(y(b,S),v))}function u(b,S){let g=0,v=S.buffer.lines.get(b),E=v==null?void 0:v.isWrapped;for(;E&&b>=0&&b<S.rows;)g++,v=S.buffer.lines.get(--b),E=v==null?void 0:v.isWrapped;return g}function y(b,S){return b>S?"A":"B"}function w(b,S,g,v,E,L){let R=b,T=S,A="";for(;R!==g||T!==v;)R+=E?1:-1,E&&R>L.cols-1?(A+=L.buffer.translateBufferLineToString(T,!1,b,R),R=0,b=0,T++):!E&&R<0&&(A+=L.buffer.translateBufferLineToString(T,!1,0,b+1),R=L.cols-1,b=R,T--);return A+L.buffer.translateBufferLineToString(T,!1,b,R)}function k(b,S){const g=S?"O":"[";return h.C0.ESC+g+b}function x(b,S){b=Math.floor(b);let g="";for(let v=0;v<b;v++)g+=S;return g}a.moveToCellSequence=function(b,S,g,v){const E=g.buffer.x,L=g.buffer.y;if(!g.buffer.hasScrollback)return(function(A,M,j,I,U,F){return m(M,I,U,F).length===0?"":x(w(A,M,A,M-u(M,U),!1,U).length,k("D",F))})(E,L,0,S,g,v)+m(L,S,g,v)+(function(A,M,j,I,U,F){let K;K=m(M,I,U,F).length>0?I-u(I,U):M;const W=I,V=(function($,ee,N,B,z,G){let H;return H=m(N,B,z,G).length>0?B-u(B,z):ee,$<N&&H<=B||$>=N&&H<B?"C":"D"})(A,M,j,I,U,F);return x(w(A,K,j,W,V==="C",U).length,k(V,F))})(E,L,b,S,g,v);let R;if(L===S)return R=E>b?"D":"C",x(Math.abs(E-b),k(R,v));R=L>S?"D":"C";const T=Math.abs(L-S);return x((function(A,M){return M.cols-A})(L>S?b:E,g)+(T-1)*g.cols+1+((L>S?E:b)-1),k(R,v))}},1296:function(f,a,c){var h=this&&this.__decorate||function(F,K,W,V){var $,ee=arguments.length,N=ee<3?K:V===null?V=Object.getOwnPropertyDescriptor(K,W):V;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(F,K,W,V);else for(var B=F.length-1;B>=0;B--)($=F[B])&&(N=(ee<3?$(N):ee>3?$(K,W,N):$(K,W))||N);return ee>3&&N&&Object.defineProperty(K,W,N),N},m=this&&this.__param||function(F,K){return function(W,V){K(W,V,F)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRenderer=void 0;const u=c(3787),y=c(2550),w=c(2223),k=c(6171),x=c(6052),b=c(4725),S=c(8055),g=c(8460),v=c(844),E=c(2585),L="xterm-dom-renderer-owner-",R="xterm-rows",T="xterm-fg-",A="xterm-bg-",M="xterm-focus",j="xterm-selection";let I=1,U=a.DomRenderer=class extends v.Disposable{constructor(F,K,W,V,$,ee,N,B,z,G,H,te,he){super(),this._terminal=F,this._document=K,this._element=W,this._screenElement=V,this._viewportElement=$,this._helperContainer=ee,this._linkifier2=N,this._charSizeService=z,this._optionsService=G,this._bufferService=H,this._coreBrowserService=te,this._themeService=he,this._terminalClass=I++,this._rowElements=[],this._selectionRenderModel=(0,x.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new g.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(R),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(j),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,k.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((me=>this._injectCss(me)))),this._injectCss(this._themeService.colors),this._rowFactory=B.createInstance(u.DomRendererRowFactory,document),this._element.classList.add(L+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((me=>this._handleLinkHover(me)))),this.register(this._linkifier2.onHideLinkUnderline((me=>this._handleLinkLeave(me)))),this.register((0,v.toDisposable)((()=>{this._element.classList.remove(L+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new y.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const F=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*F,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*F),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/F),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/F),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const W of this._rowElements)W.style.width=`${this.dimensions.css.canvas.width}px`,W.style.height=`${this.dimensions.css.cell.height}px`,W.style.lineHeight=`${this.dimensions.css.cell.height}px`,W.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const K=`${this._terminalSelector} .${R} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=K,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(F){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let K=`${this._terminalSelector} .${R} { color: ${F.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;K+=`${this._terminalSelector} .${R} .xterm-dim { color: ${S.color.multiplyOpacity(F.foreground,.5).css};}`,K+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const W=`blink_underline_${this._terminalClass}`,V=`blink_bar_${this._terminalClass}`,$=`blink_block_${this._terminalClass}`;K+=`@keyframes ${W} { 50% { border-bottom-style: hidden; }}`,K+=`@keyframes ${V} { 50% { box-shadow: none; }}`,K+=`@keyframes ${$} { 0% { background-color: ${F.cursor.css}; color: ${F.cursorAccent.css}; } 50% { background-color: inherit; color: ${F.cursor.css}; }}`,K+=`${this._terminalSelector} .${R}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${W} 1s step-end infinite;}${this._terminalSelector} .${R}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${V} 1s step-end infinite;}${this._terminalSelector} .${R}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${$} 1s step-end infinite;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block { background-color: ${F.cursor.css}; color: ${F.cursorAccent.css};}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${F.cursor.css} !important; color: ${F.cursorAccent.css} !important;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${F.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${F.cursor.css} inset;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${F.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,K+=`${this._terminalSelector} .${j} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${j} div { position: absolute; background-color: ${F.selectionBackgroundOpaque.css};}${this._terminalSelector} .${j} div { position: absolute; background-color: ${F.selectionInactiveBackgroundOpaque.css};}`;for(const[ee,N]of F.ansi.entries())K+=`${this._terminalSelector} .${T}${ee} { color: ${N.css}; }${this._terminalSelector} .${T}${ee}.xterm-dim { color: ${S.color.multiplyOpacity(N,.5).css}; }${this._terminalSelector} .${A}${ee} { background-color: ${N.css}; }`;K+=`${this._terminalSelector} .${T}${w.INVERTED_DEFAULT_COLOR} { color: ${S.color.opaque(F.background).css}; }${this._terminalSelector} .${T}${w.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${S.color.multiplyOpacity(S.color.opaque(F.background),.5).css}; }${this._terminalSelector} .${A}${w.INVERTED_DEFAULT_COLOR} { background-color: ${F.foreground.css}; }`,this._themeStyleElement.textContent=K}_setDefaultSpacing(){const F=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${F}px`,this._rowFactory.defaultSpacing=F}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(F,K){for(let W=this._rowElements.length;W<=K;W++){const V=this._document.createElement("div");this._rowContainer.appendChild(V),this._rowElements.push(V)}for(;this._rowElements.length>K;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(F,K){this._refreshRowElements(F,K),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(M),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(M),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(F,K,W){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(F,K,W),this.renderRows(0,this._bufferService.rows-1),!F||!K)return;this._selectionRenderModel.update(this._terminal,F,K,W);const V=this._selectionRenderModel.viewportStartRow,$=this._selectionRenderModel.viewportEndRow,ee=this._selectionRenderModel.viewportCappedStartRow,N=this._selectionRenderModel.viewportCappedEndRow;if(ee>=this._bufferService.rows||N<0)return;const B=this._document.createDocumentFragment();if(W){const z=F[0]>K[0];B.appendChild(this._createSelectionElement(ee,z?K[0]:F[0],z?F[0]:K[0],N-ee+1))}else{const z=V===ee?F[0]:0,G=ee===$?K[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(ee,z,G));const H=N-ee-1;if(B.appendChild(this._createSelectionElement(ee+1,0,this._bufferService.cols,H)),ee!==N){const te=$===N?K[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(N,0,te))}}this._selectionContainer.appendChild(B)}_createSelectionElement(F,K,W,V=1){const $=this._document.createElement("div"),ee=K*this.dimensions.css.cell.width;let N=this.dimensions.css.cell.width*(W-K);return ee+N>this.dimensions.css.canvas.width&&(N=this.dimensions.css.canvas.width-ee),$.style.height=V*this.dimensions.css.cell.height+"px",$.style.top=F*this.dimensions.css.cell.height+"px",$.style.left=`${ee}px`,$.style.width=`${N}px`,$}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const F of this._rowElements)F.replaceChildren()}renderRows(F,K){const W=this._bufferService.buffer,V=W.ybase+W.y,$=Math.min(W.x,this._bufferService.cols-1),ee=this._optionsService.rawOptions.cursorBlink,N=this._optionsService.rawOptions.cursorStyle,B=this._optionsService.rawOptions.cursorInactiveStyle;for(let z=F;z<=K;z++){const G=z+W.ydisp,H=this._rowElements[z],te=W.lines.get(G);if(!H||!te)break;H.replaceChildren(...this._rowFactory.createRow(te,G,G===V,N,B,$,ee,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${L}${this._terminalClass}`}_handleLinkHover(F){this._setCellUnderline(F.x1,F.x2,F.y1,F.y2,F.cols,!0)}_handleLinkLeave(F){this._setCellUnderline(F.x1,F.x2,F.y1,F.y2,F.cols,!1)}_setCellUnderline(F,K,W,V,$,ee){W<0&&(F=0),V<0&&(K=0);const N=this._bufferService.rows-1;W=Math.max(Math.min(W,N),0),V=Math.max(Math.min(V,N),0),$=Math.min($,this._bufferService.cols);const B=this._bufferService.buffer,z=B.ybase+B.y,G=Math.min(B.x,$-1),H=this._optionsService.rawOptions.cursorBlink,te=this._optionsService.rawOptions.cursorStyle,he=this._optionsService.rawOptions.cursorInactiveStyle;for(let me=W;me<=V;++me){const Y=me+B.ydisp,q=this._rowElements[me],oe=B.lines.get(Y);if(!q||!oe)break;q.replaceChildren(...this._rowFactory.createRow(oe,Y,Y===z,te,he,G,H,this.dimensions.css.cell.width,this._widthCache,ee?me===W?F:0:-1,ee?(me===V?K:$)-1:-1))}}};a.DomRenderer=U=h([m(7,E.IInstantiationService),m(8,b.ICharSizeService),m(9,E.IOptionsService),m(10,E.IBufferService),m(11,b.ICoreBrowserService),m(12,b.IThemeService)],U)},3787:function(f,a,c){var h=this&&this.__decorate||function(R,T,A,M){var j,I=arguments.length,U=I<3?T:M===null?M=Object.getOwnPropertyDescriptor(T,A):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(R,T,A,M);else for(var F=R.length-1;F>=0;F--)(j=R[F])&&(U=(I<3?j(U):I>3?j(T,A,U):j(T,A))||U);return I>3&&U&&Object.defineProperty(T,A,U),U},m=this&&this.__param||function(R,T){return function(A,M){T(A,M,R)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRendererRowFactory=void 0;const u=c(2223),y=c(643),w=c(511),k=c(2585),x=c(8055),b=c(4725),S=c(4269),g=c(6171),v=c(3734);let E=a.DomRendererRowFactory=class{constructor(R,T,A,M,j,I,U){this._document=R,this._characterJoinerService=T,this._optionsService=A,this._coreBrowserService=M,this._coreService=j,this._decorationService=I,this._themeService=U,this._workCell=new w.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(R,T,A){this._selectionStart=R,this._selectionEnd=T,this._columnSelectMode=A}createRow(R,T,A,M,j,I,U,F,K,W,V){const $=[],ee=this._characterJoinerService.getJoinedCharacters(T),N=this._themeService.colors;let B,z=R.getNoBgTrimmedLength();A&&z<I+1&&(z=I+1);let G=0,H="",te=0,he=0,me=0,Y=!1,q=0,oe=!1,J=0;const ie=[],de=W!==-1&&V!==-1;for(let Ce=0;Ce<z;Ce++){R.loadCell(Ce,this._workCell);let xe=this._workCell.getWidth();if(xe===0)continue;let Ke=!1,it=Ce,Re=this._workCell;if(ee.length>0&&Ce===ee[0][0]){Ke=!0;const Ie=ee.shift();Re=new S.JoinedCellData(this._workCell,R.translateToString(!0,Ie[0],Ie[1]),Ie[1]-Ie[0]),it=Ie[1]-1,xe=Re.getWidth()}const Jt=this._isCellInSelection(Ce,T),Wt=A&&Ce===I,Bt=de&&Ce>=W&&Ce<=V;let Ct=!1;this._decorationService.forEachDecorationAtCell(Ce,T,void 0,(Ie=>{Ct=!0}));let Xt=Re.getChars()||y.WHITESPACE_CELL_CHAR;if(Xt===" "&&(Re.isUnderline()||Re.isOverline())&&(Xt=" "),J=xe*F-K.get(Xt,Re.isBold(),Re.isItalic()),B){if(G&&(Jt&&oe||!Jt&&!oe&&Re.bg===te)&&(Jt&&oe&&N.selectionForeground||Re.fg===he)&&Re.extended.ext===me&&Bt===Y&&J===q&&!Wt&&!Ke&&!Ct){Re.isInvisible()?H+=y.WHITESPACE_CELL_CHAR:H+=Xt,G++;continue}G&&(B.textContent=H),B=this._document.createElement("span"),G=0,H=""}else B=this._document.createElement("span");if(te=Re.bg,he=Re.fg,me=Re.extended.ext,Y=Bt,q=J,oe=Jt,Ke&&I>=Ce&&I<=it&&(I=Ce),!this._coreService.isCursorHidden&&Wt&&this._coreService.isCursorInitialized){if(ie.push("xterm-cursor"),this._coreBrowserService.isFocused)U&&ie.push("xterm-cursor-blink"),ie.push(M==="bar"?"xterm-cursor-bar":M==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(j)switch(j){case"outline":ie.push("xterm-cursor-outline");break;case"block":ie.push("xterm-cursor-block");break;case"bar":ie.push("xterm-cursor-bar");break;case"underline":ie.push("xterm-cursor-underline")}}if(Re.isBold()&&ie.push("xterm-bold"),Re.isItalic()&&ie.push("xterm-italic"),Re.isDim()&&ie.push("xterm-dim"),H=Re.isInvisible()?y.WHITESPACE_CELL_CHAR:Re.getChars()||y.WHITESPACE_CELL_CHAR,Re.isUnderline()&&(ie.push(`xterm-underline-${Re.extended.underlineStyle}`),H===" "&&(H=" "),!Re.isUnderlineColorDefault()))if(Re.isUnderlineColorRGB())B.style.textDecorationColor=`rgb(${v.AttributeData.toColorRGB(Re.getUnderlineColor()).join(",")})`;else{let Ie=Re.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Re.isBold()&&Ie<8&&(Ie+=8),B.style.textDecorationColor=N.ansi[Ie].css}Re.isOverline()&&(ie.push("xterm-overline"),H===" "&&(H=" ")),Re.isStrikethrough()&&ie.push("xterm-strikethrough"),Bt&&(B.style.textDecoration="underline");let vt=Re.getFgColor(),rt=Re.getFgColorMode(),kt=Re.getBgColor(),ue=Re.getBgColorMode();const Se=!!Re.isInverse();if(Se){const Ie=vt;vt=kt,kt=Ie;const gt=rt;rt=ue,ue=gt}let ke,De,Be,ht=!1;switch(this._decorationService.forEachDecorationAtCell(Ce,T,void 0,(Ie=>{Ie.options.layer!=="top"&&ht||(Ie.backgroundColorRGB&&(ue=50331648,kt=Ie.backgroundColorRGB.rgba>>8&16777215,ke=Ie.backgroundColorRGB),Ie.foregroundColorRGB&&(rt=50331648,vt=Ie.foregroundColorRGB.rgba>>8&16777215,De=Ie.foregroundColorRGB),ht=Ie.options.layer==="top")})),!ht&&Jt&&(ke=this._coreBrowserService.isFocused?N.selectionBackgroundOpaque:N.selectionInactiveBackgroundOpaque,kt=ke.rgba>>8&16777215,ue=50331648,ht=!0,N.selectionForeground&&(rt=50331648,vt=N.selectionForeground.rgba>>8&16777215,De=N.selectionForeground)),ht&&ie.push("xterm-decoration-top"),ue){case 16777216:case 33554432:Be=N.ansi[kt],ie.push(`xterm-bg-${kt}`);break;case 50331648:Be=x.channels.toColor(kt>>16,kt>>8&255,255&kt),this._addStyle(B,`background-color:#${L((kt>>>0).toString(16),"0",6)}`);break;default:Se?(Be=N.foreground,ie.push(`xterm-bg-${u.INVERTED_DEFAULT_COLOR}`)):Be=N.background}switch(ke||Re.isDim()&&(ke=x.color.multiplyOpacity(Be,.5)),rt){case 16777216:case 33554432:Re.isBold()&&vt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(vt+=8),this._applyMinimumContrast(B,Be,N.ansi[vt],Re,ke,void 0)||ie.push(`xterm-fg-${vt}`);break;case 50331648:const Ie=x.channels.toColor(vt>>16&255,vt>>8&255,255&vt);this._applyMinimumContrast(B,Be,Ie,Re,ke,De)||this._addStyle(B,`color:#${L(vt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(B,Be,N.foreground,Re,ke,De)||Se&&ie.push(`xterm-fg-${u.INVERTED_DEFAULT_COLOR}`)}ie.length&&(B.className=ie.join(" "),ie.length=0),Wt||Ke||Ct?B.textContent=H:G++,J!==this.defaultSpacing&&(B.style.letterSpacing=`${J}px`),$.push(B),Ce=it}return B&&G&&(B.textContent=H),$}_applyMinimumContrast(R,T,A,M,j,I){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,g.treatGlyphAsBackgroundColor)(M.getCode()))return!1;const U=this._getContrastCache(M);let F;if(j||I||(F=U.getColor(T.rgba,A.rgba)),F===void 0){const K=this._optionsService.rawOptions.minimumContrastRatio/(M.isDim()?2:1);F=x.color.ensureContrastRatio(j||T,I||A,K),U.setColor((j||T).rgba,(I||A).rgba,F??null)}return!!F&&(this._addStyle(R,`color:${F.css}`),!0)}_getContrastCache(R){return R.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(R,T){R.setAttribute("style",`${R.getAttribute("style")||""}${T};`)}_isCellInSelection(R,T){const A=this._selectionStart,M=this._selectionEnd;return!(!A||!M)&&(this._columnSelectMode?A[0]<=M[0]?R>=A[0]&&T>=A[1]&&R<M[0]&&T<=M[1]:R<A[0]&&T>=A[1]&&R>=M[0]&&T<=M[1]:T>A[1]&&T<M[1]||A[1]===M[1]&&T===A[1]&&R>=A[0]&&R<M[0]||A[1]<M[1]&&T===M[1]&&R<M[0]||A[1]<M[1]&&T===A[1]&&R>=A[0])}};function L(R,T,A){for(;R.length<A;)R=T+R;return R}a.DomRendererRowFactory=E=h([m(1,b.ICharacterJoinerService),m(2,k.IOptionsService),m(3,b.ICoreBrowserService),m(4,k.ICoreService),m(5,k.IDecorationService),m(6,b.IThemeService)],E)},2550:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WidthCache=void 0,a.WidthCache=class{constructor(c,h){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=c.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const m=c.createElement("span");m.classList.add("xterm-char-measure-element");const u=c.createElement("span");u.classList.add("xterm-char-measure-element"),u.style.fontWeight="bold";const y=c.createElement("span");y.classList.add("xterm-char-measure-element"),y.style.fontStyle="italic";const w=c.createElement("span");w.classList.add("xterm-char-measure-element"),w.style.fontWeight="bold",w.style.fontStyle="italic",this._measureElements=[m,u,y,w],this._container.appendChild(m),this._container.appendChild(u),this._container.appendChild(y),this._container.appendChild(w),h.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(c,h,m,u){c===this._font&&h===this._fontSize&&m===this._weight&&u===this._weightBold||(this._font=c,this._fontSize=h,this._weight=m,this._weightBold=u,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${m}`,this._measureElements[1].style.fontWeight=`${u}`,this._measureElements[2].style.fontWeight=`${m}`,this._measureElements[3].style.fontWeight=`${u}`,this.clear())}get(c,h,m){let u=0;if(!h&&!m&&c.length===1&&(u=c.charCodeAt(0))<256){if(this._flat[u]!==-9999)return this._flat[u];const k=this._measure(c,0);return k>0&&(this._flat[u]=k),k}let y=c;h&&(y+="B"),m&&(y+="I");let w=this._holey.get(y);if(w===void 0){let k=0;h&&(k|=1),m&&(k|=2),w=this._measure(c,k),w>0&&this._holey.set(y,w)}return w}_measure(c,h){const m=this._measureElements[h];return m.textContent=c.repeat(32),m.offsetWidth/32}}},2223:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.TEXT_BASELINE=a.DIM_OPACITY=a.INVERTED_DEFAULT_COLOR=void 0;const h=c(6114);a.INVERTED_DEFAULT_COLOR=257,a.DIM_OPACITY=.5,a.TEXT_BASELINE=h.isFirefox||h.isLegacyEdge?"bottom":"ideographic"},6171:(f,a)=>{function c(m){return 57508<=m&&m<=57558}function h(m){return m>=128512&&m<=128591||m>=127744&&m<=128511||m>=128640&&m<=128767||m>=9728&&m<=9983||m>=9984&&m<=10175||m>=65024&&m<=65039||m>=129280&&m<=129535||m>=127462&&m<=127487}Object.defineProperty(a,"__esModule",{value:!0}),a.computeNextVariantOffset=a.createRenderDimensions=a.treatGlyphAsBackgroundColor=a.allowRescaling=a.isEmoji=a.isRestrictedPowerlineGlyph=a.isPowerlineGlyph=a.throwIfFalsy=void 0,a.throwIfFalsy=function(m){if(!m)throw new Error("value must not be falsy");return m},a.isPowerlineGlyph=c,a.isRestrictedPowerlineGlyph=function(m){return 57520<=m&&m<=57527},a.isEmoji=h,a.allowRescaling=function(m,u,y,w){return u===1&&y>Math.ceil(1.5*w)&&m!==void 0&&m>255&&!h(m)&&!c(m)&&!(function(k){return 57344<=k&&k<=63743})(m)},a.treatGlyphAsBackgroundColor=function(m){return c(m)||(function(u){return 9472<=u&&u<=9631})(m)},a.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},a.computeNextVariantOffset=function(m,u,y=0){return(m-(2*Math.round(u)-y))%(2*Math.round(u))}},6052:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createSelectionRenderModel=void 0;class c{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(m,u,y,w=!1){if(this.selectionStart=u,this.selectionEnd=y,!u||!y||u[0]===y[0]&&u[1]===y[1])return void this.clear();const k=m.buffers.active.ydisp,x=u[1]-k,b=y[1]-k,S=Math.max(x,0),g=Math.min(b,m.rows-1);S>=m.rows||g<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=w,this.viewportStartRow=x,this.viewportEndRow=b,this.viewportCappedStartRow=S,this.viewportCappedEndRow=g,this.startCol=u[0],this.endCol=y[0])}isCellSelected(m,u,y){return!!this.hasSelection&&(y-=m.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?u>=this.startCol&&y>=this.viewportCappedStartRow&&u<this.endCol&&y<=this.viewportCappedEndRow:u<this.startCol&&y>=this.viewportCappedStartRow&&u>=this.endCol&&y<=this.viewportCappedEndRow:y>this.viewportStartRow&&y<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&y===this.viewportStartRow&&u>=this.startCol&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&y===this.viewportEndRow&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&y===this.viewportStartRow&&u>=this.startCol)}}a.createSelectionRenderModel=function(){return new c}},456:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionModel=void 0,a.SelectionModel=class{constructor(c){this._bufferService=c,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?c%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)-1]:[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[c,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[Math.max(c,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const c=this.selectionStart,h=this.selectionEnd;return!(!c||!h)&&(c[1]>h[1]||c[1]===h[1]&&c[0]>h[0])}handleTrim(c){return this.selectionStart&&(this.selectionStart[1]-=c),this.selectionEnd&&(this.selectionEnd[1]-=c),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(f,a,c){var h=this&&this.__decorate||function(g,v,E,L){var R,T=arguments.length,A=T<3?v:L===null?L=Object.getOwnPropertyDescriptor(v,E):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(g,v,E,L);else for(var M=g.length-1;M>=0;M--)(R=g[M])&&(A=(T<3?R(A):T>3?R(v,E,A):R(v,E))||A);return T>3&&A&&Object.defineProperty(v,E,A),A},m=this&&this.__param||function(g,v){return function(E,L){v(E,L,g)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharSizeService=void 0;const u=c(2585),y=c(8460),w=c(844);let k=a.CharSizeService=class extends w.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(g,v,E){super(),this._optionsService=E,this.width=0,this.height=0,this._onCharSizeChange=this.register(new y.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new S(this._optionsService))}catch{this._measureStrategy=this.register(new b(g,v,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const g=this._measureStrategy.measure();g.width===this.width&&g.height===this.height||(this.width=g.width,this.height=g.height,this._onCharSizeChange.fire())}};a.CharSizeService=k=h([m(2,u.IOptionsService)],k);class x extends w.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(v,E){v!==void 0&&v>0&&E!==void 0&&E>0&&(this._result.width=v,this._result.height=E)}}class b extends x{constructor(v,E,L){super(),this._document=v,this._parentElement=E,this._optionsService=L,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class S extends x{constructor(v){super(),this._optionsService=v,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const E=this._ctx.measureText("W");if(!("width"in E&&"fontBoundingBoxAscent"in E&&"fontBoundingBoxDescent"in E))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const v=this._ctx.measureText("W");return this._validateAndSet(v.width,v.fontBoundingBoxAscent+v.fontBoundingBoxDescent),this._result}}},4269:function(f,a,c){var h=this&&this.__decorate||function(S,g,v,E){var L,R=arguments.length,T=R<3?g:E===null?E=Object.getOwnPropertyDescriptor(g,v):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(S,g,v,E);else for(var A=S.length-1;A>=0;A--)(L=S[A])&&(T=(R<3?L(T):R>3?L(g,v,T):L(g,v))||T);return R>3&&T&&Object.defineProperty(g,v,T),T},m=this&&this.__param||function(S,g){return function(v,E){g(v,E,S)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharacterJoinerService=a.JoinedCellData=void 0;const u=c(3734),y=c(643),w=c(511),k=c(2585);class x extends u.AttributeData{constructor(g,v,E){super(),this.content=0,this.combinedData="",this.fg=g.fg,this.bg=g.bg,this.combinedData=v,this._width=E}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(g){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.JoinedCellData=x;let b=a.CharacterJoinerService=class Ag{constructor(g){this._bufferService=g,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new w.CellData}register(g){const v={id:this._nextCharacterJoinerId++,handler:g};return this._characterJoiners.push(v),v.id}deregister(g){for(let v=0;v<this._characterJoiners.length;v++)if(this._characterJoiners[v].id===g)return this._characterJoiners.splice(v,1),!0;return!1}getJoinedCharacters(g){if(this._characterJoiners.length===0)return[];const v=this._bufferService.buffer.lines.get(g);if(!v||v.length===0)return[];const E=[],L=v.translateToString(!0);let R=0,T=0,A=0,M=v.getFg(0),j=v.getBg(0);for(let I=0;I<v.getTrimmedLength();I++)if(v.loadCell(I,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==M||this._workCell.bg!==j){if(I-R>1){const U=this._getJoinedRanges(L,A,T,v,R);for(let F=0;F<U.length;F++)E.push(U[F])}R=I,A=T,M=this._workCell.fg,j=this._workCell.bg}T+=this._workCell.getChars().length||y.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-R>1){const I=this._getJoinedRanges(L,A,T,v,R);for(let U=0;U<I.length;U++)E.push(I[U])}return E}_getJoinedRanges(g,v,E,L,R){const T=g.substring(v,E);let A=[];try{A=this._characterJoiners[0].handler(T)}catch(M){console.error(M)}for(let M=1;M<this._characterJoiners.length;M++)try{const j=this._characterJoiners[M].handler(T);for(let I=0;I<j.length;I++)Ag._mergeRanges(A,j[I])}catch(j){console.error(j)}return this._stringRangesToCellRanges(A,L,R),A}_stringRangesToCellRanges(g,v,E){let L=0,R=!1,T=0,A=g[L];if(A){for(let M=E;M<this._bufferService.cols;M++){const j=v.getWidth(M),I=v.getString(M).length||y.WHITESPACE_CELL_CHAR.length;if(j!==0){if(!R&&A[0]<=T&&(A[0]=M,R=!0),A[1]<=T){if(A[1]=M,A=g[++L],!A)break;A[0]<=T?(A[0]=M,R=!0):R=!1}T+=I}}A&&(A[1]=this._bufferService.cols)}}static _mergeRanges(g,v){let E=!1;for(let L=0;L<g.length;L++){const R=g[L];if(E){if(v[1]<=R[0])return g[L-1][1]=v[1],g;if(v[1]<=R[1])return g[L-1][1]=Math.max(v[1],R[1]),g.splice(L,1),g;g.splice(L,1),L--}else{if(v[1]<=R[0])return g.splice(L,0,v),g;if(v[1]<=R[1])return R[0]=Math.min(v[0],R[0]),g;v[0]<R[1]&&(R[0]=Math.min(v[0],R[0]),E=!0)}}return E?g[g.length-1][1]=v[1]:g.push(v),g}};a.CharacterJoinerService=b=h([m(0,k.IBufferService)],b)},5114:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreBrowserService=void 0;const h=c(844),m=c(8460),u=c(3656);class y extends h.Disposable{constructor(x,b,S){super(),this._textarea=x,this._window=b,this.mainDocument=S,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new w(this._window),this._onDprChange=this.register(new m.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new m.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((g=>this._screenDprMonitor.setWindow(g)))),this.register((0,m.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(x){this._window!==x&&(this._window=x,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}a.CoreBrowserService=y;class w extends h.Disposable{constructor(x){super(),this._parentWindow=x,this._windowResizeListener=this.register(new h.MutableDisposable),this._onDprChange=this.register(new m.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,h.toDisposable)((()=>this.clearListener())))}setWindow(x){this._parentWindow=x,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,u.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var x;this._outerListener&&((x=this._resolutionMediaMatchList)==null||x.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.LinkProviderService=void 0;const h=c(844);class m extends h.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,h.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(y){return this.linkProviders.push(y),{dispose:()=>{const w=this.linkProviders.indexOf(y);w!==-1&&this.linkProviders.splice(w,1)}}}}a.LinkProviderService=m},8934:function(f,a,c){var h=this&&this.__decorate||function(k,x,b,S){var g,v=arguments.length,E=v<3?x:S===null?S=Object.getOwnPropertyDescriptor(x,b):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(k,x,b,S);else for(var L=k.length-1;L>=0;L--)(g=k[L])&&(E=(v<3?g(E):v>3?g(x,b,E):g(x,b))||E);return v>3&&E&&Object.defineProperty(x,b,E),E},m=this&&this.__param||function(k,x){return function(b,S){x(b,S,k)}};Object.defineProperty(a,"__esModule",{value:!0}),a.MouseService=void 0;const u=c(4725),y=c(9806);let w=a.MouseService=class{constructor(k,x){this._renderService=k,this._charSizeService=x}getCoords(k,x,b,S,g){return(0,y.getCoords)(window,k,x,b,S,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,g)}getMouseReportCoords(k,x){const b=(0,y.getCoordsRelativeToElement)(window,k,x);if(this._charSizeService.hasValidSize)return b[0]=Math.min(Math.max(b[0],0),this._renderService.dimensions.css.canvas.width-1),b[1]=Math.min(Math.max(b[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(b[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(b[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(b[0]),y:Math.floor(b[1])}}};a.MouseService=w=h([m(0,u.IRenderService),m(1,u.ICharSizeService)],w)},3230:function(f,a,c){var h=this&&this.__decorate||function(g,v,E,L){var R,T=arguments.length,A=T<3?v:L===null?L=Object.getOwnPropertyDescriptor(v,E):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(g,v,E,L);else for(var M=g.length-1;M>=0;M--)(R=g[M])&&(A=(T<3?R(A):T>3?R(v,E,A):R(v,E))||A);return T>3&&A&&Object.defineProperty(v,E,A),A},m=this&&this.__param||function(g,v){return function(E,L){v(E,L,g)}};Object.defineProperty(a,"__esModule",{value:!0}),a.RenderService=void 0;const u=c(6193),y=c(4725),w=c(8460),k=c(844),x=c(7226),b=c(2585);let S=a.RenderService=class extends k.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(g,v,E,L,R,T,A,M){super(),this._rowCount=g,this._charSizeService=L,this._renderer=this.register(new k.MutableDisposable),this._pausedResizeTask=new x.DebouncedIdleTask,this._observerDisposable=this.register(new k.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new w.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new w.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new w.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new w.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new u.RenderDebouncer(((j,I)=>this._renderRows(j,I)),A),this.register(this._renderDebouncer),this.register(A.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(T.onResize((()=>this._fullRefresh()))),this.register(T.buffers.onBufferActivate((()=>{var j;return(j=this._renderer.value)==null?void 0:j.clear()}))),this.register(E.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(R.onDecorationRegistered((()=>this._fullRefresh()))),this.register(R.onDecorationRemoved((()=>this._fullRefresh()))),this.register(E.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(T.cols,T.rows),this._fullRefresh()}))),this.register(E.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(T.buffer.y,T.buffer.y,!0)))),this.register(M.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(A.window,v),this.register(A.onWindowChange((j=>this._registerIntersectionObserver(j,v))))}_registerIntersectionObserver(g,v){if("IntersectionObserver"in g){const E=new g.IntersectionObserver((L=>this._handleIntersectionChange(L[L.length-1])),{threshold:0});E.observe(v),this._observerDisposable.value=(0,k.toDisposable)((()=>E.disconnect()))}}_handleIntersectionChange(g){this._isPaused=g.isIntersecting===void 0?g.intersectionRatio===0:!g.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(g,v,E=!1){this._isPaused?this._needsFullRefresh=!0:(E||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(g,v,this._rowCount))}_renderRows(g,v){this._renderer.value&&(g=Math.min(g,this._rowCount-1),v=Math.min(v,this._rowCount-1),this._renderer.value.renderRows(g,v),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:g,end:v}),this._onRender.fire({start:g,end:v}),this._isNextRenderRedrawOnly=!0)}resize(g,v){this._rowCount=v,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(g){this._renderer.value=g,this._renderer.value&&(this._renderer.value.onRequestRedraw((v=>this.refreshRows(v.start,v.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(g){return this._renderDebouncer.addRefreshCallback(g)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var g,v;this._renderer.value&&((v=(g=this._renderer.value).clearTextureAtlas)==null||v.call(g),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(g,v){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var E;return(E=this._renderer.value)==null?void 0:E.handleResize(g,v)})):this._renderer.value.handleResize(g,v),this._fullRefresh())}handleCharSizeChanged(){var g;(g=this._renderer.value)==null||g.handleCharSizeChanged()}handleBlur(){var g;(g=this._renderer.value)==null||g.handleBlur()}handleFocus(){var g;(g=this._renderer.value)==null||g.handleFocus()}handleSelectionChanged(g,v,E){var L;this._selectionState.start=g,this._selectionState.end=v,this._selectionState.columnSelectMode=E,(L=this._renderer.value)==null||L.handleSelectionChanged(g,v,E)}handleCursorMove(){var g;(g=this._renderer.value)==null||g.handleCursorMove()}clear(){var g;(g=this._renderer.value)==null||g.clear()}};a.RenderService=S=h([m(2,b.IOptionsService),m(3,y.ICharSizeService),m(4,b.IDecorationService),m(5,b.IBufferService),m(6,y.ICoreBrowserService),m(7,y.IThemeService)],S)},9312:function(f,a,c){var h=this&&this.__decorate||function(A,M,j,I){var U,F=arguments.length,K=F<3?M:I===null?I=Object.getOwnPropertyDescriptor(M,j):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")K=Reflect.decorate(A,M,j,I);else for(var W=A.length-1;W>=0;W--)(U=A[W])&&(K=(F<3?U(K):F>3?U(M,j,K):U(M,j))||K);return F>3&&K&&Object.defineProperty(M,j,K),K},m=this&&this.__param||function(A,M){return function(j,I){M(j,I,A)}};Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionService=void 0;const u=c(9806),y=c(9504),w=c(456),k=c(4725),x=c(8460),b=c(844),S=c(6114),g=c(4841),v=c(511),E=c(2585),L=" ",R=new RegExp(L,"g");let T=a.SelectionService=class extends b.Disposable{constructor(A,M,j,I,U,F,K,W,V){super(),this._element=A,this._screenElement=M,this._linkifier=j,this._bufferService=I,this._coreService=U,this._mouseService=F,this._optionsService=K,this._renderService=W,this._coreBrowserService=V,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new v.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new x.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new x.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new x.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new x.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=$=>this._handleMouseMove($),this._mouseUpListener=$=>this._handleMouseUp($),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim(($=>this._handleTrim($))),this.register(this._bufferService.buffers.onBufferActivate(($=>this._handleBufferActivate($)))),this.enable(),this._model=new w.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,b.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const A=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!(!A||!M||A[0]===M[0]&&A[1]===M[1])}get selectionText(){const A=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;if(!A||!M)return"";const j=this._bufferService.buffer,I=[];if(this._activeSelectionMode===3){if(A[0]===M[0])return"";const U=A[0]<M[0]?A[0]:M[0],F=A[0]<M[0]?M[0]:A[0];for(let K=A[1];K<=M[1];K++){const W=j.translateBufferLineToString(K,!0,U,F);I.push(W)}}else{const U=A[1]===M[1]?M[0]:void 0;I.push(j.translateBufferLineToString(A[1],!0,A[0],U));for(let F=A[1]+1;F<=M[1]-1;F++){const K=j.lines.get(F),W=j.translateBufferLineToString(F,!0);K!=null&&K.isWrapped?I[I.length-1]+=W:I.push(W)}if(A[1]!==M[1]){const F=j.lines.get(M[1]),K=j.translateBufferLineToString(M[1],!0,0,M[0]);F&&F.isWrapped?I[I.length-1]+=K:I.push(K)}}return I.map((U=>U.replace(R," "))).join(S.isWindows?`\r
56
+ `:`
57
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(A){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),S.isLinux&&A&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(A){const M=this._getMouseBufferCoords(A),j=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;return!!(j&&I&&M)&&this._areCoordsInSelection(M,j,I)}isCellInSelection(A,M){const j=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;return!(!j||!I)&&this._areCoordsInSelection([A,M],j,I)}_areCoordsInSelection(A,M,j){return A[1]>M[1]&&A[1]<j[1]||M[1]===j[1]&&A[1]===M[1]&&A[0]>=M[0]&&A[0]<j[0]||M[1]<j[1]&&A[1]===j[1]&&A[0]<j[0]||M[1]<j[1]&&A[1]===M[1]&&A[0]>=M[0]}_selectWordAtCursor(A,M){var U,F;const j=(F=(U=this._linkifier.currentLink)==null?void 0:U.link)==null?void 0:F.range;if(j)return this._model.selectionStart=[j.start.x-1,j.start.y-1],this._model.selectionStartLength=(0,g.getRangeLength)(j,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const I=this._getMouseBufferCoords(A);return!!I&&(this._selectWordAt(I,M),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(A,M){this._model.clearSelection(),A=Math.max(A,0),M=Math.min(M,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,A],this._model.selectionEnd=[this._bufferService.cols,M],this.refresh(),this._onSelectionChange.fire()}_handleTrim(A){this._model.handleTrim(A)&&this.refresh()}_getMouseBufferCoords(A){const M=this._mouseService.getCoords(A,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(M)return M[0]--,M[1]--,M[1]+=this._bufferService.buffer.ydisp,M}_getMouseEventScrollAmount(A){let M=(0,u.getCoordsRelativeToElement)(this._coreBrowserService.window,A,this._screenElement)[1];const j=this._renderService.dimensions.css.canvas.height;return M>=0&&M<=j?0:(M>j&&(M-=j),M=Math.min(Math.max(M,-50),50),M/=50,M/Math.abs(M)+Math.round(14*M))}shouldForceSelection(A){return S.isMac?A.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:A.shiftKey}handleMouseDown(A){if(this._mouseDownTimeStamp=A.timeStamp,(A.button!==2||!this.hasSelection)&&A.button===0){if(!this._enabled){if(!this.shouldForceSelection(A))return;A.stopPropagation()}A.preventDefault(),this._dragScrollAmount=0,this._enabled&&A.shiftKey?this._handleIncrementalClick(A):A.detail===1?this._handleSingleClick(A):A.detail===2?this._handleDoubleClick(A):A.detail===3&&this._handleTripleClick(A),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(A){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(A))}_handleSingleClick(A){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(A)?3:0,this._model.selectionStart=this._getMouseBufferCoords(A),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const M=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);M&&M.length!==this._model.selectionStart[0]&&M.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(A){this._selectWordAtCursor(A,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(A){const M=this._getMouseBufferCoords(A);M&&(this._activeSelectionMode=2,this._selectLineAt(M[1]))}shouldColumnSelect(A){return A.altKey&&!(S.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(A){if(A.stopImmediatePropagation(),!this._model.selectionStart)return;const M=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(A),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(A),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const j=this._bufferService.buffer;if(this._model.selectionEnd[1]<j.lines.length){const I=j.lines.get(this._model.selectionEnd[1]);I&&I.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}M&&M[0]===this._model.selectionEnd[0]&&M[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const A=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(A.ydisp+this._bufferService.rows,A.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=A.ydisp),this.refresh()}}_handleMouseUp(A){const M=A.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&M<500&&A.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const j=this._mouseService.getCoords(A,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(j&&j[0]!==void 0&&j[1]!==void 0){const I=(0,y.moveToCellSequence)(j[0]-1,j[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(I,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const A=this._model.finalSelectionStart,M=this._model.finalSelectionEnd,j=!(!A||!M||A[0]===M[0]&&A[1]===M[1]);j?A&&M&&(this._oldSelectionStart&&this._oldSelectionEnd&&A[0]===this._oldSelectionStart[0]&&A[1]===this._oldSelectionStart[1]&&M[0]===this._oldSelectionEnd[0]&&M[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(A,M,j)):this._oldHasSelection&&this._fireOnSelectionChange(A,M,j)}_fireOnSelectionChange(A,M,j){this._oldSelectionStart=A,this._oldSelectionEnd=M,this._oldHasSelection=j,this._onSelectionChange.fire()}_handleBufferActivate(A){this.clearSelection(),this._trimListener.dispose(),this._trimListener=A.activeBuffer.lines.onTrim((M=>this._handleTrim(M)))}_convertViewportColToCharacterIndex(A,M){let j=M;for(let I=0;M>=I;I++){const U=A.loadCell(I,this._workCell).getChars().length;this._workCell.getWidth()===0?j--:U>1&&M!==I&&(j+=U-1)}return j}setSelection(A,M,j){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[A,M],this._model.selectionStartLength=j,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(A){this._isClickInSelection(A)||(this._selectWordAtCursor(A,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(A,M,j=!0,I=!0){if(A[0]>=this._bufferService.cols)return;const U=this._bufferService.buffer,F=U.lines.get(A[1]);if(!F)return;const K=U.translateBufferLineToString(A[1],!1);let W=this._convertViewportColToCharacterIndex(F,A[0]),V=W;const $=A[0]-W;let ee=0,N=0,B=0,z=0;if(K.charAt(W)===" "){for(;W>0&&K.charAt(W-1)===" ";)W--;for(;V<K.length&&K.charAt(V+1)===" ";)V++}else{let te=A[0],he=A[0];F.getWidth(te)===0&&(ee++,te--),F.getWidth(he)===2&&(N++,he++);const me=F.getString(he).length;for(me>1&&(z+=me-1,V+=me-1);te>0&&W>0&&!this._isCharWordSeparator(F.loadCell(te-1,this._workCell));){F.loadCell(te-1,this._workCell);const Y=this._workCell.getChars().length;this._workCell.getWidth()===0?(ee++,te--):Y>1&&(B+=Y-1,W-=Y-1),W--,te--}for(;he<F.length&&V+1<K.length&&!this._isCharWordSeparator(F.loadCell(he+1,this._workCell));){F.loadCell(he+1,this._workCell);const Y=this._workCell.getChars().length;this._workCell.getWidth()===2?(N++,he++):Y>1&&(z+=Y-1,V+=Y-1),V++,he++}}V++;let G=W+$-ee+B,H=Math.min(this._bufferService.cols,V-W+ee+N-B-z);if(M||K.slice(W,V).trim()!==""){if(j&&G===0&&F.getCodePoint(0)!==32){const te=U.lines.get(A[1]-1);if(te&&F.isWrapped&&te.getCodePoint(this._bufferService.cols-1)!==32){const he=this._getWordAt([this._bufferService.cols-1,A[1]-1],!1,!0,!1);if(he){const me=this._bufferService.cols-he.start;G-=me,H+=me}}}if(I&&G+H===this._bufferService.cols&&F.getCodePoint(this._bufferService.cols-1)!==32){const te=U.lines.get(A[1]+1);if(te!=null&&te.isWrapped&&te.getCodePoint(0)!==32){const he=this._getWordAt([0,A[1]+1],!1,!1,!0);he&&(H+=he.length)}}return{start:G,length:H}}}_selectWordAt(A,M){const j=this._getWordAt(A,M);if(j){for(;j.start<0;)j.start+=this._bufferService.cols,A[1]--;this._model.selectionStart=[j.start,A[1]],this._model.selectionStartLength=j.length}}_selectToWordAt(A){const M=this._getWordAt(A,!0);if(M){let j=A[1];for(;M.start<0;)M.start+=this._bufferService.cols,j--;if(!this._model.areSelectionValuesReversed())for(;M.start+M.length>this._bufferService.cols;)M.length-=this._bufferService.cols,j++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?M.start:M.start+M.length,j]}}_isCharWordSeparator(A){return A.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(A.getChars())>=0}_selectLineAt(A){const M=this._bufferService.buffer.getWrappedRangeForLine(A),j={start:{x:0,y:M.first},end:{x:this._bufferService.cols-1,y:M.last}};this._model.selectionStart=[0,M.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,g.getRangeLength)(j,this._bufferService.cols)}};a.SelectionService=T=h([m(3,E.IBufferService),m(4,E.ICoreService),m(5,k.IMouseService),m(6,E.IOptionsService),m(7,k.IRenderService),m(8,k.ICoreBrowserService)],T)},4725:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ILinkProviderService=a.IThemeService=a.ICharacterJoinerService=a.ISelectionService=a.IRenderService=a.IMouseService=a.ICoreBrowserService=a.ICharSizeService=void 0;const h=c(8343);a.ICharSizeService=(0,h.createDecorator)("CharSizeService"),a.ICoreBrowserService=(0,h.createDecorator)("CoreBrowserService"),a.IMouseService=(0,h.createDecorator)("MouseService"),a.IRenderService=(0,h.createDecorator)("RenderService"),a.ISelectionService=(0,h.createDecorator)("SelectionService"),a.ICharacterJoinerService=(0,h.createDecorator)("CharacterJoinerService"),a.IThemeService=(0,h.createDecorator)("ThemeService"),a.ILinkProviderService=(0,h.createDecorator)("LinkProviderService")},6731:function(f,a,c){var h=this&&this.__decorate||function(T,A,M,j){var I,U=arguments.length,F=U<3?A:j===null?j=Object.getOwnPropertyDescriptor(A,M):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(T,A,M,j);else for(var K=T.length-1;K>=0;K--)(I=T[K])&&(F=(U<3?I(F):U>3?I(A,M,F):I(A,M))||F);return U>3&&F&&Object.defineProperty(A,M,F),F},m=this&&this.__param||function(T,A){return function(M,j){A(M,j,T)}};Object.defineProperty(a,"__esModule",{value:!0}),a.ThemeService=a.DEFAULT_ANSI_COLORS=void 0;const u=c(7239),y=c(8055),w=c(8460),k=c(844),x=c(2585),b=y.css.toColor("#ffffff"),S=y.css.toColor("#000000"),g=y.css.toColor("#ffffff"),v=y.css.toColor("#000000"),E={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};a.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const T=[y.css.toColor("#2e3436"),y.css.toColor("#cc0000"),y.css.toColor("#4e9a06"),y.css.toColor("#c4a000"),y.css.toColor("#3465a4"),y.css.toColor("#75507b"),y.css.toColor("#06989a"),y.css.toColor("#d3d7cf"),y.css.toColor("#555753"),y.css.toColor("#ef2929"),y.css.toColor("#8ae234"),y.css.toColor("#fce94f"),y.css.toColor("#729fcf"),y.css.toColor("#ad7fa8"),y.css.toColor("#34e2e2"),y.css.toColor("#eeeeec")],A=[0,95,135,175,215,255];for(let M=0;M<216;M++){const j=A[M/36%6|0],I=A[M/6%6|0],U=A[M%6];T.push({css:y.channels.toCss(j,I,U),rgba:y.channels.toRgba(j,I,U)})}for(let M=0;M<24;M++){const j=8+10*M;T.push({css:y.channels.toCss(j,j,j),rgba:y.channels.toRgba(j,j,j)})}return T})());let L=a.ThemeService=class extends k.Disposable{get colors(){return this._colors}constructor(T){super(),this._optionsService=T,this._contrastCache=new u.ColorContrastCache,this._halfContrastCache=new u.ColorContrastCache,this._onChangeColors=this.register(new w.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:b,background:S,cursor:g,cursorAccent:v,selectionForeground:void 0,selectionBackgroundTransparent:E,selectionBackgroundOpaque:y.color.blend(S,E),selectionInactiveBackgroundTransparent:E,selectionInactiveBackgroundOpaque:y.color.blend(S,E),ansi:a.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(T={}){const A=this._colors;if(A.foreground=R(T.foreground,b),A.background=R(T.background,S),A.cursor=R(T.cursor,g),A.cursorAccent=R(T.cursorAccent,v),A.selectionBackgroundTransparent=R(T.selectionBackground,E),A.selectionBackgroundOpaque=y.color.blend(A.background,A.selectionBackgroundTransparent),A.selectionInactiveBackgroundTransparent=R(T.selectionInactiveBackground,A.selectionBackgroundTransparent),A.selectionInactiveBackgroundOpaque=y.color.blend(A.background,A.selectionInactiveBackgroundTransparent),A.selectionForeground=T.selectionForeground?R(T.selectionForeground,y.NULL_COLOR):void 0,A.selectionForeground===y.NULL_COLOR&&(A.selectionForeground=void 0),y.color.isOpaque(A.selectionBackgroundTransparent)&&(A.selectionBackgroundTransparent=y.color.opacity(A.selectionBackgroundTransparent,.3)),y.color.isOpaque(A.selectionInactiveBackgroundTransparent)&&(A.selectionInactiveBackgroundTransparent=y.color.opacity(A.selectionInactiveBackgroundTransparent,.3)),A.ansi=a.DEFAULT_ANSI_COLORS.slice(),A.ansi[0]=R(T.black,a.DEFAULT_ANSI_COLORS[0]),A.ansi[1]=R(T.red,a.DEFAULT_ANSI_COLORS[1]),A.ansi[2]=R(T.green,a.DEFAULT_ANSI_COLORS[2]),A.ansi[3]=R(T.yellow,a.DEFAULT_ANSI_COLORS[3]),A.ansi[4]=R(T.blue,a.DEFAULT_ANSI_COLORS[4]),A.ansi[5]=R(T.magenta,a.DEFAULT_ANSI_COLORS[5]),A.ansi[6]=R(T.cyan,a.DEFAULT_ANSI_COLORS[6]),A.ansi[7]=R(T.white,a.DEFAULT_ANSI_COLORS[7]),A.ansi[8]=R(T.brightBlack,a.DEFAULT_ANSI_COLORS[8]),A.ansi[9]=R(T.brightRed,a.DEFAULT_ANSI_COLORS[9]),A.ansi[10]=R(T.brightGreen,a.DEFAULT_ANSI_COLORS[10]),A.ansi[11]=R(T.brightYellow,a.DEFAULT_ANSI_COLORS[11]),A.ansi[12]=R(T.brightBlue,a.DEFAULT_ANSI_COLORS[12]),A.ansi[13]=R(T.brightMagenta,a.DEFAULT_ANSI_COLORS[13]),A.ansi[14]=R(T.brightCyan,a.DEFAULT_ANSI_COLORS[14]),A.ansi[15]=R(T.brightWhite,a.DEFAULT_ANSI_COLORS[15]),T.extendedAnsi){const M=Math.min(A.ansi.length-16,T.extendedAnsi.length);for(let j=0;j<M;j++)A.ansi[j+16]=R(T.extendedAnsi[j],a.DEFAULT_ANSI_COLORS[j+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(T){this._restoreColor(T),this._onChangeColors.fire(this.colors)}_restoreColor(T){if(T!==void 0)switch(T){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[T]=this._restoreColors.ansi[T]}else for(let A=0;A<this._restoreColors.ansi.length;++A)this._colors.ansi[A]=this._restoreColors.ansi[A]}modifyColors(T){T(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function R(T,A){if(T!==void 0)try{return y.css.toColor(T)}catch{}return A}a.ThemeService=L=h([m(0,x.IOptionsService)],L)},6349:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CircularList=void 0;const h=c(8460),m=c(844);class u extends m.Disposable{constructor(w){super(),this._maxLength=w,this.onDeleteEmitter=this.register(new h.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new h.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new h.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(w){if(this._maxLength===w)return;const k=new Array(w);for(let x=0;x<Math.min(w,this.length);x++)k[x]=this._array[this._getCyclicIndex(x)];this._array=k,this._maxLength=w,this._startIndex=0}get length(){return this._length}set length(w){if(w>this._length)for(let k=this._length;k<w;k++)this._array[k]=void 0;this._length=w}get(w){return this._array[this._getCyclicIndex(w)]}set(w,k){this._array[this._getCyclicIndex(w)]=k}push(w){this._array[this._getCyclicIndex(this._length)]=w,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(w,k,...x){if(k){for(let b=w;b<this._length-k;b++)this._array[this._getCyclicIndex(b)]=this._array[this._getCyclicIndex(b+k)];this._length-=k,this.onDeleteEmitter.fire({index:w,amount:k})}for(let b=this._length-1;b>=w;b--)this._array[this._getCyclicIndex(b+x.length)]=this._array[this._getCyclicIndex(b)];for(let b=0;b<x.length;b++)this._array[this._getCyclicIndex(w+b)]=x[b];if(x.length&&this.onInsertEmitter.fire({index:w,amount:x.length}),this._length+x.length>this._maxLength){const b=this._length+x.length-this._maxLength;this._startIndex+=b,this._length=this._maxLength,this.onTrimEmitter.fire(b)}else this._length+=x.length}trimStart(w){w>this._length&&(w=this._length),this._startIndex+=w,this._length-=w,this.onTrimEmitter.fire(w)}shiftElements(w,k,x){if(!(k<=0)){if(w<0||w>=this._length)throw new Error("start argument out of range");if(w+x<0)throw new Error("Cannot shift elements in list beyond index 0");if(x>0){for(let S=k-1;S>=0;S--)this.set(w+S+x,this.get(w+S));const b=w+k+x-this._length;if(b>0)for(this._length+=b;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let b=0;b<k;b++)this.set(w+b+x,this.get(w+b))}}_getCyclicIndex(w){return(this._startIndex+w)%this._maxLength}}a.CircularList=u},1439:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.clone=void 0,a.clone=function c(h,m=5){if(typeof h!="object")return h;const u=Array.isArray(h)?[]:{};for(const y in h)u[y]=m<=1?h[y]:h[y]&&c(h[y],m-1);return u}},8055:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.contrastRatio=a.toPaddedHex=a.rgba=a.rgb=a.css=a.color=a.channels=a.NULL_COLOR=void 0;let c=0,h=0,m=0,u=0;var y,w,k,x,b;function S(v){const E=v.toString(16);return E.length<2?"0"+E:E}function g(v,E){return v<E?(E+.05)/(v+.05):(v+.05)/(E+.05)}a.NULL_COLOR={css:"#00000000",rgba:0},(function(v){v.toCss=function(E,L,R,T){return T!==void 0?`#${S(E)}${S(L)}${S(R)}${S(T)}`:`#${S(E)}${S(L)}${S(R)}`},v.toRgba=function(E,L,R,T=255){return(E<<24|L<<16|R<<8|T)>>>0},v.toColor=function(E,L,R,T){return{css:v.toCss(E,L,R,T),rgba:v.toRgba(E,L,R,T)}}})(y||(a.channels=y={})),(function(v){function E(L,R){return u=Math.round(255*R),[c,h,m]=b.toChannels(L.rgba),{css:y.toCss(c,h,m,u),rgba:y.toRgba(c,h,m,u)}}v.blend=function(L,R){if(u=(255&R.rgba)/255,u===1)return{css:R.css,rgba:R.rgba};const T=R.rgba>>24&255,A=R.rgba>>16&255,M=R.rgba>>8&255,j=L.rgba>>24&255,I=L.rgba>>16&255,U=L.rgba>>8&255;return c=j+Math.round((T-j)*u),h=I+Math.round((A-I)*u),m=U+Math.round((M-U)*u),{css:y.toCss(c,h,m),rgba:y.toRgba(c,h,m)}},v.isOpaque=function(L){return(255&L.rgba)==255},v.ensureContrastRatio=function(L,R,T){const A=b.ensureContrastRatio(L.rgba,R.rgba,T);if(A)return y.toColor(A>>24&255,A>>16&255,A>>8&255)},v.opaque=function(L){const R=(255|L.rgba)>>>0;return[c,h,m]=b.toChannels(R),{css:y.toCss(c,h,m),rgba:R}},v.opacity=E,v.multiplyOpacity=function(L,R){return u=255&L.rgba,E(L,u*R/255)},v.toColorRGB=function(L){return[L.rgba>>24&255,L.rgba>>16&255,L.rgba>>8&255]}})(w||(a.color=w={})),(function(v){let E,L;try{const R=document.createElement("canvas");R.width=1,R.height=1;const T=R.getContext("2d",{willReadFrequently:!0});T&&(E=T,E.globalCompositeOperation="copy",L=E.createLinearGradient(0,0,1,1))}catch{}v.toColor=function(R){if(R.match(/#[\da-f]{3,8}/i))switch(R.length){case 4:return c=parseInt(R.slice(1,2).repeat(2),16),h=parseInt(R.slice(2,3).repeat(2),16),m=parseInt(R.slice(3,4).repeat(2),16),y.toColor(c,h,m);case 5:return c=parseInt(R.slice(1,2).repeat(2),16),h=parseInt(R.slice(2,3).repeat(2),16),m=parseInt(R.slice(3,4).repeat(2),16),u=parseInt(R.slice(4,5).repeat(2),16),y.toColor(c,h,m,u);case 7:return{css:R,rgba:(parseInt(R.slice(1),16)<<8|255)>>>0};case 9:return{css:R,rgba:parseInt(R.slice(1),16)>>>0}}const T=R.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(T)return c=parseInt(T[1]),h=parseInt(T[2]),m=parseInt(T[3]),u=Math.round(255*(T[5]===void 0?1:parseFloat(T[5]))),y.toColor(c,h,m,u);if(!E||!L)throw new Error("css.toColor: Unsupported css format");if(E.fillStyle=L,E.fillStyle=R,typeof E.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(E.fillRect(0,0,1,1),[c,h,m,u]=E.getImageData(0,0,1,1).data,u!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:y.toRgba(c,h,m,u),css:R}}})(k||(a.css=k={})),(function(v){function E(L,R,T){const A=L/255,M=R/255,j=T/255;return .2126*(A<=.03928?A/12.92:Math.pow((A+.055)/1.055,2.4))+.7152*(M<=.03928?M/12.92:Math.pow((M+.055)/1.055,2.4))+.0722*(j<=.03928?j/12.92:Math.pow((j+.055)/1.055,2.4))}v.relativeLuminance=function(L){return E(L>>16&255,L>>8&255,255&L)},v.relativeLuminance2=E})(x||(a.rgb=x={})),(function(v){function E(R,T,A){const M=R>>24&255,j=R>>16&255,I=R>>8&255;let U=T>>24&255,F=T>>16&255,K=T>>8&255,W=g(x.relativeLuminance2(U,F,K),x.relativeLuminance2(M,j,I));for(;W<A&&(U>0||F>0||K>0);)U-=Math.max(0,Math.ceil(.1*U)),F-=Math.max(0,Math.ceil(.1*F)),K-=Math.max(0,Math.ceil(.1*K)),W=g(x.relativeLuminance2(U,F,K),x.relativeLuminance2(M,j,I));return(U<<24|F<<16|K<<8|255)>>>0}function L(R,T,A){const M=R>>24&255,j=R>>16&255,I=R>>8&255;let U=T>>24&255,F=T>>16&255,K=T>>8&255,W=g(x.relativeLuminance2(U,F,K),x.relativeLuminance2(M,j,I));for(;W<A&&(U<255||F<255||K<255);)U=Math.min(255,U+Math.ceil(.1*(255-U))),F=Math.min(255,F+Math.ceil(.1*(255-F))),K=Math.min(255,K+Math.ceil(.1*(255-K))),W=g(x.relativeLuminance2(U,F,K),x.relativeLuminance2(M,j,I));return(U<<24|F<<16|K<<8|255)>>>0}v.blend=function(R,T){if(u=(255&T)/255,u===1)return T;const A=T>>24&255,M=T>>16&255,j=T>>8&255,I=R>>24&255,U=R>>16&255,F=R>>8&255;return c=I+Math.round((A-I)*u),h=U+Math.round((M-U)*u),m=F+Math.round((j-F)*u),y.toRgba(c,h,m)},v.ensureContrastRatio=function(R,T,A){const M=x.relativeLuminance(R>>8),j=x.relativeLuminance(T>>8);if(g(M,j)<A){if(j<M){const F=E(R,T,A),K=g(M,x.relativeLuminance(F>>8));if(K<A){const W=L(R,T,A);return K>g(M,x.relativeLuminance(W>>8))?F:W}return F}const I=L(R,T,A),U=g(M,x.relativeLuminance(I>>8));if(U<A){const F=E(R,T,A);return U>g(M,x.relativeLuminance(F>>8))?I:F}return I}},v.reduceLuminance=E,v.increaseLuminance=L,v.toChannels=function(R){return[R>>24&255,R>>16&255,R>>8&255,255&R]}})(b||(a.rgba=b={})),a.toPaddedHex=S,a.contrastRatio=g},8969:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreTerminal=void 0;const h=c(844),m=c(2585),u=c(4348),y=c(7866),w=c(744),k=c(7302),x=c(6975),b=c(8460),S=c(1753),g=c(1480),v=c(7994),E=c(9282),L=c(5435),R=c(5981),T=c(2660);let A=!1;class M extends h.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new b.EventEmitter),this._onScroll.event((I=>{var U;(U=this._onScrollApi)==null||U.fire(I.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(I){for(const U in I)this.optionsService.options[U]=I[U]}constructor(I){super(),this._windowsWrappingHeuristics=this.register(new h.MutableDisposable),this._onBinary=this.register(new b.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new b.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new b.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new b.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new b.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new b.EventEmitter),this._instantiationService=new u.InstantiationService,this.optionsService=this.register(new k.OptionsService(I)),this._instantiationService.setService(m.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(w.BufferService)),this._instantiationService.setService(m.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(y.LogService)),this._instantiationService.setService(m.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(x.CoreService)),this._instantiationService.setService(m.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(S.CoreMouseService)),this._instantiationService.setService(m.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(g.UnicodeService)),this._instantiationService.setService(m.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(v.CharsetService),this._instantiationService.setService(m.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(T.OscLinkService),this._instantiationService.setService(m.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new L.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,b.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,b.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,b.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,b.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((U=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((U=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new R.WriteBuffer(((U,F)=>this._inputHandler.parse(U,F)))),this.register((0,b.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(I,U){this._writeBuffer.write(I,U)}writeSync(I,U){this._logService.logLevel<=m.LogLevelEnum.WARN&&!A&&(this._logService.warn("writeSync is unreliable and will be removed soon."),A=!0),this._writeBuffer.writeSync(I,U)}input(I,U=!0){this.coreService.triggerDataEvent(I,U)}resize(I,U){isNaN(I)||isNaN(U)||(I=Math.max(I,w.MINIMUM_COLS),U=Math.max(U,w.MINIMUM_ROWS),this._bufferService.resize(I,U))}scroll(I,U=!1){this._bufferService.scroll(I,U)}scrollLines(I,U,F){this._bufferService.scrollLines(I,U,F)}scrollPages(I){this.scrollLines(I*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(I){const U=I-this._bufferService.buffer.ydisp;U!==0&&this.scrollLines(U)}registerEscHandler(I,U){return this._inputHandler.registerEscHandler(I,U)}registerDcsHandler(I,U){return this._inputHandler.registerDcsHandler(I,U)}registerCsiHandler(I,U){return this._inputHandler.registerCsiHandler(I,U)}registerOscHandler(I,U){return this._inputHandler.registerOscHandler(I,U)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let I=!1;const U=this.optionsService.rawOptions.windowsPty;U&&U.buildNumber!==void 0&&U.buildNumber!==void 0?I=U.backend==="conpty"&&U.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(I=!0),I?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const I=[];I.push(this.onLineFeed(E.updateWindowsModeWrappedState.bind(null,this._bufferService))),I.push(this.registerCsiHandler({final:"H"},(()=>((0,E.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,h.toDisposable)((()=>{for(const U of I)U.dispose()}))}}}a.CoreTerminal=M},8460:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.runAndSubscribe=a.forwardEvent=a.EventEmitter=void 0,a.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let h=0;h<this._listeners.length;h++)if(this._listeners[h]===c)return void this._listeners.splice(h,1)}}})),this._event}fire(c,h){const m=[];for(let u=0;u<this._listeners.length;u++)m.push(this._listeners[u]);for(let u=0;u<m.length;u++)m[u].call(void 0,c,h)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},a.forwardEvent=function(c,h){return c((m=>h.fire(m)))},a.runAndSubscribe=function(c,h){return h(void 0),c((m=>h(m)))}},5435:function(f,a,c){var h=this&&this.__decorate||function(ee,N,B,z){var G,H=arguments.length,te=H<3?N:z===null?z=Object.getOwnPropertyDescriptor(N,B):z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")te=Reflect.decorate(ee,N,B,z);else for(var he=ee.length-1;he>=0;he--)(G=ee[he])&&(te=(H<3?G(te):H>3?G(N,B,te):G(N,B))||te);return H>3&&te&&Object.defineProperty(N,B,te),te},m=this&&this.__param||function(ee,N){return function(B,z){N(B,z,ee)}};Object.defineProperty(a,"__esModule",{value:!0}),a.InputHandler=a.WindowsOptionsReportType=void 0;const u=c(2584),y=c(7116),w=c(2015),k=c(844),x=c(482),b=c(8437),S=c(8460),g=c(643),v=c(511),E=c(3734),L=c(2585),R=c(1480),T=c(6242),A=c(6351),M=c(5941),j={"(":0,")":1,"*":2,"+":3,"-":1,".":2},I=131072;function U(ee,N){if(ee>24)return N.setWinLines||!1;switch(ee){case 1:return!!N.restoreWin;case 2:return!!N.minimizeWin;case 3:return!!N.setWinPosition;case 4:return!!N.setWinSizePixels;case 5:return!!N.raiseWin;case 6:return!!N.lowerWin;case 7:return!!N.refreshWin;case 8:return!!N.setWinSizeChars;case 9:return!!N.maximizeWin;case 10:return!!N.fullscreenWin;case 11:return!!N.getWinState;case 13:return!!N.getWinPosition;case 14:return!!N.getWinSizePixels;case 15:return!!N.getScreenSizePixels;case 16:return!!N.getCellSizePixels;case 18:return!!N.getWinSizeChars;case 19:return!!N.getScreenSizeChars;case 20:return!!N.getIconTitle;case 21:return!!N.getWinTitle;case 22:return!!N.pushTitle;case 23:return!!N.popTitle;case 24:return!!N.setWinLines}return!1}var F;(function(ee){ee[ee.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",ee[ee.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(F||(a.WindowsOptionsReportType=F={}));let K=0;class W extends k.Disposable{getAttrData(){return this._curAttrData}constructor(N,B,z,G,H,te,he,me,Y=new w.EscapeSequenceParser){super(),this._bufferService=N,this._charsetService=B,this._coreService=z,this._logService=G,this._optionsService=H,this._oscLinkService=te,this._coreMouseService=he,this._unicodeService=me,this._parser=Y,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new x.StringToUtf32,this._utf8Decoder=new x.Utf8ToUtf32,this._workCell=new v.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=b.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=b.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new S.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new S.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new S.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new S.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new S.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new S.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new S.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new S.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new S.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new S.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new S.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new S.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new S.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new V(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((q=>this._activeBuffer=q.activeBuffer))),this._parser.setCsiHandlerFallback(((q,oe)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(q),params:oe.toArray()})})),this._parser.setEscHandlerFallback((q=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(q)})})),this._parser.setExecuteHandlerFallback((q=>{this._logService.debug("Unknown EXECUTE code: ",{code:q})})),this._parser.setOscHandlerFallback(((q,oe,J)=>{this._logService.debug("Unknown OSC code: ",{identifier:q,action:oe,data:J})})),this._parser.setDcsHandlerFallback(((q,oe,J)=>{oe==="HOOK"&&(J=J.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(q),action:oe,payload:J})})),this._parser.setPrintHandler(((q,oe,J)=>this.print(q,oe,J))),this._parser.registerCsiHandler({final:"@"},(q=>this.insertChars(q))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(q=>this.scrollLeft(q))),this._parser.registerCsiHandler({final:"A"},(q=>this.cursorUp(q))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(q=>this.scrollRight(q))),this._parser.registerCsiHandler({final:"B"},(q=>this.cursorDown(q))),this._parser.registerCsiHandler({final:"C"},(q=>this.cursorForward(q))),this._parser.registerCsiHandler({final:"D"},(q=>this.cursorBackward(q))),this._parser.registerCsiHandler({final:"E"},(q=>this.cursorNextLine(q))),this._parser.registerCsiHandler({final:"F"},(q=>this.cursorPrecedingLine(q))),this._parser.registerCsiHandler({final:"G"},(q=>this.cursorCharAbsolute(q))),this._parser.registerCsiHandler({final:"H"},(q=>this.cursorPosition(q))),this._parser.registerCsiHandler({final:"I"},(q=>this.cursorForwardTab(q))),this._parser.registerCsiHandler({final:"J"},(q=>this.eraseInDisplay(q,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(q=>this.eraseInDisplay(q,!0))),this._parser.registerCsiHandler({final:"K"},(q=>this.eraseInLine(q,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(q=>this.eraseInLine(q,!0))),this._parser.registerCsiHandler({final:"L"},(q=>this.insertLines(q))),this._parser.registerCsiHandler({final:"M"},(q=>this.deleteLines(q))),this._parser.registerCsiHandler({final:"P"},(q=>this.deleteChars(q))),this._parser.registerCsiHandler({final:"S"},(q=>this.scrollUp(q))),this._parser.registerCsiHandler({final:"T"},(q=>this.scrollDown(q))),this._parser.registerCsiHandler({final:"X"},(q=>this.eraseChars(q))),this._parser.registerCsiHandler({final:"Z"},(q=>this.cursorBackwardTab(q))),this._parser.registerCsiHandler({final:"`"},(q=>this.charPosAbsolute(q))),this._parser.registerCsiHandler({final:"a"},(q=>this.hPositionRelative(q))),this._parser.registerCsiHandler({final:"b"},(q=>this.repeatPrecedingCharacter(q))),this._parser.registerCsiHandler({final:"c"},(q=>this.sendDeviceAttributesPrimary(q))),this._parser.registerCsiHandler({prefix:">",final:"c"},(q=>this.sendDeviceAttributesSecondary(q))),this._parser.registerCsiHandler({final:"d"},(q=>this.linePosAbsolute(q))),this._parser.registerCsiHandler({final:"e"},(q=>this.vPositionRelative(q))),this._parser.registerCsiHandler({final:"f"},(q=>this.hVPosition(q))),this._parser.registerCsiHandler({final:"g"},(q=>this.tabClear(q))),this._parser.registerCsiHandler({final:"h"},(q=>this.setMode(q))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(q=>this.setModePrivate(q))),this._parser.registerCsiHandler({final:"l"},(q=>this.resetMode(q))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(q=>this.resetModePrivate(q))),this._parser.registerCsiHandler({final:"m"},(q=>this.charAttributes(q))),this._parser.registerCsiHandler({final:"n"},(q=>this.deviceStatus(q))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(q=>this.deviceStatusPrivate(q))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(q=>this.softReset(q))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(q=>this.setCursorStyle(q))),this._parser.registerCsiHandler({final:"r"},(q=>this.setScrollRegion(q))),this._parser.registerCsiHandler({final:"s"},(q=>this.saveCursor(q))),this._parser.registerCsiHandler({final:"t"},(q=>this.windowOptions(q))),this._parser.registerCsiHandler({final:"u"},(q=>this.restoreCursor(q))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(q=>this.insertColumns(q))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(q=>this.deleteColumns(q))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(q=>this.selectProtected(q))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(q=>this.requestMode(q,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(q=>this.requestMode(q,!1))),this._parser.setExecuteHandler(u.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(u.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(u.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(u.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(u.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(u.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(u.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(u.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(u.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(u.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(u.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(u.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new T.OscHandler((q=>(this.setTitle(q),this.setIconName(q),!0)))),this._parser.registerOscHandler(1,new T.OscHandler((q=>this.setIconName(q)))),this._parser.registerOscHandler(2,new T.OscHandler((q=>this.setTitle(q)))),this._parser.registerOscHandler(4,new T.OscHandler((q=>this.setOrReportIndexedColor(q)))),this._parser.registerOscHandler(8,new T.OscHandler((q=>this.setHyperlink(q)))),this._parser.registerOscHandler(10,new T.OscHandler((q=>this.setOrReportFgColor(q)))),this._parser.registerOscHandler(11,new T.OscHandler((q=>this.setOrReportBgColor(q)))),this._parser.registerOscHandler(12,new T.OscHandler((q=>this.setOrReportCursorColor(q)))),this._parser.registerOscHandler(104,new T.OscHandler((q=>this.restoreIndexedColor(q)))),this._parser.registerOscHandler(110,new T.OscHandler((q=>this.restoreFgColor(q)))),this._parser.registerOscHandler(111,new T.OscHandler((q=>this.restoreBgColor(q)))),this._parser.registerOscHandler(112,new T.OscHandler((q=>this.restoreCursorColor(q)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const q in y.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:q},(()=>this.selectCharset("("+q))),this._parser.registerEscHandler({intermediates:")",final:q},(()=>this.selectCharset(")"+q))),this._parser.registerEscHandler({intermediates:"*",final:q},(()=>this.selectCharset("*"+q))),this._parser.registerEscHandler({intermediates:"+",final:q},(()=>this.selectCharset("+"+q))),this._parser.registerEscHandler({intermediates:"-",final:q},(()=>this.selectCharset("-"+q))),this._parser.registerEscHandler({intermediates:".",final:q},(()=>this.selectCharset("."+q))),this._parser.registerEscHandler({intermediates:"/",final:q},(()=>this.selectCharset("/"+q)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((q=>(this._logService.error("Parsing error: ",q),q))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new A.DcsHandler(((q,oe)=>this.requestStatusString(q,oe))))}_preserveStack(N,B,z,G){this._parseStack.paused=!0,this._parseStack.cursorStartX=N,this._parseStack.cursorStartY=B,this._parseStack.decodedLength=z,this._parseStack.position=G}_logSlowResolvingAsync(N){this._logService.logLevel<=L.LogLevelEnum.WARN&&Promise.race([N,new Promise(((B,z)=>setTimeout((()=>z("#SLOW_TIMEOUT")),5e3)))]).catch((B=>{if(B!=="#SLOW_TIMEOUT")throw B;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(N,B){let z,G=this._activeBuffer.x,H=this._activeBuffer.y,te=0;const he=this._parseStack.paused;if(he){if(z=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,B))return this._logSlowResolvingAsync(z),z;G=this._parseStack.cursorStartX,H=this._parseStack.cursorStartY,this._parseStack.paused=!1,N.length>I&&(te=this._parseStack.position+I)}if(this._logService.logLevel<=L.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof N=="string"?` "${N}"`:` "${Array.prototype.map.call(N,(q=>String.fromCharCode(q))).join("")}"`),typeof N=="string"?N.split("").map((q=>q.charCodeAt(0))):N),this._parseBuffer.length<N.length&&this._parseBuffer.length<I&&(this._parseBuffer=new Uint32Array(Math.min(N.length,I))),he||this._dirtyRowTracker.clearRange(),N.length>I)for(let q=te;q<N.length;q+=I){const oe=q+I<N.length?q+I:N.length,J=typeof N=="string"?this._stringDecoder.decode(N.substring(q,oe),this._parseBuffer):this._utf8Decoder.decode(N.subarray(q,oe),this._parseBuffer);if(z=this._parser.parse(this._parseBuffer,J))return this._preserveStack(G,H,J,q),this._logSlowResolvingAsync(z),z}else if(!he){const q=typeof N=="string"?this._stringDecoder.decode(N,this._parseBuffer):this._utf8Decoder.decode(N,this._parseBuffer);if(z=this._parser.parse(this._parseBuffer,q))return this._preserveStack(G,H,q,0),this._logSlowResolvingAsync(z),z}this._activeBuffer.x===G&&this._activeBuffer.y===H||this._onCursorMove.fire();const me=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),Y=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);Y<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(Y,this._bufferService.rows-1),Math.min(me,this._bufferService.rows-1))}print(N,B,z){let G,H;const te=this._charsetService.charset,he=this._optionsService.rawOptions.screenReaderMode,me=this._bufferService.cols,Y=this._coreService.decPrivateModes.wraparound,q=this._coreService.modes.insertMode,oe=this._curAttrData;let J=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&z-B>0&&J.getWidth(this._activeBuffer.x-1)===2&&J.setCellFromCodepoint(this._activeBuffer.x-1,0,1,oe);let ie=this._parser.precedingJoinState;for(let de=B;de<z;++de){if(G=N[de],G<127&&te){const it=te[String.fromCharCode(G)];it&&(G=it.charCodeAt(0))}const Ce=this._unicodeService.charProperties(G,ie);H=R.UnicodeService.extractWidth(Ce);const xe=R.UnicodeService.extractShouldJoin(Ce),Ke=xe?R.UnicodeService.extractWidth(ie):0;if(ie=Ce,he&&this._onA11yChar.fire((0,x.stringFromCodePoint)(G)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+H-Ke>me){if(Y){const it=J;let Re=this._activeBuffer.x-Ke;for(this._activeBuffer.x=Ke,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),J=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Ke>0&&J instanceof b.BufferLine&&J.copyCellsFrom(it,Re,0,Ke,!1);Re<me;)it.setCellFromCodepoint(Re++,0,1,oe)}else if(this._activeBuffer.x=me-1,H===2)continue}if(xe&&this._activeBuffer.x){const it=J.getWidth(this._activeBuffer.x-1)?1:2;J.addCodepointToCell(this._activeBuffer.x-it,G,H);for(let Re=H-Ke;--Re>=0;)J.setCellFromCodepoint(this._activeBuffer.x++,0,0,oe)}else if(q&&(J.insertCells(this._activeBuffer.x,H-Ke,this._activeBuffer.getNullCell(oe)),J.getWidth(me-1)===2&&J.setCellFromCodepoint(me-1,g.NULL_CELL_CODE,g.NULL_CELL_WIDTH,oe)),J.setCellFromCodepoint(this._activeBuffer.x++,G,H,oe),H>0)for(;--H;)J.setCellFromCodepoint(this._activeBuffer.x++,0,0,oe)}this._parser.precedingJoinState=ie,this._activeBuffer.x<me&&z-B>0&&J.getWidth(this._activeBuffer.x)===0&&!J.hasContent(this._activeBuffer.x)&&J.setCellFromCodepoint(this._activeBuffer.x,0,1,oe),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(N,B){return N.final!=="t"||N.prefix||N.intermediates?this._parser.registerCsiHandler(N,B):this._parser.registerCsiHandler(N,(z=>!U(z.params[0],this._optionsService.rawOptions.windowOptions)||B(z)))}registerDcsHandler(N,B){return this._parser.registerDcsHandler(N,new A.DcsHandler(B))}registerEscHandler(N,B){return this._parser.registerEscHandler(N,B)}registerOscHandler(N,B){return this._parser.registerOscHandler(N,new T.OscHandler(B))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var N;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((N=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&N.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);B.hasWidth(this._activeBuffer.x)&&!B.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const N=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-N),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(N=this._bufferService.cols-1){this._activeBuffer.x=Math.min(N,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(N,B){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=N,this._activeBuffer.y=this._activeBuffer.scrollTop+B):(this._activeBuffer.x=N,this._activeBuffer.y=B),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(N,B){this._restrictCursor(),this._setCursor(this._activeBuffer.x+N,this._activeBuffer.y+B)}cursorUp(N){const B=this._activeBuffer.y-this._activeBuffer.scrollTop;return B>=0?this._moveCursor(0,-Math.min(B,N.params[0]||1)):this._moveCursor(0,-(N.params[0]||1)),!0}cursorDown(N){const B=this._activeBuffer.scrollBottom-this._activeBuffer.y;return B>=0?this._moveCursor(0,Math.min(B,N.params[0]||1)):this._moveCursor(0,N.params[0]||1),!0}cursorForward(N){return this._moveCursor(N.params[0]||1,0),!0}cursorBackward(N){return this._moveCursor(-(N.params[0]||1),0),!0}cursorNextLine(N){return this.cursorDown(N),this._activeBuffer.x=0,!0}cursorPrecedingLine(N){return this.cursorUp(N),this._activeBuffer.x=0,!0}cursorCharAbsolute(N){return this._setCursor((N.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(N){return this._setCursor(N.length>=2?(N.params[1]||1)-1:0,(N.params[0]||1)-1),!0}charPosAbsolute(N){return this._setCursor((N.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(N){return this._moveCursor(N.params[0]||1,0),!0}linePosAbsolute(N){return this._setCursor(this._activeBuffer.x,(N.params[0]||1)-1),!0}vPositionRelative(N){return this._moveCursor(0,N.params[0]||1),!0}hVPosition(N){return this.cursorPosition(N),!0}tabClear(N){const B=N.params[0];return B===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:B===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(N){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let B=N.params[0]||1;for(;B--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(N){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let B=N.params[0]||1;for(;B--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(N){const B=N.params[0];return B===1&&(this._curAttrData.bg|=536870912),B!==2&&B!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(N,B,z,G=!1,H=!1){const te=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);te.replaceCells(B,z,this._activeBuffer.getNullCell(this._eraseAttrData()),H),G&&(te.isWrapped=!1)}_resetBufferLine(N,B=!1){const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);z&&(z.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),B),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+N),z.isWrapped=!1)}eraseInDisplay(N,B=!1){let z;switch(this._restrictCursor(this._bufferService.cols),N.params[0]){case 0:for(z=this._activeBuffer.y,this._dirtyRowTracker.markDirty(z),this._eraseInBufferLine(z++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,B);z<this._bufferService.rows;z++)this._resetBufferLine(z,B);this._dirtyRowTracker.markDirty(z);break;case 1:for(z=this._activeBuffer.y,this._dirtyRowTracker.markDirty(z),this._eraseInBufferLine(z,0,this._activeBuffer.x+1,!0,B),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(z+1).isWrapped=!1);z--;)this._resetBufferLine(z,B);this._dirtyRowTracker.markDirty(0);break;case 2:for(z=this._bufferService.rows,this._dirtyRowTracker.markDirty(z-1);z--;)this._resetBufferLine(z,B);this._dirtyRowTracker.markDirty(0);break;case 3:const G=this._activeBuffer.lines.length-this._bufferService.rows;G>0&&(this._activeBuffer.lines.trimStart(G),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-G,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-G,0),this._onScroll.fire(0))}return!0}eraseInLine(N,B=!1){switch(this._restrictCursor(this._bufferService.cols),N.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,B);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,B);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,B)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(N){this._restrictCursor();let B=N.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const z=this._activeBuffer.ybase+this._activeBuffer.y,G=this._bufferService.rows-1-this._activeBuffer.scrollBottom,H=this._bufferService.rows-1+this._activeBuffer.ybase-G+1;for(;B--;)this._activeBuffer.lines.splice(H-1,1),this._activeBuffer.lines.splice(z,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(N){this._restrictCursor();let B=N.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const z=this._activeBuffer.ybase+this._activeBuffer.y;let G;for(G=this._bufferService.rows-1-this._activeBuffer.scrollBottom,G=this._bufferService.rows-1+this._activeBuffer.ybase-G;B--;)this._activeBuffer.lines.splice(z,1),this._activeBuffer.lines.splice(G,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(N){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.insertCells(this._activeBuffer.x,N.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(N){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.deleteCells(this._activeBuffer.x,N.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(N){let B=N.params[0]||1;for(;B--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(N){let B=N.params[0]||1;for(;B--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(b.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=N.params[0]||1;for(let z=this._activeBuffer.scrollTop;z<=this._activeBuffer.scrollBottom;++z){const G=this._activeBuffer.lines.get(this._activeBuffer.ybase+z);G.deleteCells(0,B,this._activeBuffer.getNullCell(this._eraseAttrData())),G.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=N.params[0]||1;for(let z=this._activeBuffer.scrollTop;z<=this._activeBuffer.scrollBottom;++z){const G=this._activeBuffer.lines.get(this._activeBuffer.ybase+z);G.insertCells(0,B,this._activeBuffer.getNullCell(this._eraseAttrData())),G.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=N.params[0]||1;for(let z=this._activeBuffer.scrollTop;z<=this._activeBuffer.scrollBottom;++z){const G=this._activeBuffer.lines.get(this._activeBuffer.ybase+z);G.insertCells(this._activeBuffer.x,B,this._activeBuffer.getNullCell(this._eraseAttrData())),G.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=N.params[0]||1;for(let z=this._activeBuffer.scrollTop;z<=this._activeBuffer.scrollBottom;++z){const G=this._activeBuffer.lines.get(this._activeBuffer.ybase+z);G.deleteCells(this._activeBuffer.x,B,this._activeBuffer.getNullCell(this._eraseAttrData())),G.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(N){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(N.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(N){const B=this._parser.precedingJoinState;if(!B)return!0;const z=N.params[0]||1,G=R.UnicodeService.extractWidth(B),H=this._activeBuffer.x-G,te=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(H),he=new Uint32Array(te.length*z);let me=0;for(let q=0;q<te.length;){const oe=te.codePointAt(q)||0;he[me++]=oe,q+=oe>65535?2:1}let Y=me;for(let q=1;q<z;++q)he.copyWithin(Y,0,me),Y+=me;return this.print(he,0,Y),!0}sendDeviceAttributesPrimary(N){return N.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(u.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(u.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(N){return N.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(u.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(u.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(N.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(u.C0.ESC+"[>83;40003;0c")),!0}_is(N){return(this._optionsService.rawOptions.termName+"").indexOf(N)===0}setMode(N){for(let B=0;B<N.length;B++)switch(N.params[B]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(N){for(let B=0;B<N.length;B++)switch(N.params[B]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,y.DEFAULT_CHARSET),this._charsetService.setgCharset(1,y.DEFAULT_CHARSET),this._charsetService.setgCharset(2,y.DEFAULT_CHARSET),this._charsetService.setgCharset(3,y.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(N){for(let B=0;B<N.length;B++)switch(N.params[B]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(N){for(let B=0;B<N.length;B++)switch(N.params[B]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),N.params[B]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(N,B){const z=this._coreService.decPrivateModes,{activeProtocol:G,activeEncoding:H}=this._coreMouseService,te=this._coreService,{buffers:he,cols:me}=this._bufferService,{active:Y,alt:q}=he,oe=this._optionsService.rawOptions,J=xe=>xe?1:2,ie=N.params[0];return de=ie,Ce=B?ie===2?4:ie===4?J(te.modes.insertMode):ie===12?3:ie===20?J(oe.convertEol):0:ie===1?J(z.applicationCursorKeys):ie===3?oe.windowOptions.setWinLines?me===80?2:me===132?1:0:0:ie===6?J(z.origin):ie===7?J(z.wraparound):ie===8?3:ie===9?J(G==="X10"):ie===12?J(oe.cursorBlink):ie===25?J(!te.isCursorHidden):ie===45?J(z.reverseWraparound):ie===66?J(z.applicationKeypad):ie===67?4:ie===1e3?J(G==="VT200"):ie===1002?J(G==="DRAG"):ie===1003?J(G==="ANY"):ie===1004?J(z.sendFocus):ie===1005?4:ie===1006?J(H==="SGR"):ie===1015?4:ie===1016?J(H==="SGR_PIXELS"):ie===1048?1:ie===47||ie===1047||ie===1049?J(Y===q):ie===2004?J(z.bracketedPasteMode):0,te.triggerDataEvent(`${u.C0.ESC}[${B?"":"?"}${de};${Ce}$y`),!0;var de,Ce}_updateAttrColor(N,B,z,G,H){return B===2?(N|=50331648,N&=-16777216,N|=E.AttributeData.fromColorRGB([z,G,H])):B===5&&(N&=-50331904,N|=33554432|255&z),N}_extractColor(N,B,z){const G=[0,0,-1,0,0,0];let H=0,te=0;do{if(G[te+H]=N.params[B+te],N.hasSubParams(B+te)){const he=N.getSubParams(B+te);let me=0;do G[1]===5&&(H=1),G[te+me+1+H]=he[me];while(++me<he.length&&me+te+1+H<G.length);break}if(G[1]===5&&te+H>=2||G[1]===2&&te+H>=5)break;G[1]&&(H=1)}while(++te+B<N.length&&te+H<G.length);for(let he=2;he<G.length;++he)G[he]===-1&&(G[he]=0);switch(G[0]){case 38:z.fg=this._updateAttrColor(z.fg,G[1],G[3],G[4],G[5]);break;case 48:z.bg=this._updateAttrColor(z.bg,G[1],G[3],G[4],G[5]);break;case 58:z.extended=z.extended.clone(),z.extended.underlineColor=this._updateAttrColor(z.extended.underlineColor,G[1],G[3],G[4],G[5])}return te}_processUnderline(N,B){B.extended=B.extended.clone(),(!~N||N>5)&&(N=1),B.extended.underlineStyle=N,B.fg|=268435456,N===0&&(B.fg&=-268435457),B.updateExtended()}_processSGR0(N){N.fg=b.DEFAULT_ATTR_DATA.fg,N.bg=b.DEFAULT_ATTR_DATA.bg,N.extended=N.extended.clone(),N.extended.underlineStyle=0,N.extended.underlineColor&=-67108864,N.updateExtended()}charAttributes(N){if(N.length===1&&N.params[0]===0)return this._processSGR0(this._curAttrData),!0;const B=N.length;let z;const G=this._curAttrData;for(let H=0;H<B;H++)z=N.params[H],z>=30&&z<=37?(G.fg&=-50331904,G.fg|=16777216|z-30):z>=40&&z<=47?(G.bg&=-50331904,G.bg|=16777216|z-40):z>=90&&z<=97?(G.fg&=-50331904,G.fg|=16777224|z-90):z>=100&&z<=107?(G.bg&=-50331904,G.bg|=16777224|z-100):z===0?this._processSGR0(G):z===1?G.fg|=134217728:z===3?G.bg|=67108864:z===4?(G.fg|=268435456,this._processUnderline(N.hasSubParams(H)?N.getSubParams(H)[0]:1,G)):z===5?G.fg|=536870912:z===7?G.fg|=67108864:z===8?G.fg|=1073741824:z===9?G.fg|=2147483648:z===2?G.bg|=134217728:z===21?this._processUnderline(2,G):z===22?(G.fg&=-134217729,G.bg&=-134217729):z===23?G.bg&=-67108865:z===24?(G.fg&=-268435457,this._processUnderline(0,G)):z===25?G.fg&=-536870913:z===27?G.fg&=-67108865:z===28?G.fg&=-1073741825:z===29?G.fg&=2147483647:z===39?(G.fg&=-67108864,G.fg|=16777215&b.DEFAULT_ATTR_DATA.fg):z===49?(G.bg&=-67108864,G.bg|=16777215&b.DEFAULT_ATTR_DATA.bg):z===38||z===48||z===58?H+=this._extractColor(N,H,G):z===53?G.bg|=1073741824:z===55?G.bg&=-1073741825:z===59?(G.extended=G.extended.clone(),G.extended.underlineColor=-1,G.updateExtended()):z===100?(G.fg&=-67108864,G.fg|=16777215&b.DEFAULT_ATTR_DATA.fg,G.bg&=-67108864,G.bg|=16777215&b.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",z);return!0}deviceStatus(N){switch(N.params[0]){case 5:this._coreService.triggerDataEvent(`${u.C0.ESC}[0n`);break;case 6:const B=this._activeBuffer.y+1,z=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[${B};${z}R`)}return!0}deviceStatusPrivate(N){if(N.params[0]===6){const B=this._activeBuffer.y+1,z=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[?${B};${z}R`)}return!0}softReset(N){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=b.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(N){const B=N.params[0]||1;switch(B){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const z=B%2==1;return this._optionsService.options.cursorBlink=z,!0}setScrollRegion(N){const B=N.params[0]||1;let z;return(N.length<2||(z=N.params[1])>this._bufferService.rows||z===0)&&(z=this._bufferService.rows),z>B&&(this._activeBuffer.scrollTop=B-1,this._activeBuffer.scrollBottom=z-1,this._setCursor(0,0)),!0}windowOptions(N){if(!U(N.params[0],this._optionsService.rawOptions.windowOptions))return!0;const B=N.length>1?N.params[1]:0;switch(N.params[0]){case 14:B!==2&&this._onRequestWindowsOptionsReport.fire(F.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(F.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${u.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:B!==0&&B!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),B!==0&&B!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:B!==0&&B!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),B!==0&&B!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(N){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(N){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(N){return this._windowTitle=N,this._onTitleChange.fire(N),!0}setIconName(N){return this._iconName=N,!0}setOrReportIndexedColor(N){const B=[],z=N.split(";");for(;z.length>1;){const G=z.shift(),H=z.shift();if(/^\d+$/.exec(G)){const te=parseInt(G);if($(te))if(H==="?")B.push({type:0,index:te});else{const he=(0,M.parseColor)(H);he&&B.push({type:1,index:te,color:he})}}}return B.length&&this._onColor.fire(B),!0}setHyperlink(N){const B=N.split(";");return!(B.length<2)&&(B[1]?this._createHyperlink(B[0],B[1]):!B[0]&&this._finishHyperlink())}_createHyperlink(N,B){this._getCurrentLinkId()&&this._finishHyperlink();const z=N.split(":");let G;const H=z.findIndex((te=>te.startsWith("id=")));return H!==-1&&(G=z[H].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:G,uri:B}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(N,B){const z=N.split(";");for(let G=0;G<z.length&&!(B>=this._specialColors.length);++G,++B)if(z[G]==="?")this._onColor.fire([{type:0,index:this._specialColors[B]}]);else{const H=(0,M.parseColor)(z[G]);H&&this._onColor.fire([{type:1,index:this._specialColors[B],color:H}])}return!0}setOrReportFgColor(N){return this._setOrReportSpecialColor(N,0)}setOrReportBgColor(N){return this._setOrReportSpecialColor(N,1)}setOrReportCursorColor(N){return this._setOrReportSpecialColor(N,2)}restoreIndexedColor(N){if(!N)return this._onColor.fire([{type:2}]),!0;const B=[],z=N.split(";");for(let G=0;G<z.length;++G)if(/^\d+$/.exec(z[G])){const H=parseInt(z[G]);$(H)&&B.push({type:2,index:H})}return B.length&&this._onColor.fire(B),!0}restoreFgColor(N){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(N){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(N){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,y.DEFAULT_CHARSET),!0}selectCharset(N){return N.length!==2?(this.selectDefaultCharset(),!0):(N[0]==="/"||this._charsetService.setgCharset(j[N[0]],y.CHARSETS[N[1]]||y.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const N=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,N,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=b.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=b.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(N){return this._charsetService.setgLevel(N),!0}screenAlignmentPattern(){const N=new v.CellData;N.content=4194373,N.fg=this._curAttrData.fg,N.bg=this._curAttrData.bg,this._setCursor(0,0);for(let B=0;B<this._bufferService.rows;++B){const z=this._activeBuffer.ybase+this._activeBuffer.y+B,G=this._activeBuffer.lines.get(z);G&&(G.fill(N),G.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(N,B){const z=this._bufferService.buffer,G=this._optionsService.rawOptions;return(H=>(this._coreService.triggerDataEvent(`${u.C0.ESC}${H}${u.C0.ESC}\\`),!0))(N==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:N==='"p'?'P1$r61;1"p':N==="r"?`P1$r${z.scrollTop+1};${z.scrollBottom+1}r`:N==="m"?"P1$r0m":N===" q"?`P1$r${{block:2,underline:4,bar:6}[G.cursorStyle]-(G.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(N,B){this._dirtyRowTracker.markRangeDirty(N,B)}}a.InputHandler=W;let V=class{constructor(ee){this._bufferService=ee,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(ee){ee<this.start?this.start=ee:ee>this.end&&(this.end=ee)}markRangeDirty(ee,N){ee>N&&(K=ee,ee=N,N=K),ee<this.start&&(this.start=ee),N>this.end&&(this.end=N)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function $(ee){return 0<=ee&&ee<256}V=h([m(0,L.IBufferService)],V)},844:(f,a)=>{function c(h){for(const m of h)m.dispose();h.length=0}Object.defineProperty(a,"__esModule",{value:!0}),a.getDisposeArrayDisposable=a.disposeArray=a.toDisposable=a.MutableDisposable=a.Disposable=void 0,a.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const h of this._disposables)h.dispose();this._disposables.length=0}register(h){return this._disposables.push(h),h}unregister(h){const m=this._disposables.indexOf(h);m!==-1&&this._disposables.splice(m,1)}},a.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(h){var m;this._isDisposed||h===this._value||((m=this._value)==null||m.dispose(),this._value=h)}clear(){this.value=void 0}dispose(){var h;this._isDisposed=!0,(h=this._value)==null||h.dispose(),this._value=void 0}},a.toDisposable=function(h){return{dispose:h}},a.disposeArray=c,a.getDisposeArrayDisposable=function(h){return{dispose:()=>c(h)}}},1505:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.FourKeyMap=a.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(m,u,y){this._data[m]||(this._data[m]={}),this._data[m][u]=y}get(m,u){return this._data[m]?this._data[m][u]:void 0}clear(){this._data={}}}a.TwoKeyMap=c,a.FourKeyMap=class{constructor(){this._data=new c}set(h,m,u,y,w){this._data.get(h,m)||this._data.set(h,m,new c),this._data.get(h,m).set(u,y,w)}get(h,m,u,y){var w;return(w=this._data.get(h,m))==null?void 0:w.get(u,y)}clear(){this._data.clear()}}},6114:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.isChromeOS=a.isLinux=a.isWindows=a.isIphone=a.isIpad=a.isMac=a.getSafariVersion=a.isSafari=a.isLegacyEdge=a.isFirefox=a.isNode=void 0,a.isNode=typeof process<"u"&&"title"in process;const c=a.isNode?"node":navigator.userAgent,h=a.isNode?"node":navigator.platform;a.isFirefox=c.includes("Firefox"),a.isLegacyEdge=c.includes("Edge"),a.isSafari=/^((?!chrome|android).)*safari/i.test(c),a.getSafariVersion=function(){if(!a.isSafari)return 0;const m=c.match(/Version\/(\d+)/);return m===null||m.length<2?0:parseInt(m[1])},a.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(h),a.isIpad=h==="iPad",a.isIphone=h==="iPhone",a.isWindows=["Windows","Win16","Win32","WinCE"].includes(h),a.isLinux=h.indexOf("Linux")>=0,a.isChromeOS=/\bCrOS\b/.test(c)},6106:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.SortedList=void 0;let c=0;a.SortedList=class{constructor(h){this._getKey=h,this._array=[]}clear(){this._array.length=0}insert(h){this._array.length!==0?(c=this._search(this._getKey(h)),this._array.splice(c,0,h)):this._array.push(h)}delete(h){if(this._array.length===0)return!1;const m=this._getKey(h);if(m===void 0||(c=this._search(m),c===-1)||this._getKey(this._array[c])!==m)return!1;do if(this._array[c]===h)return this._array.splice(c,1),!0;while(++c<this._array.length&&this._getKey(this._array[c])===m);return!1}*getKeyIterator(h){if(this._array.length!==0&&(c=this._search(h),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===h))do yield this._array[c];while(++c<this._array.length&&this._getKey(this._array[c])===h)}forEachByKey(h,m){if(this._array.length!==0&&(c=this._search(h),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===h))do m(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===h)}values(){return[...this._array].values()}_search(h){let m=0,u=this._array.length-1;for(;u>=m;){let y=m+u>>1;const w=this._getKey(this._array[y]);if(w>h)u=y-1;else{if(!(w<h)){for(;y>0&&this._getKey(this._array[y-1])===h;)y--;return y}m=y+1}}return m}}},7226:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DebouncedIdleTask=a.IdleTaskQueue=a.PriorityTaskQueue=void 0;const h=c(6114);class m{constructor(){this._tasks=[],this._i=0}enqueue(w){this._tasks.push(w),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(w){this._idleCallback=void 0;let k=0,x=0,b=w.timeRemaining(),S=0;for(;this._i<this._tasks.length;){if(k=Date.now(),this._tasks[this._i]()||this._i++,k=Math.max(1,Date.now()-k),x=Math.max(k,x),S=w.timeRemaining(),1.5*x>S)return b-k<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(b-k))}ms`),void this._start();b=S}this.clear()}}class u extends m{_requestCallback(w){return setTimeout((()=>w(this._createDeadline(16))))}_cancelCallback(w){clearTimeout(w)}_createDeadline(w){const k=Date.now()+w;return{timeRemaining:()=>Math.max(0,k-Date.now())}}}a.PriorityTaskQueue=u,a.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends m{_requestCallback(y){return requestIdleCallback(y)}_cancelCallback(y){cancelIdleCallback(y)}}:u,a.DebouncedIdleTask=class{constructor(){this._queue=new a.IdleTaskQueue}set(y){this._queue.clear(),this._queue.enqueue(y)}flush(){this._queue.flush()}}},9282:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.updateWindowsModeWrappedState=void 0;const h=c(643);a.updateWindowsModeWrappedState=function(m){const u=m.buffer.lines.get(m.buffer.ybase+m.buffer.y-1),y=u==null?void 0:u.get(m.cols-1),w=m.buffer.lines.get(m.buffer.ybase+m.buffer.y);w&&y&&(w.isWrapped=y[h.CHAR_DATA_CODE_INDEX]!==h.NULL_CELL_CODE&&y[h.CHAR_DATA_CODE_INDEX]!==h.WHITESPACE_CELL_CODE)}},3734:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ExtendedAttrs=a.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new h}static toColorRGB(u){return[u>>>16&255,u>>>8&255,255&u]}static fromColorRGB(u){return(255&u[0])<<16|(255&u[1])<<8|255&u[2]}clone(){const u=new c;return u.fg=this.fg,u.bg=this.bg,u.extended=this.extended.clone(),u}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}a.AttributeData=c;class h{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(u){this._ext=u}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(u){this._ext&=-469762049,this._ext|=u<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(u){this._ext&=-67108864,this._ext|=67108863&u}get urlId(){return this._urlId}set urlId(u){this._urlId=u}get underlineVariantOffset(){const u=(3758096384&this._ext)>>29;return u<0?4294967288^u:u}set underlineVariantOffset(u){this._ext&=536870911,this._ext|=u<<29&3758096384}constructor(u=0,y=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=y}clone(){return new h(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}a.ExtendedAttrs=h},9092:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Buffer=a.MAX_BUFFER_SIZE=void 0;const h=c(6349),m=c(7226),u=c(3734),y=c(8437),w=c(4634),k=c(511),x=c(643),b=c(4863),S=c(7116);a.MAX_BUFFER_SIZE=4294967295,a.Buffer=class{constructor(g,v,E){this._hasScrollback=g,this._optionsService=v,this._bufferService=E,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=y.DEFAULT_ATTR_DATA.clone(),this.savedCharset=S.DEFAULT_CHARSET,this.markers=[],this._nullCell=k.CellData.fromCharData([0,x.NULL_CELL_CHAR,x.NULL_CELL_WIDTH,x.NULL_CELL_CODE]),this._whitespaceCell=k.CellData.fromCharData([0,x.WHITESPACE_CELL_CHAR,x.WHITESPACE_CELL_WIDTH,x.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new m.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(g){return g?(this._nullCell.fg=g.fg,this._nullCell.bg=g.bg,this._nullCell.extended=g.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new u.ExtendedAttrs),this._nullCell}getWhitespaceCell(g){return g?(this._whitespaceCell.fg=g.fg,this._whitespaceCell.bg=g.bg,this._whitespaceCell.extended=g.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new u.ExtendedAttrs),this._whitespaceCell}getBlankLine(g,v){return new y.BufferLine(this._bufferService.cols,this.getNullCell(g),v)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const g=this.ybase+this.y-this.ydisp;return g>=0&&g<this._rows}_getCorrectBufferLength(g){if(!this._hasScrollback)return g;const v=g+this._optionsService.rawOptions.scrollback;return v>a.MAX_BUFFER_SIZE?a.MAX_BUFFER_SIZE:v}fillViewportRows(g){if(this.lines.length===0){g===void 0&&(g=y.DEFAULT_ATTR_DATA);let v=this._rows;for(;v--;)this.lines.push(this.getBlankLine(g))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(g,v){const E=this.getNullCell(y.DEFAULT_ATTR_DATA);let L=0;const R=this._getCorrectBufferLength(v);if(R>this.lines.maxLength&&(this.lines.maxLength=R),this.lines.length>0){if(this._cols<g)for(let A=0;A<this.lines.length;A++)L+=+this.lines.get(A).resize(g,E);let T=0;if(this._rows<v)for(let A=this._rows;A<v;A++)this.lines.length<v+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new y.BufferLine(g,E)):this.ybase>0&&this.lines.length<=this.ybase+this.y+T+1?(this.ybase--,T++,this.ydisp>0&&this.ydisp--):this.lines.push(new y.BufferLine(g,E)));else for(let A=this._rows;A>v;A--)this.lines.length>v+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(R<this.lines.maxLength){const A=this.lines.length-R;A>0&&(this.lines.trimStart(A),this.ybase=Math.max(this.ybase-A,0),this.ydisp=Math.max(this.ydisp-A,0),this.savedY=Math.max(this.savedY-A,0)),this.lines.maxLength=R}this.x=Math.min(this.x,g-1),this.y=Math.min(this.y,v-1),T&&(this.y+=T),this.savedX=Math.min(this.savedX,g-1),this.scrollTop=0}if(this.scrollBottom=v-1,this._isReflowEnabled&&(this._reflow(g,v),this._cols>g))for(let T=0;T<this.lines.length;T++)L+=+this.lines.get(T).resize(g,E);this._cols=g,this._rows=v,this._memoryCleanupQueue.clear(),L>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let g=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,g=!1);let v=0;for(;this._memoryCleanupPosition<this.lines.length;)if(v+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),v>100)return!0;return g}get _isReflowEnabled(){const g=this._optionsService.rawOptions.windowsPty;return g&&g.buildNumber?this._hasScrollback&&g.backend==="conpty"&&g.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(g,v){this._cols!==g&&(g>this._cols?this._reflowLarger(g,v):this._reflowSmaller(g,v))}_reflowLarger(g,v){const E=(0,w.reflowLargerGetLinesToRemove)(this.lines,this._cols,g,this.ybase+this.y,this.getNullCell(y.DEFAULT_ATTR_DATA));if(E.length>0){const L=(0,w.reflowLargerCreateNewLayout)(this.lines,E);(0,w.reflowLargerApplyNewLayout)(this.lines,L.layout),this._reflowLargerAdjustViewport(g,v,L.countRemoved)}}_reflowLargerAdjustViewport(g,v,E){const L=this.getNullCell(y.DEFAULT_ATTR_DATA);let R=E;for(;R-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<v&&this.lines.push(new y.BufferLine(g,L))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-E,0)}_reflowSmaller(g,v){const E=this.getNullCell(y.DEFAULT_ATTR_DATA),L=[];let R=0;for(let T=this.lines.length-1;T>=0;T--){let A=this.lines.get(T);if(!A||!A.isWrapped&&A.getTrimmedLength()<=g)continue;const M=[A];for(;A.isWrapped&&T>0;)A=this.lines.get(--T),M.unshift(A);const j=this.ybase+this.y;if(j>=T&&j<T+M.length)continue;const I=M[M.length-1].getTrimmedLength(),U=(0,w.reflowSmallerGetNewLineLengths)(M,this._cols,g),F=U.length-M.length;let K;K=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+F):Math.max(0,this.lines.length-this.lines.maxLength+F);const W=[];for(let z=0;z<F;z++){const G=this.getBlankLine(y.DEFAULT_ATTR_DATA,!0);W.push(G)}W.length>0&&(L.push({start:T+M.length+R,newLines:W}),R+=W.length),M.push(...W);let V=U.length-1,$=U[V];$===0&&(V--,$=U[V]);let ee=M.length-F-1,N=I;for(;ee>=0;){const z=Math.min(N,$);if(M[V]===void 0)break;if(M[V].copyCellsFrom(M[ee],N-z,$-z,z,!0),$-=z,$===0&&(V--,$=U[V]),N-=z,N===0){ee--;const G=Math.max(ee,0);N=(0,w.getWrappedLineTrimmedLength)(M,G,this._cols)}}for(let z=0;z<M.length;z++)U[z]<g&&M[z].setCell(U[z],E);let B=F-K;for(;B-- >0;)this.ybase===0?this.y<v-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+R)-v&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+F,this.ybase+v-1)}if(L.length>0){const T=[],A=[];for(let V=0;V<this.lines.length;V++)A.push(this.lines.get(V));const M=this.lines.length;let j=M-1,I=0,U=L[I];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+R);let F=0;for(let V=Math.min(this.lines.maxLength-1,M+R-1);V>=0;V--)if(U&&U.start>j+F){for(let $=U.newLines.length-1;$>=0;$--)this.lines.set(V--,U.newLines[$]);V++,T.push({index:j+1,amount:U.newLines.length}),F+=U.newLines.length,U=L[++I]}else this.lines.set(V,A[j--]);let K=0;for(let V=T.length-1;V>=0;V--)T[V].index+=K,this.lines.onInsertEmitter.fire(T[V]),K+=T[V].amount;const W=Math.max(0,M+R-this.lines.maxLength);W>0&&this.lines.onTrimEmitter.fire(W)}}translateBufferLineToString(g,v,E=0,L){const R=this.lines.get(g);return R?R.translateToString(v,E,L):""}getWrappedRangeForLine(g){let v=g,E=g;for(;v>0&&this.lines.get(v).isWrapped;)v--;for(;E+1<this.lines.length&&this.lines.get(E+1).isWrapped;)E++;return{first:v,last:E}}setupTabStops(g){for(g!=null?this.tabs[g]||(g=this.prevStop(g)):(this.tabs={},g=0);g<this._cols;g+=this._optionsService.rawOptions.tabStopWidth)this.tabs[g]=!0}prevStop(g){for(g==null&&(g=this.x);!this.tabs[--g]&&g>0;);return g>=this._cols?this._cols-1:g<0?0:g}nextStop(g){for(g==null&&(g=this.x);!this.tabs[++g]&&g<this._cols;);return g>=this._cols?this._cols-1:g<0?0:g}clearMarkers(g){this._isClearing=!0;for(let v=0;v<this.markers.length;v++)this.markers[v].line===g&&(this.markers[v].dispose(),this.markers.splice(v--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let g=0;g<this.markers.length;g++)this.markers[g].dispose(),this.markers.splice(g--,1);this._isClearing=!1}addMarker(g){const v=new b.Marker(g);return this.markers.push(v),v.register(this.lines.onTrim((E=>{v.line-=E,v.line<0&&v.dispose()}))),v.register(this.lines.onInsert((E=>{v.line>=E.index&&(v.line+=E.amount)}))),v.register(this.lines.onDelete((E=>{v.line>=E.index&&v.line<E.index+E.amount&&v.dispose(),v.line>E.index&&(v.line-=E.amount)}))),v.register(v.onDispose((()=>this._removeMarker(v)))),v}_removeMarker(g){this._isClearing||this.markers.splice(this.markers.indexOf(g),1)}}},8437:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLine=a.DEFAULT_ATTR_DATA=void 0;const h=c(3734),m=c(511),u=c(643),y=c(482);a.DEFAULT_ATTR_DATA=Object.freeze(new h.AttributeData);let w=0;class k{constructor(b,S,g=!1){this.isWrapped=g,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*b);const v=S||m.CellData.fromCharData([0,u.NULL_CELL_CHAR,u.NULL_CELL_WIDTH,u.NULL_CELL_CODE]);for(let E=0;E<b;++E)this.setCell(E,v);this.length=b}get(b){const S=this._data[3*b+0],g=2097151&S;return[this._data[3*b+1],2097152&S?this._combined[b]:g?(0,y.stringFromCodePoint)(g):"",S>>22,2097152&S?this._combined[b].charCodeAt(this._combined[b].length-1):g]}set(b,S){this._data[3*b+1]=S[u.CHAR_DATA_ATTR_INDEX],S[u.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[b]=S[1],this._data[3*b+0]=2097152|b|S[u.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*b+0]=S[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|S[u.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(b){return this._data[3*b+0]>>22}hasWidth(b){return 12582912&this._data[3*b+0]}getFg(b){return this._data[3*b+1]}getBg(b){return this._data[3*b+2]}hasContent(b){return 4194303&this._data[3*b+0]}getCodePoint(b){const S=this._data[3*b+0];return 2097152&S?this._combined[b].charCodeAt(this._combined[b].length-1):2097151&S}isCombined(b){return 2097152&this._data[3*b+0]}getString(b){const S=this._data[3*b+0];return 2097152&S?this._combined[b]:2097151&S?(0,y.stringFromCodePoint)(2097151&S):""}isProtected(b){return 536870912&this._data[3*b+2]}loadCell(b,S){return w=3*b,S.content=this._data[w+0],S.fg=this._data[w+1],S.bg=this._data[w+2],2097152&S.content&&(S.combinedData=this._combined[b]),268435456&S.bg&&(S.extended=this._extendedAttrs[b]),S}setCell(b,S){2097152&S.content&&(this._combined[b]=S.combinedData),268435456&S.bg&&(this._extendedAttrs[b]=S.extended),this._data[3*b+0]=S.content,this._data[3*b+1]=S.fg,this._data[3*b+2]=S.bg}setCellFromCodepoint(b,S,g,v){268435456&v.bg&&(this._extendedAttrs[b]=v.extended),this._data[3*b+0]=S|g<<22,this._data[3*b+1]=v.fg,this._data[3*b+2]=v.bg}addCodepointToCell(b,S,g){let v=this._data[3*b+0];2097152&v?this._combined[b]+=(0,y.stringFromCodePoint)(S):2097151&v?(this._combined[b]=(0,y.stringFromCodePoint)(2097151&v)+(0,y.stringFromCodePoint)(S),v&=-2097152,v|=2097152):v=S|4194304,g&&(v&=-12582913,v|=g<<22),this._data[3*b+0]=v}insertCells(b,S,g){if((b%=this.length)&&this.getWidth(b-1)===2&&this.setCellFromCodepoint(b-1,0,1,g),S<this.length-b){const v=new m.CellData;for(let E=this.length-b-S-1;E>=0;--E)this.setCell(b+S+E,this.loadCell(b+E,v));for(let E=0;E<S;++E)this.setCell(b+E,g)}else for(let v=b;v<this.length;++v)this.setCell(v,g);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,g)}deleteCells(b,S,g){if(b%=this.length,S<this.length-b){const v=new m.CellData;for(let E=0;E<this.length-b-S;++E)this.setCell(b+E,this.loadCell(b+S+E,v));for(let E=this.length-S;E<this.length;++E)this.setCell(E,g)}else for(let v=b;v<this.length;++v)this.setCell(v,g);b&&this.getWidth(b-1)===2&&this.setCellFromCodepoint(b-1,0,1,g),this.getWidth(b)!==0||this.hasContent(b)||this.setCellFromCodepoint(b,0,1,g)}replaceCells(b,S,g,v=!1){if(v)for(b&&this.getWidth(b-1)===2&&!this.isProtected(b-1)&&this.setCellFromCodepoint(b-1,0,1,g),S<this.length&&this.getWidth(S-1)===2&&!this.isProtected(S)&&this.setCellFromCodepoint(S,0,1,g);b<S&&b<this.length;)this.isProtected(b)||this.setCell(b,g),b++;else for(b&&this.getWidth(b-1)===2&&this.setCellFromCodepoint(b-1,0,1,g),S<this.length&&this.getWidth(S-1)===2&&this.setCellFromCodepoint(S,0,1,g);b<S&&b<this.length;)this.setCell(b++,g)}resize(b,S){if(b===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const g=3*b;if(b>this.length){if(this._data.buffer.byteLength>=4*g)this._data=new Uint32Array(this._data.buffer,0,g);else{const v=new Uint32Array(g);v.set(this._data),this._data=v}for(let v=this.length;v<b;++v)this.setCell(v,S)}else{this._data=this._data.subarray(0,g);const v=Object.keys(this._combined);for(let L=0;L<v.length;L++){const R=parseInt(v[L],10);R>=b&&delete this._combined[R]}const E=Object.keys(this._extendedAttrs);for(let L=0;L<E.length;L++){const R=parseInt(E[L],10);R>=b&&delete this._extendedAttrs[R]}}return this.length=b,4*g*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const b=new Uint32Array(this._data.length);return b.set(this._data),this._data=b,1}return 0}fill(b,S=!1){if(S)for(let g=0;g<this.length;++g)this.isProtected(g)||this.setCell(g,b);else{this._combined={},this._extendedAttrs={};for(let g=0;g<this.length;++g)this.setCell(g,b)}}copyFrom(b){this.length!==b.length?this._data=new Uint32Array(b._data):this._data.set(b._data),this.length=b.length,this._combined={};for(const S in b._combined)this._combined[S]=b._combined[S];this._extendedAttrs={};for(const S in b._extendedAttrs)this._extendedAttrs[S]=b._extendedAttrs[S];this.isWrapped=b.isWrapped}clone(){const b=new k(0);b._data=new Uint32Array(this._data),b.length=this.length;for(const S in this._combined)b._combined[S]=this._combined[S];for(const S in this._extendedAttrs)b._extendedAttrs[S]=this._extendedAttrs[S];return b.isWrapped=this.isWrapped,b}getTrimmedLength(){for(let b=this.length-1;b>=0;--b)if(4194303&this._data[3*b+0])return b+(this._data[3*b+0]>>22);return 0}getNoBgTrimmedLength(){for(let b=this.length-1;b>=0;--b)if(4194303&this._data[3*b+0]||50331648&this._data[3*b+2])return b+(this._data[3*b+0]>>22);return 0}copyCellsFrom(b,S,g,v,E){const L=b._data;if(E)for(let T=v-1;T>=0;T--){for(let A=0;A<3;A++)this._data[3*(g+T)+A]=L[3*(S+T)+A];268435456&L[3*(S+T)+2]&&(this._extendedAttrs[g+T]=b._extendedAttrs[S+T])}else for(let T=0;T<v;T++){for(let A=0;A<3;A++)this._data[3*(g+T)+A]=L[3*(S+T)+A];268435456&L[3*(S+T)+2]&&(this._extendedAttrs[g+T]=b._extendedAttrs[S+T])}const R=Object.keys(b._combined);for(let T=0;T<R.length;T++){const A=parseInt(R[T],10);A>=S&&(this._combined[A-S+g]=b._combined[A])}}translateToString(b,S,g,v){S=S??0,g=g??this.length,b&&(g=Math.min(g,this.getTrimmedLength())),v&&(v.length=0);let E="";for(;S<g;){const L=this._data[3*S+0],R=2097151&L,T=2097152&L?this._combined[S]:R?(0,y.stringFromCodePoint)(R):u.WHITESPACE_CELL_CHAR;if(E+=T,v)for(let A=0;A<T.length;++A)v.push(S);S+=L>>22||1}return v&&v.push(S),E}}a.BufferLine=k},4841:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.getRangeLength=void 0,a.getRangeLength=function(c,h){if(c.start.y>c.end.y)throw new Error(`Buffer range end (${c.end.x}, ${c.end.y}) cannot be before start (${c.start.x}, ${c.start.y})`);return h*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(f,a)=>{function c(h,m,u){if(m===h.length-1)return h[m].getTrimmedLength();const y=!h[m].hasContent(u-1)&&h[m].getWidth(u-1)===1,w=h[m+1].getWidth(0)===2;return y&&w?u-1:u}Object.defineProperty(a,"__esModule",{value:!0}),a.getWrappedLineTrimmedLength=a.reflowSmallerGetNewLineLengths=a.reflowLargerApplyNewLayout=a.reflowLargerCreateNewLayout=a.reflowLargerGetLinesToRemove=void 0,a.reflowLargerGetLinesToRemove=function(h,m,u,y,w){const k=[];for(let x=0;x<h.length-1;x++){let b=x,S=h.get(++b);if(!S.isWrapped)continue;const g=[h.get(x)];for(;b<h.length&&S.isWrapped;)g.push(S),S=h.get(++b);if(y>=x&&y<b){x+=g.length-1;continue}let v=0,E=c(g,v,m),L=1,R=0;for(;L<g.length;){const A=c(g,L,m),M=A-R,j=u-E,I=Math.min(M,j);g[v].copyCellsFrom(g[L],R,E,I,!1),E+=I,E===u&&(v++,E=0),R+=I,R===A&&(L++,R=0),E===0&&v!==0&&g[v-1].getWidth(u-1)===2&&(g[v].copyCellsFrom(g[v-1],u-1,E++,1,!1),g[v-1].setCell(u-1,w))}g[v].replaceCells(E,u,w);let T=0;for(let A=g.length-1;A>0&&(A>v||g[A].getTrimmedLength()===0);A--)T++;T>0&&(k.push(x+g.length-T),k.push(T)),x+=g.length-1}return k},a.reflowLargerCreateNewLayout=function(h,m){const u=[];let y=0,w=m[y],k=0;for(let x=0;x<h.length;x++)if(w===x){const b=m[++y];h.onDeleteEmitter.fire({index:x-k,amount:b}),x+=b-1,k+=b,w=m[++y]}else u.push(x);return{layout:u,countRemoved:k}},a.reflowLargerApplyNewLayout=function(h,m){const u=[];for(let y=0;y<m.length;y++)u.push(h.get(m[y]));for(let y=0;y<u.length;y++)h.set(y,u[y]);h.length=m.length},a.reflowSmallerGetNewLineLengths=function(h,m,u){const y=[],w=h.map(((S,g)=>c(h,g,m))).reduce(((S,g)=>S+g));let k=0,x=0,b=0;for(;b<w;){if(w-b<u){y.push(w-b);break}k+=u;const S=c(h,x,m);k>S&&(k-=S,x++);const g=h[x].getWidth(k-1)===2;g&&k--;const v=g?u-1:u;y.push(v),b+=v}return y},a.getWrappedLineTrimmedLength=c},5295:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferSet=void 0;const h=c(8460),m=c(844),u=c(9092);class y extends m.Disposable{constructor(k,x){super(),this._optionsService=k,this._bufferService=x,this._onBufferActivate=this.register(new h.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new u.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new u.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(k){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(k),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(k,x){this._normal.resize(k,x),this._alt.resize(k,x),this.setupTabStops(k)}setupTabStops(k){this._normal.setupTabStops(k),this._alt.setupTabStops(k)}}a.BufferSet=y},511:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CellData=void 0;const h=c(482),m=c(643),u=c(3734);class y extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(k){const x=new y;return x.setFromCharData(k),x}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,h.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(k){this.fg=k[m.CHAR_DATA_ATTR_INDEX],this.bg=0;let x=!1;if(k[m.CHAR_DATA_CHAR_INDEX].length>2)x=!0;else if(k[m.CHAR_DATA_CHAR_INDEX].length===2){const b=k[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=b&&b<=56319){const S=k[m.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=S&&S<=57343?this.content=1024*(b-55296)+S-56320+65536|k[m.CHAR_DATA_WIDTH_INDEX]<<22:x=!0}else x=!0}else this.content=k[m.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|k[m.CHAR_DATA_WIDTH_INDEX]<<22;x&&(this.combinedData=k[m.CHAR_DATA_CHAR_INDEX],this.content=2097152|k[m.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}a.CellData=y},643:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WHITESPACE_CELL_CODE=a.WHITESPACE_CELL_WIDTH=a.WHITESPACE_CELL_CHAR=a.NULL_CELL_CODE=a.NULL_CELL_WIDTH=a.NULL_CELL_CHAR=a.CHAR_DATA_CODE_INDEX=a.CHAR_DATA_WIDTH_INDEX=a.CHAR_DATA_CHAR_INDEX=a.CHAR_DATA_ATTR_INDEX=a.DEFAULT_EXT=a.DEFAULT_ATTR=a.DEFAULT_COLOR=void 0,a.DEFAULT_COLOR=0,a.DEFAULT_ATTR=256|a.DEFAULT_COLOR<<9,a.DEFAULT_EXT=0,a.CHAR_DATA_ATTR_INDEX=0,a.CHAR_DATA_CHAR_INDEX=1,a.CHAR_DATA_WIDTH_INDEX=2,a.CHAR_DATA_CODE_INDEX=3,a.NULL_CELL_CHAR="",a.NULL_CELL_WIDTH=1,a.NULL_CELL_CODE=0,a.WHITESPACE_CELL_CHAR=" ",a.WHITESPACE_CELL_WIDTH=1,a.WHITESPACE_CELL_CODE=32},4863:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Marker=void 0;const h=c(8460),m=c(844);class u{get id(){return this._id}constructor(w){this.line=w,this.isDisposed=!1,this._disposables=[],this._id=u._nextId++,this._onDispose=this.register(new h.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,m.disposeArray)(this._disposables),this._disposables.length=0)}register(w){return this._disposables.push(w),w}}a.Marker=u,u._nextId=1},7116:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DEFAULT_CHARSET=a.CHARSETS=void 0,a.CHARSETS={},a.DEFAULT_CHARSET=a.CHARSETS.B,a.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},a.CHARSETS.A={"#":"£"},a.CHARSETS.B=void 0,a.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},a.CHARSETS.C=a.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},a.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},a.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},a.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},a.CHARSETS.E=a.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},a.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},a.CHARSETS.H=a.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},a.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(f,a)=>{var c,h,m;Object.defineProperty(a,"__esModule",{value:!0}),a.C1_ESCAPED=a.C1=a.C0=void 0,(function(u){u.NUL="\0",u.SOH="",u.STX="",u.ETX="",u.EOT="",u.ENQ="",u.ACK="",u.BEL="\x07",u.BS="\b",u.HT=" ",u.LF=`
58
+ `,u.VT="\v",u.FF="\f",u.CR="\r",u.SO="",u.SI="",u.DLE="",u.DC1="",u.DC2="",u.DC3="",u.DC4="",u.NAK="",u.SYN="",u.ETB="",u.CAN="",u.EM="",u.SUB="",u.ESC="\x1B",u.FS="",u.GS="",u.RS="",u.US="",u.SP=" ",u.DEL=""})(c||(a.C0=c={})),(function(u){u.PAD="€",u.HOP="",u.BPH="‚",u.NBH="ƒ",u.IND="„",u.NEL="…",u.SSA="†",u.ESA="‡",u.HTS="ˆ",u.HTJ="‰",u.VTS="Š",u.PLD="‹",u.PLU="Œ",u.RI="",u.SS2="Ž",u.SS3="",u.DCS="",u.PU1="‘",u.PU2="’",u.STS="“",u.CCH="”",u.MW="•",u.SPA="–",u.EPA="—",u.SOS="˜",u.SGCI="™",u.SCI="š",u.CSI="›",u.ST="œ",u.OSC="",u.PM="ž",u.APC="Ÿ"})(h||(a.C1=h={})),(function(u){u.ST=`${c.ESC}\\`})(m||(a.C1_ESCAPED=m={}))},7399:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.evaluateKeyboardEvent=void 0;const h=c(2584),m={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};a.evaluateKeyboardEvent=function(u,y,w,k){const x={type:0,cancel:!1,key:void 0},b=(u.shiftKey?1:0)|(u.altKey?2:0)|(u.ctrlKey?4:0)|(u.metaKey?8:0);switch(u.keyCode){case 0:u.key==="UIKeyInputUpArrow"?x.key=y?h.C0.ESC+"OA":h.C0.ESC+"[A":u.key==="UIKeyInputLeftArrow"?x.key=y?h.C0.ESC+"OD":h.C0.ESC+"[D":u.key==="UIKeyInputRightArrow"?x.key=y?h.C0.ESC+"OC":h.C0.ESC+"[C":u.key==="UIKeyInputDownArrow"&&(x.key=y?h.C0.ESC+"OB":h.C0.ESC+"[B");break;case 8:x.key=u.ctrlKey?"\b":h.C0.DEL,u.altKey&&(x.key=h.C0.ESC+x.key);break;case 9:if(u.shiftKey){x.key=h.C0.ESC+"[Z";break}x.key=h.C0.HT,x.cancel=!0;break;case 13:x.key=u.altKey?h.C0.ESC+h.C0.CR:h.C0.CR,x.cancel=!0;break;case 27:x.key=h.C0.ESC,u.altKey&&(x.key=h.C0.ESC+h.C0.ESC),x.cancel=!0;break;case 37:if(u.metaKey)break;b?(x.key=h.C0.ESC+"[1;"+(b+1)+"D",x.key===h.C0.ESC+"[1;3D"&&(x.key=h.C0.ESC+(w?"b":"[1;5D"))):x.key=y?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(u.metaKey)break;b?(x.key=h.C0.ESC+"[1;"+(b+1)+"C",x.key===h.C0.ESC+"[1;3C"&&(x.key=h.C0.ESC+(w?"f":"[1;5C"))):x.key=y?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(u.metaKey)break;b?(x.key=h.C0.ESC+"[1;"+(b+1)+"A",w||x.key!==h.C0.ESC+"[1;3A"||(x.key=h.C0.ESC+"[1;5A")):x.key=y?h.C0.ESC+"OA":h.C0.ESC+"[A";break;case 40:if(u.metaKey)break;b?(x.key=h.C0.ESC+"[1;"+(b+1)+"B",w||x.key!==h.C0.ESC+"[1;3B"||(x.key=h.C0.ESC+"[1;5B")):x.key=y?h.C0.ESC+"OB":h.C0.ESC+"[B";break;case 45:u.shiftKey||u.ctrlKey||(x.key=h.C0.ESC+"[2~");break;case 46:x.key=b?h.C0.ESC+"[3;"+(b+1)+"~":h.C0.ESC+"[3~";break;case 36:x.key=b?h.C0.ESC+"[1;"+(b+1)+"H":y?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:x.key=b?h.C0.ESC+"[1;"+(b+1)+"F":y?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:u.shiftKey?x.type=2:u.ctrlKey?x.key=h.C0.ESC+"[5;"+(b+1)+"~":x.key=h.C0.ESC+"[5~";break;case 34:u.shiftKey?x.type=3:u.ctrlKey?x.key=h.C0.ESC+"[6;"+(b+1)+"~":x.key=h.C0.ESC+"[6~";break;case 112:x.key=b?h.C0.ESC+"[1;"+(b+1)+"P":h.C0.ESC+"OP";break;case 113:x.key=b?h.C0.ESC+"[1;"+(b+1)+"Q":h.C0.ESC+"OQ";break;case 114:x.key=b?h.C0.ESC+"[1;"+(b+1)+"R":h.C0.ESC+"OR";break;case 115:x.key=b?h.C0.ESC+"[1;"+(b+1)+"S":h.C0.ESC+"OS";break;case 116:x.key=b?h.C0.ESC+"[15;"+(b+1)+"~":h.C0.ESC+"[15~";break;case 117:x.key=b?h.C0.ESC+"[17;"+(b+1)+"~":h.C0.ESC+"[17~";break;case 118:x.key=b?h.C0.ESC+"[18;"+(b+1)+"~":h.C0.ESC+"[18~";break;case 119:x.key=b?h.C0.ESC+"[19;"+(b+1)+"~":h.C0.ESC+"[19~";break;case 120:x.key=b?h.C0.ESC+"[20;"+(b+1)+"~":h.C0.ESC+"[20~";break;case 121:x.key=b?h.C0.ESC+"[21;"+(b+1)+"~":h.C0.ESC+"[21~";break;case 122:x.key=b?h.C0.ESC+"[23;"+(b+1)+"~":h.C0.ESC+"[23~";break;case 123:x.key=b?h.C0.ESC+"[24;"+(b+1)+"~":h.C0.ESC+"[24~";break;default:if(!u.ctrlKey||u.shiftKey||u.altKey||u.metaKey)if(w&&!k||!u.altKey||u.metaKey)!w||u.altKey||u.ctrlKey||u.shiftKey||!u.metaKey?u.key&&!u.ctrlKey&&!u.altKey&&!u.metaKey&&u.keyCode>=48&&u.key.length===1?x.key=u.key:u.key&&u.ctrlKey&&(u.key==="_"&&(x.key=h.C0.US),u.key==="@"&&(x.key=h.C0.NUL)):u.keyCode===65&&(x.type=1);else{const S=m[u.keyCode],g=S==null?void 0:S[u.shiftKey?1:0];if(g)x.key=h.C0.ESC+g;else if(u.keyCode>=65&&u.keyCode<=90){const v=u.ctrlKey?u.keyCode-64:u.keyCode+32;let E=String.fromCharCode(v);u.shiftKey&&(E=E.toUpperCase()),x.key=h.C0.ESC+E}else if(u.keyCode===32)x.key=h.C0.ESC+(u.ctrlKey?h.C0.NUL:" ");else if(u.key==="Dead"&&u.code.startsWith("Key")){let v=u.code.slice(3,4);u.shiftKey||(v=v.toLowerCase()),x.key=h.C0.ESC+v,x.cancel=!0}}else u.keyCode>=65&&u.keyCode<=90?x.key=String.fromCharCode(u.keyCode-64):u.keyCode===32?x.key=h.C0.NUL:u.keyCode>=51&&u.keyCode<=55?x.key=String.fromCharCode(u.keyCode-51+27):u.keyCode===56?x.key=h.C0.DEL:u.keyCode===219?x.key=h.C0.ESC:u.keyCode===220?x.key=h.C0.FS:u.keyCode===221&&(x.key=h.C0.GS)}return x}},482:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Utf8ToUtf32=a.StringToUtf32=a.utf32ToString=a.stringFromCodePoint=void 0,a.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},a.utf32ToString=function(c,h=0,m=c.length){let u="";for(let y=h;y<m;++y){let w=c[y];w>65535?(w-=65536,u+=String.fromCharCode(55296+(w>>10))+String.fromCharCode(w%1024+56320)):u+=String.fromCharCode(w)}return u},a.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,h){const m=c.length;if(!m)return 0;let u=0,y=0;if(this._interim){const w=c.charCodeAt(y++);56320<=w&&w<=57343?h[u++]=1024*(this._interim-55296)+w-56320+65536:(h[u++]=this._interim,h[u++]=w),this._interim=0}for(let w=y;w<m;++w){const k=c.charCodeAt(w);if(55296<=k&&k<=56319){if(++w>=m)return this._interim=k,u;const x=c.charCodeAt(w);56320<=x&&x<=57343?h[u++]=1024*(k-55296)+x-56320+65536:(h[u++]=k,h[u++]=x)}else k!==65279&&(h[u++]=k)}return u}},a.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,h){const m=c.length;if(!m)return 0;let u,y,w,k,x=0,b=0,S=0;if(this.interim[0]){let E=!1,L=this.interim[0];L&=(224&L)==192?31:(240&L)==224?15:7;let R,T=0;for(;(R=63&this.interim[++T])&&T<4;)L<<=6,L|=R;const A=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,M=A-T;for(;S<M;){if(S>=m)return 0;if(R=c[S++],(192&R)!=128){S--,E=!0;break}this.interim[T++]=R,L<<=6,L|=63&R}E||(A===2?L<128?S--:h[x++]=L:A===3?L<2048||L>=55296&&L<=57343||L===65279||(h[x++]=L):L<65536||L>1114111||(h[x++]=L)),this.interim.fill(0)}const g=m-4;let v=S;for(;v<m;){for(;!(!(v<g)||128&(u=c[v])||128&(y=c[v+1])||128&(w=c[v+2])||128&(k=c[v+3]));)h[x++]=u,h[x++]=y,h[x++]=w,h[x++]=k,v+=4;if(u=c[v++],u<128)h[x++]=u;else if((224&u)==192){if(v>=m)return this.interim[0]=u,x;if(y=c[v++],(192&y)!=128){v--;continue}if(b=(31&u)<<6|63&y,b<128){v--;continue}h[x++]=b}else if((240&u)==224){if(v>=m)return this.interim[0]=u,x;if(y=c[v++],(192&y)!=128){v--;continue}if(v>=m)return this.interim[0]=u,this.interim[1]=y,x;if(w=c[v++],(192&w)!=128){v--;continue}if(b=(15&u)<<12|(63&y)<<6|63&w,b<2048||b>=55296&&b<=57343||b===65279)continue;h[x++]=b}else if((248&u)==240){if(v>=m)return this.interim[0]=u,x;if(y=c[v++],(192&y)!=128){v--;continue}if(v>=m)return this.interim[0]=u,this.interim[1]=y,x;if(w=c[v++],(192&w)!=128){v--;continue}if(v>=m)return this.interim[0]=u,this.interim[1]=y,this.interim[2]=w,x;if(k=c[v++],(192&k)!=128){v--;continue}if(b=(7&u)<<18|(63&y)<<12|(63&w)<<6|63&k,b<65536||b>1114111)continue;h[x++]=b}}return x}}},225:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeV6=void 0;const h=c(1480),m=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],u=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let y;a.UnicodeV6=class{constructor(){if(this.version="6",!y){y=new Uint8Array(65536),y.fill(1),y[0]=0,y.fill(0,1,32),y.fill(0,127,160),y.fill(2,4352,4448),y[9001]=2,y[9002]=2,y.fill(2,11904,42192),y[12351]=1,y.fill(2,44032,55204),y.fill(2,63744,64256),y.fill(2,65040,65050),y.fill(2,65072,65136),y.fill(2,65280,65377),y.fill(2,65504,65511);for(let w=0;w<m.length;++w)y.fill(0,m[w][0],m[w][1]+1)}}wcwidth(w){return w<32?0:w<127?1:w<65536?y[w]:(function(k,x){let b,S=0,g=x.length-1;if(k<x[0][0]||k>x[g][1])return!1;for(;g>=S;)if(b=S+g>>1,k>x[b][1])S=b+1;else{if(!(k<x[b][0]))return!0;g=b-1}return!1})(w,u)?0:w>=131072&&w<=196605||w>=196608&&w<=262141?2:1}charProperties(w,k){let x=this.wcwidth(w),b=x===0&&k!==0;if(b){const S=h.UnicodeService.extractWidth(k);S===0?b=!1:S>x&&(x=S)}return h.UnicodeService.createPropertyValue(0,x,b)}}},5981:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WriteBuffer=void 0;const h=c(8460),m=c(844);class u extends m.Disposable{constructor(w){super(),this._action=w,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new h.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(w,k){if(k!==void 0&&this._syncCalls>k)return void(this._syncCalls=0);if(this._pendingData+=w.length,this._writeBuffer.push(w),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let x;for(this._isSyncWriting=!0;x=this._writeBuffer.shift();){this._action(x);const b=this._callbacks.shift();b&&b()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(w,k){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=w.length,this._writeBuffer.push(w),this._callbacks.push(k),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=w.length,this._writeBuffer.push(w),this._callbacks.push(k)}_innerWrite(w=0,k=!0){const x=w||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const b=this._writeBuffer[this._bufferOffset],S=this._action(b,k);if(S){const v=E=>Date.now()-x>=12?setTimeout((()=>this._innerWrite(0,E))):this._innerWrite(x,E);return void S.catch((E=>(queueMicrotask((()=>{throw E})),Promise.resolve(!1)))).then(v)}const g=this._callbacks[this._bufferOffset];if(g&&g(),this._bufferOffset++,this._pendingData-=b.length,Date.now()-x>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}a.WriteBuffer=u},5941:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.toRgbString=a.parseColor=void 0;const c=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,h=/^[\da-f]+$/;function m(u,y){const w=u.toString(16),k=w.length<2?"0"+w:w;switch(y){case 4:return w[0];case 8:return k;case 12:return(k+k).slice(0,3);default:return k+k}}a.parseColor=function(u){if(!u)return;let y=u.toLowerCase();if(y.indexOf("rgb:")===0){y=y.slice(4);const w=c.exec(y);if(w){const k=w[1]?15:w[4]?255:w[7]?4095:65535;return[Math.round(parseInt(w[1]||w[4]||w[7]||w[10],16)/k*255),Math.round(parseInt(w[2]||w[5]||w[8]||w[11],16)/k*255),Math.round(parseInt(w[3]||w[6]||w[9]||w[12],16)/k*255)]}}else if(y.indexOf("#")===0&&(y=y.slice(1),h.exec(y)&&[3,6,9,12].includes(y.length))){const w=y.length/3,k=[0,0,0];for(let x=0;x<3;++x){const b=parseInt(y.slice(w*x,w*x+w),16);k[x]=w===1?b<<4:w===2?b:w===3?b>>4:b>>8}return k}},a.toRgbString=function(u,y=16){const[w,k,x]=u;return`rgb:${m(w,y)}/${m(k,y)}/${m(x,y)}`}},5770:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.PAYLOAD_LIMIT=void 0,a.PAYLOAD_LIMIT=1e7},6351:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DcsHandler=a.DcsParser=void 0;const h=c(482),m=c(8742),u=c(5770),y=[];a.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=y,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=y}registerHandler(k,x){this._handlers[k]===void 0&&(this._handlers[k]=[]);const b=this._handlers[k];return b.push(x),{dispose:()=>{const S=b.indexOf(x);S!==-1&&b.splice(S,1)}}}clearHandler(k){this._handlers[k]&&delete this._handlers[k]}setHandlerFallback(k){this._handlerFb=k}reset(){if(this._active.length)for(let k=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;k>=0;--k)this._active[k].unhook(!1);this._stack.paused=!1,this._active=y,this._ident=0}hook(k,x){if(this.reset(),this._ident=k,this._active=this._handlers[k]||y,this._active.length)for(let b=this._active.length-1;b>=0;b--)this._active[b].hook(x);else this._handlerFb(this._ident,"HOOK",x)}put(k,x,b){if(this._active.length)for(let S=this._active.length-1;S>=0;S--)this._active[S].put(k,x,b);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(k,x,b))}unhook(k,x=!0){if(this._active.length){let b=!1,S=this._active.length-1,g=!1;if(this._stack.paused&&(S=this._stack.loopPosition-1,b=x,g=this._stack.fallThrough,this._stack.paused=!1),!g&&b===!1){for(;S>=0&&(b=this._active[S].unhook(k),b!==!0);S--)if(b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!1,b;S--}for(;S>=0;S--)if(b=this._active[S].unhook(!1),b instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!0,b}else this._handlerFb(this._ident,"UNHOOK",k);this._active=y,this._ident=0}};const w=new m.Params;w.addParam(0),a.DcsHandler=class{constructor(k){this._handler=k,this._data="",this._params=w,this._hitLimit=!1}hook(k){this._params=k.length>1||k.params[0]?k.clone():w,this._data="",this._hitLimit=!1}put(k,x,b){this._hitLimit||(this._data+=(0,h.utf32ToString)(k,x,b),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(k){let x=!1;if(this._hitLimit)x=!1;else if(k&&(x=this._handler(this._data,this._params),x instanceof Promise))return x.then((b=>(this._params=w,this._data="",this._hitLimit=!1,b)));return this._params=w,this._data="",this._hitLimit=!1,x}}},2015:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.EscapeSequenceParser=a.VT500_TRANSITION_TABLE=a.TransitionTable=void 0;const h=c(844),m=c(8742),u=c(6242),y=c(6351);class w{constructor(S){this.table=new Uint8Array(S)}setDefault(S,g){this.table.fill(S<<4|g)}add(S,g,v,E){this.table[g<<8|S]=v<<4|E}addMany(S,g,v,E){for(let L=0;L<S.length;L++)this.table[g<<8|S[L]]=v<<4|E}}a.TransitionTable=w;const k=160;a.VT500_TRANSITION_TABLE=(function(){const b=new w(4095),S=Array.apply(null,Array(256)).map(((T,A)=>A)),g=(T,A)=>S.slice(T,A),v=g(32,127),E=g(0,24);E.push(25),E.push.apply(E,g(28,32));const L=g(0,14);let R;for(R in b.setDefault(1,0),b.addMany(v,0,2,0),L)b.addMany([24,26,153,154],R,3,0),b.addMany(g(128,144),R,3,0),b.addMany(g(144,152),R,3,0),b.add(156,R,0,0),b.add(27,R,11,1),b.add(157,R,4,8),b.addMany([152,158,159],R,0,7),b.add(155,R,11,3),b.add(144,R,11,9);return b.addMany(E,0,3,0),b.addMany(E,1,3,1),b.add(127,1,0,1),b.addMany(E,8,0,8),b.addMany(E,3,3,3),b.add(127,3,0,3),b.addMany(E,4,3,4),b.add(127,4,0,4),b.addMany(E,6,3,6),b.addMany(E,5,3,5),b.add(127,5,0,5),b.addMany(E,2,3,2),b.add(127,2,0,2),b.add(93,1,4,8),b.addMany(v,8,5,8),b.add(127,8,5,8),b.addMany([156,27,24,26,7],8,6,0),b.addMany(g(28,32),8,0,8),b.addMany([88,94,95],1,0,7),b.addMany(v,7,0,7),b.addMany(E,7,0,7),b.add(156,7,0,0),b.add(127,7,0,7),b.add(91,1,11,3),b.addMany(g(64,127),3,7,0),b.addMany(g(48,60),3,8,4),b.addMany([60,61,62,63],3,9,4),b.addMany(g(48,60),4,8,4),b.addMany(g(64,127),4,7,0),b.addMany([60,61,62,63],4,0,6),b.addMany(g(32,64),6,0,6),b.add(127,6,0,6),b.addMany(g(64,127),6,0,0),b.addMany(g(32,48),3,9,5),b.addMany(g(32,48),5,9,5),b.addMany(g(48,64),5,0,6),b.addMany(g(64,127),5,7,0),b.addMany(g(32,48),4,9,5),b.addMany(g(32,48),1,9,2),b.addMany(g(32,48),2,9,2),b.addMany(g(48,127),2,10,0),b.addMany(g(48,80),1,10,0),b.addMany(g(81,88),1,10,0),b.addMany([89,90,92],1,10,0),b.addMany(g(96,127),1,10,0),b.add(80,1,11,9),b.addMany(E,9,0,9),b.add(127,9,0,9),b.addMany(g(28,32),9,0,9),b.addMany(g(32,48),9,9,12),b.addMany(g(48,60),9,8,10),b.addMany([60,61,62,63],9,9,10),b.addMany(E,11,0,11),b.addMany(g(32,128),11,0,11),b.addMany(g(28,32),11,0,11),b.addMany(E,10,0,10),b.add(127,10,0,10),b.addMany(g(28,32),10,0,10),b.addMany(g(48,60),10,8,10),b.addMany([60,61,62,63],10,0,11),b.addMany(g(32,48),10,9,12),b.addMany(E,12,0,12),b.add(127,12,0,12),b.addMany(g(28,32),12,0,12),b.addMany(g(32,48),12,9,12),b.addMany(g(48,64),12,0,11),b.addMany(g(64,127),12,12,13),b.addMany(g(64,127),10,12,13),b.addMany(g(64,127),9,12,13),b.addMany(E,13,13,13),b.addMany(v,13,13,13),b.add(127,13,0,13),b.addMany([27,156,24,26],13,14,0),b.add(k,0,2,0),b.add(k,8,5,8),b.add(k,6,0,6),b.add(k,11,0,11),b.add(k,13,13,13),b})();class x extends h.Disposable{constructor(S=a.VT500_TRANSITION_TABLE){super(),this._transitions=S,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new m.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(g,v,E)=>{},this._executeHandlerFb=g=>{},this._csiHandlerFb=(g,v)=>{},this._escHandlerFb=g=>{},this._errorHandlerFb=g=>g,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,h.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new u.OscParser),this._dcsParser=this.register(new y.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(S,g=[64,126]){let v=0;if(S.prefix){if(S.prefix.length>1)throw new Error("only one byte as prefix supported");if(v=S.prefix.charCodeAt(0),v&&60>v||v>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(S.intermediates){if(S.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let L=0;L<S.intermediates.length;++L){const R=S.intermediates.charCodeAt(L);if(32>R||R>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");v<<=8,v|=R}}if(S.final.length!==1)throw new Error("final must be a single byte");const E=S.final.charCodeAt(0);if(g[0]>E||E>g[1])throw new Error(`final must be in range ${g[0]} .. ${g[1]}`);return v<<=8,v|=E,v}identToString(S){const g=[];for(;S;)g.push(String.fromCharCode(255&S)),S>>=8;return g.reverse().join("")}setPrintHandler(S){this._printHandler=S}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(S,g){const v=this._identifier(S,[48,126]);this._escHandlers[v]===void 0&&(this._escHandlers[v]=[]);const E=this._escHandlers[v];return E.push(g),{dispose:()=>{const L=E.indexOf(g);L!==-1&&E.splice(L,1)}}}clearEscHandler(S){this._escHandlers[this._identifier(S,[48,126])]&&delete this._escHandlers[this._identifier(S,[48,126])]}setEscHandlerFallback(S){this._escHandlerFb=S}setExecuteHandler(S,g){this._executeHandlers[S.charCodeAt(0)]=g}clearExecuteHandler(S){this._executeHandlers[S.charCodeAt(0)]&&delete this._executeHandlers[S.charCodeAt(0)]}setExecuteHandlerFallback(S){this._executeHandlerFb=S}registerCsiHandler(S,g){const v=this._identifier(S);this._csiHandlers[v]===void 0&&(this._csiHandlers[v]=[]);const E=this._csiHandlers[v];return E.push(g),{dispose:()=>{const L=E.indexOf(g);L!==-1&&E.splice(L,1)}}}clearCsiHandler(S){this._csiHandlers[this._identifier(S)]&&delete this._csiHandlers[this._identifier(S)]}setCsiHandlerFallback(S){this._csiHandlerFb=S}registerDcsHandler(S,g){return this._dcsParser.registerHandler(this._identifier(S),g)}clearDcsHandler(S){this._dcsParser.clearHandler(this._identifier(S))}setDcsHandlerFallback(S){this._dcsParser.setHandlerFallback(S)}registerOscHandler(S,g){return this._oscParser.registerHandler(S,g)}clearOscHandler(S){this._oscParser.clearHandler(S)}setOscHandlerFallback(S){this._oscParser.setHandlerFallback(S)}setErrorHandler(S){this._errorHandler=S}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(S,g,v,E,L){this._parseStack.state=S,this._parseStack.handlers=g,this._parseStack.handlerPos=v,this._parseStack.transition=E,this._parseStack.chunkPos=L}parse(S,g,v){let E,L=0,R=0,T=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,T=this._parseStack.chunkPos+1;else{if(v===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const A=this._parseStack.handlers;let M=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(v===!1&&M>-1){for(;M>=0&&(E=A[M](this._params),E!==!0);M--)if(E instanceof Promise)return this._parseStack.handlerPos=M,E}this._parseStack.handlers=[];break;case 4:if(v===!1&&M>-1){for(;M>=0&&(E=A[M](),E!==!0);M--)if(E instanceof Promise)return this._parseStack.handlerPos=M,E}this._parseStack.handlers=[];break;case 6:if(L=S[this._parseStack.chunkPos],E=this._dcsParser.unhook(L!==24&&L!==26,v),E)return E;L===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(L=S[this._parseStack.chunkPos],E=this._oscParser.end(L!==24&&L!==26,v),E)return E;L===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,T=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let A=T;A<g;++A){switch(L=S[A],R=this._transitions.table[this.currentState<<8|(L<160?L:k)],R>>4){case 2:for(let F=A+1;;++F){if(F>=g||(L=S[F])<32||L>126&&L<k){this._printHandler(S,A,F),A=F-1;break}if(++F>=g||(L=S[F])<32||L>126&&L<k){this._printHandler(S,A,F),A=F-1;break}if(++F>=g||(L=S[F])<32||L>126&&L<k){this._printHandler(S,A,F),A=F-1;break}if(++F>=g||(L=S[F])<32||L>126&&L<k){this._printHandler(S,A,F),A=F-1;break}}break;case 3:this._executeHandlers[L]?this._executeHandlers[L]():this._executeHandlerFb(L),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:A,code:L,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const M=this._csiHandlers[this._collect<<8|L];let j=M?M.length-1:-1;for(;j>=0&&(E=M[j](this._params),E!==!0);j--)if(E instanceof Promise)return this._preserveStack(3,M,j,R,A),E;j<0&&this._csiHandlerFb(this._collect<<8|L,this._params),this.precedingJoinState=0;break;case 8:do switch(L){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(L-48)}while(++A<g&&(L=S[A])>47&&L<60);A--;break;case 9:this._collect<<=8,this._collect|=L;break;case 10:const I=this._escHandlers[this._collect<<8|L];let U=I?I.length-1:-1;for(;U>=0&&(E=I[U](),E!==!0);U--)if(E instanceof Promise)return this._preserveStack(4,I,U,R,A),E;U<0&&this._escHandlerFb(this._collect<<8|L),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|L,this._params);break;case 13:for(let F=A+1;;++F)if(F>=g||(L=S[F])===24||L===26||L===27||L>127&&L<k){this._dcsParser.put(S,A,F),A=F-1;break}break;case 14:if(E=this._dcsParser.unhook(L!==24&&L!==26),E)return this._preserveStack(6,[],0,R,A),E;L===27&&(R|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let F=A+1;;F++)if(F>=g||(L=S[F])<32||L>127&&L<k){this._oscParser.put(S,A,F),A=F-1;break}break;case 6:if(E=this._oscParser.end(L!==24&&L!==26),E)return this._preserveStack(5,[],0,R,A),E;L===27&&(R|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&R}}}a.EscapeSequenceParser=x},6242:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OscHandler=a.OscParser=void 0;const h=c(5770),m=c(482),u=[];a.OscParser=class{constructor(){this._state=0,this._active=u,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(y,w){this._handlers[y]===void 0&&(this._handlers[y]=[]);const k=this._handlers[y];return k.push(w),{dispose:()=>{const x=k.indexOf(w);x!==-1&&k.splice(x,1)}}}clearHandler(y){this._handlers[y]&&delete this._handlers[y]}setHandlerFallback(y){this._handlerFb=y}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=u}reset(){if(this._state===2)for(let y=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;y>=0;--y)this._active[y].end(!1);this._stack.paused=!1,this._active=u,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||u,this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].start();else this._handlerFb(this._id,"START")}_put(y,w,k){if(this._active.length)for(let x=this._active.length-1;x>=0;x--)this._active[x].put(y,w,k);else this._handlerFb(this._id,"PUT",(0,m.utf32ToString)(y,w,k))}start(){this.reset(),this._state=1}put(y,w,k){if(this._state!==3){if(this._state===1)for(;w<k;){const x=y[w++];if(x===59){this._state=2,this._start();break}if(x<48||57<x)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+x-48}this._state===2&&k-w>0&&this._put(y,w,k)}}end(y,w=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let k=!1,x=this._active.length-1,b=!1;if(this._stack.paused&&(x=this._stack.loopPosition-1,k=w,b=this._stack.fallThrough,this._stack.paused=!1),!b&&k===!1){for(;x>=0&&(k=this._active[x].end(y),k!==!0);x--)if(k instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=x,this._stack.fallThrough=!1,k;x--}for(;x>=0;x--)if(k=this._active[x].end(!1),k instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=x,this._stack.fallThrough=!0,k}else this._handlerFb(this._id,"END",y);this._active=u,this._id=-1,this._state=0}}},a.OscHandler=class{constructor(y){this._handler=y,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(y,w,k){this._hitLimit||(this._data+=(0,m.utf32ToString)(y,w,k),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(y){let w=!1;if(this._hitLimit)w=!1;else if(y&&(w=this._handler(this._data),w instanceof Promise))return w.then((k=>(this._data="",this._hitLimit=!1,k)));return this._data="",this._hitLimit=!1,w}}},8742:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Params=void 0;const c=2147483647;class h{static fromArray(u){const y=new h;if(!u.length)return y;for(let w=Array.isArray(u[0])?1:0;w<u.length;++w){const k=u[w];if(Array.isArray(k))for(let x=0;x<k.length;++x)y.addSubParam(k[x]);else y.addParam(k)}return y}constructor(u=32,y=32){if(this.maxLength=u,this.maxSubParamsLength=y,y>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(u),this.length=0,this._subParams=new Int32Array(y),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(u),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const u=new h(this.maxLength,this.maxSubParamsLength);return u.params.set(this.params),u.length=this.length,u._subParams.set(this._subParams),u._subParamsLength=this._subParamsLength,u._subParamsIdx.set(this._subParamsIdx),u._rejectDigits=this._rejectDigits,u._rejectSubDigits=this._rejectSubDigits,u._digitIsSub=this._digitIsSub,u}toArray(){const u=[];for(let y=0;y<this.length;++y){u.push(this.params[y]);const w=this._subParamsIdx[y]>>8,k=255&this._subParamsIdx[y];k-w>0&&u.push(Array.prototype.slice.call(this._subParams,w,k))}return u}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(u){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=u>c?c:u}}addSubParam(u){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=u>c?c:u,this._subParamsIdx[this.length-1]++}}hasSubParams(u){return(255&this._subParamsIdx[u])-(this._subParamsIdx[u]>>8)>0}getSubParams(u){const y=this._subParamsIdx[u]>>8,w=255&this._subParamsIdx[u];return w-y>0?this._subParams.subarray(y,w):null}getSubParamsAll(){const u={};for(let y=0;y<this.length;++y){const w=this._subParamsIdx[y]>>8,k=255&this._subParamsIdx[y];k-w>0&&(u[y]=this._subParams.slice(w,k))}return u}addDigit(u){let y;if(this._rejectDigits||!(y=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const w=this._digitIsSub?this._subParams:this.params,k=w[y-1];w[y-1]=~k?Math.min(10*k+u,c):u}}a.Params=h},5741:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.AddonManager=void 0,a.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,h){const m={instance:h,dispose:h.dispose,isDisposed:!1};this._addons.push(m),h.dispose=()=>this._wrappedAddonDispose(m),h.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let h=-1;for(let m=0;m<this._addons.length;m++)if(this._addons[m]===c){h=m;break}if(h===-1)throw new Error("Could not dispose an addon that has not been loaded");c.isDisposed=!0,c.dispose.apply(c.instance),this._addons.splice(h,1)}}},8771:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferApiView=void 0;const h=c(3785),m=c(511);a.BufferApiView=class{constructor(u,y){this._buffer=u,this.type=y}init(u){return this._buffer=u,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(u){const y=this._buffer.lines.get(u);if(y)return new h.BufferLineApiView(y)}getNullCell(){return new m.CellData}}},3785:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLineApiView=void 0;const h=c(511);a.BufferLineApiView=class{constructor(m){this._line=m}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(m,u){if(!(m<0||m>=this._line.length))return u?(this._line.loadCell(m,u),u):this._line.loadCell(m,new h.CellData)}translateToString(m,u,y){return this._line.translateToString(m,u,y)}}},8285:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferNamespaceApi=void 0;const h=c(8771),m=c(8460),u=c(844);class y extends u.Disposable{constructor(k){super(),this._core=k,this._onBufferChange=this.register(new m.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new h.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new h.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}a.BufferNamespaceApi=y},7975:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ParserApi=void 0,a.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,h){return this._core.registerCsiHandler(c,(m=>h(m.toArray())))}addCsiHandler(c,h){return this.registerCsiHandler(c,h)}registerDcsHandler(c,h){return this._core.registerDcsHandler(c,((m,u)=>h(m,u.toArray())))}addDcsHandler(c,h){return this.registerDcsHandler(c,h)}registerEscHandler(c,h){return this._core.registerEscHandler(c,h)}addEscHandler(c,h){return this.registerEscHandler(c,h)}registerOscHandler(c,h){return this._core.registerOscHandler(c,h)}addOscHandler(c,h){return this.registerOscHandler(c,h)}}},7090:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeApi=void 0,a.UnicodeApi=class{constructor(c){this._core=c}register(c){this._core.unicodeService.register(c)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(c){this._core.unicodeService.activeVersion=c}}},744:function(f,a,c){var h=this&&this.__decorate||function(b,S,g,v){var E,L=arguments.length,R=L<3?S:v===null?v=Object.getOwnPropertyDescriptor(S,g):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(b,S,g,v);else for(var T=b.length-1;T>=0;T--)(E=b[T])&&(R=(L<3?E(R):L>3?E(S,g,R):E(S,g))||R);return L>3&&R&&Object.defineProperty(S,g,R),R},m=this&&this.__param||function(b,S){return function(g,v){S(g,v,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferService=a.MINIMUM_ROWS=a.MINIMUM_COLS=void 0;const u=c(8460),y=c(844),w=c(5295),k=c(2585);a.MINIMUM_COLS=2,a.MINIMUM_ROWS=1;let x=a.BufferService=class extends y.Disposable{get buffer(){return this.buffers.active}constructor(b){super(),this.isUserScrolling=!1,this._onResize=this.register(new u.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new u.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(b.rawOptions.cols||0,a.MINIMUM_COLS),this.rows=Math.max(b.rawOptions.rows||0,a.MINIMUM_ROWS),this.buffers=this.register(new w.BufferSet(b,this))}resize(b,S){this.cols=b,this.rows=S,this.buffers.resize(b,S),this._onResize.fire({cols:b,rows:S})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(b,S=!1){const g=this.buffer;let v;v=this._cachedBlankLine,v&&v.length===this.cols&&v.getFg(0)===b.fg&&v.getBg(0)===b.bg||(v=g.getBlankLine(b,S),this._cachedBlankLine=v),v.isWrapped=S;const E=g.ybase+g.scrollTop,L=g.ybase+g.scrollBottom;if(g.scrollTop===0){const R=g.lines.isFull;L===g.lines.length-1?R?g.lines.recycle().copyFrom(v):g.lines.push(v.clone()):g.lines.splice(L+1,0,v.clone()),R?this.isUserScrolling&&(g.ydisp=Math.max(g.ydisp-1,0)):(g.ybase++,this.isUserScrolling||g.ydisp++)}else{const R=L-E+1;g.lines.shiftElements(E+1,R-1,-1),g.lines.set(L,v.clone())}this.isUserScrolling||(g.ydisp=g.ybase),this._onScroll.fire(g.ydisp)}scrollLines(b,S,g){const v=this.buffer;if(b<0){if(v.ydisp===0)return;this.isUserScrolling=!0}else b+v.ydisp>=v.ybase&&(this.isUserScrolling=!1);const E=v.ydisp;v.ydisp=Math.max(Math.min(v.ydisp+b,v.ybase),0),E!==v.ydisp&&(S||this._onScroll.fire(v.ydisp))}};a.BufferService=x=h([m(0,k.IOptionsService)],x)},7994:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CharsetService=void 0,a.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(c){this.glevel=c,this.charset=this._charsets[c]}setgCharset(c,h){this._charsets[c]=h,this.glevel===c&&(this.charset=h)}}},1753:function(f,a,c){var h=this&&this.__decorate||function(v,E,L,R){var T,A=arguments.length,M=A<3?E:R===null?R=Object.getOwnPropertyDescriptor(E,L):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(v,E,L,R);else for(var j=v.length-1;j>=0;j--)(T=v[j])&&(M=(A<3?T(M):A>3?T(E,L,M):T(E,L))||M);return A>3&&M&&Object.defineProperty(E,L,M),M},m=this&&this.__param||function(v,E){return function(L,R){E(L,R,v)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreMouseService=void 0;const u=c(2585),y=c(8460),w=c(844),k={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:v=>v.button!==4&&v.action===1&&(v.ctrl=!1,v.alt=!1,v.shift=!1,!0)},VT200:{events:19,restrict:v=>v.action!==32},DRAG:{events:23,restrict:v=>v.action!==32||v.button!==3},ANY:{events:31,restrict:v=>!0}};function x(v,E){let L=(v.ctrl?16:0)|(v.shift?4:0)|(v.alt?8:0);return v.button===4?(L|=64,L|=v.action):(L|=3&v.button,4&v.button&&(L|=64),8&v.button&&(L|=128),v.action===32?L|=32:v.action!==0||E||(L|=3)),L}const b=String.fromCharCode,S={DEFAULT:v=>{const E=[x(v,!1)+32,v.col+32,v.row+32];return E[0]>255||E[1]>255||E[2]>255?"":`\x1B[M${b(E[0])}${b(E[1])}${b(E[2])}`},SGR:v=>{const E=v.action===0&&v.button!==4?"m":"M";return`\x1B[<${x(v,!0)};${v.col};${v.row}${E}`},SGR_PIXELS:v=>{const E=v.action===0&&v.button!==4?"m":"M";return`\x1B[<${x(v,!0)};${v.x};${v.y}${E}`}};let g=a.CoreMouseService=class extends w.Disposable{constructor(v,E){super(),this._bufferService=v,this._coreService=E,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new y.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const L of Object.keys(k))this.addProtocol(L,k[L]);for(const L of Object.keys(S))this.addEncoding(L,S[L]);this.reset()}addProtocol(v,E){this._protocols[v]=E}addEncoding(v,E){this._encodings[v]=E}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(v){if(!this._protocols[v])throw new Error(`unknown protocol "${v}"`);this._activeProtocol=v,this._onProtocolChange.fire(this._protocols[v].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(v){if(!this._encodings[v])throw new Error(`unknown encoding "${v}"`);this._activeEncoding=v}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(v){if(v.col<0||v.col>=this._bufferService.cols||v.row<0||v.row>=this._bufferService.rows||v.button===4&&v.action===32||v.button===3&&v.action!==32||v.button!==4&&(v.action===2||v.action===3)||(v.col++,v.row++,v.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,v,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(v))return!1;const E=this._encodings[this._activeEncoding](v);return E&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(E):this._coreService.triggerDataEvent(E,!0)),this._lastEvent=v,!0}explainEvents(v){return{down:!!(1&v),up:!!(2&v),drag:!!(4&v),move:!!(8&v),wheel:!!(16&v)}}_equalEvents(v,E,L){if(L){if(v.x!==E.x||v.y!==E.y)return!1}else if(v.col!==E.col||v.row!==E.row)return!1;return v.button===E.button&&v.action===E.action&&v.ctrl===E.ctrl&&v.alt===E.alt&&v.shift===E.shift}};a.CoreMouseService=g=h([m(0,u.IBufferService),m(1,u.ICoreService)],g)},6975:function(f,a,c){var h=this&&this.__decorate||function(g,v,E,L){var R,T=arguments.length,A=T<3?v:L===null?L=Object.getOwnPropertyDescriptor(v,E):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(g,v,E,L);else for(var M=g.length-1;M>=0;M--)(R=g[M])&&(A=(T<3?R(A):T>3?R(v,E,A):R(v,E))||A);return T>3&&A&&Object.defineProperty(v,E,A),A},m=this&&this.__param||function(g,v){return function(E,L){v(E,L,g)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreService=void 0;const u=c(1439),y=c(8460),w=c(844),k=c(2585),x=Object.freeze({insertMode:!1}),b=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let S=a.CoreService=class extends w.Disposable{constructor(g,v,E){super(),this._bufferService=g,this._logService=v,this._optionsService=E,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new y.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new y.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new y.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new y.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,u.clone)(x),this.decPrivateModes=(0,u.clone)(b)}reset(){this.modes=(0,u.clone)(x),this.decPrivateModes=(0,u.clone)(b)}triggerDataEvent(g,v=!1){if(this._optionsService.rawOptions.disableStdin)return;const E=this._bufferService.buffer;v&&this._optionsService.rawOptions.scrollOnUserInput&&E.ybase!==E.ydisp&&this._onRequestScrollToBottom.fire(),v&&this._onUserInput.fire(),this._logService.debug(`sending data "${g}"`,(()=>g.split("").map((L=>L.charCodeAt(0))))),this._onData.fire(g)}triggerBinaryEvent(g){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${g}"`,(()=>g.split("").map((v=>v.charCodeAt(0))))),this._onBinary.fire(g))}};a.CoreService=S=h([m(0,k.IBufferService),m(1,k.ILogService),m(2,k.IOptionsService)],S)},9074:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DecorationService=void 0;const h=c(8055),m=c(8460),u=c(844),y=c(6106);let w=0,k=0;class x extends u.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new y.SortedList((g=>g==null?void 0:g.marker.line)),this._onDecorationRegistered=this.register(new m.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new m.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,u.toDisposable)((()=>this.reset())))}registerDecoration(g){if(g.marker.isDisposed)return;const v=new b(g);if(v){const E=v.marker.onDispose((()=>v.dispose()));v.onDispose((()=>{v&&(this._decorations.delete(v)&&this._onDecorationRemoved.fire(v),E.dispose())})),this._decorations.insert(v),this._onDecorationRegistered.fire(v)}return v}reset(){for(const g of this._decorations.values())g.dispose();this._decorations.clear()}*getDecorationsAtCell(g,v,E){let L=0,R=0;for(const T of this._decorations.getKeyIterator(v))L=T.options.x??0,R=L+(T.options.width??1),g>=L&&g<R&&(!E||(T.options.layer??"bottom")===E)&&(yield T)}forEachDecorationAtCell(g,v,E,L){this._decorations.forEachByKey(v,(R=>{w=R.options.x??0,k=w+(R.options.width??1),g>=w&&g<k&&(!E||(R.options.layer??"bottom")===E)&&L(R)}))}}a.DecorationService=x;class b extends u.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=h.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=h.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(g){super(),this.options=g,this.onRenderEmitter=this.register(new m.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new m.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=g.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.InstantiationService=a.ServiceCollection=void 0;const h=c(2585),m=c(8343);class u{constructor(...w){this._entries=new Map;for(const[k,x]of w)this.set(k,x)}set(w,k){const x=this._entries.get(w);return this._entries.set(w,k),x}forEach(w){for(const[k,x]of this._entries.entries())w(k,x)}has(w){return this._entries.has(w)}get(w){return this._entries.get(w)}}a.ServiceCollection=u,a.InstantiationService=class{constructor(){this._services=new u,this._services.set(h.IInstantiationService,this)}setService(y,w){this._services.set(y,w)}getService(y){return this._services.get(y)}createInstance(y,...w){const k=(0,m.getServiceDependencies)(y).sort(((S,g)=>S.index-g.index)),x=[];for(const S of k){const g=this._services.get(S.id);if(!g)throw new Error(`[createInstance] ${y.name} depends on UNKNOWN service ${S.id}.`);x.push(g)}const b=k.length>0?k[0].index:w.length;if(w.length!==b)throw new Error(`[createInstance] First service dependency of ${y.name} at position ${b+1} conflicts with ${w.length} static arguments`);return new y(...w,...x)}}},7866:function(f,a,c){var h=this&&this.__decorate||function(b,S,g,v){var E,L=arguments.length,R=L<3?S:v===null?v=Object.getOwnPropertyDescriptor(S,g):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(b,S,g,v);else for(var T=b.length-1;T>=0;T--)(E=b[T])&&(R=(L<3?E(R):L>3?E(S,g,R):E(S,g))||R);return L>3&&R&&Object.defineProperty(S,g,R),R},m=this&&this.__param||function(b,S){return function(g,v){S(g,v,b)}};Object.defineProperty(a,"__esModule",{value:!0}),a.traceCall=a.setTraceLogger=a.LogService=void 0;const u=c(844),y=c(2585),w={trace:y.LogLevelEnum.TRACE,debug:y.LogLevelEnum.DEBUG,info:y.LogLevelEnum.INFO,warn:y.LogLevelEnum.WARN,error:y.LogLevelEnum.ERROR,off:y.LogLevelEnum.OFF};let k,x=a.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(b){super(),this._optionsService=b,this._logLevel=y.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),k=this}_updateLogLevel(){this._logLevel=w[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(b){for(let S=0;S<b.length;S++)typeof b[S]=="function"&&(b[S]=b[S]())}_log(b,S,g){this._evalLazyOptionalParams(g),b.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+S,...g)}trace(b,...S){var g;this._logLevel<=y.LogLevelEnum.TRACE&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.trace.bind(this._optionsService.options.logger))??console.log,b,S)}debug(b,...S){var g;this._logLevel<=y.LogLevelEnum.DEBUG&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.debug.bind(this._optionsService.options.logger))??console.log,b,S)}info(b,...S){var g;this._logLevel<=y.LogLevelEnum.INFO&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.info.bind(this._optionsService.options.logger))??console.info,b,S)}warn(b,...S){var g;this._logLevel<=y.LogLevelEnum.WARN&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.warn.bind(this._optionsService.options.logger))??console.warn,b,S)}error(b,...S){var g;this._logLevel<=y.LogLevelEnum.ERROR&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.error.bind(this._optionsService.options.logger))??console.error,b,S)}};a.LogService=x=h([m(0,y.IOptionsService)],x),a.setTraceLogger=function(b){k=b},a.traceCall=function(b,S,g){if(typeof g.value!="function")throw new Error("not supported");const v=g.value;g.value=function(...E){if(k.logLevel!==y.LogLevelEnum.TRACE)return v.apply(this,E);k.trace(`GlyphRenderer#${v.name}(${E.map((R=>JSON.stringify(R))).join(", ")})`);const L=v.apply(this,E);return k.trace(`GlyphRenderer#${v.name} return`,L),L}}},7302:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.OptionsService=a.DEFAULT_OPTIONS=void 0;const h=c(8460),m=c(844),u=c(6114);a.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:u.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const y=["normal","bold","100","200","300","400","500","600","700","800","900"];class w extends m.Disposable{constructor(x){super(),this._onOptionChange=this.register(new h.EventEmitter),this.onOptionChange=this._onOptionChange.event;const b={...a.DEFAULT_OPTIONS};for(const S in x)if(S in b)try{const g=x[S];b[S]=this._sanitizeAndValidateOption(S,g)}catch(g){console.error(g)}this.rawOptions=b,this.options={...b},this._setupOptions(),this.register((0,m.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(x,b){return this.onOptionChange((S=>{S===x&&b(this.rawOptions[x])}))}onMultipleOptionChange(x,b){return this.onOptionChange((S=>{x.indexOf(S)!==-1&&b()}))}_setupOptions(){const x=S=>{if(!(S in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${S}"`);return this.rawOptions[S]},b=(S,g)=>{if(!(S in a.DEFAULT_OPTIONS))throw new Error(`No option with key "${S}"`);g=this._sanitizeAndValidateOption(S,g),this.rawOptions[S]!==g&&(this.rawOptions[S]=g,this._onOptionChange.fire(S))};for(const S in this.rawOptions){const g={get:x.bind(this,S),set:b.bind(this,S)};Object.defineProperty(this.options,S,g)}}_sanitizeAndValidateOption(x,b){switch(x){case"cursorStyle":if(b||(b=a.DEFAULT_OPTIONS[x]),!(function(S){return S==="block"||S==="underline"||S==="bar"})(b))throw new Error(`"${b}" is not a valid value for ${x}`);break;case"wordSeparator":b||(b=a.DEFAULT_OPTIONS[x]);break;case"fontWeight":case"fontWeightBold":if(typeof b=="number"&&1<=b&&b<=1e3)break;b=y.includes(b)?b:a.DEFAULT_OPTIONS[x];break;case"cursorWidth":b=Math.floor(b);case"lineHeight":case"tabStopWidth":if(b<1)throw new Error(`${x} cannot be less than 1, value: ${b}`);break;case"minimumContrastRatio":b=Math.max(1,Math.min(21,Math.round(10*b)/10));break;case"scrollback":if((b=Math.min(b,4294967295))<0)throw new Error(`${x} cannot be less than 0, value: ${b}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(b<=0)throw new Error(`${x} cannot be less than or equal to 0, value: ${b}`);break;case"rows":case"cols":if(!b&&b!==0)throw new Error(`${x} must be numeric, value: ${b}`);break;case"windowsPty":b=b??{}}return b}}a.OptionsService=w},2660:function(f,a,c){var h=this&&this.__decorate||function(w,k,x,b){var S,g=arguments.length,v=g<3?k:b===null?b=Object.getOwnPropertyDescriptor(k,x):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(w,k,x,b);else for(var E=w.length-1;E>=0;E--)(S=w[E])&&(v=(g<3?S(v):g>3?S(k,x,v):S(k,x))||v);return g>3&&v&&Object.defineProperty(k,x,v),v},m=this&&this.__param||function(w,k){return function(x,b){k(x,b,w)}};Object.defineProperty(a,"__esModule",{value:!0}),a.OscLinkService=void 0;const u=c(2585);let y=a.OscLinkService=class{constructor(w){this._bufferService=w,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(w){const k=this._bufferService.buffer;if(w.id===void 0){const E=k.addMarker(k.ybase+k.y),L={data:w,id:this._nextId++,lines:[E]};return E.onDispose((()=>this._removeMarkerFromLink(L,E))),this._dataByLinkId.set(L.id,L),L.id}const x=w,b=this._getEntryIdKey(x),S=this._entriesWithId.get(b);if(S)return this.addLineToLink(S.id,k.ybase+k.y),S.id;const g=k.addMarker(k.ybase+k.y),v={id:this._nextId++,key:this._getEntryIdKey(x),data:x,lines:[g]};return g.onDispose((()=>this._removeMarkerFromLink(v,g))),this._entriesWithId.set(v.key,v),this._dataByLinkId.set(v.id,v),v.id}addLineToLink(w,k){const x=this._dataByLinkId.get(w);if(x&&x.lines.every((b=>b.line!==k))){const b=this._bufferService.buffer.addMarker(k);x.lines.push(b),b.onDispose((()=>this._removeMarkerFromLink(x,b)))}}getLinkData(w){var k;return(k=this._dataByLinkId.get(w))==null?void 0:k.data}_getEntryIdKey(w){return`${w.id};;${w.uri}`}_removeMarkerFromLink(w,k){const x=w.lines.indexOf(k);x!==-1&&(w.lines.splice(x,1),w.lines.length===0&&(w.data.id!==void 0&&this._entriesWithId.delete(w.key),this._dataByLinkId.delete(w.id)))}};a.OscLinkService=y=h([m(0,u.IBufferService)],y)},8343:(f,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.createDecorator=a.getServiceDependencies=a.serviceRegistry=void 0;const c="di$target",h="di$dependencies";a.serviceRegistry=new Map,a.getServiceDependencies=function(m){return m[h]||[]},a.createDecorator=function(m){if(a.serviceRegistry.has(m))return a.serviceRegistry.get(m);const u=function(y,w,k){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(x,b,S){b[c]===b?b[h].push({id:x,index:S}):(b[h]=[{id:x,index:S}],b[c]=b)})(u,y,k)};return u.toString=()=>m,a.serviceRegistry.set(m,u),u}},2585:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.IDecorationService=a.IUnicodeService=a.IOscLinkService=a.IOptionsService=a.ILogService=a.LogLevelEnum=a.IInstantiationService=a.ICharsetService=a.ICoreService=a.ICoreMouseService=a.IBufferService=void 0;const h=c(8343);var m;a.IBufferService=(0,h.createDecorator)("BufferService"),a.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),a.ICoreService=(0,h.createDecorator)("CoreService"),a.ICharsetService=(0,h.createDecorator)("CharsetService"),a.IInstantiationService=(0,h.createDecorator)("InstantiationService"),(function(u){u[u.TRACE=0]="TRACE",u[u.DEBUG=1]="DEBUG",u[u.INFO=2]="INFO",u[u.WARN=3]="WARN",u[u.ERROR=4]="ERROR",u[u.OFF=5]="OFF"})(m||(a.LogLevelEnum=m={})),a.ILogService=(0,h.createDecorator)("LogService"),a.IOptionsService=(0,h.createDecorator)("OptionsService"),a.IOscLinkService=(0,h.createDecorator)("OscLinkService"),a.IUnicodeService=(0,h.createDecorator)("UnicodeService"),a.IDecorationService=(0,h.createDecorator)("DecorationService")},1480:(f,a,c)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeService=void 0;const h=c(8460),m=c(225);class u{static extractShouldJoin(w){return(1&w)!=0}static extractWidth(w){return w>>1&3}static extractCharKind(w){return w>>3}static createPropertyValue(w,k,x=!1){return(16777215&w)<<3|(3&k)<<1|(x?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const w=new m.UnicodeV6;this.register(w),this._active=w.version,this._activeProvider=w}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(w){if(!this._providers[w])throw new Error(`unknown Unicode version "${w}"`);this._active=w,this._activeProvider=this._providers[w],this._onChange.fire(w)}register(w){this._providers[w.version]=w}wcwidth(w){return this._activeProvider.wcwidth(w)}getStringCellWidth(w){let k=0,x=0;const b=w.length;for(let S=0;S<b;++S){let g=w.charCodeAt(S);if(55296<=g&&g<=56319){if(++S>=b)return k+this.wcwidth(g);const L=w.charCodeAt(S);56320<=L&&L<=57343?g=1024*(g-55296)+L-56320+65536:k+=this.wcwidth(L)}const v=this.charProperties(g,x);let E=u.extractWidth(v);u.extractShouldJoin(v)&&(E-=u.extractWidth(x)),k+=E,x=v}return k}charProperties(w,k){return this._activeProvider.charProperties(w,k)}}a.UnicodeService=u}},o={};function d(f){var a=o[f];if(a!==void 0)return a.exports;var c=o[f]={exports:{}};return s[f].call(c.exports,c,c.exports,d),c.exports}var _={};return(()=>{var f=_;Object.defineProperty(f,"__esModule",{value:!0}),f.Terminal=void 0;const a=d(9042),c=d(3236),h=d(844),m=d(5741),u=d(8285),y=d(7975),w=d(7090),k=["cols","rows"];class x extends h.Disposable{constructor(S){super(),this._core=this.register(new c.Terminal(S)),this._addonManager=this.register(new m.AddonManager),this._publicOptions={...this._core.options};const g=E=>this._core.options[E],v=(E,L)=>{this._checkReadonlyOptions(E),this._core.options[E]=L};for(const E in this._core.options){const L={get:g.bind(this,E),set:v.bind(this,E)};Object.defineProperty(this._publicOptions,E,L)}}_checkReadonlyOptions(S){if(k.includes(S))throw new Error(`Option "${S}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new y.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new w.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new u.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const S=this._core.coreService.decPrivateModes;let g="none";switch(this._core.coreMouseService.activeProtocol){case"X10":g="x10";break;case"VT200":g="vt200";break;case"DRAG":g="drag";break;case"ANY":g="any"}return{applicationCursorKeysMode:S.applicationCursorKeys,applicationKeypadMode:S.applicationKeypad,bracketedPasteMode:S.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:g,originMode:S.origin,reverseWraparoundMode:S.reverseWraparound,sendFocusMode:S.sendFocus,wraparoundMode:S.wraparound}}get options(){return this._publicOptions}set options(S){for(const g in S)this._publicOptions[g]=S[g]}blur(){this._core.blur()}focus(){this._core.focus()}input(S,g=!0){this._core.input(S,g)}resize(S,g){this._verifyIntegers(S,g),this._core.resize(S,g)}open(S){this._core.open(S)}attachCustomKeyEventHandler(S){this._core.attachCustomKeyEventHandler(S)}attachCustomWheelEventHandler(S){this._core.attachCustomWheelEventHandler(S)}registerLinkProvider(S){return this._core.registerLinkProvider(S)}registerCharacterJoiner(S){return this._checkProposedApi(),this._core.registerCharacterJoiner(S)}deregisterCharacterJoiner(S){this._checkProposedApi(),this._core.deregisterCharacterJoiner(S)}registerMarker(S=0){return this._verifyIntegers(S),this._core.registerMarker(S)}registerDecoration(S){return this._checkProposedApi(),this._verifyPositiveIntegers(S.x??0,S.width??0,S.height??0),this._core.registerDecoration(S)}hasSelection(){return this._core.hasSelection()}select(S,g,v){this._verifyIntegers(S,g,v),this._core.select(S,g,v)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(S,g){this._verifyIntegers(S,g),this._core.selectLines(S,g)}dispose(){super.dispose()}scrollLines(S){this._verifyIntegers(S),this._core.scrollLines(S)}scrollPages(S){this._verifyIntegers(S),this._core.scrollPages(S)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(S){this._verifyIntegers(S),this._core.scrollToLine(S)}clear(){this._core.clear()}write(S,g){this._core.write(S,g)}writeln(S,g){this._core.write(S),this._core.write(`\r
59
+ `,g)}paste(S){this._core.paste(S)}refresh(S,g){this._verifyIntegers(S,g),this._core.refresh(S,g)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(S){this._addonManager.loadAddon(this,S)}static get strings(){return a}_verifyIntegers(...S){for(const g of S)if(g===1/0||isNaN(g)||g%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...S){for(const g of S)if(g&&(g===1/0||isNaN(g)||g%1!=0||g<0))throw new Error("This API only accepts positive integers")}}f.Terminal=x})(),_})()))})(Su)),Su.exports}var T1=A1();class R1{constructor(r,s){rm(this,"socket");const o=window.location.protocol==="https:"?"wss:":"ws:";this.socket=new WebSocket(`${o}//${window.location.host}/ws/terminal/${encodeURIComponent(r)}`),this.socket.addEventListener("message",d=>{var f,a;const _=JSON.parse(d.data);_.type==="output"?s.onOutput(_.data):_.type==="error"?(f=s.onError)==null||f.call(s,_.message):(a=s.onStatus)==null||a.call(s,_)}),this.socket.addEventListener("error",()=>{var d;(d=s.onError)==null||d.call(s,"Terminal connection failed.")})}sendInput(r){this.send({type:"input",data:r})}resize(r,s){this.send({type:"resize",cols:r,rows:s})}close(){this.socket.close()}send(r){const s=JSON.stringify(r);if(this.socket.readyState===WebSocket.OPEN){this.socket.send(s);return}this.socket.addEventListener("open",()=>this.socket.send(s),{once:!0})}}function eo({sessionId:n,active:r=!0,onEvent:s}){const o=re.useRef(null),d=re.useRef(null),_=re.useRef(null),f=re.useRef(null),a=re.useRef(r),c=re.useRef(s);function h(m={}){const u=o.current,y=d.current,w=_.current,k=f.current;if(!u||!y||!w||!k)return!1;const x=u.getBoundingClientRect();return x.width<Sm||x.height<bm||(w.fit(),k.cols<Cm||k.rows<wm)?!1:(y.resize(k.cols,k.rows),m.focus&&k.focus(),!0)}return re.useEffect(()=>{c.current=s},[s]),re.useEffect(()=>{a.current=r},[r]),re.useEffect(()=>{if(!o.current)return;const m=new T1.Terminal({cursorBlink:!0,convertEol:!0,drawBoldTextInBrightColors:!0,fontFamily:"Menlo, Monaco, Consolas, monospace",fontSize:13,fontWeight:"400",fontWeightBold:"700",lineHeight:1.35,macOptionIsMeta:!0,scrollback:1e4,theme:D1}),u=new x1.FitAddon;m.loadAddon(u),m.loadAddon(new k1.WebLinksAddon),m.open(o.current),f.current=m,_.current=u;const y=o.current.getBoundingClientRect();y.width>=Sm&&y.height>=bm&&u.fit();const w=new R1(n,{onOutput(E){m.write(E)},onStatus(E){var L;(L=c.current)==null||L.call(c,E.type)},onError(E){var L;m.writeln(`\r
60
+ [VCM] ${E}`),(L=c.current)==null||L.call(c,E)}});d.current=w,m.cols>=Cm&&m.rows>=wm&&w.resize(m.cols,m.rows);const k=m.onData(E=>{w.sendInput(E)});let x=0,b=0,S=0;const g=()=>{x&&window.cancelAnimationFrame(x),x=window.requestAnimationFrame(()=>{x=0,h({focus:a.current})})},v=new ResizeObserver(()=>{g()});return v.observe(o.current),b=window.requestAnimationFrame(g),S=window.setTimeout(g,120),()=>{x&&window.cancelAnimationFrame(x),b&&window.cancelAnimationFrame(b),S&&window.clearTimeout(S),v.disconnect(),k.dispose(),w.close(),m.dispose(),d.current=null,f.current=null,_.current=null}},[n]),re.useEffect(()=>{if(!r)return;const m=[],u=[];return m.push(window.requestAnimationFrame(()=>{h({focus:!0}),m.push(window.requestAnimationFrame(()=>h({focus:!0})))})),u.push(window.setTimeout(()=>h({focus:!0}),160)),u.push(window.setTimeout(()=>h({focus:!0}),360)),()=>{for(const y of m)window.cancelAnimationFrame(y);for(const y of u)window.clearTimeout(y)}},[r]),re.useEffect(()=>{const m=()=>{a.current&&h()};return window.addEventListener("resize",m),()=>window.removeEventListener("resize",m)},[]),D.jsx("div",{className:"terminal-frame",ref:o,onMouseDown:()=>{var m;return(m=f.current)==null?void 0:m.focus()}})}const Sm=160,bm=80,Cm=20,wm=5,D1={background:"#0d1117",foreground:"#d6deeb",cursor:"#ffd866",cursorAccent:"#0d1117",selectionBackground:"#264f78",selectionForeground:"#ffffff",black:"#1f2430",red:"#ff5c57",green:"#5af78e",yellow:"#f3f99d",blue:"#57c7ff",magenta:"#ff6ac1",cyan:"#9aedfe",white:"#f1f1f0",brightBlack:"#686868",brightRed:"#ff5c57",brightGreen:"#5af78e",brightYellow:"#f3f99d",brightBlue:"#57c7ff",brightMagenta:"#ff6ac1",brightCyan:"#9aedfe",brightWhite:"#ffffff"},Tg=[{value:"default",label:"Default",description:"Account default"},{value:"best",label:"Best",description:"Fable 5 or latest Opus"},{value:"fable",label:"Fable 5",description:"1M context, v2.1.170+"},{value:"opus",label:"Opus",description:"latest Opus"},{value:"opus[1m]",label:"Opus 1M",description:"Force 1M context"},{value:"claude-opus-4-8",label:"Opus 4.8",description:"Current Opus"},{value:"claude-opus-4-8[1m]",label:"Opus 4.8 1M",description:"Opus 4.8 + 1M context"}],M1=[{value:"default",label:"Default",description:"CLI or project default"},{value:"low",label:"Low",description:"Fastest reasoning"},{value:"medium",label:"Medium",description:"Balanced reasoning"},{value:"high",label:"High",description:"Deeper reasoning"},{value:"xhigh",label:"XHigh",description:"Extra high reasoning"}],Rg=[...M1,{value:"max",label:"Max",description:"Maximum reasoning"},{value:"ultracode",label:"Ultracode",description:"Claude Code dynamic workflows with xhigh reasoning"}];function mi({status:n}){return D.jsx("span",{className:`status-badge status-${n}`,children:n.replaceAll("_"," ")})}function eh({role:n,session:r,permissionMode:s,model:o,effort:d,busy:_=!1,onPermissionModeChange:f,onModelChange:a,onEffortChange:c,onStart:h,onResume:m,onStop:u,onRestart:y,onNotifyHarnessUpdated:w}){const k=(r==null?void 0:r.status)==="running",x=!!(r!=null&&r.claudeSessionId&&!k),b=!k&&!(r!=null&&r.claudeSessionId),S=!!(r!=null&&r.harnessOutdated);return D.jsxs("div",{className:"session-controls",children:[D.jsxs("label",{className:"session-option-field permission-mode-field",children:[D.jsx("span",{children:"Permission"}),D.jsxs("select",{value:s,onChange:g=>f(g.target.value),children:[D.jsx("option",{value:"default",children:"默认"}),D.jsx("option",{value:"bypassPermissions",children:"bypassPermissions"})]})]}),D.jsxs("label",{className:"session-option-field model-field",children:[D.jsx("span",{children:"Model"}),D.jsx("select",{value:o,onChange:g=>a(g.target.value),children:Tg.map(g=>D.jsx("option",{value:g.value,children:g.label},g.value))})]}),D.jsxs("label",{className:"session-option-field effort-field",children:[D.jsx("span",{children:"Effort"}),D.jsx("select",{value:d,onChange:g=>c(g.target.value),children:Rg.map(g=>D.jsx("option",{value:g.value,children:g.label},g.value))})]}),D.jsxs("div",{className:"session-toolbar",children:[D.jsx("button",{type:"button",disabled:_||!b,onClick:h,children:"Start"}),D.jsx("button",{type:"button",disabled:_||!x,onClick:m,children:"Resume"}),D.jsx("button",{type:"button",disabled:_||!r,onClick:y,children:"Restart"}),D.jsx("button",{type:"button",disabled:_||!r,onClick:u,children:"Stop"})]}),S?D.jsxs("div",{className:"session-harness-notice",children:[D.jsx(mi,{status:"outdated"}),D.jsxs("span",{children:["Harness updated",(r==null?void 0:r.harnessRevision)!==void 0&&r.harnessCurrentRevision!==void 0?` (${r.harnessRevision} -> ${r.harnessCurrentRevision})`:""]}),D.jsx("button",{type:"button",disabled:_||!k||!w,onClick:w,children:"Notify role"})]}):null]})}function L1({busy:n,effort:r,model:s,open:o,permissionMode:d,bootstrapStatus:_,engineerSession:f,status:a,onClose:c,onEffortChange:h,onModelChange:m,onPermissionModeChange:u,onEngineerResume:y,onEngineerRestart:w,onEngineerStart:k,onEngineerStop:x,onEngineerNotifyHarnessUpdated:b,onRefresh:S}){const[g,v]=re.useState(null),[E,L]=re.useState(null),[R,T]=re.useState(""),[A,M]=re.useState(!1),[j,I]=re.useState(null),U=(a==null?void 0:a.files)??[],F=U.filter(N=>N.kind.startsWith("agent-")),K=U.filter(N=>N.kind.startsWith("skill-")),W=U.filter(N=>N.kind.startsWith("tool-")),V=U.filter(N=>N.kind==="root-claude"||N.kind==="gitignore"||N.kind==="pull-request-template"),$=!!(E&&R!==E.content);re.useEffect(()=>{if(!o){v(null),L(null),T(""),I(null);return}!g&&U.length>0&&v(U[0].path)},[U,o,g]),re.useEffect(()=>{if(!o||!g)return;let N=!1;return M(!0),I(null),ve.getHarnessFileContent(g).then(B=>{N||(L(B),T(B.content))}).catch(B=>{N||I(B.message)}).finally(()=>{N||M(!1)}),()=>{N=!0}},[o,g]);async function ee(){if(!(!E||!E.editable||!$)){M(!0),I(null);try{const N=await ve.updateHarnessFileContent(E.path,{content:R});L(N.file),T(N.file.content),S()}catch(N){I(N instanceof Error?N.message:String(N))}finally{M(!1)}}}return o?D.jsx("div",{className:"modal-backdrop harness-studio-backdrop",children:D.jsxs("section",{className:"harness-studio-modal",role:"dialog","aria-modal":"true","aria-label":"Harness Studio",children:[D.jsxs("header",{className:"harness-studio-header",children:[D.jsxs("div",{children:[D.jsx("h2",{children:"Harness Studio"}),D.jsx("p",{children:"VCM 0.4 harness visibility, role configuration, and Harness Engineer workspace."})]}),D.jsxs("div",{className:"harness-studio-header-actions",children:[D.jsx("button",{type:"button",disabled:n,onClick:S,children:"Refresh"}),D.jsx("button",{type:"button",onClick:c,children:"Close"})]})]}),D.jsxs("div",{className:"harness-studio-grid",children:[D.jsxs("section",{className:"harness-studio-section harness-studio-overview",children:[D.jsx("h3",{children:"Overview"}),D.jsxs("div",{className:"harness-studio-metrics",children:[D.jsx(os,{label:"Fixed install",value:a?a.initialized?a.needsApply?"updates":"current":"new":"unknown"}),D.jsx(os,{label:"Revision",value:String((a==null?void 0:a.harnessRevision)??0)}),D.jsx(os,{label:"Managed files",value:String(U.length)}),D.jsx(os,{label:"Pending updates",value:String((a==null?void 0:a.plannedChanges.length)??0)}),D.jsx(os,{label:"Bootstrap",value:(_==null?void 0:_.status.replaceAll("_"," "))??"unknown"}),D.jsx(os,{label:"Engineer",value:O1(f)})]}),a!=null&&a.warnings.length?D.jsx("ul",{className:"warnings",children:a.warnings.map(N=>D.jsx("li",{children:N},N))}):null]}),D.jsxs("section",{className:"harness-studio-section harness-studio-engineer",children:[D.jsx("h3",{children:"Harness Engineer"}),D.jsx("p",{className:"muted",children:"Project-scoped tool role. It proposes harness diffs and VCM issue drafts; it is not part of task round state."}),D.jsx(eh,{role:"harness-engineer",session:f??void 0,permissionMode:d,model:s,effort:r,busy:n,onPermissionModeChange:u,onModelChange:m,onEffortChange:h,onStart:k,onResume:y,onRestart:w,onStop:x,onNotifyHarnessUpdated:b}),D.jsx("div",{className:"harness-engineer-terminal",children:(f==null?void 0:f.status)==="running"?D.jsx(eo,{sessionId:f.id,active:o},f.id):D.jsxs("div",{className:"terminal-empty",children:[D.jsx("strong",{children:"harness-engineer"}),D.jsx("span",{children:f!=null&&f.claudeSessionId?"Resume this project Harness Engineer session.":"Start the project Harness Engineer session."})]})})]}),D.jsxs("section",{className:"harness-studio-section harness-studio-file-editor",children:[D.jsxs("div",{className:"harness-studio-file-editor-header",children:[D.jsxs("div",{children:[D.jsx("h3",{children:(E==null?void 0:E.title)??"Harness File"}),D.jsx("p",{className:"muted",children:(E==null?void 0:E.path)??"Select a file to inspect."})]}),D.jsxs("div",{className:"harness-studio-file-editor-actions",children:[E?D.jsx(mi,{status:E.editable?"ok":"unknown"}):null,D.jsx("button",{type:"button",disabled:A||!(E!=null&&E.editable)||!$,onClick:()=>void ee(),children:"Save"})]})]}),E!=null&&E.readonlyReason?D.jsx("p",{className:"muted",children:E.readonlyReason}):null,j?D.jsx("p",{className:"error-banner",children:j}):null,D.jsx("textarea",{className:"harness-studio-file-textarea",value:R,spellCheck:!1,disabled:A||!(E!=null&&E.editable),onChange:N=>T(N.target.value)})]}),D.jsx(Ua,{title:"Agents",files:F,selectedPath:g,onSelect:v}),D.jsx(Ua,{title:"Skills",files:K,selectedPath:g,onSelect:v}),D.jsx(Ua,{title:"Root Context",files:V,selectedPath:g,onSelect:v}),D.jsx(Ua,{title:"Tools",files:W,selectedPath:g,onSelect:v}),D.jsxs("section",{className:"harness-studio-section",children:[D.jsx("h3",{children:"Project Docs"}),D.jsx("ul",{className:"harness-studio-doc-list",children:(_==null?void 0:_.checks.map(N=>D.jsxs("li",{children:[D.jsx("span",{children:N.path??N.label}),D.jsx(mi,{status:N.status})]},N.key)))??D.jsx("li",{children:D.jsx("span",{children:"No bootstrap status loaded."})})})]}),D.jsxs("section",{className:"harness-studio-section",children:[D.jsx("h3",{children:"Proposed Changes"}),D.jsx("p",{className:"muted",children:"Harness Engineer changes must be reviewed as diffs before apply. The first 0.4 implementation exposes the workspace; pending change-set apply will build on this surface."})]}),D.jsxs("section",{className:"harness-studio-section",children:[D.jsx("h3",{children:"VCM Feedback"}),D.jsx("p",{className:"muted",children:"VCM product or fixed-template problems should become issue drafts for CodingForMoney/VibeCodingMaster, submitted only after user confirmation."})]})]})]})}):null}function os({label:n,value:r}){return D.jsxs("div",{className:"harness-studio-metric",children:[D.jsx("span",{children:n}),D.jsx("strong",{children:r})]})}function Ua({title:n,files:r,selectedPath:s,onSelect:o}){return D.jsxs("section",{className:"harness-studio-section",children:[D.jsx("h3",{children:n}),D.jsx("ol",{className:"harness-studio-file-list",children:r.length?r.map(d=>D.jsxs("li",{className:d.path===s?"selected":void 0,children:[D.jsx("button",{type:"button",title:d.path,onClick:()=>o(d.path),children:d.path}),D.jsx(mi,{status:d.action})]},d.path)):D.jsx("li",{children:D.jsx("span",{children:"No files."})})})]})}function O1(n){return n?n.status==="running"?`${n.status} / ${n.activityStatus??"idle"}`:n.status:"not started"}function B1({busy:n,effort:r,model:s,open:o,permissionMode:d,session:_,onClose:f,onEffortChange:a,onModelChange:c,onPermissionModeChange:h,onResume:m,onRestart:u,onStart:y,onStop:w,onNotifyHarnessUpdated:k}){return o?D.jsx("div",{className:"modal-backdrop translator-session-backdrop",children:D.jsxs("section",{className:"translator-session-modal",role:"dialog","aria-modal":"true","aria-label":"Translator Session",children:[D.jsxs("header",{className:"translator-session-header",children:[D.jsxs("div",{children:[D.jsx("h2",{children:"Translator Session"}),D.jsx("p",{children:j1(_)})]}),D.jsx("button",{type:"button",onClick:f,children:"Close"})]}),D.jsx(eh,{role:"translator",session:_??void 0,permissionMode:d,model:s,effort:r,busy:n,onPermissionModeChange:h,onModelChange:c,onEffortChange:a,onStart:y,onResume:m,onRestart:u,onStop:w,onNotifyHarnessUpdated:k}),D.jsx("div",{className:"translator-session-terminal",children:(_==null?void 0:_.status)==="running"?D.jsx(eo,{sessionId:_.id,active:o},_.id):D.jsxs("div",{className:"terminal-empty",children:[D.jsx("strong",{children:"translator"}),D.jsx("span",{children:_!=null&&_.claudeSessionId?"Resume this project translator session.":"Start the project translator session."})]})})]})}):null}function j1(n){if(!n)return"not started";const r=n.status==="running"?` · ${n.activityStatus??"idle"}`:"";return`${n.status}${r}`}function N1(n,r){const s={};return(n[n.length-1]===""?[...n,""]:n).join((s.padRight?" ":"")+","+(s.padLeft===!1?"":" ")).trim()}const H1=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,z1=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,I1={};function xm(n,r){return(I1.jsx?z1:H1).test(n)}const U1=/[ \t\n\f\r]/g;function P1(n){return typeof n=="object"?n.type==="text"?Em(n.value):!1:Em(n)}function Em(n){return n.replace(U1,"")===""}class Cl{constructor(r,s,o){this.normal=s,this.property=r,o&&(this.space=o)}}Cl.prototype.normal={};Cl.prototype.property={};Cl.prototype.space=void 0;function Dg(n,r){const s={},o={};for(const d of n)Object.assign(s,d.property),Object.assign(o,d.normal);return new Cl(s,o,r)}function zu(n){return n.toLowerCase()}class cn{constructor(r,s){this.attribute=s,this.property=r}}cn.prototype.attribute="";cn.prototype.booleanish=!1;cn.prototype.boolean=!1;cn.prototype.commaOrSpaceSeparated=!1;cn.prototype.commaSeparated=!1;cn.prototype.defined=!1;cn.prototype.mustUseProperty=!1;cn.prototype.number=!1;cn.prototype.overloadedBoolean=!1;cn.prototype.property="";cn.prototype.spaceSeparated=!1;cn.prototype.space=void 0;let F1=0;const ze=Cr(),Ot=Cr(),Iu=Cr(),be=Cr(),dt=Cr(),fs=Cr(),vn=Cr();function Cr(){return 2**++F1}const Uu=Object.freeze(Object.defineProperty({__proto__:null,boolean:ze,booleanish:Ot,commaOrSpaceSeparated:vn,commaSeparated:fs,number:be,overloadedBoolean:Iu,spaceSeparated:dt},Symbol.toStringTag,{value:"Module"})),bu=Object.keys(Uu);class th extends cn{constructor(r,s,o,d){let _=-1;if(super(r,s),km(this,"space",d),typeof o=="number")for(;++_<bu.length;){const f=bu[_];km(this,bu[_],(o&Uu[f])===Uu[f])}}}th.prototype.defined=!0;function km(n,r,s){s&&(n[r]=s)}function gs(n){const r={},s={};for(const[o,d]of Object.entries(n.properties)){const _=new th(o,n.transform(n.attributes||{},o),d,n.space);n.mustUseProperty&&n.mustUseProperty.includes(o)&&(_.mustUseProperty=!0),r[o]=_,s[zu(o)]=o,s[zu(_.attribute)]=o}return new Cl(r,s,n.space)}const Mg=gs({properties:{ariaActiveDescendant:null,ariaAtomic:Ot,ariaAutoComplete:null,ariaBusy:Ot,ariaChecked:Ot,ariaColCount:be,ariaColIndex:be,ariaColSpan:be,ariaControls:dt,ariaCurrent:null,ariaDescribedBy:dt,ariaDetails:null,ariaDisabled:Ot,ariaDropEffect:dt,ariaErrorMessage:null,ariaExpanded:Ot,ariaFlowTo:dt,ariaGrabbed:Ot,ariaHasPopup:null,ariaHidden:Ot,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:dt,ariaLevel:be,ariaLive:null,ariaModal:Ot,ariaMultiLine:Ot,ariaMultiSelectable:Ot,ariaOrientation:null,ariaOwns:dt,ariaPlaceholder:null,ariaPosInSet:be,ariaPressed:Ot,ariaReadOnly:Ot,ariaRelevant:null,ariaRequired:Ot,ariaRoleDescription:dt,ariaRowCount:be,ariaRowIndex:be,ariaRowSpan:be,ariaSelected:Ot,ariaSetSize:be,ariaSort:null,ariaValueMax:be,ariaValueMin:be,ariaValueNow:be,ariaValueText:null,role:null},transform(n,r){return r==="role"?r:"aria-"+r.slice(4).toLowerCase()}});function Lg(n,r){return r in n?n[r]:r}function Og(n,r){return Lg(n,r.toLowerCase())}const q1=gs({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:fs,acceptCharset:dt,accessKey:dt,action:null,allow:null,allowFullScreen:ze,allowPaymentRequest:ze,allowUserMedia:ze,alt:null,as:null,async:ze,autoCapitalize:null,autoComplete:dt,autoFocus:ze,autoPlay:ze,blocking:dt,capture:null,charSet:null,checked:ze,cite:null,className:dt,cols:be,colSpan:null,content:null,contentEditable:Ot,controls:ze,controlsList:dt,coords:be|fs,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ze,defer:ze,dir:null,dirName:null,disabled:ze,download:Iu,draggable:Ot,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ze,formTarget:null,headers:dt,height:be,hidden:Iu,high:be,href:null,hrefLang:null,htmlFor:dt,httpEquiv:dt,id:null,imageSizes:null,imageSrcSet:null,inert:ze,inputMode:null,integrity:null,is:null,isMap:ze,itemId:null,itemProp:dt,itemRef:dt,itemScope:ze,itemType:dt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ze,low:be,manifest:null,max:null,maxLength:be,media:null,method:null,min:null,minLength:be,multiple:ze,muted:ze,name:null,nonce:null,noModule:ze,noValidate:ze,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ze,optimum:be,pattern:null,ping:dt,placeholder:null,playsInline:ze,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ze,referrerPolicy:null,rel:dt,required:ze,reversed:ze,rows:be,rowSpan:be,sandbox:dt,scope:null,scoped:ze,seamless:ze,selected:ze,shadowRootClonable:ze,shadowRootDelegatesFocus:ze,shadowRootMode:null,shape:null,size:be,sizes:null,slot:null,span:be,spellCheck:Ot,src:null,srcDoc:null,srcLang:null,srcSet:null,start:be,step:null,style:null,tabIndex:be,target:null,title:null,translate:null,type:null,typeMustMatch:ze,useMap:null,value:Ot,width:be,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:dt,axis:null,background:null,bgColor:null,border:be,borderColor:null,bottomMargin:be,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ze,declare:ze,event:null,face:null,frame:null,frameBorder:null,hSpace:be,leftMargin:be,link:null,longDesc:null,lowSrc:null,marginHeight:be,marginWidth:be,noResize:ze,noHref:ze,noShade:ze,noWrap:ze,object:null,profile:null,prompt:null,rev:null,rightMargin:be,rules:null,scheme:null,scrolling:Ot,standby:null,summary:null,text:null,topMargin:be,valueType:null,version:null,vAlign:null,vLink:null,vSpace:be,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ze,disableRemotePlayback:ze,prefix:null,property:null,results:be,security:null,unselectable:null},space:"html",transform:Og}),G1=gs({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:vn,accentHeight:be,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:be,amplitude:be,arabicForm:null,ascent:be,attributeName:null,attributeType:null,azimuth:be,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:be,by:null,calcMode:null,capHeight:be,className:dt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:be,diffuseConstant:be,direction:null,display:null,dur:null,divisor:be,dominantBaseline:null,download:ze,dx:null,dy:null,edgeMode:null,editable:null,elevation:be,enableBackground:null,end:null,event:null,exponent:be,externalResourcesRequired:null,fill:null,fillOpacity:be,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:fs,g2:fs,glyphName:fs,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:be,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:be,horizOriginX:be,horizOriginY:be,id:null,ideographic:be,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:be,k:be,k1:be,k2:be,k3:be,k4:be,kernelMatrix:vn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:be,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:be,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:be,overlineThickness:be,paintOrder:null,panose1:null,path:null,pathLength:be,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:dt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:be,pointsAtY:be,pointsAtZ:be,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:vn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:vn,rev:vn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:vn,requiredFeatures:vn,requiredFonts:vn,requiredFormats:vn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:be,specularExponent:be,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:be,strikethroughThickness:be,string:null,stroke:null,strokeDashArray:vn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:be,strokeOpacity:be,strokeWidth:null,style:null,surfaceScale:be,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:vn,tabIndex:be,tableValues:null,target:null,targetX:be,targetY:be,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:vn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:be,underlineThickness:be,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:be,values:null,vAlphabetic:be,vMathematical:be,vectorEffect:null,vHanging:be,vIdeographic:be,version:null,vertAdvY:be,vertOriginX:be,vertOriginY:be,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:be,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Lg}),Bg=gs({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(n,r){return"xlink:"+r.slice(5).toLowerCase()}}),jg=gs({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Og}),Ng=gs({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(n,r){return"xml:"+r.slice(3).toLowerCase()}}),V1={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},$1=/[A-Z]/g,Am=/-[a-z]/g,K1=/^data[-\w.:]+$/i;function Y1(n,r){const s=zu(r);let o=r,d=cn;if(s in n.normal)return n.property[n.normal[s]];if(s.length>4&&s.slice(0,4)==="data"&&K1.test(r)){if(r.charAt(4)==="-"){const _=r.slice(5).replace(Am,X1);o="data"+_.charAt(0).toUpperCase()+_.slice(1)}else{const _=r.slice(4);if(!Am.test(_)){let f=_.replace($1,W1);f.charAt(0)!=="-"&&(f="-"+f),r="data"+f}}d=th}return new d(o,r)}function W1(n){return"-"+n.toLowerCase()}function X1(n){return n.charAt(1).toUpperCase()}const Q1=Dg([Mg,q1,Bg,jg,Ng],"html"),nh=Dg([Mg,G1,Bg,jg,Ng],"svg");function Z1(n){return n.join(" ").trim()}var cs={},Cu,Tm;function J1(){if(Tm)return Cu;Tm=1;var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,s=/^\s*/,o=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,d=/^:\s*/,_=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,f=/^[;\s]*/,a=/^\s+|\s+$/g,c=`
61
+ `,h="/",m="*",u="",y="comment",w="declaration";function k(b,S){if(typeof b!="string")throw new TypeError("First argument must be a string");if(!b)return[];S=S||{};var g=1,v=1;function E(K){var W=K.match(r);W&&(g+=W.length);var V=K.lastIndexOf(c);v=~V?K.length-V:v+K.length}function L(){var K={line:g,column:v};return function(W){return W.position=new R(K),M(),W}}function R(K){this.start=K,this.end={line:g,column:v},this.source=S.source}R.prototype.content=b;function T(K){var W=new Error(S.source+":"+g+":"+v+": "+K);if(W.reason=K,W.filename=S.source,W.line=g,W.column=v,W.source=b,!S.silent)throw W}function A(K){var W=K.exec(b);if(W){var V=W[0];return E(V),b=b.slice(V.length),W}}function M(){A(s)}function j(K){var W;for(K=K||[];W=I();)W!==!1&&K.push(W);return K}function I(){var K=L();if(!(h!=b.charAt(0)||m!=b.charAt(1))){for(var W=2;u!=b.charAt(W)&&(m!=b.charAt(W)||h!=b.charAt(W+1));)++W;if(W+=2,u===b.charAt(W-1))return T("End of comment missing");var V=b.slice(2,W-2);return v+=2,E(V),b=b.slice(W),v+=2,K({type:y,comment:V})}}function U(){var K=L(),W=A(o);if(W){if(I(),!A(d))return T("property missing ':'");var V=A(_),$=K({type:w,property:x(W[0].replace(n,u)),value:V?x(V[0].replace(n,u)):u});return A(f),$}}function F(){var K=[];j(K);for(var W;W=U();)W!==!1&&(K.push(W),j(K));return K}return M(),F()}function x(b){return b?b.replace(a,u):u}return Cu=k,Cu}var Rm;function ey(){if(Rm)return cs;Rm=1;var n=cs&&cs.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(cs,"__esModule",{value:!0}),cs.default=s;const r=n(J1());function s(o,d){let _=null;if(!o||typeof o!="string")return _;const f=(0,r.default)(o),a=typeof d=="function";return f.forEach(c=>{if(c.type!=="declaration")return;const{property:h,value:m}=c;a?d(h,m,c):m&&(_=_||{},_[h]=m)}),_}return cs}var hl={},Dm;function ty(){if(Dm)return hl;Dm=1,Object.defineProperty(hl,"__esModule",{value:!0}),hl.camelCase=void 0;var n=/^--[a-zA-Z0-9_-]+$/,r=/-([a-z])/g,s=/^[^-]+$/,o=/^-(webkit|moz|ms|o|khtml)-/,d=/^-(ms)-/,_=function(h){return!h||s.test(h)||n.test(h)},f=function(h,m){return m.toUpperCase()},a=function(h,m){return"".concat(m,"-")},c=function(h,m){return m===void 0&&(m={}),_(h)?h:(h=h.toLowerCase(),m.reactCompat?h=h.replace(d,a):h=h.replace(o,a),h.replace(r,f))};return hl.camelCase=c,hl}var fl,Mm;function ny(){if(Mm)return fl;Mm=1;var n=fl&&fl.__importDefault||function(d){return d&&d.__esModule?d:{default:d}},r=n(ey()),s=ty();function o(d,_){var f={};return!d||typeof d!="string"||(0,r.default)(d,function(a,c){a&&c&&(f[(0,s.camelCase)(a,_)]=c)}),f}return o.default=o,fl=o,fl}var iy=ny();const ry=bg(iy),Hg=zg("end"),ih=zg("start");function zg(n){return r;function r(s){const o=s&&s.position&&s.position[n]||{};if(typeof o.line=="number"&&o.line>0&&typeof o.column=="number"&&o.column>0)return{line:o.line,column:o.column,offset:typeof o.offset=="number"&&o.offset>-1?o.offset:void 0}}}function sy(n){const r=ih(n),s=Hg(n);if(r&&s)return{start:r,end:s}}function gl(n){return!n||typeof n!="object"?"":"position"in n||"type"in n?Lm(n.position):"start"in n||"end"in n?Lm(n):"line"in n||"column"in n?Pu(n):""}function Pu(n){return Om(n&&n.line)+":"+Om(n&&n.column)}function Lm(n){return Pu(n&&n.start)+"-"+Pu(n&&n.end)}function Om(n){return n&&typeof n=="number"?n:1}class Yt extends Error{constructor(r,s,o){super(),typeof s=="string"&&(o=s,s=void 0);let d="",_={},f=!1;if(s&&("line"in s&&"column"in s?_={place:s}:"start"in s&&"end"in s?_={place:s}:"type"in s?_={ancestors:[s],place:s.position}:_={...s}),typeof r=="string"?d=r:!_.cause&&r&&(f=!0,d=r.message,_.cause=r),!_.ruleId&&!_.source&&typeof o=="string"){const c=o.indexOf(":");c===-1?_.ruleId=o:(_.source=o.slice(0,c),_.ruleId=o.slice(c+1))}if(!_.place&&_.ancestors&&_.ancestors){const c=_.ancestors[_.ancestors.length-1];c&&(_.place=c.position)}const a=_.place&&"start"in _.place?_.place.start:_.place;this.ancestors=_.ancestors||void 0,this.cause=_.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=d,this.line=a?a.line:void 0,this.name=gl(_.place)||"1:1",this.place=_.place||void 0,this.reason=this.message,this.ruleId=_.ruleId||void 0,this.source=_.source||void 0,this.stack=f&&_.cause&&typeof _.cause.stack=="string"?_.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Yt.prototype.file="";Yt.prototype.name="";Yt.prototype.reason="";Yt.prototype.message="";Yt.prototype.stack="";Yt.prototype.column=void 0;Yt.prototype.line=void 0;Yt.prototype.ancestors=void 0;Yt.prototype.cause=void 0;Yt.prototype.fatal=void 0;Yt.prototype.place=void 0;Yt.prototype.ruleId=void 0;Yt.prototype.source=void 0;const rh={}.hasOwnProperty,ly=new Map,ay=/[A-Z]/g,oy=new Set(["table","tbody","thead","tfoot","tr"]),cy=new Set(["td","th"]),Ig="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function uy(n,r){if(!r||r.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const s=r.filePath||void 0;let o;if(r.development){if(typeof r.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");o=vy(s,r.jsxDEV)}else{if(typeof r.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof r.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");o=_y(s,r.jsx,r.jsxs)}const d={Fragment:r.Fragment,ancestors:[],components:r.components||{},create:o,elementAttributeNameCase:r.elementAttributeNameCase||"react",evaluater:r.createEvaluater?r.createEvaluater():void 0,filePath:s,ignoreInvalidStyle:r.ignoreInvalidStyle||!1,passKeys:r.passKeys!==!1,passNode:r.passNode||!1,schema:r.space==="svg"?nh:Q1,stylePropertyNameCase:r.stylePropertyNameCase||"dom",tableCellAlignToStyle:r.tableCellAlignToStyle!==!1},_=Ug(d,n,void 0);return _&&typeof _!="string"?_:d.create(n,d.Fragment,{children:_||void 0},void 0)}function Ug(n,r,s){if(r.type==="element")return hy(n,r,s);if(r.type==="mdxFlowExpression"||r.type==="mdxTextExpression")return fy(n,r);if(r.type==="mdxJsxFlowElement"||r.type==="mdxJsxTextElement")return py(n,r,s);if(r.type==="mdxjsEsm")return dy(n,r);if(r.type==="root")return my(n,r,s);if(r.type==="text")return gy(n,r)}function hy(n,r,s){const o=n.schema;let d=o;r.tagName.toLowerCase()==="svg"&&o.space==="html"&&(d=nh,n.schema=d),n.ancestors.push(r);const _=Fg(n,r.tagName,!1),f=yy(n,r);let a=lh(n,r);return oy.has(r.tagName)&&(a=a.filter(function(c){return typeof c=="string"?!P1(c):!0})),Pg(n,f,_,r),sh(f,a),n.ancestors.pop(),n.schema=o,n.create(r,_,f,s)}function fy(n,r){if(r.data&&r.data.estree&&n.evaluater){const o=r.data.estree.body[0];return o.type,n.evaluater.evaluateExpression(o.expression)}Sl(n,r.position)}function dy(n,r){if(r.data&&r.data.estree&&n.evaluater)return n.evaluater.evaluateProgram(r.data.estree);Sl(n,r.position)}function py(n,r,s){const o=n.schema;let d=o;r.name==="svg"&&o.space==="html"&&(d=nh,n.schema=d),n.ancestors.push(r);const _=r.name===null?n.Fragment:Fg(n,r.name,!0),f=Sy(n,r),a=lh(n,r);return Pg(n,f,_,r),sh(f,a),n.ancestors.pop(),n.schema=o,n.create(r,_,f,s)}function my(n,r,s){const o={};return sh(o,lh(n,r)),n.create(r,n.Fragment,o,s)}function gy(n,r){return r.value}function Pg(n,r,s,o){typeof s!="string"&&s!==n.Fragment&&n.passNode&&(r.node=o)}function sh(n,r){if(r.length>0){const s=r.length>1?r:r[0];s&&(n.children=s)}}function _y(n,r,s){return o;function o(d,_,f,a){const h=Array.isArray(f.children)?s:r;return a?h(_,f,a):h(_,f)}}function vy(n,r){return s;function s(o,d,_,f){const a=Array.isArray(_.children),c=ih(o);return r(d,_,f,a,{columnNumber:c?c.column-1:void 0,fileName:n,lineNumber:c?c.line:void 0},void 0)}}function yy(n,r){const s={};let o,d;for(d in r.properties)if(d!=="children"&&rh.call(r.properties,d)){const _=by(n,d,r.properties[d]);if(_){const[f,a]=_;n.tableCellAlignToStyle&&f==="align"&&typeof a=="string"&&cy.has(r.tagName)?o=a:s[f]=a}}if(o){const _=s.style||(s.style={});_[n.stylePropertyNameCase==="css"?"text-align":"textAlign"]=o}return s}function Sy(n,r){const s={};for(const o of r.attributes)if(o.type==="mdxJsxExpressionAttribute")if(o.data&&o.data.estree&&n.evaluater){const _=o.data.estree.body[0];_.type;const f=_.expression;f.type;const a=f.properties[0];a.type,Object.assign(s,n.evaluater.evaluateExpression(a.argument))}else Sl(n,r.position);else{const d=o.name;let _;if(o.value&&typeof o.value=="object")if(o.value.data&&o.value.data.estree&&n.evaluater){const a=o.value.data.estree.body[0];a.type,_=n.evaluater.evaluateExpression(a.expression)}else Sl(n,r.position);else _=o.value===null?!0:o.value;s[d]=_}return s}function lh(n,r){const s=[];let o=-1;const d=n.passKeys?new Map:ly;for(;++o<r.children.length;){const _=r.children[o];let f;if(n.passKeys){const c=_.type==="element"?_.tagName:_.type==="mdxJsxFlowElement"||_.type==="mdxJsxTextElement"?_.name:void 0;if(c){const h=d.get(c)||0;f=c+"-"+h,d.set(c,h+1)}}const a=Ug(n,_,f);a!==void 0&&s.push(a)}return s}function by(n,r,s){const o=Y1(n.schema,r);if(!(s==null||typeof s=="number"&&Number.isNaN(s))){if(Array.isArray(s)&&(s=o.commaSeparated?N1(s):Z1(s)),o.property==="style"){let d=typeof s=="object"?s:Cy(n,String(s));return n.stylePropertyNameCase==="css"&&(d=wy(d)),["style",d]}return[n.elementAttributeNameCase==="react"&&o.space?V1[o.property]||o.property:o.attribute,s]}}function Cy(n,r){try{return ry(r,{reactCompat:!0})}catch(s){if(n.ignoreInvalidStyle)return{};const o=s,d=new Yt("Cannot parse `style` attribute",{ancestors:n.ancestors,cause:o,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw d.file=n.filePath||void 0,d.url=Ig+"#cannot-parse-style-attribute",d}}function Fg(n,r,s){let o;if(!s)o={type:"Literal",value:r};else if(r.includes(".")){const d=r.split(".");let _=-1,f;for(;++_<d.length;){const a=xm(d[_])?{type:"Identifier",name:d[_]}:{type:"Literal",value:d[_]};f=f?{type:"MemberExpression",object:f,property:a,computed:!!(_&&a.type==="Literal"),optional:!1}:a}o=f}else o=xm(r)&&!/^[a-z]/.test(r)?{type:"Identifier",name:r}:{type:"Literal",value:r};if(o.type==="Literal"){const d=o.value;return rh.call(n.components,d)?n.components[d]:d}if(n.evaluater)return n.evaluater.evaluateExpression(o);Sl(n)}function Sl(n,r){const s=new Yt("Cannot handle MDX estrees without `createEvaluater`",{ancestors:n.ancestors,place:r,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw s.file=n.filePath||void 0,s.url=Ig+"#cannot-handle-mdx-estrees-without-createevaluater",s}function wy(n){const r={};let s;for(s in n)rh.call(n,s)&&(r[xy(s)]=n[s]);return r}function xy(n){let r=n.replace(ay,Ey);return r.slice(0,3)==="ms-"&&(r="-"+r),r}function Ey(n){return"-"+n.toLowerCase()}const wu={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},ky={};function ah(n,r){const s=ky,o=typeof s.includeImageAlt=="boolean"?s.includeImageAlt:!0,d=typeof s.includeHtml=="boolean"?s.includeHtml:!0;return qg(n,o,d)}function qg(n,r,s){if(Ay(n)){if("value"in n)return n.type==="html"&&!s?"":n.value;if(r&&"alt"in n&&n.alt)return n.alt;if("children"in n)return Bm(n.children,r,s)}return Array.isArray(n)?Bm(n,r,s):""}function Bm(n,r,s){const o=[];let d=-1;for(;++d<n.length;)o[d]=qg(n[d],r,s);return o.join("")}function Ay(n){return!!(n&&typeof n=="object")}const jm=document.createElement("i");function oh(n){const r="&"+n+";";jm.innerHTML=r;const s=jm.textContent;return s.charCodeAt(s.length-1)===59&&n!=="semi"||s===r?!1:s}function yn(n,r,s,o){const d=n.length;let _=0,f;if(r<0?r=-r>d?0:d+r:r=r>d?d:r,s=s>0?s:0,o.length<1e4)f=Array.from(o),f.unshift(r,s),n.splice(...f);else for(s&&n.splice(r,s);_<o.length;)f=o.slice(_,_+1e4),f.unshift(r,0),n.splice(...f),_+=1e4,r+=1e4}function Mn(n,r){return n.length>0?(yn(n,n.length,0,r),n):r}const Nm={}.hasOwnProperty;function Gg(n){const r={};let s=-1;for(;++s<n.length;)Ty(r,n[s]);return r}function Ty(n,r){let s;for(s in r){const d=(Nm.call(n,s)?n[s]:void 0)||(n[s]={}),_=r[s];let f;if(_)for(f in _){Nm.call(d,f)||(d[f]=[]);const a=_[f];Ry(d[f],Array.isArray(a)?a:a?[a]:[])}}}function Ry(n,r){let s=-1;const o=[];for(;++s<r.length;)(r[s].add==="after"?n:o).push(r[s]);yn(n,0,0,o)}function Vg(n,r){const s=Number.parseInt(n,r);return s<9||s===11||s>13&&s<32||s>126&&s<160||s>55295&&s<57344||s>64975&&s<65008||(s&65535)===65535||(s&65535)===65534||s>1114111?"�":String.fromCodePoint(s)}function zn(n){return n.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Zt=Qi(/[A-Za-z]/),Kt=Qi(/[\dA-Za-z]/),Dy=Qi(/[#-'*+\--9=?A-Z^-~]/);function Ya(n){return n!==null&&(n<32||n===127)}const Fu=Qi(/\d/),My=Qi(/[\dA-Fa-f]/),Ly=Qi(/[!-/:-@[-`{-~]/);function Me(n){return n!==null&&n<-2}function ut(n){return n!==null&&(n<0||n===32)}function qe(n){return n===-2||n===-1||n===32}const to=Qi(new RegExp("\\p{P}|\\p{S}","u")),br=Qi(/\s/);function Qi(n){return r;function r(s){return s!==null&&s>-1&&n.test(String.fromCharCode(s))}}function _s(n){const r=[];let s=-1,o=0,d=0;for(;++s<n.length;){const _=n.charCodeAt(s);let f="";if(_===37&&Kt(n.charCodeAt(s+1))&&Kt(n.charCodeAt(s+2)))d=2;else if(_<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(_))||(f=String.fromCharCode(_));else if(_>55295&&_<57344){const a=n.charCodeAt(s+1);_<56320&&a>56319&&a<57344?(f=String.fromCharCode(_,a),d=1):f="�"}else f=String.fromCharCode(_);f&&(r.push(n.slice(o,s),encodeURIComponent(f)),o=s+d+1,f=""),d&&(s+=d,d=0)}return r.join("")+n.slice(o)}function We(n,r,s,o){const d=o?o-1:Number.POSITIVE_INFINITY;let _=0;return f;function f(c){return qe(c)?(n.enter(s),a(c)):r(c)}function a(c){return qe(c)&&_++<d?(n.consume(c),a):(n.exit(s),r(c))}}const Oy={tokenize:By};function By(n){const r=n.attempt(this.parser.constructs.contentInitial,o,d);let s;return r;function o(a){if(a===null){n.consume(a);return}return n.enter("lineEnding"),n.consume(a),n.exit("lineEnding"),We(n,r,"linePrefix")}function d(a){return n.enter("paragraph"),_(a)}function _(a){const c=n.enter("chunkText",{contentType:"text",previous:s});return s&&(s.next=c),s=c,f(a)}function f(a){if(a===null){n.exit("chunkText"),n.exit("paragraph"),n.consume(a);return}return Me(a)?(n.consume(a),n.exit("chunkText"),_):(n.consume(a),f)}}const jy={tokenize:Ny},Hm={tokenize:Hy};function Ny(n){const r=this,s=[];let o=0,d,_,f;return a;function a(v){if(o<s.length){const E=s[o];return r.containerState=E[1],n.attempt(E[0].continuation,c,h)(v)}return h(v)}function c(v){if(o++,r.containerState._closeFlow){r.containerState._closeFlow=void 0,d&&g();const E=r.events.length;let L=E,R;for(;L--;)if(r.events[L][0]==="exit"&&r.events[L][1].type==="chunkFlow"){R=r.events[L][1].end;break}S(o);let T=E;for(;T<r.events.length;)r.events[T][1].end={...R},T++;return yn(r.events,L+1,0,r.events.slice(E)),r.events.length=T,h(v)}return a(v)}function h(v){if(o===s.length){if(!d)return y(v);if(d.currentConstruct&&d.currentConstruct.concrete)return k(v);r.interrupt=!!(d.currentConstruct&&!d._gfmTableDynamicInterruptHack)}return r.containerState={},n.check(Hm,m,u)(v)}function m(v){return d&&g(),S(o),y(v)}function u(v){return r.parser.lazy[r.now().line]=o!==s.length,f=r.now().offset,k(v)}function y(v){return r.containerState={},n.attempt(Hm,w,k)(v)}function w(v){return o++,s.push([r.currentConstruct,r.containerState]),y(v)}function k(v){if(v===null){d&&g(),S(0),n.consume(v);return}return d=d||r.parser.flow(r.now()),n.enter("chunkFlow",{_tokenizer:d,contentType:"flow",previous:_}),x(v)}function x(v){if(v===null){b(n.exit("chunkFlow"),!0),S(0),n.consume(v);return}return Me(v)?(n.consume(v),b(n.exit("chunkFlow")),o=0,r.interrupt=void 0,a):(n.consume(v),x)}function b(v,E){const L=r.sliceStream(v);if(E&&L.push(null),v.previous=_,_&&(_.next=v),_=v,d.defineSkip(v.start),d.write(L),r.parser.lazy[v.start.line]){let R=d.events.length;for(;R--;)if(d.events[R][1].start.offset<f&&(!d.events[R][1].end||d.events[R][1].end.offset>f))return;const T=r.events.length;let A=T,M,j;for(;A--;)if(r.events[A][0]==="exit"&&r.events[A][1].type==="chunkFlow"){if(M){j=r.events[A][1].end;break}M=!0}for(S(o),R=T;R<r.events.length;)r.events[R][1].end={...j},R++;yn(r.events,A+1,0,r.events.slice(T)),r.events.length=R}}function S(v){let E=s.length;for(;E-- >v;){const L=s[E];r.containerState=L[1],L[0].exit.call(r,n)}s.length=v}function g(){d.write([null]),_=void 0,d=void 0,r.containerState._closeFlow=void 0}}function Hy(n,r,s){return We(n,n.attempt(this.parser.constructs.document,r,s),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ps(n){if(n===null||ut(n)||br(n))return 1;if(to(n))return 2}function no(n,r,s){const o=[];let d=-1;for(;++d<n.length;){const _=n[d].resolveAll;_&&!o.includes(_)&&(r=_(r,s),o.push(_))}return r}const qu={name:"attention",resolveAll:zy,tokenize:Iy};function zy(n,r){let s=-1,o,d,_,f,a,c,h,m;for(;++s<n.length;)if(n[s][0]==="enter"&&n[s][1].type==="attentionSequence"&&n[s][1]._close){for(o=s;o--;)if(n[o][0]==="exit"&&n[o][1].type==="attentionSequence"&&n[o][1]._open&&r.sliceSerialize(n[o][1]).charCodeAt(0)===r.sliceSerialize(n[s][1]).charCodeAt(0)){if((n[o][1]._close||n[s][1]._open)&&(n[s][1].end.offset-n[s][1].start.offset)%3&&!((n[o][1].end.offset-n[o][1].start.offset+n[s][1].end.offset-n[s][1].start.offset)%3))continue;c=n[o][1].end.offset-n[o][1].start.offset>1&&n[s][1].end.offset-n[s][1].start.offset>1?2:1;const u={...n[o][1].end},y={...n[s][1].start};zm(u,-c),zm(y,c),f={type:c>1?"strongSequence":"emphasisSequence",start:u,end:{...n[o][1].end}},a={type:c>1?"strongSequence":"emphasisSequence",start:{...n[s][1].start},end:y},_={type:c>1?"strongText":"emphasisText",start:{...n[o][1].end},end:{...n[s][1].start}},d={type:c>1?"strong":"emphasis",start:{...f.start},end:{...a.end}},n[o][1].end={...f.start},n[s][1].start={...a.end},h=[],n[o][1].end.offset-n[o][1].start.offset&&(h=Mn(h,[["enter",n[o][1],r],["exit",n[o][1],r]])),h=Mn(h,[["enter",d,r],["enter",f,r],["exit",f,r],["enter",_,r]]),h=Mn(h,no(r.parser.constructs.insideSpan.null,n.slice(o+1,s),r)),h=Mn(h,[["exit",_,r],["enter",a,r],["exit",a,r],["exit",d,r]]),n[s][1].end.offset-n[s][1].start.offset?(m=2,h=Mn(h,[["enter",n[s][1],r],["exit",n[s][1],r]])):m=0,yn(n,o-1,s-o+3,h),s=o+h.length-m-2;break}}for(s=-1;++s<n.length;)n[s][1].type==="attentionSequence"&&(n[s][1].type="data");return n}function Iy(n,r){const s=this.parser.constructs.attentionMarkers.null,o=this.previous,d=ps(o);let _;return f;function f(c){return _=c,n.enter("attentionSequence"),a(c)}function a(c){if(c===_)return n.consume(c),a;const h=n.exit("attentionSequence"),m=ps(c),u=!m||m===2&&d||s.includes(c),y=!d||d===2&&m||s.includes(o);return h._open=!!(_===42?u:u&&(d||!y)),h._close=!!(_===42?y:y&&(m||!u)),r(c)}}function zm(n,r){n.column+=r,n.offset+=r,n._bufferIndex+=r}const Uy={name:"autolink",tokenize:Py};function Py(n,r,s){let o=0;return d;function d(w){return n.enter("autolink"),n.enter("autolinkMarker"),n.consume(w),n.exit("autolinkMarker"),n.enter("autolinkProtocol"),_}function _(w){return Zt(w)?(n.consume(w),f):w===64?s(w):h(w)}function f(w){return w===43||w===45||w===46||Kt(w)?(o=1,a(w)):h(w)}function a(w){return w===58?(n.consume(w),o=0,c):(w===43||w===45||w===46||Kt(w))&&o++<32?(n.consume(w),a):(o=0,h(w))}function c(w){return w===62?(n.exit("autolinkProtocol"),n.enter("autolinkMarker"),n.consume(w),n.exit("autolinkMarker"),n.exit("autolink"),r):w===null||w===32||w===60||Ya(w)?s(w):(n.consume(w),c)}function h(w){return w===64?(n.consume(w),m):Dy(w)?(n.consume(w),h):s(w)}function m(w){return Kt(w)?u(w):s(w)}function u(w){return w===46?(n.consume(w),o=0,m):w===62?(n.exit("autolinkProtocol").type="autolinkEmail",n.enter("autolinkMarker"),n.consume(w),n.exit("autolinkMarker"),n.exit("autolink"),r):y(w)}function y(w){if((w===45||Kt(w))&&o++<63){const k=w===45?y:u;return n.consume(w),k}return s(w)}}const wl={partial:!0,tokenize:Fy};function Fy(n,r,s){return o;function o(_){return qe(_)?We(n,d,"linePrefix")(_):d(_)}function d(_){return _===null||Me(_)?r(_):s(_)}}const $g={continuation:{tokenize:Gy},exit:Vy,name:"blockQuote",tokenize:qy};function qy(n,r,s){const o=this;return d;function d(f){if(f===62){const a=o.containerState;return a.open||(n.enter("blockQuote",{_container:!0}),a.open=!0),n.enter("blockQuotePrefix"),n.enter("blockQuoteMarker"),n.consume(f),n.exit("blockQuoteMarker"),_}return s(f)}function _(f){return qe(f)?(n.enter("blockQuotePrefixWhitespace"),n.consume(f),n.exit("blockQuotePrefixWhitespace"),n.exit("blockQuotePrefix"),r):(n.exit("blockQuotePrefix"),r(f))}}function Gy(n,r,s){const o=this;return d;function d(f){return qe(f)?We(n,_,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f):_(f)}function _(f){return n.attempt($g,r,s)(f)}}function Vy(n){n.exit("blockQuote")}const Kg={name:"characterEscape",tokenize:$y};function $y(n,r,s){return o;function o(_){return n.enter("characterEscape"),n.enter("escapeMarker"),n.consume(_),n.exit("escapeMarker"),d}function d(_){return Ly(_)?(n.enter("characterEscapeValue"),n.consume(_),n.exit("characterEscapeValue"),n.exit("characterEscape"),r):s(_)}}const Yg={name:"characterReference",tokenize:Ky};function Ky(n,r,s){const o=this;let d=0,_,f;return a;function a(u){return n.enter("characterReference"),n.enter("characterReferenceMarker"),n.consume(u),n.exit("characterReferenceMarker"),c}function c(u){return u===35?(n.enter("characterReferenceMarkerNumeric"),n.consume(u),n.exit("characterReferenceMarkerNumeric"),h):(n.enter("characterReferenceValue"),_=31,f=Kt,m(u))}function h(u){return u===88||u===120?(n.enter("characterReferenceMarkerHexadecimal"),n.consume(u),n.exit("characterReferenceMarkerHexadecimal"),n.enter("characterReferenceValue"),_=6,f=My,m):(n.enter("characterReferenceValue"),_=7,f=Fu,m(u))}function m(u){if(u===59&&d){const y=n.exit("characterReferenceValue");return f===Kt&&!oh(o.sliceSerialize(y))?s(u):(n.enter("characterReferenceMarker"),n.consume(u),n.exit("characterReferenceMarker"),n.exit("characterReference"),r)}return f(u)&&d++<_?(n.consume(u),m):s(u)}}const Im={partial:!0,tokenize:Wy},Um={concrete:!0,name:"codeFenced",tokenize:Yy};function Yy(n,r,s){const o=this,d={partial:!0,tokenize:L};let _=0,f=0,a;return c;function c(R){return h(R)}function h(R){const T=o.events[o.events.length-1];return _=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,a=R,n.enter("codeFenced"),n.enter("codeFencedFence"),n.enter("codeFencedFenceSequence"),m(R)}function m(R){return R===a?(f++,n.consume(R),m):f<3?s(R):(n.exit("codeFencedFenceSequence"),qe(R)?We(n,u,"whitespace")(R):u(R))}function u(R){return R===null||Me(R)?(n.exit("codeFencedFence"),o.interrupt?r(R):n.check(Im,x,E)(R)):(n.enter("codeFencedFenceInfo"),n.enter("chunkString",{contentType:"string"}),y(R))}function y(R){return R===null||Me(R)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),u(R)):qe(R)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),We(n,w,"whitespace")(R)):R===96&&R===a?s(R):(n.consume(R),y)}function w(R){return R===null||Me(R)?u(R):(n.enter("codeFencedFenceMeta"),n.enter("chunkString",{contentType:"string"}),k(R))}function k(R){return R===null||Me(R)?(n.exit("chunkString"),n.exit("codeFencedFenceMeta"),u(R)):R===96&&R===a?s(R):(n.consume(R),k)}function x(R){return n.attempt(d,E,b)(R)}function b(R){return n.enter("lineEnding"),n.consume(R),n.exit("lineEnding"),S}function S(R){return _>0&&qe(R)?We(n,g,"linePrefix",_+1)(R):g(R)}function g(R){return R===null||Me(R)?n.check(Im,x,E)(R):(n.enter("codeFlowValue"),v(R))}function v(R){return R===null||Me(R)?(n.exit("codeFlowValue"),g(R)):(n.consume(R),v)}function E(R){return n.exit("codeFenced"),r(R)}function L(R,T,A){let M=0;return j;function j(W){return R.enter("lineEnding"),R.consume(W),R.exit("lineEnding"),I}function I(W){return R.enter("codeFencedFence"),qe(W)?We(R,U,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(W):U(W)}function U(W){return W===a?(R.enter("codeFencedFenceSequence"),F(W)):A(W)}function F(W){return W===a?(M++,R.consume(W),F):M>=f?(R.exit("codeFencedFenceSequence"),qe(W)?We(R,K,"whitespace")(W):K(W)):A(W)}function K(W){return W===null||Me(W)?(R.exit("codeFencedFence"),T(W)):A(W)}}}function Wy(n,r,s){const o=this;return d;function d(f){return f===null?s(f):(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),_)}function _(f){return o.parser.lazy[o.now().line]?s(f):r(f)}}const xu={name:"codeIndented",tokenize:Qy},Xy={partial:!0,tokenize:Zy};function Qy(n,r,s){const o=this;return d;function d(h){return n.enter("codeIndented"),We(n,_,"linePrefix",5)(h)}function _(h){const m=o.events[o.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?f(h):s(h)}function f(h){return h===null?c(h):Me(h)?n.attempt(Xy,f,c)(h):(n.enter("codeFlowValue"),a(h))}function a(h){return h===null||Me(h)?(n.exit("codeFlowValue"),f(h)):(n.consume(h),a)}function c(h){return n.exit("codeIndented"),r(h)}}function Zy(n,r,s){const o=this;return d;function d(f){return o.parser.lazy[o.now().line]?s(f):Me(f)?(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),d):We(n,_,"linePrefix",5)(f)}function _(f){const a=o.events[o.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?r(f):Me(f)?d(f):s(f)}}const Jy={name:"codeText",previous:tS,resolve:eS,tokenize:nS};function eS(n){let r=n.length-4,s=3,o,d;if((n[s][1].type==="lineEnding"||n[s][1].type==="space")&&(n[r][1].type==="lineEnding"||n[r][1].type==="space")){for(o=s;++o<r;)if(n[o][1].type==="codeTextData"){n[s][1].type="codeTextPadding",n[r][1].type="codeTextPadding",s+=2,r-=2;break}}for(o=s-1,r++;++o<=r;)d===void 0?o!==r&&n[o][1].type!=="lineEnding"&&(d=o):(o===r||n[o][1].type==="lineEnding")&&(n[d][1].type="codeTextData",o!==d+2&&(n[d][1].end=n[o-1][1].end,n.splice(d+2,o-d-2),r-=o-d-2,o=d+2),d=void 0);return n}function tS(n){return n!==96||this.events[this.events.length-1][1].type==="characterEscape"}function nS(n,r,s){let o=0,d,_;return f;function f(u){return n.enter("codeText"),n.enter("codeTextSequence"),a(u)}function a(u){return u===96?(n.consume(u),o++,a):(n.exit("codeTextSequence"),c(u))}function c(u){return u===null?s(u):u===32?(n.enter("space"),n.consume(u),n.exit("space"),c):u===96?(_=n.enter("codeTextSequence"),d=0,m(u)):Me(u)?(n.enter("lineEnding"),n.consume(u),n.exit("lineEnding"),c):(n.enter("codeTextData"),h(u))}function h(u){return u===null||u===32||u===96||Me(u)?(n.exit("codeTextData"),c(u)):(n.consume(u),h)}function m(u){return u===96?(n.consume(u),d++,m):d===o?(n.exit("codeTextSequence"),n.exit("codeText"),r(u)):(_.type="codeTextData",h(u))}}class iS{constructor(r){this.left=r?[...r]:[],this.right=[]}get(r){if(r<0||r>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+r+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return r<this.left.length?this.left[r]:this.right[this.right.length-r+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(r,s){const o=s??Number.POSITIVE_INFINITY;return o<this.left.length?this.left.slice(r,o):r>this.left.length?this.right.slice(this.right.length-o+this.left.length,this.right.length-r+this.left.length).reverse():this.left.slice(r).concat(this.right.slice(this.right.length-o+this.left.length).reverse())}splice(r,s,o){const d=s||0;this.setCursor(Math.trunc(r));const _=this.right.splice(this.right.length-d,Number.POSITIVE_INFINITY);return o&&dl(this.left,o),_.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(r){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(r)}pushMany(r){this.setCursor(Number.POSITIVE_INFINITY),dl(this.left,r)}unshift(r){this.setCursor(0),this.right.push(r)}unshiftMany(r){this.setCursor(0),dl(this.right,r.reverse())}setCursor(r){if(!(r===this.left.length||r>this.left.length&&this.right.length===0||r<0&&this.left.length===0))if(r<this.left.length){const s=this.left.splice(r,Number.POSITIVE_INFINITY);dl(this.right,s.reverse())}else{const s=this.right.splice(this.left.length+this.right.length-r,Number.POSITIVE_INFINITY);dl(this.left,s.reverse())}}}function dl(n,r){let s=0;if(r.length<1e4)n.push(...r);else for(;s<r.length;)n.push(...r.slice(s,s+1e4)),s+=1e4}function Wg(n){const r={};let s=-1,o,d,_,f,a,c,h;const m=new iS(n);for(;++s<m.length;){for(;s in r;)s=r[s];if(o=m.get(s),s&&o[1].type==="chunkFlow"&&m.get(s-1)[1].type==="listItemPrefix"&&(c=o[1]._tokenizer.events,_=0,_<c.length&&c[_][1].type==="lineEndingBlank"&&(_+=2),_<c.length&&c[_][1].type==="content"))for(;++_<c.length&&c[_][1].type!=="content";)c[_][1].type==="chunkText"&&(c[_][1]._isInFirstContentOfListItem=!0,_++);if(o[0]==="enter")o[1].contentType&&(Object.assign(r,rS(m,s)),s=r[s],h=!0);else if(o[1]._container){for(_=s,d=void 0;_--;)if(f=m.get(_),f[1].type==="lineEnding"||f[1].type==="lineEndingBlank")f[0]==="enter"&&(d&&(m.get(d)[1].type="lineEndingBlank"),f[1].type="lineEnding",d=_);else if(!(f[1].type==="linePrefix"||f[1].type==="listItemIndent"))break;d&&(o[1].end={...m.get(d)[1].start},a=m.slice(d,s),a.unshift(o),m.splice(d,s-d+1,a))}}return yn(n,0,Number.POSITIVE_INFINITY,m.slice(0)),!h}function rS(n,r){const s=n.get(r)[1],o=n.get(r)[2];let d=r-1;const _=[];let f=s._tokenizer;f||(f=o.parser[s.contentType](s.start),s._contentTypeTextTrailing&&(f._contentTypeTextTrailing=!0));const a=f.events,c=[],h={};let m,u,y=-1,w=s,k=0,x=0;const b=[x];for(;w;){for(;n.get(++d)[1]!==w;);_.push(d),w._tokenizer||(m=o.sliceStream(w),w.next||m.push(null),u&&f.defineSkip(w.start),w._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=!0),f.write(m),w._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=void 0)),u=w,w=w.next}for(w=s;++y<a.length;)a[y][0]==="exit"&&a[y-1][0]==="enter"&&a[y][1].type===a[y-1][1].type&&a[y][1].start.line!==a[y][1].end.line&&(x=y+1,b.push(x),w._tokenizer=void 0,w.previous=void 0,w=w.next);for(f.events=[],w?(w._tokenizer=void 0,w.previous=void 0):b.pop(),y=b.length;y--;){const S=a.slice(b[y],b[y+1]),g=_.pop();c.push([g,g+S.length-1]),n.splice(g,2,S)}for(c.reverse(),y=-1;++y<c.length;)h[k+c[y][0]]=k+c[y][1],k+=c[y][1]-c[y][0]-1;return h}const sS={resolve:aS,tokenize:oS},lS={partial:!0,tokenize:cS};function aS(n){return Wg(n),n}function oS(n,r){let s;return o;function o(a){return n.enter("content"),s=n.enter("chunkContent",{contentType:"content"}),d(a)}function d(a){return a===null?_(a):Me(a)?n.check(lS,f,_)(a):(n.consume(a),d)}function _(a){return n.exit("chunkContent"),n.exit("content"),r(a)}function f(a){return n.consume(a),n.exit("chunkContent"),s.next=n.enter("chunkContent",{contentType:"content",previous:s}),s=s.next,d}}function cS(n,r,s){const o=this;return d;function d(f){return n.exit("chunkContent"),n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),We(n,_,"linePrefix")}function _(f){if(f===null||Me(f))return s(f);const a=o.events[o.events.length-1];return!o.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?r(f):n.interrupt(o.parser.constructs.flow,s,r)(f)}}function Xg(n,r,s,o,d,_,f,a,c){const h=c||Number.POSITIVE_INFINITY;let m=0;return u;function u(S){return S===60?(n.enter(o),n.enter(d),n.enter(_),n.consume(S),n.exit(_),y):S===null||S===32||S===41||Ya(S)?s(S):(n.enter(o),n.enter(f),n.enter(a),n.enter("chunkString",{contentType:"string"}),x(S))}function y(S){return S===62?(n.enter(_),n.consume(S),n.exit(_),n.exit(d),n.exit(o),r):(n.enter(a),n.enter("chunkString",{contentType:"string"}),w(S))}function w(S){return S===62?(n.exit("chunkString"),n.exit(a),y(S)):S===null||S===60||Me(S)?s(S):(n.consume(S),S===92?k:w)}function k(S){return S===60||S===62||S===92?(n.consume(S),w):w(S)}function x(S){return!m&&(S===null||S===41||ut(S))?(n.exit("chunkString"),n.exit(a),n.exit(f),n.exit(o),r(S)):m<h&&S===40?(n.consume(S),m++,x):S===41?(n.consume(S),m--,x):S===null||S===32||S===40||Ya(S)?s(S):(n.consume(S),S===92?b:x)}function b(S){return S===40||S===41||S===92?(n.consume(S),x):x(S)}}function Qg(n,r,s,o,d,_){const f=this;let a=0,c;return h;function h(w){return n.enter(o),n.enter(d),n.consume(w),n.exit(d),n.enter(_),m}function m(w){return a>999||w===null||w===91||w===93&&!c||w===94&&!a&&"_hiddenFootnoteSupport"in f.parser.constructs?s(w):w===93?(n.exit(_),n.enter(d),n.consume(w),n.exit(d),n.exit(o),r):Me(w)?(n.enter("lineEnding"),n.consume(w),n.exit("lineEnding"),m):(n.enter("chunkString",{contentType:"string"}),u(w))}function u(w){return w===null||w===91||w===93||Me(w)||a++>999?(n.exit("chunkString"),m(w)):(n.consume(w),c||(c=!qe(w)),w===92?y:u)}function y(w){return w===91||w===92||w===93?(n.consume(w),a++,u):u(w)}}function Zg(n,r,s,o,d,_){let f;return a;function a(y){return y===34||y===39||y===40?(n.enter(o),n.enter(d),n.consume(y),n.exit(d),f=y===40?41:y,c):s(y)}function c(y){return y===f?(n.enter(d),n.consume(y),n.exit(d),n.exit(o),r):(n.enter(_),h(y))}function h(y){return y===f?(n.exit(_),c(f)):y===null?s(y):Me(y)?(n.enter("lineEnding"),n.consume(y),n.exit("lineEnding"),We(n,h,"linePrefix")):(n.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===f||y===null||Me(y)?(n.exit("chunkString"),h(y)):(n.consume(y),y===92?u:m)}function u(y){return y===f||y===92?(n.consume(y),m):m(y)}}function _l(n,r){let s;return o;function o(d){return Me(d)?(n.enter("lineEnding"),n.consume(d),n.exit("lineEnding"),s=!0,o):qe(d)?We(n,o,s?"linePrefix":"lineSuffix")(d):r(d)}}const uS={name:"definition",tokenize:fS},hS={partial:!0,tokenize:dS};function fS(n,r,s){const o=this;let d;return _;function _(w){return n.enter("definition"),f(w)}function f(w){return Qg.call(o,n,a,s,"definitionLabel","definitionLabelMarker","definitionLabelString")(w)}function a(w){return d=zn(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)),w===58?(n.enter("definitionMarker"),n.consume(w),n.exit("definitionMarker"),c):s(w)}function c(w){return ut(w)?_l(n,h)(w):h(w)}function h(w){return Xg(n,m,s,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(w)}function m(w){return n.attempt(hS,u,u)(w)}function u(w){return qe(w)?We(n,y,"whitespace")(w):y(w)}function y(w){return w===null||Me(w)?(n.exit("definition"),o.parser.defined.push(d),r(w)):s(w)}}function dS(n,r,s){return o;function o(a){return ut(a)?_l(n,d)(a):s(a)}function d(a){return Zg(n,_,s,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function _(a){return qe(a)?We(n,f,"whitespace")(a):f(a)}function f(a){return a===null||Me(a)?r(a):s(a)}}const pS={name:"hardBreakEscape",tokenize:mS};function mS(n,r,s){return o;function o(_){return n.enter("hardBreakEscape"),n.consume(_),d}function d(_){return Me(_)?(n.exit("hardBreakEscape"),r(_)):s(_)}}const gS={name:"headingAtx",resolve:_S,tokenize:vS};function _S(n,r){let s=n.length-2,o=3,d,_;return n[o][1].type==="whitespace"&&(o+=2),s-2>o&&n[s][1].type==="whitespace"&&(s-=2),n[s][1].type==="atxHeadingSequence"&&(o===s-1||s-4>o&&n[s-2][1].type==="whitespace")&&(s-=o+1===s?2:4),s>o&&(d={type:"atxHeadingText",start:n[o][1].start,end:n[s][1].end},_={type:"chunkText",start:n[o][1].start,end:n[s][1].end,contentType:"text"},yn(n,o,s-o+1,[["enter",d,r],["enter",_,r],["exit",_,r],["exit",d,r]])),n}function vS(n,r,s){let o=0;return d;function d(m){return n.enter("atxHeading"),_(m)}function _(m){return n.enter("atxHeadingSequence"),f(m)}function f(m){return m===35&&o++<6?(n.consume(m),f):m===null||ut(m)?(n.exit("atxHeadingSequence"),a(m)):s(m)}function a(m){return m===35?(n.enter("atxHeadingSequence"),c(m)):m===null||Me(m)?(n.exit("atxHeading"),r(m)):qe(m)?We(n,a,"whitespace")(m):(n.enter("atxHeadingText"),h(m))}function c(m){return m===35?(n.consume(m),c):(n.exit("atxHeadingSequence"),a(m))}function h(m){return m===null||m===35||ut(m)?(n.exit("atxHeadingText"),a(m)):(n.consume(m),h)}}const yS=["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","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Pm=["pre","script","style","textarea"],SS={concrete:!0,name:"htmlFlow",resolveTo:wS,tokenize:xS},bS={partial:!0,tokenize:kS},CS={partial:!0,tokenize:ES};function wS(n){let r=n.length;for(;r--&&!(n[r][0]==="enter"&&n[r][1].type==="htmlFlow"););return r>1&&n[r-2][1].type==="linePrefix"&&(n[r][1].start=n[r-2][1].start,n[r+1][1].start=n[r-2][1].start,n.splice(r-2,2)),n}function xS(n,r,s){const o=this;let d,_,f,a,c;return h;function h(H){return m(H)}function m(H){return n.enter("htmlFlow"),n.enter("htmlFlowData"),n.consume(H),u}function u(H){return H===33?(n.consume(H),y):H===47?(n.consume(H),_=!0,x):H===63?(n.consume(H),d=3,o.interrupt?r:B):Zt(H)?(n.consume(H),f=String.fromCharCode(H),b):s(H)}function y(H){return H===45?(n.consume(H),d=2,w):H===91?(n.consume(H),d=5,a=0,k):Zt(H)?(n.consume(H),d=4,o.interrupt?r:B):s(H)}function w(H){return H===45?(n.consume(H),o.interrupt?r:B):s(H)}function k(H){const te="CDATA[";return H===te.charCodeAt(a++)?(n.consume(H),a===te.length?o.interrupt?r:U:k):s(H)}function x(H){return Zt(H)?(n.consume(H),f=String.fromCharCode(H),b):s(H)}function b(H){if(H===null||H===47||H===62||ut(H)){const te=H===47,he=f.toLowerCase();return!te&&!_&&Pm.includes(he)?(d=1,o.interrupt?r(H):U(H)):yS.includes(f.toLowerCase())?(d=6,te?(n.consume(H),S):o.interrupt?r(H):U(H)):(d=7,o.interrupt&&!o.parser.lazy[o.now().line]?s(H):_?g(H):v(H))}return H===45||Kt(H)?(n.consume(H),f+=String.fromCharCode(H),b):s(H)}function S(H){return H===62?(n.consume(H),o.interrupt?r:U):s(H)}function g(H){return qe(H)?(n.consume(H),g):j(H)}function v(H){return H===47?(n.consume(H),j):H===58||H===95||Zt(H)?(n.consume(H),E):qe(H)?(n.consume(H),v):j(H)}function E(H){return H===45||H===46||H===58||H===95||Kt(H)?(n.consume(H),E):L(H)}function L(H){return H===61?(n.consume(H),R):qe(H)?(n.consume(H),L):v(H)}function R(H){return H===null||H===60||H===61||H===62||H===96?s(H):H===34||H===39?(n.consume(H),c=H,T):qe(H)?(n.consume(H),R):A(H)}function T(H){return H===c?(n.consume(H),c=null,M):H===null||Me(H)?s(H):(n.consume(H),T)}function A(H){return H===null||H===34||H===39||H===47||H===60||H===61||H===62||H===96||ut(H)?L(H):(n.consume(H),A)}function M(H){return H===47||H===62||qe(H)?v(H):s(H)}function j(H){return H===62?(n.consume(H),I):s(H)}function I(H){return H===null||Me(H)?U(H):qe(H)?(n.consume(H),I):s(H)}function U(H){return H===45&&d===2?(n.consume(H),V):H===60&&d===1?(n.consume(H),$):H===62&&d===4?(n.consume(H),z):H===63&&d===3?(n.consume(H),B):H===93&&d===5?(n.consume(H),N):Me(H)&&(d===6||d===7)?(n.exit("htmlFlowData"),n.check(bS,G,F)(H)):H===null||Me(H)?(n.exit("htmlFlowData"),F(H)):(n.consume(H),U)}function F(H){return n.check(CS,K,G)(H)}function K(H){return n.enter("lineEnding"),n.consume(H),n.exit("lineEnding"),W}function W(H){return H===null||Me(H)?F(H):(n.enter("htmlFlowData"),U(H))}function V(H){return H===45?(n.consume(H),B):U(H)}function $(H){return H===47?(n.consume(H),f="",ee):U(H)}function ee(H){if(H===62){const te=f.toLowerCase();return Pm.includes(te)?(n.consume(H),z):U(H)}return Zt(H)&&f.length<8?(n.consume(H),f+=String.fromCharCode(H),ee):U(H)}function N(H){return H===93?(n.consume(H),B):U(H)}function B(H){return H===62?(n.consume(H),z):H===45&&d===2?(n.consume(H),B):U(H)}function z(H){return H===null||Me(H)?(n.exit("htmlFlowData"),G(H)):(n.consume(H),z)}function G(H){return n.exit("htmlFlow"),r(H)}}function ES(n,r,s){const o=this;return d;function d(f){return Me(f)?(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),_):s(f)}function _(f){return o.parser.lazy[o.now().line]?s(f):r(f)}}function kS(n,r,s){return o;function o(d){return n.enter("lineEnding"),n.consume(d),n.exit("lineEnding"),n.attempt(wl,r,s)}}const AS={name:"htmlText",tokenize:TS};function TS(n,r,s){const o=this;let d,_,f;return a;function a(B){return n.enter("htmlText"),n.enter("htmlTextData"),n.consume(B),c}function c(B){return B===33?(n.consume(B),h):B===47?(n.consume(B),L):B===63?(n.consume(B),v):Zt(B)?(n.consume(B),A):s(B)}function h(B){return B===45?(n.consume(B),m):B===91?(n.consume(B),_=0,k):Zt(B)?(n.consume(B),g):s(B)}function m(B){return B===45?(n.consume(B),w):s(B)}function u(B){return B===null?s(B):B===45?(n.consume(B),y):Me(B)?(f=u,$(B)):(n.consume(B),u)}function y(B){return B===45?(n.consume(B),w):u(B)}function w(B){return B===62?V(B):B===45?y(B):u(B)}function k(B){const z="CDATA[";return B===z.charCodeAt(_++)?(n.consume(B),_===z.length?x:k):s(B)}function x(B){return B===null?s(B):B===93?(n.consume(B),b):Me(B)?(f=x,$(B)):(n.consume(B),x)}function b(B){return B===93?(n.consume(B),S):x(B)}function S(B){return B===62?V(B):B===93?(n.consume(B),S):x(B)}function g(B){return B===null||B===62?V(B):Me(B)?(f=g,$(B)):(n.consume(B),g)}function v(B){return B===null?s(B):B===63?(n.consume(B),E):Me(B)?(f=v,$(B)):(n.consume(B),v)}function E(B){return B===62?V(B):v(B)}function L(B){return Zt(B)?(n.consume(B),R):s(B)}function R(B){return B===45||Kt(B)?(n.consume(B),R):T(B)}function T(B){return Me(B)?(f=T,$(B)):qe(B)?(n.consume(B),T):V(B)}function A(B){return B===45||Kt(B)?(n.consume(B),A):B===47||B===62||ut(B)?M(B):s(B)}function M(B){return B===47?(n.consume(B),V):B===58||B===95||Zt(B)?(n.consume(B),j):Me(B)?(f=M,$(B)):qe(B)?(n.consume(B),M):V(B)}function j(B){return B===45||B===46||B===58||B===95||Kt(B)?(n.consume(B),j):I(B)}function I(B){return B===61?(n.consume(B),U):Me(B)?(f=I,$(B)):qe(B)?(n.consume(B),I):M(B)}function U(B){return B===null||B===60||B===61||B===62||B===96?s(B):B===34||B===39?(n.consume(B),d=B,F):Me(B)?(f=U,$(B)):qe(B)?(n.consume(B),U):(n.consume(B),K)}function F(B){return B===d?(n.consume(B),d=void 0,W):B===null?s(B):Me(B)?(f=F,$(B)):(n.consume(B),F)}function K(B){return B===null||B===34||B===39||B===60||B===61||B===96?s(B):B===47||B===62||ut(B)?M(B):(n.consume(B),K)}function W(B){return B===47||B===62||ut(B)?M(B):s(B)}function V(B){return B===62?(n.consume(B),n.exit("htmlTextData"),n.exit("htmlText"),r):s(B)}function $(B){return n.exit("htmlTextData"),n.enter("lineEnding"),n.consume(B),n.exit("lineEnding"),ee}function ee(B){return qe(B)?We(n,N,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):N(B)}function N(B){return n.enter("htmlTextData"),f(B)}}const ch={name:"labelEnd",resolveAll:LS,resolveTo:OS,tokenize:BS},RS={tokenize:jS},DS={tokenize:NS},MS={tokenize:HS};function LS(n){let r=-1;const s=[];for(;++r<n.length;){const o=n[r][1];if(s.push(n[r]),o.type==="labelImage"||o.type==="labelLink"||o.type==="labelEnd"){const d=o.type==="labelImage"?4:2;o.type="data",r+=d}}return n.length!==s.length&&yn(n,0,n.length,s),n}function OS(n,r){let s=n.length,o=0,d,_,f,a;for(;s--;)if(d=n[s][1],_){if(d.type==="link"||d.type==="labelLink"&&d._inactive)break;n[s][0]==="enter"&&d.type==="labelLink"&&(d._inactive=!0)}else if(f){if(n[s][0]==="enter"&&(d.type==="labelImage"||d.type==="labelLink")&&!d._balanced&&(_=s,d.type!=="labelLink")){o=2;break}}else d.type==="labelEnd"&&(f=s);const c={type:n[_][1].type==="labelLink"?"link":"image",start:{...n[_][1].start},end:{...n[n.length-1][1].end}},h={type:"label",start:{...n[_][1].start},end:{...n[f][1].end}},m={type:"labelText",start:{...n[_+o+2][1].end},end:{...n[f-2][1].start}};return a=[["enter",c,r],["enter",h,r]],a=Mn(a,n.slice(_+1,_+o+3)),a=Mn(a,[["enter",m,r]]),a=Mn(a,no(r.parser.constructs.insideSpan.null,n.slice(_+o+4,f-3),r)),a=Mn(a,[["exit",m,r],n[f-2],n[f-1],["exit",h,r]]),a=Mn(a,n.slice(f+1)),a=Mn(a,[["exit",c,r]]),yn(n,_,n.length,a),n}function BS(n,r,s){const o=this;let d=o.events.length,_,f;for(;d--;)if((o.events[d][1].type==="labelImage"||o.events[d][1].type==="labelLink")&&!o.events[d][1]._balanced){_=o.events[d][1];break}return a;function a(y){return _?_._inactive?u(y):(f=o.parser.defined.includes(zn(o.sliceSerialize({start:_.end,end:o.now()}))),n.enter("labelEnd"),n.enter("labelMarker"),n.consume(y),n.exit("labelMarker"),n.exit("labelEnd"),c):s(y)}function c(y){return y===40?n.attempt(RS,m,f?m:u)(y):y===91?n.attempt(DS,m,f?h:u)(y):f?m(y):u(y)}function h(y){return n.attempt(MS,m,u)(y)}function m(y){return r(y)}function u(y){return _._balanced=!0,s(y)}}function jS(n,r,s){return o;function o(u){return n.enter("resource"),n.enter("resourceMarker"),n.consume(u),n.exit("resourceMarker"),d}function d(u){return ut(u)?_l(n,_)(u):_(u)}function _(u){return u===41?m(u):Xg(n,f,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(u)}function f(u){return ut(u)?_l(n,c)(u):m(u)}function a(u){return s(u)}function c(u){return u===34||u===39||u===40?Zg(n,h,s,"resourceTitle","resourceTitleMarker","resourceTitleString")(u):m(u)}function h(u){return ut(u)?_l(n,m)(u):m(u)}function m(u){return u===41?(n.enter("resourceMarker"),n.consume(u),n.exit("resourceMarker"),n.exit("resource"),r):s(u)}}function NS(n,r,s){const o=this;return d;function d(a){return Qg.call(o,n,_,f,"reference","referenceMarker","referenceString")(a)}function _(a){return o.parser.defined.includes(zn(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)))?r(a):s(a)}function f(a){return s(a)}}function HS(n,r,s){return o;function o(_){return n.enter("reference"),n.enter("referenceMarker"),n.consume(_),n.exit("referenceMarker"),d}function d(_){return _===93?(n.enter("referenceMarker"),n.consume(_),n.exit("referenceMarker"),n.exit("reference"),r):s(_)}}const zS={name:"labelStartImage",resolveAll:ch.resolveAll,tokenize:IS};function IS(n,r,s){const o=this;return d;function d(a){return n.enter("labelImage"),n.enter("labelImageMarker"),n.consume(a),n.exit("labelImageMarker"),_}function _(a){return a===91?(n.enter("labelMarker"),n.consume(a),n.exit("labelMarker"),n.exit("labelImage"),f):s(a)}function f(a){return a===94&&"_hiddenFootnoteSupport"in o.parser.constructs?s(a):r(a)}}const US={name:"labelStartLink",resolveAll:ch.resolveAll,tokenize:PS};function PS(n,r,s){const o=this;return d;function d(f){return n.enter("labelLink"),n.enter("labelMarker"),n.consume(f),n.exit("labelMarker"),n.exit("labelLink"),_}function _(f){return f===94&&"_hiddenFootnoteSupport"in o.parser.constructs?s(f):r(f)}}const Eu={name:"lineEnding",tokenize:FS};function FS(n,r){return s;function s(o){return n.enter("lineEnding"),n.consume(o),n.exit("lineEnding"),We(n,r,"linePrefix")}}const Ka={name:"thematicBreak",tokenize:qS};function qS(n,r,s){let o=0,d;return _;function _(h){return n.enter("thematicBreak"),f(h)}function f(h){return d=h,a(h)}function a(h){return h===d?(n.enter("thematicBreakSequence"),c(h)):o>=3&&(h===null||Me(h))?(n.exit("thematicBreak"),r(h)):s(h)}function c(h){return h===d?(n.consume(h),o++,c):(n.exit("thematicBreakSequence"),qe(h)?We(n,a,"whitespace")(h):a(h))}}const on={continuation:{tokenize:KS},exit:WS,name:"list",tokenize:$S},GS={partial:!0,tokenize:XS},VS={partial:!0,tokenize:YS};function $S(n,r,s){const o=this,d=o.events[o.events.length-1];let _=d&&d[1].type==="linePrefix"?d[2].sliceSerialize(d[1],!0).length:0,f=0;return a;function a(w){const k=o.containerState.type||(w===42||w===43||w===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!o.containerState.marker||w===o.containerState.marker:Fu(w)){if(o.containerState.type||(o.containerState.type=k,n.enter(k,{_container:!0})),k==="listUnordered")return n.enter("listItemPrefix"),w===42||w===45?n.check(Ka,s,h)(w):h(w);if(!o.interrupt||w===49)return n.enter("listItemPrefix"),n.enter("listItemValue"),c(w)}return s(w)}function c(w){return Fu(w)&&++f<10?(n.consume(w),c):(!o.interrupt||f<2)&&(o.containerState.marker?w===o.containerState.marker:w===41||w===46)?(n.exit("listItemValue"),h(w)):s(w)}function h(w){return n.enter("listItemMarker"),n.consume(w),n.exit("listItemMarker"),o.containerState.marker=o.containerState.marker||w,n.check(wl,o.interrupt?s:m,n.attempt(GS,y,u))}function m(w){return o.containerState.initialBlankLine=!0,_++,y(w)}function u(w){return qe(w)?(n.enter("listItemPrefixWhitespace"),n.consume(w),n.exit("listItemPrefixWhitespace"),y):s(w)}function y(w){return o.containerState.size=_+o.sliceSerialize(n.exit("listItemPrefix"),!0).length,r(w)}}function KS(n,r,s){const o=this;return o.containerState._closeFlow=void 0,n.check(wl,d,_);function d(a){return o.containerState.furtherBlankLines=o.containerState.furtherBlankLines||o.containerState.initialBlankLine,We(n,r,"listItemIndent",o.containerState.size+1)(a)}function _(a){return o.containerState.furtherBlankLines||!qe(a)?(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,f(a)):(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,n.attempt(VS,r,f)(a))}function f(a){return o.containerState._closeFlow=!0,o.interrupt=void 0,We(n,n.attempt(on,r,s),"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function YS(n,r,s){const o=this;return We(n,d,"listItemIndent",o.containerState.size+1);function d(_){const f=o.events[o.events.length-1];return f&&f[1].type==="listItemIndent"&&f[2].sliceSerialize(f[1],!0).length===o.containerState.size?r(_):s(_)}}function WS(n){n.exit(this.containerState.type)}function XS(n,r,s){const o=this;return We(n,d,"listItemPrefixWhitespace",o.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function d(_){const f=o.events[o.events.length-1];return!qe(_)&&f&&f[1].type==="listItemPrefixWhitespace"?r(_):s(_)}}const Fm={name:"setextUnderline",resolveTo:QS,tokenize:ZS};function QS(n,r){let s=n.length,o,d,_;for(;s--;)if(n[s][0]==="enter"){if(n[s][1].type==="content"){o=s;break}n[s][1].type==="paragraph"&&(d=s)}else n[s][1].type==="content"&&n.splice(s,1),!_&&n[s][1].type==="definition"&&(_=s);const f={type:"setextHeading",start:{...n[o][1].start},end:{...n[n.length-1][1].end}};return n[d][1].type="setextHeadingText",_?(n.splice(d,0,["enter",f,r]),n.splice(_+1,0,["exit",n[o][1],r]),n[o][1].end={...n[_][1].end}):n[o][1]=f,n.push(["exit",f,r]),n}function ZS(n,r,s){const o=this;let d;return _;function _(h){let m=o.events.length,u;for(;m--;)if(o.events[m][1].type!=="lineEnding"&&o.events[m][1].type!=="linePrefix"&&o.events[m][1].type!=="content"){u=o.events[m][1].type==="paragraph";break}return!o.parser.lazy[o.now().line]&&(o.interrupt||u)?(n.enter("setextHeadingLine"),d=h,f(h)):s(h)}function f(h){return n.enter("setextHeadingLineSequence"),a(h)}function a(h){return h===d?(n.consume(h),a):(n.exit("setextHeadingLineSequence"),qe(h)?We(n,c,"lineSuffix")(h):c(h))}function c(h){return h===null||Me(h)?(n.exit("setextHeadingLine"),r(h)):s(h)}}const JS={tokenize:eb};function eb(n){const r=this,s=n.attempt(wl,o,n.attempt(this.parser.constructs.flowInitial,d,We(n,n.attempt(this.parser.constructs.flow,d,n.attempt(sS,d)),"linePrefix")));return s;function o(_){if(_===null){n.consume(_);return}return n.enter("lineEndingBlank"),n.consume(_),n.exit("lineEndingBlank"),r.currentConstruct=void 0,s}function d(_){if(_===null){n.consume(_);return}return n.enter("lineEnding"),n.consume(_),n.exit("lineEnding"),r.currentConstruct=void 0,s}}const tb={resolveAll:e_()},nb=Jg("string"),ib=Jg("text");function Jg(n){return{resolveAll:e_(n==="text"?rb:void 0),tokenize:r};function r(s){const o=this,d=this.parser.constructs[n],_=s.attempt(d,f,a);return f;function f(m){return h(m)?_(m):a(m)}function a(m){if(m===null){s.consume(m);return}return s.enter("data"),s.consume(m),c}function c(m){return h(m)?(s.exit("data"),_(m)):(s.consume(m),c)}function h(m){if(m===null)return!0;const u=d[m];let y=-1;if(u)for(;++y<u.length;){const w=u[y];if(!w.previous||w.previous.call(o,o.previous))return!0}return!1}}}function e_(n){return r;function r(s,o){let d=-1,_;for(;++d<=s.length;)_===void 0?s[d]&&s[d][1].type==="data"&&(_=d,d++):(!s[d]||s[d][1].type!=="data")&&(d!==_+2&&(s[_][1].end=s[d-1][1].end,s.splice(_+2,d-_-2),d=_+2),_=void 0);return n?n(s,o):s}}function rb(n,r){let s=0;for(;++s<=n.length;)if((s===n.length||n[s][1].type==="lineEnding")&&n[s-1][1].type==="data"){const o=n[s-1][1],d=r.sliceStream(o);let _=d.length,f=-1,a=0,c;for(;_--;){const h=d[_];if(typeof h=="string"){for(f=h.length;h.charCodeAt(f-1)===32;)a++,f--;if(f)break;f=-1}else if(h===-2)c=!0,a++;else if(h!==-1){_++;break}}if(r._contentTypeTextTrailing&&s===n.length&&(a=0),a){const h={type:s===n.length||c||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:_?f:o.start._bufferIndex+f,_index:o.start._index+_,line:o.end.line,column:o.end.column-a,offset:o.end.offset-a},end:{...o.end}};o.end={...h.start},o.start.offset===o.end.offset?Object.assign(o,h):(n.splice(s,0,["enter",h,r],["exit",h,r]),s+=2)}s++}return n}const sb={42:on,43:on,45:on,48:on,49:on,50:on,51:on,52:on,53:on,54:on,55:on,56:on,57:on,62:$g},lb={91:uS},ab={[-2]:xu,[-1]:xu,32:xu},ob={35:gS,42:Ka,45:[Fm,Ka],60:SS,61:Fm,95:Ka,96:Um,126:Um},cb={38:Yg,92:Kg},ub={[-5]:Eu,[-4]:Eu,[-3]:Eu,33:zS,38:Yg,42:qu,60:[Uy,AS],91:US,92:[pS,Kg],93:ch,95:qu,96:Jy},hb={null:[qu,tb]},fb={null:[42,95]},db={null:[]},pb=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:fb,contentInitial:lb,disable:db,document:sb,flow:ob,flowInitial:ab,insideSpan:hb,string:cb,text:ub},Symbol.toStringTag,{value:"Module"}));function mb(n,r,s){let o={_bufferIndex:-1,_index:0,line:s&&s.line||1,column:s&&s.column||1,offset:s&&s.offset||0};const d={},_=[];let f=[],a=[];const c={attempt:T(L),check:T(R),consume:g,enter:v,exit:E,interrupt:T(R,{interrupt:!0})},h={code:null,containerState:{},defineSkip:x,events:[],now:k,parser:n,previous:null,sliceSerialize:y,sliceStream:w,write:u};let m=r.tokenize.call(h,c);return r.resolveAll&&_.push(r),h;function u(I){return f=Mn(f,I),b(),f[f.length-1]!==null?[]:(A(r,0),h.events=no(_,h.events,h),h.events)}function y(I,U){return _b(w(I),U)}function w(I){return gb(f,I)}function k(){const{_bufferIndex:I,_index:U,line:F,column:K,offset:W}=o;return{_bufferIndex:I,_index:U,line:F,column:K,offset:W}}function x(I){d[I.line]=I.column,j()}function b(){let I;for(;o._index<f.length;){const U=f[o._index];if(typeof U=="string")for(I=o._index,o._bufferIndex<0&&(o._bufferIndex=0);o._index===I&&o._bufferIndex<U.length;)S(U.charCodeAt(o._bufferIndex));else S(U)}}function S(I){m=m(I)}function g(I){Me(I)?(o.line++,o.column=1,o.offset+=I===-3?2:1,j()):I!==-1&&(o.column++,o.offset++),o._bufferIndex<0?o._index++:(o._bufferIndex++,o._bufferIndex===f[o._index].length&&(o._bufferIndex=-1,o._index++)),h.previous=I}function v(I,U){const F=U||{};return F.type=I,F.start=k(),h.events.push(["enter",F,h]),a.push(F),F}function E(I){const U=a.pop();return U.end=k(),h.events.push(["exit",U,h]),U}function L(I,U){A(I,U.from)}function R(I,U){U.restore()}function T(I,U){return F;function F(K,W,V){let $,ee,N,B;return Array.isArray(K)?G(K):"tokenize"in K?G([K]):z(K);function z(me){return Y;function Y(q){const oe=q!==null&&me[q],J=q!==null&&me.null,ie=[...Array.isArray(oe)?oe:oe?[oe]:[],...Array.isArray(J)?J:J?[J]:[]];return G(ie)(q)}}function G(me){return $=me,ee=0,me.length===0?V:H(me[ee])}function H(me){return Y;function Y(q){return B=M(),N=me,me.partial||(h.currentConstruct=me),me.name&&h.parser.constructs.disable.null.includes(me.name)?he():me.tokenize.call(U?Object.assign(Object.create(h),U):h,c,te,he)(q)}}function te(me){return I(N,B),W}function he(me){return B.restore(),++ee<$.length?H($[ee]):V}}}function A(I,U){I.resolveAll&&!_.includes(I)&&_.push(I),I.resolve&&yn(h.events,U,h.events.length-U,I.resolve(h.events.slice(U),h)),I.resolveTo&&(h.events=I.resolveTo(h.events,h))}function M(){const I=k(),U=h.previous,F=h.currentConstruct,K=h.events.length,W=Array.from(a);return{from:K,restore:V};function V(){o=I,h.previous=U,h.currentConstruct=F,h.events.length=K,a=W,j()}}function j(){o.line in d&&o.column<2&&(o.column=d[o.line],o.offset+=d[o.line]-1)}}function gb(n,r){const s=r.start._index,o=r.start._bufferIndex,d=r.end._index,_=r.end._bufferIndex;let f;if(s===d)f=[n[s].slice(o,_)];else{if(f=n.slice(s,d),o>-1){const a=f[0];typeof a=="string"?f[0]=a.slice(o):f.shift()}_>0&&f.push(n[d].slice(0,_))}return f}function _b(n,r){let s=-1;const o=[];let d;for(;++s<n.length;){const _=n[s];let f;if(typeof _=="string")f=_;else switch(_){case-5:{f="\r";break}case-4:{f=`
62
+ `;break}case-3:{f=`\r
63
+ `;break}case-2:{f=r?" ":" ";break}case-1:{if(!r&&d)continue;f=" ";break}default:f=String.fromCharCode(_)}d=_===-2,o.push(f)}return o.join("")}function vb(n){const o={constructs:Gg([pb,...(n||{}).extensions||[]]),content:d(Oy),defined:[],document:d(jy),flow:d(JS),lazy:{},string:d(nb),text:d(ib)};return o;function d(_){return f;function f(a){return mb(o,_,a)}}}function yb(n){for(;!Wg(n););return n}const qm=/[\0\t\n\r]/g;function Sb(){let n=1,r="",s=!0,o;return d;function d(_,f,a){const c=[];let h,m,u,y,w;for(_=r+(typeof _=="string"?_.toString():new TextDecoder(f||void 0).decode(_)),u=0,r="",s&&(_.charCodeAt(0)===65279&&u++,s=void 0);u<_.length;){if(qm.lastIndex=u,h=qm.exec(_),y=h&&h.index!==void 0?h.index:_.length,w=_.charCodeAt(y),!h){r=_.slice(u);break}if(w===10&&u===y&&o)c.push(-3),o=void 0;else switch(o&&(c.push(-5),o=void 0),u<y&&(c.push(_.slice(u,y)),n+=y-u),w){case 0:{c.push(65533),n++;break}case 9:{for(m=Math.ceil(n/4)*4,c.push(-2);n++<m;)c.push(-1);break}case 10:{c.push(-4),n=1;break}default:o=!0,n=1}u=y+1}return a&&(o&&c.push(-5),r&&c.push(r),c.push(null)),c}}const bb=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Cb(n){return n.replace(bb,wb)}function wb(n,r,s){if(r)return r;if(s.charCodeAt(0)===35){const d=s.charCodeAt(1),_=d===120||d===88;return Vg(s.slice(_?2:1),_?16:10)}return oh(s)||n}const t_={}.hasOwnProperty;function xb(n,r,s){return r&&typeof r=="object"&&(s=r,r=void 0),Eb(s)(yb(vb(s).document().write(Sb()(n,r,!0))))}function Eb(n){const r={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:_(Wt),autolinkProtocol:M,autolinkEmail:M,atxHeading:_(Ke),blockQuote:_(J),characterEscape:M,characterReference:M,codeFenced:_(ie),codeFencedFenceInfo:f,codeFencedFenceMeta:f,codeIndented:_(ie,f),codeText:_(de,f),codeTextData:M,data:M,codeFlowValue:M,definition:_(Ce),definitionDestinationString:f,definitionLabelString:f,definitionTitleString:f,emphasis:_(xe),hardBreakEscape:_(it),hardBreakTrailing:_(it),htmlFlow:_(Re,f),htmlFlowData:M,htmlText:_(Re,f),htmlTextData:M,image:_(Jt),label:f,link:_(Wt),listItem:_(Ct),listItemValue:y,listOrdered:_(Bt,u),listUnordered:_(Bt),paragraph:_(Xt),reference:H,referenceString:f,resourceDestinationString:f,resourceTitleString:f,setextHeading:_(Ke),strong:_(vt),thematicBreak:_(kt)},exit:{atxHeading:c(),atxHeadingSequence:L,autolink:c(),autolinkEmail:oe,autolinkProtocol:q,blockQuote:c(),characterEscapeValue:j,characterReferenceMarkerHexadecimal:he,characterReferenceMarkerNumeric:he,characterReferenceValue:me,characterReference:Y,codeFenced:c(b),codeFencedFence:x,codeFencedFenceInfo:w,codeFencedFenceMeta:k,codeFlowValue:j,codeIndented:c(S),codeText:c(W),codeTextData:j,data:j,definition:c(),definitionDestinationString:E,definitionLabelString:g,definitionTitleString:v,emphasis:c(),hardBreakEscape:c(U),hardBreakTrailing:c(U),htmlFlow:c(F),htmlFlowData:j,htmlText:c(K),htmlTextData:j,image:c($),label:N,labelText:ee,lineEnding:I,link:c(V),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:te,resourceDestinationString:B,resourceTitleString:z,resource:G,setextHeading:c(A),setextHeadingLineSequence:T,setextHeadingText:R,strong:c(),thematicBreak:c()}};n_(r,(n||{}).mdastExtensions||[]);const s={};return o;function o(ue){let Se={type:"root",children:[]};const ke={stack:[Se],tokenStack:[],config:r,enter:a,exit:h,buffer:f,resume:m,data:s},De=[];let Be=-1;for(;++Be<ue.length;)if(ue[Be][1].type==="listOrdered"||ue[Be][1].type==="listUnordered")if(ue[Be][0]==="enter")De.push(Be);else{const ht=De.pop();Be=d(ue,ht,Be)}for(Be=-1;++Be<ue.length;){const ht=r[ue[Be][0]];t_.call(ht,ue[Be][1].type)&&ht[ue[Be][1].type].call(Object.assign({sliceSerialize:ue[Be][2].sliceSerialize},ke),ue[Be][1])}if(ke.tokenStack.length>0){const ht=ke.tokenStack[ke.tokenStack.length-1];(ht[1]||Gm).call(ke,void 0,ht[0])}for(Se.position={start:Yi(ue.length>0?ue[0][1].start:{line:1,column:1,offset:0}),end:Yi(ue.length>0?ue[ue.length-2][1].end:{line:1,column:1,offset:0})},Be=-1;++Be<r.transforms.length;)Se=r.transforms[Be](Se)||Se;return Se}function d(ue,Se,ke){let De=Se-1,Be=-1,ht=!1,Ie,gt,Ye,wt;for(;++De<=ke;){const Xe=ue[De];switch(Xe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Xe[0]==="enter"?Be++:Be--,wt=void 0;break}case"lineEndingBlank":{Xe[0]==="enter"&&(Ie&&!wt&&!Be&&!Ye&&(Ye=De),wt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:wt=void 0}if(!Be&&Xe[0]==="enter"&&Xe[1].type==="listItemPrefix"||Be===-1&&Xe[0]==="exit"&&(Xe[1].type==="listUnordered"||Xe[1].type==="listOrdered")){if(Ie){let zt=De;for(gt=void 0;zt--;){const At=ue[zt];if(At[1].type==="lineEnding"||At[1].type==="lineEndingBlank"){if(At[0]==="exit")continue;gt&&(ue[gt][1].type="lineEndingBlank",ht=!0),At[1].type="lineEnding",gt=zt}else if(!(At[1].type==="linePrefix"||At[1].type==="blockQuotePrefix"||At[1].type==="blockQuotePrefixWhitespace"||At[1].type==="blockQuoteMarker"||At[1].type==="listItemIndent"))break}Ye&&(!gt||Ye<gt)&&(Ie._spread=!0),Ie.end=Object.assign({},gt?ue[gt][1].start:Xe[1].end),ue.splice(gt||De,0,["exit",Ie,Xe[2]]),De++,ke++}if(Xe[1].type==="listItemPrefix"){const zt={type:"listItem",_spread:!1,start:Object.assign({},Xe[1].start),end:void 0};Ie=zt,ue.splice(De,0,["enter",zt,Xe[2]]),De++,ke++,Ye=void 0,wt=!0}}}return ue[Se][1]._spread=ht,ke}function _(ue,Se){return ke;function ke(De){a.call(this,ue(De),De),Se&&Se.call(this,De)}}function f(){this.stack.push({type:"fragment",children:[]})}function a(ue,Se,ke){this.stack[this.stack.length-1].children.push(ue),this.stack.push(ue),this.tokenStack.push([Se,ke||void 0]),ue.position={start:Yi(Se.start),end:void 0}}function c(ue){return Se;function Se(ke){ue&&ue.call(this,ke),h.call(this,ke)}}function h(ue,Se){const ke=this.stack.pop(),De=this.tokenStack.pop();if(De)De[0].type!==ue.type&&(Se?Se.call(this,ue,De[0]):(De[1]||Gm).call(this,ue,De[0]));else throw new Error("Cannot close `"+ue.type+"` ("+gl({start:ue.start,end:ue.end})+"): it’s not open");ke.position.end=Yi(ue.end)}function m(){return ah(this.stack.pop())}function u(){this.data.expectingFirstListItemValue=!0}function y(ue){if(this.data.expectingFirstListItemValue){const Se=this.stack[this.stack.length-2];Se.start=Number.parseInt(this.sliceSerialize(ue),10),this.data.expectingFirstListItemValue=void 0}}function w(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.lang=ue}function k(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.meta=ue}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ue.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ue.replace(/(\r?\n|\r)$/g,"")}function g(ue){const Se=this.resume(),ke=this.stack[this.stack.length-1];ke.label=Se,ke.identifier=zn(this.sliceSerialize(ue)).toLowerCase()}function v(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.title=ue}function E(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.url=ue}function L(ue){const Se=this.stack[this.stack.length-1];if(!Se.depth){const ke=this.sliceSerialize(ue).length;Se.depth=ke}}function R(){this.data.setextHeadingSlurpLineEnding=!0}function T(ue){const Se=this.stack[this.stack.length-1];Se.depth=this.sliceSerialize(ue).codePointAt(0)===61?1:2}function A(){this.data.setextHeadingSlurpLineEnding=void 0}function M(ue){const ke=this.stack[this.stack.length-1].children;let De=ke[ke.length-1];(!De||De.type!=="text")&&(De=rt(),De.position={start:Yi(ue.start),end:void 0},ke.push(De)),this.stack.push(De)}function j(ue){const Se=this.stack.pop();Se.value+=this.sliceSerialize(ue),Se.position.end=Yi(ue.end)}function I(ue){const Se=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ke=Se.children[Se.children.length-1];ke.position.end=Yi(ue.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&r.canContainEols.includes(Se.type)&&(M.call(this,ue),j.call(this,ue))}function U(){this.data.atHardBreak=!0}function F(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ue}function K(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ue}function W(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ue}function V(){const ue=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";ue.type+="Reference",ue.referenceType=Se,delete ue.url,delete ue.title}else delete ue.identifier,delete ue.label;this.data.referenceType=void 0}function $(){const ue=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";ue.type+="Reference",ue.referenceType=Se,delete ue.url,delete ue.title}else delete ue.identifier,delete ue.label;this.data.referenceType=void 0}function ee(ue){const Se=this.sliceSerialize(ue),ke=this.stack[this.stack.length-2];ke.label=Cb(Se),ke.identifier=zn(Se).toLowerCase()}function N(){const ue=this.stack[this.stack.length-1],Se=this.resume(),ke=this.stack[this.stack.length-1];if(this.data.inReference=!0,ke.type==="link"){const De=ue.children;ke.children=De}else ke.alt=Se}function B(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.url=ue}function z(){const ue=this.resume(),Se=this.stack[this.stack.length-1];Se.title=ue}function G(){this.data.inReference=void 0}function H(){this.data.referenceType="collapsed"}function te(ue){const Se=this.resume(),ke=this.stack[this.stack.length-1];ke.label=Se,ke.identifier=zn(this.sliceSerialize(ue)).toLowerCase(),this.data.referenceType="full"}function he(ue){this.data.characterReferenceType=ue.type}function me(ue){const Se=this.sliceSerialize(ue),ke=this.data.characterReferenceType;let De;ke?(De=Vg(Se,ke==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):De=oh(Se);const Be=this.stack[this.stack.length-1];Be.value+=De}function Y(ue){const Se=this.stack.pop();Se.position.end=Yi(ue.end)}function q(ue){j.call(this,ue);const Se=this.stack[this.stack.length-1];Se.url=this.sliceSerialize(ue)}function oe(ue){j.call(this,ue);const Se=this.stack[this.stack.length-1];Se.url="mailto:"+this.sliceSerialize(ue)}function J(){return{type:"blockquote",children:[]}}function ie(){return{type:"code",lang:null,meta:null,value:""}}function de(){return{type:"inlineCode",value:""}}function Ce(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function xe(){return{type:"emphasis",children:[]}}function Ke(){return{type:"heading",depth:0,children:[]}}function it(){return{type:"break"}}function Re(){return{type:"html",value:""}}function Jt(){return{type:"image",title:null,url:"",alt:null}}function Wt(){return{type:"link",title:null,url:"",children:[]}}function Bt(ue){return{type:"list",ordered:ue.type==="listOrdered",start:null,spread:ue._spread,children:[]}}function Ct(ue){return{type:"listItem",spread:ue._spread,checked:null,children:[]}}function Xt(){return{type:"paragraph",children:[]}}function vt(){return{type:"strong",children:[]}}function rt(){return{type:"text",value:""}}function kt(){return{type:"thematicBreak"}}}function Yi(n){return{line:n.line,column:n.column,offset:n.offset}}function n_(n,r){let s=-1;for(;++s<r.length;){const o=r[s];Array.isArray(o)?n_(n,o):kb(n,o)}}function kb(n,r){let s;for(s in r)if(t_.call(r,s))switch(s){case"canContainEols":{const o=r[s];o&&n[s].push(...o);break}case"transforms":{const o=r[s];o&&n[s].push(...o);break}case"enter":case"exit":{const o=r[s];o&&Object.assign(n[s],o);break}}}function Gm(n,r){throw n?new Error("Cannot close `"+n.type+"` ("+gl({start:n.start,end:n.end})+"): a different token (`"+r.type+"`, "+gl({start:r.start,end:r.end})+") is open"):new Error("Cannot close document, a token (`"+r.type+"`, "+gl({start:r.start,end:r.end})+") is still open")}function Ab(n){const r=this;r.parser=s;function s(o){return xb(o,{...r.data("settings"),...n,extensions:r.data("micromarkExtensions")||[],mdastExtensions:r.data("fromMarkdownExtensions")||[]})}}function Tb(n,r){const s={type:"element",tagName:"blockquote",properties:{},children:n.wrap(n.all(r),!0)};return n.patch(r,s),n.applyData(r,s)}function Rb(n,r){const s={type:"element",tagName:"br",properties:{},children:[]};return n.patch(r,s),[n.applyData(r,s),{type:"text",value:`
64
+ `}]}function Db(n,r){const s=r.value?r.value+`
65
+ `:"",o={},d=r.lang?r.lang.split(/\s+/):[];d.length>0&&(o.className=["language-"+d[0]]);let _={type:"element",tagName:"code",properties:o,children:[{type:"text",value:s}]};return r.meta&&(_.data={meta:r.meta}),n.patch(r,_),_=n.applyData(r,_),_={type:"element",tagName:"pre",properties:{},children:[_]},n.patch(r,_),_}function Mb(n,r){const s={type:"element",tagName:"del",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}function Lb(n,r){const s={type:"element",tagName:"em",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}function Ob(n,r){const s=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",o=String(r.identifier).toUpperCase(),d=_s(o.toLowerCase()),_=n.footnoteOrder.indexOf(o);let f,a=n.footnoteCounts.get(o);a===void 0?(a=0,n.footnoteOrder.push(o),f=n.footnoteOrder.length):f=_+1,a+=1,n.footnoteCounts.set(o,a);const c={type:"element",tagName:"a",properties:{href:"#"+s+"fn-"+d,id:s+"fnref-"+d+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(f)}]};n.patch(r,c);const h={type:"element",tagName:"sup",properties:{},children:[c]};return n.patch(r,h),n.applyData(r,h)}function Bb(n,r){const s={type:"element",tagName:"h"+r.depth,properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}function jb(n,r){if(n.options.allowDangerousHtml){const s={type:"raw",value:r.value};return n.patch(r,s),n.applyData(r,s)}}function i_(n,r){const s=r.referenceType;let o="]";if(s==="collapsed"?o+="[]":s==="full"&&(o+="["+(r.label||r.identifier)+"]"),r.type==="imageReference")return[{type:"text",value:"!["+r.alt+o}];const d=n.all(r),_=d[0];_&&_.type==="text"?_.value="["+_.value:d.unshift({type:"text",value:"["});const f=d[d.length-1];return f&&f.type==="text"?f.value+=o:d.push({type:"text",value:o}),d}function Nb(n,r){const s=String(r.identifier).toUpperCase(),o=n.definitionById.get(s);if(!o)return i_(n,r);const d={src:_s(o.url||""),alt:r.alt};o.title!==null&&o.title!==void 0&&(d.title=o.title);const _={type:"element",tagName:"img",properties:d,children:[]};return n.patch(r,_),n.applyData(r,_)}function Hb(n,r){const s={src:_s(r.url)};r.alt!==null&&r.alt!==void 0&&(s.alt=r.alt),r.title!==null&&r.title!==void 0&&(s.title=r.title);const o={type:"element",tagName:"img",properties:s,children:[]};return n.patch(r,o),n.applyData(r,o)}function zb(n,r){const s={type:"text",value:r.value.replace(/\r?\n|\r/g," ")};n.patch(r,s);const o={type:"element",tagName:"code",properties:{},children:[s]};return n.patch(r,o),n.applyData(r,o)}function Ib(n,r){const s=String(r.identifier).toUpperCase(),o=n.definitionById.get(s);if(!o)return i_(n,r);const d={href:_s(o.url||"")};o.title!==null&&o.title!==void 0&&(d.title=o.title);const _={type:"element",tagName:"a",properties:d,children:n.all(r)};return n.patch(r,_),n.applyData(r,_)}function Ub(n,r){const s={href:_s(r.url)};r.title!==null&&r.title!==void 0&&(s.title=r.title);const o={type:"element",tagName:"a",properties:s,children:n.all(r)};return n.patch(r,o),n.applyData(r,o)}function Pb(n,r,s){const o=n.all(r),d=s?Fb(s):r_(r),_={},f=[];if(typeof r.checked=="boolean"){const m=o[0];let u;m&&m.type==="element"&&m.tagName==="p"?u=m:(u={type:"element",tagName:"p",properties:{},children:[]},o.unshift(u)),u.children.length>0&&u.children.unshift({type:"text",value:" "}),u.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:r.checked,disabled:!0},children:[]}),_.className=["task-list-item"]}let a=-1;for(;++a<o.length;){const m=o[a];(d||a!==0||m.type!=="element"||m.tagName!=="p")&&f.push({type:"text",value:`
66
+ `}),m.type==="element"&&m.tagName==="p"&&!d?f.push(...m.children):f.push(m)}const c=o[o.length-1];c&&(d||c.type!=="element"||c.tagName!=="p")&&f.push({type:"text",value:`
67
+ `});const h={type:"element",tagName:"li",properties:_,children:f};return n.patch(r,h),n.applyData(r,h)}function Fb(n){let r=!1;if(n.type==="list"){r=n.spread||!1;const s=n.children;let o=-1;for(;!r&&++o<s.length;)r=r_(s[o])}return r}function r_(n){const r=n.spread;return r??n.children.length>1}function qb(n,r){const s={},o=n.all(r);let d=-1;for(typeof r.start=="number"&&r.start!==1&&(s.start=r.start);++d<o.length;){const f=o[d];if(f.type==="element"&&f.tagName==="li"&&f.properties&&Array.isArray(f.properties.className)&&f.properties.className.includes("task-list-item")){s.className=["contains-task-list"];break}}const _={type:"element",tagName:r.ordered?"ol":"ul",properties:s,children:n.wrap(o,!0)};return n.patch(r,_),n.applyData(r,_)}function Gb(n,r){const s={type:"element",tagName:"p",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}function Vb(n,r){const s={type:"root",children:n.wrap(n.all(r))};return n.patch(r,s),n.applyData(r,s)}function $b(n,r){const s={type:"element",tagName:"strong",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}function Kb(n,r){const s=n.all(r),o=s.shift(),d=[];if(o){const f={type:"element",tagName:"thead",properties:{},children:n.wrap([o],!0)};n.patch(r.children[0],f),d.push(f)}if(s.length>0){const f={type:"element",tagName:"tbody",properties:{},children:n.wrap(s,!0)},a=ih(r.children[1]),c=Hg(r.children[r.children.length-1]);a&&c&&(f.position={start:a,end:c}),d.push(f)}const _={type:"element",tagName:"table",properties:{},children:n.wrap(d,!0)};return n.patch(r,_),n.applyData(r,_)}function Yb(n,r,s){const o=s?s.children:void 0,_=(o?o.indexOf(r):1)===0?"th":"td",f=s&&s.type==="table"?s.align:void 0,a=f?f.length:r.children.length;let c=-1;const h=[];for(;++c<a;){const u=r.children[c],y={},w=f?f[c]:void 0;w&&(y.align=w);let k={type:"element",tagName:_,properties:y,children:[]};u&&(k.children=n.all(u),n.patch(u,k),k=n.applyData(u,k)),h.push(k)}const m={type:"element",tagName:"tr",properties:{},children:n.wrap(h,!0)};return n.patch(r,m),n.applyData(r,m)}function Wb(n,r){const s={type:"element",tagName:"td",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}const Vm=9,$m=32;function Xb(n){const r=String(n),s=/\r?\n|\r/g;let o=s.exec(r),d=0;const _=[];for(;o;)_.push(Km(r.slice(d,o.index),d>0,!0),o[0]),d=o.index+o[0].length,o=s.exec(r);return _.push(Km(r.slice(d),d>0,!1)),_.join("")}function Km(n,r,s){let o=0,d=n.length;if(r){let _=n.codePointAt(o);for(;_===Vm||_===$m;)o++,_=n.codePointAt(o)}if(s){let _=n.codePointAt(d-1);for(;_===Vm||_===$m;)d--,_=n.codePointAt(d-1)}return d>o?n.slice(o,d):""}function Qb(n,r){const s={type:"text",value:Xb(String(r.value))};return n.patch(r,s),n.applyData(r,s)}function Zb(n,r){const s={type:"element",tagName:"hr",properties:{},children:[]};return n.patch(r,s),n.applyData(r,s)}const Jb={blockquote:Tb,break:Rb,code:Db,delete:Mb,emphasis:Lb,footnoteReference:Ob,heading:Bb,html:jb,imageReference:Nb,image:Hb,inlineCode:zb,linkReference:Ib,link:Ub,listItem:Pb,list:qb,paragraph:Gb,root:Vb,strong:$b,table:Kb,tableCell:Wb,tableRow:Yb,text:Qb,thematicBreak:Zb,toml:Pa,yaml:Pa,definition:Pa,footnoteDefinition:Pa};function Pa(){}const s_=-1,io=0,vl=1,Wa=2,uh=3,hh=4,fh=5,dh=6,l_=7,a_=8,eC=typeof self=="object"?self:globalThis,Ym=(n,r)=>{switch(n){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+n)}return new eC[n](r)},tC=(n,r)=>{const s=(d,_)=>(n.set(_,d),d),o=d=>{if(n.has(d))return n.get(d);const[_,f]=r[d];switch(_){case io:case s_:return s(f,d);case vl:{const a=s([],d);for(const c of f)a.push(o(c));return a}case Wa:{const a=s({},d);for(const[c,h]of f)a[o(c)]=o(h);return a}case uh:return s(new Date(f),d);case hh:{const{source:a,flags:c}=f;return s(new RegExp(a,c),d)}case fh:{const a=s(new Map,d);for(const[c,h]of f)a.set(o(c),o(h));return a}case dh:{const a=s(new Set,d);for(const c of f)a.add(o(c));return a}case l_:{const{name:a,message:c}=f;return s(Ym(a,c),d)}case a_:return s(BigInt(f),d);case"BigInt":return s(Object(BigInt(f)),d);case"ArrayBuffer":return s(new Uint8Array(f).buffer,f);case"DataView":{const{buffer:a}=new Uint8Array(f);return s(new DataView(a),f)}}return s(Ym(_,f),d)};return o},Wm=n=>tC(new Map,n)(0),us="",{toString:nC}={},{keys:iC}=Object,pl=n=>{const r=typeof n;if(r!=="object"||!n)return[io,r];const s=nC.call(n).slice(8,-1);switch(s){case"Array":return[vl,us];case"Object":return[Wa,us];case"Date":return[uh,us];case"RegExp":return[hh,us];case"Map":return[fh,us];case"Set":return[dh,us];case"DataView":return[vl,s]}return s.includes("Array")?[vl,s]:s.includes("Error")?[l_,s]:[Wa,s]},Fa=([n,r])=>n===io&&(r==="function"||r==="symbol"),rC=(n,r,s,o)=>{const d=(f,a)=>{const c=o.push(f)-1;return s.set(a,c),c},_=f=>{if(s.has(f))return s.get(f);let[a,c]=pl(f);switch(a){case io:{let m=f;switch(c){case"bigint":a=a_,m=f.toString();break;case"function":case"symbol":if(n)throw new TypeError("unable to serialize "+c);m=null;break;case"undefined":return d([s_],f)}return d([a,m],f)}case vl:{if(c){let y=f;return c==="DataView"?y=new Uint8Array(f.buffer):c==="ArrayBuffer"&&(y=new Uint8Array(f)),d([c,[...y]],f)}const m=[],u=d([a,m],f);for(const y of f)m.push(_(y));return u}case Wa:{if(c)switch(c){case"BigInt":return d([c,f.toString()],f);case"Boolean":case"Number":case"String":return d([c,f.valueOf()],f)}if(r&&"toJSON"in f)return _(f.toJSON());const m=[],u=d([a,m],f);for(const y of iC(f))(n||!Fa(pl(f[y])))&&m.push([_(y),_(f[y])]);return u}case uh:return d([a,f.toISOString()],f);case hh:{const{source:m,flags:u}=f;return d([a,{source:m,flags:u}],f)}case fh:{const m=[],u=d([a,m],f);for(const[y,w]of f)(n||!(Fa(pl(y))||Fa(pl(w))))&&m.push([_(y),_(w)]);return u}case dh:{const m=[],u=d([a,m],f);for(const y of f)(n||!Fa(pl(y)))&&m.push(_(y));return u}}const{message:h}=f;return d([a,{name:c,message:h}],f)};return _},Xm=(n,{json:r,lossy:s}={})=>{const o=[];return rC(!(r||s),!!r,new Map,o)(n),o},Xa=typeof structuredClone=="function"?(n,r)=>r&&("json"in r||"lossy"in r)?Wm(Xm(n,r)):structuredClone(n):(n,r)=>Wm(Xm(n,r));function sC(n,r){const s=[{type:"text",value:"↩"}];return r>1&&s.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(r)}]}),s}function lC(n,r){return"Back to reference "+(n+1)+(r>1?"-"+r:"")}function aC(n){const r=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",s=n.options.footnoteBackContent||sC,o=n.options.footnoteBackLabel||lC,d=n.options.footnoteLabel||"Footnotes",_=n.options.footnoteLabelTagName||"h2",f=n.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let c=-1;for(;++c<n.footnoteOrder.length;){const h=n.footnoteById.get(n.footnoteOrder[c]);if(!h)continue;const m=n.all(h),u=String(h.identifier).toUpperCase(),y=_s(u.toLowerCase());let w=0;const k=[],x=n.footnoteCounts.get(u);for(;x!==void 0&&++w<=x;){k.length>0&&k.push({type:"text",value:" "});let g=typeof s=="string"?s:s(c,w);typeof g=="string"&&(g={type:"text",value:g}),k.push({type:"element",tagName:"a",properties:{href:"#"+r+"fnref-"+y+(w>1?"-"+w:""),dataFootnoteBackref:"",ariaLabel:typeof o=="string"?o:o(c,w),className:["data-footnote-backref"]},children:Array.isArray(g)?g:[g]})}const b=m[m.length-1];if(b&&b.type==="element"&&b.tagName==="p"){const g=b.children[b.children.length-1];g&&g.type==="text"?g.value+=" ":b.children.push({type:"text",value:" "}),b.children.push(...k)}else m.push(...k);const S={type:"element",tagName:"li",properties:{id:r+"fn-"+y},children:n.wrap(m,!0)};n.patch(h,S),a.push(S)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:_,properties:{...Xa(f),id:"footnote-label"},children:[{type:"text",value:d}]},{type:"text",value:`
68
+ `},{type:"element",tagName:"ol",properties:{},children:n.wrap(a,!0)},{type:"text",value:`
69
+ `}]}}const ro=(function(n){if(n==null)return hC;if(typeof n=="function")return so(n);if(typeof n=="object")return Array.isArray(n)?oC(n):cC(n);if(typeof n=="string")return uC(n);throw new Error("Expected function, string, or object as test")});function oC(n){const r=[];let s=-1;for(;++s<n.length;)r[s]=ro(n[s]);return so(o);function o(...d){let _=-1;for(;++_<r.length;)if(r[_].apply(this,d))return!0;return!1}}function cC(n){const r=n;return so(s);function s(o){const d=o;let _;for(_ in n)if(d[_]!==r[_])return!1;return!0}}function uC(n){return so(r);function r(s){return s&&s.type===n}}function so(n){return r;function r(s,o,d){return!!(fC(s)&&n.call(this,s,typeof o=="number"?o:void 0,d||void 0))}}function hC(){return!0}function fC(n){return n!==null&&typeof n=="object"&&"type"in n}const o_=[],dC=!0,Gu=!1,pC="skip";function c_(n,r,s,o){let d;typeof r=="function"&&typeof s!="function"?(o=s,s=r):d=r;const _=ro(d),f=o?-1:1;a(n,void 0,[])();function a(c,h,m){const u=c&&typeof c=="object"?c:{};if(typeof u.type=="string"){const w=typeof u.tagName=="string"?u.tagName:typeof u.name=="string"?u.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(c.type+(w?"<"+w+">":""))+")"})}return y;function y(){let w=o_,k,x,b;if((!r||_(c,h,m[m.length-1]||void 0))&&(w=mC(s(c,m)),w[0]===Gu))return w;if("children"in c&&c.children){const S=c;if(S.children&&w[0]!==pC)for(x=(o?S.children.length:-1)+f,b=m.concat(S);x>-1&&x<S.children.length;){const g=S.children[x];if(k=a(g,x,b)(),k[0]===Gu)return k;x=typeof k[1]=="number"?k[1]:x+f}}return w}}}function mC(n){return Array.isArray(n)?n:typeof n=="number"?[dC,n]:n==null?o_:[n]}function ph(n,r,s,o){let d,_,f;typeof r=="function"&&typeof s!="function"?(_=void 0,f=r,d=s):(_=r,f=s,d=o),c_(n,_,a,d);function a(c,h){const m=h[h.length-1],u=m?m.children.indexOf(c):void 0;return f(c,u,m)}}const Vu={}.hasOwnProperty,gC={};function _C(n,r){const s=r||gC,o=new Map,d=new Map,_=new Map,f={...Jb,...s.handlers},a={all:h,applyData:yC,definitionById:o,footnoteById:d,footnoteCounts:_,footnoteOrder:[],handlers:f,one:c,options:s,patch:vC,wrap:bC};return ph(n,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const u=m.type==="definition"?o:d,y=String(m.identifier).toUpperCase();u.has(y)||u.set(y,m)}}),a;function c(m,u){const y=m.type,w=a.handlers[y];if(Vu.call(a.handlers,y)&&w)return w(a,m,u);if(a.options.passThrough&&a.options.passThrough.includes(y)){if("children"in m){const{children:x,...b}=m,S=Xa(b);return S.children=a.all(m),S}return Xa(m)}return(a.options.unknownHandler||SC)(a,m,u)}function h(m){const u=[];if("children"in m){const y=m.children;let w=-1;for(;++w<y.length;){const k=a.one(y[w],m);if(k){if(w&&y[w-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=Qm(k.value)),!Array.isArray(k)&&k.type==="element")){const x=k.children[0];x&&x.type==="text"&&(x.value=Qm(x.value))}Array.isArray(k)?u.push(...k):u.push(k)}}}return u}}function vC(n,r){n.position&&(r.position=sy(n))}function yC(n,r){let s=r;if(n&&n.data){const o=n.data.hName,d=n.data.hChildren,_=n.data.hProperties;if(typeof o=="string")if(s.type==="element")s.tagName=o;else{const f="children"in s?s.children:[s];s={type:"element",tagName:o,properties:{},children:f}}s.type==="element"&&_&&Object.assign(s.properties,Xa(_)),"children"in s&&s.children&&d!==null&&d!==void 0&&(s.children=d)}return s}function SC(n,r){const s=r.data||{},o="value"in r&&!(Vu.call(s,"hProperties")||Vu.call(s,"hChildren"))?{type:"text",value:r.value}:{type:"element",tagName:"div",properties:{},children:n.all(r)};return n.patch(r,o),n.applyData(r,o)}function bC(n,r){const s=[];let o=-1;for(r&&s.push({type:"text",value:`
70
+ `});++o<n.length;)o&&s.push({type:"text",value:`
71
+ `}),s.push(n[o]);return r&&n.length>0&&s.push({type:"text",value:`
72
+ `}),s}function Qm(n){let r=0,s=n.charCodeAt(r);for(;s===9||s===32;)r++,s=n.charCodeAt(r);return n.slice(r)}function Zm(n,r){const s=_C(n,r),o=s.one(n,void 0),d=aC(s),_=Array.isArray(o)?{type:"root",children:o}:o||{type:"root",children:[]};return d&&_.children.push({type:"text",value:`
73
+ `},d),_}function CC(n,r){return n&&"run"in n?async function(s,o){const d=Zm(s,{file:o,...r});await n.run(d,o)}:function(s,o){return Zm(s,{file:o,...n||r})}}function Jm(n){if(n)throw n}var ku,eg;function wC(){if(eg)return ku;eg=1;var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,s=Object.defineProperty,o=Object.getOwnPropertyDescriptor,d=function(h){return typeof Array.isArray=="function"?Array.isArray(h):r.call(h)==="[object Array]"},_=function(h){if(!h||r.call(h)!=="[object Object]")return!1;var m=n.call(h,"constructor"),u=h.constructor&&h.constructor.prototype&&n.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!m&&!u)return!1;var y;for(y in h);return typeof y>"u"||n.call(h,y)},f=function(h,m){s&&m.name==="__proto__"?s(h,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):h[m.name]=m.newValue},a=function(h,m){if(m==="__proto__")if(n.call(h,m)){if(o)return o(h,m).value}else return;return h[m]};return ku=function c(){var h,m,u,y,w,k,x=arguments[0],b=1,S=arguments.length,g=!1;for(typeof x=="boolean"&&(g=x,x=arguments[1]||{},b=2),(x==null||typeof x!="object"&&typeof x!="function")&&(x={});b<S;++b)if(h=arguments[b],h!=null)for(m in h)u=a(x,m),y=a(h,m),x!==y&&(g&&y&&(_(y)||(w=d(y)))?(w?(w=!1,k=u&&d(u)?u:[]):k=u&&_(u)?u:{},f(x,{name:m,newValue:c(g,k,y)})):typeof y<"u"&&f(x,{name:m,newValue:y}));return x},ku}var xC=wC();const Au=bg(xC);function $u(n){if(typeof n!="object"||n===null)return!1;const r=Object.getPrototypeOf(n);return(r===null||r===Object.prototype||Object.getPrototypeOf(r)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)}function EC(){const n=[],r={run:s,use:o};return r;function s(...d){let _=-1;const f=d.pop();if(typeof f!="function")throw new TypeError("Expected function as last argument, not "+f);a(null,...d);function a(c,...h){const m=n[++_];let u=-1;if(c){f(c);return}for(;++u<d.length;)(h[u]===null||h[u]===void 0)&&(h[u]=d[u]);d=h,m?kC(m,a)(...h):f(null,...h)}}function o(d){if(typeof d!="function")throw new TypeError("Expected `middelware` to be a function, not "+d);return n.push(d),r}}function kC(n,r){let s;return o;function o(...f){const a=n.length>f.length;let c;a&&f.push(d);try{c=n.apply(this,f)}catch(h){const m=h;if(a&&s)throw m;return d(m)}a||(c&&c.then&&typeof c.then=="function"?c.then(_,d):c instanceof Error?d(c):_(c))}function d(f,...a){s||(s=!0,r(f,...a))}function _(f){d(null,f)}}const Gn={basename:AC,dirname:TC,extname:RC,join:DC,sep:"/"};function AC(n,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');xl(n);let s=0,o=-1,d=n.length,_;if(r===void 0||r.length===0||r.length>n.length){for(;d--;)if(n.codePointAt(d)===47){if(_){s=d+1;break}}else o<0&&(_=!0,o=d+1);return o<0?"":n.slice(s,o)}if(r===n)return"";let f=-1,a=r.length-1;for(;d--;)if(n.codePointAt(d)===47){if(_){s=d+1;break}}else f<0&&(_=!0,f=d+1),a>-1&&(n.codePointAt(d)===r.codePointAt(a--)?a<0&&(o=d):(a=-1,o=f));return s===o?o=f:o<0&&(o=n.length),n.slice(s,o)}function TC(n){if(xl(n),n.length===0)return".";let r=-1,s=n.length,o;for(;--s;)if(n.codePointAt(s)===47){if(o){r=s;break}}else o||(o=!0);return r<0?n.codePointAt(0)===47?"/":".":r===1&&n.codePointAt(0)===47?"//":n.slice(0,r)}function RC(n){xl(n);let r=n.length,s=-1,o=0,d=-1,_=0,f;for(;r--;){const a=n.codePointAt(r);if(a===47){if(f){o=r+1;break}continue}s<0&&(f=!0,s=r+1),a===46?d<0?d=r:_!==1&&(_=1):d>-1&&(_=-1)}return d<0||s<0||_===0||_===1&&d===s-1&&d===o+1?"":n.slice(d,s)}function DC(...n){let r=-1,s;for(;++r<n.length;)xl(n[r]),n[r]&&(s=s===void 0?n[r]:s+"/"+n[r]);return s===void 0?".":MC(s)}function MC(n){xl(n);const r=n.codePointAt(0)===47;let s=LC(n,!r);return s.length===0&&!r&&(s="."),s.length>0&&n.codePointAt(n.length-1)===47&&(s+="/"),r?"/"+s:s}function LC(n,r){let s="",o=0,d=-1,_=0,f=-1,a,c;for(;++f<=n.length;){if(f<n.length)a=n.codePointAt(f);else{if(a===47)break;a=47}if(a===47){if(!(d===f-1||_===1))if(d!==f-1&&_===2){if(s.length<2||o!==2||s.codePointAt(s.length-1)!==46||s.codePointAt(s.length-2)!==46){if(s.length>2){if(c=s.lastIndexOf("/"),c!==s.length-1){c<0?(s="",o=0):(s=s.slice(0,c),o=s.length-1-s.lastIndexOf("/")),d=f,_=0;continue}}else if(s.length>0){s="",o=0,d=f,_=0;continue}}r&&(s=s.length>0?s+"/..":"..",o=2)}else s.length>0?s+="/"+n.slice(d+1,f):s=n.slice(d+1,f),o=f-d-1;d=f,_=0}else a===46&&_>-1?_++:_=-1}return s}function xl(n){if(typeof n!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(n))}const OC={cwd:BC};function BC(){return"/"}function Ku(n){return!!(n!==null&&typeof n=="object"&&"href"in n&&n.href&&"protocol"in n&&n.protocol&&n.auth===void 0)}function jC(n){if(typeof n=="string")n=new URL(n);else if(!Ku(n)){const r=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+n+"`");throw r.code="ERR_INVALID_ARG_TYPE",r}if(n.protocol!=="file:"){const r=new TypeError("The URL must be of scheme file");throw r.code="ERR_INVALID_URL_SCHEME",r}return NC(n)}function NC(n){if(n.hostname!==""){const o=new TypeError('File URL host must be "localhost" or empty on darwin');throw o.code="ERR_INVALID_FILE_URL_HOST",o}const r=n.pathname;let s=-1;for(;++s<r.length;)if(r.codePointAt(s)===37&&r.codePointAt(s+1)===50){const o=r.codePointAt(s+2);if(o===70||o===102){const d=new TypeError("File URL path must not include encoded / characters");throw d.code="ERR_INVALID_FILE_URL_PATH",d}}return decodeURIComponent(r)}const Tu=["history","path","basename","stem","extname","dirname"];class u_{constructor(r){let s;r?Ku(r)?s={path:r}:typeof r=="string"||HC(r)?s={value:r}:s=r:s={},this.cwd="cwd"in s?"":OC.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let o=-1;for(;++o<Tu.length;){const _=Tu[o];_ in s&&s[_]!==void 0&&s[_]!==null&&(this[_]=_==="history"?[...s[_]]:s[_])}let d;for(d in s)Tu.includes(d)||(this[d]=s[d])}get basename(){return typeof this.path=="string"?Gn.basename(this.path):void 0}set basename(r){Du(r,"basename"),Ru(r,"basename"),this.path=Gn.join(this.dirname||"",r)}get dirname(){return typeof this.path=="string"?Gn.dirname(this.path):void 0}set dirname(r){tg(this.basename,"dirname"),this.path=Gn.join(r||"",this.basename)}get extname(){return typeof this.path=="string"?Gn.extname(this.path):void 0}set extname(r){if(Ru(r,"extname"),tg(this.dirname,"extname"),r){if(r.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(r.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Gn.join(this.dirname,this.stem+(r||""))}get path(){return this.history[this.history.length-1]}set path(r){Ku(r)&&(r=jC(r)),Du(r,"path"),this.path!==r&&this.history.push(r)}get stem(){return typeof this.path=="string"?Gn.basename(this.path,this.extname):void 0}set stem(r){Du(r,"stem"),Ru(r,"stem"),this.path=Gn.join(this.dirname||"",r+(this.extname||""))}fail(r,s,o){const d=this.message(r,s,o);throw d.fatal=!0,d}info(r,s,o){const d=this.message(r,s,o);return d.fatal=void 0,d}message(r,s,o){const d=new Yt(r,s,o);return this.path&&(d.name=this.path+":"+d.name,d.file=this.path),d.fatal=!1,this.messages.push(d),d}toString(r){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(r||void 0).decode(this.value)}}function Ru(n,r){if(n&&n.includes(Gn.sep))throw new Error("`"+r+"` cannot be a path: did not expect `"+Gn.sep+"`")}function Du(n,r){if(!n)throw new Error("`"+r+"` cannot be empty")}function tg(n,r){if(!n)throw new Error("Setting `"+r+"` requires `path` to be set too")}function HC(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const zC=(function(n){const o=this.constructor.prototype,d=o[n],_=function(){return d.apply(_,arguments)};return Object.setPrototypeOf(_,o),_}),IC={}.hasOwnProperty;class mh extends zC{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=EC()}copy(){const r=new mh;let s=-1;for(;++s<this.attachers.length;){const o=this.attachers[s];r.use(...o)}return r.data(Au(!0,{},this.namespace)),r}data(r,s){return typeof r=="string"?arguments.length===2?(Ou("data",this.frozen),this.namespace[r]=s,this):IC.call(this.namespace,r)&&this.namespace[r]||void 0:r?(Ou("data",this.frozen),this.namespace=r,this):this.namespace}freeze(){if(this.frozen)return this;const r=this;for(;++this.freezeIndex<this.attachers.length;){const[s,...o]=this.attachers[this.freezeIndex];if(o[0]===!1)continue;o[0]===!0&&(o[0]=void 0);const d=s.call(r,...o);typeof d=="function"&&this.transformers.use(d)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(r){this.freeze();const s=qa(r),o=this.parser||this.Parser;return Mu("parse",o),o(String(s),s)}process(r,s){const o=this;return this.freeze(),Mu("process",this.parser||this.Parser),Lu("process",this.compiler||this.Compiler),s?d(void 0,s):new Promise(d);function d(_,f){const a=qa(r),c=o.parse(a);o.run(c,a,function(m,u,y){if(m||!u||!y)return h(m);const w=u,k=o.stringify(w,y);FC(k)?y.value=k:y.result=k,h(m,y)});function h(m,u){m||!u?f(m):_?_(u):s(void 0,u)}}}processSync(r){let s=!1,o;return this.freeze(),Mu("processSync",this.parser||this.Parser),Lu("processSync",this.compiler||this.Compiler),this.process(r,d),ig("processSync","process",s),o;function d(_,f){s=!0,Jm(_),o=f}}run(r,s,o){ng(r),this.freeze();const d=this.transformers;return!o&&typeof s=="function"&&(o=s,s=void 0),o?_(void 0,o):new Promise(_);function _(f,a){const c=qa(s);d.run(r,c,h);function h(m,u,y){const w=u||r;m?a(m):f?f(w):o(void 0,w,y)}}}runSync(r,s){let o=!1,d;return this.run(r,s,_),ig("runSync","run",o),d;function _(f,a){Jm(f),d=a,o=!0}}stringify(r,s){this.freeze();const o=qa(s),d=this.compiler||this.Compiler;return Lu("stringify",d),ng(r),d(r,o)}use(r,...s){const o=this.attachers,d=this.namespace;if(Ou("use",this.frozen),r!=null)if(typeof r=="function")c(r,s);else if(typeof r=="object")Array.isArray(r)?a(r):f(r);else throw new TypeError("Expected usable value, not `"+r+"`");return this;function _(h){if(typeof h=="function")c(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[m,...u]=h;c(m,u)}else f(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function f(h){if(!("plugins"in h)&&!("settings"in h))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(h.plugins),h.settings&&(d.settings=Au(!0,d.settings,h.settings))}function a(h){let m=-1;if(h!=null)if(Array.isArray(h))for(;++m<h.length;){const u=h[m];_(u)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function c(h,m){let u=-1,y=-1;for(;++u<o.length;)if(o[u][0]===h){y=u;break}if(y===-1)o.push([h,...m]);else if(m.length>0){let[w,...k]=m;const x=o[y][1];$u(x)&&$u(w)&&(w=Au(!0,x,w)),o[y]=[h,w,...k]}}}}const UC=new mh().freeze();function Mu(n,r){if(typeof r!="function")throw new TypeError("Cannot `"+n+"` without `parser`")}function Lu(n,r){if(typeof r!="function")throw new TypeError("Cannot `"+n+"` without `compiler`")}function Ou(n,r){if(r)throw new Error("Cannot call `"+n+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function ng(n){if(!$u(n)||typeof n.type!="string")throw new TypeError("Expected node, got `"+n+"`")}function ig(n,r,s){if(!s)throw new Error("`"+n+"` finished async. Use `"+r+"` instead")}function qa(n){return PC(n)?n:new u_(n)}function PC(n){return!!(n&&typeof n=="object"&&"message"in n&&"messages"in n)}function FC(n){return typeof n=="string"||qC(n)}function qC(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const GC="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",rg=[],sg={allowDangerousHtml:!0},VC=/^(https?|ircs?|mailto|xmpp)$/i,$C=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function h_(n){const r=KC(n),s=YC(n);return WC(r.runSync(r.parse(s),s),n)}function KC(n){const r=n.rehypePlugins||rg,s=n.remarkPlugins||rg,o=n.remarkRehypeOptions?{...n.remarkRehypeOptions,...sg}:sg;return UC().use(Ab).use(s).use(CC,o).use(r)}function YC(n){const r=n.children||"",s=new u_;return typeof r=="string"&&(s.value=r),s}function WC(n,r){const s=r.allowedElements,o=r.allowElement,d=r.components,_=r.disallowedElements,f=r.skipHtml,a=r.unwrapDisallowed,c=r.urlTransform||XC;for(const m of $C)Object.hasOwn(r,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+GC+m.id,void 0);return ph(n,h),uy(n,{Fragment:D.Fragment,components:d,ignoreInvalidStyle:!0,jsx:D.jsx,jsxs:D.jsxs,passKeys:!0,passNode:!0});function h(m,u,y){if(m.type==="raw"&&y&&typeof u=="number")return f?y.children.splice(u,1):y.children[u]={type:"text",value:m.value},u;if(m.type==="element"){let w;for(w in wu)if(Object.hasOwn(wu,w)&&Object.hasOwn(m.properties,w)){const k=m.properties[w],x=wu[w];(x===null||x.includes(m.tagName))&&(m.properties[w]=c(String(k||""),w,m))}}if(m.type==="element"){let w=s?!s.includes(m.tagName):_?_.includes(m.tagName):!1;if(!w&&o&&typeof u=="number"&&(w=!o(m,u,y)),w&&y&&typeof u=="number")return a&&m.children?y.children.splice(u,1,...m.children):y.children.splice(u,1),u}}}function XC(n){const r=n.indexOf(":"),s=n.indexOf("?"),o=n.indexOf("#"),d=n.indexOf("/");return r===-1||d!==-1&&r>d||s!==-1&&r>s||o!==-1&&r>o||VC.test(n.slice(0,r))?n:""}function lg(n,r){const s=String(n);if(typeof r!="string")throw new TypeError("Expected character");let o=0,d=s.indexOf(r);for(;d!==-1;)o++,d=s.indexOf(r,d+r.length);return o}function QC(n){if(typeof n!="string")throw new TypeError("Expected a string");return n.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function ZC(n,r,s){const d=ro((s||{}).ignore||[]),_=JC(r);let f=-1;for(;++f<_.length;)c_(n,"text",a);function a(h,m){let u=-1,y;for(;++u<m.length;){const w=m[u],k=y?y.children:void 0;if(d(w,k?k.indexOf(w):void 0,y))return;y=w}if(y)return c(h,m)}function c(h,m){const u=m[m.length-1],y=_[f][0],w=_[f][1];let k=0;const b=u.children.indexOf(h);let S=!1,g=[];y.lastIndex=0;let v=y.exec(h.value);for(;v;){const E=v.index,L={index:v.index,input:v.input,stack:[...m,h]};let R=w(...v,L);if(typeof R=="string"&&(R=R.length>0?{type:"text",value:R}:void 0),R===!1?y.lastIndex=E+1:(k!==E&&g.push({type:"text",value:h.value.slice(k,E)}),Array.isArray(R)?g.push(...R):R&&g.push(R),k=E+v[0].length,S=!0),!y.global)break;v=y.exec(h.value)}return S?(k<h.value.length&&g.push({type:"text",value:h.value.slice(k)}),u.children.splice(b,1,...g)):g=[h],b+g.length}}function JC(n){const r=[];if(!Array.isArray(n))throw new TypeError("Expected find and replace tuple or list of tuples");const s=!n[0]||Array.isArray(n[0])?n:[n];let o=-1;for(;++o<s.length;){const d=s[o];r.push([ew(d[0]),tw(d[1])])}return r}function ew(n){return typeof n=="string"?new RegExp(QC(n),"g"):n}function tw(n){return typeof n=="function"?n:function(){return n}}const Bu="phrasing",ju=["autolink","link","image","label"];function nw(){return{transforms:[cw],enter:{literalAutolink:rw,literalAutolinkEmail:Nu,literalAutolinkHttp:Nu,literalAutolinkWww:Nu},exit:{literalAutolink:ow,literalAutolinkEmail:aw,literalAutolinkHttp:sw,literalAutolinkWww:lw}}}function iw(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Bu,notInConstruct:ju},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Bu,notInConstruct:ju},{character:":",before:"[ps]",after:"\\/",inConstruct:Bu,notInConstruct:ju}]}}function rw(n){this.enter({type:"link",title:null,url:"",children:[]},n)}function Nu(n){this.config.enter.autolinkProtocol.call(this,n)}function sw(n){this.config.exit.autolinkProtocol.call(this,n)}function lw(n){this.config.exit.data.call(this,n);const r=this.stack[this.stack.length-1];r.type,r.url="http://"+this.sliceSerialize(n)}function aw(n){this.config.exit.autolinkEmail.call(this,n)}function ow(n){this.exit(n)}function cw(n){ZC(n,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,uw],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),hw]],{ignore:["link","linkReference"]})}function uw(n,r,s,o,d){let _="";if(!f_(d)||(/^w/i.test(r)&&(s=r+s,r="",_="http://"),!fw(s)))return!1;const f=dw(s+o);if(!f[0])return!1;const a={type:"link",title:null,url:_+r+f[0],children:[{type:"text",value:r+f[0]}]};return f[1]?[a,{type:"text",value:f[1]}]:a}function hw(n,r,s,o){return!f_(o,!0)||/[-\d_]$/.test(s)?!1:{type:"link",title:null,url:"mailto:"+r+"@"+s,children:[{type:"text",value:r+"@"+s}]}}function fw(n){const r=n.split(".");return!(r.length<2||r[r.length-1]&&(/_/.test(r[r.length-1])||!/[a-zA-Z\d]/.test(r[r.length-1]))||r[r.length-2]&&(/_/.test(r[r.length-2])||!/[a-zA-Z\d]/.test(r[r.length-2])))}function dw(n){const r=/[!"&'),.:;<>?\]}]+$/.exec(n);if(!r)return[n,void 0];n=n.slice(0,r.index);let s=r[0],o=s.indexOf(")");const d=lg(n,"(");let _=lg(n,")");for(;o!==-1&&d>_;)n+=s.slice(0,o+1),s=s.slice(o+1),o=s.indexOf(")"),_++;return[n,s]}function f_(n,r){const s=n.input.charCodeAt(n.index-1);return(n.index===0||br(s)||to(s))&&(!r||s!==47)}d_.peek=Cw;function pw(){this.buffer()}function mw(n){this.enter({type:"footnoteReference",identifier:"",label:""},n)}function gw(){this.buffer()}function _w(n){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},n)}function vw(n){const r=this.resume(),s=this.stack[this.stack.length-1];s.type,s.identifier=zn(this.sliceSerialize(n)).toLowerCase(),s.label=r}function yw(n){this.exit(n)}function Sw(n){const r=this.resume(),s=this.stack[this.stack.length-1];s.type,s.identifier=zn(this.sliceSerialize(n)).toLowerCase(),s.label=r}function bw(n){this.exit(n)}function Cw(){return"["}function d_(n,r,s,o){const d=s.createTracker(o);let _=d.move("[^");const f=s.enter("footnoteReference"),a=s.enter("reference");return _+=d.move(s.safe(s.associationId(n),{after:"]",before:_})),a(),f(),_+=d.move("]"),_}function ww(){return{enter:{gfmFootnoteCallString:pw,gfmFootnoteCall:mw,gfmFootnoteDefinitionLabelString:gw,gfmFootnoteDefinition:_w},exit:{gfmFootnoteCallString:vw,gfmFootnoteCall:yw,gfmFootnoteDefinitionLabelString:Sw,gfmFootnoteDefinition:bw}}}function xw(n){let r=!1;return n&&n.firstLineBlank&&(r=!0),{handlers:{footnoteDefinition:s,footnoteReference:d_},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function s(o,d,_,f){const a=_.createTracker(f);let c=a.move("[^");const h=_.enter("footnoteDefinition"),m=_.enter("label");return c+=a.move(_.safe(_.associationId(o),{before:c,after:"]"})),m(),c+=a.move("]:"),o.children&&o.children.length>0&&(a.shift(4),c+=a.move((r?`
74
+ `:" ")+_.indentLines(_.containerFlow(o,a.current()),r?p_:Ew))),h(),c}}function Ew(n,r,s){return r===0?n:p_(n,r,s)}function p_(n,r,s){return(s?"":" ")+n}const kw=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];m_.peek=Mw;function Aw(){return{canContainEols:["delete"],enter:{strikethrough:Rw},exit:{strikethrough:Dw}}}function Tw(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:kw}],handlers:{delete:m_}}}function Rw(n){this.enter({type:"delete",children:[]},n)}function Dw(n){this.exit(n)}function m_(n,r,s,o){const d=s.createTracker(o),_=s.enter("strikethrough");let f=d.move("~~");return f+=s.containerPhrasing(n,{...d.current(),before:f,after:"~"}),f+=d.move("~~"),_(),f}function Mw(){return"~"}function Lw(n){return n.length}function Ow(n,r){const s=r||{},o=(s.align||[]).concat(),d=s.stringLength||Lw,_=[],f=[],a=[],c=[];let h=0,m=-1;for(;++m<n.length;){const x=[],b=[];let S=-1;for(n[m].length>h&&(h=n[m].length);++S<n[m].length;){const g=Bw(n[m][S]);if(s.alignDelimiters!==!1){const v=d(g);b[S]=v,(c[S]===void 0||v>c[S])&&(c[S]=v)}x.push(g)}f[m]=x,a[m]=b}let u=-1;if(typeof o=="object"&&"length"in o)for(;++u<h;)_[u]=ag(o[u]);else{const x=ag(o);for(;++u<h;)_[u]=x}u=-1;const y=[],w=[];for(;++u<h;){const x=_[u];let b="",S="";x===99?(b=":",S=":"):x===108?b=":":x===114&&(S=":");let g=s.alignDelimiters===!1?1:Math.max(1,c[u]-b.length-S.length);const v=b+"-".repeat(g)+S;s.alignDelimiters!==!1&&(g=b.length+g+S.length,g>c[u]&&(c[u]=g),w[u]=g),y[u]=v}f.splice(1,0,y),a.splice(1,0,w),m=-1;const k=[];for(;++m<f.length;){const x=f[m],b=a[m];u=-1;const S=[];for(;++u<h;){const g=x[u]||"";let v="",E="";if(s.alignDelimiters!==!1){const L=c[u]-(b[u]||0),R=_[u];R===114?v=" ".repeat(L):R===99?L%2?(v=" ".repeat(L/2+.5),E=" ".repeat(L/2-.5)):(v=" ".repeat(L/2),E=v):E=" ".repeat(L)}s.delimiterStart!==!1&&!u&&S.push("|"),s.padding!==!1&&!(s.alignDelimiters===!1&&g==="")&&(s.delimiterStart!==!1||u)&&S.push(" "),s.alignDelimiters!==!1&&S.push(v),S.push(g),s.alignDelimiters!==!1&&S.push(E),s.padding!==!1&&S.push(" "),(s.delimiterEnd!==!1||u!==h-1)&&S.push("|")}k.push(s.delimiterEnd===!1?S.join("").replace(/ +$/,""):S.join(""))}return k.join(`
75
+ `)}function Bw(n){return n==null?"":String(n)}function ag(n){const r=typeof n=="string"?n.codePointAt(0):0;return r===67||r===99?99:r===76||r===108?108:r===82||r===114?114:0}function jw(n,r,s,o){const d=s.enter("blockquote"),_=s.createTracker(o);_.move("> "),_.shift(2);const f=s.indentLines(s.containerFlow(n,_.current()),Nw);return d(),f}function Nw(n,r,s){return">"+(s?"":" ")+n}function Hw(n,r){return og(n,r.inConstruct,!0)&&!og(n,r.notInConstruct,!1)}function og(n,r,s){if(typeof r=="string"&&(r=[r]),!r||r.length===0)return s;let o=-1;for(;++o<r.length;)if(n.includes(r[o]))return!0;return!1}function cg(n,r,s,o){let d=-1;for(;++d<s.unsafe.length;)if(s.unsafe[d].character===`
76
+ `&&Hw(s.stack,s.unsafe[d]))return/[ \t]/.test(o.before)?"":" ";return`\\
77
+ `}function zw(n,r){const s=String(n);let o=s.indexOf(r),d=o,_=0,f=0;if(typeof r!="string")throw new TypeError("Expected substring");for(;o!==-1;)o===d?++_>f&&(f=_):_=1,d=o+r.length,o=s.indexOf(r,d);return f}function Iw(n,r){return!!(r.options.fences===!1&&n.value&&!n.lang&&/[^ \r\n]/.test(n.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(n.value))}function Uw(n){const r=n.options.fence||"`";if(r!=="`"&&r!=="~")throw new Error("Cannot serialize code with `"+r+"` for `options.fence`, expected `` ` `` or `~`");return r}function Pw(n,r,s,o){const d=Uw(s),_=n.value||"",f=d==="`"?"GraveAccent":"Tilde";if(Iw(n,s)){const u=s.enter("codeIndented"),y=s.indentLines(_,Fw);return u(),y}const a=s.createTracker(o),c=d.repeat(Math.max(zw(_,d)+1,3)),h=s.enter("codeFenced");let m=a.move(c);if(n.lang){const u=s.enter(`codeFencedLang${f}`);m+=a.move(s.safe(n.lang,{before:m,after:" ",encode:["`"],...a.current()})),u()}if(n.lang&&n.meta){const u=s.enter(`codeFencedMeta${f}`);m+=a.move(" "),m+=a.move(s.safe(n.meta,{before:m,after:`
78
+ `,encode:["`"],...a.current()})),u()}return m+=a.move(`
79
+ `),_&&(m+=a.move(_+`
80
+ `)),m+=a.move(c),h(),m}function Fw(n,r,s){return(s?"":" ")+n}function gh(n){const r=n.options.quote||'"';if(r!=='"'&&r!=="'")throw new Error("Cannot serialize title with `"+r+"` for `options.quote`, expected `\"`, or `'`");return r}function qw(n,r,s,o){const d=gh(s),_=d==='"'?"Quote":"Apostrophe",f=s.enter("definition");let a=s.enter("label");const c=s.createTracker(o);let h=c.move("[");return h+=c.move(s.safe(s.associationId(n),{before:h,after:"]",...c.current()})),h+=c.move("]: "),a(),!n.url||/[\0- \u007F]/.test(n.url)?(a=s.enter("destinationLiteral"),h+=c.move("<"),h+=c.move(s.safe(n.url,{before:h,after:">",...c.current()})),h+=c.move(">")):(a=s.enter("destinationRaw"),h+=c.move(s.safe(n.url,{before:h,after:n.title?" ":`
81
+ `,...c.current()}))),a(),n.title&&(a=s.enter(`title${_}`),h+=c.move(" "+d),h+=c.move(s.safe(n.title,{before:h,after:d,...c.current()})),h+=c.move(d),a()),f(),h}function Gw(n){const r=n.options.emphasis||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize emphasis with `"+r+"` for `options.emphasis`, expected `*`, or `_`");return r}function bl(n){return"&#x"+n.toString(16).toUpperCase()+";"}function Qa(n,r,s){const o=ps(n),d=ps(r);return o===void 0?d===void 0?s==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:d===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:o===1?d===void 0?{inside:!1,outside:!1}:d===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:d===void 0?{inside:!1,outside:!1}:d===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}g_.peek=Vw;function g_(n,r,s,o){const d=Gw(s),_=s.enter("emphasis"),f=s.createTracker(o),a=f.move(d);let c=f.move(s.containerPhrasing(n,{after:d,before:a,...f.current()}));const h=c.charCodeAt(0),m=Qa(o.before.charCodeAt(o.before.length-1),h,d);m.inside&&(c=bl(h)+c.slice(1));const u=c.charCodeAt(c.length-1),y=Qa(o.after.charCodeAt(0),u,d);y.inside&&(c=c.slice(0,-1)+bl(u));const w=f.move(d);return _(),s.attentionEncodeSurroundingInfo={after:y.outside,before:m.outside},a+c+w}function Vw(n,r,s){return s.options.emphasis||"*"}function $w(n,r){let s=!1;return ph(n,function(o){if("value"in o&&/\r?\n|\r/.test(o.value)||o.type==="break")return s=!0,Gu}),!!((!n.depth||n.depth<3)&&ah(n)&&(r.options.setext||s))}function Kw(n,r,s,o){const d=Math.max(Math.min(6,n.depth||1),1),_=s.createTracker(o);if($w(n,s)){const m=s.enter("headingSetext"),u=s.enter("phrasing"),y=s.containerPhrasing(n,{..._.current(),before:`
82
+ `,after:`
83
+ `});return u(),m(),y+`
84
+ `+(d===1?"=":"-").repeat(y.length-(Math.max(y.lastIndexOf("\r"),y.lastIndexOf(`
85
+ `))+1))}const f="#".repeat(d),a=s.enter("headingAtx"),c=s.enter("phrasing");_.move(f+" ");let h=s.containerPhrasing(n,{before:"# ",after:`
86
+ `,..._.current()});return/^[\t ]/.test(h)&&(h=bl(h.charCodeAt(0))+h.slice(1)),h=h?f+" "+h:f,s.options.closeAtx&&(h+=" "+f),c(),a(),h}__.peek=Yw;function __(n){return n.value||""}function Yw(){return"<"}v_.peek=Ww;function v_(n,r,s,o){const d=gh(s),_=d==='"'?"Quote":"Apostrophe",f=s.enter("image");let a=s.enter("label");const c=s.createTracker(o);let h=c.move("![");return h+=c.move(s.safe(n.alt,{before:h,after:"]",...c.current()})),h+=c.move("]("),a(),!n.url&&n.title||/[\0- \u007F]/.test(n.url)?(a=s.enter("destinationLiteral"),h+=c.move("<"),h+=c.move(s.safe(n.url,{before:h,after:">",...c.current()})),h+=c.move(">")):(a=s.enter("destinationRaw"),h+=c.move(s.safe(n.url,{before:h,after:n.title?" ":")",...c.current()}))),a(),n.title&&(a=s.enter(`title${_}`),h+=c.move(" "+d),h+=c.move(s.safe(n.title,{before:h,after:d,...c.current()})),h+=c.move(d),a()),h+=c.move(")"),f(),h}function Ww(){return"!"}y_.peek=Xw;function y_(n,r,s,o){const d=n.referenceType,_=s.enter("imageReference");let f=s.enter("label");const a=s.createTracker(o);let c=a.move("![");const h=s.safe(n.alt,{before:c,after:"]",...a.current()});c+=a.move(h+"]["),f();const m=s.stack;s.stack=[],f=s.enter("reference");const u=s.safe(s.associationId(n),{before:c,after:"]",...a.current()});return f(),s.stack=m,_(),d==="full"||!h||h!==u?c+=a.move(u+"]"):d==="shortcut"?c=c.slice(0,-1):c+=a.move("]"),c}function Xw(){return"!"}S_.peek=Qw;function S_(n,r,s){let o=n.value||"",d="`",_=-1;for(;new RegExp("(^|[^`])"+d+"([^`]|$)").test(o);)d+="`";for(/[^ \r\n]/.test(o)&&(/^[ \r\n]/.test(o)&&/[ \r\n]$/.test(o)||/^`|`$/.test(o))&&(o=" "+o+" ");++_<s.unsafe.length;){const f=s.unsafe[_],a=s.compilePattern(f);let c;if(f.atBreak)for(;c=a.exec(o);){let h=c.index;o.charCodeAt(h)===10&&o.charCodeAt(h-1)===13&&h--,o=o.slice(0,h)+" "+o.slice(c.index+1)}}return d+o+d}function Qw(){return"`"}function b_(n,r){const s=ah(n);return!!(!r.options.resourceLink&&n.url&&!n.title&&n.children&&n.children.length===1&&n.children[0].type==="text"&&(s===n.url||"mailto:"+s===n.url)&&/^[a-z][a-z+.-]+:/i.test(n.url)&&!/[\0- <>\u007F]/.test(n.url))}C_.peek=Zw;function C_(n,r,s,o){const d=gh(s),_=d==='"'?"Quote":"Apostrophe",f=s.createTracker(o);let a,c;if(b_(n,s)){const m=s.stack;s.stack=[],a=s.enter("autolink");let u=f.move("<");return u+=f.move(s.containerPhrasing(n,{before:u,after:">",...f.current()})),u+=f.move(">"),a(),s.stack=m,u}a=s.enter("link"),c=s.enter("label");let h=f.move("[");return h+=f.move(s.containerPhrasing(n,{before:h,after:"](",...f.current()})),h+=f.move("]("),c(),!n.url&&n.title||/[\0- \u007F]/.test(n.url)?(c=s.enter("destinationLiteral"),h+=f.move("<"),h+=f.move(s.safe(n.url,{before:h,after:">",...f.current()})),h+=f.move(">")):(c=s.enter("destinationRaw"),h+=f.move(s.safe(n.url,{before:h,after:n.title?" ":")",...f.current()}))),c(),n.title&&(c=s.enter(`title${_}`),h+=f.move(" "+d),h+=f.move(s.safe(n.title,{before:h,after:d,...f.current()})),h+=f.move(d),c()),h+=f.move(")"),a(),h}function Zw(n,r,s){return b_(n,s)?"<":"["}w_.peek=Jw;function w_(n,r,s,o){const d=n.referenceType,_=s.enter("linkReference");let f=s.enter("label");const a=s.createTracker(o);let c=a.move("[");const h=s.containerPhrasing(n,{before:c,after:"]",...a.current()});c+=a.move(h+"]["),f();const m=s.stack;s.stack=[],f=s.enter("reference");const u=s.safe(s.associationId(n),{before:c,after:"]",...a.current()});return f(),s.stack=m,_(),d==="full"||!h||h!==u?c+=a.move(u+"]"):d==="shortcut"?c=c.slice(0,-1):c+=a.move("]"),c}function Jw(){return"["}function _h(n){const r=n.options.bullet||"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bullet`, expected `*`, `+`, or `-`");return r}function ex(n){const r=_h(n),s=n.options.bulletOther;if(!s)return r==="*"?"-":"*";if(s!=="*"&&s!=="+"&&s!=="-")throw new Error("Cannot serialize items with `"+s+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(s===r)throw new Error("Expected `bullet` (`"+r+"`) and `bulletOther` (`"+s+"`) to be different");return s}function tx(n){const r=n.options.bulletOrdered||".";if(r!=="."&&r!==")")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOrdered`, expected `.` or `)`");return r}function x_(n){const r=n.options.rule||"*";if(r!=="*"&&r!=="-"&&r!=="_")throw new Error("Cannot serialize rules with `"+r+"` for `options.rule`, expected `*`, `-`, or `_`");return r}function nx(n,r,s,o){const d=s.enter("list"),_=s.bulletCurrent;let f=n.ordered?tx(s):_h(s);const a=n.ordered?f==="."?")":".":ex(s);let c=r&&s.bulletLastUsed?f===s.bulletLastUsed:!1;if(!n.ordered){const m=n.children?n.children[0]:void 0;if((f==="*"||f==="-")&&m&&(!m.children||!m.children[0])&&s.stack[s.stack.length-1]==="list"&&s.stack[s.stack.length-2]==="listItem"&&s.stack[s.stack.length-3]==="list"&&s.stack[s.stack.length-4]==="listItem"&&s.indexStack[s.indexStack.length-1]===0&&s.indexStack[s.indexStack.length-2]===0&&s.indexStack[s.indexStack.length-3]===0&&(c=!0),x_(s)===f&&m){let u=-1;for(;++u<n.children.length;){const y=n.children[u];if(y&&y.type==="listItem"&&y.children&&y.children[0]&&y.children[0].type==="thematicBreak"){c=!0;break}}}}c&&(f=a),s.bulletCurrent=f;const h=s.containerFlow(n,o);return s.bulletLastUsed=f,s.bulletCurrent=_,d(),h}function ix(n){const r=n.options.listItemIndent||"one";if(r!=="tab"&&r!=="one"&&r!=="mixed")throw new Error("Cannot serialize items with `"+r+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return r}function rx(n,r,s,o){const d=ix(s);let _=s.bulletCurrent||_h(s);r&&r.type==="list"&&r.ordered&&(_=(typeof r.start=="number"&&r.start>-1?r.start:1)+(s.options.incrementListMarker===!1?0:r.children.indexOf(n))+_);let f=_.length+1;(d==="tab"||d==="mixed"&&(r&&r.type==="list"&&r.spread||n.spread))&&(f=Math.ceil(f/4)*4);const a=s.createTracker(o);a.move(_+" ".repeat(f-_.length)),a.shift(f);const c=s.enter("listItem"),h=s.indentLines(s.containerFlow(n,a.current()),m);return c(),h;function m(u,y,w){return y?(w?"":" ".repeat(f))+u:(w?_:_+" ".repeat(f-_.length))+u}}function sx(n,r,s,o){const d=s.enter("paragraph"),_=s.enter("phrasing"),f=s.containerPhrasing(n,o);return _(),d(),f}const lx=ro(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function ax(n,r,s,o){return(n.children.some(function(f){return lx(f)})?s.containerPhrasing:s.containerFlow).call(s,n,o)}function ox(n){const r=n.options.strong||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize strong with `"+r+"` for `options.strong`, expected `*`, or `_`");return r}E_.peek=cx;function E_(n,r,s,o){const d=ox(s),_=s.enter("strong"),f=s.createTracker(o),a=f.move(d+d);let c=f.move(s.containerPhrasing(n,{after:d,before:a,...f.current()}));const h=c.charCodeAt(0),m=Qa(o.before.charCodeAt(o.before.length-1),h,d);m.inside&&(c=bl(h)+c.slice(1));const u=c.charCodeAt(c.length-1),y=Qa(o.after.charCodeAt(0),u,d);y.inside&&(c=c.slice(0,-1)+bl(u));const w=f.move(d+d);return _(),s.attentionEncodeSurroundingInfo={after:y.outside,before:m.outside},a+c+w}function cx(n,r,s){return s.options.strong||"*"}function ux(n,r,s,o){return s.safe(n.value,o)}function hx(n){const r=n.options.ruleRepetition||3;if(r<3)throw new Error("Cannot serialize rules with repetition `"+r+"` for `options.ruleRepetition`, expected `3` or more");return r}function fx(n,r,s){const o=(x_(s)+(s.options.ruleSpaces?" ":"")).repeat(hx(s));return s.options.ruleSpaces?o.slice(0,-1):o}const k_={blockquote:jw,break:cg,code:Pw,definition:qw,emphasis:g_,hardBreak:cg,heading:Kw,html:__,image:v_,imageReference:y_,inlineCode:S_,link:C_,linkReference:w_,list:nx,listItem:rx,paragraph:sx,root:ax,strong:E_,text:ux,thematicBreak:fx};function dx(){return{enter:{table:px,tableData:ug,tableHeader:ug,tableRow:gx},exit:{codeText:_x,table:mx,tableData:Hu,tableHeader:Hu,tableRow:Hu}}}function px(n){const r=n._align;this.enter({type:"table",align:r.map(function(s){return s==="none"?null:s}),children:[]},n),this.data.inTable=!0}function mx(n){this.exit(n),this.data.inTable=void 0}function gx(n){this.enter({type:"tableRow",children:[]},n)}function Hu(n){this.exit(n)}function ug(n){this.enter({type:"tableCell",children:[]},n)}function _x(n){let r=this.resume();this.data.inTable&&(r=r.replace(/\\([\\|])/g,vx));const s=this.stack[this.stack.length-1];s.type,s.value=r,this.exit(n)}function vx(n,r){return r==="|"?r:n}function yx(n){const r=n||{},s=r.tableCellPadding,o=r.tablePipeAlign,d=r.stringLength,_=s?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
87
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:y,table:f,tableCell:c,tableRow:a}};function f(w,k,x,b){return h(m(w,x,b),w.align)}function a(w,k,x,b){const S=u(w,x,b),g=h([S]);return g.slice(0,g.indexOf(`
88
+ `))}function c(w,k,x,b){const S=x.enter("tableCell"),g=x.enter("phrasing"),v=x.containerPhrasing(w,{...b,before:_,after:_});return g(),S(),v}function h(w,k){return Ow(w,{align:k,alignDelimiters:o,padding:s,stringLength:d})}function m(w,k,x){const b=w.children;let S=-1;const g=[],v=k.enter("table");for(;++S<b.length;)g[S]=u(b[S],k,x);return v(),g}function u(w,k,x){const b=w.children;let S=-1;const g=[],v=k.enter("tableRow");for(;++S<b.length;)g[S]=c(b[S],w,k,x);return v(),g}function y(w,k,x){let b=k_.inlineCode(w,k,x);return x.stack.includes("tableCell")&&(b=b.replace(/\|/g,"\\$&")),b}}function Sx(){return{exit:{taskListCheckValueChecked:hg,taskListCheckValueUnchecked:hg,paragraph:Cx}}}function bx(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:wx}}}function hg(n){const r=this.stack[this.stack.length-2];r.type,r.checked=n.type==="taskListCheckValueChecked"}function Cx(n){const r=this.stack[this.stack.length-2];if(r&&r.type==="listItem"&&typeof r.checked=="boolean"){const s=this.stack[this.stack.length-1];s.type;const o=s.children[0];if(o&&o.type==="text"){const d=r.children;let _=-1,f;for(;++_<d.length;){const a=d[_];if(a.type==="paragraph"){f=a;break}}f===s&&(o.value=o.value.slice(1),o.value.length===0?s.children.shift():s.position&&o.position&&typeof o.position.start.offset=="number"&&(o.position.start.column++,o.position.start.offset++,s.position.start=Object.assign({},o.position.start)))}}this.exit(n)}function wx(n,r,s,o){const d=n.children[0],_=typeof n.checked=="boolean"&&d&&d.type==="paragraph",f="["+(n.checked?"x":" ")+"] ",a=s.createTracker(o);_&&a.move(f);let c=k_.listItem(n,r,s,{...o,...a.current()});return _&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),c;function h(m){return m+f}}function xx(){return[nw(),ww(),Aw(),dx(),Sx()]}function Ex(n){return{extensions:[iw(),xw(n),Tw(),yx(n),bx()]}}const kx={tokenize:Lx,partial:!0},A_={tokenize:Ox,partial:!0},T_={tokenize:Bx,partial:!0},R_={tokenize:jx,partial:!0},Ax={tokenize:Nx,partial:!0},D_={name:"wwwAutolink",tokenize:Dx,previous:L_},M_={name:"protocolAutolink",tokenize:Mx,previous:O_},gi={name:"emailAutolink",tokenize:Rx,previous:B_},Vn={};function Tx(){return{text:Vn}}let Sr=48;for(;Sr<123;)Vn[Sr]=gi,Sr++,Sr===58?Sr=65:Sr===91&&(Sr=97);Vn[43]=gi;Vn[45]=gi;Vn[46]=gi;Vn[95]=gi;Vn[72]=[gi,M_];Vn[104]=[gi,M_];Vn[87]=[gi,D_];Vn[119]=[gi,D_];function Rx(n,r,s){const o=this;let d,_;return f;function f(u){return!Yu(u)||!B_.call(o,o.previous)||vh(o.events)?s(u):(n.enter("literalAutolink"),n.enter("literalAutolinkEmail"),a(u))}function a(u){return Yu(u)?(n.consume(u),a):u===64?(n.consume(u),c):s(u)}function c(u){return u===46?n.check(Ax,m,h)(u):u===45||u===95||Kt(u)?(_=!0,n.consume(u),c):m(u)}function h(u){return n.consume(u),d=!0,c}function m(u){return _&&d&&Zt(o.previous)?(n.exit("literalAutolinkEmail"),n.exit("literalAutolink"),r(u)):s(u)}}function Dx(n,r,s){const o=this;return d;function d(f){return f!==87&&f!==119||!L_.call(o,o.previous)||vh(o.events)?s(f):(n.enter("literalAutolink"),n.enter("literalAutolinkWww"),n.check(kx,n.attempt(A_,n.attempt(T_,_),s),s)(f))}function _(f){return n.exit("literalAutolinkWww"),n.exit("literalAutolink"),r(f)}}function Mx(n,r,s){const o=this;let d="",_=!1;return f;function f(u){return(u===72||u===104)&&O_.call(o,o.previous)&&!vh(o.events)?(n.enter("literalAutolink"),n.enter("literalAutolinkHttp"),d+=String.fromCodePoint(u),n.consume(u),a):s(u)}function a(u){if(Zt(u)&&d.length<5)return d+=String.fromCodePoint(u),n.consume(u),a;if(u===58){const y=d.toLowerCase();if(y==="http"||y==="https")return n.consume(u),c}return s(u)}function c(u){return u===47?(n.consume(u),_?h:(_=!0,c)):s(u)}function h(u){return u===null||Ya(u)||ut(u)||br(u)||to(u)?s(u):n.attempt(A_,n.attempt(T_,m),s)(u)}function m(u){return n.exit("literalAutolinkHttp"),n.exit("literalAutolink"),r(u)}}function Lx(n,r,s){let o=0;return d;function d(f){return(f===87||f===119)&&o<3?(o++,n.consume(f),d):f===46&&o===3?(n.consume(f),_):s(f)}function _(f){return f===null?s(f):r(f)}}function Ox(n,r,s){let o,d,_;return f;function f(h){return h===46||h===95?n.check(R_,c,a)(h):h===null||ut(h)||br(h)||h!==45&&to(h)?c(h):(_=!0,n.consume(h),f)}function a(h){return h===95?o=!0:(d=o,o=void 0),n.consume(h),f}function c(h){return d||o||!_?s(h):r(h)}}function Bx(n,r){let s=0,o=0;return d;function d(f){return f===40?(s++,n.consume(f),d):f===41&&o<s?_(f):f===33||f===34||f===38||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===60||f===63||f===93||f===95||f===126?n.check(R_,r,_)(f):f===null||ut(f)||br(f)?r(f):(n.consume(f),d)}function _(f){return f===41&&o++,n.consume(f),d}}function jx(n,r,s){return o;function o(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(n.consume(a),o):a===38?(n.consume(a),_):a===93?(n.consume(a),d):a===60||a===null||ut(a)||br(a)?r(a):s(a)}function d(a){return a===null||a===40||a===91||ut(a)||br(a)?r(a):o(a)}function _(a){return Zt(a)?f(a):s(a)}function f(a){return a===59?(n.consume(a),o):Zt(a)?(n.consume(a),f):s(a)}}function Nx(n,r,s){return o;function o(_){return n.consume(_),d}function d(_){return Kt(_)?s(_):r(_)}}function L_(n){return n===null||n===40||n===42||n===95||n===91||n===93||n===126||ut(n)}function O_(n){return!Zt(n)}function B_(n){return!(n===47||Yu(n))}function Yu(n){return n===43||n===45||n===46||n===95||Kt(n)}function vh(n){let r=n.length,s=!1;for(;r--;){const o=n[r][1];if((o.type==="labelLink"||o.type==="labelImage")&&!o._balanced){s=!0;break}if(o._gfmAutolinkLiteralWalkedInto){s=!1;break}}return n.length>0&&!s&&(n[n.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),s}const Hx={tokenize:Vx,partial:!0};function zx(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Fx,continuation:{tokenize:qx},exit:Gx}},text:{91:{name:"gfmFootnoteCall",tokenize:Px},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Ix,resolveTo:Ux}}}}function Ix(n,r,s){const o=this;let d=o.events.length;const _=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]);let f;for(;d--;){const c=o.events[d][1];if(c.type==="labelImage"){f=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return a;function a(c){if(!f||!f._balanced)return s(c);const h=zn(o.sliceSerialize({start:f.end,end:o.now()}));return h.codePointAt(0)!==94||!_.includes(h.slice(1))?s(c):(n.enter("gfmFootnoteCallLabelMarker"),n.consume(c),n.exit("gfmFootnoteCallLabelMarker"),r(c))}}function Ux(n,r){let s=n.length;for(;s--;)if(n[s][1].type==="labelImage"&&n[s][0]==="enter"){n[s][1];break}n[s+1][1].type="data",n[s+3][1].type="gfmFootnoteCallLabelMarker";const o={type:"gfmFootnoteCall",start:Object.assign({},n[s+3][1].start),end:Object.assign({},n[n.length-1][1].end)},d={type:"gfmFootnoteCallMarker",start:Object.assign({},n[s+3][1].end),end:Object.assign({},n[s+3][1].end)};d.end.column++,d.end.offset++,d.end._bufferIndex++;const _={type:"gfmFootnoteCallString",start:Object.assign({},d.end),end:Object.assign({},n[n.length-1][1].start)},f={type:"chunkString",contentType:"string",start:Object.assign({},_.start),end:Object.assign({},_.end)},a=[n[s+1],n[s+2],["enter",o,r],n[s+3],n[s+4],["enter",d,r],["exit",d,r],["enter",_,r],["enter",f,r],["exit",f,r],["exit",_,r],n[n.length-2],n[n.length-1],["exit",o,r]];return n.splice(s,n.length-s+1,...a),n}function Px(n,r,s){const o=this,d=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]);let _=0,f;return a;function a(u){return n.enter("gfmFootnoteCall"),n.enter("gfmFootnoteCallLabelMarker"),n.consume(u),n.exit("gfmFootnoteCallLabelMarker"),c}function c(u){return u!==94?s(u):(n.enter("gfmFootnoteCallMarker"),n.consume(u),n.exit("gfmFootnoteCallMarker"),n.enter("gfmFootnoteCallString"),n.enter("chunkString").contentType="string",h)}function h(u){if(_>999||u===93&&!f||u===null||u===91||ut(u))return s(u);if(u===93){n.exit("chunkString");const y=n.exit("gfmFootnoteCallString");return d.includes(zn(o.sliceSerialize(y)))?(n.enter("gfmFootnoteCallLabelMarker"),n.consume(u),n.exit("gfmFootnoteCallLabelMarker"),n.exit("gfmFootnoteCall"),r):s(u)}return ut(u)||(f=!0),_++,n.consume(u),u===92?m:h}function m(u){return u===91||u===92||u===93?(n.consume(u),_++,h):h(u)}}function Fx(n,r,s){const o=this,d=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]);let _,f=0,a;return c;function c(k){return n.enter("gfmFootnoteDefinition")._container=!0,n.enter("gfmFootnoteDefinitionLabel"),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(k),n.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(k){return k===94?(n.enter("gfmFootnoteDefinitionMarker"),n.consume(k),n.exit("gfmFootnoteDefinitionMarker"),n.enter("gfmFootnoteDefinitionLabelString"),n.enter("chunkString").contentType="string",m):s(k)}function m(k){if(f>999||k===93&&!a||k===null||k===91||ut(k))return s(k);if(k===93){n.exit("chunkString");const x=n.exit("gfmFootnoteDefinitionLabelString");return _=zn(o.sliceSerialize(x)),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(k),n.exit("gfmFootnoteDefinitionLabelMarker"),n.exit("gfmFootnoteDefinitionLabel"),y}return ut(k)||(a=!0),f++,n.consume(k),k===92?u:m}function u(k){return k===91||k===92||k===93?(n.consume(k),f++,m):m(k)}function y(k){return k===58?(n.enter("definitionMarker"),n.consume(k),n.exit("definitionMarker"),d.includes(_)||d.push(_),We(n,w,"gfmFootnoteDefinitionWhitespace")):s(k)}function w(k){return r(k)}}function qx(n,r,s){return n.check(wl,r,n.attempt(Hx,r,s))}function Gx(n){n.exit("gfmFootnoteDefinition")}function Vx(n,r,s){const o=this;return We(n,d,"gfmFootnoteDefinitionIndent",5);function d(_){const f=o.events[o.events.length-1];return f&&f[1].type==="gfmFootnoteDefinitionIndent"&&f[2].sliceSerialize(f[1],!0).length===4?r(_):s(_)}}function $x(n){let s=(n||{}).singleTilde;const o={name:"strikethrough",tokenize:_,resolveAll:d};return s==null&&(s=!0),{text:{126:o},insideSpan:{null:[o]},attentionMarkers:{null:[126]}};function d(f,a){let c=-1;for(;++c<f.length;)if(f[c][0]==="enter"&&f[c][1].type==="strikethroughSequenceTemporary"&&f[c][1]._close){let h=c;for(;h--;)if(f[h][0]==="exit"&&f[h][1].type==="strikethroughSequenceTemporary"&&f[h][1]._open&&f[c][1].end.offset-f[c][1].start.offset===f[h][1].end.offset-f[h][1].start.offset){f[c][1].type="strikethroughSequence",f[h][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},f[h][1].start),end:Object.assign({},f[c][1].end)},u={type:"strikethroughText",start:Object.assign({},f[h][1].end),end:Object.assign({},f[c][1].start)},y=[["enter",m,a],["enter",f[h][1],a],["exit",f[h][1],a],["enter",u,a]],w=a.parser.constructs.insideSpan.null;w&&yn(y,y.length,0,no(w,f.slice(h+1,c),a)),yn(y,y.length,0,[["exit",u,a],["enter",f[c][1],a],["exit",f[c][1],a],["exit",m,a]]),yn(f,h-1,c-h+3,y),c=h+y.length-2;break}}for(c=-1;++c<f.length;)f[c][1].type==="strikethroughSequenceTemporary"&&(f[c][1].type="data");return f}function _(f,a,c){const h=this.previous,m=this.events;let u=0;return y;function y(k){return h===126&&m[m.length-1][1].type!=="characterEscape"?c(k):(f.enter("strikethroughSequenceTemporary"),w(k))}function w(k){const x=ps(h);if(k===126)return u>1?c(k):(f.consume(k),u++,w);if(u<2&&!s)return c(k);const b=f.exit("strikethroughSequenceTemporary"),S=ps(k);return b._open=!S||S===2&&!!x,b._close=!x||x===2&&!!S,a(k)}}}class Kx{constructor(){this.map=[]}add(r,s,o){Yx(this,r,s,o)}consume(r){if(this.map.sort(function(_,f){return _[0]-f[0]}),this.map.length===0)return;let s=this.map.length;const o=[];for(;s>0;)s-=1,o.push(r.slice(this.map[s][0]+this.map[s][1]),this.map[s][2]),r.length=this.map[s][0];o.push(r.slice()),r.length=0;let d=o.pop();for(;d;){for(const _ of d)r.push(_);d=o.pop()}this.map.length=0}}function Yx(n,r,s,o){let d=0;if(!(s===0&&o.length===0)){for(;d<n.map.length;){if(n.map[d][0]===r){n.map[d][1]+=s,n.map[d][2].push(...o);return}d+=1}n.map.push([r,s,o])}}function Wx(n,r){let s=!1;const o=[];for(;r<n.length;){const d=n[r];if(s){if(d[0]==="enter")d[1].type==="tableContent"&&o.push(n[r+1][1].type==="tableDelimiterMarker"?"left":"none");else if(d[1].type==="tableContent"){if(n[r-1][1].type==="tableDelimiterMarker"){const _=o.length-1;o[_]=o[_]==="left"?"center":"right"}}else if(d[1].type==="tableDelimiterRow")break}else d[0]==="enter"&&d[1].type==="tableDelimiterRow"&&(s=!0);r+=1}return o}function Xx(){return{flow:{null:{name:"table",tokenize:Qx,resolveAll:Zx}}}}function Qx(n,r,s){const o=this;let d=0,_=0,f;return a;function a(j){let I=o.events.length-1;for(;I>-1;){const K=o.events[I][1].type;if(K==="lineEnding"||K==="linePrefix")I--;else break}const U=I>-1?o.events[I][1].type:null,F=U==="tableHead"||U==="tableRow"?R:c;return F===R&&o.parser.lazy[o.now().line]?s(j):F(j)}function c(j){return n.enter("tableHead"),n.enter("tableRow"),h(j)}function h(j){return j===124||(f=!0,_+=1),m(j)}function m(j){return j===null?s(j):Me(j)?_>1?(_=0,o.interrupt=!0,n.exit("tableRow"),n.enter("lineEnding"),n.consume(j),n.exit("lineEnding"),w):s(j):qe(j)?We(n,m,"whitespace")(j):(_+=1,f&&(f=!1,d+=1),j===124?(n.enter("tableCellDivider"),n.consume(j),n.exit("tableCellDivider"),f=!0,m):(n.enter("data"),u(j)))}function u(j){return j===null||j===124||ut(j)?(n.exit("data"),m(j)):(n.consume(j),j===92?y:u)}function y(j){return j===92||j===124?(n.consume(j),u):u(j)}function w(j){return o.interrupt=!1,o.parser.lazy[o.now().line]?s(j):(n.enter("tableDelimiterRow"),f=!1,qe(j)?We(n,k,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):k(j))}function k(j){return j===45||j===58?b(j):j===124?(f=!0,n.enter("tableCellDivider"),n.consume(j),n.exit("tableCellDivider"),x):L(j)}function x(j){return qe(j)?We(n,b,"whitespace")(j):b(j)}function b(j){return j===58?(_+=1,f=!0,n.enter("tableDelimiterMarker"),n.consume(j),n.exit("tableDelimiterMarker"),S):j===45?(_+=1,S(j)):j===null||Me(j)?E(j):L(j)}function S(j){return j===45?(n.enter("tableDelimiterFiller"),g(j)):L(j)}function g(j){return j===45?(n.consume(j),g):j===58?(f=!0,n.exit("tableDelimiterFiller"),n.enter("tableDelimiterMarker"),n.consume(j),n.exit("tableDelimiterMarker"),v):(n.exit("tableDelimiterFiller"),v(j))}function v(j){return qe(j)?We(n,E,"whitespace")(j):E(j)}function E(j){return j===124?k(j):j===null||Me(j)?!f||d!==_?L(j):(n.exit("tableDelimiterRow"),n.exit("tableHead"),r(j)):L(j)}function L(j){return s(j)}function R(j){return n.enter("tableRow"),T(j)}function T(j){return j===124?(n.enter("tableCellDivider"),n.consume(j),n.exit("tableCellDivider"),T):j===null||Me(j)?(n.exit("tableRow"),r(j)):qe(j)?We(n,T,"whitespace")(j):(n.enter("data"),A(j))}function A(j){return j===null||j===124||ut(j)?(n.exit("data"),T(j)):(n.consume(j),j===92?M:A)}function M(j){return j===92||j===124?(n.consume(j),A):A(j)}}function Zx(n,r){let s=-1,o=!0,d=0,_=[0,0,0,0],f=[0,0,0,0],a=!1,c=0,h,m,u;const y=new Kx;for(;++s<n.length;){const w=n[s],k=w[1];w[0]==="enter"?k.type==="tableHead"?(a=!1,c!==0&&(fg(y,r,c,h,m),m=void 0,c=0),h={type:"table",start:Object.assign({},k.start),end:Object.assign({},k.end)},y.add(s,0,[["enter",h,r]])):k.type==="tableRow"||k.type==="tableDelimiterRow"?(o=!0,u=void 0,_=[0,0,0,0],f=[0,s+1,0,0],a&&(a=!1,m={type:"tableBody",start:Object.assign({},k.start),end:Object.assign({},k.end)},y.add(s,0,[["enter",m,r]])),d=k.type==="tableDelimiterRow"?2:m?3:1):d&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")?(o=!1,f[2]===0&&(_[1]!==0&&(f[0]=f[1],u=Ga(y,r,_,d,void 0,u),_=[0,0,0,0]),f[2]=s)):k.type==="tableCellDivider"&&(o?o=!1:(_[1]!==0&&(f[0]=f[1],u=Ga(y,r,_,d,void 0,u)),_=f,f=[_[1],s,0,0])):k.type==="tableHead"?(a=!0,c=s):k.type==="tableRow"||k.type==="tableDelimiterRow"?(c=s,_[1]!==0?(f[0]=f[1],u=Ga(y,r,_,d,s,u)):f[1]!==0&&(u=Ga(y,r,f,d,s,u)),d=0):d&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(f[3]=s)}for(c!==0&&fg(y,r,c,h,m),y.consume(r.events),s=-1;++s<r.events.length;){const w=r.events[s];w[0]==="enter"&&w[1].type==="table"&&(w[1]._align=Wx(r.events,s))}return n}function Ga(n,r,s,o,d,_){const f=o===1?"tableHeader":o===2?"tableDelimiter":"tableData",a="tableContent";s[0]!==0&&(_.end=Object.assign({},hs(r.events,s[0])),n.add(s[0],0,[["exit",_,r]]));const c=hs(r.events,s[1]);if(_={type:f,start:Object.assign({},c),end:Object.assign({},c)},n.add(s[1],0,[["enter",_,r]]),s[2]!==0){const h=hs(r.events,s[2]),m=hs(r.events,s[3]),u={type:a,start:Object.assign({},h),end:Object.assign({},m)};if(n.add(s[2],0,[["enter",u,r]]),o!==2){const y=r.events[s[2]],w=r.events[s[3]];if(y[1].end=Object.assign({},w[1].end),y[1].type="chunkText",y[1].contentType="text",s[3]>s[2]+1){const k=s[2]+1,x=s[3]-s[2]-1;n.add(k,x,[])}}n.add(s[3]+1,0,[["exit",u,r]])}return d!==void 0&&(_.end=Object.assign({},hs(r.events,d)),n.add(d,0,[["exit",_,r]]),_=void 0),_}function fg(n,r,s,o,d){const _=[],f=hs(r.events,s);d&&(d.end=Object.assign({},f),_.push(["exit",d,r])),o.end=Object.assign({},f),_.push(["exit",o,r]),n.add(s+1,0,_)}function hs(n,r){const s=n[r],o=s[0]==="enter"?"start":"end";return s[1][o]}const Jx={name:"tasklistCheck",tokenize:t2};function e2(){return{text:{91:Jx}}}function t2(n,r,s){const o=this;return d;function d(c){return o.previous!==null||!o._gfmTasklistFirstContentOfListItem?s(c):(n.enter("taskListCheck"),n.enter("taskListCheckMarker"),n.consume(c),n.exit("taskListCheckMarker"),_)}function _(c){return ut(c)?(n.enter("taskListCheckValueUnchecked"),n.consume(c),n.exit("taskListCheckValueUnchecked"),f):c===88||c===120?(n.enter("taskListCheckValueChecked"),n.consume(c),n.exit("taskListCheckValueChecked"),f):s(c)}function f(c){return c===93?(n.enter("taskListCheckMarker"),n.consume(c),n.exit("taskListCheckMarker"),n.exit("taskListCheck"),a):s(c)}function a(c){return Me(c)?r(c):qe(c)?n.check({tokenize:n2},r,s)(c):s(c)}}function n2(n,r,s){return We(n,o,"whitespace");function o(d){return d===null?s(d):r(d)}}function i2(n){return Gg([Tx(),zx(),$x(n),Xx(),e2()])}const r2={};function j_(n){const r=this,s=n||r2,o=r.data(),d=o.micromarkExtensions||(o.micromarkExtensions=[]),_=o.fromMarkdownExtensions||(o.fromMarkdownExtensions=[]),f=o.toMarkdownExtensions||(o.toMarkdownExtensions=[]);d.push(i2(s)),_.push(xx()),f.push(Ex(s))}const s2=500,Za=`
89
+
90
+ --- Translation ---
91
+ `;function l2({active:n=!0,autoSendEnabled:r,targetLanguage:s,taskSlug:o,role:d,sessionId:_}){const[f,a]=re.useState([]),[c,h]=re.useState([]),[m,u]=re.useState(""),[y,w]=re.useState(!1),[k,x]=re.useState("ready"),[b,S]=re.useState(""),[g,v]=re.useState(Date.now()),[E,L]=re.useState(!1),[R,T]=re.useState(""),[A,M]=re.useState(0),j=re.useRef(n),I=re.useRef(1),U=re.useRef(null);re.useEffect(()=>{j.current=n},[n]),re.useEffect(()=>{a([]),h([]),T(""),x("ready"),S(""),I.current=1;let H=!1,te;const he=()=>{H||(te=window.setTimeout(me,j.current?200:1e3))},me=async()=>{if(!H)try{const Y=await ve.pollTranslationSession(_,I.current);if(H)return;W(Y.events),I.current=Y.nextCursor,x(Y.status),j.current&&S(b2(new Date().toISOString()))}catch(Y){H||T(Y instanceof Error?Y.message:"Translation poll failed.")}finally{he()}};return ve.startTranslationSession(o,d).then(Y=>{H||(x(Y.status),I.current=Y.nextCursor,me())}).catch(Y=>{H||T(Y instanceof Error?Y.message:"Translation start failed.")}),()=>{H=!0,te!==void 0&&window.clearTimeout(te),ve.stopTranslationSession(_).catch(()=>{})}},[_,o,d]),re.useEffect(()=>{if(!n)return;const H=U.current;if(!H)return;const te=window.requestAnimationFrame(()=>{H.scrollTop=H.scrollHeight});return()=>window.cancelAnimationFrame(te)},[n,A]);const F=d2(f);re.useEffect(()=>{if(!F)return;v(Date.now());const H=window.setInterval(()=>v(Date.now()),250);return()=>window.clearInterval(H)},[F]);async function K(H=!1){const te=m;L(!0),T(""),w(!1);try{const he=await ve.translateUserInput(o,d,{text:te,mode:H?"auto-send":"review-before-send",useContext:!1,send:H});he.sent?(u(""),w(!1)):(u(N_(te,he.englishPreview)),w(!0))}catch(he){T(he instanceof Error?he.message:"Translation failed.")}finally{L(!1)}}function W(H){if(H.length===0)return;for(const he of H)he.type==="status"?x(he.status):he.type==="error"?T(he.message):he.type==="failures"&&h(he.failures);const te=H.filter(he=>he.type==="entry");te.length>0&&(a(he=>{const me=te.reduce((q,oe)=>y2(q,oe.entry),he),Y=m2(me);return Y.removedIds.size>0&&h(q=>q.filter(oe=>!Y.removedIds.has(oe.translationId))),Y.entries}),M(he=>he+1))}async function V(){const H=y?pg(m):m;if(H.trim()){L(!0),T("");try{await ve.sendTranslatedInput(o,d,{englishText:H}),u(""),w(!1)}catch(te){T(te instanceof Error?te.message:"Failed to send English input.")}finally{L(!1)}}}function $(H){H.key!=="Enter"||H.shiftKey||H.nativeEvent.isComposing||(H.preventDefault(),!E&&m.trim()&&(y?V():K(r)))}async function ee(){a([]),h([]),I.current=1,await ve.clearTranslationSession(_).catch(H=>T(H.message))}async function N(){L(!0),T("");try{const H=await ve.ignoreTranslationFailures(_);h(H.failures)}catch(H){T(H instanceof Error?H.message:"Failed to ignore translation failures.")}finally{L(!1)}}async function B(){L(!0),T("");try{const H=await ve.retryTranslationFailures(_);h(H.failures)}catch(H){T(H instanceof Error?H.message:"Failed to retry translation failures.")}finally{L(!1)}}const z=p2(f,k,g),G=c.length;return D.jsxs("aside",{className:"translation-panel",children:[D.jsxs("header",{className:"translation-panel-header",children:[D.jsxs("div",{className:"translation-panel-titlebar",children:[D.jsx("h2",{children:"Translation"}),D.jsxs("div",{className:"translation-panel-actions",children:[G>0?D.jsxs(D.Fragment,{children:[D.jsxs("button",{type:"button",disabled:E,onClick:()=>void N(),children:["Ignore ",G]}),D.jsxs("button",{type:"button",disabled:E,onClick:()=>void B(),children:["Retry ",G]})]}):null,D.jsx("button",{type:"button",onClick:()=>void ee(),children:"Clear"})]})]}),D.jsxs("div",{className:"translation-status-row",children:[D.jsxs("p",{children:["Claude Code · target ",a2(s)," · ",z]}),D.jsx("p",{children:b?`poll ${b}`:"poll -"})]})]}),R?D.jsx("div",{className:"error-banner",children:R}):null,D.jsxs("div",{className:"translation-entry-list",ref:U,children:[f.length===0?D.jsx("p",{className:"muted",children:"Translated Claude Code output will appear here."}):null,f.map(H=>D.jsx(h2,{entry:H},H.id))]}),D.jsx("div",{className:"translation-composer",children:D.jsxs("div",{className:"translation-composer-row",children:[D.jsx("textarea",{value:m,onChange:H=>{u(H.target.value),(!H.target.value.trim()||y&&!v2(H.target.value))&&w(!1)},onKeyDown:$,placeholder:"输入中文,先翻译成英文工程指令..."}),D.jsx("div",{className:"translation-composer-actions",children:D.jsx("button",{type:"button",disabled:E||!y||!pg(m).trim(),onClick:()=>void V(),children:"Send English"})})]})})]})}function a2(n){var r;return((r=kg.find(s=>s.value===n))==null?void 0:r.label)??n}function o2({open:n,targetLanguage:r,onClose:s}){const[o,d]=re.useState(!1),[_,f]=re.useState(""),[a,c]=re.useState(null),[h,m]=re.useState(""),[u,y]=re.useState(""),[w,k]=re.useState(""),[x,b]=re.useState(!1),[S,g]=re.useState(null),[v,E]=re.useState(""),[L,R]=re.useState(""),[T,A]=re.useState(""),[M,j]=re.useState(!1);re.useEffect(()=>{if(!n)return;let V=!1,$;const ee=async()=>{V||(await I(!0),V||($=window.setTimeout(ee,2e3)))};return ee(),()=>{V=!0,$!==void 0&&window.clearTimeout($)}},[n,h]);async function I(V=!1){try{const $=await ve.getTranslationState();c($);const ee=h?$.fileIndex.jobs.some(N=>N.id===h):!1;if((!h||!ee)&&$.fileIndex.jobs[0])U($.fileIndex.jobs[0].id);else if(!$.fileIndex.jobs[0])m(""),y(""),k("");else if(V&&h){const N=await ve.readFileTranslation(h);y(N.output),k(N.report)}}catch($){f($ instanceof Error?$.message:"Failed to load file translations.")}}async function U(V){m(V),y(""),k("");try{const $=await ve.readFileTranslation(V);y($.output),k($.report)}catch($){f($ instanceof Error?$.message:"Failed to read translated file.")}}async function F(){b(!0),await K(v,L)}async function K(V="",$=""){j(!0),f("");try{const ee=await ve.browseTranslationSourceFiles({path:V,query:$,limit:250});g(ee),E(ee.currentPath),R($)}catch(ee){f(ee instanceof Error?ee.message:"Failed to browse source files.")}finally{j(!1)}}async function W(V=T){const $=V.trim();if($){d(!0),f("");try{const ee=await ve.createFileTranslation({sourcePath:$,targetLanguage:r});b(!1),await I(),await U(ee.id)}catch(ee){f(ee instanceof Error?ee.message:"Failed to create file translation.")}finally{d(!1)}}}return n?D.jsxs(D.Fragment,{children:[D.jsx("div",{className:"modal-backdrop file-translation-backdrop",children:D.jsx(u2,{busy:o,error:_,state:a,selectedJobId:h,output:u,report:w,onClose:()=>{b(!1),s()},onRefresh:()=>void I(),onSelectJob:V=>void U(V),onTranslate:()=>void F()})}),x?D.jsx(c2,{busy:o||M,state:S,currentPath:v,query:L,selectedPath:T,onBrowse:(V,$)=>void K(V,$),onClose:()=>b(!1),onQueryChange:R,onSelectPath:A,onTranslate:()=>void W()}):null]}):null}function c2({busy:n,state:r,currentPath:s,query:o,selectedPath:d,onBrowse:_,onClose:f,onQueryChange:a,onSelectPath:c,onTranslate:h}){const m=(r==null?void 0:r.entries)??[],u=m.filter(w=>w.type==="directory"),y=m.filter(w=>w.type==="file");return D.jsx("div",{className:"modal-backdrop translation-file-browser-backdrop",children:D.jsxs("section",{className:"translation-file-browser-modal",role:"dialog","aria-modal":"true","aria-label":"Select Source File",children:[D.jsxs("header",{children:[D.jsxs("div",{children:[D.jsx("h2",{children:"Select Source File"}),D.jsx("p",{children:s||"."})]}),D.jsx("button",{type:"button",onClick:f,children:"Close"})]}),D.jsxs("div",{className:"translation-file-browser-controls",children:[D.jsxs("div",{className:"translation-file-browser-nav",children:[D.jsx("button",{type:"button",disabled:n||!s,onClick:()=>_((r==null?void 0:r.parentPath)??"",""),children:"Up"}),D.jsx("button",{type:"button",disabled:n||!s,onClick:()=>_("",""),children:"Root"})]}),D.jsxs("form",{className:"translation-file-browser-search",onSubmit:w=>{w.preventDefault(),_(s,o)},children:[D.jsx("input",{value:o,onChange:w=>a(w.target.value),placeholder:"Search files"}),D.jsx("button",{type:"submit",disabled:n,children:"Search"}),D.jsx("button",{type:"button",disabled:n||!o,onClick:()=>_(s,""),children:"Clear"})]})]}),D.jsxs("div",{className:"translation-file-browser-layout",children:[D.jsxs("div",{className:"translation-file-browser-list",children:[n&&!r?D.jsx("p",{className:"muted",children:"Loading files..."}):null,!n&&m.length===0?D.jsx("p",{className:"muted",children:"No source files found."}):null,u.length>0?D.jsxs("div",{className:"translation-file-browser-group",children:[D.jsx("h3",{children:"Folders"}),u.map(w=>D.jsx(dg,{entry:w,selected:d===w.path,onBrowse:_,onSelectPath:c},w.path))]}):null,y.length>0?D.jsxs("div",{className:"translation-file-browser-group",children:[D.jsx("h3",{children:"Files"}),y.map(w=>D.jsx(dg,{entry:w,selected:d===w.path,onBrowse:_,onSelectPath:c},w.path))]}):null,r!=null&&r.truncated?D.jsx("p",{className:"translation-entry-note",children:"Result limit reached."}):null]}),D.jsxs("aside",{className:"translation-file-browser-selection",children:[D.jsxs("label",{children:[D.jsx("span",{children:"Source path"}),D.jsx("input",{value:d,onChange:w=>c(w.target.value)})]}),D.jsx("button",{type:"button",disabled:n||!d.trim(),onClick:h,children:"Translate File"})]})]})]})})}function dg({entry:n,selected:r,onBrowse:s,onSelectPath:o}){const d=n.type==="directory";return D.jsxs("button",{className:r?"translation-file-browser-entry is-selected":"translation-file-browser-entry",type:"button",onClick:()=>d?s(n.path,""):o(n.path),onDoubleClick:()=>d?s(n.path,""):void 0,children:[D.jsx("span",{children:d?"DIR":"FILE"}),D.jsx("strong",{children:n.name}),D.jsx("small",{children:n.path})]})}function u2({busy:n,error:r,state:s,selectedJobId:o,output:d,report:_,onClose:f,onRefresh:a,onSelectJob:c,onTranslate:h}){const m=(s==null?void 0:s.fileIndex.jobs)??[],u=m.find(y=>y.id===o);return D.jsxs("section",{className:"file-translation-modal",role:"dialog","aria-modal":"true","aria-label":"File Translation",children:[D.jsxs("header",{className:"file-translation-header",children:[D.jsxs("div",{children:[D.jsx("h2",{children:"File Translation"}),D.jsx("p",{children:"Claude Code · 中英互译"})]}),D.jsxs("div",{className:"file-translation-toolbar",children:[D.jsx("button",{type:"button",disabled:n,onClick:h,children:"Translate"}),D.jsx("button",{type:"button",disabled:n,onClick:a,children:"Refresh"}),D.jsx("button",{type:"button",onClick:f,children:"Close"})]})]}),r?D.jsx("div",{className:"error-banner",children:r}):null,s!=null&&s.memoryInitialized?null:D.jsx("p",{className:"translation-entry-note",children:"Translation memory is not initialized. Run Bootstrap from the sidebar before important file translations."}),D.jsxs("div",{className:"file-translation-layout",children:[D.jsxs("div",{className:"file-translation-list",children:[m.length===0?D.jsx("p",{className:"muted",children:"No translated files yet."}):null,m.map(y=>D.jsxs("button",{className:y.id===o?"file-translation-item is-active":"file-translation-item",type:"button",onClick:()=>c(y.id),children:[D.jsx("strong",{children:y.sourcePath}),D.jsxs("span",{children:[y.status," · ",y.targetLanguage]})]},y.id))]}),D.jsx("div",{className:"file-translation-preview",children:u?D.jsxs(D.Fragment,{children:[D.jsxs("header",{children:[D.jsx("strong",{children:u.sourcePath}),D.jsx("span",{children:u.status})]}),D.jsx("div",{className:"translation-markdown",children:D.jsx(h_,{remarkPlugins:[j_],children:d||_||"Translation output is not available yet."})})]}):D.jsx("p",{className:"muted",children:"Select a translated file to preview it."})})]})]})}function h2({entry:n}){if(n.sourceKind==="conversation-boundary")return D.jsx(f2,{entry:n});const r=_2(n),s=n.sourceKind==="tool-output",o=n.direction==="user-input-to-english",d=["translation-entry",`is-${n.sourceKind}`,o?"is-user-input":""].filter(Boolean).join(" ");return D.jsxs("article",{className:d,children:[s?D.jsx("pre",{children:r}):D.jsx("div",{className:"translation-markdown",children:D.jsx(h_,{remarkPlugins:[j_],children:r})}),n.warning?D.jsx("p",{className:"translation-entry-note",children:n.warning}):null,n.error?D.jsx("p",{className:"translation-entry-note is-error",children:n.error}):null]})}function f2({entry:n}){const r=n.boundaryKind==="end"?"结束":"开始",s=n.conversationTurn??0,o=C2(n.occurredAt??n.createdAt);return D.jsxs("div",{className:"translation-conversation-boundary","aria-label":`${r} 第 ${s} 轮 ${o}`,children:[D.jsx("span",{className:"translation-boundary-dash","aria-hidden":"true"}),D.jsx("span",{children:r}),D.jsxs("span",{children:["第 ",s," 轮"]}),D.jsx("time",{children:o}),D.jsx("span",{className:"translation-boundary-dash","aria-hidden":"true"})]})}function d2(n){const r=n.find(yh);return(r==null?void 0:r.translationStartedAt)??(r==null?void 0:r.createdAt)}function p2(n,r,s){const o=n.find(yh);if(o)return`translating ${S2(Math.max(0,s-g2(o)))}`;const d=n.at(-1);return(d==null?void 0:d.status)==="failed"||r==="failed"?"error":r}function yh(n){return n.status==="queued"||n.status==="translating"}function m2(n){const r=n.length-s2;if(r<=0)return{entries:n,removedIds:new Set};const s=new Set;for(const o of n){if(s.size>=r)break;yh(o)||s.add(o.id)}return s.size===0?{entries:n,removedIds:s}:{entries:n.filter(o=>!s.has(o.id)),removedIds:s}}function g2(n){const r=Date.parse(n.translationStartedAt??n.createdAt);return Number.isFinite(r)?r:Date.now()}function _2(n){return n.status==="queued"||n.status==="translating"?n.sourceText:n.status==="translated"?n.direction==="user-input-to-english"?N_(n.sourceText,n.translatedText):n.translatedText:n.translatedText||n.sourceText}function N_(n,r){return`${n.trimEnd()}${Za}${r.trimStart()}`}function v2(n){return n.includes(Za)}function pg(n){const r=n.indexOf(Za);return r===-1?n:n.slice(r+Za.length)}function y2(n,r){return n.findIndex(o=>o.id===r.id)===-1?[...n,r]:n.map(o=>o.id===r.id?r:o)}function S2(n){if(n<1e3)return`${Math.max(.1,n/1e3).toFixed(1)}s`;const r=n/1e3;if(r<60)return`${r.toFixed(1)}s`;const s=Math.floor(r/60),o=Math.floor(r%60).toString().padStart(2,"0");return`${s}:${o}`}function b2(n){const r=new Date(n);return Number.isNaN(r.getTime())?n:r.toLocaleTimeString()}function C2(n){const r=new Date(n);return Number.isNaN(r.getTime())?n:r.toLocaleTimeString()}function w2(n,r){return n.find(s=>s.taskSlug===r)??n[0]??null}function x2(n,r){const s=ds.map(o=>({role:o.name,permissionMode:n.roles[o.name].permissionMode,model:n.roles[o.name].model,effort:n.roles[o.name].effort}));if(r.gateReviewerEnabled){const o=n.roles["gate-reviewer"];s.push({role:"gate-reviewer",permissionMode:o.permissionMode,model:o.model,effort:o.effort})}return s}const E2=["architecture-plan","validation-adequacy","final-diff"];function k2({events:n,maxEvents:r=8,showHeader:s=!0}){const o=r===null?n:n.slice(-r);return D.jsxs("section",{className:"event-log",children:[s?D.jsx("h2",{children:"Events"}):null,n.length===0?D.jsx("p",{className:"muted",children:"No terminal events yet."}):D.jsx("ol",{children:o.map((d,_)=>D.jsx("li",{children:d},`${d}-${_}`))})]})}function A2({status:n,bootstrapStatus:r,applyResult:s,taskSyncResult:o,harnessEngineerSession:d,canCommitAndRebaseTask:_=!1,busy:f=!1,onRefresh:a,onApply:c,onCommitAndRebaseTask:h,onOpenStudio:m,onStartBootstrap:u,onRestartBootstrap:y,onStopBootstrap:w,onRunBootstrap:k}){const[x,b]=re.useState(!1),[S,g]=re.useState("default"),[v,E]=re.useState("default"),[L,R]=re.useState("default"),T=r==null?void 0:r.session,A=(r==null?void 0:r.status)==="running",M=(T==null?void 0:T.status)==="running";re.useEffect(()=>{T!=null&&T.permissionMode&&g(T.permissionMode),T!=null&&T.model&&E(T.model),T!=null&&T.effort&&R(T.effort)},[T]);const j={permissionMode:S,model:v,effort:L};return n?D.jsxs("section",{className:"harness-panel",children:[D.jsxs("div",{className:"harness-stage",children:[D.jsxs("div",{className:"harness-panel-header",children:[D.jsxs("div",{children:[D.jsx("strong",{children:"Fixed install"}),D.jsx("p",{className:"muted",children:n.initialized?n.needsApply?`${n.plannedChanges.length} pending updates`:"Up to date":"Not initialized"})]}),D.jsx("div",{className:"harness-actions",children:n.initialized?D.jsxs(D.Fragment,{children:[D.jsx("button",{type:"button",disabled:f,onClick:()=>void a(),children:"Refresh"}),n.needsApply?D.jsx("button",{type:"button",disabled:f,onClick:()=>void c(),children:"Update"}):null]}):D.jsx("button",{type:"button",disabled:f,onClick:()=>void c(),children:"Initialize"})})]}),n.initialized&&n.needsApply?D.jsxs(D.Fragment,{children:[D.jsx("h3",{className:"harness-file-list-title",children:"Files to update"}),D.jsx("ol",{className:"harness-file-list",children:n.plannedChanges.map(I=>D.jsxs("li",{children:[D.jsx("span",{children:I.path}),D.jsx(mi,{status:I.action})]},`${I.path}:${I.action}`))})]}):null]}),D.jsx("div",{className:"harness-stage",children:D.jsxs("div",{className:"harness-panel-header",children:[D.jsxs("div",{children:[D.jsx("strong",{children:"Harness Studio"}),D.jsxs("p",{className:"muted",children:["Engineer: ",R2(d)]})]}),D.jsx("div",{className:"harness-actions",children:D.jsx("button",{type:"button",disabled:f,onClick:m,children:"Open Studio"})})]})}),D.jsxs("div",{className:"harness-stage",children:[D.jsxs("div",{className:"harness-panel-header",children:[D.jsxs("div",{children:[D.jsx("strong",{children:"Bootstrap"}),D.jsx("p",{className:"muted",children:r?T2(r.status):"not loaded"})]}),D.jsx("div",{className:"harness-actions",children:D.jsx("button",{type:"button",disabled:f||!(r!=null&&r.canStart),onClick:()=>{b(!0)},children:"Open Bootstrap"})})]}),T?D.jsxs("div",{className:"harness-bootstrap-session",children:[D.jsxs("div",{children:[D.jsx("span",{children:T.command}),D.jsx(mi,{status:T.status})]}),D.jsx("button",{type:"button",onClick:()=>b(!0),children:"Open Terminal"})]}):null]}),s!=null&&s.changedFiles.length&&_&&!o?D.jsx("div",{className:"harness-result",children:D.jsx("button",{type:"button",disabled:f,onClick:()=>void h(),children:"Commit & rebase task"})}):null,o?D.jsx("div",{className:"harness-result",children:D.jsx("p",{className:"muted",children:o.message})}):null,n.warnings.length>0?D.jsx("ul",{className:"warnings",children:n.warnings.map(I=>D.jsx("li",{children:I},I))}):null,r!=null&&r.warnings.length?D.jsx("ul",{className:"warnings",children:r.warnings.map(I=>D.jsx("li",{children:I},I))}):null,x?D.jsx("div",{className:"harness-bootstrap-modal",role:"dialog","aria-modal":"true","aria-label":"Harness Engineer bootstrap session",children:D.jsxs("div",{className:"harness-bootstrap-modal-surface",children:[D.jsxs("header",{className:"harness-bootstrap-modal-header",children:[D.jsxs("div",{children:[D.jsx("strong",{children:"Harness Engineer Bootstrap"}),D.jsx("p",{className:"muted",children:(T==null?void 0:T.command)??"Start Harness Engineer, then run bootstrap when ready."})]}),D.jsxs("div",{className:"harness-bootstrap-modal-actions",children:[T?D.jsx(mi,{status:T.status}):null,D.jsx("button",{type:"button",onClick:()=>b(!1),children:"Close"})]})]}),D.jsxs("div",{className:"harness-bootstrap-controls",children:[D.jsxs("label",{children:[D.jsx("span",{children:"Permission"}),D.jsxs("select",{value:S,disabled:f||A||M,onChange:I=>g(I.target.value),children:[D.jsx("option",{value:"default",children:"默认"}),D.jsx("option",{value:"bypassPermissions",children:"bypassPermissions"})]})]}),D.jsxs("label",{children:[D.jsx("span",{children:"Model"}),D.jsx("select",{value:v,disabled:f||A||M,onChange:I=>E(I.target.value),children:Tg.map(I=>D.jsx("option",{value:I.value,children:I.label},I.value))})]}),D.jsxs("label",{children:[D.jsx("span",{children:"Effort"}),D.jsx("select",{value:L,disabled:f||A||M,onChange:I=>R(I.target.value),children:Rg.map(I=>D.jsx("option",{value:I.value,children:I.label},I.value))})]}),D.jsxs("div",{className:"harness-bootstrap-control-actions",children:[D.jsx("button",{type:"button",disabled:f||A||!(r!=null&&r.canStart),onClick:()=>void u(j),children:"Start"}),D.jsx("button",{type:"button",disabled:f||A||!(r!=null&&r.canStart),onClick:()=>void y(j),children:"Restart"}),D.jsx("button",{type:"button",disabled:f||!T,onClick:()=>void w(),children:"Stop"}),D.jsx("button",{type:"button",disabled:f||A||!M,onClick:()=>void k(),children:"Run bootstrap"})]})]}),D.jsx("div",{className:"harness-bootstrap-terminal",children:M?D.jsx(eo,{sessionId:T.id,active:x}):D.jsxs("div",{className:"terminal-empty",children:[D.jsx("strong",{children:"Harness Bootstrap"}),D.jsx("span",{children:"Start Harness Engineer first. When it is ready, click Run bootstrap to send the prompt."})]})})]})}):null]}):null}function T2(n){return n.replaceAll("_"," ")}function R2(n){return n?n.status==="running"?`${n.status} / ${n.activityStatus??"idle"}`:n.status:"not started"}function Sh(n){return{total:n.length,accepted:n.filter(r=>r.acceptedAt).length,delivered:n.filter(r=>r.deliveredAt).length}}function D2(n,r=6){const s=[...n].sort(O2).map((d,_)=>({message:d,sequence:_+1}));return[...r===null?s:s.slice(-r)].sort((d,_)=>_.sequence-d.sequence)}function M2({messages:n,orchestration:r,busy:s,maxMessages:o=6,showControls:d=!0,showHeader:_=!0,onModeChange:f,onMarkAllDone:a}){const[c,h]=re.useState(null),m=Sh(n),u=(r==null?void 0:r.mode)??"auto",y=D2(n,o);async function w(k){await B2(k.body),h(k.id),window.setTimeout(()=>h(x=>x===k.id?null:x),1200)}return D.jsxs("section",{className:"message-panel",children:[_?D.jsxs("div",{className:"message-panel-header",children:[D.jsxs("div",{children:[D.jsx("h2",{children:"Messages"}),D.jsxs("p",{className:"muted",children:[m.total," total / ",m.accepted," accepted"]})]}),d&&f?D.jsx("div",{className:"message-controls",children:D.jsxs("label",{className:"message-mode-toggle",children:[D.jsx("input",{type:"checkbox",checked:u==="auto",disabled:s,onChange:k=>f(k.target.checked?"auto":"manual")}),D.jsx("span",{children:"Auto orchestration"})]})}):null,d&&a?D.jsx("button",{type:"button",disabled:s,onClick:a,children:"Mark All Done"}):null]}):null,n.length===0?D.jsx("p",{className:"muted",children:"No role messages yet."}):D.jsx("ol",{className:"message-list",children:y.map(({message:k,sequence:x})=>D.jsxs("li",{className:"message-item",children:[D.jsxs("div",{className:"message-item-main",children:[D.jsxs("div",{className:"message-meta",children:[D.jsxs("span",{className:"message-sequence",children:["#",x]}),D.jsx("time",{dateTime:Ja(k),children:L2(Ja(k))}),D.jsxs("strong",{children:[k.fromRole," ","->"," ",k.toRole]}),D.jsx("span",{children:k.type})]}),D.jsx("p",{children:k.body}),k.failureReason?D.jsx("span",{className:"message-reason",children:k.failureReason}):null,k.bodyPath?D.jsx("span",{className:"message-path",children:k.bodyPath}):null]}),D.jsx("div",{className:"message-actions",children:D.jsx("button",{type:"button",disabled:s,onClick:()=>void w(k),children:c===k.id?"Copied":"Copy"})})]},k.id))})]})}function L2(n){const r=new Date(n);return Number.isNaN(r.getTime())?n:r.toLocaleString(void 0,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}function Ja(n){return n.acceptedAt??n.deliveredAt??n.dispatchingAt??n.createdAt}function O2(n,r){const s=Ja(n).localeCompare(Ja(r));if(s!==0)return s;const o=n.createdAt.localeCompare(r.createdAt);return o!==0?o:n.id.localeCompare(r.id)}async function B2(n){var s;if((s=navigator.clipboard)!=null&&s.writeText){await navigator.clipboard.writeText(n);return}const r=document.createElement("textarea");r.value=n,r.setAttribute("readonly","true"),r.style.position="fixed",r.style.left="-9999px",document.body.appendChild(r),r.select(),document.execCommand("copy"),r.remove()}function j2({defaultPath:n="",recentPaths:r=[],busy:s=!1,onConnect:o}){const[d,_]=re.useState(n);re.useEffect(()=>{n&&_(n)},[n]);async function f(a){a.preventDefault(),await o(d)}return D.jsx("form",{className:"repo-connect",onSubmit:f,children:D.jsxs("div",{className:r.length>0?"inline-form has-recent-paths":"inline-form",children:[D.jsx("input",{"aria-label":"Repository path",id:"repo-path",value:d,onChange:a=>_(a.target.value),placeholder:"/path/to/repo"}),r.length>0?D.jsxs("select",{"aria-label":"Recent repositories",className:"repo-recent-select",value:"",onChange:a=>{a.target.value&&_(a.target.value)},children:[D.jsx("option",{value:"",children:"Recent"}),r.map(a=>D.jsx("option",{value:a,children:a},a))]}):null,D.jsx("button",{type:"submit",disabled:s||!d.trim(),children:"Connect"})]})})}function N2({tasks:n,activeTaskSlug:r,onSelect:s}){return D.jsx("nav",{className:"task-nav","aria-label":"Tasks",children:n.map(o=>D.jsxs("button",{className:o.taskSlug===r?"task-nav-item is-active":"task-nav-item",type:"button",onClick:()=>s(o.taskSlug),children:[D.jsx("span",{children:o.title||o.taskSlug}),D.jsx(mi,{status:o.status})]},o.taskSlug))})}function H2({project:n,recentRepositoryPaths:r,tasks:s,activeTaskSlug:o,messages:d,orchestration:_,events:f,roundState:a,gateReview:c,translationEnabled:h,translationAutoSendEnabled:m,translationTargetLanguage:u,translationOutputMode:y,translatorSession:w,harnessEngineerSession:k,harnessStatus:x,harnessBootstrapStatus:b,harnessApplyResult:S,harnessTaskSyncResult:g,gatewayStatus:v,gatewayQrLogin:E,gatewayQrCheck:L,busy:R,onConnect:T,onRefreshConnectedRepository:A,onPullConnectedRepository:M,onRefreshHarness:j,onApplyHarness:I,onCommitAndRebaseHarnessTask:U,onStartHarnessBootstrap:F,onRestartHarnessBootstrap:K,onStopHarnessBootstrap:W,onRunHarnessBootstrap:V,onOpenHarnessStudio:$,onRefreshGateway:ee,onGatewayEnabledChange:N,onGatewayTranslationChange:B,onStartGatewayQrLogin:z,onResetGatewayBinding:G,onGateReviewGateEnabledChange:H,onTranslationEnabledChange:te,onTranslationAutoSendChange:he,onTranslationTargetLanguageChange:me,onTranslationOutputModeChange:Y,onOpenFileTranslation:q,onOpenTranslatorSession:oe,onCreateTranslationBootstrap:J,onUpdateTranslationMemory:ie,onCreateTask:de,onSelectTask:Ce,themeMode:xe,onThemeModeChange:Ke,flowPauseAlerts:it,onFlowPauseAlertsChange:Re,permissionRequestMode:Jt,onPermissionRequestModeChange:Wt,launchTemplate:Bt,canSaveLaunchTemplate:Ct,canOneClickStart:Xt,onSaveLaunchTemplate:vt,onOneClickStart:rt,onTryFlowPauseAlert:kt,onMarkAllMessagesDone:ue,onDeleteMessageHistory:Se}){const[ke,De]=re.useState(""),[Be,ht]=re.useState(!1),[Ie,gt]=re.useState(!1),[Ye,wt]=re.useState(()=>o?null:"repository-path"),Xe=Sh(d),zt=ke.trim(),At=s.find(Ue=>Ue.taskSlug===o)??null;re.useEffect(()=>{wt(Ue=>o&&Ue==="repository-path"?null:!o&&Ue===null?"repository-path":Ue)},[o]);function un(Ue,$n){wt($n?Ue:null)}async function _i(Ue){Ue.preventDefault(),await de({taskSlug:zt}),De("")}return D.jsxs("div",{className:"project-dashboard",children:[D.jsx("header",{className:"brand-header",children:D.jsx("strong",{children:"VibeCodingMaster"})}),D.jsx(pi,{title:"Repository Path",open:Ye==="repository-path",onOpenChange:Ue=>un("repository-path",Ue),children:D.jsx(j2,{defaultPath:(n==null?void 0:n.repoRoot)??"",recentPaths:r,busy:R,onConnect:T})}),n?D.jsx(pi,{title:"Connected Repository",open:Ye==="connected-repository",onOpenChange:Ue=>{un("connected-repository",Ue),Ue&&A()},children:D.jsx(G2,{busy:R,project:n,onPull:M})}):null,D.jsx(pi,{title:"Settings",open:Ye==="settings",onOpenChange:Ue=>un("settings",Ue),children:D.jsxs("div",{className:"sidebar-settings",children:[D.jsxs("button",{"aria-label":`Theme mode: ${gg(xe)}`,className:"settings-toggle theme-mode-toggle",disabled:R,title:"Cycle theme: system, light, dark",type:"button",onClick:()=>Ke(W2(xe)),children:[D.jsx("span",{children:"Theme"}),D.jsx("span",{children:gg(xe)})]}),D.jsxs("button",{"aria-pressed":!(v!=null&&v.enabled)&&it,className:!(v!=null&&v.enabled)&&it?"settings-toggle is-active":"settings-toggle",disabled:R||(v==null?void 0:v.enabled),title:v!=null&&v.enabled?"Disabled while Gateway is on":void 0,type:"button",onClick:()=>Re(!it),children:[D.jsx("span",{children:"Flow pause alert"}),D.jsx("span",{children:v!=null&&v.enabled?"off":it?"on":"off"})]}),D.jsxs("button",{className:"settings-toggle",disabled:R||(v==null?void 0:v.enabled),title:v!=null&&v.enabled?"Disabled while Gateway is on":void 0,type:"button",onClick:kt,children:[D.jsx("span",{children:"Try alert"}),D.jsx("span",{children:"test"})]}),D.jsxs("label",{className:"settings-select-row",children:[D.jsx("span",{children:"Permission requests"}),D.jsxs("select",{value:Jt,disabled:R,onChange:Ue=>Wt(Ue.target.value),children:[D.jsx("option",{value:"off",children:"off"}),D.jsx("option",{value:"allowAll",children:"allow all"})]})]}),D.jsxs("button",{className:"settings-toggle",disabled:R||!Ct,title:"Save the current core role launch settings and optional Gate Reviewer settings",type:"button",onClick:vt,children:[D.jsx("span",{children:"Save launch template"}),D.jsx("span",{children:Ct?"ready":"needs core sessions"})]}),Xt?D.jsxs("button",{className:"settings-toggle is-active",disabled:R,title:z2(Bt),type:"button",onClick:rt,children:[D.jsx("span",{children:"One-click start"}),D.jsx("span",{children:H_(Bt)})]}):null,o?D.jsxs(D.Fragment,{children:[D.jsxs("button",{type:"button",onClick:()=>ht(!0),children:[D.jsx("span",{children:"Messages"}),D.jsxs("span",{className:"muted",children:[Xe.total," total"]})]}),D.jsxs("button",{type:"button",onClick:()=>gt(!0),children:[D.jsx("span",{children:"Events"}),D.jsxs("span",{className:"muted",children:[f.length," total"]})]})]}):null]})}),D.jsx(pi,{title:"Translation",open:Ye==="translation",onOpenChange:Ue=>un("translation",Ue),children:D.jsx(I2,{busy:R,enabled:h,autoSendEnabled:m,targetLanguage:u,outputMode:y,fileTranslationAvailable:!!n,translatorSession:w,onAutoSendChange:he,onCreateBootstrap:J,onEnabledChange:te,onUpdateMemory:ie,onTargetLanguageChange:me,onOutputModeChange:Y,onOpenFileTranslation:q,onOpenTranslatorSession:oe})}),n&&o?D.jsx(pi,{title:"Gate Review Gates",open:Ye==="gate-review-gates",onOpenChange:Ue=>un("gate-review-gates",Ue),children:D.jsx(P2,{busy:R,state:c,onGateEnabledChange:H})}):null,D.jsx(pi,{title:"Gateway",open:Ye==="gateway",onOpenChange:Ue=>{un("gateway",Ue),Ue&&ee()},children:D.jsx(q2,{busy:R,qrCheck:L,qrLogin:E,status:v,onEnabledChange:N,onResetBinding:G,onStartQrLogin:z,onTranslationChange:B})}),n?D.jsx(pi,{title:"VCM Harness",open:Ye==="vcm-harness",onOpenChange:Ue=>un("vcm-harness",Ue),children:D.jsx(A2,{status:x,bootstrapStatus:b,applyResult:S,taskSyncResult:g,harnessEngineerSession:k,canCommitAndRebaseTask:!!(S!=null&&S.changedFiles.length&&At),busy:R,onRefresh:j,onApply:I,onCommitAndRebaseTask:U,onOpenStudio:$,onStartBootstrap:F,onRestartBootstrap:K,onStopBootstrap:W,onRunBootstrap:V})}):null,n?D.jsx(pi,{title:"New Task",open:Ye==="new-task",onOpenChange:Ue=>un("new-task",Ue),children:D.jsx("div",{className:"task-create",children:D.jsxs("form",{onSubmit:_i,children:[D.jsx("input",{value:ke,onChange:Ue=>De(Ue.target.value),placeholder:"task name"}),D.jsxs("div",{className:"task-create-preview",children:[D.jsxs("small",{children:["branch: ",zt?`feature/${zt}`:"feature/<task>"]}),D.jsxs("small",{children:["worktree: ",zt?`.claude/worktrees/${zt}`:".claude/worktrees/<task>"]})]}),D.jsx("button",{type:"submit",disabled:R||!zt,children:"Create"})]})})}):null,s.length>0?D.jsx(pi,{title:"Tasks",open:Ye==="tasks",onOpenChange:Ue=>un("tasks",Ue),children:D.jsx(N2,{tasks:s,activeTaskSlug:o,onSelect:Ce})}):null,n&&At?D.jsx(K2,{task:At,roundState:a}):null,Be?D.jsx(Q2,{busy:R,messages:d,orchestration:_,onClose:()=>ht(!1),onMarkAllDone:()=>{o&&ue(o)},onDeleteMessageHistory:()=>{o&&Se(o)}}):null,Ie?D.jsx(X2,{events:f,onClose:()=>gt(!1)}):null]})}function H_(n){return[n.autoOrchestration?"auto":"manual"].join(" + ")}function z2(n){const r=Object.entries(n.roles).map(([s,o])=>`${s}: ${o.permissionMode} / ${o.model} / ${o.effort}`).join("; ");return`Launch template: ${H_(n)}; ${r}`}function I2({autoSendEnabled:n,busy:r,enabled:s,fileTranslationAvailable:o,outputMode:d,targetLanguage:_,translatorSession:f,onAutoSendChange:a,onCreateBootstrap:c,onEnabledChange:h,onUpdateMemory:m,onOutputModeChange:u,onTargetLanguageChange:y,onOpenFileTranslation:w,onOpenTranslatorSession:k}){return D.jsxs("div",{className:"sidebar-settings",children:[D.jsxs("button",{"aria-pressed":s,className:s?"settings-toggle is-active":"settings-toggle",disabled:r,type:"button",onClick:()=>h(!s),children:[D.jsx("span",{children:"Conversation translation"}),D.jsx("span",{children:s?"on":"off"})]}),D.jsxs("button",{"aria-pressed":n,className:n?"settings-toggle is-active":"settings-toggle",disabled:r,type:"button",onClick:()=>a(!n),children:[D.jsx("span",{children:"Auto-send"}),D.jsx("span",{children:n?"on":"off"})]}),D.jsxs("label",{className:"settings-select-row",children:[D.jsx("span",{children:"Language"}),D.jsx("select",{value:_,disabled:r,onChange:x=>y(x.target.value),children:kg.map(x=>D.jsx("option",{value:x.value,children:x.label},x.value))})]}),D.jsxs("label",{className:"settings-select-row",children:[D.jsx("span",{children:"Reply scope"}),D.jsx("select",{value:d,disabled:r,onChange:x=>u(x.target.value),children:S1.map(x=>D.jsx("option",{value:x.value,children:x.label},x.value))})]}),D.jsxs("button",{className:"settings-toggle",disabled:r||!o,title:o?"Open file translation":"Connect a repository first",type:"button",onClick:w,children:[D.jsx("span",{children:"File translation"}),D.jsx("span",{children:"open"})]}),D.jsxs("button",{className:"settings-toggle",disabled:r||!o,title:o?"Run translation bootstrap":"Connect a repository first",type:"button",onClick:c,children:[D.jsx("span",{children:"Bootstrap"}),D.jsx("span",{children:"run"})]}),D.jsxs("button",{className:"settings-toggle",disabled:r||!o,title:o?"Compact and update translation memory":"Connect a repository first",type:"button",onClick:m,children:[D.jsx("span",{children:"Update memory"}),D.jsx("span",{children:"run"})]}),D.jsxs("div",{className:"settings-status-row",children:[D.jsx("span",{children:"Session status"}),D.jsx("strong",{children:U2(f)})]}),D.jsxs("button",{className:"settings-toggle",disabled:r||!o,title:o?"Open Translator session":"Connect a repository first",type:"button",onClick:k,children:[D.jsx("span",{children:"Open Session"}),D.jsx("span",{children:"open"})]})]})}function U2(n){return n?n.status==="running"?n.activityStatus??"idle":n.status:"not started"}function P2({busy:n,onGateEnabledChange:r,state:s}){return D.jsx("div",{className:"sidebar-settings",children:E2.map(o=>{const d=s==null?void 0:s.gates[o],_=!!(d!=null&&d.required);return D.jsxs("button",{"aria-pressed":_,className:_?"settings-toggle is-active":"settings-toggle",disabled:n||!s,title:d!=null&&d.status?`status: ${d.status}`:void 0,type:"button",onClick:()=>r(o,!_),children:[D.jsx("span",{children:F2(o)}),D.jsx("span",{children:_?"on":"off"})]},o)})})}function F2(n){switch(n){case"architecture-plan":return"Architecture plan";case"validation-adequacy":return"Validation adequacy";case"final-diff":return"Final diff"}return n}function q2({busy:n,onEnabledChange:r,onResetBinding:s,onStartQrLogin:o,onTranslationChange:d,qrCheck:_,qrLogin:f,status:a}){const c=!!(a!=null&&a.binding.tokenConfigured),h=!!(a!=null&&a.binding.tokenConfigured);return D.jsxs("div",{className:"gateway-panel",children:[D.jsxs("div",{className:"gateway-actions",children:[D.jsxs("button",{"aria-pressed":!!(a!=null&&a.enabled),className:a!=null&&a.enabled?"settings-toggle is-active":"settings-toggle",disabled:n||!a||!a.enabled&&!c,title:c?"Enable or disable PM messages and task-changing Gateway commands":"Scan and confirm iLink login first",type:"button",onClick:()=>a?r(!a.enabled):void 0,children:[D.jsx("span",{children:"Gateway"}),D.jsx("span",{children:a!=null&&a.enabled?"on":"off"})]}),D.jsxs("button",{"aria-pressed":!!(a!=null&&a.translationEnabled),className:a!=null&&a.translationEnabled?"settings-toggle is-active":"settings-toggle",disabled:n||!a,type:"button",onClick:()=>a?d(!a.translationEnabled):void 0,children:[D.jsx("span",{children:"Translation"}),D.jsx("span",{children:a!=null&&a.translationEnabled?"on":"off"})]}),h?D.jsx("button",{className:"danger-button",type:"button",disabled:n,onClick:s,children:"Reset Binding"}):D.jsx("button",{type:"button",disabled:n,onClick:o,children:"Start QR Login"})]}),f?D.jsx("p",{className:"muted",children:"QR login started. Use the login dialog to confirm binding."}):null,_?D.jsxs("p",{className:"muted",children:["QR status: ",_.status,_.message?` · ${_.message}`:""]}):null]})}function G2({busy:n,onPull:r,project:s}){const o=s.pullDisabledReason,d=!!s.canPull;return D.jsxs("div",{className:"project-summary",children:[D.jsxs("dl",{children:[D.jsxs("div",{children:[D.jsx("dt",{children:"Base path"}),D.jsx("dd",{children:s.repoRoot})]}),D.jsxs("div",{children:[D.jsx("dt",{children:"Branch"}),D.jsx("dd",{children:V2(s)})]}),D.jsxs("div",{children:[D.jsx("dt",{children:"Remote"}),D.jsx("dd",{children:s.upstreamBranch??"no upstream"})]}),D.jsxs("div",{children:[D.jsx("dt",{children:"Status"}),D.jsx("dd",{children:$2(s)})]}),D.jsxs("div",{children:[D.jsx("dt",{children:"Commit"}),D.jsx("dd",{children:s.shortHeadCommit??s.headCommit??"unknown"})]}),D.jsxs("div",{children:[D.jsx("dt",{children:"Working tree"}),D.jsx("dd",{children:s.isDirty?"uncommitted changes":"clean"})]})]}),D.jsxs("div",{className:"connected-repo-actions",children:[D.jsx("button",{type:"button",disabled:n||!d,title:o??"Pull latest changes with git pull --ff-only",onClick:()=>void r(),children:"Pull"}),D.jsx("span",{className:"muted",children:s.checkedAt?`checked ${Wu(s.checkedAt)}`:"status not refreshed"})]}),o?D.jsx("p",{className:"muted",children:o}):null,s.warnings.length>0?D.jsx("ul",{className:"warnings",children:s.warnings.map(_=>D.jsx("li",{children:_},_))}):null]})}function V2(n){return n.branch||"unknown"}function $2(n){if(!n.upstreamBranch)return"no upstream";const r=n.ahead??0,s=n.behind??0;return r===0&&s===0?"up to date":r>0&&s>0?`ahead ${r}, behind ${s}`:r>0?`ahead ${r}`:`behind ${s}`}function K2({roundState:n,task:r}){var m;const[s,o]=re.useState(()=>Date.now()),d=!!(n!=null&&n.startedAt),_=z_(r.createdAt,s),f=mg(n,(n==null?void 0:n.totalCcActiveMs)??0,s),a=d&&n?mg(n,n.currentRoundCcActiveMs,s):0,c=d&&n?Y2(n,s):0,h=((m=r.title)==null?void 0:m.trim())||r.taskSlug;return re.useEffect(()=>{const u=window.setInterval(()=>o(Date.now()),1e3);return()=>window.clearInterval(u)},[]),D.jsxs("section",{className:"task-status-dock","aria-label":"VCM Session status",children:[D.jsxs("div",{className:"task-status-dock-title",children:[D.jsx("strong",{title:h,children:h}),D.jsx("span",{className:`status-badge status-${r.status}`,children:r.status})]}),D.jsxs("dl",{className:"task-status-stats",children:[D.jsxs("div",{children:[D.jsx("dt",{children:"Session start"}),D.jsx("dd",{children:Wu(r.createdAt)})]}),D.jsxs("div",{children:[D.jsx("dt",{children:"Session total"}),D.jsx("dd",{children:Va(_)})]}),D.jsxs("div",{children:[D.jsx("dt",{children:"Rounds"}),D.jsx("dd",{children:(n==null?void 0:n.totalRoundCount)??0})]}),D.jsxs("div",{children:[D.jsx("dt",{children:"Role runtime"}),D.jsx("dd",{children:Va(f)})]})]}),d&&n?D.jsxs("div",{className:"current-round-status",children:[D.jsxs("div",{className:"current-round-title",children:[D.jsx("span",{children:n.status==="running"?"Current Round":"Last Round"}),D.jsx("span",{className:`status-badge status-${n.status}`,children:n.status})]}),D.jsxs("dl",{className:"task-status-stats",children:[D.jsxs("div",{children:[D.jsx("dt",{children:"Started"}),D.jsx("dd",{children:Wu(n.startedAt)})]}),D.jsxs("div",{children:[D.jsx("dt",{children:"Total"}),D.jsx("dd",{children:Va(c)})]}),D.jsxs("div",{children:[D.jsx("dt",{children:"Role runtime"}),D.jsx("dd",{children:Va(a)})]}),D.jsxs("div",{children:[D.jsx("dt",{children:"Turn count"}),D.jsx("dd",{children:n.turnCount})]})]})]}):null]})}function mg(n,r,s){if(!(n!=null&&n.activeTurnStartedAt)||n.status!=="running")return r;const o=Date.parse(n.updatedAt);return Number.isFinite(o)?r+Math.max(0,s-o):r}function Y2(n,r){const s=n.status==="running"?r:Date.parse(n.stoppedAt??n.lastTurnEndedAt??"");return z_(n.startedAt??"",Number.isFinite(s)?s:r)}function z_(n,r){const s=Date.parse(n);return Number.isFinite(s)?Math.max(0,r-s):0}function Wu(n){if(!n)return"-";const r=new Date(n);return Number.isNaN(r.getTime())?"-":new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit"}).format(r)}function Va(n){const r=Math.max(0,Math.floor(n/1e3)),s=Math.floor(r/3600),o=Math.floor(r%3600/60),d=r%60;return s>0?o>0?`${s}h ${o}m`:`${s}h`:o>0?d>0?`${o}m ${d}s`:`${o}m`:`${d}s`}function W2(n){return n==="system"?"light":n==="light"?"dark":"system"}function gg(n){return n==="system"?"System":n==="light"?"Light":"Dark"}function X2({events:n,onClose:r}){return D.jsx("div",{className:"modal-backdrop",children:D.jsxs("section",{className:"event-modal",role:"dialog","aria-modal":"true","aria-label":"Events",children:[D.jsxs("header",{children:[D.jsxs("div",{children:[D.jsx("h2",{children:"Events"}),D.jsxs("p",{className:"muted",children:[n.length," total"]})]}),D.jsx("button",{type:"button",onClick:r,children:"Close"})]}),D.jsx(k2,{events:n,maxEvents:null,showHeader:!1})]})})}function Q2({busy:n,messages:r,orchestration:s,onClose:o,onMarkAllDone:d,onDeleteMessageHistory:_}){const f=Sh(r);function a(){window.confirm(["Clear all pending route-file messages?","","Use this only after you manually copied or handled stuck route-file messages.","VCM will clear non-empty handoff message files so Stop-hook orchestration can continue."].join(`
92
+ `))&&d()}function c(){window.confirm([`Delete ${f.total} message histor${f.total===1?"y item":"y items"}?`,"","This removes message history from the Messages panel.","Pending route-file messages are not touched."].join(`
93
+ `))&&_()}return D.jsx("div",{className:"modal-backdrop",children:D.jsxs("section",{className:"message-modal",role:"dialog","aria-modal":"true","aria-label":"Messages",children:[D.jsxs("header",{children:[D.jsxs("div",{children:[D.jsx("h2",{children:"Messages"}),D.jsxs("p",{className:"muted",children:[f.total," total / ",f.accepted," accepted",s?` · ${s.mode}`:""]})]}),D.jsxs("div",{className:"modal-actions",children:[D.jsx("button",{type:"button",disabled:n,onClick:a,children:"Mark All Done"}),D.jsx("button",{type:"button",disabled:n||f.total===0,onClick:c,children:"Delete All"}),D.jsx("button",{type:"button",onClick:o,children:"Close"})]})]}),D.jsx(M2,{busy:n,maxMessages:null,messages:r,orchestration:s,showControls:!1,showHeader:!1})]})})}function pi({children:n,onOpenChange:r,open:s,title:o}){return D.jsxs("section",{className:"sidebar-section",children:[D.jsxs("button",{"aria-expanded":s,className:"sidebar-section-toggle",type:"button",onClick:()=>{r==null||r(!s)},children:[D.jsx("span",{children:o}),D.jsx("span",{"aria-hidden":"true",className:"sidebar-section-chevron"})]}),s?D.jsx("div",{className:"sidebar-section-content",children:n}):null]})}function I_(n,r){return n.find(s=>s.role===r)}function Z2({activeRole:n,roles:r=Ju,sessions:s,onSelect:o}){return D.jsx("div",{className:"role-tabs",role:"tablist","aria-label":"Role sessions",children:r.map(d=>{const _=I_(s,d.name),f=(_==null?void 0:_.status)==="running"?_.activityStatus??"idle":(_==null?void 0:_.status)??"not_started";return D.jsxs("button",{className:d.name===n?"role-tab is-active":"role-tab",type:"button",role:"tab","aria-selected":d.name===n,onClick:()=>o(d.name),children:[D.jsx("span",{children:d.label}),D.jsx(mi,{status:f})]},d.name)})})}function J2({role:n,session:r,permissionMode:s,model:o,effort:d,active:_=!0,busy:f,translationEnabled:a,translationAutoSendEnabled:c,translationTargetLanguage:h,onPermissionModeChange:m,onModelChange:u,onEffortChange:y,onStart:w,onResume:k,onStop:x,onRestart:b,onNotifyHarnessUpdated:S,onTerminalEvent:g}){const v=_1(n)&&a&&(r==null?void 0:r.status)==="running";return D.jsx("section",{className:"session-console",children:D.jsxs("div",{className:v?"session-console-body has-translation":"session-console-body",children:[D.jsxs("div",{className:"terminal-pane",children:[D.jsx(eh,{role:n,session:r,permissionMode:s,model:o,effort:d,busy:f,onPermissionModeChange:m,onModelChange:u,onEffortChange:y,onStart:w,onResume:k,onStop:x,onRestart:b,onNotifyHarnessUpdated:S}),(r==null?void 0:r.status)==="running"?D.jsx(eo,{sessionId:r.id,active:_,onEvent:g},r.id):D.jsxs("div",{className:"terminal-empty",children:[D.jsx("strong",{children:n}),D.jsx("span",{children:r!=null&&r.claudeSessionId?"Resume this role to reconnect its Claude Code conversation.":"Start this role to open an embedded Claude Code terminal."})]})]}),v?D.jsx("div",{className:"translation-pane",children:D.jsx(l2,{active:_,autoSendEnabled:c,targetLanguage:h,taskSlug:r.taskSlug,role:n,sessionId:r.id},r.id)}):null]})})}function eE(n,r,s){var _;if(!n||s.mode!=="auto")return null;const o=new Map(n.map(f=>[f.id,f])),d=r.filter(f=>{var a;return f.dispatchingAt?((a=o.get(f.id))==null?void 0:a.dispatchingAt)!==f.dispatchingAt:!1});return d.length===0?null:((_=d.sort(tE)[d.length-1])==null?void 0:_.toRole)??null}function tE(n,r){const s=n.dispatchingAt??n.deliveredAt??n.acceptedAt??"",o=r.dispatchingAt??r.deliveredAt??r.acceptedAt??"";return s!==o?s.localeCompare(o):n.createdAt.localeCompare(r.createdAt)}const nE=2e3;function iE({task:n,activeRole:r,gateReviewerEnabled:s,translationEnabled:o,translationAutoSendEnabled:d,translationTargetLanguage:_,refreshNonce:f=0,onTaskChanged:a,onActiveRoleChange:c,onMessagesChanged:h,onOrchestrationChanged:m,onRoundStateChanged:u,onEventsChanged:y,onLaunchStateChanged:w}){const[k,x]=re.useState(null),[b,S]=re.useState({"project-manager":"default",architect:"default",coder:"default",reviewer:"default","gate-reviewer":"default",translator:"default","harness-engineer":"default"}),[g,v]=re.useState({"project-manager":"default",architect:"default",coder:"default",reviewer:"default","gate-reviewer":"default",translator:"default","harness-engineer":"default"}),[E,L]=re.useState({"project-manager":"default",architect:"default",coder:"default",reviewer:"default","gate-reviewer":"default",translator:"medium","harness-engineer":"medium"}),[R,T]=re.useState(!1),[A,M]=re.useState(""),[j,I]=re.useState([]),[U,F]=re.useState(null),K=re.useRef(null),W=re.useRef(""),V=!!(k!=null&&k.sessions.some(J=>J.role==="gate-reviewer")),$=s||V,ee=[...ds,...$?[wg]:[]],N=re.useCallback((J,ie)=>{var xe;const de=((xe=K.current)==null?void 0:xe.taskSlug)===n.taskSlug?K.current.messages:null,Ce=eE(de,J,ie);K.current={taskSlug:n.taskSlug,messages:J},F(ie),h==null||h(J),m==null||m(ie),Ce&&(c(Ce),te(`auto switched to ${Ce} before VCM dispatch`))},[c,h,m,n.taskSlug]),B=re.useCallback((J,ie,de,Ce)=>{x(J),N(ie,de),u==null||u(Ce)},[N,u]),z=re.useCallback(async()=>{const[J,ie,de,Ce]=await Promise.all([ve.getTaskStatus(n.taskSlug),ve.listMessages(n.taskSlug),ve.getOrchestrationState(n.taskSlug),ve.getSessionRoundState(n.taskSlug)]);B(J,ie,de,Ce)},[B,n.taskSlug]);re.useEffect(()=>{z().catch(J=>M(J.message))},[z,f]),re.useEffect(()=>{I([]),y==null||y([])},[y,n.taskSlug]),re.useEffect(()=>{k&&!$&&r==="gate-reviewer"&&c("project-manager"),k&&r==="translator"&&c("project-manager")},[r,$,c,k]),re.useEffect(()=>{const J=k==null?void 0:k.task;if(!J||J.taskSlug!==n.taskSlug)return;const ie=_g(J);if(ie===_g(n)){W.current="";return}W.current!==ie&&(W.current=ie,a().catch(de=>{W.current="",M(de.message)}))},[a,k==null?void 0:k.task,n]),re.useEffect(()=>{S(J=>{let ie=!1;const de={...J};for(const Ce of(k==null?void 0:k.sessions)??[])de[Ce.role]!==Ce.permissionMode&&(de[Ce.role]=Ce.permissionMode,ie=!0);return ie?de:J})},[k==null?void 0:k.sessions]),re.useEffect(()=>{v(J=>{let ie=!1;const de={...J};for(const Ce of(k==null?void 0:k.sessions)??[]){const xe=Ce.model??"default";de[Ce.role]!==xe&&(de[Ce.role]=xe,ie=!0)}return ie?de:J})},[k==null?void 0:k.sessions]),re.useEffect(()=>{L(J=>{let ie=!1;const de={...J};for(const Ce of(k==null?void 0:k.sessions)??[]){const xe=Ce.effort??"default";de[Ce.role]!==xe&&(de[Ce.role]=xe,ie=!0)}return ie?de:J})},[k==null?void 0:k.sessions]),re.useEffect(()=>{const ie=((k==null?void 0:k.sessions)??[]).filter(xe=>rE(xe.role)),de=new Set(ie.map(xe=>xe.role)),Ce={};for(const xe of Zu)Ce[xe.name]={permissionMode:b[xe.name],model:g[xe.name],effort:E[xe.name]};w==null||w({taskSlug:n.taskSlug,roles:Ce,autoOrchestration:((U==null?void 0:U.mode)??"auto")==="auto",statusLoaded:!!k,sessionCount:ie.length,hasAnySession:ie.length>0,allRolesHaveSession:ds.every(xe=>de.has(xe.name))})},[g,E,w,U==null?void 0:U.mode,b,k,n.taskSlug]),re.useEffect(()=>{const J=window.setInterval(()=>{Promise.all([ve.getTaskStatus(n.taskSlug),ve.listMessages(n.taskSlug),ve.getOrchestrationState(n.taskSlug),ve.getSessionRoundState(n.taskSlug)]).then(([ie,de,Ce,xe])=>{B(ie,de,Ce,xe)}).catch(ie=>M(ie.message))},3e3);return()=>window.clearInterval(J)},[B,n.taskSlug]),re.useEffect(()=>{let J=!1,ie=!1;const de=window.setInterval(()=>{ie||(ie=!0,Promise.all([ve.listMessages(n.taskSlug),ve.getOrchestrationState(n.taskSlug)]).then(([Ce,xe])=>{J||N(Ce,xe)}).catch(Ce=>{J||M(Ce.message)}).finally(()=>{ie=!1}))},nE);return()=>{J=!0,window.clearInterval(de)}},[N,n.taskSlug]);async function G(J){T(!0),M("");try{await J(),await z(),await a()}catch(ie){M(ie instanceof Error?ie.message:"Action failed.")}finally{T(!1)}}async function H(){const J=[`Close task "${n.taskSlug}"?`,"","This is destructive:","- stops VCM-managed running role sessions for this task",`- deletes the task worktree: ${n.worktreePath}`,`- deletes the Git branch: ${n.branch}`,"- deletes VCM task/session/message/orchestration state","","VCM will not check running sessions or uncommitted changes before closing."].join(`
94
+ `);if(window.confirm(J)){T(!0),M("");try{await ve.cleanupTask(n.taskSlug,{force:!0,forceDeleteBranch:!0}),te(`closed ${n.taskSlug}`),await a()}catch(de){M(de instanceof Error?de.message:"Close task failed.")}finally{T(!1)}}}function te(J){I(ie=>{const de=[...ie,`${new Date().toLocaleTimeString()} ${J}`];return y==null||y(de),de})}function he(J,ie){S(de=>({...de,[J]:ie}))}function me(J,ie){v(de=>({...de,[J]:ie}))}function Y(J,ie){L(de=>({...de,[J]:ie}))}async function q(J){T(!0),M("");try{const ie=await ve.updateOrchestrationState(n.taskSlug,{mode:J});F(ie),m==null||m(ie),te(`auto orchestration ${J==="auto"?"enabled":"disabled"}`)}catch(ie){M(ie instanceof Error?ie.message:"Failed to update orchestration mode.")}finally{T(!1)}}const oe=((U==null?void 0:U.mode)??"auto")==="auto";return D.jsxs("div",{className:"task-workspace",children:[D.jsxs("header",{className:"workspace-header",children:[D.jsx("div",{className:"workspace-title-line",children:D.jsx("h1",{children:n.title||n.taskSlug})}),D.jsx(Z2,{activeRole:r,roles:ee,sessions:(k==null?void 0:k.sessions)??[],onSelect:c}),D.jsxs("div",{className:"workspace-header-actions",children:[D.jsxs("button",{"aria-label":`Auto orchestration is ${oe?"on":"off"}`,"aria-pressed":oe,className:`orchestration-toggle${oe?" is-active":""}`,disabled:R,type:"button",onClick:()=>void q(oe?"manual":"auto"),children:[D.jsx("span",{children:"Auto orchestration"}),D.jsx("strong",{children:oe?"on":"off"})]}),D.jsx("button",{className:"danger-button",type:"button",disabled:R,onClick:()=>void H(),children:"Close Task"})]})]}),A?D.jsx("div",{className:"error-banner",children:A}):null,D.jsx("div",{className:"workspace-grid",children:D.jsx("div",{className:"workspace-main",children:D.jsx("div",{className:"role-console-stack",children:ee.map(J=>{const ie=J.name,de=ie===r,Ce=I_((k==null?void 0:k.sessions)??[],ie);return D.jsx("div",{className:de?"role-console-panel is-active":"role-console-panel","aria-hidden":!de,children:D.jsx(J2,{role:ie,session:Ce,permissionMode:b[ie],model:g[ie],effort:E[ie],active:de,busy:R,translationEnabled:o,translationAutoSendEnabled:d,translationTargetLanguage:_,onPermissionModeChange:xe=>he(ie,xe),onModelChange:xe=>me(ie,xe),onEffortChange:xe=>Y(ie,xe),onStart:()=>void G(async()=>{await ve.startRoleSession(n.taskSlug,ie,{cols:100,rows:28,permissionMode:b[ie],model:g[ie],effort:E[ie]}),te(`started ${ie} with ${b[ie]} / ${g[ie]} / ${E[ie]}`)}),onResume:()=>void G(async()=>{await ve.resumeRoleSession(n.taskSlug,ie,{cols:100,rows:28,permissionMode:b[ie],model:g[ie],effort:E[ie]}),te(`resumed ${ie} with ${b[ie]} / ${g[ie]} / ${E[ie]}`)}),onStop:()=>void G(async()=>{await ve.stopRoleSession(n.taskSlug,ie),te(`stopped ${ie}`)}),onRestart:()=>void G(async()=>{await ve.restartRoleSession(n.taskSlug,ie,{cols:100,rows:28,permissionMode:b[ie],model:g[ie],effort:E[ie]}),te(`restarted ${ie} with ${b[ie]} / ${g[ie]} / ${E[ie]}`)}),onNotifyHarnessUpdated:()=>void G(async()=>{await ve.notifyRoleHarnessUpdated(n.taskSlug,ie),te(`notified ${ie} to reload latest harness`)}),onTerminalEvent:xe=>te(`${J.label}: ${xe}`)})},ie)})})})})]})}function rE(n){return ds.some(r=>r.name===n)}function _g(n){return[n.status,n.updatedAt,n.cleanupStatus??"",n.cleanedAt??""].join(":")}const sE=120*1e3,vg=1400,lE=3;function aE(){const[n,r]=re.useState(null),[s,o]=re.useState([]),[d,_]=re.useState(null),[f,a]=re.useState(null),[c,h]=re.useState(null),[m,u]=re.useState(null),[y,w]=re.useState(null),[k,x]=re.useState(null),[b,S]=re.useState(null),[g,v]=re.useState(!1),[E,L]=re.useState([]),[R,T]=re.useState(null),[A,M]=re.useState(null),[j,I]=re.useState(null),[U,F]=re.useState(null),[K,W]=re.useState(null),[V,$]=re.useState(null),[ee,N]=re.useState("project-manager"),[B,z]=re.useState("system"),[G,H]=re.useState(!0),[te,he]=re.useState("off"),[me,Y]=re.useState(!1),[q,oe]=re.useState(!1),[J,ie]=re.useState(v1),[de,Ce]=re.useState(y1),[xe,Ke]=re.useState(!1),[it,Re]=re.useState(!1),[Jt,Wt]=re.useState(!1),[Bt,Ct]=re.useState(null),[Xt,vt]=re.useState("default"),[rt,kt]=re.useState("default"),[ue,Se]=re.useState("medium"),[ke,De]=re.useState(null),[Be,ht]=re.useState("default"),[Ie,gt]=re.useState("default"),[Ye,wt]=re.useState("medium"),[Xe,zt]=re.useState(()=>b1()),[At,un]=re.useState(null),[_i,Ue]=re.useState(0),[$n,Sn]=re.useState(null),[Zi,Ji]=re.useState(!1),[wr,vs]=re.useState(!1),[xr,Nt]=re.useState(""),El=re.useRef({}),Ln=re.useRef(null),vi=re.useRef(""),er=re.useRef(""),ye=re.useMemo(()=>w2(E,R),[E,R]),It=(At==null?void 0:At.taskSlug)===(ye==null?void 0:ye.taskSlug)?At:null,kl=!!(It!=null&&It.statusLoaded&&It.allRolesHaveSession),Al=!!(ye&&(It!=null&&It.statusLoaded)&&!It.hasAnySession),yt=re.useCallback(Q=>{z(Q.themeMode),H(Q.flowPauseAlerts),he(Q.permissionRequestMode),Y(Q.translationEnabled),oe(Q.translationAutoSendEnabled),ie(Q.translationTargetLanguage),Ce(Q.translationOutputMode),zt(Q.launchTemplate)},[]),st=re.useCallback(()=>{Ln.current!==null&&(window.clearInterval(Ln.current),Ln.current=null)},[]),Ut=re.useCallback((Q={})=>{st(),Q.resetAudio&&dE(),$a(),Ln.current=window.setInterval(()=>{$a()},vg)},[st]),Kn=re.useCallback(()=>{st(),Sn(null);let Q=1;$a(),Ln.current=window.setInterval(()=>{Q+=1,$a(),Q>=lE&&Ln.current!==null&&(window.clearInterval(Ln.current),Ln.current=null)},vg)},[st]),tr=re.useCallback((Q,_e=`manual-${Date.now()}`,Tt={})=>{Sn({id:_e,text:Q}),Ut(Tt)},[Ut]),lo=re.useCallback(()=>{st(),Sn(null)},[st]),Er=re.useCallback(()=>{st(),Sn(null),H(!1)},[st]),Tl=re.useCallback(Q=>{ye!=null&&ye.taskSlug&&M({taskSlug:ye.taskSlug,messages:Q})},[ye==null?void 0:ye.taskSlug]),nr=re.useCallback(Q=>{ye!=null&&ye.taskSlug&&I({taskSlug:ye.taskSlug,orchestration:Q})},[ye==null?void 0:ye.taskSlug]),ys=re.useCallback(Q=>{ye!=null&&ye.taskSlug&&F({taskSlug:ye.taskSlug,events:Q})},[ye==null?void 0:ye.taskSlug]),yi=re.useCallback(Q=>{if(!(ye!=null&&ye.taskSlug)||Q.taskSlug!==ye.taskSlug||(W({taskSlug:Q.taskSlug,roundState:Q}),Q.status!=="stopped"||!Q.roundId))return;const _e=hE(Q);if(El.current[Q.taskSlug]===_e||(El.current[Q.taskSlug]=_e,!G))return;const Je=Q.activeRole??"role";uE(Q)>=sE?tr(`No new turn started after ${Je} stopped.`,_e):Kn()},[ye==null?void 0:ye.taskSlug,G,Kn,tr]),Si=re.useCallback(Q=>{un(_e=>(_e==null?void 0:_e.taskSlug)===Q.taskSlug&&_e.statusLoaded===Q.statusLoaded&&_e.sessionCount===Q.sessionCount&&_e.hasAnySession===Q.hasAnySession&&_e.allRolesHaveSession===Q.allRolesHaveSession&&_e.autoOrchestration===Q.autoOrchestration&&JSON.stringify(_e.roles)===JSON.stringify(Q.roles)?_e:Q)},[]);async function bn(){const Q=await ve.listTasks();return L(Q),T(_e=>{var Tt;return _e&&Q.some(Je=>Je.taskSlug===_e)?_e:((Tt=Q[0])==null?void 0:Tt.taskSlug)??null}),Q}async function Cn(){const Q=await ve.getHarnessStatus();return _(Q),Q}async function ft(){const Q=await ve.getHarnessBootstrapStatus();return a(Q),Q}async function kr(){const Q=await ve.getGatewayStatus();return w(Q),Q}async function Rl(){const Q=await ve.getRecentRepositoryPaths();return o(Q),Q}async function On(Q){const[_e,Tt]=await Promise.all([ve.listMessages(Q),ve.getOrchestrationState(Q)]);M({taskSlug:Q,messages:_e}),I({taskSlug:Q,orchestration:Tt})}async function In(Q){const _e=await ve.getGateReviewState(Q);return $({taskSlug:Q,state:_e}),_e}function bi(Q){Q&&(vt(Q.permissionMode),Q.model&&kt(Q.model),Q.effort&&Se(Q.effort))}async function ir(Q={}){const _e=await ve.getTranslatorSession();return Ct(_e),Q.syncLaunchOptions&&bi(_e),_e}function Ci(Q){Q&&(ht(Q.permissionMode),Q.model&&gt(Q.model),Q.effort&&wt(Q.effort))}async function Yn(Q={}){const _e=await ve.getHarnessEngineerSession();return De(_e),Q.syncLaunchOptions&&Ci(_e),_e}re.useEffect(()=>{Promise.all([ve.getCurrentProject(),ve.getRecentRepositoryPaths(),ve.getAppPreferences(),ve.getGatewayStatus()]).then(async([Q,_e,Tt,Je])=>{r(Q),o(_e),w(Je),yt(Tt),Q&&await Promise.all([bn(),Cn(),ft()])}).catch(Q=>Nt(Q.message))},[yt]),re.useEffect(()=>{const Q=window.matchMedia("(prefers-color-scheme: dark)"),_e=()=>Ji(Q.matches);return _e(),Q.addEventListener("change",_e),()=>Q.removeEventListener("change",_e)},[]),re.useEffect(()=>()=>st(),[st]),re.useEffect(()=>{const Q=B==="system"?Zi?"dark":"light":B;document.documentElement.dataset.theme=Q,document.documentElement.dataset.themeMode=B},[Zi,B]),re.useEffect(()=>{!(y!=null&&y.enabled)||!G||(Er(),ve.updateAppPreferences({flowPauseAlerts:!1}).then(Q=>yt(Q)).catch(Q=>Nt(Q.message)))},[yt,Er,G,y==null?void 0:y.enabled]),re.useEffect(()=>{if(!(y!=null&&y.enabled)||!n||!ye)return;const Q=`${n.repoRoot}:${ye.taskSlug}`;if(y.currentProjectId===n.repoRoot&&y.currentTaskSlug===ye.taskSlug){vi.current=Q;return}vi.current!==Q&&(vi.current=Q,ve.updateGatewaySettings({currentProjectId:n.repoRoot,currentTaskSlug:ye.taskSlug}).then(_e=>w(_e)).catch(_e=>{vi.current===Q&&(vi.current=""),Nt(_e.message)}))},[ye==null?void 0:ye.taskSlug,y==null?void 0:y.currentProjectId,y==null?void 0:y.currentTaskSlug,y==null?void 0:y.enabled,n==null?void 0:n.repoRoot]),re.useEffect(()=>{if(!(ye!=null&&ye.taskSlug)){$(null);return}In(ye.taskSlug).catch(Q=>Nt(Q.message))},[ye==null?void 0:ye.taskSlug]),re.useEffect(()=>{er.current="",Ct(null),vt("default"),kt("default"),Se("medium"),De(null),ht("default"),gt("default"),wt("medium")},[n==null?void 0:n.repoRoot]),re.useEffect(()=>{if(!n)return;ir({syncLaunchOptions:!0}).catch(_e=>Nt(_e.message));const Q=window.setInterval(()=>{ir().catch(_e=>Nt(_e.message))},3e3);return()=>window.clearInterval(Q)},[n==null?void 0:n.repoRoot]),re.useEffect(()=>{if(!n)return;Promise.all([Yn({syncLaunchOptions:!0}),ft()]).catch(_e=>Nt(_e.message));const Q=window.setInterval(()=>{Promise.all([Yn(),ft()]).catch(_e=>Nt(_e.message))},3e3);return()=>window.clearInterval(Q)},[n==null?void 0:n.repoRoot]),re.useEffect(()=>{if(!n||!me)return;const Q=n.repoRoot;er.current===Q&&(Bt==null?void 0:Bt.status)==="running"||(er.current=Q,ve.ensureTranslatorSession().then(_e=>{Ct(_e),bi(_e)}).catch(_e=>{er.current="",Nt(_e.message)}))},[n==null?void 0:n.repoRoot,me]),re.useEffect(()=>{if(!(ye!=null&&ye.taskSlug))return;const Q=ye.taskSlug,_e=window.setInterval(()=>{In(Q).catch(Tt=>Nt(Tt.message))},3e3);return()=>window.clearInterval(_e)},[ye==null?void 0:ye.taskSlug]);async function Oe(Q){vs(!0),Nt("");try{await Q()}catch(_e){Nt(_e instanceof Error?_e.message:"Action failed.")}finally{vs(!1)}}const Ar=A&&A.taskSlug===(ye==null?void 0:ye.taskSlug)?A.messages:[],Bn=j&&j.taskSlug===(ye==null?void 0:ye.taskSlug)?j.orchestration:null,en=U&&U.taskSlug===(ye==null?void 0:ye.taskSlug)?U.events:[],Dl=K&&K.taskSlug===(ye==null?void 0:ye.taskSlug)?K.roundState:null,Ss=V&&V.taskSlug===(ye==null?void 0:ye.taskSlug)?V.state:null,Tr=!!(Ss&&Object.values(Ss.gates).some(Q=>Q.required));return D.jsxs(C1,{sidebar:D.jsx(H2,{project:n,recentRepositoryPaths:s,tasks:E,activeTaskSlug:(ye==null?void 0:ye.taskSlug)??null,messages:Ar,orchestration:Bn,events:en,roundState:Dl,gateReview:Ss,translationEnabled:me,translationAutoSendEnabled:q,translationTargetLanguage:J,translationOutputMode:de,translatorSession:Bt,harnessEngineerSession:ke,harnessStatus:d,harnessBootstrapStatus:f,harnessApplyResult:c,harnessTaskSyncResult:m,gatewayStatus:y,gatewayQrLogin:k,gatewayQrCheck:b,busy:wr,onConnect:Q=>Oe(async()=>{const _e=await ve.connectProject({repoPath:Q});r(_e),h(null),u(null),await Promise.all([bn(),Cn(),ft(),Rl()])}),onRefreshConnectedRepository:()=>Oe(async()=>{const Q=await ve.getCurrentProject();r(Q)}),onPullConnectedRepository:()=>Oe(async()=>{const Q=await ve.pullCurrentProject();r(Q)}),onRefreshHarness:()=>Oe(async()=>{h(null),u(null),await Promise.all([Cn(),ft()])}),onApplyHarness:()=>Oe(async()=>{u(null);const Q=await ve.applyHarness();h(Q),await Promise.all([Cn(),ft()])}),onCommitAndRebaseHarnessTask:()=>Oe(async()=>{if(!ye)throw new Error("Select a task before using Commit & rebase task.");if(!(c!=null&&c.changedFiles.length))throw new Error("Apply a harness update before using Commit & rebase task.");const Q=await ve.commitAndRebaseHarnessTask(ye.taskSlug,{changedFiles:c.changedFiles});u(Q);const _e=await ve.getCurrentProject();r(_e),await bn()}),onStartHarnessBootstrap:Q=>Oe(async()=>{const _e=await ve.startHarnessBootstrap({cols:120,rows:32,...Q});a(_e.status),await Yn({syncLaunchOptions:!0})}),onRestartHarnessBootstrap:Q=>Oe(async()=>{const _e=await ve.restartHarnessBootstrap({cols:120,rows:32,...Q});a(_e.status),await Yn({syncLaunchOptions:!0})}),onStopHarnessBootstrap:()=>Oe(async()=>{const Q=await ve.stopHarnessBootstrap();a(Q),await Yn()}),onRunHarnessBootstrap:()=>Oe(async()=>{const Q=await ve.runHarnessBootstrap();a(Q.status),await Yn()}),onOpenHarnessStudio:()=>Wt(!0),onRefreshGateway:()=>Oe(async()=>{await kr()}),onGatewayEnabledChange:Q=>{Oe(async()=>{const[_e,Tt]=await Promise.all([ve.updateGatewaySettings({enabled:Q,...Q&&n?{currentProjectId:n.repoRoot,currentTaskSlug:(ye==null?void 0:ye.taskSlug)??null}:{}}),Q?ve.updateAppPreferences({flowPauseAlerts:!1}):Promise.resolve(null)]);Tt&&yt(Tt),Q&&Er(),w(_e)})},onGatewayTranslationChange:Q=>{Oe(async()=>{const _e=await ve.updateGatewaySettings({translationEnabled:Q});w(_e)})},onStartGatewayQrLogin:()=>{Oe(async()=>{const Q=await ve.startGatewayQrLogin();x(Q),S(null),v(!0),await kr()})},onResetGatewayBinding:()=>{Oe(async()=>{const Q=await ve.resetGatewayBinding();w(Q),x(null),S(null),v(!1)})},onGateReviewGateEnabledChange:(Q,_e)=>{Oe(async()=>{if(!ye)throw new Error("Create or select a task before changing Gate Review Gates.");const Tt=await ve.updateGateReviewSettings(ye.taskSlug,{gates:{[Q]:_e}});$({taskSlug:ye.taskSlug,state:Tt})})},onTranslationEnabledChange:Q=>{Y(Q),Oe(async()=>{const _e=await ve.updateAppPreferences({translationEnabled:Q});yt(_e)})},onTranslationAutoSendChange:Q=>{oe(Q),Oe(async()=>{const _e=await ve.updateAppPreferences({translationAutoSendEnabled:Q});yt(_e)})},onTranslationTargetLanguageChange:Q=>{ie(Q),Oe(async()=>{const _e=await ve.updateAppPreferences({translationTargetLanguage:Q});yt(_e)})},onTranslationOutputModeChange:Q=>{Ce(Q),Oe(async()=>{const _e=await ve.updateAppPreferences({translationOutputMode:Q});yt(_e)})},onOpenFileTranslation:()=>Ke(!0),onOpenTranslatorSession:()=>Re(!0),onCreateTranslationBootstrap:()=>{Oe(async()=>{if(!n)throw new Error("Connect a repository before running Translation Bootstrap.");await ve.createTranslationBootstrap({targetLanguage:J}),await ir()})},onUpdateTranslationMemory:()=>{Oe(async()=>{if(!n)throw new Error("Connect a repository before updating translation memory.");await ve.createTranslationMemoryUpdate({targetLanguage:J}),await ir()})},onCreateTask:Q=>Oe(async()=>{const _e=await ve.createTask(Q);await bn(),T(_e.taskSlug),await In(_e.taskSlug)}),onSelectTask:T,themeMode:B,onThemeModeChange:Q=>{z(Q),Oe(async()=>{const _e=await ve.updateAppPreferences({themeMode:Q});yt(_e)})},flowPauseAlerts:G,onFlowPauseAlertsChange:Q=>{if(y!=null&&y.enabled){Er();return}H(Q),Q&&fE(),Oe(async()=>{const _e=await ve.updateAppPreferences({flowPauseAlerts:Q});yt(_e)})},permissionRequestMode:te,onPermissionRequestModeChange:Q=>{he(Q),Oe(async()=>{const _e=await ve.updateAppPreferences({permissionRequestMode:Q});yt(_e)})},launchTemplate:Xe,canSaveLaunchTemplate:kl,canOneClickStart:Al,onSaveLaunchTemplate:()=>{Oe(async()=>{if(!(It!=null&&It.allRolesHaveSession))throw new Error("Start all core role sessions before saving a launch template.");const Q=await ve.updateAppPreferences({launchTemplate:{version:1,roles:It.roles,autoOrchestration:It.autoOrchestration}});yt(Q)})},onOneClickStart:()=>{Oe(async()=>{if(!ye)throw new Error("Create or select a task before one-click start.");const Q=await ve.getTaskStatus(ye.taskSlug);if(Q.sessions.some(Je=>g1.some(Wn=>Wn===Je.role)))throw new Error("One-click start is only available before any role session has started.");const _e=await ve.updateOrchestrationState(ye.taskSlug,{mode:Xe.autoOrchestration?"auto":"manual"});I({taskSlug:ye.taskSlug,orchestration:_e});const Tt=x2(Xe,{gateReviewerEnabled:Tr});for(const Je of Tt){const Wn={cols:100,rows:28,permissionMode:Je.permissionMode,model:Je.model,effort:Je.effort},Xn=Q.sessions.find(bs=>bs.role===Je.role);if((Xn==null?void 0:Xn.status)==="running"){Je.role==="gate-reviewer"&&await ve.resumeRoleSession(ye.taskSlug,Je.role,Wn);continue}Xn!=null&&Xn.claudeSessionId?await ve.resumeRoleSession(ye.taskSlug,Je.role,Wn):await ve.startRoleSession(ye.taskSlug,Je.role,Wn)}N("project-manager"),await On(ye.taskSlug),await bn(),Ue(Je=>Je+1)})},onTryFlowPauseAlert:()=>{tr("This is a test flow pause alert.",void 0,{resetAudio:!0})},onMarkAllMessagesDone:Q=>{Oe(async()=>{const _e=await ve.markAllMessagesDone(Q);M({taskSlug:Q,messages:_e.messages}),await On(Q)})},onDeleteMessageHistory:Q=>{Oe(async()=>{const _e=await ve.deleteMessageHistory(Q);M({taskSlug:Q,messages:_e.messages}),await On(Q)})}}),children:[xr?D.jsx("div",{className:"error-banner",children:xr}):null,$n?D.jsx("div",{className:"flow-pause-alert-backdrop",children:D.jsxs("section",{"aria-describedby":"flow-pause-alert-body flow-pause-alert-hint","aria-labelledby":"flow-pause-alert-title","aria-modal":"true",className:"flow-pause-alert",role:"alertdialog",children:[D.jsx("p",{className:"flow-pause-alert-kicker",children:"VCM needs attention"}),D.jsx("h2",{id:"flow-pause-alert-title",children:"Flow needs attention"}),D.jsx("p",{id:"flow-pause-alert-body",children:$n.text}),D.jsx("p",{id:"flow-pause-alert-hint",className:"flow-pause-alert-hint",children:"The task may be complete, waiting for your decision, or blocked by a workflow issue."}),D.jsx("button",{type:"button",autoFocus:!0,onClick:lo,children:"Confirm"})]})}):null,g&&k?D.jsx(oE,{busy:wr,qrCheck:b,qrLogin:k,onCheck:()=>{Oe(async()=>{const Q=await ve.checkGatewayQrLogin();S(Q),(Q.status==="confirmed"||Q.status==="binded_redirect")&&v(!1),await kr()})},onClose:()=>v(!1)}):null,n&&ye?D.jsx(iE,{task:ye,activeRole:ee,gateReviewerEnabled:Tr,translationEnabled:me,translationAutoSendEnabled:q,translationTargetLanguage:J,refreshNonce:_i,onTaskChanged:async()=>{await bn()},onActiveRoleChange:N,onMessagesChanged:Tl,onOrchestrationChanged:nr,onRoundStateChanged:yi,onEventsChanged:ys,onLaunchStateChanged:Si}):D.jsxs("section",{className:"empty-workspace",children:[D.jsx("h1",{children:n?"Create a task to open the workspace":"Connect a repository to begin"}),D.jsx("p",{children:n?"Tasks create local role commands and handoff artifacts for the selected repository.":"VibeCodingMaster will create a local task workspace, role sessions, and handoff artifacts."})]}),D.jsx(o2,{open:xe,targetLanguage:J,onClose:()=>Ke(!1)}),D.jsx(L1,{open:Jt,busy:wr,status:d,bootstrapStatus:f,engineerSession:ke,permissionMode:Be,model:Ie,effort:Ye,onClose:()=>Wt(!1),onRefresh:()=>{Oe(async()=>{await Promise.all([Cn(),ft(),Yn()])})},onPermissionModeChange:ht,onModelChange:gt,onEffortChange:wt,onEngineerStart:()=>{Oe(async()=>{const Q=await ve.startHarnessEngineerSession({cols:120,rows:32,permissionMode:Be,model:Ie,effort:Ye});De(Q),Ci(Q)})},onEngineerResume:()=>{Oe(async()=>{const Q=await ve.resumeHarnessEngineerSession({cols:120,rows:32,permissionMode:Be,model:Ie,effort:Ye});De(Q),Ci(Q)})},onEngineerRestart:()=>{Oe(async()=>{const Q=await ve.restartHarnessEngineerSession({cols:120,rows:32,permissionMode:Be,model:Ie,effort:Ye});De(Q),Ci(Q)})},onEngineerStop:()=>{Oe(async()=>{const Q=await ve.stopHarnessEngineerSession();De(Q)})},onEngineerNotifyHarnessUpdated:()=>{Oe(async()=>{const Q=await ve.notifyHarnessEngineerHarnessUpdated();De(Q),Ci(Q)})}}),D.jsx(B1,{open:it,busy:wr,session:Bt,permissionMode:Xt,model:rt,effort:ue,onClose:()=>Re(!1),onPermissionModeChange:vt,onModelChange:kt,onEffortChange:Se,onStart:()=>{Oe(async()=>{const Q=await ve.startTranslatorSession({cols:100,rows:28,permissionMode:Xt,model:rt,effort:ue});Ct(Q),bi(Q)})},onResume:()=>{Oe(async()=>{const Q=await ve.resumeTranslatorSession({cols:100,rows:28,permissionMode:Xt,model:rt,effort:ue});Ct(Q),bi(Q)})},onRestart:()=>{Oe(async()=>{const Q=await ve.restartTranslatorSession({cols:100,rows:28,permissionMode:Xt,model:rt,effort:ue});Ct(Q),bi(Q)})},onStop:()=>{Oe(async()=>{const Q=await ve.stopTranslatorSession();Ct(Q)})},onNotifyHarnessUpdated:()=>{Oe(async()=>{const Q=await ve.notifyTranslatorHarnessUpdated();Ct(Q),bi(Q)})}})]})}function oE({busy:n,onCheck:r,onClose:s,qrCheck:o,qrLogin:d}){const[_,f]=re.useState(""),[a,c]=re.useState("");return re.useEffect(()=>{let h=!1;if(c(""),f(""),d.qrcodeUrl.startsWith("data:image/")){f(d.qrcodeUrl);return}try{const m=ms(0,"M");m.addData(d.qrcodeUrl),m.make(),h||f(m.createDataURL(8,2))}catch(m){h||c(m instanceof Error?m.message:"Failed to render QR code.")}return()=>{h=!0}},[d.qrcodeUrl]),D.jsx("div",{className:"modal-backdrop",children:D.jsxs("section",{"aria-labelledby":"gateway-qr-title","aria-modal":"true",className:"gateway-qr-modal",role:"dialog",children:[D.jsxs("header",{children:[D.jsxs("div",{children:[D.jsx("h2",{id:"gateway-qr-title",children:"Weixin Gateway Login"}),D.jsx("p",{className:"muted",children:"Scan with Weixin, confirm on the phone, then click Confirm."})]}),D.jsx("button",{type:"button",onClick:s,children:"Close"})]}),D.jsxs("div",{className:"gateway-qr-modal-body",children:[D.jsx("div",{className:"gateway-qr-code-frame",children:_?D.jsx("img",{alt:"Weixin Gateway QR login",src:_}):D.jsx("div",{className:"gateway-qr-placeholder",children:a||"Rendering QR code..."})}),D.jsxs("dl",{className:"gateway-qr-meta",children:[D.jsxs("div",{children:[D.jsx("dt",{children:"Status"}),D.jsx("dd",{children:(o==null?void 0:o.status)??d.status})]}),D.jsxs("div",{children:[D.jsx("dt",{children:"Expires"}),D.jsx("dd",{children:cE(d.expiresAt)})]}),o!=null&&o.message?D.jsxs("div",{children:[D.jsx("dt",{children:"Message"}),D.jsx("dd",{children:o.message})]}):null]})]}),D.jsx("footer",{children:D.jsx("button",{type:"button",disabled:n,onClick:r,children:"Confirm"})})]})})}function cE(n){const r=new Date(n);return Number.isNaN(r.getTime())?"-":new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(r)}let Xi=null;function uE(n){const r=Date.parse(n.startedAt??""),s=Date.parse(n.stoppedAt??n.lastTurnEndedAt??"");return!Number.isFinite(r)||!Number.isFinite(s)?0:Math.max(0,s-r)}function hE(n){const r=n.roundId??n.startedAt??n.taskSlug,s=n.stoppedAt??n.lastTurnEndedAt??"stopped";return`${r}:${s}`}async function fE(){const n=U_();return n?P_(n):!1}async function $a(){const n=U_();if(!n||!await P_(n))return!1;try{const s=n.createGain(),o=n.currentTime+.025;return s.gain.setValueAtTime(.85,n.currentTime),s.connect(n.destination),Sg(n,s,{frequency:587.33,startAt:o,duration:.18,peakGain:.045}),Sg(n,s,{frequency:783.99,startAt:o+.11,duration:.28,peakGain:.055}),window.setTimeout(()=>{s.disconnect()},800),!0}catch{return!1}}function U_(){const n=window.AudioContext??window.webkitAudioContext;if(!n)return null;try{return(!Xi||Xi.state==="closed")&&(Xi=new n),Xi}catch{return null}}function dE(){Xu(Xi)}function Xu(n){Xi=null,n&&n.state!=="closed"&&n.close().catch(()=>{})}async function P_(n){if(yg(n))return!0;try{await n.resume();const r=yg(n);return!r&&n===Xi&&Xu(n),r}catch{return n===Xi&&Xu(n),!1}}function yg(n){return n.state==="running"}function Sg(n,r,s){const o=n.createGain(),d=n.createOscillator(),_=n.createOscillator(),f=s.startAt+s.duration;o.gain.setValueAtTime(1e-4,s.startAt),o.gain.exponentialRampToValueAtTime(s.peakGain,s.startAt+.018),o.gain.exponentialRampToValueAtTime(1e-4,f),d.type="sine",d.frequency.setValueAtTime(s.frequency,s.startAt),_.type="triangle",_.frequency.setValueAtTime(s.frequency*2.01,s.startAt),d.connect(o),_.connect(o),o.connect(r),d.start(s.startAt),_.start(s.startAt),d.stop(f+.02),_.stop(f+.02)}const F_=document.getElementById("root");if(!F_)throw new Error("Missing #root element.");s1.createRoot(F_).render(D.jsx(re.StrictMode,{children:D.jsx(aE,{})}));