vibe-coding-master 0.4.41 → 0.4.42
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.
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
var E0=Object.defineProperty;var k0=(n,r,s)=>r in n?E0(n,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[r]=s;var Tm=(n,r,s)=>k0(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 g of d)if(g.type==="childList")for(const f of g.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&o(f)}).observe(document,{childList:!0,subtree:!0});function s(d){const g={};return d.integrity&&(g.integrity=d.integrity),d.referrerPolicy&&(g.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?g.credentials="include":d.crossOrigin==="anonymous"?g.credentials="omit":g.credentials="same-origin",g}function o(d){if(d.ep)return;d.ep=!0;const g=s(d);fetch(d.href,g)}})();function Jg(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Hu={exports:{}},Na={};/**
|
|
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 Rm;function A0(){if(Rm)return Na;Rm=1;var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function s(o,d,g){var f=null;if(g!==void 0&&(f=""+g),d.key!==void 0&&(f=""+d.key),"key"in d){g={};for(var l in d)l!=="key"&&(g[l]=d[l])}else g=d;return d=g.ref,{$$typeof:n,type:o,key:f,ref:d!==void 0?d:null,props:g}}return Na.Fragment=r,Na.jsx=s,Na.jsxs=s,Na}var Dm;function T0(){return Dm||(Dm=1,Hu.exports=A0()),Hu.exports}var x=T0(),zu={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 Mm;function R0(){if(Mm)return je;Mm=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"),g=Symbol.for("react.consumer"),f=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),u=Symbol.for("react.activity"),b=Symbol.iterator;function C(N){return N===null||typeof N!="object"?null:(N=b&&N[b]||N["@@iterator"],typeof N=="function"?N:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,S={};function v(N,$,I){this.props=N,this.context=$,this.refs=S,this.updater=I||T}v.prototype.isReactComponent={},v.prototype.setState=function(N,$){if(typeof N!="object"&&typeof N!="function"&&N!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,N,$,"setState")},v.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function _(){}_.prototype=v.prototype;function y(N,$,I){this.props=N,this.context=$,this.refs=S,this.updater=I||T}var A=y.prototype=new _;A.constructor=y,E(A,v.prototype),A.isPureReactComponent=!0;var L=Array.isArray;function D(){}var R={H:null,A:null,T:null,S:null},k=Object.prototype.hasOwnProperty;function M(N,$,I){var se=I.ref;return{$$typeof:n,type:N,key:$,ref:se!==void 0?se:null,props:I}}function B(N,$){return M(N.type,$,N.props)}function H(N){return typeof N=="object"&&N!==null&&N.$$typeof===n}function U(N){var $={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(I){return $[I]})}var P=/\/+/g;function K(N,$){return typeof N=="object"&&N!==null&&N.key!=null?U(""+N.key):$.toString(36)}function X(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(D,D):(N.status="pending",N.then(function($){N.status==="pending"&&(N.status="fulfilled",N.value=$)},function($){N.status==="pending"&&(N.status="rejected",N.reason=$)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function G(N,$,I,se,ae){var ue=typeof N;(ue==="undefined"||ue==="boolean")&&(N=null);var Y=!1;if(N===null)Y=!0;else switch(ue){case"bigint":case"string":case"number":Y=!0;break;case"object":switch(N.$$typeof){case n:case r:Y=!0;break;case p:return Y=N._init,G(Y(N._payload),$,I,se,ae)}}if(Y)return ae=ae(N),Y=se===""?"."+K(N,0):se,L(ae)?(I="",Y!=null&&(I=Y.replace(P,"$&/")+"/"),G(ae,$,I,"",function(Q){return Q})):ae!=null&&(H(ae)&&(ae=B(ae,I+(ae.key==null||N&&N.key===ae.key?"":(""+ae.key).replace(P,"$&/")+"/")+Y)),$.push(ae)),1;Y=0;var q=se===""?".":se+":";if(L(N))for(var Z=0;Z<N.length;Z++)se=N[Z],ue=q+K(se,Z),Y+=G(se,$,I,ue,ae);else if(Z=C(N),typeof Z=="function")for(N=Z.call(N),Z=0;!(se=N.next()).done;)se=se.value,ue=q+K(se,Z++),Y+=G(se,$,I,ue,ae);else if(ue==="object"){if(typeof N.then=="function")return G(X(N),$,I,se,ae);throw $=String(N),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return Y}function W(N,$,I){if(N==null)return N;var se=[],ae=0;return G(N,se,"","",function(ue){return $.call(I,ue,ae++)}),se}function te(N){if(N._status===-1){var $=N._result;$=$(),$.then(function(I){(N._status===0||N._status===-1)&&(N._status=1,N._result=I)},function(I){(N._status===0||N._status===-1)&&(N._status=2,N._result=I)}),N._status===-1&&(N._status=0,N._result=$)}if(N._status===1)return N._result.default;throw N._result}var z=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof N=="object"&&N!==null&&typeof N.message=="string"?String(N.message):String(N),error:N});if(!window.dispatchEvent($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)},j={map:W,forEach:function(N,$,I){W(N,function(){$.apply(this,arguments)},I)},count:function(N){var $=0;return W(N,function(){$++}),$},toArray:function(N){return W(N,function($){return $})||[]},only:function(N){if(!H(N))throw Error("React.Children.only expected to receive a single React element child.");return N}};return je.Activity=u,je.Children=j,je.Component=v,je.Fragment=s,je.Profiler=d,je.PureComponent=y,je.StrictMode=o,je.Suspense=c,je.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=R,je.__COMPILER_RUNTIME={__proto__:null,c:function(N){return R.H.useMemoCache(N)}},je.cache=function(N){return function(){return N.apply(null,arguments)}},je.cacheSignal=function(){return null},je.cloneElement=function(N,$,I){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var se=E({},N.props),ae=N.key;if($!=null)for(ue in $.key!==void 0&&(ae=""+$.key),$)!k.call($,ue)||ue==="key"||ue==="__self"||ue==="__source"||ue==="ref"&&$.ref===void 0||(se[ue]=$[ue]);var ue=arguments.length-2;if(ue===1)se.children=I;else if(1<ue){for(var Y=Array(ue),q=0;q<ue;q++)Y[q]=arguments[q+2];se.children=Y}return M(N.type,ae,se)},je.createContext=function(N){return N={$$typeof:f,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:g,_context:N},N},je.createElement=function(N,$,I){var se,ae={},ue=null;if($!=null)for(se in $.key!==void 0&&(ue=""+$.key),$)k.call($,se)&&se!=="key"&&se!=="__self"&&se!=="__source"&&(ae[se]=$[se]);var Y=arguments.length-2;if(Y===1)ae.children=I;else if(1<Y){for(var q=Array(Y),Z=0;Z<Y;Z++)q[Z]=arguments[Z+2];ae.children=q}if(N&&N.defaultProps)for(se in Y=N.defaultProps,Y)ae[se]===void 0&&(ae[se]=Y[se]);return M(N,ue,ae)},je.createRef=function(){return{current:null}},je.forwardRef=function(N){return{$$typeof:l,render:N}},je.isValidElement=H,je.lazy=function(N){return{$$typeof:p,_payload:{_status:-1,_result:N},_init:te}},je.memo=function(N,$){return{$$typeof:h,type:N,compare:$===void 0?null:$}},je.startTransition=function(N){var $=R.T,I={};R.T=I;try{var se=N(),ae=R.S;ae!==null&&ae(I,se),typeof se=="object"&&se!==null&&typeof se.then=="function"&&se.then(D,z)}catch(ue){z(ue)}finally{$!==null&&I.types!==null&&($.types=I.types),R.T=$}},je.unstable_useCacheRefresh=function(){return R.H.useCacheRefresh()},je.use=function(N){return R.H.use(N)},je.useActionState=function(N,$,I){return R.H.useActionState(N,$,I)},je.useCallback=function(N,$){return R.H.useCallback(N,$)},je.useContext=function(N){return R.H.useContext(N)},je.useDebugValue=function(){},je.useDeferredValue=function(N,$){return R.H.useDeferredValue(N,$)},je.useEffect=function(N,$){return R.H.useEffect(N,$)},je.useEffectEvent=function(N){return R.H.useEffectEvent(N)},je.useId=function(){return R.H.useId()},je.useImperativeHandle=function(N,$,I){return R.H.useImperativeHandle(N,$,I)},je.useInsertionEffect=function(N,$){return R.H.useInsertionEffect(N,$)},je.useLayoutEffect=function(N,$){return R.H.useLayoutEffect(N,$)},je.useMemo=function(N,$){return R.H.useMemo(N,$)},je.useOptimistic=function(N,$){return R.H.useOptimistic(N,$)},je.useReducer=function(N,$,I){return R.H.useReducer(N,$,I)},je.useRef=function(N){return R.H.useRef(N)},je.useState=function(N){return R.H.useState(N)},je.useSyncExternalStore=function(N,$,I){return R.H.useSyncExternalStore(N,$,I)},je.useTransition=function(){return R.H.useTransition()},je.version="19.2.6",je}var Lm;function Rh(){return Lm||(Lm=1,zu.exports=R0()),zu.exports}var ne=Rh(),Iu={exports:{}},Ha={},Uu={exports:{}},Pu={};/**
|
|
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 Om;function D0(){return Om||(Om=1,(function(n){function r(G,W){var te=G.length;G.push(W);e:for(;0<te;){var z=te-1>>>1,j=G[z];if(0<d(j,W))G[z]=W,G[te]=j,te=z;else break e}}function s(G){return G.length===0?null:G[0]}function o(G){if(G.length===0)return null;var W=G[0],te=G.pop();if(te!==W){G[0]=te;e:for(var z=0,j=G.length,N=j>>>1;z<N;){var $=2*(z+1)-1,I=G[$],se=$+1,ae=G[se];if(0>d(I,te))se<j&&0>d(ae,I)?(G[z]=ae,G[se]=te,z=se):(G[z]=I,G[$]=te,z=$);else if(se<j&&0>d(ae,te))G[z]=ae,G[se]=te,z=se;else break e}}return W}function d(G,W){var te=G.sortIndex-W.sortIndex;return te!==0?te:G.id-W.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var g=performance;n.unstable_now=function(){return g.now()}}else{var f=Date,l=f.now();n.unstable_now=function(){return f.now()-l}}var c=[],h=[],p=1,u=null,b=3,C=!1,T=!1,E=!1,S=!1,v=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;function A(G){for(var W=s(h);W!==null;){if(W.callback===null)o(h);else if(W.startTime<=G)o(h),W.sortIndex=W.expirationTime,r(c,W);else break;W=s(h)}}function L(G){if(E=!1,A(G),!T)if(s(c)!==null)T=!0,D||(D=!0,U());else{var W=s(h);W!==null&&X(L,W.startTime-G)}}var D=!1,R=-1,k=5,M=-1;function B(){return S?!0:!(n.unstable_now()-M<k)}function H(){if(S=!1,D){var G=n.unstable_now();M=G;var W=!0;try{e:{T=!1,E&&(E=!1,_(R),R=-1),C=!0;var te=b;try{t:{for(A(G),u=s(c);u!==null&&!(u.expirationTime>G&&B());){var z=u.callback;if(typeof z=="function"){u.callback=null,b=u.priorityLevel;var j=z(u.expirationTime<=G);if(G=n.unstable_now(),typeof j=="function"){u.callback=j,A(G),W=!0;break t}u===s(c)&&o(c),A(G)}else o(c);u=s(c)}if(u!==null)W=!0;else{var N=s(h);N!==null&&X(L,N.startTime-G),W=!1}}break e}finally{u=null,b=te,C=!1}W=void 0}}finally{W?U():D=!1}}}var U;if(typeof y=="function")U=function(){y(H)};else if(typeof MessageChannel<"u"){var P=new MessageChannel,K=P.port2;P.port1.onmessage=H,U=function(){K.postMessage(null)}}else U=function(){v(H,0)};function X(G,W){R=v(function(){G(n.unstable_now())},W)}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(G){G.callback=null},n.unstable_forceFrameRate=function(G){0>G||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<G?Math.floor(1e3/G):5},n.unstable_getCurrentPriorityLevel=function(){return b},n.unstable_next=function(G){switch(b){case 1:case 2:case 3:var W=3;break;default:W=b}var te=b;b=W;try{return G()}finally{b=te}},n.unstable_requestPaint=function(){S=!0},n.unstable_runWithPriority=function(G,W){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var te=b;b=G;try{return W()}finally{b=te}},n.unstable_scheduleCallback=function(G,W,te){var z=n.unstable_now();switch(typeof te=="object"&&te!==null?(te=te.delay,te=typeof te=="number"&&0<te?z+te:z):te=z,G){case 1:var j=-1;break;case 2:j=250;break;case 5:j=1073741823;break;case 4:j=1e4;break;default:j=5e3}return j=te+j,G={id:p++,callback:W,priorityLevel:G,startTime:te,expirationTime:j,sortIndex:-1},te>z?(G.sortIndex=te,r(h,G),s(c)===null&&G===s(h)&&(E?(_(R),R=-1):E=!0,X(L,te-z))):(G.sortIndex=j,r(c,G),T||C||(T=!0,D||(D=!0,U()))),G},n.unstable_shouldYield=B,n.unstable_wrapCallback=function(G){var W=b;return function(){var te=b;b=W;try{return G.apply(this,arguments)}finally{b=te}}}})(Pu)),Pu}var Bm;function M0(){return Bm||(Bm=1,Uu.exports=D0()),Uu.exports}var Fu={exports:{}},Xt={};/**
|
|
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 jm;function L0(){if(jm)return Xt;jm=1;var n=Rh();function r(c){var h="https://react.dev/errors/"+c;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)h+="&args[]="+encodeURIComponent(arguments[p])}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 g(c,h,p){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:p}}var f=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(c,h){if(c==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Xt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,Xt.createPortal=function(c,h){var p=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 g(c,h,null,p)},Xt.flushSync=function(c){var h=f.T,p=o.p;try{if(f.T=null,o.p=2,c)return c()}finally{f.T=h,o.p=p,o.d.f()}},Xt.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))},Xt.prefetchDNS=function(c){typeof c=="string"&&o.d.D(c)},Xt.preinit=function(c,h){if(typeof c=="string"&&h&&typeof h.as=="string"){var p=h.as,u=l(p,h.crossOrigin),b=typeof h.integrity=="string"?h.integrity:void 0,C=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;p==="style"?o.d.S(c,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:u,integrity:b,fetchPriority:C}):p==="script"&&o.d.X(c,{crossOrigin:u,integrity:b,fetchPriority:C,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Xt.preinitModule=function(c,h){if(typeof c=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var p=l(h.as,h.crossOrigin);o.d.M(c,{crossOrigin:p,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)},Xt.preload=function(c,h){if(typeof c=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var p=h.as,u=l(p,h.crossOrigin);o.d.L(c,p,{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})}},Xt.preloadModule=function(c,h){if(typeof c=="string")if(h){var p=l(h.as,h.crossOrigin);o.d.m(c,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else o.d.m(c)},Xt.requestFormReset=function(c){o.d.r(c)},Xt.unstable_batchedUpdates=function(c,h){return c(h)},Xt.useFormState=function(c,h,p){return f.H.useFormState(c,h,p)},Xt.useFormStatus=function(){return f.H.useHostTransitionStatus()},Xt.version="19.2.6",Xt}var Nm;function O0(){if(Nm)return Fu.exports;Nm=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(),Fu.exports=L0(),Fu.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 Hm;function B0(){if(Hm)return Ha;Hm=1;var n=M0(),r=Rh(),s=O0();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 g(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 l(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(g(e)!==e)throw Error(o(188))}function h(e){var t=e.alternate;if(!t){if(t=g(e),t===null)throw Error(o(188));return t!==e?null:e}for(var i=e,a=t;;){var m=i.return;if(m===null)break;var w=m.alternate;if(w===null){if(a=m.return,a!==null){i=a;continue}break}if(m.child===w.child){for(w=m.child;w;){if(w===i)return c(m),e;if(w===a)return c(m),t;w=w.sibling}throw Error(o(188))}if(i.return!==a.return)i=m,a=w;else{for(var O=!1,F=m.child;F;){if(F===i){O=!0,i=m,a=w;break}if(F===a){O=!0,a=m,i=w;break}F=F.sibling}if(!O){for(F=w.child;F;){if(F===i){O=!0,i=w,a=m;break}if(F===a){O=!0,a=w,i=m;break}F=F.sibling}if(!O)throw Error(o(189))}}if(i.alternate!==a)throw Error(o(190))}if(i.tag!==3)throw Error(o(188));return i.stateNode.current===i?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}var u=Object.assign,b=Symbol.for("react.element"),C=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),y=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),M=Symbol.for("react.activity"),B=Symbol.for("react.memo_cache_sentinel"),H=Symbol.iterator;function U(e){return e===null||typeof e!="object"?null:(e=H&&e[H]||e["@@iterator"],typeof e=="function"?e:null)}var P=Symbol.for("react.client.reference");function K(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===P?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case E:return"Fragment";case v:return"Profiler";case S:return"StrictMode";case L:return"Suspense";case D:return"SuspenseList";case M:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case T:return"Portal";case y:return e.displayName||"Context";case _:return(e._context.displayName||"Context")+".Consumer";case A:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case R:return t=e.displayName||null,t!==null?t:K(e.type)||"Memo";case k:t=e._payload,e=e._init;try{return K(e(t))}catch{}}return null}var X=Array.isArray,G=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te={pending:!1,data:null,method:null,action:null},z=[],j=-1;function N(e){return{current:e}}function $(e){0>j||(e.current=z[j],z[j]=null,j--)}function I(e,t){j++,z[j]=e.current,e.current=t}var se=N(null),ae=N(null),ue=N(null),Y=N(null);function q(e,t){switch(I(ue,t),I(ae,e),I(se,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Qp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Qp(t),e=Jp(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}$(se),I(se,e)}function Z(){$(se),$(ae),$(ue)}function Q(e){e.memoizedState!==null&&I(Y,e);var t=se.current,i=Jp(t,e.type);t!==i&&(I(ae,e),I(se,i))}function _e(e){ae.current===e&&($(se),$(ae)),Y.current===e&&($(Y),La._currentValue=te)}var ve,De;function Ae(e){if(ve===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);ve=t&&t[1]||"",De=-1<i.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+ve+e+De}var Ke=!1;function ht(e,t){if(!e||Ke)return"";Ke=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={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(he){var ce=he}Reflect.construct(e,[],ge)}else{try{ge.call()}catch(he){ce=he}e.call(ge.prototype)}}else{try{throw Error()}catch(he){ce=he}(ge=e())&&typeof ge.catch=="function"&&ge.catch(function(){})}}catch(he){if(he&&ce&&typeof he.stack=="string")return[he.stack,ce.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var m=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");m&&m.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var w=a.DetermineComponentFrameRoot(),O=w[0],F=w[1];if(O&&F){var J=O.split(`
|
|
44
|
-
`),oe=F.split(`
|
|
45
|
-
`);for(m=a=0;a<J.length&&!J[a].includes("DetermineComponentFrameRoot");)a++;for(;m<oe.length&&!oe[m].includes("DetermineComponentFrameRoot");)m++;if(a===J.length||m===oe.length)for(a=J.length-1,m=oe.length-1;1<=a&&0<=m&&J[a]!==oe[m];)m--;for(;1<=a&&0<=m;a--,m--)if(J[a]!==oe[m]){if(a!==1||m!==1)do if(a--,m--,0>m||J[a]!==oe[m]){var de=`
|
|
46
|
-
`+J[a].replace(" at new "," at ");return e.displayName&&de.includes("<anonymous>")&&(de=de.replace("<anonymous>",e.displayName)),de}while(1<=a&&0<=m);break}}}finally{Ke=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?Ae(i):""}function Re(e,t){switch(e.tag){case 26:case 27:case 5:return Ae(e.type);case 16:return Ae("Lazy");case 13:return e.child!==t&&t!==null?Ae("Suspense Fallback"):Ae("Suspense");case 19:return Ae("SuspenseList");case 0:case 15:return ht(e.type,!1);case 11:return ht(e.type.render,!1);case 1:return ht(e.type,!0);case 31:return Ae("Activity");default:return""}}function sn(e){try{var t="",i=null;do t+=Re(e,i),i=e,e=e.return;while(e);return t}catch(a){return`
|
|
47
|
-
Error generating stack: `+a.message+`
|
|
48
|
-
`+a.stack}}var en=Object.prototype.hasOwnProperty,Vt=n.unstable_scheduleCallback,an=n.unstable_cancelCallback,yn=n.unstable_shouldYield,bt=n.unstable_requestPaint,et=n.unstable_now,Lt=n.unstable_getCurrentPriorityLevel,fe=n.unstable_ImmediatePriority,Se=n.unstable_UserBlockingPriority,xe=n.unstable_NormalPriority,Le=n.unstable_LowPriority,Be=n.unstable_IdlePriority,mt=n.log,Pe=n.unstable_setDisableYieldValue,vt=null,_t=null;function Ot(e){if(typeof mt=="function"&&Pe(e),_t&&typeof _t.setStrictMode=="function")try{_t.setStrictMode(vt,e)}catch{}}var Xe=Math.clz32?Math.clz32:ln,tn=Math.log,Bt=Math.LN2;function ln(e){return e>>>=0,e===0?32:31-(tn(e)/Bt|0)|0}var Vn=256,Wn=262144,Ht=4194304;function on(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 Kn(e,t,i){var a=e.pendingLanes;if(a===0)return 0;var m=0,w=e.suspendedLanes,O=e.pingedLanes;e=e.warmLanes;var F=a&134217727;return F!==0?(a=F&~w,a!==0?m=on(a):(O&=F,O!==0?m=on(O):i||(i=F&~e,i!==0&&(m=on(i))))):(F=a&~w,F!==0?m=on(F):O!==0?m=on(O):i||(i=a&~e,i!==0&&(m=on(i)))),m===0?0:t!==0&&t!==m&&(t&w)===0&&(w=m&-m,i=t&-t,w>=i||w===32&&(i&4194048)!==0)?t:m}function Wt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function qs(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 Kt(){var e=Ht;return Ht<<=1,(Ht&62914560)===0&&(Ht=4194304),e}function Sn(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function zt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Hi(e,t,i,a,m,w){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 F=e.entanglements,J=e.expirationTimes,oe=e.hiddenUpdates;for(i=O&~i;0<i;){var de=31-Xe(i),ge=1<<de;F[de]=0,J[de]=-1;var ce=oe[de];if(ce!==null)for(oe[de]=null,de=0;de<ce.length;de++){var he=ce[de];he!==null&&(he.lane&=-536870913)}i&=~ge}a!==0&&He(e,a,0),w!==0&&m===0&&e.tag!==0&&(e.suspendedLanes|=w&~(O&~t))}function He(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-Xe(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|i&261930}function mi(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var a=31-Xe(i),m=1<<a;m&t|e[a]&t&&(e[a]|=t),i&=~m}}function Fr(e,t){var i=t&-t;return i=(i&42)!==0?1:zi(i),(i&(e.suspendedLanes|t))!==0?0:i}function zi(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 $s(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Yn(){var e=W.p;return e!==0?e:(e=window.event,e===void 0?32:bm(e.type))}function tl(e,t){var i=W.p;try{return W.p=e,t()}finally{W.p=i}}var ri=Math.random().toString(36).slice(2),Et="__reactFiber$"+ri,It="__reactProps$"+ri,Xn="__reactContainer$"+ri,Gs="__reactEvents$"+ri,zo="__reactListeners$"+ri,nl="__reactHandles$"+ri,il="__reactResources$"+ri,On="__reactMarker$"+ri;function qr(e){delete e[Et],delete e[It],delete e[Gs],delete e[zo],delete e[nl]}function cn(e){var t=e[Et];if(t)return t;for(var i=e.parentNode;i;){if(t=i[Xn]||i[Et]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=sm(e);e!==null;){if(i=e[Et])return i;e=sm(e)}return t}e=i,i=e.parentNode}return null}function gi(e){if(e=e[Et]||e[Xn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function si(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function _i(e){var t=e[il];return t||(t=e[il]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function at(e){e[On]=!0}var $r=new Set,re={};function kt(e,t){ai(e,t),ai(e+"Capture",t)}function ai(e,t){for(re[e]=t,e=0;e<t.length;e++)$r.add(t[e])}var rl=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]*$"),sl={},al={};function Gr(e){return en.call(al,e)?!0:en.call(sl,e)?!1:rl.test(e)?al[e]=!0:(sl[e]=!0,!1)}function gr(e,t,i){if(Gr(t))if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+i)}}function Vr(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 Qn(e,t,i,a){if(a===null)e.removeAttribute(i);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(t,i,""+a)}}function ct(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ut(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ll(e,t,i){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var m=a.get,w=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return m.call(this)},set:function(O){i=""+O,w.call(this,O)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return i},setValue:function(O){i=""+O},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Wr(e){if(!e._valueTracker){var t=Ut(e)?"checked":"value";e._valueTracker=ll(e,t,""+e[t])}}function Vs(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),a="";return e&&(a=Ut(e)?e.checked?"true":"false":e.value),e=a,e!==i?(t.setValue(e),!0):!1}function Kr(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 Io=/[\n"\\]/g;function un(e){return e.replace(Io,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Ws(e,t,i,a,m,w,O,F){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=""+ct(t)):e.value!==""+ct(t)&&(e.value=""+ct(t)):O!=="submit"&&O!=="reset"||e.removeAttribute("value"),t!=null?Ks(e,O,ct(t)):i!=null?Ks(e,O,ct(i)):a!=null&&e.removeAttribute("value"),m==null&&w!=null&&(e.defaultChecked=!!w),m!=null&&(e.checked=m&&typeof m!="function"&&typeof m!="symbol"),F!=null&&typeof F!="function"&&typeof F!="symbol"&&typeof F!="boolean"?e.name=""+ct(F):e.removeAttribute("name")}function ol(e,t,i,a,m,w,O,F){if(w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(e.type=w),t!=null||i!=null){if(!(w!=="submit"&&w!=="reset"||t!=null)){Wr(e);return}i=i!=null?""+ct(i):"",t=t!=null?""+ct(t):i,F||t===e.value||(e.value=t),e.defaultValue=t}a=a??m,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=F?e.checked:!!a,e.defaultChecked=!!a,O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"&&(e.name=O),Wr(e)}function Ks(e,t,i){t==="number"&&Kr(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function bn(e,t,i,a){if(e=e.options,t){t={};for(var m=0;m<i.length;m++)t["$"+i[m]]=!0;for(i=0;i<e.length;i++)m=t.hasOwnProperty("$"+e[i].value),e[i].selected!==m&&(e[i].selected=m),m&&a&&(e[i].defaultSelected=!0)}else{for(i=""+ct(i),t=null,m=0;m<e.length;m++){if(e[m].value===i){e[m].selected=!0,a&&(e[m].defaultSelected=!0);return}t!==null||e[m].disabled||(t=e[m])}t!==null&&(t.selected=!0)}}function Yr(e,t,i){if(t!=null&&(t=""+ct(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+ct(i):""}function Xr(e,t,i,a){if(t==null){if(a!=null){if(i!=null)throw Error(o(92));if(X(a)){if(1<a.length)throw Error(o(93));a=a[0]}i=a}i==null&&(i=""),t=i}i=ct(t),e.defaultValue=i,a=e.textContent,a===i&&a!==""&&a!==null&&(e.value=a),Wr(e)}function Cn(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var Uo=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 Ys(e,t,i){var a=t.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?a?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":a?e.setProperty(t,i):typeof i!="number"||i===0||Uo.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function Qr(e,t,i){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,i!=null){for(var a in i)!i.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="");for(var m in t)a=t[m],t.hasOwnProperty(m)&&i[m]!==a&&Ys(e,m,a)}else for(var w in t)t.hasOwnProperty(w)&&Ys(e,w,t[w])}function Jr(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 cl=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"]]),Ii=/^[\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 _r(e){return Ii.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Yt(){}var Bn=null;function Xs(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ui=null,Pi=null;function hn(e){var t=gi(e);if(t&&(e=t.stateNode)){var i=e[It]||null;e:switch(e=t.stateNode,t.type){case"input":if(Ws(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="'+un(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var a=i[t];if(a!==e&&a.form===e.form){var m=a[It]||null;if(!m)throw Error(o(90));Ws(a,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name)}}for(t=0;t<i.length;t++)a=i[t],a.form===e.form&&Vs(a)}break e;case"textarea":Yr(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&bn(e,!!i.multiple,t,!1)}}}var vr=!1;function Zr(e,t,i){if(vr)return e(t,i);vr=!0;try{var a=e(t);return a}finally{if(vr=!1,(Ui!==null||Pi!==null)&&(Vl(),Ui&&(t=Ui,e=Pi,Pi=Ui=null,hn(t),e)))for(t=0;t<e.length;t++)hn(e[t])}}function vi(e,t){var i=e.stateNode;if(i===null)return null;var a=i[It]||null;if(a===null)return null;i=a[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(o(231,t,typeof i));return i}var Jn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ke=!1;if(Jn)try{var yr={};Object.defineProperty(yr,"passive",{get:function(){ke=!0}}),window.addEventListener("test",yr,yr),window.removeEventListener("test",yr,yr)}catch{ke=!1}var li=null,Qs=null,es=null;function wn(){if(es)return es;var e,t=Qs,i=t.length,a,m="value"in li?li.value:li.textContent,w=m.length;for(e=0;e<i&&t[e]===m[e];e++);var O=i-e;for(a=1;a<=O&&t[i-a]===m[w-a];a++);return es=m.slice(e,1<a?1-a:void 0)}function Fi(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 Sr(){return!0}function ts(){return!1}function Pt(e){function t(i,a,m,w,O){this._reactName=i,this._targetInst=m,this.type=a,this.nativeEvent=w,this.target=O,this.currentTarget=null;for(var F in e)e.hasOwnProperty(F)&&(i=e[F],this[F]=i?i(w):w[F]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?Sr:ts,this.isPropagationStopped=ts,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=Sr)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Sr)},persist:function(){},isPersistent:Sr}),t}var V={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},pe=Pt(V),Ue=u({},V,{view:0,detail:0}),Ct=Pt(Ue),Zn,jn,Nn,ns=u({},Ue,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Fo,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!==Nn&&(Nn&&e.type==="mousemove"?(Zn=e.screenX-Nn.screenX,jn=e.screenY-Nn.screenY):jn=Zn=0,Nn=e),Zn)},movementY:function(e){return"movementY"in e?e.movementY:jn}}),Js=Pt(ns),ul=u({},ns,{dataTransfer:0}),Ev=Pt(ul),kv=u({},Ue,{relatedTarget:0}),Po=Pt(kv),Av=u({},V,{animationName:0,elapsedTime:0,pseudoElement:0}),Tv=Pt(Av),Rv=u({},V,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Dv=Pt(Rv),Mv=u({},V,{data:0}),ef=Pt(Mv),Lv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ov={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"},Bv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function jv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Bv[e])?!!t[e]:!1}function Fo(){return jv}var Nv=u({},Ue,{key:function(e){if(e.key){var t=Lv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Fi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Ov[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Fo,charCode:function(e){return e.type==="keypress"?Fi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Fi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Hv=Pt(Nv),zv=u({},ns,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),tf=Pt(zv),Iv=u({},Ue,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Fo}),Uv=Pt(Iv),Pv=u({},V,{propertyName:0,elapsedTime:0,pseudoElement:0}),Fv=Pt(Pv),qv=u({},ns,{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}),$v=Pt(qv),Gv=u({},V,{newState:0,oldState:0}),Vv=Pt(Gv),Wv=[9,13,27,32],qo=Jn&&"CompositionEvent"in window,Zs=null;Jn&&"documentMode"in document&&(Zs=document.documentMode);var Kv=Jn&&"TextEvent"in window&&!Zs,nf=Jn&&(!qo||Zs&&8<Zs&&11>=Zs),rf=" ",sf=!1;function af(e,t){switch(e){case"keyup":return Wv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function lf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var is=!1;function Yv(e,t){switch(e){case"compositionend":return lf(t);case"keypress":return t.which!==32?null:(sf=!0,rf);case"textInput":return e=t.data,e===rf&&sf?null:e;default:return null}}function Xv(e,t){if(is)return e==="compositionend"||!qo&&af(e,t)?(e=wn(),es=Qs=li=null,is=!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 nf&&t.locale!=="ko"?null:t.data;default:return null}}var Qv={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 of(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Qv[e.type]:t==="textarea"}function cf(e,t,i,a){Ui?Pi?Pi.push(a):Pi=[a]:Ui=a,t=Zl(t,"onChange"),0<t.length&&(i=new pe("onChange","change",null,i,a),e.push({event:i,listeners:t}))}var ea=null,ta=null;function Jv(e){Gp(e,0)}function hl(e){var t=si(e);if(Vs(t))return e}function uf(e,t){if(e==="change")return t}var hf=!1;if(Jn){var $o;if(Jn){var Go="oninput"in document;if(!Go){var ff=document.createElement("div");ff.setAttribute("oninput","return;"),Go=typeof ff.oninput=="function"}$o=Go}else $o=!1;hf=$o&&(!document.documentMode||9<document.documentMode)}function df(){ea&&(ea.detachEvent("onpropertychange",pf),ta=ea=null)}function pf(e){if(e.propertyName==="value"&&hl(ta)){var t=[];cf(t,ta,e,Xs(e)),Zr(Jv,t)}}function Zv(e,t,i){e==="focusin"?(df(),ea=t,ta=i,ea.attachEvent("onpropertychange",pf)):e==="focusout"&&df()}function ey(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return hl(ta)}function ty(e,t){if(e==="click")return hl(t)}function ny(e,t){if(e==="input"||e==="change")return hl(t)}function iy(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var xn=typeof Object.is=="function"?Object.is:iy;function na(e,t){if(xn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;for(a=0;a<i.length;a++){var m=i[a];if(!en.call(t,m)||!xn(e[m],t[m]))return!1}return!0}function mf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function gf(e,t){var i=mf(e);e=0;for(var a;i;){if(i.nodeType===3){if(a=e+i.textContent.length,e<=t&&a>=t)return{node:i,offset:t-e};e=a}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=mf(i)}}function _f(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?_f(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function vf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Kr(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=Kr(e.document)}return t}function Vo(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 ry=Jn&&"documentMode"in document&&11>=document.documentMode,rs=null,Wo=null,ia=null,Ko=!1;function yf(e,t,i){var a=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Ko||rs==null||rs!==Kr(a)||(a=rs,"selectionStart"in a&&Vo(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),ia&&na(ia,a)||(ia=a,a=Zl(Wo,"onSelect"),0<a.length&&(t=new pe("onSelect","select",null,t,i),e.push({event:t,listeners:a}),t.target=rs)))}function br(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var ss={animationend:br("Animation","AnimationEnd"),animationiteration:br("Animation","AnimationIteration"),animationstart:br("Animation","AnimationStart"),transitionrun:br("Transition","TransitionRun"),transitionstart:br("Transition","TransitionStart"),transitioncancel:br("Transition","TransitionCancel"),transitionend:br("Transition","TransitionEnd")},Yo={},Sf={};Jn&&(Sf=document.createElement("div").style,"AnimationEvent"in window||(delete ss.animationend.animation,delete ss.animationiteration.animation,delete ss.animationstart.animation),"TransitionEvent"in window||delete ss.transitionend.transition);function Cr(e){if(Yo[e])return Yo[e];if(!ss[e])return e;var t=ss[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in Sf)return Yo[e]=t[i];return e}var bf=Cr("animationend"),Cf=Cr("animationiteration"),wf=Cr("animationstart"),sy=Cr("transitionrun"),ay=Cr("transitionstart"),ly=Cr("transitioncancel"),xf=Cr("transitionend"),Ef=new Map,Xo="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(" ");Xo.push("scrollEnd");function ei(e,t){Ef.set(e,t),kt(t,[e])}var fl=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Hn=[],as=0,Qo=0;function dl(){for(var e=as,t=Qo=as=0;t<e;){var i=Hn[t];Hn[t++]=null;var a=Hn[t];Hn[t++]=null;var m=Hn[t];Hn[t++]=null;var w=Hn[t];if(Hn[t++]=null,a!==null&&m!==null){var O=a.pending;O===null?m.next=m:(m.next=O.next,O.next=m),a.pending=m}w!==0&&kf(i,m,w)}}function pl(e,t,i,a){Hn[as++]=e,Hn[as++]=t,Hn[as++]=i,Hn[as++]=a,Qo|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function Jo(e,t,i,a){return pl(e,t,i,a),ml(e)}function wr(e,t){return pl(e,null,null,t),ml(e)}function kf(e,t,i){e.lanes|=i;var a=e.alternate;a!==null&&(a.lanes|=i);for(var m=!1,w=e.return;w!==null;)w.childLanes|=i,a=w.alternate,a!==null&&(a.childLanes|=i),w.tag===22&&(e=w.stateNode,e===null||e._visibility&1||(m=!0)),e=w,w=w.return;return e.tag===3?(w=e.stateNode,m&&t!==null&&(m=31-Xe(i),e=w.hiddenUpdates,a=e[m],a===null?e[m]=[t]:a.push(t),t.lane=i|536870912),w):null}function ml(e){if(50<Ea)throw Ea=0,lu=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ls={};function oy(e,t,i,a){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=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function En(e,t,i,a){return new oy(e,t,i,a)}function Zo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function yi(e,t){var i=e.alternate;return i===null?(i=En(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 Af(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 gl(e,t,i,a,m,w){var O=0;if(a=e,typeof e=="function")Zo(e)&&(O=1);else if(typeof e=="string")O=d0(e,i,se.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case M:return e=En(31,i,t,m),e.elementType=M,e.lanes=w,e;case E:return xr(i.children,m,w,t);case S:O=8,m|=24;break;case v:return e=En(12,i,t,m|2),e.elementType=v,e.lanes=w,e;case L:return e=En(13,i,t,m),e.elementType=L,e.lanes=w,e;case D:return e=En(19,i,t,m),e.elementType=D,e.lanes=w,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case y:O=10;break e;case _:O=9;break e;case A:O=11;break e;case R:O=14;break e;case k:O=16,a=null;break e}O=29,i=Error(o(130,e===null?"null":typeof e,"")),a=null}return t=En(O,i,t,m),t.elementType=e,t.type=a,t.lanes=w,t}function xr(e,t,i,a){return e=En(7,e,a,t),e.lanes=i,e}function ec(e,t,i){return e=En(6,e,null,t),e.lanes=i,e}function Tf(e){var t=En(18,null,null,0);return t.stateNode=e,t}function tc(e,t,i){return t=En(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Rf=new WeakMap;function zn(e,t){if(typeof e=="object"&&e!==null){var i=Rf.get(e);return i!==void 0?i:(t={value:e,source:t,stack:sn(t)},Rf.set(e,t),t)}return{value:e,source:t,stack:sn(t)}}var os=[],cs=0,_l=null,ra=0,In=[],Un=0,qi=null,oi=1,ci="";function Si(e,t){os[cs++]=ra,os[cs++]=_l,_l=e,ra=t}function Df(e,t,i){In[Un++]=oi,In[Un++]=ci,In[Un++]=qi,qi=e;var a=oi;e=ci;var m=32-Xe(a)-1;a&=~(1<<m),i+=1;var w=32-Xe(t)+m;if(30<w){var O=m-m%5;w=(a&(1<<O)-1).toString(32),a>>=O,m-=O,oi=1<<32-Xe(t)+m|i<<m|a,ci=w+e}else oi=1<<w|i<<m|a,ci=e}function nc(e){e.return!==null&&(Si(e,1),Df(e,1,0))}function ic(e){for(;e===_l;)_l=os[--cs],os[cs]=null,ra=os[--cs],os[cs]=null;for(;e===qi;)qi=In[--Un],In[Un]=null,ci=In[--Un],In[Un]=null,oi=In[--Un],In[Un]=null}function Mf(e,t){In[Un++]=oi,In[Un++]=ci,In[Un++]=qi,oi=t.id,ci=t.overflow,qi=e}var Ft=null,ft=null,We=!1,$i=null,Pn=!1,rc=Error(o(519));function Gi(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw sa(zn(t,e)),rc}function Lf(e){var t=e.stateNode,i=e.type,a=e.memoizedProps;switch(t[Et]=e,t[It]=a,i){case"dialog":qe("cancel",t),qe("close",t);break;case"iframe":case"object":case"embed":qe("load",t);break;case"video":case"audio":for(i=0;i<Aa.length;i++)qe(Aa[i],t);break;case"source":qe("error",t);break;case"img":case"image":case"link":qe("error",t),qe("load",t);break;case"details":qe("toggle",t);break;case"input":qe("invalid",t),ol(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":qe("invalid",t);break;case"textarea":qe("invalid",t),Xr(t,a.value,a.defaultValue,a.children)}i=a.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||t.textContent===""+i||a.suppressHydrationWarning===!0||Yp(t.textContent,i)?(a.popover!=null&&(qe("beforetoggle",t),qe("toggle",t)),a.onScroll!=null&&qe("scroll",t),a.onScrollEnd!=null&&qe("scrollend",t),a.onClick!=null&&(t.onclick=Yt),t=!0):t=!1,t||Gi(e,!0)}function Of(e){for(Ft=e.return;Ft;)switch(Ft.tag){case 5:case 31:case 13:Pn=!1;return;case 27:case 3:Pn=!0;return;default:Ft=Ft.return}}function us(e){if(e!==Ft)return!1;if(!We)return Of(e),We=!0,!1;var t=e.tag,i;if((i=t!==3&&t!==27)&&((i=t===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||Cu(e.type,e.memoizedProps)),i=!i),i&&ft&&Gi(e),Of(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));ft=rm(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));ft=rm(e)}else t===27?(t=ft,sr(e.type)?(e=Au,Au=null,ft=e):ft=t):ft=Ft?qn(e.stateNode.nextSibling):null;return!0}function Er(){ft=Ft=null,We=!1}function sc(){var e=$i;return e!==null&&(mn===null?mn=e:mn.push.apply(mn,e),$i=null),e}function sa(e){$i===null?$i=[e]:$i.push(e)}var ac=N(null),kr=null,bi=null;function Vi(e,t,i){I(ac,t._currentValue),t._currentValue=i}function Ci(e){e._currentValue=ac.current,$(ac)}function lc(e,t,i){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===i)break;e=e.return}}function oc(e,t,i,a){var m=e.child;for(m!==null&&(m.return=e);m!==null;){var w=m.dependencies;if(w!==null){var O=m.child;w=w.firstContext;e:for(;w!==null;){var F=w;w=m;for(var J=0;J<t.length;J++)if(F.context===t[J]){w.lanes|=i,F=w.alternate,F!==null&&(F.lanes|=i),lc(w.return,i,e),a||(O=null);break e}w=F.next}}else if(m.tag===18){if(O=m.return,O===null)throw Error(o(341));O.lanes|=i,w=O.alternate,w!==null&&(w.lanes|=i),lc(O,i,e),O=null}else O=m.child;if(O!==null)O.return=m;else for(O=m;O!==null;){if(O===e){O=null;break}if(m=O.sibling,m!==null){m.return=O.return,O=m;break}O=O.return}m=O}}function hs(e,t,i,a){e=null;for(var m=t,w=!1;m!==null;){if(!w){if((m.flags&524288)!==0)w=!0;else if((m.flags&262144)!==0)break}if(m.tag===10){var O=m.alternate;if(O===null)throw Error(o(387));if(O=O.memoizedProps,O!==null){var F=m.type;xn(m.pendingProps.value,O.value)||(e!==null?e.push(F):e=[F])}}else if(m===Y.current){if(O=m.alternate,O===null)throw Error(o(387));O.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(e!==null?e.push(La):e=[La])}m=m.return}e!==null&&oc(t,e,i,a),t.flags|=262144}function vl(e){for(e=e.firstContext;e!==null;){if(!xn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ar(e){kr=e,bi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function qt(e){return Bf(kr,e)}function yl(e,t){return kr===null&&Ar(e),Bf(e,t)}function Bf(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},bi===null){if(e===null)throw Error(o(308));bi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else bi=bi.next=t;return i}var cy=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(i,a){e.push(a)}};this.abort=function(){t.aborted=!0,e.forEach(function(i){return i()})}},uy=n.unstable_scheduleCallback,hy=n.unstable_NormalPriority,At={$$typeof:y,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function cc(){return{controller:new cy,data:new Map,refCount:0}}function aa(e){e.refCount--,e.refCount===0&&uy(hy,function(){e.controller.abort()})}var la=null,uc=0,fs=0,ds=null;function fy(e,t){if(la===null){var i=la=[];uc=0,fs=du(),ds={status:"pending",value:void 0,then:function(a){i.push(a)}}}return uc++,t.then(jf,jf),t}function jf(){if(--uc===0&&la!==null){ds!==null&&(ds.status="fulfilled");var e=la;la=null,fs=0,ds=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function dy(e,t){var i=[],a={status:"pending",value:null,reason:null,then:function(m){i.push(m)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var m=0;m<i.length;m++)(0,i[m])(t)},function(m){for(a.status="rejected",a.reason=m,m=0;m<i.length;m++)(0,i[m])(void 0)}),a}var Nf=G.S;G.S=function(e,t){yp=et(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&fy(e,t),Nf!==null&&Nf(e,t)};var Tr=N(null);function hc(){var e=Tr.current;return e!==null?e:lt.pooledCache}function Sl(e,t){t===null?I(Tr,Tr.current):I(Tr,t.pool)}function Hf(){var e=hc();return e===null?null:{parent:At._currentValue,pool:e}}var ps=Error(o(460)),fc=Error(o(474)),bl=Error(o(542)),Cl={then:function(){}};function zf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function If(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(Yt,Yt),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Pf(e),e;default:if(typeof t.status=="string")t.then(Yt,Yt);else{if(e=lt,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var m=t;m.status="fulfilled",m.value=a}},function(a){if(t.status==="pending"){var m=t;m.status="rejected",m.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Pf(e),e}throw Dr=t,ps}}function Rr(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(Dr=i,ps):i}}var Dr=null;function Uf(){if(Dr===null)throw Error(o(459));var e=Dr;return Dr=null,e}function Pf(e){if(e===ps||e===bl)throw Error(o(483))}var ms=null,oa=0;function wl(e){var t=oa;return oa+=1,ms===null&&(ms=[]),If(ms,e,t)}function ca(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function xl(e,t){throw t.$$typeof===b?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Ff(e){function t(ie,ee){if(e){var le=ie.deletions;le===null?(ie.deletions=[ee],ie.flags|=16):le.push(ee)}}function i(ie,ee){if(!e)return null;for(;ee!==null;)t(ie,ee),ee=ee.sibling;return null}function a(ie){for(var ee=new Map;ie!==null;)ie.key!==null?ee.set(ie.key,ie):ee.set(ie.index,ie),ie=ie.sibling;return ee}function m(ie,ee){return ie=yi(ie,ee),ie.index=0,ie.sibling=null,ie}function w(ie,ee,le){return ie.index=le,e?(le=ie.alternate,le!==null?(le=le.index,le<ee?(ie.flags|=67108866,ee):le):(ie.flags|=67108866,ee)):(ie.flags|=1048576,ee)}function O(ie){return e&&ie.alternate===null&&(ie.flags|=67108866),ie}function F(ie,ee,le,me){return ee===null||ee.tag!==6?(ee=ec(le,ie.mode,me),ee.return=ie,ee):(ee=m(ee,le),ee.return=ie,ee)}function J(ie,ee,le,me){var Te=le.type;return Te===E?de(ie,ee,le.props.children,me,le.key):ee!==null&&(ee.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===k&&Rr(Te)===ee.type)?(ee=m(ee,le.props),ca(ee,le),ee.return=ie,ee):(ee=gl(le.type,le.key,le.props,null,ie.mode,me),ca(ee,le),ee.return=ie,ee)}function oe(ie,ee,le,me){return ee===null||ee.tag!==4||ee.stateNode.containerInfo!==le.containerInfo||ee.stateNode.implementation!==le.implementation?(ee=tc(le,ie.mode,me),ee.return=ie,ee):(ee=m(ee,le.children||[]),ee.return=ie,ee)}function de(ie,ee,le,me,Te){return ee===null||ee.tag!==7?(ee=xr(le,ie.mode,me,Te),ee.return=ie,ee):(ee=m(ee,le),ee.return=ie,ee)}function ge(ie,ee,le){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return ee=ec(""+ee,ie.mode,le),ee.return=ie,ee;if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case C:return le=gl(ee.type,ee.key,ee.props,null,ie.mode,le),ca(le,ee),le.return=ie,le;case T:return ee=tc(ee,ie.mode,le),ee.return=ie,ee;case k:return ee=Rr(ee),ge(ie,ee,le)}if(X(ee)||U(ee))return ee=xr(ee,ie.mode,le,null),ee.return=ie,ee;if(typeof ee.then=="function")return ge(ie,wl(ee),le);if(ee.$$typeof===y)return ge(ie,yl(ie,ee),le);xl(ie,ee)}return null}function ce(ie,ee,le,me){var Te=ee!==null?ee.key:null;if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return Te!==null?null:F(ie,ee,""+le,me);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case C:return le.key===Te?J(ie,ee,le,me):null;case T:return le.key===Te?oe(ie,ee,le,me):null;case k:return le=Rr(le),ce(ie,ee,le,me)}if(X(le)||U(le))return Te!==null?null:de(ie,ee,le,me,null);if(typeof le.then=="function")return ce(ie,ee,wl(le),me);if(le.$$typeof===y)return ce(ie,ee,yl(ie,le),me);xl(ie,le)}return null}function he(ie,ee,le,me,Te){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return ie=ie.get(le)||null,F(ee,ie,""+me,Te);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case C:return ie=ie.get(me.key===null?le:me.key)||null,J(ee,ie,me,Te);case T:return ie=ie.get(me.key===null?le:me.key)||null,oe(ee,ie,me,Te);case k:return me=Rr(me),he(ie,ee,le,me,Te)}if(X(me)||U(me))return ie=ie.get(le)||null,de(ee,ie,me,Te,null);if(typeof me.then=="function")return he(ie,ee,le,wl(me),Te);if(me.$$typeof===y)return he(ie,ee,le,yl(ee,me),Te);xl(ee,me)}return null}function we(ie,ee,le,me){for(var Te=null,Qe=null,Ee=ee,ze=ee=0,Ve=null;Ee!==null&&ze<le.length;ze++){Ee.index>ze?(Ve=Ee,Ee=null):Ve=Ee.sibling;var Je=ce(ie,Ee,le[ze],me);if(Je===null){Ee===null&&(Ee=Ve);break}e&&Ee&&Je.alternate===null&&t(ie,Ee),ee=w(Je,ee,ze),Qe===null?Te=Je:Qe.sibling=Je,Qe=Je,Ee=Ve}if(ze===le.length)return i(ie,Ee),We&&Si(ie,ze),Te;if(Ee===null){for(;ze<le.length;ze++)Ee=ge(ie,le[ze],me),Ee!==null&&(ee=w(Ee,ee,ze),Qe===null?Te=Ee:Qe.sibling=Ee,Qe=Ee);return We&&Si(ie,ze),Te}for(Ee=a(Ee);ze<le.length;ze++)Ve=he(Ee,ie,ze,le[ze],me),Ve!==null&&(e&&Ve.alternate!==null&&Ee.delete(Ve.key===null?ze:Ve.key),ee=w(Ve,ee,ze),Qe===null?Te=Ve:Qe.sibling=Ve,Qe=Ve);return e&&Ee.forEach(function(ur){return t(ie,ur)}),We&&Si(ie,ze),Te}function Oe(ie,ee,le,me){if(le==null)throw Error(o(151));for(var Te=null,Qe=null,Ee=ee,ze=ee=0,Ve=null,Je=le.next();Ee!==null&&!Je.done;ze++,Je=le.next()){Ee.index>ze?(Ve=Ee,Ee=null):Ve=Ee.sibling;var ur=ce(ie,Ee,Je.value,me);if(ur===null){Ee===null&&(Ee=Ve);break}e&&Ee&&ur.alternate===null&&t(ie,Ee),ee=w(ur,ee,ze),Qe===null?Te=ur:Qe.sibling=ur,Qe=ur,Ee=Ve}if(Je.done)return i(ie,Ee),We&&Si(ie,ze),Te;if(Ee===null){for(;!Je.done;ze++,Je=le.next())Je=ge(ie,Je.value,me),Je!==null&&(ee=w(Je,ee,ze),Qe===null?Te=Je:Qe.sibling=Je,Qe=Je);return We&&Si(ie,ze),Te}for(Ee=a(Ee);!Je.done;ze++,Je=le.next())Je=he(Ee,ie,ze,Je.value,me),Je!==null&&(e&&Je.alternate!==null&&Ee.delete(Je.key===null?ze:Je.key),ee=w(Je,ee,ze),Qe===null?Te=Je:Qe.sibling=Je,Qe=Je);return e&&Ee.forEach(function(x0){return t(ie,x0)}),We&&Si(ie,ze),Te}function st(ie,ee,le,me){if(typeof le=="object"&&le!==null&&le.type===E&&le.key===null&&(le=le.props.children),typeof le=="object"&&le!==null){switch(le.$$typeof){case C:e:{for(var Te=le.key;ee!==null;){if(ee.key===Te){if(Te=le.type,Te===E){if(ee.tag===7){i(ie,ee.sibling),me=m(ee,le.props.children),me.return=ie,ie=me;break e}}else if(ee.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===k&&Rr(Te)===ee.type){i(ie,ee.sibling),me=m(ee,le.props),ca(me,le),me.return=ie,ie=me;break e}i(ie,ee);break}else t(ie,ee);ee=ee.sibling}le.type===E?(me=xr(le.props.children,ie.mode,me,le.key),me.return=ie,ie=me):(me=gl(le.type,le.key,le.props,null,ie.mode,me),ca(me,le),me.return=ie,ie=me)}return O(ie);case T:e:{for(Te=le.key;ee!==null;){if(ee.key===Te)if(ee.tag===4&&ee.stateNode.containerInfo===le.containerInfo&&ee.stateNode.implementation===le.implementation){i(ie,ee.sibling),me=m(ee,le.children||[]),me.return=ie,ie=me;break e}else{i(ie,ee);break}else t(ie,ee);ee=ee.sibling}me=tc(le,ie.mode,me),me.return=ie,ie=me}return O(ie);case k:return le=Rr(le),st(ie,ee,le,me)}if(X(le))return we(ie,ee,le,me);if(U(le)){if(Te=U(le),typeof Te!="function")throw Error(o(150));return le=Te.call(le),Oe(ie,ee,le,me)}if(typeof le.then=="function")return st(ie,ee,wl(le),me);if(le.$$typeof===y)return st(ie,ee,yl(ie,le),me);xl(ie,le)}return typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint"?(le=""+le,ee!==null&&ee.tag===6?(i(ie,ee.sibling),me=m(ee,le),me.return=ie,ie=me):(i(ie,ee),me=ec(le,ie.mode,me),me.return=ie,ie=me),O(ie)):i(ie,ee)}return function(ie,ee,le,me){try{oa=0;var Te=st(ie,ee,le,me);return ms=null,Te}catch(Ee){if(Ee===ps||Ee===bl)throw Ee;var Qe=En(29,Ee,null,ie.mode);return Qe.lanes=me,Qe.return=ie,Qe}finally{}}}var Mr=Ff(!0),qf=Ff(!1),Wi=!1;function dc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function pc(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 Ki(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Yi(e,t,i){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(Ze&2)!==0){var m=a.pending;return m===null?t.next=t:(t.next=m.next,m.next=t),a.pending=t,t=ml(e),kf(e,null,i),t}return pl(e,a,t,i),ml(e)}function ua(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,i|=a,t.lanes=i,mi(e,i)}}function mc(e,t){var i=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,i===a)){var m=null,w=null;if(i=i.firstBaseUpdate,i!==null){do{var O={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};w===null?m=w=O:w=w.next=O,i=i.next}while(i!==null);w===null?m=w=t:w=w.next=t}else m=w=t;i={baseState:a.baseState,firstBaseUpdate:m,lastBaseUpdate:w,shared:a.shared,callbacks:a.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}var gc=!1;function ha(){if(gc){var e=ds;if(e!==null)throw e}}function fa(e,t,i,a){gc=!1;var m=e.updateQueue;Wi=!1;var w=m.firstBaseUpdate,O=m.lastBaseUpdate,F=m.shared.pending;if(F!==null){m.shared.pending=null;var J=F,oe=J.next;J.next=null,O===null?w=oe:O.next=oe,O=J;var de=e.alternate;de!==null&&(de=de.updateQueue,F=de.lastBaseUpdate,F!==O&&(F===null?de.firstBaseUpdate=oe:F.next=oe,de.lastBaseUpdate=J))}if(w!==null){var ge=m.baseState;O=0,de=oe=J=null,F=w;do{var ce=F.lane&-536870913,he=ce!==F.lane;if(he?(Ge&ce)===ce:(a&ce)===ce){ce!==0&&ce===fs&&(gc=!0),de!==null&&(de=de.next={lane:0,tag:F.tag,payload:F.payload,callback:null,next:null});e:{var we=e,Oe=F;ce=t;var st=i;switch(Oe.tag){case 1:if(we=Oe.payload,typeof we=="function"){ge=we.call(st,ge,ce);break e}ge=we;break e;case 3:we.flags=we.flags&-65537|128;case 0:if(we=Oe.payload,ce=typeof we=="function"?we.call(st,ge,ce):we,ce==null)break e;ge=u({},ge,ce);break e;case 2:Wi=!0}}ce=F.callback,ce!==null&&(e.flags|=64,he&&(e.flags|=8192),he=m.callbacks,he===null?m.callbacks=[ce]:he.push(ce))}else he={lane:ce,tag:F.tag,payload:F.payload,callback:F.callback,next:null},de===null?(oe=de=he,J=ge):de=de.next=he,O|=ce;if(F=F.next,F===null){if(F=m.shared.pending,F===null)break;he=F,F=he.next,he.next=null,m.lastBaseUpdate=he,m.shared.pending=null}}while(!0);de===null&&(J=ge),m.baseState=J,m.firstBaseUpdate=oe,m.lastBaseUpdate=de,w===null&&(m.shared.lanes=0),er|=O,e.lanes=O,e.memoizedState=ge}}function $f(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function Gf(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)$f(i[e],t)}var gs=N(null),El=N(0);function Vf(e,t){e=Mi,I(El,e),I(gs,t),Mi=e|t.baseLanes}function _c(){I(El,Mi),I(gs,gs.current)}function vc(){Mi=El.current,$(gs),$(El)}var kn=N(null),Fn=null;function Xi(e){var t=e.alternate;I(wt,wt.current&1),I(kn,e),Fn===null&&(t===null||gs.current!==null||t.memoizedState!==null)&&(Fn=e)}function yc(e){I(wt,wt.current),I(kn,e),Fn===null&&(Fn=e)}function Wf(e){e.tag===22?(I(wt,wt.current),I(kn,e),Fn===null&&(Fn=e)):Qi()}function Qi(){I(wt,wt.current),I(kn,kn.current)}function An(e){$(kn),Fn===e&&(Fn=null),$(wt)}var wt=N(0);function kl(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)||ku(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 wi=0,Ne=null,it=null,Tt=null,Al=!1,_s=!1,Lr=!1,Tl=0,da=0,vs=null,py=0;function yt(){throw Error(o(321))}function Sc(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!xn(e[i],t[i]))return!1;return!0}function bc(e,t,i,a,m,w){return wi=w,Ne=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,G.H=e===null||e.memoizedState===null?Dd:Nc,Lr=!1,w=i(a,m),Lr=!1,_s&&(w=Yf(t,i,a,m)),Kf(e),w}function Kf(e){G.H=ga;var t=it!==null&&it.next!==null;if(wi=0,Tt=it=Ne=null,Al=!1,da=0,vs=null,t)throw Error(o(300));e===null||Rt||(e=e.dependencies,e!==null&&vl(e)&&(Rt=!0))}function Yf(e,t,i,a){Ne=e;var m=0;do{if(_s&&(vs=null),da=0,_s=!1,25<=m)throw Error(o(301));if(m+=1,Tt=it=null,e.updateQueue!=null){var w=e.updateQueue;w.lastEffect=null,w.events=null,w.stores=null,w.memoCache!=null&&(w.memoCache.index=0)}G.H=Md,w=t(i,a)}while(_s);return w}function my(){var e=G.H,t=e.useState()[0];return t=typeof t.then=="function"?pa(t):t,e=e.useState()[0],(it!==null?it.memoizedState:null)!==e&&(Ne.flags|=1024),t}function Cc(){var e=Tl!==0;return Tl=0,e}function wc(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function xc(e){if(Al){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Al=!1}wi=0,Tt=it=Ne=null,_s=!1,da=Tl=0,vs=null}function nn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Tt===null?Ne.memoizedState=Tt=e:Tt=Tt.next=e,Tt}function xt(){if(it===null){var e=Ne.alternate;e=e!==null?e.memoizedState:null}else e=it.next;var t=Tt===null?Ne.memoizedState:Tt.next;if(t!==null)Tt=t,it=e;else{if(e===null)throw Ne.alternate===null?Error(o(467)):Error(o(310));it=e,e={memoizedState:it.memoizedState,baseState:it.baseState,baseQueue:it.baseQueue,queue:it.queue,next:null},Tt===null?Ne.memoizedState=Tt=e:Tt=Tt.next=e}return Tt}function Rl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function pa(e){var t=da;return da+=1,vs===null&&(vs=[]),e=If(vs,e,t),t=Ne,(Tt===null?t.memoizedState:Tt.next)===null&&(t=t.alternate,G.H=t===null||t.memoizedState===null?Dd:Nc),e}function Dl(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return pa(e);if(e.$$typeof===y)return qt(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 a=Ne.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(m){return m.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),i===null&&(i=Rl(),Ne.updateQueue=i),i.memoCache=t,i=t.data[t.index],i===void 0)for(i=t.data[t.index]=Array(e),a=0;a<e;a++)i[a]=B;return t.index++,i}function xi(e,t){return typeof t=="function"?t(e):t}function Ml(e){var t=xt();return kc(t,it,e)}function kc(e,t,i){var a=e.queue;if(a===null)throw Error(o(311));a.lastRenderedReducer=i;var m=e.baseQueue,w=a.pending;if(w!==null){if(m!==null){var O=m.next;m.next=w.next,w.next=O}t.baseQueue=m=w,a.pending=null}if(w=e.baseState,m===null)e.memoizedState=w;else{t=m.next;var F=O=null,J=null,oe=t,de=!1;do{var ge=oe.lane&-536870913;if(ge!==oe.lane?(Ge&ge)===ge:(wi&ge)===ge){var ce=oe.revertLane;if(ce===0)J!==null&&(J=J.next={lane:0,revertLane:0,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null}),ge===fs&&(de=!0);else if((wi&ce)===ce){oe=oe.next,ce===fs&&(de=!0);continue}else ge={lane:0,revertLane:oe.revertLane,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},J===null?(F=J=ge,O=w):J=J.next=ge,Ne.lanes|=ce,er|=ce;ge=oe.action,Lr&&i(w,ge),w=oe.hasEagerState?oe.eagerState:i(w,ge)}else ce={lane:ge,revertLane:oe.revertLane,gesture:oe.gesture,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},J===null?(F=J=ce,O=w):J=J.next=ce,Ne.lanes|=ge,er|=ge;oe=oe.next}while(oe!==null&&oe!==t);if(J===null?O=w:J.next=F,!xn(w,e.memoizedState)&&(Rt=!0,de&&(i=ds,i!==null)))throw i;e.memoizedState=w,e.baseState=O,e.baseQueue=J,a.lastRenderedState=w}return m===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function Ac(e){var t=xt(),i=t.queue;if(i===null)throw Error(o(311));i.lastRenderedReducer=e;var a=i.dispatch,m=i.pending,w=t.memoizedState;if(m!==null){i.pending=null;var O=m=m.next;do w=e(w,O.action),O=O.next;while(O!==m);xn(w,t.memoizedState)||(Rt=!0),t.memoizedState=w,t.baseQueue===null&&(t.baseState=w),i.lastRenderedState=w}return[w,a]}function Xf(e,t,i){var a=Ne,m=xt(),w=We;if(w){if(i===void 0)throw Error(o(407));i=i()}else i=t();var O=!xn((it||m).memoizedState,i);if(O&&(m.memoizedState=i,Rt=!0),m=m.queue,Dc(Zf.bind(null,a,m,e),[e]),m.getSnapshot!==t||O||Tt!==null&&Tt.memoizedState.tag&1){if(a.flags|=2048,ys(9,{destroy:void 0},Jf.bind(null,a,m,i,t),null),lt===null)throw Error(o(349));w||(wi&127)!==0||Qf(a,t,i)}return i}function Qf(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=Ne.updateQueue,t===null?(t=Rl(),Ne.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function Jf(e,t,i,a){t.value=i,t.getSnapshot=a,ed(t)&&td(e)}function Zf(e,t,i){return i(function(){ed(t)&&td(e)})}function ed(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!xn(e,i)}catch{return!0}}function td(e){var t=wr(e,2);t!==null&&gn(t,e,2)}function Tc(e){var t=nn();if(typeof e=="function"){var i=e;if(e=i(),Lr){Ot(!0);try{i()}finally{Ot(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xi,lastRenderedState:e},t}function nd(e,t,i,a){return e.baseState=i,kc(e,it,typeof a=="function"?a:xi)}function gy(e,t,i,a,m){if(Bl(e))throw Error(o(485));if(e=t.action,e!==null){var w={payload:m,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(O){w.listeners.push(O)}};G.T!==null?i(!0):w.isTransition=!1,a(w),i=t.pending,i===null?(w.next=t.pending=w,id(t,w)):(w.next=i.next,t.pending=i.next=w)}}function id(e,t){var i=t.action,a=t.payload,m=e.state;if(t.isTransition){var w=G.T,O={};G.T=O;try{var F=i(m,a),J=G.S;J!==null&&J(O,F),rd(e,t,F)}catch(oe){Rc(e,t,oe)}finally{w!==null&&O.types!==null&&(w.types=O.types),G.T=w}}else try{w=i(m,a),rd(e,t,w)}catch(oe){Rc(e,t,oe)}}function rd(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(a){sd(e,t,a)},function(a){return Rc(e,t,a)}):sd(e,t,i)}function sd(e,t,i){t.status="fulfilled",t.value=i,ad(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,id(e,i)))}function Rc(e,t,i){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=i,ad(t),t=t.next;while(t!==a)}e.action=null}function ad(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ld(e,t){return t}function od(e,t){if(We){var i=lt.formState;if(i!==null){e:{var a=Ne;if(We){if(ft){t:{for(var m=ft,w=Pn;m.nodeType!==8;){if(!w){m=null;break t}if(m=qn(m.nextSibling),m===null){m=null;break t}}w=m.data,m=w==="F!"||w==="F"?m:null}if(m){ft=qn(m.nextSibling),a=m.data==="F!";break e}}Gi(a)}a=!1}a&&(t=i[0])}}return i=nn(),i.memoizedState=i.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ld,lastRenderedState:t},i.queue=a,i=Ad.bind(null,Ne,a),a.dispatch=i,a=Tc(!1),w=jc.bind(null,Ne,!1,a.queue),a=nn(),m={state:t,dispatch:null,action:e,pending:null},a.queue=m,i=gy.bind(null,Ne,m,w,i),m.dispatch=i,a.memoizedState=e,[t,i,!1]}function cd(e){var t=xt();return ud(t,it,e)}function ud(e,t,i){if(t=kc(e,t,ld)[0],e=Ml(xi)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=pa(t)}catch(O){throw O===ps?bl:O}else a=t;t=xt();var m=t.queue,w=m.dispatch;return i!==t.memoizedState&&(Ne.flags|=2048,ys(9,{destroy:void 0},_y.bind(null,m,i),null)),[a,w,e]}function _y(e,t){e.action=t}function hd(e){var t=xt(),i=it;if(i!==null)return ud(t,i,e);xt(),t=t.memoizedState,i=xt();var a=i.queue.dispatch;return i.memoizedState=e,[t,a,!1]}function ys(e,t,i,a){return e={tag:e,create:i,deps:a,inst:t,next:null},t=Ne.updateQueue,t===null&&(t=Rl(),Ne.updateQueue=t),i=t.lastEffect,i===null?t.lastEffect=e.next=e:(a=i.next,i.next=e,e.next=a,t.lastEffect=e),e}function fd(){return xt().memoizedState}function Ll(e,t,i,a){var m=nn();Ne.flags|=e,m.memoizedState=ys(1|t,{destroy:void 0},i,a===void 0?null:a)}function Ol(e,t,i,a){var m=xt();a=a===void 0?null:a;var w=m.memoizedState.inst;it!==null&&a!==null&&Sc(a,it.memoizedState.deps)?m.memoizedState=ys(t,w,i,a):(Ne.flags|=e,m.memoizedState=ys(1|t,w,i,a))}function dd(e,t){Ll(8390656,8,e,t)}function Dc(e,t){Ol(2048,8,e,t)}function vy(e){Ne.flags|=4;var t=Ne.updateQueue;if(t===null)t=Rl(),Ne.updateQueue=t,t.events=[e];else{var i=t.events;i===null?t.events=[e]:i.push(e)}}function pd(e){var t=xt().memoizedState;return vy({ref:t,nextImpl:e}),function(){if((Ze&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function md(e,t){return Ol(4,2,e,t)}function gd(e,t){return Ol(4,4,e,t)}function _d(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 vd(e,t,i){i=i!=null?i.concat([e]):null,Ol(4,4,_d.bind(null,t,e),i)}function Mc(){}function yd(e,t){var i=xt();t=t===void 0?null:t;var a=i.memoizedState;return t!==null&&Sc(t,a[1])?a[0]:(i.memoizedState=[e,t],e)}function Sd(e,t){var i=xt();t=t===void 0?null:t;var a=i.memoizedState;if(t!==null&&Sc(t,a[1]))return a[0];if(a=e(),Lr){Ot(!0);try{e()}finally{Ot(!1)}}return i.memoizedState=[a,t],a}function Lc(e,t,i){return i===void 0||(wi&1073741824)!==0&&(Ge&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=bp(),Ne.lanes|=e,er|=e,i)}function bd(e,t,i,a){return xn(i,t)?i:gs.current!==null?(e=Lc(e,i,a),xn(e,t)||(Rt=!0),e):(wi&42)===0||(wi&1073741824)!==0&&(Ge&261930)===0?(Rt=!0,e.memoizedState=i):(e=bp(),Ne.lanes|=e,er|=e,t)}function Cd(e,t,i,a,m){var w=W.p;W.p=w!==0&&8>w?w:8;var O=G.T,F={};G.T=F,jc(e,!1,t,i);try{var J=m(),oe=G.S;if(oe!==null&&oe(F,J),J!==null&&typeof J=="object"&&typeof J.then=="function"){var de=dy(J,a);ma(e,t,de,Dn(e))}else ma(e,t,a,Dn(e))}catch(ge){ma(e,t,{then:function(){},status:"rejected",reason:ge},Dn())}finally{W.p=w,O!==null&&F.types!==null&&(O.types=F.types),G.T=O}}function yy(){}function Oc(e,t,i,a){if(e.tag!==5)throw Error(o(476));var m=wd(e).queue;Cd(e,m,t,te,i===null?yy:function(){return xd(e),i(a)})}function wd(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:te,baseState:te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xi,lastRenderedState:te},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xi,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function xd(e){var t=wd(e);t.next===null&&(t=e.alternate.memoizedState),ma(e,t.next.queue,{},Dn())}function Bc(){return qt(La)}function Ed(){return xt().memoizedState}function kd(){return xt().memoizedState}function Sy(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=Dn();e=Ki(i);var a=Yi(t,e,i);a!==null&&(gn(a,t,i),ua(a,t,i)),t={cache:cc()},e.payload=t;return}t=t.return}}function by(e,t,i){var a=Dn();i={lane:a,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Bl(e)?Td(t,i):(i=Jo(e,t,i,a),i!==null&&(gn(i,e,a),Rd(i,t,a)))}function Ad(e,t,i){var a=Dn();ma(e,t,i,a)}function ma(e,t,i,a){var m={lane:a,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(Bl(e))Td(t,m);else{var w=e.alternate;if(e.lanes===0&&(w===null||w.lanes===0)&&(w=t.lastRenderedReducer,w!==null))try{var O=t.lastRenderedState,F=w(O,i);if(m.hasEagerState=!0,m.eagerState=F,xn(F,O))return pl(e,t,m,0),lt===null&&dl(),!1}catch{}finally{}if(i=Jo(e,t,m,a),i!==null)return gn(i,e,a),Rd(i,t,a),!0}return!1}function jc(e,t,i,a){if(a={lane:2,revertLane:du(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Bl(e)){if(t)throw Error(o(479))}else t=Jo(e,i,a,2),t!==null&&gn(t,e,2)}function Bl(e){var t=e.alternate;return e===Ne||t!==null&&t===Ne}function Td(e,t){_s=Al=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function Rd(e,t,i){if((i&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,i|=a,t.lanes=i,mi(e,i)}}var ga={readContext:qt,use:Dl,useCallback:yt,useContext:yt,useEffect:yt,useImperativeHandle:yt,useLayoutEffect:yt,useInsertionEffect:yt,useMemo:yt,useReducer:yt,useRef:yt,useState:yt,useDebugValue:yt,useDeferredValue:yt,useTransition:yt,useSyncExternalStore:yt,useId:yt,useHostTransitionStatus:yt,useFormState:yt,useActionState:yt,useOptimistic:yt,useMemoCache:yt,useCacheRefresh:yt};ga.useEffectEvent=yt;var Dd={readContext:qt,use:Dl,useCallback:function(e,t){return nn().memoizedState=[e,t===void 0?null:t],e},useContext:qt,useEffect:dd,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,Ll(4194308,4,_d.bind(null,t,e),i)},useLayoutEffect:function(e,t){return Ll(4194308,4,e,t)},useInsertionEffect:function(e,t){Ll(4,2,e,t)},useMemo:function(e,t){var i=nn();t=t===void 0?null:t;var a=e();if(Lr){Ot(!0);try{e()}finally{Ot(!1)}}return i.memoizedState=[a,t],a},useReducer:function(e,t,i){var a=nn();if(i!==void 0){var m=i(t);if(Lr){Ot(!0);try{i(t)}finally{Ot(!1)}}}else m=t;return a.memoizedState=a.baseState=m,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:m},a.queue=e,e=e.dispatch=by.bind(null,Ne,e),[a.memoizedState,e]},useRef:function(e){var t=nn();return e={current:e},t.memoizedState=e},useState:function(e){e=Tc(e);var t=e.queue,i=Ad.bind(null,Ne,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:Mc,useDeferredValue:function(e,t){var i=nn();return Lc(i,e,t)},useTransition:function(){var e=Tc(!1);return e=Cd.bind(null,Ne,e.queue,!0,!1),nn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var a=Ne,m=nn();if(We){if(i===void 0)throw Error(o(407));i=i()}else{if(i=t(),lt===null)throw Error(o(349));(Ge&127)!==0||Qf(a,t,i)}m.memoizedState=i;var w={value:i,getSnapshot:t};return m.queue=w,dd(Zf.bind(null,a,w,e),[e]),a.flags|=2048,ys(9,{destroy:void 0},Jf.bind(null,a,w,i,t),null),i},useId:function(){var e=nn(),t=lt.identifierPrefix;if(We){var i=ci,a=oi;i=(a&~(1<<32-Xe(a)-1)).toString(32)+i,t="_"+t+"R_"+i,i=Tl++,0<i&&(t+="H"+i.toString(32)),t+="_"}else i=py++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Bc,useFormState:od,useActionState:od,useOptimistic:function(e){var t=nn();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=jc.bind(null,Ne,!0,i),i.dispatch=t,[e,t]},useMemoCache:Ec,useCacheRefresh:function(){return nn().memoizedState=Sy.bind(null,Ne)},useEffectEvent:function(e){var t=nn(),i={impl:e};return t.memoizedState=i,function(){if((Ze&2)!==0)throw Error(o(440));return i.impl.apply(void 0,arguments)}}},Nc={readContext:qt,use:Dl,useCallback:yd,useContext:qt,useEffect:Dc,useImperativeHandle:vd,useInsertionEffect:md,useLayoutEffect:gd,useMemo:Sd,useReducer:Ml,useRef:fd,useState:function(){return Ml(xi)},useDebugValue:Mc,useDeferredValue:function(e,t){var i=xt();return bd(i,it.memoizedState,e,t)},useTransition:function(){var e=Ml(xi)[0],t=xt().memoizedState;return[typeof e=="boolean"?e:pa(e),t]},useSyncExternalStore:Xf,useId:Ed,useHostTransitionStatus:Bc,useFormState:cd,useActionState:cd,useOptimistic:function(e,t){var i=xt();return nd(i,it,e,t)},useMemoCache:Ec,useCacheRefresh:kd};Nc.useEffectEvent=pd;var Md={readContext:qt,use:Dl,useCallback:yd,useContext:qt,useEffect:Dc,useImperativeHandle:vd,useInsertionEffect:md,useLayoutEffect:gd,useMemo:Sd,useReducer:Ac,useRef:fd,useState:function(){return Ac(xi)},useDebugValue:Mc,useDeferredValue:function(e,t){var i=xt();return it===null?Lc(i,e,t):bd(i,it.memoizedState,e,t)},useTransition:function(){var e=Ac(xi)[0],t=xt().memoizedState;return[typeof e=="boolean"?e:pa(e),t]},useSyncExternalStore:Xf,useId:Ed,useHostTransitionStatus:Bc,useFormState:hd,useActionState:hd,useOptimistic:function(e,t){var i=xt();return it!==null?nd(i,it,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:Ec,useCacheRefresh:kd};Md.useEffectEvent=pd;function Hc(e,t,i,a){t=e.memoizedState,i=i(a,t),i=i==null?t:u({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var zc={enqueueSetState:function(e,t,i){e=e._reactInternals;var a=Dn(),m=Ki(a);m.payload=t,i!=null&&(m.callback=i),t=Yi(e,m,a),t!==null&&(gn(t,e,a),ua(t,e,a))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var a=Dn(),m=Ki(a);m.tag=1,m.payload=t,i!=null&&(m.callback=i),t=Yi(e,m,a),t!==null&&(gn(t,e,a),ua(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=Dn(),a=Ki(i);a.tag=2,t!=null&&(a.callback=t),t=Yi(e,a,i),t!==null&&(gn(t,e,i),ua(t,e,i))}};function Ld(e,t,i,a,m,w,O){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,w,O):t.prototype&&t.prototype.isPureReactComponent?!na(i,a)||!na(m,w):!0}function Od(e,t,i,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,a),t.state!==e&&zc.enqueueReplaceState(t,t.state,null)}function Or(e,t){var i=t;if("ref"in t){i={};for(var a in t)a!=="ref"&&(i[a]=t[a])}if(e=e.defaultProps){i===t&&(i=u({},i));for(var m in e)i[m]===void 0&&(i[m]=e[m])}return i}function Bd(e){fl(e)}function jd(e){console.error(e)}function Nd(e){fl(e)}function jl(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function Hd(e,t,i){try{var a=e.onCaughtError;a(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(m){setTimeout(function(){throw m})}}function Ic(e,t,i){return i=Ki(i),i.tag=3,i.payload={element:null},i.callback=function(){jl(e,t)},i}function zd(e){return e=Ki(e),e.tag=3,e}function Id(e,t,i,a){var m=i.type.getDerivedStateFromError;if(typeof m=="function"){var w=a.value;e.payload=function(){return m(w)},e.callback=function(){Hd(t,i,a)}}var O=i.stateNode;O!==null&&typeof O.componentDidCatch=="function"&&(e.callback=function(){Hd(t,i,a),typeof m!="function"&&(tr===null?tr=new Set([this]):tr.add(this));var F=a.stack;this.componentDidCatch(a.value,{componentStack:F!==null?F:""})})}function Cy(e,t,i,a,m){if(i.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=i.alternate,t!==null&&hs(t,i,m,!0),i=kn.current,i!==null){switch(i.tag){case 31:case 13:return Fn===null?Wl():i.alternate===null&&St===0&&(St=3),i.flags&=-257,i.flags|=65536,i.lanes=m,a===Cl?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([a]):t.add(a),uu(e,a,m)),!1;case 22:return i.flags|=65536,a===Cl?i.flags|=16384:(t=i.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},i.updateQueue=t):(i=t.retryQueue,i===null?t.retryQueue=new Set([a]):i.add(a)),uu(e,a,m)),!1}throw Error(o(435,i.tag))}return uu(e,a,m),Wl(),!1}if(We)return t=kn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=m,a!==rc&&(e=Error(o(422),{cause:a}),sa(zn(e,i)))):(a!==rc&&(t=Error(o(423),{cause:a}),sa(zn(t,i))),e=e.current.alternate,e.flags|=65536,m&=-m,e.lanes|=m,a=zn(a,i),m=Ic(e.stateNode,a,m),mc(e,m),St!==4&&(St=2)),!1;var w=Error(o(520),{cause:a});if(w=zn(w,i),xa===null?xa=[w]:xa.push(w),St!==4&&(St=2),t===null)return!0;a=zn(a,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=m&-m,i.lanes|=e,e=Ic(i.stateNode,a,e),mc(i,e),!1;case 1:if(t=i.type,w=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(tr===null||!tr.has(w))))return i.flags|=65536,m&=-m,i.lanes|=m,m=zd(m),Id(m,e,i,a),mc(i,m),!1}i=i.return}while(i!==null);return!1}var Uc=Error(o(461)),Rt=!1;function $t(e,t,i,a){t.child=e===null?qf(t,null,i,a):Mr(t,e.child,i,a)}function Ud(e,t,i,a,m){i=i.render;var w=t.ref;if("ref"in a){var O={};for(var F in a)F!=="ref"&&(O[F]=a[F])}else O=a;return Ar(t),a=bc(e,t,i,O,w,m),F=Cc(),e!==null&&!Rt?(wc(e,t,m),Ei(e,t,m)):(We&&F&&nc(t),t.flags|=1,$t(e,t,a,m),t.child)}function Pd(e,t,i,a,m){if(e===null){var w=i.type;return typeof w=="function"&&!Zo(w)&&w.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=w,Fd(e,t,w,a,m)):(e=gl(i.type,null,a,t,t.mode,m),e.ref=t.ref,e.return=t,t.child=e)}if(w=e.child,!Kc(e,m)){var O=w.memoizedProps;if(i=i.compare,i=i!==null?i:na,i(O,a)&&e.ref===t.ref)return Ei(e,t,m)}return t.flags|=1,e=yi(w,a),e.ref=t.ref,e.return=t,t.child=e}function Fd(e,t,i,a,m){if(e!==null){var w=e.memoizedProps;if(na(w,a)&&e.ref===t.ref)if(Rt=!1,t.pendingProps=a=w,Kc(e,m))(e.flags&131072)!==0&&(Rt=!0);else return t.lanes=e.lanes,Ei(e,t,m)}return Pc(e,t,i,a,m)}function qd(e,t,i,a){var m=a.children,w=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((t.flags&128)!==0){if(w=w!==null?w.baseLanes|i:i,e!==null){for(a=t.child=e.child,m=0;a!==null;)m=m|a.lanes|a.childLanes,a=a.sibling;a=m&~w}else a=0,t.child=null;return $d(e,t,w,i,a)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Sl(t,w!==null?w.cachePool:null),w!==null?Vf(t,w):_c(),Wf(t);else return a=t.lanes=536870912,$d(e,t,w!==null?w.baseLanes|i:i,i,a)}else w!==null?(Sl(t,w.cachePool),Vf(t,w),Qi(),t.memoizedState=null):(e!==null&&Sl(t,null),_c(),Qi());return $t(e,t,m,i),t.child}function _a(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function $d(e,t,i,a,m){var w=hc();return w=w===null?null:{parent:At._currentValue,pool:w},t.memoizedState={baseLanes:i,cachePool:w},e!==null&&Sl(t,null),_c(),Wf(t),e!==null&&hs(e,t,a,!0),t.childLanes=m,null}function Nl(e,t){return t=zl({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Gd(e,t,i){return Mr(t,e.child,null,i),e=Nl(t,t.pendingProps),e.flags|=2,An(t),t.memoizedState=null,e}function wy(e,t,i){var a=t.pendingProps,m=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(We){if(a.mode==="hidden")return e=Nl(t,a),t.lanes=536870912,_a(null,e);if(yc(t),(e=ft)?(e=im(e,Pn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:qi!==null?{id:oi,overflow:ci}:null,retryLane:536870912,hydrationErrors:null},i=Tf(e),i.return=t,t.child=i,Ft=t,ft=null)):e=null,e===null)throw Gi(t);return t.lanes=536870912,null}return Nl(t,a)}var w=e.memoizedState;if(w!==null){var O=w.dehydrated;if(yc(t),m)if(t.flags&256)t.flags&=-257,t=Gd(e,t,i);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(Rt||hs(e,t,i,!1),m=(i&e.childLanes)!==0,Rt||m){if(a=lt,a!==null&&(O=Fr(a,i),O!==0&&O!==w.retryLane))throw w.retryLane=O,wr(e,O),gn(a,e,O),Uc;Wl(),t=Gd(e,t,i)}else e=w.treeContext,ft=qn(O.nextSibling),Ft=t,We=!0,$i=null,Pn=!1,e!==null&&Mf(t,e),t=Nl(t,a),t.flags|=4096;return t}return e=yi(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Hl(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 Pc(e,t,i,a,m){return Ar(t),i=bc(e,t,i,a,void 0,m),a=Cc(),e!==null&&!Rt?(wc(e,t,m),Ei(e,t,m)):(We&&a&&nc(t),t.flags|=1,$t(e,t,i,m),t.child)}function Vd(e,t,i,a,m,w){return Ar(t),t.updateQueue=null,i=Yf(t,a,i,m),Kf(e),a=Cc(),e!==null&&!Rt?(wc(e,t,w),Ei(e,t,w)):(We&&a&&nc(t),t.flags|=1,$t(e,t,i,w),t.child)}function Wd(e,t,i,a,m){if(Ar(t),t.stateNode===null){var w=ls,O=i.contextType;typeof O=="object"&&O!==null&&(w=qt(O)),w=new i(a,w),t.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=zc,t.stateNode=w,w._reactInternals=t,w=t.stateNode,w.props=a,w.state=t.memoizedState,w.refs={},dc(t),O=i.contextType,w.context=typeof O=="object"&&O!==null?qt(O):ls,w.state=t.memoizedState,O=i.getDerivedStateFromProps,typeof O=="function"&&(Hc(t,i,O,a),w.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(O=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),O!==w.state&&zc.enqueueReplaceState(w,w.state,null),fa(t,a,w,m),ha(),w.state=t.memoizedState),typeof w.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){w=t.stateNode;var F=t.memoizedProps,J=Or(i,F);w.props=J;var oe=w.context,de=i.contextType;O=ls,typeof de=="object"&&de!==null&&(O=qt(de));var ge=i.getDerivedStateFromProps;de=typeof ge=="function"||typeof w.getSnapshotBeforeUpdate=="function",F=t.pendingProps!==F,de||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(F||oe!==O)&&Od(t,w,a,O),Wi=!1;var ce=t.memoizedState;w.state=ce,fa(t,a,w,m),ha(),oe=t.memoizedState,F||ce!==oe||Wi?(typeof ge=="function"&&(Hc(t,i,ge,a),oe=t.memoizedState),(J=Wi||Ld(t,i,J,a,ce,oe,O))?(de||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(t.flags|=4194308)):(typeof w.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=oe),w.props=a,w.state=oe,w.context=O,a=J):(typeof w.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{w=t.stateNode,pc(e,t),O=t.memoizedProps,de=Or(i,O),w.props=de,ge=t.pendingProps,ce=w.context,oe=i.contextType,J=ls,typeof oe=="object"&&oe!==null&&(J=qt(oe)),F=i.getDerivedStateFromProps,(oe=typeof F=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(O!==ge||ce!==J)&&Od(t,w,a,J),Wi=!1,ce=t.memoizedState,w.state=ce,fa(t,a,w,m),ha();var he=t.memoizedState;O!==ge||ce!==he||Wi||e!==null&&e.dependencies!==null&&vl(e.dependencies)?(typeof F=="function"&&(Hc(t,i,F,a),he=t.memoizedState),(de=Wi||Ld(t,i,de,a,ce,he,J)||e!==null&&e.dependencies!==null&&vl(e.dependencies))?(oe||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(a,he,J),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(a,he,J)),typeof w.componentDidUpdate=="function"&&(t.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof w.componentDidUpdate!="function"||O===e.memoizedProps&&ce===e.memoizedState||(t.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||O===e.memoizedProps&&ce===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=he),w.props=a,w.state=he,w.context=J,a=de):(typeof w.componentDidUpdate!="function"||O===e.memoizedProps&&ce===e.memoizedState||(t.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||O===e.memoizedProps&&ce===e.memoizedState||(t.flags|=1024),a=!1)}return w=a,Hl(e,t),a=(t.flags&128)!==0,w||a?(w=t.stateNode,i=a&&typeof i.getDerivedStateFromError!="function"?null:w.render(),t.flags|=1,e!==null&&a?(t.child=Mr(t,e.child,null,m),t.child=Mr(t,null,i,m)):$t(e,t,i,m),t.memoizedState=w.state,e=t.child):e=Ei(e,t,m),e}function Kd(e,t,i,a){return Er(),t.flags|=256,$t(e,t,i,a),t.child}var Fc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function qc(e){return{baseLanes:e,cachePool:Hf()}}function $c(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=Rn),e}function Yd(e,t,i){var a=t.pendingProps,m=!1,w=(t.flags&128)!==0,O;if((O=w)||(O=e!==null&&e.memoizedState===null?!1:(wt.current&2)!==0),O&&(m=!0,t.flags&=-129),O=(t.flags&32)!==0,t.flags&=-33,e===null){if(We){if(m?Xi(t):Qi(),(e=ft)?(e=im(e,Pn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:qi!==null?{id:oi,overflow:ci}:null,retryLane:536870912,hydrationErrors:null},i=Tf(e),i.return=t,t.child=i,Ft=t,ft=null)):e=null,e===null)throw Gi(t);return ku(e)?t.lanes=32:t.lanes=536870912,null}var F=a.children;return a=a.fallback,m?(Qi(),m=t.mode,F=zl({mode:"hidden",children:F},m),a=xr(a,m,i,null),F.return=t,a.return=t,F.sibling=a,t.child=F,a=t.child,a.memoizedState=qc(i),a.childLanes=$c(e,O,i),t.memoizedState=Fc,_a(null,a)):(Xi(t),Gc(t,F))}var J=e.memoizedState;if(J!==null&&(F=J.dehydrated,F!==null)){if(w)t.flags&256?(Xi(t),t.flags&=-257,t=Vc(e,t,i)):t.memoizedState!==null?(Qi(),t.child=e.child,t.flags|=128,t=null):(Qi(),F=a.fallback,m=t.mode,a=zl({mode:"visible",children:a.children},m),F=xr(F,m,i,null),F.flags|=2,a.return=t,F.return=t,a.sibling=F,t.child=a,Mr(t,e.child,null,i),a=t.child,a.memoizedState=qc(i),a.childLanes=$c(e,O,i),t.memoizedState=Fc,t=_a(null,a));else if(Xi(t),ku(F)){if(O=F.nextSibling&&F.nextSibling.dataset,O)var oe=O.dgst;O=oe,a=Error(o(419)),a.stack="",a.digest=O,sa({value:a,source:null,stack:null}),t=Vc(e,t,i)}else if(Rt||hs(e,t,i,!1),O=(i&e.childLanes)!==0,Rt||O){if(O=lt,O!==null&&(a=Fr(O,i),a!==0&&a!==J.retryLane))throw J.retryLane=a,wr(e,a),gn(O,e,a),Uc;Eu(F)||Wl(),t=Vc(e,t,i)}else Eu(F)?(t.flags|=192,t.child=e.child,t=null):(e=J.treeContext,ft=qn(F.nextSibling),Ft=t,We=!0,$i=null,Pn=!1,e!==null&&Mf(t,e),t=Gc(t,a.children),t.flags|=4096);return t}return m?(Qi(),F=a.fallback,m=t.mode,J=e.child,oe=J.sibling,a=yi(J,{mode:"hidden",children:a.children}),a.subtreeFlags=J.subtreeFlags&65011712,oe!==null?F=yi(oe,F):(F=xr(F,m,i,null),F.flags|=2),F.return=t,a.return=t,a.sibling=F,t.child=a,_a(null,a),a=t.child,F=e.child.memoizedState,F===null?F=qc(i):(m=F.cachePool,m!==null?(J=At._currentValue,m=m.parent!==J?{parent:J,pool:J}:m):m=Hf(),F={baseLanes:F.baseLanes|i,cachePool:m}),a.memoizedState=F,a.childLanes=$c(e,O,i),t.memoizedState=Fc,_a(e.child,a)):(Xi(t),i=e.child,e=i.sibling,i=yi(i,{mode:"visible",children:a.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 Gc(e,t){return t=zl({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function zl(e,t){return e=En(22,e,null,t),e.lanes=0,e}function Vc(e,t,i){return Mr(t,e.child,null,i),e=Gc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Xd(e,t,i){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),lc(e.return,t,i)}function Wc(e,t,i,a,m,w){var O=e.memoizedState;O===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:i,tailMode:m,treeForkCount:w}:(O.isBackwards=t,O.rendering=null,O.renderingStartTime=0,O.last=a,O.tail=i,O.tailMode=m,O.treeForkCount=w)}function Qd(e,t,i){var a=t.pendingProps,m=a.revealOrder,w=a.tail;a=a.children;var O=wt.current,F=(O&2)!==0;if(F?(O=O&1|2,t.flags|=128):O&=1,I(wt,O),$t(e,t,a,i),a=We?ra:0,!F&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Xd(e,i,t);else if(e.tag===19)Xd(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(m){case"forwards":for(i=t.child,m=null;i!==null;)e=i.alternate,e!==null&&kl(e)===null&&(m=i),i=i.sibling;i=m,i===null?(m=t.child,t.child=null):(m=i.sibling,i.sibling=null),Wc(t,!1,m,i,w,a);break;case"backwards":case"unstable_legacy-backwards":for(i=null,m=t.child,t.child=null;m!==null;){if(e=m.alternate,e!==null&&kl(e)===null){t.child=m;break}e=m.sibling,m.sibling=i,i=m,m=e}Wc(t,!0,i,null,w,a);break;case"together":Wc(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function Ei(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),er|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(hs(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=yi(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=yi(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function Kc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&vl(e)))}function xy(e,t,i){switch(t.tag){case 3:q(t,t.stateNode.containerInfo),Vi(t,At,e.memoizedState.cache),Er();break;case 27:case 5:Q(t);break;case 4:q(t,t.stateNode.containerInfo);break;case 10:Vi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,yc(t),null;break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(Xi(t),t.flags|=128,null):(i&t.child.childLanes)!==0?Yd(e,t,i):(Xi(t),e=Ei(e,t,i),e!==null?e.sibling:null);Xi(t);break;case 19:var m=(e.flags&128)!==0;if(a=(i&t.childLanes)!==0,a||(hs(e,t,i,!1),a=(i&t.childLanes)!==0),m){if(a)return Qd(e,t,i);t.flags|=128}if(m=t.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),I(wt,wt.current),a)break;return null;case 22:return t.lanes=0,qd(e,t,i,t.pendingProps);case 24:Vi(t,At,e.memoizedState.cache)}return Ei(e,t,i)}function Jd(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)Rt=!0;else{if(!Kc(e,i)&&(t.flags&128)===0)return Rt=!1,xy(e,t,i);Rt=(e.flags&131072)!==0}else Rt=!1,We&&(t.flags&1048576)!==0&&Df(t,ra,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=Rr(t.elementType),t.type=e,typeof e=="function")Zo(e)?(a=Or(e,a),t.tag=1,t=Wd(null,t,e,a,i)):(t.tag=0,t=Pc(null,t,e,a,i));else{if(e!=null){var m=e.$$typeof;if(m===A){t.tag=11,t=Ud(null,t,e,a,i);break e}else if(m===R){t.tag=14,t=Pd(null,t,e,a,i);break e}}throw t=K(e)||e,Error(o(306,t,""))}}return t;case 0:return Pc(e,t,t.type,t.pendingProps,i);case 1:return a=t.type,m=Or(a,t.pendingProps),Wd(e,t,a,m,i);case 3:e:{if(q(t,t.stateNode.containerInfo),e===null)throw Error(o(387));a=t.pendingProps;var w=t.memoizedState;m=w.element,pc(e,t),fa(t,a,null,i);var O=t.memoizedState;if(a=O.cache,Vi(t,At,a),a!==w.cache&&oc(t,[At],i,!0),ha(),a=O.element,w.isDehydrated)if(w={element:a,isDehydrated:!1,cache:O.cache},t.updateQueue.baseState=w,t.memoizedState=w,t.flags&256){t=Kd(e,t,a,i);break e}else if(a!==m){m=zn(Error(o(424)),t),sa(m),t=Kd(e,t,a,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(ft=qn(e.firstChild),Ft=t,We=!0,$i=null,Pn=!0,i=qf(t,null,a,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(Er(),a===m){t=Ei(e,t,i);break e}$t(e,t,a,i)}t=t.child}return t;case 26:return Hl(e,t),e===null?(i=cm(t.type,null,t.pendingProps,null))?t.memoizedState=i:We||(i=t.type,e=t.pendingProps,a=eo(ue.current).createElement(i),a[Et]=t,a[It]=e,Gt(a,i,e),at(a),t.stateNode=a):t.memoizedState=cm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Q(t),e===null&&We&&(a=t.stateNode=am(t.type,t.pendingProps,ue.current),Ft=t,Pn=!0,m=ft,sr(t.type)?(Au=m,ft=qn(a.firstChild)):ft=m),$t(e,t,t.pendingProps.children,i),Hl(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&We&&((m=a=ft)&&(a=e0(a,t.type,t.pendingProps,Pn),a!==null?(t.stateNode=a,Ft=t,ft=qn(a.firstChild),Pn=!1,m=!0):m=!1),m||Gi(t)),Q(t),m=t.type,w=t.pendingProps,O=e!==null?e.memoizedProps:null,a=w.children,Cu(m,w)?a=null:O!==null&&Cu(m,O)&&(t.flags|=32),t.memoizedState!==null&&(m=bc(e,t,my,null,null,i),La._currentValue=m),Hl(e,t),$t(e,t,a,i),t.child;case 6:return e===null&&We&&((e=i=ft)&&(i=t0(i,t.pendingProps,Pn),i!==null?(t.stateNode=i,Ft=t,ft=null,e=!0):e=!1),e||Gi(t)),null;case 13:return Yd(e,t,i);case 4:return q(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=Mr(t,null,a,i):$t(e,t,a,i),t.child;case 11:return Ud(e,t,t.type,t.pendingProps,i);case 7:return $t(e,t,t.pendingProps,i),t.child;case 8:return $t(e,t,t.pendingProps.children,i),t.child;case 12:return $t(e,t,t.pendingProps.children,i),t.child;case 10:return a=t.pendingProps,Vi(t,t.type,a.value),$t(e,t,a.children,i),t.child;case 9:return m=t.type._context,a=t.pendingProps.children,Ar(t),m=qt(m),a=a(m),t.flags|=1,$t(e,t,a,i),t.child;case 14:return Pd(e,t,t.type,t.pendingProps,i);case 15:return Fd(e,t,t.type,t.pendingProps,i);case 19:return Qd(e,t,i);case 31:return wy(e,t,i);case 22:return qd(e,t,i,t.pendingProps);case 24:return Ar(t),a=qt(At),e===null?(m=hc(),m===null&&(m=lt,w=cc(),m.pooledCache=w,w.refCount++,w!==null&&(m.pooledCacheLanes|=i),m=w),t.memoizedState={parent:a,cache:m},dc(t),Vi(t,At,m)):((e.lanes&i)!==0&&(pc(e,t),fa(t,null,null,i),ha()),m=e.memoizedState,w=t.memoizedState,m.parent!==a?(m={parent:a,cache:a},t.memoizedState=m,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=m),Vi(t,At,a)):(a=w.cache,Vi(t,At,a),a!==m.cache&&oc(t,[At],i,!0))),$t(e,t,t.pendingProps.children,i),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function ki(e){e.flags|=4}function Yc(e,t,i,a,m){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(m&335544128)===m)if(e.stateNode.complete)e.flags|=8192;else if(Ep())e.flags|=8192;else throw Dr=Cl,fc}else e.flags&=-16777217}function Zd(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!pm(t))if(Ep())e.flags|=8192;else throw Dr=Cl,fc}function Il(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Kt():536870912,e.lanes|=t,ws|=t)}function va(e,t){if(!We)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 a=null;i!==null;)i.alternate!==null&&(a=i),i=i.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function dt(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,a=0;if(t)for(var m=e.child;m!==null;)i|=m.lanes|m.childLanes,a|=m.subtreeFlags&65011712,a|=m.flags&65011712,m.return=e,m=m.sibling;else for(m=e.child;m!==null;)i|=m.lanes|m.childLanes,a|=m.subtreeFlags,a|=m.flags,m.return=e,m=m.sibling;return e.subtreeFlags|=a,e.childLanes=i,t}function Ey(e,t,i){var a=t.pendingProps;switch(ic(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return dt(t),null;case 1:return dt(t),null;case 3:return i=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Ci(At),Z(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(us(t)?ki(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,sc())),dt(t),null;case 26:var m=t.type,w=t.memoizedState;return e===null?(ki(t),w!==null?(dt(t),Zd(t,w)):(dt(t),Yc(t,m,null,a,i))):w?w!==e.memoizedState?(ki(t),dt(t),Zd(t,w)):(dt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&ki(t),dt(t),Yc(t,m,e,a,i)),null;case 27:if(_e(t),i=ue.current,m=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&ki(t);else{if(!a){if(t.stateNode===null)throw Error(o(166));return dt(t),null}e=se.current,us(t)?Lf(t):(e=am(m,a,i),t.stateNode=e,ki(t))}return dt(t),null;case 5:if(_e(t),m=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&ki(t);else{if(!a){if(t.stateNode===null)throw Error(o(166));return dt(t),null}if(w=se.current,us(t))Lf(t);else{var O=eo(ue.current);switch(w){case 1:w=O.createElementNS("http://www.w3.org/2000/svg",m);break;case 2:w=O.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;default:switch(m){case"svg":w=O.createElementNS("http://www.w3.org/2000/svg",m);break;case"math":w=O.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;case"script":w=O.createElement("div"),w.innerHTML="<script><\/script>",w=w.removeChild(w.firstChild);break;case"select":w=typeof a.is=="string"?O.createElement("select",{is:a.is}):O.createElement("select"),a.multiple?w.multiple=!0:a.size&&(w.size=a.size);break;default:w=typeof a.is=="string"?O.createElement(m,{is:a.is}):O.createElement(m)}}w[Et]=t,w[It]=a;e:for(O=t.child;O!==null;){if(O.tag===5||O.tag===6)w.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=w;e:switch(Gt(w,m,a),m){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&ki(t)}}return dt(t),Yc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&ki(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(o(166));if(e=ue.current,us(t)){if(e=t.stateNode,i=t.memoizedProps,a=null,m=Ft,m!==null)switch(m.tag){case 27:case 5:a=m.memoizedProps}e[Et]=t,e=!!(e.nodeValue===i||a!==null&&a.suppressHydrationWarning===!0||Yp(e.nodeValue,i)),e||Gi(t,!0)}else e=eo(e).createTextNode(a),e[Et]=t,t.stateNode=e}return dt(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(a=us(t),i!==null){if(e===null){if(!a)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[Et]=t}else Er(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;dt(t),e=!1}else i=sc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?(An(t),t):(An(t),null);if((t.flags&128)!==0)throw Error(o(558))}return dt(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(m=us(t),a!==null&&a.dehydrated!==null){if(e===null){if(!m)throw Error(o(318));if(m=t.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(o(317));m[Et]=t}else Er(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;dt(t),m=!1}else m=sc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=m),m=!0;if(!m)return t.flags&256?(An(t),t):(An(t),null)}return An(t),(t.flags&128)!==0?(t.lanes=i,t):(i=a!==null,e=e!==null&&e.memoizedState!==null,i&&(a=t.child,m=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(m=a.alternate.memoizedState.cachePool.pool),w=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(w=a.memoizedState.cachePool.pool),w!==m&&(a.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),Il(t,t.updateQueue),dt(t),null);case 4:return Z(),e===null&&_u(t.stateNode.containerInfo),dt(t),null;case 10:return Ci(t.type),dt(t),null;case 19:if($(wt),a=t.memoizedState,a===null)return dt(t),null;if(m=(t.flags&128)!==0,w=a.rendering,w===null)if(m)va(a,!1);else{if(St!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(w=kl(e),w!==null){for(t.flags|=128,va(a,!1),e=w.updateQueue,t.updateQueue=e,Il(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)Af(i,e),i=i.sibling;return I(wt,wt.current&1|2),We&&Si(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&et()>$l&&(t.flags|=128,m=!0,va(a,!1),t.lanes=4194304)}else{if(!m)if(e=kl(w),e!==null){if(t.flags|=128,m=!0,e=e.updateQueue,t.updateQueue=e,Il(t,e),va(a,!0),a.tail===null&&a.tailMode==="hidden"&&!w.alternate&&!We)return dt(t),null}else 2*et()-a.renderingStartTime>$l&&i!==536870912&&(t.flags|=128,m=!0,va(a,!1),t.lanes=4194304);a.isBackwards?(w.sibling=t.child,t.child=w):(e=a.last,e!==null?e.sibling=w:t.child=w,a.last=w)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=et(),e.sibling=null,i=wt.current,I(wt,m?i&1|2:i&1),We&&Si(t,a.treeForkCount),e):(dt(t),null);case 22:case 23:return An(t),vc(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(i&536870912)!==0&&(t.flags&128)===0&&(dt(t),t.subtreeFlags&6&&(t.flags|=8192)):dt(t),i=t.updateQueue,i!==null&&Il(t,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==i&&(t.flags|=2048),e!==null&&$(Tr),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Ci(At),dt(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function ky(e,t){switch(ic(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ci(At),Z(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return _e(t),null;case 31:if(t.memoizedState!==null){if(An(t),t.alternate===null)throw Error(o(340));Er()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(An(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));Er()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return $(wt),null;case 4:return Z(),null;case 10:return Ci(t.type),null;case 22:case 23:return An(t),vc(),e!==null&&$(Tr),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ci(At),null;case 25:return null;default:return null}}function ep(e,t){switch(ic(t),t.tag){case 3:Ci(At),Z();break;case 26:case 27:case 5:_e(t);break;case 4:Z();break;case 31:t.memoizedState!==null&&An(t);break;case 13:An(t);break;case 19:$(wt);break;case 10:Ci(t.type);break;case 22:case 23:An(t),vc(),e!==null&&$(Tr);break;case 24:Ci(At)}}function ya(e,t){try{var i=t.updateQueue,a=i!==null?i.lastEffect:null;if(a!==null){var m=a.next;i=m;do{if((i.tag&e)===e){a=void 0;var w=i.create,O=i.inst;a=w(),O.destroy=a}i=i.next}while(i!==m)}}catch(F){nt(t,t.return,F)}}function Ji(e,t,i){try{var a=t.updateQueue,m=a!==null?a.lastEffect:null;if(m!==null){var w=m.next;a=w;do{if((a.tag&e)===e){var O=a.inst,F=O.destroy;if(F!==void 0){O.destroy=void 0,m=t;var J=i,oe=F;try{oe()}catch(de){nt(m,J,de)}}}a=a.next}while(a!==w)}}catch(de){nt(t,t.return,de)}}function tp(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{Gf(t,i)}catch(a){nt(e,e.return,a)}}}function np(e,t,i){i.props=Or(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(a){nt(e,t,a)}}function Sa(e,t){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof i=="function"?e.refCleanup=i(a):i.current=a}}catch(m){nt(e,t,m)}}function ui(e,t){var i=e.ref,a=e.refCleanup;if(i!==null)if(typeof a=="function")try{a()}catch(m){nt(e,t,m)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(m){nt(e,t,m)}else i.current=null}function ip(e){var t=e.type,i=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":i.autoFocus&&a.focus();break e;case"img":i.src?a.src=i.src:i.srcSet&&(a.srcset=i.srcSet)}}catch(m){nt(e,e.return,m)}}function Xc(e,t,i){try{var a=e.stateNode;Ky(a,e.type,i,t),a[It]=t}catch(m){nt(e,e.return,m)}}function rp(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&sr(e.type)||e.tag===4}function Qc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||rp(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&&sr(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 Jc(e,t,i){var a=e.tag;if(a===5||a===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=Yt));else if(a!==4&&(a===27&&sr(e.type)&&(i=e.stateNode,t=null),e=e.child,e!==null))for(Jc(e,t,i),e=e.sibling;e!==null;)Jc(e,t,i),e=e.sibling}function Ul(e,t,i){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?i.insertBefore(e,t):i.appendChild(e);else if(a!==4&&(a===27&&sr(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(Ul(e,t,i),e=e.sibling;e!==null;)Ul(e,t,i),e=e.sibling}function sp(e){var t=e.stateNode,i=e.memoizedProps;try{for(var a=e.type,m=t.attributes;m.length;)t.removeAttributeNode(m[0]);Gt(t,a,i),t[Et]=e,t[It]=i}catch(w){nt(e,e.return,w)}}var Ai=!1,Dt=!1,Zc=!1,ap=typeof WeakSet=="function"?WeakSet:Set,Nt=null;function Ay(e,t){if(e=e.containerInfo,Su=lo,e=vf(e),Vo(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var a=i.getSelection&&i.getSelection();if(a&&a.rangeCount!==0){i=a.anchorNode;var m=a.anchorOffset,w=a.focusNode;a=a.focusOffset;try{i.nodeType,w.nodeType}catch{i=null;break e}var O=0,F=-1,J=-1,oe=0,de=0,ge=e,ce=null;t:for(;;){for(var he;ge!==i||m!==0&&ge.nodeType!==3||(F=O+m),ge!==w||a!==0&&ge.nodeType!==3||(J=O+a),ge.nodeType===3&&(O+=ge.nodeValue.length),(he=ge.firstChild)!==null;)ce=ge,ge=he;for(;;){if(ge===e)break t;if(ce===i&&++oe===m&&(F=O),ce===w&&++de===a&&(J=O),(he=ge.nextSibling)!==null)break;ge=ce,ce=ge.parentNode}ge=he}i=F===-1||J===-1?null:{start:F,end:J}}else i=null}i=i||{start:0,end:0}}else i=null;for(bu={focusedElem:e,selectionRange:i},lo=!1,Nt=t;Nt!==null;)if(t=Nt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Nt=e;else for(;Nt!==null;){switch(t=Nt,w=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++)m=e[i],m.ref.impl=m.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&w!==null){e=void 0,i=t,m=w.memoizedProps,w=w.memoizedState,a=i.stateNode;try{var we=Or(i.type,m);e=a.getSnapshotBeforeUpdate(we,w),a.__reactInternalSnapshotBeforeUpdate=e}catch(Oe){nt(i,i.return,Oe)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,i=e.nodeType,i===9)xu(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":xu(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,Nt=e;break}Nt=t.return}}function lp(e,t,i){var a=i.flags;switch(i.tag){case 0:case 11:case 15:Ri(e,i),a&4&&ya(5,i);break;case 1:if(Ri(e,i),a&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(O){nt(i,i.return,O)}else{var m=Or(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(m,t,e.__reactInternalSnapshotBeforeUpdate)}catch(O){nt(i,i.return,O)}}a&64&&tp(i),a&512&&Sa(i,i.return);break;case 3:if(Ri(e,i),a&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{Gf(e,t)}catch(O){nt(i,i.return,O)}}break;case 27:t===null&&a&4&&sp(i);case 26:case 5:Ri(e,i),t===null&&a&4&&ip(i),a&512&&Sa(i,i.return);break;case 12:Ri(e,i);break;case 31:Ri(e,i),a&4&&up(e,i);break;case 13:Ri(e,i),a&4&&hp(e,i),a&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=Ny.bind(null,i),n0(e,i))));break;case 22:if(a=i.memoizedState!==null||Ai,!a){t=t!==null&&t.memoizedState!==null||Dt,m=Ai;var w=Dt;Ai=a,(Dt=t)&&!w?Di(e,i,(i.subtreeFlags&8772)!==0):Ri(e,i),Ai=m,Dt=w}break;case 30:break;default:Ri(e,i)}}function op(e){var t=e.alternate;t!==null&&(e.alternate=null,op(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&qr(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 gt=null,fn=!1;function Ti(e,t,i){for(i=i.child;i!==null;)cp(e,t,i),i=i.sibling}function cp(e,t,i){if(_t&&typeof _t.onCommitFiberUnmount=="function")try{_t.onCommitFiberUnmount(vt,i)}catch{}switch(i.tag){case 26:Dt||ui(i,t),Ti(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:Dt||ui(i,t);var a=gt,m=fn;sr(i.type)&&(gt=i.stateNode,fn=!1),Ti(e,t,i),Ra(i.stateNode),gt=a,fn=m;break;case 5:Dt||ui(i,t);case 6:if(a=gt,m=fn,gt=null,Ti(e,t,i),gt=a,fn=m,gt!==null)if(fn)try{(gt.nodeType===9?gt.body:gt.nodeName==="HTML"?gt.ownerDocument.body:gt).removeChild(i.stateNode)}catch(w){nt(i,t,w)}else try{gt.removeChild(i.stateNode)}catch(w){nt(i,t,w)}break;case 18:gt!==null&&(fn?(e=gt,tm(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),Ms(e)):tm(gt,i.stateNode));break;case 4:a=gt,m=fn,gt=i.stateNode.containerInfo,fn=!0,Ti(e,t,i),gt=a,fn=m;break;case 0:case 11:case 14:case 15:Ji(2,i,t),Dt||Ji(4,i,t),Ti(e,t,i);break;case 1:Dt||(ui(i,t),a=i.stateNode,typeof a.componentWillUnmount=="function"&&np(i,t,a)),Ti(e,t,i);break;case 21:Ti(e,t,i);break;case 22:Dt=(a=Dt)||i.memoizedState!==null,Ti(e,t,i),Dt=a;break;default:Ti(e,t,i)}}function up(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ms(e)}catch(i){nt(t,t.return,i)}}}function hp(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ms(e)}catch(i){nt(t,t.return,i)}}function Ty(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ap),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ap),t;default:throw Error(o(435,e.tag))}}function Pl(e,t){var i=Ty(e);t.forEach(function(a){if(!i.has(a)){i.add(a);var m=Hy.bind(null,e,a);a.then(m,m)}})}function dn(e,t){var i=t.deletions;if(i!==null)for(var a=0;a<i.length;a++){var m=i[a],w=e,O=t,F=O;e:for(;F!==null;){switch(F.tag){case 27:if(sr(F.type)){gt=F.stateNode,fn=!1;break e}break;case 5:gt=F.stateNode,fn=!1;break e;case 3:case 4:gt=F.stateNode.containerInfo,fn=!0;break e}F=F.return}if(gt===null)throw Error(o(160));cp(w,O,m),gt=null,fn=!1,w=m.alternate,w!==null&&(w.return=null),m.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)fp(t,e),t=t.sibling}var ti=null;function fp(e,t){var i=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:dn(t,e),pn(e),a&4&&(Ji(3,e,e.return),ya(3,e),Ji(5,e,e.return));break;case 1:dn(t,e),pn(e),a&512&&(Dt||i===null||ui(i,i.return)),a&64&&Ai&&(e=e.updateQueue,e!==null&&(a=e.callbacks,a!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?a:i.concat(a))));break;case 26:var m=ti;if(dn(t,e),pn(e),a&512&&(Dt||i===null||ui(i,i.return)),a&4){var w=i!==null?i.memoizedState:null;if(a=e.memoizedState,i===null)if(a===null)if(e.stateNode===null){e:{a=e.type,i=e.memoizedProps,m=m.ownerDocument||m;t:switch(a){case"title":w=m.getElementsByTagName("title")[0],(!w||w[On]||w[Et]||w.namespaceURI==="http://www.w3.org/2000/svg"||w.hasAttribute("itemprop"))&&(w=m.createElement(a),m.head.insertBefore(w,m.querySelector("head > title"))),Gt(w,a,i),w[Et]=e,at(w),a=w;break e;case"link":var O=fm("link","href",m).get(a+(i.href||""));if(O){for(var F=0;F<O.length;F++)if(w=O[F],w.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&w.getAttribute("rel")===(i.rel==null?null:i.rel)&&w.getAttribute("title")===(i.title==null?null:i.title)&&w.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){O.splice(F,1);break t}}w=m.createElement(a),Gt(w,a,i),m.head.appendChild(w);break;case"meta":if(O=fm("meta","content",m).get(a+(i.content||""))){for(F=0;F<O.length;F++)if(w=O[F],w.getAttribute("content")===(i.content==null?null:""+i.content)&&w.getAttribute("name")===(i.name==null?null:i.name)&&w.getAttribute("property")===(i.property==null?null:i.property)&&w.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&w.getAttribute("charset")===(i.charSet==null?null:i.charSet)){O.splice(F,1);break t}}w=m.createElement(a),Gt(w,a,i),m.head.appendChild(w);break;default:throw Error(o(468,a))}w[Et]=e,at(w),a=w}e.stateNode=a}else dm(m,e.type,e.stateNode);else e.stateNode=hm(m,a,e.memoizedProps);else w!==a?(w===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):w.count--,a===null?dm(m,e.type,e.stateNode):hm(m,a,e.memoizedProps)):a===null&&e.stateNode!==null&&Xc(e,e.memoizedProps,i.memoizedProps)}break;case 27:dn(t,e),pn(e),a&512&&(Dt||i===null||ui(i,i.return)),i!==null&&a&4&&Xc(e,e.memoizedProps,i.memoizedProps);break;case 5:if(dn(t,e),pn(e),a&512&&(Dt||i===null||ui(i,i.return)),e.flags&32){m=e.stateNode;try{Cn(m,"")}catch(we){nt(e,e.return,we)}}a&4&&e.stateNode!=null&&(m=e.memoizedProps,Xc(e,m,i!==null?i.memoizedProps:m)),a&1024&&(Zc=!0);break;case 6:if(dn(t,e),pn(e),a&4){if(e.stateNode===null)throw Error(o(162));a=e.memoizedProps,i=e.stateNode;try{i.nodeValue=a}catch(we){nt(e,e.return,we)}}break;case 3:if(io=null,m=ti,ti=to(t.containerInfo),dn(t,e),ti=m,pn(e),a&4&&i!==null&&i.memoizedState.isDehydrated)try{Ms(t.containerInfo)}catch(we){nt(e,e.return,we)}Zc&&(Zc=!1,dp(e));break;case 4:a=ti,ti=to(e.stateNode.containerInfo),dn(t,e),pn(e),ti=a;break;case 12:dn(t,e),pn(e);break;case 31:dn(t,e),pn(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Pl(e,a)));break;case 13:dn(t,e),pn(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(ql=et()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Pl(e,a)));break;case 22:m=e.memoizedState!==null;var J=i!==null&&i.memoizedState!==null,oe=Ai,de=Dt;if(Ai=oe||m,Dt=de||J,dn(t,e),Dt=de,Ai=oe,pn(e),a&8192)e:for(t=e.stateNode,t._visibility=m?t._visibility&-2:t._visibility|1,m&&(i===null||J||Ai||Dt||Br(e)),i=null,t=e;;){if(t.tag===5||t.tag===26){if(i===null){J=i=t;try{if(w=J.stateNode,m)O=w.style,typeof O.setProperty=="function"?O.setProperty("display","none","important"):O.display="none";else{F=J.stateNode;var ge=J.memoizedProps.style,ce=ge!=null&&ge.hasOwnProperty("display")?ge.display:null;F.style.display=ce==null||typeof ce=="boolean"?"":(""+ce).trim()}}catch(we){nt(J,J.return,we)}}}else if(t.tag===6){if(i===null){J=t;try{J.stateNode.nodeValue=m?"":J.memoizedProps}catch(we){nt(J,J.return,we)}}}else if(t.tag===18){if(i===null){J=t;try{var he=J.stateNode;m?nm(he,!0):nm(J.stateNode,!1)}catch(we){nt(J,J.return,we)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;i===t&&(i=null),t=t.return}i===t&&(i=null),t.sibling.return=t.return,t=t.sibling}a&4&&(a=e.updateQueue,a!==null&&(i=a.retryQueue,i!==null&&(a.retryQueue=null,Pl(e,i))));break;case 19:dn(t,e),pn(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Pl(e,a)));break;case 30:break;case 21:break;default:dn(t,e),pn(e)}}function pn(e){var t=e.flags;if(t&2){try{for(var i,a=e.return;a!==null;){if(rp(a)){i=a;break}a=a.return}if(i==null)throw Error(o(160));switch(i.tag){case 27:var m=i.stateNode,w=Qc(e);Ul(e,w,m);break;case 5:var O=i.stateNode;i.flags&32&&(Cn(O,""),i.flags&=-33);var F=Qc(e);Ul(e,F,O);break;case 3:case 4:var J=i.stateNode.containerInfo,oe=Qc(e);Jc(e,oe,J);break;default:throw Error(o(161))}}catch(de){nt(e,e.return,de)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function dp(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;dp(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Ri(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)lp(e,t.alternate,t),t=t.sibling}function Br(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ji(4,t,t.return),Br(t);break;case 1:ui(t,t.return);var i=t.stateNode;typeof i.componentWillUnmount=="function"&&np(t,t.return,i),Br(t);break;case 27:Ra(t.stateNode);case 26:case 5:ui(t,t.return),Br(t);break;case 22:t.memoizedState===null&&Br(t);break;case 30:Br(t);break;default:Br(t)}e=e.sibling}}function Di(e,t,i){for(i=i&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,m=e,w=t,O=w.flags;switch(w.tag){case 0:case 11:case 15:Di(m,w,i),ya(4,w);break;case 1:if(Di(m,w,i),a=w,m=a.stateNode,typeof m.componentDidMount=="function")try{m.componentDidMount()}catch(oe){nt(a,a.return,oe)}if(a=w,m=a.updateQueue,m!==null){var F=a.stateNode;try{var J=m.shared.hiddenCallbacks;if(J!==null)for(m.shared.hiddenCallbacks=null,m=0;m<J.length;m++)$f(J[m],F)}catch(oe){nt(a,a.return,oe)}}i&&O&64&&tp(w),Sa(w,w.return);break;case 27:sp(w);case 26:case 5:Di(m,w,i),i&&a===null&&O&4&&ip(w),Sa(w,w.return);break;case 12:Di(m,w,i);break;case 31:Di(m,w,i),i&&O&4&&up(m,w);break;case 13:Di(m,w,i),i&&O&4&&hp(m,w);break;case 22:w.memoizedState===null&&Di(m,w,i),Sa(w,w.return);break;case 30:break;default:Di(m,w,i)}t=t.sibling}}function eu(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&&aa(i))}function tu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&aa(e))}function ni(e,t,i,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)pp(e,t,i,a),t=t.sibling}function pp(e,t,i,a){var m=t.flags;switch(t.tag){case 0:case 11:case 15:ni(e,t,i,a),m&2048&&ya(9,t);break;case 1:ni(e,t,i,a);break;case 3:ni(e,t,i,a),m&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&aa(e)));break;case 12:if(m&2048){ni(e,t,i,a),e=t.stateNode;try{var w=t.memoizedProps,O=w.id,F=w.onPostCommit;typeof F=="function"&&F(O,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(J){nt(t,t.return,J)}}else ni(e,t,i,a);break;case 31:ni(e,t,i,a);break;case 13:ni(e,t,i,a);break;case 23:break;case 22:w=t.stateNode,O=t.alternate,t.memoizedState!==null?w._visibility&2?ni(e,t,i,a):ba(e,t):w._visibility&2?ni(e,t,i,a):(w._visibility|=2,Ss(e,t,i,a,(t.subtreeFlags&10256)!==0||!1)),m&2048&&eu(O,t);break;case 24:ni(e,t,i,a),m&2048&&tu(t.alternate,t);break;default:ni(e,t,i,a)}}function Ss(e,t,i,a,m){for(m=m&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var w=e,O=t,F=i,J=a,oe=O.flags;switch(O.tag){case 0:case 11:case 15:Ss(w,O,F,J,m),ya(8,O);break;case 23:break;case 22:var de=O.stateNode;O.memoizedState!==null?de._visibility&2?Ss(w,O,F,J,m):ba(w,O):(de._visibility|=2,Ss(w,O,F,J,m)),m&&oe&2048&&eu(O.alternate,O);break;case 24:Ss(w,O,F,J,m),m&&oe&2048&&tu(O.alternate,O);break;default:Ss(w,O,F,J,m)}t=t.sibling}}function ba(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,a=t,m=a.flags;switch(a.tag){case 22:ba(i,a),m&2048&&eu(a.alternate,a);break;case 24:ba(i,a),m&2048&&tu(a.alternate,a);break;default:ba(i,a)}t=t.sibling}}var Ca=8192;function bs(e,t,i){if(e.subtreeFlags&Ca)for(e=e.child;e!==null;)mp(e,t,i),e=e.sibling}function mp(e,t,i){switch(e.tag){case 26:bs(e,t,i),e.flags&Ca&&e.memoizedState!==null&&p0(i,ti,e.memoizedState,e.memoizedProps);break;case 5:bs(e,t,i);break;case 3:case 4:var a=ti;ti=to(e.stateNode.containerInfo),bs(e,t,i),ti=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=Ca,Ca=16777216,bs(e,t,i),Ca=a):bs(e,t,i));break;default:bs(e,t,i)}}function gp(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 wa(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var a=t[i];Nt=a,vp(a,e)}gp(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)_p(e),e=e.sibling}function _p(e){switch(e.tag){case 0:case 11:case 15:wa(e),e.flags&2048&&Ji(9,e,e.return);break;case 3:wa(e);break;case 12:wa(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Fl(e)):wa(e);break;default:wa(e)}}function Fl(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var a=t[i];Nt=a,vp(a,e)}gp(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ji(8,t,t.return),Fl(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,Fl(t));break;default:Fl(t)}e=e.sibling}}function vp(e,t){for(;Nt!==null;){var i=Nt;switch(i.tag){case 0:case 11:case 15:Ji(8,i,t);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var a=i.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:aa(i.memoizedState.cache)}if(a=i.child,a!==null)a.return=i,Nt=a;else e:for(i=e;Nt!==null;){a=Nt;var m=a.sibling,w=a.return;if(op(a),a===i){Nt=null;break e}if(m!==null){m.return=w,Nt=m;break e}Nt=w}}}var Ry={getCacheForType:function(e){var t=qt(At),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return qt(At).controller.signal}},Dy=typeof WeakMap=="function"?WeakMap:Map,Ze=0,lt=null,Fe=null,Ge=0,tt=0,Tn=null,Zi=!1,Cs=!1,nu=!1,Mi=0,St=0,er=0,jr=0,iu=0,Rn=0,ws=0,xa=null,mn=null,ru=!1,ql=0,yp=0,$l=1/0,Gl=null,tr=null,jt=0,nr=null,xs=null,Li=0,su=0,au=null,Sp=null,Ea=0,lu=null;function Dn(){return(Ze&2)!==0&&Ge!==0?Ge&-Ge:G.T!==null?du():Yn()}function bp(){if(Rn===0)if((Ge&536870912)===0||We){var e=Wn;Wn<<=1,(Wn&3932160)===0&&(Wn=262144),Rn=e}else Rn=536870912;return e=kn.current,e!==null&&(e.flags|=32),Rn}function gn(e,t,i){(e===lt&&(tt===2||tt===9)||e.cancelPendingCommit!==null)&&(Es(e,0),ir(e,Ge,Rn,!1)),zt(e,i),((Ze&2)===0||e!==lt)&&(e===lt&&((Ze&2)===0&&(jr|=i),St===4&&ir(e,Ge,Rn,!1)),hi(e))}function Cp(e,t,i){if((Ze&6)!==0)throw Error(o(327));var a=!i&&(t&127)===0&&(t&e.expiredLanes)===0||Wt(e,t),m=a?Oy(e,t):cu(e,t,!0),w=a;do{if(m===0){Cs&&!a&&ir(e,t,0,!1);break}else{if(i=e.current.alternate,w&&!My(i)){m=cu(e,t,!1),w=!1;continue}if(m===2){if(w=t,e.errorRecoveryDisabledLanes&w)var O=0;else O=e.pendingLanes&-536870913,O=O!==0?O:O&536870912?536870912:0;if(O!==0){t=O;e:{var F=e;m=xa;var J=F.current.memoizedState.isDehydrated;if(J&&(Es(F,O).flags|=256),O=cu(F,O,!1),O!==2){if(nu&&!J){F.errorRecoveryDisabledLanes|=w,jr|=w,m=4;break e}w=mn,mn=m,w!==null&&(mn===null?mn=w:mn.push.apply(mn,w))}m=O}if(w=!1,m!==2)continue}}if(m===1){Es(e,0),ir(e,t,0,!0);break}e:{switch(a=e,w=m,w){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:ir(a,t,Rn,!Zi);break e;case 2:mn=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(m=ql+300-et(),10<m)){if(ir(a,t,Rn,!Zi),Kn(a,0,!0)!==0)break e;Li=t,a.timeoutHandle=Zp(wp.bind(null,a,i,mn,Gl,ru,t,Rn,jr,ws,Zi,w,"Throttled",-0,0),m);break e}wp(a,i,mn,Gl,ru,t,Rn,jr,ws,Zi,w,null,-0,0)}}break}while(!0);hi(e)}function wp(e,t,i,a,m,w,O,F,J,oe,de,ge,ce,he){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:Yt},mp(t,w,ge);var we=(w&62914560)===w?ql-et():(w&4194048)===w?yp-et():0;if(we=m0(ge,we),we!==null){Li=w,e.cancelPendingCommit=we(Mp.bind(null,e,t,w,i,a,m,O,F,J,de,ge,null,ce,he)),ir(e,w,O,!oe);return}}Mp(e,t,w,i,a,m,O,F,J)}function My(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 a=0;a<i.length;a++){var m=i[a],w=m.getSnapshot;m=m.value;try{if(!xn(w(),m))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 ir(e,t,i,a){t&=~iu,t&=~jr,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var m=t;0<m;){var w=31-Xe(m),O=1<<w;a[w]=-1,m&=~O}i!==0&&He(e,i,t)}function Vl(){return(Ze&6)===0?(ka(0),!1):!0}function ou(){if(Fe!==null){if(tt===0)var e=Fe.return;else e=Fe,bi=kr=null,xc(e),ms=null,oa=0,e=Fe;for(;e!==null;)ep(e.alternate,e),e=e.return;Fe=null}}function Es(e,t){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,Qy(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),Li=0,ou(),lt=e,Fe=i=yi(e.current,null),Ge=t,tt=0,Tn=null,Zi=!1,Cs=Wt(e,t),nu=!1,ws=Rn=iu=jr=er=St=0,mn=xa=null,ru=!1,(t&8)!==0&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var m=31-Xe(a),w=1<<m;t|=e[m],a&=~w}return Mi=t,dl(),i}function xp(e,t){Ne=null,G.H=ga,t===ps||t===bl?(t=Uf(),tt=3):t===fc?(t=Uf(),tt=4):tt=t===Uc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Tn=t,Fe===null&&(St=1,jl(e,zn(t,e.current)))}function Ep(){var e=kn.current;return e===null?!0:(Ge&4194048)===Ge?Fn===null:(Ge&62914560)===Ge||(Ge&536870912)!==0?e===Fn:!1}function kp(){var e=G.H;return G.H=ga,e===null?ga:e}function Ap(){var e=G.A;return G.A=Ry,e}function Wl(){St=4,Zi||(Ge&4194048)!==Ge&&kn.current!==null||(Cs=!0),(er&134217727)===0&&(jr&134217727)===0||lt===null||ir(lt,Ge,Rn,!1)}function cu(e,t,i){var a=Ze;Ze|=2;var m=kp(),w=Ap();(lt!==e||Ge!==t)&&(Gl=null,Es(e,t)),t=!1;var O=St;e:do try{if(tt!==0&&Fe!==null){var F=Fe,J=Tn;switch(tt){case 8:ou(),O=6;break e;case 3:case 2:case 9:case 6:kn.current===null&&(t=!0);var oe=tt;if(tt=0,Tn=null,ks(e,F,J,oe),i&&Cs){O=0;break e}break;default:oe=tt,tt=0,Tn=null,ks(e,F,J,oe)}}Ly(),O=St;break}catch(de){xp(e,de)}while(!0);return t&&e.shellSuspendCounter++,bi=kr=null,Ze=a,G.H=m,G.A=w,Fe===null&&(lt=null,Ge=0,dl()),O}function Ly(){for(;Fe!==null;)Tp(Fe)}function Oy(e,t){var i=Ze;Ze|=2;var a=kp(),m=Ap();lt!==e||Ge!==t?(Gl=null,$l=et()+500,Es(e,t)):Cs=Wt(e,t);e:do try{if(tt!==0&&Fe!==null){t=Fe;var w=Tn;t:switch(tt){case 1:tt=0,Tn=null,ks(e,t,w,1);break;case 2:case 9:if(zf(w)){tt=0,Tn=null,Rp(t);break}t=function(){tt!==2&&tt!==9||lt!==e||(tt=7),hi(e)},w.then(t,t);break e;case 3:tt=7;break e;case 4:tt=5;break e;case 7:zf(w)?(tt=0,Tn=null,Rp(t)):(tt=0,Tn=null,ks(e,t,w,7));break;case 5:var O=null;switch(Fe.tag){case 26:O=Fe.memoizedState;case 5:case 27:var F=Fe;if(O?pm(O):F.stateNode.complete){tt=0,Tn=null;var J=F.sibling;if(J!==null)Fe=J;else{var oe=F.return;oe!==null?(Fe=oe,Kl(oe)):Fe=null}break t}}tt=0,Tn=null,ks(e,t,w,5);break;case 6:tt=0,Tn=null,ks(e,t,w,6);break;case 8:ou(),St=6;break e;default:throw Error(o(462))}}By();break}catch(de){xp(e,de)}while(!0);return bi=kr=null,G.H=a,G.A=m,Ze=i,Fe!==null?0:(lt=null,Ge=0,dl(),St)}function By(){for(;Fe!==null&&!yn();)Tp(Fe)}function Tp(e){var t=Jd(e.alternate,e,Mi);e.memoizedProps=e.pendingProps,t===null?Kl(e):Fe=t}function Rp(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=Vd(i,t,t.pendingProps,t.type,void 0,Ge);break;case 11:t=Vd(i,t,t.pendingProps,t.type.render,t.ref,Ge);break;case 5:xc(t);default:ep(i,t),t=Fe=Af(t,Mi),t=Jd(i,t,Mi)}e.memoizedProps=e.pendingProps,t===null?Kl(e):Fe=t}function ks(e,t,i,a){bi=kr=null,xc(t),ms=null,oa=0;var m=t.return;try{if(Cy(e,m,t,i,Ge)){St=1,jl(e,zn(i,e.current)),Fe=null;return}}catch(w){if(m!==null)throw Fe=m,w;St=1,jl(e,zn(i,e.current)),Fe=null;return}t.flags&32768?(We||a===1?e=!0:Cs||(Ge&536870912)!==0?e=!1:(Zi=e=!0,(a===2||a===9||a===3||a===6)&&(a=kn.current,a!==null&&a.tag===13&&(a.flags|=16384))),Dp(t,e)):Kl(t)}function Kl(e){var t=e;do{if((t.flags&32768)!==0){Dp(t,Zi);return}e=t.return;var i=Ey(t.alternate,t,Mi);if(i!==null){Fe=i;return}if(t=t.sibling,t!==null){Fe=t;return}Fe=t=e}while(t!==null);St===0&&(St=5)}function Dp(e,t){do{var i=ky(e.alternate,e);if(i!==null){i.flags&=32767,Fe=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){Fe=e;return}Fe=e=i}while(e!==null);St=6,Fe=null}function Mp(e,t,i,a,m,w,O,F,J){e.cancelPendingCommit=null;do Yl();while(jt!==0);if((Ze&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(w=t.lanes|t.childLanes,w|=Qo,Hi(e,i,w,O,F,J),e===lt&&(Fe=lt=null,Ge=0),xs=t,nr=e,Li=i,su=w,au=m,Sp=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,zy(xe,function(){return Np(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=G.T,G.T=null,m=W.p,W.p=2,O=Ze,Ze|=4;try{Ay(e,t,i)}finally{Ze=O,W.p=m,G.T=a}}jt=1,Lp(),Op(),Bp()}}function Lp(){if(jt===1){jt=0;var e=nr,t=xs,i=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||i){i=G.T,G.T=null;var a=W.p;W.p=2;var m=Ze;Ze|=4;try{fp(t,e);var w=bu,O=vf(e.containerInfo),F=w.focusedElem,J=w.selectionRange;if(O!==F&&F&&F.ownerDocument&&_f(F.ownerDocument.documentElement,F)){if(J!==null&&Vo(F)){var oe=J.start,de=J.end;if(de===void 0&&(de=oe),"selectionStart"in F)F.selectionStart=oe,F.selectionEnd=Math.min(de,F.value.length);else{var ge=F.ownerDocument||document,ce=ge&&ge.defaultView||window;if(ce.getSelection){var he=ce.getSelection(),we=F.textContent.length,Oe=Math.min(J.start,we),st=J.end===void 0?Oe:Math.min(J.end,we);!he.extend&&Oe>st&&(O=st,st=Oe,Oe=O);var ie=gf(F,Oe),ee=gf(F,st);if(ie&&ee&&(he.rangeCount!==1||he.anchorNode!==ie.node||he.anchorOffset!==ie.offset||he.focusNode!==ee.node||he.focusOffset!==ee.offset)){var le=ge.createRange();le.setStart(ie.node,ie.offset),he.removeAllRanges(),Oe>st?(he.addRange(le),he.extend(ee.node,ee.offset)):(le.setEnd(ee.node,ee.offset),he.addRange(le))}}}}for(ge=[],he=F;he=he.parentNode;)he.nodeType===1&&ge.push({element:he,left:he.scrollLeft,top:he.scrollTop});for(typeof F.focus=="function"&&F.focus(),F=0;F<ge.length;F++){var me=ge[F];me.element.scrollLeft=me.left,me.element.scrollTop=me.top}}lo=!!Su,bu=Su=null}finally{Ze=m,W.p=a,G.T=i}}e.current=t,jt=2}}function Op(){if(jt===2){jt=0;var e=nr,t=xs,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=G.T,G.T=null;var a=W.p;W.p=2;var m=Ze;Ze|=4;try{lp(e,t.alternate,t)}finally{Ze=m,W.p=a,G.T=i}}jt=3}}function Bp(){if(jt===4||jt===3){jt=0,bt();var e=nr,t=xs,i=Li,a=Sp;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?jt=5:(jt=0,xs=nr=null,jp(e,e.pendingLanes));var m=e.pendingLanes;if(m===0&&(tr=null),$s(i),t=t.stateNode,_t&&typeof _t.onCommitFiberRoot=="function")try{_t.onCommitFiberRoot(vt,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=G.T,m=W.p,W.p=2,G.T=null;try{for(var w=e.onRecoverableError,O=0;O<a.length;O++){var F=a[O];w(F.value,{componentStack:F.stack})}}finally{G.T=t,W.p=m}}(Li&3)!==0&&Yl(),hi(e),m=e.pendingLanes,(i&261930)!==0&&(m&42)!==0?e===lu?Ea++:(Ea=0,lu=e):Ea=0,ka(0)}}function jp(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,aa(t)))}function Yl(){return Lp(),Op(),Bp(),Np()}function Np(){if(jt!==5)return!1;var e=nr,t=su;su=0;var i=$s(Li),a=G.T,m=W.p;try{W.p=32>i?32:i,G.T=null,i=au,au=null;var w=nr,O=Li;if(jt=0,xs=nr=null,Li=0,(Ze&6)!==0)throw Error(o(331));var F=Ze;if(Ze|=4,_p(w.current),pp(w,w.current,O,i),Ze=F,ka(0,!1),_t&&typeof _t.onPostCommitFiberRoot=="function")try{_t.onPostCommitFiberRoot(vt,w)}catch{}return!0}finally{W.p=m,G.T=a,jp(e,t)}}function Hp(e,t,i){t=zn(i,t),t=Ic(e.stateNode,t,2),e=Yi(e,t,2),e!==null&&(zt(e,2),hi(e))}function nt(e,t,i){if(e.tag===3)Hp(e,e,i);else for(;t!==null;){if(t.tag===3){Hp(t,e,i);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(tr===null||!tr.has(a))){e=zn(i,e),i=zd(2),a=Yi(t,i,2),a!==null&&(Id(i,a,t,e),zt(a,2),hi(a));break}}t=t.return}}function uu(e,t,i){var a=e.pingCache;if(a===null){a=e.pingCache=new Dy;var m=new Set;a.set(t,m)}else m=a.get(t),m===void 0&&(m=new Set,a.set(t,m));m.has(i)||(nu=!0,m.add(i),e=jy.bind(null,e,t,i),t.then(e,e))}function jy(e,t,i){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,lt===e&&(Ge&i)===i&&(St===4||St===3&&(Ge&62914560)===Ge&&300>et()-ql?(Ze&2)===0&&Es(e,0):iu|=i,ws===Ge&&(ws=0)),hi(e)}function zp(e,t){t===0&&(t=Kt()),e=wr(e,t),e!==null&&(zt(e,t),hi(e))}function Ny(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),zp(e,i)}function Hy(e,t){var i=0;switch(e.tag){case 31:case 13:var a=e.stateNode,m=e.memoizedState;m!==null&&(i=m.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(o(314))}a!==null&&a.delete(t),zp(e,i)}function zy(e,t){return Vt(e,t)}var Xl=null,As=null,hu=!1,Ql=!1,fu=!1,rr=0;function hi(e){e!==As&&e.next===null&&(As===null?Xl=As=e:As=As.next=e),Ql=!0,hu||(hu=!0,Uy())}function ka(e,t){if(!fu&&Ql){fu=!0;do for(var i=!1,a=Xl;a!==null;){if(e!==0){var m=a.pendingLanes;if(m===0)var w=0;else{var O=a.suspendedLanes,F=a.pingedLanes;w=(1<<31-Xe(42|e)+1)-1,w&=m&~(O&~F),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(i=!0,Fp(a,w))}else w=Ge,w=Kn(a,a===lt?w:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(w&3)===0||Wt(a,w)||(i=!0,Fp(a,w));a=a.next}while(i);fu=!1}}function Iy(){Ip()}function Ip(){Ql=hu=!1;var e=0;rr!==0&&Xy()&&(e=rr);for(var t=et(),i=null,a=Xl;a!==null;){var m=a.next,w=Up(a,t);w===0?(a.next=null,i===null?Xl=m:i.next=m,m===null&&(As=i)):(i=a,(e!==0||(w&3)!==0)&&(Ql=!0)),a=m}jt!==0&&jt!==5||ka(e),rr!==0&&(rr=0)}function Up(e,t){for(var i=e.suspendedLanes,a=e.pingedLanes,m=e.expirationTimes,w=e.pendingLanes&-62914561;0<w;){var O=31-Xe(w),F=1<<O,J=m[O];J===-1?((F&i)===0||(F&a)!==0)&&(m[O]=qs(F,t)):J<=t&&(e.expiredLanes|=F),w&=~F}if(t=lt,i=Ge,i=Kn(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,i===0||e===t&&(tt===2||tt===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&an(a),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||Wt(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(a!==null&&an(a),$s(i)){case 2:case 8:i=Se;break;case 32:i=xe;break;case 268435456:i=Be;break;default:i=xe}return a=Pp.bind(null,e),i=Vt(i,a),e.callbackPriority=t,e.callbackNode=i,t}return a!==null&&a!==null&&an(a),e.callbackPriority=2,e.callbackNode=null,2}function Pp(e,t){if(jt!==0&&jt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(Yl()&&e.callbackNode!==i)return null;var a=Ge;return a=Kn(e,e===lt?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(Cp(e,a,t),Up(e,et()),e.callbackNode!=null&&e.callbackNode===i?Pp.bind(null,e):null)}function Fp(e,t){if(Yl())return null;Cp(e,t,!0)}function Uy(){Jy(function(){(Ze&6)!==0?Vt(fe,Iy):Ip()})}function du(){if(rr===0){var e=fs;e===0&&(e=Vn,Vn<<=1,(Vn&261888)===0&&(Vn=256)),rr=e}return rr}function qp(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:_r(""+e)}function $p(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 Py(e,t,i,a,m){if(t==="submit"&&i&&i.stateNode===m){var w=qp((m[It]||null).action),O=a.submitter;O&&(t=(t=O[It]||null)?qp(t.formAction):O.getAttribute("formAction"),t!==null&&(w=t,O=null));var F=new pe("action","action",null,a,m);e.push({event:F,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(rr!==0){var J=O?$p(m,O):new FormData(m);Oc(i,{pending:!0,data:J,method:m.method,action:w},null,J)}}else typeof w=="function"&&(F.preventDefault(),J=O?$p(m,O):new FormData(m),Oc(i,{pending:!0,data:J,method:m.method,action:w},w,J))},currentTarget:m}]})}}for(var pu=0;pu<Xo.length;pu++){var mu=Xo[pu],Fy=mu.toLowerCase(),qy=mu[0].toUpperCase()+mu.slice(1);ei(Fy,"on"+qy)}ei(bf,"onAnimationEnd"),ei(Cf,"onAnimationIteration"),ei(wf,"onAnimationStart"),ei("dblclick","onDoubleClick"),ei("focusin","onFocus"),ei("focusout","onBlur"),ei(sy,"onTransitionRun"),ei(ay,"onTransitionStart"),ei(ly,"onTransitionCancel"),ei(xf,"onTransitionEnd"),ai("onMouseEnter",["mouseout","mouseover"]),ai("onMouseLeave",["mouseout","mouseover"]),ai("onPointerEnter",["pointerout","pointerover"]),ai("onPointerLeave",["pointerout","pointerover"]),kt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),kt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),kt("onBeforeInput",["compositionend","keypress","textInput","paste"]),kt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),kt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),kt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Aa="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(" "),$y=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Aa));function Gp(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var a=e[i],m=a.event;a=a.listeners;e:{var w=void 0;if(t)for(var O=a.length-1;0<=O;O--){var F=a[O],J=F.instance,oe=F.currentTarget;if(F=F.listener,J!==w&&m.isPropagationStopped())break e;w=F,m.currentTarget=oe;try{w(m)}catch(de){fl(de)}m.currentTarget=null,w=J}else for(O=0;O<a.length;O++){if(F=a[O],J=F.instance,oe=F.currentTarget,F=F.listener,J!==w&&m.isPropagationStopped())break e;w=F,m.currentTarget=oe;try{w(m)}catch(de){fl(de)}m.currentTarget=null,w=J}}}}function qe(e,t){var i=t[Gs];i===void 0&&(i=t[Gs]=new Set);var a=e+"__bubble";i.has(a)||(Vp(t,e,2,!1),i.add(a))}function gu(e,t,i){var a=0;t&&(a|=4),Vp(i,e,a,t)}var Jl="_reactListening"+Math.random().toString(36).slice(2);function _u(e){if(!e[Jl]){e[Jl]=!0,$r.forEach(function(i){i!=="selectionchange"&&($y.has(i)||gu(i,!1,e),gu(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Jl]||(t[Jl]=!0,gu("selectionchange",!1,t))}}function Vp(e,t,i,a){switch(bm(t)){case 2:var m=v0;break;case 8:m=y0;break;default:m=Lu}i=m.bind(null,t,i,e),m=void 0,!ke||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(m=!0),a?m!==void 0?e.addEventListener(t,i,{capture:!0,passive:m}):e.addEventListener(t,i,!0):m!==void 0?e.addEventListener(t,i,{passive:m}):e.addEventListener(t,i,!1)}function vu(e,t,i,a,m){var w=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var O=a.tag;if(O===3||O===4){var F=a.stateNode.containerInfo;if(F===m)break;if(O===4)for(O=a.return;O!==null;){var J=O.tag;if((J===3||J===4)&&O.stateNode.containerInfo===m)return;O=O.return}for(;F!==null;){if(O=cn(F),O===null)return;if(J=O.tag,J===5||J===6||J===26||J===27){a=w=O;continue e}F=F.parentNode}}a=a.return}Zr(function(){var oe=w,de=Xs(i),ge=[];e:{var ce=Ef.get(e);if(ce!==void 0){var he=pe,we=e;switch(e){case"keypress":if(Fi(i)===0)break e;case"keydown":case"keyup":he=Hv;break;case"focusin":we="focus",he=Po;break;case"focusout":we="blur",he=Po;break;case"beforeblur":case"afterblur":he=Po;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":he=Js;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":he=Ev;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":he=Uv;break;case bf:case Cf:case wf:he=Tv;break;case xf:he=Fv;break;case"scroll":case"scrollend":he=Ct;break;case"wheel":he=$v;break;case"copy":case"cut":case"paste":he=Dv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":he=tf;break;case"toggle":case"beforetoggle":he=Vv}var Oe=(t&4)!==0,st=!Oe&&(e==="scroll"||e==="scrollend"),ie=Oe?ce!==null?ce+"Capture":null:ce;Oe=[];for(var ee=oe,le;ee!==null;){var me=ee;if(le=me.stateNode,me=me.tag,me!==5&&me!==26&&me!==27||le===null||ie===null||(me=vi(ee,ie),me!=null&&Oe.push(Ta(ee,me,le))),st)break;ee=ee.return}0<Oe.length&&(ce=new he(ce,we,null,i,de),ge.push({event:ce,listeners:Oe}))}}if((t&7)===0){e:{if(ce=e==="mouseover"||e==="pointerover",he=e==="mouseout"||e==="pointerout",ce&&i!==Bn&&(we=i.relatedTarget||i.fromElement)&&(cn(we)||we[Xn]))break e;if((he||ce)&&(ce=de.window===de?de:(ce=de.ownerDocument)?ce.defaultView||ce.parentWindow:window,he?(we=i.relatedTarget||i.toElement,he=oe,we=we?cn(we):null,we!==null&&(st=g(we),Oe=we.tag,we!==st||Oe!==5&&Oe!==27&&Oe!==6)&&(we=null)):(he=null,we=oe),he!==we)){if(Oe=Js,me="onMouseLeave",ie="onMouseEnter",ee="mouse",(e==="pointerout"||e==="pointerover")&&(Oe=tf,me="onPointerLeave",ie="onPointerEnter",ee="pointer"),st=he==null?ce:si(he),le=we==null?ce:si(we),ce=new Oe(me,ee+"leave",he,i,de),ce.target=st,ce.relatedTarget=le,me=null,cn(de)===oe&&(Oe=new Oe(ie,ee+"enter",we,i,de),Oe.target=le,Oe.relatedTarget=st,me=Oe),st=me,he&&we)t:{for(Oe=Gy,ie=he,ee=we,le=0,me=ie;me;me=Oe(me))le++;me=0;for(var Te=ee;Te;Te=Oe(Te))me++;for(;0<le-me;)ie=Oe(ie),le--;for(;0<me-le;)ee=Oe(ee),me--;for(;le--;){if(ie===ee||ee!==null&&ie===ee.alternate){Oe=ie;break t}ie=Oe(ie),ee=Oe(ee)}Oe=null}else Oe=null;he!==null&&Wp(ge,ce,he,Oe,!1),we!==null&&st!==null&&Wp(ge,st,we,Oe,!0)}}e:{if(ce=oe?si(oe):window,he=ce.nodeName&&ce.nodeName.toLowerCase(),he==="select"||he==="input"&&ce.type==="file")var Qe=uf;else if(of(ce))if(hf)Qe=ny;else{Qe=ey;var Ee=Zv}else he=ce.nodeName,!he||he.toLowerCase()!=="input"||ce.type!=="checkbox"&&ce.type!=="radio"?oe&&Jr(oe.elementType)&&(Qe=uf):Qe=ty;if(Qe&&(Qe=Qe(e,oe))){cf(ge,Qe,i,de);break e}Ee&&Ee(e,ce,oe),e==="focusout"&&oe&&ce.type==="number"&&oe.memoizedProps.value!=null&&Ks(ce,"number",ce.value)}switch(Ee=oe?si(oe):window,e){case"focusin":(of(Ee)||Ee.contentEditable==="true")&&(rs=Ee,Wo=oe,ia=null);break;case"focusout":ia=Wo=rs=null;break;case"mousedown":Ko=!0;break;case"contextmenu":case"mouseup":case"dragend":Ko=!1,yf(ge,i,de);break;case"selectionchange":if(ry)break;case"keydown":case"keyup":yf(ge,i,de)}var ze;if(qo)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 is?af(e,i)&&(Ve="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Ve="onCompositionStart");Ve&&(nf&&i.locale!=="ko"&&(is||Ve!=="onCompositionStart"?Ve==="onCompositionEnd"&&is&&(ze=wn()):(li=de,Qs="value"in li?li.value:li.textContent,is=!0)),Ee=Zl(oe,Ve),0<Ee.length&&(Ve=new ef(Ve,e,null,i,de),ge.push({event:Ve,listeners:Ee}),ze?Ve.data=ze:(ze=lf(i),ze!==null&&(Ve.data=ze)))),(ze=Kv?Yv(e,i):Xv(e,i))&&(Ve=Zl(oe,"onBeforeInput"),0<Ve.length&&(Ee=new ef("onBeforeInput","beforeinput",null,i,de),ge.push({event:Ee,listeners:Ve}),Ee.data=ze)),Py(ge,e,oe,i,de)}Gp(ge,t)})}function Ta(e,t,i){return{instance:e,listener:t,currentTarget:i}}function Zl(e,t){for(var i=t+"Capture",a=[];e!==null;){var m=e,w=m.stateNode;if(m=m.tag,m!==5&&m!==26&&m!==27||w===null||(m=vi(e,i),m!=null&&a.unshift(Ta(e,m,w)),m=vi(e,t),m!=null&&a.push(Ta(e,m,w))),e.tag===3)return a;e=e.return}return[]}function Gy(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,a,m){for(var w=t._reactName,O=[];i!==null&&i!==a;){var F=i,J=F.alternate,oe=F.stateNode;if(F=F.tag,J!==null&&J===a)break;F!==5&&F!==26&&F!==27||oe===null||(J=oe,m?(oe=vi(i,w),oe!=null&&O.unshift(Ta(i,oe,J))):m||(oe=vi(i,w),oe!=null&&O.push(Ta(i,oe,J)))),i=i.return}O.length!==0&&e.push({event:t,listeners:O})}var Vy=/\r\n?/g,Wy=/\u0000|\uFFFD/g;function Kp(e){return(typeof e=="string"?e:""+e).replace(Vy,`
|
|
49
|
-
`).replace(Wy,"")}function Yp(e,t){return t=Kp(t),Kp(e)===t}function rt(e,t,i,a,m,w){switch(i){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||Cn(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&Cn(e,""+a);break;case"className":Vr(e,"class",a);break;case"tabIndex":Vr(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":Vr(e,i,a);break;case"style":Qr(e,a,w);break;case"data":if(t!=="object"){Vr(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||i!=="href")){e.removeAttribute(i);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(i);break}a=_r(""+a),e.setAttribute(i,a);break;case"action":case"formAction":if(typeof a=="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 w=="function"&&(i==="formAction"?(t!=="input"&&rt(e,t,"name",m.name,m,null),rt(e,t,"formEncType",m.formEncType,m,null),rt(e,t,"formMethod",m.formMethod,m,null),rt(e,t,"formTarget",m.formTarget,m,null)):(rt(e,t,"encType",m.encType,m,null),rt(e,t,"method",m.method,m,null),rt(e,t,"target",m.target,m,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(i);break}a=_r(""+a),e.setAttribute(i,a);break;case"onClick":a!=null&&(e.onclick=Yt);break;case"onScroll":a!=null&&qe("scroll",e);break;case"onScrollEnd":a!=null&&qe("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(o(61));if(i=a.__html,i!=null){if(m.children!=null)throw Error(o(60));e.innerHTML=i}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}i=_r(""+a),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":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(i,""+a):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":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":a===!0?e.setAttribute(i,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(i,a):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(i,a):e.removeAttribute(i);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(i):e.setAttribute(i,a);break;case"popover":qe("beforetoggle",e),qe("toggle",e),gr(e,"popover",a);break;case"xlinkActuate":Qn(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":Qn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":Qn(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":Qn(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":Qn(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":Qn(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":Qn(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":Qn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":Qn(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":gr(e,"is",a);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=cl.get(i)||i,gr(e,i,a))}}function yu(e,t,i,a,m,w){switch(i){case"style":Qr(e,a,w);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(o(61));if(i=a.__html,i!=null){if(m.children!=null)throw Error(o(60));e.innerHTML=i}}break;case"children":typeof a=="string"?Cn(e,a):(typeof a=="number"||typeof a=="bigint")&&Cn(e,""+a);break;case"onScroll":a!=null&&qe("scroll",e);break;case"onScrollEnd":a!=null&&qe("scrollend",e);break;case"onClick":a!=null&&(e.onclick=Yt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!re.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(m=i.endsWith("Capture"),t=i.slice(2,m?i.length-7:void 0),w=e[It]||null,w=w!=null?w[i]:null,typeof w=="function"&&e.removeEventListener(t,w,m),typeof a=="function")){typeof w!="function"&&w!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(t,a,m);break e}i in e?e[i]=a:a===!0?e.setAttribute(i,""):gr(e,i,a)}}}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":qe("error",e),qe("load",e);var a=!1,m=!1,w;for(w in i)if(i.hasOwnProperty(w)){var O=i[w];if(O!=null)switch(w){case"src":a=!0;break;case"srcSet":m=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:rt(e,t,w,O,i,null)}}m&&rt(e,t,"srcSet",i.srcSet,i,null),a&&rt(e,t,"src",i.src,i,null);return;case"input":qe("invalid",e);var F=w=O=m=null,J=null,oe=null;for(a in i)if(i.hasOwnProperty(a)){var de=i[a];if(de!=null)switch(a){case"name":m=de;break;case"type":O=de;break;case"checked":J=de;break;case"defaultChecked":oe=de;break;case"value":w=de;break;case"defaultValue":F=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(o(137,t));break;default:rt(e,t,a,de,i,null)}}ol(e,w,F,J,oe,O,m,!1);return;case"select":qe("invalid",e),a=O=w=null;for(m in i)if(i.hasOwnProperty(m)&&(F=i[m],F!=null))switch(m){case"value":w=F;break;case"defaultValue":O=F;break;case"multiple":a=F;default:rt(e,t,m,F,i,null)}t=w,i=O,e.multiple=!!a,t!=null?bn(e,!!a,t,!1):i!=null&&bn(e,!!a,i,!0);return;case"textarea":qe("invalid",e),w=m=a=null;for(O in i)if(i.hasOwnProperty(O)&&(F=i[O],F!=null))switch(O){case"value":a=F;break;case"defaultValue":m=F;break;case"children":w=F;break;case"dangerouslySetInnerHTML":if(F!=null)throw Error(o(91));break;default:rt(e,t,O,F,i,null)}Xr(e,a,m,w);return;case"option":for(J in i)if(i.hasOwnProperty(J)&&(a=i[J],a!=null))switch(J){case"selected":e.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:rt(e,t,J,a,i,null)}return;case"dialog":qe("beforetoggle",e),qe("toggle",e),qe("cancel",e),qe("close",e);break;case"iframe":case"object":qe("load",e);break;case"video":case"audio":for(a=0;a<Aa.length;a++)qe(Aa[a],e);break;case"image":qe("error",e),qe("load",e);break;case"details":qe("toggle",e);break;case"embed":case"source":case"link":qe("error",e),qe("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(oe in i)if(i.hasOwnProperty(oe)&&(a=i[oe],a!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:rt(e,t,oe,a,i,null)}return;default:if(Jr(t)){for(de in i)i.hasOwnProperty(de)&&(a=i[de],a!==void 0&&yu(e,t,de,a,i,void 0));return}}for(F in i)i.hasOwnProperty(F)&&(a=i[F],a!=null&&rt(e,t,F,a,i,null))}function Ky(e,t,i,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var m=null,w=null,O=null,F=null,J=null,oe=null,de=null;for(he in i){var ge=i[he];if(i.hasOwnProperty(he)&&ge!=null)switch(he){case"checked":break;case"value":break;case"defaultValue":J=ge;default:a.hasOwnProperty(he)||rt(e,t,he,null,a,ge)}}for(var ce in a){var he=a[ce];if(ge=i[ce],a.hasOwnProperty(ce)&&(he!=null||ge!=null))switch(ce){case"type":w=he;break;case"name":m=he;break;case"checked":oe=he;break;case"defaultChecked":de=he;break;case"value":O=he;break;case"defaultValue":F=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(o(137,t));break;default:he!==ge&&rt(e,t,ce,he,a,ge)}}Ws(e,O,F,J,oe,de,w,m);return;case"select":he=O=F=ce=null;for(w in i)if(J=i[w],i.hasOwnProperty(w)&&J!=null)switch(w){case"value":break;case"multiple":he=J;default:a.hasOwnProperty(w)||rt(e,t,w,null,a,J)}for(m in a)if(w=a[m],J=i[m],a.hasOwnProperty(m)&&(w!=null||J!=null))switch(m){case"value":ce=w;break;case"defaultValue":F=w;break;case"multiple":O=w;default:w!==J&&rt(e,t,m,w,a,J)}t=F,i=O,a=he,ce!=null?bn(e,!!i,ce,!1):!!a!=!!i&&(t!=null?bn(e,!!i,t,!0):bn(e,!!i,i?[]:"",!1));return;case"textarea":he=ce=null;for(F in i)if(m=i[F],i.hasOwnProperty(F)&&m!=null&&!a.hasOwnProperty(F))switch(F){case"value":break;case"children":break;default:rt(e,t,F,null,a,m)}for(O in a)if(m=a[O],w=i[O],a.hasOwnProperty(O)&&(m!=null||w!=null))switch(O){case"value":ce=m;break;case"defaultValue":he=m;break;case"children":break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(o(91));break;default:m!==w&&rt(e,t,O,m,a,w)}Yr(e,ce,he);return;case"option":for(var we in i)if(ce=i[we],i.hasOwnProperty(we)&&ce!=null&&!a.hasOwnProperty(we))switch(we){case"selected":e.selected=!1;break;default:rt(e,t,we,null,a,ce)}for(J in a)if(ce=a[J],he=i[J],a.hasOwnProperty(J)&&ce!==he&&(ce!=null||he!=null))switch(J){case"selected":e.selected=ce&&typeof ce!="function"&&typeof ce!="symbol";break;default:rt(e,t,J,ce,a,he)}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 Oe in i)ce=i[Oe],i.hasOwnProperty(Oe)&&ce!=null&&!a.hasOwnProperty(Oe)&&rt(e,t,Oe,null,a,ce);for(oe in a)if(ce=a[oe],he=i[oe],a.hasOwnProperty(oe)&&ce!==he&&(ce!=null||he!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(o(137,t));break;default:rt(e,t,oe,ce,a,he)}return;default:if(Jr(t)){for(var st in i)ce=i[st],i.hasOwnProperty(st)&&ce!==void 0&&!a.hasOwnProperty(st)&&yu(e,t,st,void 0,a,ce);for(de in a)ce=a[de],he=i[de],!a.hasOwnProperty(de)||ce===he||ce===void 0&&he===void 0||yu(e,t,de,ce,a,he);return}}for(var ie in i)ce=i[ie],i.hasOwnProperty(ie)&&ce!=null&&!a.hasOwnProperty(ie)&&rt(e,t,ie,null,a,ce);for(ge in a)ce=a[ge],he=i[ge],!a.hasOwnProperty(ge)||ce===he||ce==null&&he==null||rt(e,t,ge,ce,a,he)}function Xp(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Yy(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,i=performance.getEntriesByType("resource"),a=0;a<i.length;a++){var m=i[a],w=m.transferSize,O=m.initiatorType,F=m.duration;if(w&&F&&Xp(O)){for(O=0,F=m.responseEnd,a+=1;a<i.length;a++){var J=i[a],oe=J.startTime;if(oe>F)break;var de=J.transferSize,ge=J.initiatorType;de&&Xp(ge)&&(J=J.responseEnd,O+=de*(J<F?1:(F-oe)/(J-oe)))}if(--a,t+=8*(w+O)/(m.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 Su=null,bu=null;function eo(e){return e.nodeType===9?e:e.ownerDocument}function Qp(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 Jp(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 Cu(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 wu=null;function Xy(){var e=window.event;return e&&e.type==="popstate"?e===wu?!1:(wu=e,!0):(wu=null,!1)}var Zp=typeof setTimeout=="function"?setTimeout:void 0,Qy=typeof clearTimeout=="function"?clearTimeout:void 0,em=typeof Promise=="function"?Promise:void 0,Jy=typeof queueMicrotask=="function"?queueMicrotask:typeof em<"u"?function(e){return em.resolve(null).then(e).catch(Zy)}:Zp;function Zy(e){setTimeout(function(){throw e})}function sr(e){return e==="head"}function tm(e,t){var i=t,a=0;do{var m=i.nextSibling;if(e.removeChild(i),m&&m.nodeType===8)if(i=m.data,i==="/$"||i==="/&"){if(a===0){e.removeChild(m),Ms(t);return}a--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")a++;else if(i==="html")Ra(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,Ra(i);for(var w=i.firstChild;w;){var O=w.nextSibling,F=w.nodeName;w[On]||F==="SCRIPT"||F==="STYLE"||F==="LINK"&&w.rel.toLowerCase()==="stylesheet"||i.removeChild(w),w=O}}else i==="body"&&Ra(e.ownerDocument.body);i=m}while(i);Ms(t)}function nm(e,t){var i=e;e=0;do{var a=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||""),a&&a.nodeType===8)if(i=a.data,i==="/$"){if(e===0)break;e--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||e++;i=a}while(i)}function xu(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":xu(i),qr(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function e0(e,t,i,a){for(;e.nodeType===1;){var m=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[On])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(w=e.getAttribute("rel"),w==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(w!==m.rel||e.getAttribute("href")!==(m.href==null||m.href===""?null:m.href)||e.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin)||e.getAttribute("title")!==(m.title==null?null:m.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(w=e.getAttribute("src"),(w!==(m.src==null?null:m.src)||e.getAttribute("type")!==(m.type==null?null:m.type)||e.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin))&&w&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var w=m.name==null?null:""+m.name;if(m.type==="hidden"&&e.getAttribute("name")===w)return e}else return e;if(e=qn(e.nextSibling),e===null)break}return null}function t0(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=qn(e.nextSibling),e===null))return null;return e}function im(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=qn(e.nextSibling),e===null))return null;return e}function Eu(e){return e.data==="$?"||e.data==="$~"}function ku(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function n0(e,t){var i=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||i.readyState!=="loading")t();else{var a=function(){t(),i.removeEventListener("DOMContentLoaded",a)};i.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function qn(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 Au=null;function rm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(t===0)return qn(e.nextSibling);t--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||t++}e=e.nextSibling}return null}function sm(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 am(e,t,i){switch(t=eo(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 Ra(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);qr(e)}var $n=new Map,lm=new Set;function to(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Oi=W.d;W.d={f:i0,r:r0,D:s0,C:a0,L:l0,m:o0,X:u0,S:c0,M:h0};function i0(){var e=Oi.f(),t=Vl();return e||t}function r0(e){var t=gi(e);t!==null&&t.tag===5&&t.type==="form"?xd(t):Oi.r(e)}var Ts=typeof document>"u"?null:document;function om(e,t,i){var a=Ts;if(a&&typeof t=="string"&&t){var m=un(t);m='link[rel="'+e+'"][href="'+m+'"]',typeof i=="string"&&(m+='[crossorigin="'+i+'"]'),lm.has(m)||(lm.add(m),e={rel:e,crossOrigin:i,href:t},a.querySelector(m)===null&&(t=a.createElement("link"),Gt(t,"link",e),at(t),a.head.appendChild(t)))}}function s0(e){Oi.D(e),om("dns-prefetch",e,null)}function a0(e,t){Oi.C(e,t),om("preconnect",e,t)}function l0(e,t,i){Oi.L(e,t,i);var a=Ts;if(a&&e&&t){var m='link[rel="preload"][as="'+un(t)+'"]';t==="image"&&i&&i.imageSrcSet?(m+='[imagesrcset="'+un(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(m+='[imagesizes="'+un(i.imageSizes)+'"]')):m+='[href="'+un(e)+'"]';var w=m;switch(t){case"style":w=Rs(e);break;case"script":w=Ds(e)}$n.has(w)||(e=u({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),$n.set(w,e),a.querySelector(m)!==null||t==="style"&&a.querySelector(Da(w))||t==="script"&&a.querySelector(Ma(w))||(t=a.createElement("link"),Gt(t,"link",e),at(t),a.head.appendChild(t)))}}function o0(e,t){Oi.m(e,t);var i=Ts;if(i&&e){var a=t&&typeof t.as=="string"?t.as:"script",m='link[rel="modulepreload"][as="'+un(a)+'"][href="'+un(e)+'"]',w=m;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":w=Ds(e)}if(!$n.has(w)&&(e=u({rel:"modulepreload",href:e},t),$n.set(w,e),i.querySelector(m)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(Ma(w)))return}a=i.createElement("link"),Gt(a,"link",e),at(a),i.head.appendChild(a)}}}function c0(e,t,i){Oi.S(e,t,i);var a=Ts;if(a&&e){var m=_i(a).hoistableStyles,w=Rs(e);t=t||"default";var O=m.get(w);if(!O){var F={loading:0,preload:null};if(O=a.querySelector(Da(w)))F.loading=5;else{e=u({rel:"stylesheet",href:e,"data-precedence":t},i),(i=$n.get(w))&&Tu(e,i);var J=O=a.createElement("link");at(J),Gt(J,"link",e),J._p=new Promise(function(oe,de){J.onload=oe,J.onerror=de}),J.addEventListener("load",function(){F.loading|=1}),J.addEventListener("error",function(){F.loading|=2}),F.loading|=4,no(O,t,a)}O={type:"stylesheet",instance:O,count:1,state:F},m.set(w,O)}}}function u0(e,t){Oi.X(e,t);var i=Ts;if(i&&e){var a=_i(i).hoistableScripts,m=Ds(e),w=a.get(m);w||(w=i.querySelector(Ma(m)),w||(e=u({src:e,async:!0},t),(t=$n.get(m))&&Ru(e,t),w=i.createElement("script"),at(w),Gt(w,"link",e),i.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},a.set(m,w))}}function h0(e,t){Oi.M(e,t);var i=Ts;if(i&&e){var a=_i(i).hoistableScripts,m=Ds(e),w=a.get(m);w||(w=i.querySelector(Ma(m)),w||(e=u({src:e,async:!0,type:"module"},t),(t=$n.get(m))&&Ru(e,t),w=i.createElement("script"),at(w),Gt(w,"link",e),i.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},a.set(m,w))}}function cm(e,t,i,a){var m=(m=ue.current)?to(m):null;if(!m)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(t=Rs(i.href),i=_i(m).hoistableStyles,a=i.get(t),a||(a={type:"style",instance:null,count:0,state:null},i.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=Rs(i.href);var w=_i(m).hoistableStyles,O=w.get(e);if(O||(m=m.ownerDocument||m,O={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},w.set(e,O),(w=m.querySelector(Da(e)))&&!w._p&&(O.instance=w,O.state.loading=5),$n.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},$n.set(e,i),w||f0(m,e,i,O.state))),t&&a===null)throw Error(o(528,""));return O}if(t&&a!==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=Ds(i),i=_i(m).hoistableScripts,a=i.get(t),a||(a={type:"script",instance:null,count:0,state:null},i.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Rs(e){return'href="'+un(e)+'"'}function Da(e){return'link[rel="stylesheet"]['+e+"]"}function um(e){return u({},e,{"data-precedence":e.precedence,precedence:null})}function f0(e,t,i,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),Gt(t,"link",i),at(t),e.head.appendChild(t))}function Ds(e){return'[src="'+un(e)+'"]'}function Ma(e){return"script[async]"+e}function hm(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+un(i.href)+'"]');if(a)return t.instance=a,at(a),a;var m=u({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),at(a),Gt(a,"style",m),no(a,i.precedence,e),t.instance=a;case"stylesheet":m=Rs(i.href);var w=e.querySelector(Da(m));if(w)return t.state.loading|=4,t.instance=w,at(w),w;a=um(i),(m=$n.get(m))&&Tu(a,m),w=(e.ownerDocument||e).createElement("link"),at(w);var O=w;return O._p=new Promise(function(F,J){O.onload=F,O.onerror=J}),Gt(w,"link",a),t.state.loading|=4,no(w,i.precedence,e),t.instance=w;case"script":return w=Ds(i.src),(m=e.querySelector(Ma(w)))?(t.instance=m,at(m),m):(a=i,(m=$n.get(w))&&(a=u({},i),Ru(a,m)),e=e.ownerDocument||e,m=e.createElement("script"),at(m),Gt(m,"link",a),e.head.appendChild(m),t.instance=m);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,no(a,i.precedence,e));return t.instance}function no(e,t,i){for(var a=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=a.length?a[a.length-1]:null,w=m,O=0;O<a.length;O++){var F=a[O];if(F.dataset.precedence===t)w=F;else if(w!==m)break}w?w.parentNode.insertBefore(e,w.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function Tu(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 io=null;function fm(e,t,i){if(io===null){var a=new Map,m=io=new Map;m.set(i,a)}else m=io,a=m.get(i),a||(a=new Map,m.set(i,a));if(a.has(e))return a;for(a.set(e,null),i=i.getElementsByTagName(e),m=0;m<i.length;m++){var w=i[m];if(!(w[On]||w[Et]||e==="link"&&w.getAttribute("rel")==="stylesheet")&&w.namespaceURI!=="http://www.w3.org/2000/svg"){var O=w.getAttribute(t)||"";O=e+O;var F=a.get(O);F?F.push(w):a.set(O,[w])}}return a}function dm(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function d0(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 pm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function p0(e,t,i,a){if(i.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var m=Rs(a.href),w=t.querySelector(Da(m));if(w){t=w._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=ro.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=w,at(w);return}w=t.ownerDocument||t,a=um(a),(m=$n.get(m))&&Tu(a,m),w=w.createElement("link"),at(w);var O=w;O._p=new Promise(function(F,J){O.onload=F,O.onerror=J}),Gt(w,"link",a),i.instance=w}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,t),(t=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=ro.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var Du=0;function m0(e,t){return e.stylesheets&&e.count===0&&ao(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var a=setTimeout(function(){if(e.stylesheets&&ao(e,e.stylesheets),e.unsuspend){var w=e.unsuspend;e.unsuspend=null,w()}},6e4+t);0<e.imgBytes&&Du===0&&(Du=62500*Yy());var m=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ao(e,e.stylesheets),e.unsuspend)){var w=e.unsuspend;e.unsuspend=null,w()}},(e.imgBytes>Du?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(m)}}:null}function ro(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ao(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var so=null;function ao(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,so=new Map,t.forEach(g0,e),so=null,ro.call(e))}function g0(e,t){if(!(t.state.loading&4)){var i=so.get(e);if(i)var a=i.get(null);else{i=new Map,so.set(e,i);for(var m=e.querySelectorAll("link[data-precedence],style[data-precedence]"),w=0;w<m.length;w++){var O=m[w];(O.nodeName==="LINK"||O.getAttribute("media")!=="not all")&&(i.set(O.dataset.precedence,O),a=O)}a&&i.set(null,a)}m=t.instance,O=m.getAttribute("data-precedence"),w=i.get(O)||a,w===a&&i.set(null,m),i.set(O,m),this.count++,a=ro.bind(this),m.addEventListener("load",a),m.addEventListener("error",a),w?w.parentNode.insertBefore(m,w.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(m,e.firstChild)),t.state.loading|=4}}var La={$$typeof:y,Provider:null,Consumer:null,_currentValue:te,_currentValue2:te,_threadCount:0};function _0(e,t,i,a,m,w,O,F,J){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Sn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Sn(0),this.hiddenUpdates=Sn(null),this.identifierPrefix=a,this.onUncaughtError=m,this.onCaughtError=w,this.onRecoverableError=O,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=J,this.incompleteTransitions=new Map}function mm(e,t,i,a,m,w,O,F,J,oe,de,ge){return e=new _0(e,t,i,O,J,oe,de,ge,F),t=1,w===!0&&(t|=24),w=En(3,null,null,t),e.current=w,w.stateNode=e,t=cc(),t.refCount++,e.pooledCache=t,t.refCount++,w.memoizedState={element:a,isDehydrated:i,cache:t},dc(w),e}function gm(e){return e?(e=ls,e):ls}function _m(e,t,i,a,m,w){m=gm(m),a.context===null?a.context=m:a.pendingContext=m,a=Ki(t),a.payload={element:i},w=w===void 0?null:w,w!==null&&(a.callback=w),i=Yi(e,a,t),i!==null&&(gn(i,e,t),ua(i,e,t))}function vm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function Mu(e,t){vm(e,t),(e=e.alternate)&&vm(e,t)}function ym(e){if(e.tag===13||e.tag===31){var t=wr(e,67108864);t!==null&&gn(t,e,67108864),Mu(e,67108864)}}function Sm(e){if(e.tag===13||e.tag===31){var t=Dn();t=zi(t);var i=wr(e,t);i!==null&&gn(i,e,t),Mu(e,t)}}var lo=!0;function v0(e,t,i,a){var m=G.T;G.T=null;var w=W.p;try{W.p=2,Lu(e,t,i,a)}finally{W.p=w,G.T=m}}function y0(e,t,i,a){var m=G.T;G.T=null;var w=W.p;try{W.p=8,Lu(e,t,i,a)}finally{W.p=w,G.T=m}}function Lu(e,t,i,a){if(lo){var m=Ou(a);if(m===null)vu(e,t,a,oo,i),Cm(e,a);else if(b0(m,e,t,i,a))a.stopPropagation();else if(Cm(e,a),t&4&&-1<S0.indexOf(e)){for(;m!==null;){var w=gi(m);if(w!==null)switch(w.tag){case 3:if(w=w.stateNode,w.current.memoizedState.isDehydrated){var O=on(w.pendingLanes);if(O!==0){var F=w;for(F.pendingLanes|=2,F.entangledLanes|=2;O;){var J=1<<31-Xe(O);F.entanglements[1]|=J,O&=~J}hi(w),(Ze&6)===0&&($l=et()+500,ka(0))}}break;case 31:case 13:F=wr(w,2),F!==null&&gn(F,w,2),Vl(),Mu(w,2)}if(w=Ou(a),w===null&&vu(e,t,a,oo,i),w===m)break;m=w}m!==null&&a.stopPropagation()}else vu(e,t,a,null,i)}}function Ou(e){return e=Xs(e),Bu(e)}var oo=null;function Bu(e){if(oo=null,e=cn(e),e!==null){var t=g(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=l(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 oo=e,null}function bm(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(Lt()){case fe:return 2;case Se:return 8;case xe:case Le:return 32;case Be:return 268435456;default:return 32}default:return 32}}var ju=!1,ar=null,lr=null,or=null,Oa=new Map,Ba=new Map,cr=[],S0="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 Cm(e,t){switch(e){case"focusin":case"focusout":ar=null;break;case"dragenter":case"dragleave":lr=null;break;case"mouseover":case"mouseout":or=null;break;case"pointerover":case"pointerout":Oa.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ba.delete(t.pointerId)}}function ja(e,t,i,a,m,w){return e===null||e.nativeEvent!==w?(e={blockedOn:t,domEventName:i,eventSystemFlags:a,nativeEvent:w,targetContainers:[m]},t!==null&&(t=gi(t),t!==null&&ym(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,m!==null&&t.indexOf(m)===-1&&t.push(m),e)}function b0(e,t,i,a,m){switch(t){case"focusin":return ar=ja(ar,e,t,i,a,m),!0;case"dragenter":return lr=ja(lr,e,t,i,a,m),!0;case"mouseover":return or=ja(or,e,t,i,a,m),!0;case"pointerover":var w=m.pointerId;return Oa.set(w,ja(Oa.get(w)||null,e,t,i,a,m)),!0;case"gotpointercapture":return w=m.pointerId,Ba.set(w,ja(Ba.get(w)||null,e,t,i,a,m)),!0}return!1}function wm(e){var t=cn(e.target);if(t!==null){var i=g(t);if(i!==null){if(t=i.tag,t===13){if(t=f(i),t!==null){e.blockedOn=t,tl(e.priority,function(){Sm(i)});return}}else if(t===31){if(t=l(i),t!==null){e.blockedOn=t,tl(e.priority,function(){Sm(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 co(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 a=new i.constructor(i.type,i);Bn=a,i.target.dispatchEvent(a),Bn=null}else return t=gi(i),t!==null&&ym(t),e.blockedOn=i,!1;t.shift()}return!0}function xm(e,t,i){co(e)&&i.delete(t)}function C0(){ju=!1,ar!==null&&co(ar)&&(ar=null),lr!==null&&co(lr)&&(lr=null),or!==null&&co(or)&&(or=null),Oa.forEach(xm),Ba.forEach(xm)}function uo(e,t){e.blockedOn===t&&(e.blockedOn=null,ju||(ju=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,C0)))}var ho=null;function Em(e){ho!==e&&(ho=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){ho===e&&(ho=null);for(var t=0;t<e.length;t+=3){var i=e[t],a=e[t+1],m=e[t+2];if(typeof a!="function"){if(Bu(a||i)===null)continue;break}var w=gi(i);w!==null&&(e.splice(t,3),t-=3,Oc(w,{pending:!0,data:m,method:i.method,action:a},a,m))}}))}function Ms(e){function t(J){return uo(J,e)}ar!==null&&uo(ar,e),lr!==null&&uo(lr,e),or!==null&&uo(or,e),Oa.forEach(t),Ba.forEach(t);for(var i=0;i<cr.length;i++){var a=cr[i];a.blockedOn===e&&(a.blockedOn=null)}for(;0<cr.length&&(i=cr[0],i.blockedOn===null);)wm(i),i.blockedOn===null&&cr.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(a=0;a<i.length;a+=3){var m=i[a],w=i[a+1],O=m[It]||null;if(typeof w=="function")O||Em(i);else if(O){var F=null;if(w&&w.hasAttribute("formAction")){if(m=w,O=w[It]||null)F=O.formAction;else if(Bu(m)!==null)continue}else F=O.action;typeof F=="function"?i[a+1]=F:(i.splice(a,3),a-=3),Em(i)}}}function km(){function e(w){w.canIntercept&&w.info==="react-transition"&&w.intercept({handler:function(){return new Promise(function(O){return m=O})},focusReset:"manual",scroll:"manual"})}function t(){m!==null&&(m(),m=null),a||setTimeout(i,20)}function i(){if(!a&&!navigation.transition){var w=navigation.currentEntry;w&&w.url!=null&&navigation.navigate(w.url,{state:w.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var a=!1,m=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(i,100),function(){a=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),m!==null&&(m(),m=null)}}}function Nu(e){this._internalRoot=e}fo.prototype.render=Nu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var i=t.current,a=Dn();_m(i,a,e,t,null,null)},fo.prototype.unmount=Nu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;_m(e.current,2,null,e,null,null),Vl(),t[Xn]=null}};function fo(e){this._internalRoot=e}fo.prototype.unstable_scheduleHydration=function(e){if(e){var t=Yn();e={blockedOn:null,target:e,priority:t};for(var i=0;i<cr.length&&t!==0&&t<cr[i].priority;i++);cr.splice(i,0,e),i===0&&wm(e)}};var Am=r.version;if(Am!=="19.2.6")throw Error(o(527,Am,"19.2.6"));W.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?p(e):null,e=e===null?null:e.stateNode,e};var w0={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:G,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var po=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!po.isDisabled&&po.supportsFiber)try{vt=po.inject(w0),_t=po}catch{}}return Ha.createRoot=function(e,t){if(!d(e))throw Error(o(299));var i=!1,a="",m=Bd,w=jd,O=Nd;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(m=t.onUncaughtError),t.onCaughtError!==void 0&&(w=t.onCaughtError),t.onRecoverableError!==void 0&&(O=t.onRecoverableError)),t=mm(e,1,!1,null,null,i,a,null,m,w,O,km),e[Xn]=t.current,_u(e),new Nu(t)},Ha.hydrateRoot=function(e,t,i){if(!d(e))throw Error(o(299));var a=!1,m="",w=Bd,O=jd,F=Nd,J=null;return i!=null&&(i.unstable_strictMode===!0&&(a=!0),i.identifierPrefix!==void 0&&(m=i.identifierPrefix),i.onUncaughtError!==void 0&&(w=i.onUncaughtError),i.onCaughtError!==void 0&&(O=i.onCaughtError),i.onRecoverableError!==void 0&&(F=i.onRecoverableError),i.formState!==void 0&&(J=i.formState)),t=mm(e,1,!0,t,i??null,a,m,J,w,O,F,km),t.context=gm(null),i=t.current,a=Dn(),a=zi(a),m=Ki(a),m.callback=null,Yi(i,m,a),i=a,t.current.lanes=i,zt(t,i),hi(t),e[Xn]=t.current,_u(e),new fo(t)},Ha.version="19.2.6",Ha}var zm;function j0(){if(zm)return Iu.exports;zm=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(),Iu.exports=B0(),Iu.exports}var N0=j0();const Ur=function(n,r){let d=n;const g=qa[r];let f=null,l=0,c=null;const h=[],p={},u=function(R,k){l=d*4+17,f=(function(M){const B=new Array(M);for(let H=0;H<M;H+=1){B[H]=new Array(M);for(let U=0;U<M;U+=1)B[H][U]=null}return B})(l),b(0,0),b(l-7,0),b(0,l-7),E(),T(),v(R,k),d>=7&&S(R),c==null&&(c=A(d,g,h)),_(c,k)},b=function(R,k){for(let M=-1;M<=7;M+=1)if(!(R+M<=-1||l<=R+M))for(let B=-1;B<=7;B+=1)k+B<=-1||l<=k+B||(0<=M&&M<=6&&(B==0||B==6)||0<=B&&B<=6&&(M==0||M==6)||2<=M&&M<=4&&2<=B&&B<=4?f[R+M][k+B]=!0:f[R+M][k+B]=!1)},C=function(){let R=0,k=0;for(let M=0;M<8;M+=1){u(!0,M);const B=fr.getLostPoint(p);(M==0||R>B)&&(R=B,k=M)}return k},T=function(){for(let R=8;R<l-8;R+=1)f[R][6]==null&&(f[R][6]=R%2==0);for(let R=8;R<l-8;R+=1)f[6][R]==null&&(f[6][R]=R%2==0)},E=function(){const R=fr.getPatternPosition(d);for(let k=0;k<R.length;k+=1)for(let M=0;M<R.length;M+=1){const B=R[k],H=R[M];if(f[B][H]==null)for(let U=-2;U<=2;U+=1)for(let P=-2;P<=2;P+=1)U==-2||U==2||P==-2||P==2||U==0&&P==0?f[B+U][H+P]=!0:f[B+U][H+P]=!1}},S=function(R){const k=fr.getBCHTypeNumber(d);for(let M=0;M<18;M+=1){const B=!R&&(k>>M&1)==1;f[Math.floor(M/3)][M%3+l-8-3]=B}for(let M=0;M<18;M+=1){const B=!R&&(k>>M&1)==1;f[M%3+l-8-3][Math.floor(M/3)]=B}},v=function(R,k){const M=g<<3|k,B=fr.getBCHTypeInfo(M);for(let H=0;H<15;H+=1){const U=!R&&(B>>H&1)==1;H<6?f[H][8]=U:H<8?f[H+1][8]=U:f[l-15+H][8]=U}for(let H=0;H<15;H+=1){const U=!R&&(B>>H&1)==1;H<8?f[8][l-H-1]=U:H<9?f[8][15-H-1+1]=U:f[8][15-H-1]=U}f[l-8][8]=!R},_=function(R,k){let M=-1,B=l-1,H=7,U=0;const P=fr.getMaskFunction(k);for(let K=l-1;K>0;K-=2)for(K==6&&(K-=1);;){for(let X=0;X<2;X+=1)if(f[B][K-X]==null){let G=!1;U<R.length&&(G=(R[U]>>>H&1)==1),P(B,K-X)&&(G=!G),f[B][K-X]=G,H-=1,H==-1&&(U+=1,H=7)}if(B+=M,B<0||l<=B){B-=M,M=-M;break}}},y=function(R,k){let M=0,B=0,H=0;const U=new Array(k.length),P=new Array(k.length);for(let W=0;W<k.length;W+=1){const te=k[W].dataCount,z=k[W].totalCount-te;B=Math.max(B,te),H=Math.max(H,z),U[W]=new Array(te);for(let I=0;I<U[W].length;I+=1)U[W][I]=255&R.getBuffer()[I+M];M+=te;const j=fr.getErrorCorrectPolynomial(z),$=Ka(U[W],j.getLength()-1).mod(j);P[W]=new Array(j.getLength()-1);for(let I=0;I<P[W].length;I+=1){const se=I+$.getLength()-P[W].length;P[W][I]=se>=0?$.getAt(se):0}}let K=0;for(let W=0;W<k.length;W+=1)K+=k[W].totalCount;const X=new Array(K);let G=0;for(let W=0;W<B;W+=1)for(let te=0;te<k.length;te+=1)W<U[te].length&&(X[G]=U[te][W],G+=1);for(let W=0;W<H;W+=1)for(let te=0;te<k.length;te+=1)W<P[te].length&&(X[G]=P[te][W],G+=1);return X},A=function(R,k,M){const B=Im.getRSBlocks(R,k),H=Um();for(let P=0;P<M.length;P+=1){const K=M[P];H.put(K.getMode(),4),H.put(K.getLength(),fr.getLengthInBits(K.getMode(),R)),K.write(H)}let U=0;for(let P=0;P<B.length;P+=1)U+=B[P].dataCount;if(H.getLengthInBits()>U*8)throw"code length overflow. ("+H.getLengthInBits()+">"+U*8+")";for(H.getLengthInBits()+4<=U*8&&H.put(0,4);H.getLengthInBits()%8!=0;)H.putBit(!1);for(;!(H.getLengthInBits()>=U*8||(H.put(236,8),H.getLengthInBits()>=U*8));)H.put(17,8);return y(H,B)};p.addData=function(R,k){k=k||"Byte";let M=null;switch(k){case"Numeric":M=H0(R);break;case"Alphanumeric":M=z0(R);break;case"Byte":M=I0(R);break;case"Kanji":M=U0(R);break;default:throw"mode:"+k}h.push(M),c=null},p.isDark=function(R,k){if(R<0||l<=R||k<0||l<=k)throw R+","+k;return f[R][k]},p.getModuleCount=function(){return l},p.make=function(){if(d<1){let R=1;for(;R<40;R++){const k=Im.getRSBlocks(R,g),M=Um();for(let H=0;H<h.length;H++){const U=h[H];M.put(U.getMode(),4),M.put(U.getLength(),fr.getLengthInBits(U.getMode(),R)),U.write(M)}let B=0;for(let H=0;H<k.length;H++)B+=k[H].dataCount;if(M.getLengthInBits()<=B*8)break}d=R}u(!1,C())},p.createTableTag=function(R,k){R=R||2,k=typeof k>"u"?R*4:k;let M="";M+='<table style="',M+=" border-width: 0px; border-style: none;",M+=" border-collapse: collapse;",M+=" padding: 0px; margin: "+k+"px;",M+='">',M+="<tbody>";for(let B=0;B<p.getModuleCount();B+=1){M+="<tr>";for(let H=0;H<p.getModuleCount();H+=1)M+='<td style="',M+=" border-width: 0px; border-style: none;",M+=" border-collapse: collapse;",M+=" padding: 0px; margin: 0px;",M+=" width: "+R+"px;",M+=" height: "+R+"px;",M+=" background-color: ",M+=p.isDark(B,H)?"#000000":"#ffffff",M+=";",M+='"/>';M+="</tr>"}return M+="</tbody>",M+="</table>",M},p.createSvgTag=function(R,k,M,B){let H={};typeof arguments[0]=="object"&&(H=arguments[0],R=H.cellSize,k=H.margin,M=H.alt,B=H.title),R=R||2,k=typeof k>"u"?R*4:k,M=typeof M=="string"?{text:M}:M||{},M.text=M.text||null,M.id=M.text?M.id||"qrcode-description":null,B=typeof B=="string"?{text:B}:B||{},B.text=B.text||null,B.id=B.text?B.id||"qrcode-title":null;const U=p.getModuleCount()*R+k*2;let P,K,X,G,W="",te;for(te="l"+R+",0 0,"+R+" -"+R+",0 0,-"+R+"z ",W+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',W+=H.scalable?"":' width="'+U+'px" height="'+U+'px"',W+=' viewBox="0 0 '+U+" "+U+'" ',W+=' preserveAspectRatio="xMinYMin meet"',W+=B.text||M.text?' role="img" aria-labelledby="'+L([B.id,M.id].join(" ").trim())+'"':"",W+=">",W+=B.text?'<title id="'+L(B.id)+'">'+L(B.text)+"</title>":"",W+=M.text?'<description id="'+L(M.id)+'">'+L(M.text)+"</description>":"",W+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',W+='<path d="',X=0;X<p.getModuleCount();X+=1)for(G=X*R+k,P=0;P<p.getModuleCount();P+=1)p.isDark(X,P)&&(K=P*R+k,W+="M"+K+","+G+te);return W+='" stroke="transparent" fill="black"/>',W+="</svg>",W},p.createDataURL=function(R,k){R=R||2,k=typeof k>"u"?R*4:k;const M=p.getModuleCount()*R+k*2,B=k,H=M-k;return $0(M,M,function(U,P){if(B<=U&&U<H&&B<=P&&P<H){const K=Math.floor((U-B)/R),X=Math.floor((P-B)/R);return p.isDark(X,K)?0:1}else return 1})},p.createImgTag=function(R,k,M){R=R||2,k=typeof k>"u"?R*4:k;const B=p.getModuleCount()*R+k*2;let H="";return H+="<img",H+=' src="',H+=p.createDataURL(R,k),H+='"',H+=' width="',H+=B,H+='"',H+=' height="',H+=B,H+='"',M&&(H+=' alt="',H+=L(M),H+='"'),H+="/>",H};const L=function(R){let k="";for(let M=0;M<R.length;M+=1){const B=R.charAt(M);switch(B){case"<":k+="<";break;case">":k+=">";break;case"&":k+="&";break;case'"':k+=""";break;default:k+=B;break}}return k},D=function(R){R=typeof R>"u"?2:R;const M=p.getModuleCount()*1+R*2,B=R,H=M-R;let U,P,K,X,G;const W={"██":"█","█ ":"▀"," █":"▄"," ":" "},te={"██":"▀","█ ":"▀"," █":" "," ":" "};let z="";for(U=0;U<M;U+=2){for(K=Math.floor((U-B)/1),X=Math.floor((U+1-B)/1),P=0;P<M;P+=1)G="█",B<=P&&P<H&&B<=U&&U<H&&p.isDark(K,Math.floor((P-B)/1))&&(G=" "),B<=P&&P<H&&B<=U+1&&U+1<H&&p.isDark(X,Math.floor((P-B)/1))?G+=" ":G+="█",z+=R<1&&U+1>=H?te[G]:W[G];z+=`
|
|
50
|
-
`}return M%2&&R>0?z.substring(0,z.length-M-1)+Array(M+1).join("▀"):z.substring(0,z.length-1)};return p.createASCII=function(R,k){if(R=R||1,R<2)return D(k);R-=1,k=typeof k>"u"?R*2:k;const M=p.getModuleCount()*R+k*2,B=k,H=M-k;let U,P,K,X;const G=Array(R+1).join("██"),W=Array(R+1).join(" ");let te="",z="";for(U=0;U<M;U+=1){for(K=Math.floor((U-B)/R),z="",P=0;P<M;P+=1)X=1,B<=P&&P<H&&B<=U&&U<H&&p.isDark(K,Math.floor((P-B)/R))&&(X=0),z+=X?G:W;for(K=0;K<R;K+=1)te+=z+`
|
|
51
|
-
`}return te.substring(0,te.length-1)},p.renderTo2dContext=function(R,k){k=k||2;const M=p.getModuleCount();for(let B=0;B<M;B++)for(let H=0;H<M;H++)R.fillStyle=p.isDark(B,H)?"black":"white",R.fillRect(H*k,B*k,k,k)},p};Ur.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};Ur.createStringToBytes=function(n,r){const s=(function(){const d=F0(n),g=function(){const c=d.read();if(c==-1)throw"eof";return c};let f=0;const l={};for(;;){const c=d.read();if(c==-1)break;const h=g(),p=g(),u=g(),b=String.fromCharCode(c<<8|h),C=p<<8|u;l[b]=C,f+=1}if(f!=r)throw f+" != "+r;return l})(),o=63;return function(d){const g=[];for(let f=0;f<d.length;f+=1){const l=d.charCodeAt(f);if(l<128)g.push(l);else{const c=s[d.charAt(f)];typeof c=="number"?(c&255)==c?g.push(c):(g.push(c>>>8),g.push(c&255)):g.push(o)}}return g}};const Qt={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},qa={L:1,M:0,Q:3,H:2},hr={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},fr=(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={},g=function(f){let l=0;for(;f!=0;)l+=1,f>>>=1;return l};return d.getBCHTypeInfo=function(f){let l=f<<10;for(;g(l)-g(r)>=0;)l^=r<<g(l)-g(r);return(f<<10|l)^o},d.getBCHTypeNumber=function(f){let l=f<<12;for(;g(l)-g(s)>=0;)l^=s<<g(l)-g(s);return f<<12|l},d.getPatternPosition=function(f){return n[f-1]},d.getMaskFunction=function(f){switch(f){case hr.PATTERN000:return function(l,c){return(l+c)%2==0};case hr.PATTERN001:return function(l,c){return l%2==0};case hr.PATTERN010:return function(l,c){return c%3==0};case hr.PATTERN011:return function(l,c){return(l+c)%3==0};case hr.PATTERN100:return function(l,c){return(Math.floor(l/2)+Math.floor(c/3))%2==0};case hr.PATTERN101:return function(l,c){return l*c%2+l*c%3==0};case hr.PATTERN110:return function(l,c){return(l*c%2+l*c%3)%2==0};case hr.PATTERN111:return function(l,c){return(l*c%3+(l+c)%2)%2==0};default:throw"bad maskPattern:"+f}},d.getErrorCorrectPolynomial=function(f){let l=Ka([1],0);for(let c=0;c<f;c+=1)l=l.multiply(Ka([1,pr.gexp(c)],0));return l},d.getLengthInBits=function(f,l){if(1<=l&&l<10)switch(f){case Qt.MODE_NUMBER:return 10;case Qt.MODE_ALPHA_NUM:return 9;case Qt.MODE_8BIT_BYTE:return 8;case Qt.MODE_KANJI:return 8;default:throw"mode:"+f}else if(l<27)switch(f){case Qt.MODE_NUMBER:return 12;case Qt.MODE_ALPHA_NUM:return 11;case Qt.MODE_8BIT_BYTE:return 16;case Qt.MODE_KANJI:return 10;default:throw"mode:"+f}else if(l<41)switch(f){case Qt.MODE_NUMBER:return 14;case Qt.MODE_ALPHA_NUM:return 13;case Qt.MODE_8BIT_BYTE:return 16;case Qt.MODE_KANJI:return 12;default:throw"mode:"+f}else throw"type:"+l},d.getLostPoint=function(f){const l=f.getModuleCount();let c=0;for(let u=0;u<l;u+=1)for(let b=0;b<l;b+=1){let C=0;const T=f.isDark(u,b);for(let E=-1;E<=1;E+=1)if(!(u+E<0||l<=u+E))for(let S=-1;S<=1;S+=1)b+S<0||l<=b+S||E==0&&S==0||T==f.isDark(u+E,b+S)&&(C+=1);C>5&&(c+=3+C-5)}for(let u=0;u<l-1;u+=1)for(let b=0;b<l-1;b+=1){let C=0;f.isDark(u,b)&&(C+=1),f.isDark(u+1,b)&&(C+=1),f.isDark(u,b+1)&&(C+=1),f.isDark(u+1,b+1)&&(C+=1),(C==0||C==4)&&(c+=3)}for(let u=0;u<l;u+=1)for(let b=0;b<l-6;b+=1)f.isDark(u,b)&&!f.isDark(u,b+1)&&f.isDark(u,b+2)&&f.isDark(u,b+3)&&f.isDark(u,b+4)&&!f.isDark(u,b+5)&&f.isDark(u,b+6)&&(c+=40);for(let u=0;u<l;u+=1)for(let b=0;b<l-6;b+=1)f.isDark(b,u)&&!f.isDark(b+1,u)&&f.isDark(b+2,u)&&f.isDark(b+3,u)&&f.isDark(b+4,u)&&!f.isDark(b+5,u)&&f.isDark(b+6,u)&&(c+=40);let h=0;for(let u=0;u<l;u+=1)for(let b=0;b<l;b+=1)f.isDark(b,u)&&(h+=1);const p=Math.abs(100*h/l/l-50)/5;return c+=p*10,c},d})(),pr=(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})(),Ka=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 g=new Array(n.length-d+r);for(let f=0;f<n.length-d;f+=1)g[f]=n[f+d];return g})(),o={};return o.getAt=function(d){return s[d]},o.getLength=function(){return s.length},o.multiply=function(d){const g=new Array(o.getLength()+d.getLength()-1);for(let f=0;f<o.getLength();f+=1)for(let l=0;l<d.getLength();l+=1)g[f+l]^=pr.gexp(pr.glog(o.getAt(f))+pr.glog(d.getAt(l)));return Ka(g,0)},o.mod=function(d){if(o.getLength()-d.getLength()<0)return o;const g=pr.glog(o.getAt(0))-pr.glog(d.getAt(0)),f=new Array(o.getLength());for(let l=0;l<o.getLength();l+=1)f[l]=o.getAt(l);for(let l=0;l<d.getLength();l+=1)f[l]^=pr.gexp(pr.glog(d.getAt(l))+g);return Ka(f,0).mod(d)},o},Im=(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,g){const f={};return f.totalCount=d,f.dataCount=g,f},s={},o=function(d,g){switch(g){case qa.L:return n[(d-1)*4+0];case qa.M:return n[(d-1)*4+1];case qa.Q:return n[(d-1)*4+2];case qa.H:return n[(d-1)*4+3];default:return}};return s.getRSBlocks=function(d,g){const f=o(d,g);if(typeof f>"u")throw"bad rs block @ typeNumber:"+d+"/errorCorrectionLevel:"+g;const l=f.length/3,c=[];for(let h=0;h<l;h+=1){const p=f[h*3+0],u=f[h*3+1],b=f[h*3+2];for(let C=0;C<p;C+=1)c.push(r(u,b))}return c},s})(),Um=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 g=0;g<d;g+=1)s.putBit((o>>>d-g-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},H0=function(n){const r=Qt.MODE_NUMBER,s=n,o={};o.getMode=function(){return r},o.getLength=function(f){return s.length},o.write=function(f){const l=s;let c=0;for(;c+2<l.length;)f.put(d(l.substring(c,c+3)),10),c+=3;c<l.length&&(l.length-c==1?f.put(d(l.substring(c,c+1)),4):l.length-c==2&&f.put(d(l.substring(c,c+2)),7))};const d=function(f){let l=0;for(let c=0;c<f.length;c+=1)l=l*10+g(f.charAt(c));return l},g=function(f){if("0"<=f&&f<="9")return f.charCodeAt(0)-48;throw"illegal char :"+f};return o},z0=function(n){const r=Qt.MODE_ALPHA_NUM,s=n,o={};o.getMode=function(){return r},o.getLength=function(g){return s.length},o.write=function(g){const f=s;let l=0;for(;l+1<f.length;)g.put(d(f.charAt(l))*45+d(f.charAt(l+1)),11),l+=2;l<f.length&&g.put(d(f.charAt(l)),6)};const d=function(g){if("0"<=g&&g<="9")return g.charCodeAt(0)-48;if("A"<=g&&g<="Z")return g.charCodeAt(0)-65+10;switch(g){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 :"+g}};return o},I0=function(n){const r=Qt.MODE_8BIT_BYTE,s=Ur.stringToBytes(n),o={};return o.getMode=function(){return r},o.getLength=function(d){return s.length},o.write=function(d){for(let g=0;g<s.length;g+=1)d.put(s[g],8)},o},U0=function(n){const r=Qt.MODE_KANJI,s=Ur.stringToBytes;(function(g,f){const l=s(g);if(l.length!=2||(l[0]<<8|l[1])!=f)throw"sjis not supported."})("友",38726);const o=s(n),d={};return d.getMode=function(){return r},d.getLength=function(g){return~~(o.length/2)},d.write=function(g){const f=o;let l=0;for(;l+1<f.length;){let c=(255&f[l])<<8|255&f[l+1];if(33088<=c&&c<=40956)c-=33088;else if(57408<=c&&c<=60351)c-=49472;else throw"illegal char at "+(l+1)+"/"+c;c=(c>>>8&255)*192+(c&255),g.put(c,13),l+=2}if(l<f.length)throw"illegal char at "+(l+1)},d},Zg=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 g=0;g<d;g+=1)r.writeByte(s[g+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},P0=function(){let n=0,r=0,s=0,o="";const d={},g=function(l){o+=String.fromCharCode(f(l&63))},f=function(l){if(l<0)throw"n:"+l;if(l<26)return 65+l;if(l<52)return 97+(l-26);if(l<62)return 48+(l-52);if(l==62)return 43;if(l==63)return 47;throw"n:"+l};return d.writeByte=function(l){for(n=n<<8|l&255,r+=8,s+=1;r>=6;)g(n>>>r-6),r-=6},d.flush=function(){if(r>0&&(g(n<<6-r),n=0,r=0),s%3!=0){const l=3-s%3;for(let c=0;c<l;c+=1)o+="="}},d.toString=function(){return o},d},F0=function(n){const r=n;let s=0,o=0,d=0;const g={};g.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 l=o>>>d-8&255;return d-=8,l};const f=function(l){if(65<=l&&l<=90)return l-65;if(97<=l&&l<=122)return l-97+26;if(48<=l&&l<=57)return l-48+52;if(l==43)return 62;if(l==47)return 63;throw"c:"+l};return g},q0=function(n,r){const s=n,o=r,d=new Array(n*r),g={};g.setPixel=function(h,p,u){d[p*s+h]=u},g.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 p=2,u=l(p);h.writeByte(p);let b=0;for(;u.length-b>255;)h.writeByte(255),h.writeBytes(u,b,255),b+=255;h.writeByte(u.length-b),h.writeBytes(u,b,u.length-b),h.writeByte(0),h.writeString(";")};const f=function(h){const p=h;let u=0,b=0;const C={};return C.write=function(T,E){if(T>>>E)throw"length over";for(;u+E>=8;)p.writeByte(255&(T<<u|b)),E-=8-u,T>>>=8-u,b=0,u=0;b=T<<u|b,u=u+E},C.flush=function(){u>0&&p.writeByte(b)},C},l=function(h){const p=1<<h,u=(1<<h)+1;let b=h+1;const C=c();for(let _=0;_<p;_+=1)C.add(String.fromCharCode(_));C.add(String.fromCharCode(p)),C.add(String.fromCharCode(u));const T=Zg(),E=f(T);E.write(p,b);let S=0,v=String.fromCharCode(d[S]);for(S+=1;S<d.length;){const _=String.fromCharCode(d[S]);S+=1,C.contains(v+_)?v=v+_:(E.write(C.indexOf(v),b),C.size()<4095&&(C.size()==1<<b&&(b+=1),C.add(v+_)),v=_)}return E.write(C.indexOf(v),b),E.write(u,b),E.flush(),T.toByteArray()},c=function(){const h={};let p=0;const u={};return u.add=function(b){if(u.contains(b))throw"dup key:"+b;h[b]=p,p+=1},u.size=function(){return p},u.indexOf=function(b){return h[b]},u.contains=function(b){return typeof h[b]<"u"},u};return g},$0=function(n,r,s){const o=q0(n,r);for(let l=0;l<r;l+=1)for(let c=0;c<n;c+=1)o.setPixel(c,l,s(c,l));const d=Zg();o.write(d);const g=P0(),f=d.toByteArray();for(let l=0;l<f.length;l+=1)g.writeByte(f[l]);return g.flush(),"data:image/gif;base64,"+g};Ur.stringToBytes;const zs=[{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}],e_={name:"gate-reviewer",label:"Gate Reviewer",commandAgent:"gate-reviewer",dispatchable:!1},Us=[...zs,e_],G0={name:"translator",label:"Translator",commandAgent:"translator",dispatchable:!1},V0={name:"harness-engineer",label:"Harness Engineer",commandAgent:"harness-engineer",dispatchable:!1},t_=[G0,V0],Dh=[...Us,...t_];zs.map(n=>n.name);const Mh=Us.map(n=>n.name);t_.map(n=>n.name);Dh.map(n=>n.name);Dh.filter(n=>n.dispatchable).map(n=>n.name);function W0(n){return Mh.includes(n)}const K0="zh-CN",Y0="pm-final-only",n_=[{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"}],X0=[{value:"pm-final-only",label:"PM final reply"},{value:"final-only",label:"Each role final reply"},{value:"all",label:"All replies"}];function Q0(){const n={};for(const r of Mh)n[r]={permissionMode:"bypassPermissions",model:"default",effort:"default"};return{version:1,roles:n,autoOrchestration:!0}}function J0({sidebar:n,children:r}){const[s,o]=ne.useState(!1);return x.jsxs("div",{className:s?"app-shell is-sidebar-collapsed":"app-shell",children:[x.jsxs("aside",{className:"app-sidebar",children:[x.jsx("button",{className:"sidebar-toggle",type:"button","aria-label":s?"Expand sidebar":"Collapse sidebar",title:s?"Expand sidebar":"Collapse sidebar",onClick:()=>o(d=>!d)}),x.jsx("div",{className:"sidebar-content",children:n})]}),x.jsx("main",{className:"app-main",children:r})]})}function Z0({busy:n,state:r,onApprove:s,onCancel:o,onComment:d,onReject:g}){var _;const[f,l]=ne.useState(!1),[c,h]=ne.useState(""),[p,u]=ne.useState(null);if(!r||r.status==="idle")return null;const b=r.active,C=e1(r);if(p===C)return null;const T=r.status==="awaiting_user_approval",E=(b==null?void 0:b.title)??((_=r.pending[0])==null?void 0:_.title)??"Harness feedback",S=(b==null?void 0:b.source)==="task-retrospective"?"Task Harness Review":"Harness Feedback",v=()=>{l(!1),u(C)};return x.jsxs(x.Fragment,{children:[x.jsxs("section",{className:T?"harness-feedback-float needs-review":"harness-feedback-float",children:[x.jsxs("div",{children:[x.jsx("strong",{children:T?`${S} needed`:S}),x.jsx("span",{children:t1(r)})]}),x.jsx("p",{title:E,children:E}),x.jsxs("div",{className:"harness-feedback-float-actions",children:[x.jsx("button",{type:"button",disabled:n,onClick:v,children:"Close"}),x.jsx("button",{type:"button",disabled:n||!b,onClick:()=>l(!0),children:T?"Review":"Open"})]})]}),f&&b?x.jsx("div",{className:"modal-backdrop harness-feedback-backdrop",children:x.jsxs("section",{className:"harness-feedback-modal",role:"dialog","aria-modal":"true","aria-label":"Harness feedback review",children:[x.jsxs("header",{children:[x.jsxs("div",{children:[x.jsx("h2",{children:S}),x.jsxs("p",{className:"muted",children:[r.status.replaceAll("_"," ")," · queued ",r.queuedCount]})]}),x.jsx("button",{type:"button",onClick:()=>l(!1),children:"Close"})]}),x.jsxs("div",{className:"harness-feedback-modal-body",children:[x.jsxs("section",{children:[x.jsx("h3",{children:b.source==="task-retrospective"?"Task Retrospective Request":"Feedback"}),x.jsx("pre",{children:b.feedbackContent||"No feedback content found."})]}),x.jsxs("section",{children:[x.jsx("h3",{children:"Harness Engineer Analysis"}),x.jsx("pre",{children:b.analysisContent||"Analysis is not available yet."})]})]}),T?x.jsxs("footer",{className:"harness-feedback-review-actions",children:[x.jsx("textarea",{value:c,placeholder:"Optional note for Harness Engineer...",onChange:y=>h(y.target.value)}),x.jsxs("div",{children:[x.jsx("button",{type:"button",disabled:n,onClick:()=>d(c),children:"Send Feedback"}),x.jsx("button",{type:"button",disabled:n,onClick:()=>g(c),children:"Reject"}),x.jsx("button",{type:"button",disabled:n,onClick:()=>s(c),children:"Approve"})]})]}):b?x.jsxs("footer",{className:"harness-feedback-review-actions",children:[x.jsx("textarea",{value:c,placeholder:"Optional cancellation note...",onChange:y=>h(y.target.value)}),x.jsx("div",{children:x.jsx("button",{type:"button",disabled:n,onClick:()=>o(c),children:"Cancel"})})]}):null]})}):null]})}function e1(n){if(n.active)return["active",n.status,n.active.id,n.active.path,n.active.updatedAt??"",n.active.analysisPath??"",n.active.applyReportPath??""].join(":");const r=n.pending[0];return r?["pending",n.status,r.id,r.path,n.queuedCount].join(":"):[n.status,n.queuedCount].join(":")}function t1(n){return n.status==="queued"?`${n.queuedCount} queued`:n.status==="awaiting_user_approval"?"waiting for approval":n.status==="analyzing"?"Harness Engineer analyzing":n.status==="applying"?"Harness Engineer applying":n.status}function Mo(n,r="Unknown error."){if(n instanceof Error)return n.message||r;if(typeof n=="string"&&n.trim())return n;if(n===void 0)return r;try{return JSON.stringify(n)}catch{return String(n)}}function pt(n,r,s){return`${n} failed. Reason: ${Mo(r,s)}`}function wo(n,r){return r.some(s=>n.startsWith(`${s} failed.`))?"":n}const ye={getAppPreferences(){return Ce("/api/settings/preferences")},updateAppPreferences(n){return Ce("/api/settings/preferences",{method:"PUT",body:JSON.stringify(n)})},getRuntimeDiagnostics(){return Ce("/api/diagnostics/runtime")},getCurrentProject(){return Ce("/api/projects/current")},pullCurrentProject(){return Ce("/api/projects/current/pull",{method:"POST"})},getRecentRepositoryPaths(){return Ce("/api/projects/recent")},connectProject(n){return Ce("/api/projects/connect",{method:"POST",body:JSON.stringify(n)})},listTasks(){return Ce("/api/tasks")},createTask(n){return Ce("/api/tasks",{method:"POST",body:JSON.stringify(n)})},cleanupTask(n,r={}){return Ce(`/api/tasks/${encodeURIComponent(n)}/cleanup`,{method:"POST",body:JSON.stringify(r)})},getHarnessStatus(n){const r=new URLSearchParams({taskSlug:n});return Ce(`/api/projects/harness?${r.toString()}`)},applyHarness(n){return Ce("/api/projects/harness/apply",{method:"POST",body:JSON.stringify(n)})},getHarnessFileContent(n,r){const s=new URLSearchParams({path:r,taskSlug:n});return Ce(`/api/projects/harness/file?${s.toString()}`)},updateHarnessFileContent(n,r,s){const o=new URLSearchParams({path:r,taskSlug:n});return Ce(`/api/projects/harness/file?${o.toString()}`,{method:"PUT",body:JSON.stringify(s)})},getRepositoryDiff(n,r){const s=new URLSearchParams({taskSlug:n});return r&&s.set("commit",r),Ce(`/api/projects/harness/repository-diff?${s.toString()}`)},getRepositoryFileDiff(n,r){const s=new URLSearchParams({taskSlug:n,path:r});return Ce(`/api/projects/harness/repository-diff/file?${s.toString()}`)},mergeRepositoryDiffToCurrentBranch(n){return Ce("/api/projects/harness/repository-diff/merge-to-current-branch",{method:"POST",body:JSON.stringify({taskSlug:n})})},getHarnessBootstrapStatus(n){const r=new URLSearchParams({taskSlug:n});return Ce(`/api/projects/harness/bootstrap?${r.toString()}`)},startHarnessBootstrap(n={}){return Ce("/api/projects/harness/bootstrap/start",{method:"POST",body:JSON.stringify(n)})},restartHarnessBootstrap(n={}){return Ce("/api/projects/harness/bootstrap/restart",{method:"POST",body:JSON.stringify(n)})},stopHarnessBootstrap(){return Ce("/api/projects/harness/bootstrap/stop",{method:"POST"})},runHarnessBootstrap(n){return Ce("/api/projects/harness/bootstrap/run",{method:"POST",body:JSON.stringify(n)})},getHarnessEngineerSession(){return Ce("/api/projects/harness/engineer/session")},ensureHarnessEngineerSession(n={}){return Ce("/api/projects/harness/engineer/session/ensure",{method:"POST",body:JSON.stringify(n)})},startHarnessEngineerSession(n={}){return Ce("/api/projects/harness/engineer/session/start",{method:"POST",body:JSON.stringify(n)})},resumeHarnessEngineerSession(n={}){return Ce("/api/projects/harness/engineer/session/resume",{method:"POST",body:JSON.stringify(n)})},restartHarnessEngineerSession(n={}){return Ce("/api/projects/harness/engineer/session/restart",{method:"POST",body:JSON.stringify(n)})},stopHarnessEngineerSession(){return Ce("/api/projects/harness/engineer/session/stop",{method:"POST"})},notifyHarnessEngineerHarnessUpdated(){return Ce("/api/projects/harness/engineer/session/notify-harness",{method:"POST"})},getHarnessFeedbackState(n){const r=new URLSearchParams;n&&r.set("taskSlug",n);const s=r.toString();return Ce(`/api/projects/harness/feedback${s?`?${s}`:""}`)},decideHarnessFeedback(n){return Ce("/api/projects/harness/feedback/decision",{method:"POST",body:JSON.stringify(n)})},startTaskHarnessRetrospective(n){return Ce("/api/projects/harness/task-retrospective",{method:"POST",body:JSON.stringify(n)})},getTaskStatus(n){return Ce(`/api/tasks/${encodeURIComponent(n)}/status`)},getTaskWorkspaceState(n){return Ce(`/api/tasks/${encodeURIComponent(n)}/workspace-state`)},getProjectRuntimeState(n){const r=new URLSearchParams;n&&r.set("taskSlug",n);const s=r.toString();return Ce(`/api/projects/runtime-state${s?`?${s}`:""}`)},listSessions(n){return Ce(`/api/tasks/${encodeURIComponent(n)}/sessions`)},startRoleSession(n,r,s={}){return Ce(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/start`,{method:"POST",body:JSON.stringify(s)})},stopRoleSession(n,r){return Ce(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/stop`,{method:"POST"})},restartRoleSession(n,r,s={}){return Ce(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/restart`,{method:"POST",body:JSON.stringify(s)})},resumeRoleSession(n,r,s={}){return Ce(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/resume`,{method:"POST",body:JSON.stringify(s)})},notifyRoleHarnessUpdated(n,r){return Ce(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/notify-harness`,{method:"POST"})},dispatchRoleCommand(n,r){return Ce(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/dispatch`,{method:"POST"})},listMessages(n){return Ce(`/api/tasks/${encodeURIComponent(n)}/messages`)},markAllMessagesDone(n){return Ce(`/api/tasks/${encodeURIComponent(n)}/messages/mark-all-done`,{method:"POST"})},deleteMessageHistory(n){return Ce(`/api/tasks/${encodeURIComponent(n)}/messages/history`,{method:"DELETE"})},getOrchestrationState(n){return Ce(`/api/tasks/${encodeURIComponent(n)}/orchestration`)},updateOrchestrationState(n,r){return Ce(`/api/tasks/${encodeURIComponent(n)}/orchestration`,{method:"PUT",body:JSON.stringify(r)})},getSessionRoundState(n){return Ce(`/api/tasks/${encodeURIComponent(n)}/round`)},getGateReviewState(n){return Ce(`/api/tasks/${encodeURIComponent(n)}/gate-review`)},updateGateReviewSettings(n,r){return Ce(`/api/tasks/${encodeURIComponent(n)}/gate-review/settings`,{method:"PUT",body:JSON.stringify(r)})},requestGateReviewGate(n,r){return Ce(`/api/tasks/${encodeURIComponent(n)}/gate-review/${r}/request`,{method:"POST"})},retryGateReviewGate(n,r){return Ce(`/api/tasks/${encodeURIComponent(n)}/gate-review/${r}/retry`,{method:"POST"})},skipGateReviewGate(n,r,s){return Ce(`/api/tasks/${encodeURIComponent(n)}/gate-review/${r}/skip`,{method:"POST",body:JSON.stringify(s)})},overrideGateReviewGate(n,r,s){return Ce(`/api/tasks/${encodeURIComponent(n)}/gate-review/${r}/override`,{method:"POST",body:JSON.stringify(s)})},getGateReviewReport(n,r){return Ce(`/api/tasks/${encodeURIComponent(n)}/gate-review/${r}/report`)},startTranslationSession(n,r){return Ce(`/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)),Ce(`/api/translation/sessions/${encodeURIComponent(n)}/events?${o.toString()}`)},translateUserInput(n,r,s){return Ce(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/translation/input`,{method:"POST",body:JSON.stringify(s)})},translateManualOutput(n,r,s){return Ce(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/translation/manual-output`,{method:"POST",body:JSON.stringify(s)})},sendTranslatedInput(n,r,s){return Ce(`/api/tasks/${encodeURIComponent(n)}/sessions/${r}/translation/send`,{method:"POST",body:JSON.stringify(s)})},clearTranslationSession(n){return Ce(`/api/translation/sessions/${encodeURIComponent(n)}/clear`,{method:"POST"})},stopTranslationSession(n){return Ce(`/api/translation/sessions/${encodeURIComponent(n)}/stop`,{method:"POST"})},notifyTranslatorHarnessUpdated(){return Ce("/api/projects/translation/session/notify-harness",{method:"POST"})},retryTranslation(n,r){return Ce(`/api/translation/sessions/${encodeURIComponent(n)}/retry/${encodeURIComponent(r)}`,{method:"POST"})},ignoreTranslationFailures(n){return Ce(`/api/translation/sessions/${encodeURIComponent(n)}/failures/ignore`,{method:"POST"})},retryTranslationFailures(n){return Ce(`/api/translation/sessions/${encodeURIComponent(n)}/failures/retry`,{method:"POST"})},getTranslationState(){return Ce("/api/translation/state")},getTranslatorSession(){return Ce("/api/translation/session")},ensureTranslatorSession(n={}){return Ce("/api/translation/session/ensure",{method:"POST",body:JSON.stringify(n)})},startTranslatorSession(n={}){return Ce("/api/translation/session/start",{method:"POST",body:JSON.stringify(n)})},resumeTranslatorSession(n={}){return Ce("/api/translation/session/resume",{method:"POST",body:JSON.stringify(n)})},restartTranslatorSession(n={}){return Ce("/api/translation/session/restart",{method:"POST",body:JSON.stringify(n)})},stopTranslatorSession(){return Ce("/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 Ce(`/api/translation/source-files${s}`)},createFileTranslation(n){return Ce("/api/translation/files",{method:"POST",body:JSON.stringify(n)})},readFileTranslation(n){return Ce(`/api/translation/files/${encodeURIComponent(n)}`)},createTranslationBootstrap(n){return Ce("/api/translation/bootstrap",{method:"POST",body:JSON.stringify(n)})},createTranslationMemoryUpdate(n){return Ce("/api/translation/memory-update",{method:"POST",body:JSON.stringify(n)})},promoteTranslation(n,r){return Ce(`/api/translation/files/${encodeURIComponent(n)}/promote`,{method:"POST",body:JSON.stringify({targetPath:r})})},getGatewayStatus(){return Ce("/api/gateway/status")},updateGatewaySettings(n){return Ce("/api/gateway/settings",{method:"PUT",body:JSON.stringify(n)})},startGatewayQrLogin(){return Ce("/api/gateway/qr/start",{method:"POST"})},checkGatewayQrLogin(n={}){return Ce("/api/gateway/qr/check",{method:"POST",body:JSON.stringify(n)})},startGatewayLarkRegistration(){return Ce("/api/gateway/lark-registration/start",{method:"POST"})},checkGatewayLarkRegistration(){return Ce("/api/gateway/lark-registration/check",{method:"POST"})},bindGatewayLarkApp(n){return Ce("/api/gateway/lark-registration/bind",{method:"POST",body:JSON.stringify(n)})},resetGatewayBinding(){return Ce("/api/gateway/binding/reset",{method:"POST"})}};async function Ce(n,r={}){var g,f,l;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=(r.method??"GET").toUpperCase();let d;try{d=await fetch(n,{...r,headers:s})}catch(c){throw new Error(`${o} ${n} could not reach the VCM backend. Reason: ${Mo(c)}`)}if(!d.ok){const c=await d.text().catch(()=>""),h=n1(c),p=d.statusText?`${d.status} ${d.statusText}`:String(d.status),b=((g=h==null?void 0:h.error)!=null&&g.hint?`${h.error.message??"Backend error."} ${h.error.hint}`:(f=h==null?void 0:h.error)==null?void 0:f.message)??i1(c),C=(l=h==null?void 0:h.error)==null?void 0:l.runtime,T=C?` [backend ${C.version??"unknown"} pid=${C.pid??"unknown"} cwd=${C.cwd??"unknown"}]`:"";throw new Error(`${o} ${n} returned HTTP ${p}. ${b}${T}`)}return d.json()}function n1(n){if(!n.trim())return null;try{return JSON.parse(n)}catch{return null}}function i1(n){const r=n.trim();return r?`Non-JSON response body: ${r.slice(0,500)}`:"The response body was empty."}const hh="vcm:ui-error-report",fh="vcm:ui-error-clear-actions",dh="vcm:ui-error-clear-message";function r1(n){const r=n.trim();!r||typeof window>"u"||window.dispatchEvent(new CustomEvent(hh,{detail:{message:r}}))}function s1(n){const r=n.trim();!r||typeof window>"u"||window.dispatchEvent(new CustomEvent(dh,{detail:{message:r}}))}function a1(n){n.length===0||typeof window>"u"||window.dispatchEvent(new CustomEvent(fh,{detail:{actions:n}}))}function ji(n){const[r,s]=ne.useState(n),o=ne.useRef(n),d=ne.useCallback(g=>{const f=o.current,l=typeof g=="function"?g(f):g;o.current=l,typeof l=="string"&&l.trim()?r1(l):typeof f=="string"&&f.trim()&&s1(f),s(l)},[]);return[r,d]}var qu={exports:{}},Pm;function l1(){return Pm||(Pm=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 g=this._terminal._core;this._terminal.rows===d.rows&&this._terminal.cols===d.cols||(g._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,g=d._renderService.dimensions;if(g.css.cell.width===0||g.css.cell.height===0)return;const f=this._terminal.options.scrollback===0?0:d.viewport.scrollBarWidth,l=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(l.getPropertyValue("height")),h=Math.max(0,parseInt(l.getPropertyValue("width"))),p=window.getComputedStyle(this._terminal.element),u=c-(parseInt(p.getPropertyValue("padding-top"))+parseInt(p.getPropertyValue("padding-bottom"))),b=h-(parseInt(p.getPropertyValue("padding-right"))+parseInt(p.getPropertyValue("padding-left")))-f;return{cols:Math.max(2,Math.floor(b/g.css.cell.width)),rows:Math.max(1,Math.floor(u/g.css.cell.height))}}}})(),s})()))})(qu)),qu.exports}var o1=l1(),$u={exports:{}},Fm;function c1(){return Fm||(Fm=1,(function(n,r){(function(s,o){n.exports=o()})(self,(()=>(()=>{var s={6:(f,l)=>{function c(p){try{const u=new URL(p),b=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 p.toLocaleLowerCase().startsWith(b.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(l,"__esModule",{value:!0}),l.LinkComputer=l.WebLinkProvider=void 0,l.WebLinkProvider=class{constructor(p,u,b,C={}){this._terminal=p,this._regex=u,this._handler=b,this._options=C}provideLinks(p,u){const b=h.computeLink(p,this._regex,this._terminal,this._handler);u(this._addCallbacks(b))}_addCallbacks(p){return p.map((u=>(u.leave=this._options.leave,u.hover=(b,C)=>{if(this._options.hover){const{range:T}=u;this._options.hover(b,C,T)}},u)))}};class h{static computeLink(u,b,C,T){const E=new RegExp(b.source,(b.flags||"")+"g"),[S,v]=h._getWindowedLineStrings(u-1,C),_=S.join("");let y;const A=[];for(;y=E.exec(_);){const L=y[0];if(!c(L))continue;const[D,R]=h._mapStrIdx(C,v,0,y.index),[k,M]=h._mapStrIdx(C,D,R,L.length);if(D===-1||R===-1||k===-1||M===-1)continue;const B={start:{x:R+1,y:D+1},end:{x:M,y:k+1}};A.push({range:B,text:L,activate:T})}return A}static _getWindowedLineStrings(u,b){let C,T=u,E=u,S=0,v="";const _=[];if(C=b.buffer.active.getLine(u)){const y=C.translateToString(!0);if(C.isWrapped&&y[0]!==" "){for(S=0;(C=b.buffer.active.getLine(--T))&&S<2048&&(v=C.translateToString(!0),S+=v.length,_.push(v),C.isWrapped&&v.indexOf(" ")===-1););_.reverse()}for(_.push(y),S=0;(C=b.buffer.active.getLine(++E))&&C.isWrapped&&S<2048&&(v=C.translateToString(!0),S+=v.length,_.push(v),v.indexOf(" ")===-1););}return[_,T]}static _mapStrIdx(u,b,C,T){const E=u.buffer.active,S=E.getNullCell();let v=C;for(;T;){const _=E.getLine(b);if(!_)return[-1,-1];for(let y=v;y<_.length;++y){_.getCell(y,S);const A=S.getChars();if(S.getWidth()&&(T-=A.length||1,y===_.length-1&&A==="")){const L=E.getLine(b+1);L&&L.isWrapped&&(L.getCell(0,S),S.getWidth()===2&&(T+=1))}if(T<0)return[b,y]}b++,v=0}return[b,v]}}l.LinkComputer=h}},o={};function d(f){var l=o[f];if(l!==void 0)return l.exports;var c=o[f]={exports:{}};return s[f](c,c.exports,d),c.exports}var g={};return(()=>{var f=g;Object.defineProperty(f,"__esModule",{value:!0}),f.WebLinksAddon=void 0;const l=d(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function h(p,u){const b=window.open();if(b){try{b.opener=null}catch{}b.location.href=u}else console.warn("Opening link blocked as opener could not be cleared")}f.WebLinksAddon=class{constructor(p=h,u={}){this._handler=p,this._options=u}activate(p){this._terminal=p;const u=this._options,b=u.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new l.WebLinkProvider(this._terminal,b,this._handler,u))}dispose(){var p;(p=this._linkProvider)==null||p.dispose()}}})(),g})()))})($u)),$u.exports}var u1=c1(),Gu={exports:{}},qm;function h1(){return qm||(qm=1,(function(n,r){(function(s,o){n.exports=o()})(globalThis,(()=>(()=>{var s={4567:function(f,l,c){var h=this&&this.__decorate||function(_,y,A,L){var D,R=arguments.length,k=R<3?y:L===null?L=Object.getOwnPropertyDescriptor(y,A):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(_,y,A,L);else for(var M=_.length-1;M>=0;M--)(D=_[M])&&(k=(R<3?D(k):R>3?D(y,A,k):D(y,A))||k);return R>3&&k&&Object.defineProperty(y,A,k),k},p=this&&this.__param||function(_,y){return function(A,L){y(A,L,_)}};Object.defineProperty(l,"__esModule",{value:!0}),l.AccessibilityManager=void 0;const u=c(9042),b=c(9924),C=c(844),T=c(4725),E=c(2585),S=c(3656);let v=l.AccessibilityManager=class extends C.Disposable{constructor(_,y,A,L){super(),this._terminal=_,this._coreBrowserService=A,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 D=0;D<this._terminal.rows;D++)this._rowElements[D]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[D]);if(this._topBoundaryFocusListener=D=>this._handleBoundaryFocus(D,0),this._bottomBoundaryFocusListener=D=>this._handleBoundaryFocus(D,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 b.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((D=>this._handleResize(D.rows)))),this.register(this._terminal.onRender((D=>this._refreshRows(D.start,D.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((D=>this._handleChar(D)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
52
|
-
`)))),this.register(this._terminal.onA11yTab((D=>this._handleTab(D)))),this.register(this._terminal.onKey((D=>this._handleKey(D.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,S.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,C.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(_){for(let y=0;y<_;y++)this._handleChar(" ")}_handleChar(_){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==_&&(this._charsToAnnounce+=_):this._charsToAnnounce+=_,_===`
|
|
53
|
-
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=u.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(_){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(_)||this._charsToConsume.push(_)}_refreshRows(_,y){this._liveRegionDebouncer.refresh(_,y,this._terminal.rows)}_renderRows(_,y){const A=this._terminal.buffer,L=A.lines.length.toString();for(let D=_;D<=y;D++){const R=A.lines.get(A.ydisp+D),k=[],M=(R==null?void 0:R.translateToString(!0,void 0,void 0,k))||"",B=(A.ydisp+D+1).toString(),H=this._rowElements[D];H&&(M.length===0?(H.innerText=" ",this._rowColumns.set(H,[0,1])):(H.textContent=M,this._rowColumns.set(H,k)),H.setAttribute("aria-posinset",B),H.setAttribute("aria-setsize",L))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(_,y){const A=_.target,L=this._rowElements[y===0?1:this._rowElements.length-2];if(A.getAttribute("aria-posinset")===(y===0?"1":`${this._terminal.buffer.lines.length}`)||_.relatedTarget!==L)return;let D,R;if(y===0?(D=A,R=this._rowElements.pop(),this._rowContainer.removeChild(R)):(D=this._rowElements.shift(),R=A,this._rowContainer.removeChild(D)),D.removeEventListener("focus",this._topBoundaryFocusListener),R.removeEventListener("focus",this._bottomBoundaryFocusListener),y===0){const k=this._createAccessibilityTreeNode();this._rowElements.unshift(k),this._rowContainer.insertAdjacentElement("afterbegin",k)}else{const k=this._createAccessibilityTreeNode();this._rowElements.push(k),this._rowContainer.appendChild(k)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(y===0?-1:1),this._rowElements[y===0?1:this._rowElements.length-2].focus(),_.preventDefault(),_.stopImmediatePropagation()}_handleSelectionChange(){var M;if(this._rowElements.length===0)return;const _=document.getSelection();if(!_)return;if(_.isCollapsed)return void(this._rowContainer.contains(_.anchorNode)&&this._terminal.clearSelection());if(!_.anchorNode||!_.focusNode)return void console.error("anchorNode and/or focusNode are null");let y={node:_.anchorNode,offset:_.anchorOffset},A={node:_.focusNode,offset:_.focusOffset};if((y.node.compareDocumentPosition(A.node)&Node.DOCUMENT_POSITION_PRECEDING||y.node===A.node&&y.offset>A.offset)&&([y,A]=[A,y]),y.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(y={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(y.node))return;const L=this._rowElements.slice(-1)[0];if(A.node.compareDocumentPosition(L)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(A={node:L,offset:((M=L.textContent)==null?void 0:M.length)??0}),!this._rowContainer.contains(A.node))return;const D=({node:B,offset:H})=>{const U=B instanceof Text?B.parentNode:B;let P=parseInt(U==null?void 0:U.getAttribute("aria-posinset"),10)-1;if(isNaN(P))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 X=H<K.length?K[H]:K.slice(-1)[0]+1;return X>=this._terminal.cols&&(++P,X=0),{row:P,column:X}},R=D(y),k=D(A);if(R&&k){if(R.row>k.row||R.row===k.row&&R.column>=k.column)throw new Error("invalid range");this._terminal.select(R.column,R.row,(k.row-R.row)*this._terminal.cols-R.column+k.column)}}_handleResize(_){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let y=this._rowContainer.children.length;y<this._terminal.rows;y++)this._rowElements[y]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[y]);for(;this._rowElements.length>_;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const _=this._coreBrowserService.mainDocument.createElement("div");return _.setAttribute("role","listitem"),_.tabIndex=-1,this._refreshRowDimensions(_),_}_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 _=0;_<this._terminal.rows;_++)this._refreshRowDimensions(this._rowElements[_])}}_refreshRowDimensions(_){_.style.height=`${this._renderService.dimensions.css.cell.height}px`}};l.AccessibilityManager=v=h([p(1,E.IInstantiationService),p(2,T.ICoreBrowserService),p(3,T.IRenderService)],v)},3614:(f,l)=>{function c(b){return b.replace(/\r?\n/g,"\r")}function h(b,C){return C?"\x1B[200~"+b+"\x1B[201~":b}function p(b,C,T,E){b=h(b=c(b),T.decPrivateModes.bracketedPasteMode&&E.rawOptions.ignoreBracketedPasteMode!==!0),T.triggerDataEvent(b,!0),C.value=""}function u(b,C,T){const E=T.getBoundingClientRect(),S=b.clientX-E.left-10,v=b.clientY-E.top-10;C.style.width="20px",C.style.height="20px",C.style.left=`${S}px`,C.style.top=`${v}px`,C.style.zIndex="1000",C.focus()}Object.defineProperty(l,"__esModule",{value:!0}),l.rightClickHandler=l.moveTextAreaUnderMouseCursor=l.paste=l.handlePasteEvent=l.copyHandler=l.bracketTextForPaste=l.prepareTextForTerminal=void 0,l.prepareTextForTerminal=c,l.bracketTextForPaste=h,l.copyHandler=function(b,C){b.clipboardData&&b.clipboardData.setData("text/plain",C.selectionText),b.preventDefault()},l.handlePasteEvent=function(b,C,T,E){b.stopPropagation(),b.clipboardData&&p(b.clipboardData.getData("text/plain"),C,T,E)},l.paste=p,l.moveTextAreaUnderMouseCursor=u,l.rightClickHandler=function(b,C,T,E,S){u(b,C,T),S&&E.rightClickSelect(b),C.value=E.selectionText,C.select()}},7239:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorContrastCache=void 0;const h=c(1505);l.ColorContrastCache=class{constructor(){this._color=new h.TwoKeyMap,this._css=new h.TwoKeyMap}setCss(p,u,b){this._css.set(p,u,b)}getCss(p,u){return this._css.get(p,u)}setColor(p,u,b){this._color.set(p,u,b)}getColor(p,u){return this._color.get(p,u)}clear(){this._color.clear(),this._css.clear()}}},3656:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.addDisposableDomListener=void 0,l.addDisposableDomListener=function(c,h,p,u){c.addEventListener(h,p,u);let b=!1;return{dispose:()=>{b||(b=!0,c.removeEventListener(h,p,u))}}}},3551:function(f,l,c){var h=this&&this.__decorate||function(v,_,y,A){var L,D=arguments.length,R=D<3?_:A===null?A=Object.getOwnPropertyDescriptor(_,y):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(v,_,y,A);else for(var k=v.length-1;k>=0;k--)(L=v[k])&&(R=(D<3?L(R):D>3?L(_,y,R):L(_,y))||R);return D>3&&R&&Object.defineProperty(_,y,R),R},p=this&&this.__param||function(v,_){return function(y,A){_(y,A,v)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Linkifier=void 0;const u=c(3656),b=c(8460),C=c(844),T=c(2585),E=c(4725);let S=l.Linkifier=class extends C.Disposable{get currentLink(){return this._currentLink}constructor(v,_,y,A,L){super(),this._element=v,this._mouseService=_,this._renderService=y,this._bufferService=A,this._linkProviderService=L,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new b.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new b.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,C.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,C.toDisposable)((()=>{var D;this._lastMouseEvent=void 0,(D=this._activeProviderReplies)==null||D.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(v){this._lastMouseEvent=v;const _=this._positionFromMouseEvent(v,this._element,this._mouseService);if(!_)return;this._isMouseOut=!1;const y=v.composedPath();for(let A=0;A<y.length;A++){const L=y[A];if(L.classList.contains("xterm"))break;if(L.classList.contains("xterm-hover"))return}this._lastBufferCell&&_.x===this._lastBufferCell.x&&_.y===this._lastBufferCell.y||(this._handleHover(_),this._lastBufferCell=_)}_handleHover(v){if(this._activeLine!==v.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(v,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,v)||(this._clearCurrentLink(),this._askForLink(v,!0))}_askForLink(v,_){var A,L;this._activeProviderReplies&&_||((A=this._activeProviderReplies)==null||A.forEach((D=>{D==null||D.forEach((R=>{R.link.dispose&&R.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=v.y);let y=!1;for(const[D,R]of this._linkProviderService.linkProviders.entries())_?(L=this._activeProviderReplies)!=null&&L.get(D)&&(y=this._checkLinkProviderResult(D,v,y)):R.provideLinks(v.y,(k=>{var B,H;if(this._isMouseOut)return;const M=k==null?void 0:k.map((U=>({link:U})));(B=this._activeProviderReplies)==null||B.set(D,M),y=this._checkLinkProviderResult(D,v,y),((H=this._activeProviderReplies)==null?void 0:H.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(v.y,this._activeProviderReplies)}))}_removeIntersectingLinks(v,_){const y=new Set;for(let A=0;A<_.size;A++){const L=_.get(A);if(L)for(let D=0;D<L.length;D++){const R=L[D],k=R.link.range.start.y<v?0:R.link.range.start.x,M=R.link.range.end.y>v?this._bufferService.cols:R.link.range.end.x;for(let B=k;B<=M;B++){if(y.has(B)){L.splice(D--,1);break}y.add(B)}}}}_checkLinkProviderResult(v,_,y){var D;if(!this._activeProviderReplies)return y;const A=this._activeProviderReplies.get(v);let L=!1;for(let R=0;R<v;R++)this._activeProviderReplies.has(R)&&!this._activeProviderReplies.get(R)||(L=!0);if(!L&&A){const R=A.find((k=>this._linkAtPosition(k.link,_)));R&&(y=!0,this._handleNewLink(R))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!y)for(let R=0;R<this._activeProviderReplies.size;R++){const k=(D=this._activeProviderReplies.get(R))==null?void 0:D.find((M=>this._linkAtPosition(M.link,_)));if(k){y=!0,this._handleNewLink(k);break}}return y}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(v){if(!this._currentLink)return;const _=this._positionFromMouseEvent(v,this._element,this._mouseService);_&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,_)&&this._currentLink.link.activate(v,this._currentLink.link.text)}_clearCurrentLink(v,_){this._currentLink&&this._lastMouseEvent&&(!v||!_||this._currentLink.link.range.start.y>=v&&this._currentLink.link.range.end.y<=_)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,C.disposeArray)(this._linkCacheDisposables))}_handleNewLink(v){if(!this._lastMouseEvent)return;const _=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);_&&this._linkAtPosition(v.link,_)&&(this._currentLink=v,this._currentLink.state={decorations:{underline:v.link.decorations===void 0||v.link.decorations.underline,pointerCursor:v.link.decorations===void 0||v.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,v.link,this._lastMouseEvent),v.link.decorations={},Object.defineProperties(v.link.decorations,{pointerCursor:{get:()=>{var y,A;return(A=(y=this._currentLink)==null?void 0:y.state)==null?void 0:A.decorations.pointerCursor},set:y=>{var A;(A=this._currentLink)!=null&&A.state&&this._currentLink.state.decorations.pointerCursor!==y&&(this._currentLink.state.decorations.pointerCursor=y,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",y))}},underline:{get:()=>{var y,A;return(A=(y=this._currentLink)==null?void 0:y.state)==null?void 0:A.decorations.underline},set:y=>{var A,L,D;(A=this._currentLink)!=null&&A.state&&((D=(L=this._currentLink)==null?void 0:L.state)==null?void 0:D.decorations.underline)!==y&&(this._currentLink.state.decorations.underline=y,this._currentLink.state.isHovered&&this._fireUnderlineEvent(v.link,y))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((y=>{if(!this._currentLink)return;const A=y.start===0?0:y.start+1+this._bufferService.buffer.ydisp,L=this._bufferService.buffer.ydisp+1+y.end;if(this._currentLink.link.range.start.y>=A&&this._currentLink.link.range.end.y<=L&&(this._clearCurrentLink(A,L),this._lastMouseEvent)){const D=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);D&&this._askForLink(D,!1)}}))))}_linkHover(v,_,y){var A;(A=this._currentLink)!=null&&A.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(_,!0),this._currentLink.state.decorations.pointerCursor&&v.classList.add("xterm-cursor-pointer")),_.hover&&_.hover(y,_.text)}_fireUnderlineEvent(v,_){const y=v.range,A=this._bufferService.buffer.ydisp,L=this._createLinkUnderlineEvent(y.start.x-1,y.start.y-A-1,y.end.x,y.end.y-A-1,void 0);(_?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(L)}_linkLeave(v,_,y){var A;(A=this._currentLink)!=null&&A.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(_,!1),this._currentLink.state.decorations.pointerCursor&&v.classList.remove("xterm-cursor-pointer")),_.leave&&_.leave(y,_.text)}_linkAtPosition(v,_){const y=v.range.start.y*this._bufferService.cols+v.range.start.x,A=v.range.end.y*this._bufferService.cols+v.range.end.x,L=_.y*this._bufferService.cols+_.x;return y<=L&&L<=A}_positionFromMouseEvent(v,_,y){const A=y.getCoords(v,_,this._bufferService.cols,this._bufferService.rows);if(A)return{x:A[0],y:A[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(v,_,y,A,L){return{x1:v,y1:_,x2:y,y2:A,cols:this._bufferService.cols,fg:L}}};l.Linkifier=S=h([p(1,E.IMouseService),p(2,E.IRenderService),p(3,T.IBufferService),p(4,E.ILinkProviderService)],S)},9042:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.tooMuchOutput=l.promptLabel=void 0,l.promptLabel="Terminal input",l.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(f,l,c){var h=this&&this.__decorate||function(E,S,v,_){var y,A=arguments.length,L=A<3?S:_===null?_=Object.getOwnPropertyDescriptor(S,v):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(E,S,v,_);else for(var D=E.length-1;D>=0;D--)(y=E[D])&&(L=(A<3?y(L):A>3?y(S,v,L):y(S,v))||L);return A>3&&L&&Object.defineProperty(S,v,L),L},p=this&&this.__param||function(E,S){return function(v,_){S(v,_,E)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkProvider=void 0;const u=c(511),b=c(2585);let C=l.OscLinkProvider=class{constructor(E,S,v){this._bufferService=E,this._optionsService=S,this._oscLinkService=v}provideLinks(E,S){var M;const v=this._bufferService.buffer.lines.get(E-1);if(!v)return void S(void 0);const _=[],y=this._optionsService.rawOptions.linkHandler,A=new u.CellData,L=v.getTrimmedLength();let D=-1,R=-1,k=!1;for(let B=0;B<L;B++)if(R!==-1||v.hasContent(B)){if(v.loadCell(B,A),A.hasExtendedAttrs()&&A.extended.urlId){if(R===-1){R=B,D=A.extended.urlId;continue}k=A.extended.urlId!==D}else R!==-1&&(k=!0);if(k||R!==-1&&B===L-1){const H=(M=this._oscLinkService.getLinkData(D))==null?void 0:M.uri;if(H){const U={start:{x:R+1,y:E},end:{x:B+(k||B!==L-1?0:1),y:E}};let P=!1;if(!(y!=null&&y.allowNonHttpProtocols))try{const K=new URL(H);["http:","https:"].includes(K.protocol)||(P=!0)}catch{P=!0}P||_.push({text:H,range:U,activate:(K,X)=>y?y.activate(K,X,U):T(0,X),hover:(K,X)=>{var G;return(G=y==null?void 0:y.hover)==null?void 0:G.call(y,K,X,U)},leave:(K,X)=>{var G;return(G=y==null?void 0:y.leave)==null?void 0:G.call(y,K,X,U)}})}k=!1,A.hasExtendedAttrs()&&A.extended.urlId?(R=B,D=A.extended.urlId):(R=-1,D=-1)}}S(_)}};function T(E,S){if(confirm(`Do you want to navigate to ${S}?
|
|
54
|
-
|
|
55
|
-
WARNING: This link could potentially be dangerous`)){const v=window.open();if(v){try{v.opener=null}catch{}v.location.href=S}else console.warn("Opening link blocked as opener could not be cleared")}}l.OscLinkProvider=C=h([p(0,b.IBufferService),p(1,b.IOptionsService),p(2,b.IOscLinkService)],C)},6193:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.RenderDebouncer=void 0,l.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,p){this._rowCount=p,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,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Terminal=void 0;const h=c(3614),p=c(3656),u=c(3551),b=c(9042),C=c(3730),T=c(1680),E=c(3107),S=c(5744),v=c(2950),_=c(1296),y=c(428),A=c(4269),L=c(5114),D=c(8934),R=c(3230),k=c(9312),M=c(4725),B=c(6731),H=c(8055),U=c(8969),P=c(8460),K=c(844),X=c(6114),G=c(8437),W=c(2584),te=c(7399),z=c(5941),j=c(9074),N=c(2585),$=c(5435),I=c(4567),se=c(779);class ae 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=X,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new K.MutableDisposable),this._onCursorMove=this.register(new P.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new P.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new P.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new P.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new P.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new P.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new P.EventEmitter),this._onBlur=this.register(new P.EventEmitter),this._onA11yCharEmitter=this.register(new P.EventEmitter),this._onA11yTabEmitter=this.register(new P.EventEmitter),this._onWillOpen=this.register(new P.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(j.DecorationService),this._instantiationService.setService(N.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(se.LinkProviderService),this._instantiationService.setService(M.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(C.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((q,Z)=>this.refresh(q,Z)))),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,P.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,P.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,P.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,P.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,Z;this._customKeyEventHandler=void 0,(Z=(q=this.element)==null?void 0:q.parentNode)==null||Z.removeChild(this.element)})))}_handleColorEvent(Y){if(this._themeService)for(const q of Y){let Z,Q="";switch(q.index){case 256:Z="foreground",Q="10";break;case 257:Z="background",Q="11";break;case 258:Z="cursor",Q="12";break;default:Z="ansi",Q="4;"+q.index}switch(q.type){case 0:const _e=H.color.toColorRGB(Z==="ansi"?this._themeService.colors.ansi[q.index]:this._themeService.colors[Z]);this.coreService.triggerDataEvent(`${W.C0.ESC}]${Q};${(0,z.toRgbString)(_e)}${W.C1_ESCAPED.ST}`);break;case 1:if(Z==="ansi")this._themeService.modifyColors((ve=>ve.ansi[q.index]=H.channels.toColor(...q.color)));else{const ve=Z;this._themeService.modifyColors((De=>De[ve]=H.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(I.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(Y){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(W.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(W.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 Z=Math.min(this.buffer.x,this.cols-1),Q=this._renderService.dimensions.css.cell.height,_e=q.getWidth(Z),ve=this._renderService.dimensions.css.cell.width*_e,De=this.buffer.y*this._renderService.dimensions.css.cell.height,Ae=Z*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Ae+"px",this.textarea.style.top=De+"px",this.textarea.style.width=ve+"px",this.textarea.style.height=Q+"px",this.textarea.style.lineHeight=Q+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,p.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,p.addDisposableDomListener)(this.textarea,"paste",Y)),this.register((0,p.addDisposableDomListener)(this.element,"paste",Y)),X.isFirefox?this.register((0,p.addDisposableDomListener)(this.element,"mousedown",(q=>{q.button===2&&(0,h.rightClickHandler)(q,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,p.addDisposableDomListener)(this.element,"contextmenu",(q=>{(0,h.rightClickHandler)(q,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),X.isLinux&&this.register((0,p.addDisposableDomListener)(this.element,"auxclick",(q=>{q.button===1&&(0,h.moveTextAreaUnderMouseCursor)(q,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,p.addDisposableDomListener)(this.textarea,"keyup",(Y=>this._keyUp(Y)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keydown",(Y=>this._keyDown(Y)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keypress",(Y=>this._keyPress(Y)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionupdate",(Y=>this._compositionHelper.compositionupdate(Y)))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,p.addDisposableDomListener)(this.textarea,"input",(Y=>this._inputEvent(Y)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(Y){var Z;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"),((Z=this.element)==null?void 0:Z.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,p.addDisposableDomListener)(this.screenElement,"mousemove",(Q=>this.updateCursorStyle(Q)))),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",b.promptLabel),X.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,p.addDisposableDomListener)(this.textarea,"focus",(Q=>this._handleTextAreaFocus(Q)))),this.register((0,p.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(y.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(M.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(B.ThemeService),this._instantiationService.setService(M.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(A.CharacterJoinerService),this._instantiationService.setService(M.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(R.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(M.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((Q=>this._onRender.fire(Q)))),this.onResize((Q=>this._renderService.resize(Q.cols,Q.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(v.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(D.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(T.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((Q=>this.scrollLines(Q.amount,Q.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(k.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(M.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((Q=>this.scrollLines(Q.amount,Q.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((Q=>this._renderService.handleSelectionChanged(Q.start,Q.end,Q.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((Q=>{this.textarea.value=Q,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((Q=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,p.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(E.BufferDecorationRenderer,this.screenElement)),this.register((0,p.addDisposableDomListener)(this.element,"mousedown",(Q=>this._selectionService.handleMouseDown(Q)))),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(I.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(Q=>this._handleScreenReaderModeOptionChange(Q)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(S.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(Q=>{!this._overviewRulerRenderer&&Q&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(S.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(_.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const Y=this,q=this.element;function Z(ve){const De=Y._mouseService.getMouseReportCoords(ve,Y.screenElement);if(!De)return!1;let Ae,Ke;switch(ve.overrideType||ve.type){case"mousemove":Ke=32,ve.buttons===void 0?(Ae=3,ve.button!==void 0&&(Ae=ve.button<3?ve.button:3)):Ae=1&ve.buttons?0:4&ve.buttons?1:2&ve.buttons?2:3;break;case"mouseup":Ke=0,Ae=ve.button<3?ve.button:3;break;case"mousedown":Ke=1,Ae=ve.button<3?ve.button:3;break;case"wheel":if(Y._customWheelEventHandler&&Y._customWheelEventHandler(ve)===!1||Y.viewport.getLinesScrolled(ve)===0)return!1;Ke=ve.deltaY<0?0:1,Ae=4;break;default:return!1}return!(Ke===void 0||Ae===void 0||Ae>4)&&Y.coreMouseService.triggerMouseEvent({col:De.col,row:De.row,x:De.x,y:De.y,button:Ae,action:Ke,ctrl:ve.ctrlKey,alt:ve.altKey,shift:ve.shiftKey})}const Q={mouseup:null,wheel:null,mousedrag:null,mousemove:null},_e={mouseup:ve=>(Z(ve),ve.buttons||(this._document.removeEventListener("mouseup",Q.mouseup),Q.mousedrag&&this._document.removeEventListener("mousemove",Q.mousedrag)),this.cancel(ve)),wheel:ve=>(Z(ve),this.cancel(ve,!0)),mousedrag:ve=>{ve.buttons&&Z(ve)},mousemove:ve=>{ve.buttons||Z(ve)}};this.register(this.coreMouseService.onProtocolChange((ve=>{ve?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(ve)),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&ve?Q.mousemove||(q.addEventListener("mousemove",_e.mousemove),Q.mousemove=_e.mousemove):(q.removeEventListener("mousemove",Q.mousemove),Q.mousemove=null),16&ve?Q.wheel||(q.addEventListener("wheel",_e.wheel,{passive:!1}),Q.wheel=_e.wheel):(q.removeEventListener("wheel",Q.wheel),Q.wheel=null),2&ve?Q.mouseup||(Q.mouseup=_e.mouseup):(this._document.removeEventListener("mouseup",Q.mouseup),Q.mouseup=null),4&ve?Q.mousedrag||(Q.mousedrag=_e.mousedrag):(this._document.removeEventListener("mousemove",Q.mousedrag),Q.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,p.addDisposableDomListener)(q,"mousedown",(ve=>{if(ve.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(ve))return Z(ve),Q.mouseup&&this._document.addEventListener("mouseup",Q.mouseup),Q.mousedrag&&this._document.addEventListener("mousemove",Q.mousedrag),this.cancel(ve)}))),this.register((0,p.addDisposableDomListener)(q,"wheel",(ve=>{if(!Q.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(ve)===!1)return!1;if(!this.buffer.hasScrollback){const De=this.viewport.getLinesScrolled(ve);if(De===0)return;const Ae=W.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(ve.deltaY<0?"A":"B");let Ke="";for(let ht=0;ht<Math.abs(De);ht++)Ke+=Ae;return this.coreService.triggerDataEvent(Ke,!0),this.cancel(ve,!0)}return this.viewport.handleWheel(ve)?this.cancel(ve):void 0}}),{passive:!1})),this.register((0,p.addDisposableDomListener)(q,"touchstart",(ve=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(ve),this.cancel(ve)}),{passive:!0})),this.register((0,p.addDisposableDomListener)(q,"touchmove",(ve=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(ve)?void 0:this.cancel(ve)}),{passive:!1}))}refresh(Y,q){var Z;(Z=this._renderService)==null||Z.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,Z=0){var Q;Z===1?(super.scrollLines(Y,q,Z),this.refresh(0,this.rows-1)):(Q=this.viewport)==null||Q.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,Z){this._selectionService.setSelection(Y,q,Z)}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 Z;(Z=this._selectionService)==null||Z.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 Z=(0,te.evaluateKeyboardEvent)(Y,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(Y),Z.type===3||Z.type===2){const Q=this.rows-1;return this.scrollLines(Z.type===2?-Q:Q),this.cancel(Y,!0)}return Z.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,Y)||(Z.cancel&&this.cancel(Y,!0),!Z.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):(Z.key!==W.C0.ETX&&Z.key!==W.C0.CR||(this.textarea.value=""),this._onKey.fire({key:Z.key,domEvent:Y}),this._showCursor(),this.coreService.triggerDataEvent(Z.key,!0),!this.optionsService.rawOptions.screenReaderMode||Y.altKey||Y.ctrlKey?this.cancel(Y,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(Y,q){const Z=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"?Z:Z&&(!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 Z,Q;(Z=this._charSizeService)==null||Z.measure(),(Q=this.viewport)==null||Q.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(G.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,Z;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(),(Z=this.viewport)==null||Z.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(W.C0.ESC+"[I"):this.coreService.triggerDataEvent(W.C0.ESC+"[O")}_reportWindowsOptions(Y){if(this._renderService)switch(Y){case $.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const q=this._renderService.dimensions.css.canvas.width.toFixed(0),Z=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${W.C0.ESC}[4;${Z};${q}t`);break;case $.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const Q=this._renderService.dimensions.css.cell.width.toFixed(0),_e=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${W.C0.ESC}[6;${_e};${Q}t`)}}cancel(Y,q){if(this.options.cancelEvents||q)return Y.preventDefault(),Y.stopPropagation(),!1}}l.Terminal=ae},9924:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TimeBasedDebouncer=void 0,l.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,p){this._rowCount=p,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 b=u-this._lastRefreshMs,C=this._debounceThresholdMS-b;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),C)}}_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,l,c){var h=this&&this.__decorate||function(v,_,y,A){var L,D=arguments.length,R=D<3?_:A===null?A=Object.getOwnPropertyDescriptor(_,y):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(v,_,y,A);else for(var k=v.length-1;k>=0;k--)(L=v[k])&&(R=(D<3?L(R):D>3?L(_,y,R):L(_,y))||R);return D>3&&R&&Object.defineProperty(_,y,R),R},p=this&&this.__param||function(v,_){return function(y,A){_(y,A,v)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Viewport=void 0;const u=c(3656),b=c(4725),C=c(8460),T=c(844),E=c(2585);let S=l.Viewport=class extends T.Disposable{constructor(v,_,y,A,L,D,R,k){super(),this._viewportElement=v,this._scrollArea=_,this._bufferService=y,this._optionsService=A,this._charSizeService=L,this._renderService=D,this._coreBrowserService=R,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 C.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(k.colors),this.register(k.onChangeColors((M=>this._handleThemeChange(M)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(v){this._viewportElement.style.backgroundColor=v.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(v){if(v)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 _=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==_&&(this._lastRecordedBufferHeight=_,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const v=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==v&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=v),this._refreshAnimationFrame=null}syncScrollArea(v=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(v);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(v)}_handleScroll(v){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 _=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:_,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const v=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(v*(this._smoothScrollState.target-this._smoothScrollState.origin)),v<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(v,_){const y=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(_<0&&this._viewportElement.scrollTop!==0||_>0&&y<this._lastRecordedBufferHeight)||(v.cancelable&&v.preventDefault(),!1)}handleWheel(v){const _=this._getPixelsScrolled(v);return _!==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+_:this._smoothScrollState.target+=_,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=_,this._bubbleScroll(v,_))}scrollLines(v){if(v!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const _=v*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+_,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:v,suppressScrollEvent:!1})}_getPixelsScrolled(v){if(v.deltaY===0||v.shiftKey)return 0;let _=this._applyScrollModifier(v.deltaY,v);return v.deltaMode===WheelEvent.DOM_DELTA_LINE?_*=this._currentRowHeight:v.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(_*=this._currentRowHeight*this._bufferService.rows),_}getBufferElements(v,_){var k;let y,A="";const L=[],D=_??this._bufferService.buffer.lines.length,R=this._bufferService.buffer.lines;for(let M=v;M<D;M++){const B=R.get(M);if(!B)continue;const H=(k=R.get(M+1))==null?void 0:k.isWrapped;if(A+=B.translateToString(!H),!H||M===R.length-1){const U=document.createElement("div");U.textContent=A,L.push(U),A.length>0&&(y=U),A=""}}return{bufferElements:L,cursorElement:y}}getLinesScrolled(v){if(v.deltaY===0||v.shiftKey)return 0;let _=this._applyScrollModifier(v.deltaY,v);return v.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(_/=this._currentRowHeight+0,this._wheelPartialScroll+=_,_=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):v.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(_*=this._bufferService.rows),_}_applyScrollModifier(v,_){const y=this._optionsService.rawOptions.fastScrollModifier;return y==="alt"&&_.altKey||y==="ctrl"&&_.ctrlKey||y==="shift"&&_.shiftKey?v*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:v*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(v){this._lastTouchY=v.touches[0].pageY}handleTouchMove(v){const _=this._lastTouchY-v.touches[0].pageY;return this._lastTouchY=v.touches[0].pageY,_!==0&&(this._viewportElement.scrollTop+=_,this._bubbleScroll(v,_))}};l.Viewport=S=h([p(2,E.IBufferService),p(3,E.IOptionsService),p(4,b.ICharSizeService),p(5,b.IRenderService),p(6,b.ICoreBrowserService),p(7,b.IThemeService)],S)},3107:function(f,l,c){var h=this&&this.__decorate||function(E,S,v,_){var y,A=arguments.length,L=A<3?S:_===null?_=Object.getOwnPropertyDescriptor(S,v):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(E,S,v,_);else for(var D=E.length-1;D>=0;D--)(y=E[D])&&(L=(A<3?y(L):A>3?y(S,v,L):y(S,v))||L);return A>3&&L&&Object.defineProperty(S,v,L),L},p=this&&this.__param||function(E,S){return function(v,_){S(v,_,E)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferDecorationRenderer=void 0;const u=c(4725),b=c(844),C=c(2585);let T=l.BufferDecorationRenderer=class extends b.Disposable{constructor(E,S,v,_,y){super(),this._screenElement=E,this._bufferService=S,this._coreBrowserService=v,this._decorationService=_,this._renderService=y,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((A=>this._removeDecoration(A)))),this.register((0,b.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 E of this._decorationService.decorations)this._renderDecoration(E);this._dimensionsChanged=!1}_renderDecoration(E){this._refreshStyle(E),this._dimensionsChanged&&this._refreshXPosition(E)}_createElement(E){var _;const S=this._coreBrowserService.mainDocument.createElement("div");S.classList.add("xterm-decoration"),S.classList.toggle("xterm-decoration-top-layer",((_=E==null?void 0:E.options)==null?void 0:_.layer)==="top"),S.style.width=`${Math.round((E.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,S.style.height=(E.options.height||1)*this._renderService.dimensions.css.cell.height+"px",S.style.top=(E.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",S.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const v=E.options.x??0;return v&&v>this._bufferService.cols&&(S.style.display="none"),this._refreshXPosition(E,S),S}_refreshStyle(E){const S=E.marker.line-this._bufferService.buffers.active.ydisp;if(S<0||S>=this._bufferService.rows)E.element&&(E.element.style.display="none",E.onRenderEmitter.fire(E.element));else{let v=this._decorationElements.get(E);v||(v=this._createElement(E),E.element=v,this._decorationElements.set(E,v),this._container.appendChild(v),E.onDispose((()=>{this._decorationElements.delete(E),v.remove()}))),v.style.top=S*this._renderService.dimensions.css.cell.height+"px",v.style.display=this._altBufferIsActive?"none":"block",E.onRenderEmitter.fire(v)}}_refreshXPosition(E,S=E.element){if(!S)return;const v=E.options.x??0;(E.options.anchor||"left")==="right"?S.style.right=v?v*this._renderService.dimensions.css.cell.width+"px":"":S.style.left=v?v*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(E){var S;(S=this._decorationElements.get(E))==null||S.remove(),this._decorationElements.delete(E),E.dispose()}};l.BufferDecorationRenderer=T=h([p(1,C.IBufferService),p(2,u.ICoreBrowserService),p(3,C.IDecorationService),p(4,u.IRenderService)],T)},5871:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorZoneStore=void 0,l.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,p){return h>=c.startBufferLine-this._linePadding[p||"full"]&&h<=c.endBufferLine+this._linePadding[p||"full"]}_addLineToZone(c,h){c.startBufferLine=Math.min(c.startBufferLine,h),c.endBufferLine=Math.max(c.endBufferLine,h)}}},5744:function(f,l,c){var h=this&&this.__decorate||function(y,A,L,D){var R,k=arguments.length,M=k<3?A:D===null?D=Object.getOwnPropertyDescriptor(A,L):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(y,A,L,D);else for(var B=y.length-1;B>=0;B--)(R=y[B])&&(M=(k<3?R(M):k>3?R(A,L,M):R(A,L))||M);return k>3&&M&&Object.defineProperty(A,L,M),M},p=this&&this.__param||function(y,A){return function(L,D){A(L,D,y)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OverviewRulerRenderer=void 0;const u=c(5871),b=c(4725),C=c(844),T=c(2585),E={full:0,left:0,center:0,right:0},S={full:0,left:0,center:0,right:0},v={full:0,left:0,center:0,right:0};let _=l.OverviewRulerRenderer=class extends C.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(y,A,L,D,R,k,M){var H;super(),this._viewportElement=y,this._screenElement=A,this._bufferService=L,this._decorationService=D,this._renderService=R,this._optionsService=k,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(),(H=this._viewportElement.parentElement)==null||H.insertBefore(this._canvas,this._viewportElement);const B=this._canvas.getContext("2d");if(!B)throw new Error("Ctx cannot be null");this._ctx=B,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,C.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 y=Math.floor(this._canvas.width/3),A=Math.ceil(this._canvas.width/3);S.full=this._canvas.width,S.left=y,S.center=A,S.right=y,this._refreshDrawHeightConstants(),v.full=0,v.left=0,v.center=S.left,v.right=S.left+S.center}_refreshDrawHeightConstants(){E.full=Math.round(2*this._coreBrowserService.dpr);const y=this._canvas.height/this._bufferService.buffer.lines.length,A=Math.round(Math.max(Math.min(y,12),6)*this._coreBrowserService.dpr);E.left=A,E.center=A,E.right=A}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*E.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*E.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*E.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*E.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 A of this._decorationService.decorations)this._colorZoneStore.addDecoration(A);this._ctx.lineWidth=1;const y=this._colorZoneStore.zones;for(const A of y)A.position!=="full"&&this._renderColorZone(A);for(const A of y)A.position==="full"&&this._renderColorZone(A);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(y){this._ctx.fillStyle=y.color,this._ctx.fillRect(v[y.position||"full"],Math.round((this._canvas.height-1)*(y.startBufferLine/this._bufferService.buffers.active.lines.length)-E[y.position||"full"]/2),S[y.position||"full"],Math.round((this._canvas.height-1)*((y.endBufferLine-y.startBufferLine)/this._bufferService.buffers.active.lines.length)+E[y.position||"full"]))}_queueRefresh(y,A){this._shouldUpdateDimensions=y||this._shouldUpdateDimensions,this._shouldUpdateAnchor=A||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};l.OverviewRulerRenderer=_=h([p(2,T.IBufferService),p(3,T.IDecorationService),p(4,b.IRenderService),p(5,T.IOptionsService),p(6,b.ICoreBrowserService)],_)},2950:function(f,l,c){var h=this&&this.__decorate||function(E,S,v,_){var y,A=arguments.length,L=A<3?S:_===null?_=Object.getOwnPropertyDescriptor(S,v):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(E,S,v,_);else for(var D=E.length-1;D>=0;D--)(y=E[D])&&(L=(A<3?y(L):A>3?y(S,v,L):y(S,v))||L);return A>3&&L&&Object.defineProperty(S,v,L),L},p=this&&this.__param||function(E,S){return function(v,_){S(v,_,E)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CompositionHelper=void 0;const u=c(4725),b=c(2585),C=c(2584);let T=l.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(E,S,v,_,y,A){this._textarea=E,this._compositionView=S,this._bufferService=v,this._optionsService=_,this._coreService=y,this._renderService=A,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(E){this._compositionView.textContent=E.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(E){if(this._isComposing||this._isSendingComposition){if(E.keyCode===229||E.keyCode===16||E.keyCode===17||E.keyCode===18)return!1;this._finalizeComposition(!1)}return E.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(E){if(this._compositionView.classList.remove("active"),this._isComposing=!1,E){const S={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let v;this._isSendingComposition=!1,S.start+=this._dataAlreadySent.length,v=this._isComposing?this._textarea.value.substring(S.start,S.end):this._textarea.value.substring(S.start),v.length>0&&this._coreService.triggerDataEvent(v,!0)}}),0)}else{this._isSendingComposition=!1;const S=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(S,!0)}}_handleAnyTextareaChanges(){const E=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const S=this._textarea.value,v=S.replace(E,"");this._dataAlreadySent=v,S.length>E.length?this._coreService.triggerDataEvent(v,!0):S.length<E.length?this._coreService.triggerDataEvent(`${C.C0.DEL}`,!0):S.length===E.length&&S!==E&&this._coreService.triggerDataEvent(S,!0)}}),0)}updateCompositionElements(E){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const S=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),v=this._renderService.dimensions.css.cell.height,_=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,y=S*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=y+"px",this._compositionView.style.top=_+"px",this._compositionView.style.height=v+"px",this._compositionView.style.lineHeight=v+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const A=this._compositionView.getBoundingClientRect();this._textarea.style.left=y+"px",this._textarea.style.top=_+"px",this._textarea.style.width=Math.max(A.width,1)+"px",this._textarea.style.height=Math.max(A.height,1)+"px",this._textarea.style.lineHeight=A.height+"px"}E||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};l.CompositionHelper=T=h([p(2,b.IBufferService),p(3,b.IOptionsService),p(4,b.ICoreService),p(5,u.IRenderService)],T)},9806:(f,l)=>{function c(h,p,u){const b=u.getBoundingClientRect(),C=h.getComputedStyle(u),T=parseInt(C.getPropertyValue("padding-left")),E=parseInt(C.getPropertyValue("padding-top"));return[p.clientX-b.left-T,p.clientY-b.top-E]}Object.defineProperty(l,"__esModule",{value:!0}),l.getCoords=l.getCoordsRelativeToElement=void 0,l.getCoordsRelativeToElement=c,l.getCoords=function(h,p,u,b,C,T,E,S,v){if(!T)return;const _=c(h,p,u);return _?(_[0]=Math.ceil((_[0]+(v?E/2:0))/E),_[1]=Math.ceil(_[1]/S),_[0]=Math.min(Math.max(_[0],1),b+(v?1:0)),_[1]=Math.min(Math.max(_[1],1),C),_):void 0}},9504:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.moveToCellSequence=void 0;const h=c(2584);function p(S,v,_,y){const A=S-u(S,_),L=v-u(v,_),D=Math.abs(A-L)-(function(R,k,M){let B=0;const H=R-u(R,M),U=k-u(k,M);for(let P=0;P<Math.abs(H-U);P++){const K=b(R,k)==="A"?-1:1,X=M.buffer.lines.get(H+K*P);X!=null&&X.isWrapped&&B++}return B})(S,v,_);return E(D,T(b(S,v),y))}function u(S,v){let _=0,y=v.buffer.lines.get(S),A=y==null?void 0:y.isWrapped;for(;A&&S>=0&&S<v.rows;)_++,y=v.buffer.lines.get(--S),A=y==null?void 0:y.isWrapped;return _}function b(S,v){return S>v?"A":"B"}function C(S,v,_,y,A,L){let D=S,R=v,k="";for(;D!==_||R!==y;)D+=A?1:-1,A&&D>L.cols-1?(k+=L.buffer.translateBufferLineToString(R,!1,S,D),D=0,S=0,R++):!A&&D<0&&(k+=L.buffer.translateBufferLineToString(R,!1,0,S+1),D=L.cols-1,S=D,R--);return k+L.buffer.translateBufferLineToString(R,!1,S,D)}function T(S,v){const _=v?"O":"[";return h.C0.ESC+_+S}function E(S,v){S=Math.floor(S);let _="";for(let y=0;y<S;y++)_+=v;return _}l.moveToCellSequence=function(S,v,_,y){const A=_.buffer.x,L=_.buffer.y;if(!_.buffer.hasScrollback)return(function(k,M,B,H,U,P){return p(M,H,U,P).length===0?"":E(C(k,M,k,M-u(M,U),!1,U).length,T("D",P))})(A,L,0,v,_,y)+p(L,v,_,y)+(function(k,M,B,H,U,P){let K;K=p(M,H,U,P).length>0?H-u(H,U):M;const X=H,G=(function(W,te,z,j,N,$){let I;return I=p(z,j,N,$).length>0?j-u(j,N):te,W<z&&I<=j||W>=z&&I<j?"C":"D"})(k,M,B,H,U,P);return E(C(k,K,B,X,G==="C",U).length,T(G,P))})(A,L,S,v,_,y);let D;if(L===v)return D=A>S?"D":"C",E(Math.abs(A-S),T(D,y));D=L>v?"D":"C";const R=Math.abs(L-v);return E((function(k,M){return M.cols-k})(L>v?S:A,_)+(R-1)*_.cols+1+((L>v?A:S)-1),T(D,y))}},1296:function(f,l,c){var h=this&&this.__decorate||function(P,K,X,G){var W,te=arguments.length,z=te<3?K:G===null?G=Object.getOwnPropertyDescriptor(K,X):G;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(P,K,X,G);else for(var j=P.length-1;j>=0;j--)(W=P[j])&&(z=(te<3?W(z):te>3?W(K,X,z):W(K,X))||z);return te>3&&z&&Object.defineProperty(K,X,z),z},p=this&&this.__param||function(P,K){return function(X,G){K(X,G,P)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRenderer=void 0;const u=c(3787),b=c(2550),C=c(2223),T=c(6171),E=c(6052),S=c(4725),v=c(8055),_=c(8460),y=c(844),A=c(2585),L="xterm-dom-renderer-owner-",D="xterm-rows",R="xterm-fg-",k="xterm-bg-",M="xterm-focus",B="xterm-selection";let H=1,U=l.DomRenderer=class extends y.Disposable{constructor(P,K,X,G,W,te,z,j,N,$,I,se,ae){super(),this._terminal=P,this._document=K,this._element=X,this._screenElement=G,this._viewportElement=W,this._helperContainer=te,this._linkifier2=z,this._charSizeService=N,this._optionsService=$,this._bufferService=I,this._coreBrowserService=se,this._themeService=ae,this._terminalClass=H++,this._rowElements=[],this._selectionRenderModel=(0,E.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new _.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(D),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(B),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,T.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((ue=>this._injectCss(ue)))),this._injectCss(this._themeService.colors),this._rowFactory=j.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((ue=>this._handleLinkHover(ue)))),this.register(this._linkifier2.onHideLinkUnderline((ue=>this._handleLinkLeave(ue)))),this.register((0,y.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 b.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 P=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*P,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*P),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/P),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/P),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 X of this._rowElements)X.style.width=`${this.dimensions.css.canvas.width}px`,X.style.height=`${this.dimensions.css.cell.height}px`,X.style.lineHeight=`${this.dimensions.css.cell.height}px`,X.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const K=`${this._terminalSelector} .${D} 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(P){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let K=`${this._terminalSelector} .${D} { color: ${P.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;K+=`${this._terminalSelector} .${D} .xterm-dim { color: ${v.color.multiplyOpacity(P.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 X=`blink_underline_${this._terminalClass}`,G=`blink_bar_${this._terminalClass}`,W=`blink_block_${this._terminalClass}`;K+=`@keyframes ${X} { 50% { border-bottom-style: hidden; }}`,K+=`@keyframes ${G} { 50% { box-shadow: none; }}`,K+=`@keyframes ${W} { 0% { background-color: ${P.cursor.css}; color: ${P.cursorAccent.css}; } 50% { background-color: inherit; color: ${P.cursor.css}; }}`,K+=`${this._terminalSelector} .${D}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${X} 1s step-end infinite;}${this._terminalSelector} .${D}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${G} 1s step-end infinite;}${this._terminalSelector} .${D}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${W} 1s step-end infinite;}${this._terminalSelector} .${D} .xterm-cursor.xterm-cursor-block { background-color: ${P.cursor.css}; color: ${P.cursorAccent.css};}${this._terminalSelector} .${D} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${P.cursor.css} !important; color: ${P.cursorAccent.css} !important;}${this._terminalSelector} .${D} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${P.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${D} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${P.cursor.css} inset;}${this._terminalSelector} .${D} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${P.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,K+=`${this._terminalSelector} .${B} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${B} div { position: absolute; background-color: ${P.selectionBackgroundOpaque.css};}${this._terminalSelector} .${B} div { position: absolute; background-color: ${P.selectionInactiveBackgroundOpaque.css};}`;for(const[te,z]of P.ansi.entries())K+=`${this._terminalSelector} .${R}${te} { color: ${z.css}; }${this._terminalSelector} .${R}${te}.xterm-dim { color: ${v.color.multiplyOpacity(z,.5).css}; }${this._terminalSelector} .${k}${te} { background-color: ${z.css}; }`;K+=`${this._terminalSelector} .${R}${C.INVERTED_DEFAULT_COLOR} { color: ${v.color.opaque(P.background).css}; }${this._terminalSelector} .${R}${C.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${v.color.multiplyOpacity(v.color.opaque(P.background),.5).css}; }${this._terminalSelector} .${k}${C.INVERTED_DEFAULT_COLOR} { background-color: ${P.foreground.css}; }`,this._themeStyleElement.textContent=K}_setDefaultSpacing(){const P=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${P}px`,this._rowFactory.defaultSpacing=P}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(P,K){for(let X=this._rowElements.length;X<=K;X++){const G=this._document.createElement("div");this._rowContainer.appendChild(G),this._rowElements.push(G)}for(;this._rowElements.length>K;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(P,K){this._refreshRowElements(P,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(P,K,X){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(P,K,X),this.renderRows(0,this._bufferService.rows-1),!P||!K)return;this._selectionRenderModel.update(this._terminal,P,K,X);const G=this._selectionRenderModel.viewportStartRow,W=this._selectionRenderModel.viewportEndRow,te=this._selectionRenderModel.viewportCappedStartRow,z=this._selectionRenderModel.viewportCappedEndRow;if(te>=this._bufferService.rows||z<0)return;const j=this._document.createDocumentFragment();if(X){const N=P[0]>K[0];j.appendChild(this._createSelectionElement(te,N?K[0]:P[0],N?P[0]:K[0],z-te+1))}else{const N=G===te?P[0]:0,$=te===W?K[0]:this._bufferService.cols;j.appendChild(this._createSelectionElement(te,N,$));const I=z-te-1;if(j.appendChild(this._createSelectionElement(te+1,0,this._bufferService.cols,I)),te!==z){const se=W===z?K[0]:this._bufferService.cols;j.appendChild(this._createSelectionElement(z,0,se))}}this._selectionContainer.appendChild(j)}_createSelectionElement(P,K,X,G=1){const W=this._document.createElement("div"),te=K*this.dimensions.css.cell.width;let z=this.dimensions.css.cell.width*(X-K);return te+z>this.dimensions.css.canvas.width&&(z=this.dimensions.css.canvas.width-te),W.style.height=G*this.dimensions.css.cell.height+"px",W.style.top=P*this.dimensions.css.cell.height+"px",W.style.left=`${te}px`,W.style.width=`${z}px`,W}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 P of this._rowElements)P.replaceChildren()}renderRows(P,K){const X=this._bufferService.buffer,G=X.ybase+X.y,W=Math.min(X.x,this._bufferService.cols-1),te=this._optionsService.rawOptions.cursorBlink,z=this._optionsService.rawOptions.cursorStyle,j=this._optionsService.rawOptions.cursorInactiveStyle;for(let N=P;N<=K;N++){const $=N+X.ydisp,I=this._rowElements[N],se=X.lines.get($);if(!I||!se)break;I.replaceChildren(...this._rowFactory.createRow(se,$,$===G,z,j,W,te,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${L}${this._terminalClass}`}_handleLinkHover(P){this._setCellUnderline(P.x1,P.x2,P.y1,P.y2,P.cols,!0)}_handleLinkLeave(P){this._setCellUnderline(P.x1,P.x2,P.y1,P.y2,P.cols,!1)}_setCellUnderline(P,K,X,G,W,te){X<0&&(P=0),G<0&&(K=0);const z=this._bufferService.rows-1;X=Math.max(Math.min(X,z),0),G=Math.max(Math.min(G,z),0),W=Math.min(W,this._bufferService.cols);const j=this._bufferService.buffer,N=j.ybase+j.y,$=Math.min(j.x,W-1),I=this._optionsService.rawOptions.cursorBlink,se=this._optionsService.rawOptions.cursorStyle,ae=this._optionsService.rawOptions.cursorInactiveStyle;for(let ue=X;ue<=G;++ue){const Y=ue+j.ydisp,q=this._rowElements[ue],Z=j.lines.get(Y);if(!q||!Z)break;q.replaceChildren(...this._rowFactory.createRow(Z,Y,Y===N,se,ae,$,I,this.dimensions.css.cell.width,this._widthCache,te?ue===X?P:0:-1,te?(ue===G?K:W)-1:-1))}}};l.DomRenderer=U=h([p(7,A.IInstantiationService),p(8,S.ICharSizeService),p(9,A.IOptionsService),p(10,A.IBufferService),p(11,S.ICoreBrowserService),p(12,S.IThemeService)],U)},3787:function(f,l,c){var h=this&&this.__decorate||function(D,R,k,M){var B,H=arguments.length,U=H<3?R:M===null?M=Object.getOwnPropertyDescriptor(R,k):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(D,R,k,M);else for(var P=D.length-1;P>=0;P--)(B=D[P])&&(U=(H<3?B(U):H>3?B(R,k,U):B(R,k))||U);return H>3&&U&&Object.defineProperty(R,k,U),U},p=this&&this.__param||function(D,R){return function(k,M){R(k,M,D)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRendererRowFactory=void 0;const u=c(2223),b=c(643),C=c(511),T=c(2585),E=c(8055),S=c(4725),v=c(4269),_=c(6171),y=c(3734);let A=l.DomRendererRowFactory=class{constructor(D,R,k,M,B,H,U){this._document=D,this._characterJoinerService=R,this._optionsService=k,this._coreBrowserService=M,this._coreService=B,this._decorationService=H,this._themeService=U,this._workCell=new C.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(D,R,k){this._selectionStart=D,this._selectionEnd=R,this._columnSelectMode=k}createRow(D,R,k,M,B,H,U,P,K,X,G){const W=[],te=this._characterJoinerService.getJoinedCharacters(R),z=this._themeService.colors;let j,N=D.getNoBgTrimmedLength();k&&N<H+1&&(N=H+1);let $=0,I="",se=0,ae=0,ue=0,Y=!1,q=0,Z=!1,Q=0;const _e=[],ve=X!==-1&&G!==-1;for(let De=0;De<N;De++){D.loadCell(De,this._workCell);let Ae=this._workCell.getWidth();if(Ae===0)continue;let Ke=!1,ht=De,Re=this._workCell;if(te.length>0&&De===te[0][0]){Ke=!0;const Pe=te.shift();Re=new v.JoinedCellData(this._workCell,D.translateToString(!0,Pe[0],Pe[1]),Pe[1]-Pe[0]),ht=Pe[1]-1,Ae=Re.getWidth()}const sn=this._isCellInSelection(De,R),en=k&&De===H,Vt=ve&&De>=X&&De<=G;let an=!1;this._decorationService.forEachDecorationAtCell(De,R,void 0,(Pe=>{an=!0}));let yn=Re.getChars()||b.WHITESPACE_CELL_CHAR;if(yn===" "&&(Re.isUnderline()||Re.isOverline())&&(yn=" "),Q=Ae*P-K.get(yn,Re.isBold(),Re.isItalic()),j){if($&&(sn&&Z||!sn&&!Z&&Re.bg===se)&&(sn&&Z&&z.selectionForeground||Re.fg===ae)&&Re.extended.ext===ue&&Vt===Y&&Q===q&&!en&&!Ke&&!an){Re.isInvisible()?I+=b.WHITESPACE_CELL_CHAR:I+=yn,$++;continue}$&&(j.textContent=I),j=this._document.createElement("span"),$=0,I=""}else j=this._document.createElement("span");if(se=Re.bg,ae=Re.fg,ue=Re.extended.ext,Y=Vt,q=Q,Z=sn,Ke&&H>=De&&H<=ht&&(H=De),!this._coreService.isCursorHidden&&en&&this._coreService.isCursorInitialized){if(_e.push("xterm-cursor"),this._coreBrowserService.isFocused)U&&_e.push("xterm-cursor-blink"),_e.push(M==="bar"?"xterm-cursor-bar":M==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(B)switch(B){case"outline":_e.push("xterm-cursor-outline");break;case"block":_e.push("xterm-cursor-block");break;case"bar":_e.push("xterm-cursor-bar");break;case"underline":_e.push("xterm-cursor-underline")}}if(Re.isBold()&&_e.push("xterm-bold"),Re.isItalic()&&_e.push("xterm-italic"),Re.isDim()&&_e.push("xterm-dim"),I=Re.isInvisible()?b.WHITESPACE_CELL_CHAR:Re.getChars()||b.WHITESPACE_CELL_CHAR,Re.isUnderline()&&(_e.push(`xterm-underline-${Re.extended.underlineStyle}`),I===" "&&(I=" "),!Re.isUnderlineColorDefault()))if(Re.isUnderlineColorRGB())j.style.textDecorationColor=`rgb(${y.AttributeData.toColorRGB(Re.getUnderlineColor()).join(",")})`;else{let Pe=Re.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Re.isBold()&&Pe<8&&(Pe+=8),j.style.textDecorationColor=z.ansi[Pe].css}Re.isOverline()&&(_e.push("xterm-overline"),I===" "&&(I=" ")),Re.isStrikethrough()&&_e.push("xterm-strikethrough"),Vt&&(j.style.textDecoration="underline");let bt=Re.getFgColor(),et=Re.getFgColorMode(),Lt=Re.getBgColor(),fe=Re.getBgColorMode();const Se=!!Re.isInverse();if(Se){const Pe=bt;bt=Lt,Lt=Pe;const vt=et;et=fe,fe=vt}let xe,Le,Be,mt=!1;switch(this._decorationService.forEachDecorationAtCell(De,R,void 0,(Pe=>{Pe.options.layer!=="top"&&mt||(Pe.backgroundColorRGB&&(fe=50331648,Lt=Pe.backgroundColorRGB.rgba>>8&16777215,xe=Pe.backgroundColorRGB),Pe.foregroundColorRGB&&(et=50331648,bt=Pe.foregroundColorRGB.rgba>>8&16777215,Le=Pe.foregroundColorRGB),mt=Pe.options.layer==="top")})),!mt&&sn&&(xe=this._coreBrowserService.isFocused?z.selectionBackgroundOpaque:z.selectionInactiveBackgroundOpaque,Lt=xe.rgba>>8&16777215,fe=50331648,mt=!0,z.selectionForeground&&(et=50331648,bt=z.selectionForeground.rgba>>8&16777215,Le=z.selectionForeground)),mt&&_e.push("xterm-decoration-top"),fe){case 16777216:case 33554432:Be=z.ansi[Lt],_e.push(`xterm-bg-${Lt}`);break;case 50331648:Be=E.channels.toColor(Lt>>16,Lt>>8&255,255&Lt),this._addStyle(j,`background-color:#${L((Lt>>>0).toString(16),"0",6)}`);break;default:Se?(Be=z.foreground,_e.push(`xterm-bg-${u.INVERTED_DEFAULT_COLOR}`)):Be=z.background}switch(xe||Re.isDim()&&(xe=E.color.multiplyOpacity(Be,.5)),et){case 16777216:case 33554432:Re.isBold()&&bt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(bt+=8),this._applyMinimumContrast(j,Be,z.ansi[bt],Re,xe,void 0)||_e.push(`xterm-fg-${bt}`);break;case 50331648:const Pe=E.channels.toColor(bt>>16&255,bt>>8&255,255&bt);this._applyMinimumContrast(j,Be,Pe,Re,xe,Le)||this._addStyle(j,`color:#${L(bt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(j,Be,z.foreground,Re,xe,Le)||Se&&_e.push(`xterm-fg-${u.INVERTED_DEFAULT_COLOR}`)}_e.length&&(j.className=_e.join(" "),_e.length=0),en||Ke||an?j.textContent=I:$++,Q!==this.defaultSpacing&&(j.style.letterSpacing=`${Q}px`),W.push(j),De=ht}return j&&$&&(j.textContent=I),W}_applyMinimumContrast(D,R,k,M,B,H){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,_.treatGlyphAsBackgroundColor)(M.getCode()))return!1;const U=this._getContrastCache(M);let P;if(B||H||(P=U.getColor(R.rgba,k.rgba)),P===void 0){const K=this._optionsService.rawOptions.minimumContrastRatio/(M.isDim()?2:1);P=E.color.ensureContrastRatio(B||R,H||k,K),U.setColor((B||R).rgba,(H||k).rgba,P??null)}return!!P&&(this._addStyle(D,`color:${P.css}`),!0)}_getContrastCache(D){return D.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(D,R){D.setAttribute("style",`${D.getAttribute("style")||""}${R};`)}_isCellInSelection(D,R){const k=this._selectionStart,M=this._selectionEnd;return!(!k||!M)&&(this._columnSelectMode?k[0]<=M[0]?D>=k[0]&&R>=k[1]&&D<M[0]&&R<=M[1]:D<k[0]&&R>=k[1]&&D>=M[0]&&R<=M[1]:R>k[1]&&R<M[1]||k[1]===M[1]&&R===k[1]&&D>=k[0]&&D<M[0]||k[1]<M[1]&&R===M[1]&&D<M[0]||k[1]<M[1]&&R===k[1]&&D>=k[0])}};function L(D,R,k){for(;D.length<k;)D=R+D;return D}l.DomRendererRowFactory=A=h([p(1,S.ICharacterJoinerService),p(2,T.IOptionsService),p(3,S.ICoreBrowserService),p(4,T.ICoreService),p(5,T.IDecorationService),p(6,S.IThemeService)],A)},2550:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WidthCache=void 0,l.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 p=c.createElement("span");p.classList.add("xterm-char-measure-element");const u=c.createElement("span");u.classList.add("xterm-char-measure-element"),u.style.fontWeight="bold";const b=c.createElement("span");b.classList.add("xterm-char-measure-element"),b.style.fontStyle="italic";const C=c.createElement("span");C.classList.add("xterm-char-measure-element"),C.style.fontWeight="bold",C.style.fontStyle="italic",this._measureElements=[p,u,b,C],this._container.appendChild(p),this._container.appendChild(u),this._container.appendChild(b),this._container.appendChild(C),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,p,u){c===this._font&&h===this._fontSize&&p===this._weight&&u===this._weightBold||(this._font=c,this._fontSize=h,this._weight=p,this._weightBold=u,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${p}`,this._measureElements[1].style.fontWeight=`${u}`,this._measureElements[2].style.fontWeight=`${p}`,this._measureElements[3].style.fontWeight=`${u}`,this.clear())}get(c,h,p){let u=0;if(!h&&!p&&c.length===1&&(u=c.charCodeAt(0))<256){if(this._flat[u]!==-9999)return this._flat[u];const T=this._measure(c,0);return T>0&&(this._flat[u]=T),T}let b=c;h&&(b+="B"),p&&(b+="I");let C=this._holey.get(b);if(C===void 0){let T=0;h&&(T|=1),p&&(T|=2),C=this._measure(c,T),C>0&&this._holey.set(b,C)}return C}_measure(c,h){const p=this._measureElements[h];return p.textContent=c.repeat(32),p.offsetWidth/32}}},2223:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TEXT_BASELINE=l.DIM_OPACITY=l.INVERTED_DEFAULT_COLOR=void 0;const h=c(6114);l.INVERTED_DEFAULT_COLOR=257,l.DIM_OPACITY=.5,l.TEXT_BASELINE=h.isFirefox||h.isLegacyEdge?"bottom":"ideographic"},6171:(f,l)=>{function c(p){return 57508<=p&&p<=57558}function h(p){return p>=128512&&p<=128591||p>=127744&&p<=128511||p>=128640&&p<=128767||p>=9728&&p<=9983||p>=9984&&p<=10175||p>=65024&&p<=65039||p>=129280&&p<=129535||p>=127462&&p<=127487}Object.defineProperty(l,"__esModule",{value:!0}),l.computeNextVariantOffset=l.createRenderDimensions=l.treatGlyphAsBackgroundColor=l.allowRescaling=l.isEmoji=l.isRestrictedPowerlineGlyph=l.isPowerlineGlyph=l.throwIfFalsy=void 0,l.throwIfFalsy=function(p){if(!p)throw new Error("value must not be falsy");return p},l.isPowerlineGlyph=c,l.isRestrictedPowerlineGlyph=function(p){return 57520<=p&&p<=57527},l.isEmoji=h,l.allowRescaling=function(p,u,b,C){return u===1&&b>Math.ceil(1.5*C)&&p!==void 0&&p>255&&!h(p)&&!c(p)&&!(function(T){return 57344<=T&&T<=63743})(p)},l.treatGlyphAsBackgroundColor=function(p){return c(p)||(function(u){return 9472<=u&&u<=9631})(p)},l.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}}}},l.computeNextVariantOffset=function(p,u,b=0){return(p-(2*Math.round(u)-b))%(2*Math.round(u))}},6052:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.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(p,u,b,C=!1){if(this.selectionStart=u,this.selectionEnd=b,!u||!b||u[0]===b[0]&&u[1]===b[1])return void this.clear();const T=p.buffers.active.ydisp,E=u[1]-T,S=b[1]-T,v=Math.max(E,0),_=Math.min(S,p.rows-1);v>=p.rows||_<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=C,this.viewportStartRow=E,this.viewportEndRow=S,this.viewportCappedStartRow=v,this.viewportCappedEndRow=_,this.startCol=u[0],this.endCol=b[0])}isCellSelected(p,u,b){return!!this.hasSelection&&(b-=p.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?u>=this.startCol&&b>=this.viewportCappedStartRow&&u<this.endCol&&b<=this.viewportCappedEndRow:u<this.startCol&&b>=this.viewportCappedStartRow&&u>=this.endCol&&b<=this.viewportCappedEndRow:b>this.viewportStartRow&&b<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&b===this.viewportStartRow&&u>=this.startCol&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&b===this.viewportEndRow&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&b===this.viewportStartRow&&u>=this.startCol)}}l.createSelectionRenderModel=function(){return new c}},456:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionModel=void 0,l.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,l,c){var h=this&&this.__decorate||function(_,y,A,L){var D,R=arguments.length,k=R<3?y:L===null?L=Object.getOwnPropertyDescriptor(y,A):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(_,y,A,L);else for(var M=_.length-1;M>=0;M--)(D=_[M])&&(k=(R<3?D(k):R>3?D(y,A,k):D(y,A))||k);return R>3&&k&&Object.defineProperty(y,A,k),k},p=this&&this.__param||function(_,y){return function(A,L){y(A,L,_)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharSizeService=void 0;const u=c(2585),b=c(8460),C=c(844);let T=l.CharSizeService=class extends C.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(_,y,A){super(),this._optionsService=A,this.width=0,this.height=0,this._onCharSizeChange=this.register(new b.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new v(this._optionsService))}catch{this._measureStrategy=this.register(new S(_,y,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const _=this._measureStrategy.measure();_.width===this.width&&_.height===this.height||(this.width=_.width,this.height=_.height,this._onCharSizeChange.fire())}};l.CharSizeService=T=h([p(2,u.IOptionsService)],T);class E extends C.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(y,A){y!==void 0&&y>0&&A!==void 0&&A>0&&(this._result.width=y,this._result.height=A)}}class S extends E{constructor(y,A,L){super(),this._document=y,this._parentElement=A,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 v extends E{constructor(y){super(),this._optionsService=y,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const A=this._ctx.measureText("W");if(!("width"in A&&"fontBoundingBoxAscent"in A&&"fontBoundingBoxDescent"in A))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const y=this._ctx.measureText("W");return this._validateAndSet(y.width,y.fontBoundingBoxAscent+y.fontBoundingBoxDescent),this._result}}},4269:function(f,l,c){var h=this&&this.__decorate||function(v,_,y,A){var L,D=arguments.length,R=D<3?_:A===null?A=Object.getOwnPropertyDescriptor(_,y):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(v,_,y,A);else for(var k=v.length-1;k>=0;k--)(L=v[k])&&(R=(D<3?L(R):D>3?L(_,y,R):L(_,y))||R);return D>3&&R&&Object.defineProperty(_,y,R),R},p=this&&this.__param||function(v,_){return function(y,A){_(y,A,v)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharacterJoinerService=l.JoinedCellData=void 0;const u=c(3734),b=c(643),C=c(511),T=c(2585);class E extends u.AttributeData{constructor(_,y,A){super(),this.content=0,this.combinedData="",this.fg=_.fg,this.bg=_.bg,this.combinedData=y,this._width=A}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(_){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.JoinedCellData=E;let S=l.CharacterJoinerService=class i_{constructor(_){this._bufferService=_,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new C.CellData}register(_){const y={id:this._nextCharacterJoinerId++,handler:_};return this._characterJoiners.push(y),y.id}deregister(_){for(let y=0;y<this._characterJoiners.length;y++)if(this._characterJoiners[y].id===_)return this._characterJoiners.splice(y,1),!0;return!1}getJoinedCharacters(_){if(this._characterJoiners.length===0)return[];const y=this._bufferService.buffer.lines.get(_);if(!y||y.length===0)return[];const A=[],L=y.translateToString(!0);let D=0,R=0,k=0,M=y.getFg(0),B=y.getBg(0);for(let H=0;H<y.getTrimmedLength();H++)if(y.loadCell(H,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==M||this._workCell.bg!==B){if(H-D>1){const U=this._getJoinedRanges(L,k,R,y,D);for(let P=0;P<U.length;P++)A.push(U[P])}D=H,k=R,M=this._workCell.fg,B=this._workCell.bg}R+=this._workCell.getChars().length||b.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-D>1){const H=this._getJoinedRanges(L,k,R,y,D);for(let U=0;U<H.length;U++)A.push(H[U])}return A}_getJoinedRanges(_,y,A,L,D){const R=_.substring(y,A);let k=[];try{k=this._characterJoiners[0].handler(R)}catch(M){console.error(M)}for(let M=1;M<this._characterJoiners.length;M++)try{const B=this._characterJoiners[M].handler(R);for(let H=0;H<B.length;H++)i_._mergeRanges(k,B[H])}catch(B){console.error(B)}return this._stringRangesToCellRanges(k,L,D),k}_stringRangesToCellRanges(_,y,A){let L=0,D=!1,R=0,k=_[L];if(k){for(let M=A;M<this._bufferService.cols;M++){const B=y.getWidth(M),H=y.getString(M).length||b.WHITESPACE_CELL_CHAR.length;if(B!==0){if(!D&&k[0]<=R&&(k[0]=M,D=!0),k[1]<=R){if(k[1]=M,k=_[++L],!k)break;k[0]<=R?(k[0]=M,D=!0):D=!1}R+=H}}k&&(k[1]=this._bufferService.cols)}}static _mergeRanges(_,y){let A=!1;for(let L=0;L<_.length;L++){const D=_[L];if(A){if(y[1]<=D[0])return _[L-1][1]=y[1],_;if(y[1]<=D[1])return _[L-1][1]=Math.max(y[1],D[1]),_.splice(L,1),_;_.splice(L,1),L--}else{if(y[1]<=D[0])return _.splice(L,0,y),_;if(y[1]<=D[1])return D[0]=Math.min(y[0],D[0]),_;y[0]<D[1]&&(D[0]=Math.min(y[0],D[0]),A=!0)}}return A?_[_.length-1][1]=y[1]:_.push(y),_}};l.CharacterJoinerService=S=h([p(0,T.IBufferService)],S)},5114:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreBrowserService=void 0;const h=c(844),p=c(8460),u=c(3656);class b extends h.Disposable{constructor(E,S,v){super(),this._textarea=E,this._window=S,this.mainDocument=v,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new C(this._window),this._onDprChange=this.register(new p.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new p.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((_=>this._screenDprMonitor.setWindow(_)))),this.register((0,p.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(E){this._window!==E&&(this._window=E,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}}l.CoreBrowserService=b;class C extends h.Disposable{constructor(E){super(),this._parentWindow=E,this._windowResizeListener=this.register(new h.MutableDisposable),this._onDprChange=this.register(new p.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(E){this._parentWindow=E,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 E;this._outerListener&&((E=this._resolutionMediaMatchList)==null||E.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,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.LinkProviderService=void 0;const h=c(844);class p extends h.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,h.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(b){return this.linkProviders.push(b),{dispose:()=>{const C=this.linkProviders.indexOf(b);C!==-1&&this.linkProviders.splice(C,1)}}}}l.LinkProviderService=p},8934:function(f,l,c){var h=this&&this.__decorate||function(T,E,S,v){var _,y=arguments.length,A=y<3?E:v===null?v=Object.getOwnPropertyDescriptor(E,S):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(T,E,S,v);else for(var L=T.length-1;L>=0;L--)(_=T[L])&&(A=(y<3?_(A):y>3?_(E,S,A):_(E,S))||A);return y>3&&A&&Object.defineProperty(E,S,A),A},p=this&&this.__param||function(T,E){return function(S,v){E(S,v,T)}};Object.defineProperty(l,"__esModule",{value:!0}),l.MouseService=void 0;const u=c(4725),b=c(9806);let C=l.MouseService=class{constructor(T,E){this._renderService=T,this._charSizeService=E}getCoords(T,E,S,v,_){return(0,b.getCoords)(window,T,E,S,v,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,_)}getMouseReportCoords(T,E){const S=(0,b.getCoordsRelativeToElement)(window,T,E);if(this._charSizeService.hasValidSize)return S[0]=Math.min(Math.max(S[0],0),this._renderService.dimensions.css.canvas.width-1),S[1]=Math.min(Math.max(S[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(S[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(S[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(S[0]),y:Math.floor(S[1])}}};l.MouseService=C=h([p(0,u.IRenderService),p(1,u.ICharSizeService)],C)},3230:function(f,l,c){var h=this&&this.__decorate||function(_,y,A,L){var D,R=arguments.length,k=R<3?y:L===null?L=Object.getOwnPropertyDescriptor(y,A):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(_,y,A,L);else for(var M=_.length-1;M>=0;M--)(D=_[M])&&(k=(R<3?D(k):R>3?D(y,A,k):D(y,A))||k);return R>3&&k&&Object.defineProperty(y,A,k),k},p=this&&this.__param||function(_,y){return function(A,L){y(A,L,_)}};Object.defineProperty(l,"__esModule",{value:!0}),l.RenderService=void 0;const u=c(6193),b=c(4725),C=c(8460),T=c(844),E=c(7226),S=c(2585);let v=l.RenderService=class extends T.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(_,y,A,L,D,R,k,M){super(),this._rowCount=_,this._charSizeService=L,this._renderer=this.register(new T.MutableDisposable),this._pausedResizeTask=new E.DebouncedIdleTask,this._observerDisposable=this.register(new T.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 C.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new C.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new C.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new C.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new u.RenderDebouncer(((B,H)=>this._renderRows(B,H)),k),this.register(this._renderDebouncer),this.register(k.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(R.onResize((()=>this._fullRefresh()))),this.register(R.buffers.onBufferActivate((()=>{var B;return(B=this._renderer.value)==null?void 0:B.clear()}))),this.register(A.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(D.onDecorationRegistered((()=>this._fullRefresh()))),this.register(D.onDecorationRemoved((()=>this._fullRefresh()))),this.register(A.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(R.cols,R.rows),this._fullRefresh()}))),this.register(A.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(R.buffer.y,R.buffer.y,!0)))),this.register(M.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(k.window,y),this.register(k.onWindowChange((B=>this._registerIntersectionObserver(B,y))))}_registerIntersectionObserver(_,y){if("IntersectionObserver"in _){const A=new _.IntersectionObserver((L=>this._handleIntersectionChange(L[L.length-1])),{threshold:0});A.observe(y),this._observerDisposable.value=(0,T.toDisposable)((()=>A.disconnect()))}}_handleIntersectionChange(_){this._isPaused=_.isIntersecting===void 0?_.intersectionRatio===0:!_.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(_,y,A=!1){this._isPaused?this._needsFullRefresh=!0:(A||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(_,y,this._rowCount))}_renderRows(_,y){this._renderer.value&&(_=Math.min(_,this._rowCount-1),y=Math.min(y,this._rowCount-1),this._renderer.value.renderRows(_,y),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:_,end:y}),this._onRender.fire({start:_,end:y}),this._isNextRenderRedrawOnly=!0)}resize(_,y){this._rowCount=y,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(_){this._renderer.value=_,this._renderer.value&&(this._renderer.value.onRequestRedraw((y=>this.refreshRows(y.start,y.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(_){return this._renderDebouncer.addRefreshCallback(_)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var _,y;this._renderer.value&&((y=(_=this._renderer.value).clearTextureAtlas)==null||y.call(_),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(_,y){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var A;return(A=this._renderer.value)==null?void 0:A.handleResize(_,y)})):this._renderer.value.handleResize(_,y),this._fullRefresh())}handleCharSizeChanged(){var _;(_=this._renderer.value)==null||_.handleCharSizeChanged()}handleBlur(){var _;(_=this._renderer.value)==null||_.handleBlur()}handleFocus(){var _;(_=this._renderer.value)==null||_.handleFocus()}handleSelectionChanged(_,y,A){var L;this._selectionState.start=_,this._selectionState.end=y,this._selectionState.columnSelectMode=A,(L=this._renderer.value)==null||L.handleSelectionChanged(_,y,A)}handleCursorMove(){var _;(_=this._renderer.value)==null||_.handleCursorMove()}clear(){var _;(_=this._renderer.value)==null||_.clear()}};l.RenderService=v=h([p(2,S.IOptionsService),p(3,b.ICharSizeService),p(4,S.IDecorationService),p(5,S.IBufferService),p(6,b.ICoreBrowserService),p(7,b.IThemeService)],v)},9312:function(f,l,c){var h=this&&this.__decorate||function(k,M,B,H){var U,P=arguments.length,K=P<3?M:H===null?H=Object.getOwnPropertyDescriptor(M,B):H;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")K=Reflect.decorate(k,M,B,H);else for(var X=k.length-1;X>=0;X--)(U=k[X])&&(K=(P<3?U(K):P>3?U(M,B,K):U(M,B))||K);return P>3&&K&&Object.defineProperty(M,B,K),K},p=this&&this.__param||function(k,M){return function(B,H){M(B,H,k)}};Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionService=void 0;const u=c(9806),b=c(9504),C=c(456),T=c(4725),E=c(8460),S=c(844),v=c(6114),_=c(4841),y=c(511),A=c(2585),L=" ",D=new RegExp(L,"g");let R=l.SelectionService=class extends S.Disposable{constructor(k,M,B,H,U,P,K,X,G){super(),this._element=k,this._screenElement=M,this._linkifier=B,this._bufferService=H,this._coreService=U,this._mouseService=P,this._optionsService=K,this._renderService=X,this._coreBrowserService=G,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new y.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new E.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new E.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new E.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new E.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=W=>this._handleMouseMove(W),this._mouseUpListener=W=>this._handleMouseUp(W),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((W=>this._handleTrim(W))),this.register(this._bufferService.buffers.onBufferActivate((W=>this._handleBufferActivate(W)))),this.enable(),this._model=new C.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,S.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 k=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!(!k||!M||k[0]===M[0]&&k[1]===M[1])}get selectionText(){const k=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;if(!k||!M)return"";const B=this._bufferService.buffer,H=[];if(this._activeSelectionMode===3){if(k[0]===M[0])return"";const U=k[0]<M[0]?k[0]:M[0],P=k[0]<M[0]?M[0]:k[0];for(let K=k[1];K<=M[1];K++){const X=B.translateBufferLineToString(K,!0,U,P);H.push(X)}}else{const U=k[1]===M[1]?M[0]:void 0;H.push(B.translateBufferLineToString(k[1],!0,k[0],U));for(let P=k[1]+1;P<=M[1]-1;P++){const K=B.lines.get(P),X=B.translateBufferLineToString(P,!0);K!=null&&K.isWrapped?H[H.length-1]+=X:H.push(X)}if(k[1]!==M[1]){const P=B.lines.get(M[1]),K=B.translateBufferLineToString(M[1],!0,0,M[0]);P&&P.isWrapped?H[H.length-1]+=K:H.push(K)}}return H.map((U=>U.replace(D," "))).join(v.isWindows?`\r
|
|
56
|
-
`:`
|
|
57
|
-
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(k){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),v.isLinux&&k&&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(k){const M=this._getMouseBufferCoords(k),B=this._model.finalSelectionStart,H=this._model.finalSelectionEnd;return!!(B&&H&&M)&&this._areCoordsInSelection(M,B,H)}isCellInSelection(k,M){const B=this._model.finalSelectionStart,H=this._model.finalSelectionEnd;return!(!B||!H)&&this._areCoordsInSelection([k,M],B,H)}_areCoordsInSelection(k,M,B){return k[1]>M[1]&&k[1]<B[1]||M[1]===B[1]&&k[1]===M[1]&&k[0]>=M[0]&&k[0]<B[0]||M[1]<B[1]&&k[1]===B[1]&&k[0]<B[0]||M[1]<B[1]&&k[1]===M[1]&&k[0]>=M[0]}_selectWordAtCursor(k,M){var U,P;const B=(P=(U=this._linkifier.currentLink)==null?void 0:U.link)==null?void 0:P.range;if(B)return this._model.selectionStart=[B.start.x-1,B.start.y-1],this._model.selectionStartLength=(0,_.getRangeLength)(B,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const H=this._getMouseBufferCoords(k);return!!H&&(this._selectWordAt(H,M),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(k,M){this._model.clearSelection(),k=Math.max(k,0),M=Math.min(M,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,k],this._model.selectionEnd=[this._bufferService.cols,M],this.refresh(),this._onSelectionChange.fire()}_handleTrim(k){this._model.handleTrim(k)&&this.refresh()}_getMouseBufferCoords(k){const M=this._mouseService.getCoords(k,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(M)return M[0]--,M[1]--,M[1]+=this._bufferService.buffer.ydisp,M}_getMouseEventScrollAmount(k){let M=(0,u.getCoordsRelativeToElement)(this._coreBrowserService.window,k,this._screenElement)[1];const B=this._renderService.dimensions.css.canvas.height;return M>=0&&M<=B?0:(M>B&&(M-=B),M=Math.min(Math.max(M,-50),50),M/=50,M/Math.abs(M)+Math.round(14*M))}shouldForceSelection(k){return v.isMac?k.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:k.shiftKey}handleMouseDown(k){if(this._mouseDownTimeStamp=k.timeStamp,(k.button!==2||!this.hasSelection)&&k.button===0){if(!this._enabled){if(!this.shouldForceSelection(k))return;k.stopPropagation()}k.preventDefault(),this._dragScrollAmount=0,this._enabled&&k.shiftKey?this._handleIncrementalClick(k):k.detail===1?this._handleSingleClick(k):k.detail===2?this._handleDoubleClick(k):k.detail===3&&this._handleTripleClick(k),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(k){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(k))}_handleSingleClick(k){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(k)?3:0,this._model.selectionStart=this._getMouseBufferCoords(k),!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(k){this._selectWordAtCursor(k,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(k){const M=this._getMouseBufferCoords(k);M&&(this._activeSelectionMode=2,this._selectLineAt(M[1]))}shouldColumnSelect(k){return k.altKey&&!(v.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(k){if(k.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(k),!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(k),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const B=this._bufferService.buffer;if(this._model.selectionEnd[1]<B.lines.length){const H=B.lines.get(this._model.selectionEnd[1]);H&&H.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 k=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(k.ydisp+this._bufferService.rows,k.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=k.ydisp),this.refresh()}}_handleMouseUp(k){const M=k.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&M<500&&k.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const B=this._mouseService.getCoords(k,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(B&&B[0]!==void 0&&B[1]!==void 0){const H=(0,b.moveToCellSequence)(B[0]-1,B[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(H,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const k=this._model.finalSelectionStart,M=this._model.finalSelectionEnd,B=!(!k||!M||k[0]===M[0]&&k[1]===M[1]);B?k&&M&&(this._oldSelectionStart&&this._oldSelectionEnd&&k[0]===this._oldSelectionStart[0]&&k[1]===this._oldSelectionStart[1]&&M[0]===this._oldSelectionEnd[0]&&M[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(k,M,B)):this._oldHasSelection&&this._fireOnSelectionChange(k,M,B)}_fireOnSelectionChange(k,M,B){this._oldSelectionStart=k,this._oldSelectionEnd=M,this._oldHasSelection=B,this._onSelectionChange.fire()}_handleBufferActivate(k){this.clearSelection(),this._trimListener.dispose(),this._trimListener=k.activeBuffer.lines.onTrim((M=>this._handleTrim(M)))}_convertViewportColToCharacterIndex(k,M){let B=M;for(let H=0;M>=H;H++){const U=k.loadCell(H,this._workCell).getChars().length;this._workCell.getWidth()===0?B--:U>1&&M!==H&&(B+=U-1)}return B}setSelection(k,M,B){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[k,M],this._model.selectionStartLength=B,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(k){this._isClickInSelection(k)||(this._selectWordAtCursor(k,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(k,M,B=!0,H=!0){if(k[0]>=this._bufferService.cols)return;const U=this._bufferService.buffer,P=U.lines.get(k[1]);if(!P)return;const K=U.translateBufferLineToString(k[1],!1);let X=this._convertViewportColToCharacterIndex(P,k[0]),G=X;const W=k[0]-X;let te=0,z=0,j=0,N=0;if(K.charAt(X)===" "){for(;X>0&&K.charAt(X-1)===" ";)X--;for(;G<K.length&&K.charAt(G+1)===" ";)G++}else{let se=k[0],ae=k[0];P.getWidth(se)===0&&(te++,se--),P.getWidth(ae)===2&&(z++,ae++);const ue=P.getString(ae).length;for(ue>1&&(N+=ue-1,G+=ue-1);se>0&&X>0&&!this._isCharWordSeparator(P.loadCell(se-1,this._workCell));){P.loadCell(se-1,this._workCell);const Y=this._workCell.getChars().length;this._workCell.getWidth()===0?(te++,se--):Y>1&&(j+=Y-1,X-=Y-1),X--,se--}for(;ae<P.length&&G+1<K.length&&!this._isCharWordSeparator(P.loadCell(ae+1,this._workCell));){P.loadCell(ae+1,this._workCell);const Y=this._workCell.getChars().length;this._workCell.getWidth()===2?(z++,ae++):Y>1&&(N+=Y-1,G+=Y-1),G++,ae++}}G++;let $=X+W-te+j,I=Math.min(this._bufferService.cols,G-X+te+z-j-N);if(M||K.slice(X,G).trim()!==""){if(B&&$===0&&P.getCodePoint(0)!==32){const se=U.lines.get(k[1]-1);if(se&&P.isWrapped&&se.getCodePoint(this._bufferService.cols-1)!==32){const ae=this._getWordAt([this._bufferService.cols-1,k[1]-1],!1,!0,!1);if(ae){const ue=this._bufferService.cols-ae.start;$-=ue,I+=ue}}}if(H&&$+I===this._bufferService.cols&&P.getCodePoint(this._bufferService.cols-1)!==32){const se=U.lines.get(k[1]+1);if(se!=null&&se.isWrapped&&se.getCodePoint(0)!==32){const ae=this._getWordAt([0,k[1]+1],!1,!1,!0);ae&&(I+=ae.length)}}return{start:$,length:I}}}_selectWordAt(k,M){const B=this._getWordAt(k,M);if(B){for(;B.start<0;)B.start+=this._bufferService.cols,k[1]--;this._model.selectionStart=[B.start,k[1]],this._model.selectionStartLength=B.length}}_selectToWordAt(k){const M=this._getWordAt(k,!0);if(M){let B=k[1];for(;M.start<0;)M.start+=this._bufferService.cols,B--;if(!this._model.areSelectionValuesReversed())for(;M.start+M.length>this._bufferService.cols;)M.length-=this._bufferService.cols,B++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?M.start:M.start+M.length,B]}}_isCharWordSeparator(k){return k.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(k.getChars())>=0}_selectLineAt(k){const M=this._bufferService.buffer.getWrappedRangeForLine(k),B={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,_.getRangeLength)(B,this._bufferService.cols)}};l.SelectionService=R=h([p(3,A.IBufferService),p(4,A.ICoreService),p(5,T.IMouseService),p(6,A.IOptionsService),p(7,T.IRenderService),p(8,T.ICoreBrowserService)],R)},4725:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ILinkProviderService=l.IThemeService=l.ICharacterJoinerService=l.ISelectionService=l.IRenderService=l.IMouseService=l.ICoreBrowserService=l.ICharSizeService=void 0;const h=c(8343);l.ICharSizeService=(0,h.createDecorator)("CharSizeService"),l.ICoreBrowserService=(0,h.createDecorator)("CoreBrowserService"),l.IMouseService=(0,h.createDecorator)("MouseService"),l.IRenderService=(0,h.createDecorator)("RenderService"),l.ISelectionService=(0,h.createDecorator)("SelectionService"),l.ICharacterJoinerService=(0,h.createDecorator)("CharacterJoinerService"),l.IThemeService=(0,h.createDecorator)("ThemeService"),l.ILinkProviderService=(0,h.createDecorator)("LinkProviderService")},6731:function(f,l,c){var h=this&&this.__decorate||function(R,k,M,B){var H,U=arguments.length,P=U<3?k:B===null?B=Object.getOwnPropertyDescriptor(k,M):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(R,k,M,B);else for(var K=R.length-1;K>=0;K--)(H=R[K])&&(P=(U<3?H(P):U>3?H(k,M,P):H(k,M))||P);return U>3&&P&&Object.defineProperty(k,M,P),P},p=this&&this.__param||function(R,k){return function(M,B){k(M,B,R)}};Object.defineProperty(l,"__esModule",{value:!0}),l.ThemeService=l.DEFAULT_ANSI_COLORS=void 0;const u=c(7239),b=c(8055),C=c(8460),T=c(844),E=c(2585),S=b.css.toColor("#ffffff"),v=b.css.toColor("#000000"),_=b.css.toColor("#ffffff"),y=b.css.toColor("#000000"),A={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};l.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const R=[b.css.toColor("#2e3436"),b.css.toColor("#cc0000"),b.css.toColor("#4e9a06"),b.css.toColor("#c4a000"),b.css.toColor("#3465a4"),b.css.toColor("#75507b"),b.css.toColor("#06989a"),b.css.toColor("#d3d7cf"),b.css.toColor("#555753"),b.css.toColor("#ef2929"),b.css.toColor("#8ae234"),b.css.toColor("#fce94f"),b.css.toColor("#729fcf"),b.css.toColor("#ad7fa8"),b.css.toColor("#34e2e2"),b.css.toColor("#eeeeec")],k=[0,95,135,175,215,255];for(let M=0;M<216;M++){const B=k[M/36%6|0],H=k[M/6%6|0],U=k[M%6];R.push({css:b.channels.toCss(B,H,U),rgba:b.channels.toRgba(B,H,U)})}for(let M=0;M<24;M++){const B=8+10*M;R.push({css:b.channels.toCss(B,B,B),rgba:b.channels.toRgba(B,B,B)})}return R})());let L=l.ThemeService=class extends T.Disposable{get colors(){return this._colors}constructor(R){super(),this._optionsService=R,this._contrastCache=new u.ColorContrastCache,this._halfContrastCache=new u.ColorContrastCache,this._onChangeColors=this.register(new C.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:S,background:v,cursor:_,cursorAccent:y,selectionForeground:void 0,selectionBackgroundTransparent:A,selectionBackgroundOpaque:b.color.blend(v,A),selectionInactiveBackgroundTransparent:A,selectionInactiveBackgroundOpaque:b.color.blend(v,A),ansi:l.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(R={}){const k=this._colors;if(k.foreground=D(R.foreground,S),k.background=D(R.background,v),k.cursor=D(R.cursor,_),k.cursorAccent=D(R.cursorAccent,y),k.selectionBackgroundTransparent=D(R.selectionBackground,A),k.selectionBackgroundOpaque=b.color.blend(k.background,k.selectionBackgroundTransparent),k.selectionInactiveBackgroundTransparent=D(R.selectionInactiveBackground,k.selectionBackgroundTransparent),k.selectionInactiveBackgroundOpaque=b.color.blend(k.background,k.selectionInactiveBackgroundTransparent),k.selectionForeground=R.selectionForeground?D(R.selectionForeground,b.NULL_COLOR):void 0,k.selectionForeground===b.NULL_COLOR&&(k.selectionForeground=void 0),b.color.isOpaque(k.selectionBackgroundTransparent)&&(k.selectionBackgroundTransparent=b.color.opacity(k.selectionBackgroundTransparent,.3)),b.color.isOpaque(k.selectionInactiveBackgroundTransparent)&&(k.selectionInactiveBackgroundTransparent=b.color.opacity(k.selectionInactiveBackgroundTransparent,.3)),k.ansi=l.DEFAULT_ANSI_COLORS.slice(),k.ansi[0]=D(R.black,l.DEFAULT_ANSI_COLORS[0]),k.ansi[1]=D(R.red,l.DEFAULT_ANSI_COLORS[1]),k.ansi[2]=D(R.green,l.DEFAULT_ANSI_COLORS[2]),k.ansi[3]=D(R.yellow,l.DEFAULT_ANSI_COLORS[3]),k.ansi[4]=D(R.blue,l.DEFAULT_ANSI_COLORS[4]),k.ansi[5]=D(R.magenta,l.DEFAULT_ANSI_COLORS[5]),k.ansi[6]=D(R.cyan,l.DEFAULT_ANSI_COLORS[6]),k.ansi[7]=D(R.white,l.DEFAULT_ANSI_COLORS[7]),k.ansi[8]=D(R.brightBlack,l.DEFAULT_ANSI_COLORS[8]),k.ansi[9]=D(R.brightRed,l.DEFAULT_ANSI_COLORS[9]),k.ansi[10]=D(R.brightGreen,l.DEFAULT_ANSI_COLORS[10]),k.ansi[11]=D(R.brightYellow,l.DEFAULT_ANSI_COLORS[11]),k.ansi[12]=D(R.brightBlue,l.DEFAULT_ANSI_COLORS[12]),k.ansi[13]=D(R.brightMagenta,l.DEFAULT_ANSI_COLORS[13]),k.ansi[14]=D(R.brightCyan,l.DEFAULT_ANSI_COLORS[14]),k.ansi[15]=D(R.brightWhite,l.DEFAULT_ANSI_COLORS[15]),R.extendedAnsi){const M=Math.min(k.ansi.length-16,R.extendedAnsi.length);for(let B=0;B<M;B++)k.ansi[B+16]=D(R.extendedAnsi[B],l.DEFAULT_ANSI_COLORS[B+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(R){this._restoreColor(R),this._onChangeColors.fire(this.colors)}_restoreColor(R){if(R!==void 0)switch(R){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[R]=this._restoreColors.ansi[R]}else for(let k=0;k<this._restoreColors.ansi.length;++k)this._colors.ansi[k]=this._restoreColors.ansi[k]}modifyColors(R){R(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 D(R,k){if(R!==void 0)try{return b.css.toColor(R)}catch{}return k}l.ThemeService=L=h([p(0,E.IOptionsService)],L)},6349:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CircularList=void 0;const h=c(8460),p=c(844);class u extends p.Disposable{constructor(C){super(),this._maxLength=C,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(C){if(this._maxLength===C)return;const T=new Array(C);for(let E=0;E<Math.min(C,this.length);E++)T[E]=this._array[this._getCyclicIndex(E)];this._array=T,this._maxLength=C,this._startIndex=0}get length(){return this._length}set length(C){if(C>this._length)for(let T=this._length;T<C;T++)this._array[T]=void 0;this._length=C}get(C){return this._array[this._getCyclicIndex(C)]}set(C,T){this._array[this._getCyclicIndex(C)]=T}push(C){this._array[this._getCyclicIndex(this._length)]=C,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(C,T,...E){if(T){for(let S=C;S<this._length-T;S++)this._array[this._getCyclicIndex(S)]=this._array[this._getCyclicIndex(S+T)];this._length-=T,this.onDeleteEmitter.fire({index:C,amount:T})}for(let S=this._length-1;S>=C;S--)this._array[this._getCyclicIndex(S+E.length)]=this._array[this._getCyclicIndex(S)];for(let S=0;S<E.length;S++)this._array[this._getCyclicIndex(C+S)]=E[S];if(E.length&&this.onInsertEmitter.fire({index:C,amount:E.length}),this._length+E.length>this._maxLength){const S=this._length+E.length-this._maxLength;this._startIndex+=S,this._length=this._maxLength,this.onTrimEmitter.fire(S)}else this._length+=E.length}trimStart(C){C>this._length&&(C=this._length),this._startIndex+=C,this._length-=C,this.onTrimEmitter.fire(C)}shiftElements(C,T,E){if(!(T<=0)){if(C<0||C>=this._length)throw new Error("start argument out of range");if(C+E<0)throw new Error("Cannot shift elements in list beyond index 0");if(E>0){for(let v=T-1;v>=0;v--)this.set(C+v+E,this.get(C+v));const S=C+T+E-this._length;if(S>0)for(this._length+=S;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let S=0;S<T;S++)this.set(C+S+E,this.get(C+S))}}_getCyclicIndex(C){return(this._startIndex+C)%this._maxLength}}l.CircularList=u},1439:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.clone=void 0,l.clone=function c(h,p=5){if(typeof h!="object")return h;const u=Array.isArray(h)?[]:{};for(const b in h)u[b]=p<=1?h[b]:h[b]&&c(h[b],p-1);return u}},8055:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.contrastRatio=l.toPaddedHex=l.rgba=l.rgb=l.css=l.color=l.channels=l.NULL_COLOR=void 0;let c=0,h=0,p=0,u=0;var b,C,T,E,S;function v(y){const A=y.toString(16);return A.length<2?"0"+A:A}function _(y,A){return y<A?(A+.05)/(y+.05):(y+.05)/(A+.05)}l.NULL_COLOR={css:"#00000000",rgba:0},(function(y){y.toCss=function(A,L,D,R){return R!==void 0?`#${v(A)}${v(L)}${v(D)}${v(R)}`:`#${v(A)}${v(L)}${v(D)}`},y.toRgba=function(A,L,D,R=255){return(A<<24|L<<16|D<<8|R)>>>0},y.toColor=function(A,L,D,R){return{css:y.toCss(A,L,D,R),rgba:y.toRgba(A,L,D,R)}}})(b||(l.channels=b={})),(function(y){function A(L,D){return u=Math.round(255*D),[c,h,p]=S.toChannels(L.rgba),{css:b.toCss(c,h,p,u),rgba:b.toRgba(c,h,p,u)}}y.blend=function(L,D){if(u=(255&D.rgba)/255,u===1)return{css:D.css,rgba:D.rgba};const R=D.rgba>>24&255,k=D.rgba>>16&255,M=D.rgba>>8&255,B=L.rgba>>24&255,H=L.rgba>>16&255,U=L.rgba>>8&255;return c=B+Math.round((R-B)*u),h=H+Math.round((k-H)*u),p=U+Math.round((M-U)*u),{css:b.toCss(c,h,p),rgba:b.toRgba(c,h,p)}},y.isOpaque=function(L){return(255&L.rgba)==255},y.ensureContrastRatio=function(L,D,R){const k=S.ensureContrastRatio(L.rgba,D.rgba,R);if(k)return b.toColor(k>>24&255,k>>16&255,k>>8&255)},y.opaque=function(L){const D=(255|L.rgba)>>>0;return[c,h,p]=S.toChannels(D),{css:b.toCss(c,h,p),rgba:D}},y.opacity=A,y.multiplyOpacity=function(L,D){return u=255&L.rgba,A(L,u*D/255)},y.toColorRGB=function(L){return[L.rgba>>24&255,L.rgba>>16&255,L.rgba>>8&255]}})(C||(l.color=C={})),(function(y){let A,L;try{const D=document.createElement("canvas");D.width=1,D.height=1;const R=D.getContext("2d",{willReadFrequently:!0});R&&(A=R,A.globalCompositeOperation="copy",L=A.createLinearGradient(0,0,1,1))}catch{}y.toColor=function(D){if(D.match(/#[\da-f]{3,8}/i))switch(D.length){case 4:return c=parseInt(D.slice(1,2).repeat(2),16),h=parseInt(D.slice(2,3).repeat(2),16),p=parseInt(D.slice(3,4).repeat(2),16),b.toColor(c,h,p);case 5:return c=parseInt(D.slice(1,2).repeat(2),16),h=parseInt(D.slice(2,3).repeat(2),16),p=parseInt(D.slice(3,4).repeat(2),16),u=parseInt(D.slice(4,5).repeat(2),16),b.toColor(c,h,p,u);case 7:return{css:D,rgba:(parseInt(D.slice(1),16)<<8|255)>>>0};case 9:return{css:D,rgba:parseInt(D.slice(1),16)>>>0}}const R=D.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(R)return c=parseInt(R[1]),h=parseInt(R[2]),p=parseInt(R[3]),u=Math.round(255*(R[5]===void 0?1:parseFloat(R[5]))),b.toColor(c,h,p,u);if(!A||!L)throw new Error("css.toColor: Unsupported css format");if(A.fillStyle=L,A.fillStyle=D,typeof A.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(A.fillRect(0,0,1,1),[c,h,p,u]=A.getImageData(0,0,1,1).data,u!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:b.toRgba(c,h,p,u),css:D}}})(T||(l.css=T={})),(function(y){function A(L,D,R){const k=L/255,M=D/255,B=R/255;return .2126*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))+.7152*(M<=.03928?M/12.92:Math.pow((M+.055)/1.055,2.4))+.0722*(B<=.03928?B/12.92:Math.pow((B+.055)/1.055,2.4))}y.relativeLuminance=function(L){return A(L>>16&255,L>>8&255,255&L)},y.relativeLuminance2=A})(E||(l.rgb=E={})),(function(y){function A(D,R,k){const M=D>>24&255,B=D>>16&255,H=D>>8&255;let U=R>>24&255,P=R>>16&255,K=R>>8&255,X=_(E.relativeLuminance2(U,P,K),E.relativeLuminance2(M,B,H));for(;X<k&&(U>0||P>0||K>0);)U-=Math.max(0,Math.ceil(.1*U)),P-=Math.max(0,Math.ceil(.1*P)),K-=Math.max(0,Math.ceil(.1*K)),X=_(E.relativeLuminance2(U,P,K),E.relativeLuminance2(M,B,H));return(U<<24|P<<16|K<<8|255)>>>0}function L(D,R,k){const M=D>>24&255,B=D>>16&255,H=D>>8&255;let U=R>>24&255,P=R>>16&255,K=R>>8&255,X=_(E.relativeLuminance2(U,P,K),E.relativeLuminance2(M,B,H));for(;X<k&&(U<255||P<255||K<255);)U=Math.min(255,U+Math.ceil(.1*(255-U))),P=Math.min(255,P+Math.ceil(.1*(255-P))),K=Math.min(255,K+Math.ceil(.1*(255-K))),X=_(E.relativeLuminance2(U,P,K),E.relativeLuminance2(M,B,H));return(U<<24|P<<16|K<<8|255)>>>0}y.blend=function(D,R){if(u=(255&R)/255,u===1)return R;const k=R>>24&255,M=R>>16&255,B=R>>8&255,H=D>>24&255,U=D>>16&255,P=D>>8&255;return c=H+Math.round((k-H)*u),h=U+Math.round((M-U)*u),p=P+Math.round((B-P)*u),b.toRgba(c,h,p)},y.ensureContrastRatio=function(D,R,k){const M=E.relativeLuminance(D>>8),B=E.relativeLuminance(R>>8);if(_(M,B)<k){if(B<M){const P=A(D,R,k),K=_(M,E.relativeLuminance(P>>8));if(K<k){const X=L(D,R,k);return K>_(M,E.relativeLuminance(X>>8))?P:X}return P}const H=L(D,R,k),U=_(M,E.relativeLuminance(H>>8));if(U<k){const P=A(D,R,k);return U>_(M,E.relativeLuminance(P>>8))?H:P}return H}},y.reduceLuminance=A,y.increaseLuminance=L,y.toChannels=function(D){return[D>>24&255,D>>16&255,D>>8&255,255&D]}})(S||(l.rgba=S={})),l.toPaddedHex=v,l.contrastRatio=_},8969:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreTerminal=void 0;const h=c(844),p=c(2585),u=c(4348),b=c(7866),C=c(744),T=c(7302),E=c(6975),S=c(8460),v=c(1753),_=c(1480),y=c(7994),A=c(9282),L=c(5435),D=c(5981),R=c(2660);let k=!1;class M extends h.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new S.EventEmitter),this._onScroll.event((H=>{var U;(U=this._onScrollApi)==null||U.fire(H.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(H){for(const U in H)this.optionsService.options[U]=H[U]}constructor(H){super(),this._windowsWrappingHeuristics=this.register(new h.MutableDisposable),this._onBinary=this.register(new S.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new S.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new S.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new S.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new S.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new S.EventEmitter),this._instantiationService=new u.InstantiationService,this.optionsService=this.register(new T.OptionsService(H)),this._instantiationService.setService(p.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(C.BufferService)),this._instantiationService.setService(p.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(b.LogService)),this._instantiationService.setService(p.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(E.CoreService)),this._instantiationService.setService(p.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(v.CoreMouseService)),this._instantiationService.setService(p.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(_.UnicodeService)),this._instantiationService.setService(p.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(y.CharsetService),this._instantiationService.setService(p.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(R.OscLinkService),this._instantiationService.setService(p.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,S.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,S.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,S.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,S.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 D.WriteBuffer(((U,P)=>this._inputHandler.parse(U,P)))),this.register((0,S.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(H,U){this._writeBuffer.write(H,U)}writeSync(H,U){this._logService.logLevel<=p.LogLevelEnum.WARN&&!k&&(this._logService.warn("writeSync is unreliable and will be removed soon."),k=!0),this._writeBuffer.writeSync(H,U)}input(H,U=!0){this.coreService.triggerDataEvent(H,U)}resize(H,U){isNaN(H)||isNaN(U)||(H=Math.max(H,C.MINIMUM_COLS),U=Math.max(U,C.MINIMUM_ROWS),this._bufferService.resize(H,U))}scroll(H,U=!1){this._bufferService.scroll(H,U)}scrollLines(H,U,P){this._bufferService.scrollLines(H,U,P)}scrollPages(H){this.scrollLines(H*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(H){const U=H-this._bufferService.buffer.ydisp;U!==0&&this.scrollLines(U)}registerEscHandler(H,U){return this._inputHandler.registerEscHandler(H,U)}registerDcsHandler(H,U){return this._inputHandler.registerDcsHandler(H,U)}registerCsiHandler(H,U){return this._inputHandler.registerCsiHandler(H,U)}registerOscHandler(H,U){return this._inputHandler.registerOscHandler(H,U)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let H=!1;const U=this.optionsService.rawOptions.windowsPty;U&&U.buildNumber!==void 0&&U.buildNumber!==void 0?H=U.backend==="conpty"&&U.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(H=!0),H?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const H=[];H.push(this.onLineFeed(A.updateWindowsModeWrappedState.bind(null,this._bufferService))),H.push(this.registerCsiHandler({final:"H"},(()=>((0,A.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,h.toDisposable)((()=>{for(const U of H)U.dispose()}))}}}l.CoreTerminal=M},8460:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.runAndSubscribe=l.forwardEvent=l.EventEmitter=void 0,l.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 p=[];for(let u=0;u<this._listeners.length;u++)p.push(this._listeners[u]);for(let u=0;u<p.length;u++)p[u].call(void 0,c,h)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},l.forwardEvent=function(c,h){return c((p=>h.fire(p)))},l.runAndSubscribe=function(c,h){return h(void 0),c((p=>h(p)))}},5435:function(f,l,c){var h=this&&this.__decorate||function(te,z,j,N){var $,I=arguments.length,se=I<3?z:N===null?N=Object.getOwnPropertyDescriptor(z,j):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")se=Reflect.decorate(te,z,j,N);else for(var ae=te.length-1;ae>=0;ae--)($=te[ae])&&(se=(I<3?$(se):I>3?$(z,j,se):$(z,j))||se);return I>3&&se&&Object.defineProperty(z,j,se),se},p=this&&this.__param||function(te,z){return function(j,N){z(j,N,te)}};Object.defineProperty(l,"__esModule",{value:!0}),l.InputHandler=l.WindowsOptionsReportType=void 0;const u=c(2584),b=c(7116),C=c(2015),T=c(844),E=c(482),S=c(8437),v=c(8460),_=c(643),y=c(511),A=c(3734),L=c(2585),D=c(1480),R=c(6242),k=c(6351),M=c(5941),B={"(":0,")":1,"*":2,"+":3,"-":1,".":2},H=131072;function U(te,z){if(te>24)return z.setWinLines||!1;switch(te){case 1:return!!z.restoreWin;case 2:return!!z.minimizeWin;case 3:return!!z.setWinPosition;case 4:return!!z.setWinSizePixels;case 5:return!!z.raiseWin;case 6:return!!z.lowerWin;case 7:return!!z.refreshWin;case 8:return!!z.setWinSizeChars;case 9:return!!z.maximizeWin;case 10:return!!z.fullscreenWin;case 11:return!!z.getWinState;case 13:return!!z.getWinPosition;case 14:return!!z.getWinSizePixels;case 15:return!!z.getScreenSizePixels;case 16:return!!z.getCellSizePixels;case 18:return!!z.getWinSizeChars;case 19:return!!z.getScreenSizeChars;case 20:return!!z.getIconTitle;case 21:return!!z.getWinTitle;case 22:return!!z.pushTitle;case 23:return!!z.popTitle;case 24:return!!z.setWinLines}return!1}var P;(function(te){te[te.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",te[te.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(P||(l.WindowsOptionsReportType=P={}));let K=0;class X extends T.Disposable{getAttrData(){return this._curAttrData}constructor(z,j,N,$,I,se,ae,ue,Y=new C.EscapeSequenceParser){super(),this._bufferService=z,this._charsetService=j,this._coreService=N,this._logService=$,this._optionsService=I,this._oscLinkService=se,this._coreMouseService=ae,this._unicodeService=ue,this._parser=Y,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new E.StringToUtf32,this._utf8Decoder=new E.Utf8ToUtf32,this._workCell=new y.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=S.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=S.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new v.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new v.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new v.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new v.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new v.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new v.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new v.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new v.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new v.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new v.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new v.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new v.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new v.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 G(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((q=>this._activeBuffer=q.activeBuffer))),this._parser.setCsiHandlerFallback(((q,Z)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(q),params:Z.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,Z,Q)=>{this._logService.debug("Unknown OSC code: ",{identifier:q,action:Z,data:Q})})),this._parser.setDcsHandlerFallback(((q,Z,Q)=>{Z==="HOOK"&&(Q=Q.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(q),action:Z,payload:Q})})),this._parser.setPrintHandler(((q,Z,Q)=>this.print(q,Z,Q))),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 R.OscHandler((q=>(this.setTitle(q),this.setIconName(q),!0)))),this._parser.registerOscHandler(1,new R.OscHandler((q=>this.setIconName(q)))),this._parser.registerOscHandler(2,new R.OscHandler((q=>this.setTitle(q)))),this._parser.registerOscHandler(4,new R.OscHandler((q=>this.setOrReportIndexedColor(q)))),this._parser.registerOscHandler(8,new R.OscHandler((q=>this.setHyperlink(q)))),this._parser.registerOscHandler(10,new R.OscHandler((q=>this.setOrReportFgColor(q)))),this._parser.registerOscHandler(11,new R.OscHandler((q=>this.setOrReportBgColor(q)))),this._parser.registerOscHandler(12,new R.OscHandler((q=>this.setOrReportCursorColor(q)))),this._parser.registerOscHandler(104,new R.OscHandler((q=>this.restoreIndexedColor(q)))),this._parser.registerOscHandler(110,new R.OscHandler((q=>this.restoreFgColor(q)))),this._parser.registerOscHandler(111,new R.OscHandler((q=>this.restoreBgColor(q)))),this._parser.registerOscHandler(112,new R.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 b.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 k.DcsHandler(((q,Z)=>this.requestStatusString(q,Z))))}_preserveStack(z,j,N,$){this._parseStack.paused=!0,this._parseStack.cursorStartX=z,this._parseStack.cursorStartY=j,this._parseStack.decodedLength=N,this._parseStack.position=$}_logSlowResolvingAsync(z){this._logService.logLevel<=L.LogLevelEnum.WARN&&Promise.race([z,new Promise(((j,N)=>setTimeout((()=>N("#SLOW_TIMEOUT")),5e3)))]).catch((j=>{if(j!=="#SLOW_TIMEOUT")throw j;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(z,j){let N,$=this._activeBuffer.x,I=this._activeBuffer.y,se=0;const ae=this._parseStack.paused;if(ae){if(N=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,j))return this._logSlowResolvingAsync(N),N;$=this._parseStack.cursorStartX,I=this._parseStack.cursorStartY,this._parseStack.paused=!1,z.length>H&&(se=this._parseStack.position+H)}if(this._logService.logLevel<=L.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof z=="string"?` "${z}"`:` "${Array.prototype.map.call(z,(q=>String.fromCharCode(q))).join("")}"`),typeof z=="string"?z.split("").map((q=>q.charCodeAt(0))):z),this._parseBuffer.length<z.length&&this._parseBuffer.length<H&&(this._parseBuffer=new Uint32Array(Math.min(z.length,H))),ae||this._dirtyRowTracker.clearRange(),z.length>H)for(let q=se;q<z.length;q+=H){const Z=q+H<z.length?q+H:z.length,Q=typeof z=="string"?this._stringDecoder.decode(z.substring(q,Z),this._parseBuffer):this._utf8Decoder.decode(z.subarray(q,Z),this._parseBuffer);if(N=this._parser.parse(this._parseBuffer,Q))return this._preserveStack($,I,Q,q),this._logSlowResolvingAsync(N),N}else if(!ae){const q=typeof z=="string"?this._stringDecoder.decode(z,this._parseBuffer):this._utf8Decoder.decode(z,this._parseBuffer);if(N=this._parser.parse(this._parseBuffer,q))return this._preserveStack($,I,q,0),this._logSlowResolvingAsync(N),N}this._activeBuffer.x===$&&this._activeBuffer.y===I||this._onCursorMove.fire();const ue=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(ue,this._bufferService.rows-1))}print(z,j,N){let $,I;const se=this._charsetService.charset,ae=this._optionsService.rawOptions.screenReaderMode,ue=this._bufferService.cols,Y=this._coreService.decPrivateModes.wraparound,q=this._coreService.modes.insertMode,Z=this._curAttrData;let Q=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&N-j>0&&Q.getWidth(this._activeBuffer.x-1)===2&&Q.setCellFromCodepoint(this._activeBuffer.x-1,0,1,Z);let _e=this._parser.precedingJoinState;for(let ve=j;ve<N;++ve){if($=z[ve],$<127&&se){const ht=se[String.fromCharCode($)];ht&&($=ht.charCodeAt(0))}const De=this._unicodeService.charProperties($,_e);I=D.UnicodeService.extractWidth(De);const Ae=D.UnicodeService.extractShouldJoin(De),Ke=Ae?D.UnicodeService.extractWidth(_e):0;if(_e=De,ae&&this._onA11yChar.fire((0,E.stringFromCodePoint)($)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+I-Ke>ue){if(Y){const ht=Q;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),Q=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Ke>0&&Q instanceof S.BufferLine&&Q.copyCellsFrom(ht,Re,0,Ke,!1);Re<ue;)ht.setCellFromCodepoint(Re++,0,1,Z)}else if(this._activeBuffer.x=ue-1,I===2)continue}if(Ae&&this._activeBuffer.x){const ht=Q.getWidth(this._activeBuffer.x-1)?1:2;Q.addCodepointToCell(this._activeBuffer.x-ht,$,I);for(let Re=I-Ke;--Re>=0;)Q.setCellFromCodepoint(this._activeBuffer.x++,0,0,Z)}else if(q&&(Q.insertCells(this._activeBuffer.x,I-Ke,this._activeBuffer.getNullCell(Z)),Q.getWidth(ue-1)===2&&Q.setCellFromCodepoint(ue-1,_.NULL_CELL_CODE,_.NULL_CELL_WIDTH,Z)),Q.setCellFromCodepoint(this._activeBuffer.x++,$,I,Z),I>0)for(;--I;)Q.setCellFromCodepoint(this._activeBuffer.x++,0,0,Z)}this._parser.precedingJoinState=_e,this._activeBuffer.x<ue&&N-j>0&&Q.getWidth(this._activeBuffer.x)===0&&!Q.hasContent(this._activeBuffer.x)&&Q.setCellFromCodepoint(this._activeBuffer.x,0,1,Z),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(z,j){return z.final!=="t"||z.prefix||z.intermediates?this._parser.registerCsiHandler(z,j):this._parser.registerCsiHandler(z,(N=>!U(N.params[0],this._optionsService.rawOptions.windowOptions)||j(N)))}registerDcsHandler(z,j){return this._parser.registerDcsHandler(z,new k.DcsHandler(j))}registerEscHandler(z,j){return this._parser.registerEscHandler(z,j)}registerOscHandler(z,j){return this._parser.registerOscHandler(z,new R.OscHandler(j))}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 z;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&&((z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&z.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);j.hasWidth(this._activeBuffer.x)&&!j.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const z=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-z),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(z=this._bufferService.cols-1){this._activeBuffer.x=Math.min(z,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(z,j){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=z,this._activeBuffer.y=this._activeBuffer.scrollTop+j):(this._activeBuffer.x=z,this._activeBuffer.y=j),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(z,j){this._restrictCursor(),this._setCursor(this._activeBuffer.x+z,this._activeBuffer.y+j)}cursorUp(z){const j=this._activeBuffer.y-this._activeBuffer.scrollTop;return j>=0?this._moveCursor(0,-Math.min(j,z.params[0]||1)):this._moveCursor(0,-(z.params[0]||1)),!0}cursorDown(z){const j=this._activeBuffer.scrollBottom-this._activeBuffer.y;return j>=0?this._moveCursor(0,Math.min(j,z.params[0]||1)):this._moveCursor(0,z.params[0]||1),!0}cursorForward(z){return this._moveCursor(z.params[0]||1,0),!0}cursorBackward(z){return this._moveCursor(-(z.params[0]||1),0),!0}cursorNextLine(z){return this.cursorDown(z),this._activeBuffer.x=0,!0}cursorPrecedingLine(z){return this.cursorUp(z),this._activeBuffer.x=0,!0}cursorCharAbsolute(z){return this._setCursor((z.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(z){return this._setCursor(z.length>=2?(z.params[1]||1)-1:0,(z.params[0]||1)-1),!0}charPosAbsolute(z){return this._setCursor((z.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(z){return this._moveCursor(z.params[0]||1,0),!0}linePosAbsolute(z){return this._setCursor(this._activeBuffer.x,(z.params[0]||1)-1),!0}vPositionRelative(z){return this._moveCursor(0,z.params[0]||1),!0}hVPosition(z){return this.cursorPosition(z),!0}tabClear(z){const j=z.params[0];return j===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:j===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(z){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let j=z.params[0]||1;for(;j--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(z){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let j=z.params[0]||1;for(;j--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(z){const j=z.params[0];return j===1&&(this._curAttrData.bg|=536870912),j!==2&&j!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(z,j,N,$=!1,I=!1){const se=this._activeBuffer.lines.get(this._activeBuffer.ybase+z);se.replaceCells(j,N,this._activeBuffer.getNullCell(this._eraseAttrData()),I),$&&(se.isWrapped=!1)}_resetBufferLine(z,j=!1){const N=this._activeBuffer.lines.get(this._activeBuffer.ybase+z);N&&(N.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),j),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+z),N.isWrapped=!1)}eraseInDisplay(z,j=!1){let N;switch(this._restrictCursor(this._bufferService.cols),z.params[0]){case 0:for(N=this._activeBuffer.y,this._dirtyRowTracker.markDirty(N),this._eraseInBufferLine(N++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,j);N<this._bufferService.rows;N++)this._resetBufferLine(N,j);this._dirtyRowTracker.markDirty(N);break;case 1:for(N=this._activeBuffer.y,this._dirtyRowTracker.markDirty(N),this._eraseInBufferLine(N,0,this._activeBuffer.x+1,!0,j),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(N+1).isWrapped=!1);N--;)this._resetBufferLine(N,j);this._dirtyRowTracker.markDirty(0);break;case 2:for(N=this._bufferService.rows,this._dirtyRowTracker.markDirty(N-1);N--;)this._resetBufferLine(N,j);this._dirtyRowTracker.markDirty(0);break;case 3:const $=this._activeBuffer.lines.length-this._bufferService.rows;$>0&&(this._activeBuffer.lines.trimStart($),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-$,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-$,0),this._onScroll.fire(0))}return!0}eraseInLine(z,j=!1){switch(this._restrictCursor(this._bufferService.cols),z.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,j);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,j);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,j)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(z){this._restrictCursor();let j=z.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const N=this._activeBuffer.ybase+this._activeBuffer.y,$=this._bufferService.rows-1-this._activeBuffer.scrollBottom,I=this._bufferService.rows-1+this._activeBuffer.ybase-$+1;for(;j--;)this._activeBuffer.lines.splice(I-1,1),this._activeBuffer.lines.splice(N,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(z){this._restrictCursor();let j=z.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const N=this._activeBuffer.ybase+this._activeBuffer.y;let $;for($=this._bufferService.rows-1-this._activeBuffer.scrollBottom,$=this._bufferService.rows-1+this._activeBuffer.ybase-$;j--;)this._activeBuffer.lines.splice(N,1),this._activeBuffer.lines.splice($,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(z){this._restrictCursor();const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return j&&(j.insertCells(this._activeBuffer.x,z.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(z){this._restrictCursor();const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return j&&(j.deleteCells(this._activeBuffer.x,z.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(z){let j=z.params[0]||1;for(;j--;)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(z){let j=z.params[0]||1;for(;j--;)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(S.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(z){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const j=z.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);$.deleteCells(0,j,this._activeBuffer.getNullCell(this._eraseAttrData())),$.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(z){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const j=z.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);$.insertCells(0,j,this._activeBuffer.getNullCell(this._eraseAttrData())),$.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(z){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const j=z.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);$.insertCells(this._activeBuffer.x,j,this._activeBuffer.getNullCell(this._eraseAttrData())),$.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(z){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const j=z.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const $=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);$.deleteCells(this._activeBuffer.x,j,this._activeBuffer.getNullCell(this._eraseAttrData())),$.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(z){this._restrictCursor();const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return j&&(j.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(z.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(z){const j=this._parser.precedingJoinState;if(!j)return!0;const N=z.params[0]||1,$=D.UnicodeService.extractWidth(j),I=this._activeBuffer.x-$,se=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(I),ae=new Uint32Array(se.length*N);let ue=0;for(let q=0;q<se.length;){const Z=se.codePointAt(q)||0;ae[ue++]=Z,q+=Z>65535?2:1}let Y=ue;for(let q=1;q<N;++q)ae.copyWithin(Y,0,ue),Y+=ue;return this.print(ae,0,Y),!0}sendDeviceAttributesPrimary(z){return z.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(z){return z.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(z.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(u.C0.ESC+"[>83;40003;0c")),!0}_is(z){return(this._optionsService.rawOptions.termName+"").indexOf(z)===0}setMode(z){for(let j=0;j<z.length;j++)switch(z.params[j]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(z){for(let j=0;j<z.length;j++)switch(z.params[j]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,b.DEFAULT_CHARSET),this._charsetService.setgCharset(1,b.DEFAULT_CHARSET),this._charsetService.setgCharset(2,b.DEFAULT_CHARSET),this._charsetService.setgCharset(3,b.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(z){for(let j=0;j<z.length;j++)switch(z.params[j]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(z){for(let j=0;j<z.length;j++)switch(z.params[j]){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(),z.params[j]===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(z,j){const N=this._coreService.decPrivateModes,{activeProtocol:$,activeEncoding:I}=this._coreMouseService,se=this._coreService,{buffers:ae,cols:ue}=this._bufferService,{active:Y,alt:q}=ae,Z=this._optionsService.rawOptions,Q=Ae=>Ae?1:2,_e=z.params[0];return ve=_e,De=j?_e===2?4:_e===4?Q(se.modes.insertMode):_e===12?3:_e===20?Q(Z.convertEol):0:_e===1?Q(N.applicationCursorKeys):_e===3?Z.windowOptions.setWinLines?ue===80?2:ue===132?1:0:0:_e===6?Q(N.origin):_e===7?Q(N.wraparound):_e===8?3:_e===9?Q($==="X10"):_e===12?Q(Z.cursorBlink):_e===25?Q(!se.isCursorHidden):_e===45?Q(N.reverseWraparound):_e===66?Q(N.applicationKeypad):_e===67?4:_e===1e3?Q($==="VT200"):_e===1002?Q($==="DRAG"):_e===1003?Q($==="ANY"):_e===1004?Q(N.sendFocus):_e===1005?4:_e===1006?Q(I==="SGR"):_e===1015?4:_e===1016?Q(I==="SGR_PIXELS"):_e===1048?1:_e===47||_e===1047||_e===1049?Q(Y===q):_e===2004?Q(N.bracketedPasteMode):0,se.triggerDataEvent(`${u.C0.ESC}[${j?"":"?"}${ve};${De}$y`),!0;var ve,De}_updateAttrColor(z,j,N,$,I){return j===2?(z|=50331648,z&=-16777216,z|=A.AttributeData.fromColorRGB([N,$,I])):j===5&&(z&=-50331904,z|=33554432|255&N),z}_extractColor(z,j,N){const $=[0,0,-1,0,0,0];let I=0,se=0;do{if($[se+I]=z.params[j+se],z.hasSubParams(j+se)){const ae=z.getSubParams(j+se);let ue=0;do $[1]===5&&(I=1),$[se+ue+1+I]=ae[ue];while(++ue<ae.length&&ue+se+1+I<$.length);break}if($[1]===5&&se+I>=2||$[1]===2&&se+I>=5)break;$[1]&&(I=1)}while(++se+j<z.length&&se+I<$.length);for(let ae=2;ae<$.length;++ae)$[ae]===-1&&($[ae]=0);switch($[0]){case 38:N.fg=this._updateAttrColor(N.fg,$[1],$[3],$[4],$[5]);break;case 48:N.bg=this._updateAttrColor(N.bg,$[1],$[3],$[4],$[5]);break;case 58:N.extended=N.extended.clone(),N.extended.underlineColor=this._updateAttrColor(N.extended.underlineColor,$[1],$[3],$[4],$[5])}return se}_processUnderline(z,j){j.extended=j.extended.clone(),(!~z||z>5)&&(z=1),j.extended.underlineStyle=z,j.fg|=268435456,z===0&&(j.fg&=-268435457),j.updateExtended()}_processSGR0(z){z.fg=S.DEFAULT_ATTR_DATA.fg,z.bg=S.DEFAULT_ATTR_DATA.bg,z.extended=z.extended.clone(),z.extended.underlineStyle=0,z.extended.underlineColor&=-67108864,z.updateExtended()}charAttributes(z){if(z.length===1&&z.params[0]===0)return this._processSGR0(this._curAttrData),!0;const j=z.length;let N;const $=this._curAttrData;for(let I=0;I<j;I++)N=z.params[I],N>=30&&N<=37?($.fg&=-50331904,$.fg|=16777216|N-30):N>=40&&N<=47?($.bg&=-50331904,$.bg|=16777216|N-40):N>=90&&N<=97?($.fg&=-50331904,$.fg|=16777224|N-90):N>=100&&N<=107?($.bg&=-50331904,$.bg|=16777224|N-100):N===0?this._processSGR0($):N===1?$.fg|=134217728:N===3?$.bg|=67108864:N===4?($.fg|=268435456,this._processUnderline(z.hasSubParams(I)?z.getSubParams(I)[0]:1,$)):N===5?$.fg|=536870912:N===7?$.fg|=67108864:N===8?$.fg|=1073741824:N===9?$.fg|=2147483648:N===2?$.bg|=134217728:N===21?this._processUnderline(2,$):N===22?($.fg&=-134217729,$.bg&=-134217729):N===23?$.bg&=-67108865:N===24?($.fg&=-268435457,this._processUnderline(0,$)):N===25?$.fg&=-536870913:N===27?$.fg&=-67108865:N===28?$.fg&=-1073741825:N===29?$.fg&=2147483647:N===39?($.fg&=-67108864,$.fg|=16777215&S.DEFAULT_ATTR_DATA.fg):N===49?($.bg&=-67108864,$.bg|=16777215&S.DEFAULT_ATTR_DATA.bg):N===38||N===48||N===58?I+=this._extractColor(z,I,$):N===53?$.bg|=1073741824:N===55?$.bg&=-1073741825:N===59?($.extended=$.extended.clone(),$.extended.underlineColor=-1,$.updateExtended()):N===100?($.fg&=-67108864,$.fg|=16777215&S.DEFAULT_ATTR_DATA.fg,$.bg&=-67108864,$.bg|=16777215&S.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",N);return!0}deviceStatus(z){switch(z.params[0]){case 5:this._coreService.triggerDataEvent(`${u.C0.ESC}[0n`);break;case 6:const j=this._activeBuffer.y+1,N=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[${j};${N}R`)}return!0}deviceStatusPrivate(z){if(z.params[0]===6){const j=this._activeBuffer.y+1,N=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[?${j};${N}R`)}return!0}softReset(z){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=S.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(z){const j=z.params[0]||1;switch(j){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 N=j%2==1;return this._optionsService.options.cursorBlink=N,!0}setScrollRegion(z){const j=z.params[0]||1;let N;return(z.length<2||(N=z.params[1])>this._bufferService.rows||N===0)&&(N=this._bufferService.rows),N>j&&(this._activeBuffer.scrollTop=j-1,this._activeBuffer.scrollBottom=N-1,this._setCursor(0,0)),!0}windowOptions(z){if(!U(z.params[0],this._optionsService.rawOptions.windowOptions))return!0;const j=z.length>1?z.params[1]:0;switch(z.params[0]){case 14:j!==2&&this._onRequestWindowsOptionsReport.fire(P.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(P.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:j!==0&&j!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),j!==0&&j!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:j!==0&&j!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),j!==0&&j!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(z){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(z){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(z){return this._windowTitle=z,this._onTitleChange.fire(z),!0}setIconName(z){return this._iconName=z,!0}setOrReportIndexedColor(z){const j=[],N=z.split(";");for(;N.length>1;){const $=N.shift(),I=N.shift();if(/^\d+$/.exec($)){const se=parseInt($);if(W(se))if(I==="?")j.push({type:0,index:se});else{const ae=(0,M.parseColor)(I);ae&&j.push({type:1,index:se,color:ae})}}}return j.length&&this._onColor.fire(j),!0}setHyperlink(z){const j=z.split(";");return!(j.length<2)&&(j[1]?this._createHyperlink(j[0],j[1]):!j[0]&&this._finishHyperlink())}_createHyperlink(z,j){this._getCurrentLinkId()&&this._finishHyperlink();const N=z.split(":");let $;const I=N.findIndex((se=>se.startsWith("id=")));return I!==-1&&($=N[I].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:$,uri:j}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(z,j){const N=z.split(";");for(let $=0;$<N.length&&!(j>=this._specialColors.length);++$,++j)if(N[$]==="?")this._onColor.fire([{type:0,index:this._specialColors[j]}]);else{const I=(0,M.parseColor)(N[$]);I&&this._onColor.fire([{type:1,index:this._specialColors[j],color:I}])}return!0}setOrReportFgColor(z){return this._setOrReportSpecialColor(z,0)}setOrReportBgColor(z){return this._setOrReportSpecialColor(z,1)}setOrReportCursorColor(z){return this._setOrReportSpecialColor(z,2)}restoreIndexedColor(z){if(!z)return this._onColor.fire([{type:2}]),!0;const j=[],N=z.split(";");for(let $=0;$<N.length;++$)if(/^\d+$/.exec(N[$])){const I=parseInt(N[$]);W(I)&&j.push({type:2,index:I})}return j.length&&this._onColor.fire(j),!0}restoreFgColor(z){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(z){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(z){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,b.DEFAULT_CHARSET),!0}selectCharset(z){return z.length!==2?(this.selectDefaultCharset(),!0):(z[0]==="/"||this._charsetService.setgCharset(B[z[0]],b.CHARSETS[z[1]]||b.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 z=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,z,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=S.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=S.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(z){return this._charsetService.setgLevel(z),!0}screenAlignmentPattern(){const z=new y.CellData;z.content=4194373,z.fg=this._curAttrData.fg,z.bg=this._curAttrData.bg,this._setCursor(0,0);for(let j=0;j<this._bufferService.rows;++j){const N=this._activeBuffer.ybase+this._activeBuffer.y+j,$=this._activeBuffer.lines.get(N);$&&($.fill(z),$.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(z,j){const N=this._bufferService.buffer,$=this._optionsService.rawOptions;return(I=>(this._coreService.triggerDataEvent(`${u.C0.ESC}${I}${u.C0.ESC}\\`),!0))(z==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:z==='"p'?'P1$r61;1"p':z==="r"?`P1$r${N.scrollTop+1};${N.scrollBottom+1}r`:z==="m"?"P1$r0m":z===" q"?`P1$r${{block:2,underline:4,bar:6}[$.cursorStyle]-($.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(z,j){this._dirtyRowTracker.markRangeDirty(z,j)}}l.InputHandler=X;let G=class{constructor(te){this._bufferService=te,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(te){te<this.start?this.start=te:te>this.end&&(this.end=te)}markRangeDirty(te,z){te>z&&(K=te,te=z,z=K),te<this.start&&(this.start=te),z>this.end&&(this.end=z)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function W(te){return 0<=te&&te<256}G=h([p(0,L.IBufferService)],G)},844:(f,l)=>{function c(h){for(const p of h)p.dispose();h.length=0}Object.defineProperty(l,"__esModule",{value:!0}),l.getDisposeArrayDisposable=l.disposeArray=l.toDisposable=l.MutableDisposable=l.Disposable=void 0,l.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 p=this._disposables.indexOf(h);p!==-1&&this._disposables.splice(p,1)}},l.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(h){var p;this._isDisposed||h===this._value||((p=this._value)==null||p.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}},l.toDisposable=function(h){return{dispose:h}},l.disposeArray=c,l.getDisposeArrayDisposable=function(h){return{dispose:()=>c(h)}}},1505:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.FourKeyMap=l.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(p,u,b){this._data[p]||(this._data[p]={}),this._data[p][u]=b}get(p,u){return this._data[p]?this._data[p][u]:void 0}clear(){this._data={}}}l.TwoKeyMap=c,l.FourKeyMap=class{constructor(){this._data=new c}set(h,p,u,b,C){this._data.get(h,p)||this._data.set(h,p,new c),this._data.get(h,p).set(u,b,C)}get(h,p,u,b){var C;return(C=this._data.get(h,p))==null?void 0:C.get(u,b)}clear(){this._data.clear()}}},6114:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.isChromeOS=l.isLinux=l.isWindows=l.isIphone=l.isIpad=l.isMac=l.getSafariVersion=l.isSafari=l.isLegacyEdge=l.isFirefox=l.isNode=void 0,l.isNode=typeof process<"u"&&"title"in process;const c=l.isNode?"node":navigator.userAgent,h=l.isNode?"node":navigator.platform;l.isFirefox=c.includes("Firefox"),l.isLegacyEdge=c.includes("Edge"),l.isSafari=/^((?!chrome|android).)*safari/i.test(c),l.getSafariVersion=function(){if(!l.isSafari)return 0;const p=c.match(/Version\/(\d+)/);return p===null||p.length<2?0:parseInt(p[1])},l.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(h),l.isIpad=h==="iPad",l.isIphone=h==="iPhone",l.isWindows=["Windows","Win16","Win32","WinCE"].includes(h),l.isLinux=h.indexOf("Linux")>=0,l.isChromeOS=/\bCrOS\b/.test(c)},6106:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SortedList=void 0;let c=0;l.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 p=this._getKey(h);if(p===void 0||(c=this._search(p),c===-1)||this._getKey(this._array[c])!==p)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])===p);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,p){if(this._array.length!==0&&(c=this._search(h),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===h))do p(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===h)}values(){return[...this._array].values()}_search(h){let p=0,u=this._array.length-1;for(;u>=p;){let b=p+u>>1;const C=this._getKey(this._array[b]);if(C>h)u=b-1;else{if(!(C<h)){for(;b>0&&this._getKey(this._array[b-1])===h;)b--;return b}p=b+1}}return p}}},7226:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DebouncedIdleTask=l.IdleTaskQueue=l.PriorityTaskQueue=void 0;const h=c(6114);class p{constructor(){this._tasks=[],this._i=0}enqueue(C){this._tasks.push(C),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(C){this._idleCallback=void 0;let T=0,E=0,S=C.timeRemaining(),v=0;for(;this._i<this._tasks.length;){if(T=Date.now(),this._tasks[this._i]()||this._i++,T=Math.max(1,Date.now()-T),E=Math.max(T,E),v=C.timeRemaining(),1.5*E>v)return S-T<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(S-T))}ms`),void this._start();S=v}this.clear()}}class u extends p{_requestCallback(C){return setTimeout((()=>C(this._createDeadline(16))))}_cancelCallback(C){clearTimeout(C)}_createDeadline(C){const T=Date.now()+C;return{timeRemaining:()=>Math.max(0,T-Date.now())}}}l.PriorityTaskQueue=u,l.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends p{_requestCallback(b){return requestIdleCallback(b)}_cancelCallback(b){cancelIdleCallback(b)}}:u,l.DebouncedIdleTask=class{constructor(){this._queue=new l.IdleTaskQueue}set(b){this._queue.clear(),this._queue.enqueue(b)}flush(){this._queue.flush()}}},9282:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.updateWindowsModeWrappedState=void 0;const h=c(643);l.updateWindowsModeWrappedState=function(p){const u=p.buffer.lines.get(p.buffer.ybase+p.buffer.y-1),b=u==null?void 0:u.get(p.cols-1),C=p.buffer.lines.get(p.buffer.ybase+p.buffer.y);C&&b&&(C.isWrapped=b[h.CHAR_DATA_CODE_INDEX]!==h.NULL_CELL_CODE&&b[h.CHAR_DATA_CODE_INDEX]!==h.WHITESPACE_CELL_CODE)}},3734:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ExtendedAttrs=l.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}}l.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,b=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=b}clone(){return new h(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}l.ExtendedAttrs=h},9092:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Buffer=l.MAX_BUFFER_SIZE=void 0;const h=c(6349),p=c(7226),u=c(3734),b=c(8437),C=c(4634),T=c(511),E=c(643),S=c(4863),v=c(7116);l.MAX_BUFFER_SIZE=4294967295,l.Buffer=class{constructor(_,y,A){this._hasScrollback=_,this._optionsService=y,this._bufferService=A,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=b.DEFAULT_ATTR_DATA.clone(),this.savedCharset=v.DEFAULT_CHARSET,this.markers=[],this._nullCell=T.CellData.fromCharData([0,E.NULL_CELL_CHAR,E.NULL_CELL_WIDTH,E.NULL_CELL_CODE]),this._whitespaceCell=T.CellData.fromCharData([0,E.WHITESPACE_CELL_CHAR,E.WHITESPACE_CELL_WIDTH,E.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new p.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(_){return _?(this._nullCell.fg=_.fg,this._nullCell.bg=_.bg,this._nullCell.extended=_.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new u.ExtendedAttrs),this._nullCell}getWhitespaceCell(_){return _?(this._whitespaceCell.fg=_.fg,this._whitespaceCell.bg=_.bg,this._whitespaceCell.extended=_.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new u.ExtendedAttrs),this._whitespaceCell}getBlankLine(_,y){return new b.BufferLine(this._bufferService.cols,this.getNullCell(_),y)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const _=this.ybase+this.y-this.ydisp;return _>=0&&_<this._rows}_getCorrectBufferLength(_){if(!this._hasScrollback)return _;const y=_+this._optionsService.rawOptions.scrollback;return y>l.MAX_BUFFER_SIZE?l.MAX_BUFFER_SIZE:y}fillViewportRows(_){if(this.lines.length===0){_===void 0&&(_=b.DEFAULT_ATTR_DATA);let y=this._rows;for(;y--;)this.lines.push(this.getBlankLine(_))}}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(_,y){const A=this.getNullCell(b.DEFAULT_ATTR_DATA);let L=0;const D=this._getCorrectBufferLength(y);if(D>this.lines.maxLength&&(this.lines.maxLength=D),this.lines.length>0){if(this._cols<_)for(let k=0;k<this.lines.length;k++)L+=+this.lines.get(k).resize(_,A);let R=0;if(this._rows<y)for(let k=this._rows;k<y;k++)this.lines.length<y+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new b.BufferLine(_,A)):this.ybase>0&&this.lines.length<=this.ybase+this.y+R+1?(this.ybase--,R++,this.ydisp>0&&this.ydisp--):this.lines.push(new b.BufferLine(_,A)));else for(let k=this._rows;k>y;k--)this.lines.length>y+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(D<this.lines.maxLength){const k=this.lines.length-D;k>0&&(this.lines.trimStart(k),this.ybase=Math.max(this.ybase-k,0),this.ydisp=Math.max(this.ydisp-k,0),this.savedY=Math.max(this.savedY-k,0)),this.lines.maxLength=D}this.x=Math.min(this.x,_-1),this.y=Math.min(this.y,y-1),R&&(this.y+=R),this.savedX=Math.min(this.savedX,_-1),this.scrollTop=0}if(this.scrollBottom=y-1,this._isReflowEnabled&&(this._reflow(_,y),this._cols>_))for(let R=0;R<this.lines.length;R++)L+=+this.lines.get(R).resize(_,A);this._cols=_,this._rows=y,this._memoryCleanupQueue.clear(),L>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let _=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,_=!1);let y=0;for(;this._memoryCleanupPosition<this.lines.length;)if(y+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),y>100)return!0;return _}get _isReflowEnabled(){const _=this._optionsService.rawOptions.windowsPty;return _&&_.buildNumber?this._hasScrollback&&_.backend==="conpty"&&_.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(_,y){this._cols!==_&&(_>this._cols?this._reflowLarger(_,y):this._reflowSmaller(_,y))}_reflowLarger(_,y){const A=(0,C.reflowLargerGetLinesToRemove)(this.lines,this._cols,_,this.ybase+this.y,this.getNullCell(b.DEFAULT_ATTR_DATA));if(A.length>0){const L=(0,C.reflowLargerCreateNewLayout)(this.lines,A);(0,C.reflowLargerApplyNewLayout)(this.lines,L.layout),this._reflowLargerAdjustViewport(_,y,L.countRemoved)}}_reflowLargerAdjustViewport(_,y,A){const L=this.getNullCell(b.DEFAULT_ATTR_DATA);let D=A;for(;D-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<y&&this.lines.push(new b.BufferLine(_,L))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-A,0)}_reflowSmaller(_,y){const A=this.getNullCell(b.DEFAULT_ATTR_DATA),L=[];let D=0;for(let R=this.lines.length-1;R>=0;R--){let k=this.lines.get(R);if(!k||!k.isWrapped&&k.getTrimmedLength()<=_)continue;const M=[k];for(;k.isWrapped&&R>0;)k=this.lines.get(--R),M.unshift(k);const B=this.ybase+this.y;if(B>=R&&B<R+M.length)continue;const H=M[M.length-1].getTrimmedLength(),U=(0,C.reflowSmallerGetNewLineLengths)(M,this._cols,_),P=U.length-M.length;let K;K=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+P):Math.max(0,this.lines.length-this.lines.maxLength+P);const X=[];for(let N=0;N<P;N++){const $=this.getBlankLine(b.DEFAULT_ATTR_DATA,!0);X.push($)}X.length>0&&(L.push({start:R+M.length+D,newLines:X}),D+=X.length),M.push(...X);let G=U.length-1,W=U[G];W===0&&(G--,W=U[G]);let te=M.length-P-1,z=H;for(;te>=0;){const N=Math.min(z,W);if(M[G]===void 0)break;if(M[G].copyCellsFrom(M[te],z-N,W-N,N,!0),W-=N,W===0&&(G--,W=U[G]),z-=N,z===0){te--;const $=Math.max(te,0);z=(0,C.getWrappedLineTrimmedLength)(M,$,this._cols)}}for(let N=0;N<M.length;N++)U[N]<_&&M[N].setCell(U[N],A);let j=P-K;for(;j-- >0;)this.ybase===0?this.y<y-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+D)-y&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+P,this.ybase+y-1)}if(L.length>0){const R=[],k=[];for(let G=0;G<this.lines.length;G++)k.push(this.lines.get(G));const M=this.lines.length;let B=M-1,H=0,U=L[H];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+D);let P=0;for(let G=Math.min(this.lines.maxLength-1,M+D-1);G>=0;G--)if(U&&U.start>B+P){for(let W=U.newLines.length-1;W>=0;W--)this.lines.set(G--,U.newLines[W]);G++,R.push({index:B+1,amount:U.newLines.length}),P+=U.newLines.length,U=L[++H]}else this.lines.set(G,k[B--]);let K=0;for(let G=R.length-1;G>=0;G--)R[G].index+=K,this.lines.onInsertEmitter.fire(R[G]),K+=R[G].amount;const X=Math.max(0,M+D-this.lines.maxLength);X>0&&this.lines.onTrimEmitter.fire(X)}}translateBufferLineToString(_,y,A=0,L){const D=this.lines.get(_);return D?D.translateToString(y,A,L):""}getWrappedRangeForLine(_){let y=_,A=_;for(;y>0&&this.lines.get(y).isWrapped;)y--;for(;A+1<this.lines.length&&this.lines.get(A+1).isWrapped;)A++;return{first:y,last:A}}setupTabStops(_){for(_!=null?this.tabs[_]||(_=this.prevStop(_)):(this.tabs={},_=0);_<this._cols;_+=this._optionsService.rawOptions.tabStopWidth)this.tabs[_]=!0}prevStop(_){for(_==null&&(_=this.x);!this.tabs[--_]&&_>0;);return _>=this._cols?this._cols-1:_<0?0:_}nextStop(_){for(_==null&&(_=this.x);!this.tabs[++_]&&_<this._cols;);return _>=this._cols?this._cols-1:_<0?0:_}clearMarkers(_){this._isClearing=!0;for(let y=0;y<this.markers.length;y++)this.markers[y].line===_&&(this.markers[y].dispose(),this.markers.splice(y--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let _=0;_<this.markers.length;_++)this.markers[_].dispose(),this.markers.splice(_--,1);this._isClearing=!1}addMarker(_){const y=new S.Marker(_);return this.markers.push(y),y.register(this.lines.onTrim((A=>{y.line-=A,y.line<0&&y.dispose()}))),y.register(this.lines.onInsert((A=>{y.line>=A.index&&(y.line+=A.amount)}))),y.register(this.lines.onDelete((A=>{y.line>=A.index&&y.line<A.index+A.amount&&y.dispose(),y.line>A.index&&(y.line-=A.amount)}))),y.register(y.onDispose((()=>this._removeMarker(y)))),y}_removeMarker(_){this._isClearing||this.markers.splice(this.markers.indexOf(_),1)}}},8437:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLine=l.DEFAULT_ATTR_DATA=void 0;const h=c(3734),p=c(511),u=c(643),b=c(482);l.DEFAULT_ATTR_DATA=Object.freeze(new h.AttributeData);let C=0;class T{constructor(S,v,_=!1){this.isWrapped=_,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*S);const y=v||p.CellData.fromCharData([0,u.NULL_CELL_CHAR,u.NULL_CELL_WIDTH,u.NULL_CELL_CODE]);for(let A=0;A<S;++A)this.setCell(A,y);this.length=S}get(S){const v=this._data[3*S+0],_=2097151&v;return[this._data[3*S+1],2097152&v?this._combined[S]:_?(0,b.stringFromCodePoint)(_):"",v>>22,2097152&v?this._combined[S].charCodeAt(this._combined[S].length-1):_]}set(S,v){this._data[3*S+1]=v[u.CHAR_DATA_ATTR_INDEX],v[u.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[S]=v[1],this._data[3*S+0]=2097152|S|v[u.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*S+0]=v[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|v[u.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(S){return this._data[3*S+0]>>22}hasWidth(S){return 12582912&this._data[3*S+0]}getFg(S){return this._data[3*S+1]}getBg(S){return this._data[3*S+2]}hasContent(S){return 4194303&this._data[3*S+0]}getCodePoint(S){const v=this._data[3*S+0];return 2097152&v?this._combined[S].charCodeAt(this._combined[S].length-1):2097151&v}isCombined(S){return 2097152&this._data[3*S+0]}getString(S){const v=this._data[3*S+0];return 2097152&v?this._combined[S]:2097151&v?(0,b.stringFromCodePoint)(2097151&v):""}isProtected(S){return 536870912&this._data[3*S+2]}loadCell(S,v){return C=3*S,v.content=this._data[C+0],v.fg=this._data[C+1],v.bg=this._data[C+2],2097152&v.content&&(v.combinedData=this._combined[S]),268435456&v.bg&&(v.extended=this._extendedAttrs[S]),v}setCell(S,v){2097152&v.content&&(this._combined[S]=v.combinedData),268435456&v.bg&&(this._extendedAttrs[S]=v.extended),this._data[3*S+0]=v.content,this._data[3*S+1]=v.fg,this._data[3*S+2]=v.bg}setCellFromCodepoint(S,v,_,y){268435456&y.bg&&(this._extendedAttrs[S]=y.extended),this._data[3*S+0]=v|_<<22,this._data[3*S+1]=y.fg,this._data[3*S+2]=y.bg}addCodepointToCell(S,v,_){let y=this._data[3*S+0];2097152&y?this._combined[S]+=(0,b.stringFromCodePoint)(v):2097151&y?(this._combined[S]=(0,b.stringFromCodePoint)(2097151&y)+(0,b.stringFromCodePoint)(v),y&=-2097152,y|=2097152):y=v|4194304,_&&(y&=-12582913,y|=_<<22),this._data[3*S+0]=y}insertCells(S,v,_){if((S%=this.length)&&this.getWidth(S-1)===2&&this.setCellFromCodepoint(S-1,0,1,_),v<this.length-S){const y=new p.CellData;for(let A=this.length-S-v-1;A>=0;--A)this.setCell(S+v+A,this.loadCell(S+A,y));for(let A=0;A<v;++A)this.setCell(S+A,_)}else for(let y=S;y<this.length;++y)this.setCell(y,_);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,_)}deleteCells(S,v,_){if(S%=this.length,v<this.length-S){const y=new p.CellData;for(let A=0;A<this.length-S-v;++A)this.setCell(S+A,this.loadCell(S+v+A,y));for(let A=this.length-v;A<this.length;++A)this.setCell(A,_)}else for(let y=S;y<this.length;++y)this.setCell(y,_);S&&this.getWidth(S-1)===2&&this.setCellFromCodepoint(S-1,0,1,_),this.getWidth(S)!==0||this.hasContent(S)||this.setCellFromCodepoint(S,0,1,_)}replaceCells(S,v,_,y=!1){if(y)for(S&&this.getWidth(S-1)===2&&!this.isProtected(S-1)&&this.setCellFromCodepoint(S-1,0,1,_),v<this.length&&this.getWidth(v-1)===2&&!this.isProtected(v)&&this.setCellFromCodepoint(v,0,1,_);S<v&&S<this.length;)this.isProtected(S)||this.setCell(S,_),S++;else for(S&&this.getWidth(S-1)===2&&this.setCellFromCodepoint(S-1,0,1,_),v<this.length&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v,0,1,_);S<v&&S<this.length;)this.setCell(S++,_)}resize(S,v){if(S===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const _=3*S;if(S>this.length){if(this._data.buffer.byteLength>=4*_)this._data=new Uint32Array(this._data.buffer,0,_);else{const y=new Uint32Array(_);y.set(this._data),this._data=y}for(let y=this.length;y<S;++y)this.setCell(y,v)}else{this._data=this._data.subarray(0,_);const y=Object.keys(this._combined);for(let L=0;L<y.length;L++){const D=parseInt(y[L],10);D>=S&&delete this._combined[D]}const A=Object.keys(this._extendedAttrs);for(let L=0;L<A.length;L++){const D=parseInt(A[L],10);D>=S&&delete this._extendedAttrs[D]}}return this.length=S,4*_*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const S=new Uint32Array(this._data.length);return S.set(this._data),this._data=S,1}return 0}fill(S,v=!1){if(v)for(let _=0;_<this.length;++_)this.isProtected(_)||this.setCell(_,S);else{this._combined={},this._extendedAttrs={};for(let _=0;_<this.length;++_)this.setCell(_,S)}}copyFrom(S){this.length!==S.length?this._data=new Uint32Array(S._data):this._data.set(S._data),this.length=S.length,this._combined={};for(const v in S._combined)this._combined[v]=S._combined[v];this._extendedAttrs={};for(const v in S._extendedAttrs)this._extendedAttrs[v]=S._extendedAttrs[v];this.isWrapped=S.isWrapped}clone(){const S=new T(0);S._data=new Uint32Array(this._data),S.length=this.length;for(const v in this._combined)S._combined[v]=this._combined[v];for(const v in this._extendedAttrs)S._extendedAttrs[v]=this._extendedAttrs[v];return S.isWrapped=this.isWrapped,S}getTrimmedLength(){for(let S=this.length-1;S>=0;--S)if(4194303&this._data[3*S+0])return S+(this._data[3*S+0]>>22);return 0}getNoBgTrimmedLength(){for(let S=this.length-1;S>=0;--S)if(4194303&this._data[3*S+0]||50331648&this._data[3*S+2])return S+(this._data[3*S+0]>>22);return 0}copyCellsFrom(S,v,_,y,A){const L=S._data;if(A)for(let R=y-1;R>=0;R--){for(let k=0;k<3;k++)this._data[3*(_+R)+k]=L[3*(v+R)+k];268435456&L[3*(v+R)+2]&&(this._extendedAttrs[_+R]=S._extendedAttrs[v+R])}else for(let R=0;R<y;R++){for(let k=0;k<3;k++)this._data[3*(_+R)+k]=L[3*(v+R)+k];268435456&L[3*(v+R)+2]&&(this._extendedAttrs[_+R]=S._extendedAttrs[v+R])}const D=Object.keys(S._combined);for(let R=0;R<D.length;R++){const k=parseInt(D[R],10);k>=v&&(this._combined[k-v+_]=S._combined[k])}}translateToString(S,v,_,y){v=v??0,_=_??this.length,S&&(_=Math.min(_,this.getTrimmedLength())),y&&(y.length=0);let A="";for(;v<_;){const L=this._data[3*v+0],D=2097151&L,R=2097152&L?this._combined[v]:D?(0,b.stringFromCodePoint)(D):u.WHITESPACE_CELL_CHAR;if(A+=R,y)for(let k=0;k<R.length;++k)y.push(v);v+=L>>22||1}return y&&y.push(v),A}}l.BufferLine=T},4841:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.getRangeLength=void 0,l.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,l)=>{function c(h,p,u){if(p===h.length-1)return h[p].getTrimmedLength();const b=!h[p].hasContent(u-1)&&h[p].getWidth(u-1)===1,C=h[p+1].getWidth(0)===2;return b&&C?u-1:u}Object.defineProperty(l,"__esModule",{value:!0}),l.getWrappedLineTrimmedLength=l.reflowSmallerGetNewLineLengths=l.reflowLargerApplyNewLayout=l.reflowLargerCreateNewLayout=l.reflowLargerGetLinesToRemove=void 0,l.reflowLargerGetLinesToRemove=function(h,p,u,b,C){const T=[];for(let E=0;E<h.length-1;E++){let S=E,v=h.get(++S);if(!v.isWrapped)continue;const _=[h.get(E)];for(;S<h.length&&v.isWrapped;)_.push(v),v=h.get(++S);if(b>=E&&b<S){E+=_.length-1;continue}let y=0,A=c(_,y,p),L=1,D=0;for(;L<_.length;){const k=c(_,L,p),M=k-D,B=u-A,H=Math.min(M,B);_[y].copyCellsFrom(_[L],D,A,H,!1),A+=H,A===u&&(y++,A=0),D+=H,D===k&&(L++,D=0),A===0&&y!==0&&_[y-1].getWidth(u-1)===2&&(_[y].copyCellsFrom(_[y-1],u-1,A++,1,!1),_[y-1].setCell(u-1,C))}_[y].replaceCells(A,u,C);let R=0;for(let k=_.length-1;k>0&&(k>y||_[k].getTrimmedLength()===0);k--)R++;R>0&&(T.push(E+_.length-R),T.push(R)),E+=_.length-1}return T},l.reflowLargerCreateNewLayout=function(h,p){const u=[];let b=0,C=p[b],T=0;for(let E=0;E<h.length;E++)if(C===E){const S=p[++b];h.onDeleteEmitter.fire({index:E-T,amount:S}),E+=S-1,T+=S,C=p[++b]}else u.push(E);return{layout:u,countRemoved:T}},l.reflowLargerApplyNewLayout=function(h,p){const u=[];for(let b=0;b<p.length;b++)u.push(h.get(p[b]));for(let b=0;b<u.length;b++)h.set(b,u[b]);h.length=p.length},l.reflowSmallerGetNewLineLengths=function(h,p,u){const b=[],C=h.map(((v,_)=>c(h,_,p))).reduce(((v,_)=>v+_));let T=0,E=0,S=0;for(;S<C;){if(C-S<u){b.push(C-S);break}T+=u;const v=c(h,E,p);T>v&&(T-=v,E++);const _=h[E].getWidth(T-1)===2;_&&T--;const y=_?u-1:u;b.push(y),S+=y}return b},l.getWrappedLineTrimmedLength=c},5295:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferSet=void 0;const h=c(8460),p=c(844),u=c(9092);class b extends p.Disposable{constructor(T,E){super(),this._optionsService=T,this._bufferService=E,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(T){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(T),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(T,E){this._normal.resize(T,E),this._alt.resize(T,E),this.setupTabStops(T)}setupTabStops(T){this._normal.setupTabStops(T),this._alt.setupTabStops(T)}}l.BufferSet=b},511:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CellData=void 0;const h=c(482),p=c(643),u=c(3734);class b extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(T){const E=new b;return E.setFromCharData(T),E}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(T){this.fg=T[p.CHAR_DATA_ATTR_INDEX],this.bg=0;let E=!1;if(T[p.CHAR_DATA_CHAR_INDEX].length>2)E=!0;else if(T[p.CHAR_DATA_CHAR_INDEX].length===2){const S=T[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=S&&S<=56319){const v=T[p.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=v&&v<=57343?this.content=1024*(S-55296)+v-56320+65536|T[p.CHAR_DATA_WIDTH_INDEX]<<22:E=!0}else E=!0}else this.content=T[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|T[p.CHAR_DATA_WIDTH_INDEX]<<22;E&&(this.combinedData=T[p.CHAR_DATA_CHAR_INDEX],this.content=2097152|T[p.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.CellData=b},643:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WHITESPACE_CELL_CODE=l.WHITESPACE_CELL_WIDTH=l.WHITESPACE_CELL_CHAR=l.NULL_CELL_CODE=l.NULL_CELL_WIDTH=l.NULL_CELL_CHAR=l.CHAR_DATA_CODE_INDEX=l.CHAR_DATA_WIDTH_INDEX=l.CHAR_DATA_CHAR_INDEX=l.CHAR_DATA_ATTR_INDEX=l.DEFAULT_EXT=l.DEFAULT_ATTR=l.DEFAULT_COLOR=void 0,l.DEFAULT_COLOR=0,l.DEFAULT_ATTR=256|l.DEFAULT_COLOR<<9,l.DEFAULT_EXT=0,l.CHAR_DATA_ATTR_INDEX=0,l.CHAR_DATA_CHAR_INDEX=1,l.CHAR_DATA_WIDTH_INDEX=2,l.CHAR_DATA_CODE_INDEX=3,l.NULL_CELL_CHAR="",l.NULL_CELL_WIDTH=1,l.NULL_CELL_CODE=0,l.WHITESPACE_CELL_CHAR=" ",l.WHITESPACE_CELL_WIDTH=1,l.WHITESPACE_CELL_CODE=32},4863:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Marker=void 0;const h=c(8460),p=c(844);class u{get id(){return this._id}constructor(C){this.line=C,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,p.disposeArray)(this._disposables),this._disposables.length=0)}register(C){return this._disposables.push(C),C}}l.Marker=u,u._nextId=1},7116:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DEFAULT_CHARSET=l.CHARSETS=void 0,l.CHARSETS={},l.DEFAULT_CHARSET=l.CHARSETS.B,l.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:"≥","{":"π","|":"≠","}":"£","~":"·"},l.CHARSETS.A={"#":"£"},l.CHARSETS.B=void 0,l.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},l.CHARSETS.C=l.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},l.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},l.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},l.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},l.CHARSETS.E=l.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},l.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},l.CHARSETS.H=l.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(f,l)=>{var c,h,p;Object.defineProperty(l,"__esModule",{value:!0}),l.C1_ESCAPED=l.C1=l.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||(l.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||(l.C1=h={})),(function(u){u.ST=`${c.ESC}\\`})(p||(l.C1_ESCAPED=p={}))},7399:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.evaluateKeyboardEvent=void 0;const h=c(2584),p={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:["'",'"']};l.evaluateKeyboardEvent=function(u,b,C,T){const E={type:0,cancel:!1,key:void 0},S=(u.shiftKey?1:0)|(u.altKey?2:0)|(u.ctrlKey?4:0)|(u.metaKey?8:0);switch(u.keyCode){case 0:u.key==="UIKeyInputUpArrow"?E.key=b?h.C0.ESC+"OA":h.C0.ESC+"[A":u.key==="UIKeyInputLeftArrow"?E.key=b?h.C0.ESC+"OD":h.C0.ESC+"[D":u.key==="UIKeyInputRightArrow"?E.key=b?h.C0.ESC+"OC":h.C0.ESC+"[C":u.key==="UIKeyInputDownArrow"&&(E.key=b?h.C0.ESC+"OB":h.C0.ESC+"[B");break;case 8:E.key=u.ctrlKey?"\b":h.C0.DEL,u.altKey&&(E.key=h.C0.ESC+E.key);break;case 9:if(u.shiftKey){E.key=h.C0.ESC+"[Z";break}E.key=h.C0.HT,E.cancel=!0;break;case 13:E.key=u.altKey?h.C0.ESC+h.C0.CR:h.C0.CR,E.cancel=!0;break;case 27:E.key=h.C0.ESC,u.altKey&&(E.key=h.C0.ESC+h.C0.ESC),E.cancel=!0;break;case 37:if(u.metaKey)break;S?(E.key=h.C0.ESC+"[1;"+(S+1)+"D",E.key===h.C0.ESC+"[1;3D"&&(E.key=h.C0.ESC+(C?"b":"[1;5D"))):E.key=b?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(u.metaKey)break;S?(E.key=h.C0.ESC+"[1;"+(S+1)+"C",E.key===h.C0.ESC+"[1;3C"&&(E.key=h.C0.ESC+(C?"f":"[1;5C"))):E.key=b?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(u.metaKey)break;S?(E.key=h.C0.ESC+"[1;"+(S+1)+"A",C||E.key!==h.C0.ESC+"[1;3A"||(E.key=h.C0.ESC+"[1;5A")):E.key=b?h.C0.ESC+"OA":h.C0.ESC+"[A";break;case 40:if(u.metaKey)break;S?(E.key=h.C0.ESC+"[1;"+(S+1)+"B",C||E.key!==h.C0.ESC+"[1;3B"||(E.key=h.C0.ESC+"[1;5B")):E.key=b?h.C0.ESC+"OB":h.C0.ESC+"[B";break;case 45:u.shiftKey||u.ctrlKey||(E.key=h.C0.ESC+"[2~");break;case 46:E.key=S?h.C0.ESC+"[3;"+(S+1)+"~":h.C0.ESC+"[3~";break;case 36:E.key=S?h.C0.ESC+"[1;"+(S+1)+"H":b?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:E.key=S?h.C0.ESC+"[1;"+(S+1)+"F":b?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:u.shiftKey?E.type=2:u.ctrlKey?E.key=h.C0.ESC+"[5;"+(S+1)+"~":E.key=h.C0.ESC+"[5~";break;case 34:u.shiftKey?E.type=3:u.ctrlKey?E.key=h.C0.ESC+"[6;"+(S+1)+"~":E.key=h.C0.ESC+"[6~";break;case 112:E.key=S?h.C0.ESC+"[1;"+(S+1)+"P":h.C0.ESC+"OP";break;case 113:E.key=S?h.C0.ESC+"[1;"+(S+1)+"Q":h.C0.ESC+"OQ";break;case 114:E.key=S?h.C0.ESC+"[1;"+(S+1)+"R":h.C0.ESC+"OR";break;case 115:E.key=S?h.C0.ESC+"[1;"+(S+1)+"S":h.C0.ESC+"OS";break;case 116:E.key=S?h.C0.ESC+"[15;"+(S+1)+"~":h.C0.ESC+"[15~";break;case 117:E.key=S?h.C0.ESC+"[17;"+(S+1)+"~":h.C0.ESC+"[17~";break;case 118:E.key=S?h.C0.ESC+"[18;"+(S+1)+"~":h.C0.ESC+"[18~";break;case 119:E.key=S?h.C0.ESC+"[19;"+(S+1)+"~":h.C0.ESC+"[19~";break;case 120:E.key=S?h.C0.ESC+"[20;"+(S+1)+"~":h.C0.ESC+"[20~";break;case 121:E.key=S?h.C0.ESC+"[21;"+(S+1)+"~":h.C0.ESC+"[21~";break;case 122:E.key=S?h.C0.ESC+"[23;"+(S+1)+"~":h.C0.ESC+"[23~";break;case 123:E.key=S?h.C0.ESC+"[24;"+(S+1)+"~":h.C0.ESC+"[24~";break;default:if(!u.ctrlKey||u.shiftKey||u.altKey||u.metaKey)if(C&&!T||!u.altKey||u.metaKey)!C||u.altKey||u.ctrlKey||u.shiftKey||!u.metaKey?u.key&&!u.ctrlKey&&!u.altKey&&!u.metaKey&&u.keyCode>=48&&u.key.length===1?E.key=u.key:u.key&&u.ctrlKey&&(u.key==="_"&&(E.key=h.C0.US),u.key==="@"&&(E.key=h.C0.NUL)):u.keyCode===65&&(E.type=1);else{const v=p[u.keyCode],_=v==null?void 0:v[u.shiftKey?1:0];if(_)E.key=h.C0.ESC+_;else if(u.keyCode>=65&&u.keyCode<=90){const y=u.ctrlKey?u.keyCode-64:u.keyCode+32;let A=String.fromCharCode(y);u.shiftKey&&(A=A.toUpperCase()),E.key=h.C0.ESC+A}else if(u.keyCode===32)E.key=h.C0.ESC+(u.ctrlKey?h.C0.NUL:" ");else if(u.key==="Dead"&&u.code.startsWith("Key")){let y=u.code.slice(3,4);u.shiftKey||(y=y.toLowerCase()),E.key=h.C0.ESC+y,E.cancel=!0}}else u.keyCode>=65&&u.keyCode<=90?E.key=String.fromCharCode(u.keyCode-64):u.keyCode===32?E.key=h.C0.NUL:u.keyCode>=51&&u.keyCode<=55?E.key=String.fromCharCode(u.keyCode-51+27):u.keyCode===56?E.key=h.C0.DEL:u.keyCode===219?E.key=h.C0.ESC:u.keyCode===220?E.key=h.C0.FS:u.keyCode===221&&(E.key=h.C0.GS)}return E}},482:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Utf8ToUtf32=l.StringToUtf32=l.utf32ToString=l.stringFromCodePoint=void 0,l.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},l.utf32ToString=function(c,h=0,p=c.length){let u="";for(let b=h;b<p;++b){let C=c[b];C>65535?(C-=65536,u+=String.fromCharCode(55296+(C>>10))+String.fromCharCode(C%1024+56320)):u+=String.fromCharCode(C)}return u},l.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,h){const p=c.length;if(!p)return 0;let u=0,b=0;if(this._interim){const C=c.charCodeAt(b++);56320<=C&&C<=57343?h[u++]=1024*(this._interim-55296)+C-56320+65536:(h[u++]=this._interim,h[u++]=C),this._interim=0}for(let C=b;C<p;++C){const T=c.charCodeAt(C);if(55296<=T&&T<=56319){if(++C>=p)return this._interim=T,u;const E=c.charCodeAt(C);56320<=E&&E<=57343?h[u++]=1024*(T-55296)+E-56320+65536:(h[u++]=T,h[u++]=E)}else T!==65279&&(h[u++]=T)}return u}},l.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,h){const p=c.length;if(!p)return 0;let u,b,C,T,E=0,S=0,v=0;if(this.interim[0]){let A=!1,L=this.interim[0];L&=(224&L)==192?31:(240&L)==224?15:7;let D,R=0;for(;(D=63&this.interim[++R])&&R<4;)L<<=6,L|=D;const k=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,M=k-R;for(;v<M;){if(v>=p)return 0;if(D=c[v++],(192&D)!=128){v--,A=!0;break}this.interim[R++]=D,L<<=6,L|=63&D}A||(k===2?L<128?v--:h[E++]=L:k===3?L<2048||L>=55296&&L<=57343||L===65279||(h[E++]=L):L<65536||L>1114111||(h[E++]=L)),this.interim.fill(0)}const _=p-4;let y=v;for(;y<p;){for(;!(!(y<_)||128&(u=c[y])||128&(b=c[y+1])||128&(C=c[y+2])||128&(T=c[y+3]));)h[E++]=u,h[E++]=b,h[E++]=C,h[E++]=T,y+=4;if(u=c[y++],u<128)h[E++]=u;else if((224&u)==192){if(y>=p)return this.interim[0]=u,E;if(b=c[y++],(192&b)!=128){y--;continue}if(S=(31&u)<<6|63&b,S<128){y--;continue}h[E++]=S}else if((240&u)==224){if(y>=p)return this.interim[0]=u,E;if(b=c[y++],(192&b)!=128){y--;continue}if(y>=p)return this.interim[0]=u,this.interim[1]=b,E;if(C=c[y++],(192&C)!=128){y--;continue}if(S=(15&u)<<12|(63&b)<<6|63&C,S<2048||S>=55296&&S<=57343||S===65279)continue;h[E++]=S}else if((248&u)==240){if(y>=p)return this.interim[0]=u,E;if(b=c[y++],(192&b)!=128){y--;continue}if(y>=p)return this.interim[0]=u,this.interim[1]=b,E;if(C=c[y++],(192&C)!=128){y--;continue}if(y>=p)return this.interim[0]=u,this.interim[1]=b,this.interim[2]=C,E;if(T=c[y++],(192&T)!=128){y--;continue}if(S=(7&u)<<18|(63&b)<<12|(63&C)<<6|63&T,S<65536||S>1114111)continue;h[E++]=S}}return E}}},225:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeV6=void 0;const h=c(1480),p=[[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 b;l.UnicodeV6=class{constructor(){if(this.version="6",!b){b=new Uint8Array(65536),b.fill(1),b[0]=0,b.fill(0,1,32),b.fill(0,127,160),b.fill(2,4352,4448),b[9001]=2,b[9002]=2,b.fill(2,11904,42192),b[12351]=1,b.fill(2,44032,55204),b.fill(2,63744,64256),b.fill(2,65040,65050),b.fill(2,65072,65136),b.fill(2,65280,65377),b.fill(2,65504,65511);for(let C=0;C<p.length;++C)b.fill(0,p[C][0],p[C][1]+1)}}wcwidth(C){return C<32?0:C<127?1:C<65536?b[C]:(function(T,E){let S,v=0,_=E.length-1;if(T<E[0][0]||T>E[_][1])return!1;for(;_>=v;)if(S=v+_>>1,T>E[S][1])v=S+1;else{if(!(T<E[S][0]))return!0;_=S-1}return!1})(C,u)?0:C>=131072&&C<=196605||C>=196608&&C<=262141?2:1}charProperties(C,T){let E=this.wcwidth(C),S=E===0&&T!==0;if(S){const v=h.UnicodeService.extractWidth(T);v===0?S=!1:v>E&&(E=v)}return h.UnicodeService.createPropertyValue(0,E,S)}}},5981:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WriteBuffer=void 0;const h=c(8460),p=c(844);class u extends p.Disposable{constructor(C){super(),this._action=C,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(C,T){if(T!==void 0&&this._syncCalls>T)return void(this._syncCalls=0);if(this._pendingData+=C.length,this._writeBuffer.push(C),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let E;for(this._isSyncWriting=!0;E=this._writeBuffer.shift();){this._action(E);const S=this._callbacks.shift();S&&S()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(C,T){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+=C.length,this._writeBuffer.push(C),this._callbacks.push(T),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=C.length,this._writeBuffer.push(C),this._callbacks.push(T)}_innerWrite(C=0,T=!0){const E=C||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const S=this._writeBuffer[this._bufferOffset],v=this._action(S,T);if(v){const y=A=>Date.now()-E>=12?setTimeout((()=>this._innerWrite(0,A))):this._innerWrite(E,A);return void v.catch((A=>(queueMicrotask((()=>{throw A})),Promise.resolve(!1)))).then(y)}const _=this._callbacks[this._bufferOffset];if(_&&_(),this._bufferOffset++,this._pendingData-=S.length,Date.now()-E>=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()}}l.WriteBuffer=u},5941:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.toRgbString=l.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 p(u,b){const C=u.toString(16),T=C.length<2?"0"+C:C;switch(b){case 4:return C[0];case 8:return T;case 12:return(T+T).slice(0,3);default:return T+T}}l.parseColor=function(u){if(!u)return;let b=u.toLowerCase();if(b.indexOf("rgb:")===0){b=b.slice(4);const C=c.exec(b);if(C){const T=C[1]?15:C[4]?255:C[7]?4095:65535;return[Math.round(parseInt(C[1]||C[4]||C[7]||C[10],16)/T*255),Math.round(parseInt(C[2]||C[5]||C[8]||C[11],16)/T*255),Math.round(parseInt(C[3]||C[6]||C[9]||C[12],16)/T*255)]}}else if(b.indexOf("#")===0&&(b=b.slice(1),h.exec(b)&&[3,6,9,12].includes(b.length))){const C=b.length/3,T=[0,0,0];for(let E=0;E<3;++E){const S=parseInt(b.slice(C*E,C*E+C),16);T[E]=C===1?S<<4:C===2?S:C===3?S>>4:S>>8}return T}},l.toRgbString=function(u,b=16){const[C,T,E]=u;return`rgb:${p(C,b)}/${p(T,b)}/${p(E,b)}`}},5770:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.PAYLOAD_LIMIT=void 0,l.PAYLOAD_LIMIT=1e7},6351:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DcsHandler=l.DcsParser=void 0;const h=c(482),p=c(8742),u=c(5770),b=[];l.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=b,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=b}registerHandler(T,E){this._handlers[T]===void 0&&(this._handlers[T]=[]);const S=this._handlers[T];return S.push(E),{dispose:()=>{const v=S.indexOf(E);v!==-1&&S.splice(v,1)}}}clearHandler(T){this._handlers[T]&&delete this._handlers[T]}setHandlerFallback(T){this._handlerFb=T}reset(){if(this._active.length)for(let T=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;T>=0;--T)this._active[T].unhook(!1);this._stack.paused=!1,this._active=b,this._ident=0}hook(T,E){if(this.reset(),this._ident=T,this._active=this._handlers[T]||b,this._active.length)for(let S=this._active.length-1;S>=0;S--)this._active[S].hook(E);else this._handlerFb(this._ident,"HOOK",E)}put(T,E,S){if(this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].put(T,E,S);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(T,E,S))}unhook(T,E=!0){if(this._active.length){let S=!1,v=this._active.length-1,_=!1;if(this._stack.paused&&(v=this._stack.loopPosition-1,S=E,_=this._stack.fallThrough,this._stack.paused=!1),!_&&S===!1){for(;v>=0&&(S=this._active[v].unhook(T),S!==!0);v--)if(S instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!1,S;v--}for(;v>=0;v--)if(S=this._active[v].unhook(!1),S instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!0,S}else this._handlerFb(this._ident,"UNHOOK",T);this._active=b,this._ident=0}};const C=new p.Params;C.addParam(0),l.DcsHandler=class{constructor(T){this._handler=T,this._data="",this._params=C,this._hitLimit=!1}hook(T){this._params=T.length>1||T.params[0]?T.clone():C,this._data="",this._hitLimit=!1}put(T,E,S){this._hitLimit||(this._data+=(0,h.utf32ToString)(T,E,S),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(T){let E=!1;if(this._hitLimit)E=!1;else if(T&&(E=this._handler(this._data,this._params),E instanceof Promise))return E.then((S=>(this._params=C,this._data="",this._hitLimit=!1,S)));return this._params=C,this._data="",this._hitLimit=!1,E}}},2015:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.EscapeSequenceParser=l.VT500_TRANSITION_TABLE=l.TransitionTable=void 0;const h=c(844),p=c(8742),u=c(6242),b=c(6351);class C{constructor(v){this.table=new Uint8Array(v)}setDefault(v,_){this.table.fill(v<<4|_)}add(v,_,y,A){this.table[_<<8|v]=y<<4|A}addMany(v,_,y,A){for(let L=0;L<v.length;L++)this.table[_<<8|v[L]]=y<<4|A}}l.TransitionTable=C;const T=160;l.VT500_TRANSITION_TABLE=(function(){const S=new C(4095),v=Array.apply(null,Array(256)).map(((R,k)=>k)),_=(R,k)=>v.slice(R,k),y=_(32,127),A=_(0,24);A.push(25),A.push.apply(A,_(28,32));const L=_(0,14);let D;for(D in S.setDefault(1,0),S.addMany(y,0,2,0),L)S.addMany([24,26,153,154],D,3,0),S.addMany(_(128,144),D,3,0),S.addMany(_(144,152),D,3,0),S.add(156,D,0,0),S.add(27,D,11,1),S.add(157,D,4,8),S.addMany([152,158,159],D,0,7),S.add(155,D,11,3),S.add(144,D,11,9);return S.addMany(A,0,3,0),S.addMany(A,1,3,1),S.add(127,1,0,1),S.addMany(A,8,0,8),S.addMany(A,3,3,3),S.add(127,3,0,3),S.addMany(A,4,3,4),S.add(127,4,0,4),S.addMany(A,6,3,6),S.addMany(A,5,3,5),S.add(127,5,0,5),S.addMany(A,2,3,2),S.add(127,2,0,2),S.add(93,1,4,8),S.addMany(y,8,5,8),S.add(127,8,5,8),S.addMany([156,27,24,26,7],8,6,0),S.addMany(_(28,32),8,0,8),S.addMany([88,94,95],1,0,7),S.addMany(y,7,0,7),S.addMany(A,7,0,7),S.add(156,7,0,0),S.add(127,7,0,7),S.add(91,1,11,3),S.addMany(_(64,127),3,7,0),S.addMany(_(48,60),3,8,4),S.addMany([60,61,62,63],3,9,4),S.addMany(_(48,60),4,8,4),S.addMany(_(64,127),4,7,0),S.addMany([60,61,62,63],4,0,6),S.addMany(_(32,64),6,0,6),S.add(127,6,0,6),S.addMany(_(64,127),6,0,0),S.addMany(_(32,48),3,9,5),S.addMany(_(32,48),5,9,5),S.addMany(_(48,64),5,0,6),S.addMany(_(64,127),5,7,0),S.addMany(_(32,48),4,9,5),S.addMany(_(32,48),1,9,2),S.addMany(_(32,48),2,9,2),S.addMany(_(48,127),2,10,0),S.addMany(_(48,80),1,10,0),S.addMany(_(81,88),1,10,0),S.addMany([89,90,92],1,10,0),S.addMany(_(96,127),1,10,0),S.add(80,1,11,9),S.addMany(A,9,0,9),S.add(127,9,0,9),S.addMany(_(28,32),9,0,9),S.addMany(_(32,48),9,9,12),S.addMany(_(48,60),9,8,10),S.addMany([60,61,62,63],9,9,10),S.addMany(A,11,0,11),S.addMany(_(32,128),11,0,11),S.addMany(_(28,32),11,0,11),S.addMany(A,10,0,10),S.add(127,10,0,10),S.addMany(_(28,32),10,0,10),S.addMany(_(48,60),10,8,10),S.addMany([60,61,62,63],10,0,11),S.addMany(_(32,48),10,9,12),S.addMany(A,12,0,12),S.add(127,12,0,12),S.addMany(_(28,32),12,0,12),S.addMany(_(32,48),12,9,12),S.addMany(_(48,64),12,0,11),S.addMany(_(64,127),12,12,13),S.addMany(_(64,127),10,12,13),S.addMany(_(64,127),9,12,13),S.addMany(A,13,13,13),S.addMany(y,13,13,13),S.add(127,13,0,13),S.addMany([27,156,24,26],13,14,0),S.add(T,0,2,0),S.add(T,8,5,8),S.add(T,6,0,6),S.add(T,11,0,11),S.add(T,13,13,13),S})();class E extends h.Disposable{constructor(v=l.VT500_TRANSITION_TABLE){super(),this._transitions=v,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new p.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(_,y,A)=>{},this._executeHandlerFb=_=>{},this._csiHandlerFb=(_,y)=>{},this._escHandlerFb=_=>{},this._errorHandlerFb=_=>_,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 b.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(v,_=[64,126]){let y=0;if(v.prefix){if(v.prefix.length>1)throw new Error("only one byte as prefix supported");if(y=v.prefix.charCodeAt(0),y&&60>y||y>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(v.intermediates){if(v.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let L=0;L<v.intermediates.length;++L){const D=v.intermediates.charCodeAt(L);if(32>D||D>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");y<<=8,y|=D}}if(v.final.length!==1)throw new Error("final must be a single byte");const A=v.final.charCodeAt(0);if(_[0]>A||A>_[1])throw new Error(`final must be in range ${_[0]} .. ${_[1]}`);return y<<=8,y|=A,y}identToString(v){const _=[];for(;v;)_.push(String.fromCharCode(255&v)),v>>=8;return _.reverse().join("")}setPrintHandler(v){this._printHandler=v}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(v,_){const y=this._identifier(v,[48,126]);this._escHandlers[y]===void 0&&(this._escHandlers[y]=[]);const A=this._escHandlers[y];return A.push(_),{dispose:()=>{const L=A.indexOf(_);L!==-1&&A.splice(L,1)}}}clearEscHandler(v){this._escHandlers[this._identifier(v,[48,126])]&&delete this._escHandlers[this._identifier(v,[48,126])]}setEscHandlerFallback(v){this._escHandlerFb=v}setExecuteHandler(v,_){this._executeHandlers[v.charCodeAt(0)]=_}clearExecuteHandler(v){this._executeHandlers[v.charCodeAt(0)]&&delete this._executeHandlers[v.charCodeAt(0)]}setExecuteHandlerFallback(v){this._executeHandlerFb=v}registerCsiHandler(v,_){const y=this._identifier(v);this._csiHandlers[y]===void 0&&(this._csiHandlers[y]=[]);const A=this._csiHandlers[y];return A.push(_),{dispose:()=>{const L=A.indexOf(_);L!==-1&&A.splice(L,1)}}}clearCsiHandler(v){this._csiHandlers[this._identifier(v)]&&delete this._csiHandlers[this._identifier(v)]}setCsiHandlerFallback(v){this._csiHandlerFb=v}registerDcsHandler(v,_){return this._dcsParser.registerHandler(this._identifier(v),_)}clearDcsHandler(v){this._dcsParser.clearHandler(this._identifier(v))}setDcsHandlerFallback(v){this._dcsParser.setHandlerFallback(v)}registerOscHandler(v,_){return this._oscParser.registerHandler(v,_)}clearOscHandler(v){this._oscParser.clearHandler(v)}setOscHandlerFallback(v){this._oscParser.setHandlerFallback(v)}setErrorHandler(v){this._errorHandler=v}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(v,_,y,A,L){this._parseStack.state=v,this._parseStack.handlers=_,this._parseStack.handlerPos=y,this._parseStack.transition=A,this._parseStack.chunkPos=L}parse(v,_,y){let A,L=0,D=0,R=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,R=this._parseStack.chunkPos+1;else{if(y===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const k=this._parseStack.handlers;let M=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(y===!1&&M>-1){for(;M>=0&&(A=k[M](this._params),A!==!0);M--)if(A instanceof Promise)return this._parseStack.handlerPos=M,A}this._parseStack.handlers=[];break;case 4:if(y===!1&&M>-1){for(;M>=0&&(A=k[M](),A!==!0);M--)if(A instanceof Promise)return this._parseStack.handlerPos=M,A}this._parseStack.handlers=[];break;case 6:if(L=v[this._parseStack.chunkPos],A=this._dcsParser.unhook(L!==24&&L!==26,y),A)return A;L===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(L=v[this._parseStack.chunkPos],A=this._oscParser.end(L!==24&&L!==26,y),A)return A;L===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,R=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let k=R;k<_;++k){switch(L=v[k],D=this._transitions.table[this.currentState<<8|(L<160?L:T)],D>>4){case 2:for(let P=k+1;;++P){if(P>=_||(L=v[P])<32||L>126&&L<T){this._printHandler(v,k,P),k=P-1;break}if(++P>=_||(L=v[P])<32||L>126&&L<T){this._printHandler(v,k,P),k=P-1;break}if(++P>=_||(L=v[P])<32||L>126&&L<T){this._printHandler(v,k,P),k=P-1;break}if(++P>=_||(L=v[P])<32||L>126&&L<T){this._printHandler(v,k,P),k=P-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:k,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 B=M?M.length-1:-1;for(;B>=0&&(A=M[B](this._params),A!==!0);B--)if(A instanceof Promise)return this._preserveStack(3,M,B,D,k),A;B<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(++k<_&&(L=v[k])>47&&L<60);k--;break;case 9:this._collect<<=8,this._collect|=L;break;case 10:const H=this._escHandlers[this._collect<<8|L];let U=H?H.length-1:-1;for(;U>=0&&(A=H[U](),A!==!0);U--)if(A instanceof Promise)return this._preserveStack(4,H,U,D,k),A;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 P=k+1;;++P)if(P>=_||(L=v[P])===24||L===26||L===27||L>127&&L<T){this._dcsParser.put(v,k,P),k=P-1;break}break;case 14:if(A=this._dcsParser.unhook(L!==24&&L!==26),A)return this._preserveStack(6,[],0,D,k),A;L===27&&(D|=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 P=k+1;;P++)if(P>=_||(L=v[P])<32||L>127&&L<T){this._oscParser.put(v,k,P),k=P-1;break}break;case 6:if(A=this._oscParser.end(L!==24&&L!==26),A)return this._preserveStack(5,[],0,D,k),A;L===27&&(D|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&D}}}l.EscapeSequenceParser=E},6242:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.OscHandler=l.OscParser=void 0;const h=c(5770),p=c(482),u=[];l.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(b,C){this._handlers[b]===void 0&&(this._handlers[b]=[]);const T=this._handlers[b];return T.push(C),{dispose:()=>{const E=T.indexOf(C);E!==-1&&T.splice(E,1)}}}clearHandler(b){this._handlers[b]&&delete this._handlers[b]}setHandlerFallback(b){this._handlerFb=b}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=u}reset(){if(this._state===2)for(let b=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;b>=0;--b)this._active[b].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 b=this._active.length-1;b>=0;b--)this._active[b].start();else this._handlerFb(this._id,"START")}_put(b,C,T){if(this._active.length)for(let E=this._active.length-1;E>=0;E--)this._active[E].put(b,C,T);else this._handlerFb(this._id,"PUT",(0,p.utf32ToString)(b,C,T))}start(){this.reset(),this._state=1}put(b,C,T){if(this._state!==3){if(this._state===1)for(;C<T;){const E=b[C++];if(E===59){this._state=2,this._start();break}if(E<48||57<E)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+E-48}this._state===2&&T-C>0&&this._put(b,C,T)}}end(b,C=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let T=!1,E=this._active.length-1,S=!1;if(this._stack.paused&&(E=this._stack.loopPosition-1,T=C,S=this._stack.fallThrough,this._stack.paused=!1),!S&&T===!1){for(;E>=0&&(T=this._active[E].end(b),T!==!0);E--)if(T instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=E,this._stack.fallThrough=!1,T;E--}for(;E>=0;E--)if(T=this._active[E].end(!1),T instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=E,this._stack.fallThrough=!0,T}else this._handlerFb(this._id,"END",b);this._active=u,this._id=-1,this._state=0}}},l.OscHandler=class{constructor(b){this._handler=b,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(b,C,T){this._hitLimit||(this._data+=(0,p.utf32ToString)(b,C,T),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(b){let C=!1;if(this._hitLimit)C=!1;else if(b&&(C=this._handler(this._data),C instanceof Promise))return C.then((T=>(this._data="",this._hitLimit=!1,T)));return this._data="",this._hitLimit=!1,C}}},8742:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Params=void 0;const c=2147483647;class h{static fromArray(u){const b=new h;if(!u.length)return b;for(let C=Array.isArray(u[0])?1:0;C<u.length;++C){const T=u[C];if(Array.isArray(T))for(let E=0;E<T.length;++E)b.addSubParam(T[E]);else b.addParam(T)}return b}constructor(u=32,b=32){if(this.maxLength=u,this.maxSubParamsLength=b,b>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(u),this.length=0,this._subParams=new Int32Array(b),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 b=0;b<this.length;++b){u.push(this.params[b]);const C=this._subParamsIdx[b]>>8,T=255&this._subParamsIdx[b];T-C>0&&u.push(Array.prototype.slice.call(this._subParams,C,T))}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 b=this._subParamsIdx[u]>>8,C=255&this._subParamsIdx[u];return C-b>0?this._subParams.subarray(b,C):null}getSubParamsAll(){const u={};for(let b=0;b<this.length;++b){const C=this._subParamsIdx[b]>>8,T=255&this._subParamsIdx[b];T-C>0&&(u[b]=this._subParams.slice(C,T))}return u}addDigit(u){let b;if(this._rejectDigits||!(b=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const C=this._digitIsSub?this._subParams:this.params,T=C[b-1];C[b-1]=~T?Math.min(10*T+u,c):u}}l.Params=h},5741:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.AddonManager=void 0,l.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 p={instance:h,dispose:h.dispose,isDisposed:!1};this._addons.push(p),h.dispose=()=>this._wrappedAddonDispose(p),h.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let h=-1;for(let p=0;p<this._addons.length;p++)if(this._addons[p]===c){h=p;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,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferApiView=void 0;const h=c(3785),p=c(511);l.BufferApiView=class{constructor(u,b){this._buffer=u,this.type=b}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 b=this._buffer.lines.get(u);if(b)return new h.BufferLineApiView(b)}getNullCell(){return new p.CellData}}},3785:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLineApiView=void 0;const h=c(511);l.BufferLineApiView=class{constructor(p){this._line=p}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(p,u){if(!(p<0||p>=this._line.length))return u?(this._line.loadCell(p,u),u):this._line.loadCell(p,new h.CellData)}translateToString(p,u,b){return this._line.translateToString(p,u,b)}}},8285:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferNamespaceApi=void 0;const h=c(8771),p=c(8460),u=c(844);class b extends u.Disposable{constructor(T){super(),this._core=T,this._onBufferChange=this.register(new p.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)}}l.BufferNamespaceApi=b},7975:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ParserApi=void 0,l.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,h){return this._core.registerCsiHandler(c,(p=>h(p.toArray())))}addCsiHandler(c,h){return this.registerCsiHandler(c,h)}registerDcsHandler(c,h){return this._core.registerDcsHandler(c,((p,u)=>h(p,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,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeApi=void 0,l.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,l,c){var h=this&&this.__decorate||function(S,v,_,y){var A,L=arguments.length,D=L<3?v:y===null?y=Object.getOwnPropertyDescriptor(v,_):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(S,v,_,y);else for(var R=S.length-1;R>=0;R--)(A=S[R])&&(D=(L<3?A(D):L>3?A(v,_,D):A(v,_))||D);return L>3&&D&&Object.defineProperty(v,_,D),D},p=this&&this.__param||function(S,v){return function(_,y){v(_,y,S)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferService=l.MINIMUM_ROWS=l.MINIMUM_COLS=void 0;const u=c(8460),b=c(844),C=c(5295),T=c(2585);l.MINIMUM_COLS=2,l.MINIMUM_ROWS=1;let E=l.BufferService=class extends b.Disposable{get buffer(){return this.buffers.active}constructor(S){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(S.rawOptions.cols||0,l.MINIMUM_COLS),this.rows=Math.max(S.rawOptions.rows||0,l.MINIMUM_ROWS),this.buffers=this.register(new C.BufferSet(S,this))}resize(S,v){this.cols=S,this.rows=v,this.buffers.resize(S,v),this._onResize.fire({cols:S,rows:v})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(S,v=!1){const _=this.buffer;let y;y=this._cachedBlankLine,y&&y.length===this.cols&&y.getFg(0)===S.fg&&y.getBg(0)===S.bg||(y=_.getBlankLine(S,v),this._cachedBlankLine=y),y.isWrapped=v;const A=_.ybase+_.scrollTop,L=_.ybase+_.scrollBottom;if(_.scrollTop===0){const D=_.lines.isFull;L===_.lines.length-1?D?_.lines.recycle().copyFrom(y):_.lines.push(y.clone()):_.lines.splice(L+1,0,y.clone()),D?this.isUserScrolling&&(_.ydisp=Math.max(_.ydisp-1,0)):(_.ybase++,this.isUserScrolling||_.ydisp++)}else{const D=L-A+1;_.lines.shiftElements(A+1,D-1,-1),_.lines.set(L,y.clone())}this.isUserScrolling||(_.ydisp=_.ybase),this._onScroll.fire(_.ydisp)}scrollLines(S,v,_){const y=this.buffer;if(S<0){if(y.ydisp===0)return;this.isUserScrolling=!0}else S+y.ydisp>=y.ybase&&(this.isUserScrolling=!1);const A=y.ydisp;y.ydisp=Math.max(Math.min(y.ydisp+S,y.ybase),0),A!==y.ydisp&&(v||this._onScroll.fire(y.ydisp))}};l.BufferService=E=h([p(0,T.IOptionsService)],E)},7994:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CharsetService=void 0,l.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,l,c){var h=this&&this.__decorate||function(y,A,L,D){var R,k=arguments.length,M=k<3?A:D===null?D=Object.getOwnPropertyDescriptor(A,L):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(y,A,L,D);else for(var B=y.length-1;B>=0;B--)(R=y[B])&&(M=(k<3?R(M):k>3?R(A,L,M):R(A,L))||M);return k>3&&M&&Object.defineProperty(A,L,M),M},p=this&&this.__param||function(y,A){return function(L,D){A(L,D,y)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreMouseService=void 0;const u=c(2585),b=c(8460),C=c(844),T={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:y=>y.button!==4&&y.action===1&&(y.ctrl=!1,y.alt=!1,y.shift=!1,!0)},VT200:{events:19,restrict:y=>y.action!==32},DRAG:{events:23,restrict:y=>y.action!==32||y.button!==3},ANY:{events:31,restrict:y=>!0}};function E(y,A){let L=(y.ctrl?16:0)|(y.shift?4:0)|(y.alt?8:0);return y.button===4?(L|=64,L|=y.action):(L|=3&y.button,4&y.button&&(L|=64),8&y.button&&(L|=128),y.action===32?L|=32:y.action!==0||A||(L|=3)),L}const S=String.fromCharCode,v={DEFAULT:y=>{const A=[E(y,!1)+32,y.col+32,y.row+32];return A[0]>255||A[1]>255||A[2]>255?"":`\x1B[M${S(A[0])}${S(A[1])}${S(A[2])}`},SGR:y=>{const A=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${E(y,!0)};${y.col};${y.row}${A}`},SGR_PIXELS:y=>{const A=y.action===0&&y.button!==4?"m":"M";return`\x1B[<${E(y,!0)};${y.x};${y.y}${A}`}};let _=l.CoreMouseService=class extends C.Disposable{constructor(y,A){super(),this._bufferService=y,this._coreService=A,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new b.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const L of Object.keys(T))this.addProtocol(L,T[L]);for(const L of Object.keys(v))this.addEncoding(L,v[L]);this.reset()}addProtocol(y,A){this._protocols[y]=A}addEncoding(y,A){this._encodings[y]=A}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(y){if(!this._protocols[y])throw new Error(`unknown protocol "${y}"`);this._activeProtocol=y,this._onProtocolChange.fire(this._protocols[y].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(y){if(!this._encodings[y])throw new Error(`unknown encoding "${y}"`);this._activeEncoding=y}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(y){if(y.col<0||y.col>=this._bufferService.cols||y.row<0||y.row>=this._bufferService.rows||y.button===4&&y.action===32||y.button===3&&y.action!==32||y.button!==4&&(y.action===2||y.action===3)||(y.col++,y.row++,y.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,y,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(y))return!1;const A=this._encodings[this._activeEncoding](y);return A&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(A):this._coreService.triggerDataEvent(A,!0)),this._lastEvent=y,!0}explainEvents(y){return{down:!!(1&y),up:!!(2&y),drag:!!(4&y),move:!!(8&y),wheel:!!(16&y)}}_equalEvents(y,A,L){if(L){if(y.x!==A.x||y.y!==A.y)return!1}else if(y.col!==A.col||y.row!==A.row)return!1;return y.button===A.button&&y.action===A.action&&y.ctrl===A.ctrl&&y.alt===A.alt&&y.shift===A.shift}};l.CoreMouseService=_=h([p(0,u.IBufferService),p(1,u.ICoreService)],_)},6975:function(f,l,c){var h=this&&this.__decorate||function(_,y,A,L){var D,R=arguments.length,k=R<3?y:L===null?L=Object.getOwnPropertyDescriptor(y,A):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(_,y,A,L);else for(var M=_.length-1;M>=0;M--)(D=_[M])&&(k=(R<3?D(k):R>3?D(y,A,k):D(y,A))||k);return R>3&&k&&Object.defineProperty(y,A,k),k},p=this&&this.__param||function(_,y){return function(A,L){y(A,L,_)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreService=void 0;const u=c(1439),b=c(8460),C=c(844),T=c(2585),E=Object.freeze({insertMode:!1}),S=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let v=l.CoreService=class extends C.Disposable{constructor(_,y,A){super(),this._bufferService=_,this._logService=y,this._optionsService=A,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new b.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new b.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new b.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new b.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,u.clone)(E),this.decPrivateModes=(0,u.clone)(S)}reset(){this.modes=(0,u.clone)(E),this.decPrivateModes=(0,u.clone)(S)}triggerDataEvent(_,y=!1){if(this._optionsService.rawOptions.disableStdin)return;const A=this._bufferService.buffer;y&&this._optionsService.rawOptions.scrollOnUserInput&&A.ybase!==A.ydisp&&this._onRequestScrollToBottom.fire(),y&&this._onUserInput.fire(),this._logService.debug(`sending data "${_}"`,(()=>_.split("").map((L=>L.charCodeAt(0))))),this._onData.fire(_)}triggerBinaryEvent(_){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${_}"`,(()=>_.split("").map((y=>y.charCodeAt(0))))),this._onBinary.fire(_))}};l.CoreService=v=h([p(0,T.IBufferService),p(1,T.ILogService),p(2,T.IOptionsService)],v)},9074:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DecorationService=void 0;const h=c(8055),p=c(8460),u=c(844),b=c(6106);let C=0,T=0;class E extends u.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new b.SortedList((_=>_==null?void 0:_.marker.line)),this._onDecorationRegistered=this.register(new p.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new p.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,u.toDisposable)((()=>this.reset())))}registerDecoration(_){if(_.marker.isDisposed)return;const y=new S(_);if(y){const A=y.marker.onDispose((()=>y.dispose()));y.onDispose((()=>{y&&(this._decorations.delete(y)&&this._onDecorationRemoved.fire(y),A.dispose())})),this._decorations.insert(y),this._onDecorationRegistered.fire(y)}return y}reset(){for(const _ of this._decorations.values())_.dispose();this._decorations.clear()}*getDecorationsAtCell(_,y,A){let L=0,D=0;for(const R of this._decorations.getKeyIterator(y))L=R.options.x??0,D=L+(R.options.width??1),_>=L&&_<D&&(!A||(R.options.layer??"bottom")===A)&&(yield R)}forEachDecorationAtCell(_,y,A,L){this._decorations.forEachByKey(y,(D=>{C=D.options.x??0,T=C+(D.options.width??1),_>=C&&_<T&&(!A||(D.options.layer??"bottom")===A)&&L(D)}))}}l.DecorationService=E;class S 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(_){super(),this.options=_,this.onRenderEmitter=this.register(new p.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new p.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=_.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.InstantiationService=l.ServiceCollection=void 0;const h=c(2585),p=c(8343);class u{constructor(...C){this._entries=new Map;for(const[T,E]of C)this.set(T,E)}set(C,T){const E=this._entries.get(C);return this._entries.set(C,T),E}forEach(C){for(const[T,E]of this._entries.entries())C(T,E)}has(C){return this._entries.has(C)}get(C){return this._entries.get(C)}}l.ServiceCollection=u,l.InstantiationService=class{constructor(){this._services=new u,this._services.set(h.IInstantiationService,this)}setService(b,C){this._services.set(b,C)}getService(b){return this._services.get(b)}createInstance(b,...C){const T=(0,p.getServiceDependencies)(b).sort(((v,_)=>v.index-_.index)),E=[];for(const v of T){const _=this._services.get(v.id);if(!_)throw new Error(`[createInstance] ${b.name} depends on UNKNOWN service ${v.id}.`);E.push(_)}const S=T.length>0?T[0].index:C.length;if(C.length!==S)throw new Error(`[createInstance] First service dependency of ${b.name} at position ${S+1} conflicts with ${C.length} static arguments`);return new b(...C,...E)}}},7866:function(f,l,c){var h=this&&this.__decorate||function(S,v,_,y){var A,L=arguments.length,D=L<3?v:y===null?y=Object.getOwnPropertyDescriptor(v,_):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(S,v,_,y);else for(var R=S.length-1;R>=0;R--)(A=S[R])&&(D=(L<3?A(D):L>3?A(v,_,D):A(v,_))||D);return L>3&&D&&Object.defineProperty(v,_,D),D},p=this&&this.__param||function(S,v){return function(_,y){v(_,y,S)}};Object.defineProperty(l,"__esModule",{value:!0}),l.traceCall=l.setTraceLogger=l.LogService=void 0;const u=c(844),b=c(2585),C={trace:b.LogLevelEnum.TRACE,debug:b.LogLevelEnum.DEBUG,info:b.LogLevelEnum.INFO,warn:b.LogLevelEnum.WARN,error:b.LogLevelEnum.ERROR,off:b.LogLevelEnum.OFF};let T,E=l.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(S){super(),this._optionsService=S,this._logLevel=b.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),T=this}_updateLogLevel(){this._logLevel=C[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(S){for(let v=0;v<S.length;v++)typeof S[v]=="function"&&(S[v]=S[v]())}_log(S,v,_){this._evalLazyOptionalParams(_),S.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+v,..._)}trace(S,...v){var _;this._logLevel<=b.LogLevelEnum.TRACE&&this._log(((_=this._optionsService.options.logger)==null?void 0:_.trace.bind(this._optionsService.options.logger))??console.log,S,v)}debug(S,...v){var _;this._logLevel<=b.LogLevelEnum.DEBUG&&this._log(((_=this._optionsService.options.logger)==null?void 0:_.debug.bind(this._optionsService.options.logger))??console.log,S,v)}info(S,...v){var _;this._logLevel<=b.LogLevelEnum.INFO&&this._log(((_=this._optionsService.options.logger)==null?void 0:_.info.bind(this._optionsService.options.logger))??console.info,S,v)}warn(S,...v){var _;this._logLevel<=b.LogLevelEnum.WARN&&this._log(((_=this._optionsService.options.logger)==null?void 0:_.warn.bind(this._optionsService.options.logger))??console.warn,S,v)}error(S,...v){var _;this._logLevel<=b.LogLevelEnum.ERROR&&this._log(((_=this._optionsService.options.logger)==null?void 0:_.error.bind(this._optionsService.options.logger))??console.error,S,v)}};l.LogService=E=h([p(0,b.IOptionsService)],E),l.setTraceLogger=function(S){T=S},l.traceCall=function(S,v,_){if(typeof _.value!="function")throw new Error("not supported");const y=_.value;_.value=function(...A){if(T.logLevel!==b.LogLevelEnum.TRACE)return y.apply(this,A);T.trace(`GlyphRenderer#${y.name}(${A.map((D=>JSON.stringify(D))).join(", ")})`);const L=y.apply(this,A);return T.trace(`GlyphRenderer#${y.name} return`,L),L}}},7302:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.OptionsService=l.DEFAULT_OPTIONS=void 0;const h=c(8460),p=c(844),u=c(6114);l.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 b=["normal","bold","100","200","300","400","500","600","700","800","900"];class C extends p.Disposable{constructor(E){super(),this._onOptionChange=this.register(new h.EventEmitter),this.onOptionChange=this._onOptionChange.event;const S={...l.DEFAULT_OPTIONS};for(const v in E)if(v in S)try{const _=E[v];S[v]=this._sanitizeAndValidateOption(v,_)}catch(_){console.error(_)}this.rawOptions=S,this.options={...S},this._setupOptions(),this.register((0,p.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(E,S){return this.onOptionChange((v=>{v===E&&S(this.rawOptions[E])}))}onMultipleOptionChange(E,S){return this.onOptionChange((v=>{E.indexOf(v)!==-1&&S()}))}_setupOptions(){const E=v=>{if(!(v in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${v}"`);return this.rawOptions[v]},S=(v,_)=>{if(!(v in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${v}"`);_=this._sanitizeAndValidateOption(v,_),this.rawOptions[v]!==_&&(this.rawOptions[v]=_,this._onOptionChange.fire(v))};for(const v in this.rawOptions){const _={get:E.bind(this,v),set:S.bind(this,v)};Object.defineProperty(this.options,v,_)}}_sanitizeAndValidateOption(E,S){switch(E){case"cursorStyle":if(S||(S=l.DEFAULT_OPTIONS[E]),!(function(v){return v==="block"||v==="underline"||v==="bar"})(S))throw new Error(`"${S}" is not a valid value for ${E}`);break;case"wordSeparator":S||(S=l.DEFAULT_OPTIONS[E]);break;case"fontWeight":case"fontWeightBold":if(typeof S=="number"&&1<=S&&S<=1e3)break;S=b.includes(S)?S:l.DEFAULT_OPTIONS[E];break;case"cursorWidth":S=Math.floor(S);case"lineHeight":case"tabStopWidth":if(S<1)throw new Error(`${E} cannot be less than 1, value: ${S}`);break;case"minimumContrastRatio":S=Math.max(1,Math.min(21,Math.round(10*S)/10));break;case"scrollback":if((S=Math.min(S,4294967295))<0)throw new Error(`${E} cannot be less than 0, value: ${S}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(S<=0)throw new Error(`${E} cannot be less than or equal to 0, value: ${S}`);break;case"rows":case"cols":if(!S&&S!==0)throw new Error(`${E} must be numeric, value: ${S}`);break;case"windowsPty":S=S??{}}return S}}l.OptionsService=C},2660:function(f,l,c){var h=this&&this.__decorate||function(C,T,E,S){var v,_=arguments.length,y=_<3?T:S===null?S=Object.getOwnPropertyDescriptor(T,E):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(C,T,E,S);else for(var A=C.length-1;A>=0;A--)(v=C[A])&&(y=(_<3?v(y):_>3?v(T,E,y):v(T,E))||y);return _>3&&y&&Object.defineProperty(T,E,y),y},p=this&&this.__param||function(C,T){return function(E,S){T(E,S,C)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkService=void 0;const u=c(2585);let b=l.OscLinkService=class{constructor(C){this._bufferService=C,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(C){const T=this._bufferService.buffer;if(C.id===void 0){const A=T.addMarker(T.ybase+T.y),L={data:C,id:this._nextId++,lines:[A]};return A.onDispose((()=>this._removeMarkerFromLink(L,A))),this._dataByLinkId.set(L.id,L),L.id}const E=C,S=this._getEntryIdKey(E),v=this._entriesWithId.get(S);if(v)return this.addLineToLink(v.id,T.ybase+T.y),v.id;const _=T.addMarker(T.ybase+T.y),y={id:this._nextId++,key:this._getEntryIdKey(E),data:E,lines:[_]};return _.onDispose((()=>this._removeMarkerFromLink(y,_))),this._entriesWithId.set(y.key,y),this._dataByLinkId.set(y.id,y),y.id}addLineToLink(C,T){const E=this._dataByLinkId.get(C);if(E&&E.lines.every((S=>S.line!==T))){const S=this._bufferService.buffer.addMarker(T);E.lines.push(S),S.onDispose((()=>this._removeMarkerFromLink(E,S)))}}getLinkData(C){var T;return(T=this._dataByLinkId.get(C))==null?void 0:T.data}_getEntryIdKey(C){return`${C.id};;${C.uri}`}_removeMarkerFromLink(C,T){const E=C.lines.indexOf(T);E!==-1&&(C.lines.splice(E,1),C.lines.length===0&&(C.data.id!==void 0&&this._entriesWithId.delete(C.key),this._dataByLinkId.delete(C.id)))}};l.OscLinkService=b=h([p(0,u.IBufferService)],b)},8343:(f,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.createDecorator=l.getServiceDependencies=l.serviceRegistry=void 0;const c="di$target",h="di$dependencies";l.serviceRegistry=new Map,l.getServiceDependencies=function(p){return p[h]||[]},l.createDecorator=function(p){if(l.serviceRegistry.has(p))return l.serviceRegistry.get(p);const u=function(b,C,T){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(E,S,v){S[c]===S?S[h].push({id:E,index:v}):(S[h]=[{id:E,index:v}],S[c]=S)})(u,b,T)};return u.toString=()=>p,l.serviceRegistry.set(p,u),u}},2585:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.IDecorationService=l.IUnicodeService=l.IOscLinkService=l.IOptionsService=l.ILogService=l.LogLevelEnum=l.IInstantiationService=l.ICharsetService=l.ICoreService=l.ICoreMouseService=l.IBufferService=void 0;const h=c(8343);var p;l.IBufferService=(0,h.createDecorator)("BufferService"),l.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),l.ICoreService=(0,h.createDecorator)("CoreService"),l.ICharsetService=(0,h.createDecorator)("CharsetService"),l.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"})(p||(l.LogLevelEnum=p={})),l.ILogService=(0,h.createDecorator)("LogService"),l.IOptionsService=(0,h.createDecorator)("OptionsService"),l.IOscLinkService=(0,h.createDecorator)("OscLinkService"),l.IUnicodeService=(0,h.createDecorator)("UnicodeService"),l.IDecorationService=(0,h.createDecorator)("DecorationService")},1480:(f,l,c)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeService=void 0;const h=c(8460),p=c(225);class u{static extractShouldJoin(C){return(1&C)!=0}static extractWidth(C){return C>>1&3}static extractCharKind(C){return C>>3}static createPropertyValue(C,T,E=!1){return(16777215&C)<<3|(3&T)<<1|(E?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const C=new p.UnicodeV6;this.register(C),this._active=C.version,this._activeProvider=C}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(C){if(!this._providers[C])throw new Error(`unknown Unicode version "${C}"`);this._active=C,this._activeProvider=this._providers[C],this._onChange.fire(C)}register(C){this._providers[C.version]=C}wcwidth(C){return this._activeProvider.wcwidth(C)}getStringCellWidth(C){let T=0,E=0;const S=C.length;for(let v=0;v<S;++v){let _=C.charCodeAt(v);if(55296<=_&&_<=56319){if(++v>=S)return T+this.wcwidth(_);const L=C.charCodeAt(v);56320<=L&&L<=57343?_=1024*(_-55296)+L-56320+65536:T+=this.wcwidth(L)}const y=this.charProperties(_,E);let A=u.extractWidth(y);u.extractShouldJoin(y)&&(A-=u.extractWidth(E)),T+=A,E=y}return T}charProperties(C,T){return this._activeProvider.charProperties(C,T)}}l.UnicodeService=u}},o={};function d(f){var l=o[f];if(l!==void 0)return l.exports;var c=o[f]={exports:{}};return s[f].call(c.exports,c,c.exports,d),c.exports}var g={};return(()=>{var f=g;Object.defineProperty(f,"__esModule",{value:!0}),f.Terminal=void 0;const l=d(9042),c=d(3236),h=d(844),p=d(5741),u=d(8285),b=d(7975),C=d(7090),T=["cols","rows"];class E extends h.Disposable{constructor(v){super(),this._core=this.register(new c.Terminal(v)),this._addonManager=this.register(new p.AddonManager),this._publicOptions={...this._core.options};const _=A=>this._core.options[A],y=(A,L)=>{this._checkReadonlyOptions(A),this._core.options[A]=L};for(const A in this._core.options){const L={get:_.bind(this,A),set:y.bind(this,A)};Object.defineProperty(this._publicOptions,A,L)}}_checkReadonlyOptions(v){if(T.includes(v))throw new Error(`Option "${v}" 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 b.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new C.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 v=this._core.coreService.decPrivateModes;let _="none";switch(this._core.coreMouseService.activeProtocol){case"X10":_="x10";break;case"VT200":_="vt200";break;case"DRAG":_="drag";break;case"ANY":_="any"}return{applicationCursorKeysMode:v.applicationCursorKeys,applicationKeypadMode:v.applicationKeypad,bracketedPasteMode:v.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:_,originMode:v.origin,reverseWraparoundMode:v.reverseWraparound,sendFocusMode:v.sendFocus,wraparoundMode:v.wraparound}}get options(){return this._publicOptions}set options(v){for(const _ in v)this._publicOptions[_]=v[_]}blur(){this._core.blur()}focus(){this._core.focus()}input(v,_=!0){this._core.input(v,_)}resize(v,_){this._verifyIntegers(v,_),this._core.resize(v,_)}open(v){this._core.open(v)}attachCustomKeyEventHandler(v){this._core.attachCustomKeyEventHandler(v)}attachCustomWheelEventHandler(v){this._core.attachCustomWheelEventHandler(v)}registerLinkProvider(v){return this._core.registerLinkProvider(v)}registerCharacterJoiner(v){return this._checkProposedApi(),this._core.registerCharacterJoiner(v)}deregisterCharacterJoiner(v){this._checkProposedApi(),this._core.deregisterCharacterJoiner(v)}registerMarker(v=0){return this._verifyIntegers(v),this._core.registerMarker(v)}registerDecoration(v){return this._checkProposedApi(),this._verifyPositiveIntegers(v.x??0,v.width??0,v.height??0),this._core.registerDecoration(v)}hasSelection(){return this._core.hasSelection()}select(v,_,y){this._verifyIntegers(v,_,y),this._core.select(v,_,y)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(v,_){this._verifyIntegers(v,_),this._core.selectLines(v,_)}dispose(){super.dispose()}scrollLines(v){this._verifyIntegers(v),this._core.scrollLines(v)}scrollPages(v){this._verifyIntegers(v),this._core.scrollPages(v)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(v){this._verifyIntegers(v),this._core.scrollToLine(v)}clear(){this._core.clear()}write(v,_){this._core.write(v,_)}writeln(v,_){this._core.write(v),this._core.write(`\r
|
|
59
|
-
`,_)}paste(v){this._core.paste(v)}refresh(v,_){this._verifyIntegers(v,_),this._core.refresh(v,_)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(v){this._addonManager.loadAddon(this,v)}static get strings(){return l}_verifyIntegers(...v){for(const _ of v)if(_===1/0||isNaN(_)||_%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...v){for(const _ of v)if(_&&(_===1/0||isNaN(_)||_%1!=0||_<0))throw new Error("This API only accepts positive integers")}}f.Terminal=E})(),g})()))})(Gu)),Gu.exports}var f1=h1();class d1{constructor(r,s){Tm(this,"socket");const d=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/terminal/${encodeURIComponent(r)}`;this.socket=new WebSocket(d),this.socket.addEventListener("message",g=>{var l,c,h;let f;try{f=JSON.parse(g.data)}catch(p){(l=s.onError)==null||l.call(s,`Terminal message parse failed for session ${r}. Reason: ${Mo(p)}`);return}f.type==="output"?s.onOutput(f.data):f.type==="error"?(c=s.onError)==null||c.call(s,f.message):(h=s.onStatus)==null||h.call(s,f)}),this.socket.addEventListener("error",()=>{var g;(g=s.onError)==null||g.call(s,`Terminal WebSocket connection failed for session ${r}. URL: ${d}. Check that the VCM backend is running and the session still exists.`)})}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 Lo({sessionId:n,active:r=!0,onEvent:s}){const o=ne.useRef(null),d=ne.useRef(null),g=ne.useRef(null),f=ne.useRef(null),l=ne.useRef(r),c=ne.useRef(s);function h(p={}){const u=o.current,b=d.current,C=g.current,T=f.current;if(!u||!b||!C||!T)return!1;const E=u.getBoundingClientRect();return E.width<$m||E.height<Gm||(C.fit(),T.cols<Vm||T.rows<Wm)?!1:(b.resize(T.cols,T.rows),p.focus&&T.focus(),!0)}return ne.useEffect(()=>{c.current=s},[s]),ne.useEffect(()=>{l.current=r},[r]),ne.useEffect(()=>{if(!o.current)return;const p=new f1.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:p1}),u=new o1.FitAddon;p.loadAddon(u),p.loadAddon(new u1.WebLinksAddon),p.open(o.current),f.current=p,g.current=u;const b=o.current.getBoundingClientRect();b.width>=$m&&b.height>=Gm&&u.fit();const C=new d1(n,{onOutput(A){p.write(A)},onStatus(A){var L;(L=c.current)==null||L.call(c,A.type)},onError(A){var L;p.writeln(`\r
|
|
60
|
-
[VCM] ${A}`),(L=c.current)==null||L.call(c,A)}});d.current=C,p.cols>=Vm&&p.rows>=Wm&&C.resize(p.cols,p.rows);const T=p.onData(A=>{C.sendInput(A)});let E=0,S=0,v=0;const _=()=>{E&&window.cancelAnimationFrame(E),E=window.requestAnimationFrame(()=>{E=0,h({focus:l.current})})},y=new ResizeObserver(()=>{_()});return y.observe(o.current),S=window.requestAnimationFrame(_),v=window.setTimeout(_,120),()=>{E&&window.cancelAnimationFrame(E),S&&window.cancelAnimationFrame(S),v&&window.clearTimeout(v),y.disconnect(),T.dispose(),C.close(),p.dispose(),d.current=null,f.current=null,g.current=null}},[n]),ne.useEffect(()=>{if(!r)return;const p=[],u=[];return p.push(window.requestAnimationFrame(()=>{h({focus:!0}),p.push(window.requestAnimationFrame(()=>h({focus:!0})))})),u.push(window.setTimeout(()=>h({focus:!0}),160)),u.push(window.setTimeout(()=>h({focus:!0}),360)),()=>{for(const b of p)window.cancelAnimationFrame(b);for(const b of u)window.clearTimeout(b)}},[r]),ne.useEffect(()=>{const p=()=>{l.current&&h()};return window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[]),x.jsx("div",{className:"terminal-frame",ref:o,onMouseDown:()=>{var p;return(p=f.current)==null?void 0:p.focus()}})}const $m=160,Gm=80,Vm=20,Wm=5,p1={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"},r_=[{value:"bypassPermissions",label:"bypassPermissions",description:"Bypass prompts; recommended in DevContainer worktrees"},{value:"plan",label:"plan",description:"Plan-only permission mode"},{value:"default",label:"default",description:"Claude Code default permission behavior"}],s_=[{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"}],a_=[...m1,{value:"max",label:"Max",description:"Maximum reasoning"},{value:"ultracode",label:"Ultracode",description:"Claude Code dynamic workflows with xhigh reasoning"}];function Bi({status:n}){return x.jsx("span",{className:`status-badge status-${n}`,children:n.replaceAll("_"," ")})}function Lh({role:n,session:r,permissionMode:s,model:o,effort:d,busy:g=!1,onPermissionModeChange:f,onModelChange:l,onEffortChange:c,onStart:h,onResume:p,onStop:u,onRestart:b,onNotifyHarnessUpdated:C}){const T=(r==null?void 0:r.status)==="running",E=!!(r!=null&&r.claudeSessionId&&!T),S=!T&&!(r!=null&&r.claudeSessionId),v=!!(r!=null&&r.harnessOutdated);return x.jsxs("div",{className:"session-controls",children:[x.jsxs("label",{className:"session-option-field permission-mode-field",children:[x.jsx("span",{children:"Permission"}),x.jsx("select",{value:s,onChange:_=>f(_.target.value),children:r_.map(_=>x.jsx("option",{value:_.value,children:_.label},_.value))})]}),x.jsxs("label",{className:"session-option-field model-field",children:[x.jsx("span",{children:"Model"}),x.jsx("select",{value:o,onChange:_=>l(_.target.value),children:s_.map(_=>x.jsx("option",{value:_.value,children:_.label},_.value))})]}),x.jsxs("label",{className:"session-option-field effort-field",children:[x.jsx("span",{children:"Effort"}),x.jsx("select",{value:d,onChange:_=>c(_.target.value),children:a_.map(_=>x.jsx("option",{value:_.value,children:_.label},_.value))})]}),x.jsxs("div",{className:"session-toolbar",children:[x.jsx("button",{type:"button",disabled:g||!S,onClick:h,children:"Start"}),x.jsx("button",{type:"button",disabled:g||!E,onClick:p,children:"Resume"}),x.jsx("button",{type:"button",disabled:g||!r,onClick:b,children:"Restart"}),x.jsx("button",{type:"button",disabled:g||!r,onClick:u,children:"Stop"})]}),v?x.jsxs("div",{className:"session-harness-notice",children:[x.jsx(Bi,{status:"outdated"}),x.jsxs("span",{children:["Harness updated",(r==null?void 0:r.harnessRevision)!==void 0&&r.harnessCurrentRevision!==void 0?` (${r.harnessRevision} -> ${r.harnessCurrentRevision})`:""]}),x.jsx("button",{type:"button",disabled:g||!T||!C,onClick:C,children:"Notify role"})]}):null]})}function g1({busy:n,effort:r,model:s,open:o,permissionMode:d,taskSlug:g,bootstrapStatus:f,engineerSession:l,status:c,onClose:h,onEffortChange:p,onModelChange:u,onPermissionModeChange:b,onEngineerResume:C,onEngineerRestart:T,onEngineerStart:E,onEngineerStop:S,onEngineerNotifyHarnessUpdated:v,onOpenRepositoryDiff:_,onReviewTaskHarness:y,onRefresh:A}){const[L,D]=ne.useState(null),[R,k]=ne.useState(null),[M,B]=ne.useState(""),[H,U]=ne.useState(!1),[P,K]=ne.useState(!1),[,X]=ji(null),[G,W]=ne.useState(null),te=(c==null?void 0:c.files)??[],z=te.filter(Z=>Z.kind.startsWith("agent-")),j=z.filter(Z=>Km(Z)),N=z.filter(Z=>!Km(Z)),$=te.filter(Z=>Z.kind.startsWith("skill-")),I=te.filter(Z=>Z.kind.startsWith("tool-")),se=te.filter(Z=>Z.kind==="root-claude"||Z.kind==="gitignore"||Z.kind==="pull-request-template"),ae=!!(R&&M!==R.content);ne.useEffect(()=>{o||(D(null),k(null),B(""),U(!1),X(null))},[te,o,L]),ne.useEffect(()=>{if(!o||!L||!g)return;let Z=!1;return K(!0),X(null),U(!1),ye.getHarnessFileContent(g,L).then(Q=>{Z||(k(Q),B(Q.content))}).catch(Q=>{Z||X(pt(`Load harness file ${L}`,Q))}).finally(()=>{Z||K(!1)}),()=>{Z=!0}},[o,L,g]);async function ue(){if(!(!R||!R.editable||!ae||!g)){K(!0),X(null);try{const Z=await ye.updateHarnessFileContent(g,R.path,{content:M});k(Z.file),B(Z.file.content),U(!1),A()}catch(Z){X(pt(`Save harness file ${R.path}`,Z))}finally{K(!1)}}}function Y(){D(null),k(null),B(""),U(!1),X(null)}async function q(Z){X(null);try{await _1(Z),W(Z),window.setTimeout(()=>{W(Q=>Q===Z?null:Q)},1200)}catch(Q){X(pt(`Copy harness file path ${Z}`,Q))}}return o?x.jsx(x.Fragment,{children:x.jsx("div",{className:"modal-backdrop harness-studio-backdrop",children:x.jsxs("section",{className:"harness-studio-modal",role:"dialog","aria-modal":"true","aria-label":"Harness Studio",children:[x.jsxs("header",{className:"harness-studio-header",children:[x.jsxs("div",{children:[x.jsx("h2",{children:"Harness Studio"}),g?null:x.jsx("p",{className:"muted",children:"Create or select a task before editing harness files."})]}),x.jsxs("div",{className:"harness-studio-header-actions",children:[x.jsx("button",{type:"button",disabled:n||!g,onClick:y,children:"Review Task Harness"}),x.jsx("button",{type:"button",disabled:n,onClick:_,children:"Review Diff"}),x.jsx("button",{type:"button",disabled:n,onClick:A,children:"Refresh"}),x.jsx("button",{type:"button",onClick:h,children:"Close"})]})]}),x.jsxs("div",{className:"harness-studio-layout",children:[x.jsx("aside",{className:L?"harness-studio-left harness-studio-left-preview":"harness-studio-left",children:L?x.jsxs("section",{className:"harness-studio-section harness-studio-file-preview",children:[x.jsxs("header",{className:"harness-studio-file-editor-header",children:[x.jsxs("div",{children:[x.jsx("h3",{children:(R==null?void 0:R.title)??"Harness File"}),x.jsx("p",{className:"muted",children:(R==null?void 0:R.path)??L})]}),x.jsxs("div",{className:"harness-studio-file-editor-actions",children:[R?x.jsx(Bi,{status:R.editable?"ok":"unknown"}):null,H?x.jsxs(x.Fragment,{children:[x.jsx("button",{type:"button",disabled:P||!g||!(R!=null&&R.editable)||!ae,onClick:()=>void ue(),children:"Save"}),x.jsx("button",{type:"button",disabled:P,onClick:()=>{B((R==null?void 0:R.content)??""),U(!1)},children:"Cancel"})]}):x.jsx("button",{type:"button",disabled:P||!g||!(R!=null&&R.editable),onClick:()=>U(!0),children:"Edit"}),x.jsx("button",{type:"button",onClick:Y,children:"Return"})]})]}),R!=null&&R.readonlyReason?x.jsx("p",{className:"muted",children:R.readonlyReason}):null,x.jsx("textarea",{className:H?"harness-studio-file-textarea is-editing":"harness-studio-file-textarea",value:M,spellCheck:!1,readOnly:!H,disabled:P,onChange:Z=>B(Z.target.value)})]}):x.jsxs(x.Fragment,{children:[x.jsx(za,{title:"VCM Roles",files:j,selectedPath:L,copiedPath:G,onCopy:Z=>void q(Z),onSelect:D}),x.jsx(za,{title:"Auxiliary Roles",files:N,selectedPath:L,copiedPath:G,onCopy:Z=>void q(Z),onSelect:D}),x.jsx(ph,{title:"Overview",children:x.jsxs("section",{className:"harness-studio-overview",children:[x.jsxs("div",{className:"harness-studio-metrics",children:[x.jsx(Ls,{label:"Fixed install",value:c?c.initialized?c.needsApply?"updates":"current":"new":"unknown"}),x.jsx(Ls,{label:"Revision",value:String((c==null?void 0:c.harnessRevision)??0)}),x.jsx(Ls,{label:"Managed files",value:String(te.length)}),x.jsx(Ls,{label:"Pending updates",value:String((c==null?void 0:c.plannedChanges.length)??0)}),x.jsx(Ls,{label:"Bootstrap",value:(f==null?void 0:f.status.replaceAll("_"," "))??"unknown"}),x.jsx(Ls,{label:"Engineer",value:Ym(l)})]}),c!=null&&c.warnings.length?x.jsx("ul",{className:"warnings",children:c.warnings.map(Z=>x.jsx("li",{children:Z},Z))}):null]})}),x.jsx(za,{title:"Skills",files:$,selectedPath:L,copiedPath:G,onCopy:Z=>void q(Z),onSelect:D,collapsible:!0}),x.jsx(za,{title:"Root Context",files:se,selectedPath:L,copiedPath:G,onCopy:Z=>void q(Z),onSelect:D,collapsible:!0}),x.jsx(za,{title:"Tools",files:I,selectedPath:L,copiedPath:G,onCopy:Z=>void q(Z),onSelect:D,collapsible:!0}),x.jsx(ph,{title:"Project Docs",children:x.jsx("ul",{className:"harness-studio-doc-list",children:(f==null?void 0:f.checks.map(Z=>x.jsxs("li",{children:[x.jsx("span",{children:Z.path??Z.label}),x.jsx(Bi,{status:Z.status})]},Z.key)))??x.jsx("li",{children:x.jsx("span",{children:"No bootstrap status loaded."})})})})]})}),x.jsxs("section",{className:"harness-studio-section harness-studio-engineer",children:[x.jsxs("div",{className:"harness-studio-engineer-header",children:[x.jsxs("div",{children:[x.jsx("h3",{children:"Harness Engineer"}),x.jsx("p",{className:"muted",children:Ym(l)})]}),x.jsx(Bi,{status:(l==null?void 0:l.status)??"unknown"})]}),x.jsx(Lh,{role:"harness-engineer",session:l??void 0,permissionMode:d,model:s,effort:r,busy:n,onPermissionModeChange:b,onModelChange:u,onEffortChange:p,onStart:E,onResume:C,onRestart:T,onStop:S,onNotifyHarnessUpdated:v}),x.jsx("div",{className:"harness-engineer-terminal",children:(l==null?void 0:l.status)==="running"?x.jsx(Lo,{sessionId:l.id,active:o},l.id):x.jsxs("div",{className:"terminal-empty",children:[x.jsx("strong",{children:"harness-engineer"}),x.jsx("span",{children:l!=null&&l.claudeSessionId?"Resume this project Harness Engineer session.":"Start this project Harness Engineer session."})]})})]})]})]})})}):null}function Ls({label:n,value:r}){return x.jsxs("div",{className:"harness-studio-metric",children:[x.jsx("span",{children:n}),x.jsx("strong",{children:r})]})}function za({title:n,files:r,selectedPath:s,copiedPath:o,onCopy:d,onSelect:g,collapsible:f=!1}){const l=x.jsx("ol",{className:"harness-studio-file-list",children:r.length?r.map(c=>x.jsxs("li",{className:c.path===s?"selected":void 0,children:[x.jsx("button",{className:"harness-studio-file-path-button",type:"button",title:c.path,onClick:()=>g(c.path),children:c.path}),x.jsx("button",{className:"harness-studio-file-copy-button",type:"button",title:`Copy ${c.path}`,onClick:()=>d(c.path),children:o===c.path?"Copied":"Copy"}),x.jsx(Bi,{status:c.action})]},c.path)):x.jsx("li",{children:x.jsx("span",{children:"No files."})})});return f?x.jsx(ph,{title:n,children:l}):x.jsxs("section",{className:"harness-studio-section",children:[x.jsx("h3",{children:n}),l]})}function ph({title:n,children:r}){return x.jsxs("details",{className:"harness-studio-section harness-studio-collapsible-section",children:[x.jsxs("summary",{children:[x.jsx("h3",{children:n}),x.jsx("span",{children:"Show"})]}),x.jsx("div",{className:"harness-studio-collapsible-content",children:r})]})}function Km(n){return n.kind==="agent-project-manager"||n.kind==="agent-architect"||n.kind==="agent-coder"||n.kind==="agent-reviewer"||n.kind==="agent-gate-reviewer"}function Ym(n){return n?n.status==="running"?`${n.status} / ${n.activityStatus??"idle"}`:n.status:"not started"}async function _1(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 v1({open:n,taskSlug:r,onClose:s}){var k;const[o,d]=ne.useState(null),[g,f]=ne.useState(null),[l,c]=ne.useState(null),[h,p]=ne.useState(null),[u,b]=ne.useState(null),[C,T]=ne.useState(!1),[E,S]=ne.useState(!1),[,v]=ji(null),[_,y]=ne.useState(null),A=ne.useMemo(()=>(o==null?void 0:o.files.find(M=>M.path===l))??(o==null?void 0:o.files[0])??null,[o,l]);async function L(M=g){var B;T(!0),v(null);try{if(!r)throw new Error("Create or select a task before reviewing harness commits.");const H=await ye.getRepositoryDiff(r,M);d(H),p(null),f(((B=H.commit)==null?void 0:B.sha)??null),c(U=>{var P;return U&&H.files.some(K=>K.path===U)?U:((P=H.files[0])==null?void 0:P.path)??null})}catch(H){v(pt(M?`Load commit diff ${M}`:"Load latest commit diff",H))}finally{T(!1)}}ne.useEffect(()=>{n&&(f(null),y(null),L(null))},[n,r]);async function D(M){b(M),v(null);try{if(!r)throw new Error("Create or select a task before reviewing file diffs.");const B=await ye.getRepositoryFileDiff(r,M);p(B),c(M)}catch(B){v(pt(`Load task file diff for ${M}`,B))}finally{b(null)}}async function R(){if(v(null),y(null),!r){v("Create or select a task before merging the task branch.");return}if(!o){v("Load the commit diff before merging the task branch.");return}const M=o.commits.length?o.commits.map(H=>`- ${H.shortSha} ${H.subject}`):["- No new commits found."];if(window.confirm([`Merge ${o.sourceBranch} into ${o.targetBranch}?`,"","VCM will run a fast-forward merge only.","The merge will fail if the task worktree or connected repository has uncommitted changes.","If the connected repository branch has diverged, rebase or merge manually first.","","Commits:",...M].join(`
|
|
61
|
-
`))){S(!0);try{const H=await ye.mergeRepositoryDiffToCurrentBranch(r);y(H.changed?`Merged ${H.sourceBranch} into ${H.targetBranch} at ${H.afterSha.slice(0,12)}.`:`${H.targetBranch} already includes ${H.sourceBranch}.`),f(null),await L(null)}catch(H){v(pt("Merge task branch to connected repository branch",H))}finally{S(!1)}}}return n?x.jsx("div",{className:"modal-backdrop repository-diff-backdrop",children:x.jsxs("section",{className:"repository-diff-modal",role:"dialog","aria-modal":"true","aria-label":"Commit Diff",children:[x.jsxs("header",{className:"repository-diff-header",children:[x.jsxs("div",{children:[x.jsx("h2",{children:"Commit Diff"}),x.jsx("p",{children:o?`${((k=o.commit)==null?void 0:k.shortSha)??"HEAD"} · ${o.summary.totalFiles} files · +${o.summary.additions} / -${o.summary.deletions}`:"Review a new commit on the active task worktree branch."})]}),x.jsxs("div",{className:"repository-diff-header-actions",children:[x.jsxs("label",{className:"repository-diff-commit-picker",children:[x.jsx("span",{children:"Commit"}),x.jsx("select",{value:g??"",disabled:C||!(o!=null&&o.commits.length),onChange:M=>{const B=M.target.value||null;f(B),L(B)},children:o==null?void 0:o.commits.map(M=>x.jsxs("option",{value:M.sha,children:[M.shortSha," · ",M.subject]},M.sha))})]}),x.jsx("button",{type:"button",disabled:C,onClick:()=>void L(),children:"Refresh"}),x.jsx("button",{type:"button",disabled:C||E||!r||!(o!=null&&o.commits.length),onClick:()=>void R(),children:E?"Merging...":"Merge to Main"}),x.jsx("button",{type:"button",onClick:s,children:"Close"})]})]}),_?x.jsx("p",{className:"success-banner",children:_}):null,o!=null&&o.warnings.length?x.jsx("ul",{className:"warnings repository-diff-warnings",children:o.warnings.map(M=>x.jsx("li",{children:M},M))}):null,x.jsxs("div",{className:"repository-diff-body",children:[x.jsxs("aside",{className:"repository-diff-sidebar",children:[x.jsx(y1,{report:o,busy:C}),x.jsxs("ol",{className:"repository-diff-file-list",children:[o==null?void 0:o.files.map(M=>x.jsx("li",{className:[(A==null?void 0:A.path)===M.path&&!h?"selected":"",(h==null?void 0:h.path)===M.path?"task-diff-selected":""].filter(Boolean).join(" "),children:x.jsxs("div",{className:"repository-diff-file-row",children:[x.jsxs("button",{className:"repository-diff-file-select",type:"button",onClick:()=>{p(null),c(M.path)},children:[x.jsx("span",{children:M.path}),x.jsxs("small",{children:[gh(M.status)," · ",Xm(M.stage)," · ",mh(M.category)]})]}),x.jsx("button",{className:"repository-diff-task-file-button",type:"button",disabled:u===M.path,title:"View this file diff across the whole task worktree",onClick:()=>void D(M.path),children:u===M.path?"...":"Task diff"})]})},M.path)),o&&o.files.length===0?x.jsx("li",{className:"repository-diff-empty",children:o.commits.length===0?"No new commits on this task branch.":"No files in this commit."}):null]})]}),x.jsx("main",{className:"repository-diff-main",children:h?x.jsx(S1,{diff:h,onClose:()=>p(null)}):A?x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"repository-diff-file-header",children:[x.jsxs("div",{children:[x.jsx("h3",{children:A.path}),x.jsxs("p",{children:[mh(A.category)," · ",gh(A.status)," · ",Xm(A.stage)]})]}),x.jsxs("span",{className:"repository-diff-stats",children:["+",A.additions," / -",A.deletions]})]}),A.binary?x.jsx("p",{className:"muted",children:"Binary or non-regular file. Text diff is not available."}):null,A.truncated?x.jsx("p",{className:"muted",children:"Diff was truncated for display."}):null,x.jsx("pre",{className:"repository-diff-code","aria-label":`${A.path} diff`,children:l_(A.diff)})]}):x.jsx("div",{className:"repository-diff-placeholder",children:C?"Loading commit diff...":"No diff selected."})})]})]})}):null}function y1({report:n,busy:r}){var o;const s=n==null?void 0:n.summary;return x.jsxs("div",{className:"repository-diff-summary",children:[x.jsx("strong",{children:r?"Loading":n?"Commit changes":"Not loaded"}),s?x.jsxs(x.Fragment,{children:[x.jsxs("span",{children:[s.harnessFiles," harness files"]}),x.jsxs("span",{children:[s.productCodeFiles," product code files"]}),x.jsxs("span",{children:[s.committedFiles," committed files"]}),x.jsxs("span",{children:[(n==null?void 0:n.commits.length)??0," branch commits"]}),x.jsx("span",{children:((o=n==null?void 0:n.commit)==null?void 0:o.subject)??"HEAD"})]}):null]})}function S1({diff:n,onClose:r}){const s=n.file;return x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"repository-diff-file-header",children:[x.jsxs("div",{children:[x.jsx("h3",{children:n.path}),x.jsxs("p",{children:["Task diff · ",n.targetBranch," ",n.baseSha.slice(0,12)," → ",n.sourceBranch," worktree ",n.headSha.slice(0,12)]})]}),x.jsxs("div",{className:"repository-diff-task-file-actions",children:[s?x.jsxs("span",{className:"repository-diff-stats",children:["+",s.additions," / -",s.deletions]}):null,x.jsx("button",{type:"button",onClick:r,children:"Commit diff"})]})]}),n.warnings.length>0?x.jsx("ul",{className:"warnings repository-diff-warnings",children:n.warnings.map(o=>x.jsx("li",{children:o},o))}):null,s?x.jsxs(x.Fragment,{children:[x.jsxs("p",{className:"muted",children:[mh(s.category)," · ",gh(s.status)," · whole task comparison"]}),s.binary?x.jsx("p",{className:"muted",children:"Binary or non-regular file. Text diff is not available."}):null,s.truncated?x.jsx("p",{className:"muted",children:"Diff was truncated for display."}):null,x.jsx("pre",{className:"repository-diff-code","aria-label":`${n.path} task diff`,children:l_(s.diff)})]}):x.jsx("div",{className:"repository-diff-placeholder",children:"No task-level diff for this file."})]})}function mh(n){switch(n){case"fixed_harness":return"fixed harness";case"tools_hooks":return"tools/hooks";case"generated_context":return"generated context";case"project_docs":return"project docs";case"product_code":return"product code"}}function Xm(n){return n.replaceAll("_"," ")}function gh(n){return n.replaceAll("_"," ")}function l_(n){return n.split(`
|
|
62
|
-
`).filter(r=>!C1(r)).map((r,s)=>x.jsx("span",{className:`repository-diff-line ${b1(r)}`,children:r||" "},`${s}:${r}`))}function b1(n){return n.startsWith("+")&&!n.startsWith("+++")?"repository-diff-line-added":n.startsWith("-")&&!n.startsWith("---")?"repository-diff-line-deleted":n.startsWith("@@")?"repository-diff-line-hunk":"repository-diff-line-context"}function C1(n){return n.startsWith("diff --git")||n.startsWith("index ")||n.startsWith("new file mode ")||n.startsWith("deleted file mode ")||n.startsWith("similarity index ")||n.startsWith("rename from ")||n.startsWith("rename to ")||n.startsWith("--- ")||n.startsWith("+++ ")}function w1({busy:n,effort:r,model:s,open:o,permissionMode:d,session:g,onClose:f,onEffortChange:l,onModelChange:c,onPermissionModeChange:h,onResume:p,onRestart:u,onStart:b,onStop:C,onNotifyHarnessUpdated:T}){return o?x.jsx("div",{className:"modal-backdrop translator-session-backdrop",children:x.jsxs("section",{className:"translator-session-modal",role:"dialog","aria-modal":"true","aria-label":"Translator Session",children:[x.jsxs("header",{className:"translator-session-header",children:[x.jsxs("div",{children:[x.jsx("h2",{children:"Translator Session"}),x.jsx("p",{children:x1(g)})]}),x.jsx("button",{type:"button",onClick:f,children:"Close"})]}),x.jsx(Lh,{role:"translator",session:g??void 0,permissionMode:d,model:s,effort:r,busy:n,onPermissionModeChange:h,onModelChange:c,onEffortChange:l,onStart:b,onResume:p,onRestart:u,onStop:C,onNotifyHarnessUpdated:T}),x.jsx("div",{className:"translator-session-terminal",children:(g==null?void 0:g.status)==="running"?x.jsx(Lo,{sessionId:g.id,active:o},g.id):x.jsxs("div",{className:"terminal-empty",children:[x.jsx("strong",{children:"translator"}),x.jsx("span",{children:g!=null&&g.claudeSessionId?"Resume this project translator session.":"Start the project translator session."})]})})]})}):null}function x1(n){if(!n)return"not started";const r=n.status==="running"?` · ${n.activityStatus??"idle"}`:"";return`${n.status}${r}`}function E1(n,r){const s={};return(n[n.length-1]===""?[...n,""]:n).join((s.padRight?" ":"")+","+(s.padLeft===!1?"":" ")).trim()}const k1=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,A1=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,T1={};function Qm(n,r){return(T1.jsx?A1:k1).test(n)}const R1=/[ \t\n\f\r]/g;function D1(n){return typeof n=="object"?n.type==="text"?Jm(n.value):!1:Jm(n)}function Jm(n){return n.replace(R1,"")===""}class Ja{constructor(r,s,o){this.normal=s,this.property=r,o&&(this.space=o)}}Ja.prototype.normal={};Ja.prototype.property={};Ja.prototype.space=void 0;function o_(n,r){const s={},o={};for(const d of n)Object.assign(s,d.property),Object.assign(o,d.normal);return new Ja(s,o,r)}function _h(n){return n.toLowerCase()}class vn{constructor(r,s){this.attribute=s,this.property=r}}vn.prototype.attribute="";vn.prototype.booleanish=!1;vn.prototype.boolean=!1;vn.prototype.commaOrSpaceSeparated=!1;vn.prototype.commaSeparated=!1;vn.prototype.defined=!1;vn.prototype.mustUseProperty=!1;vn.prototype.number=!1;vn.prototype.overloadedBoolean=!1;vn.prototype.property="";vn.prototype.spaceSeparated=!1;vn.prototype.space=void 0;let M1=0;const Ie=Pr(),Mt=Pr(),vh=Pr(),be=Pr(),ut=Pr(),Hs=Pr(),Mn=Pr();function Pr(){return 2**++M1}const yh=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ie,booleanish:Mt,commaOrSpaceSeparated:Mn,commaSeparated:Hs,number:be,overloadedBoolean:vh,spaceSeparated:ut},Symbol.toStringTag,{value:"Module"})),Vu=Object.keys(yh);class Oh extends vn{constructor(r,s,o,d){let g=-1;if(super(r,s),Zm(this,"space",d),typeof o=="number")for(;++g<Vu.length;){const f=Vu[g];Zm(this,Vu[g],(o&yh[f])===yh[f])}}}Oh.prototype.defined=!0;function Zm(n,r,s){s&&(n[r]=s)}function Ps(n){const r={},s={};for(const[o,d]of Object.entries(n.properties)){const g=new Oh(o,n.transform(n.attributes||{},o),d,n.space);n.mustUseProperty&&n.mustUseProperty.includes(o)&&(g.mustUseProperty=!0),r[o]=g,s[_h(o)]=o,s[_h(g.attribute)]=o}return new Ja(r,s,n.space)}const c_=Ps({properties:{ariaActiveDescendant:null,ariaAtomic:Mt,ariaAutoComplete:null,ariaBusy:Mt,ariaChecked:Mt,ariaColCount:be,ariaColIndex:be,ariaColSpan:be,ariaControls:ut,ariaCurrent:null,ariaDescribedBy:ut,ariaDetails:null,ariaDisabled:Mt,ariaDropEffect:ut,ariaErrorMessage:null,ariaExpanded:Mt,ariaFlowTo:ut,ariaGrabbed:Mt,ariaHasPopup:null,ariaHidden:Mt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ut,ariaLevel:be,ariaLive:null,ariaModal:Mt,ariaMultiLine:Mt,ariaMultiSelectable:Mt,ariaOrientation:null,ariaOwns:ut,ariaPlaceholder:null,ariaPosInSet:be,ariaPressed:Mt,ariaReadOnly:Mt,ariaRelevant:null,ariaRequired:Mt,ariaRoleDescription:ut,ariaRowCount:be,ariaRowIndex:be,ariaRowSpan:be,ariaSelected:Mt,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 u_(n,r){return r in n?n[r]:r}function h_(n,r){return u_(n,r.toLowerCase())}const L1=Ps({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Hs,acceptCharset:ut,accessKey:ut,action:null,allow:null,allowFullScreen:Ie,allowPaymentRequest:Ie,allowUserMedia:Ie,alt:null,as:null,async:Ie,autoCapitalize:null,autoComplete:ut,autoFocus:Ie,autoPlay:Ie,blocking:ut,capture:null,charSet:null,checked:Ie,cite:null,className:ut,cols:be,colSpan:null,content:null,contentEditable:Mt,controls:Ie,controlsList:ut,coords:be|Hs,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ie,defer:Ie,dir:null,dirName:null,disabled:Ie,download:vh,draggable:Mt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ie,formTarget:null,headers:ut,height:be,hidden:vh,high:be,href:null,hrefLang:null,htmlFor:ut,httpEquiv:ut,id:null,imageSizes:null,imageSrcSet:null,inert:Ie,inputMode:null,integrity:null,is:null,isMap:Ie,itemId:null,itemProp:ut,itemRef:ut,itemScope:Ie,itemType:ut,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ie,low:be,manifest:null,max:null,maxLength:be,media:null,method:null,min:null,minLength:be,multiple:Ie,muted:Ie,name:null,nonce:null,noModule:Ie,noValidate:Ie,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:Ie,optimum:be,pattern:null,ping:ut,placeholder:null,playsInline:Ie,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ie,referrerPolicy:null,rel:ut,required:Ie,reversed:Ie,rows:be,rowSpan:be,sandbox:ut,scope:null,scoped:Ie,seamless:Ie,selected:Ie,shadowRootClonable:Ie,shadowRootDelegatesFocus:Ie,shadowRootMode:null,shape:null,size:be,sizes:null,slot:null,span:be,spellCheck:Mt,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:Ie,useMap:null,value:Mt,width:be,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ut,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:Ie,declare:Ie,event:null,face:null,frame:null,frameBorder:null,hSpace:be,leftMargin:be,link:null,longDesc:null,lowSrc:null,marginHeight:be,marginWidth:be,noResize:Ie,noHref:Ie,noShade:Ie,noWrap:Ie,object:null,profile:null,prompt:null,rev:null,rightMargin:be,rules:null,scheme:null,scrolling:Mt,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:Ie,disableRemotePlayback:Ie,prefix:null,property:null,results:be,security:null,unselectable:null},space:"html",transform:h_}),O1=Ps({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:Mn,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:ut,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:Ie,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:Hs,g2:Hs,glyphName:Hs,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:Mn,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:ut,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:be,pointsAtY:be,pointsAtZ:be,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Mn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Mn,rev:Mn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Mn,requiredFeatures:Mn,requiredFonts:Mn,requiredFormats:Mn,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:Mn,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:Mn,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:Mn,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:u_}),f_=Ps({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()}}),d_=Ps({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:h_}),p_=Ps({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(n,r){return"xml:"+r.slice(3).toLowerCase()}}),B1={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"},j1=/[A-Z]/g,eg=/-[a-z]/g,N1=/^data[-\w.:]+$/i;function H1(n,r){const s=_h(r);let o=r,d=vn;if(s in n.normal)return n.property[n.normal[s]];if(s.length>4&&s.slice(0,4)==="data"&&N1.test(r)){if(r.charAt(4)==="-"){const g=r.slice(5).replace(eg,I1);o="data"+g.charAt(0).toUpperCase()+g.slice(1)}else{const g=r.slice(4);if(!eg.test(g)){let f=g.replace(j1,z1);f.charAt(0)!=="-"&&(f="-"+f),r="data"+f}}d=Oh}return new d(o,r)}function z1(n){return"-"+n.toLowerCase()}function I1(n){return n.charAt(1).toUpperCase()}const U1=o_([c_,L1,f_,d_,p_],"html"),Bh=o_([c_,O1,f_,d_,p_],"svg");function P1(n){return n.join(" ").trim()}var Os={},Wu,tg;function F1(){if(tg)return Wu;tg=1;var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,s=/^\s*/,o=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,d=/^:\s*/,g=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,f=/^[;\s]*/,l=/^\s+|\s+$/g,c=`
|
|
63
|
-
`,h="/",p="*",u="",b="comment",C="declaration";function T(S,v){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];v=v||{};var _=1,y=1;function A(K){var X=K.match(r);X&&(_+=X.length);var G=K.lastIndexOf(c);y=~G?K.length-G:y+K.length}function L(){var K={line:_,column:y};return function(X){return X.position=new D(K),M(),X}}function D(K){this.start=K,this.end={line:_,column:y},this.source=v.source}D.prototype.content=S;function R(K){var X=new Error(v.source+":"+_+":"+y+": "+K);if(X.reason=K,X.filename=v.source,X.line=_,X.column=y,X.source=S,!v.silent)throw X}function k(K){var X=K.exec(S);if(X){var G=X[0];return A(G),S=S.slice(G.length),X}}function M(){k(s)}function B(K){var X;for(K=K||[];X=H();)X!==!1&&K.push(X);return K}function H(){var K=L();if(!(h!=S.charAt(0)||p!=S.charAt(1))){for(var X=2;u!=S.charAt(X)&&(p!=S.charAt(X)||h!=S.charAt(X+1));)++X;if(X+=2,u===S.charAt(X-1))return R("End of comment missing");var G=S.slice(2,X-2);return y+=2,A(G),S=S.slice(X),y+=2,K({type:b,comment:G})}}function U(){var K=L(),X=k(o);if(X){if(H(),!k(d))return R("property missing ':'");var G=k(g),W=K({type:C,property:E(X[0].replace(n,u)),value:G?E(G[0].replace(n,u)):u});return k(f),W}}function P(){var K=[];B(K);for(var X;X=U();)X!==!1&&(K.push(X),B(K));return K}return M(),P()}function E(S){return S?S.replace(l,u):u}return Wu=T,Wu}var ng;function q1(){if(ng)return Os;ng=1;var n=Os&&Os.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(Os,"__esModule",{value:!0}),Os.default=s;const r=n(F1());function s(o,d){let g=null;if(!o||typeof o!="string")return g;const f=(0,r.default)(o),l=typeof d=="function";return f.forEach(c=>{if(c.type!=="declaration")return;const{property:h,value:p}=c;l?d(h,p,c):p&&(g=g||{},g[h]=p)}),g}return Os}var Ia={},ig;function $1(){if(ig)return Ia;ig=1,Object.defineProperty(Ia,"__esModule",{value:!0}),Ia.camelCase=void 0;var n=/^--[a-zA-Z0-9_-]+$/,r=/-([a-z])/g,s=/^[^-]+$/,o=/^-(webkit|moz|ms|o|khtml)-/,d=/^-(ms)-/,g=function(h){return!h||s.test(h)||n.test(h)},f=function(h,p){return p.toUpperCase()},l=function(h,p){return"".concat(p,"-")},c=function(h,p){return p===void 0&&(p={}),g(h)?h:(h=h.toLowerCase(),p.reactCompat?h=h.replace(d,l):h=h.replace(o,l),h.replace(r,f))};return Ia.camelCase=c,Ia}var Ua,rg;function G1(){if(rg)return Ua;rg=1;var n=Ua&&Ua.__importDefault||function(d){return d&&d.__esModule?d:{default:d}},r=n(q1()),s=$1();function o(d,g){var f={};return!d||typeof d!="string"||(0,r.default)(d,function(l,c){l&&c&&(f[(0,s.camelCase)(l,g)]=c)}),f}return o.default=o,Ua=o,Ua}var V1=G1();const W1=Jg(V1),m_=g_("end"),jh=g_("start");function g_(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 K1(n){const r=jh(n),s=m_(n);if(r&&s)return{start:r,end:s}}function $a(n){return!n||typeof n!="object"?"":"position"in n||"type"in n?sg(n.position):"start"in n||"end"in n?sg(n):"line"in n||"column"in n?Sh(n):""}function Sh(n){return ag(n&&n.line)+":"+ag(n&&n.column)}function sg(n){return Sh(n&&n.start)+"-"+Sh(n&&n.end)}function ag(n){return n&&typeof n=="number"?n:1}class Zt extends Error{constructor(r,s,o){super(),typeof s=="string"&&(o=s,s=void 0);let d="",g={},f=!1;if(s&&("line"in s&&"column"in s?g={place:s}:"start"in s&&"end"in s?g={place:s}:"type"in s?g={ancestors:[s],place:s.position}:g={...s}),typeof r=="string"?d=r:!g.cause&&r&&(f=!0,d=r.message,g.cause=r),!g.ruleId&&!g.source&&typeof o=="string"){const c=o.indexOf(":");c===-1?g.ruleId=o:(g.source=o.slice(0,c),g.ruleId=o.slice(c+1))}if(!g.place&&g.ancestors&&g.ancestors){const c=g.ancestors[g.ancestors.length-1];c&&(g.place=c.position)}const l=g.place&&"start"in g.place?g.place.start:g.place;this.ancestors=g.ancestors||void 0,this.cause=g.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=d,this.line=l?l.line:void 0,this.name=$a(g.place)||"1:1",this.place=g.place||void 0,this.reason=this.message,this.ruleId=g.ruleId||void 0,this.source=g.source||void 0,this.stack=f&&g.cause&&typeof g.cause.stack=="string"?g.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Zt.prototype.file="";Zt.prototype.name="";Zt.prototype.reason="";Zt.prototype.message="";Zt.prototype.stack="";Zt.prototype.column=void 0;Zt.prototype.line=void 0;Zt.prototype.ancestors=void 0;Zt.prototype.cause=void 0;Zt.prototype.fatal=void 0;Zt.prototype.place=void 0;Zt.prototype.ruleId=void 0;Zt.prototype.source=void 0;const Nh={}.hasOwnProperty,Y1=new Map,X1=/[A-Z]/g,Q1=new Set(["table","tbody","thead","tfoot","tr"]),J1=new Set(["td","th"]),__="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Z1(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=lS(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=aS(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"?Bh:U1,stylePropertyNameCase:r.stylePropertyNameCase||"dom",tableCellAlignToStyle:r.tableCellAlignToStyle!==!1},g=v_(d,n,void 0);return g&&typeof g!="string"?g:d.create(n,d.Fragment,{children:g||void 0},void 0)}function v_(n,r,s){if(r.type==="element")return eS(n,r,s);if(r.type==="mdxFlowExpression"||r.type==="mdxTextExpression")return tS(n,r);if(r.type==="mdxJsxFlowElement"||r.type==="mdxJsxTextElement")return iS(n,r,s);if(r.type==="mdxjsEsm")return nS(n,r);if(r.type==="root")return rS(n,r,s);if(r.type==="text")return sS(n,r)}function eS(n,r,s){const o=n.schema;let d=o;r.tagName.toLowerCase()==="svg"&&o.space==="html"&&(d=Bh,n.schema=d),n.ancestors.push(r);const g=S_(n,r.tagName,!1),f=oS(n,r);let l=zh(n,r);return Q1.has(r.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!D1(c):!0})),y_(n,f,g,r),Hh(f,l),n.ancestors.pop(),n.schema=o,n.create(r,g,f,s)}function tS(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)}Ya(n,r.position)}function nS(n,r){if(r.data&&r.data.estree&&n.evaluater)return n.evaluater.evaluateProgram(r.data.estree);Ya(n,r.position)}function iS(n,r,s){const o=n.schema;let d=o;r.name==="svg"&&o.space==="html"&&(d=Bh,n.schema=d),n.ancestors.push(r);const g=r.name===null?n.Fragment:S_(n,r.name,!0),f=cS(n,r),l=zh(n,r);return y_(n,f,g,r),Hh(f,l),n.ancestors.pop(),n.schema=o,n.create(r,g,f,s)}function rS(n,r,s){const o={};return Hh(o,zh(n,r)),n.create(r,n.Fragment,o,s)}function sS(n,r){return r.value}function y_(n,r,s,o){typeof s!="string"&&s!==n.Fragment&&n.passNode&&(r.node=o)}function Hh(n,r){if(r.length>0){const s=r.length>1?r:r[0];s&&(n.children=s)}}function aS(n,r,s){return o;function o(d,g,f,l){const h=Array.isArray(f.children)?s:r;return l?h(g,f,l):h(g,f)}}function lS(n,r){return s;function s(o,d,g,f){const l=Array.isArray(g.children),c=jh(o);return r(d,g,f,l,{columnNumber:c?c.column-1:void 0,fileName:n,lineNumber:c?c.line:void 0},void 0)}}function oS(n,r){const s={};let o,d;for(d in r.properties)if(d!=="children"&&Nh.call(r.properties,d)){const g=uS(n,d,r.properties[d]);if(g){const[f,l]=g;n.tableCellAlignToStyle&&f==="align"&&typeof l=="string"&&J1.has(r.tagName)?o=l:s[f]=l}}if(o){const g=s.style||(s.style={});g[n.stylePropertyNameCase==="css"?"text-align":"textAlign"]=o}return s}function cS(n,r){const s={};for(const o of r.attributes)if(o.type==="mdxJsxExpressionAttribute")if(o.data&&o.data.estree&&n.evaluater){const g=o.data.estree.body[0];g.type;const f=g.expression;f.type;const l=f.properties[0];l.type,Object.assign(s,n.evaluater.evaluateExpression(l.argument))}else Ya(n,r.position);else{const d=o.name;let g;if(o.value&&typeof o.value=="object")if(o.value.data&&o.value.data.estree&&n.evaluater){const l=o.value.data.estree.body[0];l.type,g=n.evaluater.evaluateExpression(l.expression)}else Ya(n,r.position);else g=o.value===null?!0:o.value;s[d]=g}return s}function zh(n,r){const s=[];let o=-1;const d=n.passKeys?new Map:Y1;for(;++o<r.children.length;){const g=r.children[o];let f;if(n.passKeys){const c=g.type==="element"?g.tagName:g.type==="mdxJsxFlowElement"||g.type==="mdxJsxTextElement"?g.name:void 0;if(c){const h=d.get(c)||0;f=c+"-"+h,d.set(c,h+1)}}const l=v_(n,g,f);l!==void 0&&s.push(l)}return s}function uS(n,r,s){const o=H1(n.schema,r);if(!(s==null||typeof s=="number"&&Number.isNaN(s))){if(Array.isArray(s)&&(s=o.commaSeparated?E1(s):P1(s)),o.property==="style"){let d=typeof s=="object"?s:hS(n,String(s));return n.stylePropertyNameCase==="css"&&(d=fS(d)),["style",d]}return[n.elementAttributeNameCase==="react"&&o.space?B1[o.property]||o.property:o.attribute,s]}}function hS(n,r){try{return W1(r,{reactCompat:!0})}catch(s){if(n.ignoreInvalidStyle)return{};const o=s,d=new Zt("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=__+"#cannot-parse-style-attribute",d}}function S_(n,r,s){let o;if(!s)o={type:"Literal",value:r};else if(r.includes(".")){const d=r.split(".");let g=-1,f;for(;++g<d.length;){const l=Qm(d[g])?{type:"Identifier",name:d[g]}:{type:"Literal",value:d[g]};f=f?{type:"MemberExpression",object:f,property:l,computed:!!(g&&l.type==="Literal"),optional:!1}:l}o=f}else o=Qm(r)&&!/^[a-z]/.test(r)?{type:"Identifier",name:r}:{type:"Literal",value:r};if(o.type==="Literal"){const d=o.value;return Nh.call(n.components,d)?n.components[d]:d}if(n.evaluater)return n.evaluater.evaluateExpression(o);Ya(n)}function Ya(n,r){const s=new Zt("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=__+"#cannot-handle-mdx-estrees-without-createevaluater",s}function fS(n){const r={};let s;for(s in n)Nh.call(n,s)&&(r[dS(s)]=n[s]);return r}function dS(n){let r=n.replace(X1,pS);return r.slice(0,3)==="ms-"&&(r="-"+r),r}function pS(n){return"-"+n.toLowerCase()}const Ku={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"]},mS={};function Ih(n,r){const s=mS,o=typeof s.includeImageAlt=="boolean"?s.includeImageAlt:!0,d=typeof s.includeHtml=="boolean"?s.includeHtml:!0;return b_(n,o,d)}function b_(n,r,s){if(gS(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 lg(n.children,r,s)}return Array.isArray(n)?lg(n,r,s):""}function lg(n,r,s){const o=[];let d=-1;for(;++d<n.length;)o[d]=b_(n[d],r,s);return o.join("")}function gS(n){return!!(n&&typeof n=="object")}const og=document.createElement("i");function Uh(n){const r="&"+n+";";og.innerHTML=r;const s=og.textContent;return s.charCodeAt(s.length-1)===59&&n!=="semi"||s===r?!1:s}function Ln(n,r,s,o){const d=n.length;let g=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);g<o.length;)f=o.slice(g,g+1e4),f.unshift(r,0),n.splice(...f),g+=1e4,r+=1e4}function Gn(n,r){return n.length>0?(Ln(n,n.length,0,r),n):r}const cg={}.hasOwnProperty;function C_(n){const r={};let s=-1;for(;++s<n.length;)_S(r,n[s]);return r}function _S(n,r){let s;for(s in r){const d=(cg.call(n,s)?n[s]:void 0)||(n[s]={}),g=r[s];let f;if(g)for(f in g){cg.call(d,f)||(d[f]=[]);const l=g[f];vS(d[f],Array.isArray(l)?l:l?[l]:[])}}}function vS(n,r){let s=-1;const o=[];for(;++s<r.length;)(r[s].add==="after"?n:o).push(r[s]);Ln(n,0,0,o)}function w_(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 ii(n){return n.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const rn=mr(/[A-Za-z]/),Jt=mr(/[\dA-Za-z]/),yS=mr(/[#-'*+\--9=?A-Z^-~]/);function xo(n){return n!==null&&(n<32||n===127)}const bh=mr(/\d/),SS=mr(/[\dA-Fa-f]/),bS=mr(/[!-/:-@[-`{-~]/);function Me(n){return n!==null&&n<-2}function ot(n){return n!==null&&(n<0||n===32)}function $e(n){return n===-2||n===-1||n===32}const Oo=mr(new RegExp("\\p{P}|\\p{S}","u")),Ir=mr(/\s/);function mr(n){return r;function r(s){return s!==null&&s>-1&&n.test(String.fromCharCode(s))}}function Fs(n){const r=[];let s=-1,o=0,d=0;for(;++s<n.length;){const g=n.charCodeAt(s);let f="";if(g===37&&Jt(n.charCodeAt(s+1))&&Jt(n.charCodeAt(s+2)))d=2;else if(g<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(g))||(f=String.fromCharCode(g));else if(g>55295&&g<57344){const l=n.charCodeAt(s+1);g<56320&&l>56319&&l<57344?(f=String.fromCharCode(g,l),d=1):f="�"}else f=String.fromCharCode(g);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 Ye(n,r,s,o){const d=o?o-1:Number.POSITIVE_INFINITY;let g=0;return f;function f(c){return $e(c)?(n.enter(s),l(c)):r(c)}function l(c){return $e(c)&&g++<d?(n.consume(c),l):(n.exit(s),r(c))}}const CS={tokenize:wS};function wS(n){const r=n.attempt(this.parser.constructs.contentInitial,o,d);let s;return r;function o(l){if(l===null){n.consume(l);return}return n.enter("lineEnding"),n.consume(l),n.exit("lineEnding"),Ye(n,r,"linePrefix")}function d(l){return n.enter("paragraph"),g(l)}function g(l){const c=n.enter("chunkText",{contentType:"text",previous:s});return s&&(s.next=c),s=c,f(l)}function f(l){if(l===null){n.exit("chunkText"),n.exit("paragraph"),n.consume(l);return}return Me(l)?(n.consume(l),n.exit("chunkText"),g):(n.consume(l),f)}}const xS={tokenize:ES},ug={tokenize:kS};function ES(n){const r=this,s=[];let o=0,d,g,f;return l;function l(y){if(o<s.length){const A=s[o];return r.containerState=A[1],n.attempt(A[0].continuation,c,h)(y)}return h(y)}function c(y){if(o++,r.containerState._closeFlow){r.containerState._closeFlow=void 0,d&&_();const A=r.events.length;let L=A,D;for(;L--;)if(r.events[L][0]==="exit"&&r.events[L][1].type==="chunkFlow"){D=r.events[L][1].end;break}v(o);let R=A;for(;R<r.events.length;)r.events[R][1].end={...D},R++;return Ln(r.events,L+1,0,r.events.slice(A)),r.events.length=R,h(y)}return l(y)}function h(y){if(o===s.length){if(!d)return b(y);if(d.currentConstruct&&d.currentConstruct.concrete)return T(y);r.interrupt=!!(d.currentConstruct&&!d._gfmTableDynamicInterruptHack)}return r.containerState={},n.check(ug,p,u)(y)}function p(y){return d&&_(),v(o),b(y)}function u(y){return r.parser.lazy[r.now().line]=o!==s.length,f=r.now().offset,T(y)}function b(y){return r.containerState={},n.attempt(ug,C,T)(y)}function C(y){return o++,s.push([r.currentConstruct,r.containerState]),b(y)}function T(y){if(y===null){d&&_(),v(0),n.consume(y);return}return d=d||r.parser.flow(r.now()),n.enter("chunkFlow",{_tokenizer:d,contentType:"flow",previous:g}),E(y)}function E(y){if(y===null){S(n.exit("chunkFlow"),!0),v(0),n.consume(y);return}return Me(y)?(n.consume(y),S(n.exit("chunkFlow")),o=0,r.interrupt=void 0,l):(n.consume(y),E)}function S(y,A){const L=r.sliceStream(y);if(A&&L.push(null),y.previous=g,g&&(g.next=y),g=y,d.defineSkip(y.start),d.write(L),r.parser.lazy[y.start.line]){let D=d.events.length;for(;D--;)if(d.events[D][1].start.offset<f&&(!d.events[D][1].end||d.events[D][1].end.offset>f))return;const R=r.events.length;let k=R,M,B;for(;k--;)if(r.events[k][0]==="exit"&&r.events[k][1].type==="chunkFlow"){if(M){B=r.events[k][1].end;break}M=!0}for(v(o),D=R;D<r.events.length;)r.events[D][1].end={...B},D++;Ln(r.events,k+1,0,r.events.slice(R)),r.events.length=D}}function v(y){let A=s.length;for(;A-- >y;){const L=s[A];r.containerState=L[1],L[0].exit.call(r,n)}s.length=y}function _(){d.write([null]),g=void 0,d=void 0,r.containerState._closeFlow=void 0}}function kS(n,r,s){return Ye(n,n.attempt(this.parser.constructs.document,r,s),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Is(n){if(n===null||ot(n)||Ir(n))return 1;if(Oo(n))return 2}function Bo(n,r,s){const o=[];let d=-1;for(;++d<n.length;){const g=n[d].resolveAll;g&&!o.includes(g)&&(r=g(r,s),o.push(g))}return r}const Ch={name:"attention",resolveAll:AS,tokenize:TS};function AS(n,r){let s=-1,o,d,g,f,l,c,h,p;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},b={...n[s][1].start};hg(u,-c),hg(b,c),f={type:c>1?"strongSequence":"emphasisSequence",start:u,end:{...n[o][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...n[s][1].start},end:b},g={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:{...l.end}},n[o][1].end={...f.start},n[s][1].start={...l.end},h=[],n[o][1].end.offset-n[o][1].start.offset&&(h=Gn(h,[["enter",n[o][1],r],["exit",n[o][1],r]])),h=Gn(h,[["enter",d,r],["enter",f,r],["exit",f,r],["enter",g,r]]),h=Gn(h,Bo(r.parser.constructs.insideSpan.null,n.slice(o+1,s),r)),h=Gn(h,[["exit",g,r],["enter",l,r],["exit",l,r],["exit",d,r]]),n[s][1].end.offset-n[s][1].start.offset?(p=2,h=Gn(h,[["enter",n[s][1],r],["exit",n[s][1],r]])):p=0,Ln(n,o-1,s-o+3,h),s=o+h.length-p-2;break}}for(s=-1;++s<n.length;)n[s][1].type==="attentionSequence"&&(n[s][1].type="data");return n}function TS(n,r){const s=this.parser.constructs.attentionMarkers.null,o=this.previous,d=Is(o);let g;return f;function f(c){return g=c,n.enter("attentionSequence"),l(c)}function l(c){if(c===g)return n.consume(c),l;const h=n.exit("attentionSequence"),p=Is(c),u=!p||p===2&&d||s.includes(c),b=!d||d===2&&p||s.includes(o);return h._open=!!(g===42?u:u&&(d||!b)),h._close=!!(g===42?b:b&&(p||!u)),r(c)}}function hg(n,r){n.column+=r,n.offset+=r,n._bufferIndex+=r}const RS={name:"autolink",tokenize:DS};function DS(n,r,s){let o=0;return d;function d(C){return n.enter("autolink"),n.enter("autolinkMarker"),n.consume(C),n.exit("autolinkMarker"),n.enter("autolinkProtocol"),g}function g(C){return rn(C)?(n.consume(C),f):C===64?s(C):h(C)}function f(C){return C===43||C===45||C===46||Jt(C)?(o=1,l(C)):h(C)}function l(C){return C===58?(n.consume(C),o=0,c):(C===43||C===45||C===46||Jt(C))&&o++<32?(n.consume(C),l):(o=0,h(C))}function c(C){return C===62?(n.exit("autolinkProtocol"),n.enter("autolinkMarker"),n.consume(C),n.exit("autolinkMarker"),n.exit("autolink"),r):C===null||C===32||C===60||xo(C)?s(C):(n.consume(C),c)}function h(C){return C===64?(n.consume(C),p):yS(C)?(n.consume(C),h):s(C)}function p(C){return Jt(C)?u(C):s(C)}function u(C){return C===46?(n.consume(C),o=0,p):C===62?(n.exit("autolinkProtocol").type="autolinkEmail",n.enter("autolinkMarker"),n.consume(C),n.exit("autolinkMarker"),n.exit("autolink"),r):b(C)}function b(C){if((C===45||Jt(C))&&o++<63){const T=C===45?b:u;return n.consume(C),T}return s(C)}}const Za={partial:!0,tokenize:MS};function MS(n,r,s){return o;function o(g){return $e(g)?Ye(n,d,"linePrefix")(g):d(g)}function d(g){return g===null||Me(g)?r(g):s(g)}}const x_={continuation:{tokenize:OS},exit:BS,name:"blockQuote",tokenize:LS};function LS(n,r,s){const o=this;return d;function d(f){if(f===62){const l=o.containerState;return l.open||(n.enter("blockQuote",{_container:!0}),l.open=!0),n.enter("blockQuotePrefix"),n.enter("blockQuoteMarker"),n.consume(f),n.exit("blockQuoteMarker"),g}return s(f)}function g(f){return $e(f)?(n.enter("blockQuotePrefixWhitespace"),n.consume(f),n.exit("blockQuotePrefixWhitespace"),n.exit("blockQuotePrefix"),r):(n.exit("blockQuotePrefix"),r(f))}}function OS(n,r,s){const o=this;return d;function d(f){return $e(f)?Ye(n,g,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f):g(f)}function g(f){return n.attempt(x_,r,s)(f)}}function BS(n){n.exit("blockQuote")}const E_={name:"characterEscape",tokenize:jS};function jS(n,r,s){return o;function o(g){return n.enter("characterEscape"),n.enter("escapeMarker"),n.consume(g),n.exit("escapeMarker"),d}function d(g){return bS(g)?(n.enter("characterEscapeValue"),n.consume(g),n.exit("characterEscapeValue"),n.exit("characterEscape"),r):s(g)}}const k_={name:"characterReference",tokenize:NS};function NS(n,r,s){const o=this;let d=0,g,f;return l;function l(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"),g=31,f=Jt,p(u))}function h(u){return u===88||u===120?(n.enter("characterReferenceMarkerHexadecimal"),n.consume(u),n.exit("characterReferenceMarkerHexadecimal"),n.enter("characterReferenceValue"),g=6,f=SS,p):(n.enter("characterReferenceValue"),g=7,f=bh,p(u))}function p(u){if(u===59&&d){const b=n.exit("characterReferenceValue");return f===Jt&&!Uh(o.sliceSerialize(b))?s(u):(n.enter("characterReferenceMarker"),n.consume(u),n.exit("characterReferenceMarker"),n.exit("characterReference"),r)}return f(u)&&d++<g?(n.consume(u),p):s(u)}}const fg={partial:!0,tokenize:zS},dg={concrete:!0,name:"codeFenced",tokenize:HS};function HS(n,r,s){const o=this,d={partial:!0,tokenize:L};let g=0,f=0,l;return c;function c(D){return h(D)}function h(D){const R=o.events[o.events.length-1];return g=R&&R[1].type==="linePrefix"?R[2].sliceSerialize(R[1],!0).length:0,l=D,n.enter("codeFenced"),n.enter("codeFencedFence"),n.enter("codeFencedFenceSequence"),p(D)}function p(D){return D===l?(f++,n.consume(D),p):f<3?s(D):(n.exit("codeFencedFenceSequence"),$e(D)?Ye(n,u,"whitespace")(D):u(D))}function u(D){return D===null||Me(D)?(n.exit("codeFencedFence"),o.interrupt?r(D):n.check(fg,E,A)(D)):(n.enter("codeFencedFenceInfo"),n.enter("chunkString",{contentType:"string"}),b(D))}function b(D){return D===null||Me(D)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),u(D)):$e(D)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),Ye(n,C,"whitespace")(D)):D===96&&D===l?s(D):(n.consume(D),b)}function C(D){return D===null||Me(D)?u(D):(n.enter("codeFencedFenceMeta"),n.enter("chunkString",{contentType:"string"}),T(D))}function T(D){return D===null||Me(D)?(n.exit("chunkString"),n.exit("codeFencedFenceMeta"),u(D)):D===96&&D===l?s(D):(n.consume(D),T)}function E(D){return n.attempt(d,A,S)(D)}function S(D){return n.enter("lineEnding"),n.consume(D),n.exit("lineEnding"),v}function v(D){return g>0&&$e(D)?Ye(n,_,"linePrefix",g+1)(D):_(D)}function _(D){return D===null||Me(D)?n.check(fg,E,A)(D):(n.enter("codeFlowValue"),y(D))}function y(D){return D===null||Me(D)?(n.exit("codeFlowValue"),_(D)):(n.consume(D),y)}function A(D){return n.exit("codeFenced"),r(D)}function L(D,R,k){let M=0;return B;function B(X){return D.enter("lineEnding"),D.consume(X),D.exit("lineEnding"),H}function H(X){return D.enter("codeFencedFence"),$e(X)?Ye(D,U,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(X):U(X)}function U(X){return X===l?(D.enter("codeFencedFenceSequence"),P(X)):k(X)}function P(X){return X===l?(M++,D.consume(X),P):M>=f?(D.exit("codeFencedFenceSequence"),$e(X)?Ye(D,K,"whitespace")(X):K(X)):k(X)}function K(X){return X===null||Me(X)?(D.exit("codeFencedFence"),R(X)):k(X)}}}function zS(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"),g)}function g(f){return o.parser.lazy[o.now().line]?s(f):r(f)}}const Yu={name:"codeIndented",tokenize:US},IS={partial:!0,tokenize:PS};function US(n,r,s){const o=this;return d;function d(h){return n.enter("codeIndented"),Ye(n,g,"linePrefix",5)(h)}function g(h){const p=o.events[o.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?f(h):s(h)}function f(h){return h===null?c(h):Me(h)?n.attempt(IS,f,c)(h):(n.enter("codeFlowValue"),l(h))}function l(h){return h===null||Me(h)?(n.exit("codeFlowValue"),f(h)):(n.consume(h),l)}function c(h){return n.exit("codeIndented"),r(h)}}function PS(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):Ye(n,g,"linePrefix",5)(f)}function g(f){const l=o.events[o.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?r(f):Me(f)?d(f):s(f)}}const FS={name:"codeText",previous:$S,resolve:qS,tokenize:GS};function qS(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 $S(n){return n!==96||this.events[this.events.length-1][1].type==="characterEscape"}function GS(n,r,s){let o=0,d,g;return f;function f(u){return n.enter("codeText"),n.enter("codeTextSequence"),l(u)}function l(u){return u===96?(n.consume(u),o++,l):(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?(g=n.enter("codeTextSequence"),d=0,p(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 p(u){return u===96?(n.consume(u),d++,p):d===o?(n.exit("codeTextSequence"),n.exit("codeText"),r(u)):(g.type="codeTextData",h(u))}}class VS{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 g=this.right.splice(this.right.length-d,Number.POSITIVE_INFINITY);return o&&Pa(this.left,o),g.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),Pa(this.left,r)}unshift(r){this.setCursor(0),this.right.push(r)}unshiftMany(r){this.setCursor(0),Pa(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);Pa(this.right,s.reverse())}else{const s=this.right.splice(this.left.length+this.right.length-r,Number.POSITIVE_INFINITY);Pa(this.left,s.reverse())}}}function Pa(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 A_(n){const r={};let s=-1,o,d,g,f,l,c,h;const p=new VS(n);for(;++s<p.length;){for(;s in r;)s=r[s];if(o=p.get(s),s&&o[1].type==="chunkFlow"&&p.get(s-1)[1].type==="listItemPrefix"&&(c=o[1]._tokenizer.events,g=0,g<c.length&&c[g][1].type==="lineEndingBlank"&&(g+=2),g<c.length&&c[g][1].type==="content"))for(;++g<c.length&&c[g][1].type!=="content";)c[g][1].type==="chunkText"&&(c[g][1]._isInFirstContentOfListItem=!0,g++);if(o[0]==="enter")o[1].contentType&&(Object.assign(r,WS(p,s)),s=r[s],h=!0);else if(o[1]._container){for(g=s,d=void 0;g--;)if(f=p.get(g),f[1].type==="lineEnding"||f[1].type==="lineEndingBlank")f[0]==="enter"&&(d&&(p.get(d)[1].type="lineEndingBlank"),f[1].type="lineEnding",d=g);else if(!(f[1].type==="linePrefix"||f[1].type==="listItemIndent"))break;d&&(o[1].end={...p.get(d)[1].start},l=p.slice(d,s),l.unshift(o),p.splice(d,s-d+1,l))}}return Ln(n,0,Number.POSITIVE_INFINITY,p.slice(0)),!h}function WS(n,r){const s=n.get(r)[1],o=n.get(r)[2];let d=r-1;const g=[];let f=s._tokenizer;f||(f=o.parser[s.contentType](s.start),s._contentTypeTextTrailing&&(f._contentTypeTextTrailing=!0));const l=f.events,c=[],h={};let p,u,b=-1,C=s,T=0,E=0;const S=[E];for(;C;){for(;n.get(++d)[1]!==C;);g.push(d),C._tokenizer||(p=o.sliceStream(C),C.next||p.push(null),u&&f.defineSkip(C.start),C._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=!0),f.write(p),C._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=void 0)),u=C,C=C.next}for(C=s;++b<l.length;)l[b][0]==="exit"&&l[b-1][0]==="enter"&&l[b][1].type===l[b-1][1].type&&l[b][1].start.line!==l[b][1].end.line&&(E=b+1,S.push(E),C._tokenizer=void 0,C.previous=void 0,C=C.next);for(f.events=[],C?(C._tokenizer=void 0,C.previous=void 0):S.pop(),b=S.length;b--;){const v=l.slice(S[b],S[b+1]),_=g.pop();c.push([_,_+v.length-1]),n.splice(_,2,v)}for(c.reverse(),b=-1;++b<c.length;)h[T+c[b][0]]=T+c[b][1],T+=c[b][1]-c[b][0]-1;return h}const KS={resolve:XS,tokenize:QS},YS={partial:!0,tokenize:JS};function XS(n){return A_(n),n}function QS(n,r){let s;return o;function o(l){return n.enter("content"),s=n.enter("chunkContent",{contentType:"content"}),d(l)}function d(l){return l===null?g(l):Me(l)?n.check(YS,f,g)(l):(n.consume(l),d)}function g(l){return n.exit("chunkContent"),n.exit("content"),r(l)}function f(l){return n.consume(l),n.exit("chunkContent"),s.next=n.enter("chunkContent",{contentType:"content",previous:s}),s=s.next,d}}function JS(n,r,s){const o=this;return d;function d(f){return n.exit("chunkContent"),n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),Ye(n,g,"linePrefix")}function g(f){if(f===null||Me(f))return s(f);const l=o.events[o.events.length-1];return!o.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?r(f):n.interrupt(o.parser.constructs.flow,s,r)(f)}}function T_(n,r,s,o,d,g,f,l,c){const h=c||Number.POSITIVE_INFINITY;let p=0;return u;function u(v){return v===60?(n.enter(o),n.enter(d),n.enter(g),n.consume(v),n.exit(g),b):v===null||v===32||v===41||xo(v)?s(v):(n.enter(o),n.enter(f),n.enter(l),n.enter("chunkString",{contentType:"string"}),E(v))}function b(v){return v===62?(n.enter(g),n.consume(v),n.exit(g),n.exit(d),n.exit(o),r):(n.enter(l),n.enter("chunkString",{contentType:"string"}),C(v))}function C(v){return v===62?(n.exit("chunkString"),n.exit(l),b(v)):v===null||v===60||Me(v)?s(v):(n.consume(v),v===92?T:C)}function T(v){return v===60||v===62||v===92?(n.consume(v),C):C(v)}function E(v){return!p&&(v===null||v===41||ot(v))?(n.exit("chunkString"),n.exit(l),n.exit(f),n.exit(o),r(v)):p<h&&v===40?(n.consume(v),p++,E):v===41?(n.consume(v),p--,E):v===null||v===32||v===40||xo(v)?s(v):(n.consume(v),v===92?S:E)}function S(v){return v===40||v===41||v===92?(n.consume(v),E):E(v)}}function R_(n,r,s,o,d,g){const f=this;let l=0,c;return h;function h(C){return n.enter(o),n.enter(d),n.consume(C),n.exit(d),n.enter(g),p}function p(C){return l>999||C===null||C===91||C===93&&!c||C===94&&!l&&"_hiddenFootnoteSupport"in f.parser.constructs?s(C):C===93?(n.exit(g),n.enter(d),n.consume(C),n.exit(d),n.exit(o),r):Me(C)?(n.enter("lineEnding"),n.consume(C),n.exit("lineEnding"),p):(n.enter("chunkString",{contentType:"string"}),u(C))}function u(C){return C===null||C===91||C===93||Me(C)||l++>999?(n.exit("chunkString"),p(C)):(n.consume(C),c||(c=!$e(C)),C===92?b:u)}function b(C){return C===91||C===92||C===93?(n.consume(C),l++,u):u(C)}}function D_(n,r,s,o,d,g){let f;return l;function l(b){return b===34||b===39||b===40?(n.enter(o),n.enter(d),n.consume(b),n.exit(d),f=b===40?41:b,c):s(b)}function c(b){return b===f?(n.enter(d),n.consume(b),n.exit(d),n.exit(o),r):(n.enter(g),h(b))}function h(b){return b===f?(n.exit(g),c(f)):b===null?s(b):Me(b)?(n.enter("lineEnding"),n.consume(b),n.exit("lineEnding"),Ye(n,h,"linePrefix")):(n.enter("chunkString",{contentType:"string"}),p(b))}function p(b){return b===f||b===null||Me(b)?(n.exit("chunkString"),h(b)):(n.consume(b),b===92?u:p)}function u(b){return b===f||b===92?(n.consume(b),p):p(b)}}function Ga(n,r){let s;return o;function o(d){return Me(d)?(n.enter("lineEnding"),n.consume(d),n.exit("lineEnding"),s=!0,o):$e(d)?Ye(n,o,s?"linePrefix":"lineSuffix")(d):r(d)}}const ZS={name:"definition",tokenize:tb},eb={partial:!0,tokenize:nb};function tb(n,r,s){const o=this;let d;return g;function g(C){return n.enter("definition"),f(C)}function f(C){return R_.call(o,n,l,s,"definitionLabel","definitionLabelMarker","definitionLabelString")(C)}function l(C){return d=ii(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)),C===58?(n.enter("definitionMarker"),n.consume(C),n.exit("definitionMarker"),c):s(C)}function c(C){return ot(C)?Ga(n,h)(C):h(C)}function h(C){return T_(n,p,s,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(C)}function p(C){return n.attempt(eb,u,u)(C)}function u(C){return $e(C)?Ye(n,b,"whitespace")(C):b(C)}function b(C){return C===null||Me(C)?(n.exit("definition"),o.parser.defined.push(d),r(C)):s(C)}}function nb(n,r,s){return o;function o(l){return ot(l)?Ga(n,d)(l):s(l)}function d(l){return D_(n,g,s,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function g(l){return $e(l)?Ye(n,f,"whitespace")(l):f(l)}function f(l){return l===null||Me(l)?r(l):s(l)}}const ib={name:"hardBreakEscape",tokenize:rb};function rb(n,r,s){return o;function o(g){return n.enter("hardBreakEscape"),n.consume(g),d}function d(g){return Me(g)?(n.exit("hardBreakEscape"),r(g)):s(g)}}const sb={name:"headingAtx",resolve:ab,tokenize:lb};function ab(n,r){let s=n.length-2,o=3,d,g;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},g={type:"chunkText",start:n[o][1].start,end:n[s][1].end,contentType:"text"},Ln(n,o,s-o+1,[["enter",d,r],["enter",g,r],["exit",g,r],["exit",d,r]])),n}function lb(n,r,s){let o=0;return d;function d(p){return n.enter("atxHeading"),g(p)}function g(p){return n.enter("atxHeadingSequence"),f(p)}function f(p){return p===35&&o++<6?(n.consume(p),f):p===null||ot(p)?(n.exit("atxHeadingSequence"),l(p)):s(p)}function l(p){return p===35?(n.enter("atxHeadingSequence"),c(p)):p===null||Me(p)?(n.exit("atxHeading"),r(p)):$e(p)?Ye(n,l,"whitespace")(p):(n.enter("atxHeadingText"),h(p))}function c(p){return p===35?(n.consume(p),c):(n.exit("atxHeadingSequence"),l(p))}function h(p){return p===null||p===35||ot(p)?(n.exit("atxHeadingText"),l(p)):(n.consume(p),h)}}const ob=["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"],pg=["pre","script","style","textarea"],cb={concrete:!0,name:"htmlFlow",resolveTo:fb,tokenize:db},ub={partial:!0,tokenize:mb},hb={partial:!0,tokenize:pb};function fb(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 db(n,r,s){const o=this;let d,g,f,l,c;return h;function h(I){return p(I)}function p(I){return n.enter("htmlFlow"),n.enter("htmlFlowData"),n.consume(I),u}function u(I){return I===33?(n.consume(I),b):I===47?(n.consume(I),g=!0,E):I===63?(n.consume(I),d=3,o.interrupt?r:j):rn(I)?(n.consume(I),f=String.fromCharCode(I),S):s(I)}function b(I){return I===45?(n.consume(I),d=2,C):I===91?(n.consume(I),d=5,l=0,T):rn(I)?(n.consume(I),d=4,o.interrupt?r:j):s(I)}function C(I){return I===45?(n.consume(I),o.interrupt?r:j):s(I)}function T(I){const se="CDATA[";return I===se.charCodeAt(l++)?(n.consume(I),l===se.length?o.interrupt?r:U:T):s(I)}function E(I){return rn(I)?(n.consume(I),f=String.fromCharCode(I),S):s(I)}function S(I){if(I===null||I===47||I===62||ot(I)){const se=I===47,ae=f.toLowerCase();return!se&&!g&&pg.includes(ae)?(d=1,o.interrupt?r(I):U(I)):ob.includes(f.toLowerCase())?(d=6,se?(n.consume(I),v):o.interrupt?r(I):U(I)):(d=7,o.interrupt&&!o.parser.lazy[o.now().line]?s(I):g?_(I):y(I))}return I===45||Jt(I)?(n.consume(I),f+=String.fromCharCode(I),S):s(I)}function v(I){return I===62?(n.consume(I),o.interrupt?r:U):s(I)}function _(I){return $e(I)?(n.consume(I),_):B(I)}function y(I){return I===47?(n.consume(I),B):I===58||I===95||rn(I)?(n.consume(I),A):$e(I)?(n.consume(I),y):B(I)}function A(I){return I===45||I===46||I===58||I===95||Jt(I)?(n.consume(I),A):L(I)}function L(I){return I===61?(n.consume(I),D):$e(I)?(n.consume(I),L):y(I)}function D(I){return I===null||I===60||I===61||I===62||I===96?s(I):I===34||I===39?(n.consume(I),c=I,R):$e(I)?(n.consume(I),D):k(I)}function R(I){return I===c?(n.consume(I),c=null,M):I===null||Me(I)?s(I):(n.consume(I),R)}function k(I){return I===null||I===34||I===39||I===47||I===60||I===61||I===62||I===96||ot(I)?L(I):(n.consume(I),k)}function M(I){return I===47||I===62||$e(I)?y(I):s(I)}function B(I){return I===62?(n.consume(I),H):s(I)}function H(I){return I===null||Me(I)?U(I):$e(I)?(n.consume(I),H):s(I)}function U(I){return I===45&&d===2?(n.consume(I),G):I===60&&d===1?(n.consume(I),W):I===62&&d===4?(n.consume(I),N):I===63&&d===3?(n.consume(I),j):I===93&&d===5?(n.consume(I),z):Me(I)&&(d===6||d===7)?(n.exit("htmlFlowData"),n.check(ub,$,P)(I)):I===null||Me(I)?(n.exit("htmlFlowData"),P(I)):(n.consume(I),U)}function P(I){return n.check(hb,K,$)(I)}function K(I){return n.enter("lineEnding"),n.consume(I),n.exit("lineEnding"),X}function X(I){return I===null||Me(I)?P(I):(n.enter("htmlFlowData"),U(I))}function G(I){return I===45?(n.consume(I),j):U(I)}function W(I){return I===47?(n.consume(I),f="",te):U(I)}function te(I){if(I===62){const se=f.toLowerCase();return pg.includes(se)?(n.consume(I),N):U(I)}return rn(I)&&f.length<8?(n.consume(I),f+=String.fromCharCode(I),te):U(I)}function z(I){return I===93?(n.consume(I),j):U(I)}function j(I){return I===62?(n.consume(I),N):I===45&&d===2?(n.consume(I),j):U(I)}function N(I){return I===null||Me(I)?(n.exit("htmlFlowData"),$(I)):(n.consume(I),N)}function $(I){return n.exit("htmlFlow"),r(I)}}function pb(n,r,s){const o=this;return d;function d(f){return Me(f)?(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),g):s(f)}function g(f){return o.parser.lazy[o.now().line]?s(f):r(f)}}function mb(n,r,s){return o;function o(d){return n.enter("lineEnding"),n.consume(d),n.exit("lineEnding"),n.attempt(Za,r,s)}}const gb={name:"htmlText",tokenize:_b};function _b(n,r,s){const o=this;let d,g,f;return l;function l(j){return n.enter("htmlText"),n.enter("htmlTextData"),n.consume(j),c}function c(j){return j===33?(n.consume(j),h):j===47?(n.consume(j),L):j===63?(n.consume(j),y):rn(j)?(n.consume(j),k):s(j)}function h(j){return j===45?(n.consume(j),p):j===91?(n.consume(j),g=0,T):rn(j)?(n.consume(j),_):s(j)}function p(j){return j===45?(n.consume(j),C):s(j)}function u(j){return j===null?s(j):j===45?(n.consume(j),b):Me(j)?(f=u,W(j)):(n.consume(j),u)}function b(j){return j===45?(n.consume(j),C):u(j)}function C(j){return j===62?G(j):j===45?b(j):u(j)}function T(j){const N="CDATA[";return j===N.charCodeAt(g++)?(n.consume(j),g===N.length?E:T):s(j)}function E(j){return j===null?s(j):j===93?(n.consume(j),S):Me(j)?(f=E,W(j)):(n.consume(j),E)}function S(j){return j===93?(n.consume(j),v):E(j)}function v(j){return j===62?G(j):j===93?(n.consume(j),v):E(j)}function _(j){return j===null||j===62?G(j):Me(j)?(f=_,W(j)):(n.consume(j),_)}function y(j){return j===null?s(j):j===63?(n.consume(j),A):Me(j)?(f=y,W(j)):(n.consume(j),y)}function A(j){return j===62?G(j):y(j)}function L(j){return rn(j)?(n.consume(j),D):s(j)}function D(j){return j===45||Jt(j)?(n.consume(j),D):R(j)}function R(j){return Me(j)?(f=R,W(j)):$e(j)?(n.consume(j),R):G(j)}function k(j){return j===45||Jt(j)?(n.consume(j),k):j===47||j===62||ot(j)?M(j):s(j)}function M(j){return j===47?(n.consume(j),G):j===58||j===95||rn(j)?(n.consume(j),B):Me(j)?(f=M,W(j)):$e(j)?(n.consume(j),M):G(j)}function B(j){return j===45||j===46||j===58||j===95||Jt(j)?(n.consume(j),B):H(j)}function H(j){return j===61?(n.consume(j),U):Me(j)?(f=H,W(j)):$e(j)?(n.consume(j),H):M(j)}function U(j){return j===null||j===60||j===61||j===62||j===96?s(j):j===34||j===39?(n.consume(j),d=j,P):Me(j)?(f=U,W(j)):$e(j)?(n.consume(j),U):(n.consume(j),K)}function P(j){return j===d?(n.consume(j),d=void 0,X):j===null?s(j):Me(j)?(f=P,W(j)):(n.consume(j),P)}function K(j){return j===null||j===34||j===39||j===60||j===61||j===96?s(j):j===47||j===62||ot(j)?M(j):(n.consume(j),K)}function X(j){return j===47||j===62||ot(j)?M(j):s(j)}function G(j){return j===62?(n.consume(j),n.exit("htmlTextData"),n.exit("htmlText"),r):s(j)}function W(j){return n.exit("htmlTextData"),n.enter("lineEnding"),n.consume(j),n.exit("lineEnding"),te}function te(j){return $e(j)?Ye(n,z,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):z(j)}function z(j){return n.enter("htmlTextData"),f(j)}}const Ph={name:"labelEnd",resolveAll:bb,resolveTo:Cb,tokenize:wb},vb={tokenize:xb},yb={tokenize:Eb},Sb={tokenize:kb};function bb(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&&Ln(n,0,n.length,s),n}function Cb(n,r){let s=n.length,o=0,d,g,f,l;for(;s--;)if(d=n[s][1],g){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&&(g=s,d.type!=="labelLink")){o=2;break}}else d.type==="labelEnd"&&(f=s);const c={type:n[g][1].type==="labelLink"?"link":"image",start:{...n[g][1].start},end:{...n[n.length-1][1].end}},h={type:"label",start:{...n[g][1].start},end:{...n[f][1].end}},p={type:"labelText",start:{...n[g+o+2][1].end},end:{...n[f-2][1].start}};return l=[["enter",c,r],["enter",h,r]],l=Gn(l,n.slice(g+1,g+o+3)),l=Gn(l,[["enter",p,r]]),l=Gn(l,Bo(r.parser.constructs.insideSpan.null,n.slice(g+o+4,f-3),r)),l=Gn(l,[["exit",p,r],n[f-2],n[f-1],["exit",h,r]]),l=Gn(l,n.slice(f+1)),l=Gn(l,[["exit",c,r]]),Ln(n,g,n.length,l),n}function wb(n,r,s){const o=this;let d=o.events.length,g,f;for(;d--;)if((o.events[d][1].type==="labelImage"||o.events[d][1].type==="labelLink")&&!o.events[d][1]._balanced){g=o.events[d][1];break}return l;function l(b){return g?g._inactive?u(b):(f=o.parser.defined.includes(ii(o.sliceSerialize({start:g.end,end:o.now()}))),n.enter("labelEnd"),n.enter("labelMarker"),n.consume(b),n.exit("labelMarker"),n.exit("labelEnd"),c):s(b)}function c(b){return b===40?n.attempt(vb,p,f?p:u)(b):b===91?n.attempt(yb,p,f?h:u)(b):f?p(b):u(b)}function h(b){return n.attempt(Sb,p,u)(b)}function p(b){return r(b)}function u(b){return g._balanced=!0,s(b)}}function xb(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 ot(u)?Ga(n,g)(u):g(u)}function g(u){return u===41?p(u):T_(n,f,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(u)}function f(u){return ot(u)?Ga(n,c)(u):p(u)}function l(u){return s(u)}function c(u){return u===34||u===39||u===40?D_(n,h,s,"resourceTitle","resourceTitleMarker","resourceTitleString")(u):p(u)}function h(u){return ot(u)?Ga(n,p)(u):p(u)}function p(u){return u===41?(n.enter("resourceMarker"),n.consume(u),n.exit("resourceMarker"),n.exit("resource"),r):s(u)}}function Eb(n,r,s){const o=this;return d;function d(l){return R_.call(o,n,g,f,"reference","referenceMarker","referenceString")(l)}function g(l){return o.parser.defined.includes(ii(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)))?r(l):s(l)}function f(l){return s(l)}}function kb(n,r,s){return o;function o(g){return n.enter("reference"),n.enter("referenceMarker"),n.consume(g),n.exit("referenceMarker"),d}function d(g){return g===93?(n.enter("referenceMarker"),n.consume(g),n.exit("referenceMarker"),n.exit("reference"),r):s(g)}}const Ab={name:"labelStartImage",resolveAll:Ph.resolveAll,tokenize:Tb};function Tb(n,r,s){const o=this;return d;function d(l){return n.enter("labelImage"),n.enter("labelImageMarker"),n.consume(l),n.exit("labelImageMarker"),g}function g(l){return l===91?(n.enter("labelMarker"),n.consume(l),n.exit("labelMarker"),n.exit("labelImage"),f):s(l)}function f(l){return l===94&&"_hiddenFootnoteSupport"in o.parser.constructs?s(l):r(l)}}const Rb={name:"labelStartLink",resolveAll:Ph.resolveAll,tokenize:Db};function Db(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"),g}function g(f){return f===94&&"_hiddenFootnoteSupport"in o.parser.constructs?s(f):r(f)}}const Xu={name:"lineEnding",tokenize:Mb};function Mb(n,r){return s;function s(o){return n.enter("lineEnding"),n.consume(o),n.exit("lineEnding"),Ye(n,r,"linePrefix")}}const bo={name:"thematicBreak",tokenize:Lb};function Lb(n,r,s){let o=0,d;return g;function g(h){return n.enter("thematicBreak"),f(h)}function f(h){return d=h,l(h)}function l(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"),$e(h)?Ye(n,l,"whitespace")(h):l(h))}}const _n={continuation:{tokenize:Nb},exit:zb,name:"list",tokenize:jb},Ob={partial:!0,tokenize:Ib},Bb={partial:!0,tokenize:Hb};function jb(n,r,s){const o=this,d=o.events[o.events.length-1];let g=d&&d[1].type==="linePrefix"?d[2].sliceSerialize(d[1],!0).length:0,f=0;return l;function l(C){const T=o.containerState.type||(C===42||C===43||C===45?"listUnordered":"listOrdered");if(T==="listUnordered"?!o.containerState.marker||C===o.containerState.marker:bh(C)){if(o.containerState.type||(o.containerState.type=T,n.enter(T,{_container:!0})),T==="listUnordered")return n.enter("listItemPrefix"),C===42||C===45?n.check(bo,s,h)(C):h(C);if(!o.interrupt||C===49)return n.enter("listItemPrefix"),n.enter("listItemValue"),c(C)}return s(C)}function c(C){return bh(C)&&++f<10?(n.consume(C),c):(!o.interrupt||f<2)&&(o.containerState.marker?C===o.containerState.marker:C===41||C===46)?(n.exit("listItemValue"),h(C)):s(C)}function h(C){return n.enter("listItemMarker"),n.consume(C),n.exit("listItemMarker"),o.containerState.marker=o.containerState.marker||C,n.check(Za,o.interrupt?s:p,n.attempt(Ob,b,u))}function p(C){return o.containerState.initialBlankLine=!0,g++,b(C)}function u(C){return $e(C)?(n.enter("listItemPrefixWhitespace"),n.consume(C),n.exit("listItemPrefixWhitespace"),b):s(C)}function b(C){return o.containerState.size=g+o.sliceSerialize(n.exit("listItemPrefix"),!0).length,r(C)}}function Nb(n,r,s){const o=this;return o.containerState._closeFlow=void 0,n.check(Za,d,g);function d(l){return o.containerState.furtherBlankLines=o.containerState.furtherBlankLines||o.containerState.initialBlankLine,Ye(n,r,"listItemIndent",o.containerState.size+1)(l)}function g(l){return o.containerState.furtherBlankLines||!$e(l)?(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,f(l)):(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,n.attempt(Bb,r,f)(l))}function f(l){return o.containerState._closeFlow=!0,o.interrupt=void 0,Ye(n,n.attempt(_n,r,s),"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function Hb(n,r,s){const o=this;return Ye(n,d,"listItemIndent",o.containerState.size+1);function d(g){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(g):s(g)}}function zb(n){n.exit(this.containerState.type)}function Ib(n,r,s){const o=this;return Ye(n,d,"listItemPrefixWhitespace",o.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function d(g){const f=o.events[o.events.length-1];return!$e(g)&&f&&f[1].type==="listItemPrefixWhitespace"?r(g):s(g)}}const mg={name:"setextUnderline",resolveTo:Ub,tokenize:Pb};function Ub(n,r){let s=n.length,o,d,g;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),!g&&n[s][1].type==="definition"&&(g=s);const f={type:"setextHeading",start:{...n[o][1].start},end:{...n[n.length-1][1].end}};return n[d][1].type="setextHeadingText",g?(n.splice(d,0,["enter",f,r]),n.splice(g+1,0,["exit",n[o][1],r]),n[o][1].end={...n[g][1].end}):n[o][1]=f,n.push(["exit",f,r]),n}function Pb(n,r,s){const o=this;let d;return g;function g(h){let p=o.events.length,u;for(;p--;)if(o.events[p][1].type!=="lineEnding"&&o.events[p][1].type!=="linePrefix"&&o.events[p][1].type!=="content"){u=o.events[p][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"),l(h)}function l(h){return h===d?(n.consume(h),l):(n.exit("setextHeadingLineSequence"),$e(h)?Ye(n,c,"lineSuffix")(h):c(h))}function c(h){return h===null||Me(h)?(n.exit("setextHeadingLine"),r(h)):s(h)}}const Fb={tokenize:qb};function qb(n){const r=this,s=n.attempt(Za,o,n.attempt(this.parser.constructs.flowInitial,d,Ye(n,n.attempt(this.parser.constructs.flow,d,n.attempt(KS,d)),"linePrefix")));return s;function o(g){if(g===null){n.consume(g);return}return n.enter("lineEndingBlank"),n.consume(g),n.exit("lineEndingBlank"),r.currentConstruct=void 0,s}function d(g){if(g===null){n.consume(g);return}return n.enter("lineEnding"),n.consume(g),n.exit("lineEnding"),r.currentConstruct=void 0,s}}const $b={resolveAll:L_()},Gb=M_("string"),Vb=M_("text");function M_(n){return{resolveAll:L_(n==="text"?Wb:void 0),tokenize:r};function r(s){const o=this,d=this.parser.constructs[n],g=s.attempt(d,f,l);return f;function f(p){return h(p)?g(p):l(p)}function l(p){if(p===null){s.consume(p);return}return s.enter("data"),s.consume(p),c}function c(p){return h(p)?(s.exit("data"),g(p)):(s.consume(p),c)}function h(p){if(p===null)return!0;const u=d[p];let b=-1;if(u)for(;++b<u.length;){const C=u[b];if(!C.previous||C.previous.call(o,o.previous))return!0}return!1}}}function L_(n){return r;function r(s,o){let d=-1,g;for(;++d<=s.length;)g===void 0?s[d]&&s[d][1].type==="data"&&(g=d,d++):(!s[d]||s[d][1].type!=="data")&&(d!==g+2&&(s[g][1].end=s[d-1][1].end,s.splice(g+2,d-g-2),d=g+2),g=void 0);return n?n(s,o):s}}function Wb(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 g=d.length,f=-1,l=0,c;for(;g--;){const h=d[g];if(typeof h=="string"){for(f=h.length;h.charCodeAt(f-1)===32;)l++,f--;if(f)break;f=-1}else if(h===-2)c=!0,l++;else if(h!==-1){g++;break}}if(r._contentTypeTextTrailing&&s===n.length&&(l=0),l){const h={type:s===n.length||c||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:g?f:o.start._bufferIndex+f,_index:o.start._index+g,line:o.end.line,column:o.end.column-l,offset:o.end.offset-l},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 Kb={42:_n,43:_n,45:_n,48:_n,49:_n,50:_n,51:_n,52:_n,53:_n,54:_n,55:_n,56:_n,57:_n,62:x_},Yb={91:ZS},Xb={[-2]:Yu,[-1]:Yu,32:Yu},Qb={35:sb,42:bo,45:[mg,bo],60:cb,61:mg,95:bo,96:dg,126:dg},Jb={38:k_,92:E_},Zb={[-5]:Xu,[-4]:Xu,[-3]:Xu,33:Ab,38:k_,42:Ch,60:[RS,gb],91:Rb,92:[ib,E_],93:Ph,95:Ch,96:FS},eC={null:[Ch,$b]},tC={null:[42,95]},nC={null:[]},iC=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:tC,contentInitial:Yb,disable:nC,document:Kb,flow:Qb,flowInitial:Xb,insideSpan:eC,string:Jb,text:Zb},Symbol.toStringTag,{value:"Module"}));function rC(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={},g=[];let f=[],l=[];const c={attempt:R(L),check:R(D),consume:_,enter:y,exit:A,interrupt:R(D,{interrupt:!0})},h={code:null,containerState:{},defineSkip:E,events:[],now:T,parser:n,previous:null,sliceSerialize:b,sliceStream:C,write:u};let p=r.tokenize.call(h,c);return r.resolveAll&&g.push(r),h;function u(H){return f=Gn(f,H),S(),f[f.length-1]!==null?[]:(k(r,0),h.events=Bo(g,h.events,h),h.events)}function b(H,U){return aC(C(H),U)}function C(H){return sC(f,H)}function T(){const{_bufferIndex:H,_index:U,line:P,column:K,offset:X}=o;return{_bufferIndex:H,_index:U,line:P,column:K,offset:X}}function E(H){d[H.line]=H.column,B()}function S(){let H;for(;o._index<f.length;){const U=f[o._index];if(typeof U=="string")for(H=o._index,o._bufferIndex<0&&(o._bufferIndex=0);o._index===H&&o._bufferIndex<U.length;)v(U.charCodeAt(o._bufferIndex));else v(U)}}function v(H){p=p(H)}function _(H){Me(H)?(o.line++,o.column=1,o.offset+=H===-3?2:1,B()):H!==-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=H}function y(H,U){const P=U||{};return P.type=H,P.start=T(),h.events.push(["enter",P,h]),l.push(P),P}function A(H){const U=l.pop();return U.end=T(),h.events.push(["exit",U,h]),U}function L(H,U){k(H,U.from)}function D(H,U){U.restore()}function R(H,U){return P;function P(K,X,G){let W,te,z,j;return Array.isArray(K)?$(K):"tokenize"in K?$([K]):N(K);function N(ue){return Y;function Y(q){const Z=q!==null&&ue[q],Q=q!==null&&ue.null,_e=[...Array.isArray(Z)?Z:Z?[Z]:[],...Array.isArray(Q)?Q:Q?[Q]:[]];return $(_e)(q)}}function $(ue){return W=ue,te=0,ue.length===0?G:I(ue[te])}function I(ue){return Y;function Y(q){return j=M(),z=ue,ue.partial||(h.currentConstruct=ue),ue.name&&h.parser.constructs.disable.null.includes(ue.name)?ae():ue.tokenize.call(U?Object.assign(Object.create(h),U):h,c,se,ae)(q)}}function se(ue){return H(z,j),X}function ae(ue){return j.restore(),++te<W.length?I(W[te]):G}}}function k(H,U){H.resolveAll&&!g.includes(H)&&g.push(H),H.resolve&&Ln(h.events,U,h.events.length-U,H.resolve(h.events.slice(U),h)),H.resolveTo&&(h.events=H.resolveTo(h.events,h))}function M(){const H=T(),U=h.previous,P=h.currentConstruct,K=h.events.length,X=Array.from(l);return{from:K,restore:G};function G(){o=H,h.previous=U,h.currentConstruct=P,h.events.length=K,l=X,B()}}function B(){o.line in d&&o.column<2&&(o.column=d[o.line],o.offset+=d[o.line]-1)}}function sC(n,r){const s=r.start._index,o=r.start._bufferIndex,d=r.end._index,g=r.end._bufferIndex;let f;if(s===d)f=[n[s].slice(o,g)];else{if(f=n.slice(s,d),o>-1){const l=f[0];typeof l=="string"?f[0]=l.slice(o):f.shift()}g>0&&f.push(n[d].slice(0,g))}return f}function aC(n,r){let s=-1;const o=[];let d;for(;++s<n.length;){const g=n[s];let f;if(typeof g=="string")f=g;else switch(g){case-5:{f="\r";break}case-4:{f=`
|
|
64
|
-
`;break}case-3:{f=`\r
|
|
65
|
-
`;break}case-2:{f=r?" ":" ";break}case-1:{if(!r&&d)continue;f=" ";break}default:f=String.fromCharCode(g)}d=g===-2,o.push(f)}return o.join("")}function lC(n){const o={constructs:C_([iC,...(n||{}).extensions||[]]),content:d(CS),defined:[],document:d(xS),flow:d(Fb),lazy:{},string:d(Gb),text:d(Vb)};return o;function d(g){return f;function f(l){return rC(o,g,l)}}}function oC(n){for(;!A_(n););return n}const gg=/[\0\t\n\r]/g;function cC(){let n=1,r="",s=!0,o;return d;function d(g,f,l){const c=[];let h,p,u,b,C;for(g=r+(typeof g=="string"?g.toString():new TextDecoder(f||void 0).decode(g)),u=0,r="",s&&(g.charCodeAt(0)===65279&&u++,s=void 0);u<g.length;){if(gg.lastIndex=u,h=gg.exec(g),b=h&&h.index!==void 0?h.index:g.length,C=g.charCodeAt(b),!h){r=g.slice(u);break}if(C===10&&u===b&&o)c.push(-3),o=void 0;else switch(o&&(c.push(-5),o=void 0),u<b&&(c.push(g.slice(u,b)),n+=b-u),C){case 0:{c.push(65533),n++;break}case 9:{for(p=Math.ceil(n/4)*4,c.push(-2);n++<p;)c.push(-1);break}case 10:{c.push(-4),n=1;break}default:o=!0,n=1}u=b+1}return l&&(o&&c.push(-5),r&&c.push(r),c.push(null)),c}}const uC=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function hC(n){return n.replace(uC,fC)}function fC(n,r,s){if(r)return r;if(s.charCodeAt(0)===35){const d=s.charCodeAt(1),g=d===120||d===88;return w_(s.slice(g?2:1),g?16:10)}return Uh(s)||n}const O_={}.hasOwnProperty;function dC(n,r,s){return r&&typeof r=="object"&&(s=r,r=void 0),pC(s)(oC(lC(s).document().write(cC()(n,r,!0))))}function pC(n){const r={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:g(en),autolinkProtocol:M,autolinkEmail:M,atxHeading:g(Ke),blockQuote:g(Q),characterEscape:M,characterReference:M,codeFenced:g(_e),codeFencedFenceInfo:f,codeFencedFenceMeta:f,codeIndented:g(_e,f),codeText:g(ve,f),codeTextData:M,data:M,codeFlowValue:M,definition:g(De),definitionDestinationString:f,definitionLabelString:f,definitionTitleString:f,emphasis:g(Ae),hardBreakEscape:g(ht),hardBreakTrailing:g(ht),htmlFlow:g(Re,f),htmlFlowData:M,htmlText:g(Re,f),htmlTextData:M,image:g(sn),label:f,link:g(en),listItem:g(an),listItemValue:b,listOrdered:g(Vt,u),listUnordered:g(Vt),paragraph:g(yn),reference:I,referenceString:f,resourceDestinationString:f,resourceTitleString:f,setextHeading:g(Ke),strong:g(bt),thematicBreak:g(Lt)},exit:{atxHeading:c(),atxHeadingSequence:L,autolink:c(),autolinkEmail:Z,autolinkProtocol:q,blockQuote:c(),characterEscapeValue:B,characterReferenceMarkerHexadecimal:ae,characterReferenceMarkerNumeric:ae,characterReferenceValue:ue,characterReference:Y,codeFenced:c(S),codeFencedFence:E,codeFencedFenceInfo:C,codeFencedFenceMeta:T,codeFlowValue:B,codeIndented:c(v),codeText:c(X),codeTextData:B,data:B,definition:c(),definitionDestinationString:A,definitionLabelString:_,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(U),hardBreakTrailing:c(U),htmlFlow:c(P),htmlFlowData:B,htmlText:c(K),htmlTextData:B,image:c(W),label:z,labelText:te,lineEnding:H,link:c(G),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:se,resourceDestinationString:j,resourceTitleString:N,resource:$,setextHeading:c(k),setextHeadingLineSequence:R,setextHeadingText:D,strong:c(),thematicBreak:c()}};B_(r,(n||{}).mdastExtensions||[]);const s={};return o;function o(fe){let Se={type:"root",children:[]};const xe={stack:[Se],tokenStack:[],config:r,enter:l,exit:h,buffer:f,resume:p,data:s},Le=[];let Be=-1;for(;++Be<fe.length;)if(fe[Be][1].type==="listOrdered"||fe[Be][1].type==="listUnordered")if(fe[Be][0]==="enter")Le.push(Be);else{const mt=Le.pop();Be=d(fe,mt,Be)}for(Be=-1;++Be<fe.length;){const mt=r[fe[Be][0]];O_.call(mt,fe[Be][1].type)&&mt[fe[Be][1].type].call(Object.assign({sliceSerialize:fe[Be][2].sliceSerialize},xe),fe[Be][1])}if(xe.tokenStack.length>0){const mt=xe.tokenStack[xe.tokenStack.length-1];(mt[1]||_g).call(xe,void 0,mt[0])}for(Se.position={start:dr(fe.length>0?fe[0][1].start:{line:1,column:1,offset:0}),end:dr(fe.length>0?fe[fe.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(fe,Se,xe){let Le=Se-1,Be=-1,mt=!1,Pe,vt,_t,Ot;for(;++Le<=xe;){const Xe=fe[Le];switch(Xe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Xe[0]==="enter"?Be++:Be--,Ot=void 0;break}case"lineEndingBlank":{Xe[0]==="enter"&&(Pe&&!Ot&&!Be&&!_t&&(_t=Le),Ot=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ot=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(Pe){let tn=Le;for(vt=void 0;tn--;){const Bt=fe[tn];if(Bt[1].type==="lineEnding"||Bt[1].type==="lineEndingBlank"){if(Bt[0]==="exit")continue;vt&&(fe[vt][1].type="lineEndingBlank",mt=!0),Bt[1].type="lineEnding",vt=tn}else if(!(Bt[1].type==="linePrefix"||Bt[1].type==="blockQuotePrefix"||Bt[1].type==="blockQuotePrefixWhitespace"||Bt[1].type==="blockQuoteMarker"||Bt[1].type==="listItemIndent"))break}_t&&(!vt||_t<vt)&&(Pe._spread=!0),Pe.end=Object.assign({},vt?fe[vt][1].start:Xe[1].end),fe.splice(vt||Le,0,["exit",Pe,Xe[2]]),Le++,xe++}if(Xe[1].type==="listItemPrefix"){const tn={type:"listItem",_spread:!1,start:Object.assign({},Xe[1].start),end:void 0};Pe=tn,fe.splice(Le,0,["enter",tn,Xe[2]]),Le++,xe++,_t=void 0,Ot=!0}}}return fe[Se][1]._spread=mt,xe}function g(fe,Se){return xe;function xe(Le){l.call(this,fe(Le),Le),Se&&Se.call(this,Le)}}function f(){this.stack.push({type:"fragment",children:[]})}function l(fe,Se,xe){this.stack[this.stack.length-1].children.push(fe),this.stack.push(fe),this.tokenStack.push([Se,xe||void 0]),fe.position={start:dr(Se.start),end:void 0}}function c(fe){return Se;function Se(xe){fe&&fe.call(this,xe),h.call(this,xe)}}function h(fe,Se){const xe=this.stack.pop(),Le=this.tokenStack.pop();if(Le)Le[0].type!==fe.type&&(Se?Se.call(this,fe,Le[0]):(Le[1]||_g).call(this,fe,Le[0]));else throw new Error("Cannot close `"+fe.type+"` ("+$a({start:fe.start,end:fe.end})+"): it’s not open");xe.position.end=dr(fe.end)}function p(){return Ih(this.stack.pop())}function u(){this.data.expectingFirstListItemValue=!0}function b(fe){if(this.data.expectingFirstListItemValue){const Se=this.stack[this.stack.length-2];Se.start=Number.parseInt(this.sliceSerialize(fe),10),this.data.expectingFirstListItemValue=void 0}}function C(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.lang=fe}function T(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.meta=fe}function E(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.value=fe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.value=fe.replace(/(\r?\n|\r)$/g,"")}function _(fe){const Se=this.resume(),xe=this.stack[this.stack.length-1];xe.label=Se,xe.identifier=ii(this.sliceSerialize(fe)).toLowerCase()}function y(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.title=fe}function A(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.url=fe}function L(fe){const Se=this.stack[this.stack.length-1];if(!Se.depth){const xe=this.sliceSerialize(fe).length;Se.depth=xe}}function D(){this.data.setextHeadingSlurpLineEnding=!0}function R(fe){const Se=this.stack[this.stack.length-1];Se.depth=this.sliceSerialize(fe).codePointAt(0)===61?1:2}function k(){this.data.setextHeadingSlurpLineEnding=void 0}function M(fe){const xe=this.stack[this.stack.length-1].children;let Le=xe[xe.length-1];(!Le||Le.type!=="text")&&(Le=et(),Le.position={start:dr(fe.start),end:void 0},xe.push(Le)),this.stack.push(Le)}function B(fe){const Se=this.stack.pop();Se.value+=this.sliceSerialize(fe),Se.position.end=dr(fe.end)}function H(fe){const Se=this.stack[this.stack.length-1];if(this.data.atHardBreak){const xe=Se.children[Se.children.length-1];xe.position.end=dr(fe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&r.canContainEols.includes(Se.type)&&(M.call(this,fe),B.call(this,fe))}function U(){this.data.atHardBreak=!0}function P(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.value=fe}function K(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.value=fe}function X(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.value=fe}function G(){const fe=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";fe.type+="Reference",fe.referenceType=Se,delete fe.url,delete fe.title}else delete fe.identifier,delete fe.label;this.data.referenceType=void 0}function W(){const fe=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";fe.type+="Reference",fe.referenceType=Se,delete fe.url,delete fe.title}else delete fe.identifier,delete fe.label;this.data.referenceType=void 0}function te(fe){const Se=this.sliceSerialize(fe),xe=this.stack[this.stack.length-2];xe.label=hC(Se),xe.identifier=ii(Se).toLowerCase()}function z(){const fe=this.stack[this.stack.length-1],Se=this.resume(),xe=this.stack[this.stack.length-1];if(this.data.inReference=!0,xe.type==="link"){const Le=fe.children;xe.children=Le}else xe.alt=Se}function j(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.url=fe}function N(){const fe=this.resume(),Se=this.stack[this.stack.length-1];Se.title=fe}function $(){this.data.inReference=void 0}function I(){this.data.referenceType="collapsed"}function se(fe){const Se=this.resume(),xe=this.stack[this.stack.length-1];xe.label=Se,xe.identifier=ii(this.sliceSerialize(fe)).toLowerCase(),this.data.referenceType="full"}function ae(fe){this.data.characterReferenceType=fe.type}function ue(fe){const Se=this.sliceSerialize(fe),xe=this.data.characterReferenceType;let Le;xe?(Le=w_(Se,xe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Le=Uh(Se);const Be=this.stack[this.stack.length-1];Be.value+=Le}function Y(fe){const Se=this.stack.pop();Se.position.end=dr(fe.end)}function q(fe){B.call(this,fe);const Se=this.stack[this.stack.length-1];Se.url=this.sliceSerialize(fe)}function Z(fe){B.call(this,fe);const Se=this.stack[this.stack.length-1];Se.url="mailto:"+this.sliceSerialize(fe)}function Q(){return{type:"blockquote",children:[]}}function _e(){return{type:"code",lang:null,meta:null,value:""}}function ve(){return{type:"inlineCode",value:""}}function De(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ae(){return{type:"emphasis",children:[]}}function Ke(){return{type:"heading",depth:0,children:[]}}function ht(){return{type:"break"}}function Re(){return{type:"html",value:""}}function sn(){return{type:"image",title:null,url:"",alt:null}}function en(){return{type:"link",title:null,url:"",children:[]}}function Vt(fe){return{type:"list",ordered:fe.type==="listOrdered",start:null,spread:fe._spread,children:[]}}function an(fe){return{type:"listItem",spread:fe._spread,checked:null,children:[]}}function yn(){return{type:"paragraph",children:[]}}function bt(){return{type:"strong",children:[]}}function et(){return{type:"text",value:""}}function Lt(){return{type:"thematicBreak"}}}function dr(n){return{line:n.line,column:n.column,offset:n.offset}}function B_(n,r){let s=-1;for(;++s<r.length;){const o=r[s];Array.isArray(o)?B_(n,o):mC(n,o)}}function mC(n,r){let s;for(s in r)if(O_.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 _g(n,r){throw n?new Error("Cannot close `"+n.type+"` ("+$a({start:n.start,end:n.end})+"): a different token (`"+r.type+"`, "+$a({start:r.start,end:r.end})+") is open"):new Error("Cannot close document, a token (`"+r.type+"`, "+$a({start:r.start,end:r.end})+") is still open")}function gC(n){const r=this;r.parser=s;function s(o){return dC(o,{...r.data("settings"),...n,extensions:r.data("micromarkExtensions")||[],mdastExtensions:r.data("fromMarkdownExtensions")||[]})}}function _C(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 vC(n,r){const s={type:"element",tagName:"br",properties:{},children:[]};return n.patch(r,s),[n.applyData(r,s),{type:"text",value:`
|
|
66
|
-
`}]}function yC(n,r){const s=r.value?r.value+`
|
|
67
|
-
`:"",o={},d=r.lang?r.lang.split(/\s+/):[];d.length>0&&(o.className=["language-"+d[0]]);let g={type:"element",tagName:"code",properties:o,children:[{type:"text",value:s}]};return r.meta&&(g.data={meta:r.meta}),n.patch(r,g),g=n.applyData(r,g),g={type:"element",tagName:"pre",properties:{},children:[g]},n.patch(r,g),g}function SC(n,r){const s={type:"element",tagName:"del",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}function bC(n,r){const s={type:"element",tagName:"em",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}function CC(n,r){const s=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",o=String(r.identifier).toUpperCase(),d=Fs(o.toLowerCase()),g=n.footnoteOrder.indexOf(o);let f,l=n.footnoteCounts.get(o);l===void 0?(l=0,n.footnoteOrder.push(o),f=n.footnoteOrder.length):f=g+1,l+=1,n.footnoteCounts.set(o,l);const c={type:"element",tagName:"a",properties:{href:"#"+s+"fn-"+d,id:s+"fnref-"+d+(l>1?"-"+l:""),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 wC(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 xC(n,r){if(n.options.allowDangerousHtml){const s={type:"raw",value:r.value};return n.patch(r,s),n.applyData(r,s)}}function j_(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),g=d[0];g&&g.type==="text"?g.value="["+g.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 EC(n,r){const s=String(r.identifier).toUpperCase(),o=n.definitionById.get(s);if(!o)return j_(n,r);const d={src:Fs(o.url||""),alt:r.alt};o.title!==null&&o.title!==void 0&&(d.title=o.title);const g={type:"element",tagName:"img",properties:d,children:[]};return n.patch(r,g),n.applyData(r,g)}function kC(n,r){const s={src:Fs(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 AC(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 TC(n,r){const s=String(r.identifier).toUpperCase(),o=n.definitionById.get(s);if(!o)return j_(n,r);const d={href:Fs(o.url||"")};o.title!==null&&o.title!==void 0&&(d.title=o.title);const g={type:"element",tagName:"a",properties:d,children:n.all(r)};return n.patch(r,g),n.applyData(r,g)}function RC(n,r){const s={href:Fs(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 DC(n,r,s){const o=n.all(r),d=s?MC(s):N_(r),g={},f=[];if(typeof r.checked=="boolean"){const p=o[0];let u;p&&p.type==="element"&&p.tagName==="p"?u=p:(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:[]}),g.className=["task-list-item"]}let l=-1;for(;++l<o.length;){const p=o[l];(d||l!==0||p.type!=="element"||p.tagName!=="p")&&f.push({type:"text",value:`
|
|
68
|
-
`}),p.type==="element"&&p.tagName==="p"&&!d?f.push(...p.children):f.push(p)}const c=o[o.length-1];c&&(d||c.type!=="element"||c.tagName!=="p")&&f.push({type:"text",value:`
|
|
69
|
-
`});const h={type:"element",tagName:"li",properties:g,children:f};return n.patch(r,h),n.applyData(r,h)}function MC(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=N_(s[o])}return r}function N_(n){const r=n.spread;return r??n.children.length>1}function LC(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 g={type:"element",tagName:r.ordered?"ol":"ul",properties:s,children:n.wrap(o,!0)};return n.patch(r,g),n.applyData(r,g)}function OC(n,r){const s={type:"element",tagName:"p",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}function BC(n,r){const s={type:"root",children:n.wrap(n.all(r))};return n.patch(r,s),n.applyData(r,s)}function jC(n,r){const s={type:"element",tagName:"strong",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}function NC(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)},l=jh(r.children[1]),c=m_(r.children[r.children.length-1]);l&&c&&(f.position={start:l,end:c}),d.push(f)}const g={type:"element",tagName:"table",properties:{},children:n.wrap(d,!0)};return n.patch(r,g),n.applyData(r,g)}function HC(n,r,s){const o=s?s.children:void 0,g=(o?o.indexOf(r):1)===0?"th":"td",f=s&&s.type==="table"?s.align:void 0,l=f?f.length:r.children.length;let c=-1;const h=[];for(;++c<l;){const u=r.children[c],b={},C=f?f[c]:void 0;C&&(b.align=C);let T={type:"element",tagName:g,properties:b,children:[]};u&&(T.children=n.all(u),n.patch(u,T),T=n.applyData(u,T)),h.push(T)}const p={type:"element",tagName:"tr",properties:{},children:n.wrap(h,!0)};return n.patch(r,p),n.applyData(r,p)}function zC(n,r){const s={type:"element",tagName:"td",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}const vg=9,yg=32;function IC(n){const r=String(n),s=/\r?\n|\r/g;let o=s.exec(r),d=0;const g=[];for(;o;)g.push(Sg(r.slice(d,o.index),d>0,!0),o[0]),d=o.index+o[0].length,o=s.exec(r);return g.push(Sg(r.slice(d),d>0,!1)),g.join("")}function Sg(n,r,s){let o=0,d=n.length;if(r){let g=n.codePointAt(o);for(;g===vg||g===yg;)o++,g=n.codePointAt(o)}if(s){let g=n.codePointAt(d-1);for(;g===vg||g===yg;)d--,g=n.codePointAt(d-1)}return d>o?n.slice(o,d):""}function UC(n,r){const s={type:"text",value:IC(String(r.value))};return n.patch(r,s),n.applyData(r,s)}function PC(n,r){const s={type:"element",tagName:"hr",properties:{},children:[]};return n.patch(r,s),n.applyData(r,s)}const FC={blockquote:_C,break:vC,code:yC,delete:SC,emphasis:bC,footnoteReference:CC,heading:wC,html:xC,imageReference:EC,image:kC,inlineCode:AC,linkReference:TC,link:RC,listItem:DC,list:LC,paragraph:OC,root:BC,strong:jC,table:NC,tableCell:zC,tableRow:HC,text:UC,thematicBreak:PC,toml:mo,yaml:mo,definition:mo,footnoteDefinition:mo};function mo(){}const H_=-1,jo=0,Va=1,Eo=2,Fh=3,qh=4,$h=5,Gh=6,z_=7,I_=8,qC=typeof self=="object"?self:globalThis,bg=(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 qC[n](r)},$C=(n,r)=>{const s=(d,g)=>(n.set(g,d),d),o=d=>{if(n.has(d))return n.get(d);const[g,f]=r[d];switch(g){case jo:case H_:return s(f,d);case Va:{const l=s([],d);for(const c of f)l.push(o(c));return l}case Eo:{const l=s({},d);for(const[c,h]of f)l[o(c)]=o(h);return l}case Fh:return s(new Date(f),d);case qh:{const{source:l,flags:c}=f;return s(new RegExp(l,c),d)}case $h:{const l=s(new Map,d);for(const[c,h]of f)l.set(o(c),o(h));return l}case Gh:{const l=s(new Set,d);for(const c of f)l.add(o(c));return l}case z_:{const{name:l,message:c}=f;return s(bg(l,c),d)}case I_: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:l}=new Uint8Array(f);return s(new DataView(l),f)}}return s(bg(g,f),d)};return o},Cg=n=>$C(new Map,n)(0),Bs="",{toString:GC}={},{keys:VC}=Object,Fa=n=>{const r=typeof n;if(r!=="object"||!n)return[jo,r];const s=GC.call(n).slice(8,-1);switch(s){case"Array":return[Va,Bs];case"Object":return[Eo,Bs];case"Date":return[Fh,Bs];case"RegExp":return[qh,Bs];case"Map":return[$h,Bs];case"Set":return[Gh,Bs];case"DataView":return[Va,s]}return s.includes("Array")?[Va,s]:s.includes("Error")?[z_,s]:[Eo,s]},go=([n,r])=>n===jo&&(r==="function"||r==="symbol"),WC=(n,r,s,o)=>{const d=(f,l)=>{const c=o.push(f)-1;return s.set(l,c),c},g=f=>{if(s.has(f))return s.get(f);let[l,c]=Fa(f);switch(l){case jo:{let p=f;switch(c){case"bigint":l=I_,p=f.toString();break;case"function":case"symbol":if(n)throw new TypeError("unable to serialize "+c);p=null;break;case"undefined":return d([H_],f)}return d([l,p],f)}case Va:{if(c){let b=f;return c==="DataView"?b=new Uint8Array(f.buffer):c==="ArrayBuffer"&&(b=new Uint8Array(f)),d([c,[...b]],f)}const p=[],u=d([l,p],f);for(const b of f)p.push(g(b));return u}case Eo:{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 g(f.toJSON());const p=[],u=d([l,p],f);for(const b of VC(f))(n||!go(Fa(f[b])))&&p.push([g(b),g(f[b])]);return u}case Fh:return d([l,f.toISOString()],f);case qh:{const{source:p,flags:u}=f;return d([l,{source:p,flags:u}],f)}case $h:{const p=[],u=d([l,p],f);for(const[b,C]of f)(n||!(go(Fa(b))||go(Fa(C))))&&p.push([g(b),g(C)]);return u}case Gh:{const p=[],u=d([l,p],f);for(const b of f)(n||!go(Fa(b)))&&p.push(g(b));return u}}const{message:h}=f;return d([l,{name:c,message:h}],f)};return g},wg=(n,{json:r,lossy:s}={})=>{const o=[];return WC(!(r||s),!!r,new Map,o)(n),o},ko=typeof structuredClone=="function"?(n,r)=>r&&("json"in r||"lossy"in r)?Cg(wg(n,r)):structuredClone(n):(n,r)=>Cg(wg(n,r));function KC(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 YC(n,r){return"Back to reference "+(n+1)+(r>1?"-"+r:"")}function XC(n){const r=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",s=n.options.footnoteBackContent||KC,o=n.options.footnoteBackLabel||YC,d=n.options.footnoteLabel||"Footnotes",g=n.options.footnoteLabelTagName||"h2",f=n.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let c=-1;for(;++c<n.footnoteOrder.length;){const h=n.footnoteById.get(n.footnoteOrder[c]);if(!h)continue;const p=n.all(h),u=String(h.identifier).toUpperCase(),b=Fs(u.toLowerCase());let C=0;const T=[],E=n.footnoteCounts.get(u);for(;E!==void 0&&++C<=E;){T.length>0&&T.push({type:"text",value:" "});let _=typeof s=="string"?s:s(c,C);typeof _=="string"&&(_={type:"text",value:_}),T.push({type:"element",tagName:"a",properties:{href:"#"+r+"fnref-"+b+(C>1?"-"+C:""),dataFootnoteBackref:"",ariaLabel:typeof o=="string"?o:o(c,C),className:["data-footnote-backref"]},children:Array.isArray(_)?_:[_]})}const S=p[p.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const _=S.children[S.children.length-1];_&&_.type==="text"?_.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...T)}else p.push(...T);const v={type:"element",tagName:"li",properties:{id:r+"fn-"+b},children:n.wrap(p,!0)};n.patch(h,v),l.push(v)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:g,properties:{...ko(f),id:"footnote-label"},children:[{type:"text",value:d}]},{type:"text",value:`
|
|
70
|
-
`},{type:"element",tagName:"ol",properties:{},children:n.wrap(l,!0)},{type:"text",value:`
|
|
71
|
-
`}]}}const No=(function(n){if(n==null)return ew;if(typeof n=="function")return Ho(n);if(typeof n=="object")return Array.isArray(n)?QC(n):JC(n);if(typeof n=="string")return ZC(n);throw new Error("Expected function, string, or object as test")});function QC(n){const r=[];let s=-1;for(;++s<n.length;)r[s]=No(n[s]);return Ho(o);function o(...d){let g=-1;for(;++g<r.length;)if(r[g].apply(this,d))return!0;return!1}}function JC(n){const r=n;return Ho(s);function s(o){const d=o;let g;for(g in n)if(d[g]!==r[g])return!1;return!0}}function ZC(n){return Ho(r);function r(s){return s&&s.type===n}}function Ho(n){return r;function r(s,o,d){return!!(tw(s)&&n.call(this,s,typeof o=="number"?o:void 0,d||void 0))}}function ew(){return!0}function tw(n){return n!==null&&typeof n=="object"&&"type"in n}const U_=[],nw=!0,wh=!1,iw="skip";function P_(n,r,s,o){let d;typeof r=="function"&&typeof s!="function"?(o=s,s=r):d=r;const g=No(d),f=o?-1:1;l(n,void 0,[])();function l(c,h,p){const u=c&&typeof c=="object"?c:{};if(typeof u.type=="string"){const C=typeof u.tagName=="string"?u.tagName:typeof u.name=="string"?u.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(c.type+(C?"<"+C+">":""))+")"})}return b;function b(){let C=U_,T,E,S;if((!r||g(c,h,p[p.length-1]||void 0))&&(C=rw(s(c,p)),C[0]===wh))return C;if("children"in c&&c.children){const v=c;if(v.children&&C[0]!==iw)for(E=(o?v.children.length:-1)+f,S=p.concat(v);E>-1&&E<v.children.length;){const _=v.children[E];if(T=l(_,E,S)(),T[0]===wh)return T;E=typeof T[1]=="number"?T[1]:E+f}}return C}}}function rw(n){return Array.isArray(n)?n:typeof n=="number"?[nw,n]:n==null?U_:[n]}function Vh(n,r,s,o){let d,g,f;typeof r=="function"&&typeof s!="function"?(g=void 0,f=r,d=s):(g=r,f=s,d=o),P_(n,g,l,d);function l(c,h){const p=h[h.length-1],u=p?p.children.indexOf(c):void 0;return f(c,u,p)}}const xh={}.hasOwnProperty,sw={};function aw(n,r){const s=r||sw,o=new Map,d=new Map,g=new Map,f={...FC,...s.handlers},l={all:h,applyData:ow,definitionById:o,footnoteById:d,footnoteCounts:g,footnoteOrder:[],handlers:f,one:c,options:s,patch:lw,wrap:uw};return Vh(n,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const u=p.type==="definition"?o:d,b=String(p.identifier).toUpperCase();u.has(b)||u.set(b,p)}}),l;function c(p,u){const b=p.type,C=l.handlers[b];if(xh.call(l.handlers,b)&&C)return C(l,p,u);if(l.options.passThrough&&l.options.passThrough.includes(b)){if("children"in p){const{children:E,...S}=p,v=ko(S);return v.children=l.all(p),v}return ko(p)}return(l.options.unknownHandler||cw)(l,p,u)}function h(p){const u=[];if("children"in p){const b=p.children;let C=-1;for(;++C<b.length;){const T=l.one(b[C],p);if(T){if(C&&b[C-1].type==="break"&&(!Array.isArray(T)&&T.type==="text"&&(T.value=xg(T.value)),!Array.isArray(T)&&T.type==="element")){const E=T.children[0];E&&E.type==="text"&&(E.value=xg(E.value))}Array.isArray(T)?u.push(...T):u.push(T)}}}return u}}function lw(n,r){n.position&&(r.position=K1(n))}function ow(n,r){let s=r;if(n&&n.data){const o=n.data.hName,d=n.data.hChildren,g=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"&&g&&Object.assign(s.properties,ko(g)),"children"in s&&s.children&&d!==null&&d!==void 0&&(s.children=d)}return s}function cw(n,r){const s=r.data||{},o="value"in r&&!(xh.call(s,"hProperties")||xh.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 uw(n,r){const s=[];let o=-1;for(r&&s.push({type:"text",value:`
|
|
72
|
-
`});++o<n.length;)o&&s.push({type:"text",value:`
|
|
73
|
-
`}),s.push(n[o]);return r&&n.length>0&&s.push({type:"text",value:`
|
|
74
|
-
`}),s}function xg(n){let r=0,s=n.charCodeAt(r);for(;s===9||s===32;)r++,s=n.charCodeAt(r);return n.slice(r)}function Eg(n,r){const s=aw(n,r),o=s.one(n,void 0),d=XC(s),g=Array.isArray(o)?{type:"root",children:o}:o||{type:"root",children:[]};return d&&g.children.push({type:"text",value:`
|
|
75
|
-
`},d),g}function hw(n,r){return n&&"run"in n?async function(s,o){const d=Eg(s,{file:o,...r});await n.run(d,o)}:function(s,o){return Eg(s,{file:o,...n||r})}}function kg(n){if(n)throw n}var Qu,Ag;function fw(){if(Ag)return Qu;Ag=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]"},g=function(h){if(!h||r.call(h)!=="[object Object]")return!1;var p=n.call(h,"constructor"),u=h.constructor&&h.constructor.prototype&&n.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!p&&!u)return!1;var b;for(b in h);return typeof b>"u"||n.call(h,b)},f=function(h,p){s&&p.name==="__proto__"?s(h,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):h[p.name]=p.newValue},l=function(h,p){if(p==="__proto__")if(n.call(h,p)){if(o)return o(h,p).value}else return;return h[p]};return Qu=function c(){var h,p,u,b,C,T,E=arguments[0],S=1,v=arguments.length,_=!1;for(typeof E=="boolean"&&(_=E,E=arguments[1]||{},S=2),(E==null||typeof E!="object"&&typeof E!="function")&&(E={});S<v;++S)if(h=arguments[S],h!=null)for(p in h)u=l(E,p),b=l(h,p),E!==b&&(_&&b&&(g(b)||(C=d(b)))?(C?(C=!1,T=u&&d(u)?u:[]):T=u&&g(u)?u:{},f(E,{name:p,newValue:c(_,T,b)})):typeof b<"u"&&f(E,{name:p,newValue:b}));return E},Qu}var dw=fw();const Ju=Jg(dw);function Eh(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 pw(){const n=[],r={run:s,use:o};return r;function s(...d){let g=-1;const f=d.pop();if(typeof f!="function")throw new TypeError("Expected function as last argument, not "+f);l(null,...d);function l(c,...h){const p=n[++g];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,p?mw(p,l)(...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 mw(n,r){let s;return o;function o(...f){const l=n.length>f.length;let c;l&&f.push(d);try{c=n.apply(this,f)}catch(h){const p=h;if(l&&s)throw p;return d(p)}l||(c&&c.then&&typeof c.then=="function"?c.then(g,d):c instanceof Error?d(c):g(c))}function d(f,...l){s||(s=!0,r(f,...l))}function g(f){d(null,f)}}const fi={basename:gw,dirname:_w,extname:vw,join:yw,sep:"/"};function gw(n,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');el(n);let s=0,o=-1,d=n.length,g;if(r===void 0||r.length===0||r.length>n.length){for(;d--;)if(n.codePointAt(d)===47){if(g){s=d+1;break}}else o<0&&(g=!0,o=d+1);return o<0?"":n.slice(s,o)}if(r===n)return"";let f=-1,l=r.length-1;for(;d--;)if(n.codePointAt(d)===47){if(g){s=d+1;break}}else f<0&&(g=!0,f=d+1),l>-1&&(n.codePointAt(d)===r.codePointAt(l--)?l<0&&(o=d):(l=-1,o=f));return s===o?o=f:o<0&&(o=n.length),n.slice(s,o)}function _w(n){if(el(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 vw(n){el(n);let r=n.length,s=-1,o=0,d=-1,g=0,f;for(;r--;){const l=n.codePointAt(r);if(l===47){if(f){o=r+1;break}continue}s<0&&(f=!0,s=r+1),l===46?d<0?d=r:g!==1&&(g=1):d>-1&&(g=-1)}return d<0||s<0||g===0||g===1&&d===s-1&&d===o+1?"":n.slice(d,s)}function yw(...n){let r=-1,s;for(;++r<n.length;)el(n[r]),n[r]&&(s=s===void 0?n[r]:s+"/"+n[r]);return s===void 0?".":Sw(s)}function Sw(n){el(n);const r=n.codePointAt(0)===47;let s=bw(n,!r);return s.length===0&&!r&&(s="."),s.length>0&&n.codePointAt(n.length-1)===47&&(s+="/"),r?"/"+s:s}function bw(n,r){let s="",o=0,d=-1,g=0,f=-1,l,c;for(;++f<=n.length;){if(f<n.length)l=n.codePointAt(f);else{if(l===47)break;l=47}if(l===47){if(!(d===f-1||g===1))if(d!==f-1&&g===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,g=0;continue}}else if(s.length>0){s="",o=0,d=f,g=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,g=0}else l===46&&g>-1?g++:g=-1}return s}function el(n){if(typeof n!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(n))}const Cw={cwd:ww};function ww(){return"/"}function kh(n){return!!(n!==null&&typeof n=="object"&&"href"in n&&n.href&&"protocol"in n&&n.protocol&&n.auth===void 0)}function xw(n){if(typeof n=="string")n=new URL(n);else if(!kh(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 Ew(n)}function Ew(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 Zu=["history","path","basename","stem","extname","dirname"];class F_{constructor(r){let s;r?kh(r)?s={path:r}:typeof r=="string"||kw(r)?s={value:r}:s=r:s={},this.cwd="cwd"in s?"":Cw.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let o=-1;for(;++o<Zu.length;){const g=Zu[o];g in s&&s[g]!==void 0&&s[g]!==null&&(this[g]=g==="history"?[...s[g]]:s[g])}let d;for(d in s)Zu.includes(d)||(this[d]=s[d])}get basename(){return typeof this.path=="string"?fi.basename(this.path):void 0}set basename(r){th(r,"basename"),eh(r,"basename"),this.path=fi.join(this.dirname||"",r)}get dirname(){return typeof this.path=="string"?fi.dirname(this.path):void 0}set dirname(r){Tg(this.basename,"dirname"),this.path=fi.join(r||"",this.basename)}get extname(){return typeof this.path=="string"?fi.extname(this.path):void 0}set extname(r){if(eh(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=fi.join(this.dirname,this.stem+(r||""))}get path(){return this.history[this.history.length-1]}set path(r){kh(r)&&(r=xw(r)),th(r,"path"),this.path!==r&&this.history.push(r)}get stem(){return typeof this.path=="string"?fi.basename(this.path,this.extname):void 0}set stem(r){th(r,"stem"),eh(r,"stem"),this.path=fi.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 Zt(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 eh(n,r){if(n&&n.includes(fi.sep))throw new Error("`"+r+"` cannot be a path: did not expect `"+fi.sep+"`")}function th(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 kw(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const Aw=(function(n){const o=this.constructor.prototype,d=o[n],g=function(){return d.apply(g,arguments)};return Object.setPrototypeOf(g,o),g}),Tw={}.hasOwnProperty;class Wh extends Aw{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=pw()}copy(){const r=new Wh;let s=-1;for(;++s<this.attachers.length;){const o=this.attachers[s];r.use(...o)}return r.data(Ju(!0,{},this.namespace)),r}data(r,s){return typeof r=="string"?arguments.length===2?(rh("data",this.frozen),this.namespace[r]=s,this):Tw.call(this.namespace,r)&&this.namespace[r]||void 0:r?(rh("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=_o(r),o=this.parser||this.Parser;return nh("parse",o),o(String(s),s)}process(r,s){const o=this;return this.freeze(),nh("process",this.parser||this.Parser),ih("process",this.compiler||this.Compiler),s?d(void 0,s):new Promise(d);function d(g,f){const l=_o(r),c=o.parse(l);o.run(c,l,function(p,u,b){if(p||!u||!b)return h(p);const C=u,T=o.stringify(C,b);Mw(T)?b.value=T:b.result=T,h(p,b)});function h(p,u){p||!u?f(p):g?g(u):s(void 0,u)}}}processSync(r){let s=!1,o;return this.freeze(),nh("processSync",this.parser||this.Parser),ih("processSync",this.compiler||this.Compiler),this.process(r,d),Dg("processSync","process",s),o;function d(g,f){s=!0,kg(g),o=f}}run(r,s,o){Rg(r),this.freeze();const d=this.transformers;return!o&&typeof s=="function"&&(o=s,s=void 0),o?g(void 0,o):new Promise(g);function g(f,l){const c=_o(s);d.run(r,c,h);function h(p,u,b){const C=u||r;p?l(p):f?f(C):o(void 0,C,b)}}}runSync(r,s){let o=!1,d;return this.run(r,s,g),Dg("runSync","run",o),d;function g(f,l){kg(f),d=l,o=!0}}stringify(r,s){this.freeze();const o=_o(s),d=this.compiler||this.Compiler;return ih("stringify",d),Rg(r),d(r,o)}use(r,...s){const o=this.attachers,d=this.namespace;if(rh("use",this.frozen),r!=null)if(typeof r=="function")c(r,s);else if(typeof r=="object")Array.isArray(r)?l(r):f(r);else throw new TypeError("Expected usable value, not `"+r+"`");return this;function g(h){if(typeof h=="function")c(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[p,...u]=h;c(p,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");l(h.plugins),h.settings&&(d.settings=Ju(!0,d.settings,h.settings))}function l(h){let p=-1;if(h!=null)if(Array.isArray(h))for(;++p<h.length;){const u=h[p];g(u)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function c(h,p){let u=-1,b=-1;for(;++u<o.length;)if(o[u][0]===h){b=u;break}if(b===-1)o.push([h,...p]);else if(p.length>0){let[C,...T]=p;const E=o[b][1];Eh(E)&&Eh(C)&&(C=Ju(!0,E,C)),o[b]=[h,C,...T]}}}}const Rw=new Wh().freeze();function nh(n,r){if(typeof r!="function")throw new TypeError("Cannot `"+n+"` without `parser`")}function ih(n,r){if(typeof r!="function")throw new TypeError("Cannot `"+n+"` without `compiler`")}function rh(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 Rg(n){if(!Eh(n)||typeof n.type!="string")throw new TypeError("Expected node, got `"+n+"`")}function Dg(n,r,s){if(!s)throw new Error("`"+n+"` finished async. Use `"+r+"` instead")}function _o(n){return Dw(n)?n:new F_(n)}function Dw(n){return!!(n&&typeof n=="object"&&"message"in n&&"messages"in n)}function Mw(n){return typeof n=="string"||Lw(n)}function Lw(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const Ow="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Mg=[],Lg={allowDangerousHtml:!0},Bw=/^(https?|ircs?|mailto|xmpp)$/i,jw=[{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 q_(n){const r=Nw(n),s=Hw(n);return zw(r.runSync(r.parse(s),s),n)}function Nw(n){const r=n.rehypePlugins||Mg,s=n.remarkPlugins||Mg,o=n.remarkRehypeOptions?{...n.remarkRehypeOptions,...Lg}:Lg;return Rw().use(gC).use(s).use(hw,o).use(r)}function Hw(n){const r=n.children||"",s=new F_;return typeof r=="string"&&(s.value=r),s}function zw(n,r){const s=r.allowedElements,o=r.allowElement,d=r.components,g=r.disallowedElements,f=r.skipHtml,l=r.unwrapDisallowed,c=r.urlTransform||Iw;for(const p of jw)Object.hasOwn(r,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+Ow+p.id,void 0);return Vh(n,h),Z1(n,{Fragment:x.Fragment,components:d,ignoreInvalidStyle:!0,jsx:x.jsx,jsxs:x.jsxs,passKeys:!0,passNode:!0});function h(p,u,b){if(p.type==="raw"&&b&&typeof u=="number")return f?b.children.splice(u,1):b.children[u]={type:"text",value:p.value},u;if(p.type==="element"){let C;for(C in Ku)if(Object.hasOwn(Ku,C)&&Object.hasOwn(p.properties,C)){const T=p.properties[C],E=Ku[C];(E===null||E.includes(p.tagName))&&(p.properties[C]=c(String(T||""),C,p))}}if(p.type==="element"){let C=s?!s.includes(p.tagName):g?g.includes(p.tagName):!1;if(!C&&o&&typeof u=="number"&&(C=!o(p,u,b)),C&&b&&typeof u=="number")return l&&p.children?b.children.splice(u,1,...p.children):b.children.splice(u,1),u}}}function Iw(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||Bw.test(n.slice(0,r))?n:""}function Og(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 Uw(n){if(typeof n!="string")throw new TypeError("Expected a string");return n.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Pw(n,r,s){const d=No((s||{}).ignore||[]),g=Fw(r);let f=-1;for(;++f<g.length;)P_(n,"text",l);function l(h,p){let u=-1,b;for(;++u<p.length;){const C=p[u],T=b?b.children:void 0;if(d(C,T?T.indexOf(C):void 0,b))return;b=C}if(b)return c(h,p)}function c(h,p){const u=p[p.length-1],b=g[f][0],C=g[f][1];let T=0;const S=u.children.indexOf(h);let v=!1,_=[];b.lastIndex=0;let y=b.exec(h.value);for(;y;){const A=y.index,L={index:y.index,input:y.input,stack:[...p,h]};let D=C(...y,L);if(typeof D=="string"&&(D=D.length>0?{type:"text",value:D}:void 0),D===!1?b.lastIndex=A+1:(T!==A&&_.push({type:"text",value:h.value.slice(T,A)}),Array.isArray(D)?_.push(...D):D&&_.push(D),T=A+y[0].length,v=!0),!b.global)break;y=b.exec(h.value)}return v?(T<h.value.length&&_.push({type:"text",value:h.value.slice(T)}),u.children.splice(S,1,..._)):_=[h],S+_.length}}function Fw(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([qw(d[0]),$w(d[1])])}return r}function qw(n){return typeof n=="string"?new RegExp(Uw(n),"g"):n}function $w(n){return typeof n=="function"?n:function(){return n}}const sh="phrasing",ah=["autolink","link","image","label"];function Gw(){return{transforms:[Jw],enter:{literalAutolink:Ww,literalAutolinkEmail:lh,literalAutolinkHttp:lh,literalAutolinkWww:lh},exit:{literalAutolink:Qw,literalAutolinkEmail:Xw,literalAutolinkHttp:Kw,literalAutolinkWww:Yw}}}function Vw(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:sh,notInConstruct:ah},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:sh,notInConstruct:ah},{character:":",before:"[ps]",after:"\\/",inConstruct:sh,notInConstruct:ah}]}}function Ww(n){this.enter({type:"link",title:null,url:"",children:[]},n)}function lh(n){this.config.enter.autolinkProtocol.call(this,n)}function Kw(n){this.config.exit.autolinkProtocol.call(this,n)}function Yw(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 Xw(n){this.config.exit.autolinkEmail.call(this,n)}function Qw(n){this.exit(n)}function Jw(n){Pw(n,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Zw],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),ex]],{ignore:["link","linkReference"]})}function Zw(n,r,s,o,d){let g="";if(!$_(d)||(/^w/i.test(r)&&(s=r+s,r="",g="http://"),!tx(s)))return!1;const f=nx(s+o);if(!f[0])return!1;const l={type:"link",title:null,url:g+r+f[0],children:[{type:"text",value:r+f[0]}]};return f[1]?[l,{type:"text",value:f[1]}]:l}function ex(n,r,s,o){return!$_(o,!0)||/[-\d_]$/.test(s)?!1:{type:"link",title:null,url:"mailto:"+r+"@"+s,children:[{type:"text",value:r+"@"+s}]}}function tx(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 nx(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=Og(n,"(");let g=Og(n,")");for(;o!==-1&&d>g;)n+=s.slice(0,o+1),s=s.slice(o+1),o=s.indexOf(")"),g++;return[n,s]}function $_(n,r){const s=n.input.charCodeAt(n.index-1);return(n.index===0||Ir(s)||Oo(s))&&(!r||s!==47)}G_.peek=hx;function ix(){this.buffer()}function rx(n){this.enter({type:"footnoteReference",identifier:"",label:""},n)}function sx(){this.buffer()}function ax(n){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},n)}function lx(n){const r=this.resume(),s=this.stack[this.stack.length-1];s.type,s.identifier=ii(this.sliceSerialize(n)).toLowerCase(),s.label=r}function ox(n){this.exit(n)}function cx(n){const r=this.resume(),s=this.stack[this.stack.length-1];s.type,s.identifier=ii(this.sliceSerialize(n)).toLowerCase(),s.label=r}function ux(n){this.exit(n)}function hx(){return"["}function G_(n,r,s,o){const d=s.createTracker(o);let g=d.move("[^");const f=s.enter("footnoteReference"),l=s.enter("reference");return g+=d.move(s.safe(s.associationId(n),{after:"]",before:g})),l(),f(),g+=d.move("]"),g}function fx(){return{enter:{gfmFootnoteCallString:ix,gfmFootnoteCall:rx,gfmFootnoteDefinitionLabelString:sx,gfmFootnoteDefinition:ax},exit:{gfmFootnoteCallString:lx,gfmFootnoteCall:ox,gfmFootnoteDefinitionLabelString:cx,gfmFootnoteDefinition:ux}}}function dx(n){let r=!1;return n&&n.firstLineBlank&&(r=!0),{handlers:{footnoteDefinition:s,footnoteReference:G_},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function s(o,d,g,f){const l=g.createTracker(f);let c=l.move("[^");const h=g.enter("footnoteDefinition"),p=g.enter("label");return c+=l.move(g.safe(g.associationId(o),{before:c,after:"]"})),p(),c+=l.move("]:"),o.children&&o.children.length>0&&(l.shift(4),c+=l.move((r?`
|
|
76
|
-
`:" ")+g.indentLines(g.containerFlow(o,l.current()),r?V_:px))),h(),c}}function px(n,r,s){return r===0?n:V_(n,r,s)}function V_(n,r,s){return(s?"":" ")+n}const mx=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];W_.peek=Sx;function gx(){return{canContainEols:["delete"],enter:{strikethrough:vx},exit:{strikethrough:yx}}}function _x(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:mx}],handlers:{delete:W_}}}function vx(n){this.enter({type:"delete",children:[]},n)}function yx(n){this.exit(n)}function W_(n,r,s,o){const d=s.createTracker(o),g=s.enter("strikethrough");let f=d.move("~~");return f+=s.containerPhrasing(n,{...d.current(),before:f,after:"~"}),f+=d.move("~~"),g(),f}function Sx(){return"~"}function bx(n){return n.length}function Cx(n,r){const s=r||{},o=(s.align||[]).concat(),d=s.stringLength||bx,g=[],f=[],l=[],c=[];let h=0,p=-1;for(;++p<n.length;){const E=[],S=[];let v=-1;for(n[p].length>h&&(h=n[p].length);++v<n[p].length;){const _=wx(n[p][v]);if(s.alignDelimiters!==!1){const y=d(_);S[v]=y,(c[v]===void 0||y>c[v])&&(c[v]=y)}E.push(_)}f[p]=E,l[p]=S}let u=-1;if(typeof o=="object"&&"length"in o)for(;++u<h;)g[u]=Bg(o[u]);else{const E=Bg(o);for(;++u<h;)g[u]=E}u=-1;const b=[],C=[];for(;++u<h;){const E=g[u];let S="",v="";E===99?(S=":",v=":"):E===108?S=":":E===114&&(v=":");let _=s.alignDelimiters===!1?1:Math.max(1,c[u]-S.length-v.length);const y=S+"-".repeat(_)+v;s.alignDelimiters!==!1&&(_=S.length+_+v.length,_>c[u]&&(c[u]=_),C[u]=_),b[u]=y}f.splice(1,0,b),l.splice(1,0,C),p=-1;const T=[];for(;++p<f.length;){const E=f[p],S=l[p];u=-1;const v=[];for(;++u<h;){const _=E[u]||"";let y="",A="";if(s.alignDelimiters!==!1){const L=c[u]-(S[u]||0),D=g[u];D===114?y=" ".repeat(L):D===99?L%2?(y=" ".repeat(L/2+.5),A=" ".repeat(L/2-.5)):(y=" ".repeat(L/2),A=y):A=" ".repeat(L)}s.delimiterStart!==!1&&!u&&v.push("|"),s.padding!==!1&&!(s.alignDelimiters===!1&&_==="")&&(s.delimiterStart!==!1||u)&&v.push(" "),s.alignDelimiters!==!1&&v.push(y),v.push(_),s.alignDelimiters!==!1&&v.push(A),s.padding!==!1&&v.push(" "),(s.delimiterEnd!==!1||u!==h-1)&&v.push("|")}T.push(s.delimiterEnd===!1?v.join("").replace(/ +$/,""):v.join(""))}return T.join(`
|
|
77
|
-
`)}function wx(n){return n==null?"":String(n)}function Bg(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 xx(n,r,s,o){const d=s.enter("blockquote"),g=s.createTracker(o);g.move("> "),g.shift(2);const f=s.indentLines(s.containerFlow(n,g.current()),Ex);return d(),f}function Ex(n,r,s){return">"+(s?"":" ")+n}function kx(n,r){return jg(n,r.inConstruct,!0)&&!jg(n,r.notInConstruct,!1)}function jg(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 Ng(n,r,s,o){let d=-1;for(;++d<s.unsafe.length;)if(s.unsafe[d].character===`
|
|
78
|
-
`&&kx(s.stack,s.unsafe[d]))return/[ \t]/.test(o.before)?"":" ";return`\\
|
|
79
|
-
`}function Ax(n,r){const s=String(n);let o=s.indexOf(r),d=o,g=0,f=0;if(typeof r!="string")throw new TypeError("Expected substring");for(;o!==-1;)o===d?++g>f&&(f=g):g=1,d=o+r.length,o=s.indexOf(r,d);return f}function Tx(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 Rx(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 Dx(n,r,s,o){const d=Rx(s),g=n.value||"",f=d==="`"?"GraveAccent":"Tilde";if(Tx(n,s)){const u=s.enter("codeIndented"),b=s.indentLines(g,Mx);return u(),b}const l=s.createTracker(o),c=d.repeat(Math.max(Ax(g,d)+1,3)),h=s.enter("codeFenced");let p=l.move(c);if(n.lang){const u=s.enter(`codeFencedLang${f}`);p+=l.move(s.safe(n.lang,{before:p,after:" ",encode:["`"],...l.current()})),u()}if(n.lang&&n.meta){const u=s.enter(`codeFencedMeta${f}`);p+=l.move(" "),p+=l.move(s.safe(n.meta,{before:p,after:`
|
|
80
|
-
`,encode:["`"],...l.current()})),u()}return p+=l.move(`
|
|
81
|
-
`),g&&(p+=l.move(g+`
|
|
82
|
-
`)),p+=l.move(c),h(),p}function Mx(n,r,s){return(s?"":" ")+n}function Kh(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 Lx(n,r,s,o){const d=Kh(s),g=d==='"'?"Quote":"Apostrophe",f=s.enter("definition");let l=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("]: "),l(),!n.url||/[\0- \u007F]/.test(n.url)?(l=s.enter("destinationLiteral"),h+=c.move("<"),h+=c.move(s.safe(n.url,{before:h,after:">",...c.current()})),h+=c.move(">")):(l=s.enter("destinationRaw"),h+=c.move(s.safe(n.url,{before:h,after:n.title?" ":`
|
|
83
|
-
`,...c.current()}))),l(),n.title&&(l=s.enter(`title${g}`),h+=c.move(" "+d),h+=c.move(s.safe(n.title,{before:h,after:d,...c.current()})),h+=c.move(d),l()),f(),h}function Ox(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 Xa(n){return"&#x"+n.toString(16).toUpperCase()+";"}function Ao(n,r,s){const o=Is(n),d=Is(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}}K_.peek=Bx;function K_(n,r,s,o){const d=Ox(s),g=s.enter("emphasis"),f=s.createTracker(o),l=f.move(d);let c=f.move(s.containerPhrasing(n,{after:d,before:l,...f.current()}));const h=c.charCodeAt(0),p=Ao(o.before.charCodeAt(o.before.length-1),h,d);p.inside&&(c=Xa(h)+c.slice(1));const u=c.charCodeAt(c.length-1),b=Ao(o.after.charCodeAt(0),u,d);b.inside&&(c=c.slice(0,-1)+Xa(u));const C=f.move(d);return g(),s.attentionEncodeSurroundingInfo={after:b.outside,before:p.outside},l+c+C}function Bx(n,r,s){return s.options.emphasis||"*"}function jx(n,r){let s=!1;return Vh(n,function(o){if("value"in o&&/\r?\n|\r/.test(o.value)||o.type==="break")return s=!0,wh}),!!((!n.depth||n.depth<3)&&Ih(n)&&(r.options.setext||s))}function Nx(n,r,s,o){const d=Math.max(Math.min(6,n.depth||1),1),g=s.createTracker(o);if(jx(n,s)){const p=s.enter("headingSetext"),u=s.enter("phrasing"),b=s.containerPhrasing(n,{...g.current(),before:`
|
|
84
|
-
`,after:`
|
|
85
|
-
`});return u(),p(),b+`
|
|
86
|
-
`+(d===1?"=":"-").repeat(b.length-(Math.max(b.lastIndexOf("\r"),b.lastIndexOf(`
|
|
87
|
-
`))+1))}const f="#".repeat(d),l=s.enter("headingAtx"),c=s.enter("phrasing");g.move(f+" ");let h=s.containerPhrasing(n,{before:"# ",after:`
|
|
88
|
-
`,...g.current()});return/^[\t ]/.test(h)&&(h=Xa(h.charCodeAt(0))+h.slice(1)),h=h?f+" "+h:f,s.options.closeAtx&&(h+=" "+f),c(),l(),h}Y_.peek=Hx;function Y_(n){return n.value||""}function Hx(){return"<"}X_.peek=zx;function X_(n,r,s,o){const d=Kh(s),g=d==='"'?"Quote":"Apostrophe",f=s.enter("image");let l=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("]("),l(),!n.url&&n.title||/[\0- \u007F]/.test(n.url)?(l=s.enter("destinationLiteral"),h+=c.move("<"),h+=c.move(s.safe(n.url,{before:h,after:">",...c.current()})),h+=c.move(">")):(l=s.enter("destinationRaw"),h+=c.move(s.safe(n.url,{before:h,after:n.title?" ":")",...c.current()}))),l(),n.title&&(l=s.enter(`title${g}`),h+=c.move(" "+d),h+=c.move(s.safe(n.title,{before:h,after:d,...c.current()})),h+=c.move(d),l()),h+=c.move(")"),f(),h}function zx(){return"!"}Q_.peek=Ix;function Q_(n,r,s,o){const d=n.referenceType,g=s.enter("imageReference");let f=s.enter("label");const l=s.createTracker(o);let c=l.move("![");const h=s.safe(n.alt,{before:c,after:"]",...l.current()});c+=l.move(h+"]["),f();const p=s.stack;s.stack=[],f=s.enter("reference");const u=s.safe(s.associationId(n),{before:c,after:"]",...l.current()});return f(),s.stack=p,g(),d==="full"||!h||h!==u?c+=l.move(u+"]"):d==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function Ix(){return"!"}J_.peek=Ux;function J_(n,r,s){let o=n.value||"",d="`",g=-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+" ");++g<s.unsafe.length;){const f=s.unsafe[g],l=s.compilePattern(f);let c;if(f.atBreak)for(;c=l.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 Ux(){return"`"}function Z_(n,r){const s=Ih(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))}ev.peek=Px;function ev(n,r,s,o){const d=Kh(s),g=d==='"'?"Quote":"Apostrophe",f=s.createTracker(o);let l,c;if(Z_(n,s)){const p=s.stack;s.stack=[],l=s.enter("autolink");let u=f.move("<");return u+=f.move(s.containerPhrasing(n,{before:u,after:">",...f.current()})),u+=f.move(">"),l(),s.stack=p,u}l=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${g}`),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(")"),l(),h}function Px(n,r,s){return Z_(n,s)?"<":"["}tv.peek=Fx;function tv(n,r,s,o){const d=n.referenceType,g=s.enter("linkReference");let f=s.enter("label");const l=s.createTracker(o);let c=l.move("[");const h=s.containerPhrasing(n,{before:c,after:"]",...l.current()});c+=l.move(h+"]["),f();const p=s.stack;s.stack=[],f=s.enter("reference");const u=s.safe(s.associationId(n),{before:c,after:"]",...l.current()});return f(),s.stack=p,g(),d==="full"||!h||h!==u?c+=l.move(u+"]"):d==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function Fx(){return"["}function Yh(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 qx(n){const r=Yh(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 $x(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 nv(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 Gx(n,r,s,o){const d=s.enter("list"),g=s.bulletCurrent;let f=n.ordered?$x(s):Yh(s);const l=n.ordered?f==="."?")":".":qx(s);let c=r&&s.bulletLastUsed?f===s.bulletLastUsed:!1;if(!n.ordered){const p=n.children?n.children[0]:void 0;if((f==="*"||f==="-")&&p&&(!p.children||!p.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),nv(s)===f&&p){let u=-1;for(;++u<n.children.length;){const b=n.children[u];if(b&&b.type==="listItem"&&b.children&&b.children[0]&&b.children[0].type==="thematicBreak"){c=!0;break}}}}c&&(f=l),s.bulletCurrent=f;const h=s.containerFlow(n,o);return s.bulletLastUsed=f,s.bulletCurrent=g,d(),h}function Vx(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 Wx(n,r,s,o){const d=Vx(s);let g=s.bulletCurrent||Yh(s);r&&r.type==="list"&&r.ordered&&(g=(typeof r.start=="number"&&r.start>-1?r.start:1)+(s.options.incrementListMarker===!1?0:r.children.indexOf(n))+g);let f=g.length+1;(d==="tab"||d==="mixed"&&(r&&r.type==="list"&&r.spread||n.spread))&&(f=Math.ceil(f/4)*4);const l=s.createTracker(o);l.move(g+" ".repeat(f-g.length)),l.shift(f);const c=s.enter("listItem"),h=s.indentLines(s.containerFlow(n,l.current()),p);return c(),h;function p(u,b,C){return b?(C?"":" ".repeat(f))+u:(C?g:g+" ".repeat(f-g.length))+u}}function Kx(n,r,s,o){const d=s.enter("paragraph"),g=s.enter("phrasing"),f=s.containerPhrasing(n,o);return g(),d(),f}const Yx=No(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Xx(n,r,s,o){return(n.children.some(function(f){return Yx(f)})?s.containerPhrasing:s.containerFlow).call(s,n,o)}function Qx(n){const r=n.options.strong||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize strong with `"+r+"` for `options.strong`, expected `*`, or `_`");return r}iv.peek=Jx;function iv(n,r,s,o){const d=Qx(s),g=s.enter("strong"),f=s.createTracker(o),l=f.move(d+d);let c=f.move(s.containerPhrasing(n,{after:d,before:l,...f.current()}));const h=c.charCodeAt(0),p=Ao(o.before.charCodeAt(o.before.length-1),h,d);p.inside&&(c=Xa(h)+c.slice(1));const u=c.charCodeAt(c.length-1),b=Ao(o.after.charCodeAt(0),u,d);b.inside&&(c=c.slice(0,-1)+Xa(u));const C=f.move(d+d);return g(),s.attentionEncodeSurroundingInfo={after:b.outside,before:p.outside},l+c+C}function Jx(n,r,s){return s.options.strong||"*"}function Zx(n,r,s,o){return s.safe(n.value,o)}function eE(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 tE(n,r,s){const o=(nv(s)+(s.options.ruleSpaces?" ":"")).repeat(eE(s));return s.options.ruleSpaces?o.slice(0,-1):o}const rv={blockquote:xx,break:Ng,code:Dx,definition:Lx,emphasis:K_,hardBreak:Ng,heading:Nx,html:Y_,image:X_,imageReference:Q_,inlineCode:J_,link:ev,linkReference:tv,list:Gx,listItem:Wx,paragraph:Kx,root:Xx,strong:iv,text:Zx,thematicBreak:tE};function nE(){return{enter:{table:iE,tableData:Hg,tableHeader:Hg,tableRow:sE},exit:{codeText:aE,table:rE,tableData:oh,tableHeader:oh,tableRow:oh}}}function iE(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 rE(n){this.exit(n),this.data.inTable=void 0}function sE(n){this.enter({type:"tableRow",children:[]},n)}function oh(n){this.exit(n)}function Hg(n){this.enter({type:"tableCell",children:[]},n)}function aE(n){let r=this.resume();this.data.inTable&&(r=r.replace(/\\([\\|])/g,lE));const s=this.stack[this.stack.length-1];s.type,s.value=r,this.exit(n)}function lE(n,r){return r==="|"?r:n}function oE(n){const r=n||{},s=r.tableCellPadding,o=r.tablePipeAlign,d=r.stringLength,g=s?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
89
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:b,table:f,tableCell:c,tableRow:l}};function f(C,T,E,S){return h(p(C,E,S),C.align)}function l(C,T,E,S){const v=u(C,E,S),_=h([v]);return _.slice(0,_.indexOf(`
|
|
90
|
-
`))}function c(C,T,E,S){const v=E.enter("tableCell"),_=E.enter("phrasing"),y=E.containerPhrasing(C,{...S,before:g,after:g});return _(),v(),y}function h(C,T){return Cx(C,{align:T,alignDelimiters:o,padding:s,stringLength:d})}function p(C,T,E){const S=C.children;let v=-1;const _=[],y=T.enter("table");for(;++v<S.length;)_[v]=u(S[v],T,E);return y(),_}function u(C,T,E){const S=C.children;let v=-1;const _=[],y=T.enter("tableRow");for(;++v<S.length;)_[v]=c(S[v],C,T,E);return y(),_}function b(C,T,E){let S=rv.inlineCode(C,T,E);return E.stack.includes("tableCell")&&(S=S.replace(/\|/g,"\\$&")),S}}function cE(){return{exit:{taskListCheckValueChecked:zg,taskListCheckValueUnchecked:zg,paragraph:hE}}}function uE(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:fE}}}function zg(n){const r=this.stack[this.stack.length-2];r.type,r.checked=n.type==="taskListCheckValueChecked"}function hE(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 g=-1,f;for(;++g<d.length;){const l=d[g];if(l.type==="paragraph"){f=l;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 fE(n,r,s,o){const d=n.children[0],g=typeof n.checked=="boolean"&&d&&d.type==="paragraph",f="["+(n.checked?"x":" ")+"] ",l=s.createTracker(o);g&&l.move(f);let c=rv.listItem(n,r,s,{...o,...l.current()});return g&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),c;function h(p){return p+f}}function dE(){return[Gw(),fx(),gx(),nE(),cE()]}function pE(n){return{extensions:[Vw(),dx(n),_x(),oE(n),uE()]}}const mE={tokenize:bE,partial:!0},sv={tokenize:CE,partial:!0},av={tokenize:wE,partial:!0},lv={tokenize:xE,partial:!0},gE={tokenize:EE,partial:!0},ov={name:"wwwAutolink",tokenize:yE,previous:uv},cv={name:"protocolAutolink",tokenize:SE,previous:hv},Ni={name:"emailAutolink",tokenize:vE,previous:fv},pi={};function _E(){return{text:pi}}let Nr=48;for(;Nr<123;)pi[Nr]=Ni,Nr++,Nr===58?Nr=65:Nr===91&&(Nr=97);pi[43]=Ni;pi[45]=Ni;pi[46]=Ni;pi[95]=Ni;pi[72]=[Ni,cv];pi[104]=[Ni,cv];pi[87]=[Ni,ov];pi[119]=[Ni,ov];function vE(n,r,s){const o=this;let d,g;return f;function f(u){return!Ah(u)||!fv.call(o,o.previous)||Xh(o.events)?s(u):(n.enter("literalAutolink"),n.enter("literalAutolinkEmail"),l(u))}function l(u){return Ah(u)?(n.consume(u),l):u===64?(n.consume(u),c):s(u)}function c(u){return u===46?n.check(gE,p,h)(u):u===45||u===95||Jt(u)?(g=!0,n.consume(u),c):p(u)}function h(u){return n.consume(u),d=!0,c}function p(u){return g&&d&&rn(o.previous)?(n.exit("literalAutolinkEmail"),n.exit("literalAutolink"),r(u)):s(u)}}function yE(n,r,s){const o=this;return d;function d(f){return f!==87&&f!==119||!uv.call(o,o.previous)||Xh(o.events)?s(f):(n.enter("literalAutolink"),n.enter("literalAutolinkWww"),n.check(mE,n.attempt(sv,n.attempt(av,g),s),s)(f))}function g(f){return n.exit("literalAutolinkWww"),n.exit("literalAutolink"),r(f)}}function SE(n,r,s){const o=this;let d="",g=!1;return f;function f(u){return(u===72||u===104)&&hv.call(o,o.previous)&&!Xh(o.events)?(n.enter("literalAutolink"),n.enter("literalAutolinkHttp"),d+=String.fromCodePoint(u),n.consume(u),l):s(u)}function l(u){if(rn(u)&&d.length<5)return d+=String.fromCodePoint(u),n.consume(u),l;if(u===58){const b=d.toLowerCase();if(b==="http"||b==="https")return n.consume(u),c}return s(u)}function c(u){return u===47?(n.consume(u),g?h:(g=!0,c)):s(u)}function h(u){return u===null||xo(u)||ot(u)||Ir(u)||Oo(u)?s(u):n.attempt(sv,n.attempt(av,p),s)(u)}function p(u){return n.exit("literalAutolinkHttp"),n.exit("literalAutolink"),r(u)}}function bE(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),g):s(f)}function g(f){return f===null?s(f):r(f)}}function CE(n,r,s){let o,d,g;return f;function f(h){return h===46||h===95?n.check(lv,c,l)(h):h===null||ot(h)||Ir(h)||h!==45&&Oo(h)?c(h):(g=!0,n.consume(h),f)}function l(h){return h===95?o=!0:(d=o,o=void 0),n.consume(h),f}function c(h){return d||o||!g?s(h):r(h)}}function wE(n,r){let s=0,o=0;return d;function d(f){return f===40?(s++,n.consume(f),d):f===41&&o<s?g(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(lv,r,g)(f):f===null||ot(f)||Ir(f)?r(f):(n.consume(f),d)}function g(f){return f===41&&o++,n.consume(f),d}}function xE(n,r,s){return o;function o(l){return l===33||l===34||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===63||l===95||l===126?(n.consume(l),o):l===38?(n.consume(l),g):l===93?(n.consume(l),d):l===60||l===null||ot(l)||Ir(l)?r(l):s(l)}function d(l){return l===null||l===40||l===91||ot(l)||Ir(l)?r(l):o(l)}function g(l){return rn(l)?f(l):s(l)}function f(l){return l===59?(n.consume(l),o):rn(l)?(n.consume(l),f):s(l)}}function EE(n,r,s){return o;function o(g){return n.consume(g),d}function d(g){return Jt(g)?s(g):r(g)}}function uv(n){return n===null||n===40||n===42||n===95||n===91||n===93||n===126||ot(n)}function hv(n){return!rn(n)}function fv(n){return!(n===47||Ah(n))}function Ah(n){return n===43||n===45||n===46||n===95||Jt(n)}function Xh(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 kE={tokenize:BE,partial:!0};function AE(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:ME,continuation:{tokenize:LE},exit:OE}},text:{91:{name:"gfmFootnoteCall",tokenize:DE},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:TE,resolveTo:RE}}}}function TE(n,r,s){const o=this;let d=o.events.length;const g=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 l;function l(c){if(!f||!f._balanced)return s(c);const h=ii(o.sliceSerialize({start:f.end,end:o.now()}));return h.codePointAt(0)!==94||!g.includes(h.slice(1))?s(c):(n.enter("gfmFootnoteCallLabelMarker"),n.consume(c),n.exit("gfmFootnoteCallLabelMarker"),r(c))}}function RE(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 g={type:"gfmFootnoteCallString",start:Object.assign({},d.end),end:Object.assign({},n[n.length-1][1].start)},f={type:"chunkString",contentType:"string",start:Object.assign({},g.start),end:Object.assign({},g.end)},l=[n[s+1],n[s+2],["enter",o,r],n[s+3],n[s+4],["enter",d,r],["exit",d,r],["enter",g,r],["enter",f,r],["exit",f,r],["exit",g,r],n[n.length-2],n[n.length-1],["exit",o,r]];return n.splice(s,n.length-s+1,...l),n}function DE(n,r,s){const o=this,d=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]);let g=0,f;return l;function l(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(g>999||u===93&&!f||u===null||u===91||ot(u))return s(u);if(u===93){n.exit("chunkString");const b=n.exit("gfmFootnoteCallString");return d.includes(ii(o.sliceSerialize(b)))?(n.enter("gfmFootnoteCallLabelMarker"),n.consume(u),n.exit("gfmFootnoteCallLabelMarker"),n.exit("gfmFootnoteCall"),r):s(u)}return ot(u)||(f=!0),g++,n.consume(u),u===92?p:h}function p(u){return u===91||u===92||u===93?(n.consume(u),g++,h):h(u)}}function ME(n,r,s){const o=this,d=o.parser.gfmFootnotes||(o.parser.gfmFootnotes=[]);let g,f=0,l;return c;function c(T){return n.enter("gfmFootnoteDefinition")._container=!0,n.enter("gfmFootnoteDefinitionLabel"),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(T),n.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(T){return T===94?(n.enter("gfmFootnoteDefinitionMarker"),n.consume(T),n.exit("gfmFootnoteDefinitionMarker"),n.enter("gfmFootnoteDefinitionLabelString"),n.enter("chunkString").contentType="string",p):s(T)}function p(T){if(f>999||T===93&&!l||T===null||T===91||ot(T))return s(T);if(T===93){n.exit("chunkString");const E=n.exit("gfmFootnoteDefinitionLabelString");return g=ii(o.sliceSerialize(E)),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(T),n.exit("gfmFootnoteDefinitionLabelMarker"),n.exit("gfmFootnoteDefinitionLabel"),b}return ot(T)||(l=!0),f++,n.consume(T),T===92?u:p}function u(T){return T===91||T===92||T===93?(n.consume(T),f++,p):p(T)}function b(T){return T===58?(n.enter("definitionMarker"),n.consume(T),n.exit("definitionMarker"),d.includes(g)||d.push(g),Ye(n,C,"gfmFootnoteDefinitionWhitespace")):s(T)}function C(T){return r(T)}}function LE(n,r,s){return n.check(Za,r,n.attempt(kE,r,s))}function OE(n){n.exit("gfmFootnoteDefinition")}function BE(n,r,s){const o=this;return Ye(n,d,"gfmFootnoteDefinitionIndent",5);function d(g){const f=o.events[o.events.length-1];return f&&f[1].type==="gfmFootnoteDefinitionIndent"&&f[2].sliceSerialize(f[1],!0).length===4?r(g):s(g)}}function jE(n){let s=(n||{}).singleTilde;const o={name:"strikethrough",tokenize:g,resolveAll:d};return s==null&&(s=!0),{text:{126:o},insideSpan:{null:[o]},attentionMarkers:{null:[126]}};function d(f,l){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 p={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)},b=[["enter",p,l],["enter",f[h][1],l],["exit",f[h][1],l],["enter",u,l]],C=l.parser.constructs.insideSpan.null;C&&Ln(b,b.length,0,Bo(C,f.slice(h+1,c),l)),Ln(b,b.length,0,[["exit",u,l],["enter",f[c][1],l],["exit",f[c][1],l],["exit",p,l]]),Ln(f,h-1,c-h+3,b),c=h+b.length-2;break}}for(c=-1;++c<f.length;)f[c][1].type==="strikethroughSequenceTemporary"&&(f[c][1].type="data");return f}function g(f,l,c){const h=this.previous,p=this.events;let u=0;return b;function b(T){return h===126&&p[p.length-1][1].type!=="characterEscape"?c(T):(f.enter("strikethroughSequenceTemporary"),C(T))}function C(T){const E=Is(h);if(T===126)return u>1?c(T):(f.consume(T),u++,C);if(u<2&&!s)return c(T);const S=f.exit("strikethroughSequenceTemporary"),v=Is(T);return S._open=!v||v===2&&!!E,S._close=!E||E===2&&!!v,l(T)}}}class NE{constructor(){this.map=[]}add(r,s,o){HE(this,r,s,o)}consume(r){if(this.map.sort(function(g,f){return g[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 g of d)r.push(g);d=o.pop()}this.map.length=0}}function HE(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 zE(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 g=o.length-1;o[g]=o[g]==="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 IE(){return{flow:{null:{name:"table",tokenize:UE,resolveAll:PE}}}}function UE(n,r,s){const o=this;let d=0,g=0,f;return l;function l(B){let H=o.events.length-1;for(;H>-1;){const K=o.events[H][1].type;if(K==="lineEnding"||K==="linePrefix")H--;else break}const U=H>-1?o.events[H][1].type:null,P=U==="tableHead"||U==="tableRow"?D:c;return P===D&&o.parser.lazy[o.now().line]?s(B):P(B)}function c(B){return n.enter("tableHead"),n.enter("tableRow"),h(B)}function h(B){return B===124||(f=!0,g+=1),p(B)}function p(B){return B===null?s(B):Me(B)?g>1?(g=0,o.interrupt=!0,n.exit("tableRow"),n.enter("lineEnding"),n.consume(B),n.exit("lineEnding"),C):s(B):$e(B)?Ye(n,p,"whitespace")(B):(g+=1,f&&(f=!1,d+=1),B===124?(n.enter("tableCellDivider"),n.consume(B),n.exit("tableCellDivider"),f=!0,p):(n.enter("data"),u(B)))}function u(B){return B===null||B===124||ot(B)?(n.exit("data"),p(B)):(n.consume(B),B===92?b:u)}function b(B){return B===92||B===124?(n.consume(B),u):u(B)}function C(B){return o.interrupt=!1,o.parser.lazy[o.now().line]?s(B):(n.enter("tableDelimiterRow"),f=!1,$e(B)?Ye(n,T,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):T(B))}function T(B){return B===45||B===58?S(B):B===124?(f=!0,n.enter("tableCellDivider"),n.consume(B),n.exit("tableCellDivider"),E):L(B)}function E(B){return $e(B)?Ye(n,S,"whitespace")(B):S(B)}function S(B){return B===58?(g+=1,f=!0,n.enter("tableDelimiterMarker"),n.consume(B),n.exit("tableDelimiterMarker"),v):B===45?(g+=1,v(B)):B===null||Me(B)?A(B):L(B)}function v(B){return B===45?(n.enter("tableDelimiterFiller"),_(B)):L(B)}function _(B){return B===45?(n.consume(B),_):B===58?(f=!0,n.exit("tableDelimiterFiller"),n.enter("tableDelimiterMarker"),n.consume(B),n.exit("tableDelimiterMarker"),y):(n.exit("tableDelimiterFiller"),y(B))}function y(B){return $e(B)?Ye(n,A,"whitespace")(B):A(B)}function A(B){return B===124?T(B):B===null||Me(B)?!f||d!==g?L(B):(n.exit("tableDelimiterRow"),n.exit("tableHead"),r(B)):L(B)}function L(B){return s(B)}function D(B){return n.enter("tableRow"),R(B)}function R(B){return B===124?(n.enter("tableCellDivider"),n.consume(B),n.exit("tableCellDivider"),R):B===null||Me(B)?(n.exit("tableRow"),r(B)):$e(B)?Ye(n,R,"whitespace")(B):(n.enter("data"),k(B))}function k(B){return B===null||B===124||ot(B)?(n.exit("data"),R(B)):(n.consume(B),B===92?M:k)}function M(B){return B===92||B===124?(n.consume(B),k):k(B)}}function PE(n,r){let s=-1,o=!0,d=0,g=[0,0,0,0],f=[0,0,0,0],l=!1,c=0,h,p,u;const b=new NE;for(;++s<n.length;){const C=n[s],T=C[1];C[0]==="enter"?T.type==="tableHead"?(l=!1,c!==0&&(Ig(b,r,c,h,p),p=void 0,c=0),h={type:"table",start:Object.assign({},T.start),end:Object.assign({},T.end)},b.add(s,0,[["enter",h,r]])):T.type==="tableRow"||T.type==="tableDelimiterRow"?(o=!0,u=void 0,g=[0,0,0,0],f=[0,s+1,0,0],l&&(l=!1,p={type:"tableBody",start:Object.assign({},T.start),end:Object.assign({},T.end)},b.add(s,0,[["enter",p,r]])),d=T.type==="tableDelimiterRow"?2:p?3:1):d&&(T.type==="data"||T.type==="tableDelimiterMarker"||T.type==="tableDelimiterFiller")?(o=!1,f[2]===0&&(g[1]!==0&&(f[0]=f[1],u=vo(b,r,g,d,void 0,u),g=[0,0,0,0]),f[2]=s)):T.type==="tableCellDivider"&&(o?o=!1:(g[1]!==0&&(f[0]=f[1],u=vo(b,r,g,d,void 0,u)),g=f,f=[g[1],s,0,0])):T.type==="tableHead"?(l=!0,c=s):T.type==="tableRow"||T.type==="tableDelimiterRow"?(c=s,g[1]!==0?(f[0]=f[1],u=vo(b,r,g,d,s,u)):f[1]!==0&&(u=vo(b,r,f,d,s,u)),d=0):d&&(T.type==="data"||T.type==="tableDelimiterMarker"||T.type==="tableDelimiterFiller")&&(f[3]=s)}for(c!==0&&Ig(b,r,c,h,p),b.consume(r.events),s=-1;++s<r.events.length;){const C=r.events[s];C[0]==="enter"&&C[1].type==="table"&&(C[1]._align=zE(r.events,s))}return n}function vo(n,r,s,o,d,g){const f=o===1?"tableHeader":o===2?"tableDelimiter":"tableData",l="tableContent";s[0]!==0&&(g.end=Object.assign({},js(r.events,s[0])),n.add(s[0],0,[["exit",g,r]]));const c=js(r.events,s[1]);if(g={type:f,start:Object.assign({},c),end:Object.assign({},c)},n.add(s[1],0,[["enter",g,r]]),s[2]!==0){const h=js(r.events,s[2]),p=js(r.events,s[3]),u={type:l,start:Object.assign({},h),end:Object.assign({},p)};if(n.add(s[2],0,[["enter",u,r]]),o!==2){const b=r.events[s[2]],C=r.events[s[3]];if(b[1].end=Object.assign({},C[1].end),b[1].type="chunkText",b[1].contentType="text",s[3]>s[2]+1){const T=s[2]+1,E=s[3]-s[2]-1;n.add(T,E,[])}}n.add(s[3]+1,0,[["exit",u,r]])}return d!==void 0&&(g.end=Object.assign({},js(r.events,d)),n.add(d,0,[["exit",g,r]]),g=void 0),g}function Ig(n,r,s,o,d){const g=[],f=js(r.events,s);d&&(d.end=Object.assign({},f),g.push(["exit",d,r])),o.end=Object.assign({},f),g.push(["exit",o,r]),n.add(s+1,0,g)}function js(n,r){const s=n[r],o=s[0]==="enter"?"start":"end";return s[1][o]}const FE={name:"tasklistCheck",tokenize:$E};function qE(){return{text:{91:FE}}}function $E(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"),g)}function g(c){return ot(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"),l):s(c)}function l(c){return Me(c)?r(c):$e(c)?n.check({tokenize:GE},r,s)(c):s(c)}}function GE(n,r,s){return Ye(n,o,"whitespace");function o(d){return d===null?s(d):r(d)}}function VE(n){return C_([_E(),AE(),jE(n),IE(),qE()])}const WE={};function dv(n){const r=this,s=n||WE,o=r.data(),d=o.micromarkExtensions||(o.micromarkExtensions=[]),g=o.fromMarkdownExtensions||(o.fromMarkdownExtensions=[]),f=o.toMarkdownExtensions||(o.toMarkdownExtensions=[]);d.push(VE(s)),g.push(dE()),f.push(pE(s))}const KE=500,YE=3,XE=3e4,Co=new Map;function Qh(n,r){const s=pt(n,r);if(!QE(r))return Co.set(n,{consecutiveFailures:1,lastMessage:s,lastReportedAt:Date.now()}),s;const o=Co.get(n),d=((o==null?void 0:o.consecutiveFailures)??0)+1,g=Date.now(),f=d>=YE&&(!o||o.lastMessage!==s||g-o.lastReportedAt>=XE);return Co.set(n,{consecutiveFailures:d,lastMessage:s,lastReportedAt:f?g:(o==null?void 0:o.lastReportedAt)??0}),f?s:null}function To(n){Co.delete(n),a1([n])}function QE(n){const r=Mo(n);return r.includes("could not reach the VCM backend")||r.includes("Failed to fetch")||r.includes("NetworkError")||r.includes("Load failed")||r.includes("ERR_CONNECTION")}const pv=1e3,Ns=new Map;let Wa;function JE(n,r,s){const o=Symbol(n),d=Math.max(pv,s.intervalMs),g=Date.now();return Ns.set(n,{id:n,intervalMs:d,nextRunAt:s.runImmediately===!1?g+d:g,inFlight:!1,run:r,token:o}),ZE(),mv(),()=>{const f=Ns.get(n);(f==null?void 0:f.token)===o&&(Ns.delete(n),Ns.size===0&&Wa!==void 0&&(window.clearInterval(Wa),Wa=void 0))}}function ZE(){Wa!==void 0||typeof window>"u"||(Wa=window.setInterval(()=>{mv()},pv))}async function mv(){const n=Date.now();for(const r of Ns.values())r.inFlight||r.nextRunAt>n||e2(r)}async function e2(n){n.inFlight=!0;try{await n.run()}catch{}finally{const r=Ns.get(n.id);(r==null?void 0:r.token)===n.token&&(r.inFlight=!1,r.nextRunAt=Date.now()+r.intervalMs)}}function Qa(n,r,s){const o=ne.useRef(r);ne.useEffect(()=>{o.current=r},[r]),ne.useEffect(()=>{if(!(!n||s.enabled===!1))return JE(n,()=>o.current(),{intervalMs:s.intervalMs,runImmediately:s.runImmediately})},[n,s.enabled,s.intervalMs,s.runImmediately])}const Ro=`
|
|
91
|
-
|
|
92
|
-
--- Translation ---
|
|
93
|
-
`;function t2({active:n=!0,autoSendEnabled:r,targetLanguage:s,taskSlug:o,role:d,sessionId:g}){const[f,l]=ne.useState([]),[c,h]=ne.useState([]),[p,u]=ne.useState(""),[b,C]=ne.useState(""),[T,E]=ne.useState(!1),[S,v]=ne.useState("ready"),[_,y]=ne.useState(Date.now()),[A,L]=ne.useState(!1),[,D]=ji(""),[R,k]=ne.useState(0),M=ne.useRef(n),B=ne.useRef(1),H=ne.useRef(null);ne.useEffect(()=>{M.current=n},[n]);const U=ne.useCallback(async()=>{try{const ae=await ye.pollTranslationSession(g,B.current);G(ae.events),B.current=ae.nextCursor,v(ae.status),To("Poll conversation translation events"),D(ue=>wo(ue,["Poll conversation translation events"]))}catch(ae){const ue=Qh("Poll conversation translation events",ae);ue&&D(ue)}},[g]);Qa(g?`translation-events:${g}`:null,U,{intervalMs:n?1e3:5e3,runImmediately:!1}),ne.useEffect(()=>{l([]),h([]),D(""),v("ready"),B.current=1,U()},[U,g,o,d]),ne.useEffect(()=>{if(!n)return;const ae=H.current;if(!ae)return;const ue=window.requestAnimationFrame(()=>{ae.scrollTop=ae.scrollHeight});return()=>window.cancelAnimationFrame(ue)},[n,R]);const P=c2(f);ne.useEffect(()=>{if(!P)return;y(Date.now());const ae=window.setInterval(()=>y(Date.now()),250);return()=>window.clearInterval(ae)},[P]);async function K(ae=!1){const ue=p;L(!0),D(""),E(!1);try{const Y=await ye.translateUserInput(o,d,{text:ue,mode:ae?"auto-send":"review-before-send",useContext:!1,send:ae});Y.sent?(u(""),E(!1)):(u(gv(ue,Y.englishPreview)),E(!0))}catch(Y){D(pt("Translate composer input",Y))}finally{L(!1)}}async function X(){const ae=b.trim();if(ae){L(!0),D("");try{const ue=await ye.translateManualOutput(o,d,{text:ae});l(Y=>ch(uh(Y,ue)).entries),C(""),k(Y=>Y+1)}catch(ue){D(pt("Translate pasted English output",ue))}finally{L(!1)}}}function G(ae){if(ae.length===0)return;for(const Y of ae)Y.type==="status"?v(Y.status):Y.type==="error"?D(pt("Process translation session event",Y.message)):Y.type==="failures"&&h(Y.failures);const ue=ae.filter(Y=>Y.type==="entry");ue.length>0&&(l(Y=>{const q=ue.reduce((Q,_e)=>uh(Q,_e.entry),Y),Z=ch(q);return Z.removedIds.size>0&&h(Q=>Q.filter(_e=>!Z.removedIds.has(_e.translationId))),Z.entries}),k(Y=>Y+1))}async function W(){const ae=T?Pg(p):p;if(ae.trim()){L(!0),D("");try{await ye.sendTranslatedInput(o,d,{englishText:ae}),u(""),E(!1)}catch(ue){D(pt("Send translated English input to role",ue))}finally{L(!1)}}}function te(ae){ae.key!=="Enter"||ae.shiftKey||ae.nativeEvent.isComposing||(ae.preventDefault(),!A&&p.trim()&&(T?W():K(r)))}async function z(){l([]),h([]),B.current=1,await ye.clearTranslationSession(g).catch(ae=>D(pt("Clear conversation translation panel",ae)))}async function j(){L(!0),D("");try{const ae=await ye.ignoreTranslationFailures(g);h(ae.failures)}catch(ae){D(pt("Ignore failed conversation translations",ae))}finally{L(!1)}}async function N(ae){L(!0),D("");try{const ue=await ye.retryTranslation(g,ae.translationId);l(Y=>ch(uh(Y,ue)).entries),k(Y=>Y+1)}catch(ue){D(pt("Retry latest failed conversation translation",ue))}finally{L(!1)}}const $=u2(f,S,_),I=c.length,se=i2(c);return x.jsxs("aside",{className:"translation-panel",children:[x.jsxs("header",{className:"translation-panel-header",children:[x.jsxs("div",{className:"translation-panel-titlebar",children:[x.jsx("h2",{children:"Translation"}),x.jsxs("div",{className:"translation-panel-actions",children:[I>0?x.jsxs(x.Fragment,{children:[x.jsxs("button",{type:"button",disabled:A,onClick:()=>void j(),children:["Ignore ",I]}),se?x.jsx("button",{type:"button",disabled:A,onClick:()=>void N(se),children:"Retry latest"}):null]}):null,x.jsx("button",{type:"button",onClick:()=>void z(),children:"Clear"})]})]}),x.jsx("div",{className:"translation-status-row",children:x.jsxs("p",{children:["Claude Code · target ",n2(s)," · ",$]})})]}),x.jsxs("div",{className:"translation-entry-list",ref:H,children:[f.length===0?x.jsx("p",{className:"muted",children:"Translated Claude Code output will appear here."}):null,f.map(ae=>x.jsx(l2,{entry:ae},ae.id))]}),x.jsxs("div",{className:"translation-composer",children:[x.jsxs("div",{className:"translation-composer-row translation-manual-row",children:[x.jsx("textarea",{value:b,onChange:ae=>C(ae.target.value),placeholder:"Paste English to translate on demand..."}),x.jsx("div",{className:"translation-composer-actions",children:x.jsx("button",{type:"button",disabled:A||!b.trim(),onClick:()=>void X(),children:"Translate"})})]}),x.jsxs("div",{className:"translation-composer-row",children:[x.jsx("textarea",{value:p,onChange:ae=>{u(ae.target.value),(!ae.target.value.trim()||T&&!d2(ae.target.value))&&E(!1)},onKeyDown:te,placeholder:"输入中文,先翻译成英文工程指令..."}),x.jsx("div",{className:"translation-composer-actions",children:x.jsx("button",{type:"button",disabled:A||!T||!Pg(p).trim(),onClick:()=>void W(),children:"Send English"})})]})]})]})}function n2(n){var r;return((r=n_.find(s=>s.value===n))==null?void 0:r.label)??n}function i2(n){let r,s=Number.NEGATIVE_INFINITY;for(const o of n){const d=Date.parse(o.failedAt),g=Number.isFinite(d)?d:Number.NEGATIVE_INFINITY;(!r||g>=s)&&(r=o,s=g)}return r}function r2({open:n,taskSlug:r,targetLanguage:s,onClose:o}){const[d,g]=ne.useState(!1),[,f]=ji(""),[l,c]=ne.useState(null),[h,p]=ne.useState(""),[u,b]=ne.useState(""),[C,T]=ne.useState(""),[E,S]=ne.useState(!1),[v,_]=ne.useState(null),[y,A]=ne.useState(""),[L,D]=ne.useState(""),[R,k]=ne.useState(""),[M,B]=ne.useState(!1);Qa(n?`file-translation:${h||"none"}`:null,()=>H(!0),{intervalMs:2e3,runImmediately:!0});async function H(G=!1){try{const W=await ye.getTranslationState();c(W);const te=h?W.fileIndex.jobs.some(z=>z.id===h):!1;if((!h||!te)&&W.fileIndex.jobs[0])U(W.fileIndex.jobs[0].id);else if(!W.fileIndex.jobs[0])p(""),b(""),T("");else if(G&&h){const z=await ye.readFileTranslation(h);b(z.output),T(z.report)}}catch(W){f(pt("Load file translation list",W))}}async function U(G){p(G),b(""),T("");try{const W=await ye.readFileTranslation(G);b(W.output),T(W.report)}catch(W){f(pt(`Read translated file ${G}`,W))}}async function P(){S(!0),await K(y,L)}async function K(G="",W=""){B(!0),f("");try{const te=await ye.browseTranslationSourceFiles({path:G,query:W,limit:250});_(te),A(te.currentPath),D(W)}catch(te){f(pt("Browse translation source files",te))}finally{B(!1)}}async function X(G=R){const W=G.trim();if(W){g(!0),f("");try{if(!r)throw new Error("Create or select a task before translating files.");const te=await ye.createFileTranslation({taskSlug:r,sourcePath:W,targetLanguage:s});S(!1),await H(),await U(te.id)}catch(te){f(pt(`Create file translation for ${W}`,te))}finally{g(!1)}}}return n?x.jsxs(x.Fragment,{children:[x.jsx("div",{className:"modal-backdrop file-translation-backdrop",children:x.jsx(a2,{busy:d,state:l,selectedJobId:h,output:u,report:C,onClose:()=>{S(!1),o()},onRefresh:()=>void H(),onSelectJob:G=>void U(G),onTranslate:()=>void P()})}),E?x.jsx(s2,{busy:d||M,state:v,currentPath:y,query:L,selectedPath:R,onBrowse:(G,W)=>void K(G,W),onClose:()=>S(!1),onQueryChange:D,onSelectPath:k,onTranslate:()=>void X()}):null]}):null}function s2({busy:n,state:r,currentPath:s,query:o,selectedPath:d,onBrowse:g,onClose:f,onQueryChange:l,onSelectPath:c,onTranslate:h}){const p=(r==null?void 0:r.entries)??[],u=p.filter(C=>C.type==="directory"),b=p.filter(C=>C.type==="file");return x.jsx("div",{className:"modal-backdrop translation-file-browser-backdrop",children:x.jsxs("section",{className:"translation-file-browser-modal",role:"dialog","aria-modal":"true","aria-label":"Select Source File",children:[x.jsxs("header",{children:[x.jsxs("div",{children:[x.jsx("h2",{children:"Select Source File"}),x.jsx("p",{children:s||"."})]}),x.jsx("button",{type:"button",onClick:f,children:"Close"})]}),x.jsxs("div",{className:"translation-file-browser-controls",children:[x.jsxs("div",{className:"translation-file-browser-nav",children:[x.jsx("button",{type:"button",disabled:n||!s,onClick:()=>g((r==null?void 0:r.parentPath)??"",""),children:"Up"}),x.jsx("button",{type:"button",disabled:n||!s,onClick:()=>g("",""),children:"Root"})]}),x.jsxs("form",{className:"translation-file-browser-search",onSubmit:C=>{C.preventDefault(),g(s,o)},children:[x.jsx("input",{value:o,onChange:C=>l(C.target.value),placeholder:"Search files"}),x.jsx("button",{type:"submit",disabled:n,children:"Search"}),x.jsx("button",{type:"button",disabled:n||!o,onClick:()=>g(s,""),children:"Clear"})]})]}),x.jsxs("div",{className:"translation-file-browser-layout",children:[x.jsxs("div",{className:"translation-file-browser-list",children:[n&&!r?x.jsx("p",{className:"muted",children:"Loading files..."}):null,!n&&p.length===0?x.jsx("p",{className:"muted",children:"No source files found."}):null,u.length>0?x.jsxs("div",{className:"translation-file-browser-group",children:[x.jsx("h3",{children:"Folders"}),u.map(C=>x.jsx(Ug,{entry:C,selected:d===C.path,onBrowse:g,onSelectPath:c},C.path))]}):null,b.length>0?x.jsxs("div",{className:"translation-file-browser-group",children:[x.jsx("h3",{children:"Files"}),b.map(C=>x.jsx(Ug,{entry:C,selected:d===C.path,onBrowse:g,onSelectPath:c},C.path))]}):null,r!=null&&r.truncated?x.jsx("p",{className:"translation-entry-note",children:"Result limit reached."}):null]}),x.jsxs("aside",{className:"translation-file-browser-selection",children:[x.jsxs("label",{children:[x.jsx("span",{children:"Source path"}),x.jsx("input",{value:d,onChange:C=>c(C.target.value)})]}),x.jsx("button",{type:"button",disabled:n||!d.trim(),onClick:h,children:"Translate File"})]})]})]})})}function Ug({entry:n,selected:r,onBrowse:s,onSelectPath:o}){const d=n.type==="directory";return x.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:[x.jsx("span",{children:d?"DIR":"FILE"}),x.jsx("strong",{children:n.name}),x.jsx("small",{children:n.path})]})}function a2({busy:n,state:r,selectedJobId:s,output:o,report:d,onClose:g,onRefresh:f,onSelectJob:l,onTranslate:c}){const h=(r==null?void 0:r.fileIndex.jobs)??[],p=h.find(u=>u.id===s);return x.jsxs("section",{className:"file-translation-modal",role:"dialog","aria-modal":"true","aria-label":"File Translation",children:[x.jsxs("header",{className:"file-translation-header",children:[x.jsxs("div",{children:[x.jsx("h2",{children:"File Translation"}),x.jsx("p",{children:"Claude Code · 中英互译"})]}),x.jsxs("div",{className:"file-translation-toolbar",children:[x.jsx("button",{type:"button",disabled:n,onClick:c,children:"Translate"}),x.jsx("button",{type:"button",disabled:n,onClick:f,children:"Refresh"}),x.jsx("button",{type:"button",onClick:g,children:"Close"})]})]}),r!=null&&r.memoryInitialized?null:x.jsx("p",{className:"translation-entry-note",children:"Translation memory is not initialized. Run Bootstrap from the sidebar before important file translations."}),x.jsxs("div",{className:"file-translation-layout",children:[x.jsxs("div",{className:"file-translation-list",children:[h.length===0?x.jsx("p",{className:"muted",children:"No translated files yet."}):null,h.map(u=>x.jsxs("button",{className:u.id===s?"file-translation-item is-active":"file-translation-item",type:"button",onClick:()=>l(u.id),children:[x.jsx("strong",{children:u.sourcePath}),x.jsxs("span",{children:[u.status," · ",u.targetLanguage]})]},u.id))]}),x.jsx("div",{className:"file-translation-preview",children:p?x.jsxs(x.Fragment,{children:[x.jsxs("header",{children:[x.jsx("strong",{children:p.sourcePath}),x.jsx("span",{children:p.status})]}),x.jsx("div",{className:"translation-markdown",children:x.jsx(q_,{remarkPlugins:[dv],children:o||d||"Translation output is not available yet."})})]}):x.jsx("p",{className:"muted",children:"Select a translated file to preview it."})})]})]})}function l2({entry:n}){if(n.sourceKind==="conversation-boundary")return x.jsx(o2,{entry:n});const r=f2(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 x.jsxs("article",{className:d,children:[s?x.jsx("pre",{children:r}):x.jsx("div",{className:"translation-markdown",children:x.jsx(q_,{remarkPlugins:[dv],children:r})}),n.warning?x.jsx("p",{className:"translation-entry-note",children:n.warning}):null,n.error?x.jsx("p",{className:"translation-entry-note is-error",children:n.error}):null]})}function o2({entry:n}){const r=n.boundaryKind==="end"?"结束":"开始",s=n.conversationTurn??0,o=m2(n.occurredAt??n.createdAt);return x.jsxs("div",{className:"translation-conversation-boundary","aria-label":`${r} 第 ${s} 轮 ${o}`,children:[x.jsx("span",{className:"translation-boundary-dash","aria-hidden":"true"}),x.jsx("span",{children:r}),x.jsxs("span",{children:["第 ",s," 轮"]}),x.jsx("time",{children:o}),x.jsx("span",{className:"translation-boundary-dash","aria-hidden":"true"})]})}function c2(n){const r=n.find(Jh);return(r==null?void 0:r.translationStartedAt)??(r==null?void 0:r.createdAt)}function u2(n,r,s){const o=n.find(Jh);if(o)return`translating ${p2(Math.max(0,s-h2(o)))}`;const d=n.at(-1);return(d==null?void 0:d.status)==="failed"||r==="failed"?"error":r}function Jh(n){return n.status==="queued"||n.status==="translating"}function ch(n){const r=n.length-KE;if(r<=0)return{entries:n,removedIds:new Set};const s=new Set;for(const o of n){if(s.size>=r)break;Jh(o)||s.add(o.id)}return s.size===0?{entries:n,removedIds:s}:{entries:n.filter(o=>!s.has(o.id)),removedIds:s}}function h2(n){const r=Date.parse(n.translationStartedAt??n.createdAt);return Number.isFinite(r)?r:Date.now()}function f2(n){return n.status==="queued"||n.status==="translating"?n.sourceText:n.status==="translated"?n.direction==="user-input-to-english"?gv(n.sourceText,n.translatedText):n.translatedText:n.translatedText||n.sourceText}function gv(n,r){return`${n.trimEnd()}${Ro}${r.trimStart()}`}function d2(n){return n.includes(Ro)}function Pg(n){const r=n.indexOf(Ro);return r===-1?n:n.slice(r+Ro.length)}function uh(n,r){return n.findIndex(o=>o.id===r.id)===-1?[...n,r]:n.map(o=>o.id===r.id?r:o)}function p2(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 m2(n){const r=new Date(n);return Number.isNaN(r.getTime())?n:r.toLocaleTimeString()}const g2=8;function _2(){const[n,r]=ne.useState([]);return ne.useEffect(()=>{const s=g=>{var c,h;const f=(h=(c=g.detail)==null?void 0:c.message)==null?void 0:h.trim();if(!f)return;const l=new Date().toISOString();r(p=>{const u=p.find(b=>b.message===f);return u?[{...u,count:u.count+1,updatedAt:l},...p.filter(b=>b.id!==u.id)]:[{id:`ui_error_${Date.now()}_${Math.random().toString(16).slice(2)}`,message:f,count:1,createdAt:l,updatedAt:l},...p].slice(0,g2)})},o=g=>{var l;const f=((l=g.detail)==null?void 0:l.actions)??[];f.length!==0&&r(c=>c.filter(h=>!f.some(p=>h.message.startsWith(`${p} failed.`))))},d=g=>{var l,c;const f=(c=(l=g.detail)==null?void 0:l.message)==null?void 0:c.trim();f&&r(h=>h.filter(p=>p.message!==f))};return window.addEventListener(hh,s),window.addEventListener(fh,o),window.addEventListener(dh,d),()=>{window.removeEventListener(hh,s),window.removeEventListener(fh,o),window.removeEventListener(dh,d)}},[]),n.length===0?null:x.jsxs("aside",{className:"ui-error-center",role:"alert","aria-live":"polite","aria-label":"Application errors",children:[x.jsxs("header",{className:"ui-error-center-header",children:[x.jsxs("div",{children:[x.jsx("h2",{children:"Errors"}),x.jsxs("p",{children:[n.length," active"]})]}),x.jsx("button",{type:"button",onClick:()=>r([]),children:"Clear"})]}),x.jsx("ol",{className:"ui-error-list",children:n.map(s=>x.jsxs("li",{children:[x.jsxs("div",{children:[x.jsx("p",{children:s.message}),x.jsxs("span",{children:[v2(s.updatedAt),s.count>1?` · repeated ${s.count} times`:""]})]}),x.jsx("button",{type:"button","aria-label":"Dismiss error",onClick:()=>r(o=>o.filter(d=>d.id!==s.id)),children:"Close"})]},s.id))})]})}function v2(n){return new Date(n).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function y2(n,r){return n.find(s=>s.taskSlug===r)??n[0]??null}function S2(n,r){const s=zs.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 b2=["architecture-plan","validation-adequacy","final-diff"];function C2({events:n,maxEvents:r=8,showHeader:s=!0}){const o=r===null?n:n.slice(-r);return x.jsxs("section",{className:"event-log",children:[s?x.jsx("h2",{children:"Events"}):null,n.length===0?x.jsx("p",{className:"muted",children:"No terminal events yet."}):x.jsx("ol",{children:o.map((d,g)=>x.jsx("li",{children:d},`${d}-${g}`))})]})}function di({checked:n,className:r,disabled:s,label:o,stateLabel:d,title:g,onChange:f}){const l=["switch-control",n?"is-on":"is-off",r].filter(Boolean).join(" "),c=d??(n?"on":"off");return x.jsxs("button",{type:"button",role:"switch","aria-checked":n,"aria-label":`${o}: ${c}`,className:l,disabled:s,title:g,onClick:()=>f(!n),children:[x.jsx("span",{className:"switch-control-label",children:o}),x.jsx("span",{className:"switch-control-track","aria-hidden":"true",children:x.jsx("span",{className:"switch-control-thumb"})})]})}function w2({status:n,bootstrapStatus:r,applyResult:s,hasActiveTask:o=!1,autoTaskHarnessReviewEnabled:d,busy:g=!1,onRefresh:f,onApply:l,onOpenStudio:c,onOpenRepositoryDiff:h,onAutoTaskHarnessReviewChange:p,onStartBootstrap:u,onRestartBootstrap:b,onStopBootstrap:C,onRunBootstrap:T}){const[E,S]=ne.useState(!1),[v,_]=ne.useState("bypassPermissions"),[y,A]=ne.useState("default"),[L,D]=ne.useState("default"),R=r==null?void 0:r.session,k=(r==null?void 0:r.status)==="running",M=(R==null?void 0:R.status)==="running",B=(r==null?void 0:r.status)!=="complete",H={permissionMode:v,model:y,effort:L};return o?n?x.jsxs("section",{className:"harness-panel",children:[x.jsxs("div",{className:"harness-stage",children:[x.jsxs("div",{className:"harness-panel-header",children:[x.jsxs("div",{children:[x.jsx("strong",{children:"Fixed install"}),x.jsx("p",{className:"muted",children:n.initialized?n.needsApply?`${n.plannedChanges.length} pending updates`:"Up to date":"Not initialized"})]}),x.jsx("div",{className:"harness-actions",children:n.initialized?x.jsxs(x.Fragment,{children:[x.jsx("button",{type:"button",disabled:g,onClick:()=>void f(),children:"Refresh"}),n.needsApply?x.jsx("button",{type:"button",disabled:g,onClick:()=>void l(),children:"Update"}):null]}):x.jsx("button",{type:"button",disabled:g,onClick:()=>void l(),children:"Initialize"})})]}),n.initialized&&n.needsApply?x.jsxs(x.Fragment,{children:[x.jsx("h3",{className:"harness-file-list-title",children:"Files to update"}),x.jsx("ol",{className:"harness-file-list",children:n.plannedChanges.map(U=>x.jsxs("li",{children:[x.jsx("span",{children:U.path}),x.jsx(Bi,{status:U.action})]},`${U.path}:${U.action}`))})]}):null]}),x.jsxs("div",{className:"harness-stage",children:[x.jsxs("div",{className:"harness-panel-header",children:[x.jsx("div",{children:x.jsx("strong",{children:"Harness Studio"})}),x.jsx("div",{className:"harness-actions",children:x.jsx("button",{type:"button",disabled:g,onClick:c,children:"Open Studio"})})]}),x.jsx("button",{className:"harness-review-diff-button",type:"button",disabled:g,onClick:h,children:"Review Diff"}),x.jsx(di,{checked:d,className:"sidebar-switch",disabled:g,label:"Auto task harness review",title:"Automatically ask Harness Engineer to review task harness after final acceptance completes",onChange:p})]}),B?x.jsx("div",{className:"harness-stage",children:x.jsxs("div",{className:"harness-panel-header",children:[x.jsxs("div",{children:[x.jsx("strong",{children:"Bootstrap"}),x.jsx("p",{className:"muted",children:r?x2(r.status):"not loaded"})]}),x.jsx("div",{className:"harness-actions",children:x.jsx("button",{type:"button",disabled:g||!(r!=null&&r.canStart),onClick:()=>{S(!0)},children:"Open Bootstrap"})})]})}):null,s!=null&&s.changedFiles.length?x.jsx("div",{className:"harness-result",children:x.jsx("p",{className:"muted",children:s.message})}):null,n.warnings.length>0?x.jsx("ul",{className:"warnings",children:n.warnings.map(U=>x.jsx("li",{children:U},U))}):null,r!=null&&r.warnings.length?x.jsx("ul",{className:"warnings",children:r.warnings.map(U=>x.jsx("li",{children:U},U))}):null,B&&E?x.jsx("div",{className:"harness-bootstrap-modal",role:"dialog","aria-modal":"true","aria-label":"Harness Engineer bootstrap session",children:x.jsxs("div",{className:"harness-bootstrap-modal-surface",children:[x.jsxs("header",{className:"harness-bootstrap-modal-header",children:[x.jsxs("div",{children:[x.jsx("strong",{children:"Harness Engineer Bootstrap"}),x.jsx("p",{className:"muted",children:(R==null?void 0:R.command)??"Start Harness Engineer, then run bootstrap when ready."})]}),x.jsxs("div",{className:"harness-bootstrap-modal-actions",children:[R?x.jsx(Bi,{status:R.status}):null,x.jsx("button",{type:"button",onClick:()=>S(!1),children:"Close"})]})]}),x.jsxs("div",{className:"harness-bootstrap-controls",children:[x.jsxs("label",{children:[x.jsx("span",{children:"Permission"}),x.jsx("select",{value:v,disabled:g||k||M,onChange:U=>_(U.target.value),children:r_.map(U=>x.jsx("option",{value:U.value,children:U.label},U.value))})]}),x.jsxs("label",{children:[x.jsx("span",{children:"Model"}),x.jsx("select",{value:y,disabled:g||k||M,onChange:U=>A(U.target.value),children:s_.map(U=>x.jsx("option",{value:U.value,children:U.label},U.value))})]}),x.jsxs("label",{children:[x.jsx("span",{children:"Effort"}),x.jsx("select",{value:L,disabled:g||k||M,onChange:U=>D(U.target.value),children:a_.map(U=>x.jsx("option",{value:U.value,children:U.label},U.value))})]}),x.jsxs("div",{className:"harness-bootstrap-control-actions",children:[x.jsx("button",{type:"button",disabled:g||k||!(r!=null&&r.canStart),onClick:()=>void u(H),children:"Start"}),x.jsx("button",{type:"button",disabled:g||k||!(r!=null&&r.canStart),onClick:()=>void b(H),children:"Restart"}),x.jsx("button",{type:"button",disabled:g||!R,onClick:()=>void C(),children:"Stop"}),x.jsx("button",{type:"button",disabled:g||k||!M,onClick:()=>void T(),children:"Run bootstrap"})]})]}),x.jsx("div",{className:"harness-bootstrap-terminal",children:M?x.jsx(Lo,{sessionId:R.id,active:E}):x.jsxs("div",{className:"terminal-empty",children:[x.jsx("strong",{children:"Harness Bootstrap"}),x.jsx("span",{children:"Start Harness Engineer first. When it is ready, click Run bootstrap to send the prompt."})]})})]})}):null]}):null:x.jsx("section",{className:"harness-panel",children:x.jsxs("div",{className:"harness-result",children:[x.jsx("strong",{children:"Task required"}),x.jsx("p",{className:"muted",children:"Create or select a task before changing VCM Harness. Harness changes are committed in the active task worktree."})]})})}function x2(n){return n.replaceAll("_"," ")}function Zh(n){return{total:n.length,accepted:n.filter(r=>r.acceptedAt).length,delivered:n.filter(r=>r.deliveredAt).length}}function E2(n,r=6){const s=[...n].sort(T2).map((d,g)=>({message:d,sequence:g+1}));return[...r===null?s:s.slice(-r)].sort((d,g)=>g.sequence-d.sequence)}function k2({messages:n,orchestration:r,busy:s,maxMessages:o=6,showControls:d=!0,showHeader:g=!0,onModeChange:f,onMarkAllDone:l}){const[c,h]=ne.useState(null),p=Zh(n),u=(r==null?void 0:r.mode)??"auto",b=E2(n,o);async function C(T){await R2(T.body),h(T.id),window.setTimeout(()=>h(E=>E===T.id?null:E),1200)}return x.jsxs("section",{className:"message-panel",children:[g?x.jsxs("div",{className:"message-panel-header",children:[x.jsxs("div",{children:[x.jsx("h2",{children:"Messages"}),x.jsxs("p",{className:"muted",children:[p.total," total / ",p.accepted," accepted"]})]}),d&&f?x.jsx("div",{className:"message-controls",children:x.jsx(di,{checked:u==="auto",className:"message-mode-toggle",disabled:s,label:"Auto orchestration",onChange:T=>f(T?"auto":"manual")})}):null,d&&l?x.jsx("button",{type:"button",disabled:s,onClick:l,children:"Mark All Done"}):null]}):null,n.length===0?x.jsx("p",{className:"muted",children:"No role messages yet."}):x.jsx("ol",{className:"message-list",children:b.map(({message:T,sequence:E})=>x.jsxs("li",{className:"message-item",children:[x.jsxs("div",{className:"message-item-main",children:[x.jsxs("div",{className:"message-meta",children:[x.jsxs("span",{className:"message-sequence",children:["#",E]}),x.jsx("time",{dateTime:Do(T),children:A2(Do(T))}),x.jsxs("strong",{children:[T.fromRole," ","->"," ",T.toRole]}),x.jsx("span",{children:T.type})]}),x.jsx("p",{children:T.body}),T.failureReason?x.jsx("span",{className:"message-reason",children:T.failureReason}):null,T.bodyPath?x.jsx("span",{className:"message-path",children:T.bodyPath}):null]}),x.jsx("div",{className:"message-actions",children:x.jsx("button",{type:"button",disabled:s,onClick:()=>void C(T),children:c===T.id?"Copied":"Copy"})})]},T.id))})]})}function A2(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 Do(n){return n.acceptedAt??n.deliveredAt??n.dispatchingAt??n.createdAt}function T2(n,r){const s=Do(n).localeCompare(Do(r));if(s!==0)return s;const o=n.createdAt.localeCompare(r.createdAt);return o!==0?o:n.id.localeCompare(r.id)}async function R2(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 D2({defaultPath:n="",recentPaths:r=[],busy:s=!1,onConnect:o}){const[d,g]=ne.useState(n);ne.useEffect(()=>{n&&g(n)},[n]);async function f(l){l.preventDefault(),await o(d)}return x.jsx("form",{className:"repo-connect",onSubmit:f,children:x.jsxs("div",{className:r.length>0?"inline-form has-recent-paths":"inline-form",children:[x.jsx("input",{"aria-label":"Repository path",id:"repo-path",value:d,onChange:l=>g(l.target.value),placeholder:"/path/to/repo"}),r.length>0?x.jsxs("select",{"aria-label":"Recent repositories",className:"repo-recent-select",value:"",onChange:l=>{l.target.value&&g(l.target.value)},children:[x.jsx("option",{value:"",children:"Recent"}),r.map(l=>x.jsx("option",{value:l,children:l},l))]}):null,x.jsx("button",{type:"submit",disabled:s||!d.trim(),children:"Connect"})]})})}function M2({tasks:n,activeTaskSlug:r,onSelect:s}){return x.jsx("nav",{className:"task-nav","aria-label":"Tasks",children:n.map(o=>x.jsxs("button",{className:o.taskSlug===r?"task-nav-item is-active":"task-nav-item",type:"button",onClick:()=>s(o.taskSlug),children:[x.jsx("span",{children:o.title||o.taskSlug}),x.jsx(Bi,{status:o.status})]},o.taskSlug))})}function L2({project:n,recentRepositoryPaths:r,tasks:s,activeTaskSlug:o,messages:d,orchestration:g,events:f,roundState:l,gateReview:c,translationEnabled:h,translationAutoSendEnabled:p,translationTargetLanguage:u,translationOutputMode:b,translationMemoryInitialized:C,translatorSession:T,harnessStatus:E,harnessBootstrapStatus:S,harnessApplyResult:v,autoTaskHarnessReviewEnabled:_,gatewayStatus:y,gatewayQrLogin:A,gatewayQrCheck:L,gatewayLarkRegistration:D,gatewayLarkRegistrationCheck:R,busy:k,onConnect:M,onRefreshConnectedRepository:B,onPullConnectedRepository:H,onRefreshHarness:U,onApplyHarness:P,onStartHarnessBootstrap:K,onRestartHarnessBootstrap:X,onStopHarnessBootstrap:G,onRunHarnessBootstrap:W,onOpenHarnessStudio:te,onOpenRepositoryDiff:z,onAutoTaskHarnessReviewChange:j,onRefreshGateway:N,onGatewayEnabledChange:$,onGatewaySettingsChange:I,onGatewayTranslationChange:se,onStartGatewayQrLogin:ae,onStartGatewayLarkRegistration:ue,onResetGatewayBinding:Y,onGateReviewGateEnabledChange:q,onTranslationEnabledChange:Z,onTranslationAutoSendChange:Q,onTranslationTargetLanguageChange:_e,onTranslationOutputModeChange:ve,onOpenFileTranslation:De,onOpenTranslatorSession:Ae,onCreateTranslationBootstrap:Ke,onUpdateTranslationMemory:ht,onCreateTask:Re,onCloseTask:sn,onSelectTask:en,themeMode:Vt,onAutoOrchestrationChange:an,onThemeModeChange:yn,pauseAlertSound:bt,onPauseAlertSoundChange:et,roleRetryEnabled:Lt,onRoleRetryEnabledChange:fe,permissionRequestMode:Se,onPermissionRequestModeChange:xe,launchTemplate:Le,canSaveLaunchTemplate:Be,canOneClickStart:mt,onSaveLaunchTemplate:Pe,onOneClickStart:vt,onMarkAllMessagesDone:_t,onDeleteMessageHistory:Ot}){const[Xe,tn]=ne.useState(""),[Bt,ln]=ne.useState(!1),[Vn,Wn]=ne.useState(!1),[Ht,on]=ne.useState(()=>o?null:"repository"),Kn=Zh(d),Wt=Xe.trim(),qs=N2(n,o,E),Kt=s.filter(He=>He.cleanupStatus!=="cleaned"),Sn=Kt.find(He=>He.taskSlug===o)??null;ne.useEffect(()=>{on(He=>!o&&He===null?n?"task":"repository":He)},[o,n]);function zt(He,mi){on(mi?He:null)}async function Hi(He){He.preventDefault(),await Re({taskSlug:Wt}),tn("")}return x.jsxs("div",{className:"project-dashboard",children:[x.jsx("header",{className:"brand-header",children:x.jsx("strong",{children:"VibeCodingMaster"})}),x.jsx(Hr,{title:"Repository",open:Ht==="repository",onOpenChange:He=>{zt("repository",He),He&&n&&B()},children:x.jsxs("div",{className:"repository-panel",children:[x.jsx(D2,{defaultPath:(n==null?void 0:n.repoRoot)??"",recentPaths:r,busy:k,onConnect:M}),n?x.jsx(U2,{busy:k,project:n,onPull:H}):null]})}),x.jsx(Hr,{title:"Settings",open:Ht==="settings",onOpenChange:He=>zt("settings",He),children:x.jsxs("div",{className:"sidebar-settings",children:[x.jsxs("button",{"aria-label":`Theme mode: ${qg(Vt)}`,className:"settings-toggle theme-mode-toggle",disabled:k,title:"Cycle theme: system, light, dark",type:"button",onClick:()=>yn(G2(Vt)),children:[x.jsx("span",{children:"Theme"}),x.jsx("span",{children:qg(Vt)})]}),x.jsx(di,{checked:((g==null?void 0:g.mode)??"auto")==="auto",className:"sidebar-switch",disabled:k||!o,label:"Auto orchestration",title:o?"Automatically dispatch role messages during the active task":"Create or select a task first",onChange:an}),x.jsx(di,{checked:bt,className:"sidebar-switch",disabled:k,label:"Pause alert sound",title:"Play a sound when VCM shows the fixed flow pause dialog",onChange:He=>et(He)}),x.jsx(di,{checked:Lt,className:"sidebar-switch",disabled:k,label:"CC auto retry",title:"Retry temporary Claude Code turn failures before showing the flow pause alert",onChange:He=>fe(He)}),x.jsxs("label",{className:"settings-select-row",children:[x.jsx("span",{children:"Permission requests"}),x.jsxs("select",{value:Se,disabled:k,onChange:He=>xe(He.target.value),children:[x.jsx("option",{value:"off",children:"off"}),x.jsx("option",{value:"allowAll",children:"allow all"})]})]}),x.jsxs("button",{className:"settings-toggle",disabled:k||!Be,title:"Save the current core role launch settings and optional Gate Reviewer settings",type:"button",onClick:Pe,children:[x.jsx("span",{children:"Save launch template"}),x.jsx("span",{children:Be?"ready":"open task"})]}),mt?x.jsxs("button",{className:"settings-toggle is-active",disabled:k,title:O2(Le),type:"button",onClick:vt,children:[x.jsx("span",{children:"One-click start"}),x.jsx("span",{children:_v(Le)})]}):null,o?x.jsxs(x.Fragment,{children:[x.jsxs("button",{type:"button",onClick:()=>ln(!0),children:[x.jsx("span",{children:"Messages"}),x.jsxs("span",{className:"muted",children:[Kn.total," total"]})]}),x.jsxs("button",{type:"button",onClick:()=>Wn(!0),children:[x.jsx("span",{children:"Events"}),x.jsxs("span",{className:"muted",children:[f.length," total"]})]})]}):null]})}),x.jsx(Hr,{title:"Translation",open:Ht==="translation",onOpenChange:He=>zt("translation",He),children:x.jsx(B2,{busy:k,enabled:h,autoSendEnabled:p,targetLanguage:u,outputMode:b,memoryInitialized:C,baseUnavailableReason:qs,translatorSession:T,onAutoSendChange:Q,onCreateBootstrap:Ke,onEnabledChange:Z,onUpdateMemory:ht,onTargetLanguageChange:_e,onOutputModeChange:ve,onOpenFileTranslation:De,onOpenTranslatorSession:Ae})}),n&&o?x.jsx(Hr,{title:"Gate Review Gates",open:Ht==="gate-review-gates",onOpenChange:He=>zt("gate-review-gates",He),children:x.jsx(H2,{busy:k,state:c,onGateEnabledChange:q})}):null,x.jsx(Hr,{title:"Gateway",open:Ht==="gateway",onOpenChange:He=>{zt("gateway",He),He&&N()},children:x.jsx(I2,{busy:k,qrCheck:L,qrLogin:A,larkRegistration:D,larkRegistrationCheck:R,status:y,onEnabledChange:$,onSettingsChange:I,onResetBinding:Y,onStartLarkRegistration:ue,onStartQrLogin:ae,onTranslationChange:se})}),n?x.jsx(Hr,{title:"VCM Harness",open:Ht==="vcm-harness",onOpenChange:He=>zt("vcm-harness",He),children:x.jsx(w2,{status:E,bootstrapStatus:S,applyResult:v,hasActiveTask:!!Sn,autoTaskHarnessReviewEnabled:_,busy:k,onRefresh:U,onApply:P,onOpenStudio:te,onOpenRepositoryDiff:z,onAutoTaskHarnessReviewChange:j,onStartBootstrap:K,onRestartBootstrap:X,onStopBootstrap:G,onRunBootstrap:W})}):null,n?x.jsx(Hr,{title:"Task",open:Ht==="task",onOpenChange:He=>zt("task",He),children:Kt.length>0?x.jsxs("div",{className:"task-panel",children:[x.jsx(M2,{tasks:Kt,activeTaskSlug:o,onSelect:en}),Sn?x.jsx("div",{className:"task-panel-actions",children:x.jsx("button",{className:"danger-button",disabled:k,type:"button",onClick:sn,children:"Close Task"})}):null]}):x.jsx("div",{className:"task-create",children:x.jsxs("form",{onSubmit:Hi,children:[x.jsx("input",{value:Xe,onChange:He=>tn(He.target.value),placeholder:"task name"}),x.jsxs("div",{className:"task-create-preview",children:[x.jsxs("small",{children:["branch: ",Wt?`feature/${Wt}`:"feature/<task>"]}),x.jsxs("small",{children:["worktree: ",Wt?`.claude/worktrees/${Wt}`:".claude/worktrees/<task>"]})]}),x.jsx("button",{type:"submit",disabled:k||!Wt,children:"Create"})]})})}):null,n&&Sn?x.jsx(q2,{task:Sn,roundState:l}):null,Bt?x.jsx(W2,{busy:k,messages:d,orchestration:g,onClose:()=>ln(!1),onMarkAllDone:()=>{o&&_t(o)},onDeleteMessageHistory:()=>{o&&Ot(o)}}):null,Vn?x.jsx(V2,{events:f,onClose:()=>Wn(!1)}):null]})}function _v(n){return[n.autoOrchestration?"auto":"manual"].join(" + ")}function O2(n){const r=Object.entries(n.roles).map(([s,o])=>`${s}: ${o.permissionMode} / ${o.model} / ${o.effort}`).join("; ");return`Launch template: ${_v(n)}; ${r}`}function B2({autoSendEnabled:n,baseUnavailableReason:r,busy:s,enabled:o,memoryInitialized:d,outputMode:g,targetLanguage:f,translatorSession:l,onAutoSendChange:c,onCreateBootstrap:h,onEnabledChange:p,onUpdateMemory:u,onOutputModeChange:b,onTargetLanguageChange:C,onOpenFileTranslation:T,onOpenTranslatorSession:E}){const S=!!(s||r),v=(l==null?void 0:l.status)==="running",_=!!(o&&!r&&v),y=r??(v?null:"Start Translator session first."),A=!!(s||y),D=r??"Open Translator session",R=y??"Translation tools are ready";return x.jsxs("div",{className:"sidebar-settings",children:[x.jsx(di,{checked:_,className:"sidebar-switch",disabled:S||!v,label:"Conversation translation",title:R,onChange:p}),x.jsx(di,{checked:n,className:"sidebar-switch",disabled:S,label:"Auto-send",onChange:c}),x.jsxs("label",{className:"settings-select-row",children:[x.jsx("span",{children:"Language"}),x.jsx("select",{value:f,disabled:S,onChange:k=>C(k.target.value),children:n_.map(k=>x.jsx("option",{value:k.value,children:k.label},k.value))})]}),x.jsxs("label",{className:"settings-select-row",children:[x.jsx("span",{children:"Reply scope"}),x.jsx("select",{value:g,disabled:S,onChange:k=>b(k.target.value),children:X0.map(k=>x.jsx("option",{value:k.value,children:k.label},k.value))})]}),x.jsxs("button",{className:"settings-toggle",disabled:A,title:R,type:"button",onClick:T,children:[x.jsx("span",{children:"File translation"}),x.jsx("span",{children:"open"})]}),d?null:x.jsxs("button",{className:"settings-toggle",disabled:A,title:R,type:"button",onClick:h,children:[x.jsx("span",{children:"Bootstrap"}),x.jsx("span",{children:"run"})]}),x.jsxs("button",{className:"settings-toggle",disabled:A,title:R,type:"button",onClick:u,children:[x.jsx("span",{children:"Update memory"}),x.jsx("span",{children:"run"})]}),y?x.jsx("p",{className:"settings-help-text",children:y}):null,x.jsxs("div",{className:"settings-status-row",children:[x.jsx("span",{children:"Session status"}),x.jsx("strong",{children:j2(l)})]}),x.jsxs("button",{className:"settings-toggle",disabled:S,title:D,type:"button",onClick:E,children:[x.jsx("span",{children:"Open Session"}),x.jsx("span",{children:"open"})]})]})}function j2(n){return n?n.status==="running"?n.activityStatus??"idle":n.status:"not started"}function N2(n,r,s){return n?r?s?s.initialized?null:"Initialize VCM Harness first.":"Load VCM Harness status first.":"Create or select a task first.":"Connect a repository first."}function H2({busy:n,onGateEnabledChange:r,state:s}){return x.jsx("div",{className:"sidebar-settings",children:b2.map(o=>{const d=s==null?void 0:s.gates[o],g=!!(d!=null&&d.required);return x.jsx(di,{checked:g,className:"sidebar-switch",disabled:n||!s,label:z2(o),title:d!=null&&d.status?`status: ${d.status}`:void 0,onChange:f=>r(o,f)},o)})})}function z2(n){switch(n){case"architecture-plan":return"Architecture plan";case"validation-adequacy":return"Validation adequacy";case"final-diff":return"Final diff"}return n}function I2({busy:n,larkRegistration:r,larkRegistrationCheck:s,onEnabledChange:o,onResetBinding:d,onSettingsChange:g,onStartLarkRegistration:f,onStartQrLogin:l,onTranslationChange:c,qrCheck:h,qrLogin:p,status:u}){const b=(u==null?void 0:u.channel)==="lark",C=(u==null?void 0:u.channel)==="lark"?!!(u.binding.appIdConfigured&&u.binding.appSecretConfigured):!!(u!=null&&u.binding.tokenConfigured),T=(u==null?void 0:u.channel)==="lark"?!!(u.binding.appIdConfigured&&u.binding.appSecretConfigured):!!(u!=null&&u.binding.tokenConfigured);return x.jsxs("div",{className:"gateway-panel",children:[x.jsxs("label",{className:"compact-field",children:[x.jsx("span",{children:"Channel"}),x.jsxs("select",{disabled:n||!u,value:(u==null?void 0:u.channel)??"weixin-ilink",onChange:E=>{g({channel:E.currentTarget.value==="lark"?"lark":"weixin-ilink"})},children:[x.jsx("option",{value:"weixin-ilink",children:"Weixin iLink"}),x.jsx("option",{value:"lark",children:"Lark"})]})]}),x.jsxs("div",{className:"gateway-actions",children:[x.jsx(di,{checked:!!(u!=null&&u.enabled),className:"sidebar-switch",disabled:n||!u||!u.enabled&&!C,label:"Gateway",title:C?"Enable or disable PM messages and task-changing Gateway commands":"Configure the selected Gateway channel first",onChange:E=>o(E)}),x.jsx(di,{checked:!!(u!=null&&u.translationEnabled),className:"sidebar-switch",disabled:n||!u,label:"Translation",onChange:E=>c(E)}),b?x.jsx("button",{type:"button",disabled:n,onClick:f,children:"Start QR Setup"}):T?x.jsx("button",{className:"danger-button",type:"button",disabled:n,onClick:d,children:"Reset Binding"}):x.jsx("button",{type:"button",disabled:n,onClick:l,children:"Start QR Login"})]}),b?x.jsxs("div",{className:"gateway-lark-settings",children:[x.jsx("p",{className:"muted",children:u!=null&&u.binding.appIdConfigured&&u.binding.appSecretConfigured?`Lark app configured${u.binding.larkBotName?` · ${u.binding.larkBotName}`:""}.`:"Use QR setup to create and configure the Lark bot automatically."}),r?x.jsxs("p",{className:"muted",children:["QR setup: ",(s==null?void 0:s.status)??r.status,s!=null&&s.message?` · ${s.message}`:""]}):null]}):p?x.jsx("p",{className:"muted",children:"QR login started. Use the login dialog to confirm binding."}):null,!b&&h?x.jsxs("p",{className:"muted",children:["QR status: ",h.status,h.message?` · ${h.message}`:""]}):null]})}function U2({busy:n,onPull:r,project:s}){const o=s.pullDisabledReason,d=!!s.canPull;return x.jsxs("div",{className:"project-summary",children:[x.jsxs("dl",{children:[x.jsxs("div",{children:[x.jsx("dt",{children:"Base path"}),x.jsx("dd",{children:s.repoRoot})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Branch"}),x.jsx("dd",{children:P2(s)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Remote"}),x.jsx("dd",{children:s.upstreamBranch??"no upstream"})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Status"}),x.jsx("dd",{children:F2(s)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Commit"}),x.jsx("dd",{children:s.shortHeadCommit??s.headCommit??"unknown"})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Working tree"}),x.jsx("dd",{children:s.isDirty?"uncommitted changes":"clean"})]})]}),x.jsxs("div",{className:"connected-repo-actions",children:[x.jsx("button",{type:"button",disabled:n||!d,title:o??"Pull latest changes with git pull --ff-only",onClick:()=>void r(),children:"Pull"}),x.jsx("span",{className:"muted",children:s.checkedAt?`checked ${Th(s.checkedAt)}`:"status not refreshed"})]}),o?x.jsx("p",{className:"muted",children:o}):null,s.warnings.length>0?x.jsx("ul",{className:"warnings",children:s.warnings.map(g=>x.jsx("li",{children:g},g))}):null]})}function P2(n){return n.branch||"unknown"}function F2(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 q2({roundState:n,task:r}){var p;const[s,o]=ne.useState(()=>Date.now()),d=!!(n!=null&&n.startedAt),g=vv(r.createdAt,s),f=Fg(n,(n==null?void 0:n.totalCcActiveMs)??0,s),l=d&&n?Fg(n,n.currentRoundCcActiveMs,s):0,c=d&&n?$2(n,s):0,h=((p=r.title)==null?void 0:p.trim())||r.taskSlug;return ne.useEffect(()=>{const u=window.setInterval(()=>o(Date.now()),1e3);return()=>window.clearInterval(u)},[]),x.jsxs("section",{className:"task-status-dock","aria-label":"VCM Session status",children:[x.jsxs("div",{className:"task-status-dock-title",children:[x.jsx("strong",{title:h,children:h}),x.jsx("span",{className:`status-badge status-${r.status}`,children:r.status})]}),x.jsxs("dl",{className:"task-status-stats",children:[x.jsxs("div",{children:[x.jsx("dt",{children:"Session start"}),x.jsx("dd",{children:Th(r.createdAt)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Session total"}),x.jsx("dd",{children:yo(g)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Rounds"}),x.jsx("dd",{children:(n==null?void 0:n.totalRoundCount)??0})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Role runtime"}),x.jsx("dd",{children:yo(f)})]})]}),d&&n?x.jsxs("div",{className:"current-round-status",children:[x.jsxs("div",{className:"current-round-title",children:[x.jsx("span",{children:n.status==="running"?"Current Round":"Last Round"}),x.jsx("span",{className:`status-badge status-${n.status}`,children:n.status})]}),x.jsxs("dl",{className:"task-status-stats",children:[x.jsxs("div",{children:[x.jsx("dt",{children:"Started"}),x.jsx("dd",{children:Th(n.startedAt)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Total"}),x.jsx("dd",{children:yo(c)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Role runtime"}),x.jsx("dd",{children:yo(l)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Turn count"}),x.jsx("dd",{children:n.turnCount})]})]})]}):null]})}function Fg(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 $2(n,r){const s=n.status==="running"?r:Date.parse(n.stoppedAt??n.lastTurnEndedAt??"");return vv(n.startedAt??"",Number.isFinite(s)?s:r)}function vv(n,r){const s=Date.parse(n);return Number.isFinite(s)?Math.max(0,r-s):0}function Th(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 yo(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 G2(n){return n==="system"?"light":n==="light"?"dark":"system"}function qg(n){return n==="system"?"System":n==="light"?"Light":"Dark"}function V2({events:n,onClose:r}){return x.jsx("div",{className:"modal-backdrop",children:x.jsxs("section",{className:"event-modal",role:"dialog","aria-modal":"true","aria-label":"Events",children:[x.jsxs("header",{children:[x.jsxs("div",{children:[x.jsx("h2",{children:"Events"}),x.jsxs("p",{className:"muted",children:[n.length," total"]})]}),x.jsx("button",{type:"button",onClick:r,children:"Close"})]}),x.jsx(C2,{events:n,maxEvents:null,showHeader:!1})]})})}function W2({busy:n,messages:r,orchestration:s,onClose:o,onMarkAllDone:d,onDeleteMessageHistory:g}){const f=Zh(r);function l(){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(`
|
|
94
|
-
`))&&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(`
|
|
95
|
-
`))&&g()}return x.jsx("div",{className:"modal-backdrop",children:x.jsxs("section",{className:"message-modal",role:"dialog","aria-modal":"true","aria-label":"Messages",children:[x.jsxs("header",{children:[x.jsxs("div",{children:[x.jsx("h2",{children:"Messages"}),x.jsxs("p",{className:"muted",children:[f.total," total / ",f.accepted," accepted",s?` · ${s.mode}`:""]})]}),x.jsxs("div",{className:"modal-actions",children:[x.jsx("button",{type:"button",disabled:n,onClick:l,children:"Mark All Done"}),x.jsx("button",{type:"button",disabled:n||f.total===0,onClick:c,children:"Delete All"}),x.jsx("button",{type:"button",onClick:o,children:"Close"})]})]}),x.jsx(k2,{busy:n,maxMessages:null,messages:r,orchestration:s,showControls:!1,showHeader:!1})]})})}function Hr({children:n,onOpenChange:r,open:s,title:o}){return x.jsxs("section",{className:"sidebar-section",children:[x.jsxs("button",{"aria-expanded":s,className:"sidebar-section-toggle",type:"button",onClick:()=>{r==null||r(!s)},children:[x.jsx("span",{children:o}),x.jsx("span",{"aria-hidden":"true",className:"sidebar-section-chevron"})]}),s?x.jsx("div",{className:"sidebar-section-content",children:n}):null]})}function yv(n,r){return n.find(s=>s.role===r)}function K2({activeRole:n,roles:r=Dh,sessions:s,onSelect:o}){return x.jsx("div",{className:"role-tabs",role:"tablist","aria-label":"Role sessions",children:r.map(d=>{const g=yv(s,d.name),f=(g==null?void 0:g.status)==="running"?g.activityStatus??"idle":(g==null?void 0:g.status)??"not_started";return x.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:[x.jsx("span",{children:d.label}),x.jsx(Bi,{status:f})]},d.name)})})}function Y2({role:n,session:r,permissionMode:s,model:o,effort:d,active:g=!0,busy:f,translationEnabled:l,translationAutoSendEnabled:c,translationTargetLanguage:h,onPermissionModeChange:p,onModelChange:u,onEffortChange:b,onStart:C,onResume:T,onStop:E,onRestart:S,onNotifyHarnessUpdated:v,onTerminalEvent:_}){const y=g&&W0(n)&&l&&(r==null?void 0:r.status)==="running";return x.jsx("section",{className:"session-console",children:x.jsxs("div",{className:y?"session-console-body has-translation":"session-console-body",children:[x.jsxs("div",{className:"terminal-pane",children:[x.jsx(Lh,{role:n,session:r,permissionMode:s,model:o,effort:d,busy:f,onPermissionModeChange:p,onModelChange:u,onEffortChange:b,onStart:C,onResume:T,onStop:E,onRestart:S,onNotifyHarnessUpdated:v}),(r==null?void 0:r.status)==="running"?x.jsx(Lo,{sessionId:r.id,active:g,onEvent:_},r.id):x.jsxs("div",{className:"terminal-empty",children:[x.jsx("strong",{children:n}),x.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."})]})]}),y?x.jsx("div",{className:"translation-pane",children:x.jsx(t2,{active:g,autoSendEnabled:c,targetLanguage:h,taskSlug:r.taskSlug,role:n,sessionId:r.id},`${n}:${r.id}`)}):null]})})}function X2(n,r,s){var g;if(!n||s.mode!=="auto")return null;const o=new Map(n.map(f=>[f.id,f])),d=r.filter(f=>{var l;return f.dispatchingAt?((l=o.get(f.id))==null?void 0:l.dispatchingAt)!==f.dispatchingAt:!1});return d.length===0?null:((g=d.sort(Q2)[d.length-1])==null?void 0:g.toRole)??null}function Q2(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 J2={"project-manager":"bypassPermissions",architect:"bypassPermissions",coder:"bypassPermissions",reviewer:"bypassPermissions","gate-reviewer":"bypassPermissions",translator:"bypassPermissions","harness-engineer":"bypassPermissions"},Z2={"project-manager":"default",architect:"default",coder:"default",reviewer:"default","gate-reviewer":"default",translator:"default","harness-engineer":"default"},ek={"project-manager":"default",architect:"default",coder:"default",reviewer:"default","gate-reviewer":"default",translator:"medium","harness-engineer":"medium"};function tk({task:n,activeRole:r,gateReviewerEnabled:s,translationEnabled:o,translationAutoSendEnabled:d,translationTargetLanguage:g,launchTemplate:f,refreshNonce:l=0,onTaskChanged:c,onActiveRoleChange:h,onMessagesChanged:p,onOrchestrationChanged:u,onRoundStateChanged:b,onEventsChanged:C,onLaunchStateChanged:T}){const[E,S]=ne.useState(null),[v,_]=ne.useState(()=>Gg(f)),[y,A]=ne.useState(()=>Vg(f)),[L,D]=ne.useState(()=>Wg(f)),[R,k]=ne.useState(!1),[,M]=ji(""),[B,H]=ne.useState([]),[U,P]=ne.useState(null),K=ne.useRef(null),X=ne.useRef(""),G=ne.useMemo(()=>JSON.stringify(f),[f]),W=!!(E!=null&&E.sessions.some(Z=>Z.role==="gate-reviewer")),te=s||W,z=[...zs,...te?[e_]:[]],j=ne.useCallback((Z,Q)=>{var De;const _e=((De=K.current)==null?void 0:De.taskSlug)===n.taskSlug?K.current.messages:null,ve=X2(_e,Z,Q);K.current={taskSlug:n.taskSlug,messages:Z},P(Q),p==null||p(Z),u==null||u(Q),ve&&(h(ve),ae(`auto switched to ${ve} before VCM dispatch`))},[h,p,u,n.taskSlug]),N=ne.useCallback((Z,Q,_e,ve)=>{S(Z),j(Q,_e),b==null||b(ve)},[j,b]),$=ne.useCallback(async()=>{const Z=await ye.getTaskWorkspaceState(n.taskSlug);N(Z.taskStatus,Z.messages,Z.orchestration,Z.roundState),To("Poll task workspace state"),M(Q=>wo(Q,["Load task workspace state","Poll task workspace state"]))},[N,n.taskSlug]),I=ne.useCallback((Z,Q)=>{const _e=Qh(Z,Q);_e&&M(_e)},[]);Qa(`task-workspace:${n.taskSlug}:${l}`,()=>$().catch(Z=>{I("Poll task workspace state",Z)}),{intervalMs:3e3,runImmediately:!0}),ne.useEffect(()=>{H([]),C==null||C([])},[C,n.taskSlug]),ne.useEffect(()=>{_(Gg(f)),A(Vg(f)),D(Wg(f))},[G,n.taskSlug]),ne.useEffect(()=>{E&&!te&&r==="gate-reviewer"&&h("project-manager"),E&&r==="translator"&&h("project-manager")},[r,te,h,E]),ne.useEffect(()=>{const Z=E==null?void 0:E.task;if(!Z||Z.taskSlug!==n.taskSlug)return;const Q=$g(Z);if(Q===$g(n)){X.current="";return}X.current!==Q&&(X.current=Q,c().catch(_e=>{X.current="",M(pt("Refresh task list after task status changed",_e))}))},[c,E==null?void 0:E.task,n]),ne.useEffect(()=>{const Z=(E==null?void 0:E.sessions)??[],Q=Z.filter(Ae=>nk(Ae.role)),_e=new Set(Q.map(Ae=>Ae.role)),ve=Z.some(Ae=>Ae.role==="gate-reviewer"),De={};for(const Ae of Us)De[Ae.name]={permissionMode:v[Ae.name],model:y[Ae.name],effort:L[Ae.name]};T==null||T({taskSlug:n.taskSlug,roles:De,autoOrchestration:((U==null?void 0:U.mode)??"auto")==="auto",statusLoaded:!!E,sessionCount:Q.length,hasAnySession:Q.length>0,hasGateReviewerSession:ve,allRolesHaveSession:zs.every(Ae=>_e.has(Ae.name))})},[y,L,T,U==null?void 0:U.mode,v,E,n.taskSlug]);async function se(Z,Q="Run role session action"){k(!0),M("");try{await Z(),await $(),await c()}catch(_e){M(pt(Q,_e))}finally{k(!1)}}function ae(Z){H(Q=>{const _e=[...Q,`${new Date().toLocaleTimeString()} ${Z}`];return C==null||C(_e),_e})}function ue(Z,Q){_(_e=>({..._e,[Z]:Q}))}function Y(Z,Q){A(_e=>({..._e,[Z]:Q}))}function q(Z,Q){D(_e=>({..._e,[Z]:Q}))}return x.jsxs("div",{className:"task-workspace",children:[x.jsxs("header",{className:"workspace-header",children:[x.jsx("div",{className:"workspace-title-line",children:x.jsx("h1",{children:n.title||n.taskSlug})}),x.jsx(K2,{activeRole:r,roles:z,sessions:(E==null?void 0:E.sessions)??[],onSelect:h})]}),x.jsx("div",{className:"workspace-grid",children:x.jsx("div",{className:"workspace-main",children:x.jsx("div",{className:"role-console-stack",children:z.map(Z=>{const Q=Z.name,_e=Q===r,ve=(E==null?void 0:E.sessions)??[],De=yv(ve,Q);return x.jsx("div",{className:_e?"role-console-panel is-active":"role-console-panel","aria-hidden":!_e,children:x.jsx(Y2,{role:Q,session:De,permissionMode:v[Q],model:y[Q],effort:L[Q],active:_e,busy:R,translationEnabled:o,translationAutoSendEnabled:d,translationTargetLanguage:g,onPermissionModeChange:Ae=>ue(Q,Ae),onModelChange:Ae=>Y(Q,Ae),onEffortChange:Ae=>q(Q,Ae),onStart:()=>void se(async()=>{await ye.startRoleSession(n.taskSlug,Q,{cols:100,rows:28,permissionMode:v[Q],model:y[Q],effort:L[Q]}),ae(`started ${Q} with ${v[Q]} / ${y[Q]} / ${L[Q]}`)},`Start ${Q} session`),onResume:()=>void se(async()=>{await ye.resumeRoleSession(n.taskSlug,Q,{cols:100,rows:28,permissionMode:v[Q],model:y[Q],effort:L[Q]}),ae(`resumed ${Q} with ${v[Q]} / ${y[Q]} / ${L[Q]}`)},`Resume ${Q} session`),onStop:()=>void se(async()=>{await ye.stopRoleSession(n.taskSlug,Q),ae(`stopped ${Q}`)},`Stop ${Q} session`),onRestart:()=>void se(async()=>{await ye.restartRoleSession(n.taskSlug,Q,{cols:100,rows:28,permissionMode:v[Q],model:y[Q],effort:L[Q]}),ae(`restarted ${Q} with ${v[Q]} / ${y[Q]} / ${L[Q]}`)},`Restart ${Q} session`),onNotifyHarnessUpdated:()=>void se(async()=>{await ye.notifyRoleHarnessUpdated(n.taskSlug,Q),ae(`notified ${Q} to reload latest harness`)},`Notify ${Q} to reload harness`),onTerminalEvent:Ae=>ae(`${Z.label}: ${Ae}`)})},Q)})})})})]})}function nk(n){return zs.some(r=>r.name===n)}function $g(n){return[n.status,n.updatedAt,n.cleanupStatus??"",n.cleanedAt??""].join(":")}function Gg(n){var s;const r={...J2};for(const o of Us)r[o.name]=((s=n.roles[o.name])==null?void 0:s.permissionMode)??r[o.name];return r}function Vg(n){var s;const r={...Z2};for(const o of Us)r[o.name]=((s=n.roles[o.name])==null?void 0:s.model)??r[o.name];return r}function Wg(n){var s;const r={...ek};for(const o of Us)r[o.name]=((s=n.roles[o.name])==null?void 0:s.effort)??r[o.name];return r}const ik=120*1e3,Kg=1400,rk=3;function sk(n){return!!(n!=null&&n.initialized)}function ak(){const[n,r]=ne.useState(null),[s,o]=ne.useState([]),[d,g]=ne.useState(null),[f,l]=ne.useState(null),[c,h]=ne.useState(null),[p,u]=ne.useState(null),[b,C]=ne.useState(null),[T,E]=ne.useState(null),[S,v]=ne.useState(null),[_,y]=ne.useState(null),[A,L]=ne.useState(null),[D,R]=ne.useState(!1),[k,M]=ne.useState(null),[B,H]=ne.useState(null),[U,P]=ne.useState(!1),[K,X]=ne.useState([]),[G,W]=ne.useState(null),[te,z]=ne.useState(null),[j,N]=ne.useState(null),[$,I]=ne.useState(null),[se,ae]=ne.useState(null),[ue,Y]=ne.useState(null),[q,Z]=ne.useState("project-manager"),[Q,_e]=ne.useState("system"),[ve,De]=ne.useState(!0),[Ae,Ke]=ne.useState(!0),[ht,Re]=ne.useState("off"),[sn,en]=ne.useState(!1),[Vt,an]=ne.useState(!1),[yn,bt]=ne.useState(!1),[et,Lt]=ne.useState(K0),[fe,Se]=ne.useState(Y0),[xe,Le]=ne.useState(!1),[Be,mt]=ne.useState(!1),[Pe,vt]=ne.useState(!1),[_t,Ot]=ne.useState(!1),[Xe,tn]=ne.useState(!1),[Bt,ln]=ne.useState(null),[Vn,Wn]=ne.useState("bypassPermissions"),[Ht,on]=ne.useState("default"),[Kn,Wt]=ne.useState("medium"),[qs,Kt]=ne.useState(null),[Sn,zt]=ne.useState("bypassPermissions"),[Hi,He]=ne.useState("default"),[mi,Fr]=ne.useState("medium"),[zi,$s]=ne.useState(()=>Q0()),[Yn,tl]=ne.useState(null),[ri,Et]=ne.useState(0),[It,Xn]=ne.useState(null),[Gs,zo]=ne.useState(null),[nl,il]=ne.useState(!1),[On,qr]=ne.useState(!1),[,cn]=ji(""),gi=ne.useRef({}),si=ne.useRef({}),_i=ne.useRef({}),at=ne.useRef(null),$r=ne.useRef(""),re=ne.useMemo(()=>y2(K,G),[K,G]),kt=(Yn==null?void 0:Yn.taskSlug)===(re==null?void 0:re.taskSlug)?Yn:null,ai=c===(re==null?void 0:re.taskSlug)?d:null,rl=p===(re==null?void 0:re.taskSlug)?f:null,sl=!!(n&&re&&sk(ai)),al=(Bt==null?void 0:Bt.status)==="running",Gr=!!(S!=null&&S.running),gr=!!(Vt&&sl&&al),Vr=!!(kt!=null&&kt.statusLoaded),Qn=!!(re&&(kt!=null&&kt.statusLoaded)&&!kt.hasAnySession),ct=ne.useCallback(V=>{_e(V.themeMode),De(V.flowPauseAlerts),Ke(V.roleRetryEnabled),Re(V.permissionRequestMode),en(V.autoTaskHarnessReviewEnabled),an(V.translationEnabled),bt(V.translationAutoSendEnabled),Lt(V.translationTargetLanguage),Se(V.translationOutputMode),$s(V.launchTemplate)},[]),Ut=ne.useCallback(()=>{at.current!==null&&(window.clearInterval(at.current),at.current=null)},[]),ll=ne.useCallback(()=>{Ut(),So(),at.current=window.setInterval(()=>{So()},Kg)},[Ut]),Wr=ne.useCallback(()=>{Ut();let V=1;So(),at.current=window.setInterval(()=>{V+=1,So(),V>=rk&&at.current!==null&&(window.clearInterval(at.current),at.current=null)},Kg)},[Ut]),Vs=ne.useCallback((V,pe=`manual-${Date.now()}`,Ue={})=>{Xn({id:pe,text:V}),Ue.sound==="strong"?ll():Ue.sound==="weak"?Wr():Ut()},[Wr,ll,Ut]),Kr=ne.useCallback(()=>{Ut(),Xn(null)},[Ut]);ne.useEffect(()=>{re!=null&&re.taskSlug&&(_i.current[re.taskSlug]=Date.now())},[re==null?void 0:re.taskSlug]);const Io=ne.useCallback(V=>{re!=null&&re.taskSlug&&z({taskSlug:re.taskSlug,messages:V})},[re==null?void 0:re.taskSlug]),un=ne.useCallback(V=>{re!=null&&re.taskSlug&&N({taskSlug:re.taskSlug,orchestration:V})},[re==null?void 0:re.taskSlug]),Ws=ne.useCallback(V=>{re!=null&&re.taskSlug&&I({taskSlug:re.taskSlug,events:V})},[re==null?void 0:re.taskSlug]),ol=ne.useCallback(V=>{var Js,ul;if(!(re!=null&&re.taskSlug)||V.taskSlug!==re.taskSlug)return;if(ae({taskSlug:V.taskSlug,roundState:V}),V.status==="running"&&V.activeRole==="gate-reviewer"&&Z("gate-reviewer"),((Js=V.roleRecovery)==null?void 0:Js.status)==="waiting"||((ul=V.roleRecovery)==null?void 0:ul.status)==="retrying"){si.current[V.taskSlug]={status:V.status};return}if(V.status!=="stopped"||!V.roundId){si.current[V.taskSlug]={status:V.status};return}const pe=hk(V),Ue=gi.current[V.taskSlug],Ct=si.current[V.taskSlug];if(si.current[V.taskSlug]={status:V.status},Ue===pe||(gi.current[V.taskSlug]=pe,!uk(V,Ct,_i.current[V.taskSlug])))return;if(Gr){Ut(),Xn(null);return}const Zn=V.activeRole??"role",jn=ve?ck(V)>=ik?"strong":"weak":"none",Nn=V.roleRecovery,ns=(Nn==null?void 0:Nn.status)==="failed"?pk(Nn,Zn):`No new turn started after ${Zn} stopped.`;Vs(ns,pe,{sound:jn})},[re==null?void 0:re.taskSlug,Gr,ve,Vs,Ut]),Ks=ne.useCallback(V=>{tl(pe=>(pe==null?void 0:pe.taskSlug)===V.taskSlug&&pe.statusLoaded===V.statusLoaded&&pe.sessionCount===V.sessionCount&&pe.hasAnySession===V.hasAnySession&&pe.hasGateReviewerSession===V.hasGateReviewerSession&&pe.allRolesHaveSession===V.allRolesHaveSession&&pe.autoOrchestration===V.autoOrchestration&&JSON.stringify(pe.roles)===JSON.stringify(V.roles)?pe:V)},[]);async function bn(){const V=await ye.listTasks();return X(V),W(pe=>{var Ue;return pe&&V.some(Ct=>Ct.taskSlug===pe)?pe:((Ue=V[0])==null?void 0:Ue.taskSlug)??null}),V}async function Yr(V=re==null?void 0:re.taskSlug){if(!V)return g(null),h(null),null;const pe=await ye.getHarnessStatus(V);return g(pe),h(V),pe}async function Xr(V=re==null?void 0:re.taskSlug){if(!V)return l(null),u(null),null;const pe=await ye.getHarnessBootstrapStatus(V);return l(pe),u(V),pe}async function Cn(){const V=await ye.getGatewayStatus();return v(V),V}async function Uo(){const V=await ye.getRecentRepositoryPaths();return o(V),V}async function Ys(){if(!n)return Le(!1),!1;const V=await ye.getTranslationState();return Le(V.memoryInitialized),V.memoryInitialized}async function Qr(V){const[pe,Ue]=await Promise.all([ye.listMessages(V),ye.getOrchestrationState(V)]);z({taskSlug:V,messages:pe}),N({taskSlug:V,orchestration:Ue})}async function Jr(V){const pe=await ye.getGateReviewState(V);return Y({taskSlug:V,state:pe}),To("Poll Gate Review state"),cn(Ue=>wo(Ue,["Refresh Gate Review state","Poll Gate Review state"])),pe}function cl(V,pe){const Ue=Qh(V,pe);Ue&&cn(Ue)}function Ii(V){V&&(Wn(V.permissionMode),V.model&&on(V.model),V.effort&&Wt(V.effort))}async function _r(V={}){const pe=await ye.getTranslatorSession();return ln(pe),V.syncLaunchOptions&&Ii(pe),pe}function Yt(V){V&&(zt(V.permissionMode),V.model&&He(V.model),V.effort&&Fr(V.effort))}async function Bn(V={}){const pe=await ye.getHarnessEngineerSession();return Kt(pe),V.syncLaunchOptions&&Yt(pe),pe}function Xs(V,pe,Ue={}){var Ct;ln(V.translatorSession),Le(!!((Ct=V.translationState)!=null&&Ct.memoryInitialized)),Kt(V.harnessEngineerSession),E(V.harnessFeedbackState),v(V.gatewayStatus),pe&&V.harnessStatus?(g(V.harnessStatus),h(pe)):(g(null),h(null)),pe&&V.harnessBootstrapStatus?(l(V.harnessBootstrapStatus),u(pe)):(l(null),u(null)),Ue.syncLaunchOptions&&(Ii(V.translatorSession),Yt(V.harnessEngineerSession))}async function Ui(V={}){if(!n)return ln(null),Le(!1),Kt(null),g(null),l(null),h(null),u(null),E(null),null;const pe=(re==null?void 0:re.taskSlug)??null,Ue=await ye.getProjectRuntimeState(pe);return Xs(Ue,pe,V),Ue}function Pi(){const V=["Poll project runtime state","Load project runtime state","Refresh Harness feedback state","Poll Harness feedback state","Load Translator session","Poll Translator session","Poll translation memory status","Load Harness Engineer session","Poll Harness Engineer session","Load VCM Harness status","Poll VCM Harness status"];for(const pe of V)To(pe);cn(pe=>wo(pe,V))}ne.useEffect(()=>{Promise.all([ye.getCurrentProject(),ye.getRecentRepositoryPaths(),ye.getAppPreferences(),ye.getGatewayStatus()]).then(async([V,pe,Ue,Ct])=>{r(V),o(pe),v(Ct),ct(Ue),V&&await bn()}).catch(V=>cn(pt("Load initial app data",V)))},[ct]),ne.useEffect(()=>{const V=window.matchMedia("(prefers-color-scheme: dark)"),pe=()=>il(V.matches);return pe(),V.addEventListener("change",pe),()=>V.removeEventListener("change",pe)},[]),ne.useEffect(()=>()=>Ut(),[Ut]),ne.useEffect(()=>{Gr&&(Ut(),Xn(null))},[Gr,Ut]),ne.useEffect(()=>{const V=Q==="system"?nl?"dark":"light":Q;document.documentElement.dataset.theme=V,document.documentElement.dataset.themeMode=Q},[nl,Q]),ne.useEffect(()=>{if(!(re!=null&&re.taskSlug)){Y(null);return}Jr(re.taskSlug).catch(V=>cn(pt("Refresh Gate Review state",V)))},[re==null?void 0:re.taskSlug]),ne.useEffect(()=>{$r.current="",ln(null),Wn("bypassPermissions"),on("default"),Wt("medium"),Le(!1),Kt(null),zt("bypassPermissions"),He("default"),Fr("medium"),g(null),l(null),h(null),u(null),E(null)},[n==null?void 0:n.repoRoot]),Qa(n?`project-runtime:${n.repoRoot}:${(re==null?void 0:re.taskSlug)??"no-task"}`:null,async()=>{try{const V=(n==null?void 0:n.repoRoot)??"",pe=!!(n&&$r.current!==V);await Ui({syncLaunchOptions:pe}),pe&&($r.current=V),Pi()}catch(V){cl("Poll project runtime state",V)}},{intervalMs:3e3,runImmediately:!0});const hn=(re==null?void 0:re.taskSlug)??null,vr=hn&&(ue==null?void 0:ue.taskSlug)===hn?ue.state:null,Zr=hn&&(se==null?void 0:se.taskSlug)===hn?se.roundState:null,vi=hn&&(Yn==null?void 0:Yn.taskSlug)===hn?Yn:null,Jn=!!(hn&&(vr!=null&&vr.activeGate||(Zr==null?void 0:Zr.activeRole)==="gate-reviewer"||vi!=null&&vi.hasGateReviewerSession));Qa(Jn&&hn?`gate-review:${hn}`:null,async()=>{if(hn)try{await Jr(hn)}catch(V){cl("Poll Gate Review state",V)}},{intervalMs:3e3,runImmediately:!1});async function ke(V,pe="Run UI action"){qr(!0),cn("");try{await V()}catch(Ue){cn(pt(pe,Ue))}finally{qr(!1)}}async function yr(){if(!re)throw new Error("Create or select a task before closing it.");const V=[`Close task "${re.taskSlug}"?`,"","This is destructive:","- stops VCM-managed running role sessions for this task","- moves project-scoped Translator and Harness Engineer sessions to the base repository cwd",`- deletes the task worktree: ${re.worktreePath}`,`- deletes the Git branch: ${re.branch}`,"- deletes VCM task/session/message/orchestration state","","VCM will not check running sessions or uncommitted changes before closing."].join(`
|
|
96
|
-
`);window.confirm(V)&&(await ye.cleanupTask(re.taskSlug,{force:!0,forceDeleteBranch:!0}),W(null),z(null),N(null),I(null),ae(null),Y(null),Et(Ue=>Ue+1),await bn())}const li=te&&te.taskSlug===(re==null?void 0:re.taskSlug)?te.messages:[],Qs=j&&j.taskSlug===(re==null?void 0:re.taskSlug)?j.orchestration:null,es=$&&$.taskSlug===(re==null?void 0:re.taskSlug)?$.events:[],wn=se&&se.taskSlug===(re==null?void 0:re.taskSlug)?se.roundState:null,Fi=re!=null&&re.taskSlug&&(wn!=null&&wn.roleRecovery)?fk(re.taskSlug,wn.roleRecovery):null,Sr=wn!=null&&wn.roleRecovery&&wn.roleRecovery.status!=="failed"&&Fi!==Gs?dk(wn.roleRecovery):null,ts=ue&&ue.taskSlug===(re==null?void 0:re.taskSlug)?ue.state:null,Pt=!!(ts&&Object.values(ts.gates).some(V=>V.required));return x.jsxs(J0,{sidebar:x.jsx(L2,{project:n,recentRepositoryPaths:s,tasks:K,activeTaskSlug:(re==null?void 0:re.taskSlug)??null,messages:li,orchestration:Qs,events:es,roundState:wn,gateReview:ts,translationEnabled:gr,translationAutoSendEnabled:yn,translationTargetLanguage:et,translationOutputMode:fe,translationMemoryInitialized:xe,translatorSession:Bt,harnessStatus:ai,harnessBootstrapStatus:rl,harnessApplyResult:b,autoTaskHarnessReviewEnabled:sn,gatewayStatus:S,gatewayQrLogin:_,gatewayQrCheck:A,gatewayLarkRegistration:k,gatewayLarkRegistrationCheck:B,busy:On,onConnect:V=>ke(async()=>{const pe=await ye.connectProject({repoPath:V});r(pe),C(null),await Promise.all([bn(),Uo()])},"Connect repository"),onRefreshConnectedRepository:()=>ke(async()=>{const V=await ye.getCurrentProject();r(V)},"Refresh connected repository"),onPullConnectedRepository:()=>ke(async()=>{const V=await ye.pullCurrentProject();r(V)},"Pull connected repository"),onRefreshHarness:()=>ke(async()=>{if(!re)throw new Error("Create or select a task before refreshing VCM Harness.");C(null),await Promise.all([Yr(re.taskSlug),Xr(re.taskSlug)])},"Refresh VCM Harness"),onApplyHarness:()=>ke(async()=>{if(!re)throw new Error("Create or select a task before applying VCM Harness.");const V=await ye.applyHarness({taskSlug:re.taskSlug});C(V),await Promise.all([Yr(re.taskSlug),Xr(re.taskSlug)])},"Apply VCM Harness"),onStartHarnessBootstrap:V=>ke(async()=>{if(!re)throw new Error("Create or select a task before starting Harness Bootstrap.");const pe=await ye.startHarnessBootstrap({taskSlug:re.taskSlug,cols:120,rows:32,...V});l(pe.status),u(re.taskSlug),await Bn({syncLaunchOptions:!0})},"Start Harness Bootstrap"),onRestartHarnessBootstrap:V=>ke(async()=>{if(!re)throw new Error("Create or select a task before restarting Harness Bootstrap.");const pe=await ye.restartHarnessBootstrap({taskSlug:re.taskSlug,cols:120,rows:32,...V});l(pe.status),u(re.taskSlug),await Bn({syncLaunchOptions:!0})},"Restart Harness Bootstrap"),onStopHarnessBootstrap:()=>ke(async()=>{const V=await ye.stopHarnessBootstrap();l(V),u((re==null?void 0:re.taskSlug)??null),await Bn()},"Stop Harness Bootstrap"),onRunHarnessBootstrap:()=>ke(async()=>{if(!re)throw new Error("Create or select a task before running Harness Bootstrap.");const V=await ye.runHarnessBootstrap({taskSlug:re.taskSlug});l(V.status),u(re.taskSlug),await Bn()},"Run Harness Bootstrap"),onOpenHarnessStudio:()=>Ot(!0),onOpenRepositoryDiff:()=>tn(!0),onAutoTaskHarnessReviewChange:V=>{en(V),ke(async()=>{const pe=await ye.updateAppPreferences({autoTaskHarnessReviewEnabled:V});ct(pe)},"Update auto task harness review setting")},onRefreshGateway:()=>ke(async()=>{await Cn()},"Refresh Gateway status"),onGatewayEnabledChange:V=>{ke(async()=>{const pe=await ye.updateGatewaySettings({enabled:V,...V&&n?{currentProjectId:n.repoRoot,currentTaskSlug:(re==null?void 0:re.taskSlug)??null}:{}});v(pe),V&&ct(await ye.getAppPreferences())},"Update Gateway enabled setting")},onGatewaySettingsChange:V=>ke(async()=>{const pe=await ye.updateGatewaySettings(V);v(pe)},"Update Gateway settings"),onGatewayTranslationChange:V=>{ke(async()=>{const pe=await ye.updateGatewaySettings({translationEnabled:V});v(pe)},"Update Gateway translation setting")},onStartGatewayQrLogin:()=>{ke(async()=>{const V=await ye.startGatewayQrLogin();y(V),L(null),R(!0),await Cn()},"Start Gateway QR login")},onStartGatewayLarkRegistration:()=>{ke(async()=>{const V=await ye.startGatewayLarkRegistration();M(V),H(null),P(!0),await Cn()},"Start Lark Gateway QR setup")},onResetGatewayBinding:()=>{ke(async()=>{const V=await ye.resetGatewayBinding();v(V),y(null),L(null),R(!1),M(null),H(null),P(!1)},"Reset Gateway binding")},onGateReviewGateEnabledChange:(V,pe)=>{ke(async()=>{if(!re)throw new Error("Create or select a task before changing Gate Review Gates.");const Ue=await ye.updateGateReviewSettings(re.taskSlug,{gates:{[V]:pe}});Y({taskSlug:re.taskSlug,state:Ue})},`Update ${V} Gate Review setting`)},onTranslationEnabledChange:V=>{an(V),ke(async()=>{const pe=await ye.updateAppPreferences({translationEnabled:V});ct(pe)},"Update conversation translation setting")},onTranslationAutoSendChange:V=>{bt(V),ke(async()=>{const pe=await ye.updateAppPreferences({translationAutoSendEnabled:V});ct(pe)},"Update translation auto-send setting")},onTranslationTargetLanguageChange:V=>{Lt(V),ke(async()=>{const pe=await ye.updateAppPreferences({translationTargetLanguage:V});ct(pe)},"Update translation target language")},onTranslationOutputModeChange:V=>{Se(V),ke(async()=>{const pe=await ye.updateAppPreferences({translationOutputMode:V});ct(pe)},"Update translation output mode")},onOpenFileTranslation:()=>mt(!0),onOpenTranslatorSession:()=>vt(!0),onCreateTranslationBootstrap:()=>{ke(async()=>{if(!re)throw new Error("Create or select a task before running Translation Bootstrap.");await ye.createTranslationBootstrap({taskSlug:re.taskSlug,targetLanguage:et}),await Ys(),await _r()},"Create Translation Bootstrap task")},onUpdateTranslationMemory:()=>{ke(async()=>{if(!re)throw new Error("Create or select a task before updating translation memory.");await ye.createTranslationMemoryUpdate({taskSlug:re.taskSlug,targetLanguage:et}),await Ys(),await _r()},"Create translation memory update task")},onCreateTask:V=>ke(async()=>{const pe=await ye.createTask(V);await bn(),W(pe.taskSlug)},"Create task"),onCloseTask:()=>{ke(yr,"Close task")},onSelectTask:W,themeMode:Q,onAutoOrchestrationChange:V=>{ke(async()=>{if(!re)throw new Error("Create or select a task before changing auto orchestration.");const pe=await ye.updateOrchestrationState(re.taskSlug,{mode:V?"auto":"manual"});N({taskSlug:re.taskSlug,orchestration:pe})},"Update auto orchestration mode")},onThemeModeChange:V=>{_e(V),ke(async()=>{const pe=await ye.updateAppPreferences({themeMode:V});ct(pe)},"Update theme setting")},pauseAlertSound:ve,onPauseAlertSoundChange:V=>{De(V),V&&vk(),ke(async()=>{const pe=await ye.updateAppPreferences({flowPauseAlerts:V});ct(pe)},"Update pause alert sound setting")},roleRetryEnabled:Ae,onRoleRetryEnabledChange:V=>{Ke(V),ke(async()=>{const pe=await ye.updateAppPreferences({roleRetryEnabled:V});ct(pe)},"Update CC retry setting")},permissionRequestMode:ht,onPermissionRequestModeChange:V=>{Re(V),ke(async()=>{const pe=await ye.updateAppPreferences({permissionRequestMode:V});ct(pe)},"Update permission request setting")},launchTemplate:zi,canSaveLaunchTemplate:Vr,canOneClickStart:Qn,onSaveLaunchTemplate:()=>{ke(async()=>{if(!(kt!=null&&kt.statusLoaded))throw new Error("Open a task workspace before saving a launch template.");const V=await ye.updateAppPreferences({launchTemplate:{version:1,roles:kt.roles,autoOrchestration:kt.autoOrchestration}});ct(V)},"Save launch template")},onOneClickStart:()=>{ke(async()=>{if(!re)throw new Error("Create or select a task before one-click start.");const V=await ye.getTaskStatus(re.taskSlug);if(V.sessions.some(Ct=>Mh.some(Zn=>Zn===Ct.role)))throw new Error("One-click start is only available before any role session has started.");const pe=await ye.updateOrchestrationState(re.taskSlug,{mode:zi.autoOrchestration?"auto":"manual"});N({taskSlug:re.taskSlug,orchestration:pe});const Ue=S2(zi,{gateReviewerEnabled:Pt});for(const Ct of Ue){const Zn={cols:100,rows:28,permissionMode:Ct.permissionMode,model:Ct.model,effort:Ct.effort},jn=V.sessions.find(Nn=>Nn.role===Ct.role);(jn==null?void 0:jn.status)!=="running"&&(jn!=null&&jn.claudeSessionId?await ye.resumeRoleSession(re.taskSlug,Ct.role,Zn):await ye.startRoleSession(re.taskSlug,Ct.role,Zn))}Z("project-manager"),await Qr(re.taskSlug),await bn(),Et(Ct=>Ct+1)},"One-click start role sessions")},onMarkAllMessagesDone:V=>{ke(async()=>{const pe=await ye.markAllMessagesDone(V);z({taskSlug:V,messages:pe.messages}),await Qr(V)},"Mark all role messages done")},onDeleteMessageHistory:V=>{ke(async()=>{const pe=await ye.deleteMessageHistory(V);z({taskSlug:V,messages:pe.messages}),await Qr(V)},"Delete role message history")}}),children:[x.jsx(_2,{}),It?x.jsx("div",{className:"flow-pause-alert-backdrop",children:x.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:[x.jsx("p",{className:"flow-pause-alert-kicker",children:"VCM needs attention"}),x.jsx("h2",{id:"flow-pause-alert-title",children:"Flow needs attention"}),x.jsx("p",{id:"flow-pause-alert-body",children:It.text}),x.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."}),x.jsx("button",{type:"button",autoFocus:!0,onClick:Kr,children:"Confirm"})]})}):null,Sr&&Fi?x.jsxs("div",{className:"role-recovery-toast",role:"status",children:[x.jsx("span",{children:Sr}),x.jsx("button",{type:"button",onClick:()=>zo(Fi),children:"Close"})]}):null,D&&_?x.jsx(lk,{busy:On,qrCheck:A,qrLogin:_,onCheck:()=>{ke(async()=>{const V=await ye.checkGatewayQrLogin();L(V),(V.status==="confirmed"||V.status==="binded_redirect")&&R(!1),await Cn()})},onClose:()=>R(!1)}):null,U&&k?x.jsx(ok,{busy:On,registration:k,registrationCheck:B,onCheck:()=>{ke(async()=>{const V=await ye.checkGatewayLarkRegistration();H(V),V.gatewayStatus&&v(V.gatewayStatus),V.status==="confirmed"&&(P(!1),await Cn())},"Check Lark Gateway QR setup")},onManualBind:(V,pe)=>{ke(async()=>{const Ue=await ye.bindGatewayLarkApp({appId:V,appSecret:pe,larkDomain:"lark"});H(Ue),Ue.gatewayStatus&&v(Ue.gatewayStatus),Ue.status==="confirmed"&&(P(!1),await Cn())},"Bind Lark Gateway app")},onClose:()=>P(!1)}):null,n&&re?x.jsx(tk,{task:re,activeRole:q,gateReviewerEnabled:Pt,translationEnabled:gr,translationAutoSendEnabled:yn,translationTargetLanguage:et,launchTemplate:zi,refreshNonce:ri,onTaskChanged:async()=>{await bn()},onActiveRoleChange:Z,onMessagesChanged:Io,onOrchestrationChanged:un,onRoundStateChanged:ol,onEventsChanged:Ws,onLaunchStateChanged:Ks}):x.jsxs("section",{className:"empty-workspace",children:[x.jsx("h1",{children:n?"Create a task to open the workspace":"Connect a repository to begin"}),x.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."})]}),x.jsx(r2,{open:Be,taskSlug:(re==null?void 0:re.taskSlug)??null,targetLanguage:et,onClose:()=>mt(!1)}),x.jsx(g1,{open:_t,busy:On,status:ai,bootstrapStatus:rl,engineerSession:qs,permissionMode:Sn,model:Hi,effort:mi,taskSlug:(re==null?void 0:re.taskSlug)??null,onClose:()=>Ot(!1),onRefresh:()=>{ke(async()=>{if(!re)throw new Error("Create or select a task before refreshing Harness Studio.");await Promise.all([Yr(re.taskSlug),Xr(re.taskSlug),Bn()])},"Refresh Harness Studio")},onPermissionModeChange:zt,onModelChange:He,onEffortChange:Fr,onEngineerStart:()=>{ke(async()=>{if(!re)throw new Error("Create or select a task before starting Harness Engineer.");const V=await ye.startHarnessEngineerSession({taskSlug:re.taskSlug,cols:120,rows:32,permissionMode:Sn,model:Hi,effort:mi});Kt(V),Yt(V)},"Start Harness Engineer")},onEngineerResume:()=>{ke(async()=>{if(!re)throw new Error("Create or select a task before resuming Harness Engineer.");const V=await ye.resumeHarnessEngineerSession({taskSlug:re.taskSlug,cols:120,rows:32,permissionMode:Sn,model:Hi,effort:mi});Kt(V),Yt(V)},"Resume Harness Engineer")},onEngineerRestart:()=>{ke(async()=>{if(!re)throw new Error("Create or select a task before restarting Harness Engineer.");const V=await ye.restartHarnessEngineerSession({taskSlug:re.taskSlug,cols:120,rows:32,permissionMode:Sn,model:Hi,effort:mi});Kt(V),Yt(V)},"Restart Harness Engineer")},onEngineerStop:()=>{ke(async()=>{const V=await ye.stopHarnessEngineerSession();Kt(V)},"Stop Harness Engineer")},onEngineerNotifyHarnessUpdated:()=>{ke(async()=>{const V=await ye.notifyHarnessEngineerHarnessUpdated();Kt(V),Yt(V)},"Notify Harness Engineer to reload harness")},onOpenRepositoryDiff:()=>tn(!0),onReviewTaskHarness:()=>{ke(async()=>{if(!re)throw new Error("Create or select a task before reviewing task harness.");const V=await ye.startTaskHarnessRetrospective({taskSlug:re.taskSlug,trigger:"manual"});E(V),await Bn({syncLaunchOptions:!0})},"Review task harness")}}),x.jsx(v1,{open:Xe,taskSlug:(re==null?void 0:re.taskSlug)??null,onClose:()=>tn(!1)}),x.jsx(w1,{open:Pe,busy:On,session:Bt,permissionMode:Vn,model:Ht,effort:Kn,onClose:()=>vt(!1),onPermissionModeChange:Wn,onModelChange:on,onEffortChange:Wt,onStart:()=>{ke(async()=>{if(!re)throw new Error("Create or select a task before starting Translator.");const V=await ye.startTranslatorSession({taskSlug:re.taskSlug,cols:100,rows:28,permissionMode:Vn,model:Ht,effort:Kn});ln(V),Ii(V)},"Start Translator session")},onResume:()=>{ke(async()=>{if(!re)throw new Error("Create or select a task before resuming Translator.");const V=await ye.resumeTranslatorSession({taskSlug:re.taskSlug,cols:100,rows:28,permissionMode:Vn,model:Ht,effort:Kn});ln(V),Ii(V)},"Resume Translator session")},onRestart:()=>{ke(async()=>{if(!re)throw new Error("Create or select a task before restarting Translator.");const V=await ye.restartTranslatorSession({taskSlug:re.taskSlug,cols:100,rows:28,permissionMode:Vn,model:Ht,effort:Kn});ln(V),Ii(V)},"Restart Translator session")},onStop:()=>{ke(async()=>{const V=await ye.stopTranslatorSession();ln(V)},"Stop Translator session")},onNotifyHarnessUpdated:()=>{ke(async()=>{const V=await ye.notifyTranslatorHarnessUpdated();ln(V),Ii(V)},"Notify Translator to reload harness")}}),x.jsx(Z0,{busy:On,state:T,onCancel:V=>{ke(async()=>{const pe=await ye.decideHarnessFeedback({action:"cancel",taskSlug:re==null?void 0:re.taskSlug,comment:V});E(pe)},"Cancel Harness feedback")},onApprove:V=>{ke(async()=>{if(!re)throw new Error("Create or select a task before approving Harness feedback.");const pe=await ye.decideHarnessFeedback({action:"approve",taskSlug:re.taskSlug,comment:V});E(pe),await Bn()},"Approve Harness feedback")},onComment:V=>{ke(async()=>{if(!re)throw new Error("Create or select a task before sending Harness feedback comments.");const pe=await ye.decideHarnessFeedback({action:"comment",taskSlug:re.taskSlug,comment:V});E(pe),await Bn()},"Send Harness feedback comment")},onReject:V=>{ke(async()=>{const pe=await ye.decideHarnessFeedback({action:"reject",taskSlug:re==null?void 0:re.taskSlug,comment:V});E(pe)},"Reject Harness feedback")}})]})}function lk({busy:n,onCheck:r,onClose:s,qrCheck:o,qrLogin:d}){const[g,f]=ne.useState(""),[l,c]=ji("");return ne.useEffect(()=>{let h=!1;if(c(""),f(""),d.qrcodeUrl.startsWith("data:image/")){f(d.qrcodeUrl);return}try{const p=Ur(0,"M");p.addData(d.qrcodeUrl),p.make(),h||f(p.createDataURL(8,2))}catch(p){h||c(pt("Render Gateway QR login code",p))}return()=>{h=!0}},[d.qrcodeUrl]),x.jsx("div",{className:"modal-backdrop",children:x.jsxs("section",{"aria-labelledby":"gateway-qr-title","aria-modal":"true",className:"gateway-qr-modal",role:"dialog",children:[x.jsxs("header",{children:[x.jsxs("div",{children:[x.jsx("h2",{id:"gateway-qr-title",children:"Weixin Gateway Login"}),x.jsx("p",{className:"muted",children:"Scan with Weixin, confirm on the phone, then click Confirm."})]}),x.jsx("button",{type:"button",onClick:s,children:"Close"})]}),x.jsxs("div",{className:"gateway-qr-modal-body",children:[x.jsx("div",{className:"gateway-qr-code-frame",children:g?x.jsx("img",{alt:"Weixin Gateway QR login",src:g}):x.jsx("div",{className:"gateway-qr-placeholder",children:l?"QR code could not be rendered.":"Rendering QR code..."})}),x.jsxs("dl",{className:"gateway-qr-meta",children:[x.jsxs("div",{children:[x.jsx("dt",{children:"Status"}),x.jsx("dd",{children:(o==null?void 0:o.status)??d.status})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Expires"}),x.jsx("dd",{children:Sv(d.expiresAt)})]}),o!=null&&o.message?x.jsxs("div",{children:[x.jsx("dt",{children:"Message"}),x.jsx("dd",{children:o.message})]}):null]})]}),x.jsx("footer",{children:x.jsx("button",{type:"button",disabled:n,onClick:r,children:"Confirm"})})]})})}function ok({busy:n,onCheck:r,onClose:s,onManualBind:o,registration:d,registrationCheck:g}){const[f,l]=ne.useState(""),[c,h]=ji(""),[p,u]=ne.useState(""),[b,C]=ne.useState(""),[T,E]=ji("");return ne.useEffect(()=>{let S=!1;h(""),l("");try{const v=Ur(0,"M");v.addData(d.qrUrl),v.make(),S||l(v.createDataURL(8,2))}catch(v){S||h(pt("Render Lark Gateway setup QR code",v))}return()=>{S=!0}},[d.qrUrl]),x.jsx("div",{className:"modal-backdrop",children:x.jsxs("section",{"aria-labelledby":"gateway-lark-registration-title","aria-modal":"true",className:"gateway-qr-modal",role:"dialog",children:[x.jsxs("header",{children:[x.jsxs("div",{children:[x.jsx("h2",{id:"gateway-lark-registration-title",children:"Lark Gateway Setup"}),x.jsx("p",{className:"muted",children:"Scan with Lark, approve bot creation, then click Confirm."})]}),x.jsx("button",{type:"button",onClick:s,children:"Close"})]}),x.jsxs("div",{className:"gateway-qr-modal-body",children:[x.jsx("div",{className:"gateway-qr-code-frame",children:f?x.jsx("img",{alt:"Lark Gateway setup QR code",src:f}):x.jsx("div",{className:"gateway-qr-placeholder",children:c?"QR code could not be rendered.":"Rendering QR code..."})}),x.jsx("div",{className:"gateway-qr-actions",children:x.jsx("button",{type:"button",disabled:n,onClick:r,children:"Confirm"})}),x.jsxs("dl",{className:"gateway-qr-meta",children:[x.jsxs("div",{children:[x.jsx("dt",{children:"Status"}),x.jsx("dd",{children:(g==null?void 0:g.status)??d.status})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Expires"}),x.jsx("dd",{children:Sv(d.expiresAt)})]}),d.userCode?x.jsxs("div",{children:[x.jsx("dt",{children:"User Code"}),x.jsx("dd",{children:d.userCode})]}):null,g!=null&&g.larkBotName?x.jsxs("div",{children:[x.jsx("dt",{children:"Bot"}),x.jsx("dd",{children:g.larkBotName})]}):null,g!=null&&g.message?x.jsxs("div",{children:[x.jsx("dt",{children:"Message"}),x.jsx("dd",{children:g.message})]}):null]}),x.jsxs("form",{className:"gateway-manual-bind",onSubmit:S=>{S.preventDefault();const v=p.trim(),_=b.trim();if(!v||!_){E("Enter both App ID and App Secret.");return}E(""),C(""),o(v,_)},children:[x.jsxs("div",{children:[x.jsx("label",{htmlFor:"gateway-lark-app-id",children:"App ID"}),x.jsx("input",{id:"gateway-lark-app-id",autoComplete:"off",disabled:n,value:p,onChange:S=>u(S.currentTarget.value),placeholder:"cli_xxx"})]}),x.jsxs("div",{children:[x.jsx("label",{htmlFor:"gateway-lark-app-secret",children:"App Secret"}),x.jsx("input",{id:"gateway-lark-app-secret",autoComplete:"off",disabled:n,type:"password",value:b,onChange:S=>C(S.currentTarget.value),placeholder:"Enter App Secret"})]}),T?x.jsx("p",{className:"form-error",children:T}):null,x.jsx("button",{type:"submit",disabled:n,children:"Bind manually"})]})]})]})})}function Sv(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 zr=null;function ck(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 uk(n,r,s){if((r==null?void 0:r.status)==="running")return!0;const o=Date.parse(n.stoppedAt??n.lastTurnEndedAt??"");return!!(s&&Number.isFinite(o)&&o>s)}function hk(n){const r=n.roundId??n.startedAt??n.taskSlug,s=n.stoppedAt??n.lastTurnEndedAt??"stopped";return`${r}:${s}`}function fk(n,r){return`${n}:${r.role}:${r.lastFailureAt}`}function dk(n){const r=gk(n.role),s=bv(n);return n.status==="retrying"?`CC 出错,正在重试 ${r}${s} · 第 ${n.attempt}/${n.maxAttempts} 次`:`CC 出错,重试中 ${r}${s} · 第 ${n.attempt}/${n.maxAttempts} 次 · ${_k(n.nextRetryAt)}`}function pk(n,r){const s=bv(n);return n.retryable===!1?`CC stopped for ${r}: ${mk(n)} cannot be fixed by retrying.`:`CC retry failed after ${n.maxAttempts} attempts for ${r}${s}.`}function bv(n){return!n.error||n.error==="unknown"?"":` · ${n.error}`}function mk(n){return n.error&&n.error!=="unknown"?n.error:"this error"}function gk(n){return n.split("-").filter(Boolean).map(r=>`${r.slice(0,1).toUpperCase()}${r.slice(1)}`).join(" ")}function _k(n){if(!n)return"即将重试";const r=Date.parse(n)-Date.now();return!Number.isFinite(r)||r<=0?"即将重试":`${Math.ceil(r/6e4)} 分钟后`}async function vk(){const n=Cv();return n?wv(n):!1}async function So(){const n=Cv();if(!n||!await wv(n))return!1;try{const s=n.createGain(),o=n.currentTime+.025;return s.gain.setValueAtTime(.85,n.currentTime),s.connect(n.destination),Qg(n,s,{frequency:587.33,startAt:o,duration:.18,peakGain:.045}),Qg(n,s,{frequency:783.99,startAt:o+.11,duration:.28,peakGain:.055}),window.setTimeout(()=>{s.disconnect()},800),!0}catch{return!1}}function Cv(){const n=window.AudioContext??window.webkitAudioContext;if(!n)return null;try{return(!zr||zr.state==="closed")&&(zr=new n),zr}catch{return null}}function Yg(n){zr=null,n&&n.state!=="closed"&&n.close().catch(()=>{})}async function wv(n){if(Xg(n))return!0;try{await n.resume();const r=Xg(n);return!r&&n===zr&&Yg(n),r}catch{return n===zr&&Yg(n),!1}}function Xg(n){return n.state==="running"}function Qg(n,r,s){const o=n.createGain(),d=n.createOscillator(),g=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),g.type="triangle",g.frequency.setValueAtTime(s.frequency*2.01,s.startAt),d.connect(o),g.connect(o),o.connect(r),d.start(s.startAt),g.start(s.startAt),d.stop(f+.02),g.stop(f+.02)}const xv=document.getElementById("root");if(!xv)throw new Error("Missing #root element.");N0.createRoot(xv).render(x.jsx(ne.StrictMode,{children:x.jsx(ak,{})}));
|