vibe-coding-master 0.4.34 → 0.4.36

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,4 +1,4 @@
1
- var k0=Object.defineProperty;var A0=(n,r,s)=>r in n?k0(n,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[r]=s;var Om=(n,r,s)=>A0(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"]'))l(d);new MutationObserver(d=>{for(const _ of d)if(_.type==="childList")for(const f of _.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&l(f)}).observe(document,{childList:!0,subtree:!0});function s(d){const _={};return d.integrity&&(_.integrity=d.integrity),d.referrerPolicy&&(_.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?_.credentials="include":d.crossOrigin==="anonymous"?_.credentials="omit":_.credentials="same-origin",_}function l(d){if(d.ep)return;d.ep=!0;const _=s(d);fetch(d.href,_)}})();function r_(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Fu={exports:{}},Ua={};/**
1
+ var k0=Object.defineProperty;var A0=(n,r,s)=>r in n?k0(n,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[r]=s;var Om=(n,r,s)=>A0(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"]'))l(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"&&l(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 l(d){if(d.ep)return;d.ep=!0;const g=s(d);fetch(d.href,g)}})();function r_(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Pu={exports:{}},Ua={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.js
4
4
  *
@@ -6,7 +6,7 @@ var k0=Object.defineProperty;var A0=(n,r,s)=>r in n?k0(n,r,{enumerable:!0,config
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var Bm;function R0(){if(Bm)return Ua;Bm=1;var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function s(l,d,_){var f=null;if(_!==void 0&&(f=""+_),d.key!==void 0&&(f=""+d.key),"key"in d){_={};for(var o in d)o!=="key"&&(_[o]=d[o])}else _=d;return d=_.ref,{$$typeof:n,type:l,key:f,ref:d!==void 0?d:null,props:_}}return Ua.Fragment=r,Ua.jsx=s,Ua.jsxs=s,Ua}var jm;function T0(){return jm||(jm=1,Fu.exports=R0()),Fu.exports}var x=T0(),qu={exports:{}},ze={};/**
9
+ */var Bm;function R0(){if(Bm)return Ua;Bm=1;var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function s(l,d,g){var f=null;if(g!==void 0&&(f=""+g),d.key!==void 0&&(f=""+d.key),"key"in d){g={};for(var o in d)o!=="key"&&(g[o]=d[o])}else g=d;return d=g.ref,{$$typeof:n,type:l,key:f,ref:d!==void 0?d:null,props:g}}return Ua.Fragment=r,Ua.jsx=s,Ua.jsxs=s,Ua}var jm;function T0(){return jm||(jm=1,Pu.exports=R0()),Pu.exports}var x=T0(),Fu={exports:{}},ze={};/**
10
10
  * @license React
11
11
  * react.production.js
12
12
  *
@@ -14,7 +14,7 @@ var k0=Object.defineProperty;var A0=(n,r,s)=>r in n?k0(n,r,{enumerable:!0,config
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var Nm;function D0(){if(Nm)return ze;Nm=1;var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),f=Symbol.for("react.context"),o=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"),v=Symbol.iterator;function w(N){return N===null||typeof N!="object"?null:(N=v&&N[v]||N["@@iterator"],typeof N=="function"?N:null)}var R={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,y={};function S(N,$,I){this.props=N,this.context=$,this.refs=y,this.updater=I||R}S.prototype.isReactComponent={},S.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")},S.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function g(){}g.prototype=S.prototype;function b(N,$,I){this.props=N,this.context=$,this.refs=y,this.updater=I||R}var A=b.prototype=new g;A.constructor=b,E(A,S.prototype),A.isPureReactComponent=!0;var L=Array.isArray;function D(){}var T={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 Y(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 V(N,$,I,se,ae){var he=typeof N;(he==="undefined"||he==="boolean")&&(N=null);var W=!1;if(N===null)W=!0;else switch(he){case"bigint":case"string":case"number":W=!0;break;case"object":switch(N.$$typeof){case n:case r:W=!0;break;case p:return W=N._init,V(W(N._payload),$,I,se,ae)}}if(W)return ae=ae(N),W=se===""?"."+Y(N,0):se,L(ae)?(I="",W!=null&&(I=W.replace(P,"$&/")+"/"),V(ae,$,I,"",function(ee){return ee})):ae!=null&&(H(ae)&&(ae=B(ae,I+(ae.key==null||N&&N.key===ae.key?"":(""+ae.key).replace(P,"$&/")+"/")+W)),$.push(ae)),1;W=0;var q=se===""?".":se+":";if(L(N))for(var ie=0;ie<N.length;ie++)se=N[ie],he=q+Y(se,ie),W+=V(se,$,I,he,ae);else if(ie=w(N),typeof ie=="function")for(N=ie.call(N),ie=0;!(se=N.next()).done;)se=se.value,he=q+Y(se,ie++),W+=V(se,$,I,he,ae);else if(he==="object"){if(typeof N.then=="function")return V(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 W}function K(N,$,I){if(N==null)return N;var se=[],ae=0;return V(N,se,"","",function(he){return $.call(I,he,ae++)}),se}function ne(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:K,forEach:function(N,$,I){K(N,function(){$.apply(this,arguments)},I)},count:function(N){var $=0;return K(N,function(){$++}),$},toArray:function(N){return K(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 ze.Activity=u,ze.Children=j,ze.Component=S,ze.Fragment=s,ze.Profiler=d,ze.PureComponent=b,ze.StrictMode=l,ze.Suspense=c,ze.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,ze.__COMPILER_RUNTIME={__proto__:null,c:function(N){return T.H.useMemoCache(N)}},ze.cache=function(N){return function(){return N.apply(null,arguments)}},ze.cacheSignal=function(){return null},ze.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(he in $.key!==void 0&&(ae=""+$.key),$)!k.call($,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&$.ref===void 0||(se[he]=$[he]);var he=arguments.length-2;if(he===1)se.children=I;else if(1<he){for(var W=Array(he),q=0;q<he;q++)W[q]=arguments[q+2];se.children=W}return M(N.type,ae,se)},ze.createContext=function(N){return N={$$typeof:f,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:_,_context:N},N},ze.createElement=function(N,$,I){var se,ae={},he=null;if($!=null)for(se in $.key!==void 0&&(he=""+$.key),$)k.call($,se)&&se!=="key"&&se!=="__self"&&se!=="__source"&&(ae[se]=$[se]);var W=arguments.length-2;if(W===1)ae.children=I;else if(1<W){for(var q=Array(W),ie=0;ie<W;ie++)q[ie]=arguments[ie+2];ae.children=q}if(N&&N.defaultProps)for(se in W=N.defaultProps,W)ae[se]===void 0&&(ae[se]=W[se]);return M(N,he,ae)},ze.createRef=function(){return{current:null}},ze.forwardRef=function(N){return{$$typeof:o,render:N}},ze.isValidElement=H,ze.lazy=function(N){return{$$typeof:p,_payload:{_status:-1,_result:N},_init:ne}},ze.memo=function(N,$){return{$$typeof:h,type:N,compare:$===void 0?null:$}},ze.startTransition=function(N){var $=T.T,I={};T.T=I;try{var se=N(),ae=T.S;ae!==null&&ae(I,se),typeof se=="object"&&se!==null&&typeof se.then=="function"&&se.then(D,z)}catch(he){z(he)}finally{$!==null&&I.types!==null&&($.types=I.types),T.T=$}},ze.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},ze.use=function(N){return T.H.use(N)},ze.useActionState=function(N,$,I){return T.H.useActionState(N,$,I)},ze.useCallback=function(N,$){return T.H.useCallback(N,$)},ze.useContext=function(N){return T.H.useContext(N)},ze.useDebugValue=function(){},ze.useDeferredValue=function(N,$){return T.H.useDeferredValue(N,$)},ze.useEffect=function(N,$){return T.H.useEffect(N,$)},ze.useEffectEvent=function(N){return T.H.useEffectEvent(N)},ze.useId=function(){return T.H.useId()},ze.useImperativeHandle=function(N,$,I){return T.H.useImperativeHandle(N,$,I)},ze.useInsertionEffect=function(N,$){return T.H.useInsertionEffect(N,$)},ze.useLayoutEffect=function(N,$){return T.H.useLayoutEffect(N,$)},ze.useMemo=function(N,$){return T.H.useMemo(N,$)},ze.useOptimistic=function(N,$){return T.H.useOptimistic(N,$)},ze.useReducer=function(N,$,I){return T.H.useReducer(N,$,I)},ze.useRef=function(N){return T.H.useRef(N)},ze.useState=function(N){return T.H.useState(N)},ze.useSyncExternalStore=function(N,$,I){return T.H.useSyncExternalStore(N,$,I)},ze.useTransition=function(){return T.H.useTransition()},ze.version="19.2.6",ze}var Hm;function Bh(){return Hm||(Hm=1,qu.exports=D0()),qu.exports}var te=Bh(),$u={exports:{}},Pa={},Gu={exports:{}},Vu={};/**
17
+ */var Nm;function D0(){if(Nm)return ze;Nm=1;var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),g=Symbol.for("react.consumer"),f=Symbol.for("react.context"),o=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 w(N){return N===null||typeof N!="object"?null:(N=b&&N[b]||N["@@iterator"],typeof N=="function"?N:null)}var R={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,v={};function y(N,$,I){this.props=N,this.context=$,this.refs=v,this.updater=I||R}y.prototype.isReactComponent={},y.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")},y.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function _(){}_.prototype=y.prototype;function S(N,$,I){this.props=N,this.context=$,this.refs=v,this.updater=I||R}var A=S.prototype=new _;A.constructor=S,E(A,y.prototype),A.isPureReactComponent=!0;var L=Array.isArray;function D(){}var T={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 Y(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 V(N,$,I,se,ae){var he=typeof N;(he==="undefined"||he==="boolean")&&(N=null);var W=!1;if(N===null)W=!0;else switch(he){case"bigint":case"string":case"number":W=!0;break;case"object":switch(N.$$typeof){case n:case r:W=!0;break;case p:return W=N._init,V(W(N._payload),$,I,se,ae)}}if(W)return ae=ae(N),W=se===""?"."+Y(N,0):se,L(ae)?(I="",W!=null&&(I=W.replace(P,"$&/")+"/"),V(ae,$,I,"",function(ee){return ee})):ae!=null&&(H(ae)&&(ae=B(ae,I+(ae.key==null||N&&N.key===ae.key?"":(""+ae.key).replace(P,"$&/")+"/")+W)),$.push(ae)),1;W=0;var q=se===""?".":se+":";if(L(N))for(var ie=0;ie<N.length;ie++)se=N[ie],he=q+Y(se,ie),W+=V(se,$,I,he,ae);else if(ie=w(N),typeof ie=="function")for(N=ie.call(N),ie=0;!(se=N.next()).done;)se=se.value,he=q+Y(se,ie++),W+=V(se,$,I,he,ae);else if(he==="object"){if(typeof N.then=="function")return V(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 W}function K(N,$,I){if(N==null)return N;var se=[],ae=0;return V(N,se,"","",function(he){return $.call(I,he,ae++)}),se}function ne(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:K,forEach:function(N,$,I){K(N,function(){$.apply(this,arguments)},I)},count:function(N){var $=0;return K(N,function(){$++}),$},toArray:function(N){return K(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 ze.Activity=u,ze.Children=j,ze.Component=y,ze.Fragment=s,ze.Profiler=d,ze.PureComponent=S,ze.StrictMode=l,ze.Suspense=c,ze.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,ze.__COMPILER_RUNTIME={__proto__:null,c:function(N){return T.H.useMemoCache(N)}},ze.cache=function(N){return function(){return N.apply(null,arguments)}},ze.cacheSignal=function(){return null},ze.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(he in $.key!==void 0&&(ae=""+$.key),$)!k.call($,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&$.ref===void 0||(se[he]=$[he]);var he=arguments.length-2;if(he===1)se.children=I;else if(1<he){for(var W=Array(he),q=0;q<he;q++)W[q]=arguments[q+2];se.children=W}return M(N.type,ae,se)},ze.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},ze.createElement=function(N,$,I){var se,ae={},he=null;if($!=null)for(se in $.key!==void 0&&(he=""+$.key),$)k.call($,se)&&se!=="key"&&se!=="__self"&&se!=="__source"&&(ae[se]=$[se]);var W=arguments.length-2;if(W===1)ae.children=I;else if(1<W){for(var q=Array(W),ie=0;ie<W;ie++)q[ie]=arguments[ie+2];ae.children=q}if(N&&N.defaultProps)for(se in W=N.defaultProps,W)ae[se]===void 0&&(ae[se]=W[se]);return M(N,he,ae)},ze.createRef=function(){return{current:null}},ze.forwardRef=function(N){return{$$typeof:o,render:N}},ze.isValidElement=H,ze.lazy=function(N){return{$$typeof:p,_payload:{_status:-1,_result:N},_init:ne}},ze.memo=function(N,$){return{$$typeof:h,type:N,compare:$===void 0?null:$}},ze.startTransition=function(N){var $=T.T,I={};T.T=I;try{var se=N(),ae=T.S;ae!==null&&ae(I,se),typeof se=="object"&&se!==null&&typeof se.then=="function"&&se.then(D,z)}catch(he){z(he)}finally{$!==null&&I.types!==null&&($.types=I.types),T.T=$}},ze.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},ze.use=function(N){return T.H.use(N)},ze.useActionState=function(N,$,I){return T.H.useActionState(N,$,I)},ze.useCallback=function(N,$){return T.H.useCallback(N,$)},ze.useContext=function(N){return T.H.useContext(N)},ze.useDebugValue=function(){},ze.useDeferredValue=function(N,$){return T.H.useDeferredValue(N,$)},ze.useEffect=function(N,$){return T.H.useEffect(N,$)},ze.useEffectEvent=function(N){return T.H.useEffectEvent(N)},ze.useId=function(){return T.H.useId()},ze.useImperativeHandle=function(N,$,I){return T.H.useImperativeHandle(N,$,I)},ze.useInsertionEffect=function(N,$){return T.H.useInsertionEffect(N,$)},ze.useLayoutEffect=function(N,$){return T.H.useLayoutEffect(N,$)},ze.useMemo=function(N,$){return T.H.useMemo(N,$)},ze.useOptimistic=function(N,$){return T.H.useOptimistic(N,$)},ze.useReducer=function(N,$,I){return T.H.useReducer(N,$,I)},ze.useRef=function(N){return T.H.useRef(N)},ze.useState=function(N){return T.H.useState(N)},ze.useSyncExternalStore=function(N,$,I){return T.H.useSyncExternalStore(N,$,I)},ze.useTransition=function(){return T.H.useTransition()},ze.version="19.2.6",ze}var Hm;function Bh(){return Hm||(Hm=1,Fu.exports=D0()),Fu.exports}var te=Bh(),qu={exports:{}},Pa={},$u={exports:{}},Gu={};/**
18
18
  * @license React
19
19
  * scheduler.production.js
20
20
  *
@@ -22,7 +22,7 @@ var k0=Object.defineProperty;var A0=(n,r,s)=>r in n?k0(n,r,{enumerable:!0,config
22
22
  *
23
23
  * This source code is licensed under the MIT license found in the
24
24
  * LICENSE file in the root directory of this source tree.
25
- */var zm;function M0(){return zm||(zm=1,(function(n){function r(V,K){var ne=V.length;V.push(K);e:for(;0<ne;){var z=ne-1>>>1,j=V[z];if(0<d(j,K))V[z]=K,V[ne]=j,ne=z;else break e}}function s(V){return V.length===0?null:V[0]}function l(V){if(V.length===0)return null;var K=V[0],ne=V.pop();if(ne!==K){V[0]=ne;e:for(var z=0,j=V.length,N=j>>>1;z<N;){var $=2*(z+1)-1,I=V[$],se=$+1,ae=V[se];if(0>d(I,ne))se<j&&0>d(ae,I)?(V[z]=ae,V[se]=ne,z=se):(V[z]=I,V[$]=ne,z=$);else if(se<j&&0>d(ae,ne))V[z]=ae,V[se]=ne,z=se;else break e}}return K}function d(V,K){var ne=V.sortIndex-K.sortIndex;return ne!==0?ne:V.id-K.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var _=performance;n.unstable_now=function(){return _.now()}}else{var f=Date,o=f.now();n.unstable_now=function(){return f.now()-o}}var c=[],h=[],p=1,u=null,v=3,w=!1,R=!1,E=!1,y=!1,S=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;function A(V){for(var K=s(h);K!==null;){if(K.callback===null)l(h);else if(K.startTime<=V)l(h),K.sortIndex=K.expirationTime,r(c,K);else break;K=s(h)}}function L(V){if(E=!1,A(V),!R)if(s(c)!==null)R=!0,D||(D=!0,U());else{var K=s(h);K!==null&&X(L,K.startTime-V)}}var D=!1,T=-1,k=5,M=-1;function B(){return y?!0:!(n.unstable_now()-M<k)}function H(){if(y=!1,D){var V=n.unstable_now();M=V;var K=!0;try{e:{R=!1,E&&(E=!1,g(T),T=-1),w=!0;var ne=v;try{t:{for(A(V),u=s(c);u!==null&&!(u.expirationTime>V&&B());){var z=u.callback;if(typeof z=="function"){u.callback=null,v=u.priorityLevel;var j=z(u.expirationTime<=V);if(V=n.unstable_now(),typeof j=="function"){u.callback=j,A(V),K=!0;break t}u===s(c)&&l(c),A(V)}else l(c);u=s(c)}if(u!==null)K=!0;else{var N=s(h);N!==null&&X(L,N.startTime-V),K=!1}}break e}finally{u=null,v=ne,w=!1}K=void 0}}finally{K?U():D=!1}}}var U;if(typeof b=="function")U=function(){b(H)};else if(typeof MessageChannel<"u"){var P=new MessageChannel,Y=P.port2;P.port1.onmessage=H,U=function(){Y.postMessage(null)}}else U=function(){S(H,0)};function X(V,K){T=S(function(){V(n.unstable_now())},K)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(V){V.callback=null},n.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<V?Math.floor(1e3/V):5},n.unstable_getCurrentPriorityLevel=function(){return v},n.unstable_next=function(V){switch(v){case 1:case 2:case 3:var K=3;break;default:K=v}var ne=v;v=K;try{return V()}finally{v=ne}},n.unstable_requestPaint=function(){y=!0},n.unstable_runWithPriority=function(V,K){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var ne=v;v=V;try{return K()}finally{v=ne}},n.unstable_scheduleCallback=function(V,K,ne){var z=n.unstable_now();switch(typeof ne=="object"&&ne!==null?(ne=ne.delay,ne=typeof ne=="number"&&0<ne?z+ne:z):ne=z,V){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=ne+j,V={id:p++,callback:K,priorityLevel:V,startTime:ne,expirationTime:j,sortIndex:-1},ne>z?(V.sortIndex=ne,r(h,V),s(c)===null&&V===s(h)&&(E?(g(T),T=-1):E=!0,X(L,ne-z))):(V.sortIndex=j,r(c,V),R||w||(R=!0,D||(D=!0,U()))),V},n.unstable_shouldYield=B,n.unstable_wrapCallback=function(V){var K=v;return function(){var ne=v;v=K;try{return V.apply(this,arguments)}finally{v=ne}}}})(Vu)),Vu}var Im;function L0(){return Im||(Im=1,Gu.exports=M0()),Gu.exports}var Ku={exports:{}},Zt={};/**
25
+ */var zm;function M0(){return zm||(zm=1,(function(n){function r(V,K){var ne=V.length;V.push(K);e:for(;0<ne;){var z=ne-1>>>1,j=V[z];if(0<d(j,K))V[z]=K,V[ne]=j,ne=z;else break e}}function s(V){return V.length===0?null:V[0]}function l(V){if(V.length===0)return null;var K=V[0],ne=V.pop();if(ne!==K){V[0]=ne;e:for(var z=0,j=V.length,N=j>>>1;z<N;){var $=2*(z+1)-1,I=V[$],se=$+1,ae=V[se];if(0>d(I,ne))se<j&&0>d(ae,I)?(V[z]=ae,V[se]=ne,z=se):(V[z]=I,V[$]=ne,z=$);else if(se<j&&0>d(ae,ne))V[z]=ae,V[se]=ne,z=se;else break e}}return K}function d(V,K){var ne=V.sortIndex-K.sortIndex;return ne!==0?ne:V.id-K.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,o=f.now();n.unstable_now=function(){return f.now()-o}}var c=[],h=[],p=1,u=null,b=3,w=!1,R=!1,E=!1,v=!1,y=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;function A(V){for(var K=s(h);K!==null;){if(K.callback===null)l(h);else if(K.startTime<=V)l(h),K.sortIndex=K.expirationTime,r(c,K);else break;K=s(h)}}function L(V){if(E=!1,A(V),!R)if(s(c)!==null)R=!0,D||(D=!0,U());else{var K=s(h);K!==null&&X(L,K.startTime-V)}}var D=!1,T=-1,k=5,M=-1;function B(){return v?!0:!(n.unstable_now()-M<k)}function H(){if(v=!1,D){var V=n.unstable_now();M=V;var K=!0;try{e:{R=!1,E&&(E=!1,_(T),T=-1),w=!0;var ne=b;try{t:{for(A(V),u=s(c);u!==null&&!(u.expirationTime>V&&B());){var z=u.callback;if(typeof z=="function"){u.callback=null,b=u.priorityLevel;var j=z(u.expirationTime<=V);if(V=n.unstable_now(),typeof j=="function"){u.callback=j,A(V),K=!0;break t}u===s(c)&&l(c),A(V)}else l(c);u=s(c)}if(u!==null)K=!0;else{var N=s(h);N!==null&&X(L,N.startTime-V),K=!1}}break e}finally{u=null,b=ne,w=!1}K=void 0}}finally{K?U():D=!1}}}var U;if(typeof S=="function")U=function(){S(H)};else if(typeof MessageChannel<"u"){var P=new MessageChannel,Y=P.port2;P.port1.onmessage=H,U=function(){Y.postMessage(null)}}else U=function(){y(H,0)};function X(V,K){T=y(function(){V(n.unstable_now())},K)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(V){V.callback=null},n.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<V?Math.floor(1e3/V):5},n.unstable_getCurrentPriorityLevel=function(){return b},n.unstable_next=function(V){switch(b){case 1:case 2:case 3:var K=3;break;default:K=b}var ne=b;b=K;try{return V()}finally{b=ne}},n.unstable_requestPaint=function(){v=!0},n.unstable_runWithPriority=function(V,K){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var ne=b;b=V;try{return K()}finally{b=ne}},n.unstable_scheduleCallback=function(V,K,ne){var z=n.unstable_now();switch(typeof ne=="object"&&ne!==null?(ne=ne.delay,ne=typeof ne=="number"&&0<ne?z+ne:z):ne=z,V){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=ne+j,V={id:p++,callback:K,priorityLevel:V,startTime:ne,expirationTime:j,sortIndex:-1},ne>z?(V.sortIndex=ne,r(h,V),s(c)===null&&V===s(h)&&(E?(_(T),T=-1):E=!0,X(L,ne-z))):(V.sortIndex=j,r(c,V),R||w||(R=!0,D||(D=!0,U()))),V},n.unstable_shouldYield=B,n.unstable_wrapCallback=function(V){var K=b;return function(){var ne=b;b=K;try{return V.apply(this,arguments)}finally{b=ne}}}})(Gu)),Gu}var Im;function L0(){return Im||(Im=1,$u.exports=M0()),$u.exports}var Vu={exports:{}},en={};/**
26
26
  * @license React
27
27
  * react-dom.production.js
28
28
  *
@@ -30,7 +30,7 @@ var k0=Object.defineProperty;var A0=(n,r,s)=>r in n?k0(n,r,{enumerable:!0,config
30
30
  *
31
31
  * This source code is licensed under the MIT license found in the
32
32
  * LICENSE file in the root directory of this source tree.
33
- */var Um;function O0(){if(Um)return Zt;Um=1;var n=Bh();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 l={d:{f:s,r:function(){throw Error(r(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},d=Symbol.for("react.portal");function _(c,h,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 o(c,h){if(c==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Zt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=l,Zt.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 _(c,h,null,p)},Zt.flushSync=function(c){var h=f.T,p=l.p;try{if(f.T=null,l.p=2,c)return c()}finally{f.T=h,l.p=p,l.d.f()}},Zt.preconnect=function(c,h){typeof c=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,l.d.C(c,h))},Zt.prefetchDNS=function(c){typeof c=="string"&&l.d.D(c)},Zt.preinit=function(c,h){if(typeof c=="string"&&h&&typeof h.as=="string"){var p=h.as,u=o(p,h.crossOrigin),v=typeof h.integrity=="string"?h.integrity:void 0,w=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;p==="style"?l.d.S(c,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:u,integrity:v,fetchPriority:w}):p==="script"&&l.d.X(c,{crossOrigin:u,integrity:v,fetchPriority:w,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Zt.preinitModule=function(c,h){if(typeof c=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var p=o(h.as,h.crossOrigin);l.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&&l.d.M(c)},Zt.preload=function(c,h){if(typeof c=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var p=h.as,u=o(p,h.crossOrigin);l.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})}},Zt.preloadModule=function(c,h){if(typeof c=="string")if(h){var p=o(h.as,h.crossOrigin);l.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 l.d.m(c)},Zt.requestFormReset=function(c){l.d.r(c)},Zt.unstable_batchedUpdates=function(c,h){return c(h)},Zt.useFormState=function(c,h,p){return f.H.useFormState(c,h,p)},Zt.useFormStatus=function(){return f.H.useHostTransitionStatus()},Zt.version="19.2.6",Zt}var Pm;function B0(){if(Pm)return Ku.exports;Pm=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),Ku.exports=O0(),Ku.exports}/**
33
+ */var Um;function O0(){if(Um)return en;Um=1;var n=Bh();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 l={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 o(c,h){if(c==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return en.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=l,en.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)},en.flushSync=function(c){var h=f.T,p=l.p;try{if(f.T=null,l.p=2,c)return c()}finally{f.T=h,l.p=p,l.d.f()}},en.preconnect=function(c,h){typeof c=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,l.d.C(c,h))},en.prefetchDNS=function(c){typeof c=="string"&&l.d.D(c)},en.preinit=function(c,h){if(typeof c=="string"&&h&&typeof h.as=="string"){var p=h.as,u=o(p,h.crossOrigin),b=typeof h.integrity=="string"?h.integrity:void 0,w=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;p==="style"?l.d.S(c,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:u,integrity:b,fetchPriority:w}):p==="script"&&l.d.X(c,{crossOrigin:u,integrity:b,fetchPriority:w,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},en.preinitModule=function(c,h){if(typeof c=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var p=o(h.as,h.crossOrigin);l.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&&l.d.M(c)},en.preload=function(c,h){if(typeof c=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var p=h.as,u=o(p,h.crossOrigin);l.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})}},en.preloadModule=function(c,h){if(typeof c=="string")if(h){var p=o(h.as,h.crossOrigin);l.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 l.d.m(c)},en.requestFormReset=function(c){l.d.r(c)},en.unstable_batchedUpdates=function(c,h){return c(h)},en.useFormState=function(c,h,p){return f.H.useFormState(c,h,p)},en.useFormStatus=function(){return f.H.useHostTransitionStatus()},en.version="19.2.6",en}var Pm;function B0(){if(Pm)return Vu.exports;Pm=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),Vu.exports=O0(),Vu.exports}/**
34
34
  * @license React
35
35
  * react-dom-client.production.js
36
36
  *
@@ -38,59 +38,59 @@ var k0=Object.defineProperty;var A0=(n,r,s)=>r in n?k0(n,r,{enumerable:!0,config
38
38
  *
39
39
  * This source code is licensed under the MIT license found in the
40
40
  * LICENSE file in the root directory of this source tree.
41
- */var Fm;function j0(){if(Fm)return Pa;Fm=1;var n=L0(),r=Bh(),s=B0();function l(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function _(e){var t=e,i=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(i=t.return),e=t.return;while(e)}return t.tag===3?i:null}function f(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function o(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(_(e)!==e)throw Error(l(188))}function h(e){var t=e.alternate;if(!t){if(t=_(e),t===null)throw Error(l(188));return t!==e?null:e}for(var i=e,a=t;;){var m=i.return;if(m===null)break;var C=m.alternate;if(C===null){if(a=m.return,a!==null){i=a;continue}break}if(m.child===C.child){for(C=m.child;C;){if(C===i)return c(m),e;if(C===a)return c(m),t;C=C.sibling}throw Error(l(188))}if(i.return!==a.return)i=m,a=C;else{for(var O=!1,F=m.child;F;){if(F===i){O=!0,i=m,a=C;break}if(F===a){O=!0,a=m,i=C;break}F=F.sibling}if(!O){for(F=C.child;F;){if(F===i){O=!0,i=C,a=m;break}if(F===a){O=!0,a=C,i=m;break}F=F.sibling}if(!O)throw Error(l(189))}}if(i.alternate!==a)throw Error(l(190))}if(i.tag!==3)throw Error(l(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,v=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),R=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),g=Symbol.for("react.consumer"),b=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),T=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 Y(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 S:return"Profiler";case y:return"StrictMode";case L:return"Suspense";case D:return"SuspenseList";case M:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case R:return"Portal";case b:return e.displayName||"Context";case g: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 T:return t=e.displayName||null,t!==null?t:Y(e.type)||"Memo";case k:t=e._payload,e=e._init;try{return Y(e(t))}catch{}}return null}var X=Array.isArray,V=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne={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),he=N(null),W=N(null);function q(e,t){switch(I(he,t),I(ae,e),I(se,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?nm(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=nm(t),e=im(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}$(se),I(se,e)}function ie(){$(se),$(ae),$(he)}function ee(e){e.memoizedState!==null&&I(W,e);var t=se.current,i=im(t,e.type);t!==i&&(I(ae,e),I(se,i))}function le(e){ae.current===e&&($(se),$(ae)),W.current===e&&($(W),Na._currentValue=ne)}var ve,De;function Ne(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(`
41
+ */var Fm;function j0(){if(Fm)return Pa;Fm=1;var n=L0(),r=Bh(),s=B0();function l(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 o(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(l(188))}function h(e){var t=e.alternate;if(!t){if(t=g(e),t===null)throw Error(l(188));return t!==e?null:e}for(var i=e,a=t;;){var m=i.return;if(m===null)break;var C=m.alternate;if(C===null){if(a=m.return,a!==null){i=a;continue}break}if(m.child===C.child){for(C=m.child;C;){if(C===i)return c(m),e;if(C===a)return c(m),t;C=C.sibling}throw Error(l(188))}if(i.return!==a.return)i=m,a=C;else{for(var O=!1,F=m.child;F;){if(F===i){O=!0,i=m,a=C;break}if(F===a){O=!0,a=m,i=C;break}F=F.sibling}if(!O){for(F=C.child;F;){if(F===i){O=!0,i=C,a=m;break}if(F===a){O=!0,a=C,i=m;break}F=F.sibling}if(!O)throw Error(l(189))}}if(i.alternate!==a)throw Error(l(190))}if(i.tag!==3)throw Error(l(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"),w=Symbol.for("react.transitional.element"),R=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),S=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),T=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 Y(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 y:return"Profiler";case v:return"StrictMode";case L:return"Suspense";case D:return"SuspenseList";case M:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case R:return"Portal";case S: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 T:return t=e.displayName||null,t!==null?t:Y(e.type)||"Memo";case k:t=e._payload,e=e._init;try{return Y(e(t))}catch{}}return null}var X=Array.isArray,V=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne={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),he=N(null),W=N(null);function q(e,t){switch(I(he,t),I(ae,e),I(se,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?nm(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=nm(t),e=im(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}$(se),I(se,e)}function ie(){$(se),$(ae),$(he)}function ee(e){e.memoizedState!==null&&I(W,e);var t=se.current,i=im(t,e.type);t!==i&&(I(ae,e),I(se,i))}function le(e){ae.current===e&&($(se),$(ae)),W.current===e&&($(W),Na._currentValue=ne)}var ve,De;function Ne(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
42
  at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
43
- `+ve+e+De}var Be=!1;function ct(e,t){if(!e||Be)return"";Be=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var _e=function(){throw Error()};if(Object.defineProperty(_e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(_e,[])}catch(de){var ue=de}Reflect.construct(e,[],_e)}else{try{_e.call()}catch(de){ue=de}e.call(_e.prototype)}}else{try{throw Error()}catch(de){ue=de}(_e=e())&&typeof _e.catch=="function"&&_e.catch(function(){})}}catch(de){if(de&&ue&&typeof de.stack=="string")return[de.stack,ue.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 C=a.DetermineComponentFrameRoot(),O=C[0],F=C[1];if(O&&F){var J=O.split(`
43
+ `+ve+e+De}var je=!1;function ct(e,t){if(!e||je)return"";je=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var _e=function(){throw Error()};if(Object.defineProperty(_e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(_e,[])}catch(de){var ue=de}Reflect.construct(e,[],_e)}else{try{_e.call()}catch(de){ue=de}e.call(_e.prototype)}}else{try{throw Error()}catch(de){ue=de}(_e=e())&&typeof _e.catch=="function"&&_e.catch(function(){})}}catch(de){if(de&&ue&&typeof de.stack=="string")return[de.stack,ue.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 C=a.DetermineComponentFrameRoot(),O=C[0],F=C[1];if(O&&F){var J=O.split(`
44
44
  `),ce=F.split(`
45
45
  `);for(m=a=0;a<J.length&&!J[a].includes("DetermineComponentFrameRoot");)a++;for(;m<ce.length&&!ce[m].includes("DetermineComponentFrameRoot");)m++;if(a===J.length||m===ce.length)for(a=J.length-1,m=ce.length-1;1<=a&&0<=m&&J[a]!==ce[m];)m--;for(;1<=a&&0<=m;a--,m--)if(J[a]!==ce[m]){if(a!==1||m!==1)do if(a--,m--,0>m||J[a]!==ce[m]){var me=`
46
- `+J[a].replace(" at new "," at ");return e.displayName&&me.includes("<anonymous>")&&(me=me.replace("<anonymous>",e.displayName)),me}while(1<=a&&0<=m);break}}}finally{Be=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?Ne(i):""}function ke(e,t){switch(e.tag){case 26:case 27:case 5:return Ne(e.type);case 16:return Ne("Lazy");case 13:return e.child!==t&&t!==null?Ne("Suspense Fallback"):Ne("Suspense");case 19:return Ne("SuspenseList");case 0:case 15:return ct(e.type,!1);case 11:return ct(e.type.render,!1);case 1:return ct(e.type,!0);case 31:return Ne("Activity");default:return""}}function Gt(e){try{var t="",i=null;do t+=ke(e,i),i=e,e=e.return;while(e);return t}catch(a){return`
46
+ `+J[a].replace(" at new "," at ");return e.displayName&&me.includes("<anonymous>")&&(me=me.replace("<anonymous>",e.displayName)),me}while(1<=a&&0<=m);break}}}finally{je=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?Ne(i):""}function Ee(e,t){switch(e.tag){case 26:case 27:case 5:return Ne(e.type);case 16:return Ne("Lazy");case 13:return e.child!==t&&t!==null?Ne("Suspense Fallback"):Ne("Suspense");case 19:return Ne("SuspenseList");case 0:case 15:return ct(e.type,!1);case 11:return ct(e.type.render,!1);case 1:return ct(e.type,!0);case 31:return Ne("Activity");default:return""}}function Yt(e){try{var t="",i=null;do t+=Ee(e,i),i=e,e=e.return;while(e);return t}catch(a){return`
47
47
  Error generating stack: `+a.message+`
48
- `+a.stack}}var rn=Object.prototype.hasOwnProperty,Vt=n.unstable_scheduleCallback,Kt=n.unstable_cancelCallback,xn=n.unstable_shouldYield,xt=n.unstable_requestPaint,it=n.unstable_now,Ot=n.unstable_getCurrentPriorityLevel,pe=n.unstable_ImmediatePriority,Se=n.unstable_UserBlockingPriority,Ae=n.unstable_NormalPriority,je=n.unstable_LowPriority,He=n.unstable_IdlePriority,mt=n.log,qe=n.unstable_setDisableYieldValue,bt=null,yt=null;function Bt(e){if(typeof mt=="function"&&qe(e),yt&&typeof yt.setStrictMode=="function")try{yt.setStrictMode(bt,e)}catch{}}var tt=Math.clz32?Math.clz32:Wt,sn=Math.log,we=Math.LN2;function Wt(e){return e>>>=0,e===0?32:31-(sn(e)/we|0)|0}var Nn=256,ai=262144,Hn=4194304;function jt(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 zn(e,t,i){var a=e.pendingLanes;if(a===0)return 0;var m=0,C=e.suspendedLanes,O=e.pingedLanes;e=e.warmLanes;var F=a&134217727;return F!==0?(a=F&~C,a!==0?m=jt(a):(O&=F,O!==0?m=jt(O):i||(i=F&~e,i!==0&&(m=jt(i))))):(F=a&~C,F!==0?m=jt(F):O!==0?m=jt(O):i||(i=a&~e,i!==0&&(m=jt(i)))),m===0?0:t!==0&&t!==m&&(t&C)===0&&(C=m&-m,i=t&-t,C>=i||C===32&&(i&4194048)!==0)?t:m}function Qn(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ee(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 Yt(){var e=Hn;return Hn<<=1,(Hn&62914560)===0&&(Hn=4194304),e}function In(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function fn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function dn(e,t,i,a,m,C){var O=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var F=e.entanglements,J=e.expirationTimes,ce=e.hiddenUpdates;for(i=O&~i;0<i;){var me=31-tt(i),_e=1<<me;F[me]=0,J[me]=-1;var ue=ce[me];if(ue!==null)for(ce[me]=null,me=0;me<ue.length;me++){var de=ue[me];de!==null&&(de.lane&=-536870913)}i&=~_e}a!==0&&Ui(e,a,0),C!==0&&m===0&&e.tag!==0&&(e.suspendedLanes|=C&~(O&~t))}function Ui(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-tt(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|i&261930}function Ie(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var a=31-tt(i),m=1<<a;m&t|e[a]&t&&(e[a]|=t),i&=~m}}function Pi(e,t){var i=t&-t;return i=(i&42)!==0?1:Fi(i),(i&(e.suspendedLanes|t))!==0?0:i}function Fi(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 Ks(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Jn(){var e=K.p;return e!==0?e:(e=window.event,e===void 0?32:km(e.type))}function al(e,t){var i=K.p;try{return K.p=e,t()}finally{K.p=i}}var li=Math.random().toString(36).slice(2),At="__reactFiber$"+li,It="__reactProps$"+li,_i="__reactContainer$"+li,Ws="__reactEvents$"+li,qo="__reactListeners$"+li,ll="__reactHandles$"+li,ol="__reactResources$"+li,Un="__reactMarker$"+li;function qi(e){delete e[At],delete e[It],delete e[Ws],delete e[qo],delete e[ll]}function St(e){var t=e[At];if(t)return t;for(var i=e.parentNode;i;){if(t=i[_i]||i[At]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=um(e);e!==null;){if(i=e[At])return i;e=um(e)}return t}e=i,i=e.parentNode}return null}function vi(e){if(e=e[At]||e[_i]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function oi(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(l(33))}function yi(e){var t=e[ol];return t||(t=e[ol]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function ut(e){e[Un]=!0}var $i=new Set,Jr={};function En(e,t){Zn(e,t),Zn(e+"Capture",t)}function Zn(e,t){for(Jr[e]=t,e=0;e<t.length;e++)$i.add(t[e])}var Ys=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]*$"),Xs={},Q={};function pn(e){return rn.call(Q,e)?!0:rn.call(Xs,e)?!1:Ys.test(e)?Q[e]=!0:(Xs[e]=!0,!1)}function Gi(e,t,i){if(pn(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 Er(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 Ut(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 Xt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Qs(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function $o(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,C=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return m.call(this)},set:function(O){i=""+O,C.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 Js(e){if(!e._valueTracker){var t=Qs(e)?"checked":"value";e._valueTracker=$o(e,t,""+e[t])}}function an(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),a="";return e&&(a=Qs(e)?e.checked?"true":"false":e.value),e=a,e!==i?(t.setValue(e),!0):!1}function ln(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 cl=/[\n"\\]/g;function on(e){return e.replace(cl,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Zr(e,t,i,a,m,C,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=""+Xt(t)):e.value!==""+Xt(t)&&(e.value=""+Xt(t)):O!=="submit"&&O!=="reset"||e.removeAttribute("value"),t!=null?Zs(e,O,Xt(t)):i!=null?Zs(e,O,Xt(i)):a!=null&&e.removeAttribute("value"),m==null&&C!=null&&(e.defaultChecked=!!C),m!=null&&(e.checked=m&&typeof m!="function"&&typeof m!="symbol"),F!=null&&typeof F!="function"&&typeof F!="symbol"&&typeof F!="boolean"?e.name=""+Xt(F):e.removeAttribute("name")}function ul(e,t,i,a,m,C,O,F){if(C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(e.type=C),t!=null||i!=null){if(!(C!=="submit"&&C!=="reset"||t!=null)){Js(e);return}i=i!=null?""+Xt(i):"",t=t!=null?""+Xt(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),Js(e)}function Zs(e,t,i){t==="number"&&ln(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function Vi(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=""+Xt(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 hl(e,t,i){if(t!=null&&(t=""+Xt(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+Xt(i):""}function ea(e,t,i,a){if(t==null){if(a!=null){if(i!=null)throw Error(l(92));if(X(a)){if(1<a.length)throw Error(l(93));a=a[0]}i=a}i==null&&(i=""),t=i}i=Xt(t),e.defaultValue=i,a=e.textContent,a===i&&a!==""&&a!==null&&(e.value=a),Js(e)}function Ki(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var Go=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 Si(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||Go.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function es(e,t,i){if(t!=null&&typeof t!="object")throw Error(l(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&&Si(e,m,a)}else for(var C in t)t.hasOwnProperty(C)&&Si(e,C,t[C])}function kr(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 Ar=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"]]),Vo=/^[\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 Rr(e){return Vo.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function kn(){}var ts=null;function ns(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Qt=null,bi=null;function ei(e){var t=vi(e);if(t&&(e=t.stateNode)){var i=e[It]||null;e:switch(e=t.stateNode,t.type){case"input":if(Zr(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="'+on(""+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(l(90));Zr(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&&an(a)}break e;case"textarea":hl(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&Vi(e,!!i.multiple,t,!1)}}}var mn=!1;function fl(e,t,i){if(mn)return e(t,i);mn=!0;try{var a=e(t);return a}finally{if(mn=!1,(Qt!==null||bi!==null)&&(Ql(),Qt&&(t=Qt,e=bi,bi=Qt=null,ei(t),e)))for(t=0;t<e.length;t++)ei(e[t])}}function Tr(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(l(231,t,typeof i));return i}var ti=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),cn=!1;if(ti)try{var Ci={};Object.defineProperty(Ci,"passive",{get:function(){cn=!0}}),window.addEventListener("test",Ci,Ci),window.removeEventListener("test",Ci,Ci)}catch{cn=!1}var Pn=null,Dr=null,is=null;function Te(){if(is)return is;var e,t=Dr,i=t.length,a,m="value"in Pn?Pn.value:Pn.textContent,C=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[C-a];a++);return is=m.slice(e,1<a?1-a:void 0)}function rs(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 ss(){return!0}function dl(){return!1}function Jt(e){function t(i,a,m,C,O){this._reactName=i,this._targetInst=m,this.type=a,this.nativeEvent=C,this.target=O,this.currentTarget=null;for(var F in e)e.hasOwnProperty(F)&&(i=e[F],this[F]=i?i(C):C[F]);return this.isDefaultPrevented=(C.defaultPrevented!=null?C.defaultPrevented:C.returnValue===!1)?ss:dl,this.isPropagationStopped=dl,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=ss)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=ss)},persist:function(){},isPersistent:ss}),t}var Ht={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Wi=Jt(Ht),Yi=u({},Ht,{view:0,detail:0}),ta=Jt(Yi),as,G,fe,$e=u({},Yi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ko,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!==fe&&(fe&&e.type==="mousemove"?(as=e.screenX-fe.screenX,G=e.screenY-fe.screenY):G=as=0,fe=e),as)},movementY:function(e){return"movementY"in e?e.movementY:G}}),dt=Jt($e),gn=u({},$e,{dataTransfer:0}),ci=Jt(gn),Xi=u({},Yi,{relatedTarget:0}),na=Jt(Xi),pl=u({},Ht,{animationName:0,elapsedTime:0,pseudoElement:0}),ml=Jt(pl),Dv=u({},Ht,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Mv=Jt(Dv),Lv=u({},Ht,{data:0}),af=Jt(Lv),Ov={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Bv={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"},jv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Nv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=jv[e])?!!t[e]:!1}function Ko(){return Nv}var Hv=u({},Yi,{key:function(e){if(e.key){var t=Ov[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=rs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Bv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ko,charCode:function(e){return e.type==="keypress"?rs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?rs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),zv=Jt(Hv),Iv=u({},$e,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),lf=Jt(Iv),Uv=u({},Yi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ko}),Pv=Jt(Uv),Fv=u({},Ht,{propertyName:0,elapsedTime:0,pseudoElement:0}),qv=Jt(Fv),$v=u({},$e,{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}),Gv=Jt($v),Vv=u({},Ht,{newState:0,oldState:0}),Kv=Jt(Vv),Wv=[9,13,27,32],Wo=ti&&"CompositionEvent"in window,ia=null;ti&&"documentMode"in document&&(ia=document.documentMode);var Yv=ti&&"TextEvent"in window&&!ia,of=ti&&(!Wo||ia&&8<ia&&11>=ia),cf=" ",uf=!1;function hf(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 ff(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ls=!1;function Xv(e,t){switch(e){case"compositionend":return ff(t);case"keypress":return t.which!==32?null:(uf=!0,cf);case"textInput":return e=t.data,e===cf&&uf?null:e;default:return null}}function Qv(e,t){if(ls)return e==="compositionend"||!Wo&&hf(e,t)?(e=Te(),is=Dr=Pn=null,ls=!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 of&&t.locale!=="ko"?null:t.data;default:return null}}var Jv={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 df(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Jv[e.type]:t==="textarea"}function pf(e,t,i,a){Qt?bi?bi.push(a):bi=[a]:Qt=a,t=ro(t,"onChange"),0<t.length&&(i=new Wi("onChange","change",null,i,a),e.push({event:i,listeners:t}))}var ra=null,sa=null;function Zv(e){Xp(e,0)}function gl(e){var t=oi(e);if(an(t))return e}function mf(e,t){if(e==="change")return t}var gf=!1;if(ti){var Yo;if(ti){var Xo="oninput"in document;if(!Xo){var _f=document.createElement("div");_f.setAttribute("oninput","return;"),Xo=typeof _f.oninput=="function"}Yo=Xo}else Yo=!1;gf=Yo&&(!document.documentMode||9<document.documentMode)}function vf(){ra&&(ra.detachEvent("onpropertychange",yf),sa=ra=null)}function yf(e){if(e.propertyName==="value"&&gl(sa)){var t=[];pf(t,sa,e,ns(e)),fl(Zv,t)}}function ey(e,t,i){e==="focusin"?(vf(),ra=t,sa=i,ra.attachEvent("onpropertychange",yf)):e==="focusout"&&vf()}function ty(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return gl(sa)}function ny(e,t){if(e==="click")return gl(t)}function iy(e,t){if(e==="input"||e==="change")return gl(t)}function ry(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var An=typeof Object.is=="function"?Object.is:ry;function aa(e,t){if(An(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(!rn.call(t,m)||!An(e[m],t[m]))return!1}return!0}function Sf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function bf(e,t){var i=Sf(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=Sf(i)}}function Cf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Cf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function wf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ln(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=ln(e.document)}return t}function Qo(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 sy=ti&&"documentMode"in document&&11>=document.documentMode,os=null,Jo=null,la=null,Zo=!1;function xf(e,t,i){var a=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Zo||os==null||os!==ln(a)||(a=os,"selectionStart"in a&&Qo(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}),la&&aa(la,a)||(la=a,a=ro(Jo,"onSelect"),0<a.length&&(t=new Wi("onSelect","select",null,t,i),e.push({event:t,listeners:a}),t.target=os)))}function Mr(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var cs={animationend:Mr("Animation","AnimationEnd"),animationiteration:Mr("Animation","AnimationIteration"),animationstart:Mr("Animation","AnimationStart"),transitionrun:Mr("Transition","TransitionRun"),transitionstart:Mr("Transition","TransitionStart"),transitioncancel:Mr("Transition","TransitionCancel"),transitionend:Mr("Transition","TransitionEnd")},ec={},Ef={};ti&&(Ef=document.createElement("div").style,"AnimationEvent"in window||(delete cs.animationend.animation,delete cs.animationiteration.animation,delete cs.animationstart.animation),"TransitionEvent"in window||delete cs.transitionend.transition);function Lr(e){if(ec[e])return ec[e];if(!cs[e])return e;var t=cs[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in Ef)return ec[e]=t[i];return e}var kf=Lr("animationend"),Af=Lr("animationiteration"),Rf=Lr("animationstart"),ay=Lr("transitionrun"),ly=Lr("transitionstart"),oy=Lr("transitioncancel"),Tf=Lr("transitionend"),Df=new Map,tc="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(" ");tc.push("scrollEnd");function ni(e,t){Df.set(e,t),En(t,[e])}var _l=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)},Fn=[],us=0,nc=0;function vl(){for(var e=us,t=nc=us=0;t<e;){var i=Fn[t];Fn[t++]=null;var a=Fn[t];Fn[t++]=null;var m=Fn[t];Fn[t++]=null;var C=Fn[t];if(Fn[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}C!==0&&Mf(i,m,C)}}function yl(e,t,i,a){Fn[us++]=e,Fn[us++]=t,Fn[us++]=i,Fn[us++]=a,nc|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function ic(e,t,i,a){return yl(e,t,i,a),Sl(e)}function Or(e,t){return yl(e,null,null,t),Sl(e)}function Mf(e,t,i){e.lanes|=i;var a=e.alternate;a!==null&&(a.lanes|=i);for(var m=!1,C=e.return;C!==null;)C.childLanes|=i,a=C.alternate,a!==null&&(a.childLanes|=i),C.tag===22&&(e=C.stateNode,e===null||e._visibility&1||(m=!0)),e=C,C=C.return;return e.tag===3?(C=e.stateNode,m&&t!==null&&(m=31-tt(i),e=C.hiddenUpdates,a=e[m],a===null?e[m]=[t]:a.push(t),t.lane=i|536870912),C):null}function Sl(e){if(50<Ta)throw Ta=0,fu=null,Error(l(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var hs={};function cy(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 Rn(e,t,i,a){return new cy(e,t,i,a)}function rc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function wi(e,t){var i=e.alternate;return i===null?(i=Rn(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 Lf(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 bl(e,t,i,a,m,C){var O=0;if(a=e,typeof e=="function")rc(e)&&(O=1);else if(typeof e=="string")O=p0(e,i,se.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case M:return e=Rn(31,i,t,m),e.elementType=M,e.lanes=C,e;case E:return Br(i.children,m,C,t);case y:O=8,m|=24;break;case S:return e=Rn(12,i,t,m|2),e.elementType=S,e.lanes=C,e;case L:return e=Rn(13,i,t,m),e.elementType=L,e.lanes=C,e;case D:return e=Rn(19,i,t,m),e.elementType=D,e.lanes=C,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case b:O=10;break e;case g:O=9;break e;case A:O=11;break e;case T:O=14;break e;case k:O=16,a=null;break e}O=29,i=Error(l(130,e===null?"null":typeof e,"")),a=null}return t=Rn(O,i,t,m),t.elementType=e,t.type=a,t.lanes=C,t}function Br(e,t,i,a){return e=Rn(7,e,a,t),e.lanes=i,e}function sc(e,t,i){return e=Rn(6,e,null,t),e.lanes=i,e}function Of(e){var t=Rn(18,null,null,0);return t.stateNode=e,t}function ac(e,t,i){return t=Rn(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Bf=new WeakMap;function qn(e,t){if(typeof e=="object"&&e!==null){var i=Bf.get(e);return i!==void 0?i:(t={value:e,source:t,stack:Gt(t)},Bf.set(e,t),t)}return{value:e,source:t,stack:Gt(t)}}var fs=[],ds=0,Cl=null,oa=0,$n=[],Gn=0,Qi=null,ui=1,hi="";function xi(e,t){fs[ds++]=oa,fs[ds++]=Cl,Cl=e,oa=t}function jf(e,t,i){$n[Gn++]=ui,$n[Gn++]=hi,$n[Gn++]=Qi,Qi=e;var a=ui;e=hi;var m=32-tt(a)-1;a&=~(1<<m),i+=1;var C=32-tt(t)+m;if(30<C){var O=m-m%5;C=(a&(1<<O)-1).toString(32),a>>=O,m-=O,ui=1<<32-tt(t)+m|i<<m|a,hi=C+e}else ui=1<<C|i<<m|a,hi=e}function lc(e){e.return!==null&&(xi(e,1),jf(e,1,0))}function oc(e){for(;e===Cl;)Cl=fs[--ds],fs[ds]=null,oa=fs[--ds],fs[ds]=null;for(;e===Qi;)Qi=$n[--Gn],$n[Gn]=null,hi=$n[--Gn],$n[Gn]=null,ui=$n[--Gn],$n[Gn]=null}function Nf(e,t){$n[Gn++]=ui,$n[Gn++]=hi,$n[Gn++]=Qi,ui=t.id,hi=t.overflow,Qi=e}var Pt=null,gt=null,Xe=!1,Ji=null,Vn=!1,cc=Error(l(519));function Zi(e){var t=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ca(qn(t,e)),cc}function Hf(e){var t=e.stateNode,i=e.type,a=e.memoizedProps;switch(t[At]=e,t[It]=a,i){case"dialog":Ve("cancel",t),Ve("close",t);break;case"iframe":case"object":case"embed":Ve("load",t);break;case"video":case"audio":for(i=0;i<Ma.length;i++)Ve(Ma[i],t);break;case"source":Ve("error",t);break;case"img":case"image":case"link":Ve("error",t),Ve("load",t);break;case"details":Ve("toggle",t);break;case"input":Ve("invalid",t),ul(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":Ve("invalid",t);break;case"textarea":Ve("invalid",t),ea(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||em(t.textContent,i)?(a.popover!=null&&(Ve("beforetoggle",t),Ve("toggle",t)),a.onScroll!=null&&Ve("scroll",t),a.onScrollEnd!=null&&Ve("scrollend",t),a.onClick!=null&&(t.onclick=kn),t=!0):t=!1,t||Zi(e,!0)}function zf(e){for(Pt=e.return;Pt;)switch(Pt.tag){case 5:case 31:case 13:Vn=!1;return;case 27:case 3:Vn=!0;return;default:Pt=Pt.return}}function ps(e){if(e!==Pt)return!1;if(!Xe)return zf(e),Xe=!0,!1;var t=e.tag,i;if((i=t!==3&&t!==27)&&((i=t===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||Au(e.type,e.memoizedProps)),i=!i),i&&gt&&Zi(e),zf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));gt=cm(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));gt=cm(e)}else t===27?(t=gt,dr(e.type)?(e=Lu,Lu=null,gt=e):gt=t):gt=Pt?Wn(e.stateNode.nextSibling):null;return!0}function jr(){gt=Pt=null,Xe=!1}function uc(){var e=Ji;return e!==null&&(Sn===null?Sn=e:Sn.push.apply(Sn,e),Ji=null),e}function ca(e){Ji===null?Ji=[e]:Ji.push(e)}var hc=N(null),Nr=null,Ei=null;function er(e,t,i){I(hc,t._currentValue),t._currentValue=i}function ki(e){e._currentValue=hc.current,$(hc)}function fc(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 dc(e,t,i,a){var m=e.child;for(m!==null&&(m.return=e);m!==null;){var C=m.dependencies;if(C!==null){var O=m.child;C=C.firstContext;e:for(;C!==null;){var F=C;C=m;for(var J=0;J<t.length;J++)if(F.context===t[J]){C.lanes|=i,F=C.alternate,F!==null&&(F.lanes|=i),fc(C.return,i,e),a||(O=null);break e}C=F.next}}else if(m.tag===18){if(O=m.return,O===null)throw Error(l(341));O.lanes|=i,C=O.alternate,C!==null&&(C.lanes|=i),fc(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 ms(e,t,i,a){e=null;for(var m=t,C=!1;m!==null;){if(!C){if((m.flags&524288)!==0)C=!0;else if((m.flags&262144)!==0)break}if(m.tag===10){var O=m.alternate;if(O===null)throw Error(l(387));if(O=O.memoizedProps,O!==null){var F=m.type;An(m.pendingProps.value,O.value)||(e!==null?e.push(F):e=[F])}}else if(m===W.current){if(O=m.alternate,O===null)throw Error(l(387));O.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(e!==null?e.push(Na):e=[Na])}m=m.return}e!==null&&dc(t,e,i,a),t.flags|=262144}function wl(e){for(e=e.firstContext;e!==null;){if(!An(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Hr(e){Nr=e,Ei=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ft(e){return If(Nr,e)}function xl(e,t){return Nr===null&&Hr(e),If(e,t)}function If(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},Ei===null){if(e===null)throw Error(l(308));Ei=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ei=Ei.next=t;return i}var uy=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()})}},hy=n.unstable_scheduleCallback,fy=n.unstable_NormalPriority,Rt={$$typeof:b,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function pc(){return{controller:new uy,data:new Map,refCount:0}}function ua(e){e.refCount--,e.refCount===0&&hy(fy,function(){e.controller.abort()})}var ha=null,mc=0,gs=0,_s=null;function dy(e,t){if(ha===null){var i=ha=[];mc=0,gs=vu(),_s={status:"pending",value:void 0,then:function(a){i.push(a)}}}return mc++,t.then(Uf,Uf),t}function Uf(){if(--mc===0&&ha!==null){_s!==null&&(_s.status="fulfilled");var e=ha;ha=null,gs=0,_s=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function py(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 Pf=V.S;V.S=function(e,t){xp=it(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&dy(e,t),Pf!==null&&Pf(e,t)};var zr=N(null);function gc(){var e=zr.current;return e!==null?e:ht.pooledCache}function El(e,t){t===null?I(zr,zr.current):I(zr,t.pool)}function Ff(){var e=gc();return e===null?null:{parent:Rt._currentValue,pool:e}}var vs=Error(l(460)),_c=Error(l(474)),kl=Error(l(542)),Al={then:function(){}};function qf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function $f(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(kn,kn),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Vf(e),e;default:if(typeof t.status=="string")t.then(kn,kn);else{if(e=ht,e!==null&&100<e.shellSuspendCounter)throw Error(l(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,Vf(e),e}throw Ur=t,vs}}function Ir(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(Ur=i,vs):i}}var Ur=null;function Gf(){if(Ur===null)throw Error(l(459));var e=Ur;return Ur=null,e}function Vf(e){if(e===vs||e===kl)throw Error(l(483))}var ys=null,fa=0;function Rl(e){var t=fa;return fa+=1,ys===null&&(ys=[]),$f(ys,e,t)}function da(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Tl(e,t){throw t.$$typeof===v?Error(l(525)):(e=Object.prototype.toString.call(t),Error(l(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Kf(e){function t(re,Z){if(e){var oe=re.deletions;oe===null?(re.deletions=[Z],re.flags|=16):oe.push(Z)}}function i(re,Z){if(!e)return null;for(;Z!==null;)t(re,Z),Z=Z.sibling;return null}function a(re){for(var Z=new Map;re!==null;)re.key!==null?Z.set(re.key,re):Z.set(re.index,re),re=re.sibling;return Z}function m(re,Z){return re=wi(re,Z),re.index=0,re.sibling=null,re}function C(re,Z,oe){return re.index=oe,e?(oe=re.alternate,oe!==null?(oe=oe.index,oe<Z?(re.flags|=67108866,Z):oe):(re.flags|=67108866,Z)):(re.flags|=1048576,Z)}function O(re){return e&&re.alternate===null&&(re.flags|=67108866),re}function F(re,Z,oe,ge){return Z===null||Z.tag!==6?(Z=sc(oe,re.mode,ge),Z.return=re,Z):(Z=m(Z,oe),Z.return=re,Z)}function J(re,Z,oe,ge){var Me=oe.type;return Me===E?me(re,Z,oe.props.children,ge,oe.key):Z!==null&&(Z.elementType===Me||typeof Me=="object"&&Me!==null&&Me.$$typeof===k&&Ir(Me)===Z.type)?(Z=m(Z,oe.props),da(Z,oe),Z.return=re,Z):(Z=bl(oe.type,oe.key,oe.props,null,re.mode,ge),da(Z,oe),Z.return=re,Z)}function ce(re,Z,oe,ge){return Z===null||Z.tag!==4||Z.stateNode.containerInfo!==oe.containerInfo||Z.stateNode.implementation!==oe.implementation?(Z=ac(oe,re.mode,ge),Z.return=re,Z):(Z=m(Z,oe.children||[]),Z.return=re,Z)}function me(re,Z,oe,ge,Me){return Z===null||Z.tag!==7?(Z=Br(oe,re.mode,ge,Me),Z.return=re,Z):(Z=m(Z,oe),Z.return=re,Z)}function _e(re,Z,oe){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return Z=sc(""+Z,re.mode,oe),Z.return=re,Z;if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case w:return oe=bl(Z.type,Z.key,Z.props,null,re.mode,oe),da(oe,Z),oe.return=re,oe;case R:return Z=ac(Z,re.mode,oe),Z.return=re,Z;case k:return Z=Ir(Z),_e(re,Z,oe)}if(X(Z)||U(Z))return Z=Br(Z,re.mode,oe,null),Z.return=re,Z;if(typeof Z.then=="function")return _e(re,Rl(Z),oe);if(Z.$$typeof===b)return _e(re,xl(re,Z),oe);Tl(re,Z)}return null}function ue(re,Z,oe,ge){var Me=Z!==null?Z.key:null;if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return Me!==null?null:F(re,Z,""+oe,ge);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case w:return oe.key===Me?J(re,Z,oe,ge):null;case R:return oe.key===Me?ce(re,Z,oe,ge):null;case k:return oe=Ir(oe),ue(re,Z,oe,ge)}if(X(oe)||U(oe))return Me!==null?null:me(re,Z,oe,ge,null);if(typeof oe.then=="function")return ue(re,Z,Rl(oe),ge);if(oe.$$typeof===b)return ue(re,Z,xl(re,oe),ge);Tl(re,oe)}return null}function de(re,Z,oe,ge,Me){if(typeof ge=="string"&&ge!==""||typeof ge=="number"||typeof ge=="bigint")return re=re.get(oe)||null,F(Z,re,""+ge,Me);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case w:return re=re.get(ge.key===null?oe:ge.key)||null,J(Z,re,ge,Me);case R:return re=re.get(ge.key===null?oe:ge.key)||null,ce(Z,re,ge,Me);case k:return ge=Ir(ge),de(re,Z,oe,ge,Me)}if(X(ge)||U(ge))return re=re.get(oe)||null,me(Z,re,ge,Me,null);if(typeof ge.then=="function")return de(re,Z,oe,Rl(ge),Me);if(ge.$$typeof===b)return de(re,Z,oe,xl(Z,ge),Me);Tl(Z,ge)}return null}function xe(re,Z,oe,ge){for(var Me=null,Ze=null,Re=Z,Pe=Z=0,Ye=null;Re!==null&&Pe<oe.length;Pe++){Re.index>Pe?(Ye=Re,Re=null):Ye=Re.sibling;var et=ue(re,Re,oe[Pe],ge);if(et===null){Re===null&&(Re=Ye);break}e&&Re&&et.alternate===null&&t(re,Re),Z=C(et,Z,Pe),Ze===null?Me=et:Ze.sibling=et,Ze=et,Re=Ye}if(Pe===oe.length)return i(re,Re),Xe&&xi(re,Pe),Me;if(Re===null){for(;Pe<oe.length;Pe++)Re=_e(re,oe[Pe],ge),Re!==null&&(Z=C(Re,Z,Pe),Ze===null?Me=Re:Ze.sibling=Re,Ze=Re);return Xe&&xi(re,Pe),Me}for(Re=a(Re);Pe<oe.length;Pe++)Ye=de(Re,re,Pe,oe[Pe],ge),Ye!==null&&(e&&Ye.alternate!==null&&Re.delete(Ye.key===null?Pe:Ye.key),Z=C(Ye,Z,Pe),Ze===null?Me=Ye:Ze.sibling=Ye,Ze=Ye);return e&&Re.forEach(function(vr){return t(re,vr)}),Xe&&xi(re,Pe),Me}function Oe(re,Z,oe,ge){if(oe==null)throw Error(l(151));for(var Me=null,Ze=null,Re=Z,Pe=Z=0,Ye=null,et=oe.next();Re!==null&&!et.done;Pe++,et=oe.next()){Re.index>Pe?(Ye=Re,Re=null):Ye=Re.sibling;var vr=ue(re,Re,et.value,ge);if(vr===null){Re===null&&(Re=Ye);break}e&&Re&&vr.alternate===null&&t(re,Re),Z=C(vr,Z,Pe),Ze===null?Me=vr:Ze.sibling=vr,Ze=vr,Re=Ye}if(et.done)return i(re,Re),Xe&&xi(re,Pe),Me;if(Re===null){for(;!et.done;Pe++,et=oe.next())et=_e(re,et.value,ge),et!==null&&(Z=C(et,Z,Pe),Ze===null?Me=et:Ze.sibling=et,Ze=et);return Xe&&xi(re,Pe),Me}for(Re=a(Re);!et.done;Pe++,et=oe.next())et=de(Re,re,Pe,et.value,ge),et!==null&&(e&&et.alternate!==null&&Re.delete(et.key===null?Pe:et.key),Z=C(et,Z,Pe),Ze===null?Me=et:Ze.sibling=et,Ze=et);return e&&Re.forEach(function(E0){return t(re,E0)}),Xe&&xi(re,Pe),Me}function ot(re,Z,oe,ge){if(typeof oe=="object"&&oe!==null&&oe.type===E&&oe.key===null&&(oe=oe.props.children),typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case w:e:{for(var Me=oe.key;Z!==null;){if(Z.key===Me){if(Me=oe.type,Me===E){if(Z.tag===7){i(re,Z.sibling),ge=m(Z,oe.props.children),ge.return=re,re=ge;break e}}else if(Z.elementType===Me||typeof Me=="object"&&Me!==null&&Me.$$typeof===k&&Ir(Me)===Z.type){i(re,Z.sibling),ge=m(Z,oe.props),da(ge,oe),ge.return=re,re=ge;break e}i(re,Z);break}else t(re,Z);Z=Z.sibling}oe.type===E?(ge=Br(oe.props.children,re.mode,ge,oe.key),ge.return=re,re=ge):(ge=bl(oe.type,oe.key,oe.props,null,re.mode,ge),da(ge,oe),ge.return=re,re=ge)}return O(re);case R:e:{for(Me=oe.key;Z!==null;){if(Z.key===Me)if(Z.tag===4&&Z.stateNode.containerInfo===oe.containerInfo&&Z.stateNode.implementation===oe.implementation){i(re,Z.sibling),ge=m(Z,oe.children||[]),ge.return=re,re=ge;break e}else{i(re,Z);break}else t(re,Z);Z=Z.sibling}ge=ac(oe,re.mode,ge),ge.return=re,re=ge}return O(re);case k:return oe=Ir(oe),ot(re,Z,oe,ge)}if(X(oe))return xe(re,Z,oe,ge);if(U(oe)){if(Me=U(oe),typeof Me!="function")throw Error(l(150));return oe=Me.call(oe),Oe(re,Z,oe,ge)}if(typeof oe.then=="function")return ot(re,Z,Rl(oe),ge);if(oe.$$typeof===b)return ot(re,Z,xl(re,oe),ge);Tl(re,oe)}return typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint"?(oe=""+oe,Z!==null&&Z.tag===6?(i(re,Z.sibling),ge=m(Z,oe),ge.return=re,re=ge):(i(re,Z),ge=sc(oe,re.mode,ge),ge.return=re,re=ge),O(re)):i(re,Z)}return function(re,Z,oe,ge){try{fa=0;var Me=ot(re,Z,oe,ge);return ys=null,Me}catch(Re){if(Re===vs||Re===kl)throw Re;var Ze=Rn(29,Re,null,re.mode);return Ze.lanes=ge,Ze.return=re,Ze}finally{}}}var Pr=Kf(!0),Wf=Kf(!1),tr=!1;function vc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function yc(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 nr(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ir(e,t,i){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(nt&2)!==0){var m=a.pending;return m===null?t.next=t:(t.next=m.next,m.next=t),a.pending=t,t=Sl(e),Mf(e,null,i),t}return yl(e,a,t,i),Sl(e)}function pa(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,Ie(e,i)}}function Sc(e,t){var i=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,i===a)){var m=null,C=null;if(i=i.firstBaseUpdate,i!==null){do{var O={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};C===null?m=C=O:C=C.next=O,i=i.next}while(i!==null);C===null?m=C=t:C=C.next=t}else m=C=t;i={baseState:a.baseState,firstBaseUpdate:m,lastBaseUpdate:C,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 bc=!1;function ma(){if(bc){var e=_s;if(e!==null)throw e}}function ga(e,t,i,a){bc=!1;var m=e.updateQueue;tr=!1;var C=m.firstBaseUpdate,O=m.lastBaseUpdate,F=m.shared.pending;if(F!==null){m.shared.pending=null;var J=F,ce=J.next;J.next=null,O===null?C=ce:O.next=ce,O=J;var me=e.alternate;me!==null&&(me=me.updateQueue,F=me.lastBaseUpdate,F!==O&&(F===null?me.firstBaseUpdate=ce:F.next=ce,me.lastBaseUpdate=J))}if(C!==null){var _e=m.baseState;O=0,me=ce=J=null,F=C;do{var ue=F.lane&-536870913,de=ue!==F.lane;if(de?(We&ue)===ue:(a&ue)===ue){ue!==0&&ue===gs&&(bc=!0),me!==null&&(me=me.next={lane:0,tag:F.tag,payload:F.payload,callback:null,next:null});e:{var xe=e,Oe=F;ue=t;var ot=i;switch(Oe.tag){case 1:if(xe=Oe.payload,typeof xe=="function"){_e=xe.call(ot,_e,ue);break e}_e=xe;break e;case 3:xe.flags=xe.flags&-65537|128;case 0:if(xe=Oe.payload,ue=typeof xe=="function"?xe.call(ot,_e,ue):xe,ue==null)break e;_e=u({},_e,ue);break e;case 2:tr=!0}}ue=F.callback,ue!==null&&(e.flags|=64,de&&(e.flags|=8192),de=m.callbacks,de===null?m.callbacks=[ue]:de.push(ue))}else de={lane:ue,tag:F.tag,payload:F.payload,callback:F.callback,next:null},me===null?(ce=me=de,J=_e):me=me.next=de,O|=ue;if(F=F.next,F===null){if(F=m.shared.pending,F===null)break;de=F,F=de.next,de.next=null,m.lastBaseUpdate=de,m.shared.pending=null}}while(!0);me===null&&(J=_e),m.baseState=J,m.firstBaseUpdate=ce,m.lastBaseUpdate=me,C===null&&(m.shared.lanes=0),or|=O,e.lanes=O,e.memoizedState=_e}}function Yf(e,t){if(typeof e!="function")throw Error(l(191,e));e.call(t)}function Xf(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)Yf(i[e],t)}var Ss=N(null),Dl=N(0);function Qf(e,t){e=ji,I(Dl,e),I(Ss,t),ji=e|t.baseLanes}function Cc(){I(Dl,ji),I(Ss,Ss.current)}function wc(){ji=Dl.current,$(Ss),$(Dl)}var Tn=N(null),Kn=null;function rr(e){var t=e.alternate;I(Et,Et.current&1),I(Tn,e),Kn===null&&(t===null||Ss.current!==null||t.memoizedState!==null)&&(Kn=e)}function xc(e){I(Et,Et.current),I(Tn,e),Kn===null&&(Kn=e)}function Jf(e){e.tag===22?(I(Et,Et.current),I(Tn,e),Kn===null&&(Kn=e)):sr()}function sr(){I(Et,Et.current),I(Tn,Tn.current)}function Dn(e){$(Tn),Kn===e&&(Kn=null),$(Et)}var Et=N(0);function Ml(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||Du(i)||Mu(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 Ai=0,Ue=null,at=null,Tt=null,Ll=!1,bs=!1,Fr=!1,Ol=0,_a=0,Cs=null,my=0;function Ct(){throw Error(l(321))}function Ec(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!An(e[i],t[i]))return!1;return!0}function kc(e,t,i,a,m,C){return Ai=C,Ue=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,V.H=e===null||e.memoizedState===null?jd:Pc,Fr=!1,C=i(a,m),Fr=!1,bs&&(C=ed(t,i,a,m)),Zf(e),C}function Zf(e){V.H=Sa;var t=at!==null&&at.next!==null;if(Ai=0,Tt=at=Ue=null,Ll=!1,_a=0,Cs=null,t)throw Error(l(300));e===null||Dt||(e=e.dependencies,e!==null&&wl(e)&&(Dt=!0))}function ed(e,t,i,a){Ue=e;var m=0;do{if(bs&&(Cs=null),_a=0,bs=!1,25<=m)throw Error(l(301));if(m+=1,Tt=at=null,e.updateQueue!=null){var C=e.updateQueue;C.lastEffect=null,C.events=null,C.stores=null,C.memoCache!=null&&(C.memoCache.index=0)}V.H=Nd,C=t(i,a)}while(bs);return C}function gy(){var e=V.H,t=e.useState()[0];return t=typeof t.then=="function"?va(t):t,e=e.useState()[0],(at!==null?at.memoizedState:null)!==e&&(Ue.flags|=1024),t}function Ac(){var e=Ol!==0;return Ol=0,e}function Rc(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function Tc(e){if(Ll){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ll=!1}Ai=0,Tt=at=Ue=null,bs=!1,_a=Ol=0,Cs=null}function un(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Tt===null?Ue.memoizedState=Tt=e:Tt=Tt.next=e,Tt}function kt(){if(at===null){var e=Ue.alternate;e=e!==null?e.memoizedState:null}else e=at.next;var t=Tt===null?Ue.memoizedState:Tt.next;if(t!==null)Tt=t,at=e;else{if(e===null)throw Ue.alternate===null?Error(l(467)):Error(l(310));at=e,e={memoizedState:at.memoizedState,baseState:at.baseState,baseQueue:at.baseQueue,queue:at.queue,next:null},Tt===null?Ue.memoizedState=Tt=e:Tt=Tt.next=e}return Tt}function Bl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function va(e){var t=_a;return _a+=1,Cs===null&&(Cs=[]),e=$f(Cs,e,t),t=Ue,(Tt===null?t.memoizedState:Tt.next)===null&&(t=t.alternate,V.H=t===null||t.memoizedState===null?jd:Pc),e}function jl(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return va(e);if(e.$$typeof===b)return Ft(e)}throw Error(l(438,String(e)))}function Dc(e){var t=null,i=Ue.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var a=Ue.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=Bl(),Ue.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 Ri(e,t){return typeof t=="function"?t(e):t}function Nl(e){var t=kt();return Mc(t,at,e)}function Mc(e,t,i){var a=e.queue;if(a===null)throw Error(l(311));a.lastRenderedReducer=i;var m=e.baseQueue,C=a.pending;if(C!==null){if(m!==null){var O=m.next;m.next=C.next,C.next=O}t.baseQueue=m=C,a.pending=null}if(C=e.baseState,m===null)e.memoizedState=C;else{t=m.next;var F=O=null,J=null,ce=t,me=!1;do{var _e=ce.lane&-536870913;if(_e!==ce.lane?(We&_e)===_e:(Ai&_e)===_e){var ue=ce.revertLane;if(ue===0)J!==null&&(J=J.next={lane:0,revertLane:0,gesture:null,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null}),_e===gs&&(me=!0);else if((Ai&ue)===ue){ce=ce.next,ue===gs&&(me=!0);continue}else _e={lane:0,revertLane:ce.revertLane,gesture:null,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null},J===null?(F=J=_e,O=C):J=J.next=_e,Ue.lanes|=ue,or|=ue;_e=ce.action,Fr&&i(C,_e),C=ce.hasEagerState?ce.eagerState:i(C,_e)}else ue={lane:_e,revertLane:ce.revertLane,gesture:ce.gesture,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null},J===null?(F=J=ue,O=C):J=J.next=ue,Ue.lanes|=_e,or|=_e;ce=ce.next}while(ce!==null&&ce!==t);if(J===null?O=C:J.next=F,!An(C,e.memoizedState)&&(Dt=!0,me&&(i=_s,i!==null)))throw i;e.memoizedState=C,e.baseState=O,e.baseQueue=J,a.lastRenderedState=C}return m===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function Lc(e){var t=kt(),i=t.queue;if(i===null)throw Error(l(311));i.lastRenderedReducer=e;var a=i.dispatch,m=i.pending,C=t.memoizedState;if(m!==null){i.pending=null;var O=m=m.next;do C=e(C,O.action),O=O.next;while(O!==m);An(C,t.memoizedState)||(Dt=!0),t.memoizedState=C,t.baseQueue===null&&(t.baseState=C),i.lastRenderedState=C}return[C,a]}function td(e,t,i){var a=Ue,m=kt(),C=Xe;if(C){if(i===void 0)throw Error(l(407));i=i()}else i=t();var O=!An((at||m).memoizedState,i);if(O&&(m.memoizedState=i,Dt=!0),m=m.queue,jc(rd.bind(null,a,m,e),[e]),m.getSnapshot!==t||O||Tt!==null&&Tt.memoizedState.tag&1){if(a.flags|=2048,ws(9,{destroy:void 0},id.bind(null,a,m,i,t),null),ht===null)throw Error(l(349));C||(Ai&127)!==0||nd(a,t,i)}return i}function nd(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=Ue.updateQueue,t===null?(t=Bl(),Ue.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function id(e,t,i,a){t.value=i,t.getSnapshot=a,sd(t)&&ad(e)}function rd(e,t,i){return i(function(){sd(t)&&ad(e)})}function sd(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!An(e,i)}catch{return!0}}function ad(e){var t=Or(e,2);t!==null&&bn(t,e,2)}function Oc(e){var t=un();if(typeof e=="function"){var i=e;if(e=i(),Fr){Bt(!0);try{i()}finally{Bt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ri,lastRenderedState:e},t}function ld(e,t,i,a){return e.baseState=i,Mc(e,at,typeof a=="function"?a:Ri)}function _y(e,t,i,a,m){if(Il(e))throw Error(l(485));if(e=t.action,e!==null){var C={payload:m,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(O){C.listeners.push(O)}};V.T!==null?i(!0):C.isTransition=!1,a(C),i=t.pending,i===null?(C.next=t.pending=C,od(t,C)):(C.next=i.next,t.pending=i.next=C)}}function od(e,t){var i=t.action,a=t.payload,m=e.state;if(t.isTransition){var C=V.T,O={};V.T=O;try{var F=i(m,a),J=V.S;J!==null&&J(O,F),cd(e,t,F)}catch(ce){Bc(e,t,ce)}finally{C!==null&&O.types!==null&&(C.types=O.types),V.T=C}}else try{C=i(m,a),cd(e,t,C)}catch(ce){Bc(e,t,ce)}}function cd(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(a){ud(e,t,a)},function(a){return Bc(e,t,a)}):ud(e,t,i)}function ud(e,t,i){t.status="fulfilled",t.value=i,hd(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,od(e,i)))}function Bc(e,t,i){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=i,hd(t),t=t.next;while(t!==a)}e.action=null}function hd(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function fd(e,t){return t}function dd(e,t){if(Xe){var i=ht.formState;if(i!==null){e:{var a=Ue;if(Xe){if(gt){t:{for(var m=gt,C=Vn;m.nodeType!==8;){if(!C){m=null;break t}if(m=Wn(m.nextSibling),m===null){m=null;break t}}C=m.data,m=C==="F!"||C==="F"?m:null}if(m){gt=Wn(m.nextSibling),a=m.data==="F!";break e}}Zi(a)}a=!1}a&&(t=i[0])}}return i=un(),i.memoizedState=i.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:fd,lastRenderedState:t},i.queue=a,i=Ld.bind(null,Ue,a),a.dispatch=i,a=Oc(!1),C=Uc.bind(null,Ue,!1,a.queue),a=un(),m={state:t,dispatch:null,action:e,pending:null},a.queue=m,i=_y.bind(null,Ue,m,C,i),m.dispatch=i,a.memoizedState=e,[t,i,!1]}function pd(e){var t=kt();return md(t,at,e)}function md(e,t,i){if(t=Mc(e,t,fd)[0],e=Nl(Ri)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=va(t)}catch(O){throw O===vs?kl:O}else a=t;t=kt();var m=t.queue,C=m.dispatch;return i!==t.memoizedState&&(Ue.flags|=2048,ws(9,{destroy:void 0},vy.bind(null,m,i),null)),[a,C,e]}function vy(e,t){e.action=t}function gd(e){var t=kt(),i=at;if(i!==null)return md(t,i,e);kt(),t=t.memoizedState,i=kt();var a=i.queue.dispatch;return i.memoizedState=e,[t,a,!1]}function ws(e,t,i,a){return e={tag:e,create:i,deps:a,inst:t,next:null},t=Ue.updateQueue,t===null&&(t=Bl(),Ue.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 _d(){return kt().memoizedState}function Hl(e,t,i,a){var m=un();Ue.flags|=e,m.memoizedState=ws(1|t,{destroy:void 0},i,a===void 0?null:a)}function zl(e,t,i,a){var m=kt();a=a===void 0?null:a;var C=m.memoizedState.inst;at!==null&&a!==null&&Ec(a,at.memoizedState.deps)?m.memoizedState=ws(t,C,i,a):(Ue.flags|=e,m.memoizedState=ws(1|t,C,i,a))}function vd(e,t){Hl(8390656,8,e,t)}function jc(e,t){zl(2048,8,e,t)}function yy(e){Ue.flags|=4;var t=Ue.updateQueue;if(t===null)t=Bl(),Ue.updateQueue=t,t.events=[e];else{var i=t.events;i===null?t.events=[e]:i.push(e)}}function yd(e){var t=kt().memoizedState;return yy({ref:t,nextImpl:e}),function(){if((nt&2)!==0)throw Error(l(440));return t.impl.apply(void 0,arguments)}}function Sd(e,t){return zl(4,2,e,t)}function bd(e,t){return zl(4,4,e,t)}function Cd(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 wd(e,t,i){i=i!=null?i.concat([e]):null,zl(4,4,Cd.bind(null,t,e),i)}function Nc(){}function xd(e,t){var i=kt();t=t===void 0?null:t;var a=i.memoizedState;return t!==null&&Ec(t,a[1])?a[0]:(i.memoizedState=[e,t],e)}function Ed(e,t){var i=kt();t=t===void 0?null:t;var a=i.memoizedState;if(t!==null&&Ec(t,a[1]))return a[0];if(a=e(),Fr){Bt(!0);try{e()}finally{Bt(!1)}}return i.memoizedState=[a,t],a}function Hc(e,t,i){return i===void 0||(Ai&1073741824)!==0&&(We&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=kp(),Ue.lanes|=e,or|=e,i)}function kd(e,t,i,a){return An(i,t)?i:Ss.current!==null?(e=Hc(e,i,a),An(e,t)||(Dt=!0),e):(Ai&42)===0||(Ai&1073741824)!==0&&(We&261930)===0?(Dt=!0,e.memoizedState=i):(e=kp(),Ue.lanes|=e,or|=e,t)}function Ad(e,t,i,a,m){var C=K.p;K.p=C!==0&&8>C?C:8;var O=V.T,F={};V.T=F,Uc(e,!1,t,i);try{var J=m(),ce=V.S;if(ce!==null&&ce(F,J),J!==null&&typeof J=="object"&&typeof J.then=="function"){var me=py(J,a);ya(e,t,me,On(e))}else ya(e,t,a,On(e))}catch(_e){ya(e,t,{then:function(){},status:"rejected",reason:_e},On())}finally{K.p=C,O!==null&&F.types!==null&&(O.types=F.types),V.T=O}}function Sy(){}function zc(e,t,i,a){if(e.tag!==5)throw Error(l(476));var m=Rd(e).queue;Ad(e,m,t,ne,i===null?Sy:function(){return Td(e),i(a)})}function Rd(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ri,lastRenderedState:ne},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ri,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Td(e){var t=Rd(e);t.next===null&&(t=e.alternate.memoizedState),ya(e,t.next.queue,{},On())}function Ic(){return Ft(Na)}function Dd(){return kt().memoizedState}function Md(){return kt().memoizedState}function by(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=On();e=nr(i);var a=ir(t,e,i);a!==null&&(bn(a,t,i),pa(a,t,i)),t={cache:pc()},e.payload=t;return}t=t.return}}function Cy(e,t,i){var a=On();i={lane:a,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Il(e)?Od(t,i):(i=ic(e,t,i,a),i!==null&&(bn(i,e,a),Bd(i,t,a)))}function Ld(e,t,i){var a=On();ya(e,t,i,a)}function ya(e,t,i,a){var m={lane:a,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(Il(e))Od(t,m);else{var C=e.alternate;if(e.lanes===0&&(C===null||C.lanes===0)&&(C=t.lastRenderedReducer,C!==null))try{var O=t.lastRenderedState,F=C(O,i);if(m.hasEagerState=!0,m.eagerState=F,An(F,O))return yl(e,t,m,0),ht===null&&vl(),!1}catch{}finally{}if(i=ic(e,t,m,a),i!==null)return bn(i,e,a),Bd(i,t,a),!0}return!1}function Uc(e,t,i,a){if(a={lane:2,revertLane:vu(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Il(e)){if(t)throw Error(l(479))}else t=ic(e,i,a,2),t!==null&&bn(t,e,2)}function Il(e){var t=e.alternate;return e===Ue||t!==null&&t===Ue}function Od(e,t){bs=Ll=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function Bd(e,t,i){if((i&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,i|=a,t.lanes=i,Ie(e,i)}}var Sa={readContext:Ft,use:jl,useCallback:Ct,useContext:Ct,useEffect:Ct,useImperativeHandle:Ct,useLayoutEffect:Ct,useInsertionEffect:Ct,useMemo:Ct,useReducer:Ct,useRef:Ct,useState:Ct,useDebugValue:Ct,useDeferredValue:Ct,useTransition:Ct,useSyncExternalStore:Ct,useId:Ct,useHostTransitionStatus:Ct,useFormState:Ct,useActionState:Ct,useOptimistic:Ct,useMemoCache:Ct,useCacheRefresh:Ct};Sa.useEffectEvent=Ct;var jd={readContext:Ft,use:jl,useCallback:function(e,t){return un().memoizedState=[e,t===void 0?null:t],e},useContext:Ft,useEffect:vd,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,Hl(4194308,4,Cd.bind(null,t,e),i)},useLayoutEffect:function(e,t){return Hl(4194308,4,e,t)},useInsertionEffect:function(e,t){Hl(4,2,e,t)},useMemo:function(e,t){var i=un();t=t===void 0?null:t;var a=e();if(Fr){Bt(!0);try{e()}finally{Bt(!1)}}return i.memoizedState=[a,t],a},useReducer:function(e,t,i){var a=un();if(i!==void 0){var m=i(t);if(Fr){Bt(!0);try{i(t)}finally{Bt(!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=Cy.bind(null,Ue,e),[a.memoizedState,e]},useRef:function(e){var t=un();return e={current:e},t.memoizedState=e},useState:function(e){e=Oc(e);var t=e.queue,i=Ld.bind(null,Ue,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:Nc,useDeferredValue:function(e,t){var i=un();return Hc(i,e,t)},useTransition:function(){var e=Oc(!1);return e=Ad.bind(null,Ue,e.queue,!0,!1),un().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var a=Ue,m=un();if(Xe){if(i===void 0)throw Error(l(407));i=i()}else{if(i=t(),ht===null)throw Error(l(349));(We&127)!==0||nd(a,t,i)}m.memoizedState=i;var C={value:i,getSnapshot:t};return m.queue=C,vd(rd.bind(null,a,C,e),[e]),a.flags|=2048,ws(9,{destroy:void 0},id.bind(null,a,C,i,t),null),i},useId:function(){var e=un(),t=ht.identifierPrefix;if(Xe){var i=hi,a=ui;i=(a&~(1<<32-tt(a)-1)).toString(32)+i,t="_"+t+"R_"+i,i=Ol++,0<i&&(t+="H"+i.toString(32)),t+="_"}else i=my++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Ic,useFormState:dd,useActionState:dd,useOptimistic:function(e){var t=un();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=Uc.bind(null,Ue,!0,i),i.dispatch=t,[e,t]},useMemoCache:Dc,useCacheRefresh:function(){return un().memoizedState=by.bind(null,Ue)},useEffectEvent:function(e){var t=un(),i={impl:e};return t.memoizedState=i,function(){if((nt&2)!==0)throw Error(l(440));return i.impl.apply(void 0,arguments)}}},Pc={readContext:Ft,use:jl,useCallback:xd,useContext:Ft,useEffect:jc,useImperativeHandle:wd,useInsertionEffect:Sd,useLayoutEffect:bd,useMemo:Ed,useReducer:Nl,useRef:_d,useState:function(){return Nl(Ri)},useDebugValue:Nc,useDeferredValue:function(e,t){var i=kt();return kd(i,at.memoizedState,e,t)},useTransition:function(){var e=Nl(Ri)[0],t=kt().memoizedState;return[typeof e=="boolean"?e:va(e),t]},useSyncExternalStore:td,useId:Dd,useHostTransitionStatus:Ic,useFormState:pd,useActionState:pd,useOptimistic:function(e,t){var i=kt();return ld(i,at,e,t)},useMemoCache:Dc,useCacheRefresh:Md};Pc.useEffectEvent=yd;var Nd={readContext:Ft,use:jl,useCallback:xd,useContext:Ft,useEffect:jc,useImperativeHandle:wd,useInsertionEffect:Sd,useLayoutEffect:bd,useMemo:Ed,useReducer:Lc,useRef:_d,useState:function(){return Lc(Ri)},useDebugValue:Nc,useDeferredValue:function(e,t){var i=kt();return at===null?Hc(i,e,t):kd(i,at.memoizedState,e,t)},useTransition:function(){var e=Lc(Ri)[0],t=kt().memoizedState;return[typeof e=="boolean"?e:va(e),t]},useSyncExternalStore:td,useId:Dd,useHostTransitionStatus:Ic,useFormState:gd,useActionState:gd,useOptimistic:function(e,t){var i=kt();return at!==null?ld(i,at,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:Dc,useCacheRefresh:Md};Nd.useEffectEvent=yd;function Fc(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 qc={enqueueSetState:function(e,t,i){e=e._reactInternals;var a=On(),m=nr(a);m.payload=t,i!=null&&(m.callback=i),t=ir(e,m,a),t!==null&&(bn(t,e,a),pa(t,e,a))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var a=On(),m=nr(a);m.tag=1,m.payload=t,i!=null&&(m.callback=i),t=ir(e,m,a),t!==null&&(bn(t,e,a),pa(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=On(),a=nr(i);a.tag=2,t!=null&&(a.callback=t),t=ir(e,a,i),t!==null&&(bn(t,e,i),pa(t,e,i))}};function Hd(e,t,i,a,m,C,O){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,C,O):t.prototype&&t.prototype.isPureReactComponent?!aa(i,a)||!aa(m,C):!0}function zd(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&&qc.enqueueReplaceState(t,t.state,null)}function qr(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 Id(e){_l(e)}function Ud(e){console.error(e)}function Pd(e){_l(e)}function Ul(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function Fd(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 $c(e,t,i){return i=nr(i),i.tag=3,i.payload={element:null},i.callback=function(){Ul(e,t)},i}function qd(e){return e=nr(e),e.tag=3,e}function $d(e,t,i,a){var m=i.type.getDerivedStateFromError;if(typeof m=="function"){var C=a.value;e.payload=function(){return m(C)},e.callback=function(){Fd(t,i,a)}}var O=i.stateNode;O!==null&&typeof O.componentDidCatch=="function"&&(e.callback=function(){Fd(t,i,a),typeof m!="function"&&(cr===null?cr=new Set([this]):cr.add(this));var F=a.stack;this.componentDidCatch(a.value,{componentStack:F!==null?F:""})})}function wy(e,t,i,a,m){if(i.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=i.alternate,t!==null&&ms(t,i,m,!0),i=Tn.current,i!==null){switch(i.tag){case 31:case 13:return Kn===null?Jl():i.alternate===null&&wt===0&&(wt=3),i.flags&=-257,i.flags|=65536,i.lanes=m,a===Al?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([a]):t.add(a),mu(e,a,m)),!1;case 22:return i.flags|=65536,a===Al?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)),mu(e,a,m)),!1}throw Error(l(435,i.tag))}return mu(e,a,m),Jl(),!1}if(Xe)return t=Tn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=m,a!==cc&&(e=Error(l(422),{cause:a}),ca(qn(e,i)))):(a!==cc&&(t=Error(l(423),{cause:a}),ca(qn(t,i))),e=e.current.alternate,e.flags|=65536,m&=-m,e.lanes|=m,a=qn(a,i),m=$c(e.stateNode,a,m),Sc(e,m),wt!==4&&(wt=2)),!1;var C=Error(l(520),{cause:a});if(C=qn(C,i),Ra===null?Ra=[C]:Ra.push(C),wt!==4&&(wt=2),t===null)return!0;a=qn(a,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=m&-m,i.lanes|=e,e=$c(i.stateNode,a,e),Sc(i,e),!1;case 1:if(t=i.type,C=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||C!==null&&typeof C.componentDidCatch=="function"&&(cr===null||!cr.has(C))))return i.flags|=65536,m&=-m,i.lanes|=m,m=qd(m),$d(m,e,i,a),Sc(i,m),!1}i=i.return}while(i!==null);return!1}var Gc=Error(l(461)),Dt=!1;function qt(e,t,i,a){t.child=e===null?Wf(t,null,i,a):Pr(t,e.child,i,a)}function Gd(e,t,i,a,m){i=i.render;var C=t.ref;if("ref"in a){var O={};for(var F in a)F!=="ref"&&(O[F]=a[F])}else O=a;return Hr(t),a=kc(e,t,i,O,C,m),F=Ac(),e!==null&&!Dt?(Rc(e,t,m),Ti(e,t,m)):(Xe&&F&&lc(t),t.flags|=1,qt(e,t,a,m),t.child)}function Vd(e,t,i,a,m){if(e===null){var C=i.type;return typeof C=="function"&&!rc(C)&&C.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=C,Kd(e,t,C,a,m)):(e=bl(i.type,null,a,t,t.mode,m),e.ref=t.ref,e.return=t,t.child=e)}if(C=e.child,!Zc(e,m)){var O=C.memoizedProps;if(i=i.compare,i=i!==null?i:aa,i(O,a)&&e.ref===t.ref)return Ti(e,t,m)}return t.flags|=1,e=wi(C,a),e.ref=t.ref,e.return=t,t.child=e}function Kd(e,t,i,a,m){if(e!==null){var C=e.memoizedProps;if(aa(C,a)&&e.ref===t.ref)if(Dt=!1,t.pendingProps=a=C,Zc(e,m))(e.flags&131072)!==0&&(Dt=!0);else return t.lanes=e.lanes,Ti(e,t,m)}return Vc(e,t,i,a,m)}function Wd(e,t,i,a){var m=a.children,C=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(C=C!==null?C.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&~C}else a=0,t.child=null;return Yd(e,t,C,i,a)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&El(t,C!==null?C.cachePool:null),C!==null?Qf(t,C):Cc(),Jf(t);else return a=t.lanes=536870912,Yd(e,t,C!==null?C.baseLanes|i:i,i,a)}else C!==null?(El(t,C.cachePool),Qf(t,C),sr(),t.memoizedState=null):(e!==null&&El(t,null),Cc(),sr());return qt(e,t,m,i),t.child}function ba(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Yd(e,t,i,a,m){var C=gc();return C=C===null?null:{parent:Rt._currentValue,pool:C},t.memoizedState={baseLanes:i,cachePool:C},e!==null&&El(t,null),Cc(),Jf(t),e!==null&&ms(e,t,a,!0),t.childLanes=m,null}function Pl(e,t){return t=ql({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Xd(e,t,i){return Pr(t,e.child,null,i),e=Pl(t,t.pendingProps),e.flags|=2,Dn(t),t.memoizedState=null,e}function xy(e,t,i){var a=t.pendingProps,m=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Xe){if(a.mode==="hidden")return e=Pl(t,a),t.lanes=536870912,ba(null,e);if(xc(t),(e=gt)?(e=om(e,Vn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Qi!==null?{id:ui,overflow:hi}:null,retryLane:536870912,hydrationErrors:null},i=Of(e),i.return=t,t.child=i,Pt=t,gt=null)):e=null,e===null)throw Zi(t);return t.lanes=536870912,null}return Pl(t,a)}var C=e.memoizedState;if(C!==null){var O=C.dehydrated;if(xc(t),m)if(t.flags&256)t.flags&=-257,t=Xd(e,t,i);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(l(558));else if(Dt||ms(e,t,i,!1),m=(i&e.childLanes)!==0,Dt||m){if(a=ht,a!==null&&(O=Pi(a,i),O!==0&&O!==C.retryLane))throw C.retryLane=O,Or(e,O),bn(a,e,O),Gc;Jl(),t=Xd(e,t,i)}else e=C.treeContext,gt=Wn(O.nextSibling),Pt=t,Xe=!0,Ji=null,Vn=!1,e!==null&&Nf(t,e),t=Pl(t,a),t.flags|=4096;return t}return e=wi(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Fl(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(l(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function Vc(e,t,i,a,m){return Hr(t),i=kc(e,t,i,a,void 0,m),a=Ac(),e!==null&&!Dt?(Rc(e,t,m),Ti(e,t,m)):(Xe&&a&&lc(t),t.flags|=1,qt(e,t,i,m),t.child)}function Qd(e,t,i,a,m,C){return Hr(t),t.updateQueue=null,i=ed(t,a,i,m),Zf(e),a=Ac(),e!==null&&!Dt?(Rc(e,t,C),Ti(e,t,C)):(Xe&&a&&lc(t),t.flags|=1,qt(e,t,i,C),t.child)}function Jd(e,t,i,a,m){if(Hr(t),t.stateNode===null){var C=hs,O=i.contextType;typeof O=="object"&&O!==null&&(C=Ft(O)),C=new i(a,C),t.memoizedState=C.state!==null&&C.state!==void 0?C.state:null,C.updater=qc,t.stateNode=C,C._reactInternals=t,C=t.stateNode,C.props=a,C.state=t.memoizedState,C.refs={},vc(t),O=i.contextType,C.context=typeof O=="object"&&O!==null?Ft(O):hs,C.state=t.memoizedState,O=i.getDerivedStateFromProps,typeof O=="function"&&(Fc(t,i,O,a),C.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof C.getSnapshotBeforeUpdate=="function"||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(O=C.state,typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount(),O!==C.state&&qc.enqueueReplaceState(C,C.state,null),ga(t,a,C,m),ma(),C.state=t.memoizedState),typeof C.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){C=t.stateNode;var F=t.memoizedProps,J=qr(i,F);C.props=J;var ce=C.context,me=i.contextType;O=hs,typeof me=="object"&&me!==null&&(O=Ft(me));var _e=i.getDerivedStateFromProps;me=typeof _e=="function"||typeof C.getSnapshotBeforeUpdate=="function",F=t.pendingProps!==F,me||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(F||ce!==O)&&zd(t,C,a,O),tr=!1;var ue=t.memoizedState;C.state=ue,ga(t,a,C,m),ma(),ce=t.memoizedState,F||ue!==ce||tr?(typeof _e=="function"&&(Fc(t,i,_e,a),ce=t.memoizedState),(J=tr||Hd(t,i,J,a,ue,ce,O))?(me||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount()),typeof C.componentDidMount=="function"&&(t.flags|=4194308)):(typeof C.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=ce),C.props=a,C.state=ce,C.context=O,a=J):(typeof C.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{C=t.stateNode,yc(e,t),O=t.memoizedProps,me=qr(i,O),C.props=me,_e=t.pendingProps,ue=C.context,ce=i.contextType,J=hs,typeof ce=="object"&&ce!==null&&(J=Ft(ce)),F=i.getDerivedStateFromProps,(ce=typeof F=="function"||typeof C.getSnapshotBeforeUpdate=="function")||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(O!==_e||ue!==J)&&zd(t,C,a,J),tr=!1,ue=t.memoizedState,C.state=ue,ga(t,a,C,m),ma();var de=t.memoizedState;O!==_e||ue!==de||tr||e!==null&&e.dependencies!==null&&wl(e.dependencies)?(typeof F=="function"&&(Fc(t,i,F,a),de=t.memoizedState),(me=tr||Hd(t,i,me,a,ue,de,J)||e!==null&&e.dependencies!==null&&wl(e.dependencies))?(ce||typeof C.UNSAFE_componentWillUpdate!="function"&&typeof C.componentWillUpdate!="function"||(typeof C.componentWillUpdate=="function"&&C.componentWillUpdate(a,de,J),typeof C.UNSAFE_componentWillUpdate=="function"&&C.UNSAFE_componentWillUpdate(a,de,J)),typeof C.componentDidUpdate=="function"&&(t.flags|=4),typeof C.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof C.componentDidUpdate!="function"||O===e.memoizedProps&&ue===e.memoizedState||(t.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||O===e.memoizedProps&&ue===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=de),C.props=a,C.state=de,C.context=J,a=me):(typeof C.componentDidUpdate!="function"||O===e.memoizedProps&&ue===e.memoizedState||(t.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||O===e.memoizedProps&&ue===e.memoizedState||(t.flags|=1024),a=!1)}return C=a,Fl(e,t),a=(t.flags&128)!==0,C||a?(C=t.stateNode,i=a&&typeof i.getDerivedStateFromError!="function"?null:C.render(),t.flags|=1,e!==null&&a?(t.child=Pr(t,e.child,null,m),t.child=Pr(t,null,i,m)):qt(e,t,i,m),t.memoizedState=C.state,e=t.child):e=Ti(e,t,m),e}function Zd(e,t,i,a){return jr(),t.flags|=256,qt(e,t,i,a),t.child}var Kc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Wc(e){return{baseLanes:e,cachePool:Ff()}}function Yc(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=Ln),e}function ep(e,t,i){var a=t.pendingProps,m=!1,C=(t.flags&128)!==0,O;if((O=C)||(O=e!==null&&e.memoizedState===null?!1:(Et.current&2)!==0),O&&(m=!0,t.flags&=-129),O=(t.flags&32)!==0,t.flags&=-33,e===null){if(Xe){if(m?rr(t):sr(),(e=gt)?(e=om(e,Vn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Qi!==null?{id:ui,overflow:hi}:null,retryLane:536870912,hydrationErrors:null},i=Of(e),i.return=t,t.child=i,Pt=t,gt=null)):e=null,e===null)throw Zi(t);return Mu(e)?t.lanes=32:t.lanes=536870912,null}var F=a.children;return a=a.fallback,m?(sr(),m=t.mode,F=ql({mode:"hidden",children:F},m),a=Br(a,m,i,null),F.return=t,a.return=t,F.sibling=a,t.child=F,a=t.child,a.memoizedState=Wc(i),a.childLanes=Yc(e,O,i),t.memoizedState=Kc,ba(null,a)):(rr(t),Xc(t,F))}var J=e.memoizedState;if(J!==null&&(F=J.dehydrated,F!==null)){if(C)t.flags&256?(rr(t),t.flags&=-257,t=Qc(e,t,i)):t.memoizedState!==null?(sr(),t.child=e.child,t.flags|=128,t=null):(sr(),F=a.fallback,m=t.mode,a=ql({mode:"visible",children:a.children},m),F=Br(F,m,i,null),F.flags|=2,a.return=t,F.return=t,a.sibling=F,t.child=a,Pr(t,e.child,null,i),a=t.child,a.memoizedState=Wc(i),a.childLanes=Yc(e,O,i),t.memoizedState=Kc,t=ba(null,a));else if(rr(t),Mu(F)){if(O=F.nextSibling&&F.nextSibling.dataset,O)var ce=O.dgst;O=ce,a=Error(l(419)),a.stack="",a.digest=O,ca({value:a,source:null,stack:null}),t=Qc(e,t,i)}else if(Dt||ms(e,t,i,!1),O=(i&e.childLanes)!==0,Dt||O){if(O=ht,O!==null&&(a=Pi(O,i),a!==0&&a!==J.retryLane))throw J.retryLane=a,Or(e,a),bn(O,e,a),Gc;Du(F)||Jl(),t=Qc(e,t,i)}else Du(F)?(t.flags|=192,t.child=e.child,t=null):(e=J.treeContext,gt=Wn(F.nextSibling),Pt=t,Xe=!0,Ji=null,Vn=!1,e!==null&&Nf(t,e),t=Xc(t,a.children),t.flags|=4096);return t}return m?(sr(),F=a.fallback,m=t.mode,J=e.child,ce=J.sibling,a=wi(J,{mode:"hidden",children:a.children}),a.subtreeFlags=J.subtreeFlags&65011712,ce!==null?F=wi(ce,F):(F=Br(F,m,i,null),F.flags|=2),F.return=t,a.return=t,a.sibling=F,t.child=a,ba(null,a),a=t.child,F=e.child.memoizedState,F===null?F=Wc(i):(m=F.cachePool,m!==null?(J=Rt._currentValue,m=m.parent!==J?{parent:J,pool:J}:m):m=Ff(),F={baseLanes:F.baseLanes|i,cachePool:m}),a.memoizedState=F,a.childLanes=Yc(e,O,i),t.memoizedState=Kc,ba(e.child,a)):(rr(t),i=e.child,e=i.sibling,i=wi(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 Xc(e,t){return t=ql({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ql(e,t){return e=Rn(22,e,null,t),e.lanes=0,e}function Qc(e,t,i){return Pr(t,e.child,null,i),e=Xc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function tp(e,t,i){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),fc(e.return,t,i)}function Jc(e,t,i,a,m,C){var O=e.memoizedState;O===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:i,tailMode:m,treeForkCount:C}:(O.isBackwards=t,O.rendering=null,O.renderingStartTime=0,O.last=a,O.tail=i,O.tailMode=m,O.treeForkCount=C)}function np(e,t,i){var a=t.pendingProps,m=a.revealOrder,C=a.tail;a=a.children;var O=Et.current,F=(O&2)!==0;if(F?(O=O&1|2,t.flags|=128):O&=1,I(Et,O),qt(e,t,a,i),a=Xe?oa:0,!F&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&tp(e,i,t);else if(e.tag===19)tp(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&&Ml(e)===null&&(m=i),i=i.sibling;i=m,i===null?(m=t.child,t.child=null):(m=i.sibling,i.sibling=null),Jc(t,!1,m,i,C,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&&Ml(e)===null){t.child=m;break}e=m.sibling,m.sibling=i,i=m,m=e}Jc(t,!0,i,null,C,a);break;case"together":Jc(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function Ti(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),or|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(ms(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(l(153));if(t.child!==null){for(e=t.child,i=wi(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=wi(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function Zc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&wl(e)))}function Ey(e,t,i){switch(t.tag){case 3:q(t,t.stateNode.containerInfo),er(t,Rt,e.memoizedState.cache),jr();break;case 27:case 5:ee(t);break;case 4:q(t,t.stateNode.containerInfo);break;case 10:er(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,xc(t),null;break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(rr(t),t.flags|=128,null):(i&t.child.childLanes)!==0?ep(e,t,i):(rr(t),e=Ti(e,t,i),e!==null?e.sibling:null);rr(t);break;case 19:var m=(e.flags&128)!==0;if(a=(i&t.childLanes)!==0,a||(ms(e,t,i,!1),a=(i&t.childLanes)!==0),m){if(a)return np(e,t,i);t.flags|=128}if(m=t.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),I(Et,Et.current),a)break;return null;case 22:return t.lanes=0,Wd(e,t,i,t.pendingProps);case 24:er(t,Rt,e.memoizedState.cache)}return Ti(e,t,i)}function ip(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)Dt=!0;else{if(!Zc(e,i)&&(t.flags&128)===0)return Dt=!1,Ey(e,t,i);Dt=(e.flags&131072)!==0}else Dt=!1,Xe&&(t.flags&1048576)!==0&&jf(t,oa,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=Ir(t.elementType),t.type=e,typeof e=="function")rc(e)?(a=qr(e,a),t.tag=1,t=Jd(null,t,e,a,i)):(t.tag=0,t=Vc(null,t,e,a,i));else{if(e!=null){var m=e.$$typeof;if(m===A){t.tag=11,t=Gd(null,t,e,a,i);break e}else if(m===T){t.tag=14,t=Vd(null,t,e,a,i);break e}}throw t=Y(e)||e,Error(l(306,t,""))}}return t;case 0:return Vc(e,t,t.type,t.pendingProps,i);case 1:return a=t.type,m=qr(a,t.pendingProps),Jd(e,t,a,m,i);case 3:e:{if(q(t,t.stateNode.containerInfo),e===null)throw Error(l(387));a=t.pendingProps;var C=t.memoizedState;m=C.element,yc(e,t),ga(t,a,null,i);var O=t.memoizedState;if(a=O.cache,er(t,Rt,a),a!==C.cache&&dc(t,[Rt],i,!0),ma(),a=O.element,C.isDehydrated)if(C={element:a,isDehydrated:!1,cache:O.cache},t.updateQueue.baseState=C,t.memoizedState=C,t.flags&256){t=Zd(e,t,a,i);break e}else if(a!==m){m=qn(Error(l(424)),t),ca(m),t=Zd(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(gt=Wn(e.firstChild),Pt=t,Xe=!0,Ji=null,Vn=!0,i=Wf(t,null,a,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(jr(),a===m){t=Ti(e,t,i);break e}qt(e,t,a,i)}t=t.child}return t;case 26:return Fl(e,t),e===null?(i=pm(t.type,null,t.pendingProps,null))?t.memoizedState=i:Xe||(i=t.type,e=t.pendingProps,a=so(he.current).createElement(i),a[At]=t,a[It]=e,$t(a,i,e),ut(a),t.stateNode=a):t.memoizedState=pm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ee(t),e===null&&Xe&&(a=t.stateNode=hm(t.type,t.pendingProps,he.current),Pt=t,Vn=!0,m=gt,dr(t.type)?(Lu=m,gt=Wn(a.firstChild)):gt=m),qt(e,t,t.pendingProps.children,i),Fl(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Xe&&((m=a=gt)&&(a=t0(a,t.type,t.pendingProps,Vn),a!==null?(t.stateNode=a,Pt=t,gt=Wn(a.firstChild),Vn=!1,m=!0):m=!1),m||Zi(t)),ee(t),m=t.type,C=t.pendingProps,O=e!==null?e.memoizedProps:null,a=C.children,Au(m,C)?a=null:O!==null&&Au(m,O)&&(t.flags|=32),t.memoizedState!==null&&(m=kc(e,t,gy,null,null,i),Na._currentValue=m),Fl(e,t),qt(e,t,a,i),t.child;case 6:return e===null&&Xe&&((e=i=gt)&&(i=n0(i,t.pendingProps,Vn),i!==null?(t.stateNode=i,Pt=t,gt=null,e=!0):e=!1),e||Zi(t)),null;case 13:return ep(e,t,i);case 4:return q(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=Pr(t,null,a,i):qt(e,t,a,i),t.child;case 11:return Gd(e,t,t.type,t.pendingProps,i);case 7:return qt(e,t,t.pendingProps,i),t.child;case 8:return qt(e,t,t.pendingProps.children,i),t.child;case 12:return qt(e,t,t.pendingProps.children,i),t.child;case 10:return a=t.pendingProps,er(t,t.type,a.value),qt(e,t,a.children,i),t.child;case 9:return m=t.type._context,a=t.pendingProps.children,Hr(t),m=Ft(m),a=a(m),t.flags|=1,qt(e,t,a,i),t.child;case 14:return Vd(e,t,t.type,t.pendingProps,i);case 15:return Kd(e,t,t.type,t.pendingProps,i);case 19:return np(e,t,i);case 31:return xy(e,t,i);case 22:return Wd(e,t,i,t.pendingProps);case 24:return Hr(t),a=Ft(Rt),e===null?(m=gc(),m===null&&(m=ht,C=pc(),m.pooledCache=C,C.refCount++,C!==null&&(m.pooledCacheLanes|=i),m=C),t.memoizedState={parent:a,cache:m},vc(t),er(t,Rt,m)):((e.lanes&i)!==0&&(yc(e,t),ga(t,null,null,i),ma()),m=e.memoizedState,C=t.memoizedState,m.parent!==a?(m={parent:a,cache:a},t.memoizedState=m,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=m),er(t,Rt,a)):(a=C.cache,er(t,Rt,a),a!==m.cache&&dc(t,[Rt],i,!0))),qt(e,t,t.pendingProps.children,i),t.child;case 29:throw t.pendingProps}throw Error(l(156,t.tag))}function Di(e){e.flags|=4}function eu(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(Dp())e.flags|=8192;else throw Ur=Al,_c}else e.flags&=-16777217}function rp(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!ym(t))if(Dp())e.flags|=8192;else throw Ur=Al,_c}function $l(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Yt():536870912,e.lanes|=t,As|=t)}function Ca(e,t){if(!Xe)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 _t(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 ky(e,t,i){var a=t.pendingProps;switch(oc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return _t(t),null;case 1:return _t(t),null;case 3:return i=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),ki(Rt),ie(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(ps(t)?Di(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,uc())),_t(t),null;case 26:var m=t.type,C=t.memoizedState;return e===null?(Di(t),C!==null?(_t(t),rp(t,C)):(_t(t),eu(t,m,null,a,i))):C?C!==e.memoizedState?(Di(t),_t(t),rp(t,C)):(_t(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&Di(t),_t(t),eu(t,m,e,a,i)),null;case 27:if(le(t),i=he.current,m=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&Di(t);else{if(!a){if(t.stateNode===null)throw Error(l(166));return _t(t),null}e=se.current,ps(t)?Hf(t):(e=hm(m,a,i),t.stateNode=e,Di(t))}return _t(t),null;case 5:if(le(t),m=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&Di(t);else{if(!a){if(t.stateNode===null)throw Error(l(166));return _t(t),null}if(C=se.current,ps(t))Hf(t);else{var O=so(he.current);switch(C){case 1:C=O.createElementNS("http://www.w3.org/2000/svg",m);break;case 2:C=O.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;default:switch(m){case"svg":C=O.createElementNS("http://www.w3.org/2000/svg",m);break;case"math":C=O.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;case"script":C=O.createElement("div"),C.innerHTML="<script><\/script>",C=C.removeChild(C.firstChild);break;case"select":C=typeof a.is=="string"?O.createElement("select",{is:a.is}):O.createElement("select"),a.multiple?C.multiple=!0:a.size&&(C.size=a.size);break;default:C=typeof a.is=="string"?O.createElement(m,{is:a.is}):O.createElement(m)}}C[At]=t,C[It]=a;e:for(O=t.child;O!==null;){if(O.tag===5||O.tag===6)C.appendChild(O.stateNode);else if(O.tag!==4&&O.tag!==27&&O.child!==null){O.child.return=O,O=O.child;continue}if(O===t)break e;for(;O.sibling===null;){if(O.return===null||O.return===t)break e;O=O.return}O.sibling.return=O.return,O=O.sibling}t.stateNode=C;e:switch($t(C,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&&Di(t)}}return _t(t),eu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&Di(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(l(166));if(e=he.current,ps(t)){if(e=t.stateNode,i=t.memoizedProps,a=null,m=Pt,m!==null)switch(m.tag){case 27:case 5:a=m.memoizedProps}e[At]=t,e=!!(e.nodeValue===i||a!==null&&a.suppressHydrationWarning===!0||em(e.nodeValue,i)),e||Zi(t,!0)}else e=so(e).createTextNode(a),e[At]=t,t.stateNode=e}return _t(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(a=ps(t),i!==null){if(e===null){if(!a)throw Error(l(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(557));e[At]=t}else jr(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;_t(t),e=!1}else i=uc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?(Dn(t),t):(Dn(t),null);if((t.flags&128)!==0)throw Error(l(558))}return _t(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(m=ps(t),a!==null&&a.dehydrated!==null){if(e===null){if(!m)throw Error(l(318));if(m=t.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(l(317));m[At]=t}else jr(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;_t(t),m=!1}else m=uc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=m),m=!0;if(!m)return t.flags&256?(Dn(t),t):(Dn(t),null)}return Dn(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),C=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(C=a.memoizedState.cachePool.pool),C!==m&&(a.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),$l(t,t.updateQueue),_t(t),null);case 4:return ie(),e===null&&Cu(t.stateNode.containerInfo),_t(t),null;case 10:return ki(t.type),_t(t),null;case 19:if($(Et),a=t.memoizedState,a===null)return _t(t),null;if(m=(t.flags&128)!==0,C=a.rendering,C===null)if(m)Ca(a,!1);else{if(wt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(C=Ml(e),C!==null){for(t.flags|=128,Ca(a,!1),e=C.updateQueue,t.updateQueue=e,$l(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)Lf(i,e),i=i.sibling;return I(Et,Et.current&1|2),Xe&&xi(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&it()>Yl&&(t.flags|=128,m=!0,Ca(a,!1),t.lanes=4194304)}else{if(!m)if(e=Ml(C),e!==null){if(t.flags|=128,m=!0,e=e.updateQueue,t.updateQueue=e,$l(t,e),Ca(a,!0),a.tail===null&&a.tailMode==="hidden"&&!C.alternate&&!Xe)return _t(t),null}else 2*it()-a.renderingStartTime>Yl&&i!==536870912&&(t.flags|=128,m=!0,Ca(a,!1),t.lanes=4194304);a.isBackwards?(C.sibling=t.child,t.child=C):(e=a.last,e!==null?e.sibling=C:t.child=C,a.last=C)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=it(),e.sibling=null,i=Et.current,I(Et,m?i&1|2:i&1),Xe&&xi(t,a.treeForkCount),e):(_t(t),null);case 22:case 23:return Dn(t),wc(),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&&(_t(t),t.subtreeFlags&6&&(t.flags|=8192)):_t(t),i=t.updateQueue,i!==null&&$l(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&&$(zr),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),ki(Rt),_t(t),null;case 25:return null;case 30:return null}throw Error(l(156,t.tag))}function Ay(e,t){switch(oc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ki(Rt),ie(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return le(t),null;case 31:if(t.memoizedState!==null){if(Dn(t),t.alternate===null)throw Error(l(340));jr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Dn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(l(340));jr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return $(Et),null;case 4:return ie(),null;case 10:return ki(t.type),null;case 22:case 23:return Dn(t),wc(),e!==null&&$(zr),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ki(Rt),null;case 25:return null;default:return null}}function sp(e,t){switch(oc(t),t.tag){case 3:ki(Rt),ie();break;case 26:case 27:case 5:le(t);break;case 4:ie();break;case 31:t.memoizedState!==null&&Dn(t);break;case 13:Dn(t);break;case 19:$(Et);break;case 10:ki(t.type);break;case 22:case 23:Dn(t),wc(),e!==null&&$(zr);break;case 24:ki(Rt)}}function wa(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 C=i.create,O=i.inst;a=C(),O.destroy=a}i=i.next}while(i!==m)}}catch(F){st(t,t.return,F)}}function ar(e,t,i){try{var a=t.updateQueue,m=a!==null?a.lastEffect:null;if(m!==null){var C=m.next;a=C;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,ce=F;try{ce()}catch(me){st(m,J,me)}}}a=a.next}while(a!==C)}}catch(me){st(t,t.return,me)}}function ap(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{Xf(t,i)}catch(a){st(e,e.return,a)}}}function lp(e,t,i){i.props=qr(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(a){st(e,t,a)}}function xa(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){st(e,t,m)}}function fi(e,t){var i=e.ref,a=e.refCleanup;if(i!==null)if(typeof a=="function")try{a()}catch(m){st(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){st(e,t,m)}else i.current=null}function op(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){st(e,e.return,m)}}function tu(e,t,i){try{var a=e.stateNode;Yy(a,e.type,i,t),a[It]=t}catch(m){st(e,e.return,m)}}function cp(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&dr(e.type)||e.tag===4}function nu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||cp(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&&dr(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 iu(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=kn));else if(a!==4&&(a===27&&dr(e.type)&&(i=e.stateNode,t=null),e=e.child,e!==null))for(iu(e,t,i),e=e.sibling;e!==null;)iu(e,t,i),e=e.sibling}function Gl(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&&dr(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(Gl(e,t,i),e=e.sibling;e!==null;)Gl(e,t,i),e=e.sibling}function up(e){var t=e.stateNode,i=e.memoizedProps;try{for(var a=e.type,m=t.attributes;m.length;)t.removeAttributeNode(m[0]);$t(t,a,i),t[At]=e,t[It]=i}catch(C){st(e,e.return,C)}}var Mi=!1,Mt=!1,ru=!1,hp=typeof WeakSet=="function"?WeakSet:Set,zt=null;function Ry(e,t){if(e=e.containerInfo,Eu=fo,e=wf(e),Qo(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,C=a.focusNode;a=a.focusOffset;try{i.nodeType,C.nodeType}catch{i=null;break e}var O=0,F=-1,J=-1,ce=0,me=0,_e=e,ue=null;t:for(;;){for(var de;_e!==i||m!==0&&_e.nodeType!==3||(F=O+m),_e!==C||a!==0&&_e.nodeType!==3||(J=O+a),_e.nodeType===3&&(O+=_e.nodeValue.length),(de=_e.firstChild)!==null;)ue=_e,_e=de;for(;;){if(_e===e)break t;if(ue===i&&++ce===m&&(F=O),ue===C&&++me===a&&(J=O),(de=_e.nextSibling)!==null)break;_e=ue,ue=_e.parentNode}_e=de}i=F===-1||J===-1?null:{start:F,end:J}}else i=null}i=i||{start:0,end:0}}else i=null;for(ku={focusedElem:e,selectionRange:i},fo=!1,zt=t;zt!==null;)if(t=zt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,zt=e;else for(;zt!==null;){switch(t=zt,C=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(i=0;i<e.length;i++)m=e[i],m.ref.impl=m.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&C!==null){e=void 0,i=t,m=C.memoizedProps,C=C.memoizedState,a=i.stateNode;try{var xe=qr(i.type,m);e=a.getSnapshotBeforeUpdate(xe,C),a.__reactInternalSnapshotBeforeUpdate=e}catch(Oe){st(i,i.return,Oe)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,i=e.nodeType,i===9)Tu(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Tu(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(l(163))}if(e=t.sibling,e!==null){e.return=t.return,zt=e;break}zt=t.return}}function fp(e,t,i){var a=i.flags;switch(i.tag){case 0:case 11:case 15:Oi(e,i),a&4&&wa(5,i);break;case 1:if(Oi(e,i),a&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(O){st(i,i.return,O)}else{var m=qr(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(m,t,e.__reactInternalSnapshotBeforeUpdate)}catch(O){st(i,i.return,O)}}a&64&&ap(i),a&512&&xa(i,i.return);break;case 3:if(Oi(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{Xf(e,t)}catch(O){st(i,i.return,O)}}break;case 27:t===null&&a&4&&up(i);case 26:case 5:Oi(e,i),t===null&&a&4&&op(i),a&512&&xa(i,i.return);break;case 12:Oi(e,i);break;case 31:Oi(e,i),a&4&&mp(e,i);break;case 13:Oi(e,i),a&4&&gp(e,i),a&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=Hy.bind(null,i),i0(e,i))));break;case 22:if(a=i.memoizedState!==null||Mi,!a){t=t!==null&&t.memoizedState!==null||Mt,m=Mi;var C=Mt;Mi=a,(Mt=t)&&!C?Bi(e,i,(i.subtreeFlags&8772)!==0):Oi(e,i),Mi=m,Mt=C}break;case 30:break;default:Oi(e,i)}}function dp(e){var t=e.alternate;t!==null&&(e.alternate=null,dp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&qi(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 vt=null,_n=!1;function Li(e,t,i){for(i=i.child;i!==null;)pp(e,t,i),i=i.sibling}function pp(e,t,i){if(yt&&typeof yt.onCommitFiberUnmount=="function")try{yt.onCommitFiberUnmount(bt,i)}catch{}switch(i.tag){case 26:Mt||fi(i,t),Li(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:Mt||fi(i,t);var a=vt,m=_n;dr(i.type)&&(vt=i.stateNode,_n=!1),Li(e,t,i),Oa(i.stateNode),vt=a,_n=m;break;case 5:Mt||fi(i,t);case 6:if(a=vt,m=_n,vt=null,Li(e,t,i),vt=a,_n=m,vt!==null)if(_n)try{(vt.nodeType===9?vt.body:vt.nodeName==="HTML"?vt.ownerDocument.body:vt).removeChild(i.stateNode)}catch(C){st(i,t,C)}else try{vt.removeChild(i.stateNode)}catch(C){st(i,t,C)}break;case 18:vt!==null&&(_n?(e=vt,am(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),js(e)):am(vt,i.stateNode));break;case 4:a=vt,m=_n,vt=i.stateNode.containerInfo,_n=!0,Li(e,t,i),vt=a,_n=m;break;case 0:case 11:case 14:case 15:ar(2,i,t),Mt||ar(4,i,t),Li(e,t,i);break;case 1:Mt||(fi(i,t),a=i.stateNode,typeof a.componentWillUnmount=="function"&&lp(i,t,a)),Li(e,t,i);break;case 21:Li(e,t,i);break;case 22:Mt=(a=Mt)||i.memoizedState!==null,Li(e,t,i),Mt=a;break;default:Li(e,t,i)}}function mp(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{js(e)}catch(i){st(t,t.return,i)}}}function gp(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{js(e)}catch(i){st(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 hp),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new hp),t;default:throw Error(l(435,e.tag))}}function Vl(e,t){var i=Ty(e);t.forEach(function(a){if(!i.has(a)){i.add(a);var m=zy.bind(null,e,a);a.then(m,m)}})}function vn(e,t){var i=t.deletions;if(i!==null)for(var a=0;a<i.length;a++){var m=i[a],C=e,O=t,F=O;e:for(;F!==null;){switch(F.tag){case 27:if(dr(F.type)){vt=F.stateNode,_n=!1;break e}break;case 5:vt=F.stateNode,_n=!1;break e;case 3:case 4:vt=F.stateNode.containerInfo,_n=!0;break e}F=F.return}if(vt===null)throw Error(l(160));pp(C,O,m),vt=null,_n=!1,C=m.alternate,C!==null&&(C.return=null),m.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)_p(t,e),t=t.sibling}var ii=null;function _p(e,t){var i=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:vn(t,e),yn(e),a&4&&(ar(3,e,e.return),wa(3,e),ar(5,e,e.return));break;case 1:vn(t,e),yn(e),a&512&&(Mt||i===null||fi(i,i.return)),a&64&&Mi&&(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=ii;if(vn(t,e),yn(e),a&512&&(Mt||i===null||fi(i,i.return)),a&4){var C=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":C=m.getElementsByTagName("title")[0],(!C||C[Un]||C[At]||C.namespaceURI==="http://www.w3.org/2000/svg"||C.hasAttribute("itemprop"))&&(C=m.createElement(a),m.head.insertBefore(C,m.querySelector("head > title"))),$t(C,a,i),C[At]=e,ut(C),a=C;break e;case"link":var O=_m("link","href",m).get(a+(i.href||""));if(O){for(var F=0;F<O.length;F++)if(C=O[F],C.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&C.getAttribute("rel")===(i.rel==null?null:i.rel)&&C.getAttribute("title")===(i.title==null?null:i.title)&&C.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){O.splice(F,1);break t}}C=m.createElement(a),$t(C,a,i),m.head.appendChild(C);break;case"meta":if(O=_m("meta","content",m).get(a+(i.content||""))){for(F=0;F<O.length;F++)if(C=O[F],C.getAttribute("content")===(i.content==null?null:""+i.content)&&C.getAttribute("name")===(i.name==null?null:i.name)&&C.getAttribute("property")===(i.property==null?null:i.property)&&C.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&C.getAttribute("charset")===(i.charSet==null?null:i.charSet)){O.splice(F,1);break t}}C=m.createElement(a),$t(C,a,i),m.head.appendChild(C);break;default:throw Error(l(468,a))}C[At]=e,ut(C),a=C}e.stateNode=a}else vm(m,e.type,e.stateNode);else e.stateNode=gm(m,a,e.memoizedProps);else C!==a?(C===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):C.count--,a===null?vm(m,e.type,e.stateNode):gm(m,a,e.memoizedProps)):a===null&&e.stateNode!==null&&tu(e,e.memoizedProps,i.memoizedProps)}break;case 27:vn(t,e),yn(e),a&512&&(Mt||i===null||fi(i,i.return)),i!==null&&a&4&&tu(e,e.memoizedProps,i.memoizedProps);break;case 5:if(vn(t,e),yn(e),a&512&&(Mt||i===null||fi(i,i.return)),e.flags&32){m=e.stateNode;try{Ki(m,"")}catch(xe){st(e,e.return,xe)}}a&4&&e.stateNode!=null&&(m=e.memoizedProps,tu(e,m,i!==null?i.memoizedProps:m)),a&1024&&(ru=!0);break;case 6:if(vn(t,e),yn(e),a&4){if(e.stateNode===null)throw Error(l(162));a=e.memoizedProps,i=e.stateNode;try{i.nodeValue=a}catch(xe){st(e,e.return,xe)}}break;case 3:if(oo=null,m=ii,ii=ao(t.containerInfo),vn(t,e),ii=m,yn(e),a&4&&i!==null&&i.memoizedState.isDehydrated)try{js(t.containerInfo)}catch(xe){st(e,e.return,xe)}ru&&(ru=!1,vp(e));break;case 4:a=ii,ii=ao(e.stateNode.containerInfo),vn(t,e),yn(e),ii=a;break;case 12:vn(t,e),yn(e);break;case 31:vn(t,e),yn(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Vl(e,a)));break;case 13:vn(t,e),yn(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(Wl=it()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Vl(e,a)));break;case 22:m=e.memoizedState!==null;var J=i!==null&&i.memoizedState!==null,ce=Mi,me=Mt;if(Mi=ce||m,Mt=me||J,vn(t,e),Mt=me,Mi=ce,yn(e),a&8192)e:for(t=e.stateNode,t._visibility=m?t._visibility&-2:t._visibility|1,m&&(i===null||J||Mi||Mt||$r(e)),i=null,t=e;;){if(t.tag===5||t.tag===26){if(i===null){J=i=t;try{if(C=J.stateNode,m)O=C.style,typeof O.setProperty=="function"?O.setProperty("display","none","important"):O.display="none";else{F=J.stateNode;var _e=J.memoizedProps.style,ue=_e!=null&&_e.hasOwnProperty("display")?_e.display:null;F.style.display=ue==null||typeof ue=="boolean"?"":(""+ue).trim()}}catch(xe){st(J,J.return,xe)}}}else if(t.tag===6){if(i===null){J=t;try{J.stateNode.nodeValue=m?"":J.memoizedProps}catch(xe){st(J,J.return,xe)}}}else if(t.tag===18){if(i===null){J=t;try{var de=J.stateNode;m?lm(de,!0):lm(J.stateNode,!1)}catch(xe){st(J,J.return,xe)}}}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,Vl(e,i))));break;case 19:vn(t,e),yn(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Vl(e,a)));break;case 30:break;case 21:break;default:vn(t,e),yn(e)}}function yn(e){var t=e.flags;if(t&2){try{for(var i,a=e.return;a!==null;){if(cp(a)){i=a;break}a=a.return}if(i==null)throw Error(l(160));switch(i.tag){case 27:var m=i.stateNode,C=nu(e);Gl(e,C,m);break;case 5:var O=i.stateNode;i.flags&32&&(Ki(O,""),i.flags&=-33);var F=nu(e);Gl(e,F,O);break;case 3:case 4:var J=i.stateNode.containerInfo,ce=nu(e);iu(e,ce,J);break;default:throw Error(l(161))}}catch(me){st(e,e.return,me)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function vp(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;vp(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Oi(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)fp(e,t.alternate,t),t=t.sibling}function $r(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:ar(4,t,t.return),$r(t);break;case 1:fi(t,t.return);var i=t.stateNode;typeof i.componentWillUnmount=="function"&&lp(t,t.return,i),$r(t);break;case 27:Oa(t.stateNode);case 26:case 5:fi(t,t.return),$r(t);break;case 22:t.memoizedState===null&&$r(t);break;case 30:$r(t);break;default:$r(t)}e=e.sibling}}function Bi(e,t,i){for(i=i&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,m=e,C=t,O=C.flags;switch(C.tag){case 0:case 11:case 15:Bi(m,C,i),wa(4,C);break;case 1:if(Bi(m,C,i),a=C,m=a.stateNode,typeof m.componentDidMount=="function")try{m.componentDidMount()}catch(ce){st(a,a.return,ce)}if(a=C,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++)Yf(J[m],F)}catch(ce){st(a,a.return,ce)}}i&&O&64&&ap(C),xa(C,C.return);break;case 27:up(C);case 26:case 5:Bi(m,C,i),i&&a===null&&O&4&&op(C),xa(C,C.return);break;case 12:Bi(m,C,i);break;case 31:Bi(m,C,i),i&&O&4&&mp(m,C);break;case 13:Bi(m,C,i),i&&O&4&&gp(m,C);break;case 22:C.memoizedState===null&&Bi(m,C,i),xa(C,C.return);break;case 30:break;default:Bi(m,C,i)}t=t.sibling}}function su(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&&ua(i))}function au(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ua(e))}function ri(e,t,i,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)yp(e,t,i,a),t=t.sibling}function yp(e,t,i,a){var m=t.flags;switch(t.tag){case 0:case 11:case 15:ri(e,t,i,a),m&2048&&wa(9,t);break;case 1:ri(e,t,i,a);break;case 3:ri(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&&ua(e)));break;case 12:if(m&2048){ri(e,t,i,a),e=t.stateNode;try{var C=t.memoizedProps,O=C.id,F=C.onPostCommit;typeof F=="function"&&F(O,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(J){st(t,t.return,J)}}else ri(e,t,i,a);break;case 31:ri(e,t,i,a);break;case 13:ri(e,t,i,a);break;case 23:break;case 22:C=t.stateNode,O=t.alternate,t.memoizedState!==null?C._visibility&2?ri(e,t,i,a):Ea(e,t):C._visibility&2?ri(e,t,i,a):(C._visibility|=2,xs(e,t,i,a,(t.subtreeFlags&10256)!==0||!1)),m&2048&&su(O,t);break;case 24:ri(e,t,i,a),m&2048&&au(t.alternate,t);break;default:ri(e,t,i,a)}}function xs(e,t,i,a,m){for(m=m&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var C=e,O=t,F=i,J=a,ce=O.flags;switch(O.tag){case 0:case 11:case 15:xs(C,O,F,J,m),wa(8,O);break;case 23:break;case 22:var me=O.stateNode;O.memoizedState!==null?me._visibility&2?xs(C,O,F,J,m):Ea(C,O):(me._visibility|=2,xs(C,O,F,J,m)),m&&ce&2048&&su(O.alternate,O);break;case 24:xs(C,O,F,J,m),m&&ce&2048&&au(O.alternate,O);break;default:xs(C,O,F,J,m)}t=t.sibling}}function Ea(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:Ea(i,a),m&2048&&su(a.alternate,a);break;case 24:Ea(i,a),m&2048&&au(a.alternate,a);break;default:Ea(i,a)}t=t.sibling}}var ka=8192;function Es(e,t,i){if(e.subtreeFlags&ka)for(e=e.child;e!==null;)Sp(e,t,i),e=e.sibling}function Sp(e,t,i){switch(e.tag){case 26:Es(e,t,i),e.flags&ka&&e.memoizedState!==null&&m0(i,ii,e.memoizedState,e.memoizedProps);break;case 5:Es(e,t,i);break;case 3:case 4:var a=ii;ii=ao(e.stateNode.containerInfo),Es(e,t,i),ii=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=ka,ka=16777216,Es(e,t,i),ka=a):Es(e,t,i));break;default:Es(e,t,i)}}function bp(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 Aa(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];zt=a,wp(a,e)}bp(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Cp(e),e=e.sibling}function Cp(e){switch(e.tag){case 0:case 11:case 15:Aa(e),e.flags&2048&&ar(9,e,e.return);break;case 3:Aa(e);break;case 12:Aa(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Kl(e)):Aa(e);break;default:Aa(e)}}function Kl(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];zt=a,wp(a,e)}bp(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:ar(8,t,t.return),Kl(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,Kl(t));break;default:Kl(t)}e=e.sibling}}function wp(e,t){for(;zt!==null;){var i=zt;switch(i.tag){case 0:case 11:case 15:ar(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:ua(i.memoizedState.cache)}if(a=i.child,a!==null)a.return=i,zt=a;else e:for(i=e;zt!==null;){a=zt;var m=a.sibling,C=a.return;if(dp(a),a===i){zt=null;break e}if(m!==null){m.return=C,zt=m;break e}zt=C}}}var Dy={getCacheForType:function(e){var t=Ft(Rt),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return Ft(Rt).controller.signal}},My=typeof WeakMap=="function"?WeakMap:Map,nt=0,ht=null,Ge=null,We=0,rt=0,Mn=null,lr=!1,ks=!1,lu=!1,ji=0,wt=0,or=0,Gr=0,ou=0,Ln=0,As=0,Ra=null,Sn=null,cu=!1,Wl=0,xp=0,Yl=1/0,Xl=null,cr=null,Nt=0,ur=null,Rs=null,Ni=0,uu=0,hu=null,Ep=null,Ta=0,fu=null;function On(){return(nt&2)!==0&&We!==0?We&-We:V.T!==null?vu():Jn()}function kp(){if(Ln===0)if((We&536870912)===0||Xe){var e=ai;ai<<=1,(ai&3932160)===0&&(ai=262144),Ln=e}else Ln=536870912;return e=Tn.current,e!==null&&(e.flags|=32),Ln}function bn(e,t,i){(e===ht&&(rt===2||rt===9)||e.cancelPendingCommit!==null)&&(Ts(e,0),hr(e,We,Ln,!1)),fn(e,i),((nt&2)===0||e!==ht)&&(e===ht&&((nt&2)===0&&(Gr|=i),wt===4&&hr(e,We,Ln,!1)),di(e))}function Ap(e,t,i){if((nt&6)!==0)throw Error(l(327));var a=!i&&(t&127)===0&&(t&e.expiredLanes)===0||Qn(e,t),m=a?By(e,t):pu(e,t,!0),C=a;do{if(m===0){ks&&!a&&hr(e,t,0,!1);break}else{if(i=e.current.alternate,C&&!Ly(i)){m=pu(e,t,!1),C=!1;continue}if(m===2){if(C=t,e.errorRecoveryDisabledLanes&C)var O=0;else O=e.pendingLanes&-536870913,O=O!==0?O:O&536870912?536870912:0;if(O!==0){t=O;e:{var F=e;m=Ra;var J=F.current.memoizedState.isDehydrated;if(J&&(Ts(F,O).flags|=256),O=pu(F,O,!1),O!==2){if(lu&&!J){F.errorRecoveryDisabledLanes|=C,Gr|=C,m=4;break e}C=Sn,Sn=m,C!==null&&(Sn===null?Sn=C:Sn.push.apply(Sn,C))}m=O}if(C=!1,m!==2)continue}}if(m===1){Ts(e,0),hr(e,t,0,!0);break}e:{switch(a=e,C=m,C){case 0:case 1:throw Error(l(345));case 4:if((t&4194048)!==t)break;case 6:hr(a,t,Ln,!lr);break e;case 2:Sn=null;break;case 3:case 5:break;default:throw Error(l(329))}if((t&62914560)===t&&(m=Wl+300-it(),10<m)){if(hr(a,t,Ln,!lr),zn(a,0,!0)!==0)break e;Ni=t,a.timeoutHandle=rm(Rp.bind(null,a,i,Sn,Xl,cu,t,Ln,Gr,As,lr,C,"Throttled",-0,0),m);break e}Rp(a,i,Sn,Xl,cu,t,Ln,Gr,As,lr,C,null,-0,0)}}break}while(!0);di(e)}function Rp(e,t,i,a,m,C,O,F,J,ce,me,_e,ue,de){if(e.timeoutHandle=-1,_e=t.subtreeFlags,_e&8192||(_e&16785408)===16785408){_e={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:kn},Sp(t,C,_e);var xe=(C&62914560)===C?Wl-it():(C&4194048)===C?xp-it():0;if(xe=g0(_e,xe),xe!==null){Ni=C,e.cancelPendingCommit=xe(Np.bind(null,e,t,C,i,a,m,O,F,J,me,_e,null,ue,de)),hr(e,C,O,!ce);return}}Np(e,t,C,i,a,m,O,F,J)}function Ly(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],C=m.getSnapshot;m=m.value;try{if(!An(C(),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 hr(e,t,i,a){t&=~ou,t&=~Gr,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var m=t;0<m;){var C=31-tt(m),O=1<<C;a[C]=-1,m&=~O}i!==0&&Ui(e,i,t)}function Ql(){return(nt&6)===0?(Da(0),!1):!0}function du(){if(Ge!==null){if(rt===0)var e=Ge.return;else e=Ge,Ei=Nr=null,Tc(e),ys=null,fa=0,e=Ge;for(;e!==null;)sp(e.alternate,e),e=e.return;Ge=null}}function Ts(e,t){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,Jy(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),Ni=0,du(),ht=e,Ge=i=wi(e.current,null),We=t,rt=0,Mn=null,lr=!1,ks=Qn(e,t),lu=!1,As=Ln=ou=Gr=or=wt=0,Sn=Ra=null,cu=!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-tt(a),C=1<<m;t|=e[m],a&=~C}return ji=t,vl(),i}function Tp(e,t){Ue=null,V.H=Sa,t===vs||t===kl?(t=Gf(),rt=3):t===_c?(t=Gf(),rt=4):rt=t===Gc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Mn=t,Ge===null&&(wt=1,Ul(e,qn(t,e.current)))}function Dp(){var e=Tn.current;return e===null?!0:(We&4194048)===We?Kn===null:(We&62914560)===We||(We&536870912)!==0?e===Kn:!1}function Mp(){var e=V.H;return V.H=Sa,e===null?Sa:e}function Lp(){var e=V.A;return V.A=Dy,e}function Jl(){wt=4,lr||(We&4194048)!==We&&Tn.current!==null||(ks=!0),(or&134217727)===0&&(Gr&134217727)===0||ht===null||hr(ht,We,Ln,!1)}function pu(e,t,i){var a=nt;nt|=2;var m=Mp(),C=Lp();(ht!==e||We!==t)&&(Xl=null,Ts(e,t)),t=!1;var O=wt;e:do try{if(rt!==0&&Ge!==null){var F=Ge,J=Mn;switch(rt){case 8:du(),O=6;break e;case 3:case 2:case 9:case 6:Tn.current===null&&(t=!0);var ce=rt;if(rt=0,Mn=null,Ds(e,F,J,ce),i&&ks){O=0;break e}break;default:ce=rt,rt=0,Mn=null,Ds(e,F,J,ce)}}Oy(),O=wt;break}catch(me){Tp(e,me)}while(!0);return t&&e.shellSuspendCounter++,Ei=Nr=null,nt=a,V.H=m,V.A=C,Ge===null&&(ht=null,We=0,vl()),O}function Oy(){for(;Ge!==null;)Op(Ge)}function By(e,t){var i=nt;nt|=2;var a=Mp(),m=Lp();ht!==e||We!==t?(Xl=null,Yl=it()+500,Ts(e,t)):ks=Qn(e,t);e:do try{if(rt!==0&&Ge!==null){t=Ge;var C=Mn;t:switch(rt){case 1:rt=0,Mn=null,Ds(e,t,C,1);break;case 2:case 9:if(qf(C)){rt=0,Mn=null,Bp(t);break}t=function(){rt!==2&&rt!==9||ht!==e||(rt=7),di(e)},C.then(t,t);break e;case 3:rt=7;break e;case 4:rt=5;break e;case 7:qf(C)?(rt=0,Mn=null,Bp(t)):(rt=0,Mn=null,Ds(e,t,C,7));break;case 5:var O=null;switch(Ge.tag){case 26:O=Ge.memoizedState;case 5:case 27:var F=Ge;if(O?ym(O):F.stateNode.complete){rt=0,Mn=null;var J=F.sibling;if(J!==null)Ge=J;else{var ce=F.return;ce!==null?(Ge=ce,Zl(ce)):Ge=null}break t}}rt=0,Mn=null,Ds(e,t,C,5);break;case 6:rt=0,Mn=null,Ds(e,t,C,6);break;case 8:du(),wt=6;break e;default:throw Error(l(462))}}jy();break}catch(me){Tp(e,me)}while(!0);return Ei=Nr=null,V.H=a,V.A=m,nt=i,Ge!==null?0:(ht=null,We=0,vl(),wt)}function jy(){for(;Ge!==null&&!xn();)Op(Ge)}function Op(e){var t=ip(e.alternate,e,ji);e.memoizedProps=e.pendingProps,t===null?Zl(e):Ge=t}function Bp(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=Qd(i,t,t.pendingProps,t.type,void 0,We);break;case 11:t=Qd(i,t,t.pendingProps,t.type.render,t.ref,We);break;case 5:Tc(t);default:sp(i,t),t=Ge=Lf(t,ji),t=ip(i,t,ji)}e.memoizedProps=e.pendingProps,t===null?Zl(e):Ge=t}function Ds(e,t,i,a){Ei=Nr=null,Tc(t),ys=null,fa=0;var m=t.return;try{if(wy(e,m,t,i,We)){wt=1,Ul(e,qn(i,e.current)),Ge=null;return}}catch(C){if(m!==null)throw Ge=m,C;wt=1,Ul(e,qn(i,e.current)),Ge=null;return}t.flags&32768?(Xe||a===1?e=!0:ks||(We&536870912)!==0?e=!1:(lr=e=!0,(a===2||a===9||a===3||a===6)&&(a=Tn.current,a!==null&&a.tag===13&&(a.flags|=16384))),jp(t,e)):Zl(t)}function Zl(e){var t=e;do{if((t.flags&32768)!==0){jp(t,lr);return}e=t.return;var i=ky(t.alternate,t,ji);if(i!==null){Ge=i;return}if(t=t.sibling,t!==null){Ge=t;return}Ge=t=e}while(t!==null);wt===0&&(wt=5)}function jp(e,t){do{var i=Ay(e.alternate,e);if(i!==null){i.flags&=32767,Ge=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){Ge=e;return}Ge=e=i}while(e!==null);wt=6,Ge=null}function Np(e,t,i,a,m,C,O,F,J){e.cancelPendingCommit=null;do eo();while(Nt!==0);if((nt&6)!==0)throw Error(l(327));if(t!==null){if(t===e.current)throw Error(l(177));if(C=t.lanes|t.childLanes,C|=nc,dn(e,i,C,O,F,J),e===ht&&(Ge=ht=null,We=0),Rs=t,ur=e,Ni=i,uu=C,hu=m,Ep=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Iy(Ae,function(){return Pp(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=V.T,V.T=null,m=K.p,K.p=2,O=nt,nt|=4;try{Ry(e,t,i)}finally{nt=O,K.p=m,V.T=a}}Nt=1,Hp(),zp(),Ip()}}function Hp(){if(Nt===1){Nt=0;var e=ur,t=Rs,i=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||i){i=V.T,V.T=null;var a=K.p;K.p=2;var m=nt;nt|=4;try{_p(t,e);var C=ku,O=wf(e.containerInfo),F=C.focusedElem,J=C.selectionRange;if(O!==F&&F&&F.ownerDocument&&Cf(F.ownerDocument.documentElement,F)){if(J!==null&&Qo(F)){var ce=J.start,me=J.end;if(me===void 0&&(me=ce),"selectionStart"in F)F.selectionStart=ce,F.selectionEnd=Math.min(me,F.value.length);else{var _e=F.ownerDocument||document,ue=_e&&_e.defaultView||window;if(ue.getSelection){var de=ue.getSelection(),xe=F.textContent.length,Oe=Math.min(J.start,xe),ot=J.end===void 0?Oe:Math.min(J.end,xe);!de.extend&&Oe>ot&&(O=ot,ot=Oe,Oe=O);var re=bf(F,Oe),Z=bf(F,ot);if(re&&Z&&(de.rangeCount!==1||de.anchorNode!==re.node||de.anchorOffset!==re.offset||de.focusNode!==Z.node||de.focusOffset!==Z.offset)){var oe=_e.createRange();oe.setStart(re.node,re.offset),de.removeAllRanges(),Oe>ot?(de.addRange(oe),de.extend(Z.node,Z.offset)):(oe.setEnd(Z.node,Z.offset),de.addRange(oe))}}}}for(_e=[],de=F;de=de.parentNode;)de.nodeType===1&&_e.push({element:de,left:de.scrollLeft,top:de.scrollTop});for(typeof F.focus=="function"&&F.focus(),F=0;F<_e.length;F++){var ge=_e[F];ge.element.scrollLeft=ge.left,ge.element.scrollTop=ge.top}}fo=!!Eu,ku=Eu=null}finally{nt=m,K.p=a,V.T=i}}e.current=t,Nt=2}}function zp(){if(Nt===2){Nt=0;var e=ur,t=Rs,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=V.T,V.T=null;var a=K.p;K.p=2;var m=nt;nt|=4;try{fp(e,t.alternate,t)}finally{nt=m,K.p=a,V.T=i}}Nt=3}}function Ip(){if(Nt===4||Nt===3){Nt=0,xt();var e=ur,t=Rs,i=Ni,a=Ep;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Nt=5:(Nt=0,Rs=ur=null,Up(e,e.pendingLanes));var m=e.pendingLanes;if(m===0&&(cr=null),Ks(i),t=t.stateNode,yt&&typeof yt.onCommitFiberRoot=="function")try{yt.onCommitFiberRoot(bt,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=V.T,m=K.p,K.p=2,V.T=null;try{for(var C=e.onRecoverableError,O=0;O<a.length;O++){var F=a[O];C(F.value,{componentStack:F.stack})}}finally{V.T=t,K.p=m}}(Ni&3)!==0&&eo(),di(e),m=e.pendingLanes,(i&261930)!==0&&(m&42)!==0?e===fu?Ta++:(Ta=0,fu=e):Ta=0,Da(0)}}function Up(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ua(t)))}function eo(){return Hp(),zp(),Ip(),Pp()}function Pp(){if(Nt!==5)return!1;var e=ur,t=uu;uu=0;var i=Ks(Ni),a=V.T,m=K.p;try{K.p=32>i?32:i,V.T=null,i=hu,hu=null;var C=ur,O=Ni;if(Nt=0,Rs=ur=null,Ni=0,(nt&6)!==0)throw Error(l(331));var F=nt;if(nt|=4,Cp(C.current),yp(C,C.current,O,i),nt=F,Da(0,!1),yt&&typeof yt.onPostCommitFiberRoot=="function")try{yt.onPostCommitFiberRoot(bt,C)}catch{}return!0}finally{K.p=m,V.T=a,Up(e,t)}}function Fp(e,t,i){t=qn(i,t),t=$c(e.stateNode,t,2),e=ir(e,t,2),e!==null&&(fn(e,2),di(e))}function st(e,t,i){if(e.tag===3)Fp(e,e,i);else for(;t!==null;){if(t.tag===3){Fp(t,e,i);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(cr===null||!cr.has(a))){e=qn(i,e),i=qd(2),a=ir(t,i,2),a!==null&&($d(i,a,t,e),fn(a,2),di(a));break}}t=t.return}}function mu(e,t,i){var a=e.pingCache;if(a===null){a=e.pingCache=new My;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)||(lu=!0,m.add(i),e=Ny.bind(null,e,t,i),t.then(e,e))}function Ny(e,t,i){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,ht===e&&(We&i)===i&&(wt===4||wt===3&&(We&62914560)===We&&300>it()-Wl?(nt&2)===0&&Ts(e,0):ou|=i,As===We&&(As=0)),di(e)}function qp(e,t){t===0&&(t=Yt()),e=Or(e,t),e!==null&&(fn(e,t),di(e))}function Hy(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),qp(e,i)}function zy(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(l(314))}a!==null&&a.delete(t),qp(e,i)}function Iy(e,t){return Vt(e,t)}var to=null,Ms=null,gu=!1,no=!1,_u=!1,fr=0;function di(e){e!==Ms&&e.next===null&&(Ms===null?to=Ms=e:Ms=Ms.next=e),no=!0,gu||(gu=!0,Py())}function Da(e,t){if(!_u&&no){_u=!0;do for(var i=!1,a=to;a!==null;){if(e!==0){var m=a.pendingLanes;if(m===0)var C=0;else{var O=a.suspendedLanes,F=a.pingedLanes;C=(1<<31-tt(42|e)+1)-1,C&=m&~(O&~F),C=C&201326741?C&201326741|1:C?C|2:0}C!==0&&(i=!0,Kp(a,C))}else C=We,C=zn(a,a===ht?C:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(C&3)===0||Qn(a,C)||(i=!0,Kp(a,C));a=a.next}while(i);_u=!1}}function Uy(){$p()}function $p(){no=gu=!1;var e=0;fr!==0&&Qy()&&(e=fr);for(var t=it(),i=null,a=to;a!==null;){var m=a.next,C=Gp(a,t);C===0?(a.next=null,i===null?to=m:i.next=m,m===null&&(Ms=i)):(i=a,(e!==0||(C&3)!==0)&&(no=!0)),a=m}Nt!==0&&Nt!==5||Da(e),fr!==0&&(fr=0)}function Gp(e,t){for(var i=e.suspendedLanes,a=e.pingedLanes,m=e.expirationTimes,C=e.pendingLanes&-62914561;0<C;){var O=31-tt(C),F=1<<O,J=m[O];J===-1?((F&i)===0||(F&a)!==0)&&(m[O]=Ee(F,t)):J<=t&&(e.expiredLanes|=F),C&=~F}if(t=ht,i=We,i=zn(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,i===0||e===t&&(rt===2||rt===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&Kt(a),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||Qn(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(a!==null&&Kt(a),Ks(i)){case 2:case 8:i=Se;break;case 32:i=Ae;break;case 268435456:i=He;break;default:i=Ae}return a=Vp.bind(null,e),i=Vt(i,a),e.callbackPriority=t,e.callbackNode=i,t}return a!==null&&a!==null&&Kt(a),e.callbackPriority=2,e.callbackNode=null,2}function Vp(e,t){if(Nt!==0&&Nt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(eo()&&e.callbackNode!==i)return null;var a=We;return a=zn(e,e===ht?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(Ap(e,a,t),Gp(e,it()),e.callbackNode!=null&&e.callbackNode===i?Vp.bind(null,e):null)}function Kp(e,t){if(eo())return null;Ap(e,t,!0)}function Py(){Zy(function(){(nt&6)!==0?Vt(pe,Uy):$p()})}function vu(){if(fr===0){var e=gs;e===0&&(e=Nn,Nn<<=1,(Nn&261888)===0&&(Nn=256)),fr=e}return fr}function Wp(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Rr(""+e)}function Yp(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 Fy(e,t,i,a,m){if(t==="submit"&&i&&i.stateNode===m){var C=Wp((m[It]||null).action),O=a.submitter;O&&(t=(t=O[It]||null)?Wp(t.formAction):O.getAttribute("formAction"),t!==null&&(C=t,O=null));var F=new Wi("action","action",null,a,m);e.push({event:F,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(fr!==0){var J=O?Yp(m,O):new FormData(m);zc(i,{pending:!0,data:J,method:m.method,action:C},null,J)}}else typeof C=="function"&&(F.preventDefault(),J=O?Yp(m,O):new FormData(m),zc(i,{pending:!0,data:J,method:m.method,action:C},C,J))},currentTarget:m}]})}}for(var yu=0;yu<tc.length;yu++){var Su=tc[yu],qy=Su.toLowerCase(),$y=Su[0].toUpperCase()+Su.slice(1);ni(qy,"on"+$y)}ni(kf,"onAnimationEnd"),ni(Af,"onAnimationIteration"),ni(Rf,"onAnimationStart"),ni("dblclick","onDoubleClick"),ni("focusin","onFocus"),ni("focusout","onBlur"),ni(ay,"onTransitionRun"),ni(ly,"onTransitionStart"),ni(oy,"onTransitionCancel"),ni(Tf,"onTransitionEnd"),Zn("onMouseEnter",["mouseout","mouseover"]),Zn("onMouseLeave",["mouseout","mouseover"]),Zn("onPointerEnter",["pointerout","pointerover"]),Zn("onPointerLeave",["pointerout","pointerover"]),En("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),En("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),En("onBeforeInput",["compositionend","keypress","textInput","paste"]),En("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),En("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),En("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ma="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(" "),Gy=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ma));function Xp(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 C=void 0;if(t)for(var O=a.length-1;0<=O;O--){var F=a[O],J=F.instance,ce=F.currentTarget;if(F=F.listener,J!==C&&m.isPropagationStopped())break e;C=F,m.currentTarget=ce;try{C(m)}catch(me){_l(me)}m.currentTarget=null,C=J}else for(O=0;O<a.length;O++){if(F=a[O],J=F.instance,ce=F.currentTarget,F=F.listener,J!==C&&m.isPropagationStopped())break e;C=F,m.currentTarget=ce;try{C(m)}catch(me){_l(me)}m.currentTarget=null,C=J}}}}function Ve(e,t){var i=t[Ws];i===void 0&&(i=t[Ws]=new Set);var a=e+"__bubble";i.has(a)||(Qp(t,e,2,!1),i.add(a))}function bu(e,t,i){var a=0;t&&(a|=4),Qp(i,e,a,t)}var io="_reactListening"+Math.random().toString(36).slice(2);function Cu(e){if(!e[io]){e[io]=!0,$i.forEach(function(i){i!=="selectionchange"&&(Gy.has(i)||bu(i,!1,e),bu(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[io]||(t[io]=!0,bu("selectionchange",!1,t))}}function Qp(e,t,i,a){switch(km(t)){case 2:var m=y0;break;case 8:m=S0;break;default:m=Hu}i=m.bind(null,t,i,e),m=void 0,!cn||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 wu(e,t,i,a,m){var C=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=St(F),O===null)return;if(J=O.tag,J===5||J===6||J===26||J===27){a=C=O;continue e}F=F.parentNode}}a=a.return}fl(function(){var ce=C,me=ns(i),_e=[];e:{var ue=Df.get(e);if(ue!==void 0){var de=Wi,xe=e;switch(e){case"keypress":if(rs(i)===0)break e;case"keydown":case"keyup":de=zv;break;case"focusin":xe="focus",de=na;break;case"focusout":xe="blur",de=na;break;case"beforeblur":case"afterblur":de=na;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":de=dt;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":de=ci;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":de=Pv;break;case kf:case Af:case Rf:de=ml;break;case Tf:de=qv;break;case"scroll":case"scrollend":de=ta;break;case"wheel":de=Gv;break;case"copy":case"cut":case"paste":de=Mv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":de=lf;break;case"toggle":case"beforetoggle":de=Kv}var Oe=(t&4)!==0,ot=!Oe&&(e==="scroll"||e==="scrollend"),re=Oe?ue!==null?ue+"Capture":null:ue;Oe=[];for(var Z=ce,oe;Z!==null;){var ge=Z;if(oe=ge.stateNode,ge=ge.tag,ge!==5&&ge!==26&&ge!==27||oe===null||re===null||(ge=Tr(Z,re),ge!=null&&Oe.push(La(Z,ge,oe))),ot)break;Z=Z.return}0<Oe.length&&(ue=new de(ue,xe,null,i,me),_e.push({event:ue,listeners:Oe}))}}if((t&7)===0){e:{if(ue=e==="mouseover"||e==="pointerover",de=e==="mouseout"||e==="pointerout",ue&&i!==ts&&(xe=i.relatedTarget||i.fromElement)&&(St(xe)||xe[_i]))break e;if((de||ue)&&(ue=me.window===me?me:(ue=me.ownerDocument)?ue.defaultView||ue.parentWindow:window,de?(xe=i.relatedTarget||i.toElement,de=ce,xe=xe?St(xe):null,xe!==null&&(ot=_(xe),Oe=xe.tag,xe!==ot||Oe!==5&&Oe!==27&&Oe!==6)&&(xe=null)):(de=null,xe=ce),de!==xe)){if(Oe=dt,ge="onMouseLeave",re="onMouseEnter",Z="mouse",(e==="pointerout"||e==="pointerover")&&(Oe=lf,ge="onPointerLeave",re="onPointerEnter",Z="pointer"),ot=de==null?ue:oi(de),oe=xe==null?ue:oi(xe),ue=new Oe(ge,Z+"leave",de,i,me),ue.target=ot,ue.relatedTarget=oe,ge=null,St(me)===ce&&(Oe=new Oe(re,Z+"enter",xe,i,me),Oe.target=oe,Oe.relatedTarget=ot,ge=Oe),ot=ge,de&&xe)t:{for(Oe=Vy,re=de,Z=xe,oe=0,ge=re;ge;ge=Oe(ge))oe++;ge=0;for(var Me=Z;Me;Me=Oe(Me))ge++;for(;0<oe-ge;)re=Oe(re),oe--;for(;0<ge-oe;)Z=Oe(Z),ge--;for(;oe--;){if(re===Z||Z!==null&&re===Z.alternate){Oe=re;break t}re=Oe(re),Z=Oe(Z)}Oe=null}else Oe=null;de!==null&&Jp(_e,ue,de,Oe,!1),xe!==null&&ot!==null&&Jp(_e,ot,xe,Oe,!0)}}e:{if(ue=ce?oi(ce):window,de=ue.nodeName&&ue.nodeName.toLowerCase(),de==="select"||de==="input"&&ue.type==="file")var Ze=mf;else if(df(ue))if(gf)Ze=iy;else{Ze=ty;var Re=ey}else de=ue.nodeName,!de||de.toLowerCase()!=="input"||ue.type!=="checkbox"&&ue.type!=="radio"?ce&&kr(ce.elementType)&&(Ze=mf):Ze=ny;if(Ze&&(Ze=Ze(e,ce))){pf(_e,Ze,i,me);break e}Re&&Re(e,ue,ce),e==="focusout"&&ce&&ue.type==="number"&&ce.memoizedProps.value!=null&&Zs(ue,"number",ue.value)}switch(Re=ce?oi(ce):window,e){case"focusin":(df(Re)||Re.contentEditable==="true")&&(os=Re,Jo=ce,la=null);break;case"focusout":la=Jo=os=null;break;case"mousedown":Zo=!0;break;case"contextmenu":case"mouseup":case"dragend":Zo=!1,xf(_e,i,me);break;case"selectionchange":if(sy)break;case"keydown":case"keyup":xf(_e,i,me)}var Pe;if(Wo)e:{switch(e){case"compositionstart":var Ye="onCompositionStart";break e;case"compositionend":Ye="onCompositionEnd";break e;case"compositionupdate":Ye="onCompositionUpdate";break e}Ye=void 0}else ls?hf(e,i)&&(Ye="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Ye="onCompositionStart");Ye&&(of&&i.locale!=="ko"&&(ls||Ye!=="onCompositionStart"?Ye==="onCompositionEnd"&&ls&&(Pe=Te()):(Pn=me,Dr="value"in Pn?Pn.value:Pn.textContent,ls=!0)),Re=ro(ce,Ye),0<Re.length&&(Ye=new af(Ye,e,null,i,me),_e.push({event:Ye,listeners:Re}),Pe?Ye.data=Pe:(Pe=ff(i),Pe!==null&&(Ye.data=Pe)))),(Pe=Yv?Xv(e,i):Qv(e,i))&&(Ye=ro(ce,"onBeforeInput"),0<Ye.length&&(Re=new af("onBeforeInput","beforeinput",null,i,me),_e.push({event:Re,listeners:Ye}),Re.data=Pe)),Fy(_e,e,ce,i,me)}Xp(_e,t)})}function La(e,t,i){return{instance:e,listener:t,currentTarget:i}}function ro(e,t){for(var i=t+"Capture",a=[];e!==null;){var m=e,C=m.stateNode;if(m=m.tag,m!==5&&m!==26&&m!==27||C===null||(m=Tr(e,i),m!=null&&a.unshift(La(e,m,C)),m=Tr(e,t),m!=null&&a.push(La(e,m,C))),e.tag===3)return a;e=e.return}return[]}function Vy(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Jp(e,t,i,a,m){for(var C=t._reactName,O=[];i!==null&&i!==a;){var F=i,J=F.alternate,ce=F.stateNode;if(F=F.tag,J!==null&&J===a)break;F!==5&&F!==26&&F!==27||ce===null||(J=ce,m?(ce=Tr(i,C),ce!=null&&O.unshift(La(i,ce,J))):m||(ce=Tr(i,C),ce!=null&&O.push(La(i,ce,J)))),i=i.return}O.length!==0&&e.push({event:t,listeners:O})}var Ky=/\r\n?/g,Wy=/\u0000|\uFFFD/g;function Zp(e){return(typeof e=="string"?e:""+e).replace(Ky,`
49
- `).replace(Wy,"")}function em(e,t){return t=Zp(t),Zp(e)===t}function lt(e,t,i,a,m,C){switch(i){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||Ki(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&Ki(e,""+a);break;case"className":Er(e,"class",a);break;case"tabIndex":Er(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":Er(e,i,a);break;case"style":es(e,a,C);break;case"data":if(t!=="object"){Er(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=Rr(""+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 C=="function"&&(i==="formAction"?(t!=="input"&&lt(e,t,"name",m.name,m,null),lt(e,t,"formEncType",m.formEncType,m,null),lt(e,t,"formMethod",m.formMethod,m,null),lt(e,t,"formTarget",m.formTarget,m,null)):(lt(e,t,"encType",m.encType,m,null),lt(e,t,"method",m.method,m,null),lt(e,t,"target",m.target,m,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(i);break}a=Rr(""+a),e.setAttribute(i,a);break;case"onClick":a!=null&&(e.onclick=kn);break;case"onScroll":a!=null&&Ve("scroll",e);break;case"onScrollEnd":a!=null&&Ve("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(l(61));if(i=a.__html,i!=null){if(m.children!=null)throw Error(l(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=Rr(""+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":Ve("beforetoggle",e),Ve("toggle",e),Gi(e,"popover",a);break;case"xlinkActuate":Ut(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":Ut(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":Ut(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":Ut(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":Ut(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":Ut(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":Ut(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":Ut(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":Ut(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":Gi(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=Ar.get(i)||i,Gi(e,i,a))}}function xu(e,t,i,a,m,C){switch(i){case"style":es(e,a,C);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(l(61));if(i=a.__html,i!=null){if(m.children!=null)throw Error(l(60));e.innerHTML=i}}break;case"children":typeof a=="string"?Ki(e,a):(typeof a=="number"||typeof a=="bigint")&&Ki(e,""+a);break;case"onScroll":a!=null&&Ve("scroll",e);break;case"onScrollEnd":a!=null&&Ve("scrollend",e);break;case"onClick":a!=null&&(e.onclick=kn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Jr.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(m=i.endsWith("Capture"),t=i.slice(2,m?i.length-7:void 0),C=e[It]||null,C=C!=null?C[i]:null,typeof C=="function"&&e.removeEventListener(t,C,m),typeof a=="function")){typeof C!="function"&&C!==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,""):Gi(e,i,a)}}}function $t(e,t,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ve("error",e),Ve("load",e);var a=!1,m=!1,C;for(C in i)if(i.hasOwnProperty(C)){var O=i[C];if(O!=null)switch(C){case"src":a=!0;break;case"srcSet":m=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:lt(e,t,C,O,i,null)}}m&&lt(e,t,"srcSet",i.srcSet,i,null),a&&lt(e,t,"src",i.src,i,null);return;case"input":Ve("invalid",e);var F=C=O=m=null,J=null,ce=null;for(a in i)if(i.hasOwnProperty(a)){var me=i[a];if(me!=null)switch(a){case"name":m=me;break;case"type":O=me;break;case"checked":J=me;break;case"defaultChecked":ce=me;break;case"value":C=me;break;case"defaultValue":F=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(l(137,t));break;default:lt(e,t,a,me,i,null)}}ul(e,C,F,J,ce,O,m,!1);return;case"select":Ve("invalid",e),a=O=C=null;for(m in i)if(i.hasOwnProperty(m)&&(F=i[m],F!=null))switch(m){case"value":C=F;break;case"defaultValue":O=F;break;case"multiple":a=F;default:lt(e,t,m,F,i,null)}t=C,i=O,e.multiple=!!a,t!=null?Vi(e,!!a,t,!1):i!=null&&Vi(e,!!a,i,!0);return;case"textarea":Ve("invalid",e),C=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":C=F;break;case"dangerouslySetInnerHTML":if(F!=null)throw Error(l(91));break;default:lt(e,t,O,F,i,null)}ea(e,a,m,C);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:lt(e,t,J,a,i,null)}return;case"dialog":Ve("beforetoggle",e),Ve("toggle",e),Ve("cancel",e),Ve("close",e);break;case"iframe":case"object":Ve("load",e);break;case"video":case"audio":for(a=0;a<Ma.length;a++)Ve(Ma[a],e);break;case"image":Ve("error",e),Ve("load",e);break;case"details":Ve("toggle",e);break;case"embed":case"source":case"link":Ve("error",e),Ve("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(ce in i)if(i.hasOwnProperty(ce)&&(a=i[ce],a!=null))switch(ce){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:lt(e,t,ce,a,i,null)}return;default:if(kr(t)){for(me in i)i.hasOwnProperty(me)&&(a=i[me],a!==void 0&&xu(e,t,me,a,i,void 0));return}}for(F in i)i.hasOwnProperty(F)&&(a=i[F],a!=null&&lt(e,t,F,a,i,null))}function Yy(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,C=null,O=null,F=null,J=null,ce=null,me=null;for(de in i){var _e=i[de];if(i.hasOwnProperty(de)&&_e!=null)switch(de){case"checked":break;case"value":break;case"defaultValue":J=_e;default:a.hasOwnProperty(de)||lt(e,t,de,null,a,_e)}}for(var ue in a){var de=a[ue];if(_e=i[ue],a.hasOwnProperty(ue)&&(de!=null||_e!=null))switch(ue){case"type":C=de;break;case"name":m=de;break;case"checked":ce=de;break;case"defaultChecked":me=de;break;case"value":O=de;break;case"defaultValue":F=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(l(137,t));break;default:de!==_e&&lt(e,t,ue,de,a,_e)}}Zr(e,O,F,J,ce,me,C,m);return;case"select":de=O=F=ue=null;for(C in i)if(J=i[C],i.hasOwnProperty(C)&&J!=null)switch(C){case"value":break;case"multiple":de=J;default:a.hasOwnProperty(C)||lt(e,t,C,null,a,J)}for(m in a)if(C=a[m],J=i[m],a.hasOwnProperty(m)&&(C!=null||J!=null))switch(m){case"value":ue=C;break;case"defaultValue":F=C;break;case"multiple":O=C;default:C!==J&&lt(e,t,m,C,a,J)}t=F,i=O,a=de,ue!=null?Vi(e,!!i,ue,!1):!!a!=!!i&&(t!=null?Vi(e,!!i,t,!0):Vi(e,!!i,i?[]:"",!1));return;case"textarea":de=ue=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:lt(e,t,F,null,a,m)}for(O in a)if(m=a[O],C=i[O],a.hasOwnProperty(O)&&(m!=null||C!=null))switch(O){case"value":ue=m;break;case"defaultValue":de=m;break;case"children":break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(l(91));break;default:m!==C&&lt(e,t,O,m,a,C)}hl(e,ue,de);return;case"option":for(var xe in i)if(ue=i[xe],i.hasOwnProperty(xe)&&ue!=null&&!a.hasOwnProperty(xe))switch(xe){case"selected":e.selected=!1;break;default:lt(e,t,xe,null,a,ue)}for(J in a)if(ue=a[J],de=i[J],a.hasOwnProperty(J)&&ue!==de&&(ue!=null||de!=null))switch(J){case"selected":e.selected=ue&&typeof ue!="function"&&typeof ue!="symbol";break;default:lt(e,t,J,ue,a,de)}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)ue=i[Oe],i.hasOwnProperty(Oe)&&ue!=null&&!a.hasOwnProperty(Oe)&&lt(e,t,Oe,null,a,ue);for(ce in a)if(ue=a[ce],de=i[ce],a.hasOwnProperty(ce)&&ue!==de&&(ue!=null||de!=null))switch(ce){case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(l(137,t));break;default:lt(e,t,ce,ue,a,de)}return;default:if(kr(t)){for(var ot in i)ue=i[ot],i.hasOwnProperty(ot)&&ue!==void 0&&!a.hasOwnProperty(ot)&&xu(e,t,ot,void 0,a,ue);for(me in a)ue=a[me],de=i[me],!a.hasOwnProperty(me)||ue===de||ue===void 0&&de===void 0||xu(e,t,me,ue,a,de);return}}for(var re in i)ue=i[re],i.hasOwnProperty(re)&&ue!=null&&!a.hasOwnProperty(re)&&lt(e,t,re,null,a,ue);for(_e in a)ue=a[_e],de=i[_e],!a.hasOwnProperty(_e)||ue===de||ue==null&&de==null||lt(e,t,_e,ue,a,de)}function tm(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Xy(){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],C=m.transferSize,O=m.initiatorType,F=m.duration;if(C&&F&&tm(O)){for(O=0,F=m.responseEnd,a+=1;a<i.length;a++){var J=i[a],ce=J.startTime;if(ce>F)break;var me=J.transferSize,_e=J.initiatorType;me&&tm(_e)&&(J=J.responseEnd,O+=me*(J<F?1:(F-ce)/(J-ce)))}if(--a,t+=8*(C+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 Eu=null,ku=null;function so(e){return e.nodeType===9?e:e.ownerDocument}function nm(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 im(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 Au(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 Ru=null;function Qy(){var e=window.event;return e&&e.type==="popstate"?e===Ru?!1:(Ru=e,!0):(Ru=null,!1)}var rm=typeof setTimeout=="function"?setTimeout:void 0,Jy=typeof clearTimeout=="function"?clearTimeout:void 0,sm=typeof Promise=="function"?Promise:void 0,Zy=typeof queueMicrotask=="function"?queueMicrotask:typeof sm<"u"?function(e){return sm.resolve(null).then(e).catch(e0)}:rm;function e0(e){setTimeout(function(){throw e})}function dr(e){return e==="head"}function am(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),js(t);return}a--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")a++;else if(i==="html")Oa(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,Oa(i);for(var C=i.firstChild;C;){var O=C.nextSibling,F=C.nodeName;C[Un]||F==="SCRIPT"||F==="STYLE"||F==="LINK"&&C.rel.toLowerCase()==="stylesheet"||i.removeChild(C),C=O}}else i==="body"&&Oa(e.ownerDocument.body);i=m}while(i);js(t)}function lm(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 Tu(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":Tu(i),qi(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function t0(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[Un])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(C=e.getAttribute("rel"),C==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(C!==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(C=e.getAttribute("src"),(C!==(m.src==null?null:m.src)||e.getAttribute("type")!==(m.type==null?null:m.type)||e.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin))&&C&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var C=m.name==null?null:""+m.name;if(m.type==="hidden"&&e.getAttribute("name")===C)return e}else return e;if(e=Wn(e.nextSibling),e===null)break}return null}function n0(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=Wn(e.nextSibling),e===null))return null;return e}function om(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Wn(e.nextSibling),e===null))return null;return e}function Du(e){return e.data==="$?"||e.data==="$~"}function Mu(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function i0(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 Wn(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 Lu=null;function cm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(t===0)return Wn(e.nextSibling);t--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||t++}e=e.nextSibling}return null}function um(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 hm(e,t,i){switch(t=so(i),e){case"html":if(e=t.documentElement,!e)throw Error(l(452));return e;case"head":if(e=t.head,!e)throw Error(l(453));return e;case"body":if(e=t.body,!e)throw Error(l(454));return e;default:throw Error(l(451))}}function Oa(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);qi(e)}var Yn=new Map,fm=new Set;function ao(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Hi=K.d;K.d={f:r0,r:s0,D:a0,C:l0,L:o0,m:c0,X:h0,S:u0,M:f0};function r0(){var e=Hi.f(),t=Ql();return e||t}function s0(e){var t=vi(e);t!==null&&t.tag===5&&t.type==="form"?Td(t):Hi.r(e)}var Ls=typeof document>"u"?null:document;function dm(e,t,i){var a=Ls;if(a&&typeof t=="string"&&t){var m=on(t);m='link[rel="'+e+'"][href="'+m+'"]',typeof i=="string"&&(m+='[crossorigin="'+i+'"]'),fm.has(m)||(fm.add(m),e={rel:e,crossOrigin:i,href:t},a.querySelector(m)===null&&(t=a.createElement("link"),$t(t,"link",e),ut(t),a.head.appendChild(t)))}}function a0(e){Hi.D(e),dm("dns-prefetch",e,null)}function l0(e,t){Hi.C(e,t),dm("preconnect",e,t)}function o0(e,t,i){Hi.L(e,t,i);var a=Ls;if(a&&e&&t){var m='link[rel="preload"][as="'+on(t)+'"]';t==="image"&&i&&i.imageSrcSet?(m+='[imagesrcset="'+on(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(m+='[imagesizes="'+on(i.imageSizes)+'"]')):m+='[href="'+on(e)+'"]';var C=m;switch(t){case"style":C=Os(e);break;case"script":C=Bs(e)}Yn.has(C)||(e=u({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),Yn.set(C,e),a.querySelector(m)!==null||t==="style"&&a.querySelector(Ba(C))||t==="script"&&a.querySelector(ja(C))||(t=a.createElement("link"),$t(t,"link",e),ut(t),a.head.appendChild(t)))}}function c0(e,t){Hi.m(e,t);var i=Ls;if(i&&e){var a=t&&typeof t.as=="string"?t.as:"script",m='link[rel="modulepreload"][as="'+on(a)+'"][href="'+on(e)+'"]',C=m;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":C=Bs(e)}if(!Yn.has(C)&&(e=u({rel:"modulepreload",href:e},t),Yn.set(C,e),i.querySelector(m)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(ja(C)))return}a=i.createElement("link"),$t(a,"link",e),ut(a),i.head.appendChild(a)}}}function u0(e,t,i){Hi.S(e,t,i);var a=Ls;if(a&&e){var m=yi(a).hoistableStyles,C=Os(e);t=t||"default";var O=m.get(C);if(!O){var F={loading:0,preload:null};if(O=a.querySelector(Ba(C)))F.loading=5;else{e=u({rel:"stylesheet",href:e,"data-precedence":t},i),(i=Yn.get(C))&&Ou(e,i);var J=O=a.createElement("link");ut(J),$t(J,"link",e),J._p=new Promise(function(ce,me){J.onload=ce,J.onerror=me}),J.addEventListener("load",function(){F.loading|=1}),J.addEventListener("error",function(){F.loading|=2}),F.loading|=4,lo(O,t,a)}O={type:"stylesheet",instance:O,count:1,state:F},m.set(C,O)}}}function h0(e,t){Hi.X(e,t);var i=Ls;if(i&&e){var a=yi(i).hoistableScripts,m=Bs(e),C=a.get(m);C||(C=i.querySelector(ja(m)),C||(e=u({src:e,async:!0},t),(t=Yn.get(m))&&Bu(e,t),C=i.createElement("script"),ut(C),$t(C,"link",e),i.head.appendChild(C)),C={type:"script",instance:C,count:1,state:null},a.set(m,C))}}function f0(e,t){Hi.M(e,t);var i=Ls;if(i&&e){var a=yi(i).hoistableScripts,m=Bs(e),C=a.get(m);C||(C=i.querySelector(ja(m)),C||(e=u({src:e,async:!0,type:"module"},t),(t=Yn.get(m))&&Bu(e,t),C=i.createElement("script"),ut(C),$t(C,"link",e),i.head.appendChild(C)),C={type:"script",instance:C,count:1,state:null},a.set(m,C))}}function pm(e,t,i,a){var m=(m=he.current)?ao(m):null;if(!m)throw Error(l(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(t=Os(i.href),i=yi(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=Os(i.href);var C=yi(m).hoistableStyles,O=C.get(e);if(O||(m=m.ownerDocument||m,O={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},C.set(e,O),(C=m.querySelector(Ba(e)))&&!C._p&&(O.instance=C,O.state.loading=5),Yn.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},Yn.set(e,i),C||d0(m,e,i,O.state))),t&&a===null)throw Error(l(528,""));return O}if(t&&a!==null)throw Error(l(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Bs(i),i=yi(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(l(444,e))}}function Os(e){return'href="'+on(e)+'"'}function Ba(e){return'link[rel="stylesheet"]['+e+"]"}function mm(e){return u({},e,{"data-precedence":e.precedence,precedence:null})}function d0(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}),$t(t,"link",i),ut(t),e.head.appendChild(t))}function Bs(e){return'[src="'+on(e)+'"]'}function ja(e){return"script[async]"+e}function gm(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+on(i.href)+'"]');if(a)return t.instance=a,ut(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"),ut(a),$t(a,"style",m),lo(a,i.precedence,e),t.instance=a;case"stylesheet":m=Os(i.href);var C=e.querySelector(Ba(m));if(C)return t.state.loading|=4,t.instance=C,ut(C),C;a=mm(i),(m=Yn.get(m))&&Ou(a,m),C=(e.ownerDocument||e).createElement("link"),ut(C);var O=C;return O._p=new Promise(function(F,J){O.onload=F,O.onerror=J}),$t(C,"link",a),t.state.loading|=4,lo(C,i.precedence,e),t.instance=C;case"script":return C=Bs(i.src),(m=e.querySelector(ja(C)))?(t.instance=m,ut(m),m):(a=i,(m=Yn.get(C))&&(a=u({},i),Bu(a,m)),e=e.ownerDocument||e,m=e.createElement("script"),ut(m),$t(m,"link",a),e.head.appendChild(m),t.instance=m);case"void":return null;default:throw Error(l(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,lo(a,i.precedence,e));return t.instance}function lo(e,t,i){for(var a=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=a.length?a[a.length-1]:null,C=m,O=0;O<a.length;O++){var F=a[O];if(F.dataset.precedence===t)C=F;else if(C!==m)break}C?C.parentNode.insertBefore(e,C.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function Ou(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Bu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var oo=null;function _m(e,t,i){if(oo===null){var a=new Map,m=oo=new Map;m.set(i,a)}else m=oo,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 C=i[m];if(!(C[Un]||C[At]||e==="link"&&C.getAttribute("rel")==="stylesheet")&&C.namespaceURI!=="http://www.w3.org/2000/svg"){var O=C.getAttribute(t)||"";O=e+O;var F=a.get(O);F?F.push(C):a.set(O,[C])}}return a}function vm(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function p0(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 ym(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function m0(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=Os(a.href),C=t.querySelector(Ba(m));if(C){t=C._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=co.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=C,ut(C);return}C=t.ownerDocument||t,a=mm(a),(m=Yn.get(m))&&Ou(a,m),C=C.createElement("link"),ut(C);var O=C;O._p=new Promise(function(F,J){O.onload=F,O.onerror=J}),$t(C,"link",a),i.instance=C}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,t),(t=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=co.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var ju=0;function g0(e,t){return e.stylesheets&&e.count===0&&ho(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var a=setTimeout(function(){if(e.stylesheets&&ho(e,e.stylesheets),e.unsuspend){var C=e.unsuspend;e.unsuspend=null,C()}},6e4+t);0<e.imgBytes&&ju===0&&(ju=62500*Xy());var m=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ho(e,e.stylesheets),e.unsuspend)){var C=e.unsuspend;e.unsuspend=null,C()}},(e.imgBytes>ju?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(m)}}:null}function co(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ho(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var uo=null;function ho(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,uo=new Map,t.forEach(_0,e),uo=null,co.call(e))}function _0(e,t){if(!(t.state.loading&4)){var i=uo.get(e);if(i)var a=i.get(null);else{i=new Map,uo.set(e,i);for(var m=e.querySelectorAll("link[data-precedence],style[data-precedence]"),C=0;C<m.length;C++){var O=m[C];(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"),C=i.get(O)||a,C===a&&i.set(null,m),i.set(O,m),this.count++,a=co.bind(this),m.addEventListener("load",a),m.addEventListener("error",a),C?C.parentNode.insertBefore(m,C.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(m,e.firstChild)),t.state.loading|=4}}var Na={$$typeof:b,Provider:null,Consumer:null,_currentValue:ne,_currentValue2:ne,_threadCount:0};function v0(e,t,i,a,m,C,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=In(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=In(0),this.hiddenUpdates=In(null),this.identifierPrefix=a,this.onUncaughtError=m,this.onCaughtError=C,this.onRecoverableError=O,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=J,this.incompleteTransitions=new Map}function Sm(e,t,i,a,m,C,O,F,J,ce,me,_e){return e=new v0(e,t,i,O,J,ce,me,_e,F),t=1,C===!0&&(t|=24),C=Rn(3,null,null,t),e.current=C,C.stateNode=e,t=pc(),t.refCount++,e.pooledCache=t,t.refCount++,C.memoizedState={element:a,isDehydrated:i,cache:t},vc(C),e}function bm(e){return e?(e=hs,e):hs}function Cm(e,t,i,a,m,C){m=bm(m),a.context===null?a.context=m:a.pendingContext=m,a=nr(t),a.payload={element:i},C=C===void 0?null:C,C!==null&&(a.callback=C),i=ir(e,a,t),i!==null&&(bn(i,e,t),pa(i,e,t))}function wm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function Nu(e,t){wm(e,t),(e=e.alternate)&&wm(e,t)}function xm(e){if(e.tag===13||e.tag===31){var t=Or(e,67108864);t!==null&&bn(t,e,67108864),Nu(e,67108864)}}function Em(e){if(e.tag===13||e.tag===31){var t=On();t=Fi(t);var i=Or(e,t);i!==null&&bn(i,e,t),Nu(e,t)}}var fo=!0;function y0(e,t,i,a){var m=V.T;V.T=null;var C=K.p;try{K.p=2,Hu(e,t,i,a)}finally{K.p=C,V.T=m}}function S0(e,t,i,a){var m=V.T;V.T=null;var C=K.p;try{K.p=8,Hu(e,t,i,a)}finally{K.p=C,V.T=m}}function Hu(e,t,i,a){if(fo){var m=zu(a);if(m===null)wu(e,t,a,po,i),Am(e,a);else if(C0(m,e,t,i,a))a.stopPropagation();else if(Am(e,a),t&4&&-1<b0.indexOf(e)){for(;m!==null;){var C=vi(m);if(C!==null)switch(C.tag){case 3:if(C=C.stateNode,C.current.memoizedState.isDehydrated){var O=jt(C.pendingLanes);if(O!==0){var F=C;for(F.pendingLanes|=2,F.entangledLanes|=2;O;){var J=1<<31-tt(O);F.entanglements[1]|=J,O&=~J}di(C),(nt&6)===0&&(Yl=it()+500,Da(0))}}break;case 31:case 13:F=Or(C,2),F!==null&&bn(F,C,2),Ql(),Nu(C,2)}if(C=zu(a),C===null&&wu(e,t,a,po,i),C===m)break;m=C}m!==null&&a.stopPropagation()}else wu(e,t,a,null,i)}}function zu(e){return e=ns(e),Iu(e)}var po=null;function Iu(e){if(po=null,e=St(e),e!==null){var t=_(e);if(t===null)e=null;else{var i=t.tag;if(i===13){if(e=f(t),e!==null)return e;e=null}else if(i===31){if(e=o(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 po=e,null}function km(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(Ot()){case pe:return 2;case Se:return 8;case Ae:case je:return 32;case He:return 268435456;default:return 32}default:return 32}}var Uu=!1,pr=null,mr=null,gr=null,Ha=new Map,za=new Map,_r=[],b0="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 Am(e,t){switch(e){case"focusin":case"focusout":pr=null;break;case"dragenter":case"dragleave":mr=null;break;case"mouseover":case"mouseout":gr=null;break;case"pointerover":case"pointerout":Ha.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":za.delete(t.pointerId)}}function Ia(e,t,i,a,m,C){return e===null||e.nativeEvent!==C?(e={blockedOn:t,domEventName:i,eventSystemFlags:a,nativeEvent:C,targetContainers:[m]},t!==null&&(t=vi(t),t!==null&&xm(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,m!==null&&t.indexOf(m)===-1&&t.push(m),e)}function C0(e,t,i,a,m){switch(t){case"focusin":return pr=Ia(pr,e,t,i,a,m),!0;case"dragenter":return mr=Ia(mr,e,t,i,a,m),!0;case"mouseover":return gr=Ia(gr,e,t,i,a,m),!0;case"pointerover":var C=m.pointerId;return Ha.set(C,Ia(Ha.get(C)||null,e,t,i,a,m)),!0;case"gotpointercapture":return C=m.pointerId,za.set(C,Ia(za.get(C)||null,e,t,i,a,m)),!0}return!1}function Rm(e){var t=St(e.target);if(t!==null){var i=_(t);if(i!==null){if(t=i.tag,t===13){if(t=f(i),t!==null){e.blockedOn=t,al(e.priority,function(){Em(i)});return}}else if(t===31){if(t=o(i),t!==null){e.blockedOn=t,al(e.priority,function(){Em(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 mo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=zu(e.nativeEvent);if(i===null){i=e.nativeEvent;var a=new i.constructor(i.type,i);ts=a,i.target.dispatchEvent(a),ts=null}else return t=vi(i),t!==null&&xm(t),e.blockedOn=i,!1;t.shift()}return!0}function Tm(e,t,i){mo(e)&&i.delete(t)}function w0(){Uu=!1,pr!==null&&mo(pr)&&(pr=null),mr!==null&&mo(mr)&&(mr=null),gr!==null&&mo(gr)&&(gr=null),Ha.forEach(Tm),za.forEach(Tm)}function go(e,t){e.blockedOn===t&&(e.blockedOn=null,Uu||(Uu=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,w0)))}var _o=null;function Dm(e){_o!==e&&(_o=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){_o===e&&(_o=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(Iu(a||i)===null)continue;break}var C=vi(i);C!==null&&(e.splice(t,3),t-=3,zc(C,{pending:!0,data:m,method:i.method,action:a},a,m))}}))}function js(e){function t(J){return go(J,e)}pr!==null&&go(pr,e),mr!==null&&go(mr,e),gr!==null&&go(gr,e),Ha.forEach(t),za.forEach(t);for(var i=0;i<_r.length;i++){var a=_r[i];a.blockedOn===e&&(a.blockedOn=null)}for(;0<_r.length&&(i=_r[0],i.blockedOn===null);)Rm(i),i.blockedOn===null&&_r.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(a=0;a<i.length;a+=3){var m=i[a],C=i[a+1],O=m[It]||null;if(typeof C=="function")O||Dm(i);else if(O){var F=null;if(C&&C.hasAttribute("formAction")){if(m=C,O=C[It]||null)F=O.formAction;else if(Iu(m)!==null)continue}else F=O.action;typeof F=="function"?i[a+1]=F:(i.splice(a,3),a-=3),Dm(i)}}}function Mm(){function e(C){C.canIntercept&&C.info==="react-transition"&&C.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 C=navigation.currentEntry;C&&C.url!=null&&navigation.navigate(C.url,{state:C.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 Pu(e){this._internalRoot=e}vo.prototype.render=Pu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(l(409));var i=t.current,a=On();Cm(i,a,e,t,null,null)},vo.prototype.unmount=Pu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Cm(e.current,2,null,e,null,null),Ql(),t[_i]=null}};function vo(e){this._internalRoot=e}vo.prototype.unstable_scheduleHydration=function(e){if(e){var t=Jn();e={blockedOn:null,target:e,priority:t};for(var i=0;i<_r.length&&t!==0&&t<_r[i].priority;i++);_r.splice(i,0,e),i===0&&Rm(e)}};var Lm=r.version;if(Lm!=="19.2.6")throw Error(l(527,Lm,"19.2.6"));K.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(l(188)):(e=Object.keys(e).join(","),Error(l(268,e)));return e=h(t),e=e!==null?p(e):null,e=e===null?null:e.stateNode,e};var x0={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:V,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var yo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!yo.isDisabled&&yo.supportsFiber)try{bt=yo.inject(x0),yt=yo}catch{}}return Pa.createRoot=function(e,t){if(!d(e))throw Error(l(299));var i=!1,a="",m=Id,C=Ud,O=Pd;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&&(C=t.onCaughtError),t.onRecoverableError!==void 0&&(O=t.onRecoverableError)),t=Sm(e,1,!1,null,null,i,a,null,m,C,O,Mm),e[_i]=t.current,Cu(e),new Pu(t)},Pa.hydrateRoot=function(e,t,i){if(!d(e))throw Error(l(299));var a=!1,m="",C=Id,O=Ud,F=Pd,J=null;return i!=null&&(i.unstable_strictMode===!0&&(a=!0),i.identifierPrefix!==void 0&&(m=i.identifierPrefix),i.onUncaughtError!==void 0&&(C=i.onUncaughtError),i.onCaughtError!==void 0&&(O=i.onCaughtError),i.onRecoverableError!==void 0&&(F=i.onRecoverableError),i.formState!==void 0&&(J=i.formState)),t=Sm(e,1,!0,t,i??null,a,m,J,C,O,F,Mm),t.context=bm(null),i=t.current,a=On(),a=Fi(a),m=nr(a),m.callback=null,ir(i,m,a),i=a,t.current.lanes=i,fn(t,i),di(t),e[_i]=t.current,Cu(e),new vo(t)},Pa.version="19.2.6",Pa}var qm;function N0(){if(qm)return $u.exports;qm=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(r){console.error(r)}}return n(),$u.exports=j0(),$u.exports}var H0=N0();const Xr=function(n,r){let d=n;const _=Ka[r];let f=null,o=0,c=null;const h=[],p={},u=function(T,k){o=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})(o),v(0,0),v(o-7,0),v(0,o-7),E(),R(),S(T,k),d>=7&&y(T),c==null&&(c=A(d,_,h)),g(c,k)},v=function(T,k){for(let M=-1;M<=7;M+=1)if(!(T+M<=-1||o<=T+M))for(let B=-1;B<=7;B+=1)k+B<=-1||o<=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[T+M][k+B]=!0:f[T+M][k+B]=!1)},w=function(){let T=0,k=0;for(let M=0;M<8;M+=1){u(!0,M);const B=Sr.getLostPoint(p);(M==0||T>B)&&(T=B,k=M)}return k},R=function(){for(let T=8;T<o-8;T+=1)f[T][6]==null&&(f[T][6]=T%2==0);for(let T=8;T<o-8;T+=1)f[6][T]==null&&(f[6][T]=T%2==0)},E=function(){const T=Sr.getPatternPosition(d);for(let k=0;k<T.length;k+=1)for(let M=0;M<T.length;M+=1){const B=T[k],H=T[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}},y=function(T){const k=Sr.getBCHTypeNumber(d);for(let M=0;M<18;M+=1){const B=!T&&(k>>M&1)==1;f[Math.floor(M/3)][M%3+o-8-3]=B}for(let M=0;M<18;M+=1){const B=!T&&(k>>M&1)==1;f[M%3+o-8-3][Math.floor(M/3)]=B}},S=function(T,k){const M=_<<3|k,B=Sr.getBCHTypeInfo(M);for(let H=0;H<15;H+=1){const U=!T&&(B>>H&1)==1;H<6?f[H][8]=U:H<8?f[H+1][8]=U:f[o-15+H][8]=U}for(let H=0;H<15;H+=1){const U=!T&&(B>>H&1)==1;H<8?f[8][o-H-1]=U:H<9?f[8][15-H-1+1]=U:f[8][15-H-1]=U}f[o-8][8]=!T},g=function(T,k){let M=-1,B=o-1,H=7,U=0;const P=Sr.getMaskFunction(k);for(let Y=o-1;Y>0;Y-=2)for(Y==6&&(Y-=1);;){for(let X=0;X<2;X+=1)if(f[B][Y-X]==null){let V=!1;U<T.length&&(V=(T[U]>>>H&1)==1),P(B,Y-X)&&(V=!V),f[B][Y-X]=V,H-=1,H==-1&&(U+=1,H=7)}if(B+=M,B<0||o<=B){B-=M,M=-M;break}}},b=function(T,k){let M=0,B=0,H=0;const U=new Array(k.length),P=new Array(k.length);for(let K=0;K<k.length;K+=1){const ne=k[K].dataCount,z=k[K].totalCount-ne;B=Math.max(B,ne),H=Math.max(H,z),U[K]=new Array(ne);for(let I=0;I<U[K].length;I+=1)U[K][I]=255&T.getBuffer()[I+M];M+=ne;const j=Sr.getErrorCorrectPolynomial(z),$=Ja(U[K],j.getLength()-1).mod(j);P[K]=new Array(j.getLength()-1);for(let I=0;I<P[K].length;I+=1){const se=I+$.getLength()-P[K].length;P[K][I]=se>=0?$.getAt(se):0}}let Y=0;for(let K=0;K<k.length;K+=1)Y+=k[K].totalCount;const X=new Array(Y);let V=0;for(let K=0;K<B;K+=1)for(let ne=0;ne<k.length;ne+=1)K<U[ne].length&&(X[V]=U[ne][K],V+=1);for(let K=0;K<H;K+=1)for(let ne=0;ne<k.length;ne+=1)K<P[ne].length&&(X[V]=P[ne][K],V+=1);return X},A=function(T,k,M){const B=$m.getRSBlocks(T,k),H=Gm();for(let P=0;P<M.length;P+=1){const Y=M[P];H.put(Y.getMode(),4),H.put(Y.getLength(),Sr.getLengthInBits(Y.getMode(),T)),Y.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 b(H,B)};p.addData=function(T,k){k=k||"Byte";let M=null;switch(k){case"Numeric":M=z0(T);break;case"Alphanumeric":M=I0(T);break;case"Byte":M=U0(T);break;case"Kanji":M=P0(T);break;default:throw"mode:"+k}h.push(M),c=null},p.isDark=function(T,k){if(T<0||o<=T||k<0||o<=k)throw T+","+k;return f[T][k]},p.getModuleCount=function(){return o},p.make=function(){if(d<1){let T=1;for(;T<40;T++){const k=$m.getRSBlocks(T,_),M=Gm();for(let H=0;H<h.length;H++){const U=h[H];M.put(U.getMode(),4),M.put(U.getLength(),Sr.getLengthInBits(U.getMode(),T)),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=T}u(!1,w())},p.createTableTag=function(T,k){T=T||2,k=typeof k>"u"?T*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: "+T+"px;",M+=" height: "+T+"px;",M+=" background-color: ",M+=p.isDark(B,H)?"#000000":"#ffffff",M+=";",M+='"/>';M+="</tr>"}return M+="</tbody>",M+="</table>",M},p.createSvgTag=function(T,k,M,B){let H={};typeof arguments[0]=="object"&&(H=arguments[0],T=H.cellSize,k=H.margin,M=H.alt,B=H.title),T=T||2,k=typeof k>"u"?T*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()*T+k*2;let P,Y,X,V,K="",ne;for(ne="l"+T+",0 0,"+T+" -"+T+",0 0,-"+T+"z ",K+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',K+=H.scalable?"":' width="'+U+'px" height="'+U+'px"',K+=' viewBox="0 0 '+U+" "+U+'" ',K+=' preserveAspectRatio="xMinYMin meet"',K+=B.text||M.text?' role="img" aria-labelledby="'+L([B.id,M.id].join(" ").trim())+'"':"",K+=">",K+=B.text?'<title id="'+L(B.id)+'">'+L(B.text)+"</title>":"",K+=M.text?'<description id="'+L(M.id)+'">'+L(M.text)+"</description>":"",K+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',K+='<path d="',X=0;X<p.getModuleCount();X+=1)for(V=X*T+k,P=0;P<p.getModuleCount();P+=1)p.isDark(X,P)&&(Y=P*T+k,K+="M"+Y+","+V+ne);return K+='" stroke="transparent" fill="black"/>',K+="</svg>",K},p.createDataURL=function(T,k){T=T||2,k=typeof k>"u"?T*4:k;const M=p.getModuleCount()*T+k*2,B=k,H=M-k;return G0(M,M,function(U,P){if(B<=U&&U<H&&B<=P&&P<H){const Y=Math.floor((U-B)/T),X=Math.floor((P-B)/T);return p.isDark(X,Y)?0:1}else return 1})},p.createImgTag=function(T,k,M){T=T||2,k=typeof k>"u"?T*4:k;const B=p.getModuleCount()*T+k*2;let H="";return H+="<img",H+=' src="',H+=p.createDataURL(T,k),H+='"',H+=' width="',H+=B,H+='"',H+=' height="',H+=B,H+='"',M&&(H+=' alt="',H+=L(M),H+='"'),H+="/>",H};const L=function(T){let k="";for(let M=0;M<T.length;M+=1){const B=T.charAt(M);switch(B){case"<":k+="&lt;";break;case">":k+="&gt;";break;case"&":k+="&amp;";break;case'"':k+="&quot;";break;default:k+=B;break}}return k},D=function(T){T=typeof T>"u"?2:T;const M=p.getModuleCount()*1+T*2,B=T,H=M-T;let U,P,Y,X,V;const K={"██":"█","█ ":"▀"," █":"▄"," ":" "},ne={"██":"▀","█ ":"▀"," █":" "," ":" "};let z="";for(U=0;U<M;U+=2){for(Y=Math.floor((U-B)/1),X=Math.floor((U+1-B)/1),P=0;P<M;P+=1)V="█",B<=P&&P<H&&B<=U&&U<H&&p.isDark(Y,Math.floor((P-B)/1))&&(V=" "),B<=P&&P<H&&B<=U+1&&U+1<H&&p.isDark(X,Math.floor((P-B)/1))?V+=" ":V+="█",z+=T<1&&U+1>=H?ne[V]:K[V];z+=`
48
+ `+a.stack}}var sn=Object.prototype.hasOwnProperty,Nt=n.unstable_scheduleCallback,dn=n.unstable_cancelCallback,En=n.unstable_shouldYield,wt=n.unstable_requestPaint,it=n.unstable_now,Ot=n.unstable_getCurrentPriorityLevel,pe=n.unstable_ImmediatePriority,Se=n.unstable_UserBlockingPriority,ke=n.unstable_NormalPriority,Oe=n.unstable_LowPriority,He=n.unstable_IdlePriority,_t=n.log,qe=n.unstable_setDisableYieldValue,St=null,yt=null;function Bt(e){if(typeof _t=="function"&&qe(e),yt&&typeof yt.setStrictMode=="function")try{yt.setStrictMode(St,e)}catch{}}var Ze=Math.clz32?Math.clz32:Ut,an=Math.log,we=Math.LN2;function Ut(e){return e>>>=0,e===0?32:31-(an(e)/we|0)|0}var Yn=256,Xn=262144,Pt=4194304;function pn(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 Qn(e,t,i){var a=e.pendingLanes;if(a===0)return 0;var m=0,C=e.suspendedLanes,O=e.pingedLanes;e=e.warmLanes;var F=a&134217727;return F!==0?(a=F&~C,a!==0?m=pn(a):(O&=F,O!==0?m=pn(O):i||(i=F&~e,i!==0&&(m=pn(i))))):(F=a&~C,F!==0?m=pn(F):O!==0?m=pn(O):i||(i=a&~e,i!==0&&(m=pn(i)))),m===0?0:t!==0&&t!==m&&(t&C)===0&&(C=m&-m,i=t&-t,C>=i||C===32&&(i&4194048)!==0)?t:m}function Xt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Re(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 Ht(){var e=Pt;return Pt<<=1,(Pt&62914560)===0&&(Pt=4194304),e}function kn(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function Ft(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ui(e,t,i,a,m,C){var O=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var F=e.entanglements,J=e.expirationTimes,ce=e.hiddenUpdates;for(i=O&~i;0<i;){var me=31-Ze(i),_e=1<<me;F[me]=0,J[me]=-1;var ue=ce[me];if(ue!==null)for(ce[me]=null,me=0;me<ue.length;me++){var de=ue[me];de!==null&&(de.lane&=-536870913)}i&=~_e}a!==0&&Ue(e,a,0),C!==0&&m===0&&e.tag!==0&&(e.suspendedLanes|=C&~(O&~t))}function Ue(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-Ze(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|i&261930}function gi(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var a=31-Ze(i),m=1<<a;m&t|e[a]&t&&(e[a]|=t),i&=~m}}function Xr(e,t){var i=t&-t;return i=(i&42)!==0?1:Pi(i),(i&(e.suspendedLanes|t))!==0?0:i}function Pi(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 Ks(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Jn(){var e=K.p;return e!==0?e:(e=window.event,e===void 0?32:km(e.type))}function sl(e,t){var i=K.p;try{return K.p=e,t()}finally{K.p=i}}var ai=Math.random().toString(36).slice(2),At="__reactFiber$"+ai,qt="__reactProps$"+ai,_i="__reactContainer$"+ai,Ws="__reactEvents$"+ai,Fo="__reactListeners$"+ai,al="__reactHandles$"+ai,ll="__reactResources$"+ai,zn="__reactMarker$"+ai;function Qr(e){delete e[At],delete e[qt],delete e[Ws],delete e[Fo],delete e[al]}function xt(e){var t=e[At];if(t)return t;for(var i=e.parentNode;i;){if(t=i[_i]||i[At]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=um(e);e!==null;){if(i=e[At])return i;e=um(e)}return t}e=i,i=e.parentNode}return null}function vi(e){if(e=e[At]||e[_i]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function li(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(l(33))}function yi(e){var t=e[ll];return t||(t=e[ll]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function ut(e){e[zn]=!0}var Fi=new Set,Jr={};function An(e,t){Zn(e,t),Zn(e+"Capture",t)}function Zn(e,t){for(Jr[e]=t,e=0;e<t.length;e++)Fi.add(t[e])}var Ys=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]*$"),Xs={},Q={};function mn(e){return sn.call(Q,e)?!0:sn.call(Xs,e)?!1:Ys.test(e)?Q[e]=!0:(Xs[e]=!0,!1)}function qi(e,t,i){if(mn(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 wr(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 $t(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 Qt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Qs(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function qo(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,C=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return m.call(this)},set:function(O){i=""+O,C.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 Js(e){if(!e._valueTracker){var t=Qs(e)?"checked":"value";e._valueTracker=qo(e,t,""+e[t])}}function ln(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),a="";return e&&(a=Qs(e)?e.checked?"true":"false":e.value),e=a,e!==i?(t.setValue(e),!0):!1}function on(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 ol=/[\n"\\]/g;function cn(e){return e.replace(ol,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Zr(e,t,i,a,m,C,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=""+Qt(t)):e.value!==""+Qt(t)&&(e.value=""+Qt(t)):O!=="submit"&&O!=="reset"||e.removeAttribute("value"),t!=null?Zs(e,O,Qt(t)):i!=null?Zs(e,O,Qt(i)):a!=null&&e.removeAttribute("value"),m==null&&C!=null&&(e.defaultChecked=!!C),m!=null&&(e.checked=m&&typeof m!="function"&&typeof m!="symbol"),F!=null&&typeof F!="function"&&typeof F!="symbol"&&typeof F!="boolean"?e.name=""+Qt(F):e.removeAttribute("name")}function cl(e,t,i,a,m,C,O,F){if(C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(e.type=C),t!=null||i!=null){if(!(C!=="submit"&&C!=="reset"||t!=null)){Js(e);return}i=i!=null?""+Qt(i):"",t=t!=null?""+Qt(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),Js(e)}function Zs(e,t,i){t==="number"&&on(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function $i(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=""+Qt(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 ul(e,t,i){if(t!=null&&(t=""+Qt(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+Qt(i):""}function ea(e,t,i,a){if(t==null){if(a!=null){if(i!=null)throw Error(l(92));if(X(a)){if(1<a.length)throw Error(l(93));a=a[0]}i=a}i==null&&(i=""),t=i}i=Qt(t),e.defaultValue=i,a=e.textContent,a===i&&a!==""&&a!==null&&(e.value=a),Js(e)}function Gi(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var $o=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 Si(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||$o.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function es(e,t,i){if(t!=null&&typeof t!="object")throw Error(l(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&&Si(e,m,a)}else for(var C in t)t.hasOwnProperty(C)&&Si(e,C,t[C])}function xr(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 Er=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"]]),Go=/^[\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 kr(e){return Go.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Rn(){}var ts=null;function ns(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Jt=null,bi=null;function ei(e){var t=vi(e);if(t&&(e=t.stateNode)){var i=e[qt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Zr(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="'+cn(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var a=i[t];if(a!==e&&a.form===e.form){var m=a[qt]||null;if(!m)throw Error(l(90));Zr(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&&ln(a)}break e;case"textarea":ul(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&$i(e,!!i.multiple,t,!1)}}}var gn=!1;function hl(e,t,i){if(gn)return e(t,i);gn=!0;try{var a=e(t);return a}finally{if(gn=!1,(Jt!==null||bi!==null)&&(Xl(),Jt&&(t=Jt,e=bi,bi=Jt=null,ei(t),e)))for(t=0;t<e.length;t++)ei(e[t])}}function Ar(e,t){var i=e.stateNode;if(i===null)return null;var a=i[qt]||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(l(231,t,typeof i));return i}var ti=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),un=!1;if(ti)try{var Ci={};Object.defineProperty(Ci,"passive",{get:function(){un=!0}}),window.addEventListener("test",Ci,Ci),window.removeEventListener("test",Ci,Ci)}catch{un=!1}var In=null,Rr=null,is=null;function Te(){if(is)return is;var e,t=Rr,i=t.length,a,m="value"in In?In.value:In.textContent,C=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[C-a];a++);return is=m.slice(e,1<a?1-a:void 0)}function rs(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 ss(){return!0}function fl(){return!1}function Zt(e){function t(i,a,m,C,O){this._reactName=i,this._targetInst=m,this.type=a,this.nativeEvent=C,this.target=O,this.currentTarget=null;for(var F in e)e.hasOwnProperty(F)&&(i=e[F],this[F]=i?i(C):C[F]);return this.isDefaultPrevented=(C.defaultPrevented!=null?C.defaultPrevented:C.returnValue===!1)?ss:fl,this.isPropagationStopped=fl,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=ss)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=ss)},persist:function(){},isPersistent:ss}),t}var zt={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Vi=Zt(zt),Ki=u({},zt,{view:0,detail:0}),ta=Zt(Ki),as,G,fe,$e=u({},Ki,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Vo,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!==fe&&(fe&&e.type==="mousemove"?(as=e.screenX-fe.screenX,G=e.screenY-fe.screenY):G=as=0,fe=e),as)},movementY:function(e){return"movementY"in e?e.movementY:G}}),dt=Zt($e),_n=u({},$e,{dataTransfer:0}),oi=Zt(_n),Wi=u({},Ki,{relatedTarget:0}),na=Zt(Wi),dl=u({},zt,{animationName:0,elapsedTime:0,pseudoElement:0}),pl=Zt(dl),Dv=u({},zt,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Mv=Zt(Dv),Lv=u({},zt,{data:0}),af=Zt(Lv),Ov={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Bv={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"},jv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Nv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=jv[e])?!!t[e]:!1}function Vo(){return Nv}var Hv=u({},Ki,{key:function(e){if(e.key){var t=Ov[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=rs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Bv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Vo,charCode:function(e){return e.type==="keypress"?rs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?rs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),zv=Zt(Hv),Iv=u({},$e,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),lf=Zt(Iv),Uv=u({},Ki,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Vo}),Pv=Zt(Uv),Fv=u({},zt,{propertyName:0,elapsedTime:0,pseudoElement:0}),qv=Zt(Fv),$v=u({},$e,{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}),Gv=Zt($v),Vv=u({},zt,{newState:0,oldState:0}),Kv=Zt(Vv),Wv=[9,13,27,32],Ko=ti&&"CompositionEvent"in window,ia=null;ti&&"documentMode"in document&&(ia=document.documentMode);var Yv=ti&&"TextEvent"in window&&!ia,of=ti&&(!Ko||ia&&8<ia&&11>=ia),cf=" ",uf=!1;function hf(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 ff(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ls=!1;function Xv(e,t){switch(e){case"compositionend":return ff(t);case"keypress":return t.which!==32?null:(uf=!0,cf);case"textInput":return e=t.data,e===cf&&uf?null:e;default:return null}}function Qv(e,t){if(ls)return e==="compositionend"||!Ko&&hf(e,t)?(e=Te(),is=Rr=In=null,ls=!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 of&&t.locale!=="ko"?null:t.data;default:return null}}var Jv={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 df(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Jv[e.type]:t==="textarea"}function pf(e,t,i,a){Jt?bi?bi.push(a):bi=[a]:Jt=a,t=io(t,"onChange"),0<t.length&&(i=new Vi("onChange","change",null,i,a),e.push({event:i,listeners:t}))}var ra=null,sa=null;function Zv(e){Xp(e,0)}function ml(e){var t=li(e);if(ln(t))return e}function mf(e,t){if(e==="change")return t}var gf=!1;if(ti){var Wo;if(ti){var Yo="oninput"in document;if(!Yo){var _f=document.createElement("div");_f.setAttribute("oninput","return;"),Yo=typeof _f.oninput=="function"}Wo=Yo}else Wo=!1;gf=Wo&&(!document.documentMode||9<document.documentMode)}function vf(){ra&&(ra.detachEvent("onpropertychange",yf),sa=ra=null)}function yf(e){if(e.propertyName==="value"&&ml(sa)){var t=[];pf(t,sa,e,ns(e)),hl(Zv,t)}}function ey(e,t,i){e==="focusin"?(vf(),ra=t,sa=i,ra.attachEvent("onpropertychange",yf)):e==="focusout"&&vf()}function ty(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ml(sa)}function ny(e,t){if(e==="click")return ml(t)}function iy(e,t){if(e==="input"||e==="change")return ml(t)}function ry(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Tn=typeof Object.is=="function"?Object.is:ry;function aa(e,t){if(Tn(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(!sn.call(t,m)||!Tn(e[m],t[m]))return!1}return!0}function Sf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function bf(e,t){var i=Sf(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=Sf(i)}}function Cf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Cf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function wf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=on(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=on(e.document)}return t}function Xo(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 sy=ti&&"documentMode"in document&&11>=document.documentMode,os=null,Qo=null,la=null,Jo=!1;function xf(e,t,i){var a=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Jo||os==null||os!==on(a)||(a=os,"selectionStart"in a&&Xo(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}),la&&aa(la,a)||(la=a,a=io(Qo,"onSelect"),0<a.length&&(t=new Vi("onSelect","select",null,t,i),e.push({event:t,listeners:a}),t.target=os)))}function Tr(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var cs={animationend:Tr("Animation","AnimationEnd"),animationiteration:Tr("Animation","AnimationIteration"),animationstart:Tr("Animation","AnimationStart"),transitionrun:Tr("Transition","TransitionRun"),transitionstart:Tr("Transition","TransitionStart"),transitioncancel:Tr("Transition","TransitionCancel"),transitionend:Tr("Transition","TransitionEnd")},Zo={},Ef={};ti&&(Ef=document.createElement("div").style,"AnimationEvent"in window||(delete cs.animationend.animation,delete cs.animationiteration.animation,delete cs.animationstart.animation),"TransitionEvent"in window||delete cs.transitionend.transition);function Dr(e){if(Zo[e])return Zo[e];if(!cs[e])return e;var t=cs[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in Ef)return Zo[e]=t[i];return e}var kf=Dr("animationend"),Af=Dr("animationiteration"),Rf=Dr("animationstart"),ay=Dr("transitionrun"),ly=Dr("transitionstart"),oy=Dr("transitioncancel"),Tf=Dr("transitionend"),Df=new Map,ec="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(" ");ec.push("scrollEnd");function ni(e,t){Df.set(e,t),An(t,[e])}var gl=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)},Un=[],us=0,tc=0;function _l(){for(var e=us,t=tc=us=0;t<e;){var i=Un[t];Un[t++]=null;var a=Un[t];Un[t++]=null;var m=Un[t];Un[t++]=null;var C=Un[t];if(Un[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}C!==0&&Mf(i,m,C)}}function vl(e,t,i,a){Un[us++]=e,Un[us++]=t,Un[us++]=i,Un[us++]=a,tc|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function nc(e,t,i,a){return vl(e,t,i,a),yl(e)}function Mr(e,t){return vl(e,null,null,t),yl(e)}function Mf(e,t,i){e.lanes|=i;var a=e.alternate;a!==null&&(a.lanes|=i);for(var m=!1,C=e.return;C!==null;)C.childLanes|=i,a=C.alternate,a!==null&&(a.childLanes|=i),C.tag===22&&(e=C.stateNode,e===null||e._visibility&1||(m=!0)),e=C,C=C.return;return e.tag===3?(C=e.stateNode,m&&t!==null&&(m=31-Ze(i),e=C.hiddenUpdates,a=e[m],a===null?e[m]=[t]:a.push(t),t.lane=i|536870912),C):null}function yl(e){if(50<Ta)throw Ta=0,hu=null,Error(l(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var hs={};function cy(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 Dn(e,t,i,a){return new cy(e,t,i,a)}function ic(e){return e=e.prototype,!(!e||!e.isReactComponent)}function wi(e,t){var i=e.alternate;return i===null?(i=Dn(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 Lf(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 Sl(e,t,i,a,m,C){var O=0;if(a=e,typeof e=="function")ic(e)&&(O=1);else if(typeof e=="string")O=p0(e,i,se.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case M:return e=Dn(31,i,t,m),e.elementType=M,e.lanes=C,e;case E:return Lr(i.children,m,C,t);case v:O=8,m|=24;break;case y:return e=Dn(12,i,t,m|2),e.elementType=y,e.lanes=C,e;case L:return e=Dn(13,i,t,m),e.elementType=L,e.lanes=C,e;case D:return e=Dn(19,i,t,m),e.elementType=D,e.lanes=C,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case S:O=10;break e;case _:O=9;break e;case A:O=11;break e;case T:O=14;break e;case k:O=16,a=null;break e}O=29,i=Error(l(130,e===null?"null":typeof e,"")),a=null}return t=Dn(O,i,t,m),t.elementType=e,t.type=a,t.lanes=C,t}function Lr(e,t,i,a){return e=Dn(7,e,a,t),e.lanes=i,e}function rc(e,t,i){return e=Dn(6,e,null,t),e.lanes=i,e}function Of(e){var t=Dn(18,null,null,0);return t.stateNode=e,t}function sc(e,t,i){return t=Dn(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Bf=new WeakMap;function Pn(e,t){if(typeof e=="object"&&e!==null){var i=Bf.get(e);return i!==void 0?i:(t={value:e,source:t,stack:Yt(t)},Bf.set(e,t),t)}return{value:e,source:t,stack:Yt(t)}}var fs=[],ds=0,bl=null,oa=0,Fn=[],qn=0,Yi=null,ci=1,ui="";function xi(e,t){fs[ds++]=oa,fs[ds++]=bl,bl=e,oa=t}function jf(e,t,i){Fn[qn++]=ci,Fn[qn++]=ui,Fn[qn++]=Yi,Yi=e;var a=ci;e=ui;var m=32-Ze(a)-1;a&=~(1<<m),i+=1;var C=32-Ze(t)+m;if(30<C){var O=m-m%5;C=(a&(1<<O)-1).toString(32),a>>=O,m-=O,ci=1<<32-Ze(t)+m|i<<m|a,ui=C+e}else ci=1<<C|i<<m|a,ui=e}function ac(e){e.return!==null&&(xi(e,1),jf(e,1,0))}function lc(e){for(;e===bl;)bl=fs[--ds],fs[ds]=null,oa=fs[--ds],fs[ds]=null;for(;e===Yi;)Yi=Fn[--qn],Fn[qn]=null,ui=Fn[--qn],Fn[qn]=null,ci=Fn[--qn],Fn[qn]=null}function Nf(e,t){Fn[qn++]=ci,Fn[qn++]=ui,Fn[qn++]=Yi,ci=t.id,ui=t.overflow,Yi=e}var Gt=null,mt=null,Xe=!1,Xi=null,$n=!1,oc=Error(l(519));function Qi(e){var t=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ca(Pn(t,e)),oc}function Hf(e){var t=e.stateNode,i=e.type,a=e.memoizedProps;switch(t[At]=e,t[qt]=a,i){case"dialog":Ve("cancel",t),Ve("close",t);break;case"iframe":case"object":case"embed":Ve("load",t);break;case"video":case"audio":for(i=0;i<Ma.length;i++)Ve(Ma[i],t);break;case"source":Ve("error",t);break;case"img":case"image":case"link":Ve("error",t),Ve("load",t);break;case"details":Ve("toggle",t);break;case"input":Ve("invalid",t),cl(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":Ve("invalid",t);break;case"textarea":Ve("invalid",t),ea(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||em(t.textContent,i)?(a.popover!=null&&(Ve("beforetoggle",t),Ve("toggle",t)),a.onScroll!=null&&Ve("scroll",t),a.onScrollEnd!=null&&Ve("scrollend",t),a.onClick!=null&&(t.onclick=Rn),t=!0):t=!1,t||Qi(e,!0)}function zf(e){for(Gt=e.return;Gt;)switch(Gt.tag){case 5:case 31:case 13:$n=!1;return;case 27:case 3:$n=!0;return;default:Gt=Gt.return}}function ps(e){if(e!==Gt)return!1;if(!Xe)return zf(e),Xe=!0,!1;var t=e.tag,i;if((i=t!==3&&t!==27)&&((i=t===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||ku(e.type,e.memoizedProps)),i=!i),i&&mt&&Qi(e),zf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));mt=cm(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));mt=cm(e)}else t===27?(t=mt,hr(e.type)?(e=Mu,Mu=null,mt=e):mt=t):mt=Gt?Vn(e.stateNode.nextSibling):null;return!0}function Or(){mt=Gt=null,Xe=!1}function cc(){var e=Xi;return e!==null&&(bn===null?bn=e:bn.push.apply(bn,e),Xi=null),e}function ca(e){Xi===null?Xi=[e]:Xi.push(e)}var uc=N(null),Br=null,Ei=null;function Ji(e,t,i){I(uc,t._currentValue),t._currentValue=i}function ki(e){e._currentValue=uc.current,$(uc)}function hc(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 fc(e,t,i,a){var m=e.child;for(m!==null&&(m.return=e);m!==null;){var C=m.dependencies;if(C!==null){var O=m.child;C=C.firstContext;e:for(;C!==null;){var F=C;C=m;for(var J=0;J<t.length;J++)if(F.context===t[J]){C.lanes|=i,F=C.alternate,F!==null&&(F.lanes|=i),hc(C.return,i,e),a||(O=null);break e}C=F.next}}else if(m.tag===18){if(O=m.return,O===null)throw Error(l(341));O.lanes|=i,C=O.alternate,C!==null&&(C.lanes|=i),hc(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 ms(e,t,i,a){e=null;for(var m=t,C=!1;m!==null;){if(!C){if((m.flags&524288)!==0)C=!0;else if((m.flags&262144)!==0)break}if(m.tag===10){var O=m.alternate;if(O===null)throw Error(l(387));if(O=O.memoizedProps,O!==null){var F=m.type;Tn(m.pendingProps.value,O.value)||(e!==null?e.push(F):e=[F])}}else if(m===W.current){if(O=m.alternate,O===null)throw Error(l(387));O.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(e!==null?e.push(Na):e=[Na])}m=m.return}e!==null&&fc(t,e,i,a),t.flags|=262144}function Cl(e){for(e=e.firstContext;e!==null;){if(!Tn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function jr(e){Br=e,Ei=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Vt(e){return If(Br,e)}function wl(e,t){return Br===null&&jr(e),If(e,t)}function If(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},Ei===null){if(e===null)throw Error(l(308));Ei=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ei=Ei.next=t;return i}var uy=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()})}},hy=n.unstable_scheduleCallback,fy=n.unstable_NormalPriority,Rt={$$typeof:S,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function dc(){return{controller:new uy,data:new Map,refCount:0}}function ua(e){e.refCount--,e.refCount===0&&hy(fy,function(){e.controller.abort()})}var ha=null,pc=0,gs=0,_s=null;function dy(e,t){if(ha===null){var i=ha=[];pc=0,gs=_u(),_s={status:"pending",value:void 0,then:function(a){i.push(a)}}}return pc++,t.then(Uf,Uf),t}function Uf(){if(--pc===0&&ha!==null){_s!==null&&(_s.status="fulfilled");var e=ha;ha=null,gs=0,_s=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function py(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 Pf=V.S;V.S=function(e,t){xp=it(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&dy(e,t),Pf!==null&&Pf(e,t)};var Nr=N(null);function mc(){var e=Nr.current;return e!==null?e:ht.pooledCache}function xl(e,t){t===null?I(Nr,Nr.current):I(Nr,t.pool)}function Ff(){var e=mc();return e===null?null:{parent:Rt._currentValue,pool:e}}var vs=Error(l(460)),gc=Error(l(474)),El=Error(l(542)),kl={then:function(){}};function qf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function $f(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(Rn,Rn),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Vf(e),e;default:if(typeof t.status=="string")t.then(Rn,Rn);else{if(e=ht,e!==null&&100<e.shellSuspendCounter)throw Error(l(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,Vf(e),e}throw zr=t,vs}}function Hr(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(zr=i,vs):i}}var zr=null;function Gf(){if(zr===null)throw Error(l(459));var e=zr;return zr=null,e}function Vf(e){if(e===vs||e===El)throw Error(l(483))}var ys=null,fa=0;function Al(e){var t=fa;return fa+=1,ys===null&&(ys=[]),$f(ys,e,t)}function da(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Rl(e,t){throw t.$$typeof===b?Error(l(525)):(e=Object.prototype.toString.call(t),Error(l(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Kf(e){function t(re,Z){if(e){var oe=re.deletions;oe===null?(re.deletions=[Z],re.flags|=16):oe.push(Z)}}function i(re,Z){if(!e)return null;for(;Z!==null;)t(re,Z),Z=Z.sibling;return null}function a(re){for(var Z=new Map;re!==null;)re.key!==null?Z.set(re.key,re):Z.set(re.index,re),re=re.sibling;return Z}function m(re,Z){return re=wi(re,Z),re.index=0,re.sibling=null,re}function C(re,Z,oe){return re.index=oe,e?(oe=re.alternate,oe!==null?(oe=oe.index,oe<Z?(re.flags|=67108866,Z):oe):(re.flags|=67108866,Z)):(re.flags|=1048576,Z)}function O(re){return e&&re.alternate===null&&(re.flags|=67108866),re}function F(re,Z,oe,ge){return Z===null||Z.tag!==6?(Z=rc(oe,re.mode,ge),Z.return=re,Z):(Z=m(Z,oe),Z.return=re,Z)}function J(re,Z,oe,ge){var Me=oe.type;return Me===E?me(re,Z,oe.props.children,ge,oe.key):Z!==null&&(Z.elementType===Me||typeof Me=="object"&&Me!==null&&Me.$$typeof===k&&Hr(Me)===Z.type)?(Z=m(Z,oe.props),da(Z,oe),Z.return=re,Z):(Z=Sl(oe.type,oe.key,oe.props,null,re.mode,ge),da(Z,oe),Z.return=re,Z)}function ce(re,Z,oe,ge){return Z===null||Z.tag!==4||Z.stateNode.containerInfo!==oe.containerInfo||Z.stateNode.implementation!==oe.implementation?(Z=sc(oe,re.mode,ge),Z.return=re,Z):(Z=m(Z,oe.children||[]),Z.return=re,Z)}function me(re,Z,oe,ge,Me){return Z===null||Z.tag!==7?(Z=Lr(oe,re.mode,ge,Me),Z.return=re,Z):(Z=m(Z,oe),Z.return=re,Z)}function _e(re,Z,oe){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return Z=rc(""+Z,re.mode,oe),Z.return=re,Z;if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case w:return oe=Sl(Z.type,Z.key,Z.props,null,re.mode,oe),da(oe,Z),oe.return=re,oe;case R:return Z=sc(Z,re.mode,oe),Z.return=re,Z;case k:return Z=Hr(Z),_e(re,Z,oe)}if(X(Z)||U(Z))return Z=Lr(Z,re.mode,oe,null),Z.return=re,Z;if(typeof Z.then=="function")return _e(re,Al(Z),oe);if(Z.$$typeof===S)return _e(re,wl(re,Z),oe);Rl(re,Z)}return null}function ue(re,Z,oe,ge){var Me=Z!==null?Z.key:null;if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return Me!==null?null:F(re,Z,""+oe,ge);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case w:return oe.key===Me?J(re,Z,oe,ge):null;case R:return oe.key===Me?ce(re,Z,oe,ge):null;case k:return oe=Hr(oe),ue(re,Z,oe,ge)}if(X(oe)||U(oe))return Me!==null?null:me(re,Z,oe,ge,null);if(typeof oe.then=="function")return ue(re,Z,Al(oe),ge);if(oe.$$typeof===S)return ue(re,Z,wl(re,oe),ge);Rl(re,oe)}return null}function de(re,Z,oe,ge,Me){if(typeof ge=="string"&&ge!==""||typeof ge=="number"||typeof ge=="bigint")return re=re.get(oe)||null,F(Z,re,""+ge,Me);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case w:return re=re.get(ge.key===null?oe:ge.key)||null,J(Z,re,ge,Me);case R:return re=re.get(ge.key===null?oe:ge.key)||null,ce(Z,re,ge,Me);case k:return ge=Hr(ge),de(re,Z,oe,ge,Me)}if(X(ge)||U(ge))return re=re.get(oe)||null,me(Z,re,ge,Me,null);if(typeof ge.then=="function")return de(re,Z,oe,Al(ge),Me);if(ge.$$typeof===S)return de(re,Z,oe,wl(Z,ge),Me);Rl(Z,ge)}return null}function xe(re,Z,oe,ge){for(var Me=null,et=null,Ae=Z,Pe=Z=0,Ye=null;Ae!==null&&Pe<oe.length;Pe++){Ae.index>Pe?(Ye=Ae,Ae=null):Ye=Ae.sibling;var tt=ue(re,Ae,oe[Pe],ge);if(tt===null){Ae===null&&(Ae=Ye);break}e&&Ae&&tt.alternate===null&&t(re,Ae),Z=C(tt,Z,Pe),et===null?Me=tt:et.sibling=tt,et=tt,Ae=Ye}if(Pe===oe.length)return i(re,Ae),Xe&&xi(re,Pe),Me;if(Ae===null){for(;Pe<oe.length;Pe++)Ae=_e(re,oe[Pe],ge),Ae!==null&&(Z=C(Ae,Z,Pe),et===null?Me=Ae:et.sibling=Ae,et=Ae);return Xe&&xi(re,Pe),Me}for(Ae=a(Ae);Pe<oe.length;Pe++)Ye=de(Ae,re,Pe,oe[Pe],ge),Ye!==null&&(e&&Ye.alternate!==null&&Ae.delete(Ye.key===null?Pe:Ye.key),Z=C(Ye,Z,Pe),et===null?Me=Ye:et.sibling=Ye,et=Ye);return e&&Ae.forEach(function(gr){return t(re,gr)}),Xe&&xi(re,Pe),Me}function Be(re,Z,oe,ge){if(oe==null)throw Error(l(151));for(var Me=null,et=null,Ae=Z,Pe=Z=0,Ye=null,tt=oe.next();Ae!==null&&!tt.done;Pe++,tt=oe.next()){Ae.index>Pe?(Ye=Ae,Ae=null):Ye=Ae.sibling;var gr=ue(re,Ae,tt.value,ge);if(gr===null){Ae===null&&(Ae=Ye);break}e&&Ae&&gr.alternate===null&&t(re,Ae),Z=C(gr,Z,Pe),et===null?Me=gr:et.sibling=gr,et=gr,Ae=Ye}if(tt.done)return i(re,Ae),Xe&&xi(re,Pe),Me;if(Ae===null){for(;!tt.done;Pe++,tt=oe.next())tt=_e(re,tt.value,ge),tt!==null&&(Z=C(tt,Z,Pe),et===null?Me=tt:et.sibling=tt,et=tt);return Xe&&xi(re,Pe),Me}for(Ae=a(Ae);!tt.done;Pe++,tt=oe.next())tt=de(Ae,re,Pe,tt.value,ge),tt!==null&&(e&&tt.alternate!==null&&Ae.delete(tt.key===null?Pe:tt.key),Z=C(tt,Z,Pe),et===null?Me=tt:et.sibling=tt,et=tt);return e&&Ae.forEach(function(E0){return t(re,E0)}),Xe&&xi(re,Pe),Me}function ot(re,Z,oe,ge){if(typeof oe=="object"&&oe!==null&&oe.type===E&&oe.key===null&&(oe=oe.props.children),typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case w:e:{for(var Me=oe.key;Z!==null;){if(Z.key===Me){if(Me=oe.type,Me===E){if(Z.tag===7){i(re,Z.sibling),ge=m(Z,oe.props.children),ge.return=re,re=ge;break e}}else if(Z.elementType===Me||typeof Me=="object"&&Me!==null&&Me.$$typeof===k&&Hr(Me)===Z.type){i(re,Z.sibling),ge=m(Z,oe.props),da(ge,oe),ge.return=re,re=ge;break e}i(re,Z);break}else t(re,Z);Z=Z.sibling}oe.type===E?(ge=Lr(oe.props.children,re.mode,ge,oe.key),ge.return=re,re=ge):(ge=Sl(oe.type,oe.key,oe.props,null,re.mode,ge),da(ge,oe),ge.return=re,re=ge)}return O(re);case R:e:{for(Me=oe.key;Z!==null;){if(Z.key===Me)if(Z.tag===4&&Z.stateNode.containerInfo===oe.containerInfo&&Z.stateNode.implementation===oe.implementation){i(re,Z.sibling),ge=m(Z,oe.children||[]),ge.return=re,re=ge;break e}else{i(re,Z);break}else t(re,Z);Z=Z.sibling}ge=sc(oe,re.mode,ge),ge.return=re,re=ge}return O(re);case k:return oe=Hr(oe),ot(re,Z,oe,ge)}if(X(oe))return xe(re,Z,oe,ge);if(U(oe)){if(Me=U(oe),typeof Me!="function")throw Error(l(150));return oe=Me.call(oe),Be(re,Z,oe,ge)}if(typeof oe.then=="function")return ot(re,Z,Al(oe),ge);if(oe.$$typeof===S)return ot(re,Z,wl(re,oe),ge);Rl(re,oe)}return typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint"?(oe=""+oe,Z!==null&&Z.tag===6?(i(re,Z.sibling),ge=m(Z,oe),ge.return=re,re=ge):(i(re,Z),ge=rc(oe,re.mode,ge),ge.return=re,re=ge),O(re)):i(re,Z)}return function(re,Z,oe,ge){try{fa=0;var Me=ot(re,Z,oe,ge);return ys=null,Me}catch(Ae){if(Ae===vs||Ae===El)throw Ae;var et=Dn(29,Ae,null,re.mode);return et.lanes=ge,et.return=re,et}finally{}}}var Ir=Kf(!0),Wf=Kf(!1),Zi=!1;function _c(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function vc(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 er(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function tr(e,t,i){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(nt&2)!==0){var m=a.pending;return m===null?t.next=t:(t.next=m.next,m.next=t),a.pending=t,t=yl(e),Mf(e,null,i),t}return vl(e,a,t,i),yl(e)}function pa(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,gi(e,i)}}function yc(e,t){var i=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,i===a)){var m=null,C=null;if(i=i.firstBaseUpdate,i!==null){do{var O={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};C===null?m=C=O:C=C.next=O,i=i.next}while(i!==null);C===null?m=C=t:C=C.next=t}else m=C=t;i={baseState:a.baseState,firstBaseUpdate:m,lastBaseUpdate:C,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 Sc=!1;function ma(){if(Sc){var e=_s;if(e!==null)throw e}}function ga(e,t,i,a){Sc=!1;var m=e.updateQueue;Zi=!1;var C=m.firstBaseUpdate,O=m.lastBaseUpdate,F=m.shared.pending;if(F!==null){m.shared.pending=null;var J=F,ce=J.next;J.next=null,O===null?C=ce:O.next=ce,O=J;var me=e.alternate;me!==null&&(me=me.updateQueue,F=me.lastBaseUpdate,F!==O&&(F===null?me.firstBaseUpdate=ce:F.next=ce,me.lastBaseUpdate=J))}if(C!==null){var _e=m.baseState;O=0,me=ce=J=null,F=C;do{var ue=F.lane&-536870913,de=ue!==F.lane;if(de?(We&ue)===ue:(a&ue)===ue){ue!==0&&ue===gs&&(Sc=!0),me!==null&&(me=me.next={lane:0,tag:F.tag,payload:F.payload,callback:null,next:null});e:{var xe=e,Be=F;ue=t;var ot=i;switch(Be.tag){case 1:if(xe=Be.payload,typeof xe=="function"){_e=xe.call(ot,_e,ue);break e}_e=xe;break e;case 3:xe.flags=xe.flags&-65537|128;case 0:if(xe=Be.payload,ue=typeof xe=="function"?xe.call(ot,_e,ue):xe,ue==null)break e;_e=u({},_e,ue);break e;case 2:Zi=!0}}ue=F.callback,ue!==null&&(e.flags|=64,de&&(e.flags|=8192),de=m.callbacks,de===null?m.callbacks=[ue]:de.push(ue))}else de={lane:ue,tag:F.tag,payload:F.payload,callback:F.callback,next:null},me===null?(ce=me=de,J=_e):me=me.next=de,O|=ue;if(F=F.next,F===null){if(F=m.shared.pending,F===null)break;de=F,F=de.next,de.next=null,m.lastBaseUpdate=de,m.shared.pending=null}}while(!0);me===null&&(J=_e),m.baseState=J,m.firstBaseUpdate=ce,m.lastBaseUpdate=me,C===null&&(m.shared.lanes=0),ar|=O,e.lanes=O,e.memoizedState=_e}}function Yf(e,t){if(typeof e!="function")throw Error(l(191,e));e.call(t)}function Xf(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)Yf(i[e],t)}var Ss=N(null),Tl=N(0);function Qf(e,t){e=ji,I(Tl,e),I(Ss,t),ji=e|t.baseLanes}function bc(){I(Tl,ji),I(Ss,Ss.current)}function Cc(){ji=Tl.current,$(Ss),$(Tl)}var Mn=N(null),Gn=null;function nr(e){var t=e.alternate;I(Et,Et.current&1),I(Mn,e),Gn===null&&(t===null||Ss.current!==null||t.memoizedState!==null)&&(Gn=e)}function wc(e){I(Et,Et.current),I(Mn,e),Gn===null&&(Gn=e)}function Jf(e){e.tag===22?(I(Et,Et.current),I(Mn,e),Gn===null&&(Gn=e)):ir()}function ir(){I(Et,Et.current),I(Mn,Mn.current)}function Ln(e){$(Mn),Gn===e&&(Gn=null),$(Et)}var Et=N(0);function Dl(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||Tu(i)||Du(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 Ai=0,Ie=null,at=null,Tt=null,Ml=!1,bs=!1,Ur=!1,Ll=0,_a=0,Cs=null,my=0;function bt(){throw Error(l(321))}function xc(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!Tn(e[i],t[i]))return!1;return!0}function Ec(e,t,i,a,m,C){return Ai=C,Ie=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,V.H=e===null||e.memoizedState===null?jd:Uc,Ur=!1,C=i(a,m),Ur=!1,bs&&(C=ed(t,i,a,m)),Zf(e),C}function Zf(e){V.H=Sa;var t=at!==null&&at.next!==null;if(Ai=0,Tt=at=Ie=null,Ml=!1,_a=0,Cs=null,t)throw Error(l(300));e===null||Dt||(e=e.dependencies,e!==null&&Cl(e)&&(Dt=!0))}function ed(e,t,i,a){Ie=e;var m=0;do{if(bs&&(Cs=null),_a=0,bs=!1,25<=m)throw Error(l(301));if(m+=1,Tt=at=null,e.updateQueue!=null){var C=e.updateQueue;C.lastEffect=null,C.events=null,C.stores=null,C.memoCache!=null&&(C.memoCache.index=0)}V.H=Nd,C=t(i,a)}while(bs);return C}function gy(){var e=V.H,t=e.useState()[0];return t=typeof t.then=="function"?va(t):t,e=e.useState()[0],(at!==null?at.memoizedState:null)!==e&&(Ie.flags|=1024),t}function kc(){var e=Ll!==0;return Ll=0,e}function Ac(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function Rc(e){if(Ml){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ml=!1}Ai=0,Tt=at=Ie=null,bs=!1,_a=Ll=0,Cs=null}function hn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Tt===null?Ie.memoizedState=Tt=e:Tt=Tt.next=e,Tt}function kt(){if(at===null){var e=Ie.alternate;e=e!==null?e.memoizedState:null}else e=at.next;var t=Tt===null?Ie.memoizedState:Tt.next;if(t!==null)Tt=t,at=e;else{if(e===null)throw Ie.alternate===null?Error(l(467)):Error(l(310));at=e,e={memoizedState:at.memoizedState,baseState:at.baseState,baseQueue:at.baseQueue,queue:at.queue,next:null},Tt===null?Ie.memoizedState=Tt=e:Tt=Tt.next=e}return Tt}function Ol(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function va(e){var t=_a;return _a+=1,Cs===null&&(Cs=[]),e=$f(Cs,e,t),t=Ie,(Tt===null?t.memoizedState:Tt.next)===null&&(t=t.alternate,V.H=t===null||t.memoizedState===null?jd:Uc),e}function Bl(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return va(e);if(e.$$typeof===S)return Vt(e)}throw Error(l(438,String(e)))}function Tc(e){var t=null,i=Ie.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var a=Ie.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=Ol(),Ie.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 Ri(e,t){return typeof t=="function"?t(e):t}function jl(e){var t=kt();return Dc(t,at,e)}function Dc(e,t,i){var a=e.queue;if(a===null)throw Error(l(311));a.lastRenderedReducer=i;var m=e.baseQueue,C=a.pending;if(C!==null){if(m!==null){var O=m.next;m.next=C.next,C.next=O}t.baseQueue=m=C,a.pending=null}if(C=e.baseState,m===null)e.memoizedState=C;else{t=m.next;var F=O=null,J=null,ce=t,me=!1;do{var _e=ce.lane&-536870913;if(_e!==ce.lane?(We&_e)===_e:(Ai&_e)===_e){var ue=ce.revertLane;if(ue===0)J!==null&&(J=J.next={lane:0,revertLane:0,gesture:null,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null}),_e===gs&&(me=!0);else if((Ai&ue)===ue){ce=ce.next,ue===gs&&(me=!0);continue}else _e={lane:0,revertLane:ce.revertLane,gesture:null,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null},J===null?(F=J=_e,O=C):J=J.next=_e,Ie.lanes|=ue,ar|=ue;_e=ce.action,Ur&&i(C,_e),C=ce.hasEagerState?ce.eagerState:i(C,_e)}else ue={lane:_e,revertLane:ce.revertLane,gesture:ce.gesture,action:ce.action,hasEagerState:ce.hasEagerState,eagerState:ce.eagerState,next:null},J===null?(F=J=ue,O=C):J=J.next=ue,Ie.lanes|=_e,ar|=_e;ce=ce.next}while(ce!==null&&ce!==t);if(J===null?O=C:J.next=F,!Tn(C,e.memoizedState)&&(Dt=!0,me&&(i=_s,i!==null)))throw i;e.memoizedState=C,e.baseState=O,e.baseQueue=J,a.lastRenderedState=C}return m===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function Mc(e){var t=kt(),i=t.queue;if(i===null)throw Error(l(311));i.lastRenderedReducer=e;var a=i.dispatch,m=i.pending,C=t.memoizedState;if(m!==null){i.pending=null;var O=m=m.next;do C=e(C,O.action),O=O.next;while(O!==m);Tn(C,t.memoizedState)||(Dt=!0),t.memoizedState=C,t.baseQueue===null&&(t.baseState=C),i.lastRenderedState=C}return[C,a]}function td(e,t,i){var a=Ie,m=kt(),C=Xe;if(C){if(i===void 0)throw Error(l(407));i=i()}else i=t();var O=!Tn((at||m).memoizedState,i);if(O&&(m.memoizedState=i,Dt=!0),m=m.queue,Bc(rd.bind(null,a,m,e),[e]),m.getSnapshot!==t||O||Tt!==null&&Tt.memoizedState.tag&1){if(a.flags|=2048,ws(9,{destroy:void 0},id.bind(null,a,m,i,t),null),ht===null)throw Error(l(349));C||(Ai&127)!==0||nd(a,t,i)}return i}function nd(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=Ie.updateQueue,t===null?(t=Ol(),Ie.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function id(e,t,i,a){t.value=i,t.getSnapshot=a,sd(t)&&ad(e)}function rd(e,t,i){return i(function(){sd(t)&&ad(e)})}function sd(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!Tn(e,i)}catch{return!0}}function ad(e){var t=Mr(e,2);t!==null&&Cn(t,e,2)}function Lc(e){var t=hn();if(typeof e=="function"){var i=e;if(e=i(),Ur){Bt(!0);try{i()}finally{Bt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ri,lastRenderedState:e},t}function ld(e,t,i,a){return e.baseState=i,Dc(e,at,typeof a=="function"?a:Ri)}function _y(e,t,i,a,m){if(zl(e))throw Error(l(485));if(e=t.action,e!==null){var C={payload:m,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(O){C.listeners.push(O)}};V.T!==null?i(!0):C.isTransition=!1,a(C),i=t.pending,i===null?(C.next=t.pending=C,od(t,C)):(C.next=i.next,t.pending=i.next=C)}}function od(e,t){var i=t.action,a=t.payload,m=e.state;if(t.isTransition){var C=V.T,O={};V.T=O;try{var F=i(m,a),J=V.S;J!==null&&J(O,F),cd(e,t,F)}catch(ce){Oc(e,t,ce)}finally{C!==null&&O.types!==null&&(C.types=O.types),V.T=C}}else try{C=i(m,a),cd(e,t,C)}catch(ce){Oc(e,t,ce)}}function cd(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(a){ud(e,t,a)},function(a){return Oc(e,t,a)}):ud(e,t,i)}function ud(e,t,i){t.status="fulfilled",t.value=i,hd(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,od(e,i)))}function Oc(e,t,i){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=i,hd(t),t=t.next;while(t!==a)}e.action=null}function hd(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function fd(e,t){return t}function dd(e,t){if(Xe){var i=ht.formState;if(i!==null){e:{var a=Ie;if(Xe){if(mt){t:{for(var m=mt,C=$n;m.nodeType!==8;){if(!C){m=null;break t}if(m=Vn(m.nextSibling),m===null){m=null;break t}}C=m.data,m=C==="F!"||C==="F"?m:null}if(m){mt=Vn(m.nextSibling),a=m.data==="F!";break e}}Qi(a)}a=!1}a&&(t=i[0])}}return i=hn(),i.memoizedState=i.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:fd,lastRenderedState:t},i.queue=a,i=Ld.bind(null,Ie,a),a.dispatch=i,a=Lc(!1),C=Ic.bind(null,Ie,!1,a.queue),a=hn(),m={state:t,dispatch:null,action:e,pending:null},a.queue=m,i=_y.bind(null,Ie,m,C,i),m.dispatch=i,a.memoizedState=e,[t,i,!1]}function pd(e){var t=kt();return md(t,at,e)}function md(e,t,i){if(t=Dc(e,t,fd)[0],e=jl(Ri)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=va(t)}catch(O){throw O===vs?El:O}else a=t;t=kt();var m=t.queue,C=m.dispatch;return i!==t.memoizedState&&(Ie.flags|=2048,ws(9,{destroy:void 0},vy.bind(null,m,i),null)),[a,C,e]}function vy(e,t){e.action=t}function gd(e){var t=kt(),i=at;if(i!==null)return md(t,i,e);kt(),t=t.memoizedState,i=kt();var a=i.queue.dispatch;return i.memoizedState=e,[t,a,!1]}function ws(e,t,i,a){return e={tag:e,create:i,deps:a,inst:t,next:null},t=Ie.updateQueue,t===null&&(t=Ol(),Ie.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 _d(){return kt().memoizedState}function Nl(e,t,i,a){var m=hn();Ie.flags|=e,m.memoizedState=ws(1|t,{destroy:void 0},i,a===void 0?null:a)}function Hl(e,t,i,a){var m=kt();a=a===void 0?null:a;var C=m.memoizedState.inst;at!==null&&a!==null&&xc(a,at.memoizedState.deps)?m.memoizedState=ws(t,C,i,a):(Ie.flags|=e,m.memoizedState=ws(1|t,C,i,a))}function vd(e,t){Nl(8390656,8,e,t)}function Bc(e,t){Hl(2048,8,e,t)}function yy(e){Ie.flags|=4;var t=Ie.updateQueue;if(t===null)t=Ol(),Ie.updateQueue=t,t.events=[e];else{var i=t.events;i===null?t.events=[e]:i.push(e)}}function yd(e){var t=kt().memoizedState;return yy({ref:t,nextImpl:e}),function(){if((nt&2)!==0)throw Error(l(440));return t.impl.apply(void 0,arguments)}}function Sd(e,t){return Hl(4,2,e,t)}function bd(e,t){return Hl(4,4,e,t)}function Cd(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 wd(e,t,i){i=i!=null?i.concat([e]):null,Hl(4,4,Cd.bind(null,t,e),i)}function jc(){}function xd(e,t){var i=kt();t=t===void 0?null:t;var a=i.memoizedState;return t!==null&&xc(t,a[1])?a[0]:(i.memoizedState=[e,t],e)}function Ed(e,t){var i=kt();t=t===void 0?null:t;var a=i.memoizedState;if(t!==null&&xc(t,a[1]))return a[0];if(a=e(),Ur){Bt(!0);try{e()}finally{Bt(!1)}}return i.memoizedState=[a,t],a}function Nc(e,t,i){return i===void 0||(Ai&1073741824)!==0&&(We&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=kp(),Ie.lanes|=e,ar|=e,i)}function kd(e,t,i,a){return Tn(i,t)?i:Ss.current!==null?(e=Nc(e,i,a),Tn(e,t)||(Dt=!0),e):(Ai&42)===0||(Ai&1073741824)!==0&&(We&261930)===0?(Dt=!0,e.memoizedState=i):(e=kp(),Ie.lanes|=e,ar|=e,t)}function Ad(e,t,i,a,m){var C=K.p;K.p=C!==0&&8>C?C:8;var O=V.T,F={};V.T=F,Ic(e,!1,t,i);try{var J=m(),ce=V.S;if(ce!==null&&ce(F,J),J!==null&&typeof J=="object"&&typeof J.then=="function"){var me=py(J,a);ya(e,t,me,jn(e))}else ya(e,t,a,jn(e))}catch(_e){ya(e,t,{then:function(){},status:"rejected",reason:_e},jn())}finally{K.p=C,O!==null&&F.types!==null&&(O.types=F.types),V.T=O}}function Sy(){}function Hc(e,t,i,a){if(e.tag!==5)throw Error(l(476));var m=Rd(e).queue;Ad(e,m,t,ne,i===null?Sy:function(){return Td(e),i(a)})}function Rd(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ri,lastRenderedState:ne},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ri,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Td(e){var t=Rd(e);t.next===null&&(t=e.alternate.memoizedState),ya(e,t.next.queue,{},jn())}function zc(){return Vt(Na)}function Dd(){return kt().memoizedState}function Md(){return kt().memoizedState}function by(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=jn();e=er(i);var a=tr(t,e,i);a!==null&&(Cn(a,t,i),pa(a,t,i)),t={cache:dc()},e.payload=t;return}t=t.return}}function Cy(e,t,i){var a=jn();i={lane:a,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},zl(e)?Od(t,i):(i=nc(e,t,i,a),i!==null&&(Cn(i,e,a),Bd(i,t,a)))}function Ld(e,t,i){var a=jn();ya(e,t,i,a)}function ya(e,t,i,a){var m={lane:a,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(zl(e))Od(t,m);else{var C=e.alternate;if(e.lanes===0&&(C===null||C.lanes===0)&&(C=t.lastRenderedReducer,C!==null))try{var O=t.lastRenderedState,F=C(O,i);if(m.hasEagerState=!0,m.eagerState=F,Tn(F,O))return vl(e,t,m,0),ht===null&&_l(),!1}catch{}finally{}if(i=nc(e,t,m,a),i!==null)return Cn(i,e,a),Bd(i,t,a),!0}return!1}function Ic(e,t,i,a){if(a={lane:2,revertLane:_u(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},zl(e)){if(t)throw Error(l(479))}else t=nc(e,i,a,2),t!==null&&Cn(t,e,2)}function zl(e){var t=e.alternate;return e===Ie||t!==null&&t===Ie}function Od(e,t){bs=Ml=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function Bd(e,t,i){if((i&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,i|=a,t.lanes=i,gi(e,i)}}var Sa={readContext:Vt,use:Bl,useCallback:bt,useContext:bt,useEffect:bt,useImperativeHandle:bt,useLayoutEffect:bt,useInsertionEffect:bt,useMemo:bt,useReducer:bt,useRef:bt,useState:bt,useDebugValue:bt,useDeferredValue:bt,useTransition:bt,useSyncExternalStore:bt,useId:bt,useHostTransitionStatus:bt,useFormState:bt,useActionState:bt,useOptimistic:bt,useMemoCache:bt,useCacheRefresh:bt};Sa.useEffectEvent=bt;var jd={readContext:Vt,use:Bl,useCallback:function(e,t){return hn().memoizedState=[e,t===void 0?null:t],e},useContext:Vt,useEffect:vd,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,Nl(4194308,4,Cd.bind(null,t,e),i)},useLayoutEffect:function(e,t){return Nl(4194308,4,e,t)},useInsertionEffect:function(e,t){Nl(4,2,e,t)},useMemo:function(e,t){var i=hn();t=t===void 0?null:t;var a=e();if(Ur){Bt(!0);try{e()}finally{Bt(!1)}}return i.memoizedState=[a,t],a},useReducer:function(e,t,i){var a=hn();if(i!==void 0){var m=i(t);if(Ur){Bt(!0);try{i(t)}finally{Bt(!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=Cy.bind(null,Ie,e),[a.memoizedState,e]},useRef:function(e){var t=hn();return e={current:e},t.memoizedState=e},useState:function(e){e=Lc(e);var t=e.queue,i=Ld.bind(null,Ie,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:jc,useDeferredValue:function(e,t){var i=hn();return Nc(i,e,t)},useTransition:function(){var e=Lc(!1);return e=Ad.bind(null,Ie,e.queue,!0,!1),hn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var a=Ie,m=hn();if(Xe){if(i===void 0)throw Error(l(407));i=i()}else{if(i=t(),ht===null)throw Error(l(349));(We&127)!==0||nd(a,t,i)}m.memoizedState=i;var C={value:i,getSnapshot:t};return m.queue=C,vd(rd.bind(null,a,C,e),[e]),a.flags|=2048,ws(9,{destroy:void 0},id.bind(null,a,C,i,t),null),i},useId:function(){var e=hn(),t=ht.identifierPrefix;if(Xe){var i=ui,a=ci;i=(a&~(1<<32-Ze(a)-1)).toString(32)+i,t="_"+t+"R_"+i,i=Ll++,0<i&&(t+="H"+i.toString(32)),t+="_"}else i=my++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:zc,useFormState:dd,useActionState:dd,useOptimistic:function(e){var t=hn();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=Ic.bind(null,Ie,!0,i),i.dispatch=t,[e,t]},useMemoCache:Tc,useCacheRefresh:function(){return hn().memoizedState=by.bind(null,Ie)},useEffectEvent:function(e){var t=hn(),i={impl:e};return t.memoizedState=i,function(){if((nt&2)!==0)throw Error(l(440));return i.impl.apply(void 0,arguments)}}},Uc={readContext:Vt,use:Bl,useCallback:xd,useContext:Vt,useEffect:Bc,useImperativeHandle:wd,useInsertionEffect:Sd,useLayoutEffect:bd,useMemo:Ed,useReducer:jl,useRef:_d,useState:function(){return jl(Ri)},useDebugValue:jc,useDeferredValue:function(e,t){var i=kt();return kd(i,at.memoizedState,e,t)},useTransition:function(){var e=jl(Ri)[0],t=kt().memoizedState;return[typeof e=="boolean"?e:va(e),t]},useSyncExternalStore:td,useId:Dd,useHostTransitionStatus:zc,useFormState:pd,useActionState:pd,useOptimistic:function(e,t){var i=kt();return ld(i,at,e,t)},useMemoCache:Tc,useCacheRefresh:Md};Uc.useEffectEvent=yd;var Nd={readContext:Vt,use:Bl,useCallback:xd,useContext:Vt,useEffect:Bc,useImperativeHandle:wd,useInsertionEffect:Sd,useLayoutEffect:bd,useMemo:Ed,useReducer:Mc,useRef:_d,useState:function(){return Mc(Ri)},useDebugValue:jc,useDeferredValue:function(e,t){var i=kt();return at===null?Nc(i,e,t):kd(i,at.memoizedState,e,t)},useTransition:function(){var e=Mc(Ri)[0],t=kt().memoizedState;return[typeof e=="boolean"?e:va(e),t]},useSyncExternalStore:td,useId:Dd,useHostTransitionStatus:zc,useFormState:gd,useActionState:gd,useOptimistic:function(e,t){var i=kt();return at!==null?ld(i,at,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:Tc,useCacheRefresh:Md};Nd.useEffectEvent=yd;function Pc(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 Fc={enqueueSetState:function(e,t,i){e=e._reactInternals;var a=jn(),m=er(a);m.payload=t,i!=null&&(m.callback=i),t=tr(e,m,a),t!==null&&(Cn(t,e,a),pa(t,e,a))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var a=jn(),m=er(a);m.tag=1,m.payload=t,i!=null&&(m.callback=i),t=tr(e,m,a),t!==null&&(Cn(t,e,a),pa(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=jn(),a=er(i);a.tag=2,t!=null&&(a.callback=t),t=tr(e,a,i),t!==null&&(Cn(t,e,i),pa(t,e,i))}};function Hd(e,t,i,a,m,C,O){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,C,O):t.prototype&&t.prototype.isPureReactComponent?!aa(i,a)||!aa(m,C):!0}function zd(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&&Fc.enqueueReplaceState(t,t.state,null)}function Pr(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 Id(e){gl(e)}function Ud(e){console.error(e)}function Pd(e){gl(e)}function Il(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function Fd(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 qc(e,t,i){return i=er(i),i.tag=3,i.payload={element:null},i.callback=function(){Il(e,t)},i}function qd(e){return e=er(e),e.tag=3,e}function $d(e,t,i,a){var m=i.type.getDerivedStateFromError;if(typeof m=="function"){var C=a.value;e.payload=function(){return m(C)},e.callback=function(){Fd(t,i,a)}}var O=i.stateNode;O!==null&&typeof O.componentDidCatch=="function"&&(e.callback=function(){Fd(t,i,a),typeof m!="function"&&(lr===null?lr=new Set([this]):lr.add(this));var F=a.stack;this.componentDidCatch(a.value,{componentStack:F!==null?F:""})})}function wy(e,t,i,a,m){if(i.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=i.alternate,t!==null&&ms(t,i,m,!0),i=Mn.current,i!==null){switch(i.tag){case 31:case 13:return Gn===null?Ql():i.alternate===null&&Ct===0&&(Ct=3),i.flags&=-257,i.flags|=65536,i.lanes=m,a===kl?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([a]):t.add(a),pu(e,a,m)),!1;case 22:return i.flags|=65536,a===kl?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)),pu(e,a,m)),!1}throw Error(l(435,i.tag))}return pu(e,a,m),Ql(),!1}if(Xe)return t=Mn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=m,a!==oc&&(e=Error(l(422),{cause:a}),ca(Pn(e,i)))):(a!==oc&&(t=Error(l(423),{cause:a}),ca(Pn(t,i))),e=e.current.alternate,e.flags|=65536,m&=-m,e.lanes|=m,a=Pn(a,i),m=qc(e.stateNode,a,m),yc(e,m),Ct!==4&&(Ct=2)),!1;var C=Error(l(520),{cause:a});if(C=Pn(C,i),Ra===null?Ra=[C]:Ra.push(C),Ct!==4&&(Ct=2),t===null)return!0;a=Pn(a,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=m&-m,i.lanes|=e,e=qc(i.stateNode,a,e),yc(i,e),!1;case 1:if(t=i.type,C=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||C!==null&&typeof C.componentDidCatch=="function"&&(lr===null||!lr.has(C))))return i.flags|=65536,m&=-m,i.lanes|=m,m=qd(m),$d(m,e,i,a),yc(i,m),!1}i=i.return}while(i!==null);return!1}var $c=Error(l(461)),Dt=!1;function Kt(e,t,i,a){t.child=e===null?Wf(t,null,i,a):Ir(t,e.child,i,a)}function Gd(e,t,i,a,m){i=i.render;var C=t.ref;if("ref"in a){var O={};for(var F in a)F!=="ref"&&(O[F]=a[F])}else O=a;return jr(t),a=Ec(e,t,i,O,C,m),F=kc(),e!==null&&!Dt?(Ac(e,t,m),Ti(e,t,m)):(Xe&&F&&ac(t),t.flags|=1,Kt(e,t,a,m),t.child)}function Vd(e,t,i,a,m){if(e===null){var C=i.type;return typeof C=="function"&&!ic(C)&&C.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=C,Kd(e,t,C,a,m)):(e=Sl(i.type,null,a,t,t.mode,m),e.ref=t.ref,e.return=t,t.child=e)}if(C=e.child,!Jc(e,m)){var O=C.memoizedProps;if(i=i.compare,i=i!==null?i:aa,i(O,a)&&e.ref===t.ref)return Ti(e,t,m)}return t.flags|=1,e=wi(C,a),e.ref=t.ref,e.return=t,t.child=e}function Kd(e,t,i,a,m){if(e!==null){var C=e.memoizedProps;if(aa(C,a)&&e.ref===t.ref)if(Dt=!1,t.pendingProps=a=C,Jc(e,m))(e.flags&131072)!==0&&(Dt=!0);else return t.lanes=e.lanes,Ti(e,t,m)}return Gc(e,t,i,a,m)}function Wd(e,t,i,a){var m=a.children,C=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(C=C!==null?C.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&~C}else a=0,t.child=null;return Yd(e,t,C,i,a)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&xl(t,C!==null?C.cachePool:null),C!==null?Qf(t,C):bc(),Jf(t);else return a=t.lanes=536870912,Yd(e,t,C!==null?C.baseLanes|i:i,i,a)}else C!==null?(xl(t,C.cachePool),Qf(t,C),ir(),t.memoizedState=null):(e!==null&&xl(t,null),bc(),ir());return Kt(e,t,m,i),t.child}function ba(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Yd(e,t,i,a,m){var C=mc();return C=C===null?null:{parent:Rt._currentValue,pool:C},t.memoizedState={baseLanes:i,cachePool:C},e!==null&&xl(t,null),bc(),Jf(t),e!==null&&ms(e,t,a,!0),t.childLanes=m,null}function Ul(e,t){return t=Fl({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Xd(e,t,i){return Ir(t,e.child,null,i),e=Ul(t,t.pendingProps),e.flags|=2,Ln(t),t.memoizedState=null,e}function xy(e,t,i){var a=t.pendingProps,m=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Xe){if(a.mode==="hidden")return e=Ul(t,a),t.lanes=536870912,ba(null,e);if(wc(t),(e=mt)?(e=om(e,$n),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Yi!==null?{id:ci,overflow:ui}:null,retryLane:536870912,hydrationErrors:null},i=Of(e),i.return=t,t.child=i,Gt=t,mt=null)):e=null,e===null)throw Qi(t);return t.lanes=536870912,null}return Ul(t,a)}var C=e.memoizedState;if(C!==null){var O=C.dehydrated;if(wc(t),m)if(t.flags&256)t.flags&=-257,t=Xd(e,t,i);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(l(558));else if(Dt||ms(e,t,i,!1),m=(i&e.childLanes)!==0,Dt||m){if(a=ht,a!==null&&(O=Xr(a,i),O!==0&&O!==C.retryLane))throw C.retryLane=O,Mr(e,O),Cn(a,e,O),$c;Ql(),t=Xd(e,t,i)}else e=C.treeContext,mt=Vn(O.nextSibling),Gt=t,Xe=!0,Xi=null,$n=!1,e!==null&&Nf(t,e),t=Ul(t,a),t.flags|=4096;return t}return e=wi(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Pl(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(l(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function Gc(e,t,i,a,m){return jr(t),i=Ec(e,t,i,a,void 0,m),a=kc(),e!==null&&!Dt?(Ac(e,t,m),Ti(e,t,m)):(Xe&&a&&ac(t),t.flags|=1,Kt(e,t,i,m),t.child)}function Qd(e,t,i,a,m,C){return jr(t),t.updateQueue=null,i=ed(t,a,i,m),Zf(e),a=kc(),e!==null&&!Dt?(Ac(e,t,C),Ti(e,t,C)):(Xe&&a&&ac(t),t.flags|=1,Kt(e,t,i,C),t.child)}function Jd(e,t,i,a,m){if(jr(t),t.stateNode===null){var C=hs,O=i.contextType;typeof O=="object"&&O!==null&&(C=Vt(O)),C=new i(a,C),t.memoizedState=C.state!==null&&C.state!==void 0?C.state:null,C.updater=Fc,t.stateNode=C,C._reactInternals=t,C=t.stateNode,C.props=a,C.state=t.memoizedState,C.refs={},_c(t),O=i.contextType,C.context=typeof O=="object"&&O!==null?Vt(O):hs,C.state=t.memoizedState,O=i.getDerivedStateFromProps,typeof O=="function"&&(Pc(t,i,O,a),C.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof C.getSnapshotBeforeUpdate=="function"||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(O=C.state,typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount(),O!==C.state&&Fc.enqueueReplaceState(C,C.state,null),ga(t,a,C,m),ma(),C.state=t.memoizedState),typeof C.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){C=t.stateNode;var F=t.memoizedProps,J=Pr(i,F);C.props=J;var ce=C.context,me=i.contextType;O=hs,typeof me=="object"&&me!==null&&(O=Vt(me));var _e=i.getDerivedStateFromProps;me=typeof _e=="function"||typeof C.getSnapshotBeforeUpdate=="function",F=t.pendingProps!==F,me||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(F||ce!==O)&&zd(t,C,a,O),Zi=!1;var ue=t.memoizedState;C.state=ue,ga(t,a,C,m),ma(),ce=t.memoizedState,F||ue!==ce||Zi?(typeof _e=="function"&&(Pc(t,i,_e,a),ce=t.memoizedState),(J=Zi||Hd(t,i,J,a,ue,ce,O))?(me||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount()),typeof C.componentDidMount=="function"&&(t.flags|=4194308)):(typeof C.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=ce),C.props=a,C.state=ce,C.context=O,a=J):(typeof C.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{C=t.stateNode,vc(e,t),O=t.memoizedProps,me=Pr(i,O),C.props=me,_e=t.pendingProps,ue=C.context,ce=i.contextType,J=hs,typeof ce=="object"&&ce!==null&&(J=Vt(ce)),F=i.getDerivedStateFromProps,(ce=typeof F=="function"||typeof C.getSnapshotBeforeUpdate=="function")||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(O!==_e||ue!==J)&&zd(t,C,a,J),Zi=!1,ue=t.memoizedState,C.state=ue,ga(t,a,C,m),ma();var de=t.memoizedState;O!==_e||ue!==de||Zi||e!==null&&e.dependencies!==null&&Cl(e.dependencies)?(typeof F=="function"&&(Pc(t,i,F,a),de=t.memoizedState),(me=Zi||Hd(t,i,me,a,ue,de,J)||e!==null&&e.dependencies!==null&&Cl(e.dependencies))?(ce||typeof C.UNSAFE_componentWillUpdate!="function"&&typeof C.componentWillUpdate!="function"||(typeof C.componentWillUpdate=="function"&&C.componentWillUpdate(a,de,J),typeof C.UNSAFE_componentWillUpdate=="function"&&C.UNSAFE_componentWillUpdate(a,de,J)),typeof C.componentDidUpdate=="function"&&(t.flags|=4),typeof C.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof C.componentDidUpdate!="function"||O===e.memoizedProps&&ue===e.memoizedState||(t.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||O===e.memoizedProps&&ue===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=de),C.props=a,C.state=de,C.context=J,a=me):(typeof C.componentDidUpdate!="function"||O===e.memoizedProps&&ue===e.memoizedState||(t.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||O===e.memoizedProps&&ue===e.memoizedState||(t.flags|=1024),a=!1)}return C=a,Pl(e,t),a=(t.flags&128)!==0,C||a?(C=t.stateNode,i=a&&typeof i.getDerivedStateFromError!="function"?null:C.render(),t.flags|=1,e!==null&&a?(t.child=Ir(t,e.child,null,m),t.child=Ir(t,null,i,m)):Kt(e,t,i,m),t.memoizedState=C.state,e=t.child):e=Ti(e,t,m),e}function Zd(e,t,i,a){return Or(),t.flags|=256,Kt(e,t,i,a),t.child}var Vc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Kc(e){return{baseLanes:e,cachePool:Ff()}}function Wc(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=Bn),e}function ep(e,t,i){var a=t.pendingProps,m=!1,C=(t.flags&128)!==0,O;if((O=C)||(O=e!==null&&e.memoizedState===null?!1:(Et.current&2)!==0),O&&(m=!0,t.flags&=-129),O=(t.flags&32)!==0,t.flags&=-33,e===null){if(Xe){if(m?nr(t):ir(),(e=mt)?(e=om(e,$n),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Yi!==null?{id:ci,overflow:ui}:null,retryLane:536870912,hydrationErrors:null},i=Of(e),i.return=t,t.child=i,Gt=t,mt=null)):e=null,e===null)throw Qi(t);return Du(e)?t.lanes=32:t.lanes=536870912,null}var F=a.children;return a=a.fallback,m?(ir(),m=t.mode,F=Fl({mode:"hidden",children:F},m),a=Lr(a,m,i,null),F.return=t,a.return=t,F.sibling=a,t.child=F,a=t.child,a.memoizedState=Kc(i),a.childLanes=Wc(e,O,i),t.memoizedState=Vc,ba(null,a)):(nr(t),Yc(t,F))}var J=e.memoizedState;if(J!==null&&(F=J.dehydrated,F!==null)){if(C)t.flags&256?(nr(t),t.flags&=-257,t=Xc(e,t,i)):t.memoizedState!==null?(ir(),t.child=e.child,t.flags|=128,t=null):(ir(),F=a.fallback,m=t.mode,a=Fl({mode:"visible",children:a.children},m),F=Lr(F,m,i,null),F.flags|=2,a.return=t,F.return=t,a.sibling=F,t.child=a,Ir(t,e.child,null,i),a=t.child,a.memoizedState=Kc(i),a.childLanes=Wc(e,O,i),t.memoizedState=Vc,t=ba(null,a));else if(nr(t),Du(F)){if(O=F.nextSibling&&F.nextSibling.dataset,O)var ce=O.dgst;O=ce,a=Error(l(419)),a.stack="",a.digest=O,ca({value:a,source:null,stack:null}),t=Xc(e,t,i)}else if(Dt||ms(e,t,i,!1),O=(i&e.childLanes)!==0,Dt||O){if(O=ht,O!==null&&(a=Xr(O,i),a!==0&&a!==J.retryLane))throw J.retryLane=a,Mr(e,a),Cn(O,e,a),$c;Tu(F)||Ql(),t=Xc(e,t,i)}else Tu(F)?(t.flags|=192,t.child=e.child,t=null):(e=J.treeContext,mt=Vn(F.nextSibling),Gt=t,Xe=!0,Xi=null,$n=!1,e!==null&&Nf(t,e),t=Yc(t,a.children),t.flags|=4096);return t}return m?(ir(),F=a.fallback,m=t.mode,J=e.child,ce=J.sibling,a=wi(J,{mode:"hidden",children:a.children}),a.subtreeFlags=J.subtreeFlags&65011712,ce!==null?F=wi(ce,F):(F=Lr(F,m,i,null),F.flags|=2),F.return=t,a.return=t,a.sibling=F,t.child=a,ba(null,a),a=t.child,F=e.child.memoizedState,F===null?F=Kc(i):(m=F.cachePool,m!==null?(J=Rt._currentValue,m=m.parent!==J?{parent:J,pool:J}:m):m=Ff(),F={baseLanes:F.baseLanes|i,cachePool:m}),a.memoizedState=F,a.childLanes=Wc(e,O,i),t.memoizedState=Vc,ba(e.child,a)):(nr(t),i=e.child,e=i.sibling,i=wi(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 Yc(e,t){return t=Fl({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Fl(e,t){return e=Dn(22,e,null,t),e.lanes=0,e}function Xc(e,t,i){return Ir(t,e.child,null,i),e=Yc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function tp(e,t,i){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),hc(e.return,t,i)}function Qc(e,t,i,a,m,C){var O=e.memoizedState;O===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:i,tailMode:m,treeForkCount:C}:(O.isBackwards=t,O.rendering=null,O.renderingStartTime=0,O.last=a,O.tail=i,O.tailMode=m,O.treeForkCount=C)}function np(e,t,i){var a=t.pendingProps,m=a.revealOrder,C=a.tail;a=a.children;var O=Et.current,F=(O&2)!==0;if(F?(O=O&1|2,t.flags|=128):O&=1,I(Et,O),Kt(e,t,a,i),a=Xe?oa:0,!F&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&tp(e,i,t);else if(e.tag===19)tp(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&&Dl(e)===null&&(m=i),i=i.sibling;i=m,i===null?(m=t.child,t.child=null):(m=i.sibling,i.sibling=null),Qc(t,!1,m,i,C,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&&Dl(e)===null){t.child=m;break}e=m.sibling,m.sibling=i,i=m,m=e}Qc(t,!0,i,null,C,a);break;case"together":Qc(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function Ti(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),ar|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(ms(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(l(153));if(t.child!==null){for(e=t.child,i=wi(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=wi(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function Jc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Cl(e)))}function Ey(e,t,i){switch(t.tag){case 3:q(t,t.stateNode.containerInfo),Ji(t,Rt,e.memoizedState.cache),Or();break;case 27:case 5:ee(t);break;case 4:q(t,t.stateNode.containerInfo);break;case 10:Ji(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,wc(t),null;break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(nr(t),t.flags|=128,null):(i&t.child.childLanes)!==0?ep(e,t,i):(nr(t),e=Ti(e,t,i),e!==null?e.sibling:null);nr(t);break;case 19:var m=(e.flags&128)!==0;if(a=(i&t.childLanes)!==0,a||(ms(e,t,i,!1),a=(i&t.childLanes)!==0),m){if(a)return np(e,t,i);t.flags|=128}if(m=t.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),I(Et,Et.current),a)break;return null;case 22:return t.lanes=0,Wd(e,t,i,t.pendingProps);case 24:Ji(t,Rt,e.memoizedState.cache)}return Ti(e,t,i)}function ip(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)Dt=!0;else{if(!Jc(e,i)&&(t.flags&128)===0)return Dt=!1,Ey(e,t,i);Dt=(e.flags&131072)!==0}else Dt=!1,Xe&&(t.flags&1048576)!==0&&jf(t,oa,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=Hr(t.elementType),t.type=e,typeof e=="function")ic(e)?(a=Pr(e,a),t.tag=1,t=Jd(null,t,e,a,i)):(t.tag=0,t=Gc(null,t,e,a,i));else{if(e!=null){var m=e.$$typeof;if(m===A){t.tag=11,t=Gd(null,t,e,a,i);break e}else if(m===T){t.tag=14,t=Vd(null,t,e,a,i);break e}}throw t=Y(e)||e,Error(l(306,t,""))}}return t;case 0:return Gc(e,t,t.type,t.pendingProps,i);case 1:return a=t.type,m=Pr(a,t.pendingProps),Jd(e,t,a,m,i);case 3:e:{if(q(t,t.stateNode.containerInfo),e===null)throw Error(l(387));a=t.pendingProps;var C=t.memoizedState;m=C.element,vc(e,t),ga(t,a,null,i);var O=t.memoizedState;if(a=O.cache,Ji(t,Rt,a),a!==C.cache&&fc(t,[Rt],i,!0),ma(),a=O.element,C.isDehydrated)if(C={element:a,isDehydrated:!1,cache:O.cache},t.updateQueue.baseState=C,t.memoizedState=C,t.flags&256){t=Zd(e,t,a,i);break e}else if(a!==m){m=Pn(Error(l(424)),t),ca(m),t=Zd(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(mt=Vn(e.firstChild),Gt=t,Xe=!0,Xi=null,$n=!0,i=Wf(t,null,a,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(Or(),a===m){t=Ti(e,t,i);break e}Kt(e,t,a,i)}t=t.child}return t;case 26:return Pl(e,t),e===null?(i=pm(t.type,null,t.pendingProps,null))?t.memoizedState=i:Xe||(i=t.type,e=t.pendingProps,a=ro(he.current).createElement(i),a[At]=t,a[qt]=e,Wt(a,i,e),ut(a),t.stateNode=a):t.memoizedState=pm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ee(t),e===null&&Xe&&(a=t.stateNode=hm(t.type,t.pendingProps,he.current),Gt=t,$n=!0,m=mt,hr(t.type)?(Mu=m,mt=Vn(a.firstChild)):mt=m),Kt(e,t,t.pendingProps.children,i),Pl(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Xe&&((m=a=mt)&&(a=t0(a,t.type,t.pendingProps,$n),a!==null?(t.stateNode=a,Gt=t,mt=Vn(a.firstChild),$n=!1,m=!0):m=!1),m||Qi(t)),ee(t),m=t.type,C=t.pendingProps,O=e!==null?e.memoizedProps:null,a=C.children,ku(m,C)?a=null:O!==null&&ku(m,O)&&(t.flags|=32),t.memoizedState!==null&&(m=Ec(e,t,gy,null,null,i),Na._currentValue=m),Pl(e,t),Kt(e,t,a,i),t.child;case 6:return e===null&&Xe&&((e=i=mt)&&(i=n0(i,t.pendingProps,$n),i!==null?(t.stateNode=i,Gt=t,mt=null,e=!0):e=!1),e||Qi(t)),null;case 13:return ep(e,t,i);case 4:return q(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=Ir(t,null,a,i):Kt(e,t,a,i),t.child;case 11:return Gd(e,t,t.type,t.pendingProps,i);case 7:return Kt(e,t,t.pendingProps,i),t.child;case 8:return Kt(e,t,t.pendingProps.children,i),t.child;case 12:return Kt(e,t,t.pendingProps.children,i),t.child;case 10:return a=t.pendingProps,Ji(t,t.type,a.value),Kt(e,t,a.children,i),t.child;case 9:return m=t.type._context,a=t.pendingProps.children,jr(t),m=Vt(m),a=a(m),t.flags|=1,Kt(e,t,a,i),t.child;case 14:return Vd(e,t,t.type,t.pendingProps,i);case 15:return Kd(e,t,t.type,t.pendingProps,i);case 19:return np(e,t,i);case 31:return xy(e,t,i);case 22:return Wd(e,t,i,t.pendingProps);case 24:return jr(t),a=Vt(Rt),e===null?(m=mc(),m===null&&(m=ht,C=dc(),m.pooledCache=C,C.refCount++,C!==null&&(m.pooledCacheLanes|=i),m=C),t.memoizedState={parent:a,cache:m},_c(t),Ji(t,Rt,m)):((e.lanes&i)!==0&&(vc(e,t),ga(t,null,null,i),ma()),m=e.memoizedState,C=t.memoizedState,m.parent!==a?(m={parent:a,cache:a},t.memoizedState=m,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=m),Ji(t,Rt,a)):(a=C.cache,Ji(t,Rt,a),a!==m.cache&&fc(t,[Rt],i,!0))),Kt(e,t,t.pendingProps.children,i),t.child;case 29:throw t.pendingProps}throw Error(l(156,t.tag))}function Di(e){e.flags|=4}function Zc(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(Dp())e.flags|=8192;else throw zr=kl,gc}else e.flags&=-16777217}function rp(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!ym(t))if(Dp())e.flags|=8192;else throw zr=kl,gc}function ql(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ht():536870912,e.lanes|=t,As|=t)}function Ca(e,t){if(!Xe)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 gt(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 ky(e,t,i){var a=t.pendingProps;switch(lc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return gt(t),null;case 1:return gt(t),null;case 3:return i=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),ki(Rt),ie(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(ps(t)?Di(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,cc())),gt(t),null;case 26:var m=t.type,C=t.memoizedState;return e===null?(Di(t),C!==null?(gt(t),rp(t,C)):(gt(t),Zc(t,m,null,a,i))):C?C!==e.memoizedState?(Di(t),gt(t),rp(t,C)):(gt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&Di(t),gt(t),Zc(t,m,e,a,i)),null;case 27:if(le(t),i=he.current,m=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&Di(t);else{if(!a){if(t.stateNode===null)throw Error(l(166));return gt(t),null}e=se.current,ps(t)?Hf(t):(e=hm(m,a,i),t.stateNode=e,Di(t))}return gt(t),null;case 5:if(le(t),m=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&Di(t);else{if(!a){if(t.stateNode===null)throw Error(l(166));return gt(t),null}if(C=se.current,ps(t))Hf(t);else{var O=ro(he.current);switch(C){case 1:C=O.createElementNS("http://www.w3.org/2000/svg",m);break;case 2:C=O.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;default:switch(m){case"svg":C=O.createElementNS("http://www.w3.org/2000/svg",m);break;case"math":C=O.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;case"script":C=O.createElement("div"),C.innerHTML="<script><\/script>",C=C.removeChild(C.firstChild);break;case"select":C=typeof a.is=="string"?O.createElement("select",{is:a.is}):O.createElement("select"),a.multiple?C.multiple=!0:a.size&&(C.size=a.size);break;default:C=typeof a.is=="string"?O.createElement(m,{is:a.is}):O.createElement(m)}}C[At]=t,C[qt]=a;e:for(O=t.child;O!==null;){if(O.tag===5||O.tag===6)C.appendChild(O.stateNode);else if(O.tag!==4&&O.tag!==27&&O.child!==null){O.child.return=O,O=O.child;continue}if(O===t)break e;for(;O.sibling===null;){if(O.return===null||O.return===t)break e;O=O.return}O.sibling.return=O.return,O=O.sibling}t.stateNode=C;e:switch(Wt(C,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&&Di(t)}}return gt(t),Zc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&Di(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(l(166));if(e=he.current,ps(t)){if(e=t.stateNode,i=t.memoizedProps,a=null,m=Gt,m!==null)switch(m.tag){case 27:case 5:a=m.memoizedProps}e[At]=t,e=!!(e.nodeValue===i||a!==null&&a.suppressHydrationWarning===!0||em(e.nodeValue,i)),e||Qi(t,!0)}else e=ro(e).createTextNode(a),e[At]=t,t.stateNode=e}return gt(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(a=ps(t),i!==null){if(e===null){if(!a)throw Error(l(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(557));e[At]=t}else Or(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;gt(t),e=!1}else i=cc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?(Ln(t),t):(Ln(t),null);if((t.flags&128)!==0)throw Error(l(558))}return gt(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(m=ps(t),a!==null&&a.dehydrated!==null){if(e===null){if(!m)throw Error(l(318));if(m=t.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(l(317));m[At]=t}else Or(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;gt(t),m=!1}else m=cc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=m),m=!0;if(!m)return t.flags&256?(Ln(t),t):(Ln(t),null)}return Ln(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),C=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(C=a.memoizedState.cachePool.pool),C!==m&&(a.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),ql(t,t.updateQueue),gt(t),null);case 4:return ie(),e===null&&bu(t.stateNode.containerInfo),gt(t),null;case 10:return ki(t.type),gt(t),null;case 19:if($(Et),a=t.memoizedState,a===null)return gt(t),null;if(m=(t.flags&128)!==0,C=a.rendering,C===null)if(m)Ca(a,!1);else{if(Ct!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(C=Dl(e),C!==null){for(t.flags|=128,Ca(a,!1),e=C.updateQueue,t.updateQueue=e,ql(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)Lf(i,e),i=i.sibling;return I(Et,Et.current&1|2),Xe&&xi(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&it()>Wl&&(t.flags|=128,m=!0,Ca(a,!1),t.lanes=4194304)}else{if(!m)if(e=Dl(C),e!==null){if(t.flags|=128,m=!0,e=e.updateQueue,t.updateQueue=e,ql(t,e),Ca(a,!0),a.tail===null&&a.tailMode==="hidden"&&!C.alternate&&!Xe)return gt(t),null}else 2*it()-a.renderingStartTime>Wl&&i!==536870912&&(t.flags|=128,m=!0,Ca(a,!1),t.lanes=4194304);a.isBackwards?(C.sibling=t.child,t.child=C):(e=a.last,e!==null?e.sibling=C:t.child=C,a.last=C)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=it(),e.sibling=null,i=Et.current,I(Et,m?i&1|2:i&1),Xe&&xi(t,a.treeForkCount),e):(gt(t),null);case 22:case 23:return Ln(t),Cc(),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&&(gt(t),t.subtreeFlags&6&&(t.flags|=8192)):gt(t),i=t.updateQueue,i!==null&&ql(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&&$(Nr),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),ki(Rt),gt(t),null;case 25:return null;case 30:return null}throw Error(l(156,t.tag))}function Ay(e,t){switch(lc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ki(Rt),ie(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return le(t),null;case 31:if(t.memoizedState!==null){if(Ln(t),t.alternate===null)throw Error(l(340));Or()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ln(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(l(340));Or()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return $(Et),null;case 4:return ie(),null;case 10:return ki(t.type),null;case 22:case 23:return Ln(t),Cc(),e!==null&&$(Nr),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ki(Rt),null;case 25:return null;default:return null}}function sp(e,t){switch(lc(t),t.tag){case 3:ki(Rt),ie();break;case 26:case 27:case 5:le(t);break;case 4:ie();break;case 31:t.memoizedState!==null&&Ln(t);break;case 13:Ln(t);break;case 19:$(Et);break;case 10:ki(t.type);break;case 22:case 23:Ln(t),Cc(),e!==null&&$(Nr);break;case 24:ki(Rt)}}function wa(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 C=i.create,O=i.inst;a=C(),O.destroy=a}i=i.next}while(i!==m)}}catch(F){st(t,t.return,F)}}function rr(e,t,i){try{var a=t.updateQueue,m=a!==null?a.lastEffect:null;if(m!==null){var C=m.next;a=C;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,ce=F;try{ce()}catch(me){st(m,J,me)}}}a=a.next}while(a!==C)}}catch(me){st(t,t.return,me)}}function ap(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{Xf(t,i)}catch(a){st(e,e.return,a)}}}function lp(e,t,i){i.props=Pr(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(a){st(e,t,a)}}function xa(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){st(e,t,m)}}function hi(e,t){var i=e.ref,a=e.refCleanup;if(i!==null)if(typeof a=="function")try{a()}catch(m){st(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){st(e,t,m)}else i.current=null}function op(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){st(e,e.return,m)}}function eu(e,t,i){try{var a=e.stateNode;Yy(a,e.type,i,t),a[qt]=t}catch(m){st(e,e.return,m)}}function cp(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&hr(e.type)||e.tag===4}function tu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||cp(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&&hr(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 nu(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=Rn));else if(a!==4&&(a===27&&hr(e.type)&&(i=e.stateNode,t=null),e=e.child,e!==null))for(nu(e,t,i),e=e.sibling;e!==null;)nu(e,t,i),e=e.sibling}function $l(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&&hr(e.type)&&(i=e.stateNode),e=e.child,e!==null))for($l(e,t,i),e=e.sibling;e!==null;)$l(e,t,i),e=e.sibling}function up(e){var t=e.stateNode,i=e.memoizedProps;try{for(var a=e.type,m=t.attributes;m.length;)t.removeAttributeNode(m[0]);Wt(t,a,i),t[At]=e,t[qt]=i}catch(C){st(e,e.return,C)}}var Mi=!1,Mt=!1,iu=!1,hp=typeof WeakSet=="function"?WeakSet:Set,It=null;function Ry(e,t){if(e=e.containerInfo,xu=ho,e=wf(e),Xo(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,C=a.focusNode;a=a.focusOffset;try{i.nodeType,C.nodeType}catch{i=null;break e}var O=0,F=-1,J=-1,ce=0,me=0,_e=e,ue=null;t:for(;;){for(var de;_e!==i||m!==0&&_e.nodeType!==3||(F=O+m),_e!==C||a!==0&&_e.nodeType!==3||(J=O+a),_e.nodeType===3&&(O+=_e.nodeValue.length),(de=_e.firstChild)!==null;)ue=_e,_e=de;for(;;){if(_e===e)break t;if(ue===i&&++ce===m&&(F=O),ue===C&&++me===a&&(J=O),(de=_e.nextSibling)!==null)break;_e=ue,ue=_e.parentNode}_e=de}i=F===-1||J===-1?null:{start:F,end:J}}else i=null}i=i||{start:0,end:0}}else i=null;for(Eu={focusedElem:e,selectionRange:i},ho=!1,It=t;It!==null;)if(t=It,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,It=e;else for(;It!==null;){switch(t=It,C=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(i=0;i<e.length;i++)m=e[i],m.ref.impl=m.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&C!==null){e=void 0,i=t,m=C.memoizedProps,C=C.memoizedState,a=i.stateNode;try{var xe=Pr(i.type,m);e=a.getSnapshotBeforeUpdate(xe,C),a.__reactInternalSnapshotBeforeUpdate=e}catch(Be){st(i,i.return,Be)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,i=e.nodeType,i===9)Ru(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Ru(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(l(163))}if(e=t.sibling,e!==null){e.return=t.return,It=e;break}It=t.return}}function fp(e,t,i){var a=i.flags;switch(i.tag){case 0:case 11:case 15:Oi(e,i),a&4&&wa(5,i);break;case 1:if(Oi(e,i),a&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(O){st(i,i.return,O)}else{var m=Pr(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(m,t,e.__reactInternalSnapshotBeforeUpdate)}catch(O){st(i,i.return,O)}}a&64&&ap(i),a&512&&xa(i,i.return);break;case 3:if(Oi(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{Xf(e,t)}catch(O){st(i,i.return,O)}}break;case 27:t===null&&a&4&&up(i);case 26:case 5:Oi(e,i),t===null&&a&4&&op(i),a&512&&xa(i,i.return);break;case 12:Oi(e,i);break;case 31:Oi(e,i),a&4&&mp(e,i);break;case 13:Oi(e,i),a&4&&gp(e,i),a&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=Hy.bind(null,i),i0(e,i))));break;case 22:if(a=i.memoizedState!==null||Mi,!a){t=t!==null&&t.memoizedState!==null||Mt,m=Mi;var C=Mt;Mi=a,(Mt=t)&&!C?Bi(e,i,(i.subtreeFlags&8772)!==0):Oi(e,i),Mi=m,Mt=C}break;case 30:break;default:Oi(e,i)}}function dp(e){var t=e.alternate;t!==null&&(e.alternate=null,dp(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 vt=null,vn=!1;function Li(e,t,i){for(i=i.child;i!==null;)pp(e,t,i),i=i.sibling}function pp(e,t,i){if(yt&&typeof yt.onCommitFiberUnmount=="function")try{yt.onCommitFiberUnmount(St,i)}catch{}switch(i.tag){case 26:Mt||hi(i,t),Li(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:Mt||hi(i,t);var a=vt,m=vn;hr(i.type)&&(vt=i.stateNode,vn=!1),Li(e,t,i),Oa(i.stateNode),vt=a,vn=m;break;case 5:Mt||hi(i,t);case 6:if(a=vt,m=vn,vt=null,Li(e,t,i),vt=a,vn=m,vt!==null)if(vn)try{(vt.nodeType===9?vt.body:vt.nodeName==="HTML"?vt.ownerDocument.body:vt).removeChild(i.stateNode)}catch(C){st(i,t,C)}else try{vt.removeChild(i.stateNode)}catch(C){st(i,t,C)}break;case 18:vt!==null&&(vn?(e=vt,am(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),js(e)):am(vt,i.stateNode));break;case 4:a=vt,m=vn,vt=i.stateNode.containerInfo,vn=!0,Li(e,t,i),vt=a,vn=m;break;case 0:case 11:case 14:case 15:rr(2,i,t),Mt||rr(4,i,t),Li(e,t,i);break;case 1:Mt||(hi(i,t),a=i.stateNode,typeof a.componentWillUnmount=="function"&&lp(i,t,a)),Li(e,t,i);break;case 21:Li(e,t,i);break;case 22:Mt=(a=Mt)||i.memoizedState!==null,Li(e,t,i),Mt=a;break;default:Li(e,t,i)}}function mp(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{js(e)}catch(i){st(t,t.return,i)}}}function gp(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{js(e)}catch(i){st(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 hp),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new hp),t;default:throw Error(l(435,e.tag))}}function Gl(e,t){var i=Ty(e);t.forEach(function(a){if(!i.has(a)){i.add(a);var m=zy.bind(null,e,a);a.then(m,m)}})}function yn(e,t){var i=t.deletions;if(i!==null)for(var a=0;a<i.length;a++){var m=i[a],C=e,O=t,F=O;e:for(;F!==null;){switch(F.tag){case 27:if(hr(F.type)){vt=F.stateNode,vn=!1;break e}break;case 5:vt=F.stateNode,vn=!1;break e;case 3:case 4:vt=F.stateNode.containerInfo,vn=!0;break e}F=F.return}if(vt===null)throw Error(l(160));pp(C,O,m),vt=null,vn=!1,C=m.alternate,C!==null&&(C.return=null),m.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)_p(t,e),t=t.sibling}var ii=null;function _p(e,t){var i=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:yn(t,e),Sn(e),a&4&&(rr(3,e,e.return),wa(3,e),rr(5,e,e.return));break;case 1:yn(t,e),Sn(e),a&512&&(Mt||i===null||hi(i,i.return)),a&64&&Mi&&(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=ii;if(yn(t,e),Sn(e),a&512&&(Mt||i===null||hi(i,i.return)),a&4){var C=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":C=m.getElementsByTagName("title")[0],(!C||C[zn]||C[At]||C.namespaceURI==="http://www.w3.org/2000/svg"||C.hasAttribute("itemprop"))&&(C=m.createElement(a),m.head.insertBefore(C,m.querySelector("head > title"))),Wt(C,a,i),C[At]=e,ut(C),a=C;break e;case"link":var O=_m("link","href",m).get(a+(i.href||""));if(O){for(var F=0;F<O.length;F++)if(C=O[F],C.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&C.getAttribute("rel")===(i.rel==null?null:i.rel)&&C.getAttribute("title")===(i.title==null?null:i.title)&&C.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){O.splice(F,1);break t}}C=m.createElement(a),Wt(C,a,i),m.head.appendChild(C);break;case"meta":if(O=_m("meta","content",m).get(a+(i.content||""))){for(F=0;F<O.length;F++)if(C=O[F],C.getAttribute("content")===(i.content==null?null:""+i.content)&&C.getAttribute("name")===(i.name==null?null:i.name)&&C.getAttribute("property")===(i.property==null?null:i.property)&&C.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&C.getAttribute("charset")===(i.charSet==null?null:i.charSet)){O.splice(F,1);break t}}C=m.createElement(a),Wt(C,a,i),m.head.appendChild(C);break;default:throw Error(l(468,a))}C[At]=e,ut(C),a=C}e.stateNode=a}else vm(m,e.type,e.stateNode);else e.stateNode=gm(m,a,e.memoizedProps);else C!==a?(C===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):C.count--,a===null?vm(m,e.type,e.stateNode):gm(m,a,e.memoizedProps)):a===null&&e.stateNode!==null&&eu(e,e.memoizedProps,i.memoizedProps)}break;case 27:yn(t,e),Sn(e),a&512&&(Mt||i===null||hi(i,i.return)),i!==null&&a&4&&eu(e,e.memoizedProps,i.memoizedProps);break;case 5:if(yn(t,e),Sn(e),a&512&&(Mt||i===null||hi(i,i.return)),e.flags&32){m=e.stateNode;try{Gi(m,"")}catch(xe){st(e,e.return,xe)}}a&4&&e.stateNode!=null&&(m=e.memoizedProps,eu(e,m,i!==null?i.memoizedProps:m)),a&1024&&(iu=!0);break;case 6:if(yn(t,e),Sn(e),a&4){if(e.stateNode===null)throw Error(l(162));a=e.memoizedProps,i=e.stateNode;try{i.nodeValue=a}catch(xe){st(e,e.return,xe)}}break;case 3:if(lo=null,m=ii,ii=so(t.containerInfo),yn(t,e),ii=m,Sn(e),a&4&&i!==null&&i.memoizedState.isDehydrated)try{js(t.containerInfo)}catch(xe){st(e,e.return,xe)}iu&&(iu=!1,vp(e));break;case 4:a=ii,ii=so(e.stateNode.containerInfo),yn(t,e),Sn(e),ii=a;break;case 12:yn(t,e),Sn(e);break;case 31:yn(t,e),Sn(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Gl(e,a)));break;case 13:yn(t,e),Sn(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(Kl=it()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Gl(e,a)));break;case 22:m=e.memoizedState!==null;var J=i!==null&&i.memoizedState!==null,ce=Mi,me=Mt;if(Mi=ce||m,Mt=me||J,yn(t,e),Mt=me,Mi=ce,Sn(e),a&8192)e:for(t=e.stateNode,t._visibility=m?t._visibility&-2:t._visibility|1,m&&(i===null||J||Mi||Mt||Fr(e)),i=null,t=e;;){if(t.tag===5||t.tag===26){if(i===null){J=i=t;try{if(C=J.stateNode,m)O=C.style,typeof O.setProperty=="function"?O.setProperty("display","none","important"):O.display="none";else{F=J.stateNode;var _e=J.memoizedProps.style,ue=_e!=null&&_e.hasOwnProperty("display")?_e.display:null;F.style.display=ue==null||typeof ue=="boolean"?"":(""+ue).trim()}}catch(xe){st(J,J.return,xe)}}}else if(t.tag===6){if(i===null){J=t;try{J.stateNode.nodeValue=m?"":J.memoizedProps}catch(xe){st(J,J.return,xe)}}}else if(t.tag===18){if(i===null){J=t;try{var de=J.stateNode;m?lm(de,!0):lm(J.stateNode,!1)}catch(xe){st(J,J.return,xe)}}}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,Gl(e,i))));break;case 19:yn(t,e),Sn(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Gl(e,a)));break;case 30:break;case 21:break;default:yn(t,e),Sn(e)}}function Sn(e){var t=e.flags;if(t&2){try{for(var i,a=e.return;a!==null;){if(cp(a)){i=a;break}a=a.return}if(i==null)throw Error(l(160));switch(i.tag){case 27:var m=i.stateNode,C=tu(e);$l(e,C,m);break;case 5:var O=i.stateNode;i.flags&32&&(Gi(O,""),i.flags&=-33);var F=tu(e);$l(e,F,O);break;case 3:case 4:var J=i.stateNode.containerInfo,ce=tu(e);nu(e,ce,J);break;default:throw Error(l(161))}}catch(me){st(e,e.return,me)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function vp(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;vp(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Oi(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)fp(e,t.alternate,t),t=t.sibling}function Fr(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:rr(4,t,t.return),Fr(t);break;case 1:hi(t,t.return);var i=t.stateNode;typeof i.componentWillUnmount=="function"&&lp(t,t.return,i),Fr(t);break;case 27:Oa(t.stateNode);case 26:case 5:hi(t,t.return),Fr(t);break;case 22:t.memoizedState===null&&Fr(t);break;case 30:Fr(t);break;default:Fr(t)}e=e.sibling}}function Bi(e,t,i){for(i=i&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,m=e,C=t,O=C.flags;switch(C.tag){case 0:case 11:case 15:Bi(m,C,i),wa(4,C);break;case 1:if(Bi(m,C,i),a=C,m=a.stateNode,typeof m.componentDidMount=="function")try{m.componentDidMount()}catch(ce){st(a,a.return,ce)}if(a=C,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++)Yf(J[m],F)}catch(ce){st(a,a.return,ce)}}i&&O&64&&ap(C),xa(C,C.return);break;case 27:up(C);case 26:case 5:Bi(m,C,i),i&&a===null&&O&4&&op(C),xa(C,C.return);break;case 12:Bi(m,C,i);break;case 31:Bi(m,C,i),i&&O&4&&mp(m,C);break;case 13:Bi(m,C,i),i&&O&4&&gp(m,C);break;case 22:C.memoizedState===null&&Bi(m,C,i),xa(C,C.return);break;case 30:break;default:Bi(m,C,i)}t=t.sibling}}function ru(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&&ua(i))}function su(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ua(e))}function ri(e,t,i,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)yp(e,t,i,a),t=t.sibling}function yp(e,t,i,a){var m=t.flags;switch(t.tag){case 0:case 11:case 15:ri(e,t,i,a),m&2048&&wa(9,t);break;case 1:ri(e,t,i,a);break;case 3:ri(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&&ua(e)));break;case 12:if(m&2048){ri(e,t,i,a),e=t.stateNode;try{var C=t.memoizedProps,O=C.id,F=C.onPostCommit;typeof F=="function"&&F(O,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(J){st(t,t.return,J)}}else ri(e,t,i,a);break;case 31:ri(e,t,i,a);break;case 13:ri(e,t,i,a);break;case 23:break;case 22:C=t.stateNode,O=t.alternate,t.memoizedState!==null?C._visibility&2?ri(e,t,i,a):Ea(e,t):C._visibility&2?ri(e,t,i,a):(C._visibility|=2,xs(e,t,i,a,(t.subtreeFlags&10256)!==0||!1)),m&2048&&ru(O,t);break;case 24:ri(e,t,i,a),m&2048&&su(t.alternate,t);break;default:ri(e,t,i,a)}}function xs(e,t,i,a,m){for(m=m&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var C=e,O=t,F=i,J=a,ce=O.flags;switch(O.tag){case 0:case 11:case 15:xs(C,O,F,J,m),wa(8,O);break;case 23:break;case 22:var me=O.stateNode;O.memoizedState!==null?me._visibility&2?xs(C,O,F,J,m):Ea(C,O):(me._visibility|=2,xs(C,O,F,J,m)),m&&ce&2048&&ru(O.alternate,O);break;case 24:xs(C,O,F,J,m),m&&ce&2048&&su(O.alternate,O);break;default:xs(C,O,F,J,m)}t=t.sibling}}function Ea(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:Ea(i,a),m&2048&&ru(a.alternate,a);break;case 24:Ea(i,a),m&2048&&su(a.alternate,a);break;default:Ea(i,a)}t=t.sibling}}var ka=8192;function Es(e,t,i){if(e.subtreeFlags&ka)for(e=e.child;e!==null;)Sp(e,t,i),e=e.sibling}function Sp(e,t,i){switch(e.tag){case 26:Es(e,t,i),e.flags&ka&&e.memoizedState!==null&&m0(i,ii,e.memoizedState,e.memoizedProps);break;case 5:Es(e,t,i);break;case 3:case 4:var a=ii;ii=so(e.stateNode.containerInfo),Es(e,t,i),ii=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=ka,ka=16777216,Es(e,t,i),ka=a):Es(e,t,i));break;default:Es(e,t,i)}}function bp(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 Aa(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];It=a,wp(a,e)}bp(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Cp(e),e=e.sibling}function Cp(e){switch(e.tag){case 0:case 11:case 15:Aa(e),e.flags&2048&&rr(9,e,e.return);break;case 3:Aa(e);break;case 12:Aa(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Vl(e)):Aa(e);break;default:Aa(e)}}function Vl(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];It=a,wp(a,e)}bp(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:rr(8,t,t.return),Vl(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,Vl(t));break;default:Vl(t)}e=e.sibling}}function wp(e,t){for(;It!==null;){var i=It;switch(i.tag){case 0:case 11:case 15:rr(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:ua(i.memoizedState.cache)}if(a=i.child,a!==null)a.return=i,It=a;else e:for(i=e;It!==null;){a=It;var m=a.sibling,C=a.return;if(dp(a),a===i){It=null;break e}if(m!==null){m.return=C,It=m;break e}It=C}}}var Dy={getCacheForType:function(e){var t=Vt(Rt),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return Vt(Rt).controller.signal}},My=typeof WeakMap=="function"?WeakMap:Map,nt=0,ht=null,Ge=null,We=0,rt=0,On=null,sr=!1,ks=!1,au=!1,ji=0,Ct=0,ar=0,qr=0,lu=0,Bn=0,As=0,Ra=null,bn=null,ou=!1,Kl=0,xp=0,Wl=1/0,Yl=null,lr=null,jt=0,or=null,Rs=null,Ni=0,cu=0,uu=null,Ep=null,Ta=0,hu=null;function jn(){return(nt&2)!==0&&We!==0?We&-We:V.T!==null?_u():Jn()}function kp(){if(Bn===0)if((We&536870912)===0||Xe){var e=Xn;Xn<<=1,(Xn&3932160)===0&&(Xn=262144),Bn=e}else Bn=536870912;return e=Mn.current,e!==null&&(e.flags|=32),Bn}function Cn(e,t,i){(e===ht&&(rt===2||rt===9)||e.cancelPendingCommit!==null)&&(Ts(e,0),cr(e,We,Bn,!1)),Ft(e,i),((nt&2)===0||e!==ht)&&(e===ht&&((nt&2)===0&&(qr|=i),Ct===4&&cr(e,We,Bn,!1)),fi(e))}function Ap(e,t,i){if((nt&6)!==0)throw Error(l(327));var a=!i&&(t&127)===0&&(t&e.expiredLanes)===0||Xt(e,t),m=a?By(e,t):du(e,t,!0),C=a;do{if(m===0){ks&&!a&&cr(e,t,0,!1);break}else{if(i=e.current.alternate,C&&!Ly(i)){m=du(e,t,!1),C=!1;continue}if(m===2){if(C=t,e.errorRecoveryDisabledLanes&C)var O=0;else O=e.pendingLanes&-536870913,O=O!==0?O:O&536870912?536870912:0;if(O!==0){t=O;e:{var F=e;m=Ra;var J=F.current.memoizedState.isDehydrated;if(J&&(Ts(F,O).flags|=256),O=du(F,O,!1),O!==2){if(au&&!J){F.errorRecoveryDisabledLanes|=C,qr|=C,m=4;break e}C=bn,bn=m,C!==null&&(bn===null?bn=C:bn.push.apply(bn,C))}m=O}if(C=!1,m!==2)continue}}if(m===1){Ts(e,0),cr(e,t,0,!0);break}e:{switch(a=e,C=m,C){case 0:case 1:throw Error(l(345));case 4:if((t&4194048)!==t)break;case 6:cr(a,t,Bn,!sr);break e;case 2:bn=null;break;case 3:case 5:break;default:throw Error(l(329))}if((t&62914560)===t&&(m=Kl+300-it(),10<m)){if(cr(a,t,Bn,!sr),Qn(a,0,!0)!==0)break e;Ni=t,a.timeoutHandle=rm(Rp.bind(null,a,i,bn,Yl,ou,t,Bn,qr,As,sr,C,"Throttled",-0,0),m);break e}Rp(a,i,bn,Yl,ou,t,Bn,qr,As,sr,C,null,-0,0)}}break}while(!0);fi(e)}function Rp(e,t,i,a,m,C,O,F,J,ce,me,_e,ue,de){if(e.timeoutHandle=-1,_e=t.subtreeFlags,_e&8192||(_e&16785408)===16785408){_e={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Rn},Sp(t,C,_e);var xe=(C&62914560)===C?Kl-it():(C&4194048)===C?xp-it():0;if(xe=g0(_e,xe),xe!==null){Ni=C,e.cancelPendingCommit=xe(Np.bind(null,e,t,C,i,a,m,O,F,J,me,_e,null,ue,de)),cr(e,C,O,!ce);return}}Np(e,t,C,i,a,m,O,F,J)}function Ly(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],C=m.getSnapshot;m=m.value;try{if(!Tn(C(),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 cr(e,t,i,a){t&=~lu,t&=~qr,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var m=t;0<m;){var C=31-Ze(m),O=1<<C;a[C]=-1,m&=~O}i!==0&&Ue(e,i,t)}function Xl(){return(nt&6)===0?(Da(0),!1):!0}function fu(){if(Ge!==null){if(rt===0)var e=Ge.return;else e=Ge,Ei=Br=null,Rc(e),ys=null,fa=0,e=Ge;for(;e!==null;)sp(e.alternate,e),e=e.return;Ge=null}}function Ts(e,t){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,Jy(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),Ni=0,fu(),ht=e,Ge=i=wi(e.current,null),We=t,rt=0,On=null,sr=!1,ks=Xt(e,t),au=!1,As=Bn=lu=qr=ar=Ct=0,bn=Ra=null,ou=!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-Ze(a),C=1<<m;t|=e[m],a&=~C}return ji=t,_l(),i}function Tp(e,t){Ie=null,V.H=Sa,t===vs||t===El?(t=Gf(),rt=3):t===gc?(t=Gf(),rt=4):rt=t===$c?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,On=t,Ge===null&&(Ct=1,Il(e,Pn(t,e.current)))}function Dp(){var e=Mn.current;return e===null?!0:(We&4194048)===We?Gn===null:(We&62914560)===We||(We&536870912)!==0?e===Gn:!1}function Mp(){var e=V.H;return V.H=Sa,e===null?Sa:e}function Lp(){var e=V.A;return V.A=Dy,e}function Ql(){Ct=4,sr||(We&4194048)!==We&&Mn.current!==null||(ks=!0),(ar&134217727)===0&&(qr&134217727)===0||ht===null||cr(ht,We,Bn,!1)}function du(e,t,i){var a=nt;nt|=2;var m=Mp(),C=Lp();(ht!==e||We!==t)&&(Yl=null,Ts(e,t)),t=!1;var O=Ct;e:do try{if(rt!==0&&Ge!==null){var F=Ge,J=On;switch(rt){case 8:fu(),O=6;break e;case 3:case 2:case 9:case 6:Mn.current===null&&(t=!0);var ce=rt;if(rt=0,On=null,Ds(e,F,J,ce),i&&ks){O=0;break e}break;default:ce=rt,rt=0,On=null,Ds(e,F,J,ce)}}Oy(),O=Ct;break}catch(me){Tp(e,me)}while(!0);return t&&e.shellSuspendCounter++,Ei=Br=null,nt=a,V.H=m,V.A=C,Ge===null&&(ht=null,We=0,_l()),O}function Oy(){for(;Ge!==null;)Op(Ge)}function By(e,t){var i=nt;nt|=2;var a=Mp(),m=Lp();ht!==e||We!==t?(Yl=null,Wl=it()+500,Ts(e,t)):ks=Xt(e,t);e:do try{if(rt!==0&&Ge!==null){t=Ge;var C=On;t:switch(rt){case 1:rt=0,On=null,Ds(e,t,C,1);break;case 2:case 9:if(qf(C)){rt=0,On=null,Bp(t);break}t=function(){rt!==2&&rt!==9||ht!==e||(rt=7),fi(e)},C.then(t,t);break e;case 3:rt=7;break e;case 4:rt=5;break e;case 7:qf(C)?(rt=0,On=null,Bp(t)):(rt=0,On=null,Ds(e,t,C,7));break;case 5:var O=null;switch(Ge.tag){case 26:O=Ge.memoizedState;case 5:case 27:var F=Ge;if(O?ym(O):F.stateNode.complete){rt=0,On=null;var J=F.sibling;if(J!==null)Ge=J;else{var ce=F.return;ce!==null?(Ge=ce,Jl(ce)):Ge=null}break t}}rt=0,On=null,Ds(e,t,C,5);break;case 6:rt=0,On=null,Ds(e,t,C,6);break;case 8:fu(),Ct=6;break e;default:throw Error(l(462))}}jy();break}catch(me){Tp(e,me)}while(!0);return Ei=Br=null,V.H=a,V.A=m,nt=i,Ge!==null?0:(ht=null,We=0,_l(),Ct)}function jy(){for(;Ge!==null&&!En();)Op(Ge)}function Op(e){var t=ip(e.alternate,e,ji);e.memoizedProps=e.pendingProps,t===null?Jl(e):Ge=t}function Bp(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=Qd(i,t,t.pendingProps,t.type,void 0,We);break;case 11:t=Qd(i,t,t.pendingProps,t.type.render,t.ref,We);break;case 5:Rc(t);default:sp(i,t),t=Ge=Lf(t,ji),t=ip(i,t,ji)}e.memoizedProps=e.pendingProps,t===null?Jl(e):Ge=t}function Ds(e,t,i,a){Ei=Br=null,Rc(t),ys=null,fa=0;var m=t.return;try{if(wy(e,m,t,i,We)){Ct=1,Il(e,Pn(i,e.current)),Ge=null;return}}catch(C){if(m!==null)throw Ge=m,C;Ct=1,Il(e,Pn(i,e.current)),Ge=null;return}t.flags&32768?(Xe||a===1?e=!0:ks||(We&536870912)!==0?e=!1:(sr=e=!0,(a===2||a===9||a===3||a===6)&&(a=Mn.current,a!==null&&a.tag===13&&(a.flags|=16384))),jp(t,e)):Jl(t)}function Jl(e){var t=e;do{if((t.flags&32768)!==0){jp(t,sr);return}e=t.return;var i=ky(t.alternate,t,ji);if(i!==null){Ge=i;return}if(t=t.sibling,t!==null){Ge=t;return}Ge=t=e}while(t!==null);Ct===0&&(Ct=5)}function jp(e,t){do{var i=Ay(e.alternate,e);if(i!==null){i.flags&=32767,Ge=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){Ge=e;return}Ge=e=i}while(e!==null);Ct=6,Ge=null}function Np(e,t,i,a,m,C,O,F,J){e.cancelPendingCommit=null;do Zl();while(jt!==0);if((nt&6)!==0)throw Error(l(327));if(t!==null){if(t===e.current)throw Error(l(177));if(C=t.lanes|t.childLanes,C|=tc,Ui(e,i,C,O,F,J),e===ht&&(Ge=ht=null,We=0),Rs=t,or=e,Ni=i,cu=C,uu=m,Ep=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Iy(ke,function(){return Pp(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=V.T,V.T=null,m=K.p,K.p=2,O=nt,nt|=4;try{Ry(e,t,i)}finally{nt=O,K.p=m,V.T=a}}jt=1,Hp(),zp(),Ip()}}function Hp(){if(jt===1){jt=0;var e=or,t=Rs,i=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||i){i=V.T,V.T=null;var a=K.p;K.p=2;var m=nt;nt|=4;try{_p(t,e);var C=Eu,O=wf(e.containerInfo),F=C.focusedElem,J=C.selectionRange;if(O!==F&&F&&F.ownerDocument&&Cf(F.ownerDocument.documentElement,F)){if(J!==null&&Xo(F)){var ce=J.start,me=J.end;if(me===void 0&&(me=ce),"selectionStart"in F)F.selectionStart=ce,F.selectionEnd=Math.min(me,F.value.length);else{var _e=F.ownerDocument||document,ue=_e&&_e.defaultView||window;if(ue.getSelection){var de=ue.getSelection(),xe=F.textContent.length,Be=Math.min(J.start,xe),ot=J.end===void 0?Be:Math.min(J.end,xe);!de.extend&&Be>ot&&(O=ot,ot=Be,Be=O);var re=bf(F,Be),Z=bf(F,ot);if(re&&Z&&(de.rangeCount!==1||de.anchorNode!==re.node||de.anchorOffset!==re.offset||de.focusNode!==Z.node||de.focusOffset!==Z.offset)){var oe=_e.createRange();oe.setStart(re.node,re.offset),de.removeAllRanges(),Be>ot?(de.addRange(oe),de.extend(Z.node,Z.offset)):(oe.setEnd(Z.node,Z.offset),de.addRange(oe))}}}}for(_e=[],de=F;de=de.parentNode;)de.nodeType===1&&_e.push({element:de,left:de.scrollLeft,top:de.scrollTop});for(typeof F.focus=="function"&&F.focus(),F=0;F<_e.length;F++){var ge=_e[F];ge.element.scrollLeft=ge.left,ge.element.scrollTop=ge.top}}ho=!!xu,Eu=xu=null}finally{nt=m,K.p=a,V.T=i}}e.current=t,jt=2}}function zp(){if(jt===2){jt=0;var e=or,t=Rs,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=V.T,V.T=null;var a=K.p;K.p=2;var m=nt;nt|=4;try{fp(e,t.alternate,t)}finally{nt=m,K.p=a,V.T=i}}jt=3}}function Ip(){if(jt===4||jt===3){jt=0,wt();var e=or,t=Rs,i=Ni,a=Ep;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?jt=5:(jt=0,Rs=or=null,Up(e,e.pendingLanes));var m=e.pendingLanes;if(m===0&&(lr=null),Ks(i),t=t.stateNode,yt&&typeof yt.onCommitFiberRoot=="function")try{yt.onCommitFiberRoot(St,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=V.T,m=K.p,K.p=2,V.T=null;try{for(var C=e.onRecoverableError,O=0;O<a.length;O++){var F=a[O];C(F.value,{componentStack:F.stack})}}finally{V.T=t,K.p=m}}(Ni&3)!==0&&Zl(),fi(e),m=e.pendingLanes,(i&261930)!==0&&(m&42)!==0?e===hu?Ta++:(Ta=0,hu=e):Ta=0,Da(0)}}function Up(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ua(t)))}function Zl(){return Hp(),zp(),Ip(),Pp()}function Pp(){if(jt!==5)return!1;var e=or,t=cu;cu=0;var i=Ks(Ni),a=V.T,m=K.p;try{K.p=32>i?32:i,V.T=null,i=uu,uu=null;var C=or,O=Ni;if(jt=0,Rs=or=null,Ni=0,(nt&6)!==0)throw Error(l(331));var F=nt;if(nt|=4,Cp(C.current),yp(C,C.current,O,i),nt=F,Da(0,!1),yt&&typeof yt.onPostCommitFiberRoot=="function")try{yt.onPostCommitFiberRoot(St,C)}catch{}return!0}finally{K.p=m,V.T=a,Up(e,t)}}function Fp(e,t,i){t=Pn(i,t),t=qc(e.stateNode,t,2),e=tr(e,t,2),e!==null&&(Ft(e,2),fi(e))}function st(e,t,i){if(e.tag===3)Fp(e,e,i);else for(;t!==null;){if(t.tag===3){Fp(t,e,i);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(lr===null||!lr.has(a))){e=Pn(i,e),i=qd(2),a=tr(t,i,2),a!==null&&($d(i,a,t,e),Ft(a,2),fi(a));break}}t=t.return}}function pu(e,t,i){var a=e.pingCache;if(a===null){a=e.pingCache=new My;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)||(au=!0,m.add(i),e=Ny.bind(null,e,t,i),t.then(e,e))}function Ny(e,t,i){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,ht===e&&(We&i)===i&&(Ct===4||Ct===3&&(We&62914560)===We&&300>it()-Kl?(nt&2)===0&&Ts(e,0):lu|=i,As===We&&(As=0)),fi(e)}function qp(e,t){t===0&&(t=Ht()),e=Mr(e,t),e!==null&&(Ft(e,t),fi(e))}function Hy(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),qp(e,i)}function zy(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(l(314))}a!==null&&a.delete(t),qp(e,i)}function Iy(e,t){return Nt(e,t)}var eo=null,Ms=null,mu=!1,to=!1,gu=!1,ur=0;function fi(e){e!==Ms&&e.next===null&&(Ms===null?eo=Ms=e:Ms=Ms.next=e),to=!0,mu||(mu=!0,Py())}function Da(e,t){if(!gu&&to){gu=!0;do for(var i=!1,a=eo;a!==null;){if(e!==0){var m=a.pendingLanes;if(m===0)var C=0;else{var O=a.suspendedLanes,F=a.pingedLanes;C=(1<<31-Ze(42|e)+1)-1,C&=m&~(O&~F),C=C&201326741?C&201326741|1:C?C|2:0}C!==0&&(i=!0,Kp(a,C))}else C=We,C=Qn(a,a===ht?C:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(C&3)===0||Xt(a,C)||(i=!0,Kp(a,C));a=a.next}while(i);gu=!1}}function Uy(){$p()}function $p(){to=mu=!1;var e=0;ur!==0&&Qy()&&(e=ur);for(var t=it(),i=null,a=eo;a!==null;){var m=a.next,C=Gp(a,t);C===0?(a.next=null,i===null?eo=m:i.next=m,m===null&&(Ms=i)):(i=a,(e!==0||(C&3)!==0)&&(to=!0)),a=m}jt!==0&&jt!==5||Da(e),ur!==0&&(ur=0)}function Gp(e,t){for(var i=e.suspendedLanes,a=e.pingedLanes,m=e.expirationTimes,C=e.pendingLanes&-62914561;0<C;){var O=31-Ze(C),F=1<<O,J=m[O];J===-1?((F&i)===0||(F&a)!==0)&&(m[O]=Re(F,t)):J<=t&&(e.expiredLanes|=F),C&=~F}if(t=ht,i=We,i=Qn(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,i===0||e===t&&(rt===2||rt===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&dn(a),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||Xt(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(a!==null&&dn(a),Ks(i)){case 2:case 8:i=Se;break;case 32:i=ke;break;case 268435456:i=He;break;default:i=ke}return a=Vp.bind(null,e),i=Nt(i,a),e.callbackPriority=t,e.callbackNode=i,t}return a!==null&&a!==null&&dn(a),e.callbackPriority=2,e.callbackNode=null,2}function Vp(e,t){if(jt!==0&&jt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(Zl()&&e.callbackNode!==i)return null;var a=We;return a=Qn(e,e===ht?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(Ap(e,a,t),Gp(e,it()),e.callbackNode!=null&&e.callbackNode===i?Vp.bind(null,e):null)}function Kp(e,t){if(Zl())return null;Ap(e,t,!0)}function Py(){Zy(function(){(nt&6)!==0?Nt(pe,Uy):$p()})}function _u(){if(ur===0){var e=gs;e===0&&(e=Yn,Yn<<=1,(Yn&261888)===0&&(Yn=256)),ur=e}return ur}function Wp(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:kr(""+e)}function Yp(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 Fy(e,t,i,a,m){if(t==="submit"&&i&&i.stateNode===m){var C=Wp((m[qt]||null).action),O=a.submitter;O&&(t=(t=O[qt]||null)?Wp(t.formAction):O.getAttribute("formAction"),t!==null&&(C=t,O=null));var F=new Vi("action","action",null,a,m);e.push({event:F,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(ur!==0){var J=O?Yp(m,O):new FormData(m);Hc(i,{pending:!0,data:J,method:m.method,action:C},null,J)}}else typeof C=="function"&&(F.preventDefault(),J=O?Yp(m,O):new FormData(m),Hc(i,{pending:!0,data:J,method:m.method,action:C},C,J))},currentTarget:m}]})}}for(var vu=0;vu<ec.length;vu++){var yu=ec[vu],qy=yu.toLowerCase(),$y=yu[0].toUpperCase()+yu.slice(1);ni(qy,"on"+$y)}ni(kf,"onAnimationEnd"),ni(Af,"onAnimationIteration"),ni(Rf,"onAnimationStart"),ni("dblclick","onDoubleClick"),ni("focusin","onFocus"),ni("focusout","onBlur"),ni(ay,"onTransitionRun"),ni(ly,"onTransitionStart"),ni(oy,"onTransitionCancel"),ni(Tf,"onTransitionEnd"),Zn("onMouseEnter",["mouseout","mouseover"]),Zn("onMouseLeave",["mouseout","mouseover"]),Zn("onPointerEnter",["pointerout","pointerover"]),Zn("onPointerLeave",["pointerout","pointerover"]),An("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),An("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),An("onBeforeInput",["compositionend","keypress","textInput","paste"]),An("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),An("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),An("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ma="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(" "),Gy=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ma));function Xp(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 C=void 0;if(t)for(var O=a.length-1;0<=O;O--){var F=a[O],J=F.instance,ce=F.currentTarget;if(F=F.listener,J!==C&&m.isPropagationStopped())break e;C=F,m.currentTarget=ce;try{C(m)}catch(me){gl(me)}m.currentTarget=null,C=J}else for(O=0;O<a.length;O++){if(F=a[O],J=F.instance,ce=F.currentTarget,F=F.listener,J!==C&&m.isPropagationStopped())break e;C=F,m.currentTarget=ce;try{C(m)}catch(me){gl(me)}m.currentTarget=null,C=J}}}}function Ve(e,t){var i=t[Ws];i===void 0&&(i=t[Ws]=new Set);var a=e+"__bubble";i.has(a)||(Qp(t,e,2,!1),i.add(a))}function Su(e,t,i){var a=0;t&&(a|=4),Qp(i,e,a,t)}var no="_reactListening"+Math.random().toString(36).slice(2);function bu(e){if(!e[no]){e[no]=!0,Fi.forEach(function(i){i!=="selectionchange"&&(Gy.has(i)||Su(i,!1,e),Su(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[no]||(t[no]=!0,Su("selectionchange",!1,t))}}function Qp(e,t,i,a){switch(km(t)){case 2:var m=y0;break;case 8:m=S0;break;default:m=Nu}i=m.bind(null,t,i,e),m=void 0,!un||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 Cu(e,t,i,a,m){var C=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=xt(F),O===null)return;if(J=O.tag,J===5||J===6||J===26||J===27){a=C=O;continue e}F=F.parentNode}}a=a.return}hl(function(){var ce=C,me=ns(i),_e=[];e:{var ue=Df.get(e);if(ue!==void 0){var de=Vi,xe=e;switch(e){case"keypress":if(rs(i)===0)break e;case"keydown":case"keyup":de=zv;break;case"focusin":xe="focus",de=na;break;case"focusout":xe="blur",de=na;break;case"beforeblur":case"afterblur":de=na;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":de=dt;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":de=oi;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":de=Pv;break;case kf:case Af:case Rf:de=pl;break;case Tf:de=qv;break;case"scroll":case"scrollend":de=ta;break;case"wheel":de=Gv;break;case"copy":case"cut":case"paste":de=Mv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":de=lf;break;case"toggle":case"beforetoggle":de=Kv}var Be=(t&4)!==0,ot=!Be&&(e==="scroll"||e==="scrollend"),re=Be?ue!==null?ue+"Capture":null:ue;Be=[];for(var Z=ce,oe;Z!==null;){var ge=Z;if(oe=ge.stateNode,ge=ge.tag,ge!==5&&ge!==26&&ge!==27||oe===null||re===null||(ge=Ar(Z,re),ge!=null&&Be.push(La(Z,ge,oe))),ot)break;Z=Z.return}0<Be.length&&(ue=new de(ue,xe,null,i,me),_e.push({event:ue,listeners:Be}))}}if((t&7)===0){e:{if(ue=e==="mouseover"||e==="pointerover",de=e==="mouseout"||e==="pointerout",ue&&i!==ts&&(xe=i.relatedTarget||i.fromElement)&&(xt(xe)||xe[_i]))break e;if((de||ue)&&(ue=me.window===me?me:(ue=me.ownerDocument)?ue.defaultView||ue.parentWindow:window,de?(xe=i.relatedTarget||i.toElement,de=ce,xe=xe?xt(xe):null,xe!==null&&(ot=g(xe),Be=xe.tag,xe!==ot||Be!==5&&Be!==27&&Be!==6)&&(xe=null)):(de=null,xe=ce),de!==xe)){if(Be=dt,ge="onMouseLeave",re="onMouseEnter",Z="mouse",(e==="pointerout"||e==="pointerover")&&(Be=lf,ge="onPointerLeave",re="onPointerEnter",Z="pointer"),ot=de==null?ue:li(de),oe=xe==null?ue:li(xe),ue=new Be(ge,Z+"leave",de,i,me),ue.target=ot,ue.relatedTarget=oe,ge=null,xt(me)===ce&&(Be=new Be(re,Z+"enter",xe,i,me),Be.target=oe,Be.relatedTarget=ot,ge=Be),ot=ge,de&&xe)t:{for(Be=Vy,re=de,Z=xe,oe=0,ge=re;ge;ge=Be(ge))oe++;ge=0;for(var Me=Z;Me;Me=Be(Me))ge++;for(;0<oe-ge;)re=Be(re),oe--;for(;0<ge-oe;)Z=Be(Z),ge--;for(;oe--;){if(re===Z||Z!==null&&re===Z.alternate){Be=re;break t}re=Be(re),Z=Be(Z)}Be=null}else Be=null;de!==null&&Jp(_e,ue,de,Be,!1),xe!==null&&ot!==null&&Jp(_e,ot,xe,Be,!0)}}e:{if(ue=ce?li(ce):window,de=ue.nodeName&&ue.nodeName.toLowerCase(),de==="select"||de==="input"&&ue.type==="file")var et=mf;else if(df(ue))if(gf)et=iy;else{et=ty;var Ae=ey}else de=ue.nodeName,!de||de.toLowerCase()!=="input"||ue.type!=="checkbox"&&ue.type!=="radio"?ce&&xr(ce.elementType)&&(et=mf):et=ny;if(et&&(et=et(e,ce))){pf(_e,et,i,me);break e}Ae&&Ae(e,ue,ce),e==="focusout"&&ce&&ue.type==="number"&&ce.memoizedProps.value!=null&&Zs(ue,"number",ue.value)}switch(Ae=ce?li(ce):window,e){case"focusin":(df(Ae)||Ae.contentEditable==="true")&&(os=Ae,Qo=ce,la=null);break;case"focusout":la=Qo=os=null;break;case"mousedown":Jo=!0;break;case"contextmenu":case"mouseup":case"dragend":Jo=!1,xf(_e,i,me);break;case"selectionchange":if(sy)break;case"keydown":case"keyup":xf(_e,i,me)}var Pe;if(Ko)e:{switch(e){case"compositionstart":var Ye="onCompositionStart";break e;case"compositionend":Ye="onCompositionEnd";break e;case"compositionupdate":Ye="onCompositionUpdate";break e}Ye=void 0}else ls?hf(e,i)&&(Ye="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Ye="onCompositionStart");Ye&&(of&&i.locale!=="ko"&&(ls||Ye!=="onCompositionStart"?Ye==="onCompositionEnd"&&ls&&(Pe=Te()):(In=me,Rr="value"in In?In.value:In.textContent,ls=!0)),Ae=io(ce,Ye),0<Ae.length&&(Ye=new af(Ye,e,null,i,me),_e.push({event:Ye,listeners:Ae}),Pe?Ye.data=Pe:(Pe=ff(i),Pe!==null&&(Ye.data=Pe)))),(Pe=Yv?Xv(e,i):Qv(e,i))&&(Ye=io(ce,"onBeforeInput"),0<Ye.length&&(Ae=new af("onBeforeInput","beforeinput",null,i,me),_e.push({event:Ae,listeners:Ye}),Ae.data=Pe)),Fy(_e,e,ce,i,me)}Xp(_e,t)})}function La(e,t,i){return{instance:e,listener:t,currentTarget:i}}function io(e,t){for(var i=t+"Capture",a=[];e!==null;){var m=e,C=m.stateNode;if(m=m.tag,m!==5&&m!==26&&m!==27||C===null||(m=Ar(e,i),m!=null&&a.unshift(La(e,m,C)),m=Ar(e,t),m!=null&&a.push(La(e,m,C))),e.tag===3)return a;e=e.return}return[]}function Vy(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Jp(e,t,i,a,m){for(var C=t._reactName,O=[];i!==null&&i!==a;){var F=i,J=F.alternate,ce=F.stateNode;if(F=F.tag,J!==null&&J===a)break;F!==5&&F!==26&&F!==27||ce===null||(J=ce,m?(ce=Ar(i,C),ce!=null&&O.unshift(La(i,ce,J))):m||(ce=Ar(i,C),ce!=null&&O.push(La(i,ce,J)))),i=i.return}O.length!==0&&e.push({event:t,listeners:O})}var Ky=/\r\n?/g,Wy=/\u0000|\uFFFD/g;function Zp(e){return(typeof e=="string"?e:""+e).replace(Ky,`
49
+ `).replace(Wy,"")}function em(e,t){return t=Zp(t),Zp(e)===t}function lt(e,t,i,a,m,C){switch(i){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||Gi(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&Gi(e,""+a);break;case"className":wr(e,"class",a);break;case"tabIndex":wr(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":wr(e,i,a);break;case"style":es(e,a,C);break;case"data":if(t!=="object"){wr(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=kr(""+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 C=="function"&&(i==="formAction"?(t!=="input"&&lt(e,t,"name",m.name,m,null),lt(e,t,"formEncType",m.formEncType,m,null),lt(e,t,"formMethod",m.formMethod,m,null),lt(e,t,"formTarget",m.formTarget,m,null)):(lt(e,t,"encType",m.encType,m,null),lt(e,t,"method",m.method,m,null),lt(e,t,"target",m.target,m,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(i);break}a=kr(""+a),e.setAttribute(i,a);break;case"onClick":a!=null&&(e.onclick=Rn);break;case"onScroll":a!=null&&Ve("scroll",e);break;case"onScrollEnd":a!=null&&Ve("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(l(61));if(i=a.__html,i!=null){if(m.children!=null)throw Error(l(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=kr(""+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":Ve("beforetoggle",e),Ve("toggle",e),qi(e,"popover",a);break;case"xlinkActuate":$t(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":$t(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":$t(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":$t(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":$t(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":$t(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":$t(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":$t(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":$t(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":qi(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=Er.get(i)||i,qi(e,i,a))}}function wu(e,t,i,a,m,C){switch(i){case"style":es(e,a,C);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(l(61));if(i=a.__html,i!=null){if(m.children!=null)throw Error(l(60));e.innerHTML=i}}break;case"children":typeof a=="string"?Gi(e,a):(typeof a=="number"||typeof a=="bigint")&&Gi(e,""+a);break;case"onScroll":a!=null&&Ve("scroll",e);break;case"onScrollEnd":a!=null&&Ve("scrollend",e);break;case"onClick":a!=null&&(e.onclick=Rn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Jr.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(m=i.endsWith("Capture"),t=i.slice(2,m?i.length-7:void 0),C=e[qt]||null,C=C!=null?C[i]:null,typeof C=="function"&&e.removeEventListener(t,C,m),typeof a=="function")){typeof C!="function"&&C!==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,""):qi(e,i,a)}}}function Wt(e,t,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ve("error",e),Ve("load",e);var a=!1,m=!1,C;for(C in i)if(i.hasOwnProperty(C)){var O=i[C];if(O!=null)switch(C){case"src":a=!0;break;case"srcSet":m=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:lt(e,t,C,O,i,null)}}m&&lt(e,t,"srcSet",i.srcSet,i,null),a&&lt(e,t,"src",i.src,i,null);return;case"input":Ve("invalid",e);var F=C=O=m=null,J=null,ce=null;for(a in i)if(i.hasOwnProperty(a)){var me=i[a];if(me!=null)switch(a){case"name":m=me;break;case"type":O=me;break;case"checked":J=me;break;case"defaultChecked":ce=me;break;case"value":C=me;break;case"defaultValue":F=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(l(137,t));break;default:lt(e,t,a,me,i,null)}}cl(e,C,F,J,ce,O,m,!1);return;case"select":Ve("invalid",e),a=O=C=null;for(m in i)if(i.hasOwnProperty(m)&&(F=i[m],F!=null))switch(m){case"value":C=F;break;case"defaultValue":O=F;break;case"multiple":a=F;default:lt(e,t,m,F,i,null)}t=C,i=O,e.multiple=!!a,t!=null?$i(e,!!a,t,!1):i!=null&&$i(e,!!a,i,!0);return;case"textarea":Ve("invalid",e),C=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":C=F;break;case"dangerouslySetInnerHTML":if(F!=null)throw Error(l(91));break;default:lt(e,t,O,F,i,null)}ea(e,a,m,C);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:lt(e,t,J,a,i,null)}return;case"dialog":Ve("beforetoggle",e),Ve("toggle",e),Ve("cancel",e),Ve("close",e);break;case"iframe":case"object":Ve("load",e);break;case"video":case"audio":for(a=0;a<Ma.length;a++)Ve(Ma[a],e);break;case"image":Ve("error",e),Ve("load",e);break;case"details":Ve("toggle",e);break;case"embed":case"source":case"link":Ve("error",e),Ve("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(ce in i)if(i.hasOwnProperty(ce)&&(a=i[ce],a!=null))switch(ce){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:lt(e,t,ce,a,i,null)}return;default:if(xr(t)){for(me in i)i.hasOwnProperty(me)&&(a=i[me],a!==void 0&&wu(e,t,me,a,i,void 0));return}}for(F in i)i.hasOwnProperty(F)&&(a=i[F],a!=null&&lt(e,t,F,a,i,null))}function Yy(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,C=null,O=null,F=null,J=null,ce=null,me=null;for(de in i){var _e=i[de];if(i.hasOwnProperty(de)&&_e!=null)switch(de){case"checked":break;case"value":break;case"defaultValue":J=_e;default:a.hasOwnProperty(de)||lt(e,t,de,null,a,_e)}}for(var ue in a){var de=a[ue];if(_e=i[ue],a.hasOwnProperty(ue)&&(de!=null||_e!=null))switch(ue){case"type":C=de;break;case"name":m=de;break;case"checked":ce=de;break;case"defaultChecked":me=de;break;case"value":O=de;break;case"defaultValue":F=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(l(137,t));break;default:de!==_e&&lt(e,t,ue,de,a,_e)}}Zr(e,O,F,J,ce,me,C,m);return;case"select":de=O=F=ue=null;for(C in i)if(J=i[C],i.hasOwnProperty(C)&&J!=null)switch(C){case"value":break;case"multiple":de=J;default:a.hasOwnProperty(C)||lt(e,t,C,null,a,J)}for(m in a)if(C=a[m],J=i[m],a.hasOwnProperty(m)&&(C!=null||J!=null))switch(m){case"value":ue=C;break;case"defaultValue":F=C;break;case"multiple":O=C;default:C!==J&&lt(e,t,m,C,a,J)}t=F,i=O,a=de,ue!=null?$i(e,!!i,ue,!1):!!a!=!!i&&(t!=null?$i(e,!!i,t,!0):$i(e,!!i,i?[]:"",!1));return;case"textarea":de=ue=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:lt(e,t,F,null,a,m)}for(O in a)if(m=a[O],C=i[O],a.hasOwnProperty(O)&&(m!=null||C!=null))switch(O){case"value":ue=m;break;case"defaultValue":de=m;break;case"children":break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(l(91));break;default:m!==C&&lt(e,t,O,m,a,C)}ul(e,ue,de);return;case"option":for(var xe in i)if(ue=i[xe],i.hasOwnProperty(xe)&&ue!=null&&!a.hasOwnProperty(xe))switch(xe){case"selected":e.selected=!1;break;default:lt(e,t,xe,null,a,ue)}for(J in a)if(ue=a[J],de=i[J],a.hasOwnProperty(J)&&ue!==de&&(ue!=null||de!=null))switch(J){case"selected":e.selected=ue&&typeof ue!="function"&&typeof ue!="symbol";break;default:lt(e,t,J,ue,a,de)}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 Be in i)ue=i[Be],i.hasOwnProperty(Be)&&ue!=null&&!a.hasOwnProperty(Be)&&lt(e,t,Be,null,a,ue);for(ce in a)if(ue=a[ce],de=i[ce],a.hasOwnProperty(ce)&&ue!==de&&(ue!=null||de!=null))switch(ce){case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(l(137,t));break;default:lt(e,t,ce,ue,a,de)}return;default:if(xr(t)){for(var ot in i)ue=i[ot],i.hasOwnProperty(ot)&&ue!==void 0&&!a.hasOwnProperty(ot)&&wu(e,t,ot,void 0,a,ue);for(me in a)ue=a[me],de=i[me],!a.hasOwnProperty(me)||ue===de||ue===void 0&&de===void 0||wu(e,t,me,ue,a,de);return}}for(var re in i)ue=i[re],i.hasOwnProperty(re)&&ue!=null&&!a.hasOwnProperty(re)&&lt(e,t,re,null,a,ue);for(_e in a)ue=a[_e],de=i[_e],!a.hasOwnProperty(_e)||ue===de||ue==null&&de==null||lt(e,t,_e,ue,a,de)}function tm(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Xy(){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],C=m.transferSize,O=m.initiatorType,F=m.duration;if(C&&F&&tm(O)){for(O=0,F=m.responseEnd,a+=1;a<i.length;a++){var J=i[a],ce=J.startTime;if(ce>F)break;var me=J.transferSize,_e=J.initiatorType;me&&tm(_e)&&(J=J.responseEnd,O+=me*(J<F?1:(F-ce)/(J-ce)))}if(--a,t+=8*(C+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 xu=null,Eu=null;function ro(e){return e.nodeType===9?e:e.ownerDocument}function nm(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 im(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 ku(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 Au=null;function Qy(){var e=window.event;return e&&e.type==="popstate"?e===Au?!1:(Au=e,!0):(Au=null,!1)}var rm=typeof setTimeout=="function"?setTimeout:void 0,Jy=typeof clearTimeout=="function"?clearTimeout:void 0,sm=typeof Promise=="function"?Promise:void 0,Zy=typeof queueMicrotask=="function"?queueMicrotask:typeof sm<"u"?function(e){return sm.resolve(null).then(e).catch(e0)}:rm;function e0(e){setTimeout(function(){throw e})}function hr(e){return e==="head"}function am(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),js(t);return}a--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")a++;else if(i==="html")Oa(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,Oa(i);for(var C=i.firstChild;C;){var O=C.nextSibling,F=C.nodeName;C[zn]||F==="SCRIPT"||F==="STYLE"||F==="LINK"&&C.rel.toLowerCase()==="stylesheet"||i.removeChild(C),C=O}}else i==="body"&&Oa(e.ownerDocument.body);i=m}while(i);js(t)}function lm(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 Ru(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":Ru(i),Qr(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function t0(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[zn])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(C=e.getAttribute("rel"),C==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(C!==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(C=e.getAttribute("src"),(C!==(m.src==null?null:m.src)||e.getAttribute("type")!==(m.type==null?null:m.type)||e.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin))&&C&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var C=m.name==null?null:""+m.name;if(m.type==="hidden"&&e.getAttribute("name")===C)return e}else return e;if(e=Vn(e.nextSibling),e===null)break}return null}function n0(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=Vn(e.nextSibling),e===null))return null;return e}function om(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Vn(e.nextSibling),e===null))return null;return e}function Tu(e){return e.data==="$?"||e.data==="$~"}function Du(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function i0(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 Vn(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 Mu=null;function cm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(t===0)return Vn(e.nextSibling);t--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||t++}e=e.nextSibling}return null}function um(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 hm(e,t,i){switch(t=ro(i),e){case"html":if(e=t.documentElement,!e)throw Error(l(452));return e;case"head":if(e=t.head,!e)throw Error(l(453));return e;case"body":if(e=t.body,!e)throw Error(l(454));return e;default:throw Error(l(451))}}function Oa(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Qr(e)}var Kn=new Map,fm=new Set;function so(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Hi=K.d;K.d={f:r0,r:s0,D:a0,C:l0,L:o0,m:c0,X:h0,S:u0,M:f0};function r0(){var e=Hi.f(),t=Xl();return e||t}function s0(e){var t=vi(e);t!==null&&t.tag===5&&t.type==="form"?Td(t):Hi.r(e)}var Ls=typeof document>"u"?null:document;function dm(e,t,i){var a=Ls;if(a&&typeof t=="string"&&t){var m=cn(t);m='link[rel="'+e+'"][href="'+m+'"]',typeof i=="string"&&(m+='[crossorigin="'+i+'"]'),fm.has(m)||(fm.add(m),e={rel:e,crossOrigin:i,href:t},a.querySelector(m)===null&&(t=a.createElement("link"),Wt(t,"link",e),ut(t),a.head.appendChild(t)))}}function a0(e){Hi.D(e),dm("dns-prefetch",e,null)}function l0(e,t){Hi.C(e,t),dm("preconnect",e,t)}function o0(e,t,i){Hi.L(e,t,i);var a=Ls;if(a&&e&&t){var m='link[rel="preload"][as="'+cn(t)+'"]';t==="image"&&i&&i.imageSrcSet?(m+='[imagesrcset="'+cn(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(m+='[imagesizes="'+cn(i.imageSizes)+'"]')):m+='[href="'+cn(e)+'"]';var C=m;switch(t){case"style":C=Os(e);break;case"script":C=Bs(e)}Kn.has(C)||(e=u({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),Kn.set(C,e),a.querySelector(m)!==null||t==="style"&&a.querySelector(Ba(C))||t==="script"&&a.querySelector(ja(C))||(t=a.createElement("link"),Wt(t,"link",e),ut(t),a.head.appendChild(t)))}}function c0(e,t){Hi.m(e,t);var i=Ls;if(i&&e){var a=t&&typeof t.as=="string"?t.as:"script",m='link[rel="modulepreload"][as="'+cn(a)+'"][href="'+cn(e)+'"]',C=m;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":C=Bs(e)}if(!Kn.has(C)&&(e=u({rel:"modulepreload",href:e},t),Kn.set(C,e),i.querySelector(m)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(ja(C)))return}a=i.createElement("link"),Wt(a,"link",e),ut(a),i.head.appendChild(a)}}}function u0(e,t,i){Hi.S(e,t,i);var a=Ls;if(a&&e){var m=yi(a).hoistableStyles,C=Os(e);t=t||"default";var O=m.get(C);if(!O){var F={loading:0,preload:null};if(O=a.querySelector(Ba(C)))F.loading=5;else{e=u({rel:"stylesheet",href:e,"data-precedence":t},i),(i=Kn.get(C))&&Lu(e,i);var J=O=a.createElement("link");ut(J),Wt(J,"link",e),J._p=new Promise(function(ce,me){J.onload=ce,J.onerror=me}),J.addEventListener("load",function(){F.loading|=1}),J.addEventListener("error",function(){F.loading|=2}),F.loading|=4,ao(O,t,a)}O={type:"stylesheet",instance:O,count:1,state:F},m.set(C,O)}}}function h0(e,t){Hi.X(e,t);var i=Ls;if(i&&e){var a=yi(i).hoistableScripts,m=Bs(e),C=a.get(m);C||(C=i.querySelector(ja(m)),C||(e=u({src:e,async:!0},t),(t=Kn.get(m))&&Ou(e,t),C=i.createElement("script"),ut(C),Wt(C,"link",e),i.head.appendChild(C)),C={type:"script",instance:C,count:1,state:null},a.set(m,C))}}function f0(e,t){Hi.M(e,t);var i=Ls;if(i&&e){var a=yi(i).hoistableScripts,m=Bs(e),C=a.get(m);C||(C=i.querySelector(ja(m)),C||(e=u({src:e,async:!0,type:"module"},t),(t=Kn.get(m))&&Ou(e,t),C=i.createElement("script"),ut(C),Wt(C,"link",e),i.head.appendChild(C)),C={type:"script",instance:C,count:1,state:null},a.set(m,C))}}function pm(e,t,i,a){var m=(m=he.current)?so(m):null;if(!m)throw Error(l(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(t=Os(i.href),i=yi(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=Os(i.href);var C=yi(m).hoistableStyles,O=C.get(e);if(O||(m=m.ownerDocument||m,O={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},C.set(e,O),(C=m.querySelector(Ba(e)))&&!C._p&&(O.instance=C,O.state.loading=5),Kn.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},Kn.set(e,i),C||d0(m,e,i,O.state))),t&&a===null)throw Error(l(528,""));return O}if(t&&a!==null)throw Error(l(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Bs(i),i=yi(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(l(444,e))}}function Os(e){return'href="'+cn(e)+'"'}function Ba(e){return'link[rel="stylesheet"]['+e+"]"}function mm(e){return u({},e,{"data-precedence":e.precedence,precedence:null})}function d0(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}),Wt(t,"link",i),ut(t),e.head.appendChild(t))}function Bs(e){return'[src="'+cn(e)+'"]'}function ja(e){return"script[async]"+e}function gm(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+cn(i.href)+'"]');if(a)return t.instance=a,ut(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"),ut(a),Wt(a,"style",m),ao(a,i.precedence,e),t.instance=a;case"stylesheet":m=Os(i.href);var C=e.querySelector(Ba(m));if(C)return t.state.loading|=4,t.instance=C,ut(C),C;a=mm(i),(m=Kn.get(m))&&Lu(a,m),C=(e.ownerDocument||e).createElement("link"),ut(C);var O=C;return O._p=new Promise(function(F,J){O.onload=F,O.onerror=J}),Wt(C,"link",a),t.state.loading|=4,ao(C,i.precedence,e),t.instance=C;case"script":return C=Bs(i.src),(m=e.querySelector(ja(C)))?(t.instance=m,ut(m),m):(a=i,(m=Kn.get(C))&&(a=u({},i),Ou(a,m)),e=e.ownerDocument||e,m=e.createElement("script"),ut(m),Wt(m,"link",a),e.head.appendChild(m),t.instance=m);case"void":return null;default:throw Error(l(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,ao(a,i.precedence,e));return t.instance}function ao(e,t,i){for(var a=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=a.length?a[a.length-1]:null,C=m,O=0;O<a.length;O++){var F=a[O];if(F.dataset.precedence===t)C=F;else if(C!==m)break}C?C.parentNode.insertBefore(e,C.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function Lu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Ou(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var lo=null;function _m(e,t,i){if(lo===null){var a=new Map,m=lo=new Map;m.set(i,a)}else m=lo,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 C=i[m];if(!(C[zn]||C[At]||e==="link"&&C.getAttribute("rel")==="stylesheet")&&C.namespaceURI!=="http://www.w3.org/2000/svg"){var O=C.getAttribute(t)||"";O=e+O;var F=a.get(O);F?F.push(C):a.set(O,[C])}}return a}function vm(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function p0(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 ym(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function m0(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=Os(a.href),C=t.querySelector(Ba(m));if(C){t=C._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=oo.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=C,ut(C);return}C=t.ownerDocument||t,a=mm(a),(m=Kn.get(m))&&Lu(a,m),C=C.createElement("link"),ut(C);var O=C;O._p=new Promise(function(F,J){O.onload=F,O.onerror=J}),Wt(C,"link",a),i.instance=C}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,t),(t=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=oo.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var Bu=0;function g0(e,t){return e.stylesheets&&e.count===0&&uo(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var a=setTimeout(function(){if(e.stylesheets&&uo(e,e.stylesheets),e.unsuspend){var C=e.unsuspend;e.unsuspend=null,C()}},6e4+t);0<e.imgBytes&&Bu===0&&(Bu=62500*Xy());var m=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&uo(e,e.stylesheets),e.unsuspend)){var C=e.unsuspend;e.unsuspend=null,C()}},(e.imgBytes>Bu?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(m)}}:null}function oo(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)uo(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var co=null;function uo(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,co=new Map,t.forEach(_0,e),co=null,oo.call(e))}function _0(e,t){if(!(t.state.loading&4)){var i=co.get(e);if(i)var a=i.get(null);else{i=new Map,co.set(e,i);for(var m=e.querySelectorAll("link[data-precedence],style[data-precedence]"),C=0;C<m.length;C++){var O=m[C];(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"),C=i.get(O)||a,C===a&&i.set(null,m),i.set(O,m),this.count++,a=oo.bind(this),m.addEventListener("load",a),m.addEventListener("error",a),C?C.parentNode.insertBefore(m,C.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(m,e.firstChild)),t.state.loading|=4}}var Na={$$typeof:S,Provider:null,Consumer:null,_currentValue:ne,_currentValue2:ne,_threadCount:0};function v0(e,t,i,a,m,C,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=kn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=kn(0),this.hiddenUpdates=kn(null),this.identifierPrefix=a,this.onUncaughtError=m,this.onCaughtError=C,this.onRecoverableError=O,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=J,this.incompleteTransitions=new Map}function Sm(e,t,i,a,m,C,O,F,J,ce,me,_e){return e=new v0(e,t,i,O,J,ce,me,_e,F),t=1,C===!0&&(t|=24),C=Dn(3,null,null,t),e.current=C,C.stateNode=e,t=dc(),t.refCount++,e.pooledCache=t,t.refCount++,C.memoizedState={element:a,isDehydrated:i,cache:t},_c(C),e}function bm(e){return e?(e=hs,e):hs}function Cm(e,t,i,a,m,C){m=bm(m),a.context===null?a.context=m:a.pendingContext=m,a=er(t),a.payload={element:i},C=C===void 0?null:C,C!==null&&(a.callback=C),i=tr(e,a,t),i!==null&&(Cn(i,e,t),pa(i,e,t))}function wm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function ju(e,t){wm(e,t),(e=e.alternate)&&wm(e,t)}function xm(e){if(e.tag===13||e.tag===31){var t=Mr(e,67108864);t!==null&&Cn(t,e,67108864),ju(e,67108864)}}function Em(e){if(e.tag===13||e.tag===31){var t=jn();t=Pi(t);var i=Mr(e,t);i!==null&&Cn(i,e,t),ju(e,t)}}var ho=!0;function y0(e,t,i,a){var m=V.T;V.T=null;var C=K.p;try{K.p=2,Nu(e,t,i,a)}finally{K.p=C,V.T=m}}function S0(e,t,i,a){var m=V.T;V.T=null;var C=K.p;try{K.p=8,Nu(e,t,i,a)}finally{K.p=C,V.T=m}}function Nu(e,t,i,a){if(ho){var m=Hu(a);if(m===null)Cu(e,t,a,fo,i),Am(e,a);else if(C0(m,e,t,i,a))a.stopPropagation();else if(Am(e,a),t&4&&-1<b0.indexOf(e)){for(;m!==null;){var C=vi(m);if(C!==null)switch(C.tag){case 3:if(C=C.stateNode,C.current.memoizedState.isDehydrated){var O=pn(C.pendingLanes);if(O!==0){var F=C;for(F.pendingLanes|=2,F.entangledLanes|=2;O;){var J=1<<31-Ze(O);F.entanglements[1]|=J,O&=~J}fi(C),(nt&6)===0&&(Wl=it()+500,Da(0))}}break;case 31:case 13:F=Mr(C,2),F!==null&&Cn(F,C,2),Xl(),ju(C,2)}if(C=Hu(a),C===null&&Cu(e,t,a,fo,i),C===m)break;m=C}m!==null&&a.stopPropagation()}else Cu(e,t,a,null,i)}}function Hu(e){return e=ns(e),zu(e)}var fo=null;function zu(e){if(fo=null,e=xt(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=o(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 fo=e,null}function km(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(Ot()){case pe:return 2;case Se:return 8;case ke:case Oe:return 32;case He:return 268435456;default:return 32}default:return 32}}var Iu=!1,fr=null,dr=null,pr=null,Ha=new Map,za=new Map,mr=[],b0="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 Am(e,t){switch(e){case"focusin":case"focusout":fr=null;break;case"dragenter":case"dragleave":dr=null;break;case"mouseover":case"mouseout":pr=null;break;case"pointerover":case"pointerout":Ha.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":za.delete(t.pointerId)}}function Ia(e,t,i,a,m,C){return e===null||e.nativeEvent!==C?(e={blockedOn:t,domEventName:i,eventSystemFlags:a,nativeEvent:C,targetContainers:[m]},t!==null&&(t=vi(t),t!==null&&xm(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,m!==null&&t.indexOf(m)===-1&&t.push(m),e)}function C0(e,t,i,a,m){switch(t){case"focusin":return fr=Ia(fr,e,t,i,a,m),!0;case"dragenter":return dr=Ia(dr,e,t,i,a,m),!0;case"mouseover":return pr=Ia(pr,e,t,i,a,m),!0;case"pointerover":var C=m.pointerId;return Ha.set(C,Ia(Ha.get(C)||null,e,t,i,a,m)),!0;case"gotpointercapture":return C=m.pointerId,za.set(C,Ia(za.get(C)||null,e,t,i,a,m)),!0}return!1}function Rm(e){var t=xt(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,sl(e.priority,function(){Em(i)});return}}else if(t===31){if(t=o(i),t!==null){e.blockedOn=t,sl(e.priority,function(){Em(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 po(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=Hu(e.nativeEvent);if(i===null){i=e.nativeEvent;var a=new i.constructor(i.type,i);ts=a,i.target.dispatchEvent(a),ts=null}else return t=vi(i),t!==null&&xm(t),e.blockedOn=i,!1;t.shift()}return!0}function Tm(e,t,i){po(e)&&i.delete(t)}function w0(){Iu=!1,fr!==null&&po(fr)&&(fr=null),dr!==null&&po(dr)&&(dr=null),pr!==null&&po(pr)&&(pr=null),Ha.forEach(Tm),za.forEach(Tm)}function mo(e,t){e.blockedOn===t&&(e.blockedOn=null,Iu||(Iu=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,w0)))}var go=null;function Dm(e){go!==e&&(go=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){go===e&&(go=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(zu(a||i)===null)continue;break}var C=vi(i);C!==null&&(e.splice(t,3),t-=3,Hc(C,{pending:!0,data:m,method:i.method,action:a},a,m))}}))}function js(e){function t(J){return mo(J,e)}fr!==null&&mo(fr,e),dr!==null&&mo(dr,e),pr!==null&&mo(pr,e),Ha.forEach(t),za.forEach(t);for(var i=0;i<mr.length;i++){var a=mr[i];a.blockedOn===e&&(a.blockedOn=null)}for(;0<mr.length&&(i=mr[0],i.blockedOn===null);)Rm(i),i.blockedOn===null&&mr.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(a=0;a<i.length;a+=3){var m=i[a],C=i[a+1],O=m[qt]||null;if(typeof C=="function")O||Dm(i);else if(O){var F=null;if(C&&C.hasAttribute("formAction")){if(m=C,O=C[qt]||null)F=O.formAction;else if(zu(m)!==null)continue}else F=O.action;typeof F=="function"?i[a+1]=F:(i.splice(a,3),a-=3),Dm(i)}}}function Mm(){function e(C){C.canIntercept&&C.info==="react-transition"&&C.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 C=navigation.currentEntry;C&&C.url!=null&&navigation.navigate(C.url,{state:C.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 Uu(e){this._internalRoot=e}_o.prototype.render=Uu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(l(409));var i=t.current,a=jn();Cm(i,a,e,t,null,null)},_o.prototype.unmount=Uu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Cm(e.current,2,null,e,null,null),Xl(),t[_i]=null}};function _o(e){this._internalRoot=e}_o.prototype.unstable_scheduleHydration=function(e){if(e){var t=Jn();e={blockedOn:null,target:e,priority:t};for(var i=0;i<mr.length&&t!==0&&t<mr[i].priority;i++);mr.splice(i,0,e),i===0&&Rm(e)}};var Lm=r.version;if(Lm!=="19.2.6")throw Error(l(527,Lm,"19.2.6"));K.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(l(188)):(e=Object.keys(e).join(","),Error(l(268,e)));return e=h(t),e=e!==null?p(e):null,e=e===null?null:e.stateNode,e};var x0={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:V,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var vo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!vo.isDisabled&&vo.supportsFiber)try{St=vo.inject(x0),yt=vo}catch{}}return Pa.createRoot=function(e,t){if(!d(e))throw Error(l(299));var i=!1,a="",m=Id,C=Ud,O=Pd;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&&(C=t.onCaughtError),t.onRecoverableError!==void 0&&(O=t.onRecoverableError)),t=Sm(e,1,!1,null,null,i,a,null,m,C,O,Mm),e[_i]=t.current,bu(e),new Uu(t)},Pa.hydrateRoot=function(e,t,i){if(!d(e))throw Error(l(299));var a=!1,m="",C=Id,O=Ud,F=Pd,J=null;return i!=null&&(i.unstable_strictMode===!0&&(a=!0),i.identifierPrefix!==void 0&&(m=i.identifierPrefix),i.onUncaughtError!==void 0&&(C=i.onUncaughtError),i.onCaughtError!==void 0&&(O=i.onCaughtError),i.onRecoverableError!==void 0&&(F=i.onRecoverableError),i.formState!==void 0&&(J=i.formState)),t=Sm(e,1,!0,t,i??null,a,m,J,C,O,F,Mm),t.context=bm(null),i=t.current,a=jn(),a=Pi(a),m=er(a),m.callback=null,tr(i,m,a),i=a,t.current.lanes=i,Ft(t,i),fi(t),e[_i]=t.current,bu(e),new _o(t)},Pa.version="19.2.6",Pa}var qm;function N0(){if(qm)return qu.exports;qm=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(),qu.exports=j0(),qu.exports}var H0=N0();const Wr=function(n,r){let d=n;const g=Ka[r];let f=null,o=0,c=null;const h=[],p={},u=function(T,k){o=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})(o),b(0,0),b(o-7,0),b(0,o-7),E(),R(),y(T,k),d>=7&&v(T),c==null&&(c=A(d,g,h)),_(c,k)},b=function(T,k){for(let M=-1;M<=7;M+=1)if(!(T+M<=-1||o<=T+M))for(let B=-1;B<=7;B+=1)k+B<=-1||o<=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[T+M][k+B]=!0:f[T+M][k+B]=!1)},w=function(){let T=0,k=0;for(let M=0;M<8;M+=1){u(!0,M);const B=vr.getLostPoint(p);(M==0||T>B)&&(T=B,k=M)}return k},R=function(){for(let T=8;T<o-8;T+=1)f[T][6]==null&&(f[T][6]=T%2==0);for(let T=8;T<o-8;T+=1)f[6][T]==null&&(f[6][T]=T%2==0)},E=function(){const T=vr.getPatternPosition(d);for(let k=0;k<T.length;k+=1)for(let M=0;M<T.length;M+=1){const B=T[k],H=T[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}},v=function(T){const k=vr.getBCHTypeNumber(d);for(let M=0;M<18;M+=1){const B=!T&&(k>>M&1)==1;f[Math.floor(M/3)][M%3+o-8-3]=B}for(let M=0;M<18;M+=1){const B=!T&&(k>>M&1)==1;f[M%3+o-8-3][Math.floor(M/3)]=B}},y=function(T,k){const M=g<<3|k,B=vr.getBCHTypeInfo(M);for(let H=0;H<15;H+=1){const U=!T&&(B>>H&1)==1;H<6?f[H][8]=U:H<8?f[H+1][8]=U:f[o-15+H][8]=U}for(let H=0;H<15;H+=1){const U=!T&&(B>>H&1)==1;H<8?f[8][o-H-1]=U:H<9?f[8][15-H-1+1]=U:f[8][15-H-1]=U}f[o-8][8]=!T},_=function(T,k){let M=-1,B=o-1,H=7,U=0;const P=vr.getMaskFunction(k);for(let Y=o-1;Y>0;Y-=2)for(Y==6&&(Y-=1);;){for(let X=0;X<2;X+=1)if(f[B][Y-X]==null){let V=!1;U<T.length&&(V=(T[U]>>>H&1)==1),P(B,Y-X)&&(V=!V),f[B][Y-X]=V,H-=1,H==-1&&(U+=1,H=7)}if(B+=M,B<0||o<=B){B-=M,M=-M;break}}},S=function(T,k){let M=0,B=0,H=0;const U=new Array(k.length),P=new Array(k.length);for(let K=0;K<k.length;K+=1){const ne=k[K].dataCount,z=k[K].totalCount-ne;B=Math.max(B,ne),H=Math.max(H,z),U[K]=new Array(ne);for(let I=0;I<U[K].length;I+=1)U[K][I]=255&T.getBuffer()[I+M];M+=ne;const j=vr.getErrorCorrectPolynomial(z),$=Ja(U[K],j.getLength()-1).mod(j);P[K]=new Array(j.getLength()-1);for(let I=0;I<P[K].length;I+=1){const se=I+$.getLength()-P[K].length;P[K][I]=se>=0?$.getAt(se):0}}let Y=0;for(let K=0;K<k.length;K+=1)Y+=k[K].totalCount;const X=new Array(Y);let V=0;for(let K=0;K<B;K+=1)for(let ne=0;ne<k.length;ne+=1)K<U[ne].length&&(X[V]=U[ne][K],V+=1);for(let K=0;K<H;K+=1)for(let ne=0;ne<k.length;ne+=1)K<P[ne].length&&(X[V]=P[ne][K],V+=1);return X},A=function(T,k,M){const B=$m.getRSBlocks(T,k),H=Gm();for(let P=0;P<M.length;P+=1){const Y=M[P];H.put(Y.getMode(),4),H.put(Y.getLength(),vr.getLengthInBits(Y.getMode(),T)),Y.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 S(H,B)};p.addData=function(T,k){k=k||"Byte";let M=null;switch(k){case"Numeric":M=z0(T);break;case"Alphanumeric":M=I0(T);break;case"Byte":M=U0(T);break;case"Kanji":M=P0(T);break;default:throw"mode:"+k}h.push(M),c=null},p.isDark=function(T,k){if(T<0||o<=T||k<0||o<=k)throw T+","+k;return f[T][k]},p.getModuleCount=function(){return o},p.make=function(){if(d<1){let T=1;for(;T<40;T++){const k=$m.getRSBlocks(T,g),M=Gm();for(let H=0;H<h.length;H++){const U=h[H];M.put(U.getMode(),4),M.put(U.getLength(),vr.getLengthInBits(U.getMode(),T)),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=T}u(!1,w())},p.createTableTag=function(T,k){T=T||2,k=typeof k>"u"?T*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: "+T+"px;",M+=" height: "+T+"px;",M+=" background-color: ",M+=p.isDark(B,H)?"#000000":"#ffffff",M+=";",M+='"/>';M+="</tr>"}return M+="</tbody>",M+="</table>",M},p.createSvgTag=function(T,k,M,B){let H={};typeof arguments[0]=="object"&&(H=arguments[0],T=H.cellSize,k=H.margin,M=H.alt,B=H.title),T=T||2,k=typeof k>"u"?T*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()*T+k*2;let P,Y,X,V,K="",ne;for(ne="l"+T+",0 0,"+T+" -"+T+",0 0,-"+T+"z ",K+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',K+=H.scalable?"":' width="'+U+'px" height="'+U+'px"',K+=' viewBox="0 0 '+U+" "+U+'" ',K+=' preserveAspectRatio="xMinYMin meet"',K+=B.text||M.text?' role="img" aria-labelledby="'+L([B.id,M.id].join(" ").trim())+'"':"",K+=">",K+=B.text?'<title id="'+L(B.id)+'">'+L(B.text)+"</title>":"",K+=M.text?'<description id="'+L(M.id)+'">'+L(M.text)+"</description>":"",K+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',K+='<path d="',X=0;X<p.getModuleCount();X+=1)for(V=X*T+k,P=0;P<p.getModuleCount();P+=1)p.isDark(X,P)&&(Y=P*T+k,K+="M"+Y+","+V+ne);return K+='" stroke="transparent" fill="black"/>',K+="</svg>",K},p.createDataURL=function(T,k){T=T||2,k=typeof k>"u"?T*4:k;const M=p.getModuleCount()*T+k*2,B=k,H=M-k;return G0(M,M,function(U,P){if(B<=U&&U<H&&B<=P&&P<H){const Y=Math.floor((U-B)/T),X=Math.floor((P-B)/T);return p.isDark(X,Y)?0:1}else return 1})},p.createImgTag=function(T,k,M){T=T||2,k=typeof k>"u"?T*4:k;const B=p.getModuleCount()*T+k*2;let H="";return H+="<img",H+=' src="',H+=p.createDataURL(T,k),H+='"',H+=' width="',H+=B,H+='"',H+=' height="',H+=B,H+='"',M&&(H+=' alt="',H+=L(M),H+='"'),H+="/>",H};const L=function(T){let k="";for(let M=0;M<T.length;M+=1){const B=T.charAt(M);switch(B){case"<":k+="&lt;";break;case">":k+="&gt;";break;case"&":k+="&amp;";break;case'"':k+="&quot;";break;default:k+=B;break}}return k},D=function(T){T=typeof T>"u"?2:T;const M=p.getModuleCount()*1+T*2,B=T,H=M-T;let U,P,Y,X,V;const K={"██":"█","█ ":"▀"," █":"▄"," ":" "},ne={"██":"▀","█ ":"▀"," █":" "," ":" "};let z="";for(U=0;U<M;U+=2){for(Y=Math.floor((U-B)/1),X=Math.floor((U+1-B)/1),P=0;P<M;P+=1)V="█",B<=P&&P<H&&B<=U&&U<H&&p.isDark(Y,Math.floor((P-B)/1))&&(V=" "),B<=P&&P<H&&B<=U+1&&U+1<H&&p.isDark(X,Math.floor((P-B)/1))?V+=" ":V+="█",z+=T<1&&U+1>=H?ne[V]:K[V];z+=`
50
50
  `}return M%2&&T>0?z.substring(0,z.length-M-1)+Array(M+1).join("▀"):z.substring(0,z.length-1)};return p.createASCII=function(T,k){if(T=T||1,T<2)return D(k);T-=1,k=typeof k>"u"?T*2:k;const M=p.getModuleCount()*T+k*2,B=k,H=M-k;let U,P,Y,X;const V=Array(T+1).join("██"),K=Array(T+1).join(" ");let ne="",z="";for(U=0;U<M;U+=1){for(Y=Math.floor((U-B)/T),z="",P=0;P<M;P+=1)X=1,B<=P&&P<H&&B<=U&&U<H&&p.isDark(Y,Math.floor((P-B)/T))&&(X=0),z+=X?V:K;for(Y=0;Y<T;Y+=1)ne+=z+`
51
- `}return ne.substring(0,ne.length-1)},p.renderTo2dContext=function(T,k){k=k||2;const M=p.getModuleCount();for(let B=0;B<M;B++)for(let H=0;H<M;H++)T.fillStyle=p.isDark(B,H)?"black":"white",T.fillRect(H*k,B*k,k,k)},p};Xr.stringToBytes=function(n){const r=[];for(let s=0;s<n.length;s+=1){const l=n.charCodeAt(s);r.push(l&255)}return r};Xr.createStringToBytes=function(n,r){const s=(function(){const d=q0(n),_=function(){const c=d.read();if(c==-1)throw"eof";return c};let f=0;const o={};for(;;){const c=d.read();if(c==-1)break;const h=_(),p=_(),u=_(),v=String.fromCharCode(c<<8|h),w=p<<8|u;o[v]=w,f+=1}if(f!=r)throw f+" != "+r;return o})(),l=63;return function(d){const _=[];for(let f=0;f<d.length;f+=1){const o=d.charCodeAt(f);if(o<128)_.push(o);else{const c=s[d.charAt(f)];typeof c=="number"?(c&255)==c?_.push(c):(_.push(c>>>8),_.push(c&255)):_.push(l)}}return _}};const en={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Ka={L:1,M:0,Q:3,H:2},yr={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},Sr=(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,l=21522,d={},_=function(f){let o=0;for(;f!=0;)o+=1,f>>>=1;return o};return d.getBCHTypeInfo=function(f){let o=f<<10;for(;_(o)-_(r)>=0;)o^=r<<_(o)-_(r);return(f<<10|o)^l},d.getBCHTypeNumber=function(f){let o=f<<12;for(;_(o)-_(s)>=0;)o^=s<<_(o)-_(s);return f<<12|o},d.getPatternPosition=function(f){return n[f-1]},d.getMaskFunction=function(f){switch(f){case yr.PATTERN000:return function(o,c){return(o+c)%2==0};case yr.PATTERN001:return function(o,c){return o%2==0};case yr.PATTERN010:return function(o,c){return c%3==0};case yr.PATTERN011:return function(o,c){return(o+c)%3==0};case yr.PATTERN100:return function(o,c){return(Math.floor(o/2)+Math.floor(c/3))%2==0};case yr.PATTERN101:return function(o,c){return o*c%2+o*c%3==0};case yr.PATTERN110:return function(o,c){return(o*c%2+o*c%3)%2==0};case yr.PATTERN111:return function(o,c){return(o*c%3+(o+c)%2)%2==0};default:throw"bad maskPattern:"+f}},d.getErrorCorrectPolynomial=function(f){let o=Ja([1],0);for(let c=0;c<f;c+=1)o=o.multiply(Ja([1,Cr.gexp(c)],0));return o},d.getLengthInBits=function(f,o){if(1<=o&&o<10)switch(f){case en.MODE_NUMBER:return 10;case en.MODE_ALPHA_NUM:return 9;case en.MODE_8BIT_BYTE:return 8;case en.MODE_KANJI:return 8;default:throw"mode:"+f}else if(o<27)switch(f){case en.MODE_NUMBER:return 12;case en.MODE_ALPHA_NUM:return 11;case en.MODE_8BIT_BYTE:return 16;case en.MODE_KANJI:return 10;default:throw"mode:"+f}else if(o<41)switch(f){case en.MODE_NUMBER:return 14;case en.MODE_ALPHA_NUM:return 13;case en.MODE_8BIT_BYTE:return 16;case en.MODE_KANJI:return 12;default:throw"mode:"+f}else throw"type:"+o},d.getLostPoint=function(f){const o=f.getModuleCount();let c=0;for(let u=0;u<o;u+=1)for(let v=0;v<o;v+=1){let w=0;const R=f.isDark(u,v);for(let E=-1;E<=1;E+=1)if(!(u+E<0||o<=u+E))for(let y=-1;y<=1;y+=1)v+y<0||o<=v+y||E==0&&y==0||R==f.isDark(u+E,v+y)&&(w+=1);w>5&&(c+=3+w-5)}for(let u=0;u<o-1;u+=1)for(let v=0;v<o-1;v+=1){let w=0;f.isDark(u,v)&&(w+=1),f.isDark(u+1,v)&&(w+=1),f.isDark(u,v+1)&&(w+=1),f.isDark(u+1,v+1)&&(w+=1),(w==0||w==4)&&(c+=3)}for(let u=0;u<o;u+=1)for(let v=0;v<o-6;v+=1)f.isDark(u,v)&&!f.isDark(u,v+1)&&f.isDark(u,v+2)&&f.isDark(u,v+3)&&f.isDark(u,v+4)&&!f.isDark(u,v+5)&&f.isDark(u,v+6)&&(c+=40);for(let u=0;u<o;u+=1)for(let v=0;v<o-6;v+=1)f.isDark(v,u)&&!f.isDark(v+1,u)&&f.isDark(v+2,u)&&f.isDark(v+3,u)&&f.isDark(v+4,u)&&!f.isDark(v+5,u)&&f.isDark(v+6,u)&&(c+=40);let h=0;for(let u=0;u<o;u+=1)for(let v=0;v<o;v+=1)f.isDark(v,u)&&(h+=1);const p=Math.abs(100*h/o/o-50)/5;return c+=p*10,c},d})(),Cr=(function(){const n=new Array(256),r=new Array(256);for(let l=0;l<8;l+=1)n[l]=1<<l;for(let l=8;l<256;l+=1)n[l]=n[l-4]^n[l-5]^n[l-6]^n[l-8];for(let l=0;l<255;l+=1)r[n[l]]=l;const s={};return s.glog=function(l){if(l<1)throw"glog("+l+")";return r[l]},s.gexp=function(l){for(;l<0;)l+=255;for(;l>=256;)l-=255;return n[l]},s})(),Ja=function(n,r){if(typeof n.length>"u")throw n.length+"/"+r;const s=(function(){let d=0;for(;d<n.length&&n[d]==0;)d+=1;const _=new Array(n.length-d+r);for(let f=0;f<n.length-d;f+=1)_[f]=n[f+d];return _})(),l={};return l.getAt=function(d){return s[d]},l.getLength=function(){return s.length},l.multiply=function(d){const _=new Array(l.getLength()+d.getLength()-1);for(let f=0;f<l.getLength();f+=1)for(let o=0;o<d.getLength();o+=1)_[f+o]^=Cr.gexp(Cr.glog(l.getAt(f))+Cr.glog(d.getAt(o)));return Ja(_,0)},l.mod=function(d){if(l.getLength()-d.getLength()<0)return l;const _=Cr.glog(l.getAt(0))-Cr.glog(d.getAt(0)),f=new Array(l.getLength());for(let o=0;o<l.getLength();o+=1)f[o]=l.getAt(o);for(let o=0;o<d.getLength();o+=1)f[o]^=Cr.gexp(Cr.glog(d.getAt(o))+_);return Ja(f,0).mod(d)},l},$m=(function(){const n=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],r=function(d,_){const f={};return f.totalCount=d,f.dataCount=_,f},s={},l=function(d,_){switch(_){case Ka.L:return n[(d-1)*4+0];case Ka.M:return n[(d-1)*4+1];case Ka.Q:return n[(d-1)*4+2];case Ka.H:return n[(d-1)*4+3];default:return}};return s.getRSBlocks=function(d,_){const f=l(d,_);if(typeof f>"u")throw"bad rs block @ typeNumber:"+d+"/errorCorrectionLevel:"+_;const o=f.length/3,c=[];for(let h=0;h<o;h+=1){const p=f[h*3+0],u=f[h*3+1],v=f[h*3+2];for(let w=0;w<p;w+=1)c.push(r(u,v))}return c},s})(),Gm=function(){const n=[];let r=0;const s={};return s.getBuffer=function(){return n},s.getAt=function(l){const d=Math.floor(l/8);return(n[d]>>>7-l%8&1)==1},s.put=function(l,d){for(let _=0;_<d;_+=1)s.putBit((l>>>d-_-1&1)==1)},s.getLengthInBits=function(){return r},s.putBit=function(l){const d=Math.floor(r/8);n.length<=d&&n.push(0),l&&(n[d]|=128>>>r%8),r+=1},s},z0=function(n){const r=en.MODE_NUMBER,s=n,l={};l.getMode=function(){return r},l.getLength=function(f){return s.length},l.write=function(f){const o=s;let c=0;for(;c+2<o.length;)f.put(d(o.substring(c,c+3)),10),c+=3;c<o.length&&(o.length-c==1?f.put(d(o.substring(c,c+1)),4):o.length-c==2&&f.put(d(o.substring(c,c+2)),7))};const d=function(f){let o=0;for(let c=0;c<f.length;c+=1)o=o*10+_(f.charAt(c));return o},_=function(f){if("0"<=f&&f<="9")return f.charCodeAt(0)-48;throw"illegal char :"+f};return l},I0=function(n){const r=en.MODE_ALPHA_NUM,s=n,l={};l.getMode=function(){return r},l.getLength=function(_){return s.length},l.write=function(_){const f=s;let o=0;for(;o+1<f.length;)_.put(d(f.charAt(o))*45+d(f.charAt(o+1)),11),o+=2;o<f.length&&_.put(d(f.charAt(o)),6)};const d=function(_){if("0"<=_&&_<="9")return _.charCodeAt(0)-48;if("A"<=_&&_<="Z")return _.charCodeAt(0)-65+10;switch(_){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+_}};return l},U0=function(n){const r=en.MODE_8BIT_BYTE,s=Xr.stringToBytes(n),l={};return l.getMode=function(){return r},l.getLength=function(d){return s.length},l.write=function(d){for(let _=0;_<s.length;_+=1)d.put(s[_],8)},l},P0=function(n){const r=en.MODE_KANJI,s=Xr.stringToBytes;(function(_,f){const o=s(_);if(o.length!=2||(o[0]<<8|o[1])!=f)throw"sjis not supported."})("友",38726);const l=s(n),d={};return d.getMode=function(){return r},d.getLength=function(_){return~~(l.length/2)},d.write=function(_){const f=l;let o=0;for(;o+1<f.length;){let c=(255&f[o])<<8|255&f[o+1];if(33088<=c&&c<=40956)c-=33088;else if(57408<=c&&c<=60351)c-=49472;else throw"illegal char at "+(o+1)+"/"+c;c=(c>>>8&255)*192+(c&255),_.put(c,13),o+=2}if(o<f.length)throw"illegal char at "+(o+1)},d},s_=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,l,d){l=l||0,d=d||s.length;for(let _=0;_<d;_+=1)r.writeByte(s[_+l])},r.writeString=function(s){for(let l=0;l<s.length;l+=1)r.writeByte(s.charCodeAt(l))},r.toByteArray=function(){return n},r.toString=function(){let s="";s+="[";for(let l=0;l<n.length;l+=1)l>0&&(s+=","),s+=n[l];return s+="]",s},r},F0=function(){let n=0,r=0,s=0,l="";const d={},_=function(o){l+=String.fromCharCode(f(o&63))},f=function(o){if(o<0)throw"n:"+o;if(o<26)return 65+o;if(o<52)return 97+(o-26);if(o<62)return 48+(o-52);if(o==62)return 43;if(o==63)return 47;throw"n:"+o};return d.writeByte=function(o){for(n=n<<8|o&255,r+=8,s+=1;r>=6;)_(n>>>r-6),r-=6},d.flush=function(){if(r>0&&(_(n<<6-r),n=0,r=0),s%3!=0){const o=3-s%3;for(let c=0;c<o;c+=1)l+="="}},d.toString=function(){return l},d},q0=function(n){const r=n;let s=0,l=0,d=0;const _={};_.read=function(){for(;d<8;){if(s>=r.length){if(d==0)return-1;throw"unexpected end of file./"+d}const c=r.charAt(s);if(s+=1,c=="=")return d=0,-1;if(c.match(/^\s$/))continue;l=l<<6|f(c.charCodeAt(0)),d+=6}const o=l>>>d-8&255;return d-=8,o};const f=function(o){if(65<=o&&o<=90)return o-65;if(97<=o&&o<=122)return o-97+26;if(48<=o&&o<=57)return o-48+52;if(o==43)return 62;if(o==47)return 63;throw"c:"+o};return _},$0=function(n,r){const s=n,l=r,d=new Array(n*r),_={};_.setPixel=function(h,p,u){d[p*s+h]=u},_.write=function(h){h.writeString("GIF87a"),h.writeShort(s),h.writeShort(l),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(l),h.writeByte(0);const p=2,u=o(p);h.writeByte(p);let v=0;for(;u.length-v>255;)h.writeByte(255),h.writeBytes(u,v,255),v+=255;h.writeByte(u.length-v),h.writeBytes(u,v,u.length-v),h.writeByte(0),h.writeString(";")};const f=function(h){const p=h;let u=0,v=0;const w={};return w.write=function(R,E){if(R>>>E)throw"length over";for(;u+E>=8;)p.writeByte(255&(R<<u|v)),E-=8-u,R>>>=8-u,v=0,u=0;v=R<<u|v,u=u+E},w.flush=function(){u>0&&p.writeByte(v)},w},o=function(h){const p=1<<h,u=(1<<h)+1;let v=h+1;const w=c();for(let g=0;g<p;g+=1)w.add(String.fromCharCode(g));w.add(String.fromCharCode(p)),w.add(String.fromCharCode(u));const R=s_(),E=f(R);E.write(p,v);let y=0,S=String.fromCharCode(d[y]);for(y+=1;y<d.length;){const g=String.fromCharCode(d[y]);y+=1,w.contains(S+g)?S=S+g:(E.write(w.indexOf(S),v),w.size()<4095&&(w.size()==1<<v&&(v+=1),w.add(S+g)),S=g)}return E.write(w.indexOf(S),v),E.write(u,v),E.flush(),R.toByteArray()},c=function(){const h={};let p=0;const u={};return u.add=function(v){if(u.contains(v))throw"dup key:"+v;h[v]=p,p+=1},u.size=function(){return p},u.indexOf=function(v){return h[v]},u.contains=function(v){return typeof h[v]<"u"},u};return _},G0=function(n,r,s){const l=$0(n,r);for(let o=0;o<r;o+=1)for(let c=0;c<n;c+=1)l.setPixel(c,o,s(c,o));const d=s_();l.write(d);const _=F0(),f=d.toByteArray();for(let o=0;o<f.length;o+=1)_.writeByte(f[o]);return _.flush(),"data:image/gif;base64,"+_};Xr.stringToBytes;const Fs=[{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}],a_={name:"gate-reviewer",label:"Gate Reviewer",commandAgent:"gate-reviewer",dispatchable:!1},$s=[...Fs,a_],V0={name:"translator",label:"Translator",commandAgent:"translator",dispatchable:!1},K0={name:"harness-engineer",label:"Harness Engineer",commandAgent:"harness-engineer",dispatchable:!1},l_=[V0,K0],jh=[...$s,...l_];Fs.map(n=>n.name);const Nh=$s.map(n=>n.name);l_.map(n=>n.name);jh.map(n=>n.name);jh.filter(n=>n.dispatchable).map(n=>n.name);function W0(n){return Nh.includes(n)}const Y0="zh-CN",X0="pm-final-only",o_=[{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"}],Q0=[{value:"pm-final-only",label:"PM final reply"},{value:"final-only",label:"Each role final reply"},{value:"all",label:"All replies"}];function J0(){const n={};for(const r of Nh)n[r]={permissionMode:"bypassPermissions",model:"default",effort:"default"};return{version:1,roles:n,autoOrchestration:!0}}function Z0({sidebar:n,children:r}){const[s,l]=te.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:()=>l(d=>!d)}),x.jsx("div",{className:"sidebar-content",children:n})]}),x.jsx("main",{className:"app-main",children:r})]})}function e1({busy:n,state:r,onApprove:s,onCancel:l,onComment:d,onReject:_}){var g;const[f,o]=te.useState(!1),[c,h]=te.useState(""),[p,u]=te.useState(null);if(!r||r.status==="idle")return null;const v=r.active,w=t1(r);if(p===w)return null;const R=r.status==="awaiting_user_approval",E=(v==null?void 0:v.title)??((g=r.pending[0])==null?void 0:g.title)??"Harness feedback",y=(v==null?void 0:v.source)==="task-retrospective"?"Task Harness Review":"Harness Feedback",S=()=>{o(!1),u(w)};return x.jsxs(x.Fragment,{children:[x.jsxs("section",{className:R?"harness-feedback-float needs-review":"harness-feedback-float",children:[x.jsxs("div",{children:[x.jsx("strong",{children:R?`${y} needed`:y}),x.jsx("span",{children:n1(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:S,children:"Close"}),x.jsx("button",{type:"button",disabled:n||!v,onClick:()=>o(!0),children:R?"Review":"Open"})]})]}),f&&v?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:y}),x.jsxs("p",{className:"muted",children:[r.status.replaceAll("_"," ")," · queued ",r.queuedCount]})]}),x.jsx("button",{type:"button",onClick:()=>o(!1),children:"Close"})]}),x.jsxs("div",{className:"harness-feedback-modal-body",children:[x.jsxs("section",{children:[x.jsx("h3",{children:v.source==="task-retrospective"?"Task Retrospective Request":"Feedback"}),x.jsx("pre",{children:v.feedbackContent||"No feedback content found."})]}),x.jsxs("section",{children:[x.jsx("h3",{children:"Harness Engineer Analysis"}),x.jsx("pre",{children:v.analysisContent||"Analysis is not available yet."})]})]}),R?x.jsxs("footer",{className:"harness-feedback-review-actions",children:[x.jsx("textarea",{value:c,placeholder:"Optional note for Harness Engineer...",onChange:b=>h(b.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:()=>_(c),children:"Reject"}),x.jsx("button",{type:"button",disabled:n,onClick:()=>s(c),children:"Approve"})]})]}):v?x.jsxs("footer",{className:"harness-feedback-review-actions",children:[x.jsx("textarea",{value:c,placeholder:"Optional cancellation note...",onChange:b=>h(b.target.value)}),x.jsx("div",{children:x.jsx("button",{type:"button",disabled:n,onClick:()=>l(c),children:"Cancel"})})]}):null]})}):null]})}function t1(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 n1(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 No(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 Qe(n,r,s){return`${n} failed. Reason: ${No(r,s)}`}function Ro(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 l=new URLSearchParams({path:r,taskSlug:n});return Ce(`/api/projects/harness/file?${l.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 l=new URLSearchParams({after:String(r)});return s!==void 0&&l.set("limit",String(s)),Ce(`/api/translation/sessions/${encodeURIComponent(n)}/events?${l.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"})},createGatewayPairingCode(){return Ce("/api/gateway/pairing-code",{method:"POST"})},resetGatewayBinding(){return Ce("/api/gateway/binding/reset",{method:"POST"})}};async function Ce(n,r={}){var _,f,o;const s=new Headers(r.headers);r.body!==void 0&&r.body!==null&&!s.has("content-type")&&s.set("content-type","application/json");const l=(r.method??"GET").toUpperCase();let d;try{d=await fetch(n,{...r,headers:s})}catch(c){throw new Error(`${l} ${n} could not reach the VCM backend. Reason: ${No(c)}`)}if(!d.ok){const c=await d.text().catch(()=>""),h=i1(c),p=d.statusText?`${d.status} ${d.statusText}`:String(d.status),v=((_=h==null?void 0:h.error)!=null&&_.hint?`${h.error.message??"Backend error."} ${h.error.hint}`:(f=h==null?void 0:h.error)==null?void 0:f.message)??r1(c),w=(o=h==null?void 0:h.error)==null?void 0:o.runtime,R=w?` [backend ${w.version??"unknown"} pid=${w.pid??"unknown"} cwd=${w.cwd??"unknown"}]`:"";throw new Error(`${l} ${n} returned HTTP ${p}. ${v}${R}`)}return d.json()}function i1(n){if(!n.trim())return null;try{return JSON.parse(n)}catch{return null}}function r1(n){const r=n.trim();return r?`Non-JSON response body: ${r.slice(0,500)}`:"The response body was empty."}const gh="vcm:ui-error-report",_h="vcm:ui-error-clear-actions",vh="vcm:ui-error-clear-message";function s1(n){const r=n.trim();!r||typeof window>"u"||window.dispatchEvent(new CustomEvent(gh,{detail:{message:r}}))}function a1(n){const r=n.trim();!r||typeof window>"u"||window.dispatchEvent(new CustomEvent(vh,{detail:{message:r}}))}function l1(n){n.length===0||typeof window>"u"||window.dispatchEvent(new CustomEvent(_h,{detail:{actions:n}}))}function wr(n){const[r,s]=te.useState(n),l=te.useRef(n),d=te.useCallback(_=>{const f=l.current,o=typeof _=="function"?_(f):_;l.current=o,typeof o=="string"&&o.trim()?s1(o):typeof f=="string"&&f.trim()&&a1(f),s(o)},[]);return[r,d]}var Wu={exports:{}},Vm;function o1(){return Vm||(Vm=1,(function(n,r){(function(s,l){n.exports=l()})(self,(()=>(()=>{var s={};return(()=>{var l=s;Object.defineProperty(l,"__esModule",{value:!0}),l.FitAddon=void 0,l.FitAddon=class{activate(d){this._terminal=d}dispose(){}fit(){const d=this.proposeDimensions();if(!d||!this._terminal||isNaN(d.cols)||isNaN(d.rows))return;const _=this._terminal._core;this._terminal.rows===d.rows&&this._terminal.cols===d.cols||(_._renderService.clear(),this._terminal.resize(d.cols,d.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const d=this._terminal._core,_=d._renderService.dimensions;if(_.css.cell.width===0||_.css.cell.height===0)return;const f=this._terminal.options.scrollback===0?0:d.viewport.scrollBarWidth,o=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(o.getPropertyValue("height")),h=Math.max(0,parseInt(o.getPropertyValue("width"))),p=window.getComputedStyle(this._terminal.element),u=c-(parseInt(p.getPropertyValue("padding-top"))+parseInt(p.getPropertyValue("padding-bottom"))),v=h-(parseInt(p.getPropertyValue("padding-right"))+parseInt(p.getPropertyValue("padding-left")))-f;return{cols:Math.max(2,Math.floor(v/_.css.cell.width)),rows:Math.max(1,Math.floor(u/_.css.cell.height))}}}})(),s})()))})(Wu)),Wu.exports}var c1=o1(),Yu={exports:{}},Km;function u1(){return Km||(Km=1,(function(n,r){(function(s,l){n.exports=l()})(self,(()=>(()=>{var s={6:(f,o)=>{function c(p){try{const u=new URL(p),v=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(v.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(o,"__esModule",{value:!0}),o.LinkComputer=o.WebLinkProvider=void 0,o.WebLinkProvider=class{constructor(p,u,v,w={}){this._terminal=p,this._regex=u,this._handler=v,this._options=w}provideLinks(p,u){const v=h.computeLink(p,this._regex,this._terminal,this._handler);u(this._addCallbacks(v))}_addCallbacks(p){return p.map((u=>(u.leave=this._options.leave,u.hover=(v,w)=>{if(this._options.hover){const{range:R}=u;this._options.hover(v,w,R)}},u)))}};class h{static computeLink(u,v,w,R){const E=new RegExp(v.source,(v.flags||"")+"g"),[y,S]=h._getWindowedLineStrings(u-1,w),g=y.join("");let b;const A=[];for(;b=E.exec(g);){const L=b[0];if(!c(L))continue;const[D,T]=h._mapStrIdx(w,S,0,b.index),[k,M]=h._mapStrIdx(w,D,T,L.length);if(D===-1||T===-1||k===-1||M===-1)continue;const B={start:{x:T+1,y:D+1},end:{x:M,y:k+1}};A.push({range:B,text:L,activate:R})}return A}static _getWindowedLineStrings(u,v){let w,R=u,E=u,y=0,S="";const g=[];if(w=v.buffer.active.getLine(u)){const b=w.translateToString(!0);if(w.isWrapped&&b[0]!==" "){for(y=0;(w=v.buffer.active.getLine(--R))&&y<2048&&(S=w.translateToString(!0),y+=S.length,g.push(S),w.isWrapped&&S.indexOf(" ")===-1););g.reverse()}for(g.push(b),y=0;(w=v.buffer.active.getLine(++E))&&w.isWrapped&&y<2048&&(S=w.translateToString(!0),y+=S.length,g.push(S),S.indexOf(" ")===-1););}return[g,R]}static _mapStrIdx(u,v,w,R){const E=u.buffer.active,y=E.getNullCell();let S=w;for(;R;){const g=E.getLine(v);if(!g)return[-1,-1];for(let b=S;b<g.length;++b){g.getCell(b,y);const A=y.getChars();if(y.getWidth()&&(R-=A.length||1,b===g.length-1&&A==="")){const L=E.getLine(v+1);L&&L.isWrapped&&(L.getCell(0,y),y.getWidth()===2&&(R+=1))}if(R<0)return[v,b]}v++,S=0}return[v,S]}}o.LinkComputer=h}},l={};function d(f){var o=l[f];if(o!==void 0)return o.exports;var c=l[f]={exports:{}};return s[f](c,c.exports,d),c.exports}var _={};return(()=>{var f=_;Object.defineProperty(f,"__esModule",{value:!0}),f.WebLinksAddon=void 0;const o=d(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function h(p,u){const v=window.open();if(v){try{v.opener=null}catch{}v.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,v=u.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new o.WebLinkProvider(this._terminal,v,this._handler,u))}dispose(){var p;(p=this._linkProvider)==null||p.dispose()}}})(),_})()))})(Yu)),Yu.exports}var h1=u1(),Xu={exports:{}},Wm;function f1(){return Wm||(Wm=1,(function(n,r){(function(s,l){n.exports=l()})(globalThis,(()=>(()=>{var s={4567:function(f,o,c){var h=this&&this.__decorate||function(g,b,A,L){var D,T=arguments.length,k=T<3?b:L===null?L=Object.getOwnPropertyDescriptor(b,A):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(g,b,A,L);else for(var M=g.length-1;M>=0;M--)(D=g[M])&&(k=(T<3?D(k):T>3?D(b,A,k):D(b,A))||k);return T>3&&k&&Object.defineProperty(b,A,k),k},p=this&&this.__param||function(g,b){return function(A,L){b(A,L,g)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const u=c(9042),v=c(9924),w=c(844),R=c(4725),E=c(2585),y=c(3656);let S=o.AccessibilityManager=class extends w.Disposable{constructor(g,b,A,L){super(),this._terminal=g,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 v.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,y.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,w.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(g){for(let b=0;b<g;b++)this._handleChar(" ")}_handleChar(g){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==g&&(this._charsToAnnounce+=g):this._charsToAnnounce+=g,g===`
53
- `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=u.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(g){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(g)||this._charsToConsume.push(g)}_refreshRows(g,b){this._liveRegionDebouncer.refresh(g,b,this._terminal.rows)}_renderRows(g,b){const A=this._terminal.buffer,L=A.lines.length.toString();for(let D=g;D<=b;D++){const T=A.lines.get(A.ydisp+D),k=[],M=(T==null?void 0:T.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(g,b){const A=g.target,L=this._rowElements[b===0?1:this._rowElements.length-2];if(A.getAttribute("aria-posinset")===(b===0?"1":`${this._terminal.buffer.lines.length}`)||g.relatedTarget!==L)return;let D,T;if(b===0?(D=A,T=this._rowElements.pop(),this._rowContainer.removeChild(T)):(D=this._rowElements.shift(),T=A,this._rowContainer.removeChild(D)),D.removeEventListener("focus",this._topBoundaryFocusListener),T.removeEventListener("focus",this._bottomBoundaryFocusListener),b===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(b===0?-1:1),this._rowElements[b===0?1:this._rowElements.length-2].focus(),g.preventDefault(),g.stopImmediatePropagation()}_handleSelectionChange(){var M;if(this._rowElements.length===0)return;const g=document.getSelection();if(!g)return;if(g.isCollapsed)return void(this._rowContainer.contains(g.anchorNode)&&this._terminal.clearSelection());if(!g.anchorNode||!g.focusNode)return void console.error("anchorNode and/or focusNode are null");let b={node:g.anchorNode,offset:g.anchorOffset},A={node:g.focusNode,offset:g.focusOffset};if((b.node.compareDocumentPosition(A.node)&Node.DOCUMENT_POSITION_PRECEDING||b.node===A.node&&b.offset>A.offset)&&([b,A]=[A,b]),b.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(b={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(b.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 Y=this._rowColumns.get(U);if(!Y)return console.warn("columns is null. Race condition?"),null;let X=H<Y.length?Y[H]:Y.slice(-1)[0]+1;return X>=this._terminal.cols&&(++P,X=0),{row:P,column:X}},T=D(b),k=D(A);if(T&&k){if(T.row>k.row||T.row===k.row&&T.column>=k.column)throw new Error("invalid range");this._terminal.select(T.column,T.row,(k.row-T.row)*this._terminal.cols-T.column+k.column)}}_handleResize(g){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let b=this._rowContainer.children.length;b<this._terminal.rows;b++)this._rowElements[b]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[b]);for(;this._rowElements.length>g;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const g=this._coreBrowserService.mainDocument.createElement("div");return g.setAttribute("role","listitem"),g.tabIndex=-1,this._refreshRowDimensions(g),g}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let g=0;g<this._terminal.rows;g++)this._refreshRowDimensions(this._rowElements[g])}}_refreshRowDimensions(g){g.style.height=`${this._renderService.dimensions.css.cell.height}px`}};o.AccessibilityManager=S=h([p(1,E.IInstantiationService),p(2,R.ICoreBrowserService),p(3,R.IRenderService)],S)},3614:(f,o)=>{function c(v){return v.replace(/\r?\n/g,"\r")}function h(v,w){return w?"\x1B[200~"+v+"\x1B[201~":v}function p(v,w,R,E){v=h(v=c(v),R.decPrivateModes.bracketedPasteMode&&E.rawOptions.ignoreBracketedPasteMode!==!0),R.triggerDataEvent(v,!0),w.value=""}function u(v,w,R){const E=R.getBoundingClientRect(),y=v.clientX-E.left-10,S=v.clientY-E.top-10;w.style.width="20px",w.style.height="20px",w.style.left=`${y}px`,w.style.top=`${S}px`,w.style.zIndex="1000",w.focus()}Object.defineProperty(o,"__esModule",{value:!0}),o.rightClickHandler=o.moveTextAreaUnderMouseCursor=o.paste=o.handlePasteEvent=o.copyHandler=o.bracketTextForPaste=o.prepareTextForTerminal=void 0,o.prepareTextForTerminal=c,o.bracketTextForPaste=h,o.copyHandler=function(v,w){v.clipboardData&&v.clipboardData.setData("text/plain",w.selectionText),v.preventDefault()},o.handlePasteEvent=function(v,w,R,E){v.stopPropagation(),v.clipboardData&&p(v.clipboardData.getData("text/plain"),w,R,E)},o.paste=p,o.moveTextAreaUnderMouseCursor=u,o.rightClickHandler=function(v,w,R,E,y){u(v,w,R),y&&E.rightClickSelect(v),w.value=E.selectionText,w.select()}},7239:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const h=c(1505);o.ColorContrastCache=class{constructor(){this._color=new h.TwoKeyMap,this._css=new h.TwoKeyMap}setCss(p,u,v){this._css.set(p,u,v)}getCss(p,u){return this._css.get(p,u)}setColor(p,u,v){this._color.set(p,u,v)}getColor(p,u){return this._color.get(p,u)}clear(){this._color.clear(),this._css.clear()}}},3656:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(c,h,p,u){c.addEventListener(h,p,u);let v=!1;return{dispose:()=>{v||(v=!0,c.removeEventListener(h,p,u))}}}},3551:function(f,o,c){var h=this&&this.__decorate||function(S,g,b,A){var L,D=arguments.length,T=D<3?g:A===null?A=Object.getOwnPropertyDescriptor(g,b):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(S,g,b,A);else for(var k=S.length-1;k>=0;k--)(L=S[k])&&(T=(D<3?L(T):D>3?L(g,b,T):L(g,b))||T);return D>3&&T&&Object.defineProperty(g,b,T),T},p=this&&this.__param||function(S,g){return function(b,A){g(b,A,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier=void 0;const u=c(3656),v=c(8460),w=c(844),R=c(2585),E=c(4725);let y=o.Linkifier=class extends w.Disposable{get currentLink(){return this._currentLink}constructor(S,g,b,A,L){super(),this._element=S,this._mouseService=g,this._renderService=b,this._bufferService=A,this._linkProviderService=L,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new v.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new v.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,w.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,w.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(S){this._lastMouseEvent=S;const g=this._positionFromMouseEvent(S,this._element,this._mouseService);if(!g)return;this._isMouseOut=!1;const b=S.composedPath();for(let A=0;A<b.length;A++){const L=b[A];if(L.classList.contains("xterm"))break;if(L.classList.contains("xterm-hover"))return}this._lastBufferCell&&g.x===this._lastBufferCell.x&&g.y===this._lastBufferCell.y||(this._handleHover(g),this._lastBufferCell=g)}_handleHover(S){if(this._activeLine!==S.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(S,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,S)||(this._clearCurrentLink(),this._askForLink(S,!0))}_askForLink(S,g){var A,L;this._activeProviderReplies&&g||((A=this._activeProviderReplies)==null||A.forEach((D=>{D==null||D.forEach((T=>{T.link.dispose&&T.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=S.y);let b=!1;for(const[D,T]of this._linkProviderService.linkProviders.entries())g?(L=this._activeProviderReplies)!=null&&L.get(D)&&(b=this._checkLinkProviderResult(D,S,b)):T.provideLinks(S.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),b=this._checkLinkProviderResult(D,S,b),((H=this._activeProviderReplies)==null?void 0:H.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(S.y,this._activeProviderReplies)}))}_removeIntersectingLinks(S,g){const b=new Set;for(let A=0;A<g.size;A++){const L=g.get(A);if(L)for(let D=0;D<L.length;D++){const T=L[D],k=T.link.range.start.y<S?0:T.link.range.start.x,M=T.link.range.end.y>S?this._bufferService.cols:T.link.range.end.x;for(let B=k;B<=M;B++){if(b.has(B)){L.splice(D--,1);break}b.add(B)}}}}_checkLinkProviderResult(S,g,b){var D;if(!this._activeProviderReplies)return b;const A=this._activeProviderReplies.get(S);let L=!1;for(let T=0;T<S;T++)this._activeProviderReplies.has(T)&&!this._activeProviderReplies.get(T)||(L=!0);if(!L&&A){const T=A.find((k=>this._linkAtPosition(k.link,g)));T&&(b=!0,this._handleNewLink(T))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!b)for(let T=0;T<this._activeProviderReplies.size;T++){const k=(D=this._activeProviderReplies.get(T))==null?void 0:D.find((M=>this._linkAtPosition(M.link,g)));if(k){b=!0,this._handleNewLink(k);break}}return b}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(S){if(!this._currentLink)return;const g=this._positionFromMouseEvent(S,this._element,this._mouseService);g&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,g)&&this._currentLink.link.activate(S,this._currentLink.link.text)}_clearCurrentLink(S,g){this._currentLink&&this._lastMouseEvent&&(!S||!g||this._currentLink.link.range.start.y>=S&&this._currentLink.link.range.end.y<=g)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,w.disposeArray)(this._linkCacheDisposables))}_handleNewLink(S){if(!this._lastMouseEvent)return;const g=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);g&&this._linkAtPosition(S.link,g)&&(this._currentLink=S,this._currentLink.state={decorations:{underline:S.link.decorations===void 0||S.link.decorations.underline,pointerCursor:S.link.decorations===void 0||S.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,S.link,this._lastMouseEvent),S.link.decorations={},Object.defineProperties(S.link.decorations,{pointerCursor:{get:()=>{var b,A;return(A=(b=this._currentLink)==null?void 0:b.state)==null?void 0:A.decorations.pointerCursor},set:b=>{var A;(A=this._currentLink)!=null&&A.state&&this._currentLink.state.decorations.pointerCursor!==b&&(this._currentLink.state.decorations.pointerCursor=b,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",b))}},underline:{get:()=>{var b,A;return(A=(b=this._currentLink)==null?void 0:b.state)==null?void 0:A.decorations.underline},set:b=>{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)!==b&&(this._currentLink.state.decorations.underline=b,this._currentLink.state.isHovered&&this._fireUnderlineEvent(S.link,b))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((b=>{if(!this._currentLink)return;const A=b.start===0?0:b.start+1+this._bufferService.buffer.ydisp,L=this._bufferService.buffer.ydisp+1+b.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(S,g,b){var A;(A=this._currentLink)!=null&&A.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(g,!0),this._currentLink.state.decorations.pointerCursor&&S.classList.add("xterm-cursor-pointer")),g.hover&&g.hover(b,g.text)}_fireUnderlineEvent(S,g){const b=S.range,A=this._bufferService.buffer.ydisp,L=this._createLinkUnderlineEvent(b.start.x-1,b.start.y-A-1,b.end.x,b.end.y-A-1,void 0);(g?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(L)}_linkLeave(S,g,b){var A;(A=this._currentLink)!=null&&A.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(g,!1),this._currentLink.state.decorations.pointerCursor&&S.classList.remove("xterm-cursor-pointer")),g.leave&&g.leave(b,g.text)}_linkAtPosition(S,g){const b=S.range.start.y*this._bufferService.cols+S.range.start.x,A=S.range.end.y*this._bufferService.cols+S.range.end.x,L=g.y*this._bufferService.cols+g.x;return b<=L&&L<=A}_positionFromMouseEvent(S,g,b){const A=b.getCoords(S,g,this._bufferService.cols,this._bufferService.rows);if(A)return{x:A[0],y:A[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(S,g,b,A,L){return{x1:S,y1:g,x2:b,y2:A,cols:this._bufferService.cols,fg:L}}};o.Linkifier=y=h([p(1,E.IMouseService),p(2,E.IRenderService),p(3,R.IBufferService),p(4,E.ILinkProviderService)],y)},9042:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tooMuchOutput=o.promptLabel=void 0,o.promptLabel="Terminal input",o.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(f,o,c){var h=this&&this.__decorate||function(E,y,S,g){var b,A=arguments.length,L=A<3?y:g===null?g=Object.getOwnPropertyDescriptor(y,S):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(E,y,S,g);else for(var D=E.length-1;D>=0;D--)(b=E[D])&&(L=(A<3?b(L):A>3?b(y,S,L):b(y,S))||L);return A>3&&L&&Object.defineProperty(y,S,L),L},p=this&&this.__param||function(E,y){return function(S,g){y(S,g,E)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const u=c(511),v=c(2585);let w=o.OscLinkProvider=class{constructor(E,y,S){this._bufferService=E,this._optionsService=y,this._oscLinkService=S}provideLinks(E,y){var M;const S=this._bufferService.buffer.lines.get(E-1);if(!S)return void y(void 0);const g=[],b=this._optionsService.rawOptions.linkHandler,A=new u.CellData,L=S.getTrimmedLength();let D=-1,T=-1,k=!1;for(let B=0;B<L;B++)if(T!==-1||S.hasContent(B)){if(S.loadCell(B,A),A.hasExtendedAttrs()&&A.extended.urlId){if(T===-1){T=B,D=A.extended.urlId;continue}k=A.extended.urlId!==D}else T!==-1&&(k=!0);if(k||T!==-1&&B===L-1){const H=(M=this._oscLinkService.getLinkData(D))==null?void 0:M.uri;if(H){const U={start:{x:T+1,y:E},end:{x:B+(k||B!==L-1?0:1),y:E}};let P=!1;if(!(b!=null&&b.allowNonHttpProtocols))try{const Y=new URL(H);["http:","https:"].includes(Y.protocol)||(P=!0)}catch{P=!0}P||g.push({text:H,range:U,activate:(Y,X)=>b?b.activate(Y,X,U):R(0,X),hover:(Y,X)=>{var V;return(V=b==null?void 0:b.hover)==null?void 0:V.call(b,Y,X,U)},leave:(Y,X)=>{var V;return(V=b==null?void 0:b.leave)==null?void 0:V.call(b,Y,X,U)}})}k=!1,A.hasExtendedAttrs()&&A.extended.urlId?(T=B,D=A.extended.urlId):(T=-1,D=-1)}}y(g)}};function R(E,y){if(confirm(`Do you want to navigate to ${y}?
51
+ `}return ne.substring(0,ne.length-1)},p.renderTo2dContext=function(T,k){k=k||2;const M=p.getModuleCount();for(let B=0;B<M;B++)for(let H=0;H<M;H++)T.fillStyle=p.isDark(B,H)?"black":"white",T.fillRect(H*k,B*k,k,k)},p};Wr.stringToBytes=function(n){const r=[];for(let s=0;s<n.length;s+=1){const l=n.charCodeAt(s);r.push(l&255)}return r};Wr.createStringToBytes=function(n,r){const s=(function(){const d=q0(n),g=function(){const c=d.read();if(c==-1)throw"eof";return c};let f=0;const o={};for(;;){const c=d.read();if(c==-1)break;const h=g(),p=g(),u=g(),b=String.fromCharCode(c<<8|h),w=p<<8|u;o[b]=w,f+=1}if(f!=r)throw f+" != "+r;return o})(),l=63;return function(d){const g=[];for(let f=0;f<d.length;f+=1){const o=d.charCodeAt(f);if(o<128)g.push(o);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(l)}}return g}};const tn={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Ka={L:1,M:0,Q:3,H:2},_r={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},vr=(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,l=21522,d={},g=function(f){let o=0;for(;f!=0;)o+=1,f>>>=1;return o};return d.getBCHTypeInfo=function(f){let o=f<<10;for(;g(o)-g(r)>=0;)o^=r<<g(o)-g(r);return(f<<10|o)^l},d.getBCHTypeNumber=function(f){let o=f<<12;for(;g(o)-g(s)>=0;)o^=s<<g(o)-g(s);return f<<12|o},d.getPatternPosition=function(f){return n[f-1]},d.getMaskFunction=function(f){switch(f){case _r.PATTERN000:return function(o,c){return(o+c)%2==0};case _r.PATTERN001:return function(o,c){return o%2==0};case _r.PATTERN010:return function(o,c){return c%3==0};case _r.PATTERN011:return function(o,c){return(o+c)%3==0};case _r.PATTERN100:return function(o,c){return(Math.floor(o/2)+Math.floor(c/3))%2==0};case _r.PATTERN101:return function(o,c){return o*c%2+o*c%3==0};case _r.PATTERN110:return function(o,c){return(o*c%2+o*c%3)%2==0};case _r.PATTERN111:return function(o,c){return(o*c%3+(o+c)%2)%2==0};default:throw"bad maskPattern:"+f}},d.getErrorCorrectPolynomial=function(f){let o=Ja([1],0);for(let c=0;c<f;c+=1)o=o.multiply(Ja([1,Sr.gexp(c)],0));return o},d.getLengthInBits=function(f,o){if(1<=o&&o<10)switch(f){case tn.MODE_NUMBER:return 10;case tn.MODE_ALPHA_NUM:return 9;case tn.MODE_8BIT_BYTE:return 8;case tn.MODE_KANJI:return 8;default:throw"mode:"+f}else if(o<27)switch(f){case tn.MODE_NUMBER:return 12;case tn.MODE_ALPHA_NUM:return 11;case tn.MODE_8BIT_BYTE:return 16;case tn.MODE_KANJI:return 10;default:throw"mode:"+f}else if(o<41)switch(f){case tn.MODE_NUMBER:return 14;case tn.MODE_ALPHA_NUM:return 13;case tn.MODE_8BIT_BYTE:return 16;case tn.MODE_KANJI:return 12;default:throw"mode:"+f}else throw"type:"+o},d.getLostPoint=function(f){const o=f.getModuleCount();let c=0;for(let u=0;u<o;u+=1)for(let b=0;b<o;b+=1){let w=0;const R=f.isDark(u,b);for(let E=-1;E<=1;E+=1)if(!(u+E<0||o<=u+E))for(let v=-1;v<=1;v+=1)b+v<0||o<=b+v||E==0&&v==0||R==f.isDark(u+E,b+v)&&(w+=1);w>5&&(c+=3+w-5)}for(let u=0;u<o-1;u+=1)for(let b=0;b<o-1;b+=1){let w=0;f.isDark(u,b)&&(w+=1),f.isDark(u+1,b)&&(w+=1),f.isDark(u,b+1)&&(w+=1),f.isDark(u+1,b+1)&&(w+=1),(w==0||w==4)&&(c+=3)}for(let u=0;u<o;u+=1)for(let b=0;b<o-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<o;u+=1)for(let b=0;b<o-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<o;u+=1)for(let b=0;b<o;b+=1)f.isDark(b,u)&&(h+=1);const p=Math.abs(100*h/o/o-50)/5;return c+=p*10,c},d})(),Sr=(function(){const n=new Array(256),r=new Array(256);for(let l=0;l<8;l+=1)n[l]=1<<l;for(let l=8;l<256;l+=1)n[l]=n[l-4]^n[l-5]^n[l-6]^n[l-8];for(let l=0;l<255;l+=1)r[n[l]]=l;const s={};return s.glog=function(l){if(l<1)throw"glog("+l+")";return r[l]},s.gexp=function(l){for(;l<0;)l+=255;for(;l>=256;)l-=255;return n[l]},s})(),Ja=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})(),l={};return l.getAt=function(d){return s[d]},l.getLength=function(){return s.length},l.multiply=function(d){const g=new Array(l.getLength()+d.getLength()-1);for(let f=0;f<l.getLength();f+=1)for(let o=0;o<d.getLength();o+=1)g[f+o]^=Sr.gexp(Sr.glog(l.getAt(f))+Sr.glog(d.getAt(o)));return Ja(g,0)},l.mod=function(d){if(l.getLength()-d.getLength()<0)return l;const g=Sr.glog(l.getAt(0))-Sr.glog(d.getAt(0)),f=new Array(l.getLength());for(let o=0;o<l.getLength();o+=1)f[o]=l.getAt(o);for(let o=0;o<d.getLength();o+=1)f[o]^=Sr.gexp(Sr.glog(d.getAt(o))+g);return Ja(f,0).mod(d)},l},$m=(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={},l=function(d,g){switch(g){case Ka.L:return n[(d-1)*4+0];case Ka.M:return n[(d-1)*4+1];case Ka.Q:return n[(d-1)*4+2];case Ka.H:return n[(d-1)*4+3];default:return}};return s.getRSBlocks=function(d,g){const f=l(d,g);if(typeof f>"u")throw"bad rs block @ typeNumber:"+d+"/errorCorrectionLevel:"+g;const o=f.length/3,c=[];for(let h=0;h<o;h+=1){const p=f[h*3+0],u=f[h*3+1],b=f[h*3+2];for(let w=0;w<p;w+=1)c.push(r(u,b))}return c},s})(),Gm=function(){const n=[];let r=0;const s={};return s.getBuffer=function(){return n},s.getAt=function(l){const d=Math.floor(l/8);return(n[d]>>>7-l%8&1)==1},s.put=function(l,d){for(let g=0;g<d;g+=1)s.putBit((l>>>d-g-1&1)==1)},s.getLengthInBits=function(){return r},s.putBit=function(l){const d=Math.floor(r/8);n.length<=d&&n.push(0),l&&(n[d]|=128>>>r%8),r+=1},s},z0=function(n){const r=tn.MODE_NUMBER,s=n,l={};l.getMode=function(){return r},l.getLength=function(f){return s.length},l.write=function(f){const o=s;let c=0;for(;c+2<o.length;)f.put(d(o.substring(c,c+3)),10),c+=3;c<o.length&&(o.length-c==1?f.put(d(o.substring(c,c+1)),4):o.length-c==2&&f.put(d(o.substring(c,c+2)),7))};const d=function(f){let o=0;for(let c=0;c<f.length;c+=1)o=o*10+g(f.charAt(c));return o},g=function(f){if("0"<=f&&f<="9")return f.charCodeAt(0)-48;throw"illegal char :"+f};return l},I0=function(n){const r=tn.MODE_ALPHA_NUM,s=n,l={};l.getMode=function(){return r},l.getLength=function(g){return s.length},l.write=function(g){const f=s;let o=0;for(;o+1<f.length;)g.put(d(f.charAt(o))*45+d(f.charAt(o+1)),11),o+=2;o<f.length&&g.put(d(f.charAt(o)),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 l},U0=function(n){const r=tn.MODE_8BIT_BYTE,s=Wr.stringToBytes(n),l={};return l.getMode=function(){return r},l.getLength=function(d){return s.length},l.write=function(d){for(let g=0;g<s.length;g+=1)d.put(s[g],8)},l},P0=function(n){const r=tn.MODE_KANJI,s=Wr.stringToBytes;(function(g,f){const o=s(g);if(o.length!=2||(o[0]<<8|o[1])!=f)throw"sjis not supported."})("友",38726);const l=s(n),d={};return d.getMode=function(){return r},d.getLength=function(g){return~~(l.length/2)},d.write=function(g){const f=l;let o=0;for(;o+1<f.length;){let c=(255&f[o])<<8|255&f[o+1];if(33088<=c&&c<=40956)c-=33088;else if(57408<=c&&c<=60351)c-=49472;else throw"illegal char at "+(o+1)+"/"+c;c=(c>>>8&255)*192+(c&255),g.put(c,13),o+=2}if(o<f.length)throw"illegal char at "+(o+1)},d},s_=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,l,d){l=l||0,d=d||s.length;for(let g=0;g<d;g+=1)r.writeByte(s[g+l])},r.writeString=function(s){for(let l=0;l<s.length;l+=1)r.writeByte(s.charCodeAt(l))},r.toByteArray=function(){return n},r.toString=function(){let s="";s+="[";for(let l=0;l<n.length;l+=1)l>0&&(s+=","),s+=n[l];return s+="]",s},r},F0=function(){let n=0,r=0,s=0,l="";const d={},g=function(o){l+=String.fromCharCode(f(o&63))},f=function(o){if(o<0)throw"n:"+o;if(o<26)return 65+o;if(o<52)return 97+(o-26);if(o<62)return 48+(o-52);if(o==62)return 43;if(o==63)return 47;throw"n:"+o};return d.writeByte=function(o){for(n=n<<8|o&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 o=3-s%3;for(let c=0;c<o;c+=1)l+="="}},d.toString=function(){return l},d},q0=function(n){const r=n;let s=0,l=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;l=l<<6|f(c.charCodeAt(0)),d+=6}const o=l>>>d-8&255;return d-=8,o};const f=function(o){if(65<=o&&o<=90)return o-65;if(97<=o&&o<=122)return o-97+26;if(48<=o&&o<=57)return o-48+52;if(o==43)return 62;if(o==47)return 63;throw"c:"+o};return g},$0=function(n,r){const s=n,l=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(l),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(l),h.writeByte(0);const p=2,u=o(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 w={};return w.write=function(R,E){if(R>>>E)throw"length over";for(;u+E>=8;)p.writeByte(255&(R<<u|b)),E-=8-u,R>>>=8-u,b=0,u=0;b=R<<u|b,u=u+E},w.flush=function(){u>0&&p.writeByte(b)},w},o=function(h){const p=1<<h,u=(1<<h)+1;let b=h+1;const w=c();for(let _=0;_<p;_+=1)w.add(String.fromCharCode(_));w.add(String.fromCharCode(p)),w.add(String.fromCharCode(u));const R=s_(),E=f(R);E.write(p,b);let v=0,y=String.fromCharCode(d[v]);for(v+=1;v<d.length;){const _=String.fromCharCode(d[v]);v+=1,w.contains(y+_)?y=y+_:(E.write(w.indexOf(y),b),w.size()<4095&&(w.size()==1<<b&&(b+=1),w.add(y+_)),y=_)}return E.write(w.indexOf(y),b),E.write(u,b),E.flush(),R.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},G0=function(n,r,s){const l=$0(n,r);for(let o=0;o<r;o+=1)for(let c=0;c<n;c+=1)l.setPixel(c,o,s(c,o));const d=s_();l.write(d);const g=F0(),f=d.toByteArray();for(let o=0;o<f.length;o+=1)g.writeByte(f[o]);return g.flush(),"data:image/gif;base64,"+g};Wr.stringToBytes;const Fs=[{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}],a_={name:"gate-reviewer",label:"Gate Reviewer",commandAgent:"gate-reviewer",dispatchable:!1},$s=[...Fs,a_],V0={name:"translator",label:"Translator",commandAgent:"translator",dispatchable:!1},K0={name:"harness-engineer",label:"Harness Engineer",commandAgent:"harness-engineer",dispatchable:!1},l_=[V0,K0],jh=[...$s,...l_];Fs.map(n=>n.name);const Nh=$s.map(n=>n.name);l_.map(n=>n.name);jh.map(n=>n.name);jh.filter(n=>n.dispatchable).map(n=>n.name);function W0(n){return Nh.includes(n)}const Y0="zh-CN",X0="pm-final-only",o_=[{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"}],Q0=[{value:"pm-final-only",label:"PM final reply"},{value:"final-only",label:"Each role final reply"},{value:"all",label:"All replies"}];function J0(){const n={};for(const r of Nh)n[r]={permissionMode:"bypassPermissions",model:"default",effort:"default"};return{version:1,roles:n,autoOrchestration:!0}}function Z0({sidebar:n,children:r}){const[s,l]=te.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:()=>l(d=>!d)}),x.jsx("div",{className:"sidebar-content",children:n})]}),x.jsx("main",{className:"app-main",children:r})]})}function e1({busy:n,state:r,onApprove:s,onCancel:l,onComment:d,onReject:g}){var _;const[f,o]=te.useState(!1),[c,h]=te.useState(""),[p,u]=te.useState(null);if(!r||r.status==="idle")return null;const b=r.active,w=t1(r);if(p===w)return null;const R=r.status==="awaiting_user_approval",E=(b==null?void 0:b.title)??((_=r.pending[0])==null?void 0:_.title)??"Harness feedback",v=(b==null?void 0:b.source)==="task-retrospective"?"Task Harness Review":"Harness Feedback",y=()=>{o(!1),u(w)};return x.jsxs(x.Fragment,{children:[x.jsxs("section",{className:R?"harness-feedback-float needs-review":"harness-feedback-float",children:[x.jsxs("div",{children:[x.jsx("strong",{children:R?`${v} needed`:v}),x.jsx("span",{children:n1(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:y,children:"Close"}),x.jsx("button",{type:"button",disabled:n||!b,onClick:()=>o(!0),children:R?"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:v}),x.jsxs("p",{className:"muted",children:[r.status.replaceAll("_"," ")," · queued ",r.queuedCount]})]}),x.jsx("button",{type:"button",onClick:()=>o(!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."})]})]}),R?x.jsxs("footer",{className:"harness-feedback-review-actions",children:[x.jsx("textarea",{value:c,placeholder:"Optional note for Harness Engineer...",onChange:S=>h(S.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:S=>h(S.target.value)}),x.jsx("div",{children:x.jsx("button",{type:"button",disabled:n,onClick:()=>l(c),children:"Cancel"})})]}):null]})}):null]})}function t1(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 n1(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 jo(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 Je(n,r,s){return`${n} failed. Reason: ${jo(r,s)}`}function Ao(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 l=new URLSearchParams({path:r,taskSlug:n});return Ce(`/api/projects/harness/file?${l.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 l=new URLSearchParams({after:String(r)});return s!==void 0&&l.set("limit",String(s)),Ce(`/api/translation/sessions/${encodeURIComponent(n)}/events?${l.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"})},resetGatewayBinding(){return Ce("/api/gateway/binding/reset",{method:"POST"})}};async function Ce(n,r={}){var g,f,o;const s=new Headers(r.headers);r.body!==void 0&&r.body!==null&&!s.has("content-type")&&s.set("content-type","application/json");const l=(r.method??"GET").toUpperCase();let d;try{d=await fetch(n,{...r,headers:s})}catch(c){throw new Error(`${l} ${n} could not reach the VCM backend. Reason: ${jo(c)}`)}if(!d.ok){const c=await d.text().catch(()=>""),h=i1(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)??r1(c),w=(o=h==null?void 0:h.error)==null?void 0:o.runtime,R=w?` [backend ${w.version??"unknown"} pid=${w.pid??"unknown"} cwd=${w.cwd??"unknown"}]`:"";throw new Error(`${l} ${n} returned HTTP ${p}. ${b}${R}`)}return d.json()}function i1(n){if(!n.trim())return null;try{return JSON.parse(n)}catch{return null}}function r1(n){const r=n.trim();return r?`Non-JSON response body: ${r.slice(0,500)}`:"The response body was empty."}const mh="vcm:ui-error-report",gh="vcm:ui-error-clear-actions",_h="vcm:ui-error-clear-message";function s1(n){const r=n.trim();!r||typeof window>"u"||window.dispatchEvent(new CustomEvent(mh,{detail:{message:r}}))}function a1(n){const r=n.trim();!r||typeof window>"u"||window.dispatchEvent(new CustomEvent(_h,{detail:{message:r}}))}function l1(n){n.length===0||typeof window>"u"||window.dispatchEvent(new CustomEvent(gh,{detail:{actions:n}}))}function br(n){const[r,s]=te.useState(n),l=te.useRef(n),d=te.useCallback(g=>{const f=l.current,o=typeof g=="function"?g(f):g;l.current=o,typeof o=="string"&&o.trim()?s1(o):typeof f=="string"&&f.trim()&&a1(f),s(o)},[]);return[r,d]}var Ku={exports:{}},Vm;function o1(){return Vm||(Vm=1,(function(n,r){(function(s,l){n.exports=l()})(self,(()=>(()=>{var s={};return(()=>{var l=s;Object.defineProperty(l,"__esModule",{value:!0}),l.FitAddon=void 0,l.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,o=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(o.getPropertyValue("height")),h=Math.max(0,parseInt(o.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})()))})(Ku)),Ku.exports}var c1=o1(),Wu={exports:{}},Km;function u1(){return Km||(Km=1,(function(n,r){(function(s,l){n.exports=l()})(self,(()=>(()=>{var s={6:(f,o)=>{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(o,"__esModule",{value:!0}),o.LinkComputer=o.WebLinkProvider=void 0,o.WebLinkProvider=class{constructor(p,u,b,w={}){this._terminal=p,this._regex=u,this._handler=b,this._options=w}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,w)=>{if(this._options.hover){const{range:R}=u;this._options.hover(b,w,R)}},u)))}};class h{static computeLink(u,b,w,R){const E=new RegExp(b.source,(b.flags||"")+"g"),[v,y]=h._getWindowedLineStrings(u-1,w),_=v.join("");let S;const A=[];for(;S=E.exec(_);){const L=S[0];if(!c(L))continue;const[D,T]=h._mapStrIdx(w,y,0,S.index),[k,M]=h._mapStrIdx(w,D,T,L.length);if(D===-1||T===-1||k===-1||M===-1)continue;const B={start:{x:T+1,y:D+1},end:{x:M,y:k+1}};A.push({range:B,text:L,activate:R})}return A}static _getWindowedLineStrings(u,b){let w,R=u,E=u,v=0,y="";const _=[];if(w=b.buffer.active.getLine(u)){const S=w.translateToString(!0);if(w.isWrapped&&S[0]!==" "){for(v=0;(w=b.buffer.active.getLine(--R))&&v<2048&&(y=w.translateToString(!0),v+=y.length,_.push(y),w.isWrapped&&y.indexOf(" ")===-1););_.reverse()}for(_.push(S),v=0;(w=b.buffer.active.getLine(++E))&&w.isWrapped&&v<2048&&(y=w.translateToString(!0),v+=y.length,_.push(y),y.indexOf(" ")===-1););}return[_,R]}static _mapStrIdx(u,b,w,R){const E=u.buffer.active,v=E.getNullCell();let y=w;for(;R;){const _=E.getLine(b);if(!_)return[-1,-1];for(let S=y;S<_.length;++S){_.getCell(S,v);const A=v.getChars();if(v.getWidth()&&(R-=A.length||1,S===_.length-1&&A==="")){const L=E.getLine(b+1);L&&L.isWrapped&&(L.getCell(0,v),v.getWidth()===2&&(R+=1))}if(R<0)return[b,S]}b++,y=0}return[b,y]}}o.LinkComputer=h}},l={};function d(f){var o=l[f];if(o!==void 0)return o.exports;var c=l[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 o=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 o.WebLinkProvider(this._terminal,b,this._handler,u))}dispose(){var p;(p=this._linkProvider)==null||p.dispose()}}})(),g})()))})(Wu)),Wu.exports}var h1=u1(),Yu={exports:{}},Wm;function f1(){return Wm||(Wm=1,(function(n,r){(function(s,l){n.exports=l()})(globalThis,(()=>(()=>{var s={4567:function(f,o,c){var h=this&&this.__decorate||function(_,S,A,L){var D,T=arguments.length,k=T<3?S:L===null?L=Object.getOwnPropertyDescriptor(S,A):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(_,S,A,L);else for(var M=_.length-1;M>=0;M--)(D=_[M])&&(k=(T<3?D(k):T>3?D(S,A,k):D(S,A))||k);return T>3&&k&&Object.defineProperty(S,A,k),k},p=this&&this.__param||function(_,S){return function(A,L){S(A,L,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const u=c(9042),b=c(9924),w=c(844),R=c(4725),E=c(2585),v=c(3656);let y=o.AccessibilityManager=class extends w.Disposable{constructor(_,S,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,v.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,w.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(_){for(let S=0;S<_;S++)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(_,S){this._liveRegionDebouncer.refresh(_,S,this._terminal.rows)}_renderRows(_,S){const A=this._terminal.buffer,L=A.lines.length.toString();for(let D=_;D<=S;D++){const T=A.lines.get(A.ydisp+D),k=[],M=(T==null?void 0:T.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(_,S){const A=_.target,L=this._rowElements[S===0?1:this._rowElements.length-2];if(A.getAttribute("aria-posinset")===(S===0?"1":`${this._terminal.buffer.lines.length}`)||_.relatedTarget!==L)return;let D,T;if(S===0?(D=A,T=this._rowElements.pop(),this._rowContainer.removeChild(T)):(D=this._rowElements.shift(),T=A,this._rowContainer.removeChild(D)),D.removeEventListener("focus",this._topBoundaryFocusListener),T.removeEventListener("focus",this._bottomBoundaryFocusListener),S===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(S===0?-1:1),this._rowElements[S===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 S={node:_.anchorNode,offset:_.anchorOffset},A={node:_.focusNode,offset:_.focusOffset};if((S.node.compareDocumentPosition(A.node)&Node.DOCUMENT_POSITION_PRECEDING||S.node===A.node&&S.offset>A.offset)&&([S,A]=[A,S]),S.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(S={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(S.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 Y=this._rowColumns.get(U);if(!Y)return console.warn("columns is null. Race condition?"),null;let X=H<Y.length?Y[H]:Y.slice(-1)[0]+1;return X>=this._terminal.cols&&(++P,X=0),{row:P,column:X}},T=D(S),k=D(A);if(T&&k){if(T.row>k.row||T.row===k.row&&T.column>=k.column)throw new Error("invalid range");this._terminal.select(T.column,T.row,(k.row-T.row)*this._terminal.cols-T.column+k.column)}}_handleResize(_){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let S=this._rowContainer.children.length;S<this._terminal.rows;S++)this._rowElements[S]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[S]);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`}};o.AccessibilityManager=y=h([p(1,E.IInstantiationService),p(2,R.ICoreBrowserService),p(3,R.IRenderService)],y)},3614:(f,o)=>{function c(b){return b.replace(/\r?\n/g,"\r")}function h(b,w){return w?"\x1B[200~"+b+"\x1B[201~":b}function p(b,w,R,E){b=h(b=c(b),R.decPrivateModes.bracketedPasteMode&&E.rawOptions.ignoreBracketedPasteMode!==!0),R.triggerDataEvent(b,!0),w.value=""}function u(b,w,R){const E=R.getBoundingClientRect(),v=b.clientX-E.left-10,y=b.clientY-E.top-10;w.style.width="20px",w.style.height="20px",w.style.left=`${v}px`,w.style.top=`${y}px`,w.style.zIndex="1000",w.focus()}Object.defineProperty(o,"__esModule",{value:!0}),o.rightClickHandler=o.moveTextAreaUnderMouseCursor=o.paste=o.handlePasteEvent=o.copyHandler=o.bracketTextForPaste=o.prepareTextForTerminal=void 0,o.prepareTextForTerminal=c,o.bracketTextForPaste=h,o.copyHandler=function(b,w){b.clipboardData&&b.clipboardData.setData("text/plain",w.selectionText),b.preventDefault()},o.handlePasteEvent=function(b,w,R,E){b.stopPropagation(),b.clipboardData&&p(b.clipboardData.getData("text/plain"),w,R,E)},o.paste=p,o.moveTextAreaUnderMouseCursor=u,o.rightClickHandler=function(b,w,R,E,v){u(b,w,R),v&&E.rightClickSelect(b),w.value=E.selectionText,w.select()}},7239:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const h=c(1505);o.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,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.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,o,c){var h=this&&this.__decorate||function(y,_,S,A){var L,D=arguments.length,T=D<3?_:A===null?A=Object.getOwnPropertyDescriptor(_,S):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(y,_,S,A);else for(var k=y.length-1;k>=0;k--)(L=y[k])&&(T=(D<3?L(T):D>3?L(_,S,T):L(_,S))||T);return D>3&&T&&Object.defineProperty(_,S,T),T},p=this&&this.__param||function(y,_){return function(S,A){_(S,A,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier=void 0;const u=c(3656),b=c(8460),w=c(844),R=c(2585),E=c(4725);let v=o.Linkifier=class extends w.Disposable{get currentLink(){return this._currentLink}constructor(y,_,S,A,L){super(),this._element=y,this._mouseService=_,this._renderService=S,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,w.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,w.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(y){this._lastMouseEvent=y;const _=this._positionFromMouseEvent(y,this._element,this._mouseService);if(!_)return;this._isMouseOut=!1;const S=y.composedPath();for(let A=0;A<S.length;A++){const L=S[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(y){if(this._activeLine!==y.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(y,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,y)||(this._clearCurrentLink(),this._askForLink(y,!0))}_askForLink(y,_){var A,L;this._activeProviderReplies&&_||((A=this._activeProviderReplies)==null||A.forEach((D=>{D==null||D.forEach((T=>{T.link.dispose&&T.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=y.y);let S=!1;for(const[D,T]of this._linkProviderService.linkProviders.entries())_?(L=this._activeProviderReplies)!=null&&L.get(D)&&(S=this._checkLinkProviderResult(D,y,S)):T.provideLinks(y.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),S=this._checkLinkProviderResult(D,y,S),((H=this._activeProviderReplies)==null?void 0:H.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(y.y,this._activeProviderReplies)}))}_removeIntersectingLinks(y,_){const S=new Set;for(let A=0;A<_.size;A++){const L=_.get(A);if(L)for(let D=0;D<L.length;D++){const T=L[D],k=T.link.range.start.y<y?0:T.link.range.start.x,M=T.link.range.end.y>y?this._bufferService.cols:T.link.range.end.x;for(let B=k;B<=M;B++){if(S.has(B)){L.splice(D--,1);break}S.add(B)}}}}_checkLinkProviderResult(y,_,S){var D;if(!this._activeProviderReplies)return S;const A=this._activeProviderReplies.get(y);let L=!1;for(let T=0;T<y;T++)this._activeProviderReplies.has(T)&&!this._activeProviderReplies.get(T)||(L=!0);if(!L&&A){const T=A.find((k=>this._linkAtPosition(k.link,_)));T&&(S=!0,this._handleNewLink(T))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!S)for(let T=0;T<this._activeProviderReplies.size;T++){const k=(D=this._activeProviderReplies.get(T))==null?void 0:D.find((M=>this._linkAtPosition(M.link,_)));if(k){S=!0,this._handleNewLink(k);break}}return S}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(y){if(!this._currentLink)return;const _=this._positionFromMouseEvent(y,this._element,this._mouseService);_&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,_)&&this._currentLink.link.activate(y,this._currentLink.link.text)}_clearCurrentLink(y,_){this._currentLink&&this._lastMouseEvent&&(!y||!_||this._currentLink.link.range.start.y>=y&&this._currentLink.link.range.end.y<=_)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,w.disposeArray)(this._linkCacheDisposables))}_handleNewLink(y){if(!this._lastMouseEvent)return;const _=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);_&&this._linkAtPosition(y.link,_)&&(this._currentLink=y,this._currentLink.state={decorations:{underline:y.link.decorations===void 0||y.link.decorations.underline,pointerCursor:y.link.decorations===void 0||y.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,y.link,this._lastMouseEvent),y.link.decorations={},Object.defineProperties(y.link.decorations,{pointerCursor:{get:()=>{var S,A;return(A=(S=this._currentLink)==null?void 0:S.state)==null?void 0:A.decorations.pointerCursor},set:S=>{var A;(A=this._currentLink)!=null&&A.state&&this._currentLink.state.decorations.pointerCursor!==S&&(this._currentLink.state.decorations.pointerCursor=S,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",S))}},underline:{get:()=>{var S,A;return(A=(S=this._currentLink)==null?void 0:S.state)==null?void 0:A.decorations.underline},set:S=>{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)!==S&&(this._currentLink.state.decorations.underline=S,this._currentLink.state.isHovered&&this._fireUnderlineEvent(y.link,S))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((S=>{if(!this._currentLink)return;const A=S.start===0?0:S.start+1+this._bufferService.buffer.ydisp,L=this._bufferService.buffer.ydisp+1+S.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(y,_,S){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&&y.classList.add("xterm-cursor-pointer")),_.hover&&_.hover(S,_.text)}_fireUnderlineEvent(y,_){const S=y.range,A=this._bufferService.buffer.ydisp,L=this._createLinkUnderlineEvent(S.start.x-1,S.start.y-A-1,S.end.x,S.end.y-A-1,void 0);(_?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(L)}_linkLeave(y,_,S){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&&y.classList.remove("xterm-cursor-pointer")),_.leave&&_.leave(S,_.text)}_linkAtPosition(y,_){const S=y.range.start.y*this._bufferService.cols+y.range.start.x,A=y.range.end.y*this._bufferService.cols+y.range.end.x,L=_.y*this._bufferService.cols+_.x;return S<=L&&L<=A}_positionFromMouseEvent(y,_,S){const A=S.getCoords(y,_,this._bufferService.cols,this._bufferService.rows);if(A)return{x:A[0],y:A[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(y,_,S,A,L){return{x1:y,y1:_,x2:S,y2:A,cols:this._bufferService.cols,fg:L}}};o.Linkifier=v=h([p(1,E.IMouseService),p(2,E.IRenderService),p(3,R.IBufferService),p(4,E.ILinkProviderService)],v)},9042:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tooMuchOutput=o.promptLabel=void 0,o.promptLabel="Terminal input",o.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(f,o,c){var h=this&&this.__decorate||function(E,v,y,_){var S,A=arguments.length,L=A<3?v:_===null?_=Object.getOwnPropertyDescriptor(v,y):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(E,v,y,_);else for(var D=E.length-1;D>=0;D--)(S=E[D])&&(L=(A<3?S(L):A>3?S(v,y,L):S(v,y))||L);return A>3&&L&&Object.defineProperty(v,y,L),L},p=this&&this.__param||function(E,v){return function(y,_){v(y,_,E)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const u=c(511),b=c(2585);let w=o.OscLinkProvider=class{constructor(E,v,y){this._bufferService=E,this._optionsService=v,this._oscLinkService=y}provideLinks(E,v){var M;const y=this._bufferService.buffer.lines.get(E-1);if(!y)return void v(void 0);const _=[],S=this._optionsService.rawOptions.linkHandler,A=new u.CellData,L=y.getTrimmedLength();let D=-1,T=-1,k=!1;for(let B=0;B<L;B++)if(T!==-1||y.hasContent(B)){if(y.loadCell(B,A),A.hasExtendedAttrs()&&A.extended.urlId){if(T===-1){T=B,D=A.extended.urlId;continue}k=A.extended.urlId!==D}else T!==-1&&(k=!0);if(k||T!==-1&&B===L-1){const H=(M=this._oscLinkService.getLinkData(D))==null?void 0:M.uri;if(H){const U={start:{x:T+1,y:E},end:{x:B+(k||B!==L-1?0:1),y:E}};let P=!1;if(!(S!=null&&S.allowNonHttpProtocols))try{const Y=new URL(H);["http:","https:"].includes(Y.protocol)||(P=!0)}catch{P=!0}P||_.push({text:H,range:U,activate:(Y,X)=>S?S.activate(Y,X,U):R(0,X),hover:(Y,X)=>{var V;return(V=S==null?void 0:S.hover)==null?void 0:V.call(S,Y,X,U)},leave:(Y,X)=>{var V;return(V=S==null?void 0:S.leave)==null?void 0:V.call(S,Y,X,U)}})}k=!1,A.hasExtendedAttrs()&&A.extended.urlId?(T=B,D=A.extended.urlId):(T=-1,D=-1)}}v(_)}};function R(E,v){if(confirm(`Do you want to navigate to ${v}?
54
54
 
55
- WARNING: This link could potentially be dangerous`)){const S=window.open();if(S){try{S.opener=null}catch{}S.location.href=y}else console.warn("Opening link blocked as opener could not be cleared")}}o.OscLinkProvider=w=h([p(0,v.IBufferService),p(1,v.IOptionsService),p(2,v.IOscLinkService)],w)},6193:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderDebouncer=void 0,o.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,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const h=c(3614),p=c(3656),u=c(3551),v=c(9042),w=c(3730),R=c(1680),E=c(3107),y=c(5744),S=c(2950),g=c(1296),b=c(428),A=c(4269),L=c(5114),D=c(8934),T=c(3230),k=c(9312),M=c(4725),B=c(6731),H=c(8055),U=c(8969),P=c(8460),Y=c(844),X=c(6114),V=c(8437),K=c(2584),ne=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(W={}){super(W),this.browser=X,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new Y.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(w.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((q,ie)=>this.refresh(q,ie)))),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,Y.toDisposable)((()=>{var q,ie;this._customKeyEventHandler=void 0,(ie=(q=this.element)==null?void 0:q.parentNode)==null||ie.removeChild(this.element)})))}_handleColorEvent(W){if(this._themeService)for(const q of W){let ie,ee="";switch(q.index){case 256:ie="foreground",ee="10";break;case 257:ie="background",ee="11";break;case 258:ie="cursor",ee="12";break;default:ie="ansi",ee="4;"+q.index}switch(q.type){case 0:const le=H.color.toColorRGB(ie==="ansi"?this._themeService.colors.ansi[q.index]:this._themeService.colors[ie]);this.coreService.triggerDataEvent(`${K.C0.ESC}]${ee};${(0,z.toRgbString)(le)}${K.C1_ESCAPED.ST}`);break;case 1:if(ie==="ansi")this._themeService.modifyColors((ve=>ve.ansi[q.index]=H.channels.toColor(...q.color)));else{const ve=ie;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(W){W?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(I.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(W){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(K.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var W;return(W=this.textarea)==null?void 0:W.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(K.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 W=this.buffer.ybase+this.buffer.y,q=this.buffer.lines.get(W);if(!q)return;const ie=Math.min(this.buffer.x,this.cols-1),ee=this._renderService.dimensions.css.cell.height,le=q.getWidth(ie),ve=this._renderService.dimensions.css.cell.width*le,De=this.buffer.y*this._renderService.dimensions.css.cell.height,Ne=ie*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Ne+"px",this.textarea.style.top=De+"px",this.textarea.style.width=ve+"px",this.textarea.style.height=ee+"px",this.textarea.style.lineHeight=ee+"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 W=q=>(0,h.handlePasteEvent)(q,this.textarea,this.coreService,this.optionsService);this.register((0,p.addDisposableDomListener)(this.textarea,"paste",W)),this.register((0,p.addDisposableDomListener)(this.element,"paste",W)),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",(W=>this._keyUp(W)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keydown",(W=>this._keyDown(W)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keypress",(W=>this._keyPress(W)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionupdate",(W=>this._compositionHelper.compositionupdate(W)))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,p.addDisposableDomListener)(this.textarea,"input",(W=>this._inputEvent(W)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(W){var ie;if(!W)throw new Error("Terminal requires a parent element.");if(W.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((ie=this.element)==null?void 0:ie.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=W.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"),W.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",(ee=>this.updateCursorStyle(ee)))),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",v.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,W.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",(ee=>this._handleTextAreaFocus(ee)))),this.register((0,p.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(b.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(T.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(M.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((ee=>this._onRender.fire(ee)))),this.onResize((ee=>this._renderService.resize(ee.cols,ee.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(S.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(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(R.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((ee=>this.scrollLines(ee.amount,ee.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((ee=>this.scrollLines(ee.amount,ee.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((ee=>this._renderService.handleSelectionChanged(ee.start,ee.end,ee.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((ee=>{this.textarea.value=ee,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((ee=>{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",(ee=>this._selectionService.handleMouseDown(ee)))),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",(ee=>this._handleScreenReaderModeOptionChange(ee)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(y.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(ee=>{!this._overviewRulerRenderer&&ee&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(y.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(g.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const W=this,q=this.element;function ie(ve){const De=W._mouseService.getMouseReportCoords(ve,W.screenElement);if(!De)return!1;let Ne,Be;switch(ve.overrideType||ve.type){case"mousemove":Be=32,ve.buttons===void 0?(Ne=3,ve.button!==void 0&&(Ne=ve.button<3?ve.button:3)):Ne=1&ve.buttons?0:4&ve.buttons?1:2&ve.buttons?2:3;break;case"mouseup":Be=0,Ne=ve.button<3?ve.button:3;break;case"mousedown":Be=1,Ne=ve.button<3?ve.button:3;break;case"wheel":if(W._customWheelEventHandler&&W._customWheelEventHandler(ve)===!1||W.viewport.getLinesScrolled(ve)===0)return!1;Be=ve.deltaY<0?0:1,Ne=4;break;default:return!1}return!(Be===void 0||Ne===void 0||Ne>4)&&W.coreMouseService.triggerMouseEvent({col:De.col,row:De.row,x:De.x,y:De.y,button:Ne,action:Be,ctrl:ve.ctrlKey,alt:ve.altKey,shift:ve.shiftKey})}const ee={mouseup:null,wheel:null,mousedrag:null,mousemove:null},le={mouseup:ve=>(ie(ve),ve.buttons||(this._document.removeEventListener("mouseup",ee.mouseup),ee.mousedrag&&this._document.removeEventListener("mousemove",ee.mousedrag)),this.cancel(ve)),wheel:ve=>(ie(ve),this.cancel(ve,!0)),mousedrag:ve=>{ve.buttons&&ie(ve)},mousemove:ve=>{ve.buttons||ie(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?ee.mousemove||(q.addEventListener("mousemove",le.mousemove),ee.mousemove=le.mousemove):(q.removeEventListener("mousemove",ee.mousemove),ee.mousemove=null),16&ve?ee.wheel||(q.addEventListener("wheel",le.wheel,{passive:!1}),ee.wheel=le.wheel):(q.removeEventListener("wheel",ee.wheel),ee.wheel=null),2&ve?ee.mouseup||(ee.mouseup=le.mouseup):(this._document.removeEventListener("mouseup",ee.mouseup),ee.mouseup=null),4&ve?ee.mousedrag||(ee.mousedrag=le.mousedrag):(this._document.removeEventListener("mousemove",ee.mousedrag),ee.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 ie(ve),ee.mouseup&&this._document.addEventListener("mouseup",ee.mouseup),ee.mousedrag&&this._document.addEventListener("mousemove",ee.mousedrag),this.cancel(ve)}))),this.register((0,p.addDisposableDomListener)(q,"wheel",(ve=>{if(!ee.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 Ne=K.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(ve.deltaY<0?"A":"B");let Be="";for(let ct=0;ct<Math.abs(De);ct++)Be+=Ne;return this.coreService.triggerDataEvent(Be,!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(W,q){var ie;(ie=this._renderService)==null||ie.refreshRows(W,q)}updateCursorStyle(W){var q;(q=this._selectionService)!=null&&q.shouldColumnSelect(W)?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(W,q,ie=0){var ee;ie===1?(super.scrollLines(W,q,ie),this.refresh(0,this.rows-1)):(ee=this.viewport)==null||ee.scrollLines(W)}paste(W){(0,h.paste)(W,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(W){this._customKeyEventHandler=W}attachCustomWheelEventHandler(W){this._customWheelEventHandler=W}registerLinkProvider(W){return this._linkProviderService.registerLinkProvider(W)}registerCharacterJoiner(W){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const q=this._characterJoinerService.register(W);return this.refresh(0,this.rows-1),q}deregisterCharacterJoiner(W){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(W)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(W){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+W)}registerDecoration(W){return this._decorationService.registerDecoration(W)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(W,q,ie){this._selectionService.setSelection(W,q,ie)}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 W;(W=this._selectionService)==null||W.clearSelection()}selectAll(){var W;(W=this._selectionService)==null||W.selectAll()}selectLines(W,q){var ie;(ie=this._selectionService)==null||ie.selectLines(W,q)}_keyDown(W){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(W)===!1)return!1;const q=this.browser.isMac&&this.options.macOptionIsMeta&&W.altKey;if(!q&&!this._compositionHelper.keydown(W))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;q||W.key!=="Dead"&&W.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ie=(0,ne.evaluateKeyboardEvent)(W,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(W),ie.type===3||ie.type===2){const ee=this.rows-1;return this.scrollLines(ie.type===2?-ee:ee),this.cancel(W,!0)}return ie.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,W)||(ie.cancel&&this.cancel(W,!0),!ie.key||!!(W.key&&!W.ctrlKey&&!W.altKey&&!W.metaKey&&W.key.length===1&&W.key.charCodeAt(0)>=65&&W.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ie.key!==K.C0.ETX&&ie.key!==K.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ie.key,domEvent:W}),this._showCursor(),this.coreService.triggerDataEvent(ie.key,!0),!this.optionsService.rawOptions.screenReaderMode||W.altKey||W.ctrlKey?this.cancel(W,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(W,q){const ie=W.isMac&&!this.options.macOptionIsMeta&&q.altKey&&!q.ctrlKey&&!q.metaKey||W.isWindows&&q.altKey&&q.ctrlKey&&!q.metaKey||W.isWindows&&q.getModifierState("AltGraph");return q.type==="keypress"?ie:ie&&(!q.keyCode||q.keyCode>47)}_keyUp(W){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(W)===!1||((function(q){return q.keyCode===16||q.keyCode===17||q.keyCode===18})(W)||this.focus(),this.updateCursorStyle(W),this._keyPressHandled=!1)}_keyPress(W){let q;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(W)===!1)return!1;if(this.cancel(W),W.charCode)q=W.charCode;else if(W.which===null||W.which===void 0)q=W.keyCode;else{if(W.which===0||W.charCode===0)return!1;q=W.which}return!(!q||(W.altKey||W.ctrlKey||W.metaKey)&&!this._isThirdLevelShift(this.browser,W)||(q=String.fromCharCode(q),this._onKey.fire({key:q,domEvent:W}),this._showCursor(),this.coreService.triggerDataEvent(q,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(W){if(W.data&&W.inputType==="insertText"&&(!W.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const q=W.data;return this.coreService.triggerDataEvent(q,!0),this.cancel(W),!0}return!1}resize(W,q){W!==this.cols||q!==this.rows?super.resize(W,q):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(W,q){var ie,ee;(ie=this._charSizeService)==null||ie.measure(),(ee=this.viewport)==null||ee.syncScrollArea(!0)}clear(){var W;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let q=1;q<this.rows;q++)this.buffer.lines.push(this.buffer.getBlankLine(V.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(W=this.viewport)==null||W.reset(),this.refresh(0,this.rows-1)}}reset(){var q,ie;this.options.rows=this.rows,this.options.cols=this.cols;const W=this._customKeyEventHandler;this._setup(),super.reset(),(q=this._selectionService)==null||q.reset(),this._decorationService.reset(),(ie=this.viewport)==null||ie.reset(),this._customKeyEventHandler=W,this.refresh(0,this.rows-1)}clearTextureAtlas(){var W;(W=this._renderService)==null||W.clearTextureAtlas()}_reportFocus(){var W;(W=this.element)!=null&&W.classList.contains("focus")?this.coreService.triggerDataEvent(K.C0.ESC+"[I"):this.coreService.triggerDataEvent(K.C0.ESC+"[O")}_reportWindowsOptions(W){if(this._renderService)switch(W){case $.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const q=this._renderService.dimensions.css.canvas.width.toFixed(0),ie=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${K.C0.ESC}[4;${ie};${q}t`);break;case $.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const ee=this._renderService.dimensions.css.cell.width.toFixed(0),le=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${K.C0.ESC}[6;${le};${ee}t`)}}cancel(W,q){if(this.options.cancelEvents||q)return W.preventDefault(),W.stopPropagation(),!1}}o.Terminal=ae},9924:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TimeBasedDebouncer=void 0,o.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 v=u-this._lastRefreshMs,w=this._debounceThresholdMS-v;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),w)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,h)}}},1680:function(f,o,c){var h=this&&this.__decorate||function(S,g,b,A){var L,D=arguments.length,T=D<3?g:A===null?A=Object.getOwnPropertyDescriptor(g,b):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(S,g,b,A);else for(var k=S.length-1;k>=0;k--)(L=S[k])&&(T=(D<3?L(T):D>3?L(g,b,T):L(g,b))||T);return D>3&&T&&Object.defineProperty(g,b,T),T},p=this&&this.__param||function(S,g){return function(b,A){g(b,A,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Viewport=void 0;const u=c(3656),v=c(4725),w=c(8460),R=c(844),E=c(2585);let y=o.Viewport=class extends R.Disposable{constructor(S,g,b,A,L,D,T,k){super(),this._viewportElement=S,this._scrollArea=g,this._bufferService=b,this._optionsService=A,this._charSizeService=L,this._renderService=D,this._coreBrowserService=T,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new w.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,u.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((M=>this._activeBuffer=M.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((M=>this._renderDimensions=M))),this._handleThemeChange(k.colors),this.register(k.onChangeColors((M=>this._handleThemeChange(M)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(S){this._viewportElement.style.backgroundColor=S.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(S){if(S)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const g=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==g&&(this._lastRecordedBufferHeight=g,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const S=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==S&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=S),this._refreshAnimationFrame=null}syncScrollArea(S=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(S);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(S)}_handleScroll(S){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const g=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:g,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const S=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(S*(this._smoothScrollState.target-this._smoothScrollState.origin)),S<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(S,g){const b=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(g<0&&this._viewportElement.scrollTop!==0||g>0&&b<this._lastRecordedBufferHeight)||(S.cancelable&&S.preventDefault(),!1)}handleWheel(S){const g=this._getPixelsScrolled(S);return g!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+g:this._smoothScrollState.target+=g,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=g,this._bubbleScroll(S,g))}scrollLines(S){if(S!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const g=S*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+g,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:S,suppressScrollEvent:!1})}_getPixelsScrolled(S){if(S.deltaY===0||S.shiftKey)return 0;let g=this._applyScrollModifier(S.deltaY,S);return S.deltaMode===WheelEvent.DOM_DELTA_LINE?g*=this._currentRowHeight:S.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(g*=this._currentRowHeight*this._bufferService.rows),g}getBufferElements(S,g){var k;let b,A="";const L=[],D=g??this._bufferService.buffer.lines.length,T=this._bufferService.buffer.lines;for(let M=S;M<D;M++){const B=T.get(M);if(!B)continue;const H=(k=T.get(M+1))==null?void 0:k.isWrapped;if(A+=B.translateToString(!H),!H||M===T.length-1){const U=document.createElement("div");U.textContent=A,L.push(U),A.length>0&&(b=U),A=""}}return{bufferElements:L,cursorElement:b}}getLinesScrolled(S){if(S.deltaY===0||S.shiftKey)return 0;let g=this._applyScrollModifier(S.deltaY,S);return S.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(g/=this._currentRowHeight+0,this._wheelPartialScroll+=g,g=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):S.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(g*=this._bufferService.rows),g}_applyScrollModifier(S,g){const b=this._optionsService.rawOptions.fastScrollModifier;return b==="alt"&&g.altKey||b==="ctrl"&&g.ctrlKey||b==="shift"&&g.shiftKey?S*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:S*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(S){this._lastTouchY=S.touches[0].pageY}handleTouchMove(S){const g=this._lastTouchY-S.touches[0].pageY;return this._lastTouchY=S.touches[0].pageY,g!==0&&(this._viewportElement.scrollTop+=g,this._bubbleScroll(S,g))}};o.Viewport=y=h([p(2,E.IBufferService),p(3,E.IOptionsService),p(4,v.ICharSizeService),p(5,v.IRenderService),p(6,v.ICoreBrowserService),p(7,v.IThemeService)],y)},3107:function(f,o,c){var h=this&&this.__decorate||function(E,y,S,g){var b,A=arguments.length,L=A<3?y:g===null?g=Object.getOwnPropertyDescriptor(y,S):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(E,y,S,g);else for(var D=E.length-1;D>=0;D--)(b=E[D])&&(L=(A<3?b(L):A>3?b(y,S,L):b(y,S))||L);return A>3&&L&&Object.defineProperty(y,S,L),L},p=this&&this.__param||function(E,y){return function(S,g){y(S,g,E)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferDecorationRenderer=void 0;const u=c(4725),v=c(844),w=c(2585);let R=o.BufferDecorationRenderer=class extends v.Disposable{constructor(E,y,S,g,b){super(),this._screenElement=E,this._bufferService=y,this._coreBrowserService=S,this._decorationService=g,this._renderService=b,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,v.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 g;const y=this._coreBrowserService.mainDocument.createElement("div");y.classList.add("xterm-decoration"),y.classList.toggle("xterm-decoration-top-layer",((g=E==null?void 0:E.options)==null?void 0:g.layer)==="top"),y.style.width=`${Math.round((E.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,y.style.height=(E.options.height||1)*this._renderService.dimensions.css.cell.height+"px",y.style.top=(E.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",y.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const S=E.options.x??0;return S&&S>this._bufferService.cols&&(y.style.display="none"),this._refreshXPosition(E,y),y}_refreshStyle(E){const y=E.marker.line-this._bufferService.buffers.active.ydisp;if(y<0||y>=this._bufferService.rows)E.element&&(E.element.style.display="none",E.onRenderEmitter.fire(E.element));else{let S=this._decorationElements.get(E);S||(S=this._createElement(E),E.element=S,this._decorationElements.set(E,S),this._container.appendChild(S),E.onDispose((()=>{this._decorationElements.delete(E),S.remove()}))),S.style.top=y*this._renderService.dimensions.css.cell.height+"px",S.style.display=this._altBufferIsActive?"none":"block",E.onRenderEmitter.fire(S)}}_refreshXPosition(E,y=E.element){if(!y)return;const S=E.options.x??0;(E.options.anchor||"left")==="right"?y.style.right=S?S*this._renderService.dimensions.css.cell.width+"px":"":y.style.left=S?S*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(E){var y;(y=this._decorationElements.get(E))==null||y.remove(),this._decorationElements.delete(E),E.dispose()}};o.BufferDecorationRenderer=R=h([p(1,w.IBufferService),p(2,u.ICoreBrowserService),p(3,w.IDecorationService),p(4,u.IRenderService)],R)},5871:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorZoneStore=void 0,o.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,o,c){var h=this&&this.__decorate||function(b,A,L,D){var T,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(b,A,L,D);else for(var B=b.length-1;B>=0;B--)(T=b[B])&&(M=(k<3?T(M):k>3?T(A,L,M):T(A,L))||M);return k>3&&M&&Object.defineProperty(A,L,M),M},p=this&&this.__param||function(b,A){return function(L,D){A(L,D,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OverviewRulerRenderer=void 0;const u=c(5871),v=c(4725),w=c(844),R=c(2585),E={full:0,left:0,center:0,right:0},y={full:0,left:0,center:0,right:0},S={full:0,left:0,center:0,right:0};let g=o.OverviewRulerRenderer=class extends w.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(b,A,L,D,T,k,M){var H;super(),this._viewportElement=b,this._screenElement=A,this._bufferService=L,this._decorationService=D,this._renderService=T,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,w.toDisposable)((()=>{var U;(U=this._canvas)==null||U.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const b=Math.floor(this._canvas.width/3),A=Math.ceil(this._canvas.width/3);y.full=this._canvas.width,y.left=b,y.center=A,y.right=b,this._refreshDrawHeightConstants(),S.full=0,S.left=0,S.center=y.left,S.right=y.left+y.center}_refreshDrawHeightConstants(){E.full=Math.round(2*this._coreBrowserService.dpr);const b=this._canvas.height/this._bufferService.buffer.lines.length,A=Math.round(Math.max(Math.min(b,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 b=this._colorZoneStore.zones;for(const A of b)A.position!=="full"&&this._renderColorZone(A);for(const A of b)A.position==="full"&&this._renderColorZone(A);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(b){this._ctx.fillStyle=b.color,this._ctx.fillRect(S[b.position||"full"],Math.round((this._canvas.height-1)*(b.startBufferLine/this._bufferService.buffers.active.lines.length)-E[b.position||"full"]/2),y[b.position||"full"],Math.round((this._canvas.height-1)*((b.endBufferLine-b.startBufferLine)/this._bufferService.buffers.active.lines.length)+E[b.position||"full"]))}_queueRefresh(b,A){this._shouldUpdateDimensions=b||this._shouldUpdateDimensions,this._shouldUpdateAnchor=A||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};o.OverviewRulerRenderer=g=h([p(2,R.IBufferService),p(3,R.IDecorationService),p(4,v.IRenderService),p(5,R.IOptionsService),p(6,v.ICoreBrowserService)],g)},2950:function(f,o,c){var h=this&&this.__decorate||function(E,y,S,g){var b,A=arguments.length,L=A<3?y:g===null?g=Object.getOwnPropertyDescriptor(y,S):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(E,y,S,g);else for(var D=E.length-1;D>=0;D--)(b=E[D])&&(L=(A<3?b(L):A>3?b(y,S,L):b(y,S))||L);return A>3&&L&&Object.defineProperty(y,S,L),L},p=this&&this.__param||function(E,y){return function(S,g){y(S,g,E)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompositionHelper=void 0;const u=c(4725),v=c(2585),w=c(2584);let R=o.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(E,y,S,g,b,A){this._textarea=E,this._compositionView=y,this._bufferService=S,this._optionsService=g,this._coreService=b,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 y={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let S;this._isSendingComposition=!1,y.start+=this._dataAlreadySent.length,S=this._isComposing?this._textarea.value.substring(y.start,y.end):this._textarea.value.substring(y.start),S.length>0&&this._coreService.triggerDataEvent(S,!0)}}),0)}else{this._isSendingComposition=!1;const y=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(y,!0)}}_handleAnyTextareaChanges(){const E=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const y=this._textarea.value,S=y.replace(E,"");this._dataAlreadySent=S,y.length>E.length?this._coreService.triggerDataEvent(S,!0):y.length<E.length?this._coreService.triggerDataEvent(`${w.C0.DEL}`,!0):y.length===E.length&&y!==E&&this._coreService.triggerDataEvent(y,!0)}}),0)}updateCompositionElements(E){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const y=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),S=this._renderService.dimensions.css.cell.height,g=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,b=y*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=b+"px",this._compositionView.style.top=g+"px",this._compositionView.style.height=S+"px",this._compositionView.style.lineHeight=S+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const A=this._compositionView.getBoundingClientRect();this._textarea.style.left=b+"px",this._textarea.style.top=g+"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)}}};o.CompositionHelper=R=h([p(2,v.IBufferService),p(3,v.IOptionsService),p(4,v.ICoreService),p(5,u.IRenderService)],R)},9806:(f,o)=>{function c(h,p,u){const v=u.getBoundingClientRect(),w=h.getComputedStyle(u),R=parseInt(w.getPropertyValue("padding-left")),E=parseInt(w.getPropertyValue("padding-top"));return[p.clientX-v.left-R,p.clientY-v.top-E]}Object.defineProperty(o,"__esModule",{value:!0}),o.getCoords=o.getCoordsRelativeToElement=void 0,o.getCoordsRelativeToElement=c,o.getCoords=function(h,p,u,v,w,R,E,y,S){if(!R)return;const g=c(h,p,u);return g?(g[0]=Math.ceil((g[0]+(S?E/2:0))/E),g[1]=Math.ceil(g[1]/y),g[0]=Math.min(Math.max(g[0],1),v+(S?1:0)),g[1]=Math.min(Math.max(g[1],1),w),g):void 0}},9504:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.moveToCellSequence=void 0;const h=c(2584);function p(y,S,g,b){const A=y-u(y,g),L=S-u(S,g),D=Math.abs(A-L)-(function(T,k,M){let B=0;const H=T-u(T,M),U=k-u(k,M);for(let P=0;P<Math.abs(H-U);P++){const Y=v(T,k)==="A"?-1:1,X=M.buffer.lines.get(H+Y*P);X!=null&&X.isWrapped&&B++}return B})(y,S,g);return E(D,R(v(y,S),b))}function u(y,S){let g=0,b=S.buffer.lines.get(y),A=b==null?void 0:b.isWrapped;for(;A&&y>=0&&y<S.rows;)g++,b=S.buffer.lines.get(--y),A=b==null?void 0:b.isWrapped;return g}function v(y,S){return y>S?"A":"B"}function w(y,S,g,b,A,L){let D=y,T=S,k="";for(;D!==g||T!==b;)D+=A?1:-1,A&&D>L.cols-1?(k+=L.buffer.translateBufferLineToString(T,!1,y,D),D=0,y=0,T++):!A&&D<0&&(k+=L.buffer.translateBufferLineToString(T,!1,0,y+1),D=L.cols-1,y=D,T--);return k+L.buffer.translateBufferLineToString(T,!1,y,D)}function R(y,S){const g=S?"O":"[";return h.C0.ESC+g+y}function E(y,S){y=Math.floor(y);let g="";for(let b=0;b<y;b++)g+=S;return g}o.moveToCellSequence=function(y,S,g,b){const A=g.buffer.x,L=g.buffer.y;if(!g.buffer.hasScrollback)return(function(k,M,B,H,U,P){return p(M,H,U,P).length===0?"":E(w(k,M,k,M-u(M,U),!1,U).length,R("D",P))})(A,L,0,S,g,b)+p(L,S,g,b)+(function(k,M,B,H,U,P){let Y;Y=p(M,H,U,P).length>0?H-u(H,U):M;const X=H,V=(function(K,ne,z,j,N,$){let I;return I=p(z,j,N,$).length>0?j-u(j,N):ne,K<z&&I<=j||K>=z&&I<j?"C":"D"})(k,M,B,H,U,P);return E(w(k,Y,B,X,V==="C",U).length,R(V,P))})(A,L,y,S,g,b);let D;if(L===S)return D=A>y?"D":"C",E(Math.abs(A-y),R(D,b));D=L>S?"D":"C";const T=Math.abs(L-S);return E((function(k,M){return M.cols-k})(L>S?y:A,g)+(T-1)*g.cols+1+((L>S?A:y)-1),R(D,b))}},1296:function(f,o,c){var h=this&&this.__decorate||function(P,Y,X,V){var K,ne=arguments.length,z=ne<3?Y:V===null?V=Object.getOwnPropertyDescriptor(Y,X):V;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(P,Y,X,V);else for(var j=P.length-1;j>=0;j--)(K=P[j])&&(z=(ne<3?K(z):ne>3?K(Y,X,z):K(Y,X))||z);return ne>3&&z&&Object.defineProperty(Y,X,z),z},p=this&&this.__param||function(P,Y){return function(X,V){Y(X,V,P)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRenderer=void 0;const u=c(3787),v=c(2550),w=c(2223),R=c(6171),E=c(6052),y=c(4725),S=c(8055),g=c(8460),b=c(844),A=c(2585),L="xterm-dom-renderer-owner-",D="xterm-rows",T="xterm-fg-",k="xterm-bg-",M="xterm-focus",B="xterm-selection";let H=1,U=o.DomRenderer=class extends b.Disposable{constructor(P,Y,X,V,K,ne,z,j,N,$,I,se,ae){super(),this._terminal=P,this._document=Y,this._element=X,this._screenElement=V,this._viewportElement=K,this._helperContainer=ne,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 g.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,R.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((he=>this._injectCss(he)))),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((he=>this._handleLinkHover(he)))),this.register(this._linkifier2.onHideLinkUnderline((he=>this._handleLinkLeave(he)))),this.register((0,b.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 v.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 Y=`${this._terminalSelector} .${D} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=Y,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 Y=`${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}`;Y+=`${this._terminalSelector} .${D} .xterm-dim { color: ${S.color.multiplyOpacity(P.foreground,.5).css};}`,Y+=`${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}`,V=`blink_bar_${this._terminalClass}`,K=`blink_block_${this._terminalClass}`;Y+=`@keyframes ${X} { 50% { border-bottom-style: hidden; }}`,Y+=`@keyframes ${V} { 50% { box-shadow: none; }}`,Y+=`@keyframes ${K} { 0% { background-color: ${P.cursor.css}; color: ${P.cursorAccent.css}; } 50% { background-color: inherit; color: ${P.cursor.css}; }}`,Y+=`${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: ${V} 1s step-end infinite;}${this._terminalSelector} .${D}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${K} 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);}`,Y+=`${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[ne,z]of P.ansi.entries())Y+=`${this._terminalSelector} .${T}${ne} { color: ${z.css}; }${this._terminalSelector} .${T}${ne}.xterm-dim { color: ${S.color.multiplyOpacity(z,.5).css}; }${this._terminalSelector} .${k}${ne} { background-color: ${z.css}; }`;Y+=`${this._terminalSelector} .${T}${w.INVERTED_DEFAULT_COLOR} { color: ${S.color.opaque(P.background).css}; }${this._terminalSelector} .${T}${w.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${S.color.multiplyOpacity(S.color.opaque(P.background),.5).css}; }${this._terminalSelector} .${k}${w.INVERTED_DEFAULT_COLOR} { background-color: ${P.foreground.css}; }`,this._themeStyleElement.textContent=Y}_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,Y){for(let X=this._rowElements.length;X<=Y;X++){const V=this._document.createElement("div");this._rowContainer.appendChild(V),this._rowElements.push(V)}for(;this._rowElements.length>Y;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(P,Y){this._refreshRowElements(P,Y),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,Y,X){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(P,Y,X),this.renderRows(0,this._bufferService.rows-1),!P||!Y)return;this._selectionRenderModel.update(this._terminal,P,Y,X);const V=this._selectionRenderModel.viewportStartRow,K=this._selectionRenderModel.viewportEndRow,ne=this._selectionRenderModel.viewportCappedStartRow,z=this._selectionRenderModel.viewportCappedEndRow;if(ne>=this._bufferService.rows||z<0)return;const j=this._document.createDocumentFragment();if(X){const N=P[0]>Y[0];j.appendChild(this._createSelectionElement(ne,N?Y[0]:P[0],N?P[0]:Y[0],z-ne+1))}else{const N=V===ne?P[0]:0,$=ne===K?Y[0]:this._bufferService.cols;j.appendChild(this._createSelectionElement(ne,N,$));const I=z-ne-1;if(j.appendChild(this._createSelectionElement(ne+1,0,this._bufferService.cols,I)),ne!==z){const se=K===z?Y[0]:this._bufferService.cols;j.appendChild(this._createSelectionElement(z,0,se))}}this._selectionContainer.appendChild(j)}_createSelectionElement(P,Y,X,V=1){const K=this._document.createElement("div"),ne=Y*this.dimensions.css.cell.width;let z=this.dimensions.css.cell.width*(X-Y);return ne+z>this.dimensions.css.canvas.width&&(z=this.dimensions.css.canvas.width-ne),K.style.height=V*this.dimensions.css.cell.height+"px",K.style.top=P*this.dimensions.css.cell.height+"px",K.style.left=`${ne}px`,K.style.width=`${z}px`,K}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,Y){const X=this._bufferService.buffer,V=X.ybase+X.y,K=Math.min(X.x,this._bufferService.cols-1),ne=this._optionsService.rawOptions.cursorBlink,z=this._optionsService.rawOptions.cursorStyle,j=this._optionsService.rawOptions.cursorInactiveStyle;for(let N=P;N<=Y;N++){const $=N+X.ydisp,I=this._rowElements[N],se=X.lines.get($);if(!I||!se)break;I.replaceChildren(...this._rowFactory.createRow(se,$,$===V,z,j,K,ne,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,Y,X,V,K,ne){X<0&&(P=0),V<0&&(Y=0);const z=this._bufferService.rows-1;X=Math.max(Math.min(X,z),0),V=Math.max(Math.min(V,z),0),K=Math.min(K,this._bufferService.cols);const j=this._bufferService.buffer,N=j.ybase+j.y,$=Math.min(j.x,K-1),I=this._optionsService.rawOptions.cursorBlink,se=this._optionsService.rawOptions.cursorStyle,ae=this._optionsService.rawOptions.cursorInactiveStyle;for(let he=X;he<=V;++he){const W=he+j.ydisp,q=this._rowElements[he],ie=j.lines.get(W);if(!q||!ie)break;q.replaceChildren(...this._rowFactory.createRow(ie,W,W===N,se,ae,$,I,this.dimensions.css.cell.width,this._widthCache,ne?he===X?P:0:-1,ne?(he===V?Y:K)-1:-1))}}};o.DomRenderer=U=h([p(7,A.IInstantiationService),p(8,y.ICharSizeService),p(9,A.IOptionsService),p(10,A.IBufferService),p(11,y.ICoreBrowserService),p(12,y.IThemeService)],U)},3787:function(f,o,c){var h=this&&this.__decorate||function(D,T,k,M){var B,H=arguments.length,U=H<3?T:M===null?M=Object.getOwnPropertyDescriptor(T,k):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(D,T,k,M);else for(var P=D.length-1;P>=0;P--)(B=D[P])&&(U=(H<3?B(U):H>3?B(T,k,U):B(T,k))||U);return H>3&&U&&Object.defineProperty(T,k,U),U},p=this&&this.__param||function(D,T){return function(k,M){T(k,M,D)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRendererRowFactory=void 0;const u=c(2223),v=c(643),w=c(511),R=c(2585),E=c(8055),y=c(4725),S=c(4269),g=c(6171),b=c(3734);let A=o.DomRendererRowFactory=class{constructor(D,T,k,M,B,H,U){this._document=D,this._characterJoinerService=T,this._optionsService=k,this._coreBrowserService=M,this._coreService=B,this._decorationService=H,this._themeService=U,this._workCell=new w.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(D,T,k){this._selectionStart=D,this._selectionEnd=T,this._columnSelectMode=k}createRow(D,T,k,M,B,H,U,P,Y,X,V){const K=[],ne=this._characterJoinerService.getJoinedCharacters(T),z=this._themeService.colors;let j,N=D.getNoBgTrimmedLength();k&&N<H+1&&(N=H+1);let $=0,I="",se=0,ae=0,he=0,W=!1,q=0,ie=!1,ee=0;const le=[],ve=X!==-1&&V!==-1;for(let De=0;De<N;De++){D.loadCell(De,this._workCell);let Ne=this._workCell.getWidth();if(Ne===0)continue;let Be=!1,ct=De,ke=this._workCell;if(ne.length>0&&De===ne[0][0]){Be=!0;const qe=ne.shift();ke=new S.JoinedCellData(this._workCell,D.translateToString(!0,qe[0],qe[1]),qe[1]-qe[0]),ct=qe[1]-1,Ne=ke.getWidth()}const Gt=this._isCellInSelection(De,T),rn=k&&De===H,Vt=ve&&De>=X&&De<=V;let Kt=!1;this._decorationService.forEachDecorationAtCell(De,T,void 0,(qe=>{Kt=!0}));let xn=ke.getChars()||v.WHITESPACE_CELL_CHAR;if(xn===" "&&(ke.isUnderline()||ke.isOverline())&&(xn=" "),ee=Ne*P-Y.get(xn,ke.isBold(),ke.isItalic()),j){if($&&(Gt&&ie||!Gt&&!ie&&ke.bg===se)&&(Gt&&ie&&z.selectionForeground||ke.fg===ae)&&ke.extended.ext===he&&Vt===W&&ee===q&&!rn&&!Be&&!Kt){ke.isInvisible()?I+=v.WHITESPACE_CELL_CHAR:I+=xn,$++;continue}$&&(j.textContent=I),j=this._document.createElement("span"),$=0,I=""}else j=this._document.createElement("span");if(se=ke.bg,ae=ke.fg,he=ke.extended.ext,W=Vt,q=ee,ie=Gt,Be&&H>=De&&H<=ct&&(H=De),!this._coreService.isCursorHidden&&rn&&this._coreService.isCursorInitialized){if(le.push("xterm-cursor"),this._coreBrowserService.isFocused)U&&le.push("xterm-cursor-blink"),le.push(M==="bar"?"xterm-cursor-bar":M==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(B)switch(B){case"outline":le.push("xterm-cursor-outline");break;case"block":le.push("xterm-cursor-block");break;case"bar":le.push("xterm-cursor-bar");break;case"underline":le.push("xterm-cursor-underline")}}if(ke.isBold()&&le.push("xterm-bold"),ke.isItalic()&&le.push("xterm-italic"),ke.isDim()&&le.push("xterm-dim"),I=ke.isInvisible()?v.WHITESPACE_CELL_CHAR:ke.getChars()||v.WHITESPACE_CELL_CHAR,ke.isUnderline()&&(le.push(`xterm-underline-${ke.extended.underlineStyle}`),I===" "&&(I=" "),!ke.isUnderlineColorDefault()))if(ke.isUnderlineColorRGB())j.style.textDecorationColor=`rgb(${b.AttributeData.toColorRGB(ke.getUnderlineColor()).join(",")})`;else{let qe=ke.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&ke.isBold()&&qe<8&&(qe+=8),j.style.textDecorationColor=z.ansi[qe].css}ke.isOverline()&&(le.push("xterm-overline"),I===" "&&(I=" ")),ke.isStrikethrough()&&le.push("xterm-strikethrough"),Vt&&(j.style.textDecoration="underline");let xt=ke.getFgColor(),it=ke.getFgColorMode(),Ot=ke.getBgColor(),pe=ke.getBgColorMode();const Se=!!ke.isInverse();if(Se){const qe=xt;xt=Ot,Ot=qe;const bt=it;it=pe,pe=bt}let Ae,je,He,mt=!1;switch(this._decorationService.forEachDecorationAtCell(De,T,void 0,(qe=>{qe.options.layer!=="top"&&mt||(qe.backgroundColorRGB&&(pe=50331648,Ot=qe.backgroundColorRGB.rgba>>8&16777215,Ae=qe.backgroundColorRGB),qe.foregroundColorRGB&&(it=50331648,xt=qe.foregroundColorRGB.rgba>>8&16777215,je=qe.foregroundColorRGB),mt=qe.options.layer==="top")})),!mt&&Gt&&(Ae=this._coreBrowserService.isFocused?z.selectionBackgroundOpaque:z.selectionInactiveBackgroundOpaque,Ot=Ae.rgba>>8&16777215,pe=50331648,mt=!0,z.selectionForeground&&(it=50331648,xt=z.selectionForeground.rgba>>8&16777215,je=z.selectionForeground)),mt&&le.push("xterm-decoration-top"),pe){case 16777216:case 33554432:He=z.ansi[Ot],le.push(`xterm-bg-${Ot}`);break;case 50331648:He=E.channels.toColor(Ot>>16,Ot>>8&255,255&Ot),this._addStyle(j,`background-color:#${L((Ot>>>0).toString(16),"0",6)}`);break;default:Se?(He=z.foreground,le.push(`xterm-bg-${u.INVERTED_DEFAULT_COLOR}`)):He=z.background}switch(Ae||ke.isDim()&&(Ae=E.color.multiplyOpacity(He,.5)),it){case 16777216:case 33554432:ke.isBold()&&xt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(xt+=8),this._applyMinimumContrast(j,He,z.ansi[xt],ke,Ae,void 0)||le.push(`xterm-fg-${xt}`);break;case 50331648:const qe=E.channels.toColor(xt>>16&255,xt>>8&255,255&xt);this._applyMinimumContrast(j,He,qe,ke,Ae,je)||this._addStyle(j,`color:#${L(xt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(j,He,z.foreground,ke,Ae,je)||Se&&le.push(`xterm-fg-${u.INVERTED_DEFAULT_COLOR}`)}le.length&&(j.className=le.join(" "),le.length=0),rn||Be||Kt?j.textContent=I:$++,ee!==this.defaultSpacing&&(j.style.letterSpacing=`${ee}px`),K.push(j),De=ct}return j&&$&&(j.textContent=I),K}_applyMinimumContrast(D,T,k,M,B,H){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,g.treatGlyphAsBackgroundColor)(M.getCode()))return!1;const U=this._getContrastCache(M);let P;if(B||H||(P=U.getColor(T.rgba,k.rgba)),P===void 0){const Y=this._optionsService.rawOptions.minimumContrastRatio/(M.isDim()?2:1);P=E.color.ensureContrastRatio(B||T,H||k,Y),U.setColor((B||T).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,T){D.setAttribute("style",`${D.getAttribute("style")||""}${T};`)}_isCellInSelection(D,T){const k=this._selectionStart,M=this._selectionEnd;return!(!k||!M)&&(this._columnSelectMode?k[0]<=M[0]?D>=k[0]&&T>=k[1]&&D<M[0]&&T<=M[1]:D<k[0]&&T>=k[1]&&D>=M[0]&&T<=M[1]:T>k[1]&&T<M[1]||k[1]===M[1]&&T===k[1]&&D>=k[0]&&D<M[0]||k[1]<M[1]&&T===M[1]&&D<M[0]||k[1]<M[1]&&T===k[1]&&D>=k[0])}};function L(D,T,k){for(;D.length<k;)D=T+D;return D}o.DomRendererRowFactory=A=h([p(1,y.ICharacterJoinerService),p(2,R.IOptionsService),p(3,y.ICoreBrowserService),p(4,R.ICoreService),p(5,R.IDecorationService),p(6,y.IThemeService)],A)},2550:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WidthCache=void 0,o.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 v=c.createElement("span");v.classList.add("xterm-char-measure-element"),v.style.fontStyle="italic";const w=c.createElement("span");w.classList.add("xterm-char-measure-element"),w.style.fontWeight="bold",w.style.fontStyle="italic",this._measureElements=[p,u,v,w],this._container.appendChild(p),this._container.appendChild(u),this._container.appendChild(v),this._container.appendChild(w),h.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(c,h,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 R=this._measure(c,0);return R>0&&(this._flat[u]=R),R}let v=c;h&&(v+="B"),p&&(v+="I");let w=this._holey.get(v);if(w===void 0){let R=0;h&&(R|=1),p&&(R|=2),w=this._measure(c,R),w>0&&this._holey.set(v,w)}return w}_measure(c,h){const p=this._measureElements[h];return p.textContent=c.repeat(32),p.offsetWidth/32}}},2223:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const h=c(6114);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=h.isFirefox||h.isLegacyEdge?"bottom":"ideographic"},6171:(f,o)=>{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(o,"__esModule",{value:!0}),o.computeNextVariantOffset=o.createRenderDimensions=o.treatGlyphAsBackgroundColor=o.allowRescaling=o.isEmoji=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(p){if(!p)throw new Error("value must not be falsy");return p},o.isPowerlineGlyph=c,o.isRestrictedPowerlineGlyph=function(p){return 57520<=p&&p<=57527},o.isEmoji=h,o.allowRescaling=function(p,u,v,w){return u===1&&v>Math.ceil(1.5*w)&&p!==void 0&&p>255&&!h(p)&&!c(p)&&!(function(R){return 57344<=R&&R<=63743})(p)},o.treatGlyphAsBackgroundColor=function(p){return c(p)||(function(u){return 9472<=u&&u<=9631})(p)},o.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}}}},o.computeNextVariantOffset=function(p,u,v=0){return(p-(2*Math.round(u)-v))%(2*Math.round(u))}},6052:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.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,v,w=!1){if(this.selectionStart=u,this.selectionEnd=v,!u||!v||u[0]===v[0]&&u[1]===v[1])return void this.clear();const R=p.buffers.active.ydisp,E=u[1]-R,y=v[1]-R,S=Math.max(E,0),g=Math.min(y,p.rows-1);S>=p.rows||g<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=w,this.viewportStartRow=E,this.viewportEndRow=y,this.viewportCappedStartRow=S,this.viewportCappedEndRow=g,this.startCol=u[0],this.endCol=v[0])}isCellSelected(p,u,v){return!!this.hasSelection&&(v-=p.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?u>=this.startCol&&v>=this.viewportCappedStartRow&&u<this.endCol&&v<=this.viewportCappedEndRow:u<this.startCol&&v>=this.viewportCappedStartRow&&u>=this.endCol&&v<=this.viewportCappedEndRow:v>this.viewportStartRow&&v<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&v===this.viewportStartRow&&u>=this.startCol&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&v===this.viewportEndRow&&u<this.endCol||this.viewportStartRow<this.viewportEndRow&&v===this.viewportStartRow&&u>=this.startCol)}}o.createSelectionRenderModel=function(){return new c}},456:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionModel=void 0,o.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,o,c){var h=this&&this.__decorate||function(g,b,A,L){var D,T=arguments.length,k=T<3?b:L===null?L=Object.getOwnPropertyDescriptor(b,A):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(g,b,A,L);else for(var M=g.length-1;M>=0;M--)(D=g[M])&&(k=(T<3?D(k):T>3?D(b,A,k):D(b,A))||k);return T>3&&k&&Object.defineProperty(b,A,k),k},p=this&&this.__param||function(g,b){return function(A,L){b(A,L,g)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharSizeService=void 0;const u=c(2585),v=c(8460),w=c(844);let R=o.CharSizeService=class extends w.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(g,b,A){super(),this._optionsService=A,this.width=0,this.height=0,this._onCharSizeChange=this.register(new v.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new S(this._optionsService))}catch{this._measureStrategy=this.register(new y(g,b,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const g=this._measureStrategy.measure();g.width===this.width&&g.height===this.height||(this.width=g.width,this.height=g.height,this._onCharSizeChange.fire())}};o.CharSizeService=R=h([p(2,u.IOptionsService)],R);class E extends w.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(b,A){b!==void 0&&b>0&&A!==void 0&&A>0&&(this._result.width=b,this._result.height=A)}}class y extends E{constructor(b,A,L){super(),this._document=b,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 S extends E{constructor(b){super(),this._optionsService=b,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 b=this._ctx.measureText("W");return this._validateAndSet(b.width,b.fontBoundingBoxAscent+b.fontBoundingBoxDescent),this._result}}},4269:function(f,o,c){var h=this&&this.__decorate||function(S,g,b,A){var L,D=arguments.length,T=D<3?g:A===null?A=Object.getOwnPropertyDescriptor(g,b):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(S,g,b,A);else for(var k=S.length-1;k>=0;k--)(L=S[k])&&(T=(D<3?L(T):D>3?L(g,b,T):L(g,b))||T);return D>3&&T&&Object.defineProperty(g,b,T),T},p=this&&this.__param||function(S,g){return function(b,A){g(b,A,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const u=c(3734),v=c(643),w=c(511),R=c(2585);class E extends u.AttributeData{constructor(g,b,A){super(),this.content=0,this.combinedData="",this.fg=g.fg,this.bg=g.bg,this.combinedData=b,this._width=A}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(g){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.JoinedCellData=E;let y=o.CharacterJoinerService=class c_{constructor(g){this._bufferService=g,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new w.CellData}register(g){const b={id:this._nextCharacterJoinerId++,handler:g};return this._characterJoiners.push(b),b.id}deregister(g){for(let b=0;b<this._characterJoiners.length;b++)if(this._characterJoiners[b].id===g)return this._characterJoiners.splice(b,1),!0;return!1}getJoinedCharacters(g){if(this._characterJoiners.length===0)return[];const b=this._bufferService.buffer.lines.get(g);if(!b||b.length===0)return[];const A=[],L=b.translateToString(!0);let D=0,T=0,k=0,M=b.getFg(0),B=b.getBg(0);for(let H=0;H<b.getTrimmedLength();H++)if(b.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,T,b,D);for(let P=0;P<U.length;P++)A.push(U[P])}D=H,k=T,M=this._workCell.fg,B=this._workCell.bg}T+=this._workCell.getChars().length||v.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-D>1){const H=this._getJoinedRanges(L,k,T,b,D);for(let U=0;U<H.length;U++)A.push(H[U])}return A}_getJoinedRanges(g,b,A,L,D){const T=g.substring(b,A);let k=[];try{k=this._characterJoiners[0].handler(T)}catch(M){console.error(M)}for(let M=1;M<this._characterJoiners.length;M++)try{const B=this._characterJoiners[M].handler(T);for(let H=0;H<B.length;H++)c_._mergeRanges(k,B[H])}catch(B){console.error(B)}return this._stringRangesToCellRanges(k,L,D),k}_stringRangesToCellRanges(g,b,A){let L=0,D=!1,T=0,k=g[L];if(k){for(let M=A;M<this._bufferService.cols;M++){const B=b.getWidth(M),H=b.getString(M).length||v.WHITESPACE_CELL_CHAR.length;if(B!==0){if(!D&&k[0]<=T&&(k[0]=M,D=!0),k[1]<=T){if(k[1]=M,k=g[++L],!k)break;k[0]<=T?(k[0]=M,D=!0):D=!1}T+=H}}k&&(k[1]=this._bufferService.cols)}}static _mergeRanges(g,b){let A=!1;for(let L=0;L<g.length;L++){const D=g[L];if(A){if(b[1]<=D[0])return g[L-1][1]=b[1],g;if(b[1]<=D[1])return g[L-1][1]=Math.max(b[1],D[1]),g.splice(L,1),g;g.splice(L,1),L--}else{if(b[1]<=D[0])return g.splice(L,0,b),g;if(b[1]<=D[1])return D[0]=Math.min(b[0],D[0]),g;b[0]<D[1]&&(D[0]=Math.min(b[0],D[0]),A=!0)}}return A?g[g.length-1][1]=b[1]:g.push(b),g}};o.CharacterJoinerService=y=h([p(0,R.IBufferService)],y)},5114:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreBrowserService=void 0;const h=c(844),p=c(8460),u=c(3656);class v extends h.Disposable{constructor(E,y,S){super(),this._textarea=E,this._window=y,this.mainDocument=S,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new w(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((g=>this._screenDprMonitor.setWindow(g)))),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}}o.CoreBrowserService=v;class w 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,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.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(v){return this.linkProviders.push(v),{dispose:()=>{const w=this.linkProviders.indexOf(v);w!==-1&&this.linkProviders.splice(w,1)}}}}o.LinkProviderService=p},8934:function(f,o,c){var h=this&&this.__decorate||function(R,E,y,S){var g,b=arguments.length,A=b<3?E:S===null?S=Object.getOwnPropertyDescriptor(E,y):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(R,E,y,S);else for(var L=R.length-1;L>=0;L--)(g=R[L])&&(A=(b<3?g(A):b>3?g(E,y,A):g(E,y))||A);return b>3&&A&&Object.defineProperty(E,y,A),A},p=this&&this.__param||function(R,E){return function(y,S){E(y,S,R)}};Object.defineProperty(o,"__esModule",{value:!0}),o.MouseService=void 0;const u=c(4725),v=c(9806);let w=o.MouseService=class{constructor(R,E){this._renderService=R,this._charSizeService=E}getCoords(R,E,y,S,g){return(0,v.getCoords)(window,R,E,y,S,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,g)}getMouseReportCoords(R,E){const y=(0,v.getCoordsRelativeToElement)(window,R,E);if(this._charSizeService.hasValidSize)return y[0]=Math.min(Math.max(y[0],0),this._renderService.dimensions.css.canvas.width-1),y[1]=Math.min(Math.max(y[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(y[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(y[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(y[0]),y:Math.floor(y[1])}}};o.MouseService=w=h([p(0,u.IRenderService),p(1,u.ICharSizeService)],w)},3230:function(f,o,c){var h=this&&this.__decorate||function(g,b,A,L){var D,T=arguments.length,k=T<3?b:L===null?L=Object.getOwnPropertyDescriptor(b,A):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(g,b,A,L);else for(var M=g.length-1;M>=0;M--)(D=g[M])&&(k=(T<3?D(k):T>3?D(b,A,k):D(b,A))||k);return T>3&&k&&Object.defineProperty(b,A,k),k},p=this&&this.__param||function(g,b){return function(A,L){b(A,L,g)}};Object.defineProperty(o,"__esModule",{value:!0}),o.RenderService=void 0;const u=c(6193),v=c(4725),w=c(8460),R=c(844),E=c(7226),y=c(2585);let S=o.RenderService=class extends R.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(g,b,A,L,D,T,k,M){super(),this._rowCount=g,this._charSizeService=L,this._renderer=this.register(new R.MutableDisposable),this._pausedResizeTask=new E.DebouncedIdleTask,this._observerDisposable=this.register(new R.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new w.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new w.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new w.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new w.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new u.RenderDebouncer(((B,H)=>this._renderRows(B,H)),k),this.register(this._renderDebouncer),this.register(k.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(T.onResize((()=>this._fullRefresh()))),this.register(T.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(T.cols,T.rows),this._fullRefresh()}))),this.register(A.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(T.buffer.y,T.buffer.y,!0)))),this.register(M.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(k.window,b),this.register(k.onWindowChange((B=>this._registerIntersectionObserver(B,b))))}_registerIntersectionObserver(g,b){if("IntersectionObserver"in g){const A=new g.IntersectionObserver((L=>this._handleIntersectionChange(L[L.length-1])),{threshold:0});A.observe(b),this._observerDisposable.value=(0,R.toDisposable)((()=>A.disconnect()))}}_handleIntersectionChange(g){this._isPaused=g.isIntersecting===void 0?g.intersectionRatio===0:!g.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(g,b,A=!1){this._isPaused?this._needsFullRefresh=!0:(A||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(g,b,this._rowCount))}_renderRows(g,b){this._renderer.value&&(g=Math.min(g,this._rowCount-1),b=Math.min(b,this._rowCount-1),this._renderer.value.renderRows(g,b),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:g,end:b}),this._onRender.fire({start:g,end:b}),this._isNextRenderRedrawOnly=!0)}resize(g,b){this._rowCount=b,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(g){this._renderer.value=g,this._renderer.value&&(this._renderer.value.onRequestRedraw((b=>this.refreshRows(b.start,b.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(g){return this._renderDebouncer.addRefreshCallback(g)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var g,b;this._renderer.value&&((b=(g=this._renderer.value).clearTextureAtlas)==null||b.call(g),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(g,b){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var A;return(A=this._renderer.value)==null?void 0:A.handleResize(g,b)})):this._renderer.value.handleResize(g,b),this._fullRefresh())}handleCharSizeChanged(){var g;(g=this._renderer.value)==null||g.handleCharSizeChanged()}handleBlur(){var g;(g=this._renderer.value)==null||g.handleBlur()}handleFocus(){var g;(g=this._renderer.value)==null||g.handleFocus()}handleSelectionChanged(g,b,A){var L;this._selectionState.start=g,this._selectionState.end=b,this._selectionState.columnSelectMode=A,(L=this._renderer.value)==null||L.handleSelectionChanged(g,b,A)}handleCursorMove(){var g;(g=this._renderer.value)==null||g.handleCursorMove()}clear(){var g;(g=this._renderer.value)==null||g.clear()}};o.RenderService=S=h([p(2,y.IOptionsService),p(3,v.ICharSizeService),p(4,y.IDecorationService),p(5,y.IBufferService),p(6,v.ICoreBrowserService),p(7,v.IThemeService)],S)},9312:function(f,o,c){var h=this&&this.__decorate||function(k,M,B,H){var U,P=arguments.length,Y=P<3?M:H===null?H=Object.getOwnPropertyDescriptor(M,B):H;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Y=Reflect.decorate(k,M,B,H);else for(var X=k.length-1;X>=0;X--)(U=k[X])&&(Y=(P<3?U(Y):P>3?U(M,B,Y):U(M,B))||Y);return P>3&&Y&&Object.defineProperty(M,B,Y),Y},p=this&&this.__param||function(k,M){return function(B,H){M(B,H,k)}};Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionService=void 0;const u=c(9806),v=c(9504),w=c(456),R=c(4725),E=c(8460),y=c(844),S=c(6114),g=c(4841),b=c(511),A=c(2585),L=" ",D=new RegExp(L,"g");let T=o.SelectionService=class extends y.Disposable{constructor(k,M,B,H,U,P,Y,X,V){super(),this._element=k,this._screenElement=M,this._linkifier=B,this._bufferService=H,this._coreService=U,this._mouseService=P,this._optionsService=Y,this._renderService=X,this._coreBrowserService=V,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new b.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=K=>this._handleMouseMove(K),this._mouseUpListener=K=>this._handleMouseUp(K),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((K=>this._handleTrim(K))),this.register(this._bufferService.buffers.onBufferActivate((K=>this._handleBufferActivate(K)))),this.enable(),this._model=new w.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,y.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 Y=k[1];Y<=M[1];Y++){const X=B.translateBufferLineToString(Y,!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 Y=B.lines.get(P),X=B.translateBufferLineToString(P,!0);Y!=null&&Y.isWrapped?H[H.length-1]+=X:H.push(X)}if(k[1]!==M[1]){const P=B.lines.get(M[1]),Y=B.translateBufferLineToString(M[1],!0,0,M[0]);P&&P.isWrapped?H[H.length-1]+=Y:H.push(Y)}}return H.map((U=>U.replace(D," "))).join(S.isWindows?`\r
55
+ WARNING: This link could potentially be dangerous`)){const y=window.open();if(y){try{y.opener=null}catch{}y.location.href=v}else console.warn("Opening link blocked as opener could not be cleared")}}o.OscLinkProvider=w=h([p(0,b.IBufferService),p(1,b.IOptionsService),p(2,b.IOscLinkService)],w)},6193:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderDebouncer=void 0,o.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,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const h=c(3614),p=c(3656),u=c(3551),b=c(9042),w=c(3730),R=c(1680),E=c(3107),v=c(5744),y=c(2950),_=c(1296),S=c(428),A=c(4269),L=c(5114),D=c(8934),T=c(3230),k=c(9312),M=c(4725),B=c(6731),H=c(8055),U=c(8969),P=c(8460),Y=c(844),X=c(6114),V=c(8437),K=c(2584),ne=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(W={}){super(W),this.browser=X,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new Y.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(w.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((q,ie)=>this.refresh(q,ie)))),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,Y.toDisposable)((()=>{var q,ie;this._customKeyEventHandler=void 0,(ie=(q=this.element)==null?void 0:q.parentNode)==null||ie.removeChild(this.element)})))}_handleColorEvent(W){if(this._themeService)for(const q of W){let ie,ee="";switch(q.index){case 256:ie="foreground",ee="10";break;case 257:ie="background",ee="11";break;case 258:ie="cursor",ee="12";break;default:ie="ansi",ee="4;"+q.index}switch(q.type){case 0:const le=H.color.toColorRGB(ie==="ansi"?this._themeService.colors.ansi[q.index]:this._themeService.colors[ie]);this.coreService.triggerDataEvent(`${K.C0.ESC}]${ee};${(0,z.toRgbString)(le)}${K.C1_ESCAPED.ST}`);break;case 1:if(ie==="ansi")this._themeService.modifyColors((ve=>ve.ansi[q.index]=H.channels.toColor(...q.color)));else{const ve=ie;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(W){W?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(I.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(W){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(K.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var W;return(W=this.textarea)==null?void 0:W.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(K.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 W=this.buffer.ybase+this.buffer.y,q=this.buffer.lines.get(W);if(!q)return;const ie=Math.min(this.buffer.x,this.cols-1),ee=this._renderService.dimensions.css.cell.height,le=q.getWidth(ie),ve=this._renderService.dimensions.css.cell.width*le,De=this.buffer.y*this._renderService.dimensions.css.cell.height,Ne=ie*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Ne+"px",this.textarea.style.top=De+"px",this.textarea.style.width=ve+"px",this.textarea.style.height=ee+"px",this.textarea.style.lineHeight=ee+"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 W=q=>(0,h.handlePasteEvent)(q,this.textarea,this.coreService,this.optionsService);this.register((0,p.addDisposableDomListener)(this.textarea,"paste",W)),this.register((0,p.addDisposableDomListener)(this.element,"paste",W)),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",(W=>this._keyUp(W)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keydown",(W=>this._keyDown(W)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keypress",(W=>this._keyPress(W)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionupdate",(W=>this._compositionHelper.compositionupdate(W)))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,p.addDisposableDomListener)(this.textarea,"input",(W=>this._inputEvent(W)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(W){var ie;if(!W)throw new Error("Terminal requires a parent element.");if(W.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((ie=this.element)==null?void 0:ie.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=W.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"),W.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",(ee=>this.updateCursorStyle(ee)))),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,W.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",(ee=>this._handleTextAreaFocus(ee)))),this.register((0,p.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(S.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(T.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(M.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((ee=>this._onRender.fire(ee)))),this.onResize((ee=>this._renderService.resize(ee.cols,ee.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(y.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(R.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((ee=>this.scrollLines(ee.amount,ee.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((ee=>this.scrollLines(ee.amount,ee.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((ee=>this._renderService.handleSelectionChanged(ee.start,ee.end,ee.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((ee=>{this.textarea.value=ee,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((ee=>{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",(ee=>this._selectionService.handleMouseDown(ee)))),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",(ee=>this._handleScreenReaderModeOptionChange(ee)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(v.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(ee=>{!this._overviewRulerRenderer&&ee&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(v.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 W=this,q=this.element;function ie(ve){const De=W._mouseService.getMouseReportCoords(ve,W.screenElement);if(!De)return!1;let Ne,je;switch(ve.overrideType||ve.type){case"mousemove":je=32,ve.buttons===void 0?(Ne=3,ve.button!==void 0&&(Ne=ve.button<3?ve.button:3)):Ne=1&ve.buttons?0:4&ve.buttons?1:2&ve.buttons?2:3;break;case"mouseup":je=0,Ne=ve.button<3?ve.button:3;break;case"mousedown":je=1,Ne=ve.button<3?ve.button:3;break;case"wheel":if(W._customWheelEventHandler&&W._customWheelEventHandler(ve)===!1||W.viewport.getLinesScrolled(ve)===0)return!1;je=ve.deltaY<0?0:1,Ne=4;break;default:return!1}return!(je===void 0||Ne===void 0||Ne>4)&&W.coreMouseService.triggerMouseEvent({col:De.col,row:De.row,x:De.x,y:De.y,button:Ne,action:je,ctrl:ve.ctrlKey,alt:ve.altKey,shift:ve.shiftKey})}const ee={mouseup:null,wheel:null,mousedrag:null,mousemove:null},le={mouseup:ve=>(ie(ve),ve.buttons||(this._document.removeEventListener("mouseup",ee.mouseup),ee.mousedrag&&this._document.removeEventListener("mousemove",ee.mousedrag)),this.cancel(ve)),wheel:ve=>(ie(ve),this.cancel(ve,!0)),mousedrag:ve=>{ve.buttons&&ie(ve)},mousemove:ve=>{ve.buttons||ie(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?ee.mousemove||(q.addEventListener("mousemove",le.mousemove),ee.mousemove=le.mousemove):(q.removeEventListener("mousemove",ee.mousemove),ee.mousemove=null),16&ve?ee.wheel||(q.addEventListener("wheel",le.wheel,{passive:!1}),ee.wheel=le.wheel):(q.removeEventListener("wheel",ee.wheel),ee.wheel=null),2&ve?ee.mouseup||(ee.mouseup=le.mouseup):(this._document.removeEventListener("mouseup",ee.mouseup),ee.mouseup=null),4&ve?ee.mousedrag||(ee.mousedrag=le.mousedrag):(this._document.removeEventListener("mousemove",ee.mousedrag),ee.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 ie(ve),ee.mouseup&&this._document.addEventListener("mouseup",ee.mouseup),ee.mousedrag&&this._document.addEventListener("mousemove",ee.mousedrag),this.cancel(ve)}))),this.register((0,p.addDisposableDomListener)(q,"wheel",(ve=>{if(!ee.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 Ne=K.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(ve.deltaY<0?"A":"B");let je="";for(let ct=0;ct<Math.abs(De);ct++)je+=Ne;return this.coreService.triggerDataEvent(je,!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(W,q){var ie;(ie=this._renderService)==null||ie.refreshRows(W,q)}updateCursorStyle(W){var q;(q=this._selectionService)!=null&&q.shouldColumnSelect(W)?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(W,q,ie=0){var ee;ie===1?(super.scrollLines(W,q,ie),this.refresh(0,this.rows-1)):(ee=this.viewport)==null||ee.scrollLines(W)}paste(W){(0,h.paste)(W,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(W){this._customKeyEventHandler=W}attachCustomWheelEventHandler(W){this._customWheelEventHandler=W}registerLinkProvider(W){return this._linkProviderService.registerLinkProvider(W)}registerCharacterJoiner(W){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const q=this._characterJoinerService.register(W);return this.refresh(0,this.rows-1),q}deregisterCharacterJoiner(W){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(W)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(W){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+W)}registerDecoration(W){return this._decorationService.registerDecoration(W)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(W,q,ie){this._selectionService.setSelection(W,q,ie)}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 W;(W=this._selectionService)==null||W.clearSelection()}selectAll(){var W;(W=this._selectionService)==null||W.selectAll()}selectLines(W,q){var ie;(ie=this._selectionService)==null||ie.selectLines(W,q)}_keyDown(W){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(W)===!1)return!1;const q=this.browser.isMac&&this.options.macOptionIsMeta&&W.altKey;if(!q&&!this._compositionHelper.keydown(W))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;q||W.key!=="Dead"&&W.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ie=(0,ne.evaluateKeyboardEvent)(W,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(W),ie.type===3||ie.type===2){const ee=this.rows-1;return this.scrollLines(ie.type===2?-ee:ee),this.cancel(W,!0)}return ie.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,W)||(ie.cancel&&this.cancel(W,!0),!ie.key||!!(W.key&&!W.ctrlKey&&!W.altKey&&!W.metaKey&&W.key.length===1&&W.key.charCodeAt(0)>=65&&W.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ie.key!==K.C0.ETX&&ie.key!==K.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ie.key,domEvent:W}),this._showCursor(),this.coreService.triggerDataEvent(ie.key,!0),!this.optionsService.rawOptions.screenReaderMode||W.altKey||W.ctrlKey?this.cancel(W,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(W,q){const ie=W.isMac&&!this.options.macOptionIsMeta&&q.altKey&&!q.ctrlKey&&!q.metaKey||W.isWindows&&q.altKey&&q.ctrlKey&&!q.metaKey||W.isWindows&&q.getModifierState("AltGraph");return q.type==="keypress"?ie:ie&&(!q.keyCode||q.keyCode>47)}_keyUp(W){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(W)===!1||((function(q){return q.keyCode===16||q.keyCode===17||q.keyCode===18})(W)||this.focus(),this.updateCursorStyle(W),this._keyPressHandled=!1)}_keyPress(W){let q;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(W)===!1)return!1;if(this.cancel(W),W.charCode)q=W.charCode;else if(W.which===null||W.which===void 0)q=W.keyCode;else{if(W.which===0||W.charCode===0)return!1;q=W.which}return!(!q||(W.altKey||W.ctrlKey||W.metaKey)&&!this._isThirdLevelShift(this.browser,W)||(q=String.fromCharCode(q),this._onKey.fire({key:q,domEvent:W}),this._showCursor(),this.coreService.triggerDataEvent(q,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(W){if(W.data&&W.inputType==="insertText"&&(!W.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const q=W.data;return this.coreService.triggerDataEvent(q,!0),this.cancel(W),!0}return!1}resize(W,q){W!==this.cols||q!==this.rows?super.resize(W,q):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(W,q){var ie,ee;(ie=this._charSizeService)==null||ie.measure(),(ee=this.viewport)==null||ee.syncScrollArea(!0)}clear(){var W;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let q=1;q<this.rows;q++)this.buffer.lines.push(this.buffer.getBlankLine(V.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(W=this.viewport)==null||W.reset(),this.refresh(0,this.rows-1)}}reset(){var q,ie;this.options.rows=this.rows,this.options.cols=this.cols;const W=this._customKeyEventHandler;this._setup(),super.reset(),(q=this._selectionService)==null||q.reset(),this._decorationService.reset(),(ie=this.viewport)==null||ie.reset(),this._customKeyEventHandler=W,this.refresh(0,this.rows-1)}clearTextureAtlas(){var W;(W=this._renderService)==null||W.clearTextureAtlas()}_reportFocus(){var W;(W=this.element)!=null&&W.classList.contains("focus")?this.coreService.triggerDataEvent(K.C0.ESC+"[I"):this.coreService.triggerDataEvent(K.C0.ESC+"[O")}_reportWindowsOptions(W){if(this._renderService)switch(W){case $.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const q=this._renderService.dimensions.css.canvas.width.toFixed(0),ie=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${K.C0.ESC}[4;${ie};${q}t`);break;case $.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const ee=this._renderService.dimensions.css.cell.width.toFixed(0),le=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${K.C0.ESC}[6;${le};${ee}t`)}}cancel(W,q){if(this.options.cancelEvents||q)return W.preventDefault(),W.stopPropagation(),!1}}o.Terminal=ae},9924:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TimeBasedDebouncer=void 0,o.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,w=this._debounceThresholdMS-b;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),w)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,h)}}},1680:function(f,o,c){var h=this&&this.__decorate||function(y,_,S,A){var L,D=arguments.length,T=D<3?_:A===null?A=Object.getOwnPropertyDescriptor(_,S):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(y,_,S,A);else for(var k=y.length-1;k>=0;k--)(L=y[k])&&(T=(D<3?L(T):D>3?L(_,S,T):L(_,S))||T);return D>3&&T&&Object.defineProperty(_,S,T),T},p=this&&this.__param||function(y,_){return function(S,A){_(S,A,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Viewport=void 0;const u=c(3656),b=c(4725),w=c(8460),R=c(844),E=c(2585);let v=o.Viewport=class extends R.Disposable{constructor(y,_,S,A,L,D,T,k){super(),this._viewportElement=y,this._scrollArea=_,this._bufferService=S,this._optionsService=A,this._charSizeService=L,this._renderService=D,this._coreBrowserService=T,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new w.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,u.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((M=>this._activeBuffer=M.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((M=>this._renderDimensions=M))),this._handleThemeChange(k.colors),this.register(k.onChangeColors((M=>this._handleThemeChange(M)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(y){this._viewportElement.style.backgroundColor=y.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(y){if(y)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 y=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==y&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=y),this._refreshAnimationFrame=null}syncScrollArea(y=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(y);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(y)}_handleScroll(y){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 y=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(y*(this._smoothScrollState.target-this._smoothScrollState.origin)),y<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(y,_){const S=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(_<0&&this._viewportElement.scrollTop!==0||_>0&&S<this._lastRecordedBufferHeight)||(y.cancelable&&y.preventDefault(),!1)}handleWheel(y){const _=this._getPixelsScrolled(y);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(y,_))}scrollLines(y){if(y!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const _=y*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:y,suppressScrollEvent:!1})}_getPixelsScrolled(y){if(y.deltaY===0||y.shiftKey)return 0;let _=this._applyScrollModifier(y.deltaY,y);return y.deltaMode===WheelEvent.DOM_DELTA_LINE?_*=this._currentRowHeight:y.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(_*=this._currentRowHeight*this._bufferService.rows),_}getBufferElements(y,_){var k;let S,A="";const L=[],D=_??this._bufferService.buffer.lines.length,T=this._bufferService.buffer.lines;for(let M=y;M<D;M++){const B=T.get(M);if(!B)continue;const H=(k=T.get(M+1))==null?void 0:k.isWrapped;if(A+=B.translateToString(!H),!H||M===T.length-1){const U=document.createElement("div");U.textContent=A,L.push(U),A.length>0&&(S=U),A=""}}return{bufferElements:L,cursorElement:S}}getLinesScrolled(y){if(y.deltaY===0||y.shiftKey)return 0;let _=this._applyScrollModifier(y.deltaY,y);return y.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(_/=this._currentRowHeight+0,this._wheelPartialScroll+=_,_=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):y.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(_*=this._bufferService.rows),_}_applyScrollModifier(y,_){const S=this._optionsService.rawOptions.fastScrollModifier;return S==="alt"&&_.altKey||S==="ctrl"&&_.ctrlKey||S==="shift"&&_.shiftKey?y*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:y*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(y){this._lastTouchY=y.touches[0].pageY}handleTouchMove(y){const _=this._lastTouchY-y.touches[0].pageY;return this._lastTouchY=y.touches[0].pageY,_!==0&&(this._viewportElement.scrollTop+=_,this._bubbleScroll(y,_))}};o.Viewport=v=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)],v)},3107:function(f,o,c){var h=this&&this.__decorate||function(E,v,y,_){var S,A=arguments.length,L=A<3?v:_===null?_=Object.getOwnPropertyDescriptor(v,y):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(E,v,y,_);else for(var D=E.length-1;D>=0;D--)(S=E[D])&&(L=(A<3?S(L):A>3?S(v,y,L):S(v,y))||L);return A>3&&L&&Object.defineProperty(v,y,L),L},p=this&&this.__param||function(E,v){return function(y,_){v(y,_,E)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferDecorationRenderer=void 0;const u=c(4725),b=c(844),w=c(2585);let R=o.BufferDecorationRenderer=class extends b.Disposable{constructor(E,v,y,_,S){super(),this._screenElement=E,this._bufferService=v,this._coreBrowserService=y,this._decorationService=_,this._renderService=S,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 v=this._coreBrowserService.mainDocument.createElement("div");v.classList.add("xterm-decoration"),v.classList.toggle("xterm-decoration-top-layer",((_=E==null?void 0:E.options)==null?void 0:_.layer)==="top"),v.style.width=`${Math.round((E.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,v.style.height=(E.options.height||1)*this._renderService.dimensions.css.cell.height+"px",v.style.top=(E.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",v.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const y=E.options.x??0;return y&&y>this._bufferService.cols&&(v.style.display="none"),this._refreshXPosition(E,v),v}_refreshStyle(E){const v=E.marker.line-this._bufferService.buffers.active.ydisp;if(v<0||v>=this._bufferService.rows)E.element&&(E.element.style.display="none",E.onRenderEmitter.fire(E.element));else{let y=this._decorationElements.get(E);y||(y=this._createElement(E),E.element=y,this._decorationElements.set(E,y),this._container.appendChild(y),E.onDispose((()=>{this._decorationElements.delete(E),y.remove()}))),y.style.top=v*this._renderService.dimensions.css.cell.height+"px",y.style.display=this._altBufferIsActive?"none":"block",E.onRenderEmitter.fire(y)}}_refreshXPosition(E,v=E.element){if(!v)return;const y=E.options.x??0;(E.options.anchor||"left")==="right"?v.style.right=y?y*this._renderService.dimensions.css.cell.width+"px":"":v.style.left=y?y*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(E){var v;(v=this._decorationElements.get(E))==null||v.remove(),this._decorationElements.delete(E),E.dispose()}};o.BufferDecorationRenderer=R=h([p(1,w.IBufferService),p(2,u.ICoreBrowserService),p(3,w.IDecorationService),p(4,u.IRenderService)],R)},5871:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorZoneStore=void 0,o.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,o,c){var h=this&&this.__decorate||function(S,A,L,D){var T,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(S,A,L,D);else for(var B=S.length-1;B>=0;B--)(T=S[B])&&(M=(k<3?T(M):k>3?T(A,L,M):T(A,L))||M);return k>3&&M&&Object.defineProperty(A,L,M),M},p=this&&this.__param||function(S,A){return function(L,D){A(L,D,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OverviewRulerRenderer=void 0;const u=c(5871),b=c(4725),w=c(844),R=c(2585),E={full:0,left:0,center:0,right:0},v={full:0,left:0,center:0,right:0},y={full:0,left:0,center:0,right:0};let _=o.OverviewRulerRenderer=class extends w.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(S,A,L,D,T,k,M){var H;super(),this._viewportElement=S,this._screenElement=A,this._bufferService=L,this._decorationService=D,this._renderService=T,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,w.toDisposable)((()=>{var U;(U=this._canvas)==null||U.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const S=Math.floor(this._canvas.width/3),A=Math.ceil(this._canvas.width/3);v.full=this._canvas.width,v.left=S,v.center=A,v.right=S,this._refreshDrawHeightConstants(),y.full=0,y.left=0,y.center=v.left,y.right=v.left+v.center}_refreshDrawHeightConstants(){E.full=Math.round(2*this._coreBrowserService.dpr);const S=this._canvas.height/this._bufferService.buffer.lines.length,A=Math.round(Math.max(Math.min(S,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 S=this._colorZoneStore.zones;for(const A of S)A.position!=="full"&&this._renderColorZone(A);for(const A of S)A.position==="full"&&this._renderColorZone(A);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(S){this._ctx.fillStyle=S.color,this._ctx.fillRect(y[S.position||"full"],Math.round((this._canvas.height-1)*(S.startBufferLine/this._bufferService.buffers.active.lines.length)-E[S.position||"full"]/2),v[S.position||"full"],Math.round((this._canvas.height-1)*((S.endBufferLine-S.startBufferLine)/this._bufferService.buffers.active.lines.length)+E[S.position||"full"]))}_queueRefresh(S,A){this._shouldUpdateDimensions=S||this._shouldUpdateDimensions,this._shouldUpdateAnchor=A||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};o.OverviewRulerRenderer=_=h([p(2,R.IBufferService),p(3,R.IDecorationService),p(4,b.IRenderService),p(5,R.IOptionsService),p(6,b.ICoreBrowserService)],_)},2950:function(f,o,c){var h=this&&this.__decorate||function(E,v,y,_){var S,A=arguments.length,L=A<3?v:_===null?_=Object.getOwnPropertyDescriptor(v,y):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(E,v,y,_);else for(var D=E.length-1;D>=0;D--)(S=E[D])&&(L=(A<3?S(L):A>3?S(v,y,L):S(v,y))||L);return A>3&&L&&Object.defineProperty(v,y,L),L},p=this&&this.__param||function(E,v){return function(y,_){v(y,_,E)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompositionHelper=void 0;const u=c(4725),b=c(2585),w=c(2584);let R=o.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(E,v,y,_,S,A){this._textarea=E,this._compositionView=v,this._bufferService=y,this._optionsService=_,this._coreService=S,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 v={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let y;this._isSendingComposition=!1,v.start+=this._dataAlreadySent.length,y=this._isComposing?this._textarea.value.substring(v.start,v.end):this._textarea.value.substring(v.start),y.length>0&&this._coreService.triggerDataEvent(y,!0)}}),0)}else{this._isSendingComposition=!1;const v=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(v,!0)}}_handleAnyTextareaChanges(){const E=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const v=this._textarea.value,y=v.replace(E,"");this._dataAlreadySent=y,v.length>E.length?this._coreService.triggerDataEvent(y,!0):v.length<E.length?this._coreService.triggerDataEvent(`${w.C0.DEL}`,!0):v.length===E.length&&v!==E&&this._coreService.triggerDataEvent(v,!0)}}),0)}updateCompositionElements(E){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const v=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),y=this._renderService.dimensions.css.cell.height,_=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,S=v*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=S+"px",this._compositionView.style.top=_+"px",this._compositionView.style.height=y+"px",this._compositionView.style.lineHeight=y+"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=S+"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)}}};o.CompositionHelper=R=h([p(2,b.IBufferService),p(3,b.IOptionsService),p(4,b.ICoreService),p(5,u.IRenderService)],R)},9806:(f,o)=>{function c(h,p,u){const b=u.getBoundingClientRect(),w=h.getComputedStyle(u),R=parseInt(w.getPropertyValue("padding-left")),E=parseInt(w.getPropertyValue("padding-top"));return[p.clientX-b.left-R,p.clientY-b.top-E]}Object.defineProperty(o,"__esModule",{value:!0}),o.getCoords=o.getCoordsRelativeToElement=void 0,o.getCoordsRelativeToElement=c,o.getCoords=function(h,p,u,b,w,R,E,v,y){if(!R)return;const _=c(h,p,u);return _?(_[0]=Math.ceil((_[0]+(y?E/2:0))/E),_[1]=Math.ceil(_[1]/v),_[0]=Math.min(Math.max(_[0],1),b+(y?1:0)),_[1]=Math.min(Math.max(_[1],1),w),_):void 0}},9504:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.moveToCellSequence=void 0;const h=c(2584);function p(v,y,_,S){const A=v-u(v,_),L=y-u(y,_),D=Math.abs(A-L)-(function(T,k,M){let B=0;const H=T-u(T,M),U=k-u(k,M);for(let P=0;P<Math.abs(H-U);P++){const Y=b(T,k)==="A"?-1:1,X=M.buffer.lines.get(H+Y*P);X!=null&&X.isWrapped&&B++}return B})(v,y,_);return E(D,R(b(v,y),S))}function u(v,y){let _=0,S=y.buffer.lines.get(v),A=S==null?void 0:S.isWrapped;for(;A&&v>=0&&v<y.rows;)_++,S=y.buffer.lines.get(--v),A=S==null?void 0:S.isWrapped;return _}function b(v,y){return v>y?"A":"B"}function w(v,y,_,S,A,L){let D=v,T=y,k="";for(;D!==_||T!==S;)D+=A?1:-1,A&&D>L.cols-1?(k+=L.buffer.translateBufferLineToString(T,!1,v,D),D=0,v=0,T++):!A&&D<0&&(k+=L.buffer.translateBufferLineToString(T,!1,0,v+1),D=L.cols-1,v=D,T--);return k+L.buffer.translateBufferLineToString(T,!1,v,D)}function R(v,y){const _=y?"O":"[";return h.C0.ESC+_+v}function E(v,y){v=Math.floor(v);let _="";for(let S=0;S<v;S++)_+=y;return _}o.moveToCellSequence=function(v,y,_,S){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(w(k,M,k,M-u(M,U),!1,U).length,R("D",P))})(A,L,0,y,_,S)+p(L,y,_,S)+(function(k,M,B,H,U,P){let Y;Y=p(M,H,U,P).length>0?H-u(H,U):M;const X=H,V=(function(K,ne,z,j,N,$){let I;return I=p(z,j,N,$).length>0?j-u(j,N):ne,K<z&&I<=j||K>=z&&I<j?"C":"D"})(k,M,B,H,U,P);return E(w(k,Y,B,X,V==="C",U).length,R(V,P))})(A,L,v,y,_,S);let D;if(L===y)return D=A>v?"D":"C",E(Math.abs(A-v),R(D,S));D=L>y?"D":"C";const T=Math.abs(L-y);return E((function(k,M){return M.cols-k})(L>y?v:A,_)+(T-1)*_.cols+1+((L>y?A:v)-1),R(D,S))}},1296:function(f,o,c){var h=this&&this.__decorate||function(P,Y,X,V){var K,ne=arguments.length,z=ne<3?Y:V===null?V=Object.getOwnPropertyDescriptor(Y,X):V;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(P,Y,X,V);else for(var j=P.length-1;j>=0;j--)(K=P[j])&&(z=(ne<3?K(z):ne>3?K(Y,X,z):K(Y,X))||z);return ne>3&&z&&Object.defineProperty(Y,X,z),z},p=this&&this.__param||function(P,Y){return function(X,V){Y(X,V,P)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRenderer=void 0;const u=c(3787),b=c(2550),w=c(2223),R=c(6171),E=c(6052),v=c(4725),y=c(8055),_=c(8460),S=c(844),A=c(2585),L="xterm-dom-renderer-owner-",D="xterm-rows",T="xterm-fg-",k="xterm-bg-",M="xterm-focus",B="xterm-selection";let H=1,U=o.DomRenderer=class extends S.Disposable{constructor(P,Y,X,V,K,ne,z,j,N,$,I,se,ae){super(),this._terminal=P,this._document=Y,this._element=X,this._screenElement=V,this._viewportElement=K,this._helperContainer=ne,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,R.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((he=>this._injectCss(he)))),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((he=>this._handleLinkHover(he)))),this.register(this._linkifier2.onHideLinkUnderline((he=>this._handleLinkLeave(he)))),this.register((0,S.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 Y=`${this._terminalSelector} .${D} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=Y,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 Y=`${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}`;Y+=`${this._terminalSelector} .${D} .xterm-dim { color: ${y.color.multiplyOpacity(P.foreground,.5).css};}`,Y+=`${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}`,V=`blink_bar_${this._terminalClass}`,K=`blink_block_${this._terminalClass}`;Y+=`@keyframes ${X} { 50% { border-bottom-style: hidden; }}`,Y+=`@keyframes ${V} { 50% { box-shadow: none; }}`,Y+=`@keyframes ${K} { 0% { background-color: ${P.cursor.css}; color: ${P.cursorAccent.css}; } 50% { background-color: inherit; color: ${P.cursor.css}; }}`,Y+=`${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: ${V} 1s step-end infinite;}${this._terminalSelector} .${D}.${M} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${K} 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);}`,Y+=`${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[ne,z]of P.ansi.entries())Y+=`${this._terminalSelector} .${T}${ne} { color: ${z.css}; }${this._terminalSelector} .${T}${ne}.xterm-dim { color: ${y.color.multiplyOpacity(z,.5).css}; }${this._terminalSelector} .${k}${ne} { background-color: ${z.css}; }`;Y+=`${this._terminalSelector} .${T}${w.INVERTED_DEFAULT_COLOR} { color: ${y.color.opaque(P.background).css}; }${this._terminalSelector} .${T}${w.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${y.color.multiplyOpacity(y.color.opaque(P.background),.5).css}; }${this._terminalSelector} .${k}${w.INVERTED_DEFAULT_COLOR} { background-color: ${P.foreground.css}; }`,this._themeStyleElement.textContent=Y}_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,Y){for(let X=this._rowElements.length;X<=Y;X++){const V=this._document.createElement("div");this._rowContainer.appendChild(V),this._rowElements.push(V)}for(;this._rowElements.length>Y;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(P,Y){this._refreshRowElements(P,Y),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,Y,X){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(P,Y,X),this.renderRows(0,this._bufferService.rows-1),!P||!Y)return;this._selectionRenderModel.update(this._terminal,P,Y,X);const V=this._selectionRenderModel.viewportStartRow,K=this._selectionRenderModel.viewportEndRow,ne=this._selectionRenderModel.viewportCappedStartRow,z=this._selectionRenderModel.viewportCappedEndRow;if(ne>=this._bufferService.rows||z<0)return;const j=this._document.createDocumentFragment();if(X){const N=P[0]>Y[0];j.appendChild(this._createSelectionElement(ne,N?Y[0]:P[0],N?P[0]:Y[0],z-ne+1))}else{const N=V===ne?P[0]:0,$=ne===K?Y[0]:this._bufferService.cols;j.appendChild(this._createSelectionElement(ne,N,$));const I=z-ne-1;if(j.appendChild(this._createSelectionElement(ne+1,0,this._bufferService.cols,I)),ne!==z){const se=K===z?Y[0]:this._bufferService.cols;j.appendChild(this._createSelectionElement(z,0,se))}}this._selectionContainer.appendChild(j)}_createSelectionElement(P,Y,X,V=1){const K=this._document.createElement("div"),ne=Y*this.dimensions.css.cell.width;let z=this.dimensions.css.cell.width*(X-Y);return ne+z>this.dimensions.css.canvas.width&&(z=this.dimensions.css.canvas.width-ne),K.style.height=V*this.dimensions.css.cell.height+"px",K.style.top=P*this.dimensions.css.cell.height+"px",K.style.left=`${ne}px`,K.style.width=`${z}px`,K}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,Y){const X=this._bufferService.buffer,V=X.ybase+X.y,K=Math.min(X.x,this._bufferService.cols-1),ne=this._optionsService.rawOptions.cursorBlink,z=this._optionsService.rawOptions.cursorStyle,j=this._optionsService.rawOptions.cursorInactiveStyle;for(let N=P;N<=Y;N++){const $=N+X.ydisp,I=this._rowElements[N],se=X.lines.get($);if(!I||!se)break;I.replaceChildren(...this._rowFactory.createRow(se,$,$===V,z,j,K,ne,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,Y,X,V,K,ne){X<0&&(P=0),V<0&&(Y=0);const z=this._bufferService.rows-1;X=Math.max(Math.min(X,z),0),V=Math.max(Math.min(V,z),0),K=Math.min(K,this._bufferService.cols);const j=this._bufferService.buffer,N=j.ybase+j.y,$=Math.min(j.x,K-1),I=this._optionsService.rawOptions.cursorBlink,se=this._optionsService.rawOptions.cursorStyle,ae=this._optionsService.rawOptions.cursorInactiveStyle;for(let he=X;he<=V;++he){const W=he+j.ydisp,q=this._rowElements[he],ie=j.lines.get(W);if(!q||!ie)break;q.replaceChildren(...this._rowFactory.createRow(ie,W,W===N,se,ae,$,I,this.dimensions.css.cell.width,this._widthCache,ne?he===X?P:0:-1,ne?(he===V?Y:K)-1:-1))}}};o.DomRenderer=U=h([p(7,A.IInstantiationService),p(8,v.ICharSizeService),p(9,A.IOptionsService),p(10,A.IBufferService),p(11,v.ICoreBrowserService),p(12,v.IThemeService)],U)},3787:function(f,o,c){var h=this&&this.__decorate||function(D,T,k,M){var B,H=arguments.length,U=H<3?T:M===null?M=Object.getOwnPropertyDescriptor(T,k):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(D,T,k,M);else for(var P=D.length-1;P>=0;P--)(B=D[P])&&(U=(H<3?B(U):H>3?B(T,k,U):B(T,k))||U);return H>3&&U&&Object.defineProperty(T,k,U),U},p=this&&this.__param||function(D,T){return function(k,M){T(k,M,D)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRendererRowFactory=void 0;const u=c(2223),b=c(643),w=c(511),R=c(2585),E=c(8055),v=c(4725),y=c(4269),_=c(6171),S=c(3734);let A=o.DomRendererRowFactory=class{constructor(D,T,k,M,B,H,U){this._document=D,this._characterJoinerService=T,this._optionsService=k,this._coreBrowserService=M,this._coreService=B,this._decorationService=H,this._themeService=U,this._workCell=new w.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(D,T,k){this._selectionStart=D,this._selectionEnd=T,this._columnSelectMode=k}createRow(D,T,k,M,B,H,U,P,Y,X,V){const K=[],ne=this._characterJoinerService.getJoinedCharacters(T),z=this._themeService.colors;let j,N=D.getNoBgTrimmedLength();k&&N<H+1&&(N=H+1);let $=0,I="",se=0,ae=0,he=0,W=!1,q=0,ie=!1,ee=0;const le=[],ve=X!==-1&&V!==-1;for(let De=0;De<N;De++){D.loadCell(De,this._workCell);let Ne=this._workCell.getWidth();if(Ne===0)continue;let je=!1,ct=De,Ee=this._workCell;if(ne.length>0&&De===ne[0][0]){je=!0;const qe=ne.shift();Ee=new y.JoinedCellData(this._workCell,D.translateToString(!0,qe[0],qe[1]),qe[1]-qe[0]),ct=qe[1]-1,Ne=Ee.getWidth()}const Yt=this._isCellInSelection(De,T),sn=k&&De===H,Nt=ve&&De>=X&&De<=V;let dn=!1;this._decorationService.forEachDecorationAtCell(De,T,void 0,(qe=>{dn=!0}));let En=Ee.getChars()||b.WHITESPACE_CELL_CHAR;if(En===" "&&(Ee.isUnderline()||Ee.isOverline())&&(En=" "),ee=Ne*P-Y.get(En,Ee.isBold(),Ee.isItalic()),j){if($&&(Yt&&ie||!Yt&&!ie&&Ee.bg===se)&&(Yt&&ie&&z.selectionForeground||Ee.fg===ae)&&Ee.extended.ext===he&&Nt===W&&ee===q&&!sn&&!je&&!dn){Ee.isInvisible()?I+=b.WHITESPACE_CELL_CHAR:I+=En,$++;continue}$&&(j.textContent=I),j=this._document.createElement("span"),$=0,I=""}else j=this._document.createElement("span");if(se=Ee.bg,ae=Ee.fg,he=Ee.extended.ext,W=Nt,q=ee,ie=Yt,je&&H>=De&&H<=ct&&(H=De),!this._coreService.isCursorHidden&&sn&&this._coreService.isCursorInitialized){if(le.push("xterm-cursor"),this._coreBrowserService.isFocused)U&&le.push("xterm-cursor-blink"),le.push(M==="bar"?"xterm-cursor-bar":M==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(B)switch(B){case"outline":le.push("xterm-cursor-outline");break;case"block":le.push("xterm-cursor-block");break;case"bar":le.push("xterm-cursor-bar");break;case"underline":le.push("xterm-cursor-underline")}}if(Ee.isBold()&&le.push("xterm-bold"),Ee.isItalic()&&le.push("xterm-italic"),Ee.isDim()&&le.push("xterm-dim"),I=Ee.isInvisible()?b.WHITESPACE_CELL_CHAR:Ee.getChars()||b.WHITESPACE_CELL_CHAR,Ee.isUnderline()&&(le.push(`xterm-underline-${Ee.extended.underlineStyle}`),I===" "&&(I=" "),!Ee.isUnderlineColorDefault()))if(Ee.isUnderlineColorRGB())j.style.textDecorationColor=`rgb(${S.AttributeData.toColorRGB(Ee.getUnderlineColor()).join(",")})`;else{let qe=Ee.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Ee.isBold()&&qe<8&&(qe+=8),j.style.textDecorationColor=z.ansi[qe].css}Ee.isOverline()&&(le.push("xterm-overline"),I===" "&&(I=" ")),Ee.isStrikethrough()&&le.push("xterm-strikethrough"),Nt&&(j.style.textDecoration="underline");let wt=Ee.getFgColor(),it=Ee.getFgColorMode(),Ot=Ee.getBgColor(),pe=Ee.getBgColorMode();const Se=!!Ee.isInverse();if(Se){const qe=wt;wt=Ot,Ot=qe;const St=it;it=pe,pe=St}let ke,Oe,He,_t=!1;switch(this._decorationService.forEachDecorationAtCell(De,T,void 0,(qe=>{qe.options.layer!=="top"&&_t||(qe.backgroundColorRGB&&(pe=50331648,Ot=qe.backgroundColorRGB.rgba>>8&16777215,ke=qe.backgroundColorRGB),qe.foregroundColorRGB&&(it=50331648,wt=qe.foregroundColorRGB.rgba>>8&16777215,Oe=qe.foregroundColorRGB),_t=qe.options.layer==="top")})),!_t&&Yt&&(ke=this._coreBrowserService.isFocused?z.selectionBackgroundOpaque:z.selectionInactiveBackgroundOpaque,Ot=ke.rgba>>8&16777215,pe=50331648,_t=!0,z.selectionForeground&&(it=50331648,wt=z.selectionForeground.rgba>>8&16777215,Oe=z.selectionForeground)),_t&&le.push("xterm-decoration-top"),pe){case 16777216:case 33554432:He=z.ansi[Ot],le.push(`xterm-bg-${Ot}`);break;case 50331648:He=E.channels.toColor(Ot>>16,Ot>>8&255,255&Ot),this._addStyle(j,`background-color:#${L((Ot>>>0).toString(16),"0",6)}`);break;default:Se?(He=z.foreground,le.push(`xterm-bg-${u.INVERTED_DEFAULT_COLOR}`)):He=z.background}switch(ke||Ee.isDim()&&(ke=E.color.multiplyOpacity(He,.5)),it){case 16777216:case 33554432:Ee.isBold()&&wt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(wt+=8),this._applyMinimumContrast(j,He,z.ansi[wt],Ee,ke,void 0)||le.push(`xterm-fg-${wt}`);break;case 50331648:const qe=E.channels.toColor(wt>>16&255,wt>>8&255,255&wt);this._applyMinimumContrast(j,He,qe,Ee,ke,Oe)||this._addStyle(j,`color:#${L(wt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(j,He,z.foreground,Ee,ke,Oe)||Se&&le.push(`xterm-fg-${u.INVERTED_DEFAULT_COLOR}`)}le.length&&(j.className=le.join(" "),le.length=0),sn||je||dn?j.textContent=I:$++,ee!==this.defaultSpacing&&(j.style.letterSpacing=`${ee}px`),K.push(j),De=ct}return j&&$&&(j.textContent=I),K}_applyMinimumContrast(D,T,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(T.rgba,k.rgba)),P===void 0){const Y=this._optionsService.rawOptions.minimumContrastRatio/(M.isDim()?2:1);P=E.color.ensureContrastRatio(B||T,H||k,Y),U.setColor((B||T).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,T){D.setAttribute("style",`${D.getAttribute("style")||""}${T};`)}_isCellInSelection(D,T){const k=this._selectionStart,M=this._selectionEnd;return!(!k||!M)&&(this._columnSelectMode?k[0]<=M[0]?D>=k[0]&&T>=k[1]&&D<M[0]&&T<=M[1]:D<k[0]&&T>=k[1]&&D>=M[0]&&T<=M[1]:T>k[1]&&T<M[1]||k[1]===M[1]&&T===k[1]&&D>=k[0]&&D<M[0]||k[1]<M[1]&&T===M[1]&&D<M[0]||k[1]<M[1]&&T===k[1]&&D>=k[0])}};function L(D,T,k){for(;D.length<k;)D=T+D;return D}o.DomRendererRowFactory=A=h([p(1,v.ICharacterJoinerService),p(2,R.IOptionsService),p(3,v.ICoreBrowserService),p(4,R.ICoreService),p(5,R.IDecorationService),p(6,v.IThemeService)],A)},2550:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WidthCache=void 0,o.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 w=c.createElement("span");w.classList.add("xterm-char-measure-element"),w.style.fontWeight="bold",w.style.fontStyle="italic",this._measureElements=[p,u,b,w],this._container.appendChild(p),this._container.appendChild(u),this._container.appendChild(b),this._container.appendChild(w),h.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(c,h,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 R=this._measure(c,0);return R>0&&(this._flat[u]=R),R}let b=c;h&&(b+="B"),p&&(b+="I");let w=this._holey.get(b);if(w===void 0){let R=0;h&&(R|=1),p&&(R|=2),w=this._measure(c,R),w>0&&this._holey.set(b,w)}return w}_measure(c,h){const p=this._measureElements[h];return p.textContent=c.repeat(32),p.offsetWidth/32}}},2223:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const h=c(6114);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=h.isFirefox||h.isLegacyEdge?"bottom":"ideographic"},6171:(f,o)=>{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(o,"__esModule",{value:!0}),o.computeNextVariantOffset=o.createRenderDimensions=o.treatGlyphAsBackgroundColor=o.allowRescaling=o.isEmoji=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(p){if(!p)throw new Error("value must not be falsy");return p},o.isPowerlineGlyph=c,o.isRestrictedPowerlineGlyph=function(p){return 57520<=p&&p<=57527},o.isEmoji=h,o.allowRescaling=function(p,u,b,w){return u===1&&b>Math.ceil(1.5*w)&&p!==void 0&&p>255&&!h(p)&&!c(p)&&!(function(R){return 57344<=R&&R<=63743})(p)},o.treatGlyphAsBackgroundColor=function(p){return c(p)||(function(u){return 9472<=u&&u<=9631})(p)},o.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}}}},o.computeNextVariantOffset=function(p,u,b=0){return(p-(2*Math.round(u)-b))%(2*Math.round(u))}},6052:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.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,w=!1){if(this.selectionStart=u,this.selectionEnd=b,!u||!b||u[0]===b[0]&&u[1]===b[1])return void this.clear();const R=p.buffers.active.ydisp,E=u[1]-R,v=b[1]-R,y=Math.max(E,0),_=Math.min(v,p.rows-1);y>=p.rows||_<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=w,this.viewportStartRow=E,this.viewportEndRow=v,this.viewportCappedStartRow=y,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)}}o.createSelectionRenderModel=function(){return new c}},456:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionModel=void 0,o.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,o,c){var h=this&&this.__decorate||function(_,S,A,L){var D,T=arguments.length,k=T<3?S:L===null?L=Object.getOwnPropertyDescriptor(S,A):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(_,S,A,L);else for(var M=_.length-1;M>=0;M--)(D=_[M])&&(k=(T<3?D(k):T>3?D(S,A,k):D(S,A))||k);return T>3&&k&&Object.defineProperty(S,A,k),k},p=this&&this.__param||function(_,S){return function(A,L){S(A,L,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharSizeService=void 0;const u=c(2585),b=c(8460),w=c(844);let R=o.CharSizeService=class extends w.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(_,S,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 y(this._optionsService))}catch{this._measureStrategy=this.register(new v(_,S,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())}};o.CharSizeService=R=h([p(2,u.IOptionsService)],R);class E extends w.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(S,A){S!==void 0&&S>0&&A!==void 0&&A>0&&(this._result.width=S,this._result.height=A)}}class v extends E{constructor(S,A,L){super(),this._document=S,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 y extends E{constructor(S){super(),this._optionsService=S,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 S=this._ctx.measureText("W");return this._validateAndSet(S.width,S.fontBoundingBoxAscent+S.fontBoundingBoxDescent),this._result}}},4269:function(f,o,c){var h=this&&this.__decorate||function(y,_,S,A){var L,D=arguments.length,T=D<3?_:A===null?A=Object.getOwnPropertyDescriptor(_,S):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(y,_,S,A);else for(var k=y.length-1;k>=0;k--)(L=y[k])&&(T=(D<3?L(T):D>3?L(_,S,T):L(_,S))||T);return D>3&&T&&Object.defineProperty(_,S,T),T},p=this&&this.__param||function(y,_){return function(S,A){_(S,A,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const u=c(3734),b=c(643),w=c(511),R=c(2585);class E extends u.AttributeData{constructor(_,S,A){super(),this.content=0,this.combinedData="",this.fg=_.fg,this.bg=_.bg,this.combinedData=S,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()]}}o.JoinedCellData=E;let v=o.CharacterJoinerService=class c_{constructor(_){this._bufferService=_,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new w.CellData}register(_){const S={id:this._nextCharacterJoinerId++,handler:_};return this._characterJoiners.push(S),S.id}deregister(_){for(let S=0;S<this._characterJoiners.length;S++)if(this._characterJoiners[S].id===_)return this._characterJoiners.splice(S,1),!0;return!1}getJoinedCharacters(_){if(this._characterJoiners.length===0)return[];const S=this._bufferService.buffer.lines.get(_);if(!S||S.length===0)return[];const A=[],L=S.translateToString(!0);let D=0,T=0,k=0,M=S.getFg(0),B=S.getBg(0);for(let H=0;H<S.getTrimmedLength();H++)if(S.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,T,S,D);for(let P=0;P<U.length;P++)A.push(U[P])}D=H,k=T,M=this._workCell.fg,B=this._workCell.bg}T+=this._workCell.getChars().length||b.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-D>1){const H=this._getJoinedRanges(L,k,T,S,D);for(let U=0;U<H.length;U++)A.push(H[U])}return A}_getJoinedRanges(_,S,A,L,D){const T=_.substring(S,A);let k=[];try{k=this._characterJoiners[0].handler(T)}catch(M){console.error(M)}for(let M=1;M<this._characterJoiners.length;M++)try{const B=this._characterJoiners[M].handler(T);for(let H=0;H<B.length;H++)c_._mergeRanges(k,B[H])}catch(B){console.error(B)}return this._stringRangesToCellRanges(k,L,D),k}_stringRangesToCellRanges(_,S,A){let L=0,D=!1,T=0,k=_[L];if(k){for(let M=A;M<this._bufferService.cols;M++){const B=S.getWidth(M),H=S.getString(M).length||b.WHITESPACE_CELL_CHAR.length;if(B!==0){if(!D&&k[0]<=T&&(k[0]=M,D=!0),k[1]<=T){if(k[1]=M,k=_[++L],!k)break;k[0]<=T?(k[0]=M,D=!0):D=!1}T+=H}}k&&(k[1]=this._bufferService.cols)}}static _mergeRanges(_,S){let A=!1;for(let L=0;L<_.length;L++){const D=_[L];if(A){if(S[1]<=D[0])return _[L-1][1]=S[1],_;if(S[1]<=D[1])return _[L-1][1]=Math.max(S[1],D[1]),_.splice(L,1),_;_.splice(L,1),L--}else{if(S[1]<=D[0])return _.splice(L,0,S),_;if(S[1]<=D[1])return D[0]=Math.min(S[0],D[0]),_;S[0]<D[1]&&(D[0]=Math.min(S[0],D[0]),A=!0)}}return A?_[_.length-1][1]=S[1]:_.push(S),_}};o.CharacterJoinerService=v=h([p(0,R.IBufferService)],v)},5114:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreBrowserService=void 0;const h=c(844),p=c(8460),u=c(3656);class b extends h.Disposable{constructor(E,v,y){super(),this._textarea=E,this._window=v,this.mainDocument=y,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new w(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}}o.CoreBrowserService=b;class w 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,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.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 w=this.linkProviders.indexOf(b);w!==-1&&this.linkProviders.splice(w,1)}}}}o.LinkProviderService=p},8934:function(f,o,c){var h=this&&this.__decorate||function(R,E,v,y){var _,S=arguments.length,A=S<3?E:y===null?y=Object.getOwnPropertyDescriptor(E,v):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(R,E,v,y);else for(var L=R.length-1;L>=0;L--)(_=R[L])&&(A=(S<3?_(A):S>3?_(E,v,A):_(E,v))||A);return S>3&&A&&Object.defineProperty(E,v,A),A},p=this&&this.__param||function(R,E){return function(v,y){E(v,y,R)}};Object.defineProperty(o,"__esModule",{value:!0}),o.MouseService=void 0;const u=c(4725),b=c(9806);let w=o.MouseService=class{constructor(R,E){this._renderService=R,this._charSizeService=E}getCoords(R,E,v,y,_){return(0,b.getCoords)(window,R,E,v,y,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,_)}getMouseReportCoords(R,E){const v=(0,b.getCoordsRelativeToElement)(window,R,E);if(this._charSizeService.hasValidSize)return v[0]=Math.min(Math.max(v[0],0),this._renderService.dimensions.css.canvas.width-1),v[1]=Math.min(Math.max(v[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(v[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(v[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(v[0]),y:Math.floor(v[1])}}};o.MouseService=w=h([p(0,u.IRenderService),p(1,u.ICharSizeService)],w)},3230:function(f,o,c){var h=this&&this.__decorate||function(_,S,A,L){var D,T=arguments.length,k=T<3?S:L===null?L=Object.getOwnPropertyDescriptor(S,A):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(_,S,A,L);else for(var M=_.length-1;M>=0;M--)(D=_[M])&&(k=(T<3?D(k):T>3?D(S,A,k):D(S,A))||k);return T>3&&k&&Object.defineProperty(S,A,k),k},p=this&&this.__param||function(_,S){return function(A,L){S(A,L,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.RenderService=void 0;const u=c(6193),b=c(4725),w=c(8460),R=c(844),E=c(7226),v=c(2585);let y=o.RenderService=class extends R.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(_,S,A,L,D,T,k,M){super(),this._rowCount=_,this._charSizeService=L,this._renderer=this.register(new R.MutableDisposable),this._pausedResizeTask=new E.DebouncedIdleTask,this._observerDisposable=this.register(new R.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new w.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new w.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new w.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new w.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new u.RenderDebouncer(((B,H)=>this._renderRows(B,H)),k),this.register(this._renderDebouncer),this.register(k.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(T.onResize((()=>this._fullRefresh()))),this.register(T.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(T.cols,T.rows),this._fullRefresh()}))),this.register(A.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(T.buffer.y,T.buffer.y,!0)))),this.register(M.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(k.window,S),this.register(k.onWindowChange((B=>this._registerIntersectionObserver(B,S))))}_registerIntersectionObserver(_,S){if("IntersectionObserver"in _){const A=new _.IntersectionObserver((L=>this._handleIntersectionChange(L[L.length-1])),{threshold:0});A.observe(S),this._observerDisposable.value=(0,R.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(_,S,A=!1){this._isPaused?this._needsFullRefresh=!0:(A||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(_,S,this._rowCount))}_renderRows(_,S){this._renderer.value&&(_=Math.min(_,this._rowCount-1),S=Math.min(S,this._rowCount-1),this._renderer.value.renderRows(_,S),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:S}),this._onRender.fire({start:_,end:S}),this._isNextRenderRedrawOnly=!0)}resize(_,S){this._rowCount=S,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((S=>this.refreshRows(S.start,S.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 _,S;this._renderer.value&&((S=(_=this._renderer.value).clearTextureAtlas)==null||S.call(_),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(_,S){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var A;return(A=this._renderer.value)==null?void 0:A.handleResize(_,S)})):this._renderer.value.handleResize(_,S),this._fullRefresh())}handleCharSizeChanged(){var _;(_=this._renderer.value)==null||_.handleCharSizeChanged()}handleBlur(){var _;(_=this._renderer.value)==null||_.handleBlur()}handleFocus(){var _;(_=this._renderer.value)==null||_.handleFocus()}handleSelectionChanged(_,S,A){var L;this._selectionState.start=_,this._selectionState.end=S,this._selectionState.columnSelectMode=A,(L=this._renderer.value)==null||L.handleSelectionChanged(_,S,A)}handleCursorMove(){var _;(_=this._renderer.value)==null||_.handleCursorMove()}clear(){var _;(_=this._renderer.value)==null||_.clear()}};o.RenderService=y=h([p(2,v.IOptionsService),p(3,b.ICharSizeService),p(4,v.IDecorationService),p(5,v.IBufferService),p(6,b.ICoreBrowserService),p(7,b.IThemeService)],y)},9312:function(f,o,c){var h=this&&this.__decorate||function(k,M,B,H){var U,P=arguments.length,Y=P<3?M:H===null?H=Object.getOwnPropertyDescriptor(M,B):H;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Y=Reflect.decorate(k,M,B,H);else for(var X=k.length-1;X>=0;X--)(U=k[X])&&(Y=(P<3?U(Y):P>3?U(M,B,Y):U(M,B))||Y);return P>3&&Y&&Object.defineProperty(M,B,Y),Y},p=this&&this.__param||function(k,M){return function(B,H){M(B,H,k)}};Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionService=void 0;const u=c(9806),b=c(9504),w=c(456),R=c(4725),E=c(8460),v=c(844),y=c(6114),_=c(4841),S=c(511),A=c(2585),L=" ",D=new RegExp(L,"g");let T=o.SelectionService=class extends v.Disposable{constructor(k,M,B,H,U,P,Y,X,V){super(),this._element=k,this._screenElement=M,this._linkifier=B,this._bufferService=H,this._coreService=U,this._mouseService=P,this._optionsService=Y,this._renderService=X,this._coreBrowserService=V,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new S.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=K=>this._handleMouseMove(K),this._mouseUpListener=K=>this._handleMouseUp(K),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((K=>this._handleTrim(K))),this.register(this._bufferService.buffers.onBufferActivate((K=>this._handleBufferActivate(K)))),this.enable(),this._model=new w.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,v.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 Y=k[1];Y<=M[1];Y++){const X=B.translateBufferLineToString(Y,!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 Y=B.lines.get(P),X=B.translateBufferLineToString(P,!0);Y!=null&&Y.isWrapped?H[H.length-1]+=X:H.push(X)}if(k[1]!==M[1]){const P=B.lines.get(M[1]),Y=B.translateBufferLineToString(M[1],!0,0,M[0]);P&&P.isWrapped?H[H.length-1]+=Y:H.push(Y)}}return H.map((U=>U.replace(D," "))).join(y.isWindows?`\r
56
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()))),S.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,g.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 S.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&&!(S.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,v.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 Y=U.translateBufferLineToString(k[1],!1);let X=this._convertViewportColToCharacterIndex(P,k[0]),V=X;const K=k[0]-X;let ne=0,z=0,j=0,N=0;if(Y.charAt(X)===" "){for(;X>0&&Y.charAt(X-1)===" ";)X--;for(;V<Y.length&&Y.charAt(V+1)===" ";)V++}else{let se=k[0],ae=k[0];P.getWidth(se)===0&&(ne++,se--),P.getWidth(ae)===2&&(z++,ae++);const he=P.getString(ae).length;for(he>1&&(N+=he-1,V+=he-1);se>0&&X>0&&!this._isCharWordSeparator(P.loadCell(se-1,this._workCell));){P.loadCell(se-1,this._workCell);const W=this._workCell.getChars().length;this._workCell.getWidth()===0?(ne++,se--):W>1&&(j+=W-1,X-=W-1),X--,se--}for(;ae<P.length&&V+1<Y.length&&!this._isCharWordSeparator(P.loadCell(ae+1,this._workCell));){P.loadCell(ae+1,this._workCell);const W=this._workCell.getChars().length;this._workCell.getWidth()===2?(z++,ae++):W>1&&(N+=W-1,V+=W-1),V++,ae++}}V++;let $=X+K-ne+j,I=Math.min(this._bufferService.cols,V-X+ne+z-j-N);if(M||Y.slice(X,V).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 he=this._bufferService.cols-ae.start;$-=he,I+=he}}}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,g.getRangeLength)(B,this._bufferService.cols)}};o.SelectionService=T=h([p(3,A.IBufferService),p(4,A.ICoreService),p(5,R.IMouseService),p(6,A.IOptionsService),p(7,R.IRenderService),p(8,R.ICoreBrowserService)],T)},4725:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ILinkProviderService=o.IThemeService=o.ICharacterJoinerService=o.ISelectionService=o.IRenderService=o.IMouseService=o.ICoreBrowserService=o.ICharSizeService=void 0;const h=c(8343);o.ICharSizeService=(0,h.createDecorator)("CharSizeService"),o.ICoreBrowserService=(0,h.createDecorator)("CoreBrowserService"),o.IMouseService=(0,h.createDecorator)("MouseService"),o.IRenderService=(0,h.createDecorator)("RenderService"),o.ISelectionService=(0,h.createDecorator)("SelectionService"),o.ICharacterJoinerService=(0,h.createDecorator)("CharacterJoinerService"),o.IThemeService=(0,h.createDecorator)("ThemeService"),o.ILinkProviderService=(0,h.createDecorator)("LinkProviderService")},6731:function(f,o,c){var h=this&&this.__decorate||function(T,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(T,k,M,B);else for(var Y=T.length-1;Y>=0;Y--)(H=T[Y])&&(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(T,k){return function(M,B){k(M,B,T)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const u=c(7239),v=c(8055),w=c(8460),R=c(844),E=c(2585),y=v.css.toColor("#ffffff"),S=v.css.toColor("#000000"),g=v.css.toColor("#ffffff"),b=v.css.toColor("#000000"),A={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};o.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const T=[v.css.toColor("#2e3436"),v.css.toColor("#cc0000"),v.css.toColor("#4e9a06"),v.css.toColor("#c4a000"),v.css.toColor("#3465a4"),v.css.toColor("#75507b"),v.css.toColor("#06989a"),v.css.toColor("#d3d7cf"),v.css.toColor("#555753"),v.css.toColor("#ef2929"),v.css.toColor("#8ae234"),v.css.toColor("#fce94f"),v.css.toColor("#729fcf"),v.css.toColor("#ad7fa8"),v.css.toColor("#34e2e2"),v.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];T.push({css:v.channels.toCss(B,H,U),rgba:v.channels.toRgba(B,H,U)})}for(let M=0;M<24;M++){const B=8+10*M;T.push({css:v.channels.toCss(B,B,B),rgba:v.channels.toRgba(B,B,B)})}return T})());let L=o.ThemeService=class extends R.Disposable{get colors(){return this._colors}constructor(T){super(),this._optionsService=T,this._contrastCache=new u.ColorContrastCache,this._halfContrastCache=new u.ColorContrastCache,this._onChangeColors=this.register(new w.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:y,background:S,cursor:g,cursorAccent:b,selectionForeground:void 0,selectionBackgroundTransparent:A,selectionBackgroundOpaque:v.color.blend(S,A),selectionInactiveBackgroundTransparent:A,selectionInactiveBackgroundOpaque:v.color.blend(S,A),ansi:o.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(T={}){const k=this._colors;if(k.foreground=D(T.foreground,y),k.background=D(T.background,S),k.cursor=D(T.cursor,g),k.cursorAccent=D(T.cursorAccent,b),k.selectionBackgroundTransparent=D(T.selectionBackground,A),k.selectionBackgroundOpaque=v.color.blend(k.background,k.selectionBackgroundTransparent),k.selectionInactiveBackgroundTransparent=D(T.selectionInactiveBackground,k.selectionBackgroundTransparent),k.selectionInactiveBackgroundOpaque=v.color.blend(k.background,k.selectionInactiveBackgroundTransparent),k.selectionForeground=T.selectionForeground?D(T.selectionForeground,v.NULL_COLOR):void 0,k.selectionForeground===v.NULL_COLOR&&(k.selectionForeground=void 0),v.color.isOpaque(k.selectionBackgroundTransparent)&&(k.selectionBackgroundTransparent=v.color.opacity(k.selectionBackgroundTransparent,.3)),v.color.isOpaque(k.selectionInactiveBackgroundTransparent)&&(k.selectionInactiveBackgroundTransparent=v.color.opacity(k.selectionInactiveBackgroundTransparent,.3)),k.ansi=o.DEFAULT_ANSI_COLORS.slice(),k.ansi[0]=D(T.black,o.DEFAULT_ANSI_COLORS[0]),k.ansi[1]=D(T.red,o.DEFAULT_ANSI_COLORS[1]),k.ansi[2]=D(T.green,o.DEFAULT_ANSI_COLORS[2]),k.ansi[3]=D(T.yellow,o.DEFAULT_ANSI_COLORS[3]),k.ansi[4]=D(T.blue,o.DEFAULT_ANSI_COLORS[4]),k.ansi[5]=D(T.magenta,o.DEFAULT_ANSI_COLORS[5]),k.ansi[6]=D(T.cyan,o.DEFAULT_ANSI_COLORS[6]),k.ansi[7]=D(T.white,o.DEFAULT_ANSI_COLORS[7]),k.ansi[8]=D(T.brightBlack,o.DEFAULT_ANSI_COLORS[8]),k.ansi[9]=D(T.brightRed,o.DEFAULT_ANSI_COLORS[9]),k.ansi[10]=D(T.brightGreen,o.DEFAULT_ANSI_COLORS[10]),k.ansi[11]=D(T.brightYellow,o.DEFAULT_ANSI_COLORS[11]),k.ansi[12]=D(T.brightBlue,o.DEFAULT_ANSI_COLORS[12]),k.ansi[13]=D(T.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),k.ansi[14]=D(T.brightCyan,o.DEFAULT_ANSI_COLORS[14]),k.ansi[15]=D(T.brightWhite,o.DEFAULT_ANSI_COLORS[15]),T.extendedAnsi){const M=Math.min(k.ansi.length-16,T.extendedAnsi.length);for(let B=0;B<M;B++)k.ansi[B+16]=D(T.extendedAnsi[B],o.DEFAULT_ANSI_COLORS[B+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(T){this._restoreColor(T),this._onChangeColors.fire(this.colors)}_restoreColor(T){if(T!==void 0)switch(T){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[T]=this._restoreColors.ansi[T]}else for(let k=0;k<this._restoreColors.ansi.length;++k)this._colors.ansi[k]=this._restoreColors.ansi[k]}modifyColors(T){T(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function D(T,k){if(T!==void 0)try{return v.css.toColor(T)}catch{}return k}o.ThemeService=L=h([p(0,E.IOptionsService)],L)},6349:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const h=c(8460),p=c(844);class u extends p.Disposable{constructor(w){super(),this._maxLength=w,this.onDeleteEmitter=this.register(new h.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new h.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new h.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(w){if(this._maxLength===w)return;const R=new Array(w);for(let E=0;E<Math.min(w,this.length);E++)R[E]=this._array[this._getCyclicIndex(E)];this._array=R,this._maxLength=w,this._startIndex=0}get length(){return this._length}set length(w){if(w>this._length)for(let R=this._length;R<w;R++)this._array[R]=void 0;this._length=w}get(w){return this._array[this._getCyclicIndex(w)]}set(w,R){this._array[this._getCyclicIndex(w)]=R}push(w){this._array[this._getCyclicIndex(this._length)]=w,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(w,R,...E){if(R){for(let y=w;y<this._length-R;y++)this._array[this._getCyclicIndex(y)]=this._array[this._getCyclicIndex(y+R)];this._length-=R,this.onDeleteEmitter.fire({index:w,amount:R})}for(let y=this._length-1;y>=w;y--)this._array[this._getCyclicIndex(y+E.length)]=this._array[this._getCyclicIndex(y)];for(let y=0;y<E.length;y++)this._array[this._getCyclicIndex(w+y)]=E[y];if(E.length&&this.onInsertEmitter.fire({index:w,amount:E.length}),this._length+E.length>this._maxLength){const y=this._length+E.length-this._maxLength;this._startIndex+=y,this._length=this._maxLength,this.onTrimEmitter.fire(y)}else this._length+=E.length}trimStart(w){w>this._length&&(w=this._length),this._startIndex+=w,this._length-=w,this.onTrimEmitter.fire(w)}shiftElements(w,R,E){if(!(R<=0)){if(w<0||w>=this._length)throw new Error("start argument out of range");if(w+E<0)throw new Error("Cannot shift elements in list beyond index 0");if(E>0){for(let S=R-1;S>=0;S--)this.set(w+S+E,this.get(w+S));const y=w+R+E-this._length;if(y>0)for(this._length+=y;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let y=0;y<R;y++)this.set(w+y+E,this.get(w+y))}}_getCyclicIndex(w){return(this._startIndex+w)%this._maxLength}}o.CircularList=u},1439:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function c(h,p=5){if(typeof h!="object")return h;const u=Array.isArray(h)?[]:{};for(const v in h)u[v]=p<=1?h[v]:h[v]&&c(h[v],p-1);return u}},8055:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;let c=0,h=0,p=0,u=0;var v,w,R,E,y;function S(b){const A=b.toString(16);return A.length<2?"0"+A:A}function g(b,A){return b<A?(A+.05)/(b+.05):(b+.05)/(A+.05)}o.NULL_COLOR={css:"#00000000",rgba:0},(function(b){b.toCss=function(A,L,D,T){return T!==void 0?`#${S(A)}${S(L)}${S(D)}${S(T)}`:`#${S(A)}${S(L)}${S(D)}`},b.toRgba=function(A,L,D,T=255){return(A<<24|L<<16|D<<8|T)>>>0},b.toColor=function(A,L,D,T){return{css:b.toCss(A,L,D,T),rgba:b.toRgba(A,L,D,T)}}})(v||(o.channels=v={})),(function(b){function A(L,D){return u=Math.round(255*D),[c,h,p]=y.toChannels(L.rgba),{css:v.toCss(c,h,p,u),rgba:v.toRgba(c,h,p,u)}}b.blend=function(L,D){if(u=(255&D.rgba)/255,u===1)return{css:D.css,rgba:D.rgba};const T=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((T-B)*u),h=H+Math.round((k-H)*u),p=U+Math.round((M-U)*u),{css:v.toCss(c,h,p),rgba:v.toRgba(c,h,p)}},b.isOpaque=function(L){return(255&L.rgba)==255},b.ensureContrastRatio=function(L,D,T){const k=y.ensureContrastRatio(L.rgba,D.rgba,T);if(k)return v.toColor(k>>24&255,k>>16&255,k>>8&255)},b.opaque=function(L){const D=(255|L.rgba)>>>0;return[c,h,p]=y.toChannels(D),{css:v.toCss(c,h,p),rgba:D}},b.opacity=A,b.multiplyOpacity=function(L,D){return u=255&L.rgba,A(L,u*D/255)},b.toColorRGB=function(L){return[L.rgba>>24&255,L.rgba>>16&255,L.rgba>>8&255]}})(w||(o.color=w={})),(function(b){let A,L;try{const D=document.createElement("canvas");D.width=1,D.height=1;const T=D.getContext("2d",{willReadFrequently:!0});T&&(A=T,A.globalCompositeOperation="copy",L=A.createLinearGradient(0,0,1,1))}catch{}b.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),v.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),v.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 T=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(T)return c=parseInt(T[1]),h=parseInt(T[2]),p=parseInt(T[3]),u=Math.round(255*(T[5]===void 0?1:parseFloat(T[5]))),v.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:v.toRgba(c,h,p,u),css:D}}})(R||(o.css=R={})),(function(b){function A(L,D,T){const k=L/255,M=D/255,B=T/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))}b.relativeLuminance=function(L){return A(L>>16&255,L>>8&255,255&L)},b.relativeLuminance2=A})(E||(o.rgb=E={})),(function(b){function A(D,T,k){const M=D>>24&255,B=D>>16&255,H=D>>8&255;let U=T>>24&255,P=T>>16&255,Y=T>>8&255,X=g(E.relativeLuminance2(U,P,Y),E.relativeLuminance2(M,B,H));for(;X<k&&(U>0||P>0||Y>0);)U-=Math.max(0,Math.ceil(.1*U)),P-=Math.max(0,Math.ceil(.1*P)),Y-=Math.max(0,Math.ceil(.1*Y)),X=g(E.relativeLuminance2(U,P,Y),E.relativeLuminance2(M,B,H));return(U<<24|P<<16|Y<<8|255)>>>0}function L(D,T,k){const M=D>>24&255,B=D>>16&255,H=D>>8&255;let U=T>>24&255,P=T>>16&255,Y=T>>8&255,X=g(E.relativeLuminance2(U,P,Y),E.relativeLuminance2(M,B,H));for(;X<k&&(U<255||P<255||Y<255);)U=Math.min(255,U+Math.ceil(.1*(255-U))),P=Math.min(255,P+Math.ceil(.1*(255-P))),Y=Math.min(255,Y+Math.ceil(.1*(255-Y))),X=g(E.relativeLuminance2(U,P,Y),E.relativeLuminance2(M,B,H));return(U<<24|P<<16|Y<<8|255)>>>0}b.blend=function(D,T){if(u=(255&T)/255,u===1)return T;const k=T>>24&255,M=T>>16&255,B=T>>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),v.toRgba(c,h,p)},b.ensureContrastRatio=function(D,T,k){const M=E.relativeLuminance(D>>8),B=E.relativeLuminance(T>>8);if(g(M,B)<k){if(B<M){const P=A(D,T,k),Y=g(M,E.relativeLuminance(P>>8));if(Y<k){const X=L(D,T,k);return Y>g(M,E.relativeLuminance(X>>8))?P:X}return P}const H=L(D,T,k),U=g(M,E.relativeLuminance(H>>8));if(U<k){const P=A(D,T,k);return U>g(M,E.relativeLuminance(P>>8))?H:P}return H}},b.reduceLuminance=A,b.increaseLuminance=L,b.toChannels=function(D){return[D>>24&255,D>>16&255,D>>8&255,255&D]}})(y||(o.rgba=y={})),o.toPaddedHex=S,o.contrastRatio=g},8969:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const h=c(844),p=c(2585),u=c(4348),v=c(7866),w=c(744),R=c(7302),E=c(6975),y=c(8460),S=c(1753),g=c(1480),b=c(7994),A=c(9282),L=c(5435),D=c(5981),T=c(2660);let k=!1;class M extends h.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new y.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 y.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new y.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new y.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new y.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new y.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new y.EventEmitter),this._instantiationService=new u.InstantiationService,this.optionsService=this.register(new R.OptionsService(H)),this._instantiationService.setService(p.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(w.BufferService)),this._instantiationService.setService(p.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(v.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(S.CoreMouseService)),this._instantiationService.setService(p.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(g.UnicodeService)),this._instantiationService.setService(p.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(b.CharsetService),this._instantiationService.setService(p.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(T.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,y.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,y.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,y.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,y.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,y.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,w.MINIMUM_COLS),U=Math.max(U,w.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()}))}}}o.CoreTerminal=M},8460:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.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)}},o.forwardEvent=function(c,h){return c((p=>h.fire(p)))},o.runAndSubscribe=function(c,h){return h(void 0),c((p=>h(p)))}},5435:function(f,o,c){var h=this&&this.__decorate||function(ne,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(ne,z,j,N);else for(var ae=ne.length-1;ae>=0;ae--)($=ne[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(ne,z){return function(j,N){z(j,N,ne)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const u=c(2584),v=c(7116),w=c(2015),R=c(844),E=c(482),y=c(8437),S=c(8460),g=c(643),b=c(511),A=c(3734),L=c(2585),D=c(1480),T=c(6242),k=c(6351),M=c(5941),B={"(":0,")":1,"*":2,"+":3,"-":1,".":2},H=131072;function U(ne,z){if(ne>24)return z.setWinLines||!1;switch(ne){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(ne){ne[ne.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",ne[ne.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(P||(o.WindowsOptionsReportType=P={}));let Y=0;class X extends R.Disposable{getAttrData(){return this._curAttrData}constructor(z,j,N,$,I,se,ae,he,W=new w.EscapeSequenceParser){super(),this._bufferService=z,this._charsetService=j,this._coreService=N,this._logService=$,this._optionsService=I,this._oscLinkService=se,this._coreMouseService=ae,this._unicodeService=he,this._parser=W,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new E.StringToUtf32,this._utf8Decoder=new E.Utf8ToUtf32,this._workCell=new b.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=y.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=y.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new S.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new S.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new S.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new S.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new S.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new S.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new S.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new S.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new S.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new S.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new S.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new S.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new S.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new V(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((q=>this._activeBuffer=q.activeBuffer))),this._parser.setCsiHandlerFallback(((q,ie)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(q),params:ie.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,ie,ee)=>{this._logService.debug("Unknown OSC code: ",{identifier:q,action:ie,data:ee})})),this._parser.setDcsHandlerFallback(((q,ie,ee)=>{ie==="HOOK"&&(ee=ee.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(q),action:ie,payload:ee})})),this._parser.setPrintHandler(((q,ie,ee)=>this.print(q,ie,ee))),this._parser.registerCsiHandler({final:"@"},(q=>this.insertChars(q))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(q=>this.scrollLeft(q))),this._parser.registerCsiHandler({final:"A"},(q=>this.cursorUp(q))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(q=>this.scrollRight(q))),this._parser.registerCsiHandler({final:"B"},(q=>this.cursorDown(q))),this._parser.registerCsiHandler({final:"C"},(q=>this.cursorForward(q))),this._parser.registerCsiHandler({final:"D"},(q=>this.cursorBackward(q))),this._parser.registerCsiHandler({final:"E"},(q=>this.cursorNextLine(q))),this._parser.registerCsiHandler({final:"F"},(q=>this.cursorPrecedingLine(q))),this._parser.registerCsiHandler({final:"G"},(q=>this.cursorCharAbsolute(q))),this._parser.registerCsiHandler({final:"H"},(q=>this.cursorPosition(q))),this._parser.registerCsiHandler({final:"I"},(q=>this.cursorForwardTab(q))),this._parser.registerCsiHandler({final:"J"},(q=>this.eraseInDisplay(q,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(q=>this.eraseInDisplay(q,!0))),this._parser.registerCsiHandler({final:"K"},(q=>this.eraseInLine(q,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(q=>this.eraseInLine(q,!0))),this._parser.registerCsiHandler({final:"L"},(q=>this.insertLines(q))),this._parser.registerCsiHandler({final:"M"},(q=>this.deleteLines(q))),this._parser.registerCsiHandler({final:"P"},(q=>this.deleteChars(q))),this._parser.registerCsiHandler({final:"S"},(q=>this.scrollUp(q))),this._parser.registerCsiHandler({final:"T"},(q=>this.scrollDown(q))),this._parser.registerCsiHandler({final:"X"},(q=>this.eraseChars(q))),this._parser.registerCsiHandler({final:"Z"},(q=>this.cursorBackwardTab(q))),this._parser.registerCsiHandler({final:"`"},(q=>this.charPosAbsolute(q))),this._parser.registerCsiHandler({final:"a"},(q=>this.hPositionRelative(q))),this._parser.registerCsiHandler({final:"b"},(q=>this.repeatPrecedingCharacter(q))),this._parser.registerCsiHandler({final:"c"},(q=>this.sendDeviceAttributesPrimary(q))),this._parser.registerCsiHandler({prefix:">",final:"c"},(q=>this.sendDeviceAttributesSecondary(q))),this._parser.registerCsiHandler({final:"d"},(q=>this.linePosAbsolute(q))),this._parser.registerCsiHandler({final:"e"},(q=>this.vPositionRelative(q))),this._parser.registerCsiHandler({final:"f"},(q=>this.hVPosition(q))),this._parser.registerCsiHandler({final:"g"},(q=>this.tabClear(q))),this._parser.registerCsiHandler({final:"h"},(q=>this.setMode(q))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(q=>this.setModePrivate(q))),this._parser.registerCsiHandler({final:"l"},(q=>this.resetMode(q))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(q=>this.resetModePrivate(q))),this._parser.registerCsiHandler({final:"m"},(q=>this.charAttributes(q))),this._parser.registerCsiHandler({final:"n"},(q=>this.deviceStatus(q))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(q=>this.deviceStatusPrivate(q))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(q=>this.softReset(q))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(q=>this.setCursorStyle(q))),this._parser.registerCsiHandler({final:"r"},(q=>this.setScrollRegion(q))),this._parser.registerCsiHandler({final:"s"},(q=>this.saveCursor(q))),this._parser.registerCsiHandler({final:"t"},(q=>this.windowOptions(q))),this._parser.registerCsiHandler({final:"u"},(q=>this.restoreCursor(q))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(q=>this.insertColumns(q))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(q=>this.deleteColumns(q))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(q=>this.selectProtected(q))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(q=>this.requestMode(q,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(q=>this.requestMode(q,!1))),this._parser.setExecuteHandler(u.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(u.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(u.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(u.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(u.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(u.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(u.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(u.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(u.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(u.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(u.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(u.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new T.OscHandler((q=>(this.setTitle(q),this.setIconName(q),!0)))),this._parser.registerOscHandler(1,new T.OscHandler((q=>this.setIconName(q)))),this._parser.registerOscHandler(2,new T.OscHandler((q=>this.setTitle(q)))),this._parser.registerOscHandler(4,new T.OscHandler((q=>this.setOrReportIndexedColor(q)))),this._parser.registerOscHandler(8,new T.OscHandler((q=>this.setHyperlink(q)))),this._parser.registerOscHandler(10,new T.OscHandler((q=>this.setOrReportFgColor(q)))),this._parser.registerOscHandler(11,new T.OscHandler((q=>this.setOrReportBgColor(q)))),this._parser.registerOscHandler(12,new T.OscHandler((q=>this.setOrReportCursorColor(q)))),this._parser.registerOscHandler(104,new T.OscHandler((q=>this.restoreIndexedColor(q)))),this._parser.registerOscHandler(110,new T.OscHandler((q=>this.restoreFgColor(q)))),this._parser.registerOscHandler(111,new T.OscHandler((q=>this.restoreBgColor(q)))),this._parser.registerOscHandler(112,new T.OscHandler((q=>this.restoreCursorColor(q)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const q in v.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,ie)=>this.requestStatusString(q,ie))))}_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 ie=q+H<z.length?q+H:z.length,ee=typeof z=="string"?this._stringDecoder.decode(z.substring(q,ie),this._parseBuffer):this._utf8Decoder.decode(z.subarray(q,ie),this._parseBuffer);if(N=this._parser.parse(this._parseBuffer,ee))return this._preserveStack($,I,ee,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 he=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),W=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);W<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(W,this._bufferService.rows-1),Math.min(he,this._bufferService.rows-1))}print(z,j,N){let $,I;const se=this._charsetService.charset,ae=this._optionsService.rawOptions.screenReaderMode,he=this._bufferService.cols,W=this._coreService.decPrivateModes.wraparound,q=this._coreService.modes.insertMode,ie=this._curAttrData;let ee=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&N-j>0&&ee.getWidth(this._activeBuffer.x-1)===2&&ee.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ie);let le=this._parser.precedingJoinState;for(let ve=j;ve<N;++ve){if($=z[ve],$<127&&se){const ct=se[String.fromCharCode($)];ct&&($=ct.charCodeAt(0))}const De=this._unicodeService.charProperties($,le);I=D.UnicodeService.extractWidth(De);const Ne=D.UnicodeService.extractShouldJoin(De),Be=Ne?D.UnicodeService.extractWidth(le):0;if(le=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-Be>he){if(W){const ct=ee;let ke=this._activeBuffer.x-Be;for(this._activeBuffer.x=Be,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),ee=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Be>0&&ee instanceof y.BufferLine&&ee.copyCellsFrom(ct,ke,0,Be,!1);ke<he;)ct.setCellFromCodepoint(ke++,0,1,ie)}else if(this._activeBuffer.x=he-1,I===2)continue}if(Ne&&this._activeBuffer.x){const ct=ee.getWidth(this._activeBuffer.x-1)?1:2;ee.addCodepointToCell(this._activeBuffer.x-ct,$,I);for(let ke=I-Be;--ke>=0;)ee.setCellFromCodepoint(this._activeBuffer.x++,0,0,ie)}else if(q&&(ee.insertCells(this._activeBuffer.x,I-Be,this._activeBuffer.getNullCell(ie)),ee.getWidth(he-1)===2&&ee.setCellFromCodepoint(he-1,g.NULL_CELL_CODE,g.NULL_CELL_WIDTH,ie)),ee.setCellFromCodepoint(this._activeBuffer.x++,$,I,ie),I>0)for(;--I;)ee.setCellFromCodepoint(this._activeBuffer.x++,0,0,ie)}this._parser.precedingJoinState=le,this._activeBuffer.x<he&&N-j>0&&ee.getWidth(this._activeBuffer.x)===0&&!ee.hasContent(this._activeBuffer.x)&&ee.setCellFromCodepoint(this._activeBuffer.x,0,1,ie),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 T.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(y.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 he=0;for(let q=0;q<se.length;){const ie=se.codePointAt(q)||0;ae[he++]=ie,q+=ie>65535?2:1}let W=he;for(let q=1;q<N;++q)ae.copyWithin(W,0,he),W+=he;return this.print(ae,0,W),!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,v.DEFAULT_CHARSET),this._charsetService.setgCharset(1,v.DEFAULT_CHARSET),this._charsetService.setgCharset(2,v.DEFAULT_CHARSET),this._charsetService.setgCharset(3,v.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:he}=this._bufferService,{active:W,alt:q}=ae,ie=this._optionsService.rawOptions,ee=Ne=>Ne?1:2,le=z.params[0];return ve=le,De=j?le===2?4:le===4?ee(se.modes.insertMode):le===12?3:le===20?ee(ie.convertEol):0:le===1?ee(N.applicationCursorKeys):le===3?ie.windowOptions.setWinLines?he===80?2:he===132?1:0:0:le===6?ee(N.origin):le===7?ee(N.wraparound):le===8?3:le===9?ee($==="X10"):le===12?ee(ie.cursorBlink):le===25?ee(!se.isCursorHidden):le===45?ee(N.reverseWraparound):le===66?ee(N.applicationKeypad):le===67?4:le===1e3?ee($==="VT200"):le===1002?ee($==="DRAG"):le===1003?ee($==="ANY"):le===1004?ee(N.sendFocus):le===1005?4:le===1006?ee(I==="SGR"):le===1015?4:le===1016?ee(I==="SGR_PIXELS"):le===1048?1:le===47||le===1047||le===1049?ee(W===q):le===2004?ee(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 he=0;do $[1]===5&&(I=1),$[se+he+1+I]=ae[he];while(++he<ae.length&&he+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=y.DEFAULT_ATTR_DATA.fg,z.bg=y.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&y.DEFAULT_ATTR_DATA.fg):N===49?($.bg&=-67108864,$.bg|=16777215&y.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&y.DEFAULT_ATTR_DATA.fg,$.bg&=-67108864,$.bg|=16777215&y.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=y.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(K(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[$]);K(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,v.DEFAULT_CHARSET),!0}selectCharset(z){return z.length!==2?(this.selectDefaultCharset(),!0):(z[0]==="/"||this._charsetService.setgCharset(B[z[0]],v.CHARSETS[z[1]]||v.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=y.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=y.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 b.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)}}o.InputHandler=X;let V=class{constructor(ne){this._bufferService=ne,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(ne){ne<this.start?this.start=ne:ne>this.end&&(this.end=ne)}markRangeDirty(ne,z){ne>z&&(Y=ne,ne=z,z=Y),ne<this.start&&(this.start=ne),z>this.end&&(this.end=z)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function K(ne){return 0<=ne&&ne<256}V=h([p(0,L.IBufferService)],V)},844:(f,o)=>{function c(h){for(const p of h)p.dispose();h.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.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)}},o.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}},o.toDisposable=function(h){return{dispose:h}},o.disposeArray=c,o.getDisposeArrayDisposable=function(h){return{dispose:()=>c(h)}}},1505:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(p,u,v){this._data[p]||(this._data[p]={}),this._data[p][u]=v}get(p,u){return this._data[p]?this._data[p][u]:void 0}clear(){this._data={}}}o.TwoKeyMap=c,o.FourKeyMap=class{constructor(){this._data=new c}set(h,p,u,v,w){this._data.get(h,p)||this._data.set(h,p,new c),this._data.get(h,p).set(u,v,w)}get(h,p,u,v){var w;return(w=this._data.get(h,p))==null?void 0:w.get(u,v)}clear(){this._data.clear()}}},6114:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof process<"u"&&"title"in process;const c=o.isNode?"node":navigator.userAgent,h=o.isNode?"node":navigator.platform;o.isFirefox=c.includes("Firefox"),o.isLegacyEdge=c.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(c),o.getSafariVersion=function(){if(!o.isSafari)return 0;const p=c.match(/Version\/(\d+)/);return p===null||p.length<2?0:parseInt(p[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(h),o.isIpad=h==="iPad",o.isIphone=h==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(h),o.isLinux=h.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(c)},6106:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SortedList=void 0;let c=0;o.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 v=p+u>>1;const w=this._getKey(this._array[v]);if(w>h)u=v-1;else{if(!(w<h)){for(;v>0&&this._getKey(this._array[v-1])===h;)v--;return v}p=v+1}}return p}}},7226:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const h=c(6114);class p{constructor(){this._tasks=[],this._i=0}enqueue(w){this._tasks.push(w),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(w){this._idleCallback=void 0;let R=0,E=0,y=w.timeRemaining(),S=0;for(;this._i<this._tasks.length;){if(R=Date.now(),this._tasks[this._i]()||this._i++,R=Math.max(1,Date.now()-R),E=Math.max(R,E),S=w.timeRemaining(),1.5*E>S)return y-R<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(y-R))}ms`),void this._start();y=S}this.clear()}}class u extends p{_requestCallback(w){return setTimeout((()=>w(this._createDeadline(16))))}_cancelCallback(w){clearTimeout(w)}_createDeadline(w){const R=Date.now()+w;return{timeRemaining:()=>Math.max(0,R-Date.now())}}}o.PriorityTaskQueue=u,o.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends p{_requestCallback(v){return requestIdleCallback(v)}_cancelCallback(v){cancelIdleCallback(v)}}:u,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(v){this._queue.clear(),this._queue.enqueue(v)}flush(){this._queue.flush()}}},9282:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.updateWindowsModeWrappedState=void 0;const h=c(643);o.updateWindowsModeWrappedState=function(p){const u=p.buffer.lines.get(p.buffer.ybase+p.buffer.y-1),v=u==null?void 0:u.get(p.cols-1),w=p.buffer.lines.get(p.buffer.ybase+p.buffer.y);w&&v&&(w.isWrapped=v[h.CHAR_DATA_CODE_INDEX]!==h.NULL_CELL_CODE&&v[h.CHAR_DATA_CODE_INDEX]!==h.WHITESPACE_CELL_CODE)}},3734:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.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}}o.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,v=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=v}clone(){return new h(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=h},9092:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const h=c(6349),p=c(7226),u=c(3734),v=c(8437),w=c(4634),R=c(511),E=c(643),y=c(4863),S=c(7116);o.MAX_BUFFER_SIZE=4294967295,o.Buffer=class{constructor(g,b,A){this._hasScrollback=g,this._optionsService=b,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=v.DEFAULT_ATTR_DATA.clone(),this.savedCharset=S.DEFAULT_CHARSET,this.markers=[],this._nullCell=R.CellData.fromCharData([0,E.NULL_CELL_CHAR,E.NULL_CELL_WIDTH,E.NULL_CELL_CODE]),this._whitespaceCell=R.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(g){return g?(this._nullCell.fg=g.fg,this._nullCell.bg=g.bg,this._nullCell.extended=g.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new u.ExtendedAttrs),this._nullCell}getWhitespaceCell(g){return g?(this._whitespaceCell.fg=g.fg,this._whitespaceCell.bg=g.bg,this._whitespaceCell.extended=g.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new u.ExtendedAttrs),this._whitespaceCell}getBlankLine(g,b){return new v.BufferLine(this._bufferService.cols,this.getNullCell(g),b)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const g=this.ybase+this.y-this.ydisp;return g>=0&&g<this._rows}_getCorrectBufferLength(g){if(!this._hasScrollback)return g;const b=g+this._optionsService.rawOptions.scrollback;return b>o.MAX_BUFFER_SIZE?o.MAX_BUFFER_SIZE:b}fillViewportRows(g){if(this.lines.length===0){g===void 0&&(g=v.DEFAULT_ATTR_DATA);let b=this._rows;for(;b--;)this.lines.push(this.getBlankLine(g))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(g,b){const A=this.getNullCell(v.DEFAULT_ATTR_DATA);let L=0;const D=this._getCorrectBufferLength(b);if(D>this.lines.maxLength&&(this.lines.maxLength=D),this.lines.length>0){if(this._cols<g)for(let k=0;k<this.lines.length;k++)L+=+this.lines.get(k).resize(g,A);let T=0;if(this._rows<b)for(let k=this._rows;k<b;k++)this.lines.length<b+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new v.BufferLine(g,A)):this.ybase>0&&this.lines.length<=this.ybase+this.y+T+1?(this.ybase--,T++,this.ydisp>0&&this.ydisp--):this.lines.push(new v.BufferLine(g,A)));else for(let k=this._rows;k>b;k--)this.lines.length>b+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,g-1),this.y=Math.min(this.y,b-1),T&&(this.y+=T),this.savedX=Math.min(this.savedX,g-1),this.scrollTop=0}if(this.scrollBottom=b-1,this._isReflowEnabled&&(this._reflow(g,b),this._cols>g))for(let T=0;T<this.lines.length;T++)L+=+this.lines.get(T).resize(g,A);this._cols=g,this._rows=b,this._memoryCleanupQueue.clear(),L>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let g=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,g=!1);let b=0;for(;this._memoryCleanupPosition<this.lines.length;)if(b+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),b>100)return!0;return g}get _isReflowEnabled(){const g=this._optionsService.rawOptions.windowsPty;return g&&g.buildNumber?this._hasScrollback&&g.backend==="conpty"&&g.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(g,b){this._cols!==g&&(g>this._cols?this._reflowLarger(g,b):this._reflowSmaller(g,b))}_reflowLarger(g,b){const A=(0,w.reflowLargerGetLinesToRemove)(this.lines,this._cols,g,this.ybase+this.y,this.getNullCell(v.DEFAULT_ATTR_DATA));if(A.length>0){const L=(0,w.reflowLargerCreateNewLayout)(this.lines,A);(0,w.reflowLargerApplyNewLayout)(this.lines,L.layout),this._reflowLargerAdjustViewport(g,b,L.countRemoved)}}_reflowLargerAdjustViewport(g,b,A){const L=this.getNullCell(v.DEFAULT_ATTR_DATA);let D=A;for(;D-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<b&&this.lines.push(new v.BufferLine(g,L))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-A,0)}_reflowSmaller(g,b){const A=this.getNullCell(v.DEFAULT_ATTR_DATA),L=[];let D=0;for(let T=this.lines.length-1;T>=0;T--){let k=this.lines.get(T);if(!k||!k.isWrapped&&k.getTrimmedLength()<=g)continue;const M=[k];for(;k.isWrapped&&T>0;)k=this.lines.get(--T),M.unshift(k);const B=this.ybase+this.y;if(B>=T&&B<T+M.length)continue;const H=M[M.length-1].getTrimmedLength(),U=(0,w.reflowSmallerGetNewLineLengths)(M,this._cols,g),P=U.length-M.length;let Y;Y=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(v.DEFAULT_ATTR_DATA,!0);X.push($)}X.length>0&&(L.push({start:T+M.length+D,newLines:X}),D+=X.length),M.push(...X);let V=U.length-1,K=U[V];K===0&&(V--,K=U[V]);let ne=M.length-P-1,z=H;for(;ne>=0;){const N=Math.min(z,K);if(M[V]===void 0)break;if(M[V].copyCellsFrom(M[ne],z-N,K-N,N,!0),K-=N,K===0&&(V--,K=U[V]),z-=N,z===0){ne--;const $=Math.max(ne,0);z=(0,w.getWrappedLineTrimmedLength)(M,$,this._cols)}}for(let N=0;N<M.length;N++)U[N]<g&&M[N].setCell(U[N],A);let j=P-Y;for(;j-- >0;)this.ybase===0?this.y<b-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+D)-b&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+P,this.ybase+b-1)}if(L.length>0){const T=[],k=[];for(let V=0;V<this.lines.length;V++)k.push(this.lines.get(V));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 V=Math.min(this.lines.maxLength-1,M+D-1);V>=0;V--)if(U&&U.start>B+P){for(let K=U.newLines.length-1;K>=0;K--)this.lines.set(V--,U.newLines[K]);V++,T.push({index:B+1,amount:U.newLines.length}),P+=U.newLines.length,U=L[++H]}else this.lines.set(V,k[B--]);let Y=0;for(let V=T.length-1;V>=0;V--)T[V].index+=Y,this.lines.onInsertEmitter.fire(T[V]),Y+=T[V].amount;const X=Math.max(0,M+D-this.lines.maxLength);X>0&&this.lines.onTrimEmitter.fire(X)}}translateBufferLineToString(g,b,A=0,L){const D=this.lines.get(g);return D?D.translateToString(b,A,L):""}getWrappedRangeForLine(g){let b=g,A=g;for(;b>0&&this.lines.get(b).isWrapped;)b--;for(;A+1<this.lines.length&&this.lines.get(A+1).isWrapped;)A++;return{first:b,last:A}}setupTabStops(g){for(g!=null?this.tabs[g]||(g=this.prevStop(g)):(this.tabs={},g=0);g<this._cols;g+=this._optionsService.rawOptions.tabStopWidth)this.tabs[g]=!0}prevStop(g){for(g==null&&(g=this.x);!this.tabs[--g]&&g>0;);return g>=this._cols?this._cols-1:g<0?0:g}nextStop(g){for(g==null&&(g=this.x);!this.tabs[++g]&&g<this._cols;);return g>=this._cols?this._cols-1:g<0?0:g}clearMarkers(g){this._isClearing=!0;for(let b=0;b<this.markers.length;b++)this.markers[b].line===g&&(this.markers[b].dispose(),this.markers.splice(b--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let g=0;g<this.markers.length;g++)this.markers[g].dispose(),this.markers.splice(g--,1);this._isClearing=!1}addMarker(g){const b=new y.Marker(g);return this.markers.push(b),b.register(this.lines.onTrim((A=>{b.line-=A,b.line<0&&b.dispose()}))),b.register(this.lines.onInsert((A=>{b.line>=A.index&&(b.line+=A.amount)}))),b.register(this.lines.onDelete((A=>{b.line>=A.index&&b.line<A.index+A.amount&&b.dispose(),b.line>A.index&&(b.line-=A.amount)}))),b.register(b.onDispose((()=>this._removeMarker(b)))),b}_removeMarker(g){this._isClearing||this.markers.splice(this.markers.indexOf(g),1)}}},8437:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const h=c(3734),p=c(511),u=c(643),v=c(482);o.DEFAULT_ATTR_DATA=Object.freeze(new h.AttributeData);let w=0;class R{constructor(y,S,g=!1){this.isWrapped=g,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*y);const b=S||p.CellData.fromCharData([0,u.NULL_CELL_CHAR,u.NULL_CELL_WIDTH,u.NULL_CELL_CODE]);for(let A=0;A<y;++A)this.setCell(A,b);this.length=y}get(y){const S=this._data[3*y+0],g=2097151&S;return[this._data[3*y+1],2097152&S?this._combined[y]:g?(0,v.stringFromCodePoint)(g):"",S>>22,2097152&S?this._combined[y].charCodeAt(this._combined[y].length-1):g]}set(y,S){this._data[3*y+1]=S[u.CHAR_DATA_ATTR_INDEX],S[u.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[y]=S[1],this._data[3*y+0]=2097152|y|S[u.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*y+0]=S[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|S[u.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(y){return this._data[3*y+0]>>22}hasWidth(y){return 12582912&this._data[3*y+0]}getFg(y){return this._data[3*y+1]}getBg(y){return this._data[3*y+2]}hasContent(y){return 4194303&this._data[3*y+0]}getCodePoint(y){const S=this._data[3*y+0];return 2097152&S?this._combined[y].charCodeAt(this._combined[y].length-1):2097151&S}isCombined(y){return 2097152&this._data[3*y+0]}getString(y){const S=this._data[3*y+0];return 2097152&S?this._combined[y]:2097151&S?(0,v.stringFromCodePoint)(2097151&S):""}isProtected(y){return 536870912&this._data[3*y+2]}loadCell(y,S){return w=3*y,S.content=this._data[w+0],S.fg=this._data[w+1],S.bg=this._data[w+2],2097152&S.content&&(S.combinedData=this._combined[y]),268435456&S.bg&&(S.extended=this._extendedAttrs[y]),S}setCell(y,S){2097152&S.content&&(this._combined[y]=S.combinedData),268435456&S.bg&&(this._extendedAttrs[y]=S.extended),this._data[3*y+0]=S.content,this._data[3*y+1]=S.fg,this._data[3*y+2]=S.bg}setCellFromCodepoint(y,S,g,b){268435456&b.bg&&(this._extendedAttrs[y]=b.extended),this._data[3*y+0]=S|g<<22,this._data[3*y+1]=b.fg,this._data[3*y+2]=b.bg}addCodepointToCell(y,S,g){let b=this._data[3*y+0];2097152&b?this._combined[y]+=(0,v.stringFromCodePoint)(S):2097151&b?(this._combined[y]=(0,v.stringFromCodePoint)(2097151&b)+(0,v.stringFromCodePoint)(S),b&=-2097152,b|=2097152):b=S|4194304,g&&(b&=-12582913,b|=g<<22),this._data[3*y+0]=b}insertCells(y,S,g){if((y%=this.length)&&this.getWidth(y-1)===2&&this.setCellFromCodepoint(y-1,0,1,g),S<this.length-y){const b=new p.CellData;for(let A=this.length-y-S-1;A>=0;--A)this.setCell(y+S+A,this.loadCell(y+A,b));for(let A=0;A<S;++A)this.setCell(y+A,g)}else for(let b=y;b<this.length;++b)this.setCell(b,g);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,g)}deleteCells(y,S,g){if(y%=this.length,S<this.length-y){const b=new p.CellData;for(let A=0;A<this.length-y-S;++A)this.setCell(y+A,this.loadCell(y+S+A,b));for(let A=this.length-S;A<this.length;++A)this.setCell(A,g)}else for(let b=y;b<this.length;++b)this.setCell(b,g);y&&this.getWidth(y-1)===2&&this.setCellFromCodepoint(y-1,0,1,g),this.getWidth(y)!==0||this.hasContent(y)||this.setCellFromCodepoint(y,0,1,g)}replaceCells(y,S,g,b=!1){if(b)for(y&&this.getWidth(y-1)===2&&!this.isProtected(y-1)&&this.setCellFromCodepoint(y-1,0,1,g),S<this.length&&this.getWidth(S-1)===2&&!this.isProtected(S)&&this.setCellFromCodepoint(S,0,1,g);y<S&&y<this.length;)this.isProtected(y)||this.setCell(y,g),y++;else for(y&&this.getWidth(y-1)===2&&this.setCellFromCodepoint(y-1,0,1,g),S<this.length&&this.getWidth(S-1)===2&&this.setCellFromCodepoint(S,0,1,g);y<S&&y<this.length;)this.setCell(y++,g)}resize(y,S){if(y===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const g=3*y;if(y>this.length){if(this._data.buffer.byteLength>=4*g)this._data=new Uint32Array(this._data.buffer,0,g);else{const b=new Uint32Array(g);b.set(this._data),this._data=b}for(let b=this.length;b<y;++b)this.setCell(b,S)}else{this._data=this._data.subarray(0,g);const b=Object.keys(this._combined);for(let L=0;L<b.length;L++){const D=parseInt(b[L],10);D>=y&&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>=y&&delete this._extendedAttrs[D]}}return this.length=y,4*g*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const y=new Uint32Array(this._data.length);return y.set(this._data),this._data=y,1}return 0}fill(y,S=!1){if(S)for(let g=0;g<this.length;++g)this.isProtected(g)||this.setCell(g,y);else{this._combined={},this._extendedAttrs={};for(let g=0;g<this.length;++g)this.setCell(g,y)}}copyFrom(y){this.length!==y.length?this._data=new Uint32Array(y._data):this._data.set(y._data),this.length=y.length,this._combined={};for(const S in y._combined)this._combined[S]=y._combined[S];this._extendedAttrs={};for(const S in y._extendedAttrs)this._extendedAttrs[S]=y._extendedAttrs[S];this.isWrapped=y.isWrapped}clone(){const y=new R(0);y._data=new Uint32Array(this._data),y.length=this.length;for(const S in this._combined)y._combined[S]=this._combined[S];for(const S in this._extendedAttrs)y._extendedAttrs[S]=this._extendedAttrs[S];return y.isWrapped=this.isWrapped,y}getTrimmedLength(){for(let y=this.length-1;y>=0;--y)if(4194303&this._data[3*y+0])return y+(this._data[3*y+0]>>22);return 0}getNoBgTrimmedLength(){for(let y=this.length-1;y>=0;--y)if(4194303&this._data[3*y+0]||50331648&this._data[3*y+2])return y+(this._data[3*y+0]>>22);return 0}copyCellsFrom(y,S,g,b,A){const L=y._data;if(A)for(let T=b-1;T>=0;T--){for(let k=0;k<3;k++)this._data[3*(g+T)+k]=L[3*(S+T)+k];268435456&L[3*(S+T)+2]&&(this._extendedAttrs[g+T]=y._extendedAttrs[S+T])}else for(let T=0;T<b;T++){for(let k=0;k<3;k++)this._data[3*(g+T)+k]=L[3*(S+T)+k];268435456&L[3*(S+T)+2]&&(this._extendedAttrs[g+T]=y._extendedAttrs[S+T])}const D=Object.keys(y._combined);for(let T=0;T<D.length;T++){const k=parseInt(D[T],10);k>=S&&(this._combined[k-S+g]=y._combined[k])}}translateToString(y,S,g,b){S=S??0,g=g??this.length,y&&(g=Math.min(g,this.getTrimmedLength())),b&&(b.length=0);let A="";for(;S<g;){const L=this._data[3*S+0],D=2097151&L,T=2097152&L?this._combined[S]:D?(0,v.stringFromCodePoint)(D):u.WHITESPACE_CELL_CHAR;if(A+=T,b)for(let k=0;k<T.length;++k)b.push(S);S+=L>>22||1}return b&&b.push(S),A}}o.BufferLine=R},4841:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getRangeLength=void 0,o.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,o)=>{function c(h,p,u){if(p===h.length-1)return h[p].getTrimmedLength();const v=!h[p].hasContent(u-1)&&h[p].getWidth(u-1)===1,w=h[p+1].getWidth(0)===2;return v&&w?u-1:u}Object.defineProperty(o,"__esModule",{value:!0}),o.getWrappedLineTrimmedLength=o.reflowSmallerGetNewLineLengths=o.reflowLargerApplyNewLayout=o.reflowLargerCreateNewLayout=o.reflowLargerGetLinesToRemove=void 0,o.reflowLargerGetLinesToRemove=function(h,p,u,v,w){const R=[];for(let E=0;E<h.length-1;E++){let y=E,S=h.get(++y);if(!S.isWrapped)continue;const g=[h.get(E)];for(;y<h.length&&S.isWrapped;)g.push(S),S=h.get(++y);if(v>=E&&v<y){E+=g.length-1;continue}let b=0,A=c(g,b,p),L=1,D=0;for(;L<g.length;){const k=c(g,L,p),M=k-D,B=u-A,H=Math.min(M,B);g[b].copyCellsFrom(g[L],D,A,H,!1),A+=H,A===u&&(b++,A=0),D+=H,D===k&&(L++,D=0),A===0&&b!==0&&g[b-1].getWidth(u-1)===2&&(g[b].copyCellsFrom(g[b-1],u-1,A++,1,!1),g[b-1].setCell(u-1,w))}g[b].replaceCells(A,u,w);let T=0;for(let k=g.length-1;k>0&&(k>b||g[k].getTrimmedLength()===0);k--)T++;T>0&&(R.push(E+g.length-T),R.push(T)),E+=g.length-1}return R},o.reflowLargerCreateNewLayout=function(h,p){const u=[];let v=0,w=p[v],R=0;for(let E=0;E<h.length;E++)if(w===E){const y=p[++v];h.onDeleteEmitter.fire({index:E-R,amount:y}),E+=y-1,R+=y,w=p[++v]}else u.push(E);return{layout:u,countRemoved:R}},o.reflowLargerApplyNewLayout=function(h,p){const u=[];for(let v=0;v<p.length;v++)u.push(h.get(p[v]));for(let v=0;v<u.length;v++)h.set(v,u[v]);h.length=p.length},o.reflowSmallerGetNewLineLengths=function(h,p,u){const v=[],w=h.map(((S,g)=>c(h,g,p))).reduce(((S,g)=>S+g));let R=0,E=0,y=0;for(;y<w;){if(w-y<u){v.push(w-y);break}R+=u;const S=c(h,E,p);R>S&&(R-=S,E++);const g=h[E].getWidth(R-1)===2;g&&R--;const b=g?u-1:u;v.push(b),y+=b}return v},o.getWrappedLineTrimmedLength=c},5295:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const h=c(8460),p=c(844),u=c(9092);class v extends p.Disposable{constructor(R,E){super(),this._optionsService=R,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(R){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(R),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(R,E){this._normal.resize(R,E),this._alt.resize(R,E),this.setupTabStops(R)}setupTabStops(R){this._normal.setupTabStops(R),this._alt.setupTabStops(R)}}o.BufferSet=v},511:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const h=c(482),p=c(643),u=c(3734);class v extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(R){const E=new v;return E.setFromCharData(R),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(R){this.fg=R[p.CHAR_DATA_ATTR_INDEX],this.bg=0;let E=!1;if(R[p.CHAR_DATA_CHAR_INDEX].length>2)E=!0;else if(R[p.CHAR_DATA_CHAR_INDEX].length===2){const y=R[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=y&&y<=56319){const S=R[p.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=S&&S<=57343?this.content=1024*(y-55296)+S-56320+65536|R[p.CHAR_DATA_WIDTH_INDEX]<<22:E=!0}else E=!0}else this.content=R[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|R[p.CHAR_DATA_WIDTH_INDEX]<<22;E&&(this.combinedData=R[p.CHAR_DATA_CHAR_INDEX],this.content=2097152|R[p.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=v},643:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},4863:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Marker=void 0;const h=c(8460),p=c(844);class u{get id(){return this._id}constructor(w){this.line=w,this.isDisposed=!1,this._disposables=[],this._id=u._nextId++,this._onDispose=this.register(new h.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,p.disposeArray)(this._disposables),this._disposables.length=0)}register(w){return this._disposables.push(w),w}}o.Marker=u,u._nextId=1},7116:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DEFAULT_CHARSET=o.CHARSETS=void 0,o.CHARSETS={},o.DEFAULT_CHARSET=o.CHARSETS.B,o.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:"≥","{":"π","|":"≠","}":"£","~":"·"},o.CHARSETS.A={"#":"£"},o.CHARSETS.B=void 0,o.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},o.CHARSETS.C=o.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},o.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},o.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},o.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},o.CHARSETS.E=o.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},o.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},o.CHARSETS.H=o.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(f,o)=>{var c,h,p;Object.defineProperty(o,"__esModule",{value:!0}),o.C1_ESCAPED=o.C1=o.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||(o.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||(o.C1=h={})),(function(u){u.ST=`${c.ESC}\\`})(p||(o.C1_ESCAPED=p={}))},7399:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.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:["'",'"']};o.evaluateKeyboardEvent=function(u,v,w,R){const E={type:0,cancel:!1,key:void 0},y=(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=v?h.C0.ESC+"OA":h.C0.ESC+"[A":u.key==="UIKeyInputLeftArrow"?E.key=v?h.C0.ESC+"OD":h.C0.ESC+"[D":u.key==="UIKeyInputRightArrow"?E.key=v?h.C0.ESC+"OC":h.C0.ESC+"[C":u.key==="UIKeyInputDownArrow"&&(E.key=v?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;y?(E.key=h.C0.ESC+"[1;"+(y+1)+"D",E.key===h.C0.ESC+"[1;3D"&&(E.key=h.C0.ESC+(w?"b":"[1;5D"))):E.key=v?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(u.metaKey)break;y?(E.key=h.C0.ESC+"[1;"+(y+1)+"C",E.key===h.C0.ESC+"[1;3C"&&(E.key=h.C0.ESC+(w?"f":"[1;5C"))):E.key=v?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(u.metaKey)break;y?(E.key=h.C0.ESC+"[1;"+(y+1)+"A",w||E.key!==h.C0.ESC+"[1;3A"||(E.key=h.C0.ESC+"[1;5A")):E.key=v?h.C0.ESC+"OA":h.C0.ESC+"[A";break;case 40:if(u.metaKey)break;y?(E.key=h.C0.ESC+"[1;"+(y+1)+"B",w||E.key!==h.C0.ESC+"[1;3B"||(E.key=h.C0.ESC+"[1;5B")):E.key=v?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=y?h.C0.ESC+"[3;"+(y+1)+"~":h.C0.ESC+"[3~";break;case 36:E.key=y?h.C0.ESC+"[1;"+(y+1)+"H":v?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:E.key=y?h.C0.ESC+"[1;"+(y+1)+"F":v?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:u.shiftKey?E.type=2:u.ctrlKey?E.key=h.C0.ESC+"[5;"+(y+1)+"~":E.key=h.C0.ESC+"[5~";break;case 34:u.shiftKey?E.type=3:u.ctrlKey?E.key=h.C0.ESC+"[6;"+(y+1)+"~":E.key=h.C0.ESC+"[6~";break;case 112:E.key=y?h.C0.ESC+"[1;"+(y+1)+"P":h.C0.ESC+"OP";break;case 113:E.key=y?h.C0.ESC+"[1;"+(y+1)+"Q":h.C0.ESC+"OQ";break;case 114:E.key=y?h.C0.ESC+"[1;"+(y+1)+"R":h.C0.ESC+"OR";break;case 115:E.key=y?h.C0.ESC+"[1;"+(y+1)+"S":h.C0.ESC+"OS";break;case 116:E.key=y?h.C0.ESC+"[15;"+(y+1)+"~":h.C0.ESC+"[15~";break;case 117:E.key=y?h.C0.ESC+"[17;"+(y+1)+"~":h.C0.ESC+"[17~";break;case 118:E.key=y?h.C0.ESC+"[18;"+(y+1)+"~":h.C0.ESC+"[18~";break;case 119:E.key=y?h.C0.ESC+"[19;"+(y+1)+"~":h.C0.ESC+"[19~";break;case 120:E.key=y?h.C0.ESC+"[20;"+(y+1)+"~":h.C0.ESC+"[20~";break;case 121:E.key=y?h.C0.ESC+"[21;"+(y+1)+"~":h.C0.ESC+"[21~";break;case 122:E.key=y?h.C0.ESC+"[23;"+(y+1)+"~":h.C0.ESC+"[23~";break;case 123:E.key=y?h.C0.ESC+"[24;"+(y+1)+"~":h.C0.ESC+"[24~";break;default:if(!u.ctrlKey||u.shiftKey||u.altKey||u.metaKey)if(w&&!R||!u.altKey||u.metaKey)!w||u.altKey||u.ctrlKey||u.shiftKey||!u.metaKey?u.key&&!u.ctrlKey&&!u.altKey&&!u.metaKey&&u.keyCode>=48&&u.key.length===1?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 S=p[u.keyCode],g=S==null?void 0:S[u.shiftKey?1:0];if(g)E.key=h.C0.ESC+g;else if(u.keyCode>=65&&u.keyCode<=90){const b=u.ctrlKey?u.keyCode-64:u.keyCode+32;let A=String.fromCharCode(b);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 b=u.code.slice(3,4);u.shiftKey||(b=b.toLowerCase()),E.key=h.C0.ESC+b,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,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},o.utf32ToString=function(c,h=0,p=c.length){let u="";for(let v=h;v<p;++v){let w=c[v];w>65535?(w-=65536,u+=String.fromCharCode(55296+(w>>10))+String.fromCharCode(w%1024+56320)):u+=String.fromCharCode(w)}return u},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,h){const p=c.length;if(!p)return 0;let u=0,v=0;if(this._interim){const w=c.charCodeAt(v++);56320<=w&&w<=57343?h[u++]=1024*(this._interim-55296)+w-56320+65536:(h[u++]=this._interim,h[u++]=w),this._interim=0}for(let w=v;w<p;++w){const R=c.charCodeAt(w);if(55296<=R&&R<=56319){if(++w>=p)return this._interim=R,u;const E=c.charCodeAt(w);56320<=E&&E<=57343?h[u++]=1024*(R-55296)+E-56320+65536:(h[u++]=R,h[u++]=E)}else R!==65279&&(h[u++]=R)}return u}},o.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,v,w,R,E=0,y=0,S=0;if(this.interim[0]){let A=!1,L=this.interim[0];L&=(224&L)==192?31:(240&L)==224?15:7;let D,T=0;for(;(D=63&this.interim[++T])&&T<4;)L<<=6,L|=D;const k=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,M=k-T;for(;S<M;){if(S>=p)return 0;if(D=c[S++],(192&D)!=128){S--,A=!0;break}this.interim[T++]=D,L<<=6,L|=63&D}A||(k===2?L<128?S--: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 g=p-4;let b=S;for(;b<p;){for(;!(!(b<g)||128&(u=c[b])||128&(v=c[b+1])||128&(w=c[b+2])||128&(R=c[b+3]));)h[E++]=u,h[E++]=v,h[E++]=w,h[E++]=R,b+=4;if(u=c[b++],u<128)h[E++]=u;else if((224&u)==192){if(b>=p)return this.interim[0]=u,E;if(v=c[b++],(192&v)!=128){b--;continue}if(y=(31&u)<<6|63&v,y<128){b--;continue}h[E++]=y}else if((240&u)==224){if(b>=p)return this.interim[0]=u,E;if(v=c[b++],(192&v)!=128){b--;continue}if(b>=p)return this.interim[0]=u,this.interim[1]=v,E;if(w=c[b++],(192&w)!=128){b--;continue}if(y=(15&u)<<12|(63&v)<<6|63&w,y<2048||y>=55296&&y<=57343||y===65279)continue;h[E++]=y}else if((248&u)==240){if(b>=p)return this.interim[0]=u,E;if(v=c[b++],(192&v)!=128){b--;continue}if(b>=p)return this.interim[0]=u,this.interim[1]=v,E;if(w=c[b++],(192&w)!=128){b--;continue}if(b>=p)return this.interim[0]=u,this.interim[1]=v,this.interim[2]=w,E;if(R=c[b++],(192&R)!=128){b--;continue}if(y=(7&u)<<18|(63&v)<<12|(63&w)<<6|63&R,y<65536||y>1114111)continue;h[E++]=y}}return E}}},225:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.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 v;o.UnicodeV6=class{constructor(){if(this.version="6",!v){v=new Uint8Array(65536),v.fill(1),v[0]=0,v.fill(0,1,32),v.fill(0,127,160),v.fill(2,4352,4448),v[9001]=2,v[9002]=2,v.fill(2,11904,42192),v[12351]=1,v.fill(2,44032,55204),v.fill(2,63744,64256),v.fill(2,65040,65050),v.fill(2,65072,65136),v.fill(2,65280,65377),v.fill(2,65504,65511);for(let w=0;w<p.length;++w)v.fill(0,p[w][0],p[w][1]+1)}}wcwidth(w){return w<32?0:w<127?1:w<65536?v[w]:(function(R,E){let y,S=0,g=E.length-1;if(R<E[0][0]||R>E[g][1])return!1;for(;g>=S;)if(y=S+g>>1,R>E[y][1])S=y+1;else{if(!(R<E[y][0]))return!0;g=y-1}return!1})(w,u)?0:w>=131072&&w<=196605||w>=196608&&w<=262141?2:1}charProperties(w,R){let E=this.wcwidth(w),y=E===0&&R!==0;if(y){const S=h.UnicodeService.extractWidth(R);S===0?y=!1:S>E&&(E=S)}return h.UnicodeService.createPropertyValue(0,E,y)}}},5981:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const h=c(8460),p=c(844);class u extends p.Disposable{constructor(w){super(),this._action=w,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new h.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(w,R){if(R!==void 0&&this._syncCalls>R)return void(this._syncCalls=0);if(this._pendingData+=w.length,this._writeBuffer.push(w),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let E;for(this._isSyncWriting=!0;E=this._writeBuffer.shift();){this._action(E);const y=this._callbacks.shift();y&&y()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(w,R){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=w.length,this._writeBuffer.push(w),this._callbacks.push(R),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=w.length,this._writeBuffer.push(w),this._callbacks.push(R)}_innerWrite(w=0,R=!0){const E=w||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const y=this._writeBuffer[this._bufferOffset],S=this._action(y,R);if(S){const b=A=>Date.now()-E>=12?setTimeout((()=>this._innerWrite(0,A))):this._innerWrite(E,A);return void S.catch((A=>(queueMicrotask((()=>{throw A})),Promise.resolve(!1)))).then(b)}const g=this._callbacks[this._bufferOffset];if(g&&g(),this._bufferOffset++,this._pendingData-=y.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()}}o.WriteBuffer=u},5941:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.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,v){const w=u.toString(16),R=w.length<2?"0"+w:w;switch(v){case 4:return w[0];case 8:return R;case 12:return(R+R).slice(0,3);default:return R+R}}o.parseColor=function(u){if(!u)return;let v=u.toLowerCase();if(v.indexOf("rgb:")===0){v=v.slice(4);const w=c.exec(v);if(w){const R=w[1]?15:w[4]?255:w[7]?4095:65535;return[Math.round(parseInt(w[1]||w[4]||w[7]||w[10],16)/R*255),Math.round(parseInt(w[2]||w[5]||w[8]||w[11],16)/R*255),Math.round(parseInt(w[3]||w[6]||w[9]||w[12],16)/R*255)]}}else if(v.indexOf("#")===0&&(v=v.slice(1),h.exec(v)&&[3,6,9,12].includes(v.length))){const w=v.length/3,R=[0,0,0];for(let E=0;E<3;++E){const y=parseInt(v.slice(w*E,w*E+w),16);R[E]=w===1?y<<4:w===2?y:w===3?y>>4:y>>8}return R}},o.toRgbString=function(u,v=16){const[w,R,E]=u;return`rgb:${p(w,v)}/${p(R,v)}/${p(E,v)}`}},5770:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const h=c(482),p=c(8742),u=c(5770),v=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=v,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=v}registerHandler(R,E){this._handlers[R]===void 0&&(this._handlers[R]=[]);const y=this._handlers[R];return y.push(E),{dispose:()=>{const S=y.indexOf(E);S!==-1&&y.splice(S,1)}}}clearHandler(R){this._handlers[R]&&delete this._handlers[R]}setHandlerFallback(R){this._handlerFb=R}reset(){if(this._active.length)for(let R=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;R>=0;--R)this._active[R].unhook(!1);this._stack.paused=!1,this._active=v,this._ident=0}hook(R,E){if(this.reset(),this._ident=R,this._active=this._handlers[R]||v,this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].hook(E);else this._handlerFb(this._ident,"HOOK",E)}put(R,E,y){if(this._active.length)for(let S=this._active.length-1;S>=0;S--)this._active[S].put(R,E,y);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(R,E,y))}unhook(R,E=!0){if(this._active.length){let y=!1,S=this._active.length-1,g=!1;if(this._stack.paused&&(S=this._stack.loopPosition-1,y=E,g=this._stack.fallThrough,this._stack.paused=!1),!g&&y===!1){for(;S>=0&&(y=this._active[S].unhook(R),y!==!0);S--)if(y instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!1,y;S--}for(;S>=0;S--)if(y=this._active[S].unhook(!1),y instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=S,this._stack.fallThrough=!0,y}else this._handlerFb(this._ident,"UNHOOK",R);this._active=v,this._ident=0}};const w=new p.Params;w.addParam(0),o.DcsHandler=class{constructor(R){this._handler=R,this._data="",this._params=w,this._hitLimit=!1}hook(R){this._params=R.length>1||R.params[0]?R.clone():w,this._data="",this._hitLimit=!1}put(R,E,y){this._hitLimit||(this._data+=(0,h.utf32ToString)(R,E,y),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(R){let E=!1;if(this._hitLimit)E=!1;else if(R&&(E=this._handler(this._data,this._params),E instanceof Promise))return E.then((y=>(this._params=w,this._data="",this._hitLimit=!1,y)));return this._params=w,this._data="",this._hitLimit=!1,E}}},2015:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const h=c(844),p=c(8742),u=c(6242),v=c(6351);class w{constructor(S){this.table=new Uint8Array(S)}setDefault(S,g){this.table.fill(S<<4|g)}add(S,g,b,A){this.table[g<<8|S]=b<<4|A}addMany(S,g,b,A){for(let L=0;L<S.length;L++)this.table[g<<8|S[L]]=b<<4|A}}o.TransitionTable=w;const R=160;o.VT500_TRANSITION_TABLE=(function(){const y=new w(4095),S=Array.apply(null,Array(256)).map(((T,k)=>k)),g=(T,k)=>S.slice(T,k),b=g(32,127),A=g(0,24);A.push(25),A.push.apply(A,g(28,32));const L=g(0,14);let D;for(D in y.setDefault(1,0),y.addMany(b,0,2,0),L)y.addMany([24,26,153,154],D,3,0),y.addMany(g(128,144),D,3,0),y.addMany(g(144,152),D,3,0),y.add(156,D,0,0),y.add(27,D,11,1),y.add(157,D,4,8),y.addMany([152,158,159],D,0,7),y.add(155,D,11,3),y.add(144,D,11,9);return y.addMany(A,0,3,0),y.addMany(A,1,3,1),y.add(127,1,0,1),y.addMany(A,8,0,8),y.addMany(A,3,3,3),y.add(127,3,0,3),y.addMany(A,4,3,4),y.add(127,4,0,4),y.addMany(A,6,3,6),y.addMany(A,5,3,5),y.add(127,5,0,5),y.addMany(A,2,3,2),y.add(127,2,0,2),y.add(93,1,4,8),y.addMany(b,8,5,8),y.add(127,8,5,8),y.addMany([156,27,24,26,7],8,6,0),y.addMany(g(28,32),8,0,8),y.addMany([88,94,95],1,0,7),y.addMany(b,7,0,7),y.addMany(A,7,0,7),y.add(156,7,0,0),y.add(127,7,0,7),y.add(91,1,11,3),y.addMany(g(64,127),3,7,0),y.addMany(g(48,60),3,8,4),y.addMany([60,61,62,63],3,9,4),y.addMany(g(48,60),4,8,4),y.addMany(g(64,127),4,7,0),y.addMany([60,61,62,63],4,0,6),y.addMany(g(32,64),6,0,6),y.add(127,6,0,6),y.addMany(g(64,127),6,0,0),y.addMany(g(32,48),3,9,5),y.addMany(g(32,48),5,9,5),y.addMany(g(48,64),5,0,6),y.addMany(g(64,127),5,7,0),y.addMany(g(32,48),4,9,5),y.addMany(g(32,48),1,9,2),y.addMany(g(32,48),2,9,2),y.addMany(g(48,127),2,10,0),y.addMany(g(48,80),1,10,0),y.addMany(g(81,88),1,10,0),y.addMany([89,90,92],1,10,0),y.addMany(g(96,127),1,10,0),y.add(80,1,11,9),y.addMany(A,9,0,9),y.add(127,9,0,9),y.addMany(g(28,32),9,0,9),y.addMany(g(32,48),9,9,12),y.addMany(g(48,60),9,8,10),y.addMany([60,61,62,63],9,9,10),y.addMany(A,11,0,11),y.addMany(g(32,128),11,0,11),y.addMany(g(28,32),11,0,11),y.addMany(A,10,0,10),y.add(127,10,0,10),y.addMany(g(28,32),10,0,10),y.addMany(g(48,60),10,8,10),y.addMany([60,61,62,63],10,0,11),y.addMany(g(32,48),10,9,12),y.addMany(A,12,0,12),y.add(127,12,0,12),y.addMany(g(28,32),12,0,12),y.addMany(g(32,48),12,9,12),y.addMany(g(48,64),12,0,11),y.addMany(g(64,127),12,12,13),y.addMany(g(64,127),10,12,13),y.addMany(g(64,127),9,12,13),y.addMany(A,13,13,13),y.addMany(b,13,13,13),y.add(127,13,0,13),y.addMany([27,156,24,26],13,14,0),y.add(R,0,2,0),y.add(R,8,5,8),y.add(R,6,0,6),y.add(R,11,0,11),y.add(R,13,13,13),y})();class E extends h.Disposable{constructor(S=o.VT500_TRANSITION_TABLE){super(),this._transitions=S,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new p.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(g,b,A)=>{},this._executeHandlerFb=g=>{},this._csiHandlerFb=(g,b)=>{},this._escHandlerFb=g=>{},this._errorHandlerFb=g=>g,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,h.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new u.OscParser),this._dcsParser=this.register(new v.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(S,g=[64,126]){let b=0;if(S.prefix){if(S.prefix.length>1)throw new Error("only one byte as prefix supported");if(b=S.prefix.charCodeAt(0),b&&60>b||b>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(S.intermediates){if(S.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let L=0;L<S.intermediates.length;++L){const D=S.intermediates.charCodeAt(L);if(32>D||D>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");b<<=8,b|=D}}if(S.final.length!==1)throw new Error("final must be a single byte");const A=S.final.charCodeAt(0);if(g[0]>A||A>g[1])throw new Error(`final must be in range ${g[0]} .. ${g[1]}`);return b<<=8,b|=A,b}identToString(S){const g=[];for(;S;)g.push(String.fromCharCode(255&S)),S>>=8;return g.reverse().join("")}setPrintHandler(S){this._printHandler=S}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(S,g){const b=this._identifier(S,[48,126]);this._escHandlers[b]===void 0&&(this._escHandlers[b]=[]);const A=this._escHandlers[b];return A.push(g),{dispose:()=>{const L=A.indexOf(g);L!==-1&&A.splice(L,1)}}}clearEscHandler(S){this._escHandlers[this._identifier(S,[48,126])]&&delete this._escHandlers[this._identifier(S,[48,126])]}setEscHandlerFallback(S){this._escHandlerFb=S}setExecuteHandler(S,g){this._executeHandlers[S.charCodeAt(0)]=g}clearExecuteHandler(S){this._executeHandlers[S.charCodeAt(0)]&&delete this._executeHandlers[S.charCodeAt(0)]}setExecuteHandlerFallback(S){this._executeHandlerFb=S}registerCsiHandler(S,g){const b=this._identifier(S);this._csiHandlers[b]===void 0&&(this._csiHandlers[b]=[]);const A=this._csiHandlers[b];return A.push(g),{dispose:()=>{const L=A.indexOf(g);L!==-1&&A.splice(L,1)}}}clearCsiHandler(S){this._csiHandlers[this._identifier(S)]&&delete this._csiHandlers[this._identifier(S)]}setCsiHandlerFallback(S){this._csiHandlerFb=S}registerDcsHandler(S,g){return this._dcsParser.registerHandler(this._identifier(S),g)}clearDcsHandler(S){this._dcsParser.clearHandler(this._identifier(S))}setDcsHandlerFallback(S){this._dcsParser.setHandlerFallback(S)}registerOscHandler(S,g){return this._oscParser.registerHandler(S,g)}clearOscHandler(S){this._oscParser.clearHandler(S)}setOscHandlerFallback(S){this._oscParser.setHandlerFallback(S)}setErrorHandler(S){this._errorHandler=S}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(S,g,b,A,L){this._parseStack.state=S,this._parseStack.handlers=g,this._parseStack.handlerPos=b,this._parseStack.transition=A,this._parseStack.chunkPos=L}parse(S,g,b){let A,L=0,D=0,T=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,T=this._parseStack.chunkPos+1;else{if(b===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(b===!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(b===!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=S[this._parseStack.chunkPos],A=this._dcsParser.unhook(L!==24&&L!==26,b),A)return A;L===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(L=S[this._parseStack.chunkPos],A=this._oscParser.end(L!==24&&L!==26,b),A)return A;L===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,T=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let k=T;k<g;++k){switch(L=S[k],D=this._transitions.table[this.currentState<<8|(L<160?L:R)],D>>4){case 2:for(let P=k+1;;++P){if(P>=g||(L=S[P])<32||L>126&&L<R){this._printHandler(S,k,P),k=P-1;break}if(++P>=g||(L=S[P])<32||L>126&&L<R){this._printHandler(S,k,P),k=P-1;break}if(++P>=g||(L=S[P])<32||L>126&&L<R){this._printHandler(S,k,P),k=P-1;break}if(++P>=g||(L=S[P])<32||L>126&&L<R){this._printHandler(S,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<g&&(L=S[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>=g||(L=S[P])===24||L===26||L===27||L>127&&L<R){this._dcsParser.put(S,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>=g||(L=S[P])<32||L>127&&L<R){this._oscParser.put(S,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}}}o.EscapeSequenceParser=E},6242:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const h=c(5770),p=c(482),u=[];o.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(v,w){this._handlers[v]===void 0&&(this._handlers[v]=[]);const R=this._handlers[v];return R.push(w),{dispose:()=>{const E=R.indexOf(w);E!==-1&&R.splice(E,1)}}}clearHandler(v){this._handlers[v]&&delete this._handlers[v]}setHandlerFallback(v){this._handlerFb=v}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=u}reset(){if(this._state===2)for(let v=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;v>=0;--v)this._active[v].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 v=this._active.length-1;v>=0;v--)this._active[v].start();else this._handlerFb(this._id,"START")}_put(v,w,R){if(this._active.length)for(let E=this._active.length-1;E>=0;E--)this._active[E].put(v,w,R);else this._handlerFb(this._id,"PUT",(0,p.utf32ToString)(v,w,R))}start(){this.reset(),this._state=1}put(v,w,R){if(this._state!==3){if(this._state===1)for(;w<R;){const E=v[w++];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&&R-w>0&&this._put(v,w,R)}}end(v,w=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let R=!1,E=this._active.length-1,y=!1;if(this._stack.paused&&(E=this._stack.loopPosition-1,R=w,y=this._stack.fallThrough,this._stack.paused=!1),!y&&R===!1){for(;E>=0&&(R=this._active[E].end(v),R!==!0);E--)if(R instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=E,this._stack.fallThrough=!1,R;E--}for(;E>=0;E--)if(R=this._active[E].end(!1),R instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=E,this._stack.fallThrough=!0,R}else this._handlerFb(this._id,"END",v);this._active=u,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(v){this._handler=v,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(v,w,R){this._hitLimit||(this._data+=(0,p.utf32ToString)(v,w,R),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(v){let w=!1;if(this._hitLimit)w=!1;else if(v&&(w=this._handler(this._data),w instanceof Promise))return w.then((R=>(this._data="",this._hitLimit=!1,R)));return this._data="",this._hitLimit=!1,w}}},8742:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const c=2147483647;class h{static fromArray(u){const v=new h;if(!u.length)return v;for(let w=Array.isArray(u[0])?1:0;w<u.length;++w){const R=u[w];if(Array.isArray(R))for(let E=0;E<R.length;++E)v.addSubParam(R[E]);else v.addParam(R)}return v}constructor(u=32,v=32){if(this.maxLength=u,this.maxSubParamsLength=v,v>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(u),this.length=0,this._subParams=new Int32Array(v),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 v=0;v<this.length;++v){u.push(this.params[v]);const w=this._subParamsIdx[v]>>8,R=255&this._subParamsIdx[v];R-w>0&&u.push(Array.prototype.slice.call(this._subParams,w,R))}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 v=this._subParamsIdx[u]>>8,w=255&this._subParamsIdx[u];return w-v>0?this._subParams.subarray(v,w):null}getSubParamsAll(){const u={};for(let v=0;v<this.length;++v){const w=this._subParamsIdx[v]>>8,R=255&this._subParamsIdx[v];R-w>0&&(u[v]=this._subParams.slice(w,R))}return u}addDigit(u){let v;if(this._rejectDigits||!(v=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const w=this._digitIsSub?this._subParams:this.params,R=w[v-1];w[v-1]=~R?Math.min(10*R+u,c):u}}o.Params=h},5741:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.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,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const h=c(3785),p=c(511);o.BufferApiView=class{constructor(u,v){this._buffer=u,this.type=v}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 v=this._buffer.lines.get(u);if(v)return new h.BufferLineApiView(v)}getNullCell(){return new p.CellData}}},3785:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const h=c(511);o.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,v){return this._line.translateToString(p,u,v)}}},8285:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const h=c(8771),p=c(8460),u=c(844);class v extends u.Disposable{constructor(R){super(),this._core=R,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)}}o.BufferNamespaceApi=v},7975:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.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,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.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,o,c){var h=this&&this.__decorate||function(y,S,g,b){var A,L=arguments.length,D=L<3?S:b===null?b=Object.getOwnPropertyDescriptor(S,g):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(y,S,g,b);else for(var T=y.length-1;T>=0;T--)(A=y[T])&&(D=(L<3?A(D):L>3?A(S,g,D):A(S,g))||D);return L>3&&D&&Object.defineProperty(S,g,D),D},p=this&&this.__param||function(y,S){return function(g,b){S(g,b,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const u=c(8460),v=c(844),w=c(5295),R=c(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let E=o.BufferService=class extends v.Disposable{get buffer(){return this.buffers.active}constructor(y){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(y.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(y.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new w.BufferSet(y,this))}resize(y,S){this.cols=y,this.rows=S,this.buffers.resize(y,S),this._onResize.fire({cols:y,rows:S})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(y,S=!1){const g=this.buffer;let b;b=this._cachedBlankLine,b&&b.length===this.cols&&b.getFg(0)===y.fg&&b.getBg(0)===y.bg||(b=g.getBlankLine(y,S),this._cachedBlankLine=b),b.isWrapped=S;const A=g.ybase+g.scrollTop,L=g.ybase+g.scrollBottom;if(g.scrollTop===0){const D=g.lines.isFull;L===g.lines.length-1?D?g.lines.recycle().copyFrom(b):g.lines.push(b.clone()):g.lines.splice(L+1,0,b.clone()),D?this.isUserScrolling&&(g.ydisp=Math.max(g.ydisp-1,0)):(g.ybase++,this.isUserScrolling||g.ydisp++)}else{const D=L-A+1;g.lines.shiftElements(A+1,D-1,-1),g.lines.set(L,b.clone())}this.isUserScrolling||(g.ydisp=g.ybase),this._onScroll.fire(g.ydisp)}scrollLines(y,S,g){const b=this.buffer;if(y<0){if(b.ydisp===0)return;this.isUserScrolling=!0}else y+b.ydisp>=b.ybase&&(this.isUserScrolling=!1);const A=b.ydisp;b.ydisp=Math.max(Math.min(b.ydisp+y,b.ybase),0),A!==b.ydisp&&(S||this._onScroll.fire(b.ydisp))}};o.BufferService=E=h([p(0,R.IOptionsService)],E)},7994:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.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,o,c){var h=this&&this.__decorate||function(b,A,L,D){var T,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(b,A,L,D);else for(var B=b.length-1;B>=0;B--)(T=b[B])&&(M=(k<3?T(M):k>3?T(A,L,M):T(A,L))||M);return k>3&&M&&Object.defineProperty(A,L,M),M},p=this&&this.__param||function(b,A){return function(L,D){A(L,D,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const u=c(2585),v=c(8460),w=c(844),R={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:b=>b.button!==4&&b.action===1&&(b.ctrl=!1,b.alt=!1,b.shift=!1,!0)},VT200:{events:19,restrict:b=>b.action!==32},DRAG:{events:23,restrict:b=>b.action!==32||b.button!==3},ANY:{events:31,restrict:b=>!0}};function E(b,A){let L=(b.ctrl?16:0)|(b.shift?4:0)|(b.alt?8:0);return b.button===4?(L|=64,L|=b.action):(L|=3&b.button,4&b.button&&(L|=64),8&b.button&&(L|=128),b.action===32?L|=32:b.action!==0||A||(L|=3)),L}const y=String.fromCharCode,S={DEFAULT:b=>{const A=[E(b,!1)+32,b.col+32,b.row+32];return A[0]>255||A[1]>255||A[2]>255?"":`\x1B[M${y(A[0])}${y(A[1])}${y(A[2])}`},SGR:b=>{const A=b.action===0&&b.button!==4?"m":"M";return`\x1B[<${E(b,!0)};${b.col};${b.row}${A}`},SGR_PIXELS:b=>{const A=b.action===0&&b.button!==4?"m":"M";return`\x1B[<${E(b,!0)};${b.x};${b.y}${A}`}};let g=o.CoreMouseService=class extends w.Disposable{constructor(b,A){super(),this._bufferService=b,this._coreService=A,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new v.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const L of Object.keys(R))this.addProtocol(L,R[L]);for(const L of Object.keys(S))this.addEncoding(L,S[L]);this.reset()}addProtocol(b,A){this._protocols[b]=A}addEncoding(b,A){this._encodings[b]=A}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(b){if(!this._protocols[b])throw new Error(`unknown protocol "${b}"`);this._activeProtocol=b,this._onProtocolChange.fire(this._protocols[b].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(b){if(!this._encodings[b])throw new Error(`unknown encoding "${b}"`);this._activeEncoding=b}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(b){if(b.col<0||b.col>=this._bufferService.cols||b.row<0||b.row>=this._bufferService.rows||b.button===4&&b.action===32||b.button===3&&b.action!==32||b.button!==4&&(b.action===2||b.action===3)||(b.col++,b.row++,b.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,b,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(b))return!1;const A=this._encodings[this._activeEncoding](b);return A&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(A):this._coreService.triggerDataEvent(A,!0)),this._lastEvent=b,!0}explainEvents(b){return{down:!!(1&b),up:!!(2&b),drag:!!(4&b),move:!!(8&b),wheel:!!(16&b)}}_equalEvents(b,A,L){if(L){if(b.x!==A.x||b.y!==A.y)return!1}else if(b.col!==A.col||b.row!==A.row)return!1;return b.button===A.button&&b.action===A.action&&b.ctrl===A.ctrl&&b.alt===A.alt&&b.shift===A.shift}};o.CoreMouseService=g=h([p(0,u.IBufferService),p(1,u.ICoreService)],g)},6975:function(f,o,c){var h=this&&this.__decorate||function(g,b,A,L){var D,T=arguments.length,k=T<3?b:L===null?L=Object.getOwnPropertyDescriptor(b,A):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(g,b,A,L);else for(var M=g.length-1;M>=0;M--)(D=g[M])&&(k=(T<3?D(k):T>3?D(b,A,k):D(b,A))||k);return T>3&&k&&Object.defineProperty(b,A,k),k},p=this&&this.__param||function(g,b){return function(A,L){b(A,L,g)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const u=c(1439),v=c(8460),w=c(844),R=c(2585),E=Object.freeze({insertMode:!1}),y=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let S=o.CoreService=class extends w.Disposable{constructor(g,b,A){super(),this._bufferService=g,this._logService=b,this._optionsService=A,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new v.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new v.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new v.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new v.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,u.clone)(E),this.decPrivateModes=(0,u.clone)(y)}reset(){this.modes=(0,u.clone)(E),this.decPrivateModes=(0,u.clone)(y)}triggerDataEvent(g,b=!1){if(this._optionsService.rawOptions.disableStdin)return;const A=this._bufferService.buffer;b&&this._optionsService.rawOptions.scrollOnUserInput&&A.ybase!==A.ydisp&&this._onRequestScrollToBottom.fire(),b&&this._onUserInput.fire(),this._logService.debug(`sending data "${g}"`,(()=>g.split("").map((L=>L.charCodeAt(0))))),this._onData.fire(g)}triggerBinaryEvent(g){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${g}"`,(()=>g.split("").map((b=>b.charCodeAt(0))))),this._onBinary.fire(g))}};o.CoreService=S=h([p(0,R.IBufferService),p(1,R.ILogService),p(2,R.IOptionsService)],S)},9074:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const h=c(8055),p=c(8460),u=c(844),v=c(6106);let w=0,R=0;class E extends u.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new v.SortedList((g=>g==null?void 0:g.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(g){if(g.marker.isDisposed)return;const b=new y(g);if(b){const A=b.marker.onDispose((()=>b.dispose()));b.onDispose((()=>{b&&(this._decorations.delete(b)&&this._onDecorationRemoved.fire(b),A.dispose())})),this._decorations.insert(b),this._onDecorationRegistered.fire(b)}return b}reset(){for(const g of this._decorations.values())g.dispose();this._decorations.clear()}*getDecorationsAtCell(g,b,A){let L=0,D=0;for(const T of this._decorations.getKeyIterator(b))L=T.options.x??0,D=L+(T.options.width??1),g>=L&&g<D&&(!A||(T.options.layer??"bottom")===A)&&(yield T)}forEachDecorationAtCell(g,b,A,L){this._decorations.forEachByKey(b,(D=>{w=D.options.x??0,R=w+(D.options.width??1),g>=w&&g<R&&(!A||(D.options.layer??"bottom")===A)&&L(D)}))}}o.DecorationService=E;class y extends u.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=h.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=h.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(g){super(),this.options=g,this.onRenderEmitter=this.register(new 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=g.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const h=c(2585),p=c(8343);class u{constructor(...w){this._entries=new Map;for(const[R,E]of w)this.set(R,E)}set(w,R){const E=this._entries.get(w);return this._entries.set(w,R),E}forEach(w){for(const[R,E]of this._entries.entries())w(R,E)}has(w){return this._entries.has(w)}get(w){return this._entries.get(w)}}o.ServiceCollection=u,o.InstantiationService=class{constructor(){this._services=new u,this._services.set(h.IInstantiationService,this)}setService(v,w){this._services.set(v,w)}getService(v){return this._services.get(v)}createInstance(v,...w){const R=(0,p.getServiceDependencies)(v).sort(((S,g)=>S.index-g.index)),E=[];for(const S of R){const g=this._services.get(S.id);if(!g)throw new Error(`[createInstance] ${v.name} depends on UNKNOWN service ${S.id}.`);E.push(g)}const y=R.length>0?R[0].index:w.length;if(w.length!==y)throw new Error(`[createInstance] First service dependency of ${v.name} at position ${y+1} conflicts with ${w.length} static arguments`);return new v(...w,...E)}}},7866:function(f,o,c){var h=this&&this.__decorate||function(y,S,g,b){var A,L=arguments.length,D=L<3?S:b===null?b=Object.getOwnPropertyDescriptor(S,g):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(y,S,g,b);else for(var T=y.length-1;T>=0;T--)(A=y[T])&&(D=(L<3?A(D):L>3?A(S,g,D):A(S,g))||D);return L>3&&D&&Object.defineProperty(S,g,D),D},p=this&&this.__param||function(y,S){return function(g,b){S(g,b,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const u=c(844),v=c(2585),w={trace:v.LogLevelEnum.TRACE,debug:v.LogLevelEnum.DEBUG,info:v.LogLevelEnum.INFO,warn:v.LogLevelEnum.WARN,error:v.LogLevelEnum.ERROR,off:v.LogLevelEnum.OFF};let R,E=o.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(y){super(),this._optionsService=y,this._logLevel=v.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),R=this}_updateLogLevel(){this._logLevel=w[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(y){for(let S=0;S<y.length;S++)typeof y[S]=="function"&&(y[S]=y[S]())}_log(y,S,g){this._evalLazyOptionalParams(g),y.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+S,...g)}trace(y,...S){var g;this._logLevel<=v.LogLevelEnum.TRACE&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.trace.bind(this._optionsService.options.logger))??console.log,y,S)}debug(y,...S){var g;this._logLevel<=v.LogLevelEnum.DEBUG&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.debug.bind(this._optionsService.options.logger))??console.log,y,S)}info(y,...S){var g;this._logLevel<=v.LogLevelEnum.INFO&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.info.bind(this._optionsService.options.logger))??console.info,y,S)}warn(y,...S){var g;this._logLevel<=v.LogLevelEnum.WARN&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.warn.bind(this._optionsService.options.logger))??console.warn,y,S)}error(y,...S){var g;this._logLevel<=v.LogLevelEnum.ERROR&&this._log(((g=this._optionsService.options.logger)==null?void 0:g.error.bind(this._optionsService.options.logger))??console.error,y,S)}};o.LogService=E=h([p(0,v.IOptionsService)],E),o.setTraceLogger=function(y){R=y},o.traceCall=function(y,S,g){if(typeof g.value!="function")throw new Error("not supported");const b=g.value;g.value=function(...A){if(R.logLevel!==v.LogLevelEnum.TRACE)return b.apply(this,A);R.trace(`GlyphRenderer#${b.name}(${A.map((D=>JSON.stringify(D))).join(", ")})`);const L=b.apply(this,A);return R.trace(`GlyphRenderer#${b.name} return`,L),L}}},7302:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const h=c(8460),p=c(844),u=c(6114);o.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 v=["normal","bold","100","200","300","400","500","600","700","800","900"];class w extends p.Disposable{constructor(E){super(),this._onOptionChange=this.register(new h.EventEmitter),this.onOptionChange=this._onOptionChange.event;const y={...o.DEFAULT_OPTIONS};for(const S in E)if(S in y)try{const g=E[S];y[S]=this._sanitizeAndValidateOption(S,g)}catch(g){console.error(g)}this.rawOptions=y,this.options={...y},this._setupOptions(),this.register((0,p.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(E,y){return this.onOptionChange((S=>{S===E&&y(this.rawOptions[E])}))}onMultipleOptionChange(E,y){return this.onOptionChange((S=>{E.indexOf(S)!==-1&&y()}))}_setupOptions(){const E=S=>{if(!(S in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${S}"`);return this.rawOptions[S]},y=(S,g)=>{if(!(S in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${S}"`);g=this._sanitizeAndValidateOption(S,g),this.rawOptions[S]!==g&&(this.rawOptions[S]=g,this._onOptionChange.fire(S))};for(const S in this.rawOptions){const g={get:E.bind(this,S),set:y.bind(this,S)};Object.defineProperty(this.options,S,g)}}_sanitizeAndValidateOption(E,y){switch(E){case"cursorStyle":if(y||(y=o.DEFAULT_OPTIONS[E]),!(function(S){return S==="block"||S==="underline"||S==="bar"})(y))throw new Error(`"${y}" is not a valid value for ${E}`);break;case"wordSeparator":y||(y=o.DEFAULT_OPTIONS[E]);break;case"fontWeight":case"fontWeightBold":if(typeof y=="number"&&1<=y&&y<=1e3)break;y=v.includes(y)?y:o.DEFAULT_OPTIONS[E];break;case"cursorWidth":y=Math.floor(y);case"lineHeight":case"tabStopWidth":if(y<1)throw new Error(`${E} cannot be less than 1, value: ${y}`);break;case"minimumContrastRatio":y=Math.max(1,Math.min(21,Math.round(10*y)/10));break;case"scrollback":if((y=Math.min(y,4294967295))<0)throw new Error(`${E} cannot be less than 0, value: ${y}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(y<=0)throw new Error(`${E} cannot be less than or equal to 0, value: ${y}`);break;case"rows":case"cols":if(!y&&y!==0)throw new Error(`${E} must be numeric, value: ${y}`);break;case"windowsPty":y=y??{}}return y}}o.OptionsService=w},2660:function(f,o,c){var h=this&&this.__decorate||function(w,R,E,y){var S,g=arguments.length,b=g<3?R:y===null?y=Object.getOwnPropertyDescriptor(R,E):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(w,R,E,y);else for(var A=w.length-1;A>=0;A--)(S=w[A])&&(b=(g<3?S(b):g>3?S(R,E,b):S(R,E))||b);return g>3&&b&&Object.defineProperty(R,E,b),b},p=this&&this.__param||function(w,R){return function(E,y){R(E,y,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const u=c(2585);let v=o.OscLinkService=class{constructor(w){this._bufferService=w,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(w){const R=this._bufferService.buffer;if(w.id===void 0){const A=R.addMarker(R.ybase+R.y),L={data:w,id:this._nextId++,lines:[A]};return A.onDispose((()=>this._removeMarkerFromLink(L,A))),this._dataByLinkId.set(L.id,L),L.id}const E=w,y=this._getEntryIdKey(E),S=this._entriesWithId.get(y);if(S)return this.addLineToLink(S.id,R.ybase+R.y),S.id;const g=R.addMarker(R.ybase+R.y),b={id:this._nextId++,key:this._getEntryIdKey(E),data:E,lines:[g]};return g.onDispose((()=>this._removeMarkerFromLink(b,g))),this._entriesWithId.set(b.key,b),this._dataByLinkId.set(b.id,b),b.id}addLineToLink(w,R){const E=this._dataByLinkId.get(w);if(E&&E.lines.every((y=>y.line!==R))){const y=this._bufferService.buffer.addMarker(R);E.lines.push(y),y.onDispose((()=>this._removeMarkerFromLink(E,y)))}}getLinkData(w){var R;return(R=this._dataByLinkId.get(w))==null?void 0:R.data}_getEntryIdKey(w){return`${w.id};;${w.uri}`}_removeMarkerFromLink(w,R){const E=w.lines.indexOf(R);E!==-1&&(w.lines.splice(E,1),w.lines.length===0&&(w.data.id!==void 0&&this._entriesWithId.delete(w.key),this._dataByLinkId.delete(w.id)))}};o.OscLinkService=v=h([p(0,u.IBufferService)],v)},8343:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const c="di$target",h="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(p){return p[h]||[]},o.createDecorator=function(p){if(o.serviceRegistry.has(p))return o.serviceRegistry.get(p);const u=function(v,w,R){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(E,y,S){y[c]===y?y[h].push({id:E,index:S}):(y[h]=[{id:E,index:S}],y[c]=y)})(u,v,R)};return u.toString=()=>p,o.serviceRegistry.set(p,u),u}},2585:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const h=c(8343);var p;o.IBufferService=(0,h.createDecorator)("BufferService"),o.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),o.ICoreService=(0,h.createDecorator)("CoreService"),o.ICharsetService=(0,h.createDecorator)("CharsetService"),o.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||(o.LogLevelEnum=p={})),o.ILogService=(0,h.createDecorator)("LogService"),o.IOptionsService=(0,h.createDecorator)("OptionsService"),o.IOscLinkService=(0,h.createDecorator)("OscLinkService"),o.IUnicodeService=(0,h.createDecorator)("UnicodeService"),o.IDecorationService=(0,h.createDecorator)("DecorationService")},1480:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const h=c(8460),p=c(225);class u{static extractShouldJoin(w){return(1&w)!=0}static extractWidth(w){return w>>1&3}static extractCharKind(w){return w>>3}static createPropertyValue(w,R,E=!1){return(16777215&w)<<3|(3&R)<<1|(E?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const w=new p.UnicodeV6;this.register(w),this._active=w.version,this._activeProvider=w}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(w){if(!this._providers[w])throw new Error(`unknown Unicode version "${w}"`);this._active=w,this._activeProvider=this._providers[w],this._onChange.fire(w)}register(w){this._providers[w.version]=w}wcwidth(w){return this._activeProvider.wcwidth(w)}getStringCellWidth(w){let R=0,E=0;const y=w.length;for(let S=0;S<y;++S){let g=w.charCodeAt(S);if(55296<=g&&g<=56319){if(++S>=y)return R+this.wcwidth(g);const L=w.charCodeAt(S);56320<=L&&L<=57343?g=1024*(g-55296)+L-56320+65536:R+=this.wcwidth(L)}const b=this.charProperties(g,E);let A=u.extractWidth(b);u.extractShouldJoin(b)&&(A-=u.extractWidth(E)),R+=A,E=b}return R}charProperties(w,R){return this._activeProvider.charProperties(w,R)}}o.UnicodeService=u}},l={};function d(f){var o=l[f];if(o!==void 0)return o.exports;var c=l[f]={exports:{}};return s[f].call(c.exports,c,c.exports,d),c.exports}var _={};return(()=>{var f=_;Object.defineProperty(f,"__esModule",{value:!0}),f.Terminal=void 0;const o=d(9042),c=d(3236),h=d(844),p=d(5741),u=d(8285),v=d(7975),w=d(7090),R=["cols","rows"];class E extends h.Disposable{constructor(S){super(),this._core=this.register(new c.Terminal(S)),this._addonManager=this.register(new p.AddonManager),this._publicOptions={...this._core.options};const g=A=>this._core.options[A],b=(A,L)=>{this._checkReadonlyOptions(A),this._core.options[A]=L};for(const A in this._core.options){const L={get:g.bind(this,A),set:b.bind(this,A)};Object.defineProperty(this._publicOptions,A,L)}}_checkReadonlyOptions(S){if(R.includes(S))throw new Error(`Option "${S}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new v.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new w.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new u.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const S=this._core.coreService.decPrivateModes;let g="none";switch(this._core.coreMouseService.activeProtocol){case"X10":g="x10";break;case"VT200":g="vt200";break;case"DRAG":g="drag";break;case"ANY":g="any"}return{applicationCursorKeysMode:S.applicationCursorKeys,applicationKeypadMode:S.applicationKeypad,bracketedPasteMode:S.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:g,originMode:S.origin,reverseWraparoundMode:S.reverseWraparound,sendFocusMode:S.sendFocus,wraparoundMode:S.wraparound}}get options(){return this._publicOptions}set options(S){for(const g in S)this._publicOptions[g]=S[g]}blur(){this._core.blur()}focus(){this._core.focus()}input(S,g=!0){this._core.input(S,g)}resize(S,g){this._verifyIntegers(S,g),this._core.resize(S,g)}open(S){this._core.open(S)}attachCustomKeyEventHandler(S){this._core.attachCustomKeyEventHandler(S)}attachCustomWheelEventHandler(S){this._core.attachCustomWheelEventHandler(S)}registerLinkProvider(S){return this._core.registerLinkProvider(S)}registerCharacterJoiner(S){return this._checkProposedApi(),this._core.registerCharacterJoiner(S)}deregisterCharacterJoiner(S){this._checkProposedApi(),this._core.deregisterCharacterJoiner(S)}registerMarker(S=0){return this._verifyIntegers(S),this._core.registerMarker(S)}registerDecoration(S){return this._checkProposedApi(),this._verifyPositiveIntegers(S.x??0,S.width??0,S.height??0),this._core.registerDecoration(S)}hasSelection(){return this._core.hasSelection()}select(S,g,b){this._verifyIntegers(S,g,b),this._core.select(S,g,b)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(S,g){this._verifyIntegers(S,g),this._core.selectLines(S,g)}dispose(){super.dispose()}scrollLines(S){this._verifyIntegers(S),this._core.scrollLines(S)}scrollPages(S){this._verifyIntegers(S),this._core.scrollPages(S)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(S){this._verifyIntegers(S),this._core.scrollToLine(S)}clear(){this._core.clear()}write(S,g){this._core.write(S,g)}writeln(S,g){this._core.write(S),this._core.write(`\r
59
- `,g)}paste(S){this._core.paste(S)}refresh(S,g){this._verifyIntegers(S,g),this._core.refresh(S,g)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(S){this._addonManager.loadAddon(this,S)}static get strings(){return o}_verifyIntegers(...S){for(const g of S)if(g===1/0||isNaN(g)||g%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...S){for(const g of S)if(g&&(g===1/0||isNaN(g)||g%1!=0||g<0))throw new Error("This API only accepts positive integers")}}f.Terminal=E})(),_})()))})(Xu)),Xu.exports}var d1=f1();class p1{constructor(r,s){Om(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",_=>{var o,c,h;let f;try{f=JSON.parse(_.data)}catch(p){(o=s.onError)==null||o.call(s,`Terminal message parse failed for session ${r}. Reason: ${No(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 _;(_=s.onError)==null||_.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 Ho({sessionId:n,active:r=!0,onEvent:s}){const l=te.useRef(null),d=te.useRef(null),_=te.useRef(null),f=te.useRef(null),o=te.useRef(r),c=te.useRef(s);function h(p={}){const u=l.current,v=d.current,w=_.current,R=f.current;if(!u||!v||!w||!R)return!1;const E=u.getBoundingClientRect();return E.width<Ym||E.height<Xm||(w.fit(),R.cols<Qm||R.rows<Jm)?!1:(v.resize(R.cols,R.rows),p.focus&&R.focus(),!0)}return te.useEffect(()=>{c.current=s},[s]),te.useEffect(()=>{o.current=r},[r]),te.useEffect(()=>{if(!l.current)return;const p=new d1.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:m1}),u=new c1.FitAddon;p.loadAddon(u),p.loadAddon(new h1.WebLinksAddon),p.open(l.current),f.current=p,_.current=u;const v=l.current.getBoundingClientRect();v.width>=Ym&&v.height>=Xm&&u.fit();const w=new p1(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=w,p.cols>=Qm&&p.rows>=Jm&&w.resize(p.cols,p.rows);const R=p.onData(A=>{w.sendInput(A)});let E=0,y=0,S=0;const g=()=>{E&&window.cancelAnimationFrame(E),E=window.requestAnimationFrame(()=>{E=0,h({focus:o.current})})},b=new ResizeObserver(()=>{g()});return b.observe(l.current),y=window.requestAnimationFrame(g),S=window.setTimeout(g,120),()=>{E&&window.cancelAnimationFrame(E),y&&window.cancelAnimationFrame(y),S&&window.clearTimeout(S),b.disconnect(),R.dispose(),w.close(),p.dispose(),d.current=null,f.current=null,_.current=null}},[n]),te.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 v of p)window.cancelAnimationFrame(v);for(const v of u)window.clearTimeout(v)}},[r]),te.useEffect(()=>{const p=()=>{o.current&&h()};return window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[]),x.jsx("div",{className:"terminal-frame",ref:l,onMouseDown:()=>{var p;return(p=f.current)==null?void 0:p.focus()}})}const Ym=160,Xm=80,Qm=20,Jm=5,m1={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"},u_=[{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"}],h_=[{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"}],g1=[{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"}],f_=[...g1,{value:"max",label:"Max",description:"Maximum reasoning"},{value:"ultracode",label:"Ultracode",description:"Claude Code dynamic workflows with xhigh reasoning"}];function zi({status:n}){return x.jsx("span",{className:`status-badge status-${n}`,children:n.replaceAll("_"," ")})}function Hh({role:n,session:r,permissionMode:s,model:l,effort:d,busy:_=!1,onPermissionModeChange:f,onModelChange:o,onEffortChange:c,onStart:h,onResume:p,onStop:u,onRestart:v,onNotifyHarnessUpdated:w}){const R=(r==null?void 0:r.status)==="running",E=!!(r!=null&&r.claudeSessionId&&!R),y=!R&&!(r!=null&&r.claudeSessionId),S=!!(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:g=>f(g.target.value),children:u_.map(g=>x.jsx("option",{value:g.value,children:g.label},g.value))})]}),x.jsxs("label",{className:"session-option-field model-field",children:[x.jsx("span",{children:"Model"}),x.jsx("select",{value:l,onChange:g=>o(g.target.value),children:h_.map(g=>x.jsx("option",{value:g.value,children:g.label},g.value))})]}),x.jsxs("label",{className:"session-option-field effort-field",children:[x.jsx("span",{children:"Effort"}),x.jsx("select",{value:d,onChange:g=>c(g.target.value),children:f_.map(g=>x.jsx("option",{value:g.value,children:g.label},g.value))})]}),x.jsxs("div",{className:"session-toolbar",children:[x.jsx("button",{type:"button",disabled:_||!y,onClick:h,children:"Start"}),x.jsx("button",{type:"button",disabled:_||!E,onClick:p,children:"Resume"}),x.jsx("button",{type:"button",disabled:_||!r,onClick:v,children:"Restart"}),x.jsx("button",{type:"button",disabled:_||!r,onClick:u,children:"Stop"})]}),S?x.jsxs("div",{className:"session-harness-notice",children:[x.jsx(zi,{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:_||!R||!w,onClick:w,children:"Notify role"})]}):null]})}function _1({busy:n,effort:r,model:s,open:l,permissionMode:d,taskSlug:_,bootstrapStatus:f,engineerSession:o,status:c,onClose:h,onEffortChange:p,onModelChange:u,onPermissionModeChange:v,onEngineerResume:w,onEngineerRestart:R,onEngineerStart:E,onEngineerStop:y,onEngineerNotifyHarnessUpdated:S,onOpenRepositoryDiff:g,onReviewTaskHarness:b,onRefresh:A}){const[L,D]=te.useState(null),[T,k]=te.useState(null),[M,B]=te.useState(""),[H,U]=te.useState(!1),[P,Y]=te.useState(!1),[,X]=wr(null),[V,K]=te.useState(null),ne=(c==null?void 0:c.files)??[],z=ne.filter(ie=>ie.kind.startsWith("agent-")),j=z.filter(ie=>Zm(ie)),N=z.filter(ie=>!Zm(ie)),$=ne.filter(ie=>ie.kind.startsWith("skill-")),I=ne.filter(ie=>ie.kind.startsWith("tool-")),se=ne.filter(ie=>ie.kind==="root-claude"||ie.kind==="gitignore"||ie.kind==="pull-request-template"),ae=!!(T&&M!==T.content);te.useEffect(()=>{l||(D(null),k(null),B(""),U(!1),X(null))},[ne,l,L]),te.useEffect(()=>{if(!l||!L||!_)return;let ie=!1;return Y(!0),X(null),U(!1),ye.getHarnessFileContent(_,L).then(ee=>{ie||(k(ee),B(ee.content))}).catch(ee=>{ie||X(Qe(`Load harness file ${L}`,ee))}).finally(()=>{ie||Y(!1)}),()=>{ie=!0}},[l,L,_]);async function he(){if(!(!T||!T.editable||!ae||!_)){Y(!0),X(null);try{const ie=await ye.updateHarnessFileContent(_,T.path,{content:M});k(ie.file),B(ie.file.content),U(!1),A()}catch(ie){X(Qe(`Save harness file ${T.path}`,ie))}finally{Y(!1)}}}function W(){D(null),k(null),B(""),U(!1),X(null)}async function q(ie){X(null);try{await v1(ie),K(ie),window.setTimeout(()=>{K(ee=>ee===ie?null:ee)},1200)}catch(ee){X(Qe(`Copy harness file path ${ie}`,ee))}}return l?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"}),_?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||!_,onClick:b,children:"Review Task Harness"}),x.jsx("button",{type:"button",disabled:n,onClick:g,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:(T==null?void 0:T.title)??"Harness File"}),x.jsx("p",{className:"muted",children:(T==null?void 0:T.path)??L})]}),x.jsxs("div",{className:"harness-studio-file-editor-actions",children:[T?x.jsx(zi,{status:T.editable?"ok":"unknown"}):null,H?x.jsxs(x.Fragment,{children:[x.jsx("button",{type:"button",disabled:P||!_||!(T!=null&&T.editable)||!ae,onClick:()=>void he(),children:"Save"}),x.jsx("button",{type:"button",disabled:P,onClick:()=>{B((T==null?void 0:T.content)??""),U(!1)},children:"Cancel"})]}):x.jsx("button",{type:"button",disabled:P||!_||!(T!=null&&T.editable),onClick:()=>U(!0),children:"Edit"}),x.jsx("button",{type:"button",onClick:W,children:"Return"})]})]}),T!=null&&T.readonlyReason?x.jsx("p",{className:"muted",children:T.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:ie=>B(ie.target.value)})]}):x.jsxs(x.Fragment,{children:[x.jsx(Fa,{title:"VCM Roles",files:j,selectedPath:L,copiedPath:V,onCopy:ie=>void q(ie),onSelect:D}),x.jsx(Fa,{title:"Auxiliary Roles",files:N,selectedPath:L,copiedPath:V,onCopy:ie=>void q(ie),onSelect:D}),x.jsx(yh,{title:"Overview",children:x.jsxs("section",{className:"harness-studio-overview",children:[x.jsxs("div",{className:"harness-studio-metrics",children:[x.jsx(Ns,{label:"Fixed install",value:c?c.initialized?c.needsApply?"updates":"current":"new":"unknown"}),x.jsx(Ns,{label:"Revision",value:String((c==null?void 0:c.harnessRevision)??0)}),x.jsx(Ns,{label:"Managed files",value:String(ne.length)}),x.jsx(Ns,{label:"Pending updates",value:String((c==null?void 0:c.plannedChanges.length)??0)}),x.jsx(Ns,{label:"Bootstrap",value:(f==null?void 0:f.status.replaceAll("_"," "))??"unknown"}),x.jsx(Ns,{label:"Engineer",value:eg(o)})]}),c!=null&&c.warnings.length?x.jsx("ul",{className:"warnings",children:c.warnings.map(ie=>x.jsx("li",{children:ie},ie))}):null]})}),x.jsx(Fa,{title:"Skills",files:$,selectedPath:L,copiedPath:V,onCopy:ie=>void q(ie),onSelect:D,collapsible:!0}),x.jsx(Fa,{title:"Root Context",files:se,selectedPath:L,copiedPath:V,onCopy:ie=>void q(ie),onSelect:D,collapsible:!0}),x.jsx(Fa,{title:"Tools",files:I,selectedPath:L,copiedPath:V,onCopy:ie=>void q(ie),onSelect:D,collapsible:!0}),x.jsx(yh,{title:"Project Docs",children:x.jsx("ul",{className:"harness-studio-doc-list",children:(f==null?void 0:f.checks.map(ie=>x.jsxs("li",{children:[x.jsx("span",{children:ie.path??ie.label}),x.jsx(zi,{status:ie.status})]},ie.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:eg(o)})]}),x.jsx(zi,{status:(o==null?void 0:o.status)??"unknown"})]}),x.jsx(Hh,{role:"harness-engineer",session:o??void 0,permissionMode:d,model:s,effort:r,busy:n,onPermissionModeChange:v,onModelChange:u,onEffortChange:p,onStart:E,onResume:w,onRestart:R,onStop:y,onNotifyHarnessUpdated:S}),x.jsx("div",{className:"harness-engineer-terminal",children:(o==null?void 0:o.status)==="running"?x.jsx(Ho,{sessionId:o.id,active:l},o.id):x.jsxs("div",{className:"terminal-empty",children:[x.jsx("strong",{children:"harness-engineer"}),x.jsx("span",{children:o!=null&&o.claudeSessionId?"Resume this project Harness Engineer session.":"Start this project Harness Engineer session."})]})})]})]})]})})}):null}function Ns({label:n,value:r}){return x.jsxs("div",{className:"harness-studio-metric",children:[x.jsx("span",{children:n}),x.jsx("strong",{children:r})]})}function Fa({title:n,files:r,selectedPath:s,copiedPath:l,onCopy:d,onSelect:_,collapsible:f=!1}){const o=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:()=>_(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:l===c.path?"Copied":"Copy"}),x.jsx(zi,{status:c.action})]},c.path)):x.jsx("li",{children:x.jsx("span",{children:"No files."})})});return f?x.jsx(yh,{title:n,children:o}):x.jsxs("section",{className:"harness-studio-section",children:[x.jsx("h3",{children:n}),o]})}function yh({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 Zm(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 eg(n){return n?n.status==="running"?`${n.status} / ${n.activityStatus??"idle"}`:n.status:"not started"}async function v1(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 y1({open:n,taskSlug:r,onClose:s}){var k;const[l,d]=te.useState(null),[_,f]=te.useState(null),[o,c]=te.useState(null),[h,p]=te.useState(null),[u,v]=te.useState(null),[w,R]=te.useState(!1),[E,y]=te.useState(!1),[,S]=wr(null),[g,b]=te.useState(null),A=te.useMemo(()=>(l==null?void 0:l.files.find(M=>M.path===o))??(l==null?void 0:l.files[0])??null,[l,o]);async function L(M=_){var B;R(!0),S(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(Y=>Y.path===U)?U:((P=H.files[0])==null?void 0:P.path)??null})}catch(H){S(Qe(M?`Load commit diff ${M}`:"Load latest commit diff",H))}finally{R(!1)}}te.useEffect(()=>{n&&(f(null),b(null),L(null))},[n,r]);async function D(M){v(M),S(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){S(Qe(`Load task file diff for ${M}`,B))}finally{v(null)}}async function T(){if(S(null),b(null),!r){S("Create or select a task before merging the task branch.");return}if(!l){S("Load the commit diff before merging the task branch.");return}const M=l.commits.length?l.commits.map(H=>`- ${H.shortSha} ${H.subject}`):["- No new commits found."];if(window.confirm([`Merge ${l.sourceBranch} into ${l.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
- `))){y(!0);try{const H=await ye.mergeRepositoryDiffToCurrentBranch(r);b(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){S(Qe("Merge task branch to connected repository branch",H))}finally{y(!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:l?`${((k=l.commit)==null?void 0:k.shortSha)??"HEAD"} · ${l.summary.totalFiles} files · +${l.summary.additions} / -${l.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:_??"",disabled:w||!(l!=null&&l.commits.length),onChange:M=>{const B=M.target.value||null;f(B),L(B)},children:l==null?void 0:l.commits.map(M=>x.jsxs("option",{value:M.sha,children:[M.shortSha," · ",M.subject]},M.sha))})]}),x.jsx("button",{type:"button",disabled:w,onClick:()=>void L(),children:"Refresh"}),x.jsx("button",{type:"button",disabled:w||E||!r||!(l!=null&&l.commits.length),onClick:()=>void T(),children:E?"Merging...":"Merge to Main"}),x.jsx("button",{type:"button",onClick:s,children:"Close"})]})]}),g?x.jsx("p",{className:"success-banner",children:g}):null,l!=null&&l.warnings.length?x.jsx("ul",{className:"warnings repository-diff-warnings",children:l.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(S1,{report:l,busy:w}),x.jsxs("ol",{className:"repository-diff-file-list",children:[l==null?void 0:l.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:[bh(M.status)," · ",tg(M.stage)," · ",Sh(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)),l&&l.files.length===0?x.jsx("li",{className:"repository-diff-empty",children:l.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(b1,{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:[Sh(A.category)," · ",bh(A.status)," · ",tg(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:d_(A.diff)})]}):x.jsx("div",{className:"repository-diff-placeholder",children:w?"Loading commit diff...":"No diff selected."})})]})]})}):null}function S1({report:n,busy:r}){var l;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:((l=n==null?void 0:n.commit)==null?void 0:l.subject)??"HEAD"})]}):null]})}function b1({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(l=>x.jsx("li",{children:l},l))}):null,s?x.jsxs(x.Fragment,{children:[x.jsxs("p",{className:"muted",children:[Sh(s.category)," · ",bh(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:d_(s.diff)})]}):x.jsx("div",{className:"repository-diff-placeholder",children:"No task-level diff for this file."})]})}function Sh(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 tg(n){return n.replaceAll("_"," ")}function bh(n){return n.replaceAll("_"," ")}function d_(n){return n.split(`
62
- `).filter(r=>!w1(r)).map((r,s)=>x.jsx("span",{className:`repository-diff-line ${C1(r)}`,children:r||" "},`${s}:${r}`))}function C1(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 w1(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 x1({busy:n,effort:r,model:s,open:l,permissionMode:d,session:_,onClose:f,onEffortChange:o,onModelChange:c,onPermissionModeChange:h,onResume:p,onRestart:u,onStart:v,onStop:w,onNotifyHarnessUpdated:R}){return l?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:E1(_)})]}),x.jsx("button",{type:"button",onClick:f,children:"Close"})]}),x.jsx(Hh,{role:"translator",session:_??void 0,permissionMode:d,model:s,effort:r,busy:n,onPermissionModeChange:h,onModelChange:c,onEffortChange:o,onStart:v,onResume:p,onRestart:u,onStop:w,onNotifyHarnessUpdated:R}),x.jsx("div",{className:"translator-session-terminal",children:(_==null?void 0:_.status)==="running"?x.jsx(Ho,{sessionId:_.id,active:l},_.id):x.jsxs("div",{className:"terminal-empty",children:[x.jsx("strong",{children:"translator"}),x.jsx("span",{children:_!=null&&_.claudeSessionId?"Resume this project translator session.":"Start the project translator session."})]})})]})}):null}function E1(n){if(!n)return"not started";const r=n.status==="running"?` · ${n.activityStatus??"idle"}`:"";return`${n.status}${r}`}function k1(n,r){const s={};return(n[n.length-1]===""?[...n,""]:n).join((s.padRight?" ":"")+","+(s.padLeft===!1?"":" ")).trim()}const A1=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,R1=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,T1={};function ng(n,r){return(T1.jsx?R1:A1).test(n)}const D1=/[ \t\n\f\r]/g;function M1(n){return typeof n=="object"?n.type==="text"?ig(n.value):!1:ig(n)}function ig(n){return n.replace(D1,"")===""}class il{constructor(r,s,l){this.normal=s,this.property=r,l&&(this.space=l)}}il.prototype.normal={};il.prototype.property={};il.prototype.space=void 0;function p_(n,r){const s={},l={};for(const d of n)Object.assign(s,d.property),Object.assign(l,d.normal);return new il(s,l,r)}function Ch(n){return n.toLowerCase()}class wn{constructor(r,s){this.attribute=s,this.property=r}}wn.prototype.attribute="";wn.prototype.booleanish=!1;wn.prototype.boolean=!1;wn.prototype.commaOrSpaceSeparated=!1;wn.prototype.commaSeparated=!1;wn.prototype.defined=!1;wn.prototype.mustUseProperty=!1;wn.prototype.number=!1;wn.prototype.overloadedBoolean=!1;wn.prototype.property="";wn.prototype.spaceSeparated=!1;wn.prototype.space=void 0;let L1=0;const Fe=Qr(),Lt=Qr(),wh=Qr(),be=Qr(),pt=Qr(),Ps=Qr(),Bn=Qr();function Qr(){return 2**++L1}const xh=Object.freeze(Object.defineProperty({__proto__:null,boolean:Fe,booleanish:Lt,commaOrSpaceSeparated:Bn,commaSeparated:Ps,number:be,overloadedBoolean:wh,spaceSeparated:pt},Symbol.toStringTag,{value:"Module"})),Qu=Object.keys(xh);class zh extends wn{constructor(r,s,l,d){let _=-1;if(super(r,s),rg(this,"space",d),typeof l=="number")for(;++_<Qu.length;){const f=Qu[_];rg(this,Qu[_],(l&xh[f])===xh[f])}}}zh.prototype.defined=!0;function rg(n,r,s){s&&(n[r]=s)}function Gs(n){const r={},s={};for(const[l,d]of Object.entries(n.properties)){const _=new zh(l,n.transform(n.attributes||{},l),d,n.space);n.mustUseProperty&&n.mustUseProperty.includes(l)&&(_.mustUseProperty=!0),r[l]=_,s[Ch(l)]=l,s[Ch(_.attribute)]=l}return new il(r,s,n.space)}const m_=Gs({properties:{ariaActiveDescendant:null,ariaAtomic:Lt,ariaAutoComplete:null,ariaBusy:Lt,ariaChecked:Lt,ariaColCount:be,ariaColIndex:be,ariaColSpan:be,ariaControls:pt,ariaCurrent:null,ariaDescribedBy:pt,ariaDetails:null,ariaDisabled:Lt,ariaDropEffect:pt,ariaErrorMessage:null,ariaExpanded:Lt,ariaFlowTo:pt,ariaGrabbed:Lt,ariaHasPopup:null,ariaHidden:Lt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:pt,ariaLevel:be,ariaLive:null,ariaModal:Lt,ariaMultiLine:Lt,ariaMultiSelectable:Lt,ariaOrientation:null,ariaOwns:pt,ariaPlaceholder:null,ariaPosInSet:be,ariaPressed:Lt,ariaReadOnly:Lt,ariaRelevant:null,ariaRequired:Lt,ariaRoleDescription:pt,ariaRowCount:be,ariaRowIndex:be,ariaRowSpan:be,ariaSelected:Lt,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 g_(n,r){return r in n?n[r]:r}function __(n,r){return g_(n,r.toLowerCase())}const O1=Gs({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ps,acceptCharset:pt,accessKey:pt,action:null,allow:null,allowFullScreen:Fe,allowPaymentRequest:Fe,allowUserMedia:Fe,alt:null,as:null,async:Fe,autoCapitalize:null,autoComplete:pt,autoFocus:Fe,autoPlay:Fe,blocking:pt,capture:null,charSet:null,checked:Fe,cite:null,className:pt,cols:be,colSpan:null,content:null,contentEditable:Lt,controls:Fe,controlsList:pt,coords:be|Ps,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Fe,defer:Fe,dir:null,dirName:null,disabled:Fe,download:wh,draggable:Lt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Fe,formTarget:null,headers:pt,height:be,hidden:wh,high:be,href:null,hrefLang:null,htmlFor:pt,httpEquiv:pt,id:null,imageSizes:null,imageSrcSet:null,inert:Fe,inputMode:null,integrity:null,is:null,isMap:Fe,itemId:null,itemProp:pt,itemRef:pt,itemScope:Fe,itemType:pt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Fe,low:be,manifest:null,max:null,maxLength:be,media:null,method:null,min:null,minLength:be,multiple:Fe,muted:Fe,name:null,nonce:null,noModule:Fe,noValidate:Fe,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:Fe,optimum:be,pattern:null,ping:pt,placeholder:null,playsInline:Fe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Fe,referrerPolicy:null,rel:pt,required:Fe,reversed:Fe,rows:be,rowSpan:be,sandbox:pt,scope:null,scoped:Fe,seamless:Fe,selected:Fe,shadowRootClonable:Fe,shadowRootDelegatesFocus:Fe,shadowRootMode:null,shape:null,size:be,sizes:null,slot:null,span:be,spellCheck:Lt,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:Fe,useMap:null,value:Lt,width:be,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:pt,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:Fe,declare:Fe,event:null,face:null,frame:null,frameBorder:null,hSpace:be,leftMargin:be,link:null,longDesc:null,lowSrc:null,marginHeight:be,marginWidth:be,noResize:Fe,noHref:Fe,noShade:Fe,noWrap:Fe,object:null,profile:null,prompt:null,rev:null,rightMargin:be,rules:null,scheme:null,scrolling:Lt,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:Fe,disableRemotePlayback:Fe,prefix:null,property:null,results:be,security:null,unselectable:null},space:"html",transform:__}),B1=Gs({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Bn,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:pt,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:Fe,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:Ps,g2:Ps,glyphName:Ps,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:Bn,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:pt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:be,pointsAtY:be,pointsAtZ:be,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Bn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Bn,rev:Bn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Bn,requiredFeatures:Bn,requiredFonts:Bn,requiredFormats:Bn,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:Bn,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:Bn,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:Bn,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:g_}),v_=Gs({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(n,r){return"xlink:"+r.slice(5).toLowerCase()}}),y_=Gs({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:__}),S_=Gs({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(n,r){return"xml:"+r.slice(3).toLowerCase()}}),j1={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"},N1=/[A-Z]/g,sg=/-[a-z]/g,H1=/^data[-\w.:]+$/i;function z1(n,r){const s=Ch(r);let l=r,d=wn;if(s in n.normal)return n.property[n.normal[s]];if(s.length>4&&s.slice(0,4)==="data"&&H1.test(r)){if(r.charAt(4)==="-"){const _=r.slice(5).replace(sg,U1);l="data"+_.charAt(0).toUpperCase()+_.slice(1)}else{const _=r.slice(4);if(!sg.test(_)){let f=_.replace(N1,I1);f.charAt(0)!=="-"&&(f="-"+f),r="data"+f}}d=zh}return new d(l,r)}function I1(n){return"-"+n.toLowerCase()}function U1(n){return n.charAt(1).toUpperCase()}const P1=p_([m_,O1,v_,y_,S_],"html"),Ih=p_([m_,B1,v_,y_,S_],"svg");function F1(n){return n.join(" ").trim()}var Hs={},Ju,ag;function q1(){if(ag)return Ju;ag=1;var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,s=/^\s*/,l=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,d=/^:\s*/,_=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,f=/^[;\s]*/,o=/^\s+|\s+$/g,c=`
63
- `,h="/",p="*",u="",v="comment",w="declaration";function R(y,S){if(typeof y!="string")throw new TypeError("First argument must be a string");if(!y)return[];S=S||{};var g=1,b=1;function A(Y){var X=Y.match(r);X&&(g+=X.length);var V=Y.lastIndexOf(c);b=~V?Y.length-V:b+Y.length}function L(){var Y={line:g,column:b};return function(X){return X.position=new D(Y),M(),X}}function D(Y){this.start=Y,this.end={line:g,column:b},this.source=S.source}D.prototype.content=y;function T(Y){var X=new Error(S.source+":"+g+":"+b+": "+Y);if(X.reason=Y,X.filename=S.source,X.line=g,X.column=b,X.source=y,!S.silent)throw X}function k(Y){var X=Y.exec(y);if(X){var V=X[0];return A(V),y=y.slice(V.length),X}}function M(){k(s)}function B(Y){var X;for(Y=Y||[];X=H();)X!==!1&&Y.push(X);return Y}function H(){var Y=L();if(!(h!=y.charAt(0)||p!=y.charAt(1))){for(var X=2;u!=y.charAt(X)&&(p!=y.charAt(X)||h!=y.charAt(X+1));)++X;if(X+=2,u===y.charAt(X-1))return T("End of comment missing");var V=y.slice(2,X-2);return b+=2,A(V),y=y.slice(X),b+=2,Y({type:v,comment:V})}}function U(){var Y=L(),X=k(l);if(X){if(H(),!k(d))return T("property missing ':'");var V=k(_),K=Y({type:w,property:E(X[0].replace(n,u)),value:V?E(V[0].replace(n,u)):u});return k(f),K}}function P(){var Y=[];B(Y);for(var X;X=U();)X!==!1&&(Y.push(X),B(Y));return Y}return M(),P()}function E(y){return y?y.replace(o,u):u}return Ju=R,Ju}var lg;function $1(){if(lg)return Hs;lg=1;var n=Hs&&Hs.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(Hs,"__esModule",{value:!0}),Hs.default=s;const r=n(q1());function s(l,d){let _=null;if(!l||typeof l!="string")return _;const f=(0,r.default)(l),o=typeof d=="function";return f.forEach(c=>{if(c.type!=="declaration")return;const{property:h,value:p}=c;o?d(h,p,c):p&&(_=_||{},_[h]=p)}),_}return Hs}var qa={},og;function G1(){if(og)return qa;og=1,Object.defineProperty(qa,"__esModule",{value:!0}),qa.camelCase=void 0;var n=/^--[a-zA-Z0-9_-]+$/,r=/-([a-z])/g,s=/^[^-]+$/,l=/^-(webkit|moz|ms|o|khtml)-/,d=/^-(ms)-/,_=function(h){return!h||s.test(h)||n.test(h)},f=function(h,p){return p.toUpperCase()},o=function(h,p){return"".concat(p,"-")},c=function(h,p){return p===void 0&&(p={}),_(h)?h:(h=h.toLowerCase(),p.reactCompat?h=h.replace(d,o):h=h.replace(l,o),h.replace(r,f))};return qa.camelCase=c,qa}var $a,cg;function V1(){if(cg)return $a;cg=1;var n=$a&&$a.__importDefault||function(d){return d&&d.__esModule?d:{default:d}},r=n($1()),s=G1();function l(d,_){var f={};return!d||typeof d!="string"||(0,r.default)(d,function(o,c){o&&c&&(f[(0,s.camelCase)(o,_)]=c)}),f}return l.default=l,$a=l,$a}var K1=V1();const W1=r_(K1),b_=C_("end"),Uh=C_("start");function C_(n){return r;function r(s){const l=s&&s.position&&s.position[n]||{};if(typeof l.line=="number"&&l.line>0&&typeof l.column=="number"&&l.column>0)return{line:l.line,column:l.column,offset:typeof l.offset=="number"&&l.offset>-1?l.offset:void 0}}}function Y1(n){const r=Uh(n),s=b_(n);if(r&&s)return{start:r,end:s}}function Wa(n){return!n||typeof n!="object"?"":"position"in n||"type"in n?ug(n.position):"start"in n||"end"in n?ug(n):"line"in n||"column"in n?Eh(n):""}function Eh(n){return hg(n&&n.line)+":"+hg(n&&n.column)}function ug(n){return Eh(n&&n.start)+"-"+Eh(n&&n.end)}function hg(n){return n&&typeof n=="number"?n:1}class nn extends Error{constructor(r,s,l){super(),typeof s=="string"&&(l=s,s=void 0);let d="",_={},f=!1;if(s&&("line"in s&&"column"in s?_={place:s}:"start"in s&&"end"in s?_={place:s}:"type"in s?_={ancestors:[s],place:s.position}:_={...s}),typeof r=="string"?d=r:!_.cause&&r&&(f=!0,d=r.message,_.cause=r),!_.ruleId&&!_.source&&typeof l=="string"){const c=l.indexOf(":");c===-1?_.ruleId=l:(_.source=l.slice(0,c),_.ruleId=l.slice(c+1))}if(!_.place&&_.ancestors&&_.ancestors){const c=_.ancestors[_.ancestors.length-1];c&&(_.place=c.position)}const o=_.place&&"start"in _.place?_.place.start:_.place;this.ancestors=_.ancestors||void 0,this.cause=_.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=d,this.line=o?o.line:void 0,this.name=Wa(_.place)||"1:1",this.place=_.place||void 0,this.reason=this.message,this.ruleId=_.ruleId||void 0,this.source=_.source||void 0,this.stack=f&&_.cause&&typeof _.cause.stack=="string"?_.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}nn.prototype.file="";nn.prototype.name="";nn.prototype.reason="";nn.prototype.message="";nn.prototype.stack="";nn.prototype.column=void 0;nn.prototype.line=void 0;nn.prototype.ancestors=void 0;nn.prototype.cause=void 0;nn.prototype.fatal=void 0;nn.prototype.place=void 0;nn.prototype.ruleId=void 0;nn.prototype.source=void 0;const Ph={}.hasOwnProperty,X1=new Map,Q1=/[A-Z]/g,J1=new Set(["table","tbody","thead","tfoot","tr"]),Z1=new Set(["td","th"]),w_="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function eS(n,r){if(!r||r.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const s=r.filePath||void 0;let l;if(r.development){if(typeof r.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");l=oS(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");l=lS(s,r.jsx,r.jsxs)}const d={Fragment:r.Fragment,ancestors:[],components:r.components||{},create:l,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"?Ih:P1,stylePropertyNameCase:r.stylePropertyNameCase||"dom",tableCellAlignToStyle:r.tableCellAlignToStyle!==!1},_=x_(d,n,void 0);return _&&typeof _!="string"?_:d.create(n,d.Fragment,{children:_||void 0},void 0)}function x_(n,r,s){if(r.type==="element")return tS(n,r,s);if(r.type==="mdxFlowExpression"||r.type==="mdxTextExpression")return nS(n,r);if(r.type==="mdxJsxFlowElement"||r.type==="mdxJsxTextElement")return rS(n,r,s);if(r.type==="mdxjsEsm")return iS(n,r);if(r.type==="root")return sS(n,r,s);if(r.type==="text")return aS(n,r)}function tS(n,r,s){const l=n.schema;let d=l;r.tagName.toLowerCase()==="svg"&&l.space==="html"&&(d=Ih,n.schema=d),n.ancestors.push(r);const _=k_(n,r.tagName,!1),f=cS(n,r);let o=qh(n,r);return J1.has(r.tagName)&&(o=o.filter(function(c){return typeof c=="string"?!M1(c):!0})),E_(n,f,_,r),Fh(f,o),n.ancestors.pop(),n.schema=l,n.create(r,_,f,s)}function nS(n,r){if(r.data&&r.data.estree&&n.evaluater){const l=r.data.estree.body[0];return l.type,n.evaluater.evaluateExpression(l.expression)}Za(n,r.position)}function iS(n,r){if(r.data&&r.data.estree&&n.evaluater)return n.evaluater.evaluateProgram(r.data.estree);Za(n,r.position)}function rS(n,r,s){const l=n.schema;let d=l;r.name==="svg"&&l.space==="html"&&(d=Ih,n.schema=d),n.ancestors.push(r);const _=r.name===null?n.Fragment:k_(n,r.name,!0),f=uS(n,r),o=qh(n,r);return E_(n,f,_,r),Fh(f,o),n.ancestors.pop(),n.schema=l,n.create(r,_,f,s)}function sS(n,r,s){const l={};return Fh(l,qh(n,r)),n.create(r,n.Fragment,l,s)}function aS(n,r){return r.value}function E_(n,r,s,l){typeof s!="string"&&s!==n.Fragment&&n.passNode&&(r.node=l)}function Fh(n,r){if(r.length>0){const s=r.length>1?r:r[0];s&&(n.children=s)}}function lS(n,r,s){return l;function l(d,_,f,o){const h=Array.isArray(f.children)?s:r;return o?h(_,f,o):h(_,f)}}function oS(n,r){return s;function s(l,d,_,f){const o=Array.isArray(_.children),c=Uh(l);return r(d,_,f,o,{columnNumber:c?c.column-1:void 0,fileName:n,lineNumber:c?c.line:void 0},void 0)}}function cS(n,r){const s={};let l,d;for(d in r.properties)if(d!=="children"&&Ph.call(r.properties,d)){const _=hS(n,d,r.properties[d]);if(_){const[f,o]=_;n.tableCellAlignToStyle&&f==="align"&&typeof o=="string"&&Z1.has(r.tagName)?l=o:s[f]=o}}if(l){const _=s.style||(s.style={});_[n.stylePropertyNameCase==="css"?"text-align":"textAlign"]=l}return s}function uS(n,r){const s={};for(const l of r.attributes)if(l.type==="mdxJsxExpressionAttribute")if(l.data&&l.data.estree&&n.evaluater){const _=l.data.estree.body[0];_.type;const f=_.expression;f.type;const o=f.properties[0];o.type,Object.assign(s,n.evaluater.evaluateExpression(o.argument))}else Za(n,r.position);else{const d=l.name;let _;if(l.value&&typeof l.value=="object")if(l.value.data&&l.value.data.estree&&n.evaluater){const o=l.value.data.estree.body[0];o.type,_=n.evaluater.evaluateExpression(o.expression)}else Za(n,r.position);else _=l.value===null?!0:l.value;s[d]=_}return s}function qh(n,r){const s=[];let l=-1;const d=n.passKeys?new Map:X1;for(;++l<r.children.length;){const _=r.children[l];let f;if(n.passKeys){const c=_.type==="element"?_.tagName:_.type==="mdxJsxFlowElement"||_.type==="mdxJsxTextElement"?_.name:void 0;if(c){const h=d.get(c)||0;f=c+"-"+h,d.set(c,h+1)}}const o=x_(n,_,f);o!==void 0&&s.push(o)}return s}function hS(n,r,s){const l=z1(n.schema,r);if(!(s==null||typeof s=="number"&&Number.isNaN(s))){if(Array.isArray(s)&&(s=l.commaSeparated?k1(s):F1(s)),l.property==="style"){let d=typeof s=="object"?s:fS(n,String(s));return n.stylePropertyNameCase==="css"&&(d=dS(d)),["style",d]}return[n.elementAttributeNameCase==="react"&&l.space?j1[l.property]||l.property:l.attribute,s]}}function fS(n,r){try{return W1(r,{reactCompat:!0})}catch(s){if(n.ignoreInvalidStyle)return{};const l=s,d=new nn("Cannot parse `style` attribute",{ancestors:n.ancestors,cause:l,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw d.file=n.filePath||void 0,d.url=w_+"#cannot-parse-style-attribute",d}}function k_(n,r,s){let l;if(!s)l={type:"Literal",value:r};else if(r.includes(".")){const d=r.split(".");let _=-1,f;for(;++_<d.length;){const o=ng(d[_])?{type:"Identifier",name:d[_]}:{type:"Literal",value:d[_]};f=f?{type:"MemberExpression",object:f,property:o,computed:!!(_&&o.type==="Literal"),optional:!1}:o}l=f}else l=ng(r)&&!/^[a-z]/.test(r)?{type:"Identifier",name:r}:{type:"Literal",value:r};if(l.type==="Literal"){const d=l.value;return Ph.call(n.components,d)?n.components[d]:d}if(n.evaluater)return n.evaluater.evaluateExpression(l);Za(n)}function Za(n,r){const s=new nn("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=w_+"#cannot-handle-mdx-estrees-without-createevaluater",s}function dS(n){const r={};let s;for(s in n)Ph.call(n,s)&&(r[pS(s)]=n[s]);return r}function pS(n){let r=n.replace(Q1,mS);return r.slice(0,3)==="ms-"&&(r="-"+r),r}function mS(n){return"-"+n.toLowerCase()}const Zu={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"]},gS={};function $h(n,r){const s=gS,l=typeof s.includeImageAlt=="boolean"?s.includeImageAlt:!0,d=typeof s.includeHtml=="boolean"?s.includeHtml:!0;return A_(n,l,d)}function A_(n,r,s){if(_S(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 fg(n.children,r,s)}return Array.isArray(n)?fg(n,r,s):""}function fg(n,r,s){const l=[];let d=-1;for(;++d<n.length;)l[d]=A_(n[d],r,s);return l.join("")}function _S(n){return!!(n&&typeof n=="object")}const dg=document.createElement("i");function Gh(n){const r="&"+n+";";dg.innerHTML=r;const s=dg.textContent;return s.charCodeAt(s.length-1)===59&&n!=="semi"||s===r?!1:s}function jn(n,r,s,l){const d=n.length;let _=0,f;if(r<0?r=-r>d?0:d+r:r=r>d?d:r,s=s>0?s:0,l.length<1e4)f=Array.from(l),f.unshift(r,s),n.splice(...f);else for(s&&n.splice(r,s);_<l.length;)f=l.slice(_,_+1e4),f.unshift(r,0),n.splice(...f),_+=1e4,r+=1e4}function Xn(n,r){return n.length>0?(jn(n,n.length,0,r),n):r}const pg={}.hasOwnProperty;function R_(n){const r={};let s=-1;for(;++s<n.length;)vS(r,n[s]);return r}function vS(n,r){let s;for(s in r){const d=(pg.call(n,s)?n[s]:void 0)||(n[s]={}),_=r[s];let f;if(_)for(f in _){pg.call(d,f)||(d[f]=[]);const o=_[f];yS(d[f],Array.isArray(o)?o:o?[o]:[])}}}function yS(n,r){let s=-1;const l=[];for(;++s<r.length;)(r[s].add==="after"?n:l).push(r[s]);jn(n,0,0,l)}function T_(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 si(n){return n.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const hn=xr(/[A-Za-z]/),tn=xr(/[\dA-Za-z]/),SS=xr(/[#-'*+\--9=?A-Z^-~]/);function To(n){return n!==null&&(n<32||n===127)}const kh=xr(/\d/),bS=xr(/[\dA-Fa-f]/),CS=xr(/[!-/:-@[-`{-~]/);function Le(n){return n!==null&&n<-2}function ft(n){return n!==null&&(n<0||n===32)}function Ke(n){return n===-2||n===-1||n===32}const zo=xr(new RegExp("\\p{P}|\\p{S}","u")),Yr=xr(/\s/);function xr(n){return r;function r(s){return s!==null&&s>-1&&n.test(String.fromCharCode(s))}}function Vs(n){const r=[];let s=-1,l=0,d=0;for(;++s<n.length;){const _=n.charCodeAt(s);let f="";if(_===37&&tn(n.charCodeAt(s+1))&&tn(n.charCodeAt(s+2)))d=2;else if(_<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(_))||(f=String.fromCharCode(_));else if(_>55295&&_<57344){const o=n.charCodeAt(s+1);_<56320&&o>56319&&o<57344?(f=String.fromCharCode(_,o),d=1):f="�"}else f=String.fromCharCode(_);f&&(r.push(n.slice(l,s),encodeURIComponent(f)),l=s+d+1,f=""),d&&(s+=d,d=0)}return r.join("")+n.slice(l)}function Je(n,r,s,l){const d=l?l-1:Number.POSITIVE_INFINITY;let _=0;return f;function f(c){return Ke(c)?(n.enter(s),o(c)):r(c)}function o(c){return Ke(c)&&_++<d?(n.consume(c),o):(n.exit(s),r(c))}}const wS={tokenize:xS};function xS(n){const r=n.attempt(this.parser.constructs.contentInitial,l,d);let s;return r;function l(o){if(o===null){n.consume(o);return}return n.enter("lineEnding"),n.consume(o),n.exit("lineEnding"),Je(n,r,"linePrefix")}function d(o){return n.enter("paragraph"),_(o)}function _(o){const c=n.enter("chunkText",{contentType:"text",previous:s});return s&&(s.next=c),s=c,f(o)}function f(o){if(o===null){n.exit("chunkText"),n.exit("paragraph"),n.consume(o);return}return Le(o)?(n.consume(o),n.exit("chunkText"),_):(n.consume(o),f)}}const ES={tokenize:kS},mg={tokenize:AS};function kS(n){const r=this,s=[];let l=0,d,_,f;return o;function o(b){if(l<s.length){const A=s[l];return r.containerState=A[1],n.attempt(A[0].continuation,c,h)(b)}return h(b)}function c(b){if(l++,r.containerState._closeFlow){r.containerState._closeFlow=void 0,d&&g();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}S(l);let T=A;for(;T<r.events.length;)r.events[T][1].end={...D},T++;return jn(r.events,L+1,0,r.events.slice(A)),r.events.length=T,h(b)}return o(b)}function h(b){if(l===s.length){if(!d)return v(b);if(d.currentConstruct&&d.currentConstruct.concrete)return R(b);r.interrupt=!!(d.currentConstruct&&!d._gfmTableDynamicInterruptHack)}return r.containerState={},n.check(mg,p,u)(b)}function p(b){return d&&g(),S(l),v(b)}function u(b){return r.parser.lazy[r.now().line]=l!==s.length,f=r.now().offset,R(b)}function v(b){return r.containerState={},n.attempt(mg,w,R)(b)}function w(b){return l++,s.push([r.currentConstruct,r.containerState]),v(b)}function R(b){if(b===null){d&&g(),S(0),n.consume(b);return}return d=d||r.parser.flow(r.now()),n.enter("chunkFlow",{_tokenizer:d,contentType:"flow",previous:_}),E(b)}function E(b){if(b===null){y(n.exit("chunkFlow"),!0),S(0),n.consume(b);return}return Le(b)?(n.consume(b),y(n.exit("chunkFlow")),l=0,r.interrupt=void 0,o):(n.consume(b),E)}function y(b,A){const L=r.sliceStream(b);if(A&&L.push(null),b.previous=_,_&&(_.next=b),_=b,d.defineSkip(b.start),d.write(L),r.parser.lazy[b.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 T=r.events.length;let k=T,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(S(l),D=T;D<r.events.length;)r.events[D][1].end={...B},D++;jn(r.events,k+1,0,r.events.slice(T)),r.events.length=D}}function S(b){let A=s.length;for(;A-- >b;){const L=s[A];r.containerState=L[1],L[0].exit.call(r,n)}s.length=b}function g(){d.write([null]),_=void 0,d=void 0,r.containerState._closeFlow=void 0}}function AS(n,r,s){return Je(n,n.attempt(this.parser.constructs.document,r,s),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function qs(n){if(n===null||ft(n)||Yr(n))return 1;if(zo(n))return 2}function Io(n,r,s){const l=[];let d=-1;for(;++d<n.length;){const _=n[d].resolveAll;_&&!l.includes(_)&&(r=_(r,s),l.push(_))}return r}const Ah={name:"attention",resolveAll:RS,tokenize:TS};function RS(n,r){let s=-1,l,d,_,f,o,c,h,p;for(;++s<n.length;)if(n[s][0]==="enter"&&n[s][1].type==="attentionSequence"&&n[s][1]._close){for(l=s;l--;)if(n[l][0]==="exit"&&n[l][1].type==="attentionSequence"&&n[l][1]._open&&r.sliceSerialize(n[l][1]).charCodeAt(0)===r.sliceSerialize(n[s][1]).charCodeAt(0)){if((n[l][1]._close||n[s][1]._open)&&(n[s][1].end.offset-n[s][1].start.offset)%3&&!((n[l][1].end.offset-n[l][1].start.offset+n[s][1].end.offset-n[s][1].start.offset)%3))continue;c=n[l][1].end.offset-n[l][1].start.offset>1&&n[s][1].end.offset-n[s][1].start.offset>1?2:1;const u={...n[l][1].end},v={...n[s][1].start};gg(u,-c),gg(v,c),f={type:c>1?"strongSequence":"emphasisSequence",start:u,end:{...n[l][1].end}},o={type:c>1?"strongSequence":"emphasisSequence",start:{...n[s][1].start},end:v},_={type:c>1?"strongText":"emphasisText",start:{...n[l][1].end},end:{...n[s][1].start}},d={type:c>1?"strong":"emphasis",start:{...f.start},end:{...o.end}},n[l][1].end={...f.start},n[s][1].start={...o.end},h=[],n[l][1].end.offset-n[l][1].start.offset&&(h=Xn(h,[["enter",n[l][1],r],["exit",n[l][1],r]])),h=Xn(h,[["enter",d,r],["enter",f,r],["exit",f,r],["enter",_,r]]),h=Xn(h,Io(r.parser.constructs.insideSpan.null,n.slice(l+1,s),r)),h=Xn(h,[["exit",_,r],["enter",o,r],["exit",o,r],["exit",d,r]]),n[s][1].end.offset-n[s][1].start.offset?(p=2,h=Xn(h,[["enter",n[s][1],r],["exit",n[s][1],r]])):p=0,jn(n,l-1,s-l+3,h),s=l+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,l=this.previous,d=qs(l);let _;return f;function f(c){return _=c,n.enter("attentionSequence"),o(c)}function o(c){if(c===_)return n.consume(c),o;const h=n.exit("attentionSequence"),p=qs(c),u=!p||p===2&&d||s.includes(c),v=!d||d===2&&p||s.includes(l);return h._open=!!(_===42?u:u&&(d||!v)),h._close=!!(_===42?v:v&&(p||!u)),r(c)}}function gg(n,r){n.column+=r,n.offset+=r,n._bufferIndex+=r}const DS={name:"autolink",tokenize:MS};function MS(n,r,s){let l=0;return d;function d(w){return n.enter("autolink"),n.enter("autolinkMarker"),n.consume(w),n.exit("autolinkMarker"),n.enter("autolinkProtocol"),_}function _(w){return hn(w)?(n.consume(w),f):w===64?s(w):h(w)}function f(w){return w===43||w===45||w===46||tn(w)?(l=1,o(w)):h(w)}function o(w){return w===58?(n.consume(w),l=0,c):(w===43||w===45||w===46||tn(w))&&l++<32?(n.consume(w),o):(l=0,h(w))}function c(w){return w===62?(n.exit("autolinkProtocol"),n.enter("autolinkMarker"),n.consume(w),n.exit("autolinkMarker"),n.exit("autolink"),r):w===null||w===32||w===60||To(w)?s(w):(n.consume(w),c)}function h(w){return w===64?(n.consume(w),p):SS(w)?(n.consume(w),h):s(w)}function p(w){return tn(w)?u(w):s(w)}function u(w){return w===46?(n.consume(w),l=0,p):w===62?(n.exit("autolinkProtocol").type="autolinkEmail",n.enter("autolinkMarker"),n.consume(w),n.exit("autolinkMarker"),n.exit("autolink"),r):v(w)}function v(w){if((w===45||tn(w))&&l++<63){const R=w===45?v:u;return n.consume(w),R}return s(w)}}const rl={partial:!0,tokenize:LS};function LS(n,r,s){return l;function l(_){return Ke(_)?Je(n,d,"linePrefix")(_):d(_)}function d(_){return _===null||Le(_)?r(_):s(_)}}const D_={continuation:{tokenize:BS},exit:jS,name:"blockQuote",tokenize:OS};function OS(n,r,s){const l=this;return d;function d(f){if(f===62){const o=l.containerState;return o.open||(n.enter("blockQuote",{_container:!0}),o.open=!0),n.enter("blockQuotePrefix"),n.enter("blockQuoteMarker"),n.consume(f),n.exit("blockQuoteMarker"),_}return s(f)}function _(f){return Ke(f)?(n.enter("blockQuotePrefixWhitespace"),n.consume(f),n.exit("blockQuotePrefixWhitespace"),n.exit("blockQuotePrefix"),r):(n.exit("blockQuotePrefix"),r(f))}}function BS(n,r,s){const l=this;return d;function d(f){return Ke(f)?Je(n,_,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f):_(f)}function _(f){return n.attempt(D_,r,s)(f)}}function jS(n){n.exit("blockQuote")}const M_={name:"characterEscape",tokenize:NS};function NS(n,r,s){return l;function l(_){return n.enter("characterEscape"),n.enter("escapeMarker"),n.consume(_),n.exit("escapeMarker"),d}function d(_){return CS(_)?(n.enter("characterEscapeValue"),n.consume(_),n.exit("characterEscapeValue"),n.exit("characterEscape"),r):s(_)}}const L_={name:"characterReference",tokenize:HS};function HS(n,r,s){const l=this;let d=0,_,f;return o;function o(u){return n.enter("characterReference"),n.enter("characterReferenceMarker"),n.consume(u),n.exit("characterReferenceMarker"),c}function c(u){return u===35?(n.enter("characterReferenceMarkerNumeric"),n.consume(u),n.exit("characterReferenceMarkerNumeric"),h):(n.enter("characterReferenceValue"),_=31,f=tn,p(u))}function h(u){return u===88||u===120?(n.enter("characterReferenceMarkerHexadecimal"),n.consume(u),n.exit("characterReferenceMarkerHexadecimal"),n.enter("characterReferenceValue"),_=6,f=bS,p):(n.enter("characterReferenceValue"),_=7,f=kh,p(u))}function p(u){if(u===59&&d){const v=n.exit("characterReferenceValue");return f===tn&&!Gh(l.sliceSerialize(v))?s(u):(n.enter("characterReferenceMarker"),n.consume(u),n.exit("characterReferenceMarker"),n.exit("characterReference"),r)}return f(u)&&d++<_?(n.consume(u),p):s(u)}}const _g={partial:!0,tokenize:IS},vg={concrete:!0,name:"codeFenced",tokenize:zS};function zS(n,r,s){const l=this,d={partial:!0,tokenize:L};let _=0,f=0,o;return c;function c(D){return h(D)}function h(D){const T=l.events[l.events.length-1];return _=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,o=D,n.enter("codeFenced"),n.enter("codeFencedFence"),n.enter("codeFencedFenceSequence"),p(D)}function p(D){return D===o?(f++,n.consume(D),p):f<3?s(D):(n.exit("codeFencedFenceSequence"),Ke(D)?Je(n,u,"whitespace")(D):u(D))}function u(D){return D===null||Le(D)?(n.exit("codeFencedFence"),l.interrupt?r(D):n.check(_g,E,A)(D)):(n.enter("codeFencedFenceInfo"),n.enter("chunkString",{contentType:"string"}),v(D))}function v(D){return D===null||Le(D)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),u(D)):Ke(D)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),Je(n,w,"whitespace")(D)):D===96&&D===o?s(D):(n.consume(D),v)}function w(D){return D===null||Le(D)?u(D):(n.enter("codeFencedFenceMeta"),n.enter("chunkString",{contentType:"string"}),R(D))}function R(D){return D===null||Le(D)?(n.exit("chunkString"),n.exit("codeFencedFenceMeta"),u(D)):D===96&&D===o?s(D):(n.consume(D),R)}function E(D){return n.attempt(d,A,y)(D)}function y(D){return n.enter("lineEnding"),n.consume(D),n.exit("lineEnding"),S}function S(D){return _>0&&Ke(D)?Je(n,g,"linePrefix",_+1)(D):g(D)}function g(D){return D===null||Le(D)?n.check(_g,E,A)(D):(n.enter("codeFlowValue"),b(D))}function b(D){return D===null||Le(D)?(n.exit("codeFlowValue"),g(D)):(n.consume(D),b)}function A(D){return n.exit("codeFenced"),r(D)}function L(D,T,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"),Ke(X)?Je(D,U,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(X):U(X)}function U(X){return X===o?(D.enter("codeFencedFenceSequence"),P(X)):k(X)}function P(X){return X===o?(M++,D.consume(X),P):M>=f?(D.exit("codeFencedFenceSequence"),Ke(X)?Je(D,Y,"whitespace")(X):Y(X)):k(X)}function Y(X){return X===null||Le(X)?(D.exit("codeFencedFence"),T(X)):k(X)}}}function IS(n,r,s){const l=this;return d;function d(f){return f===null?s(f):(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),_)}function _(f){return l.parser.lazy[l.now().line]?s(f):r(f)}}const eh={name:"codeIndented",tokenize:PS},US={partial:!0,tokenize:FS};function PS(n,r,s){const l=this;return d;function d(h){return n.enter("codeIndented"),Je(n,_,"linePrefix",5)(h)}function _(h){const p=l.events[l.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):Le(h)?n.attempt(US,f,c)(h):(n.enter("codeFlowValue"),o(h))}function o(h){return h===null||Le(h)?(n.exit("codeFlowValue"),f(h)):(n.consume(h),o)}function c(h){return n.exit("codeIndented"),r(h)}}function FS(n,r,s){const l=this;return d;function d(f){return l.parser.lazy[l.now().line]?s(f):Le(f)?(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),d):Je(n,_,"linePrefix",5)(f)}function _(f){const o=l.events[l.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?r(f):Le(f)?d(f):s(f)}}const qS={name:"codeText",previous:GS,resolve:$S,tokenize:VS};function $S(n){let r=n.length-4,s=3,l,d;if((n[s][1].type==="lineEnding"||n[s][1].type==="space")&&(n[r][1].type==="lineEnding"||n[r][1].type==="space")){for(l=s;++l<r;)if(n[l][1].type==="codeTextData"){n[s][1].type="codeTextPadding",n[r][1].type="codeTextPadding",s+=2,r-=2;break}}for(l=s-1,r++;++l<=r;)d===void 0?l!==r&&n[l][1].type!=="lineEnding"&&(d=l):(l===r||n[l][1].type==="lineEnding")&&(n[d][1].type="codeTextData",l!==d+2&&(n[d][1].end=n[l-1][1].end,n.splice(d+2,l-d-2),r-=l-d-2,l=d+2),d=void 0);return n}function GS(n){return n!==96||this.events[this.events.length-1][1].type==="characterEscape"}function VS(n,r,s){let l=0,d,_;return f;function f(u){return n.enter("codeText"),n.enter("codeTextSequence"),o(u)}function o(u){return u===96?(n.consume(u),l++,o):(n.exit("codeTextSequence"),c(u))}function c(u){return u===null?s(u):u===32?(n.enter("space"),n.consume(u),n.exit("space"),c):u===96?(_=n.enter("codeTextSequence"),d=0,p(u)):Le(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||Le(u)?(n.exit("codeTextData"),c(u)):(n.consume(u),h)}function p(u){return u===96?(n.consume(u),d++,p):d===l?(n.exit("codeTextSequence"),n.exit("codeText"),r(u)):(_.type="codeTextData",h(u))}}class KS{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 l=s??Number.POSITIVE_INFINITY;return l<this.left.length?this.left.slice(r,l):r>this.left.length?this.right.slice(this.right.length-l+this.left.length,this.right.length-r+this.left.length).reverse():this.left.slice(r).concat(this.right.slice(this.right.length-l+this.left.length).reverse())}splice(r,s,l){const d=s||0;this.setCursor(Math.trunc(r));const _=this.right.splice(this.right.length-d,Number.POSITIVE_INFINITY);return l&&Ga(this.left,l),_.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),Ga(this.left,r)}unshift(r){this.setCursor(0),this.right.push(r)}unshiftMany(r){this.setCursor(0),Ga(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);Ga(this.right,s.reverse())}else{const s=this.right.splice(this.left.length+this.right.length-r,Number.POSITIVE_INFINITY);Ga(this.left,s.reverse())}}}function Ga(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 O_(n){const r={};let s=-1,l,d,_,f,o,c,h;const p=new KS(n);for(;++s<p.length;){for(;s in r;)s=r[s];if(l=p.get(s),s&&l[1].type==="chunkFlow"&&p.get(s-1)[1].type==="listItemPrefix"&&(c=l[1]._tokenizer.events,_=0,_<c.length&&c[_][1].type==="lineEndingBlank"&&(_+=2),_<c.length&&c[_][1].type==="content"))for(;++_<c.length&&c[_][1].type!=="content";)c[_][1].type==="chunkText"&&(c[_][1]._isInFirstContentOfListItem=!0,_++);if(l[0]==="enter")l[1].contentType&&(Object.assign(r,WS(p,s)),s=r[s],h=!0);else if(l[1]._container){for(_=s,d=void 0;_--;)if(f=p.get(_),f[1].type==="lineEnding"||f[1].type==="lineEndingBlank")f[0]==="enter"&&(d&&(p.get(d)[1].type="lineEndingBlank"),f[1].type="lineEnding",d=_);else if(!(f[1].type==="linePrefix"||f[1].type==="listItemIndent"))break;d&&(l[1].end={...p.get(d)[1].start},o=p.slice(d,s),o.unshift(l),p.splice(d,s-d+1,o))}}return jn(n,0,Number.POSITIVE_INFINITY,p.slice(0)),!h}function WS(n,r){const s=n.get(r)[1],l=n.get(r)[2];let d=r-1;const _=[];let f=s._tokenizer;f||(f=l.parser[s.contentType](s.start),s._contentTypeTextTrailing&&(f._contentTypeTextTrailing=!0));const o=f.events,c=[],h={};let p,u,v=-1,w=s,R=0,E=0;const y=[E];for(;w;){for(;n.get(++d)[1]!==w;);_.push(d),w._tokenizer||(p=l.sliceStream(w),w.next||p.push(null),u&&f.defineSkip(w.start),w._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=!0),f.write(p),w._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=void 0)),u=w,w=w.next}for(w=s;++v<o.length;)o[v][0]==="exit"&&o[v-1][0]==="enter"&&o[v][1].type===o[v-1][1].type&&o[v][1].start.line!==o[v][1].end.line&&(E=v+1,y.push(E),w._tokenizer=void 0,w.previous=void 0,w=w.next);for(f.events=[],w?(w._tokenizer=void 0,w.previous=void 0):y.pop(),v=y.length;v--;){const S=o.slice(y[v],y[v+1]),g=_.pop();c.push([g,g+S.length-1]),n.splice(g,2,S)}for(c.reverse(),v=-1;++v<c.length;)h[R+c[v][0]]=R+c[v][1],R+=c[v][1]-c[v][0]-1;return h}const YS={resolve:QS,tokenize:JS},XS={partial:!0,tokenize:ZS};function QS(n){return O_(n),n}function JS(n,r){let s;return l;function l(o){return n.enter("content"),s=n.enter("chunkContent",{contentType:"content"}),d(o)}function d(o){return o===null?_(o):Le(o)?n.check(XS,f,_)(o):(n.consume(o),d)}function _(o){return n.exit("chunkContent"),n.exit("content"),r(o)}function f(o){return n.consume(o),n.exit("chunkContent"),s.next=n.enter("chunkContent",{contentType:"content",previous:s}),s=s.next,d}}function ZS(n,r,s){const l=this;return d;function d(f){return n.exit("chunkContent"),n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),Je(n,_,"linePrefix")}function _(f){if(f===null||Le(f))return s(f);const o=l.events[l.events.length-1];return!l.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?r(f):n.interrupt(l.parser.constructs.flow,s,r)(f)}}function B_(n,r,s,l,d,_,f,o,c){const h=c||Number.POSITIVE_INFINITY;let p=0;return u;function u(S){return S===60?(n.enter(l),n.enter(d),n.enter(_),n.consume(S),n.exit(_),v):S===null||S===32||S===41||To(S)?s(S):(n.enter(l),n.enter(f),n.enter(o),n.enter("chunkString",{contentType:"string"}),E(S))}function v(S){return S===62?(n.enter(_),n.consume(S),n.exit(_),n.exit(d),n.exit(l),r):(n.enter(o),n.enter("chunkString",{contentType:"string"}),w(S))}function w(S){return S===62?(n.exit("chunkString"),n.exit(o),v(S)):S===null||S===60||Le(S)?s(S):(n.consume(S),S===92?R:w)}function R(S){return S===60||S===62||S===92?(n.consume(S),w):w(S)}function E(S){return!p&&(S===null||S===41||ft(S))?(n.exit("chunkString"),n.exit(o),n.exit(f),n.exit(l),r(S)):p<h&&S===40?(n.consume(S),p++,E):S===41?(n.consume(S),p--,E):S===null||S===32||S===40||To(S)?s(S):(n.consume(S),S===92?y:E)}function y(S){return S===40||S===41||S===92?(n.consume(S),E):E(S)}}function j_(n,r,s,l,d,_){const f=this;let o=0,c;return h;function h(w){return n.enter(l),n.enter(d),n.consume(w),n.exit(d),n.enter(_),p}function p(w){return o>999||w===null||w===91||w===93&&!c||w===94&&!o&&"_hiddenFootnoteSupport"in f.parser.constructs?s(w):w===93?(n.exit(_),n.enter(d),n.consume(w),n.exit(d),n.exit(l),r):Le(w)?(n.enter("lineEnding"),n.consume(w),n.exit("lineEnding"),p):(n.enter("chunkString",{contentType:"string"}),u(w))}function u(w){return w===null||w===91||w===93||Le(w)||o++>999?(n.exit("chunkString"),p(w)):(n.consume(w),c||(c=!Ke(w)),w===92?v:u)}function v(w){return w===91||w===92||w===93?(n.consume(w),o++,u):u(w)}}function N_(n,r,s,l,d,_){let f;return o;function o(v){return v===34||v===39||v===40?(n.enter(l),n.enter(d),n.consume(v),n.exit(d),f=v===40?41:v,c):s(v)}function c(v){return v===f?(n.enter(d),n.consume(v),n.exit(d),n.exit(l),r):(n.enter(_),h(v))}function h(v){return v===f?(n.exit(_),c(f)):v===null?s(v):Le(v)?(n.enter("lineEnding"),n.consume(v),n.exit("lineEnding"),Je(n,h,"linePrefix")):(n.enter("chunkString",{contentType:"string"}),p(v))}function p(v){return v===f||v===null||Le(v)?(n.exit("chunkString"),h(v)):(n.consume(v),v===92?u:p)}function u(v){return v===f||v===92?(n.consume(v),p):p(v)}}function Ya(n,r){let s;return l;function l(d){return Le(d)?(n.enter("lineEnding"),n.consume(d),n.exit("lineEnding"),s=!0,l):Ke(d)?Je(n,l,s?"linePrefix":"lineSuffix")(d):r(d)}}const eb={name:"definition",tokenize:nb},tb={partial:!0,tokenize:ib};function nb(n,r,s){const l=this;let d;return _;function _(w){return n.enter("definition"),f(w)}function f(w){return j_.call(l,n,o,s,"definitionLabel","definitionLabelMarker","definitionLabelString")(w)}function o(w){return d=si(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)),w===58?(n.enter("definitionMarker"),n.consume(w),n.exit("definitionMarker"),c):s(w)}function c(w){return ft(w)?Ya(n,h)(w):h(w)}function h(w){return B_(n,p,s,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(w)}function p(w){return n.attempt(tb,u,u)(w)}function u(w){return Ke(w)?Je(n,v,"whitespace")(w):v(w)}function v(w){return w===null||Le(w)?(n.exit("definition"),l.parser.defined.push(d),r(w)):s(w)}}function ib(n,r,s){return l;function l(o){return ft(o)?Ya(n,d)(o):s(o)}function d(o){return N_(n,_,s,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function _(o){return Ke(o)?Je(n,f,"whitespace")(o):f(o)}function f(o){return o===null||Le(o)?r(o):s(o)}}const rb={name:"hardBreakEscape",tokenize:sb};function sb(n,r,s){return l;function l(_){return n.enter("hardBreakEscape"),n.consume(_),d}function d(_){return Le(_)?(n.exit("hardBreakEscape"),r(_)):s(_)}}const ab={name:"headingAtx",resolve:lb,tokenize:ob};function lb(n,r){let s=n.length-2,l=3,d,_;return n[l][1].type==="whitespace"&&(l+=2),s-2>l&&n[s][1].type==="whitespace"&&(s-=2),n[s][1].type==="atxHeadingSequence"&&(l===s-1||s-4>l&&n[s-2][1].type==="whitespace")&&(s-=l+1===s?2:4),s>l&&(d={type:"atxHeadingText",start:n[l][1].start,end:n[s][1].end},_={type:"chunkText",start:n[l][1].start,end:n[s][1].end,contentType:"text"},jn(n,l,s-l+1,[["enter",d,r],["enter",_,r],["exit",_,r],["exit",d,r]])),n}function ob(n,r,s){let l=0;return d;function d(p){return n.enter("atxHeading"),_(p)}function _(p){return n.enter("atxHeadingSequence"),f(p)}function f(p){return p===35&&l++<6?(n.consume(p),f):p===null||ft(p)?(n.exit("atxHeadingSequence"),o(p)):s(p)}function o(p){return p===35?(n.enter("atxHeadingSequence"),c(p)):p===null||Le(p)?(n.exit("atxHeading"),r(p)):Ke(p)?Je(n,o,"whitespace")(p):(n.enter("atxHeadingText"),h(p))}function c(p){return p===35?(n.consume(p),c):(n.exit("atxHeadingSequence"),o(p))}function h(p){return p===null||p===35||ft(p)?(n.exit("atxHeadingText"),o(p)):(n.consume(p),h)}}const cb=["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"],yg=["pre","script","style","textarea"],ub={concrete:!0,name:"htmlFlow",resolveTo:db,tokenize:pb},hb={partial:!0,tokenize:gb},fb={partial:!0,tokenize:mb};function db(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 pb(n,r,s){const l=this;let d,_,f,o,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),v):I===47?(n.consume(I),_=!0,E):I===63?(n.consume(I),d=3,l.interrupt?r:j):hn(I)?(n.consume(I),f=String.fromCharCode(I),y):s(I)}function v(I){return I===45?(n.consume(I),d=2,w):I===91?(n.consume(I),d=5,o=0,R):hn(I)?(n.consume(I),d=4,l.interrupt?r:j):s(I)}function w(I){return I===45?(n.consume(I),l.interrupt?r:j):s(I)}function R(I){const se="CDATA[";return I===se.charCodeAt(o++)?(n.consume(I),o===se.length?l.interrupt?r:U:R):s(I)}function E(I){return hn(I)?(n.consume(I),f=String.fromCharCode(I),y):s(I)}function y(I){if(I===null||I===47||I===62||ft(I)){const se=I===47,ae=f.toLowerCase();return!se&&!_&&yg.includes(ae)?(d=1,l.interrupt?r(I):U(I)):cb.includes(f.toLowerCase())?(d=6,se?(n.consume(I),S):l.interrupt?r(I):U(I)):(d=7,l.interrupt&&!l.parser.lazy[l.now().line]?s(I):_?g(I):b(I))}return I===45||tn(I)?(n.consume(I),f+=String.fromCharCode(I),y):s(I)}function S(I){return I===62?(n.consume(I),l.interrupt?r:U):s(I)}function g(I){return Ke(I)?(n.consume(I),g):B(I)}function b(I){return I===47?(n.consume(I),B):I===58||I===95||hn(I)?(n.consume(I),A):Ke(I)?(n.consume(I),b):B(I)}function A(I){return I===45||I===46||I===58||I===95||tn(I)?(n.consume(I),A):L(I)}function L(I){return I===61?(n.consume(I),D):Ke(I)?(n.consume(I),L):b(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,T):Ke(I)?(n.consume(I),D):k(I)}function T(I){return I===c?(n.consume(I),c=null,M):I===null||Le(I)?s(I):(n.consume(I),T)}function k(I){return I===null||I===34||I===39||I===47||I===60||I===61||I===62||I===96||ft(I)?L(I):(n.consume(I),k)}function M(I){return I===47||I===62||Ke(I)?b(I):s(I)}function B(I){return I===62?(n.consume(I),H):s(I)}function H(I){return I===null||Le(I)?U(I):Ke(I)?(n.consume(I),H):s(I)}function U(I){return I===45&&d===2?(n.consume(I),V):I===60&&d===1?(n.consume(I),K):I===62&&d===4?(n.consume(I),N):I===63&&d===3?(n.consume(I),j):I===93&&d===5?(n.consume(I),z):Le(I)&&(d===6||d===7)?(n.exit("htmlFlowData"),n.check(hb,$,P)(I)):I===null||Le(I)?(n.exit("htmlFlowData"),P(I)):(n.consume(I),U)}function P(I){return n.check(fb,Y,$)(I)}function Y(I){return n.enter("lineEnding"),n.consume(I),n.exit("lineEnding"),X}function X(I){return I===null||Le(I)?P(I):(n.enter("htmlFlowData"),U(I))}function V(I){return I===45?(n.consume(I),j):U(I)}function K(I){return I===47?(n.consume(I),f="",ne):U(I)}function ne(I){if(I===62){const se=f.toLowerCase();return yg.includes(se)?(n.consume(I),N):U(I)}return hn(I)&&f.length<8?(n.consume(I),f+=String.fromCharCode(I),ne):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||Le(I)?(n.exit("htmlFlowData"),$(I)):(n.consume(I),N)}function $(I){return n.exit("htmlFlow"),r(I)}}function mb(n,r,s){const l=this;return d;function d(f){return Le(f)?(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),_):s(f)}function _(f){return l.parser.lazy[l.now().line]?s(f):r(f)}}function gb(n,r,s){return l;function l(d){return n.enter("lineEnding"),n.consume(d),n.exit("lineEnding"),n.attempt(rl,r,s)}}const _b={name:"htmlText",tokenize:vb};function vb(n,r,s){const l=this;let d,_,f;return o;function o(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),b):hn(j)?(n.consume(j),k):s(j)}function h(j){return j===45?(n.consume(j),p):j===91?(n.consume(j),_=0,R):hn(j)?(n.consume(j),g):s(j)}function p(j){return j===45?(n.consume(j),w):s(j)}function u(j){return j===null?s(j):j===45?(n.consume(j),v):Le(j)?(f=u,K(j)):(n.consume(j),u)}function v(j){return j===45?(n.consume(j),w):u(j)}function w(j){return j===62?V(j):j===45?v(j):u(j)}function R(j){const N="CDATA[";return j===N.charCodeAt(_++)?(n.consume(j),_===N.length?E:R):s(j)}function E(j){return j===null?s(j):j===93?(n.consume(j),y):Le(j)?(f=E,K(j)):(n.consume(j),E)}function y(j){return j===93?(n.consume(j),S):E(j)}function S(j){return j===62?V(j):j===93?(n.consume(j),S):E(j)}function g(j){return j===null||j===62?V(j):Le(j)?(f=g,K(j)):(n.consume(j),g)}function b(j){return j===null?s(j):j===63?(n.consume(j),A):Le(j)?(f=b,K(j)):(n.consume(j),b)}function A(j){return j===62?V(j):b(j)}function L(j){return hn(j)?(n.consume(j),D):s(j)}function D(j){return j===45||tn(j)?(n.consume(j),D):T(j)}function T(j){return Le(j)?(f=T,K(j)):Ke(j)?(n.consume(j),T):V(j)}function k(j){return j===45||tn(j)?(n.consume(j),k):j===47||j===62||ft(j)?M(j):s(j)}function M(j){return j===47?(n.consume(j),V):j===58||j===95||hn(j)?(n.consume(j),B):Le(j)?(f=M,K(j)):Ke(j)?(n.consume(j),M):V(j)}function B(j){return j===45||j===46||j===58||j===95||tn(j)?(n.consume(j),B):H(j)}function H(j){return j===61?(n.consume(j),U):Le(j)?(f=H,K(j)):Ke(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):Le(j)?(f=U,K(j)):Ke(j)?(n.consume(j),U):(n.consume(j),Y)}function P(j){return j===d?(n.consume(j),d=void 0,X):j===null?s(j):Le(j)?(f=P,K(j)):(n.consume(j),P)}function Y(j){return j===null||j===34||j===39||j===60||j===61||j===96?s(j):j===47||j===62||ft(j)?M(j):(n.consume(j),Y)}function X(j){return j===47||j===62||ft(j)?M(j):s(j)}function V(j){return j===62?(n.consume(j),n.exit("htmlTextData"),n.exit("htmlText"),r):s(j)}function K(j){return n.exit("htmlTextData"),n.enter("lineEnding"),n.consume(j),n.exit("lineEnding"),ne}function ne(j){return Ke(j)?Je(n,z,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):z(j)}function z(j){return n.enter("htmlTextData"),f(j)}}const Vh={name:"labelEnd",resolveAll:Cb,resolveTo:wb,tokenize:xb},yb={tokenize:Eb},Sb={tokenize:kb},bb={tokenize:Ab};function Cb(n){let r=-1;const s=[];for(;++r<n.length;){const l=n[r][1];if(s.push(n[r]),l.type==="labelImage"||l.type==="labelLink"||l.type==="labelEnd"){const d=l.type==="labelImage"?4:2;l.type="data",r+=d}}return n.length!==s.length&&jn(n,0,n.length,s),n}function wb(n,r){let s=n.length,l=0,d,_,f,o;for(;s--;)if(d=n[s][1],_){if(d.type==="link"||d.type==="labelLink"&&d._inactive)break;n[s][0]==="enter"&&d.type==="labelLink"&&(d._inactive=!0)}else if(f){if(n[s][0]==="enter"&&(d.type==="labelImage"||d.type==="labelLink")&&!d._balanced&&(_=s,d.type!=="labelLink")){l=2;break}}else d.type==="labelEnd"&&(f=s);const c={type:n[_][1].type==="labelLink"?"link":"image",start:{...n[_][1].start},end:{...n[n.length-1][1].end}},h={type:"label",start:{...n[_][1].start},end:{...n[f][1].end}},p={type:"labelText",start:{...n[_+l+2][1].end},end:{...n[f-2][1].start}};return o=[["enter",c,r],["enter",h,r]],o=Xn(o,n.slice(_+1,_+l+3)),o=Xn(o,[["enter",p,r]]),o=Xn(o,Io(r.parser.constructs.insideSpan.null,n.slice(_+l+4,f-3),r)),o=Xn(o,[["exit",p,r],n[f-2],n[f-1],["exit",h,r]]),o=Xn(o,n.slice(f+1)),o=Xn(o,[["exit",c,r]]),jn(n,_,n.length,o),n}function xb(n,r,s){const l=this;let d=l.events.length,_,f;for(;d--;)if((l.events[d][1].type==="labelImage"||l.events[d][1].type==="labelLink")&&!l.events[d][1]._balanced){_=l.events[d][1];break}return o;function o(v){return _?_._inactive?u(v):(f=l.parser.defined.includes(si(l.sliceSerialize({start:_.end,end:l.now()}))),n.enter("labelEnd"),n.enter("labelMarker"),n.consume(v),n.exit("labelMarker"),n.exit("labelEnd"),c):s(v)}function c(v){return v===40?n.attempt(yb,p,f?p:u)(v):v===91?n.attempt(Sb,p,f?h:u)(v):f?p(v):u(v)}function h(v){return n.attempt(bb,p,u)(v)}function p(v){return r(v)}function u(v){return _._balanced=!0,s(v)}}function Eb(n,r,s){return l;function l(u){return n.enter("resource"),n.enter("resourceMarker"),n.consume(u),n.exit("resourceMarker"),d}function d(u){return ft(u)?Ya(n,_)(u):_(u)}function _(u){return u===41?p(u):B_(n,f,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(u)}function f(u){return ft(u)?Ya(n,c)(u):p(u)}function o(u){return s(u)}function c(u){return u===34||u===39||u===40?N_(n,h,s,"resourceTitle","resourceTitleMarker","resourceTitleString")(u):p(u)}function h(u){return ft(u)?Ya(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 kb(n,r,s){const l=this;return d;function d(o){return j_.call(l,n,_,f,"reference","referenceMarker","referenceString")(o)}function _(o){return l.parser.defined.includes(si(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)))?r(o):s(o)}function f(o){return s(o)}}function Ab(n,r,s){return l;function l(_){return n.enter("reference"),n.enter("referenceMarker"),n.consume(_),n.exit("referenceMarker"),d}function d(_){return _===93?(n.enter("referenceMarker"),n.consume(_),n.exit("referenceMarker"),n.exit("reference"),r):s(_)}}const Rb={name:"labelStartImage",resolveAll:Vh.resolveAll,tokenize:Tb};function Tb(n,r,s){const l=this;return d;function d(o){return n.enter("labelImage"),n.enter("labelImageMarker"),n.consume(o),n.exit("labelImageMarker"),_}function _(o){return o===91?(n.enter("labelMarker"),n.consume(o),n.exit("labelMarker"),n.exit("labelImage"),f):s(o)}function f(o){return o===94&&"_hiddenFootnoteSupport"in l.parser.constructs?s(o):r(o)}}const Db={name:"labelStartLink",resolveAll:Vh.resolveAll,tokenize:Mb};function Mb(n,r,s){const l=this;return d;function d(f){return n.enter("labelLink"),n.enter("labelMarker"),n.consume(f),n.exit("labelMarker"),n.exit("labelLink"),_}function _(f){return f===94&&"_hiddenFootnoteSupport"in l.parser.constructs?s(f):r(f)}}const th={name:"lineEnding",tokenize:Lb};function Lb(n,r){return s;function s(l){return n.enter("lineEnding"),n.consume(l),n.exit("lineEnding"),Je(n,r,"linePrefix")}}const ko={name:"thematicBreak",tokenize:Ob};function Ob(n,r,s){let l=0,d;return _;function _(h){return n.enter("thematicBreak"),f(h)}function f(h){return d=h,o(h)}function o(h){return h===d?(n.enter("thematicBreakSequence"),c(h)):l>=3&&(h===null||Le(h))?(n.exit("thematicBreak"),r(h)):s(h)}function c(h){return h===d?(n.consume(h),l++,c):(n.exit("thematicBreakSequence"),Ke(h)?Je(n,o,"whitespace")(h):o(h))}}const Cn={continuation:{tokenize:Hb},exit:Ib,name:"list",tokenize:Nb},Bb={partial:!0,tokenize:Ub},jb={partial:!0,tokenize:zb};function Nb(n,r,s){const l=this,d=l.events[l.events.length-1];let _=d&&d[1].type==="linePrefix"?d[2].sliceSerialize(d[1],!0).length:0,f=0;return o;function o(w){const R=l.containerState.type||(w===42||w===43||w===45?"listUnordered":"listOrdered");if(R==="listUnordered"?!l.containerState.marker||w===l.containerState.marker:kh(w)){if(l.containerState.type||(l.containerState.type=R,n.enter(R,{_container:!0})),R==="listUnordered")return n.enter("listItemPrefix"),w===42||w===45?n.check(ko,s,h)(w):h(w);if(!l.interrupt||w===49)return n.enter("listItemPrefix"),n.enter("listItemValue"),c(w)}return s(w)}function c(w){return kh(w)&&++f<10?(n.consume(w),c):(!l.interrupt||f<2)&&(l.containerState.marker?w===l.containerState.marker:w===41||w===46)?(n.exit("listItemValue"),h(w)):s(w)}function h(w){return n.enter("listItemMarker"),n.consume(w),n.exit("listItemMarker"),l.containerState.marker=l.containerState.marker||w,n.check(rl,l.interrupt?s:p,n.attempt(Bb,v,u))}function p(w){return l.containerState.initialBlankLine=!0,_++,v(w)}function u(w){return Ke(w)?(n.enter("listItemPrefixWhitespace"),n.consume(w),n.exit("listItemPrefixWhitespace"),v):s(w)}function v(w){return l.containerState.size=_+l.sliceSerialize(n.exit("listItemPrefix"),!0).length,r(w)}}function Hb(n,r,s){const l=this;return l.containerState._closeFlow=void 0,n.check(rl,d,_);function d(o){return l.containerState.furtherBlankLines=l.containerState.furtherBlankLines||l.containerState.initialBlankLine,Je(n,r,"listItemIndent",l.containerState.size+1)(o)}function _(o){return l.containerState.furtherBlankLines||!Ke(o)?(l.containerState.furtherBlankLines=void 0,l.containerState.initialBlankLine=void 0,f(o)):(l.containerState.furtherBlankLines=void 0,l.containerState.initialBlankLine=void 0,n.attempt(jb,r,f)(o))}function f(o){return l.containerState._closeFlow=!0,l.interrupt=void 0,Je(n,n.attempt(Cn,r,s),"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function zb(n,r,s){const l=this;return Je(n,d,"listItemIndent",l.containerState.size+1);function d(_){const f=l.events[l.events.length-1];return f&&f[1].type==="listItemIndent"&&f[2].sliceSerialize(f[1],!0).length===l.containerState.size?r(_):s(_)}}function Ib(n){n.exit(this.containerState.type)}function Ub(n,r,s){const l=this;return Je(n,d,"listItemPrefixWhitespace",l.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function d(_){const f=l.events[l.events.length-1];return!Ke(_)&&f&&f[1].type==="listItemPrefixWhitespace"?r(_):s(_)}}const Sg={name:"setextUnderline",resolveTo:Pb,tokenize:Fb};function Pb(n,r){let s=n.length,l,d,_;for(;s--;)if(n[s][0]==="enter"){if(n[s][1].type==="content"){l=s;break}n[s][1].type==="paragraph"&&(d=s)}else n[s][1].type==="content"&&n.splice(s,1),!_&&n[s][1].type==="definition"&&(_=s);const f={type:"setextHeading",start:{...n[l][1].start},end:{...n[n.length-1][1].end}};return n[d][1].type="setextHeadingText",_?(n.splice(d,0,["enter",f,r]),n.splice(_+1,0,["exit",n[l][1],r]),n[l][1].end={...n[_][1].end}):n[l][1]=f,n.push(["exit",f,r]),n}function Fb(n,r,s){const l=this;let d;return _;function _(h){let p=l.events.length,u;for(;p--;)if(l.events[p][1].type!=="lineEnding"&&l.events[p][1].type!=="linePrefix"&&l.events[p][1].type!=="content"){u=l.events[p][1].type==="paragraph";break}return!l.parser.lazy[l.now().line]&&(l.interrupt||u)?(n.enter("setextHeadingLine"),d=h,f(h)):s(h)}function f(h){return n.enter("setextHeadingLineSequence"),o(h)}function o(h){return h===d?(n.consume(h),o):(n.exit("setextHeadingLineSequence"),Ke(h)?Je(n,c,"lineSuffix")(h):c(h))}function c(h){return h===null||Le(h)?(n.exit("setextHeadingLine"),r(h)):s(h)}}const qb={tokenize:$b};function $b(n){const r=this,s=n.attempt(rl,l,n.attempt(this.parser.constructs.flowInitial,d,Je(n,n.attempt(this.parser.constructs.flow,d,n.attempt(YS,d)),"linePrefix")));return s;function l(_){if(_===null){n.consume(_);return}return n.enter("lineEndingBlank"),n.consume(_),n.exit("lineEndingBlank"),r.currentConstruct=void 0,s}function d(_){if(_===null){n.consume(_);return}return n.enter("lineEnding"),n.consume(_),n.exit("lineEnding"),r.currentConstruct=void 0,s}}const Gb={resolveAll:z_()},Vb=H_("string"),Kb=H_("text");function H_(n){return{resolveAll:z_(n==="text"?Wb:void 0),tokenize:r};function r(s){const l=this,d=this.parser.constructs[n],_=s.attempt(d,f,o);return f;function f(p){return h(p)?_(p):o(p)}function o(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"),_(p)):(s.consume(p),c)}function h(p){if(p===null)return!0;const u=d[p];let v=-1;if(u)for(;++v<u.length;){const w=u[v];if(!w.previous||w.previous.call(l,l.previous))return!0}return!1}}}function z_(n){return r;function r(s,l){let d=-1,_;for(;++d<=s.length;)_===void 0?s[d]&&s[d][1].type==="data"&&(_=d,d++):(!s[d]||s[d][1].type!=="data")&&(d!==_+2&&(s[_][1].end=s[d-1][1].end,s.splice(_+2,d-_-2),d=_+2),_=void 0);return n?n(s,l):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 l=n[s-1][1],d=r.sliceStream(l);let _=d.length,f=-1,o=0,c;for(;_--;){const h=d[_];if(typeof h=="string"){for(f=h.length;h.charCodeAt(f-1)===32;)o++,f--;if(f)break;f=-1}else if(h===-2)c=!0,o++;else if(h!==-1){_++;break}}if(r._contentTypeTextTrailing&&s===n.length&&(o=0),o){const h={type:s===n.length||c||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:_?f:l.start._bufferIndex+f,_index:l.start._index+_,line:l.end.line,column:l.end.column-o,offset:l.end.offset-o},end:{...l.end}};l.end={...h.start},l.start.offset===l.end.offset?Object.assign(l,h):(n.splice(s,0,["enter",h,r],["exit",h,r]),s+=2)}s++}return n}const Yb={42:Cn,43:Cn,45:Cn,48:Cn,49:Cn,50:Cn,51:Cn,52:Cn,53:Cn,54:Cn,55:Cn,56:Cn,57:Cn,62:D_},Xb={91:eb},Qb={[-2]:eh,[-1]:eh,32:eh},Jb={35:ab,42:ko,45:[Sg,ko],60:ub,61:Sg,95:ko,96:vg,126:vg},Zb={38:L_,92:M_},eC={[-5]:th,[-4]:th,[-3]:th,33:Rb,38:L_,42:Ah,60:[DS,_b],91:Db,92:[rb,M_],93:Vh,95:Ah,96:qS},tC={null:[Ah,Gb]},nC={null:[42,95]},iC={null:[]},rC=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:nC,contentInitial:Xb,disable:iC,document:Yb,flow:Jb,flowInitial:Qb,insideSpan:tC,string:Zb,text:eC},Symbol.toStringTag,{value:"Module"}));function sC(n,r,s){let l={_bufferIndex:-1,_index:0,line:s&&s.line||1,column:s&&s.column||1,offset:s&&s.offset||0};const d={},_=[];let f=[],o=[];const c={attempt:T(L),check:T(D),consume:g,enter:b,exit:A,interrupt:T(D,{interrupt:!0})},h={code:null,containerState:{},defineSkip:E,events:[],now:R,parser:n,previous:null,sliceSerialize:v,sliceStream:w,write:u};let p=r.tokenize.call(h,c);return r.resolveAll&&_.push(r),h;function u(H){return f=Xn(f,H),y(),f[f.length-1]!==null?[]:(k(r,0),h.events=Io(_,h.events,h),h.events)}function v(H,U){return lC(w(H),U)}function w(H){return aC(f,H)}function R(){const{_bufferIndex:H,_index:U,line:P,column:Y,offset:X}=l;return{_bufferIndex:H,_index:U,line:P,column:Y,offset:X}}function E(H){d[H.line]=H.column,B()}function y(){let H;for(;l._index<f.length;){const U=f[l._index];if(typeof U=="string")for(H=l._index,l._bufferIndex<0&&(l._bufferIndex=0);l._index===H&&l._bufferIndex<U.length;)S(U.charCodeAt(l._bufferIndex));else S(U)}}function S(H){p=p(H)}function g(H){Le(H)?(l.line++,l.column=1,l.offset+=H===-3?2:1,B()):H!==-1&&(l.column++,l.offset++),l._bufferIndex<0?l._index++:(l._bufferIndex++,l._bufferIndex===f[l._index].length&&(l._bufferIndex=-1,l._index++)),h.previous=H}function b(H,U){const P=U||{};return P.type=H,P.start=R(),h.events.push(["enter",P,h]),o.push(P),P}function A(H){const U=o.pop();return U.end=R(),h.events.push(["exit",U,h]),U}function L(H,U){k(H,U.from)}function D(H,U){U.restore()}function T(H,U){return P;function P(Y,X,V){let K,ne,z,j;return Array.isArray(Y)?$(Y):"tokenize"in Y?$([Y]):N(Y);function N(he){return W;function W(q){const ie=q!==null&&he[q],ee=q!==null&&he.null,le=[...Array.isArray(ie)?ie:ie?[ie]:[],...Array.isArray(ee)?ee:ee?[ee]:[]];return $(le)(q)}}function $(he){return K=he,ne=0,he.length===0?V:I(he[ne])}function I(he){return W;function W(q){return j=M(),z=he,he.partial||(h.currentConstruct=he),he.name&&h.parser.constructs.disable.null.includes(he.name)?ae():he.tokenize.call(U?Object.assign(Object.create(h),U):h,c,se,ae)(q)}}function se(he){return H(z,j),X}function ae(he){return j.restore(),++ne<K.length?I(K[ne]):V}}}function k(H,U){H.resolveAll&&!_.includes(H)&&_.push(H),H.resolve&&jn(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=R(),U=h.previous,P=h.currentConstruct,Y=h.events.length,X=Array.from(o);return{from:Y,restore:V};function V(){l=H,h.previous=U,h.currentConstruct=P,h.events.length=Y,o=X,B()}}function B(){l.line in d&&l.column<2&&(l.column=d[l.line],l.offset+=d[l.line]-1)}}function aC(n,r){const s=r.start._index,l=r.start._bufferIndex,d=r.end._index,_=r.end._bufferIndex;let f;if(s===d)f=[n[s].slice(l,_)];else{if(f=n.slice(s,d),l>-1){const o=f[0];typeof o=="string"?f[0]=o.slice(l):f.shift()}_>0&&f.push(n[d].slice(0,_))}return f}function lC(n,r){let s=-1;const l=[];let d;for(;++s<n.length;){const _=n[s];let f;if(typeof _=="string")f=_;else switch(_){case-5:{f="\r";break}case-4:{f=`
57
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(k){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),y.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 y.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&&!(y.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 Y=U.translateBufferLineToString(k[1],!1);let X=this._convertViewportColToCharacterIndex(P,k[0]),V=X;const K=k[0]-X;let ne=0,z=0,j=0,N=0;if(Y.charAt(X)===" "){for(;X>0&&Y.charAt(X-1)===" ";)X--;for(;V<Y.length&&Y.charAt(V+1)===" ";)V++}else{let se=k[0],ae=k[0];P.getWidth(se)===0&&(ne++,se--),P.getWidth(ae)===2&&(z++,ae++);const he=P.getString(ae).length;for(he>1&&(N+=he-1,V+=he-1);se>0&&X>0&&!this._isCharWordSeparator(P.loadCell(se-1,this._workCell));){P.loadCell(se-1,this._workCell);const W=this._workCell.getChars().length;this._workCell.getWidth()===0?(ne++,se--):W>1&&(j+=W-1,X-=W-1),X--,se--}for(;ae<P.length&&V+1<Y.length&&!this._isCharWordSeparator(P.loadCell(ae+1,this._workCell));){P.loadCell(ae+1,this._workCell);const W=this._workCell.getChars().length;this._workCell.getWidth()===2?(z++,ae++):W>1&&(N+=W-1,V+=W-1),V++,ae++}}V++;let $=X+K-ne+j,I=Math.min(this._bufferService.cols,V-X+ne+z-j-N);if(M||Y.slice(X,V).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 he=this._bufferService.cols-ae.start;$-=he,I+=he}}}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)}};o.SelectionService=T=h([p(3,A.IBufferService),p(4,A.ICoreService),p(5,R.IMouseService),p(6,A.IOptionsService),p(7,R.IRenderService),p(8,R.ICoreBrowserService)],T)},4725:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ILinkProviderService=o.IThemeService=o.ICharacterJoinerService=o.ISelectionService=o.IRenderService=o.IMouseService=o.ICoreBrowserService=o.ICharSizeService=void 0;const h=c(8343);o.ICharSizeService=(0,h.createDecorator)("CharSizeService"),o.ICoreBrowserService=(0,h.createDecorator)("CoreBrowserService"),o.IMouseService=(0,h.createDecorator)("MouseService"),o.IRenderService=(0,h.createDecorator)("RenderService"),o.ISelectionService=(0,h.createDecorator)("SelectionService"),o.ICharacterJoinerService=(0,h.createDecorator)("CharacterJoinerService"),o.IThemeService=(0,h.createDecorator)("ThemeService"),o.ILinkProviderService=(0,h.createDecorator)("LinkProviderService")},6731:function(f,o,c){var h=this&&this.__decorate||function(T,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(T,k,M,B);else for(var Y=T.length-1;Y>=0;Y--)(H=T[Y])&&(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(T,k){return function(M,B){k(M,B,T)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const u=c(7239),b=c(8055),w=c(8460),R=c(844),E=c(2585),v=b.css.toColor("#ffffff"),y=b.css.toColor("#000000"),_=b.css.toColor("#ffffff"),S=b.css.toColor("#000000"),A={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};o.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const T=[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];T.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;T.push({css:b.channels.toCss(B,B,B),rgba:b.channels.toRgba(B,B,B)})}return T})());let L=o.ThemeService=class extends R.Disposable{get colors(){return this._colors}constructor(T){super(),this._optionsService=T,this._contrastCache=new u.ColorContrastCache,this._halfContrastCache=new u.ColorContrastCache,this._onChangeColors=this.register(new w.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:v,background:y,cursor:_,cursorAccent:S,selectionForeground:void 0,selectionBackgroundTransparent:A,selectionBackgroundOpaque:b.color.blend(y,A),selectionInactiveBackgroundTransparent:A,selectionInactiveBackgroundOpaque:b.color.blend(y,A),ansi:o.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(T={}){const k=this._colors;if(k.foreground=D(T.foreground,v),k.background=D(T.background,y),k.cursor=D(T.cursor,_),k.cursorAccent=D(T.cursorAccent,S),k.selectionBackgroundTransparent=D(T.selectionBackground,A),k.selectionBackgroundOpaque=b.color.blend(k.background,k.selectionBackgroundTransparent),k.selectionInactiveBackgroundTransparent=D(T.selectionInactiveBackground,k.selectionBackgroundTransparent),k.selectionInactiveBackgroundOpaque=b.color.blend(k.background,k.selectionInactiveBackgroundTransparent),k.selectionForeground=T.selectionForeground?D(T.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=o.DEFAULT_ANSI_COLORS.slice(),k.ansi[0]=D(T.black,o.DEFAULT_ANSI_COLORS[0]),k.ansi[1]=D(T.red,o.DEFAULT_ANSI_COLORS[1]),k.ansi[2]=D(T.green,o.DEFAULT_ANSI_COLORS[2]),k.ansi[3]=D(T.yellow,o.DEFAULT_ANSI_COLORS[3]),k.ansi[4]=D(T.blue,o.DEFAULT_ANSI_COLORS[4]),k.ansi[5]=D(T.magenta,o.DEFAULT_ANSI_COLORS[5]),k.ansi[6]=D(T.cyan,o.DEFAULT_ANSI_COLORS[6]),k.ansi[7]=D(T.white,o.DEFAULT_ANSI_COLORS[7]),k.ansi[8]=D(T.brightBlack,o.DEFAULT_ANSI_COLORS[8]),k.ansi[9]=D(T.brightRed,o.DEFAULT_ANSI_COLORS[9]),k.ansi[10]=D(T.brightGreen,o.DEFAULT_ANSI_COLORS[10]),k.ansi[11]=D(T.brightYellow,o.DEFAULT_ANSI_COLORS[11]),k.ansi[12]=D(T.brightBlue,o.DEFAULT_ANSI_COLORS[12]),k.ansi[13]=D(T.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),k.ansi[14]=D(T.brightCyan,o.DEFAULT_ANSI_COLORS[14]),k.ansi[15]=D(T.brightWhite,o.DEFAULT_ANSI_COLORS[15]),T.extendedAnsi){const M=Math.min(k.ansi.length-16,T.extendedAnsi.length);for(let B=0;B<M;B++)k.ansi[B+16]=D(T.extendedAnsi[B],o.DEFAULT_ANSI_COLORS[B+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(T){this._restoreColor(T),this._onChangeColors.fire(this.colors)}_restoreColor(T){if(T!==void 0)switch(T){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[T]=this._restoreColors.ansi[T]}else for(let k=0;k<this._restoreColors.ansi.length;++k)this._colors.ansi[k]=this._restoreColors.ansi[k]}modifyColors(T){T(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function D(T,k){if(T!==void 0)try{return b.css.toColor(T)}catch{}return k}o.ThemeService=L=h([p(0,E.IOptionsService)],L)},6349:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const h=c(8460),p=c(844);class u extends p.Disposable{constructor(w){super(),this._maxLength=w,this.onDeleteEmitter=this.register(new h.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new h.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new h.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(w){if(this._maxLength===w)return;const R=new Array(w);for(let E=0;E<Math.min(w,this.length);E++)R[E]=this._array[this._getCyclicIndex(E)];this._array=R,this._maxLength=w,this._startIndex=0}get length(){return this._length}set length(w){if(w>this._length)for(let R=this._length;R<w;R++)this._array[R]=void 0;this._length=w}get(w){return this._array[this._getCyclicIndex(w)]}set(w,R){this._array[this._getCyclicIndex(w)]=R}push(w){this._array[this._getCyclicIndex(this._length)]=w,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(w,R,...E){if(R){for(let v=w;v<this._length-R;v++)this._array[this._getCyclicIndex(v)]=this._array[this._getCyclicIndex(v+R)];this._length-=R,this.onDeleteEmitter.fire({index:w,amount:R})}for(let v=this._length-1;v>=w;v--)this._array[this._getCyclicIndex(v+E.length)]=this._array[this._getCyclicIndex(v)];for(let v=0;v<E.length;v++)this._array[this._getCyclicIndex(w+v)]=E[v];if(E.length&&this.onInsertEmitter.fire({index:w,amount:E.length}),this._length+E.length>this._maxLength){const v=this._length+E.length-this._maxLength;this._startIndex+=v,this._length=this._maxLength,this.onTrimEmitter.fire(v)}else this._length+=E.length}trimStart(w){w>this._length&&(w=this._length),this._startIndex+=w,this._length-=w,this.onTrimEmitter.fire(w)}shiftElements(w,R,E){if(!(R<=0)){if(w<0||w>=this._length)throw new Error("start argument out of range");if(w+E<0)throw new Error("Cannot shift elements in list beyond index 0");if(E>0){for(let y=R-1;y>=0;y--)this.set(w+y+E,this.get(w+y));const v=w+R+E-this._length;if(v>0)for(this._length+=v;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let v=0;v<R;v++)this.set(w+v+E,this.get(w+v))}}_getCyclicIndex(w){return(this._startIndex+w)%this._maxLength}}o.CircularList=u},1439:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.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,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;let c=0,h=0,p=0,u=0;var b,w,R,E,v;function y(S){const A=S.toString(16);return A.length<2?"0"+A:A}function _(S,A){return S<A?(A+.05)/(S+.05):(S+.05)/(A+.05)}o.NULL_COLOR={css:"#00000000",rgba:0},(function(S){S.toCss=function(A,L,D,T){return T!==void 0?`#${y(A)}${y(L)}${y(D)}${y(T)}`:`#${y(A)}${y(L)}${y(D)}`},S.toRgba=function(A,L,D,T=255){return(A<<24|L<<16|D<<8|T)>>>0},S.toColor=function(A,L,D,T){return{css:S.toCss(A,L,D,T),rgba:S.toRgba(A,L,D,T)}}})(b||(o.channels=b={})),(function(S){function A(L,D){return u=Math.round(255*D),[c,h,p]=v.toChannels(L.rgba),{css:b.toCss(c,h,p,u),rgba:b.toRgba(c,h,p,u)}}S.blend=function(L,D){if(u=(255&D.rgba)/255,u===1)return{css:D.css,rgba:D.rgba};const T=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((T-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)}},S.isOpaque=function(L){return(255&L.rgba)==255},S.ensureContrastRatio=function(L,D,T){const k=v.ensureContrastRatio(L.rgba,D.rgba,T);if(k)return b.toColor(k>>24&255,k>>16&255,k>>8&255)},S.opaque=function(L){const D=(255|L.rgba)>>>0;return[c,h,p]=v.toChannels(D),{css:b.toCss(c,h,p),rgba:D}},S.opacity=A,S.multiplyOpacity=function(L,D){return u=255&L.rgba,A(L,u*D/255)},S.toColorRGB=function(L){return[L.rgba>>24&255,L.rgba>>16&255,L.rgba>>8&255]}})(w||(o.color=w={})),(function(S){let A,L;try{const D=document.createElement("canvas");D.width=1,D.height=1;const T=D.getContext("2d",{willReadFrequently:!0});T&&(A=T,A.globalCompositeOperation="copy",L=A.createLinearGradient(0,0,1,1))}catch{}S.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 T=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(T)return c=parseInt(T[1]),h=parseInt(T[2]),p=parseInt(T[3]),u=Math.round(255*(T[5]===void 0?1:parseFloat(T[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}}})(R||(o.css=R={})),(function(S){function A(L,D,T){const k=L/255,M=D/255,B=T/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))}S.relativeLuminance=function(L){return A(L>>16&255,L>>8&255,255&L)},S.relativeLuminance2=A})(E||(o.rgb=E={})),(function(S){function A(D,T,k){const M=D>>24&255,B=D>>16&255,H=D>>8&255;let U=T>>24&255,P=T>>16&255,Y=T>>8&255,X=_(E.relativeLuminance2(U,P,Y),E.relativeLuminance2(M,B,H));for(;X<k&&(U>0||P>0||Y>0);)U-=Math.max(0,Math.ceil(.1*U)),P-=Math.max(0,Math.ceil(.1*P)),Y-=Math.max(0,Math.ceil(.1*Y)),X=_(E.relativeLuminance2(U,P,Y),E.relativeLuminance2(M,B,H));return(U<<24|P<<16|Y<<8|255)>>>0}function L(D,T,k){const M=D>>24&255,B=D>>16&255,H=D>>8&255;let U=T>>24&255,P=T>>16&255,Y=T>>8&255,X=_(E.relativeLuminance2(U,P,Y),E.relativeLuminance2(M,B,H));for(;X<k&&(U<255||P<255||Y<255);)U=Math.min(255,U+Math.ceil(.1*(255-U))),P=Math.min(255,P+Math.ceil(.1*(255-P))),Y=Math.min(255,Y+Math.ceil(.1*(255-Y))),X=_(E.relativeLuminance2(U,P,Y),E.relativeLuminance2(M,B,H));return(U<<24|P<<16|Y<<8|255)>>>0}S.blend=function(D,T){if(u=(255&T)/255,u===1)return T;const k=T>>24&255,M=T>>16&255,B=T>>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)},S.ensureContrastRatio=function(D,T,k){const M=E.relativeLuminance(D>>8),B=E.relativeLuminance(T>>8);if(_(M,B)<k){if(B<M){const P=A(D,T,k),Y=_(M,E.relativeLuminance(P>>8));if(Y<k){const X=L(D,T,k);return Y>_(M,E.relativeLuminance(X>>8))?P:X}return P}const H=L(D,T,k),U=_(M,E.relativeLuminance(H>>8));if(U<k){const P=A(D,T,k);return U>_(M,E.relativeLuminance(P>>8))?H:P}return H}},S.reduceLuminance=A,S.increaseLuminance=L,S.toChannels=function(D){return[D>>24&255,D>>16&255,D>>8&255,255&D]}})(v||(o.rgba=v={})),o.toPaddedHex=y,o.contrastRatio=_},8969:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const h=c(844),p=c(2585),u=c(4348),b=c(7866),w=c(744),R=c(7302),E=c(6975),v=c(8460),y=c(1753),_=c(1480),S=c(7994),A=c(9282),L=c(5435),D=c(5981),T=c(2660);let k=!1;class M extends h.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new v.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 v.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new v.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new v.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new v.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new v.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new v.EventEmitter),this._instantiationService=new u.InstantiationService,this.optionsService=this.register(new R.OptionsService(H)),this._instantiationService.setService(p.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(w.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(y.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(S.CharsetService),this._instantiationService.setService(p.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(T.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,v.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,v.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,v.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,v.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,v.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,w.MINIMUM_COLS),U=Math.max(U,w.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()}))}}}o.CoreTerminal=M},8460:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.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)}},o.forwardEvent=function(c,h){return c((p=>h.fire(p)))},o.runAndSubscribe=function(c,h){return h(void 0),c((p=>h(p)))}},5435:function(f,o,c){var h=this&&this.__decorate||function(ne,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(ne,z,j,N);else for(var ae=ne.length-1;ae>=0;ae--)($=ne[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(ne,z){return function(j,N){z(j,N,ne)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const u=c(2584),b=c(7116),w=c(2015),R=c(844),E=c(482),v=c(8437),y=c(8460),_=c(643),S=c(511),A=c(3734),L=c(2585),D=c(1480),T=c(6242),k=c(6351),M=c(5941),B={"(":0,")":1,"*":2,"+":3,"-":1,".":2},H=131072;function U(ne,z){if(ne>24)return z.setWinLines||!1;switch(ne){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(ne){ne[ne.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",ne[ne.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(P||(o.WindowsOptionsReportType=P={}));let Y=0;class X extends R.Disposable{getAttrData(){return this._curAttrData}constructor(z,j,N,$,I,se,ae,he,W=new w.EscapeSequenceParser){super(),this._bufferService=z,this._charsetService=j,this._coreService=N,this._logService=$,this._optionsService=I,this._oscLinkService=se,this._coreMouseService=ae,this._unicodeService=he,this._parser=W,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new E.StringToUtf32,this._utf8Decoder=new E.Utf8ToUtf32,this._workCell=new S.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=v.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=v.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new y.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new y.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new y.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new y.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new y.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new y.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new y.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new y.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new y.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new y.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new y.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new y.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new y.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new V(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((q=>this._activeBuffer=q.activeBuffer))),this._parser.setCsiHandlerFallback(((q,ie)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(q),params:ie.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,ie,ee)=>{this._logService.debug("Unknown OSC code: ",{identifier:q,action:ie,data:ee})})),this._parser.setDcsHandlerFallback(((q,ie,ee)=>{ie==="HOOK"&&(ee=ee.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(q),action:ie,payload:ee})})),this._parser.setPrintHandler(((q,ie,ee)=>this.print(q,ie,ee))),this._parser.registerCsiHandler({final:"@"},(q=>this.insertChars(q))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(q=>this.scrollLeft(q))),this._parser.registerCsiHandler({final:"A"},(q=>this.cursorUp(q))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(q=>this.scrollRight(q))),this._parser.registerCsiHandler({final:"B"},(q=>this.cursorDown(q))),this._parser.registerCsiHandler({final:"C"},(q=>this.cursorForward(q))),this._parser.registerCsiHandler({final:"D"},(q=>this.cursorBackward(q))),this._parser.registerCsiHandler({final:"E"},(q=>this.cursorNextLine(q))),this._parser.registerCsiHandler({final:"F"},(q=>this.cursorPrecedingLine(q))),this._parser.registerCsiHandler({final:"G"},(q=>this.cursorCharAbsolute(q))),this._parser.registerCsiHandler({final:"H"},(q=>this.cursorPosition(q))),this._parser.registerCsiHandler({final:"I"},(q=>this.cursorForwardTab(q))),this._parser.registerCsiHandler({final:"J"},(q=>this.eraseInDisplay(q,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(q=>this.eraseInDisplay(q,!0))),this._parser.registerCsiHandler({final:"K"},(q=>this.eraseInLine(q,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(q=>this.eraseInLine(q,!0))),this._parser.registerCsiHandler({final:"L"},(q=>this.insertLines(q))),this._parser.registerCsiHandler({final:"M"},(q=>this.deleteLines(q))),this._parser.registerCsiHandler({final:"P"},(q=>this.deleteChars(q))),this._parser.registerCsiHandler({final:"S"},(q=>this.scrollUp(q))),this._parser.registerCsiHandler({final:"T"},(q=>this.scrollDown(q))),this._parser.registerCsiHandler({final:"X"},(q=>this.eraseChars(q))),this._parser.registerCsiHandler({final:"Z"},(q=>this.cursorBackwardTab(q))),this._parser.registerCsiHandler({final:"`"},(q=>this.charPosAbsolute(q))),this._parser.registerCsiHandler({final:"a"},(q=>this.hPositionRelative(q))),this._parser.registerCsiHandler({final:"b"},(q=>this.repeatPrecedingCharacter(q))),this._parser.registerCsiHandler({final:"c"},(q=>this.sendDeviceAttributesPrimary(q))),this._parser.registerCsiHandler({prefix:">",final:"c"},(q=>this.sendDeviceAttributesSecondary(q))),this._parser.registerCsiHandler({final:"d"},(q=>this.linePosAbsolute(q))),this._parser.registerCsiHandler({final:"e"},(q=>this.vPositionRelative(q))),this._parser.registerCsiHandler({final:"f"},(q=>this.hVPosition(q))),this._parser.registerCsiHandler({final:"g"},(q=>this.tabClear(q))),this._parser.registerCsiHandler({final:"h"},(q=>this.setMode(q))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(q=>this.setModePrivate(q))),this._parser.registerCsiHandler({final:"l"},(q=>this.resetMode(q))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(q=>this.resetModePrivate(q))),this._parser.registerCsiHandler({final:"m"},(q=>this.charAttributes(q))),this._parser.registerCsiHandler({final:"n"},(q=>this.deviceStatus(q))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(q=>this.deviceStatusPrivate(q))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(q=>this.softReset(q))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(q=>this.setCursorStyle(q))),this._parser.registerCsiHandler({final:"r"},(q=>this.setScrollRegion(q))),this._parser.registerCsiHandler({final:"s"},(q=>this.saveCursor(q))),this._parser.registerCsiHandler({final:"t"},(q=>this.windowOptions(q))),this._parser.registerCsiHandler({final:"u"},(q=>this.restoreCursor(q))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(q=>this.insertColumns(q))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(q=>this.deleteColumns(q))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(q=>this.selectProtected(q))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(q=>this.requestMode(q,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(q=>this.requestMode(q,!1))),this._parser.setExecuteHandler(u.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(u.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(u.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(u.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(u.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(u.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(u.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(u.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(u.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(u.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(u.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(u.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new T.OscHandler((q=>(this.setTitle(q),this.setIconName(q),!0)))),this._parser.registerOscHandler(1,new T.OscHandler((q=>this.setIconName(q)))),this._parser.registerOscHandler(2,new T.OscHandler((q=>this.setTitle(q)))),this._parser.registerOscHandler(4,new T.OscHandler((q=>this.setOrReportIndexedColor(q)))),this._parser.registerOscHandler(8,new T.OscHandler((q=>this.setHyperlink(q)))),this._parser.registerOscHandler(10,new T.OscHandler((q=>this.setOrReportFgColor(q)))),this._parser.registerOscHandler(11,new T.OscHandler((q=>this.setOrReportBgColor(q)))),this._parser.registerOscHandler(12,new T.OscHandler((q=>this.setOrReportCursorColor(q)))),this._parser.registerOscHandler(104,new T.OscHandler((q=>this.restoreIndexedColor(q)))),this._parser.registerOscHandler(110,new T.OscHandler((q=>this.restoreFgColor(q)))),this._parser.registerOscHandler(111,new T.OscHandler((q=>this.restoreBgColor(q)))),this._parser.registerOscHandler(112,new T.OscHandler((q=>this.restoreCursorColor(q)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const q in 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,ie)=>this.requestStatusString(q,ie))))}_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 ie=q+H<z.length?q+H:z.length,ee=typeof z=="string"?this._stringDecoder.decode(z.substring(q,ie),this._parseBuffer):this._utf8Decoder.decode(z.subarray(q,ie),this._parseBuffer);if(N=this._parser.parse(this._parseBuffer,ee))return this._preserveStack($,I,ee,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 he=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),W=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);W<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(W,this._bufferService.rows-1),Math.min(he,this._bufferService.rows-1))}print(z,j,N){let $,I;const se=this._charsetService.charset,ae=this._optionsService.rawOptions.screenReaderMode,he=this._bufferService.cols,W=this._coreService.decPrivateModes.wraparound,q=this._coreService.modes.insertMode,ie=this._curAttrData;let ee=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&N-j>0&&ee.getWidth(this._activeBuffer.x-1)===2&&ee.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ie);let le=this._parser.precedingJoinState;for(let ve=j;ve<N;++ve){if($=z[ve],$<127&&se){const ct=se[String.fromCharCode($)];ct&&($=ct.charCodeAt(0))}const De=this._unicodeService.charProperties($,le);I=D.UnicodeService.extractWidth(De);const Ne=D.UnicodeService.extractShouldJoin(De),je=Ne?D.UnicodeService.extractWidth(le):0;if(le=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-je>he){if(W){const ct=ee;let Ee=this._activeBuffer.x-je;for(this._activeBuffer.x=je,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),ee=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),je>0&&ee instanceof v.BufferLine&&ee.copyCellsFrom(ct,Ee,0,je,!1);Ee<he;)ct.setCellFromCodepoint(Ee++,0,1,ie)}else if(this._activeBuffer.x=he-1,I===2)continue}if(Ne&&this._activeBuffer.x){const ct=ee.getWidth(this._activeBuffer.x-1)?1:2;ee.addCodepointToCell(this._activeBuffer.x-ct,$,I);for(let Ee=I-je;--Ee>=0;)ee.setCellFromCodepoint(this._activeBuffer.x++,0,0,ie)}else if(q&&(ee.insertCells(this._activeBuffer.x,I-je,this._activeBuffer.getNullCell(ie)),ee.getWidth(he-1)===2&&ee.setCellFromCodepoint(he-1,_.NULL_CELL_CODE,_.NULL_CELL_WIDTH,ie)),ee.setCellFromCodepoint(this._activeBuffer.x++,$,I,ie),I>0)for(;--I;)ee.setCellFromCodepoint(this._activeBuffer.x++,0,0,ie)}this._parser.precedingJoinState=le,this._activeBuffer.x<he&&N-j>0&&ee.getWidth(this._activeBuffer.x)===0&&!ee.hasContent(this._activeBuffer.x)&&ee.setCellFromCodepoint(this._activeBuffer.x,0,1,ie),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 T.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(v.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 he=0;for(let q=0;q<se.length;){const ie=se.codePointAt(q)||0;ae[he++]=ie,q+=ie>65535?2:1}let W=he;for(let q=1;q<N;++q)ae.copyWithin(W,0,he),W+=he;return this.print(ae,0,W),!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:he}=this._bufferService,{active:W,alt:q}=ae,ie=this._optionsService.rawOptions,ee=Ne=>Ne?1:2,le=z.params[0];return ve=le,De=j?le===2?4:le===4?ee(se.modes.insertMode):le===12?3:le===20?ee(ie.convertEol):0:le===1?ee(N.applicationCursorKeys):le===3?ie.windowOptions.setWinLines?he===80?2:he===132?1:0:0:le===6?ee(N.origin):le===7?ee(N.wraparound):le===8?3:le===9?ee($==="X10"):le===12?ee(ie.cursorBlink):le===25?ee(!se.isCursorHidden):le===45?ee(N.reverseWraparound):le===66?ee(N.applicationKeypad):le===67?4:le===1e3?ee($==="VT200"):le===1002?ee($==="DRAG"):le===1003?ee($==="ANY"):le===1004?ee(N.sendFocus):le===1005?4:le===1006?ee(I==="SGR"):le===1015?4:le===1016?ee(I==="SGR_PIXELS"):le===1048?1:le===47||le===1047||le===1049?ee(W===q):le===2004?ee(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 he=0;do $[1]===5&&(I=1),$[se+he+1+I]=ae[he];while(++he<ae.length&&he+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=v.DEFAULT_ATTR_DATA.fg,z.bg=v.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&v.DEFAULT_ATTR_DATA.fg):N===49?($.bg&=-67108864,$.bg|=16777215&v.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&v.DEFAULT_ATTR_DATA.fg,$.bg&=-67108864,$.bg|=16777215&v.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=v.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(K(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[$]);K(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=v.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=v.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 S.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)}}o.InputHandler=X;let V=class{constructor(ne){this._bufferService=ne,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(ne){ne<this.start?this.start=ne:ne>this.end&&(this.end=ne)}markRangeDirty(ne,z){ne>z&&(Y=ne,ne=z,z=Y),ne<this.start&&(this.start=ne),z>this.end&&(this.end=z)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function K(ne){return 0<=ne&&ne<256}V=h([p(0,L.IBufferService)],V)},844:(f,o)=>{function c(h){for(const p of h)p.dispose();h.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.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)}},o.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}},o.toDisposable=function(h){return{dispose:h}},o.disposeArray=c,o.getDisposeArrayDisposable=function(h){return{dispose:()=>c(h)}}},1505:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.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={}}}o.TwoKeyMap=c,o.FourKeyMap=class{constructor(){this._data=new c}set(h,p,u,b,w){this._data.get(h,p)||this._data.set(h,p,new c),this._data.get(h,p).set(u,b,w)}get(h,p,u,b){var w;return(w=this._data.get(h,p))==null?void 0:w.get(u,b)}clear(){this._data.clear()}}},6114:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof process<"u"&&"title"in process;const c=o.isNode?"node":navigator.userAgent,h=o.isNode?"node":navigator.platform;o.isFirefox=c.includes("Firefox"),o.isLegacyEdge=c.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(c),o.getSafariVersion=function(){if(!o.isSafari)return 0;const p=c.match(/Version\/(\d+)/);return p===null||p.length<2?0:parseInt(p[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(h),o.isIpad=h==="iPad",o.isIphone=h==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(h),o.isLinux=h.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(c)},6106:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SortedList=void 0;let c=0;o.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 w=this._getKey(this._array[b]);if(w>h)u=b-1;else{if(!(w<h)){for(;b>0&&this._getKey(this._array[b-1])===h;)b--;return b}p=b+1}}return p}}},7226:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const h=c(6114);class p{constructor(){this._tasks=[],this._i=0}enqueue(w){this._tasks.push(w),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(w){this._idleCallback=void 0;let R=0,E=0,v=w.timeRemaining(),y=0;for(;this._i<this._tasks.length;){if(R=Date.now(),this._tasks[this._i]()||this._i++,R=Math.max(1,Date.now()-R),E=Math.max(R,E),y=w.timeRemaining(),1.5*E>y)return v-R<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(v-R))}ms`),void this._start();v=y}this.clear()}}class u extends p{_requestCallback(w){return setTimeout((()=>w(this._createDeadline(16))))}_cancelCallback(w){clearTimeout(w)}_createDeadline(w){const R=Date.now()+w;return{timeRemaining:()=>Math.max(0,R-Date.now())}}}o.PriorityTaskQueue=u,o.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends p{_requestCallback(b){return requestIdleCallback(b)}_cancelCallback(b){cancelIdleCallback(b)}}:u,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(b){this._queue.clear(),this._queue.enqueue(b)}flush(){this._queue.flush()}}},9282:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.updateWindowsModeWrappedState=void 0;const h=c(643);o.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),w=p.buffer.lines.get(p.buffer.ybase+p.buffer.y);w&&b&&(w.isWrapped=b[h.CHAR_DATA_CODE_INDEX]!==h.NULL_CELL_CODE&&b[h.CHAR_DATA_CODE_INDEX]!==h.WHITESPACE_CELL_CODE)}},3734:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.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}}o.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}}o.ExtendedAttrs=h},9092:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const h=c(6349),p=c(7226),u=c(3734),b=c(8437),w=c(4634),R=c(511),E=c(643),v=c(4863),y=c(7116);o.MAX_BUFFER_SIZE=4294967295,o.Buffer=class{constructor(_,S,A){this._hasScrollback=_,this._optionsService=S,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=y.DEFAULT_CHARSET,this.markers=[],this._nullCell=R.CellData.fromCharData([0,E.NULL_CELL_CHAR,E.NULL_CELL_WIDTH,E.NULL_CELL_CODE]),this._whitespaceCell=R.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(_,S){return new b.BufferLine(this._bufferService.cols,this.getNullCell(_),S)}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 S=_+this._optionsService.rawOptions.scrollback;return S>o.MAX_BUFFER_SIZE?o.MAX_BUFFER_SIZE:S}fillViewportRows(_){if(this.lines.length===0){_===void 0&&(_=b.DEFAULT_ATTR_DATA);let S=this._rows;for(;S--;)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(_,S){const A=this.getNullCell(b.DEFAULT_ATTR_DATA);let L=0;const D=this._getCorrectBufferLength(S);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 T=0;if(this._rows<S)for(let k=this._rows;k<S;k++)this.lines.length<S+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+T+1?(this.ybase--,T++,this.ydisp>0&&this.ydisp--):this.lines.push(new b.BufferLine(_,A)));else for(let k=this._rows;k>S;k--)this.lines.length>S+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,S-1),T&&(this.y+=T),this.savedX=Math.min(this.savedX,_-1),this.scrollTop=0}if(this.scrollBottom=S-1,this._isReflowEnabled&&(this._reflow(_,S),this._cols>_))for(let T=0;T<this.lines.length;T++)L+=+this.lines.get(T).resize(_,A);this._cols=_,this._rows=S,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 S=0;for(;this._memoryCleanupPosition<this.lines.length;)if(S+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),S>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(_,S){this._cols!==_&&(_>this._cols?this._reflowLarger(_,S):this._reflowSmaller(_,S))}_reflowLarger(_,S){const A=(0,w.reflowLargerGetLinesToRemove)(this.lines,this._cols,_,this.ybase+this.y,this.getNullCell(b.DEFAULT_ATTR_DATA));if(A.length>0){const L=(0,w.reflowLargerCreateNewLayout)(this.lines,A);(0,w.reflowLargerApplyNewLayout)(this.lines,L.layout),this._reflowLargerAdjustViewport(_,S,L.countRemoved)}}_reflowLargerAdjustViewport(_,S,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<S&&this.lines.push(new b.BufferLine(_,L))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-A,0)}_reflowSmaller(_,S){const A=this.getNullCell(b.DEFAULT_ATTR_DATA),L=[];let D=0;for(let T=this.lines.length-1;T>=0;T--){let k=this.lines.get(T);if(!k||!k.isWrapped&&k.getTrimmedLength()<=_)continue;const M=[k];for(;k.isWrapped&&T>0;)k=this.lines.get(--T),M.unshift(k);const B=this.ybase+this.y;if(B>=T&&B<T+M.length)continue;const H=M[M.length-1].getTrimmedLength(),U=(0,w.reflowSmallerGetNewLineLengths)(M,this._cols,_),P=U.length-M.length;let Y;Y=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:T+M.length+D,newLines:X}),D+=X.length),M.push(...X);let V=U.length-1,K=U[V];K===0&&(V--,K=U[V]);let ne=M.length-P-1,z=H;for(;ne>=0;){const N=Math.min(z,K);if(M[V]===void 0)break;if(M[V].copyCellsFrom(M[ne],z-N,K-N,N,!0),K-=N,K===0&&(V--,K=U[V]),z-=N,z===0){ne--;const $=Math.max(ne,0);z=(0,w.getWrappedLineTrimmedLength)(M,$,this._cols)}}for(let N=0;N<M.length;N++)U[N]<_&&M[N].setCell(U[N],A);let j=P-Y;for(;j-- >0;)this.ybase===0?this.y<S-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+D)-S&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+P,this.ybase+S-1)}if(L.length>0){const T=[],k=[];for(let V=0;V<this.lines.length;V++)k.push(this.lines.get(V));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 V=Math.min(this.lines.maxLength-1,M+D-1);V>=0;V--)if(U&&U.start>B+P){for(let K=U.newLines.length-1;K>=0;K--)this.lines.set(V--,U.newLines[K]);V++,T.push({index:B+1,amount:U.newLines.length}),P+=U.newLines.length,U=L[++H]}else this.lines.set(V,k[B--]);let Y=0;for(let V=T.length-1;V>=0;V--)T[V].index+=Y,this.lines.onInsertEmitter.fire(T[V]),Y+=T[V].amount;const X=Math.max(0,M+D-this.lines.maxLength);X>0&&this.lines.onTrimEmitter.fire(X)}}translateBufferLineToString(_,S,A=0,L){const D=this.lines.get(_);return D?D.translateToString(S,A,L):""}getWrappedRangeForLine(_){let S=_,A=_;for(;S>0&&this.lines.get(S).isWrapped;)S--;for(;A+1<this.lines.length&&this.lines.get(A+1).isWrapped;)A++;return{first:S,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 S=0;S<this.markers.length;S++)this.markers[S].line===_&&(this.markers[S].dispose(),this.markers.splice(S--,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 S=new v.Marker(_);return this.markers.push(S),S.register(this.lines.onTrim((A=>{S.line-=A,S.line<0&&S.dispose()}))),S.register(this.lines.onInsert((A=>{S.line>=A.index&&(S.line+=A.amount)}))),S.register(this.lines.onDelete((A=>{S.line>=A.index&&S.line<A.index+A.amount&&S.dispose(),S.line>A.index&&(S.line-=A.amount)}))),S.register(S.onDispose((()=>this._removeMarker(S)))),S}_removeMarker(_){this._isClearing||this.markers.splice(this.markers.indexOf(_),1)}}},8437:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const h=c(3734),p=c(511),u=c(643),b=c(482);o.DEFAULT_ATTR_DATA=Object.freeze(new h.AttributeData);let w=0;class R{constructor(v,y,_=!1){this.isWrapped=_,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*v);const S=y||p.CellData.fromCharData([0,u.NULL_CELL_CHAR,u.NULL_CELL_WIDTH,u.NULL_CELL_CODE]);for(let A=0;A<v;++A)this.setCell(A,S);this.length=v}get(v){const y=this._data[3*v+0],_=2097151&y;return[this._data[3*v+1],2097152&y?this._combined[v]:_?(0,b.stringFromCodePoint)(_):"",y>>22,2097152&y?this._combined[v].charCodeAt(this._combined[v].length-1):_]}set(v,y){this._data[3*v+1]=y[u.CHAR_DATA_ATTR_INDEX],y[u.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[v]=y[1],this._data[3*v+0]=2097152|v|y[u.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*v+0]=y[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|y[u.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(v){return this._data[3*v+0]>>22}hasWidth(v){return 12582912&this._data[3*v+0]}getFg(v){return this._data[3*v+1]}getBg(v){return this._data[3*v+2]}hasContent(v){return 4194303&this._data[3*v+0]}getCodePoint(v){const y=this._data[3*v+0];return 2097152&y?this._combined[v].charCodeAt(this._combined[v].length-1):2097151&y}isCombined(v){return 2097152&this._data[3*v+0]}getString(v){const y=this._data[3*v+0];return 2097152&y?this._combined[v]:2097151&y?(0,b.stringFromCodePoint)(2097151&y):""}isProtected(v){return 536870912&this._data[3*v+2]}loadCell(v,y){return w=3*v,y.content=this._data[w+0],y.fg=this._data[w+1],y.bg=this._data[w+2],2097152&y.content&&(y.combinedData=this._combined[v]),268435456&y.bg&&(y.extended=this._extendedAttrs[v]),y}setCell(v,y){2097152&y.content&&(this._combined[v]=y.combinedData),268435456&y.bg&&(this._extendedAttrs[v]=y.extended),this._data[3*v+0]=y.content,this._data[3*v+1]=y.fg,this._data[3*v+2]=y.bg}setCellFromCodepoint(v,y,_,S){268435456&S.bg&&(this._extendedAttrs[v]=S.extended),this._data[3*v+0]=y|_<<22,this._data[3*v+1]=S.fg,this._data[3*v+2]=S.bg}addCodepointToCell(v,y,_){let S=this._data[3*v+0];2097152&S?this._combined[v]+=(0,b.stringFromCodePoint)(y):2097151&S?(this._combined[v]=(0,b.stringFromCodePoint)(2097151&S)+(0,b.stringFromCodePoint)(y),S&=-2097152,S|=2097152):S=y|4194304,_&&(S&=-12582913,S|=_<<22),this._data[3*v+0]=S}insertCells(v,y,_){if((v%=this.length)&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v-1,0,1,_),y<this.length-v){const S=new p.CellData;for(let A=this.length-v-y-1;A>=0;--A)this.setCell(v+y+A,this.loadCell(v+A,S));for(let A=0;A<y;++A)this.setCell(v+A,_)}else for(let S=v;S<this.length;++S)this.setCell(S,_);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,_)}deleteCells(v,y,_){if(v%=this.length,y<this.length-v){const S=new p.CellData;for(let A=0;A<this.length-v-y;++A)this.setCell(v+A,this.loadCell(v+y+A,S));for(let A=this.length-y;A<this.length;++A)this.setCell(A,_)}else for(let S=v;S<this.length;++S)this.setCell(S,_);v&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v-1,0,1,_),this.getWidth(v)!==0||this.hasContent(v)||this.setCellFromCodepoint(v,0,1,_)}replaceCells(v,y,_,S=!1){if(S)for(v&&this.getWidth(v-1)===2&&!this.isProtected(v-1)&&this.setCellFromCodepoint(v-1,0,1,_),y<this.length&&this.getWidth(y-1)===2&&!this.isProtected(y)&&this.setCellFromCodepoint(y,0,1,_);v<y&&v<this.length;)this.isProtected(v)||this.setCell(v,_),v++;else for(v&&this.getWidth(v-1)===2&&this.setCellFromCodepoint(v-1,0,1,_),y<this.length&&this.getWidth(y-1)===2&&this.setCellFromCodepoint(y,0,1,_);v<y&&v<this.length;)this.setCell(v++,_)}resize(v,y){if(v===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const _=3*v;if(v>this.length){if(this._data.buffer.byteLength>=4*_)this._data=new Uint32Array(this._data.buffer,0,_);else{const S=new Uint32Array(_);S.set(this._data),this._data=S}for(let S=this.length;S<v;++S)this.setCell(S,y)}else{this._data=this._data.subarray(0,_);const S=Object.keys(this._combined);for(let L=0;L<S.length;L++){const D=parseInt(S[L],10);D>=v&&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>=v&&delete this._extendedAttrs[D]}}return this.length=v,4*_*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const v=new Uint32Array(this._data.length);return v.set(this._data),this._data=v,1}return 0}fill(v,y=!1){if(y)for(let _=0;_<this.length;++_)this.isProtected(_)||this.setCell(_,v);else{this._combined={},this._extendedAttrs={};for(let _=0;_<this.length;++_)this.setCell(_,v)}}copyFrom(v){this.length!==v.length?this._data=new Uint32Array(v._data):this._data.set(v._data),this.length=v.length,this._combined={};for(const y in v._combined)this._combined[y]=v._combined[y];this._extendedAttrs={};for(const y in v._extendedAttrs)this._extendedAttrs[y]=v._extendedAttrs[y];this.isWrapped=v.isWrapped}clone(){const v=new R(0);v._data=new Uint32Array(this._data),v.length=this.length;for(const y in this._combined)v._combined[y]=this._combined[y];for(const y in this._extendedAttrs)v._extendedAttrs[y]=this._extendedAttrs[y];return v.isWrapped=this.isWrapped,v}getTrimmedLength(){for(let v=this.length-1;v>=0;--v)if(4194303&this._data[3*v+0])return v+(this._data[3*v+0]>>22);return 0}getNoBgTrimmedLength(){for(let v=this.length-1;v>=0;--v)if(4194303&this._data[3*v+0]||50331648&this._data[3*v+2])return v+(this._data[3*v+0]>>22);return 0}copyCellsFrom(v,y,_,S,A){const L=v._data;if(A)for(let T=S-1;T>=0;T--){for(let k=0;k<3;k++)this._data[3*(_+T)+k]=L[3*(y+T)+k];268435456&L[3*(y+T)+2]&&(this._extendedAttrs[_+T]=v._extendedAttrs[y+T])}else for(let T=0;T<S;T++){for(let k=0;k<3;k++)this._data[3*(_+T)+k]=L[3*(y+T)+k];268435456&L[3*(y+T)+2]&&(this._extendedAttrs[_+T]=v._extendedAttrs[y+T])}const D=Object.keys(v._combined);for(let T=0;T<D.length;T++){const k=parseInt(D[T],10);k>=y&&(this._combined[k-y+_]=v._combined[k])}}translateToString(v,y,_,S){y=y??0,_=_??this.length,v&&(_=Math.min(_,this.getTrimmedLength())),S&&(S.length=0);let A="";for(;y<_;){const L=this._data[3*y+0],D=2097151&L,T=2097152&L?this._combined[y]:D?(0,b.stringFromCodePoint)(D):u.WHITESPACE_CELL_CHAR;if(A+=T,S)for(let k=0;k<T.length;++k)S.push(y);y+=L>>22||1}return S&&S.push(y),A}}o.BufferLine=R},4841:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getRangeLength=void 0,o.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,o)=>{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,w=h[p+1].getWidth(0)===2;return b&&w?u-1:u}Object.defineProperty(o,"__esModule",{value:!0}),o.getWrappedLineTrimmedLength=o.reflowSmallerGetNewLineLengths=o.reflowLargerApplyNewLayout=o.reflowLargerCreateNewLayout=o.reflowLargerGetLinesToRemove=void 0,o.reflowLargerGetLinesToRemove=function(h,p,u,b,w){const R=[];for(let E=0;E<h.length-1;E++){let v=E,y=h.get(++v);if(!y.isWrapped)continue;const _=[h.get(E)];for(;v<h.length&&y.isWrapped;)_.push(y),y=h.get(++v);if(b>=E&&b<v){E+=_.length-1;continue}let S=0,A=c(_,S,p),L=1,D=0;for(;L<_.length;){const k=c(_,L,p),M=k-D,B=u-A,H=Math.min(M,B);_[S].copyCellsFrom(_[L],D,A,H,!1),A+=H,A===u&&(S++,A=0),D+=H,D===k&&(L++,D=0),A===0&&S!==0&&_[S-1].getWidth(u-1)===2&&(_[S].copyCellsFrom(_[S-1],u-1,A++,1,!1),_[S-1].setCell(u-1,w))}_[S].replaceCells(A,u,w);let T=0;for(let k=_.length-1;k>0&&(k>S||_[k].getTrimmedLength()===0);k--)T++;T>0&&(R.push(E+_.length-T),R.push(T)),E+=_.length-1}return R},o.reflowLargerCreateNewLayout=function(h,p){const u=[];let b=0,w=p[b],R=0;for(let E=0;E<h.length;E++)if(w===E){const v=p[++b];h.onDeleteEmitter.fire({index:E-R,amount:v}),E+=v-1,R+=v,w=p[++b]}else u.push(E);return{layout:u,countRemoved:R}},o.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},o.reflowSmallerGetNewLineLengths=function(h,p,u){const b=[],w=h.map(((y,_)=>c(h,_,p))).reduce(((y,_)=>y+_));let R=0,E=0,v=0;for(;v<w;){if(w-v<u){b.push(w-v);break}R+=u;const y=c(h,E,p);R>y&&(R-=y,E++);const _=h[E].getWidth(R-1)===2;_&&R--;const S=_?u-1:u;b.push(S),v+=S}return b},o.getWrappedLineTrimmedLength=c},5295:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const h=c(8460),p=c(844),u=c(9092);class b extends p.Disposable{constructor(R,E){super(),this._optionsService=R,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(R){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(R),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(R,E){this._normal.resize(R,E),this._alt.resize(R,E),this.setupTabStops(R)}setupTabStops(R){this._normal.setupTabStops(R),this._alt.setupTabStops(R)}}o.BufferSet=b},511:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.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(R){const E=new b;return E.setFromCharData(R),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(R){this.fg=R[p.CHAR_DATA_ATTR_INDEX],this.bg=0;let E=!1;if(R[p.CHAR_DATA_CHAR_INDEX].length>2)E=!0;else if(R[p.CHAR_DATA_CHAR_INDEX].length===2){const v=R[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=v&&v<=56319){const y=R[p.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=y&&y<=57343?this.content=1024*(v-55296)+y-56320+65536|R[p.CHAR_DATA_WIDTH_INDEX]<<22:E=!0}else E=!0}else this.content=R[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|R[p.CHAR_DATA_WIDTH_INDEX]<<22;E&&(this.combinedData=R[p.CHAR_DATA_CHAR_INDEX],this.content=2097152|R[p.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=b},643:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},4863:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Marker=void 0;const h=c(8460),p=c(844);class u{get id(){return this._id}constructor(w){this.line=w,this.isDisposed=!1,this._disposables=[],this._id=u._nextId++,this._onDispose=this.register(new h.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,p.disposeArray)(this._disposables),this._disposables.length=0)}register(w){return this._disposables.push(w),w}}o.Marker=u,u._nextId=1},7116:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DEFAULT_CHARSET=o.CHARSETS=void 0,o.CHARSETS={},o.DEFAULT_CHARSET=o.CHARSETS.B,o.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:"≥","{":"π","|":"≠","}":"£","~":"·"},o.CHARSETS.A={"#":"£"},o.CHARSETS.B=void 0,o.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},o.CHARSETS.C=o.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},o.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},o.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},o.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},o.CHARSETS.E=o.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},o.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},o.CHARSETS.H=o.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(f,o)=>{var c,h,p;Object.defineProperty(o,"__esModule",{value:!0}),o.C1_ESCAPED=o.C1=o.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||(o.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||(o.C1=h={})),(function(u){u.ST=`${c.ESC}\\`})(p||(o.C1_ESCAPED=p={}))},7399:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.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:["'",'"']};o.evaluateKeyboardEvent=function(u,b,w,R){const E={type:0,cancel:!1,key:void 0},v=(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;v?(E.key=h.C0.ESC+"[1;"+(v+1)+"D",E.key===h.C0.ESC+"[1;3D"&&(E.key=h.C0.ESC+(w?"b":"[1;5D"))):E.key=b?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(u.metaKey)break;v?(E.key=h.C0.ESC+"[1;"+(v+1)+"C",E.key===h.C0.ESC+"[1;3C"&&(E.key=h.C0.ESC+(w?"f":"[1;5C"))):E.key=b?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(u.metaKey)break;v?(E.key=h.C0.ESC+"[1;"+(v+1)+"A",w||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;v?(E.key=h.C0.ESC+"[1;"+(v+1)+"B",w||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=v?h.C0.ESC+"[3;"+(v+1)+"~":h.C0.ESC+"[3~";break;case 36:E.key=v?h.C0.ESC+"[1;"+(v+1)+"H":b?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:E.key=v?h.C0.ESC+"[1;"+(v+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;"+(v+1)+"~":E.key=h.C0.ESC+"[5~";break;case 34:u.shiftKey?E.type=3:u.ctrlKey?E.key=h.C0.ESC+"[6;"+(v+1)+"~":E.key=h.C0.ESC+"[6~";break;case 112:E.key=v?h.C0.ESC+"[1;"+(v+1)+"P":h.C0.ESC+"OP";break;case 113:E.key=v?h.C0.ESC+"[1;"+(v+1)+"Q":h.C0.ESC+"OQ";break;case 114:E.key=v?h.C0.ESC+"[1;"+(v+1)+"R":h.C0.ESC+"OR";break;case 115:E.key=v?h.C0.ESC+"[1;"+(v+1)+"S":h.C0.ESC+"OS";break;case 116:E.key=v?h.C0.ESC+"[15;"+(v+1)+"~":h.C0.ESC+"[15~";break;case 117:E.key=v?h.C0.ESC+"[17;"+(v+1)+"~":h.C0.ESC+"[17~";break;case 118:E.key=v?h.C0.ESC+"[18;"+(v+1)+"~":h.C0.ESC+"[18~";break;case 119:E.key=v?h.C0.ESC+"[19;"+(v+1)+"~":h.C0.ESC+"[19~";break;case 120:E.key=v?h.C0.ESC+"[20;"+(v+1)+"~":h.C0.ESC+"[20~";break;case 121:E.key=v?h.C0.ESC+"[21;"+(v+1)+"~":h.C0.ESC+"[21~";break;case 122:E.key=v?h.C0.ESC+"[23;"+(v+1)+"~":h.C0.ESC+"[23~";break;case 123:E.key=v?h.C0.ESC+"[24;"+(v+1)+"~":h.C0.ESC+"[24~";break;default:if(!u.ctrlKey||u.shiftKey||u.altKey||u.metaKey)if(w&&!R||!u.altKey||u.metaKey)!w||u.altKey||u.ctrlKey||u.shiftKey||!u.metaKey?u.key&&!u.ctrlKey&&!u.altKey&&!u.metaKey&&u.keyCode>=48&&u.key.length===1?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 y=p[u.keyCode],_=y==null?void 0:y[u.shiftKey?1:0];if(_)E.key=h.C0.ESC+_;else if(u.keyCode>=65&&u.keyCode<=90){const S=u.ctrlKey?u.keyCode-64:u.keyCode+32;let A=String.fromCharCode(S);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 S=u.code.slice(3,4);u.shiftKey||(S=S.toLowerCase()),E.key=h.C0.ESC+S,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,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},o.utf32ToString=function(c,h=0,p=c.length){let u="";for(let b=h;b<p;++b){let w=c[b];w>65535?(w-=65536,u+=String.fromCharCode(55296+(w>>10))+String.fromCharCode(w%1024+56320)):u+=String.fromCharCode(w)}return u},o.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 w=c.charCodeAt(b++);56320<=w&&w<=57343?h[u++]=1024*(this._interim-55296)+w-56320+65536:(h[u++]=this._interim,h[u++]=w),this._interim=0}for(let w=b;w<p;++w){const R=c.charCodeAt(w);if(55296<=R&&R<=56319){if(++w>=p)return this._interim=R,u;const E=c.charCodeAt(w);56320<=E&&E<=57343?h[u++]=1024*(R-55296)+E-56320+65536:(h[u++]=R,h[u++]=E)}else R!==65279&&(h[u++]=R)}return u}},o.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,w,R,E=0,v=0,y=0;if(this.interim[0]){let A=!1,L=this.interim[0];L&=(224&L)==192?31:(240&L)==224?15:7;let D,T=0;for(;(D=63&this.interim[++T])&&T<4;)L<<=6,L|=D;const k=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,M=k-T;for(;y<M;){if(y>=p)return 0;if(D=c[y++],(192&D)!=128){y--,A=!0;break}this.interim[T++]=D,L<<=6,L|=63&D}A||(k===2?L<128?y--: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 S=y;for(;S<p;){for(;!(!(S<_)||128&(u=c[S])||128&(b=c[S+1])||128&(w=c[S+2])||128&(R=c[S+3]));)h[E++]=u,h[E++]=b,h[E++]=w,h[E++]=R,S+=4;if(u=c[S++],u<128)h[E++]=u;else if((224&u)==192){if(S>=p)return this.interim[0]=u,E;if(b=c[S++],(192&b)!=128){S--;continue}if(v=(31&u)<<6|63&b,v<128){S--;continue}h[E++]=v}else if((240&u)==224){if(S>=p)return this.interim[0]=u,E;if(b=c[S++],(192&b)!=128){S--;continue}if(S>=p)return this.interim[0]=u,this.interim[1]=b,E;if(w=c[S++],(192&w)!=128){S--;continue}if(v=(15&u)<<12|(63&b)<<6|63&w,v<2048||v>=55296&&v<=57343||v===65279)continue;h[E++]=v}else if((248&u)==240){if(S>=p)return this.interim[0]=u,E;if(b=c[S++],(192&b)!=128){S--;continue}if(S>=p)return this.interim[0]=u,this.interim[1]=b,E;if(w=c[S++],(192&w)!=128){S--;continue}if(S>=p)return this.interim[0]=u,this.interim[1]=b,this.interim[2]=w,E;if(R=c[S++],(192&R)!=128){S--;continue}if(v=(7&u)<<18|(63&b)<<12|(63&w)<<6|63&R,v<65536||v>1114111)continue;h[E++]=v}}return E}}},225:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.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;o.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 w=0;w<p.length;++w)b.fill(0,p[w][0],p[w][1]+1)}}wcwidth(w){return w<32?0:w<127?1:w<65536?b[w]:(function(R,E){let v,y=0,_=E.length-1;if(R<E[0][0]||R>E[_][1])return!1;for(;_>=y;)if(v=y+_>>1,R>E[v][1])y=v+1;else{if(!(R<E[v][0]))return!0;_=v-1}return!1})(w,u)?0:w>=131072&&w<=196605||w>=196608&&w<=262141?2:1}charProperties(w,R){let E=this.wcwidth(w),v=E===0&&R!==0;if(v){const y=h.UnicodeService.extractWidth(R);y===0?v=!1:y>E&&(E=y)}return h.UnicodeService.createPropertyValue(0,E,v)}}},5981:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const h=c(8460),p=c(844);class u extends p.Disposable{constructor(w){super(),this._action=w,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new h.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(w,R){if(R!==void 0&&this._syncCalls>R)return void(this._syncCalls=0);if(this._pendingData+=w.length,this._writeBuffer.push(w),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let E;for(this._isSyncWriting=!0;E=this._writeBuffer.shift();){this._action(E);const v=this._callbacks.shift();v&&v()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(w,R){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=w.length,this._writeBuffer.push(w),this._callbacks.push(R),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=w.length,this._writeBuffer.push(w),this._callbacks.push(R)}_innerWrite(w=0,R=!0){const E=w||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const v=this._writeBuffer[this._bufferOffset],y=this._action(v,R);if(y){const S=A=>Date.now()-E>=12?setTimeout((()=>this._innerWrite(0,A))):this._innerWrite(E,A);return void y.catch((A=>(queueMicrotask((()=>{throw A})),Promise.resolve(!1)))).then(S)}const _=this._callbacks[this._bufferOffset];if(_&&_(),this._bufferOffset++,this._pendingData-=v.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()}}o.WriteBuffer=u},5941:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.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 w=u.toString(16),R=w.length<2?"0"+w:w;switch(b){case 4:return w[0];case 8:return R;case 12:return(R+R).slice(0,3);default:return R+R}}o.parseColor=function(u){if(!u)return;let b=u.toLowerCase();if(b.indexOf("rgb:")===0){b=b.slice(4);const w=c.exec(b);if(w){const R=w[1]?15:w[4]?255:w[7]?4095:65535;return[Math.round(parseInt(w[1]||w[4]||w[7]||w[10],16)/R*255),Math.round(parseInt(w[2]||w[5]||w[8]||w[11],16)/R*255),Math.round(parseInt(w[3]||w[6]||w[9]||w[12],16)/R*255)]}}else if(b.indexOf("#")===0&&(b=b.slice(1),h.exec(b)&&[3,6,9,12].includes(b.length))){const w=b.length/3,R=[0,0,0];for(let E=0;E<3;++E){const v=parseInt(b.slice(w*E,w*E+w),16);R[E]=w===1?v<<4:w===2?v:w===3?v>>4:v>>8}return R}},o.toRgbString=function(u,b=16){const[w,R,E]=u;return`rgb:${p(w,b)}/${p(R,b)}/${p(E,b)}`}},5770:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const h=c(482),p=c(8742),u=c(5770),b=[];o.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(R,E){this._handlers[R]===void 0&&(this._handlers[R]=[]);const v=this._handlers[R];return v.push(E),{dispose:()=>{const y=v.indexOf(E);y!==-1&&v.splice(y,1)}}}clearHandler(R){this._handlers[R]&&delete this._handlers[R]}setHandlerFallback(R){this._handlerFb=R}reset(){if(this._active.length)for(let R=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;R>=0;--R)this._active[R].unhook(!1);this._stack.paused=!1,this._active=b,this._ident=0}hook(R,E){if(this.reset(),this._ident=R,this._active=this._handlers[R]||b,this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].hook(E);else this._handlerFb(this._ident,"HOOK",E)}put(R,E,v){if(this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].put(R,E,v);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(R,E,v))}unhook(R,E=!0){if(this._active.length){let v=!1,y=this._active.length-1,_=!1;if(this._stack.paused&&(y=this._stack.loopPosition-1,v=E,_=this._stack.fallThrough,this._stack.paused=!1),!_&&v===!1){for(;y>=0&&(v=this._active[y].unhook(R),v!==!0);y--)if(v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!1,v;y--}for(;y>=0;y--)if(v=this._active[y].unhook(!1),v instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!0,v}else this._handlerFb(this._ident,"UNHOOK",R);this._active=b,this._ident=0}};const w=new p.Params;w.addParam(0),o.DcsHandler=class{constructor(R){this._handler=R,this._data="",this._params=w,this._hitLimit=!1}hook(R){this._params=R.length>1||R.params[0]?R.clone():w,this._data="",this._hitLimit=!1}put(R,E,v){this._hitLimit||(this._data+=(0,h.utf32ToString)(R,E,v),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(R){let E=!1;if(this._hitLimit)E=!1;else if(R&&(E=this._handler(this._data,this._params),E instanceof Promise))return E.then((v=>(this._params=w,this._data="",this._hitLimit=!1,v)));return this._params=w,this._data="",this._hitLimit=!1,E}}},2015:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const h=c(844),p=c(8742),u=c(6242),b=c(6351);class w{constructor(y){this.table=new Uint8Array(y)}setDefault(y,_){this.table.fill(y<<4|_)}add(y,_,S,A){this.table[_<<8|y]=S<<4|A}addMany(y,_,S,A){for(let L=0;L<y.length;L++)this.table[_<<8|y[L]]=S<<4|A}}o.TransitionTable=w;const R=160;o.VT500_TRANSITION_TABLE=(function(){const v=new w(4095),y=Array.apply(null,Array(256)).map(((T,k)=>k)),_=(T,k)=>y.slice(T,k),S=_(32,127),A=_(0,24);A.push(25),A.push.apply(A,_(28,32));const L=_(0,14);let D;for(D in v.setDefault(1,0),v.addMany(S,0,2,0),L)v.addMany([24,26,153,154],D,3,0),v.addMany(_(128,144),D,3,0),v.addMany(_(144,152),D,3,0),v.add(156,D,0,0),v.add(27,D,11,1),v.add(157,D,4,8),v.addMany([152,158,159],D,0,7),v.add(155,D,11,3),v.add(144,D,11,9);return v.addMany(A,0,3,0),v.addMany(A,1,3,1),v.add(127,1,0,1),v.addMany(A,8,0,8),v.addMany(A,3,3,3),v.add(127,3,0,3),v.addMany(A,4,3,4),v.add(127,4,0,4),v.addMany(A,6,3,6),v.addMany(A,5,3,5),v.add(127,5,0,5),v.addMany(A,2,3,2),v.add(127,2,0,2),v.add(93,1,4,8),v.addMany(S,8,5,8),v.add(127,8,5,8),v.addMany([156,27,24,26,7],8,6,0),v.addMany(_(28,32),8,0,8),v.addMany([88,94,95],1,0,7),v.addMany(S,7,0,7),v.addMany(A,7,0,7),v.add(156,7,0,0),v.add(127,7,0,7),v.add(91,1,11,3),v.addMany(_(64,127),3,7,0),v.addMany(_(48,60),3,8,4),v.addMany([60,61,62,63],3,9,4),v.addMany(_(48,60),4,8,4),v.addMany(_(64,127),4,7,0),v.addMany([60,61,62,63],4,0,6),v.addMany(_(32,64),6,0,6),v.add(127,6,0,6),v.addMany(_(64,127),6,0,0),v.addMany(_(32,48),3,9,5),v.addMany(_(32,48),5,9,5),v.addMany(_(48,64),5,0,6),v.addMany(_(64,127),5,7,0),v.addMany(_(32,48),4,9,5),v.addMany(_(32,48),1,9,2),v.addMany(_(32,48),2,9,2),v.addMany(_(48,127),2,10,0),v.addMany(_(48,80),1,10,0),v.addMany(_(81,88),1,10,0),v.addMany([89,90,92],1,10,0),v.addMany(_(96,127),1,10,0),v.add(80,1,11,9),v.addMany(A,9,0,9),v.add(127,9,0,9),v.addMany(_(28,32),9,0,9),v.addMany(_(32,48),9,9,12),v.addMany(_(48,60),9,8,10),v.addMany([60,61,62,63],9,9,10),v.addMany(A,11,0,11),v.addMany(_(32,128),11,0,11),v.addMany(_(28,32),11,0,11),v.addMany(A,10,0,10),v.add(127,10,0,10),v.addMany(_(28,32),10,0,10),v.addMany(_(48,60),10,8,10),v.addMany([60,61,62,63],10,0,11),v.addMany(_(32,48),10,9,12),v.addMany(A,12,0,12),v.add(127,12,0,12),v.addMany(_(28,32),12,0,12),v.addMany(_(32,48),12,9,12),v.addMany(_(48,64),12,0,11),v.addMany(_(64,127),12,12,13),v.addMany(_(64,127),10,12,13),v.addMany(_(64,127),9,12,13),v.addMany(A,13,13,13),v.addMany(S,13,13,13),v.add(127,13,0,13),v.addMany([27,156,24,26],13,14,0),v.add(R,0,2,0),v.add(R,8,5,8),v.add(R,6,0,6),v.add(R,11,0,11),v.add(R,13,13,13),v})();class E extends h.Disposable{constructor(y=o.VT500_TRANSITION_TABLE){super(),this._transitions=y,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=(_,S,A)=>{},this._executeHandlerFb=_=>{},this._csiHandlerFb=(_,S)=>{},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(y,_=[64,126]){let S=0;if(y.prefix){if(y.prefix.length>1)throw new Error("only one byte as prefix supported");if(S=y.prefix.charCodeAt(0),S&&60>S||S>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(y.intermediates){if(y.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let L=0;L<y.intermediates.length;++L){const D=y.intermediates.charCodeAt(L);if(32>D||D>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");S<<=8,S|=D}}if(y.final.length!==1)throw new Error("final must be a single byte");const A=y.final.charCodeAt(0);if(_[0]>A||A>_[1])throw new Error(`final must be in range ${_[0]} .. ${_[1]}`);return S<<=8,S|=A,S}identToString(y){const _=[];for(;y;)_.push(String.fromCharCode(255&y)),y>>=8;return _.reverse().join("")}setPrintHandler(y){this._printHandler=y}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(y,_){const S=this._identifier(y,[48,126]);this._escHandlers[S]===void 0&&(this._escHandlers[S]=[]);const A=this._escHandlers[S];return A.push(_),{dispose:()=>{const L=A.indexOf(_);L!==-1&&A.splice(L,1)}}}clearEscHandler(y){this._escHandlers[this._identifier(y,[48,126])]&&delete this._escHandlers[this._identifier(y,[48,126])]}setEscHandlerFallback(y){this._escHandlerFb=y}setExecuteHandler(y,_){this._executeHandlers[y.charCodeAt(0)]=_}clearExecuteHandler(y){this._executeHandlers[y.charCodeAt(0)]&&delete this._executeHandlers[y.charCodeAt(0)]}setExecuteHandlerFallback(y){this._executeHandlerFb=y}registerCsiHandler(y,_){const S=this._identifier(y);this._csiHandlers[S]===void 0&&(this._csiHandlers[S]=[]);const A=this._csiHandlers[S];return A.push(_),{dispose:()=>{const L=A.indexOf(_);L!==-1&&A.splice(L,1)}}}clearCsiHandler(y){this._csiHandlers[this._identifier(y)]&&delete this._csiHandlers[this._identifier(y)]}setCsiHandlerFallback(y){this._csiHandlerFb=y}registerDcsHandler(y,_){return this._dcsParser.registerHandler(this._identifier(y),_)}clearDcsHandler(y){this._dcsParser.clearHandler(this._identifier(y))}setDcsHandlerFallback(y){this._dcsParser.setHandlerFallback(y)}registerOscHandler(y,_){return this._oscParser.registerHandler(y,_)}clearOscHandler(y){this._oscParser.clearHandler(y)}setOscHandlerFallback(y){this._oscParser.setHandlerFallback(y)}setErrorHandler(y){this._errorHandler=y}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(y,_,S,A,L){this._parseStack.state=y,this._parseStack.handlers=_,this._parseStack.handlerPos=S,this._parseStack.transition=A,this._parseStack.chunkPos=L}parse(y,_,S){let A,L=0,D=0,T=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,T=this._parseStack.chunkPos+1;else{if(S===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(S===!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(S===!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=y[this._parseStack.chunkPos],A=this._dcsParser.unhook(L!==24&&L!==26,S),A)return A;L===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(L=y[this._parseStack.chunkPos],A=this._oscParser.end(L!==24&&L!==26,S),A)return A;L===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,T=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let k=T;k<_;++k){switch(L=y[k],D=this._transitions.table[this.currentState<<8|(L<160?L:R)],D>>4){case 2:for(let P=k+1;;++P){if(P>=_||(L=y[P])<32||L>126&&L<R){this._printHandler(y,k,P),k=P-1;break}if(++P>=_||(L=y[P])<32||L>126&&L<R){this._printHandler(y,k,P),k=P-1;break}if(++P>=_||(L=y[P])<32||L>126&&L<R){this._printHandler(y,k,P),k=P-1;break}if(++P>=_||(L=y[P])<32||L>126&&L<R){this._printHandler(y,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=y[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=y[P])===24||L===26||L===27||L>127&&L<R){this._dcsParser.put(y,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=y[P])<32||L>127&&L<R){this._oscParser.put(y,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}}}o.EscapeSequenceParser=E},6242:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const h=c(5770),p=c(482),u=[];o.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,w){this._handlers[b]===void 0&&(this._handlers[b]=[]);const R=this._handlers[b];return R.push(w),{dispose:()=>{const E=R.indexOf(w);E!==-1&&R.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,w,R){if(this._active.length)for(let E=this._active.length-1;E>=0;E--)this._active[E].put(b,w,R);else this._handlerFb(this._id,"PUT",(0,p.utf32ToString)(b,w,R))}start(){this.reset(),this._state=1}put(b,w,R){if(this._state!==3){if(this._state===1)for(;w<R;){const E=b[w++];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&&R-w>0&&this._put(b,w,R)}}end(b,w=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let R=!1,E=this._active.length-1,v=!1;if(this._stack.paused&&(E=this._stack.loopPosition-1,R=w,v=this._stack.fallThrough,this._stack.paused=!1),!v&&R===!1){for(;E>=0&&(R=this._active[E].end(b),R!==!0);E--)if(R instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=E,this._stack.fallThrough=!1,R;E--}for(;E>=0;E--)if(R=this._active[E].end(!1),R instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=E,this._stack.fallThrough=!0,R}else this._handlerFb(this._id,"END",b);this._active=u,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(b){this._handler=b,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(b,w,R){this._hitLimit||(this._data+=(0,p.utf32ToString)(b,w,R),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(b){let w=!1;if(this._hitLimit)w=!1;else if(b&&(w=this._handler(this._data),w instanceof Promise))return w.then((R=>(this._data="",this._hitLimit=!1,R)));return this._data="",this._hitLimit=!1,w}}},8742:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const c=2147483647;class h{static fromArray(u){const b=new h;if(!u.length)return b;for(let w=Array.isArray(u[0])?1:0;w<u.length;++w){const R=u[w];if(Array.isArray(R))for(let E=0;E<R.length;++E)b.addSubParam(R[E]);else b.addParam(R)}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 w=this._subParamsIdx[b]>>8,R=255&this._subParamsIdx[b];R-w>0&&u.push(Array.prototype.slice.call(this._subParams,w,R))}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,w=255&this._subParamsIdx[u];return w-b>0?this._subParams.subarray(b,w):null}getSubParamsAll(){const u={};for(let b=0;b<this.length;++b){const w=this._subParamsIdx[b]>>8,R=255&this._subParamsIdx[b];R-w>0&&(u[b]=this._subParams.slice(w,R))}return u}addDigit(u){let b;if(this._rejectDigits||!(b=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const w=this._digitIsSub?this._subParams:this.params,R=w[b-1];w[b-1]=~R?Math.min(10*R+u,c):u}}o.Params=h},5741:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.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,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const h=c(3785),p=c(511);o.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,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const h=c(511);o.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,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const h=c(8771),p=c(8460),u=c(844);class b extends u.Disposable{constructor(R){super(),this._core=R,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)}}o.BufferNamespaceApi=b},7975:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.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,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.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,o,c){var h=this&&this.__decorate||function(v,y,_,S){var A,L=arguments.length,D=L<3?y:S===null?S=Object.getOwnPropertyDescriptor(y,_):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(v,y,_,S);else for(var T=v.length-1;T>=0;T--)(A=v[T])&&(D=(L<3?A(D):L>3?A(y,_,D):A(y,_))||D);return L>3&&D&&Object.defineProperty(y,_,D),D},p=this&&this.__param||function(v,y){return function(_,S){y(_,S,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const u=c(8460),b=c(844),w=c(5295),R=c(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let E=o.BufferService=class extends b.Disposable{get buffer(){return this.buffers.active}constructor(v){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(v.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(v.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new w.BufferSet(v,this))}resize(v,y){this.cols=v,this.rows=y,this.buffers.resize(v,y),this._onResize.fire({cols:v,rows:y})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(v,y=!1){const _=this.buffer;let S;S=this._cachedBlankLine,S&&S.length===this.cols&&S.getFg(0)===v.fg&&S.getBg(0)===v.bg||(S=_.getBlankLine(v,y),this._cachedBlankLine=S),S.isWrapped=y;const A=_.ybase+_.scrollTop,L=_.ybase+_.scrollBottom;if(_.scrollTop===0){const D=_.lines.isFull;L===_.lines.length-1?D?_.lines.recycle().copyFrom(S):_.lines.push(S.clone()):_.lines.splice(L+1,0,S.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,S.clone())}this.isUserScrolling||(_.ydisp=_.ybase),this._onScroll.fire(_.ydisp)}scrollLines(v,y,_){const S=this.buffer;if(v<0){if(S.ydisp===0)return;this.isUserScrolling=!0}else v+S.ydisp>=S.ybase&&(this.isUserScrolling=!1);const A=S.ydisp;S.ydisp=Math.max(Math.min(S.ydisp+v,S.ybase),0),A!==S.ydisp&&(y||this._onScroll.fire(S.ydisp))}};o.BufferService=E=h([p(0,R.IOptionsService)],E)},7994:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.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,o,c){var h=this&&this.__decorate||function(S,A,L,D){var T,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(S,A,L,D);else for(var B=S.length-1;B>=0;B--)(T=S[B])&&(M=(k<3?T(M):k>3?T(A,L,M):T(A,L))||M);return k>3&&M&&Object.defineProperty(A,L,M),M},p=this&&this.__param||function(S,A){return function(L,D){A(L,D,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const u=c(2585),b=c(8460),w=c(844),R={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:S=>S.button!==4&&S.action===1&&(S.ctrl=!1,S.alt=!1,S.shift=!1,!0)},VT200:{events:19,restrict:S=>S.action!==32},DRAG:{events:23,restrict:S=>S.action!==32||S.button!==3},ANY:{events:31,restrict:S=>!0}};function E(S,A){let L=(S.ctrl?16:0)|(S.shift?4:0)|(S.alt?8:0);return S.button===4?(L|=64,L|=S.action):(L|=3&S.button,4&S.button&&(L|=64),8&S.button&&(L|=128),S.action===32?L|=32:S.action!==0||A||(L|=3)),L}const v=String.fromCharCode,y={DEFAULT:S=>{const A=[E(S,!1)+32,S.col+32,S.row+32];return A[0]>255||A[1]>255||A[2]>255?"":`\x1B[M${v(A[0])}${v(A[1])}${v(A[2])}`},SGR:S=>{const A=S.action===0&&S.button!==4?"m":"M";return`\x1B[<${E(S,!0)};${S.col};${S.row}${A}`},SGR_PIXELS:S=>{const A=S.action===0&&S.button!==4?"m":"M";return`\x1B[<${E(S,!0)};${S.x};${S.y}${A}`}};let _=o.CoreMouseService=class extends w.Disposable{constructor(S,A){super(),this._bufferService=S,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(R))this.addProtocol(L,R[L]);for(const L of Object.keys(y))this.addEncoding(L,y[L]);this.reset()}addProtocol(S,A){this._protocols[S]=A}addEncoding(S,A){this._encodings[S]=A}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(S){if(!this._protocols[S])throw new Error(`unknown protocol "${S}"`);this._activeProtocol=S,this._onProtocolChange.fire(this._protocols[S].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(S){if(!this._encodings[S])throw new Error(`unknown encoding "${S}"`);this._activeEncoding=S}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(S){if(S.col<0||S.col>=this._bufferService.cols||S.row<0||S.row>=this._bufferService.rows||S.button===4&&S.action===32||S.button===3&&S.action!==32||S.button!==4&&(S.action===2||S.action===3)||(S.col++,S.row++,S.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,S,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(S))return!1;const A=this._encodings[this._activeEncoding](S);return A&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(A):this._coreService.triggerDataEvent(A,!0)),this._lastEvent=S,!0}explainEvents(S){return{down:!!(1&S),up:!!(2&S),drag:!!(4&S),move:!!(8&S),wheel:!!(16&S)}}_equalEvents(S,A,L){if(L){if(S.x!==A.x||S.y!==A.y)return!1}else if(S.col!==A.col||S.row!==A.row)return!1;return S.button===A.button&&S.action===A.action&&S.ctrl===A.ctrl&&S.alt===A.alt&&S.shift===A.shift}};o.CoreMouseService=_=h([p(0,u.IBufferService),p(1,u.ICoreService)],_)},6975:function(f,o,c){var h=this&&this.__decorate||function(_,S,A,L){var D,T=arguments.length,k=T<3?S:L===null?L=Object.getOwnPropertyDescriptor(S,A):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(_,S,A,L);else for(var M=_.length-1;M>=0;M--)(D=_[M])&&(k=(T<3?D(k):T>3?D(S,A,k):D(S,A))||k);return T>3&&k&&Object.defineProperty(S,A,k),k},p=this&&this.__param||function(_,S){return function(A,L){S(A,L,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const u=c(1439),b=c(8460),w=c(844),R=c(2585),E=Object.freeze({insertMode:!1}),v=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let y=o.CoreService=class extends w.Disposable{constructor(_,S,A){super(),this._bufferService=_,this._logService=S,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)(v)}reset(){this.modes=(0,u.clone)(E),this.decPrivateModes=(0,u.clone)(v)}triggerDataEvent(_,S=!1){if(this._optionsService.rawOptions.disableStdin)return;const A=this._bufferService.buffer;S&&this._optionsService.rawOptions.scrollOnUserInput&&A.ybase!==A.ydisp&&this._onRequestScrollToBottom.fire(),S&&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((S=>S.charCodeAt(0))))),this._onBinary.fire(_))}};o.CoreService=y=h([p(0,R.IBufferService),p(1,R.ILogService),p(2,R.IOptionsService)],y)},9074:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const h=c(8055),p=c(8460),u=c(844),b=c(6106);let w=0,R=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 S=new v(_);if(S){const A=S.marker.onDispose((()=>S.dispose()));S.onDispose((()=>{S&&(this._decorations.delete(S)&&this._onDecorationRemoved.fire(S),A.dispose())})),this._decorations.insert(S),this._onDecorationRegistered.fire(S)}return S}reset(){for(const _ of this._decorations.values())_.dispose();this._decorations.clear()}*getDecorationsAtCell(_,S,A){let L=0,D=0;for(const T of this._decorations.getKeyIterator(S))L=T.options.x??0,D=L+(T.options.width??1),_>=L&&_<D&&(!A||(T.options.layer??"bottom")===A)&&(yield T)}forEachDecorationAtCell(_,S,A,L){this._decorations.forEachByKey(S,(D=>{w=D.options.x??0,R=w+(D.options.width??1),_>=w&&_<R&&(!A||(D.options.layer??"bottom")===A)&&L(D)}))}}o.DecorationService=E;class v 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,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const h=c(2585),p=c(8343);class u{constructor(...w){this._entries=new Map;for(const[R,E]of w)this.set(R,E)}set(w,R){const E=this._entries.get(w);return this._entries.set(w,R),E}forEach(w){for(const[R,E]of this._entries.entries())w(R,E)}has(w){return this._entries.has(w)}get(w){return this._entries.get(w)}}o.ServiceCollection=u,o.InstantiationService=class{constructor(){this._services=new u,this._services.set(h.IInstantiationService,this)}setService(b,w){this._services.set(b,w)}getService(b){return this._services.get(b)}createInstance(b,...w){const R=(0,p.getServiceDependencies)(b).sort(((y,_)=>y.index-_.index)),E=[];for(const y of R){const _=this._services.get(y.id);if(!_)throw new Error(`[createInstance] ${b.name} depends on UNKNOWN service ${y.id}.`);E.push(_)}const v=R.length>0?R[0].index:w.length;if(w.length!==v)throw new Error(`[createInstance] First service dependency of ${b.name} at position ${v+1} conflicts with ${w.length} static arguments`);return new b(...w,...E)}}},7866:function(f,o,c){var h=this&&this.__decorate||function(v,y,_,S){var A,L=arguments.length,D=L<3?y:S===null?S=Object.getOwnPropertyDescriptor(y,_):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(v,y,_,S);else for(var T=v.length-1;T>=0;T--)(A=v[T])&&(D=(L<3?A(D):L>3?A(y,_,D):A(y,_))||D);return L>3&&D&&Object.defineProperty(y,_,D),D},p=this&&this.__param||function(v,y){return function(_,S){y(_,S,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const u=c(844),b=c(2585),w={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 R,E=o.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(v){super(),this._optionsService=v,this._logLevel=b.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),R=this}_updateLogLevel(){this._logLevel=w[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(v){for(let y=0;y<v.length;y++)typeof v[y]=="function"&&(v[y]=v[y]())}_log(v,y,_){this._evalLazyOptionalParams(_),v.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+y,..._)}trace(v,...y){var _;this._logLevel<=b.LogLevelEnum.TRACE&&this._log(((_=this._optionsService.options.logger)==null?void 0:_.trace.bind(this._optionsService.options.logger))??console.log,v,y)}debug(v,...y){var _;this._logLevel<=b.LogLevelEnum.DEBUG&&this._log(((_=this._optionsService.options.logger)==null?void 0:_.debug.bind(this._optionsService.options.logger))??console.log,v,y)}info(v,...y){var _;this._logLevel<=b.LogLevelEnum.INFO&&this._log(((_=this._optionsService.options.logger)==null?void 0:_.info.bind(this._optionsService.options.logger))??console.info,v,y)}warn(v,...y){var _;this._logLevel<=b.LogLevelEnum.WARN&&this._log(((_=this._optionsService.options.logger)==null?void 0:_.warn.bind(this._optionsService.options.logger))??console.warn,v,y)}error(v,...y){var _;this._logLevel<=b.LogLevelEnum.ERROR&&this._log(((_=this._optionsService.options.logger)==null?void 0:_.error.bind(this._optionsService.options.logger))??console.error,v,y)}};o.LogService=E=h([p(0,b.IOptionsService)],E),o.setTraceLogger=function(v){R=v},o.traceCall=function(v,y,_){if(typeof _.value!="function")throw new Error("not supported");const S=_.value;_.value=function(...A){if(R.logLevel!==b.LogLevelEnum.TRACE)return S.apply(this,A);R.trace(`GlyphRenderer#${S.name}(${A.map((D=>JSON.stringify(D))).join(", ")})`);const L=S.apply(this,A);return R.trace(`GlyphRenderer#${S.name} return`,L),L}}},7302:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const h=c(8460),p=c(844),u=c(6114);o.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 w extends p.Disposable{constructor(E){super(),this._onOptionChange=this.register(new h.EventEmitter),this.onOptionChange=this._onOptionChange.event;const v={...o.DEFAULT_OPTIONS};for(const y in E)if(y in v)try{const _=E[y];v[y]=this._sanitizeAndValidateOption(y,_)}catch(_){console.error(_)}this.rawOptions=v,this.options={...v},this._setupOptions(),this.register((0,p.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(E,v){return this.onOptionChange((y=>{y===E&&v(this.rawOptions[E])}))}onMultipleOptionChange(E,v){return this.onOptionChange((y=>{E.indexOf(y)!==-1&&v()}))}_setupOptions(){const E=y=>{if(!(y in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${y}"`);return this.rawOptions[y]},v=(y,_)=>{if(!(y in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${y}"`);_=this._sanitizeAndValidateOption(y,_),this.rawOptions[y]!==_&&(this.rawOptions[y]=_,this._onOptionChange.fire(y))};for(const y in this.rawOptions){const _={get:E.bind(this,y),set:v.bind(this,y)};Object.defineProperty(this.options,y,_)}}_sanitizeAndValidateOption(E,v){switch(E){case"cursorStyle":if(v||(v=o.DEFAULT_OPTIONS[E]),!(function(y){return y==="block"||y==="underline"||y==="bar"})(v))throw new Error(`"${v}" is not a valid value for ${E}`);break;case"wordSeparator":v||(v=o.DEFAULT_OPTIONS[E]);break;case"fontWeight":case"fontWeightBold":if(typeof v=="number"&&1<=v&&v<=1e3)break;v=b.includes(v)?v:o.DEFAULT_OPTIONS[E];break;case"cursorWidth":v=Math.floor(v);case"lineHeight":case"tabStopWidth":if(v<1)throw new Error(`${E} cannot be less than 1, value: ${v}`);break;case"minimumContrastRatio":v=Math.max(1,Math.min(21,Math.round(10*v)/10));break;case"scrollback":if((v=Math.min(v,4294967295))<0)throw new Error(`${E} cannot be less than 0, value: ${v}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(v<=0)throw new Error(`${E} cannot be less than or equal to 0, value: ${v}`);break;case"rows":case"cols":if(!v&&v!==0)throw new Error(`${E} must be numeric, value: ${v}`);break;case"windowsPty":v=v??{}}return v}}o.OptionsService=w},2660:function(f,o,c){var h=this&&this.__decorate||function(w,R,E,v){var y,_=arguments.length,S=_<3?R:v===null?v=Object.getOwnPropertyDescriptor(R,E):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(w,R,E,v);else for(var A=w.length-1;A>=0;A--)(y=w[A])&&(S=(_<3?y(S):_>3?y(R,E,S):y(R,E))||S);return _>3&&S&&Object.defineProperty(R,E,S),S},p=this&&this.__param||function(w,R){return function(E,v){R(E,v,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const u=c(2585);let b=o.OscLinkService=class{constructor(w){this._bufferService=w,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(w){const R=this._bufferService.buffer;if(w.id===void 0){const A=R.addMarker(R.ybase+R.y),L={data:w,id:this._nextId++,lines:[A]};return A.onDispose((()=>this._removeMarkerFromLink(L,A))),this._dataByLinkId.set(L.id,L),L.id}const E=w,v=this._getEntryIdKey(E),y=this._entriesWithId.get(v);if(y)return this.addLineToLink(y.id,R.ybase+R.y),y.id;const _=R.addMarker(R.ybase+R.y),S={id:this._nextId++,key:this._getEntryIdKey(E),data:E,lines:[_]};return _.onDispose((()=>this._removeMarkerFromLink(S,_))),this._entriesWithId.set(S.key,S),this._dataByLinkId.set(S.id,S),S.id}addLineToLink(w,R){const E=this._dataByLinkId.get(w);if(E&&E.lines.every((v=>v.line!==R))){const v=this._bufferService.buffer.addMarker(R);E.lines.push(v),v.onDispose((()=>this._removeMarkerFromLink(E,v)))}}getLinkData(w){var R;return(R=this._dataByLinkId.get(w))==null?void 0:R.data}_getEntryIdKey(w){return`${w.id};;${w.uri}`}_removeMarkerFromLink(w,R){const E=w.lines.indexOf(R);E!==-1&&(w.lines.splice(E,1),w.lines.length===0&&(w.data.id!==void 0&&this._entriesWithId.delete(w.key),this._dataByLinkId.delete(w.id)))}};o.OscLinkService=b=h([p(0,u.IBufferService)],b)},8343:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const c="di$target",h="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(p){return p[h]||[]},o.createDecorator=function(p){if(o.serviceRegistry.has(p))return o.serviceRegistry.get(p);const u=function(b,w,R){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(E,v,y){v[c]===v?v[h].push({id:E,index:y}):(v[h]=[{id:E,index:y}],v[c]=v)})(u,b,R)};return u.toString=()=>p,o.serviceRegistry.set(p,u),u}},2585:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const h=c(8343);var p;o.IBufferService=(0,h.createDecorator)("BufferService"),o.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),o.ICoreService=(0,h.createDecorator)("CoreService"),o.ICharsetService=(0,h.createDecorator)("CharsetService"),o.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||(o.LogLevelEnum=p={})),o.ILogService=(0,h.createDecorator)("LogService"),o.IOptionsService=(0,h.createDecorator)("OptionsService"),o.IOscLinkService=(0,h.createDecorator)("OscLinkService"),o.IUnicodeService=(0,h.createDecorator)("UnicodeService"),o.IDecorationService=(0,h.createDecorator)("DecorationService")},1480:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const h=c(8460),p=c(225);class u{static extractShouldJoin(w){return(1&w)!=0}static extractWidth(w){return w>>1&3}static extractCharKind(w){return w>>3}static createPropertyValue(w,R,E=!1){return(16777215&w)<<3|(3&R)<<1|(E?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const w=new p.UnicodeV6;this.register(w),this._active=w.version,this._activeProvider=w}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(w){if(!this._providers[w])throw new Error(`unknown Unicode version "${w}"`);this._active=w,this._activeProvider=this._providers[w],this._onChange.fire(w)}register(w){this._providers[w.version]=w}wcwidth(w){return this._activeProvider.wcwidth(w)}getStringCellWidth(w){let R=0,E=0;const v=w.length;for(let y=0;y<v;++y){let _=w.charCodeAt(y);if(55296<=_&&_<=56319){if(++y>=v)return R+this.wcwidth(_);const L=w.charCodeAt(y);56320<=L&&L<=57343?_=1024*(_-55296)+L-56320+65536:R+=this.wcwidth(L)}const S=this.charProperties(_,E);let A=u.extractWidth(S);u.extractShouldJoin(S)&&(A-=u.extractWidth(E)),R+=A,E=S}return R}charProperties(w,R){return this._activeProvider.charProperties(w,R)}}o.UnicodeService=u}},l={};function d(f){var o=l[f];if(o!==void 0)return o.exports;var c=l[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 o=d(9042),c=d(3236),h=d(844),p=d(5741),u=d(8285),b=d(7975),w=d(7090),R=["cols","rows"];class E extends h.Disposable{constructor(y){super(),this._core=this.register(new c.Terminal(y)),this._addonManager=this.register(new p.AddonManager),this._publicOptions={...this._core.options};const _=A=>this._core.options[A],S=(A,L)=>{this._checkReadonlyOptions(A),this._core.options[A]=L};for(const A in this._core.options){const L={get:_.bind(this,A),set:S.bind(this,A)};Object.defineProperty(this._publicOptions,A,L)}}_checkReadonlyOptions(y){if(R.includes(y))throw new Error(`Option "${y}" 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 w.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new u.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const y=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:y.applicationCursorKeys,applicationKeypadMode:y.applicationKeypad,bracketedPasteMode:y.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:_,originMode:y.origin,reverseWraparoundMode:y.reverseWraparound,sendFocusMode:y.sendFocus,wraparoundMode:y.wraparound}}get options(){return this._publicOptions}set options(y){for(const _ in y)this._publicOptions[_]=y[_]}blur(){this._core.blur()}focus(){this._core.focus()}input(y,_=!0){this._core.input(y,_)}resize(y,_){this._verifyIntegers(y,_),this._core.resize(y,_)}open(y){this._core.open(y)}attachCustomKeyEventHandler(y){this._core.attachCustomKeyEventHandler(y)}attachCustomWheelEventHandler(y){this._core.attachCustomWheelEventHandler(y)}registerLinkProvider(y){return this._core.registerLinkProvider(y)}registerCharacterJoiner(y){return this._checkProposedApi(),this._core.registerCharacterJoiner(y)}deregisterCharacterJoiner(y){this._checkProposedApi(),this._core.deregisterCharacterJoiner(y)}registerMarker(y=0){return this._verifyIntegers(y),this._core.registerMarker(y)}registerDecoration(y){return this._checkProposedApi(),this._verifyPositiveIntegers(y.x??0,y.width??0,y.height??0),this._core.registerDecoration(y)}hasSelection(){return this._core.hasSelection()}select(y,_,S){this._verifyIntegers(y,_,S),this._core.select(y,_,S)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(y,_){this._verifyIntegers(y,_),this._core.selectLines(y,_)}dispose(){super.dispose()}scrollLines(y){this._verifyIntegers(y),this._core.scrollLines(y)}scrollPages(y){this._verifyIntegers(y),this._core.scrollPages(y)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(y){this._verifyIntegers(y),this._core.scrollToLine(y)}clear(){this._core.clear()}write(y,_){this._core.write(y,_)}writeln(y,_){this._core.write(y),this._core.write(`\r
59
+ `,_)}paste(y){this._core.paste(y)}refresh(y,_){this._verifyIntegers(y,_),this._core.refresh(y,_)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(y){this._addonManager.loadAddon(this,y)}static get strings(){return o}_verifyIntegers(...y){for(const _ of y)if(_===1/0||isNaN(_)||_%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...y){for(const _ of y)if(_&&(_===1/0||isNaN(_)||_%1!=0||_<0))throw new Error("This API only accepts positive integers")}}f.Terminal=E})(),g})()))})(Yu)),Yu.exports}var d1=f1();class p1{constructor(r,s){Om(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 o,c,h;let f;try{f=JSON.parse(g.data)}catch(p){(o=s.onError)==null||o.call(s,`Terminal message parse failed for session ${r}. Reason: ${jo(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 No({sessionId:n,active:r=!0,onEvent:s}){const l=te.useRef(null),d=te.useRef(null),g=te.useRef(null),f=te.useRef(null),o=te.useRef(r),c=te.useRef(s);function h(p={}){const u=l.current,b=d.current,w=g.current,R=f.current;if(!u||!b||!w||!R)return!1;const E=u.getBoundingClientRect();return E.width<Ym||E.height<Xm||(w.fit(),R.cols<Qm||R.rows<Jm)?!1:(b.resize(R.cols,R.rows),p.focus&&R.focus(),!0)}return te.useEffect(()=>{c.current=s},[s]),te.useEffect(()=>{o.current=r},[r]),te.useEffect(()=>{if(!l.current)return;const p=new d1.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:m1}),u=new c1.FitAddon;p.loadAddon(u),p.loadAddon(new h1.WebLinksAddon),p.open(l.current),f.current=p,g.current=u;const b=l.current.getBoundingClientRect();b.width>=Ym&&b.height>=Xm&&u.fit();const w=new p1(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=w,p.cols>=Qm&&p.rows>=Jm&&w.resize(p.cols,p.rows);const R=p.onData(A=>{w.sendInput(A)});let E=0,v=0,y=0;const _=()=>{E&&window.cancelAnimationFrame(E),E=window.requestAnimationFrame(()=>{E=0,h({focus:o.current})})},S=new ResizeObserver(()=>{_()});return S.observe(l.current),v=window.requestAnimationFrame(_),y=window.setTimeout(_,120),()=>{E&&window.cancelAnimationFrame(E),v&&window.cancelAnimationFrame(v),y&&window.clearTimeout(y),S.disconnect(),R.dispose(),w.close(),p.dispose(),d.current=null,f.current=null,g.current=null}},[n]),te.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]),te.useEffect(()=>{const p=()=>{o.current&&h()};return window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[]),x.jsx("div",{className:"terminal-frame",ref:l,onMouseDown:()=>{var p;return(p=f.current)==null?void 0:p.focus()}})}const Ym=160,Xm=80,Qm=20,Jm=5,m1={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"},u_=[{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"}],h_=[{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"}],g1=[{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"}],f_=[...g1,{value:"max",label:"Max",description:"Maximum reasoning"},{value:"ultracode",label:"Ultracode",description:"Claude Code dynamic workflows with xhigh reasoning"}];function zi({status:n}){return x.jsx("span",{className:`status-badge status-${n}`,children:n.replaceAll("_"," ")})}function Hh({role:n,session:r,permissionMode:s,model:l,effort:d,busy:g=!1,onPermissionModeChange:f,onModelChange:o,onEffortChange:c,onStart:h,onResume:p,onStop:u,onRestart:b,onNotifyHarnessUpdated:w}){const R=(r==null?void 0:r.status)==="running",E=!!(r!=null&&r.claudeSessionId&&!R),v=!R&&!(r!=null&&r.claudeSessionId),y=!!(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:u_.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:l,onChange:_=>o(_.target.value),children:h_.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:f_.map(_=>x.jsx("option",{value:_.value,children:_.label},_.value))})]}),x.jsxs("div",{className:"session-toolbar",children:[x.jsx("button",{type:"button",disabled:g||!v,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"})]}),y?x.jsxs("div",{className:"session-harness-notice",children:[x.jsx(zi,{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||!R||!w,onClick:w,children:"Notify role"})]}):null]})}function _1({busy:n,effort:r,model:s,open:l,permissionMode:d,taskSlug:g,bootstrapStatus:f,engineerSession:o,status:c,onClose:h,onEffortChange:p,onModelChange:u,onPermissionModeChange:b,onEngineerResume:w,onEngineerRestart:R,onEngineerStart:E,onEngineerStop:v,onEngineerNotifyHarnessUpdated:y,onOpenRepositoryDiff:_,onReviewTaskHarness:S,onRefresh:A}){const[L,D]=te.useState(null),[T,k]=te.useState(null),[M,B]=te.useState(""),[H,U]=te.useState(!1),[P,Y]=te.useState(!1),[,X]=br(null),[V,K]=te.useState(null),ne=(c==null?void 0:c.files)??[],z=ne.filter(ie=>ie.kind.startsWith("agent-")),j=z.filter(ie=>Zm(ie)),N=z.filter(ie=>!Zm(ie)),$=ne.filter(ie=>ie.kind.startsWith("skill-")),I=ne.filter(ie=>ie.kind.startsWith("tool-")),se=ne.filter(ie=>ie.kind==="root-claude"||ie.kind==="gitignore"||ie.kind==="pull-request-template"),ae=!!(T&&M!==T.content);te.useEffect(()=>{l||(D(null),k(null),B(""),U(!1),X(null))},[ne,l,L]),te.useEffect(()=>{if(!l||!L||!g)return;let ie=!1;return Y(!0),X(null),U(!1),ye.getHarnessFileContent(g,L).then(ee=>{ie||(k(ee),B(ee.content))}).catch(ee=>{ie||X(Je(`Load harness file ${L}`,ee))}).finally(()=>{ie||Y(!1)}),()=>{ie=!0}},[l,L,g]);async function he(){if(!(!T||!T.editable||!ae||!g)){Y(!0),X(null);try{const ie=await ye.updateHarnessFileContent(g,T.path,{content:M});k(ie.file),B(ie.file.content),U(!1),A()}catch(ie){X(Je(`Save harness file ${T.path}`,ie))}finally{Y(!1)}}}function W(){D(null),k(null),B(""),U(!1),X(null)}async function q(ie){X(null);try{await v1(ie),K(ie),window.setTimeout(()=>{K(ee=>ee===ie?null:ee)},1200)}catch(ee){X(Je(`Copy harness file path ${ie}`,ee))}}return l?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:S,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:(T==null?void 0:T.title)??"Harness File"}),x.jsx("p",{className:"muted",children:(T==null?void 0:T.path)??L})]}),x.jsxs("div",{className:"harness-studio-file-editor-actions",children:[T?x.jsx(zi,{status:T.editable?"ok":"unknown"}):null,H?x.jsxs(x.Fragment,{children:[x.jsx("button",{type:"button",disabled:P||!g||!(T!=null&&T.editable)||!ae,onClick:()=>void he(),children:"Save"}),x.jsx("button",{type:"button",disabled:P,onClick:()=>{B((T==null?void 0:T.content)??""),U(!1)},children:"Cancel"})]}):x.jsx("button",{type:"button",disabled:P||!g||!(T!=null&&T.editable),onClick:()=>U(!0),children:"Edit"}),x.jsx("button",{type:"button",onClick:W,children:"Return"})]})]}),T!=null&&T.readonlyReason?x.jsx("p",{className:"muted",children:T.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:ie=>B(ie.target.value)})]}):x.jsxs(x.Fragment,{children:[x.jsx(Fa,{title:"VCM Roles",files:j,selectedPath:L,copiedPath:V,onCopy:ie=>void q(ie),onSelect:D}),x.jsx(Fa,{title:"Auxiliary Roles",files:N,selectedPath:L,copiedPath:V,onCopy:ie=>void q(ie),onSelect:D}),x.jsx(vh,{title:"Overview",children:x.jsxs("section",{className:"harness-studio-overview",children:[x.jsxs("div",{className:"harness-studio-metrics",children:[x.jsx(Ns,{label:"Fixed install",value:c?c.initialized?c.needsApply?"updates":"current":"new":"unknown"}),x.jsx(Ns,{label:"Revision",value:String((c==null?void 0:c.harnessRevision)??0)}),x.jsx(Ns,{label:"Managed files",value:String(ne.length)}),x.jsx(Ns,{label:"Pending updates",value:String((c==null?void 0:c.plannedChanges.length)??0)}),x.jsx(Ns,{label:"Bootstrap",value:(f==null?void 0:f.status.replaceAll("_"," "))??"unknown"}),x.jsx(Ns,{label:"Engineer",value:eg(o)})]}),c!=null&&c.warnings.length?x.jsx("ul",{className:"warnings",children:c.warnings.map(ie=>x.jsx("li",{children:ie},ie))}):null]})}),x.jsx(Fa,{title:"Skills",files:$,selectedPath:L,copiedPath:V,onCopy:ie=>void q(ie),onSelect:D,collapsible:!0}),x.jsx(Fa,{title:"Root Context",files:se,selectedPath:L,copiedPath:V,onCopy:ie=>void q(ie),onSelect:D,collapsible:!0}),x.jsx(Fa,{title:"Tools",files:I,selectedPath:L,copiedPath:V,onCopy:ie=>void q(ie),onSelect:D,collapsible:!0}),x.jsx(vh,{title:"Project Docs",children:x.jsx("ul",{className:"harness-studio-doc-list",children:(f==null?void 0:f.checks.map(ie=>x.jsxs("li",{children:[x.jsx("span",{children:ie.path??ie.label}),x.jsx(zi,{status:ie.status})]},ie.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:eg(o)})]}),x.jsx(zi,{status:(o==null?void 0:o.status)??"unknown"})]}),x.jsx(Hh,{role:"harness-engineer",session:o??void 0,permissionMode:d,model:s,effort:r,busy:n,onPermissionModeChange:b,onModelChange:u,onEffortChange:p,onStart:E,onResume:w,onRestart:R,onStop:v,onNotifyHarnessUpdated:y}),x.jsx("div",{className:"harness-engineer-terminal",children:(o==null?void 0:o.status)==="running"?x.jsx(No,{sessionId:o.id,active:l},o.id):x.jsxs("div",{className:"terminal-empty",children:[x.jsx("strong",{children:"harness-engineer"}),x.jsx("span",{children:o!=null&&o.claudeSessionId?"Resume this project Harness Engineer session.":"Start this project Harness Engineer session."})]})})]})]})]})})}):null}function Ns({label:n,value:r}){return x.jsxs("div",{className:"harness-studio-metric",children:[x.jsx("span",{children:n}),x.jsx("strong",{children:r})]})}function Fa({title:n,files:r,selectedPath:s,copiedPath:l,onCopy:d,onSelect:g,collapsible:f=!1}){const o=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:l===c.path?"Copied":"Copy"}),x.jsx(zi,{status:c.action})]},c.path)):x.jsx("li",{children:x.jsx("span",{children:"No files."})})});return f?x.jsx(vh,{title:n,children:o}):x.jsxs("section",{className:"harness-studio-section",children:[x.jsx("h3",{children:n}),o]})}function vh({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 Zm(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 eg(n){return n?n.status==="running"?`${n.status} / ${n.activityStatus??"idle"}`:n.status:"not started"}async function v1(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 y1({open:n,taskSlug:r,onClose:s}){var k;const[l,d]=te.useState(null),[g,f]=te.useState(null),[o,c]=te.useState(null),[h,p]=te.useState(null),[u,b]=te.useState(null),[w,R]=te.useState(!1),[E,v]=te.useState(!1),[,y]=br(null),[_,S]=te.useState(null),A=te.useMemo(()=>(l==null?void 0:l.files.find(M=>M.path===o))??(l==null?void 0:l.files[0])??null,[l,o]);async function L(M=g){var B;R(!0),y(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(Y=>Y.path===U)?U:((P=H.files[0])==null?void 0:P.path)??null})}catch(H){y(Je(M?`Load commit diff ${M}`:"Load latest commit diff",H))}finally{R(!1)}}te.useEffect(()=>{n&&(f(null),S(null),L(null))},[n,r]);async function D(M){b(M),y(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){y(Je(`Load task file diff for ${M}`,B))}finally{b(null)}}async function T(){if(y(null),S(null),!r){y("Create or select a task before merging the task branch.");return}if(!l){y("Load the commit diff before merging the task branch.");return}const M=l.commits.length?l.commits.map(H=>`- ${H.shortSha} ${H.subject}`):["- No new commits found."];if(window.confirm([`Merge ${l.sourceBranch} into ${l.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
+ `))){v(!0);try{const H=await ye.mergeRepositoryDiffToCurrentBranch(r);S(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){y(Je("Merge task branch to connected repository branch",H))}finally{v(!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:l?`${((k=l.commit)==null?void 0:k.shortSha)??"HEAD"} · ${l.summary.totalFiles} files · +${l.summary.additions} / -${l.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:w||!(l!=null&&l.commits.length),onChange:M=>{const B=M.target.value||null;f(B),L(B)},children:l==null?void 0:l.commits.map(M=>x.jsxs("option",{value:M.sha,children:[M.shortSha," · ",M.subject]},M.sha))})]}),x.jsx("button",{type:"button",disabled:w,onClick:()=>void L(),children:"Refresh"}),x.jsx("button",{type:"button",disabled:w||E||!r||!(l!=null&&l.commits.length),onClick:()=>void T(),children:E?"Merging...":"Merge to Main"}),x.jsx("button",{type:"button",onClick:s,children:"Close"})]})]}),_?x.jsx("p",{className:"success-banner",children:_}):null,l!=null&&l.warnings.length?x.jsx("ul",{className:"warnings repository-diff-warnings",children:l.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(S1,{report:l,busy:w}),x.jsxs("ol",{className:"repository-diff-file-list",children:[l==null?void 0:l.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:[Sh(M.status)," · ",tg(M.stage)," · ",yh(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)),l&&l.files.length===0?x.jsx("li",{className:"repository-diff-empty",children:l.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(b1,{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:[yh(A.category)," · ",Sh(A.status)," · ",tg(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:d_(A.diff)})]}):x.jsx("div",{className:"repository-diff-placeholder",children:w?"Loading commit diff...":"No diff selected."})})]})]})}):null}function S1({report:n,busy:r}){var l;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:((l=n==null?void 0:n.commit)==null?void 0:l.subject)??"HEAD"})]}):null]})}function b1({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(l=>x.jsx("li",{children:l},l))}):null,s?x.jsxs(x.Fragment,{children:[x.jsxs("p",{className:"muted",children:[yh(s.category)," · ",Sh(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:d_(s.diff)})]}):x.jsx("div",{className:"repository-diff-placeholder",children:"No task-level diff for this file."})]})}function yh(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 tg(n){return n.replaceAll("_"," ")}function Sh(n){return n.replaceAll("_"," ")}function d_(n){return n.split(`
62
+ `).filter(r=>!w1(r)).map((r,s)=>x.jsx("span",{className:`repository-diff-line ${C1(r)}`,children:r||" "},`${s}:${r}`))}function C1(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 w1(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 x1({busy:n,effort:r,model:s,open:l,permissionMode:d,session:g,onClose:f,onEffortChange:o,onModelChange:c,onPermissionModeChange:h,onResume:p,onRestart:u,onStart:b,onStop:w,onNotifyHarnessUpdated:R}){return l?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:E1(g)})]}),x.jsx("button",{type:"button",onClick:f,children:"Close"})]}),x.jsx(Hh,{role:"translator",session:g??void 0,permissionMode:d,model:s,effort:r,busy:n,onPermissionModeChange:h,onModelChange:c,onEffortChange:o,onStart:b,onResume:p,onRestart:u,onStop:w,onNotifyHarnessUpdated:R}),x.jsx("div",{className:"translator-session-terminal",children:(g==null?void 0:g.status)==="running"?x.jsx(No,{sessionId:g.id,active:l},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 E1(n){if(!n)return"not started";const r=n.status==="running"?` · ${n.activityStatus??"idle"}`:"";return`${n.status}${r}`}function k1(n,r){const s={};return(n[n.length-1]===""?[...n,""]:n).join((s.padRight?" ":"")+","+(s.padLeft===!1?"":" ")).trim()}const A1=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,R1=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,T1={};function ng(n,r){return(T1.jsx?R1:A1).test(n)}const D1=/[ \t\n\f\r]/g;function M1(n){return typeof n=="object"?n.type==="text"?ig(n.value):!1:ig(n)}function ig(n){return n.replace(D1,"")===""}class nl{constructor(r,s,l){this.normal=s,this.property=r,l&&(this.space=l)}}nl.prototype.normal={};nl.prototype.property={};nl.prototype.space=void 0;function p_(n,r){const s={},l={};for(const d of n)Object.assign(s,d.property),Object.assign(l,d.normal);return new nl(s,l,r)}function bh(n){return n.toLowerCase()}class xn{constructor(r,s){this.attribute=s,this.property=r}}xn.prototype.attribute="";xn.prototype.booleanish=!1;xn.prototype.boolean=!1;xn.prototype.commaOrSpaceSeparated=!1;xn.prototype.commaSeparated=!1;xn.prototype.defined=!1;xn.prototype.mustUseProperty=!1;xn.prototype.number=!1;xn.prototype.overloadedBoolean=!1;xn.prototype.property="";xn.prototype.spaceSeparated=!1;xn.prototype.space=void 0;let L1=0;const Fe=Yr(),Lt=Yr(),Ch=Yr(),be=Yr(),pt=Yr(),Ps=Yr(),Nn=Yr();function Yr(){return 2**++L1}const wh=Object.freeze(Object.defineProperty({__proto__:null,boolean:Fe,booleanish:Lt,commaOrSpaceSeparated:Nn,commaSeparated:Ps,number:be,overloadedBoolean:Ch,spaceSeparated:pt},Symbol.toStringTag,{value:"Module"})),Xu=Object.keys(wh);class zh extends xn{constructor(r,s,l,d){let g=-1;if(super(r,s),rg(this,"space",d),typeof l=="number")for(;++g<Xu.length;){const f=Xu[g];rg(this,Xu[g],(l&wh[f])===wh[f])}}}zh.prototype.defined=!0;function rg(n,r,s){s&&(n[r]=s)}function Gs(n){const r={},s={};for(const[l,d]of Object.entries(n.properties)){const g=new zh(l,n.transform(n.attributes||{},l),d,n.space);n.mustUseProperty&&n.mustUseProperty.includes(l)&&(g.mustUseProperty=!0),r[l]=g,s[bh(l)]=l,s[bh(g.attribute)]=l}return new nl(r,s,n.space)}const m_=Gs({properties:{ariaActiveDescendant:null,ariaAtomic:Lt,ariaAutoComplete:null,ariaBusy:Lt,ariaChecked:Lt,ariaColCount:be,ariaColIndex:be,ariaColSpan:be,ariaControls:pt,ariaCurrent:null,ariaDescribedBy:pt,ariaDetails:null,ariaDisabled:Lt,ariaDropEffect:pt,ariaErrorMessage:null,ariaExpanded:Lt,ariaFlowTo:pt,ariaGrabbed:Lt,ariaHasPopup:null,ariaHidden:Lt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:pt,ariaLevel:be,ariaLive:null,ariaModal:Lt,ariaMultiLine:Lt,ariaMultiSelectable:Lt,ariaOrientation:null,ariaOwns:pt,ariaPlaceholder:null,ariaPosInSet:be,ariaPressed:Lt,ariaReadOnly:Lt,ariaRelevant:null,ariaRequired:Lt,ariaRoleDescription:pt,ariaRowCount:be,ariaRowIndex:be,ariaRowSpan:be,ariaSelected:Lt,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 g_(n,r){return r in n?n[r]:r}function __(n,r){return g_(n,r.toLowerCase())}const O1=Gs({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ps,acceptCharset:pt,accessKey:pt,action:null,allow:null,allowFullScreen:Fe,allowPaymentRequest:Fe,allowUserMedia:Fe,alt:null,as:null,async:Fe,autoCapitalize:null,autoComplete:pt,autoFocus:Fe,autoPlay:Fe,blocking:pt,capture:null,charSet:null,checked:Fe,cite:null,className:pt,cols:be,colSpan:null,content:null,contentEditable:Lt,controls:Fe,controlsList:pt,coords:be|Ps,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Fe,defer:Fe,dir:null,dirName:null,disabled:Fe,download:Ch,draggable:Lt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Fe,formTarget:null,headers:pt,height:be,hidden:Ch,high:be,href:null,hrefLang:null,htmlFor:pt,httpEquiv:pt,id:null,imageSizes:null,imageSrcSet:null,inert:Fe,inputMode:null,integrity:null,is:null,isMap:Fe,itemId:null,itemProp:pt,itemRef:pt,itemScope:Fe,itemType:pt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Fe,low:be,manifest:null,max:null,maxLength:be,media:null,method:null,min:null,minLength:be,multiple:Fe,muted:Fe,name:null,nonce:null,noModule:Fe,noValidate:Fe,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:Fe,optimum:be,pattern:null,ping:pt,placeholder:null,playsInline:Fe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Fe,referrerPolicy:null,rel:pt,required:Fe,reversed:Fe,rows:be,rowSpan:be,sandbox:pt,scope:null,scoped:Fe,seamless:Fe,selected:Fe,shadowRootClonable:Fe,shadowRootDelegatesFocus:Fe,shadowRootMode:null,shape:null,size:be,sizes:null,slot:null,span:be,spellCheck:Lt,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:Fe,useMap:null,value:Lt,width:be,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:pt,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:Fe,declare:Fe,event:null,face:null,frame:null,frameBorder:null,hSpace:be,leftMargin:be,link:null,longDesc:null,lowSrc:null,marginHeight:be,marginWidth:be,noResize:Fe,noHref:Fe,noShade:Fe,noWrap:Fe,object:null,profile:null,prompt:null,rev:null,rightMargin:be,rules:null,scheme:null,scrolling:Lt,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:Fe,disableRemotePlayback:Fe,prefix:null,property:null,results:be,security:null,unselectable:null},space:"html",transform:__}),B1=Gs({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Nn,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:pt,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:Fe,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:Ps,g2:Ps,glyphName:Ps,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:Nn,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:pt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:be,pointsAtY:be,pointsAtZ:be,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Nn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Nn,rev:Nn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Nn,requiredFeatures:Nn,requiredFonts:Nn,requiredFormats:Nn,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:Nn,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:Nn,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:Nn,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:g_}),v_=Gs({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(n,r){return"xlink:"+r.slice(5).toLowerCase()}}),y_=Gs({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:__}),S_=Gs({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(n,r){return"xml:"+r.slice(3).toLowerCase()}}),j1={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"},N1=/[A-Z]/g,sg=/-[a-z]/g,H1=/^data[-\w.:]+$/i;function z1(n,r){const s=bh(r);let l=r,d=xn;if(s in n.normal)return n.property[n.normal[s]];if(s.length>4&&s.slice(0,4)==="data"&&H1.test(r)){if(r.charAt(4)==="-"){const g=r.slice(5).replace(sg,U1);l="data"+g.charAt(0).toUpperCase()+g.slice(1)}else{const g=r.slice(4);if(!sg.test(g)){let f=g.replace(N1,I1);f.charAt(0)!=="-"&&(f="-"+f),r="data"+f}}d=zh}return new d(l,r)}function I1(n){return"-"+n.toLowerCase()}function U1(n){return n.charAt(1).toUpperCase()}const P1=p_([m_,O1,v_,y_,S_],"html"),Ih=p_([m_,B1,v_,y_,S_],"svg");function F1(n){return n.join(" ").trim()}var Hs={},Qu,ag;function q1(){if(ag)return Qu;ag=1;var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,s=/^\s*/,l=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,d=/^:\s*/,g=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,f=/^[;\s]*/,o=/^\s+|\s+$/g,c=`
63
+ `,h="/",p="*",u="",b="comment",w="declaration";function R(v,y){if(typeof v!="string")throw new TypeError("First argument must be a string");if(!v)return[];y=y||{};var _=1,S=1;function A(Y){var X=Y.match(r);X&&(_+=X.length);var V=Y.lastIndexOf(c);S=~V?Y.length-V:S+Y.length}function L(){var Y={line:_,column:S};return function(X){return X.position=new D(Y),M(),X}}function D(Y){this.start=Y,this.end={line:_,column:S},this.source=y.source}D.prototype.content=v;function T(Y){var X=new Error(y.source+":"+_+":"+S+": "+Y);if(X.reason=Y,X.filename=y.source,X.line=_,X.column=S,X.source=v,!y.silent)throw X}function k(Y){var X=Y.exec(v);if(X){var V=X[0];return A(V),v=v.slice(V.length),X}}function M(){k(s)}function B(Y){var X;for(Y=Y||[];X=H();)X!==!1&&Y.push(X);return Y}function H(){var Y=L();if(!(h!=v.charAt(0)||p!=v.charAt(1))){for(var X=2;u!=v.charAt(X)&&(p!=v.charAt(X)||h!=v.charAt(X+1));)++X;if(X+=2,u===v.charAt(X-1))return T("End of comment missing");var V=v.slice(2,X-2);return S+=2,A(V),v=v.slice(X),S+=2,Y({type:b,comment:V})}}function U(){var Y=L(),X=k(l);if(X){if(H(),!k(d))return T("property missing ':'");var V=k(g),K=Y({type:w,property:E(X[0].replace(n,u)),value:V?E(V[0].replace(n,u)):u});return k(f),K}}function P(){var Y=[];B(Y);for(var X;X=U();)X!==!1&&(Y.push(X),B(Y));return Y}return M(),P()}function E(v){return v?v.replace(o,u):u}return Qu=R,Qu}var lg;function $1(){if(lg)return Hs;lg=1;var n=Hs&&Hs.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(Hs,"__esModule",{value:!0}),Hs.default=s;const r=n(q1());function s(l,d){let g=null;if(!l||typeof l!="string")return g;const f=(0,r.default)(l),o=typeof d=="function";return f.forEach(c=>{if(c.type!=="declaration")return;const{property:h,value:p}=c;o?d(h,p,c):p&&(g=g||{},g[h]=p)}),g}return Hs}var qa={},og;function G1(){if(og)return qa;og=1,Object.defineProperty(qa,"__esModule",{value:!0}),qa.camelCase=void 0;var n=/^--[a-zA-Z0-9_-]+$/,r=/-([a-z])/g,s=/^[^-]+$/,l=/^-(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()},o=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,o):h=h.replace(l,o),h.replace(r,f))};return qa.camelCase=c,qa}var $a,cg;function V1(){if(cg)return $a;cg=1;var n=$a&&$a.__importDefault||function(d){return d&&d.__esModule?d:{default:d}},r=n($1()),s=G1();function l(d,g){var f={};return!d||typeof d!="string"||(0,r.default)(d,function(o,c){o&&c&&(f[(0,s.camelCase)(o,g)]=c)}),f}return l.default=l,$a=l,$a}var K1=V1();const W1=r_(K1),b_=C_("end"),Uh=C_("start");function C_(n){return r;function r(s){const l=s&&s.position&&s.position[n]||{};if(typeof l.line=="number"&&l.line>0&&typeof l.column=="number"&&l.column>0)return{line:l.line,column:l.column,offset:typeof l.offset=="number"&&l.offset>-1?l.offset:void 0}}}function Y1(n){const r=Uh(n),s=b_(n);if(r&&s)return{start:r,end:s}}function Wa(n){return!n||typeof n!="object"?"":"position"in n||"type"in n?ug(n.position):"start"in n||"end"in n?ug(n):"line"in n||"column"in n?xh(n):""}function xh(n){return hg(n&&n.line)+":"+hg(n&&n.column)}function ug(n){return xh(n&&n.start)+"-"+xh(n&&n.end)}function hg(n){return n&&typeof n=="number"?n:1}class rn extends Error{constructor(r,s,l){super(),typeof s=="string"&&(l=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 l=="string"){const c=l.indexOf(":");c===-1?g.ruleId=l:(g.source=l.slice(0,c),g.ruleId=l.slice(c+1))}if(!g.place&&g.ancestors&&g.ancestors){const c=g.ancestors[g.ancestors.length-1];c&&(g.place=c.position)}const o=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=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=d,this.line=o?o.line:void 0,this.name=Wa(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}}rn.prototype.file="";rn.prototype.name="";rn.prototype.reason="";rn.prototype.message="";rn.prototype.stack="";rn.prototype.column=void 0;rn.prototype.line=void 0;rn.prototype.ancestors=void 0;rn.prototype.cause=void 0;rn.prototype.fatal=void 0;rn.prototype.place=void 0;rn.prototype.ruleId=void 0;rn.prototype.source=void 0;const Ph={}.hasOwnProperty,X1=new Map,Q1=/[A-Z]/g,J1=new Set(["table","tbody","thead","tfoot","tr"]),Z1=new Set(["td","th"]),w_="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function eS(n,r){if(!r||r.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const s=r.filePath||void 0;let l;if(r.development){if(typeof r.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");l=oS(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");l=lS(s,r.jsx,r.jsxs)}const d={Fragment:r.Fragment,ancestors:[],components:r.components||{},create:l,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"?Ih:P1,stylePropertyNameCase:r.stylePropertyNameCase||"dom",tableCellAlignToStyle:r.tableCellAlignToStyle!==!1},g=x_(d,n,void 0);return g&&typeof g!="string"?g:d.create(n,d.Fragment,{children:g||void 0},void 0)}function x_(n,r,s){if(r.type==="element")return tS(n,r,s);if(r.type==="mdxFlowExpression"||r.type==="mdxTextExpression")return nS(n,r);if(r.type==="mdxJsxFlowElement"||r.type==="mdxJsxTextElement")return rS(n,r,s);if(r.type==="mdxjsEsm")return iS(n,r);if(r.type==="root")return sS(n,r,s);if(r.type==="text")return aS(n,r)}function tS(n,r,s){const l=n.schema;let d=l;r.tagName.toLowerCase()==="svg"&&l.space==="html"&&(d=Ih,n.schema=d),n.ancestors.push(r);const g=k_(n,r.tagName,!1),f=cS(n,r);let o=qh(n,r);return J1.has(r.tagName)&&(o=o.filter(function(c){return typeof c=="string"?!M1(c):!0})),E_(n,f,g,r),Fh(f,o),n.ancestors.pop(),n.schema=l,n.create(r,g,f,s)}function nS(n,r){if(r.data&&r.data.estree&&n.evaluater){const l=r.data.estree.body[0];return l.type,n.evaluater.evaluateExpression(l.expression)}Za(n,r.position)}function iS(n,r){if(r.data&&r.data.estree&&n.evaluater)return n.evaluater.evaluateProgram(r.data.estree);Za(n,r.position)}function rS(n,r,s){const l=n.schema;let d=l;r.name==="svg"&&l.space==="html"&&(d=Ih,n.schema=d),n.ancestors.push(r);const g=r.name===null?n.Fragment:k_(n,r.name,!0),f=uS(n,r),o=qh(n,r);return E_(n,f,g,r),Fh(f,o),n.ancestors.pop(),n.schema=l,n.create(r,g,f,s)}function sS(n,r,s){const l={};return Fh(l,qh(n,r)),n.create(r,n.Fragment,l,s)}function aS(n,r){return r.value}function E_(n,r,s,l){typeof s!="string"&&s!==n.Fragment&&n.passNode&&(r.node=l)}function Fh(n,r){if(r.length>0){const s=r.length>1?r:r[0];s&&(n.children=s)}}function lS(n,r,s){return l;function l(d,g,f,o){const h=Array.isArray(f.children)?s:r;return o?h(g,f,o):h(g,f)}}function oS(n,r){return s;function s(l,d,g,f){const o=Array.isArray(g.children),c=Uh(l);return r(d,g,f,o,{columnNumber:c?c.column-1:void 0,fileName:n,lineNumber:c?c.line:void 0},void 0)}}function cS(n,r){const s={};let l,d;for(d in r.properties)if(d!=="children"&&Ph.call(r.properties,d)){const g=hS(n,d,r.properties[d]);if(g){const[f,o]=g;n.tableCellAlignToStyle&&f==="align"&&typeof o=="string"&&Z1.has(r.tagName)?l=o:s[f]=o}}if(l){const g=s.style||(s.style={});g[n.stylePropertyNameCase==="css"?"text-align":"textAlign"]=l}return s}function uS(n,r){const s={};for(const l of r.attributes)if(l.type==="mdxJsxExpressionAttribute")if(l.data&&l.data.estree&&n.evaluater){const g=l.data.estree.body[0];g.type;const f=g.expression;f.type;const o=f.properties[0];o.type,Object.assign(s,n.evaluater.evaluateExpression(o.argument))}else Za(n,r.position);else{const d=l.name;let g;if(l.value&&typeof l.value=="object")if(l.value.data&&l.value.data.estree&&n.evaluater){const o=l.value.data.estree.body[0];o.type,g=n.evaluater.evaluateExpression(o.expression)}else Za(n,r.position);else g=l.value===null?!0:l.value;s[d]=g}return s}function qh(n,r){const s=[];let l=-1;const d=n.passKeys?new Map:X1;for(;++l<r.children.length;){const g=r.children[l];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 o=x_(n,g,f);o!==void 0&&s.push(o)}return s}function hS(n,r,s){const l=z1(n.schema,r);if(!(s==null||typeof s=="number"&&Number.isNaN(s))){if(Array.isArray(s)&&(s=l.commaSeparated?k1(s):F1(s)),l.property==="style"){let d=typeof s=="object"?s:fS(n,String(s));return n.stylePropertyNameCase==="css"&&(d=dS(d)),["style",d]}return[n.elementAttributeNameCase==="react"&&l.space?j1[l.property]||l.property:l.attribute,s]}}function fS(n,r){try{return W1(r,{reactCompat:!0})}catch(s){if(n.ignoreInvalidStyle)return{};const l=s,d=new rn("Cannot parse `style` attribute",{ancestors:n.ancestors,cause:l,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw d.file=n.filePath||void 0,d.url=w_+"#cannot-parse-style-attribute",d}}function k_(n,r,s){let l;if(!s)l={type:"Literal",value:r};else if(r.includes(".")){const d=r.split(".");let g=-1,f;for(;++g<d.length;){const o=ng(d[g])?{type:"Identifier",name:d[g]}:{type:"Literal",value:d[g]};f=f?{type:"MemberExpression",object:f,property:o,computed:!!(g&&o.type==="Literal"),optional:!1}:o}l=f}else l=ng(r)&&!/^[a-z]/.test(r)?{type:"Identifier",name:r}:{type:"Literal",value:r};if(l.type==="Literal"){const d=l.value;return Ph.call(n.components,d)?n.components[d]:d}if(n.evaluater)return n.evaluater.evaluateExpression(l);Za(n)}function Za(n,r){const s=new rn("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=w_+"#cannot-handle-mdx-estrees-without-createevaluater",s}function dS(n){const r={};let s;for(s in n)Ph.call(n,s)&&(r[pS(s)]=n[s]);return r}function pS(n){let r=n.replace(Q1,mS);return r.slice(0,3)==="ms-"&&(r="-"+r),r}function mS(n){return"-"+n.toLowerCase()}const Ju={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"]},gS={};function $h(n,r){const s=gS,l=typeof s.includeImageAlt=="boolean"?s.includeImageAlt:!0,d=typeof s.includeHtml=="boolean"?s.includeHtml:!0;return A_(n,l,d)}function A_(n,r,s){if(_S(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 fg(n.children,r,s)}return Array.isArray(n)?fg(n,r,s):""}function fg(n,r,s){const l=[];let d=-1;for(;++d<n.length;)l[d]=A_(n[d],r,s);return l.join("")}function _S(n){return!!(n&&typeof n=="object")}const dg=document.createElement("i");function Gh(n){const r="&"+n+";";dg.innerHTML=r;const s=dg.textContent;return s.charCodeAt(s.length-1)===59&&n!=="semi"||s===r?!1:s}function Hn(n,r,s,l){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,l.length<1e4)f=Array.from(l),f.unshift(r,s),n.splice(...f);else for(s&&n.splice(r,s);g<l.length;)f=l.slice(g,g+1e4),f.unshift(r,0),n.splice(...f),g+=1e4,r+=1e4}function Wn(n,r){return n.length>0?(Hn(n,n.length,0,r),n):r}const pg={}.hasOwnProperty;function R_(n){const r={};let s=-1;for(;++s<n.length;)vS(r,n[s]);return r}function vS(n,r){let s;for(s in r){const d=(pg.call(n,s)?n[s]:void 0)||(n[s]={}),g=r[s];let f;if(g)for(f in g){pg.call(d,f)||(d[f]=[]);const o=g[f];yS(d[f],Array.isArray(o)?o:o?[o]:[])}}}function yS(n,r){let s=-1;const l=[];for(;++s<r.length;)(r[s].add==="after"?n:l).push(r[s]);Hn(n,0,0,l)}function T_(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 si(n){return n.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const fn=Cr(/[A-Za-z]/),nn=Cr(/[\dA-Za-z]/),SS=Cr(/[#-'*+\--9=?A-Z^-~]/);function Ro(n){return n!==null&&(n<32||n===127)}const Eh=Cr(/\d/),bS=Cr(/[\dA-Fa-f]/),CS=Cr(/[!-/:-@[-`{-~]/);function Le(n){return n!==null&&n<-2}function ft(n){return n!==null&&(n<0||n===32)}function Ke(n){return n===-2||n===-1||n===32}const Ho=Cr(new RegExp("\\p{P}|\\p{S}","u")),Kr=Cr(/\s/);function Cr(n){return r;function r(s){return s!==null&&s>-1&&n.test(String.fromCharCode(s))}}function Vs(n){const r=[];let s=-1,l=0,d=0;for(;++s<n.length;){const g=n.charCodeAt(s);let f="";if(g===37&&nn(n.charCodeAt(s+1))&&nn(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 o=n.charCodeAt(s+1);g<56320&&o>56319&&o<57344?(f=String.fromCharCode(g,o),d=1):f="�"}else f=String.fromCharCode(g);f&&(r.push(n.slice(l,s),encodeURIComponent(f)),l=s+d+1,f=""),d&&(s+=d,d=0)}return r.join("")+n.slice(l)}function Qe(n,r,s,l){const d=l?l-1:Number.POSITIVE_INFINITY;let g=0;return f;function f(c){return Ke(c)?(n.enter(s),o(c)):r(c)}function o(c){return Ke(c)&&g++<d?(n.consume(c),o):(n.exit(s),r(c))}}const wS={tokenize:xS};function xS(n){const r=n.attempt(this.parser.constructs.contentInitial,l,d);let s;return r;function l(o){if(o===null){n.consume(o);return}return n.enter("lineEnding"),n.consume(o),n.exit("lineEnding"),Qe(n,r,"linePrefix")}function d(o){return n.enter("paragraph"),g(o)}function g(o){const c=n.enter("chunkText",{contentType:"text",previous:s});return s&&(s.next=c),s=c,f(o)}function f(o){if(o===null){n.exit("chunkText"),n.exit("paragraph"),n.consume(o);return}return Le(o)?(n.consume(o),n.exit("chunkText"),g):(n.consume(o),f)}}const ES={tokenize:kS},mg={tokenize:AS};function kS(n){const r=this,s=[];let l=0,d,g,f;return o;function o(S){if(l<s.length){const A=s[l];return r.containerState=A[1],n.attempt(A[0].continuation,c,h)(S)}return h(S)}function c(S){if(l++,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}y(l);let T=A;for(;T<r.events.length;)r.events[T][1].end={...D},T++;return Hn(r.events,L+1,0,r.events.slice(A)),r.events.length=T,h(S)}return o(S)}function h(S){if(l===s.length){if(!d)return b(S);if(d.currentConstruct&&d.currentConstruct.concrete)return R(S);r.interrupt=!!(d.currentConstruct&&!d._gfmTableDynamicInterruptHack)}return r.containerState={},n.check(mg,p,u)(S)}function p(S){return d&&_(),y(l),b(S)}function u(S){return r.parser.lazy[r.now().line]=l!==s.length,f=r.now().offset,R(S)}function b(S){return r.containerState={},n.attempt(mg,w,R)(S)}function w(S){return l++,s.push([r.currentConstruct,r.containerState]),b(S)}function R(S){if(S===null){d&&_(),y(0),n.consume(S);return}return d=d||r.parser.flow(r.now()),n.enter("chunkFlow",{_tokenizer:d,contentType:"flow",previous:g}),E(S)}function E(S){if(S===null){v(n.exit("chunkFlow"),!0),y(0),n.consume(S);return}return Le(S)?(n.consume(S),v(n.exit("chunkFlow")),l=0,r.interrupt=void 0,o):(n.consume(S),E)}function v(S,A){const L=r.sliceStream(S);if(A&&L.push(null),S.previous=g,g&&(g.next=S),g=S,d.defineSkip(S.start),d.write(L),r.parser.lazy[S.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 T=r.events.length;let k=T,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(y(l),D=T;D<r.events.length;)r.events[D][1].end={...B},D++;Hn(r.events,k+1,0,r.events.slice(T)),r.events.length=D}}function y(S){let A=s.length;for(;A-- >S;){const L=s[A];r.containerState=L[1],L[0].exit.call(r,n)}s.length=S}function _(){d.write([null]),g=void 0,d=void 0,r.containerState._closeFlow=void 0}}function AS(n,r,s){return Qe(n,n.attempt(this.parser.constructs.document,r,s),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function qs(n){if(n===null||ft(n)||Kr(n))return 1;if(Ho(n))return 2}function zo(n,r,s){const l=[];let d=-1;for(;++d<n.length;){const g=n[d].resolveAll;g&&!l.includes(g)&&(r=g(r,s),l.push(g))}return r}const kh={name:"attention",resolveAll:RS,tokenize:TS};function RS(n,r){let s=-1,l,d,g,f,o,c,h,p;for(;++s<n.length;)if(n[s][0]==="enter"&&n[s][1].type==="attentionSequence"&&n[s][1]._close){for(l=s;l--;)if(n[l][0]==="exit"&&n[l][1].type==="attentionSequence"&&n[l][1]._open&&r.sliceSerialize(n[l][1]).charCodeAt(0)===r.sliceSerialize(n[s][1]).charCodeAt(0)){if((n[l][1]._close||n[s][1]._open)&&(n[s][1].end.offset-n[s][1].start.offset)%3&&!((n[l][1].end.offset-n[l][1].start.offset+n[s][1].end.offset-n[s][1].start.offset)%3))continue;c=n[l][1].end.offset-n[l][1].start.offset>1&&n[s][1].end.offset-n[s][1].start.offset>1?2:1;const u={...n[l][1].end},b={...n[s][1].start};gg(u,-c),gg(b,c),f={type:c>1?"strongSequence":"emphasisSequence",start:u,end:{...n[l][1].end}},o={type:c>1?"strongSequence":"emphasisSequence",start:{...n[s][1].start},end:b},g={type:c>1?"strongText":"emphasisText",start:{...n[l][1].end},end:{...n[s][1].start}},d={type:c>1?"strong":"emphasis",start:{...f.start},end:{...o.end}},n[l][1].end={...f.start},n[s][1].start={...o.end},h=[],n[l][1].end.offset-n[l][1].start.offset&&(h=Wn(h,[["enter",n[l][1],r],["exit",n[l][1],r]])),h=Wn(h,[["enter",d,r],["enter",f,r],["exit",f,r],["enter",g,r]]),h=Wn(h,zo(r.parser.constructs.insideSpan.null,n.slice(l+1,s),r)),h=Wn(h,[["exit",g,r],["enter",o,r],["exit",o,r],["exit",d,r]]),n[s][1].end.offset-n[s][1].start.offset?(p=2,h=Wn(h,[["enter",n[s][1],r],["exit",n[s][1],r]])):p=0,Hn(n,l-1,s-l+3,h),s=l+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,l=this.previous,d=qs(l);let g;return f;function f(c){return g=c,n.enter("attentionSequence"),o(c)}function o(c){if(c===g)return n.consume(c),o;const h=n.exit("attentionSequence"),p=qs(c),u=!p||p===2&&d||s.includes(c),b=!d||d===2&&p||s.includes(l);return h._open=!!(g===42?u:u&&(d||!b)),h._close=!!(g===42?b:b&&(p||!u)),r(c)}}function gg(n,r){n.column+=r,n.offset+=r,n._bufferIndex+=r}const DS={name:"autolink",tokenize:MS};function MS(n,r,s){let l=0;return d;function d(w){return n.enter("autolink"),n.enter("autolinkMarker"),n.consume(w),n.exit("autolinkMarker"),n.enter("autolinkProtocol"),g}function g(w){return fn(w)?(n.consume(w),f):w===64?s(w):h(w)}function f(w){return w===43||w===45||w===46||nn(w)?(l=1,o(w)):h(w)}function o(w){return w===58?(n.consume(w),l=0,c):(w===43||w===45||w===46||nn(w))&&l++<32?(n.consume(w),o):(l=0,h(w))}function c(w){return w===62?(n.exit("autolinkProtocol"),n.enter("autolinkMarker"),n.consume(w),n.exit("autolinkMarker"),n.exit("autolink"),r):w===null||w===32||w===60||Ro(w)?s(w):(n.consume(w),c)}function h(w){return w===64?(n.consume(w),p):SS(w)?(n.consume(w),h):s(w)}function p(w){return nn(w)?u(w):s(w)}function u(w){return w===46?(n.consume(w),l=0,p):w===62?(n.exit("autolinkProtocol").type="autolinkEmail",n.enter("autolinkMarker"),n.consume(w),n.exit("autolinkMarker"),n.exit("autolink"),r):b(w)}function b(w){if((w===45||nn(w))&&l++<63){const R=w===45?b:u;return n.consume(w),R}return s(w)}}const il={partial:!0,tokenize:LS};function LS(n,r,s){return l;function l(g){return Ke(g)?Qe(n,d,"linePrefix")(g):d(g)}function d(g){return g===null||Le(g)?r(g):s(g)}}const D_={continuation:{tokenize:BS},exit:jS,name:"blockQuote",tokenize:OS};function OS(n,r,s){const l=this;return d;function d(f){if(f===62){const o=l.containerState;return o.open||(n.enter("blockQuote",{_container:!0}),o.open=!0),n.enter("blockQuotePrefix"),n.enter("blockQuoteMarker"),n.consume(f),n.exit("blockQuoteMarker"),g}return s(f)}function g(f){return Ke(f)?(n.enter("blockQuotePrefixWhitespace"),n.consume(f),n.exit("blockQuotePrefixWhitespace"),n.exit("blockQuotePrefix"),r):(n.exit("blockQuotePrefix"),r(f))}}function BS(n,r,s){const l=this;return d;function d(f){return Ke(f)?Qe(n,g,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f):g(f)}function g(f){return n.attempt(D_,r,s)(f)}}function jS(n){n.exit("blockQuote")}const M_={name:"characterEscape",tokenize:NS};function NS(n,r,s){return l;function l(g){return n.enter("characterEscape"),n.enter("escapeMarker"),n.consume(g),n.exit("escapeMarker"),d}function d(g){return CS(g)?(n.enter("characterEscapeValue"),n.consume(g),n.exit("characterEscapeValue"),n.exit("characterEscape"),r):s(g)}}const L_={name:"characterReference",tokenize:HS};function HS(n,r,s){const l=this;let d=0,g,f;return o;function o(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=nn,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=bS,p):(n.enter("characterReferenceValue"),g=7,f=Eh,p(u))}function p(u){if(u===59&&d){const b=n.exit("characterReferenceValue");return f===nn&&!Gh(l.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 _g={partial:!0,tokenize:IS},vg={concrete:!0,name:"codeFenced",tokenize:zS};function zS(n,r,s){const l=this,d={partial:!0,tokenize:L};let g=0,f=0,o;return c;function c(D){return h(D)}function h(D){const T=l.events[l.events.length-1];return g=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,o=D,n.enter("codeFenced"),n.enter("codeFencedFence"),n.enter("codeFencedFenceSequence"),p(D)}function p(D){return D===o?(f++,n.consume(D),p):f<3?s(D):(n.exit("codeFencedFenceSequence"),Ke(D)?Qe(n,u,"whitespace")(D):u(D))}function u(D){return D===null||Le(D)?(n.exit("codeFencedFence"),l.interrupt?r(D):n.check(_g,E,A)(D)):(n.enter("codeFencedFenceInfo"),n.enter("chunkString",{contentType:"string"}),b(D))}function b(D){return D===null||Le(D)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),u(D)):Ke(D)?(n.exit("chunkString"),n.exit("codeFencedFenceInfo"),Qe(n,w,"whitespace")(D)):D===96&&D===o?s(D):(n.consume(D),b)}function w(D){return D===null||Le(D)?u(D):(n.enter("codeFencedFenceMeta"),n.enter("chunkString",{contentType:"string"}),R(D))}function R(D){return D===null||Le(D)?(n.exit("chunkString"),n.exit("codeFencedFenceMeta"),u(D)):D===96&&D===o?s(D):(n.consume(D),R)}function E(D){return n.attempt(d,A,v)(D)}function v(D){return n.enter("lineEnding"),n.consume(D),n.exit("lineEnding"),y}function y(D){return g>0&&Ke(D)?Qe(n,_,"linePrefix",g+1)(D):_(D)}function _(D){return D===null||Le(D)?n.check(_g,E,A)(D):(n.enter("codeFlowValue"),S(D))}function S(D){return D===null||Le(D)?(n.exit("codeFlowValue"),_(D)):(n.consume(D),S)}function A(D){return n.exit("codeFenced"),r(D)}function L(D,T,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"),Ke(X)?Qe(D,U,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(X):U(X)}function U(X){return X===o?(D.enter("codeFencedFenceSequence"),P(X)):k(X)}function P(X){return X===o?(M++,D.consume(X),P):M>=f?(D.exit("codeFencedFenceSequence"),Ke(X)?Qe(D,Y,"whitespace")(X):Y(X)):k(X)}function Y(X){return X===null||Le(X)?(D.exit("codeFencedFence"),T(X)):k(X)}}}function IS(n,r,s){const l=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 l.parser.lazy[l.now().line]?s(f):r(f)}}const Zu={name:"codeIndented",tokenize:PS},US={partial:!0,tokenize:FS};function PS(n,r,s){const l=this;return d;function d(h){return n.enter("codeIndented"),Qe(n,g,"linePrefix",5)(h)}function g(h){const p=l.events[l.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):Le(h)?n.attempt(US,f,c)(h):(n.enter("codeFlowValue"),o(h))}function o(h){return h===null||Le(h)?(n.exit("codeFlowValue"),f(h)):(n.consume(h),o)}function c(h){return n.exit("codeIndented"),r(h)}}function FS(n,r,s){const l=this;return d;function d(f){return l.parser.lazy[l.now().line]?s(f):Le(f)?(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),d):Qe(n,g,"linePrefix",5)(f)}function g(f){const o=l.events[l.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?r(f):Le(f)?d(f):s(f)}}const qS={name:"codeText",previous:GS,resolve:$S,tokenize:VS};function $S(n){let r=n.length-4,s=3,l,d;if((n[s][1].type==="lineEnding"||n[s][1].type==="space")&&(n[r][1].type==="lineEnding"||n[r][1].type==="space")){for(l=s;++l<r;)if(n[l][1].type==="codeTextData"){n[s][1].type="codeTextPadding",n[r][1].type="codeTextPadding",s+=2,r-=2;break}}for(l=s-1,r++;++l<=r;)d===void 0?l!==r&&n[l][1].type!=="lineEnding"&&(d=l):(l===r||n[l][1].type==="lineEnding")&&(n[d][1].type="codeTextData",l!==d+2&&(n[d][1].end=n[l-1][1].end,n.splice(d+2,l-d-2),r-=l-d-2,l=d+2),d=void 0);return n}function GS(n){return n!==96||this.events[this.events.length-1][1].type==="characterEscape"}function VS(n,r,s){let l=0,d,g;return f;function f(u){return n.enter("codeText"),n.enter("codeTextSequence"),o(u)}function o(u){return u===96?(n.consume(u),l++,o):(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)):Le(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||Le(u)?(n.exit("codeTextData"),c(u)):(n.consume(u),h)}function p(u){return u===96?(n.consume(u),d++,p):d===l?(n.exit("codeTextSequence"),n.exit("codeText"),r(u)):(g.type="codeTextData",h(u))}}class KS{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 l=s??Number.POSITIVE_INFINITY;return l<this.left.length?this.left.slice(r,l):r>this.left.length?this.right.slice(this.right.length-l+this.left.length,this.right.length-r+this.left.length).reverse():this.left.slice(r).concat(this.right.slice(this.right.length-l+this.left.length).reverse())}splice(r,s,l){const d=s||0;this.setCursor(Math.trunc(r));const g=this.right.splice(this.right.length-d,Number.POSITIVE_INFINITY);return l&&Ga(this.left,l),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),Ga(this.left,r)}unshift(r){this.setCursor(0),this.right.push(r)}unshiftMany(r){this.setCursor(0),Ga(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);Ga(this.right,s.reverse())}else{const s=this.right.splice(this.left.length+this.right.length-r,Number.POSITIVE_INFINITY);Ga(this.left,s.reverse())}}}function Ga(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 O_(n){const r={};let s=-1,l,d,g,f,o,c,h;const p=new KS(n);for(;++s<p.length;){for(;s in r;)s=r[s];if(l=p.get(s),s&&l[1].type==="chunkFlow"&&p.get(s-1)[1].type==="listItemPrefix"&&(c=l[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(l[0]==="enter")l[1].contentType&&(Object.assign(r,WS(p,s)),s=r[s],h=!0);else if(l[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&&(l[1].end={...p.get(d)[1].start},o=p.slice(d,s),o.unshift(l),p.splice(d,s-d+1,o))}}return Hn(n,0,Number.POSITIVE_INFINITY,p.slice(0)),!h}function WS(n,r){const s=n.get(r)[1],l=n.get(r)[2];let d=r-1;const g=[];let f=s._tokenizer;f||(f=l.parser[s.contentType](s.start),s._contentTypeTextTrailing&&(f._contentTypeTextTrailing=!0));const o=f.events,c=[],h={};let p,u,b=-1,w=s,R=0,E=0;const v=[E];for(;w;){for(;n.get(++d)[1]!==w;);g.push(d),w._tokenizer||(p=l.sliceStream(w),w.next||p.push(null),u&&f.defineSkip(w.start),w._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=!0),f.write(p),w._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=void 0)),u=w,w=w.next}for(w=s;++b<o.length;)o[b][0]==="exit"&&o[b-1][0]==="enter"&&o[b][1].type===o[b-1][1].type&&o[b][1].start.line!==o[b][1].end.line&&(E=b+1,v.push(E),w._tokenizer=void 0,w.previous=void 0,w=w.next);for(f.events=[],w?(w._tokenizer=void 0,w.previous=void 0):v.pop(),b=v.length;b--;){const y=o.slice(v[b],v[b+1]),_=g.pop();c.push([_,_+y.length-1]),n.splice(_,2,y)}for(c.reverse(),b=-1;++b<c.length;)h[R+c[b][0]]=R+c[b][1],R+=c[b][1]-c[b][0]-1;return h}const YS={resolve:QS,tokenize:JS},XS={partial:!0,tokenize:ZS};function QS(n){return O_(n),n}function JS(n,r){let s;return l;function l(o){return n.enter("content"),s=n.enter("chunkContent",{contentType:"content"}),d(o)}function d(o){return o===null?g(o):Le(o)?n.check(XS,f,g)(o):(n.consume(o),d)}function g(o){return n.exit("chunkContent"),n.exit("content"),r(o)}function f(o){return n.consume(o),n.exit("chunkContent"),s.next=n.enter("chunkContent",{contentType:"content",previous:s}),s=s.next,d}}function ZS(n,r,s){const l=this;return d;function d(f){return n.exit("chunkContent"),n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),Qe(n,g,"linePrefix")}function g(f){if(f===null||Le(f))return s(f);const o=l.events[l.events.length-1];return!l.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?r(f):n.interrupt(l.parser.constructs.flow,s,r)(f)}}function B_(n,r,s,l,d,g,f,o,c){const h=c||Number.POSITIVE_INFINITY;let p=0;return u;function u(y){return y===60?(n.enter(l),n.enter(d),n.enter(g),n.consume(y),n.exit(g),b):y===null||y===32||y===41||Ro(y)?s(y):(n.enter(l),n.enter(f),n.enter(o),n.enter("chunkString",{contentType:"string"}),E(y))}function b(y){return y===62?(n.enter(g),n.consume(y),n.exit(g),n.exit(d),n.exit(l),r):(n.enter(o),n.enter("chunkString",{contentType:"string"}),w(y))}function w(y){return y===62?(n.exit("chunkString"),n.exit(o),b(y)):y===null||y===60||Le(y)?s(y):(n.consume(y),y===92?R:w)}function R(y){return y===60||y===62||y===92?(n.consume(y),w):w(y)}function E(y){return!p&&(y===null||y===41||ft(y))?(n.exit("chunkString"),n.exit(o),n.exit(f),n.exit(l),r(y)):p<h&&y===40?(n.consume(y),p++,E):y===41?(n.consume(y),p--,E):y===null||y===32||y===40||Ro(y)?s(y):(n.consume(y),y===92?v:E)}function v(y){return y===40||y===41||y===92?(n.consume(y),E):E(y)}}function j_(n,r,s,l,d,g){const f=this;let o=0,c;return h;function h(w){return n.enter(l),n.enter(d),n.consume(w),n.exit(d),n.enter(g),p}function p(w){return o>999||w===null||w===91||w===93&&!c||w===94&&!o&&"_hiddenFootnoteSupport"in f.parser.constructs?s(w):w===93?(n.exit(g),n.enter(d),n.consume(w),n.exit(d),n.exit(l),r):Le(w)?(n.enter("lineEnding"),n.consume(w),n.exit("lineEnding"),p):(n.enter("chunkString",{contentType:"string"}),u(w))}function u(w){return w===null||w===91||w===93||Le(w)||o++>999?(n.exit("chunkString"),p(w)):(n.consume(w),c||(c=!Ke(w)),w===92?b:u)}function b(w){return w===91||w===92||w===93?(n.consume(w),o++,u):u(w)}}function N_(n,r,s,l,d,g){let f;return o;function o(b){return b===34||b===39||b===40?(n.enter(l),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(l),r):(n.enter(g),h(b))}function h(b){return b===f?(n.exit(g),c(f)):b===null?s(b):Le(b)?(n.enter("lineEnding"),n.consume(b),n.exit("lineEnding"),Qe(n,h,"linePrefix")):(n.enter("chunkString",{contentType:"string"}),p(b))}function p(b){return b===f||b===null||Le(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 Ya(n,r){let s;return l;function l(d){return Le(d)?(n.enter("lineEnding"),n.consume(d),n.exit("lineEnding"),s=!0,l):Ke(d)?Qe(n,l,s?"linePrefix":"lineSuffix")(d):r(d)}}const eb={name:"definition",tokenize:nb},tb={partial:!0,tokenize:ib};function nb(n,r,s){const l=this;let d;return g;function g(w){return n.enter("definition"),f(w)}function f(w){return j_.call(l,n,o,s,"definitionLabel","definitionLabelMarker","definitionLabelString")(w)}function o(w){return d=si(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)),w===58?(n.enter("definitionMarker"),n.consume(w),n.exit("definitionMarker"),c):s(w)}function c(w){return ft(w)?Ya(n,h)(w):h(w)}function h(w){return B_(n,p,s,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(w)}function p(w){return n.attempt(tb,u,u)(w)}function u(w){return Ke(w)?Qe(n,b,"whitespace")(w):b(w)}function b(w){return w===null||Le(w)?(n.exit("definition"),l.parser.defined.push(d),r(w)):s(w)}}function ib(n,r,s){return l;function l(o){return ft(o)?Ya(n,d)(o):s(o)}function d(o){return N_(n,g,s,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function g(o){return Ke(o)?Qe(n,f,"whitespace")(o):f(o)}function f(o){return o===null||Le(o)?r(o):s(o)}}const rb={name:"hardBreakEscape",tokenize:sb};function sb(n,r,s){return l;function l(g){return n.enter("hardBreakEscape"),n.consume(g),d}function d(g){return Le(g)?(n.exit("hardBreakEscape"),r(g)):s(g)}}const ab={name:"headingAtx",resolve:lb,tokenize:ob};function lb(n,r){let s=n.length-2,l=3,d,g;return n[l][1].type==="whitespace"&&(l+=2),s-2>l&&n[s][1].type==="whitespace"&&(s-=2),n[s][1].type==="atxHeadingSequence"&&(l===s-1||s-4>l&&n[s-2][1].type==="whitespace")&&(s-=l+1===s?2:4),s>l&&(d={type:"atxHeadingText",start:n[l][1].start,end:n[s][1].end},g={type:"chunkText",start:n[l][1].start,end:n[s][1].end,contentType:"text"},Hn(n,l,s-l+1,[["enter",d,r],["enter",g,r],["exit",g,r],["exit",d,r]])),n}function ob(n,r,s){let l=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&&l++<6?(n.consume(p),f):p===null||ft(p)?(n.exit("atxHeadingSequence"),o(p)):s(p)}function o(p){return p===35?(n.enter("atxHeadingSequence"),c(p)):p===null||Le(p)?(n.exit("atxHeading"),r(p)):Ke(p)?Qe(n,o,"whitespace")(p):(n.enter("atxHeadingText"),h(p))}function c(p){return p===35?(n.consume(p),c):(n.exit("atxHeadingSequence"),o(p))}function h(p){return p===null||p===35||ft(p)?(n.exit("atxHeadingText"),o(p)):(n.consume(p),h)}}const cb=["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"],yg=["pre","script","style","textarea"],ub={concrete:!0,name:"htmlFlow",resolveTo:db,tokenize:pb},hb={partial:!0,tokenize:gb},fb={partial:!0,tokenize:mb};function db(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 pb(n,r,s){const l=this;let d,g,f,o,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,l.interrupt?r:j):fn(I)?(n.consume(I),f=String.fromCharCode(I),v):s(I)}function b(I){return I===45?(n.consume(I),d=2,w):I===91?(n.consume(I),d=5,o=0,R):fn(I)?(n.consume(I),d=4,l.interrupt?r:j):s(I)}function w(I){return I===45?(n.consume(I),l.interrupt?r:j):s(I)}function R(I){const se="CDATA[";return I===se.charCodeAt(o++)?(n.consume(I),o===se.length?l.interrupt?r:U:R):s(I)}function E(I){return fn(I)?(n.consume(I),f=String.fromCharCode(I),v):s(I)}function v(I){if(I===null||I===47||I===62||ft(I)){const se=I===47,ae=f.toLowerCase();return!se&&!g&&yg.includes(ae)?(d=1,l.interrupt?r(I):U(I)):cb.includes(f.toLowerCase())?(d=6,se?(n.consume(I),y):l.interrupt?r(I):U(I)):(d=7,l.interrupt&&!l.parser.lazy[l.now().line]?s(I):g?_(I):S(I))}return I===45||nn(I)?(n.consume(I),f+=String.fromCharCode(I),v):s(I)}function y(I){return I===62?(n.consume(I),l.interrupt?r:U):s(I)}function _(I){return Ke(I)?(n.consume(I),_):B(I)}function S(I){return I===47?(n.consume(I),B):I===58||I===95||fn(I)?(n.consume(I),A):Ke(I)?(n.consume(I),S):B(I)}function A(I){return I===45||I===46||I===58||I===95||nn(I)?(n.consume(I),A):L(I)}function L(I){return I===61?(n.consume(I),D):Ke(I)?(n.consume(I),L):S(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,T):Ke(I)?(n.consume(I),D):k(I)}function T(I){return I===c?(n.consume(I),c=null,M):I===null||Le(I)?s(I):(n.consume(I),T)}function k(I){return I===null||I===34||I===39||I===47||I===60||I===61||I===62||I===96||ft(I)?L(I):(n.consume(I),k)}function M(I){return I===47||I===62||Ke(I)?S(I):s(I)}function B(I){return I===62?(n.consume(I),H):s(I)}function H(I){return I===null||Le(I)?U(I):Ke(I)?(n.consume(I),H):s(I)}function U(I){return I===45&&d===2?(n.consume(I),V):I===60&&d===1?(n.consume(I),K):I===62&&d===4?(n.consume(I),N):I===63&&d===3?(n.consume(I),j):I===93&&d===5?(n.consume(I),z):Le(I)&&(d===6||d===7)?(n.exit("htmlFlowData"),n.check(hb,$,P)(I)):I===null||Le(I)?(n.exit("htmlFlowData"),P(I)):(n.consume(I),U)}function P(I){return n.check(fb,Y,$)(I)}function Y(I){return n.enter("lineEnding"),n.consume(I),n.exit("lineEnding"),X}function X(I){return I===null||Le(I)?P(I):(n.enter("htmlFlowData"),U(I))}function V(I){return I===45?(n.consume(I),j):U(I)}function K(I){return I===47?(n.consume(I),f="",ne):U(I)}function ne(I){if(I===62){const se=f.toLowerCase();return yg.includes(se)?(n.consume(I),N):U(I)}return fn(I)&&f.length<8?(n.consume(I),f+=String.fromCharCode(I),ne):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||Le(I)?(n.exit("htmlFlowData"),$(I)):(n.consume(I),N)}function $(I){return n.exit("htmlFlow"),r(I)}}function mb(n,r,s){const l=this;return d;function d(f){return Le(f)?(n.enter("lineEnding"),n.consume(f),n.exit("lineEnding"),g):s(f)}function g(f){return l.parser.lazy[l.now().line]?s(f):r(f)}}function gb(n,r,s){return l;function l(d){return n.enter("lineEnding"),n.consume(d),n.exit("lineEnding"),n.attempt(il,r,s)}}const _b={name:"htmlText",tokenize:vb};function vb(n,r,s){const l=this;let d,g,f;return o;function o(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),S):fn(j)?(n.consume(j),k):s(j)}function h(j){return j===45?(n.consume(j),p):j===91?(n.consume(j),g=0,R):fn(j)?(n.consume(j),_):s(j)}function p(j){return j===45?(n.consume(j),w):s(j)}function u(j){return j===null?s(j):j===45?(n.consume(j),b):Le(j)?(f=u,K(j)):(n.consume(j),u)}function b(j){return j===45?(n.consume(j),w):u(j)}function w(j){return j===62?V(j):j===45?b(j):u(j)}function R(j){const N="CDATA[";return j===N.charCodeAt(g++)?(n.consume(j),g===N.length?E:R):s(j)}function E(j){return j===null?s(j):j===93?(n.consume(j),v):Le(j)?(f=E,K(j)):(n.consume(j),E)}function v(j){return j===93?(n.consume(j),y):E(j)}function y(j){return j===62?V(j):j===93?(n.consume(j),y):E(j)}function _(j){return j===null||j===62?V(j):Le(j)?(f=_,K(j)):(n.consume(j),_)}function S(j){return j===null?s(j):j===63?(n.consume(j),A):Le(j)?(f=S,K(j)):(n.consume(j),S)}function A(j){return j===62?V(j):S(j)}function L(j){return fn(j)?(n.consume(j),D):s(j)}function D(j){return j===45||nn(j)?(n.consume(j),D):T(j)}function T(j){return Le(j)?(f=T,K(j)):Ke(j)?(n.consume(j),T):V(j)}function k(j){return j===45||nn(j)?(n.consume(j),k):j===47||j===62||ft(j)?M(j):s(j)}function M(j){return j===47?(n.consume(j),V):j===58||j===95||fn(j)?(n.consume(j),B):Le(j)?(f=M,K(j)):Ke(j)?(n.consume(j),M):V(j)}function B(j){return j===45||j===46||j===58||j===95||nn(j)?(n.consume(j),B):H(j)}function H(j){return j===61?(n.consume(j),U):Le(j)?(f=H,K(j)):Ke(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):Le(j)?(f=U,K(j)):Ke(j)?(n.consume(j),U):(n.consume(j),Y)}function P(j){return j===d?(n.consume(j),d=void 0,X):j===null?s(j):Le(j)?(f=P,K(j)):(n.consume(j),P)}function Y(j){return j===null||j===34||j===39||j===60||j===61||j===96?s(j):j===47||j===62||ft(j)?M(j):(n.consume(j),Y)}function X(j){return j===47||j===62||ft(j)?M(j):s(j)}function V(j){return j===62?(n.consume(j),n.exit("htmlTextData"),n.exit("htmlText"),r):s(j)}function K(j){return n.exit("htmlTextData"),n.enter("lineEnding"),n.consume(j),n.exit("lineEnding"),ne}function ne(j){return Ke(j)?Qe(n,z,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):z(j)}function z(j){return n.enter("htmlTextData"),f(j)}}const Vh={name:"labelEnd",resolveAll:Cb,resolveTo:wb,tokenize:xb},yb={tokenize:Eb},Sb={tokenize:kb},bb={tokenize:Ab};function Cb(n){let r=-1;const s=[];for(;++r<n.length;){const l=n[r][1];if(s.push(n[r]),l.type==="labelImage"||l.type==="labelLink"||l.type==="labelEnd"){const d=l.type==="labelImage"?4:2;l.type="data",r+=d}}return n.length!==s.length&&Hn(n,0,n.length,s),n}function wb(n,r){let s=n.length,l=0,d,g,f,o;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")){l=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+l+2][1].end},end:{...n[f-2][1].start}};return o=[["enter",c,r],["enter",h,r]],o=Wn(o,n.slice(g+1,g+l+3)),o=Wn(o,[["enter",p,r]]),o=Wn(o,zo(r.parser.constructs.insideSpan.null,n.slice(g+l+4,f-3),r)),o=Wn(o,[["exit",p,r],n[f-2],n[f-1],["exit",h,r]]),o=Wn(o,n.slice(f+1)),o=Wn(o,[["exit",c,r]]),Hn(n,g,n.length,o),n}function xb(n,r,s){const l=this;let d=l.events.length,g,f;for(;d--;)if((l.events[d][1].type==="labelImage"||l.events[d][1].type==="labelLink")&&!l.events[d][1]._balanced){g=l.events[d][1];break}return o;function o(b){return g?g._inactive?u(b):(f=l.parser.defined.includes(si(l.sliceSerialize({start:g.end,end:l.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(yb,p,f?p:u)(b):b===91?n.attempt(Sb,p,f?h:u)(b):f?p(b):u(b)}function h(b){return n.attempt(bb,p,u)(b)}function p(b){return r(b)}function u(b){return g._balanced=!0,s(b)}}function Eb(n,r,s){return l;function l(u){return n.enter("resource"),n.enter("resourceMarker"),n.consume(u),n.exit("resourceMarker"),d}function d(u){return ft(u)?Ya(n,g)(u):g(u)}function g(u){return u===41?p(u):B_(n,f,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(u)}function f(u){return ft(u)?Ya(n,c)(u):p(u)}function o(u){return s(u)}function c(u){return u===34||u===39||u===40?N_(n,h,s,"resourceTitle","resourceTitleMarker","resourceTitleString")(u):p(u)}function h(u){return ft(u)?Ya(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 kb(n,r,s){const l=this;return d;function d(o){return j_.call(l,n,g,f,"reference","referenceMarker","referenceString")(o)}function g(o){return l.parser.defined.includes(si(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)))?r(o):s(o)}function f(o){return s(o)}}function Ab(n,r,s){return l;function l(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 Rb={name:"labelStartImage",resolveAll:Vh.resolveAll,tokenize:Tb};function Tb(n,r,s){const l=this;return d;function d(o){return n.enter("labelImage"),n.enter("labelImageMarker"),n.consume(o),n.exit("labelImageMarker"),g}function g(o){return o===91?(n.enter("labelMarker"),n.consume(o),n.exit("labelMarker"),n.exit("labelImage"),f):s(o)}function f(o){return o===94&&"_hiddenFootnoteSupport"in l.parser.constructs?s(o):r(o)}}const Db={name:"labelStartLink",resolveAll:Vh.resolveAll,tokenize:Mb};function Mb(n,r,s){const l=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 l.parser.constructs?s(f):r(f)}}const eh={name:"lineEnding",tokenize:Lb};function Lb(n,r){return s;function s(l){return n.enter("lineEnding"),n.consume(l),n.exit("lineEnding"),Qe(n,r,"linePrefix")}}const Eo={name:"thematicBreak",tokenize:Ob};function Ob(n,r,s){let l=0,d;return g;function g(h){return n.enter("thematicBreak"),f(h)}function f(h){return d=h,o(h)}function o(h){return h===d?(n.enter("thematicBreakSequence"),c(h)):l>=3&&(h===null||Le(h))?(n.exit("thematicBreak"),r(h)):s(h)}function c(h){return h===d?(n.consume(h),l++,c):(n.exit("thematicBreakSequence"),Ke(h)?Qe(n,o,"whitespace")(h):o(h))}}const wn={continuation:{tokenize:Hb},exit:Ib,name:"list",tokenize:Nb},Bb={partial:!0,tokenize:Ub},jb={partial:!0,tokenize:zb};function Nb(n,r,s){const l=this,d=l.events[l.events.length-1];let g=d&&d[1].type==="linePrefix"?d[2].sliceSerialize(d[1],!0).length:0,f=0;return o;function o(w){const R=l.containerState.type||(w===42||w===43||w===45?"listUnordered":"listOrdered");if(R==="listUnordered"?!l.containerState.marker||w===l.containerState.marker:Eh(w)){if(l.containerState.type||(l.containerState.type=R,n.enter(R,{_container:!0})),R==="listUnordered")return n.enter("listItemPrefix"),w===42||w===45?n.check(Eo,s,h)(w):h(w);if(!l.interrupt||w===49)return n.enter("listItemPrefix"),n.enter("listItemValue"),c(w)}return s(w)}function c(w){return Eh(w)&&++f<10?(n.consume(w),c):(!l.interrupt||f<2)&&(l.containerState.marker?w===l.containerState.marker:w===41||w===46)?(n.exit("listItemValue"),h(w)):s(w)}function h(w){return n.enter("listItemMarker"),n.consume(w),n.exit("listItemMarker"),l.containerState.marker=l.containerState.marker||w,n.check(il,l.interrupt?s:p,n.attempt(Bb,b,u))}function p(w){return l.containerState.initialBlankLine=!0,g++,b(w)}function u(w){return Ke(w)?(n.enter("listItemPrefixWhitespace"),n.consume(w),n.exit("listItemPrefixWhitespace"),b):s(w)}function b(w){return l.containerState.size=g+l.sliceSerialize(n.exit("listItemPrefix"),!0).length,r(w)}}function Hb(n,r,s){const l=this;return l.containerState._closeFlow=void 0,n.check(il,d,g);function d(o){return l.containerState.furtherBlankLines=l.containerState.furtherBlankLines||l.containerState.initialBlankLine,Qe(n,r,"listItemIndent",l.containerState.size+1)(o)}function g(o){return l.containerState.furtherBlankLines||!Ke(o)?(l.containerState.furtherBlankLines=void 0,l.containerState.initialBlankLine=void 0,f(o)):(l.containerState.furtherBlankLines=void 0,l.containerState.initialBlankLine=void 0,n.attempt(jb,r,f)(o))}function f(o){return l.containerState._closeFlow=!0,l.interrupt=void 0,Qe(n,n.attempt(wn,r,s),"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function zb(n,r,s){const l=this;return Qe(n,d,"listItemIndent",l.containerState.size+1);function d(g){const f=l.events[l.events.length-1];return f&&f[1].type==="listItemIndent"&&f[2].sliceSerialize(f[1],!0).length===l.containerState.size?r(g):s(g)}}function Ib(n){n.exit(this.containerState.type)}function Ub(n,r,s){const l=this;return Qe(n,d,"listItemPrefixWhitespace",l.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function d(g){const f=l.events[l.events.length-1];return!Ke(g)&&f&&f[1].type==="listItemPrefixWhitespace"?r(g):s(g)}}const Sg={name:"setextUnderline",resolveTo:Pb,tokenize:Fb};function Pb(n,r){let s=n.length,l,d,g;for(;s--;)if(n[s][0]==="enter"){if(n[s][1].type==="content"){l=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[l][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[l][1],r]),n[l][1].end={...n[g][1].end}):n[l][1]=f,n.push(["exit",f,r]),n}function Fb(n,r,s){const l=this;let d;return g;function g(h){let p=l.events.length,u;for(;p--;)if(l.events[p][1].type!=="lineEnding"&&l.events[p][1].type!=="linePrefix"&&l.events[p][1].type!=="content"){u=l.events[p][1].type==="paragraph";break}return!l.parser.lazy[l.now().line]&&(l.interrupt||u)?(n.enter("setextHeadingLine"),d=h,f(h)):s(h)}function f(h){return n.enter("setextHeadingLineSequence"),o(h)}function o(h){return h===d?(n.consume(h),o):(n.exit("setextHeadingLineSequence"),Ke(h)?Qe(n,c,"lineSuffix")(h):c(h))}function c(h){return h===null||Le(h)?(n.exit("setextHeadingLine"),r(h)):s(h)}}const qb={tokenize:$b};function $b(n){const r=this,s=n.attempt(il,l,n.attempt(this.parser.constructs.flowInitial,d,Qe(n,n.attempt(this.parser.constructs.flow,d,n.attempt(YS,d)),"linePrefix")));return s;function l(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 Gb={resolveAll:z_()},Vb=H_("string"),Kb=H_("text");function H_(n){return{resolveAll:z_(n==="text"?Wb:void 0),tokenize:r};function r(s){const l=this,d=this.parser.constructs[n],g=s.attempt(d,f,o);return f;function f(p){return h(p)?g(p):o(p)}function o(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 w=u[b];if(!w.previous||w.previous.call(l,l.previous))return!0}return!1}}}function z_(n){return r;function r(s,l){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,l):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 l=n[s-1][1],d=r.sliceStream(l);let g=d.length,f=-1,o=0,c;for(;g--;){const h=d[g];if(typeof h=="string"){for(f=h.length;h.charCodeAt(f-1)===32;)o++,f--;if(f)break;f=-1}else if(h===-2)c=!0,o++;else if(h!==-1){g++;break}}if(r._contentTypeTextTrailing&&s===n.length&&(o=0),o){const h={type:s===n.length||c||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:g?f:l.start._bufferIndex+f,_index:l.start._index+g,line:l.end.line,column:l.end.column-o,offset:l.end.offset-o},end:{...l.end}};l.end={...h.start},l.start.offset===l.end.offset?Object.assign(l,h):(n.splice(s,0,["enter",h,r],["exit",h,r]),s+=2)}s++}return n}const Yb={42:wn,43:wn,45:wn,48:wn,49:wn,50:wn,51:wn,52:wn,53:wn,54:wn,55:wn,56:wn,57:wn,62:D_},Xb={91:eb},Qb={[-2]:Zu,[-1]:Zu,32:Zu},Jb={35:ab,42:Eo,45:[Sg,Eo],60:ub,61:Sg,95:Eo,96:vg,126:vg},Zb={38:L_,92:M_},eC={[-5]:eh,[-4]:eh,[-3]:eh,33:Rb,38:L_,42:kh,60:[DS,_b],91:Db,92:[rb,M_],93:Vh,95:kh,96:qS},tC={null:[kh,Gb]},nC={null:[42,95]},iC={null:[]},rC=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:nC,contentInitial:Xb,disable:iC,document:Yb,flow:Jb,flowInitial:Qb,insideSpan:tC,string:Zb,text:eC},Symbol.toStringTag,{value:"Module"}));function sC(n,r,s){let l={_bufferIndex:-1,_index:0,line:s&&s.line||1,column:s&&s.column||1,offset:s&&s.offset||0};const d={},g=[];let f=[],o=[];const c={attempt:T(L),check:T(D),consume:_,enter:S,exit:A,interrupt:T(D,{interrupt:!0})},h={code:null,containerState:{},defineSkip:E,events:[],now:R,parser:n,previous:null,sliceSerialize:b,sliceStream:w,write:u};let p=r.tokenize.call(h,c);return r.resolveAll&&g.push(r),h;function u(H){return f=Wn(f,H),v(),f[f.length-1]!==null?[]:(k(r,0),h.events=zo(g,h.events,h),h.events)}function b(H,U){return lC(w(H),U)}function w(H){return aC(f,H)}function R(){const{_bufferIndex:H,_index:U,line:P,column:Y,offset:X}=l;return{_bufferIndex:H,_index:U,line:P,column:Y,offset:X}}function E(H){d[H.line]=H.column,B()}function v(){let H;for(;l._index<f.length;){const U=f[l._index];if(typeof U=="string")for(H=l._index,l._bufferIndex<0&&(l._bufferIndex=0);l._index===H&&l._bufferIndex<U.length;)y(U.charCodeAt(l._bufferIndex));else y(U)}}function y(H){p=p(H)}function _(H){Le(H)?(l.line++,l.column=1,l.offset+=H===-3?2:1,B()):H!==-1&&(l.column++,l.offset++),l._bufferIndex<0?l._index++:(l._bufferIndex++,l._bufferIndex===f[l._index].length&&(l._bufferIndex=-1,l._index++)),h.previous=H}function S(H,U){const P=U||{};return P.type=H,P.start=R(),h.events.push(["enter",P,h]),o.push(P),P}function A(H){const U=o.pop();return U.end=R(),h.events.push(["exit",U,h]),U}function L(H,U){k(H,U.from)}function D(H,U){U.restore()}function T(H,U){return P;function P(Y,X,V){let K,ne,z,j;return Array.isArray(Y)?$(Y):"tokenize"in Y?$([Y]):N(Y);function N(he){return W;function W(q){const ie=q!==null&&he[q],ee=q!==null&&he.null,le=[...Array.isArray(ie)?ie:ie?[ie]:[],...Array.isArray(ee)?ee:ee?[ee]:[]];return $(le)(q)}}function $(he){return K=he,ne=0,he.length===0?V:I(he[ne])}function I(he){return W;function W(q){return j=M(),z=he,he.partial||(h.currentConstruct=he),he.name&&h.parser.constructs.disable.null.includes(he.name)?ae():he.tokenize.call(U?Object.assign(Object.create(h),U):h,c,se,ae)(q)}}function se(he){return H(z,j),X}function ae(he){return j.restore(),++ne<K.length?I(K[ne]):V}}}function k(H,U){H.resolveAll&&!g.includes(H)&&g.push(H),H.resolve&&Hn(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=R(),U=h.previous,P=h.currentConstruct,Y=h.events.length,X=Array.from(o);return{from:Y,restore:V};function V(){l=H,h.previous=U,h.currentConstruct=P,h.events.length=Y,o=X,B()}}function B(){l.line in d&&l.column<2&&(l.column=d[l.line],l.offset+=d[l.line]-1)}}function aC(n,r){const s=r.start._index,l=r.start._bufferIndex,d=r.end._index,g=r.end._bufferIndex;let f;if(s===d)f=[n[s].slice(l,g)];else{if(f=n.slice(s,d),l>-1){const o=f[0];typeof o=="string"?f[0]=o.slice(l):f.shift()}g>0&&f.push(n[d].slice(0,g))}return f}function lC(n,r){let s=-1;const l=[];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
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(_)}d=_===-2,l.push(f)}return l.join("")}function oC(n){const l={constructs:R_([rC,...(n||{}).extensions||[]]),content:d(wS),defined:[],document:d(ES),flow:d(qb),lazy:{},string:d(Vb),text:d(Kb)};return l;function d(_){return f;function f(o){return sC(l,_,o)}}}function cC(n){for(;!O_(n););return n}const bg=/[\0\t\n\r]/g;function uC(){let n=1,r="",s=!0,l;return d;function d(_,f,o){const c=[];let h,p,u,v,w;for(_=r+(typeof _=="string"?_.toString():new TextDecoder(f||void 0).decode(_)),u=0,r="",s&&(_.charCodeAt(0)===65279&&u++,s=void 0);u<_.length;){if(bg.lastIndex=u,h=bg.exec(_),v=h&&h.index!==void 0?h.index:_.length,w=_.charCodeAt(v),!h){r=_.slice(u);break}if(w===10&&u===v&&l)c.push(-3),l=void 0;else switch(l&&(c.push(-5),l=void 0),u<v&&(c.push(_.slice(u,v)),n+=v-u),w){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:l=!0,n=1}u=v+1}return o&&(l&&c.push(-5),r&&c.push(r),c.push(null)),c}}const hC=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function fC(n){return n.replace(hC,dC)}function dC(n,r,s){if(r)return r;if(s.charCodeAt(0)===35){const d=s.charCodeAt(1),_=d===120||d===88;return T_(s.slice(_?2:1),_?16:10)}return Gh(s)||n}const I_={}.hasOwnProperty;function pC(n,r,s){return r&&typeof r=="object"&&(s=r,r=void 0),mC(s)(cC(oC(s).document().write(uC()(n,r,!0))))}function mC(n){const r={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:_(rn),autolinkProtocol:M,autolinkEmail:M,atxHeading:_(Be),blockQuote:_(ee),characterEscape:M,characterReference:M,codeFenced:_(le),codeFencedFenceInfo:f,codeFencedFenceMeta:f,codeIndented:_(le,f),codeText:_(ve,f),codeTextData:M,data:M,codeFlowValue:M,definition:_(De),definitionDestinationString:f,definitionLabelString:f,definitionTitleString:f,emphasis:_(Ne),hardBreakEscape:_(ct),hardBreakTrailing:_(ct),htmlFlow:_(ke,f),htmlFlowData:M,htmlText:_(ke,f),htmlTextData:M,image:_(Gt),label:f,link:_(rn),listItem:_(Kt),listItemValue:v,listOrdered:_(Vt,u),listUnordered:_(Vt),paragraph:_(xn),reference:I,referenceString:f,resourceDestinationString:f,resourceTitleString:f,setextHeading:_(Be),strong:_(xt),thematicBreak:_(Ot)},exit:{atxHeading:c(),atxHeadingSequence:L,autolink:c(),autolinkEmail:ie,autolinkProtocol:q,blockQuote:c(),characterEscapeValue:B,characterReferenceMarkerHexadecimal:ae,characterReferenceMarkerNumeric:ae,characterReferenceValue:he,characterReference:W,codeFenced:c(y),codeFencedFence:E,codeFencedFenceInfo:w,codeFencedFenceMeta:R,codeFlowValue:B,codeIndented:c(S),codeText:c(X),codeTextData:B,data:B,definition:c(),definitionDestinationString:A,definitionLabelString:g,definitionTitleString:b,emphasis:c(),hardBreakEscape:c(U),hardBreakTrailing:c(U),htmlFlow:c(P),htmlFlowData:B,htmlText:c(Y),htmlTextData:B,image:c(K),label:z,labelText:ne,lineEnding:H,link:c(V),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:se,resourceDestinationString:j,resourceTitleString:N,resource:$,setextHeading:c(k),setextHeadingLineSequence:T,setextHeadingText:D,strong:c(),thematicBreak:c()}};U_(r,(n||{}).mdastExtensions||[]);const s={};return l;function l(pe){let Se={type:"root",children:[]};const Ae={stack:[Se],tokenStack:[],config:r,enter:o,exit:h,buffer:f,resume:p,data:s},je=[];let He=-1;for(;++He<pe.length;)if(pe[He][1].type==="listOrdered"||pe[He][1].type==="listUnordered")if(pe[He][0]==="enter")je.push(He);else{const mt=je.pop();He=d(pe,mt,He)}for(He=-1;++He<pe.length;){const mt=r[pe[He][0]];I_.call(mt,pe[He][1].type)&&mt[pe[He][1].type].call(Object.assign({sliceSerialize:pe[He][2].sliceSerialize},Ae),pe[He][1])}if(Ae.tokenStack.length>0){const mt=Ae.tokenStack[Ae.tokenStack.length-1];(mt[1]||Cg).call(Ae,void 0,mt[0])}for(Se.position={start:br(pe.length>0?pe[0][1].start:{line:1,column:1,offset:0}),end:br(pe.length>0?pe[pe.length-2][1].end:{line:1,column:1,offset:0})},He=-1;++He<r.transforms.length;)Se=r.transforms[He](Se)||Se;return Se}function d(pe,Se,Ae){let je=Se-1,He=-1,mt=!1,qe,bt,yt,Bt;for(;++je<=Ae;){const tt=pe[je];switch(tt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{tt[0]==="enter"?He++:He--,Bt=void 0;break}case"lineEndingBlank":{tt[0]==="enter"&&(qe&&!Bt&&!He&&!yt&&(yt=je),Bt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Bt=void 0}if(!He&&tt[0]==="enter"&&tt[1].type==="listItemPrefix"||He===-1&&tt[0]==="exit"&&(tt[1].type==="listUnordered"||tt[1].type==="listOrdered")){if(qe){let sn=je;for(bt=void 0;sn--;){const we=pe[sn];if(we[1].type==="lineEnding"||we[1].type==="lineEndingBlank"){if(we[0]==="exit")continue;bt&&(pe[bt][1].type="lineEndingBlank",mt=!0),we[1].type="lineEnding",bt=sn}else if(!(we[1].type==="linePrefix"||we[1].type==="blockQuotePrefix"||we[1].type==="blockQuotePrefixWhitespace"||we[1].type==="blockQuoteMarker"||we[1].type==="listItemIndent"))break}yt&&(!bt||yt<bt)&&(qe._spread=!0),qe.end=Object.assign({},bt?pe[bt][1].start:tt[1].end),pe.splice(bt||je,0,["exit",qe,tt[2]]),je++,Ae++}if(tt[1].type==="listItemPrefix"){const sn={type:"listItem",_spread:!1,start:Object.assign({},tt[1].start),end:void 0};qe=sn,pe.splice(je,0,["enter",sn,tt[2]]),je++,Ae++,yt=void 0,Bt=!0}}}return pe[Se][1]._spread=mt,Ae}function _(pe,Se){return Ae;function Ae(je){o.call(this,pe(je),je),Se&&Se.call(this,je)}}function f(){this.stack.push({type:"fragment",children:[]})}function o(pe,Se,Ae){this.stack[this.stack.length-1].children.push(pe),this.stack.push(pe),this.tokenStack.push([Se,Ae||void 0]),pe.position={start:br(Se.start),end:void 0}}function c(pe){return Se;function Se(Ae){pe&&pe.call(this,Ae),h.call(this,Ae)}}function h(pe,Se){const Ae=this.stack.pop(),je=this.tokenStack.pop();if(je)je[0].type!==pe.type&&(Se?Se.call(this,pe,je[0]):(je[1]||Cg).call(this,pe,je[0]));else throw new Error("Cannot close `"+pe.type+"` ("+Wa({start:pe.start,end:pe.end})+"): it’s not open");Ae.position.end=br(pe.end)}function p(){return $h(this.stack.pop())}function u(){this.data.expectingFirstListItemValue=!0}function v(pe){if(this.data.expectingFirstListItemValue){const Se=this.stack[this.stack.length-2];Se.start=Number.parseInt(this.sliceSerialize(pe),10),this.data.expectingFirstListItemValue=void 0}}function w(){const pe=this.resume(),Se=this.stack[this.stack.length-1];Se.lang=pe}function R(){const pe=this.resume(),Se=this.stack[this.stack.length-1];Se.meta=pe}function E(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const pe=this.resume(),Se=this.stack[this.stack.length-1];Se.value=pe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const pe=this.resume(),Se=this.stack[this.stack.length-1];Se.value=pe.replace(/(\r?\n|\r)$/g,"")}function g(pe){const Se=this.resume(),Ae=this.stack[this.stack.length-1];Ae.label=Se,Ae.identifier=si(this.sliceSerialize(pe)).toLowerCase()}function b(){const pe=this.resume(),Se=this.stack[this.stack.length-1];Se.title=pe}function A(){const pe=this.resume(),Se=this.stack[this.stack.length-1];Se.url=pe}function L(pe){const Se=this.stack[this.stack.length-1];if(!Se.depth){const Ae=this.sliceSerialize(pe).length;Se.depth=Ae}}function D(){this.data.setextHeadingSlurpLineEnding=!0}function T(pe){const Se=this.stack[this.stack.length-1];Se.depth=this.sliceSerialize(pe).codePointAt(0)===61?1:2}function k(){this.data.setextHeadingSlurpLineEnding=void 0}function M(pe){const Ae=this.stack[this.stack.length-1].children;let je=Ae[Ae.length-1];(!je||je.type!=="text")&&(je=it(),je.position={start:br(pe.start),end:void 0},Ae.push(je)),this.stack.push(je)}function B(pe){const Se=this.stack.pop();Se.value+=this.sliceSerialize(pe),Se.position.end=br(pe.end)}function H(pe){const Se=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ae=Se.children[Se.children.length-1];Ae.position.end=br(pe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&r.canContainEols.includes(Se.type)&&(M.call(this,pe),B.call(this,pe))}function U(){this.data.atHardBreak=!0}function P(){const pe=this.resume(),Se=this.stack[this.stack.length-1];Se.value=pe}function Y(){const pe=this.resume(),Se=this.stack[this.stack.length-1];Se.value=pe}function X(){const pe=this.resume(),Se=this.stack[this.stack.length-1];Se.value=pe}function V(){const pe=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";pe.type+="Reference",pe.referenceType=Se,delete pe.url,delete pe.title}else delete pe.identifier,delete pe.label;this.data.referenceType=void 0}function K(){const pe=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";pe.type+="Reference",pe.referenceType=Se,delete pe.url,delete pe.title}else delete pe.identifier,delete pe.label;this.data.referenceType=void 0}function ne(pe){const Se=this.sliceSerialize(pe),Ae=this.stack[this.stack.length-2];Ae.label=fC(Se),Ae.identifier=si(Se).toLowerCase()}function z(){const pe=this.stack[this.stack.length-1],Se=this.resume(),Ae=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ae.type==="link"){const je=pe.children;Ae.children=je}else Ae.alt=Se}function j(){const pe=this.resume(),Se=this.stack[this.stack.length-1];Se.url=pe}function N(){const pe=this.resume(),Se=this.stack[this.stack.length-1];Se.title=pe}function $(){this.data.inReference=void 0}function I(){this.data.referenceType="collapsed"}function se(pe){const Se=this.resume(),Ae=this.stack[this.stack.length-1];Ae.label=Se,Ae.identifier=si(this.sliceSerialize(pe)).toLowerCase(),this.data.referenceType="full"}function ae(pe){this.data.characterReferenceType=pe.type}function he(pe){const Se=this.sliceSerialize(pe),Ae=this.data.characterReferenceType;let je;Ae?(je=T_(Se,Ae==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):je=Gh(Se);const He=this.stack[this.stack.length-1];He.value+=je}function W(pe){const Se=this.stack.pop();Se.position.end=br(pe.end)}function q(pe){B.call(this,pe);const Se=this.stack[this.stack.length-1];Se.url=this.sliceSerialize(pe)}function ie(pe){B.call(this,pe);const Se=this.stack[this.stack.length-1];Se.url="mailto:"+this.sliceSerialize(pe)}function ee(){return{type:"blockquote",children:[]}}function le(){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 Ne(){return{type:"emphasis",children:[]}}function Be(){return{type:"heading",depth:0,children:[]}}function ct(){return{type:"break"}}function ke(){return{type:"html",value:""}}function Gt(){return{type:"image",title:null,url:"",alt:null}}function rn(){return{type:"link",title:null,url:"",children:[]}}function Vt(pe){return{type:"list",ordered:pe.type==="listOrdered",start:null,spread:pe._spread,children:[]}}function Kt(pe){return{type:"listItem",spread:pe._spread,checked:null,children:[]}}function xn(){return{type:"paragraph",children:[]}}function xt(){return{type:"strong",children:[]}}function it(){return{type:"text",value:""}}function Ot(){return{type:"thematicBreak"}}}function br(n){return{line:n.line,column:n.column,offset:n.offset}}function U_(n,r){let s=-1;for(;++s<r.length;){const l=r[s];Array.isArray(l)?U_(n,l):gC(n,l)}}function gC(n,r){let s;for(s in r)if(I_.call(r,s))switch(s){case"canContainEols":{const l=r[s];l&&n[s].push(...l);break}case"transforms":{const l=r[s];l&&n[s].push(...l);break}case"enter":case"exit":{const l=r[s];l&&Object.assign(n[s],l);break}}}function Cg(n,r){throw n?new Error("Cannot close `"+n.type+"` ("+Wa({start:n.start,end:n.end})+"): a different token (`"+r.type+"`, "+Wa({start:r.start,end:r.end})+") is open"):new Error("Cannot close document, a token (`"+r.type+"`, "+Wa({start:r.start,end:r.end})+") is still open")}function _C(n){const r=this;r.parser=s;function s(l){return pC(l,{...r.data("settings"),...n,extensions:r.data("micromarkExtensions")||[],mdastExtensions:r.data("fromMarkdownExtensions")||[]})}}function vC(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 yC(n,r){const s={type:"element",tagName:"br",properties:{},children:[]};return n.patch(r,s),[n.applyData(r,s),{type:"text",value:`
65
+ `;break}case-2:{f=r?" ":" ";break}case-1:{if(!r&&d)continue;f=" ";break}default:f=String.fromCharCode(g)}d=g===-2,l.push(f)}return l.join("")}function oC(n){const l={constructs:R_([rC,...(n||{}).extensions||[]]),content:d(wS),defined:[],document:d(ES),flow:d(qb),lazy:{},string:d(Vb),text:d(Kb)};return l;function d(g){return f;function f(o){return sC(l,g,o)}}}function cC(n){for(;!O_(n););return n}const bg=/[\0\t\n\r]/g;function uC(){let n=1,r="",s=!0,l;return d;function d(g,f,o){const c=[];let h,p,u,b,w;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(bg.lastIndex=u,h=bg.exec(g),b=h&&h.index!==void 0?h.index:g.length,w=g.charCodeAt(b),!h){r=g.slice(u);break}if(w===10&&u===b&&l)c.push(-3),l=void 0;else switch(l&&(c.push(-5),l=void 0),u<b&&(c.push(g.slice(u,b)),n+=b-u),w){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:l=!0,n=1}u=b+1}return o&&(l&&c.push(-5),r&&c.push(r),c.push(null)),c}}const hC=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function fC(n){return n.replace(hC,dC)}function dC(n,r,s){if(r)return r;if(s.charCodeAt(0)===35){const d=s.charCodeAt(1),g=d===120||d===88;return T_(s.slice(g?2:1),g?16:10)}return Gh(s)||n}const I_={}.hasOwnProperty;function pC(n,r,s){return r&&typeof r=="object"&&(s=r,r=void 0),mC(s)(cC(oC(s).document().write(uC()(n,r,!0))))}function mC(n){const r={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:g(sn),autolinkProtocol:M,autolinkEmail:M,atxHeading:g(je),blockQuote:g(ee),characterEscape:M,characterReference:M,codeFenced:g(le),codeFencedFenceInfo:f,codeFencedFenceMeta:f,codeIndented:g(le,f),codeText:g(ve,f),codeTextData:M,data:M,codeFlowValue:M,definition:g(De),definitionDestinationString:f,definitionLabelString:f,definitionTitleString:f,emphasis:g(Ne),hardBreakEscape:g(ct),hardBreakTrailing:g(ct),htmlFlow:g(Ee,f),htmlFlowData:M,htmlText:g(Ee,f),htmlTextData:M,image:g(Yt),label:f,link:g(sn),listItem:g(dn),listItemValue:b,listOrdered:g(Nt,u),listUnordered:g(Nt),paragraph:g(En),reference:I,referenceString:f,resourceDestinationString:f,resourceTitleString:f,setextHeading:g(je),strong:g(wt),thematicBreak:g(Ot)},exit:{atxHeading:c(),atxHeadingSequence:L,autolink:c(),autolinkEmail:ie,autolinkProtocol:q,blockQuote:c(),characterEscapeValue:B,characterReferenceMarkerHexadecimal:ae,characterReferenceMarkerNumeric:ae,characterReferenceValue:he,characterReference:W,codeFenced:c(v),codeFencedFence:E,codeFencedFenceInfo:w,codeFencedFenceMeta:R,codeFlowValue:B,codeIndented:c(y),codeText:c(X),codeTextData:B,data:B,definition:c(),definitionDestinationString:A,definitionLabelString:_,definitionTitleString:S,emphasis:c(),hardBreakEscape:c(U),hardBreakTrailing:c(U),htmlFlow:c(P),htmlFlowData:B,htmlText:c(Y),htmlTextData:B,image:c(K),label:z,labelText:ne,lineEnding:H,link:c(V),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:se,resourceDestinationString:j,resourceTitleString:N,resource:$,setextHeading:c(k),setextHeadingLineSequence:T,setextHeadingText:D,strong:c(),thematicBreak:c()}};U_(r,(n||{}).mdastExtensions||[]);const s={};return l;function l(pe){let Se={type:"root",children:[]};const ke={stack:[Se],tokenStack:[],config:r,enter:o,exit:h,buffer:f,resume:p,data:s},Oe=[];let He=-1;for(;++He<pe.length;)if(pe[He][1].type==="listOrdered"||pe[He][1].type==="listUnordered")if(pe[He][0]==="enter")Oe.push(He);else{const _t=Oe.pop();He=d(pe,_t,He)}for(He=-1;++He<pe.length;){const _t=r[pe[He][0]];I_.call(_t,pe[He][1].type)&&_t[pe[He][1].type].call(Object.assign({sliceSerialize:pe[He][2].sliceSerialize},ke),pe[He][1])}if(ke.tokenStack.length>0){const _t=ke.tokenStack[ke.tokenStack.length-1];(_t[1]||Cg).call(ke,void 0,_t[0])}for(Se.position={start:yr(pe.length>0?pe[0][1].start:{line:1,column:1,offset:0}),end:yr(pe.length>0?pe[pe.length-2][1].end:{line:1,column:1,offset:0})},He=-1;++He<r.transforms.length;)Se=r.transforms[He](Se)||Se;return Se}function d(pe,Se,ke){let Oe=Se-1,He=-1,_t=!1,qe,St,yt,Bt;for(;++Oe<=ke;){const Ze=pe[Oe];switch(Ze[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ze[0]==="enter"?He++:He--,Bt=void 0;break}case"lineEndingBlank":{Ze[0]==="enter"&&(qe&&!Bt&&!He&&!yt&&(yt=Oe),Bt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Bt=void 0}if(!He&&Ze[0]==="enter"&&Ze[1].type==="listItemPrefix"||He===-1&&Ze[0]==="exit"&&(Ze[1].type==="listUnordered"||Ze[1].type==="listOrdered")){if(qe){let an=Oe;for(St=void 0;an--;){const we=pe[an];if(we[1].type==="lineEnding"||we[1].type==="lineEndingBlank"){if(we[0]==="exit")continue;St&&(pe[St][1].type="lineEndingBlank",_t=!0),we[1].type="lineEnding",St=an}else if(!(we[1].type==="linePrefix"||we[1].type==="blockQuotePrefix"||we[1].type==="blockQuotePrefixWhitespace"||we[1].type==="blockQuoteMarker"||we[1].type==="listItemIndent"))break}yt&&(!St||yt<St)&&(qe._spread=!0),qe.end=Object.assign({},St?pe[St][1].start:Ze[1].end),pe.splice(St||Oe,0,["exit",qe,Ze[2]]),Oe++,ke++}if(Ze[1].type==="listItemPrefix"){const an={type:"listItem",_spread:!1,start:Object.assign({},Ze[1].start),end:void 0};qe=an,pe.splice(Oe,0,["enter",an,Ze[2]]),Oe++,ke++,yt=void 0,Bt=!0}}}return pe[Se][1]._spread=_t,ke}function g(pe,Se){return ke;function ke(Oe){o.call(this,pe(Oe),Oe),Se&&Se.call(this,Oe)}}function f(){this.stack.push({type:"fragment",children:[]})}function o(pe,Se,ke){this.stack[this.stack.length-1].children.push(pe),this.stack.push(pe),this.tokenStack.push([Se,ke||void 0]),pe.position={start:yr(Se.start),end:void 0}}function c(pe){return Se;function Se(ke){pe&&pe.call(this,ke),h.call(this,ke)}}function h(pe,Se){const ke=this.stack.pop(),Oe=this.tokenStack.pop();if(Oe)Oe[0].type!==pe.type&&(Se?Se.call(this,pe,Oe[0]):(Oe[1]||Cg).call(this,pe,Oe[0]));else throw new Error("Cannot close `"+pe.type+"` ("+Wa({start:pe.start,end:pe.end})+"): it’s not open");ke.position.end=yr(pe.end)}function p(){return $h(this.stack.pop())}function u(){this.data.expectingFirstListItemValue=!0}function b(pe){if(this.data.expectingFirstListItemValue){const Se=this.stack[this.stack.length-2];Se.start=Number.parseInt(this.sliceSerialize(pe),10),this.data.expectingFirstListItemValue=void 0}}function w(){const pe=this.resume(),Se=this.stack[this.stack.length-1];Se.lang=pe}function R(){const pe=this.resume(),Se=this.stack[this.stack.length-1];Se.meta=pe}function E(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){const pe=this.resume(),Se=this.stack[this.stack.length-1];Se.value=pe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const pe=this.resume(),Se=this.stack[this.stack.length-1];Se.value=pe.replace(/(\r?\n|\r)$/g,"")}function _(pe){const Se=this.resume(),ke=this.stack[this.stack.length-1];ke.label=Se,ke.identifier=si(this.sliceSerialize(pe)).toLowerCase()}function S(){const pe=this.resume(),Se=this.stack[this.stack.length-1];Se.title=pe}function A(){const pe=this.resume(),Se=this.stack[this.stack.length-1];Se.url=pe}function L(pe){const Se=this.stack[this.stack.length-1];if(!Se.depth){const ke=this.sliceSerialize(pe).length;Se.depth=ke}}function D(){this.data.setextHeadingSlurpLineEnding=!0}function T(pe){const Se=this.stack[this.stack.length-1];Se.depth=this.sliceSerialize(pe).codePointAt(0)===61?1:2}function k(){this.data.setextHeadingSlurpLineEnding=void 0}function M(pe){const ke=this.stack[this.stack.length-1].children;let Oe=ke[ke.length-1];(!Oe||Oe.type!=="text")&&(Oe=it(),Oe.position={start:yr(pe.start),end:void 0},ke.push(Oe)),this.stack.push(Oe)}function B(pe){const Se=this.stack.pop();Se.value+=this.sliceSerialize(pe),Se.position.end=yr(pe.end)}function H(pe){const Se=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ke=Se.children[Se.children.length-1];ke.position.end=yr(pe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&r.canContainEols.includes(Se.type)&&(M.call(this,pe),B.call(this,pe))}function U(){this.data.atHardBreak=!0}function P(){const pe=this.resume(),Se=this.stack[this.stack.length-1];Se.value=pe}function Y(){const pe=this.resume(),Se=this.stack[this.stack.length-1];Se.value=pe}function X(){const pe=this.resume(),Se=this.stack[this.stack.length-1];Se.value=pe}function V(){const pe=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";pe.type+="Reference",pe.referenceType=Se,delete pe.url,delete pe.title}else delete pe.identifier,delete pe.label;this.data.referenceType=void 0}function K(){const pe=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";pe.type+="Reference",pe.referenceType=Se,delete pe.url,delete pe.title}else delete pe.identifier,delete pe.label;this.data.referenceType=void 0}function ne(pe){const Se=this.sliceSerialize(pe),ke=this.stack[this.stack.length-2];ke.label=fC(Se),ke.identifier=si(Se).toLowerCase()}function z(){const pe=this.stack[this.stack.length-1],Se=this.resume(),ke=this.stack[this.stack.length-1];if(this.data.inReference=!0,ke.type==="link"){const Oe=pe.children;ke.children=Oe}else ke.alt=Se}function j(){const pe=this.resume(),Se=this.stack[this.stack.length-1];Se.url=pe}function N(){const pe=this.resume(),Se=this.stack[this.stack.length-1];Se.title=pe}function $(){this.data.inReference=void 0}function I(){this.data.referenceType="collapsed"}function se(pe){const Se=this.resume(),ke=this.stack[this.stack.length-1];ke.label=Se,ke.identifier=si(this.sliceSerialize(pe)).toLowerCase(),this.data.referenceType="full"}function ae(pe){this.data.characterReferenceType=pe.type}function he(pe){const Se=this.sliceSerialize(pe),ke=this.data.characterReferenceType;let Oe;ke?(Oe=T_(Se,ke==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Oe=Gh(Se);const He=this.stack[this.stack.length-1];He.value+=Oe}function W(pe){const Se=this.stack.pop();Se.position.end=yr(pe.end)}function q(pe){B.call(this,pe);const Se=this.stack[this.stack.length-1];Se.url=this.sliceSerialize(pe)}function ie(pe){B.call(this,pe);const Se=this.stack[this.stack.length-1];Se.url="mailto:"+this.sliceSerialize(pe)}function ee(){return{type:"blockquote",children:[]}}function le(){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 Ne(){return{type:"emphasis",children:[]}}function je(){return{type:"heading",depth:0,children:[]}}function ct(){return{type:"break"}}function Ee(){return{type:"html",value:""}}function Yt(){return{type:"image",title:null,url:"",alt:null}}function sn(){return{type:"link",title:null,url:"",children:[]}}function Nt(pe){return{type:"list",ordered:pe.type==="listOrdered",start:null,spread:pe._spread,children:[]}}function dn(pe){return{type:"listItem",spread:pe._spread,checked:null,children:[]}}function En(){return{type:"paragraph",children:[]}}function wt(){return{type:"strong",children:[]}}function it(){return{type:"text",value:""}}function Ot(){return{type:"thematicBreak"}}}function yr(n){return{line:n.line,column:n.column,offset:n.offset}}function U_(n,r){let s=-1;for(;++s<r.length;){const l=r[s];Array.isArray(l)?U_(n,l):gC(n,l)}}function gC(n,r){let s;for(s in r)if(I_.call(r,s))switch(s){case"canContainEols":{const l=r[s];l&&n[s].push(...l);break}case"transforms":{const l=r[s];l&&n[s].push(...l);break}case"enter":case"exit":{const l=r[s];l&&Object.assign(n[s],l);break}}}function Cg(n,r){throw n?new Error("Cannot close `"+n.type+"` ("+Wa({start:n.start,end:n.end})+"): a different token (`"+r.type+"`, "+Wa({start:r.start,end:r.end})+") is open"):new Error("Cannot close document, a token (`"+r.type+"`, "+Wa({start:r.start,end:r.end})+") is still open")}function _C(n){const r=this;r.parser=s;function s(l){return pC(l,{...r.data("settings"),...n,extensions:r.data("micromarkExtensions")||[],mdastExtensions:r.data("fromMarkdownExtensions")||[]})}}function vC(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 yC(n,r){const s={type:"element",tagName:"br",properties:{},children:[]};return n.patch(r,s),[n.applyData(r,s),{type:"text",value:`
66
66
  `}]}function SC(n,r){const s=r.value?r.value+`
67
- `:"",l={},d=r.lang?r.lang.split(/\s+/):[];d.length>0&&(l.className=["language-"+d[0]]);let _={type:"element",tagName:"code",properties:l,children:[{type:"text",value:s}]};return r.meta&&(_.data={meta:r.meta}),n.patch(r,_),_=n.applyData(r,_),_={type:"element",tagName:"pre",properties:{},children:[_]},n.patch(r,_),_}function bC(n,r){const s={type:"element",tagName:"del",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}function CC(n,r){const s={type:"element",tagName:"em",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}function wC(n,r){const s=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",l=String(r.identifier).toUpperCase(),d=Vs(l.toLowerCase()),_=n.footnoteOrder.indexOf(l);let f,o=n.footnoteCounts.get(l);o===void 0?(o=0,n.footnoteOrder.push(l),f=n.footnoteOrder.length):f=_+1,o+=1,n.footnoteCounts.set(l,o);const c={type:"element",tagName:"a",properties:{href:"#"+s+"fn-"+d,id:s+"fnref-"+d+(o>1?"-"+o:""),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 xC(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 EC(n,r){if(n.options.allowDangerousHtml){const s={type:"raw",value:r.value};return n.patch(r,s),n.applyData(r,s)}}function P_(n,r){const s=r.referenceType;let l="]";if(s==="collapsed"?l+="[]":s==="full"&&(l+="["+(r.label||r.identifier)+"]"),r.type==="imageReference")return[{type:"text",value:"!["+r.alt+l}];const d=n.all(r),_=d[0];_&&_.type==="text"?_.value="["+_.value:d.unshift({type:"text",value:"["});const f=d[d.length-1];return f&&f.type==="text"?f.value+=l:d.push({type:"text",value:l}),d}function kC(n,r){const s=String(r.identifier).toUpperCase(),l=n.definitionById.get(s);if(!l)return P_(n,r);const d={src:Vs(l.url||""),alt:r.alt};l.title!==null&&l.title!==void 0&&(d.title=l.title);const _={type:"element",tagName:"img",properties:d,children:[]};return n.patch(r,_),n.applyData(r,_)}function AC(n,r){const s={src:Vs(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 l={type:"element",tagName:"img",properties:s,children:[]};return n.patch(r,l),n.applyData(r,l)}function RC(n,r){const s={type:"text",value:r.value.replace(/\r?\n|\r/g," ")};n.patch(r,s);const l={type:"element",tagName:"code",properties:{},children:[s]};return n.patch(r,l),n.applyData(r,l)}function TC(n,r){const s=String(r.identifier).toUpperCase(),l=n.definitionById.get(s);if(!l)return P_(n,r);const d={href:Vs(l.url||"")};l.title!==null&&l.title!==void 0&&(d.title=l.title);const _={type:"element",tagName:"a",properties:d,children:n.all(r)};return n.patch(r,_),n.applyData(r,_)}function DC(n,r){const s={href:Vs(r.url)};r.title!==null&&r.title!==void 0&&(s.title=r.title);const l={type:"element",tagName:"a",properties:s,children:n.all(r)};return n.patch(r,l),n.applyData(r,l)}function MC(n,r,s){const l=n.all(r),d=s?LC(s):F_(r),_={},f=[];if(typeof r.checked=="boolean"){const p=l[0];let u;p&&p.type==="element"&&p.tagName==="p"?u=p:(u={type:"element",tagName:"p",properties:{},children:[]},l.unshift(u)),u.children.length>0&&u.children.unshift({type:"text",value:" "}),u.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:r.checked,disabled:!0},children:[]}),_.className=["task-list-item"]}let o=-1;for(;++o<l.length;){const p=l[o];(d||o!==0||p.type!=="element"||p.tagName!=="p")&&f.push({type:"text",value:`
67
+ `:"",l={},d=r.lang?r.lang.split(/\s+/):[];d.length>0&&(l.className=["language-"+d[0]]);let g={type:"element",tagName:"code",properties:l,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 bC(n,r){const s={type:"element",tagName:"del",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}function CC(n,r){const s={type:"element",tagName:"em",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}function wC(n,r){const s=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",l=String(r.identifier).toUpperCase(),d=Vs(l.toLowerCase()),g=n.footnoteOrder.indexOf(l);let f,o=n.footnoteCounts.get(l);o===void 0?(o=0,n.footnoteOrder.push(l),f=n.footnoteOrder.length):f=g+1,o+=1,n.footnoteCounts.set(l,o);const c={type:"element",tagName:"a",properties:{href:"#"+s+"fn-"+d,id:s+"fnref-"+d+(o>1?"-"+o:""),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 xC(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 EC(n,r){if(n.options.allowDangerousHtml){const s={type:"raw",value:r.value};return n.patch(r,s),n.applyData(r,s)}}function P_(n,r){const s=r.referenceType;let l="]";if(s==="collapsed"?l+="[]":s==="full"&&(l+="["+(r.label||r.identifier)+"]"),r.type==="imageReference")return[{type:"text",value:"!["+r.alt+l}];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+=l:d.push({type:"text",value:l}),d}function kC(n,r){const s=String(r.identifier).toUpperCase(),l=n.definitionById.get(s);if(!l)return P_(n,r);const d={src:Vs(l.url||""),alt:r.alt};l.title!==null&&l.title!==void 0&&(d.title=l.title);const g={type:"element",tagName:"img",properties:d,children:[]};return n.patch(r,g),n.applyData(r,g)}function AC(n,r){const s={src:Vs(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 l={type:"element",tagName:"img",properties:s,children:[]};return n.patch(r,l),n.applyData(r,l)}function RC(n,r){const s={type:"text",value:r.value.replace(/\r?\n|\r/g," ")};n.patch(r,s);const l={type:"element",tagName:"code",properties:{},children:[s]};return n.patch(r,l),n.applyData(r,l)}function TC(n,r){const s=String(r.identifier).toUpperCase(),l=n.definitionById.get(s);if(!l)return P_(n,r);const d={href:Vs(l.url||"")};l.title!==null&&l.title!==void 0&&(d.title=l.title);const g={type:"element",tagName:"a",properties:d,children:n.all(r)};return n.patch(r,g),n.applyData(r,g)}function DC(n,r){const s={href:Vs(r.url)};r.title!==null&&r.title!==void 0&&(s.title=r.title);const l={type:"element",tagName:"a",properties:s,children:n.all(r)};return n.patch(r,l),n.applyData(r,l)}function MC(n,r,s){const l=n.all(r),d=s?LC(s):F_(r),g={},f=[];if(typeof r.checked=="boolean"){const p=l[0];let u;p&&p.type==="element"&&p.tagName==="p"?u=p:(u={type:"element",tagName:"p",properties:{},children:[]},l.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 o=-1;for(;++o<l.length;){const p=l[o];(d||o!==0||p.type!=="element"||p.tagName!=="p")&&f.push({type:"text",value:`
68
68
  `}),p.type==="element"&&p.tagName==="p"&&!d?f.push(...p.children):f.push(p)}const c=l[l.length-1];c&&(d||c.type!=="element"||c.tagName!=="p")&&f.push({type:"text",value:`
69
- `});const h={type:"element",tagName:"li",properties:_,children:f};return n.patch(r,h),n.applyData(r,h)}function LC(n){let r=!1;if(n.type==="list"){r=n.spread||!1;const s=n.children;let l=-1;for(;!r&&++l<s.length;)r=F_(s[l])}return r}function F_(n){const r=n.spread;return r??n.children.length>1}function OC(n,r){const s={},l=n.all(r);let d=-1;for(typeof r.start=="number"&&r.start!==1&&(s.start=r.start);++d<l.length;){const f=l[d];if(f.type==="element"&&f.tagName==="li"&&f.properties&&Array.isArray(f.properties.className)&&f.properties.className.includes("task-list-item")){s.className=["contains-task-list"];break}}const _={type:"element",tagName:r.ordered?"ol":"ul",properties:s,children:n.wrap(l,!0)};return n.patch(r,_),n.applyData(r,_)}function BC(n,r){const s={type:"element",tagName:"p",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}function jC(n,r){const s={type:"root",children:n.wrap(n.all(r))};return n.patch(r,s),n.applyData(r,s)}function NC(n,r){const s={type:"element",tagName:"strong",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}function HC(n,r){const s=n.all(r),l=s.shift(),d=[];if(l){const f={type:"element",tagName:"thead",properties:{},children:n.wrap([l],!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)},o=Uh(r.children[1]),c=b_(r.children[r.children.length-1]);o&&c&&(f.position={start:o,end:c}),d.push(f)}const _={type:"element",tagName:"table",properties:{},children:n.wrap(d,!0)};return n.patch(r,_),n.applyData(r,_)}function zC(n,r,s){const l=s?s.children:void 0,_=(l?l.indexOf(r):1)===0?"th":"td",f=s&&s.type==="table"?s.align:void 0,o=f?f.length:r.children.length;let c=-1;const h=[];for(;++c<o;){const u=r.children[c],v={},w=f?f[c]:void 0;w&&(v.align=w);let R={type:"element",tagName:_,properties:v,children:[]};u&&(R.children=n.all(u),n.patch(u,R),R=n.applyData(u,R)),h.push(R)}const p={type:"element",tagName:"tr",properties:{},children:n.wrap(h,!0)};return n.patch(r,p),n.applyData(r,p)}function IC(n,r){const s={type:"element",tagName:"td",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}const wg=9,xg=32;function UC(n){const r=String(n),s=/\r?\n|\r/g;let l=s.exec(r),d=0;const _=[];for(;l;)_.push(Eg(r.slice(d,l.index),d>0,!0),l[0]),d=l.index+l[0].length,l=s.exec(r);return _.push(Eg(r.slice(d),d>0,!1)),_.join("")}function Eg(n,r,s){let l=0,d=n.length;if(r){let _=n.codePointAt(l);for(;_===wg||_===xg;)l++,_=n.codePointAt(l)}if(s){let _=n.codePointAt(d-1);for(;_===wg||_===xg;)d--,_=n.codePointAt(d-1)}return d>l?n.slice(l,d):""}function PC(n,r){const s={type:"text",value:UC(String(r.value))};return n.patch(r,s),n.applyData(r,s)}function FC(n,r){const s={type:"element",tagName:"hr",properties:{},children:[]};return n.patch(r,s),n.applyData(r,s)}const qC={blockquote:vC,break:yC,code:SC,delete:bC,emphasis:CC,footnoteReference:wC,heading:xC,html:EC,imageReference:kC,image:AC,inlineCode:RC,linkReference:TC,link:DC,listItem:MC,list:OC,paragraph:BC,root:jC,strong:NC,table:HC,tableCell:IC,tableRow:zC,text:PC,thematicBreak:FC,toml:So,yaml:So,definition:So,footnoteDefinition:So};function So(){}const q_=-1,Uo=0,Xa=1,Do=2,Kh=3,Wh=4,Yh=5,Xh=6,$_=7,G_=8,$C=typeof self=="object"?self:globalThis,kg=(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 $C[n](r)},GC=(n,r)=>{const s=(d,_)=>(n.set(_,d),d),l=d=>{if(n.has(d))return n.get(d);const[_,f]=r[d];switch(_){case Uo:case q_:return s(f,d);case Xa:{const o=s([],d);for(const c of f)o.push(l(c));return o}case Do:{const o=s({},d);for(const[c,h]of f)o[l(c)]=l(h);return o}case Kh:return s(new Date(f),d);case Wh:{const{source:o,flags:c}=f;return s(new RegExp(o,c),d)}case Yh:{const o=s(new Map,d);for(const[c,h]of f)o.set(l(c),l(h));return o}case Xh:{const o=s(new Set,d);for(const c of f)o.add(l(c));return o}case $_:{const{name:o,message:c}=f;return s(kg(o,c),d)}case G_: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:o}=new Uint8Array(f);return s(new DataView(o),f)}}return s(kg(_,f),d)};return l},Ag=n=>GC(new Map,n)(0),zs="",{toString:VC}={},{keys:KC}=Object,Va=n=>{const r=typeof n;if(r!=="object"||!n)return[Uo,r];const s=VC.call(n).slice(8,-1);switch(s){case"Array":return[Xa,zs];case"Object":return[Do,zs];case"Date":return[Kh,zs];case"RegExp":return[Wh,zs];case"Map":return[Yh,zs];case"Set":return[Xh,zs];case"DataView":return[Xa,s]}return s.includes("Array")?[Xa,s]:s.includes("Error")?[$_,s]:[Do,s]},bo=([n,r])=>n===Uo&&(r==="function"||r==="symbol"),WC=(n,r,s,l)=>{const d=(f,o)=>{const c=l.push(f)-1;return s.set(o,c),c},_=f=>{if(s.has(f))return s.get(f);let[o,c]=Va(f);switch(o){case Uo:{let p=f;switch(c){case"bigint":o=G_,p=f.toString();break;case"function":case"symbol":if(n)throw new TypeError("unable to serialize "+c);p=null;break;case"undefined":return d([q_],f)}return d([o,p],f)}case Xa:{if(c){let v=f;return c==="DataView"?v=new Uint8Array(f.buffer):c==="ArrayBuffer"&&(v=new Uint8Array(f)),d([c,[...v]],f)}const p=[],u=d([o,p],f);for(const v of f)p.push(_(v));return u}case Do:{if(c)switch(c){case"BigInt":return d([c,f.toString()],f);case"Boolean":case"Number":case"String":return d([c,f.valueOf()],f)}if(r&&"toJSON"in f)return _(f.toJSON());const p=[],u=d([o,p],f);for(const v of KC(f))(n||!bo(Va(f[v])))&&p.push([_(v),_(f[v])]);return u}case Kh:return d([o,f.toISOString()],f);case Wh:{const{source:p,flags:u}=f;return d([o,{source:p,flags:u}],f)}case Yh:{const p=[],u=d([o,p],f);for(const[v,w]of f)(n||!(bo(Va(v))||bo(Va(w))))&&p.push([_(v),_(w)]);return u}case Xh:{const p=[],u=d([o,p],f);for(const v of f)(n||!bo(Va(v)))&&p.push(_(v));return u}}const{message:h}=f;return d([o,{name:c,message:h}],f)};return _},Rg=(n,{json:r,lossy:s}={})=>{const l=[];return WC(!(r||s),!!r,new Map,l)(n),l},Mo=typeof structuredClone=="function"?(n,r)=>r&&("json"in r||"lossy"in r)?Ag(Rg(n,r)):structuredClone(n):(n,r)=>Ag(Rg(n,r));function YC(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 XC(n,r){return"Back to reference "+(n+1)+(r>1?"-"+r:"")}function QC(n){const r=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",s=n.options.footnoteBackContent||YC,l=n.options.footnoteBackLabel||XC,d=n.options.footnoteLabel||"Footnotes",_=n.options.footnoteLabelTagName||"h2",f=n.options.footnoteLabelProperties||{className:["sr-only"]},o=[];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(),v=Vs(u.toLowerCase());let w=0;const R=[],E=n.footnoteCounts.get(u);for(;E!==void 0&&++w<=E;){R.length>0&&R.push({type:"text",value:" "});let g=typeof s=="string"?s:s(c,w);typeof g=="string"&&(g={type:"text",value:g}),R.push({type:"element",tagName:"a",properties:{href:"#"+r+"fnref-"+v+(w>1?"-"+w:""),dataFootnoteBackref:"",ariaLabel:typeof l=="string"?l:l(c,w),className:["data-footnote-backref"]},children:Array.isArray(g)?g:[g]})}const y=p[p.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const g=y.children[y.children.length-1];g&&g.type==="text"?g.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...R)}else p.push(...R);const S={type:"element",tagName:"li",properties:{id:r+"fn-"+v},children:n.wrap(p,!0)};n.patch(h,S),o.push(S)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:_,properties:{...Mo(f),id:"footnote-label"},children:[{type:"text",value:d}]},{type:"text",value:`
69
+ `});const h={type:"element",tagName:"li",properties:g,children:f};return n.patch(r,h),n.applyData(r,h)}function LC(n){let r=!1;if(n.type==="list"){r=n.spread||!1;const s=n.children;let l=-1;for(;!r&&++l<s.length;)r=F_(s[l])}return r}function F_(n){const r=n.spread;return r??n.children.length>1}function OC(n,r){const s={},l=n.all(r);let d=-1;for(typeof r.start=="number"&&r.start!==1&&(s.start=r.start);++d<l.length;){const f=l[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(l,!0)};return n.patch(r,g),n.applyData(r,g)}function BC(n,r){const s={type:"element",tagName:"p",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}function jC(n,r){const s={type:"root",children:n.wrap(n.all(r))};return n.patch(r,s),n.applyData(r,s)}function NC(n,r){const s={type:"element",tagName:"strong",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}function HC(n,r){const s=n.all(r),l=s.shift(),d=[];if(l){const f={type:"element",tagName:"thead",properties:{},children:n.wrap([l],!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)},o=Uh(r.children[1]),c=b_(r.children[r.children.length-1]);o&&c&&(f.position={start:o,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 zC(n,r,s){const l=s?s.children:void 0,g=(l?l.indexOf(r):1)===0?"th":"td",f=s&&s.type==="table"?s.align:void 0,o=f?f.length:r.children.length;let c=-1;const h=[];for(;++c<o;){const u=r.children[c],b={},w=f?f[c]:void 0;w&&(b.align=w);let R={type:"element",tagName:g,properties:b,children:[]};u&&(R.children=n.all(u),n.patch(u,R),R=n.applyData(u,R)),h.push(R)}const p={type:"element",tagName:"tr",properties:{},children:n.wrap(h,!0)};return n.patch(r,p),n.applyData(r,p)}function IC(n,r){const s={type:"element",tagName:"td",properties:{},children:n.all(r)};return n.patch(r,s),n.applyData(r,s)}const wg=9,xg=32;function UC(n){const r=String(n),s=/\r?\n|\r/g;let l=s.exec(r),d=0;const g=[];for(;l;)g.push(Eg(r.slice(d,l.index),d>0,!0),l[0]),d=l.index+l[0].length,l=s.exec(r);return g.push(Eg(r.slice(d),d>0,!1)),g.join("")}function Eg(n,r,s){let l=0,d=n.length;if(r){let g=n.codePointAt(l);for(;g===wg||g===xg;)l++,g=n.codePointAt(l)}if(s){let g=n.codePointAt(d-1);for(;g===wg||g===xg;)d--,g=n.codePointAt(d-1)}return d>l?n.slice(l,d):""}function PC(n,r){const s={type:"text",value:UC(String(r.value))};return n.patch(r,s),n.applyData(r,s)}function FC(n,r){const s={type:"element",tagName:"hr",properties:{},children:[]};return n.patch(r,s),n.applyData(r,s)}const qC={blockquote:vC,break:yC,code:SC,delete:bC,emphasis:CC,footnoteReference:wC,heading:xC,html:EC,imageReference:kC,image:AC,inlineCode:RC,linkReference:TC,link:DC,listItem:MC,list:OC,paragraph:BC,root:jC,strong:NC,table:HC,tableCell:IC,tableRow:zC,text:PC,thematicBreak:FC,toml:yo,yaml:yo,definition:yo,footnoteDefinition:yo};function yo(){}const q_=-1,Io=0,Xa=1,To=2,Kh=3,Wh=4,Yh=5,Xh=6,$_=7,G_=8,$C=typeof self=="object"?self:globalThis,kg=(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 $C[n](r)},GC=(n,r)=>{const s=(d,g)=>(n.set(g,d),d),l=d=>{if(n.has(d))return n.get(d);const[g,f]=r[d];switch(g){case Io:case q_:return s(f,d);case Xa:{const o=s([],d);for(const c of f)o.push(l(c));return o}case To:{const o=s({},d);for(const[c,h]of f)o[l(c)]=l(h);return o}case Kh:return s(new Date(f),d);case Wh:{const{source:o,flags:c}=f;return s(new RegExp(o,c),d)}case Yh:{const o=s(new Map,d);for(const[c,h]of f)o.set(l(c),l(h));return o}case Xh:{const o=s(new Set,d);for(const c of f)o.add(l(c));return o}case $_:{const{name:o,message:c}=f;return s(kg(o,c),d)}case G_: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:o}=new Uint8Array(f);return s(new DataView(o),f)}}return s(kg(g,f),d)};return l},Ag=n=>GC(new Map,n)(0),zs="",{toString:VC}={},{keys:KC}=Object,Va=n=>{const r=typeof n;if(r!=="object"||!n)return[Io,r];const s=VC.call(n).slice(8,-1);switch(s){case"Array":return[Xa,zs];case"Object":return[To,zs];case"Date":return[Kh,zs];case"RegExp":return[Wh,zs];case"Map":return[Yh,zs];case"Set":return[Xh,zs];case"DataView":return[Xa,s]}return s.includes("Array")?[Xa,s]:s.includes("Error")?[$_,s]:[To,s]},So=([n,r])=>n===Io&&(r==="function"||r==="symbol"),WC=(n,r,s,l)=>{const d=(f,o)=>{const c=l.push(f)-1;return s.set(o,c),c},g=f=>{if(s.has(f))return s.get(f);let[o,c]=Va(f);switch(o){case Io:{let p=f;switch(c){case"bigint":o=G_,p=f.toString();break;case"function":case"symbol":if(n)throw new TypeError("unable to serialize "+c);p=null;break;case"undefined":return d([q_],f)}return d([o,p],f)}case Xa:{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([o,p],f);for(const b of f)p.push(g(b));return u}case To:{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([o,p],f);for(const b of KC(f))(n||!So(Va(f[b])))&&p.push([g(b),g(f[b])]);return u}case Kh:return d([o,f.toISOString()],f);case Wh:{const{source:p,flags:u}=f;return d([o,{source:p,flags:u}],f)}case Yh:{const p=[],u=d([o,p],f);for(const[b,w]of f)(n||!(So(Va(b))||So(Va(w))))&&p.push([g(b),g(w)]);return u}case Xh:{const p=[],u=d([o,p],f);for(const b of f)(n||!So(Va(b)))&&p.push(g(b));return u}}const{message:h}=f;return d([o,{name:c,message:h}],f)};return g},Rg=(n,{json:r,lossy:s}={})=>{const l=[];return WC(!(r||s),!!r,new Map,l)(n),l},Do=typeof structuredClone=="function"?(n,r)=>r&&("json"in r||"lossy"in r)?Ag(Rg(n,r)):structuredClone(n):(n,r)=>Ag(Rg(n,r));function YC(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 XC(n,r){return"Back to reference "+(n+1)+(r>1?"-"+r:"")}function QC(n){const r=typeof n.options.clobberPrefix=="string"?n.options.clobberPrefix:"user-content-",s=n.options.footnoteBackContent||YC,l=n.options.footnoteBackLabel||XC,d=n.options.footnoteLabel||"Footnotes",g=n.options.footnoteLabelTagName||"h2",f=n.options.footnoteLabelProperties||{className:["sr-only"]},o=[];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=Vs(u.toLowerCase());let w=0;const R=[],E=n.footnoteCounts.get(u);for(;E!==void 0&&++w<=E;){R.length>0&&R.push({type:"text",value:" "});let _=typeof s=="string"?s:s(c,w);typeof _=="string"&&(_={type:"text",value:_}),R.push({type:"element",tagName:"a",properties:{href:"#"+r+"fnref-"+b+(w>1?"-"+w:""),dataFootnoteBackref:"",ariaLabel:typeof l=="string"?l:l(c,w),className:["data-footnote-backref"]},children:Array.isArray(_)?_:[_]})}const v=p[p.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const _=v.children[v.children.length-1];_&&_.type==="text"?_.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...R)}else p.push(...R);const y={type:"element",tagName:"li",properties:{id:r+"fn-"+b},children:n.wrap(p,!0)};n.patch(h,y),o.push(y)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:g,properties:{...Do(f),id:"footnote-label"},children:[{type:"text",value:d}]},{type:"text",value:`
70
70
  `},{type:"element",tagName:"ol",properties:{},children:n.wrap(o,!0)},{type:"text",value:`
71
- `}]}}const Po=(function(n){if(n==null)return tw;if(typeof n=="function")return Fo(n);if(typeof n=="object")return Array.isArray(n)?JC(n):ZC(n);if(typeof n=="string")return ew(n);throw new Error("Expected function, string, or object as test")});function JC(n){const r=[];let s=-1;for(;++s<n.length;)r[s]=Po(n[s]);return Fo(l);function l(...d){let _=-1;for(;++_<r.length;)if(r[_].apply(this,d))return!0;return!1}}function ZC(n){const r=n;return Fo(s);function s(l){const d=l;let _;for(_ in n)if(d[_]!==r[_])return!1;return!0}}function ew(n){return Fo(r);function r(s){return s&&s.type===n}}function Fo(n){return r;function r(s,l,d){return!!(nw(s)&&n.call(this,s,typeof l=="number"?l:void 0,d||void 0))}}function tw(){return!0}function nw(n){return n!==null&&typeof n=="object"&&"type"in n}const V_=[],iw=!0,Rh=!1,rw="skip";function K_(n,r,s,l){let d;typeof r=="function"&&typeof s!="function"?(l=s,s=r):d=r;const _=Po(d),f=l?-1:1;o(n,void 0,[])();function o(c,h,p){const u=c&&typeof c=="object"?c:{};if(typeof u.type=="string"){const w=typeof u.tagName=="string"?u.tagName:typeof u.name=="string"?u.name:void 0;Object.defineProperty(v,"name",{value:"node ("+(c.type+(w?"<"+w+">":""))+")"})}return v;function v(){let w=V_,R,E,y;if((!r||_(c,h,p[p.length-1]||void 0))&&(w=sw(s(c,p)),w[0]===Rh))return w;if("children"in c&&c.children){const S=c;if(S.children&&w[0]!==rw)for(E=(l?S.children.length:-1)+f,y=p.concat(S);E>-1&&E<S.children.length;){const g=S.children[E];if(R=o(g,E,y)(),R[0]===Rh)return R;E=typeof R[1]=="number"?R[1]:E+f}}return w}}}function sw(n){return Array.isArray(n)?n:typeof n=="number"?[iw,n]:n==null?V_:[n]}function Qh(n,r,s,l){let d,_,f;typeof r=="function"&&typeof s!="function"?(_=void 0,f=r,d=s):(_=r,f=s,d=l),K_(n,_,o,d);function o(c,h){const p=h[h.length-1],u=p?p.children.indexOf(c):void 0;return f(c,u,p)}}const Th={}.hasOwnProperty,aw={};function lw(n,r){const s=r||aw,l=new Map,d=new Map,_=new Map,f={...qC,...s.handlers},o={all:h,applyData:cw,definitionById:l,footnoteById:d,footnoteCounts:_,footnoteOrder:[],handlers:f,one:c,options:s,patch:ow,wrap:hw};return Qh(n,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const u=p.type==="definition"?l:d,v=String(p.identifier).toUpperCase();u.has(v)||u.set(v,p)}}),o;function c(p,u){const v=p.type,w=o.handlers[v];if(Th.call(o.handlers,v)&&w)return w(o,p,u);if(o.options.passThrough&&o.options.passThrough.includes(v)){if("children"in p){const{children:E,...y}=p,S=Mo(y);return S.children=o.all(p),S}return Mo(p)}return(o.options.unknownHandler||uw)(o,p,u)}function h(p){const u=[];if("children"in p){const v=p.children;let w=-1;for(;++w<v.length;){const R=o.one(v[w],p);if(R){if(w&&v[w-1].type==="break"&&(!Array.isArray(R)&&R.type==="text"&&(R.value=Tg(R.value)),!Array.isArray(R)&&R.type==="element")){const E=R.children[0];E&&E.type==="text"&&(E.value=Tg(E.value))}Array.isArray(R)?u.push(...R):u.push(R)}}}return u}}function ow(n,r){n.position&&(r.position=Y1(n))}function cw(n,r){let s=r;if(n&&n.data){const l=n.data.hName,d=n.data.hChildren,_=n.data.hProperties;if(typeof l=="string")if(s.type==="element")s.tagName=l;else{const f="children"in s?s.children:[s];s={type:"element",tagName:l,properties:{},children:f}}s.type==="element"&&_&&Object.assign(s.properties,Mo(_)),"children"in s&&s.children&&d!==null&&d!==void 0&&(s.children=d)}return s}function uw(n,r){const s=r.data||{},l="value"in r&&!(Th.call(s,"hProperties")||Th.call(s,"hChildren"))?{type:"text",value:r.value}:{type:"element",tagName:"div",properties:{},children:n.all(r)};return n.patch(r,l),n.applyData(r,l)}function hw(n,r){const s=[];let l=-1;for(r&&s.push({type:"text",value:`
71
+ `}]}}const Uo=(function(n){if(n==null)return tw;if(typeof n=="function")return Po(n);if(typeof n=="object")return Array.isArray(n)?JC(n):ZC(n);if(typeof n=="string")return ew(n);throw new Error("Expected function, string, or object as test")});function JC(n){const r=[];let s=-1;for(;++s<n.length;)r[s]=Uo(n[s]);return Po(l);function l(...d){let g=-1;for(;++g<r.length;)if(r[g].apply(this,d))return!0;return!1}}function ZC(n){const r=n;return Po(s);function s(l){const d=l;let g;for(g in n)if(d[g]!==r[g])return!1;return!0}}function ew(n){return Po(r);function r(s){return s&&s.type===n}}function Po(n){return r;function r(s,l,d){return!!(nw(s)&&n.call(this,s,typeof l=="number"?l:void 0,d||void 0))}}function tw(){return!0}function nw(n){return n!==null&&typeof n=="object"&&"type"in n}const V_=[],iw=!0,Ah=!1,rw="skip";function K_(n,r,s,l){let d;typeof r=="function"&&typeof s!="function"?(l=s,s=r):d=r;const g=Uo(d),f=l?-1:1;o(n,void 0,[])();function o(c,h,p){const u=c&&typeof c=="object"?c:{};if(typeof u.type=="string"){const w=typeof u.tagName=="string"?u.tagName:typeof u.name=="string"?u.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(c.type+(w?"<"+w+">":""))+")"})}return b;function b(){let w=V_,R,E,v;if((!r||g(c,h,p[p.length-1]||void 0))&&(w=sw(s(c,p)),w[0]===Ah))return w;if("children"in c&&c.children){const y=c;if(y.children&&w[0]!==rw)for(E=(l?y.children.length:-1)+f,v=p.concat(y);E>-1&&E<y.children.length;){const _=y.children[E];if(R=o(_,E,v)(),R[0]===Ah)return R;E=typeof R[1]=="number"?R[1]:E+f}}return w}}}function sw(n){return Array.isArray(n)?n:typeof n=="number"?[iw,n]:n==null?V_:[n]}function Qh(n,r,s,l){let d,g,f;typeof r=="function"&&typeof s!="function"?(g=void 0,f=r,d=s):(g=r,f=s,d=l),K_(n,g,o,d);function o(c,h){const p=h[h.length-1],u=p?p.children.indexOf(c):void 0;return f(c,u,p)}}const Rh={}.hasOwnProperty,aw={};function lw(n,r){const s=r||aw,l=new Map,d=new Map,g=new Map,f={...qC,...s.handlers},o={all:h,applyData:cw,definitionById:l,footnoteById:d,footnoteCounts:g,footnoteOrder:[],handlers:f,one:c,options:s,patch:ow,wrap:hw};return Qh(n,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const u=p.type==="definition"?l:d,b=String(p.identifier).toUpperCase();u.has(b)||u.set(b,p)}}),o;function c(p,u){const b=p.type,w=o.handlers[b];if(Rh.call(o.handlers,b)&&w)return w(o,p,u);if(o.options.passThrough&&o.options.passThrough.includes(b)){if("children"in p){const{children:E,...v}=p,y=Do(v);return y.children=o.all(p),y}return Do(p)}return(o.options.unknownHandler||uw)(o,p,u)}function h(p){const u=[];if("children"in p){const b=p.children;let w=-1;for(;++w<b.length;){const R=o.one(b[w],p);if(R){if(w&&b[w-1].type==="break"&&(!Array.isArray(R)&&R.type==="text"&&(R.value=Tg(R.value)),!Array.isArray(R)&&R.type==="element")){const E=R.children[0];E&&E.type==="text"&&(E.value=Tg(E.value))}Array.isArray(R)?u.push(...R):u.push(R)}}}return u}}function ow(n,r){n.position&&(r.position=Y1(n))}function cw(n,r){let s=r;if(n&&n.data){const l=n.data.hName,d=n.data.hChildren,g=n.data.hProperties;if(typeof l=="string")if(s.type==="element")s.tagName=l;else{const f="children"in s?s.children:[s];s={type:"element",tagName:l,properties:{},children:f}}s.type==="element"&&g&&Object.assign(s.properties,Do(g)),"children"in s&&s.children&&d!==null&&d!==void 0&&(s.children=d)}return s}function uw(n,r){const s=r.data||{},l="value"in r&&!(Rh.call(s,"hProperties")||Rh.call(s,"hChildren"))?{type:"text",value:r.value}:{type:"element",tagName:"div",properties:{},children:n.all(r)};return n.patch(r,l),n.applyData(r,l)}function hw(n,r){const s=[];let l=-1;for(r&&s.push({type:"text",value:`
72
72
  `});++l<n.length;)l&&s.push({type:"text",value:`
73
73
  `}),s.push(n[l]);return r&&n.length>0&&s.push({type:"text",value:`
74
- `}),s}function Tg(n){let r=0,s=n.charCodeAt(r);for(;s===9||s===32;)r++,s=n.charCodeAt(r);return n.slice(r)}function Dg(n,r){const s=lw(n,r),l=s.one(n,void 0),d=QC(s),_=Array.isArray(l)?{type:"root",children:l}:l||{type:"root",children:[]};return d&&_.children.push({type:"text",value:`
75
- `},d),_}function fw(n,r){return n&&"run"in n?async function(s,l){const d=Dg(s,{file:l,...r});await n.run(d,l)}:function(s,l){return Dg(s,{file:l,...n||r})}}function Mg(n){if(n)throw n}var nh,Lg;function dw(){if(Lg)return nh;Lg=1;var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,s=Object.defineProperty,l=Object.getOwnPropertyDescriptor,d=function(h){return typeof Array.isArray=="function"?Array.isArray(h):r.call(h)==="[object Array]"},_=function(h){if(!h||r.call(h)!=="[object Object]")return!1;var 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 v;for(v in h);return typeof v>"u"||n.call(h,v)},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},o=function(h,p){if(p==="__proto__")if(n.call(h,p)){if(l)return l(h,p).value}else return;return h[p]};return nh=function c(){var h,p,u,v,w,R,E=arguments[0],y=1,S=arguments.length,g=!1;for(typeof E=="boolean"&&(g=E,E=arguments[1]||{},y=2),(E==null||typeof E!="object"&&typeof E!="function")&&(E={});y<S;++y)if(h=arguments[y],h!=null)for(p in h)u=o(E,p),v=o(h,p),E!==v&&(g&&v&&(_(v)||(w=d(v)))?(w?(w=!1,R=u&&d(u)?u:[]):R=u&&_(u)?u:{},f(E,{name:p,newValue:c(g,R,v)})):typeof v<"u"&&f(E,{name:p,newValue:v}));return E},nh}var pw=dw();const ih=r_(pw);function Dh(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 mw(){const n=[],r={run:s,use:l};return r;function s(...d){let _=-1;const f=d.pop();if(typeof f!="function")throw new TypeError("Expected function as last argument, not "+f);o(null,...d);function o(c,...h){const p=n[++_];let u=-1;if(c){f(c);return}for(;++u<d.length;)(h[u]===null||h[u]===void 0)&&(h[u]=d[u]);d=h,p?gw(p,o)(...h):f(null,...h)}}function l(d){if(typeof d!="function")throw new TypeError("Expected `middelware` to be a function, not "+d);return n.push(d),r}}function gw(n,r){let s;return l;function l(...f){const o=n.length>f.length;let c;o&&f.push(d);try{c=n.apply(this,f)}catch(h){const p=h;if(o&&s)throw p;return d(p)}o||(c&&c.then&&typeof c.then=="function"?c.then(_,d):c instanceof Error?d(c):_(c))}function d(f,...o){s||(s=!0,r(f,...o))}function _(f){d(null,f)}}const pi={basename:_w,dirname:vw,extname:yw,join:Sw,sep:"/"};function _w(n,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');sl(n);let s=0,l=-1,d=n.length,_;if(r===void 0||r.length===0||r.length>n.length){for(;d--;)if(n.codePointAt(d)===47){if(_){s=d+1;break}}else l<0&&(_=!0,l=d+1);return l<0?"":n.slice(s,l)}if(r===n)return"";let f=-1,o=r.length-1;for(;d--;)if(n.codePointAt(d)===47){if(_){s=d+1;break}}else f<0&&(_=!0,f=d+1),o>-1&&(n.codePointAt(d)===r.codePointAt(o--)?o<0&&(l=d):(o=-1,l=f));return s===l?l=f:l<0&&(l=n.length),n.slice(s,l)}function vw(n){if(sl(n),n.length===0)return".";let r=-1,s=n.length,l;for(;--s;)if(n.codePointAt(s)===47){if(l){r=s;break}}else l||(l=!0);return r<0?n.codePointAt(0)===47?"/":".":r===1&&n.codePointAt(0)===47?"//":n.slice(0,r)}function yw(n){sl(n);let r=n.length,s=-1,l=0,d=-1,_=0,f;for(;r--;){const o=n.codePointAt(r);if(o===47){if(f){l=r+1;break}continue}s<0&&(f=!0,s=r+1),o===46?d<0?d=r:_!==1&&(_=1):d>-1&&(_=-1)}return d<0||s<0||_===0||_===1&&d===s-1&&d===l+1?"":n.slice(d,s)}function Sw(...n){let r=-1,s;for(;++r<n.length;)sl(n[r]),n[r]&&(s=s===void 0?n[r]:s+"/"+n[r]);return s===void 0?".":bw(s)}function bw(n){sl(n);const r=n.codePointAt(0)===47;let s=Cw(n,!r);return s.length===0&&!r&&(s="."),s.length>0&&n.codePointAt(n.length-1)===47&&(s+="/"),r?"/"+s:s}function Cw(n,r){let s="",l=0,d=-1,_=0,f=-1,o,c;for(;++f<=n.length;){if(f<n.length)o=n.codePointAt(f);else{if(o===47)break;o=47}if(o===47){if(!(d===f-1||_===1))if(d!==f-1&&_===2){if(s.length<2||l!==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="",l=0):(s=s.slice(0,c),l=s.length-1-s.lastIndexOf("/")),d=f,_=0;continue}}else if(s.length>0){s="",l=0,d=f,_=0;continue}}r&&(s=s.length>0?s+"/..":"..",l=2)}else s.length>0?s+="/"+n.slice(d+1,f):s=n.slice(d+1,f),l=f-d-1;d=f,_=0}else o===46&&_>-1?_++:_=-1}return s}function sl(n){if(typeof n!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(n))}const ww={cwd:xw};function xw(){return"/"}function Mh(n){return!!(n!==null&&typeof n=="object"&&"href"in n&&n.href&&"protocol"in n&&n.protocol&&n.auth===void 0)}function Ew(n){if(typeof n=="string")n=new URL(n);else if(!Mh(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 kw(n)}function kw(n){if(n.hostname!==""){const l=new TypeError('File URL host must be "localhost" or empty on darwin');throw l.code="ERR_INVALID_FILE_URL_HOST",l}const r=n.pathname;let s=-1;for(;++s<r.length;)if(r.codePointAt(s)===37&&r.codePointAt(s+1)===50){const l=r.codePointAt(s+2);if(l===70||l===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 rh=["history","path","basename","stem","extname","dirname"];class W_{constructor(r){let s;r?Mh(r)?s={path:r}:typeof r=="string"||Aw(r)?s={value:r}:s=r:s={},this.cwd="cwd"in s?"":ww.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let l=-1;for(;++l<rh.length;){const _=rh[l];_ in s&&s[_]!==void 0&&s[_]!==null&&(this[_]=_==="history"?[...s[_]]:s[_])}let d;for(d in s)rh.includes(d)||(this[d]=s[d])}get basename(){return typeof this.path=="string"?pi.basename(this.path):void 0}set basename(r){ah(r,"basename"),sh(r,"basename"),this.path=pi.join(this.dirname||"",r)}get dirname(){return typeof this.path=="string"?pi.dirname(this.path):void 0}set dirname(r){Og(this.basename,"dirname"),this.path=pi.join(r||"",this.basename)}get extname(){return typeof this.path=="string"?pi.extname(this.path):void 0}set extname(r){if(sh(r,"extname"),Og(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=pi.join(this.dirname,this.stem+(r||""))}get path(){return this.history[this.history.length-1]}set path(r){Mh(r)&&(r=Ew(r)),ah(r,"path"),this.path!==r&&this.history.push(r)}get stem(){return typeof this.path=="string"?pi.basename(this.path,this.extname):void 0}set stem(r){ah(r,"stem"),sh(r,"stem"),this.path=pi.join(this.dirname||"",r+(this.extname||""))}fail(r,s,l){const d=this.message(r,s,l);throw d.fatal=!0,d}info(r,s,l){const d=this.message(r,s,l);return d.fatal=void 0,d}message(r,s,l){const d=new nn(r,s,l);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 sh(n,r){if(n&&n.includes(pi.sep))throw new Error("`"+r+"` cannot be a path: did not expect `"+pi.sep+"`")}function ah(n,r){if(!n)throw new Error("`"+r+"` cannot be empty")}function Og(n,r){if(!n)throw new Error("Setting `"+r+"` requires `path` to be set too")}function Aw(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const Rw=(function(n){const l=this.constructor.prototype,d=l[n],_=function(){return d.apply(_,arguments)};return Object.setPrototypeOf(_,l),_}),Tw={}.hasOwnProperty;class Jh extends Rw{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=mw()}copy(){const r=new Jh;let s=-1;for(;++s<this.attachers.length;){const l=this.attachers[s];r.use(...l)}return r.data(ih(!0,{},this.namespace)),r}data(r,s){return typeof r=="string"?arguments.length===2?(ch("data",this.frozen),this.namespace[r]=s,this):Tw.call(this.namespace,r)&&this.namespace[r]||void 0:r?(ch("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,...l]=this.attachers[this.freezeIndex];if(l[0]===!1)continue;l[0]===!0&&(l[0]=void 0);const d=s.call(r,...l);typeof d=="function"&&this.transformers.use(d)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(r){this.freeze();const s=Co(r),l=this.parser||this.Parser;return lh("parse",l),l(String(s),s)}process(r,s){const l=this;return this.freeze(),lh("process",this.parser||this.Parser),oh("process",this.compiler||this.Compiler),s?d(void 0,s):new Promise(d);function d(_,f){const o=Co(r),c=l.parse(o);l.run(c,o,function(p,u,v){if(p||!u||!v)return h(p);const w=u,R=l.stringify(w,v);Lw(R)?v.value=R:v.result=R,h(p,v)});function h(p,u){p||!u?f(p):_?_(u):s(void 0,u)}}}processSync(r){let s=!1,l;return this.freeze(),lh("processSync",this.parser||this.Parser),oh("processSync",this.compiler||this.Compiler),this.process(r,d),jg("processSync","process",s),l;function d(_,f){s=!0,Mg(_),l=f}}run(r,s,l){Bg(r),this.freeze();const d=this.transformers;return!l&&typeof s=="function"&&(l=s,s=void 0),l?_(void 0,l):new Promise(_);function _(f,o){const c=Co(s);d.run(r,c,h);function h(p,u,v){const w=u||r;p?o(p):f?f(w):l(void 0,w,v)}}}runSync(r,s){let l=!1,d;return this.run(r,s,_),jg("runSync","run",l),d;function _(f,o){Mg(f),d=o,l=!0}}stringify(r,s){this.freeze();const l=Co(s),d=this.compiler||this.Compiler;return oh("stringify",d),Bg(r),d(r,l)}use(r,...s){const l=this.attachers,d=this.namespace;if(ch("use",this.frozen),r!=null)if(typeof r=="function")c(r,s);else if(typeof r=="object")Array.isArray(r)?o(r):f(r);else throw new TypeError("Expected usable value, not `"+r+"`");return this;function _(h){if(typeof h=="function")c(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[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");o(h.plugins),h.settings&&(d.settings=ih(!0,d.settings,h.settings))}function o(h){let p=-1;if(h!=null)if(Array.isArray(h))for(;++p<h.length;){const u=h[p];_(u)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function c(h,p){let u=-1,v=-1;for(;++u<l.length;)if(l[u][0]===h){v=u;break}if(v===-1)l.push([h,...p]);else if(p.length>0){let[w,...R]=p;const E=l[v][1];Dh(E)&&Dh(w)&&(w=ih(!0,E,w)),l[v]=[h,w,...R]}}}}const Dw=new Jh().freeze();function lh(n,r){if(typeof r!="function")throw new TypeError("Cannot `"+n+"` without `parser`")}function oh(n,r){if(typeof r!="function")throw new TypeError("Cannot `"+n+"` without `compiler`")}function ch(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 Bg(n){if(!Dh(n)||typeof n.type!="string")throw new TypeError("Expected node, got `"+n+"`")}function jg(n,r,s){if(!s)throw new Error("`"+n+"` finished async. Use `"+r+"` instead")}function Co(n){return Mw(n)?n:new W_(n)}function Mw(n){return!!(n&&typeof n=="object"&&"message"in n&&"messages"in n)}function Lw(n){return typeof n=="string"||Ow(n)}function Ow(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const Bw="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ng=[],Hg={allowDangerousHtml:!0},jw=/^(https?|ircs?|mailto|xmpp)$/i,Nw=[{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 Y_(n){const r=Hw(n),s=zw(n);return Iw(r.runSync(r.parse(s),s),n)}function Hw(n){const r=n.rehypePlugins||Ng,s=n.remarkPlugins||Ng,l=n.remarkRehypeOptions?{...n.remarkRehypeOptions,...Hg}:Hg;return Dw().use(_C).use(s).use(fw,l).use(r)}function zw(n){const r=n.children||"",s=new W_;return typeof r=="string"&&(s.value=r),s}function Iw(n,r){const s=r.allowedElements,l=r.allowElement,d=r.components,_=r.disallowedElements,f=r.skipHtml,o=r.unwrapDisallowed,c=r.urlTransform||Uw;for(const p of Nw)Object.hasOwn(r,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+Bw+p.id,void 0);return Qh(n,h),eS(n,{Fragment:x.Fragment,components:d,ignoreInvalidStyle:!0,jsx:x.jsx,jsxs:x.jsxs,passKeys:!0,passNode:!0});function h(p,u,v){if(p.type==="raw"&&v&&typeof u=="number")return f?v.children.splice(u,1):v.children[u]={type:"text",value:p.value},u;if(p.type==="element"){let w;for(w in Zu)if(Object.hasOwn(Zu,w)&&Object.hasOwn(p.properties,w)){const R=p.properties[w],E=Zu[w];(E===null||E.includes(p.tagName))&&(p.properties[w]=c(String(R||""),w,p))}}if(p.type==="element"){let w=s?!s.includes(p.tagName):_?_.includes(p.tagName):!1;if(!w&&l&&typeof u=="number"&&(w=!l(p,u,v)),w&&v&&typeof u=="number")return o&&p.children?v.children.splice(u,1,...p.children):v.children.splice(u,1),u}}}function Uw(n){const r=n.indexOf(":"),s=n.indexOf("?"),l=n.indexOf("#"),d=n.indexOf("/");return r===-1||d!==-1&&r>d||s!==-1&&r>s||l!==-1&&r>l||jw.test(n.slice(0,r))?n:""}function zg(n,r){const s=String(n);if(typeof r!="string")throw new TypeError("Expected character");let l=0,d=s.indexOf(r);for(;d!==-1;)l++,d=s.indexOf(r,d+r.length);return l}function Pw(n){if(typeof n!="string")throw new TypeError("Expected a string");return n.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Fw(n,r,s){const d=Po((s||{}).ignore||[]),_=qw(r);let f=-1;for(;++f<_.length;)K_(n,"text",o);function o(h,p){let u=-1,v;for(;++u<p.length;){const w=p[u],R=v?v.children:void 0;if(d(w,R?R.indexOf(w):void 0,v))return;v=w}if(v)return c(h,p)}function c(h,p){const u=p[p.length-1],v=_[f][0],w=_[f][1];let R=0;const y=u.children.indexOf(h);let S=!1,g=[];v.lastIndex=0;let b=v.exec(h.value);for(;b;){const A=b.index,L={index:b.index,input:b.input,stack:[...p,h]};let D=w(...b,L);if(typeof D=="string"&&(D=D.length>0?{type:"text",value:D}:void 0),D===!1?v.lastIndex=A+1:(R!==A&&g.push({type:"text",value:h.value.slice(R,A)}),Array.isArray(D)?g.push(...D):D&&g.push(D),R=A+b[0].length,S=!0),!v.global)break;b=v.exec(h.value)}return S?(R<h.value.length&&g.push({type:"text",value:h.value.slice(R)}),u.children.splice(y,1,...g)):g=[h],y+g.length}}function qw(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 l=-1;for(;++l<s.length;){const d=s[l];r.push([$w(d[0]),Gw(d[1])])}return r}function $w(n){return typeof n=="string"?new RegExp(Pw(n),"g"):n}function Gw(n){return typeof n=="function"?n:function(){return n}}const uh="phrasing",hh=["autolink","link","image","label"];function Vw(){return{transforms:[Zw],enter:{literalAutolink:Ww,literalAutolinkEmail:fh,literalAutolinkHttp:fh,literalAutolinkWww:fh},exit:{literalAutolink:Jw,literalAutolinkEmail:Qw,literalAutolinkHttp:Yw,literalAutolinkWww:Xw}}}function Kw(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:uh,notInConstruct:hh},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:uh,notInConstruct:hh},{character:":",before:"[ps]",after:"\\/",inConstruct:uh,notInConstruct:hh}]}}function Ww(n){this.enter({type:"link",title:null,url:"",children:[]},n)}function fh(n){this.config.enter.autolinkProtocol.call(this,n)}function Yw(n){this.config.exit.autolinkProtocol.call(this,n)}function Xw(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 Qw(n){this.config.exit.autolinkEmail.call(this,n)}function Jw(n){this.exit(n)}function Zw(n){Fw(n,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,ex],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),tx]],{ignore:["link","linkReference"]})}function ex(n,r,s,l,d){let _="";if(!X_(d)||(/^w/i.test(r)&&(s=r+s,r="",_="http://"),!nx(s)))return!1;const f=ix(s+l);if(!f[0])return!1;const o={type:"link",title:null,url:_+r+f[0],children:[{type:"text",value:r+f[0]}]};return f[1]?[o,{type:"text",value:f[1]}]:o}function tx(n,r,s,l){return!X_(l,!0)||/[-\d_]$/.test(s)?!1:{type:"link",title:null,url:"mailto:"+r+"@"+s,children:[{type:"text",value:r+"@"+s}]}}function nx(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 ix(n){const r=/[!"&'),.:;<>?\]}]+$/.exec(n);if(!r)return[n,void 0];n=n.slice(0,r.index);let s=r[0],l=s.indexOf(")");const d=zg(n,"(");let _=zg(n,")");for(;l!==-1&&d>_;)n+=s.slice(0,l+1),s=s.slice(l+1),l=s.indexOf(")"),_++;return[n,s]}function X_(n,r){const s=n.input.charCodeAt(n.index-1);return(n.index===0||Yr(s)||zo(s))&&(!r||s!==47)}Q_.peek=fx;function rx(){this.buffer()}function sx(n){this.enter({type:"footnoteReference",identifier:"",label:""},n)}function ax(){this.buffer()}function lx(n){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},n)}function ox(n){const r=this.resume(),s=this.stack[this.stack.length-1];s.type,s.identifier=si(this.sliceSerialize(n)).toLowerCase(),s.label=r}function cx(n){this.exit(n)}function ux(n){const r=this.resume(),s=this.stack[this.stack.length-1];s.type,s.identifier=si(this.sliceSerialize(n)).toLowerCase(),s.label=r}function hx(n){this.exit(n)}function fx(){return"["}function Q_(n,r,s,l){const d=s.createTracker(l);let _=d.move("[^");const f=s.enter("footnoteReference"),o=s.enter("reference");return _+=d.move(s.safe(s.associationId(n),{after:"]",before:_})),o(),f(),_+=d.move("]"),_}function dx(){return{enter:{gfmFootnoteCallString:rx,gfmFootnoteCall:sx,gfmFootnoteDefinitionLabelString:ax,gfmFootnoteDefinition:lx},exit:{gfmFootnoteCallString:ox,gfmFootnoteCall:cx,gfmFootnoteDefinitionLabelString:ux,gfmFootnoteDefinition:hx}}}function px(n){let r=!1;return n&&n.firstLineBlank&&(r=!0),{handlers:{footnoteDefinition:s,footnoteReference:Q_},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function s(l,d,_,f){const o=_.createTracker(f);let c=o.move("[^");const h=_.enter("footnoteDefinition"),p=_.enter("label");return c+=o.move(_.safe(_.associationId(l),{before:c,after:"]"})),p(),c+=o.move("]:"),l.children&&l.children.length>0&&(o.shift(4),c+=o.move((r?`
76
- `:" ")+_.indentLines(_.containerFlow(l,o.current()),r?J_:mx))),h(),c}}function mx(n,r,s){return r===0?n:J_(n,r,s)}function J_(n,r,s){return(s?"":" ")+n}const gx=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Z_.peek=bx;function _x(){return{canContainEols:["delete"],enter:{strikethrough:yx},exit:{strikethrough:Sx}}}function vx(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:gx}],handlers:{delete:Z_}}}function yx(n){this.enter({type:"delete",children:[]},n)}function Sx(n){this.exit(n)}function Z_(n,r,s,l){const d=s.createTracker(l),_=s.enter("strikethrough");let f=d.move("~~");return f+=s.containerPhrasing(n,{...d.current(),before:f,after:"~"}),f+=d.move("~~"),_(),f}function bx(){return"~"}function Cx(n){return n.length}function wx(n,r){const s=r||{},l=(s.align||[]).concat(),d=s.stringLength||Cx,_=[],f=[],o=[],c=[];let h=0,p=-1;for(;++p<n.length;){const E=[],y=[];let S=-1;for(n[p].length>h&&(h=n[p].length);++S<n[p].length;){const g=xx(n[p][S]);if(s.alignDelimiters!==!1){const b=d(g);y[S]=b,(c[S]===void 0||b>c[S])&&(c[S]=b)}E.push(g)}f[p]=E,o[p]=y}let u=-1;if(typeof l=="object"&&"length"in l)for(;++u<h;)_[u]=Ig(l[u]);else{const E=Ig(l);for(;++u<h;)_[u]=E}u=-1;const v=[],w=[];for(;++u<h;){const E=_[u];let y="",S="";E===99?(y=":",S=":"):E===108?y=":":E===114&&(S=":");let g=s.alignDelimiters===!1?1:Math.max(1,c[u]-y.length-S.length);const b=y+"-".repeat(g)+S;s.alignDelimiters!==!1&&(g=y.length+g+S.length,g>c[u]&&(c[u]=g),w[u]=g),v[u]=b}f.splice(1,0,v),o.splice(1,0,w),p=-1;const R=[];for(;++p<f.length;){const E=f[p],y=o[p];u=-1;const S=[];for(;++u<h;){const g=E[u]||"";let b="",A="";if(s.alignDelimiters!==!1){const L=c[u]-(y[u]||0),D=_[u];D===114?b=" ".repeat(L):D===99?L%2?(b=" ".repeat(L/2+.5),A=" ".repeat(L/2-.5)):(b=" ".repeat(L/2),A=b):A=" ".repeat(L)}s.delimiterStart!==!1&&!u&&S.push("|"),s.padding!==!1&&!(s.alignDelimiters===!1&&g==="")&&(s.delimiterStart!==!1||u)&&S.push(" "),s.alignDelimiters!==!1&&S.push(b),S.push(g),s.alignDelimiters!==!1&&S.push(A),s.padding!==!1&&S.push(" "),(s.delimiterEnd!==!1||u!==h-1)&&S.push("|")}R.push(s.delimiterEnd===!1?S.join("").replace(/ +$/,""):S.join(""))}return R.join(`
77
- `)}function xx(n){return n==null?"":String(n)}function Ig(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 Ex(n,r,s,l){const d=s.enter("blockquote"),_=s.createTracker(l);_.move("> "),_.shift(2);const f=s.indentLines(s.containerFlow(n,_.current()),kx);return d(),f}function kx(n,r,s){return">"+(s?"":" ")+n}function Ax(n,r){return Ug(n,r.inConstruct,!0)&&!Ug(n,r.notInConstruct,!1)}function Ug(n,r,s){if(typeof r=="string"&&(r=[r]),!r||r.length===0)return s;let l=-1;for(;++l<r.length;)if(n.includes(r[l]))return!0;return!1}function Pg(n,r,s,l){let d=-1;for(;++d<s.unsafe.length;)if(s.unsafe[d].character===`
74
+ `}),s}function Tg(n){let r=0,s=n.charCodeAt(r);for(;s===9||s===32;)r++,s=n.charCodeAt(r);return n.slice(r)}function Dg(n,r){const s=lw(n,r),l=s.one(n,void 0),d=QC(s),g=Array.isArray(l)?{type:"root",children:l}:l||{type:"root",children:[]};return d&&g.children.push({type:"text",value:`
75
+ `},d),g}function fw(n,r){return n&&"run"in n?async function(s,l){const d=Dg(s,{file:l,...r});await n.run(d,l)}:function(s,l){return Dg(s,{file:l,...n||r})}}function Mg(n){if(n)throw n}var th,Lg;function dw(){if(Lg)return th;Lg=1;var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,s=Object.defineProperty,l=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},o=function(h,p){if(p==="__proto__")if(n.call(h,p)){if(l)return l(h,p).value}else return;return h[p]};return th=function c(){var h,p,u,b,w,R,E=arguments[0],v=1,y=arguments.length,_=!1;for(typeof E=="boolean"&&(_=E,E=arguments[1]||{},v=2),(E==null||typeof E!="object"&&typeof E!="function")&&(E={});v<y;++v)if(h=arguments[v],h!=null)for(p in h)u=o(E,p),b=o(h,p),E!==b&&(_&&b&&(g(b)||(w=d(b)))?(w?(w=!1,R=u&&d(u)?u:[]):R=u&&g(u)?u:{},f(E,{name:p,newValue:c(_,R,b)})):typeof b<"u"&&f(E,{name:p,newValue:b}));return E},th}var pw=dw();const nh=r_(pw);function Th(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 mw(){const n=[],r={run:s,use:l};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);o(null,...d);function o(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?gw(p,o)(...h):f(null,...h)}}function l(d){if(typeof d!="function")throw new TypeError("Expected `middelware` to be a function, not "+d);return n.push(d),r}}function gw(n,r){let s;return l;function l(...f){const o=n.length>f.length;let c;o&&f.push(d);try{c=n.apply(this,f)}catch(h){const p=h;if(o&&s)throw p;return d(p)}o||(c&&c.then&&typeof c.then=="function"?c.then(g,d):c instanceof Error?d(c):g(c))}function d(f,...o){s||(s=!0,r(f,...o))}function g(f){d(null,f)}}const di={basename:_w,dirname:vw,extname:yw,join:Sw,sep:"/"};function _w(n,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');rl(n);let s=0,l=-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 l<0&&(g=!0,l=d+1);return l<0?"":n.slice(s,l)}if(r===n)return"";let f=-1,o=r.length-1;for(;d--;)if(n.codePointAt(d)===47){if(g){s=d+1;break}}else f<0&&(g=!0,f=d+1),o>-1&&(n.codePointAt(d)===r.codePointAt(o--)?o<0&&(l=d):(o=-1,l=f));return s===l?l=f:l<0&&(l=n.length),n.slice(s,l)}function vw(n){if(rl(n),n.length===0)return".";let r=-1,s=n.length,l;for(;--s;)if(n.codePointAt(s)===47){if(l){r=s;break}}else l||(l=!0);return r<0?n.codePointAt(0)===47?"/":".":r===1&&n.codePointAt(0)===47?"//":n.slice(0,r)}function yw(n){rl(n);let r=n.length,s=-1,l=0,d=-1,g=0,f;for(;r--;){const o=n.codePointAt(r);if(o===47){if(f){l=r+1;break}continue}s<0&&(f=!0,s=r+1),o===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===l+1?"":n.slice(d,s)}function Sw(...n){let r=-1,s;for(;++r<n.length;)rl(n[r]),n[r]&&(s=s===void 0?n[r]:s+"/"+n[r]);return s===void 0?".":bw(s)}function bw(n){rl(n);const r=n.codePointAt(0)===47;let s=Cw(n,!r);return s.length===0&&!r&&(s="."),s.length>0&&n.codePointAt(n.length-1)===47&&(s+="/"),r?"/"+s:s}function Cw(n,r){let s="",l=0,d=-1,g=0,f=-1,o,c;for(;++f<=n.length;){if(f<n.length)o=n.codePointAt(f);else{if(o===47)break;o=47}if(o===47){if(!(d===f-1||g===1))if(d!==f-1&&g===2){if(s.length<2||l!==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="",l=0):(s=s.slice(0,c),l=s.length-1-s.lastIndexOf("/")),d=f,g=0;continue}}else if(s.length>0){s="",l=0,d=f,g=0;continue}}r&&(s=s.length>0?s+"/..":"..",l=2)}else s.length>0?s+="/"+n.slice(d+1,f):s=n.slice(d+1,f),l=f-d-1;d=f,g=0}else o===46&&g>-1?g++:g=-1}return s}function rl(n){if(typeof n!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(n))}const ww={cwd:xw};function xw(){return"/"}function Dh(n){return!!(n!==null&&typeof n=="object"&&"href"in n&&n.href&&"protocol"in n&&n.protocol&&n.auth===void 0)}function Ew(n){if(typeof n=="string")n=new URL(n);else if(!Dh(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 kw(n)}function kw(n){if(n.hostname!==""){const l=new TypeError('File URL host must be "localhost" or empty on darwin');throw l.code="ERR_INVALID_FILE_URL_HOST",l}const r=n.pathname;let s=-1;for(;++s<r.length;)if(r.codePointAt(s)===37&&r.codePointAt(s+1)===50){const l=r.codePointAt(s+2);if(l===70||l===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 ih=["history","path","basename","stem","extname","dirname"];class W_{constructor(r){let s;r?Dh(r)?s={path:r}:typeof r=="string"||Aw(r)?s={value:r}:s=r:s={},this.cwd="cwd"in s?"":ww.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let l=-1;for(;++l<ih.length;){const g=ih[l];g in s&&s[g]!==void 0&&s[g]!==null&&(this[g]=g==="history"?[...s[g]]:s[g])}let d;for(d in s)ih.includes(d)||(this[d]=s[d])}get basename(){return typeof this.path=="string"?di.basename(this.path):void 0}set basename(r){sh(r,"basename"),rh(r,"basename"),this.path=di.join(this.dirname||"",r)}get dirname(){return typeof this.path=="string"?di.dirname(this.path):void 0}set dirname(r){Og(this.basename,"dirname"),this.path=di.join(r||"",this.basename)}get extname(){return typeof this.path=="string"?di.extname(this.path):void 0}set extname(r){if(rh(r,"extname"),Og(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=di.join(this.dirname,this.stem+(r||""))}get path(){return this.history[this.history.length-1]}set path(r){Dh(r)&&(r=Ew(r)),sh(r,"path"),this.path!==r&&this.history.push(r)}get stem(){return typeof this.path=="string"?di.basename(this.path,this.extname):void 0}set stem(r){sh(r,"stem"),rh(r,"stem"),this.path=di.join(this.dirname||"",r+(this.extname||""))}fail(r,s,l){const d=this.message(r,s,l);throw d.fatal=!0,d}info(r,s,l){const d=this.message(r,s,l);return d.fatal=void 0,d}message(r,s,l){const d=new rn(r,s,l);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 rh(n,r){if(n&&n.includes(di.sep))throw new Error("`"+r+"` cannot be a path: did not expect `"+di.sep+"`")}function sh(n,r){if(!n)throw new Error("`"+r+"` cannot be empty")}function Og(n,r){if(!n)throw new Error("Setting `"+r+"` requires `path` to be set too")}function Aw(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const Rw=(function(n){const l=this.constructor.prototype,d=l[n],g=function(){return d.apply(g,arguments)};return Object.setPrototypeOf(g,l),g}),Tw={}.hasOwnProperty;class Jh extends Rw{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=mw()}copy(){const r=new Jh;let s=-1;for(;++s<this.attachers.length;){const l=this.attachers[s];r.use(...l)}return r.data(nh(!0,{},this.namespace)),r}data(r,s){return typeof r=="string"?arguments.length===2?(oh("data",this.frozen),this.namespace[r]=s,this):Tw.call(this.namespace,r)&&this.namespace[r]||void 0:r?(oh("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,...l]=this.attachers[this.freezeIndex];if(l[0]===!1)continue;l[0]===!0&&(l[0]=void 0);const d=s.call(r,...l);typeof d=="function"&&this.transformers.use(d)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(r){this.freeze();const s=bo(r),l=this.parser||this.Parser;return ah("parse",l),l(String(s),s)}process(r,s){const l=this;return this.freeze(),ah("process",this.parser||this.Parser),lh("process",this.compiler||this.Compiler),s?d(void 0,s):new Promise(d);function d(g,f){const o=bo(r),c=l.parse(o);l.run(c,o,function(p,u,b){if(p||!u||!b)return h(p);const w=u,R=l.stringify(w,b);Lw(R)?b.value=R:b.result=R,h(p,b)});function h(p,u){p||!u?f(p):g?g(u):s(void 0,u)}}}processSync(r){let s=!1,l;return this.freeze(),ah("processSync",this.parser||this.Parser),lh("processSync",this.compiler||this.Compiler),this.process(r,d),jg("processSync","process",s),l;function d(g,f){s=!0,Mg(g),l=f}}run(r,s,l){Bg(r),this.freeze();const d=this.transformers;return!l&&typeof s=="function"&&(l=s,s=void 0),l?g(void 0,l):new Promise(g);function g(f,o){const c=bo(s);d.run(r,c,h);function h(p,u,b){const w=u||r;p?o(p):f?f(w):l(void 0,w,b)}}}runSync(r,s){let l=!1,d;return this.run(r,s,g),jg("runSync","run",l),d;function g(f,o){Mg(f),d=o,l=!0}}stringify(r,s){this.freeze();const l=bo(s),d=this.compiler||this.Compiler;return lh("stringify",d),Bg(r),d(r,l)}use(r,...s){const l=this.attachers,d=this.namespace;if(oh("use",this.frozen),r!=null)if(typeof r=="function")c(r,s);else if(typeof r=="object")Array.isArray(r)?o(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");o(h.plugins),h.settings&&(d.settings=nh(!0,d.settings,h.settings))}function o(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<l.length;)if(l[u][0]===h){b=u;break}if(b===-1)l.push([h,...p]);else if(p.length>0){let[w,...R]=p;const E=l[b][1];Th(E)&&Th(w)&&(w=nh(!0,E,w)),l[b]=[h,w,...R]}}}}const Dw=new Jh().freeze();function ah(n,r){if(typeof r!="function")throw new TypeError("Cannot `"+n+"` without `parser`")}function lh(n,r){if(typeof r!="function")throw new TypeError("Cannot `"+n+"` without `compiler`")}function oh(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 Bg(n){if(!Th(n)||typeof n.type!="string")throw new TypeError("Expected node, got `"+n+"`")}function jg(n,r,s){if(!s)throw new Error("`"+n+"` finished async. Use `"+r+"` instead")}function bo(n){return Mw(n)?n:new W_(n)}function Mw(n){return!!(n&&typeof n=="object"&&"message"in n&&"messages"in n)}function Lw(n){return typeof n=="string"||Ow(n)}function Ow(n){return!!(n&&typeof n=="object"&&"byteLength"in n&&"byteOffset"in n)}const Bw="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ng=[],Hg={allowDangerousHtml:!0},jw=/^(https?|ircs?|mailto|xmpp)$/i,Nw=[{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 Y_(n){const r=Hw(n),s=zw(n);return Iw(r.runSync(r.parse(s),s),n)}function Hw(n){const r=n.rehypePlugins||Ng,s=n.remarkPlugins||Ng,l=n.remarkRehypeOptions?{...n.remarkRehypeOptions,...Hg}:Hg;return Dw().use(_C).use(s).use(fw,l).use(r)}function zw(n){const r=n.children||"",s=new W_;return typeof r=="string"&&(s.value=r),s}function Iw(n,r){const s=r.allowedElements,l=r.allowElement,d=r.components,g=r.disallowedElements,f=r.skipHtml,o=r.unwrapDisallowed,c=r.urlTransform||Uw;for(const p of Nw)Object.hasOwn(r,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+Bw+p.id,void 0);return Qh(n,h),eS(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 w;for(w in Ju)if(Object.hasOwn(Ju,w)&&Object.hasOwn(p.properties,w)){const R=p.properties[w],E=Ju[w];(E===null||E.includes(p.tagName))&&(p.properties[w]=c(String(R||""),w,p))}}if(p.type==="element"){let w=s?!s.includes(p.tagName):g?g.includes(p.tagName):!1;if(!w&&l&&typeof u=="number"&&(w=!l(p,u,b)),w&&b&&typeof u=="number")return o&&p.children?b.children.splice(u,1,...p.children):b.children.splice(u,1),u}}}function Uw(n){const r=n.indexOf(":"),s=n.indexOf("?"),l=n.indexOf("#"),d=n.indexOf("/");return r===-1||d!==-1&&r>d||s!==-1&&r>s||l!==-1&&r>l||jw.test(n.slice(0,r))?n:""}function zg(n,r){const s=String(n);if(typeof r!="string")throw new TypeError("Expected character");let l=0,d=s.indexOf(r);for(;d!==-1;)l++,d=s.indexOf(r,d+r.length);return l}function Pw(n){if(typeof n!="string")throw new TypeError("Expected a string");return n.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Fw(n,r,s){const d=Uo((s||{}).ignore||[]),g=qw(r);let f=-1;for(;++f<g.length;)K_(n,"text",o);function o(h,p){let u=-1,b;for(;++u<p.length;){const w=p[u],R=b?b.children:void 0;if(d(w,R?R.indexOf(w):void 0,b))return;b=w}if(b)return c(h,p)}function c(h,p){const u=p[p.length-1],b=g[f][0],w=g[f][1];let R=0;const v=u.children.indexOf(h);let y=!1,_=[];b.lastIndex=0;let S=b.exec(h.value);for(;S;){const A=S.index,L={index:S.index,input:S.input,stack:[...p,h]};let D=w(...S,L);if(typeof D=="string"&&(D=D.length>0?{type:"text",value:D}:void 0),D===!1?b.lastIndex=A+1:(R!==A&&_.push({type:"text",value:h.value.slice(R,A)}),Array.isArray(D)?_.push(...D):D&&_.push(D),R=A+S[0].length,y=!0),!b.global)break;S=b.exec(h.value)}return y?(R<h.value.length&&_.push({type:"text",value:h.value.slice(R)}),u.children.splice(v,1,..._)):_=[h],v+_.length}}function qw(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 l=-1;for(;++l<s.length;){const d=s[l];r.push([$w(d[0]),Gw(d[1])])}return r}function $w(n){return typeof n=="string"?new RegExp(Pw(n),"g"):n}function Gw(n){return typeof n=="function"?n:function(){return n}}const ch="phrasing",uh=["autolink","link","image","label"];function Vw(){return{transforms:[Zw],enter:{literalAutolink:Ww,literalAutolinkEmail:hh,literalAutolinkHttp:hh,literalAutolinkWww:hh},exit:{literalAutolink:Jw,literalAutolinkEmail:Qw,literalAutolinkHttp:Yw,literalAutolinkWww:Xw}}}function Kw(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:ch,notInConstruct:uh},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:ch,notInConstruct:uh},{character:":",before:"[ps]",after:"\\/",inConstruct:ch,notInConstruct:uh}]}}function Ww(n){this.enter({type:"link",title:null,url:"",children:[]},n)}function hh(n){this.config.enter.autolinkProtocol.call(this,n)}function Yw(n){this.config.exit.autolinkProtocol.call(this,n)}function Xw(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 Qw(n){this.config.exit.autolinkEmail.call(this,n)}function Jw(n){this.exit(n)}function Zw(n){Fw(n,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,ex],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),tx]],{ignore:["link","linkReference"]})}function ex(n,r,s,l,d){let g="";if(!X_(d)||(/^w/i.test(r)&&(s=r+s,r="",g="http://"),!nx(s)))return!1;const f=ix(s+l);if(!f[0])return!1;const o={type:"link",title:null,url:g+r+f[0],children:[{type:"text",value:r+f[0]}]};return f[1]?[o,{type:"text",value:f[1]}]:o}function tx(n,r,s,l){return!X_(l,!0)||/[-\d_]$/.test(s)?!1:{type:"link",title:null,url:"mailto:"+r+"@"+s,children:[{type:"text",value:r+"@"+s}]}}function nx(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 ix(n){const r=/[!"&'),.:;<>?\]}]+$/.exec(n);if(!r)return[n,void 0];n=n.slice(0,r.index);let s=r[0],l=s.indexOf(")");const d=zg(n,"(");let g=zg(n,")");for(;l!==-1&&d>g;)n+=s.slice(0,l+1),s=s.slice(l+1),l=s.indexOf(")"),g++;return[n,s]}function X_(n,r){const s=n.input.charCodeAt(n.index-1);return(n.index===0||Kr(s)||Ho(s))&&(!r||s!==47)}Q_.peek=fx;function rx(){this.buffer()}function sx(n){this.enter({type:"footnoteReference",identifier:"",label:""},n)}function ax(){this.buffer()}function lx(n){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},n)}function ox(n){const r=this.resume(),s=this.stack[this.stack.length-1];s.type,s.identifier=si(this.sliceSerialize(n)).toLowerCase(),s.label=r}function cx(n){this.exit(n)}function ux(n){const r=this.resume(),s=this.stack[this.stack.length-1];s.type,s.identifier=si(this.sliceSerialize(n)).toLowerCase(),s.label=r}function hx(n){this.exit(n)}function fx(){return"["}function Q_(n,r,s,l){const d=s.createTracker(l);let g=d.move("[^");const f=s.enter("footnoteReference"),o=s.enter("reference");return g+=d.move(s.safe(s.associationId(n),{after:"]",before:g})),o(),f(),g+=d.move("]"),g}function dx(){return{enter:{gfmFootnoteCallString:rx,gfmFootnoteCall:sx,gfmFootnoteDefinitionLabelString:ax,gfmFootnoteDefinition:lx},exit:{gfmFootnoteCallString:ox,gfmFootnoteCall:cx,gfmFootnoteDefinitionLabelString:ux,gfmFootnoteDefinition:hx}}}function px(n){let r=!1;return n&&n.firstLineBlank&&(r=!0),{handlers:{footnoteDefinition:s,footnoteReference:Q_},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function s(l,d,g,f){const o=g.createTracker(f);let c=o.move("[^");const h=g.enter("footnoteDefinition"),p=g.enter("label");return c+=o.move(g.safe(g.associationId(l),{before:c,after:"]"})),p(),c+=o.move("]:"),l.children&&l.children.length>0&&(o.shift(4),c+=o.move((r?`
76
+ `:" ")+g.indentLines(g.containerFlow(l,o.current()),r?J_:mx))),h(),c}}function mx(n,r,s){return r===0?n:J_(n,r,s)}function J_(n,r,s){return(s?"":" ")+n}const gx=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Z_.peek=bx;function _x(){return{canContainEols:["delete"],enter:{strikethrough:yx},exit:{strikethrough:Sx}}}function vx(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:gx}],handlers:{delete:Z_}}}function yx(n){this.enter({type:"delete",children:[]},n)}function Sx(n){this.exit(n)}function Z_(n,r,s,l){const d=s.createTracker(l),g=s.enter("strikethrough");let f=d.move("~~");return f+=s.containerPhrasing(n,{...d.current(),before:f,after:"~"}),f+=d.move("~~"),g(),f}function bx(){return"~"}function Cx(n){return n.length}function wx(n,r){const s=r||{},l=(s.align||[]).concat(),d=s.stringLength||Cx,g=[],f=[],o=[],c=[];let h=0,p=-1;for(;++p<n.length;){const E=[],v=[];let y=-1;for(n[p].length>h&&(h=n[p].length);++y<n[p].length;){const _=xx(n[p][y]);if(s.alignDelimiters!==!1){const S=d(_);v[y]=S,(c[y]===void 0||S>c[y])&&(c[y]=S)}E.push(_)}f[p]=E,o[p]=v}let u=-1;if(typeof l=="object"&&"length"in l)for(;++u<h;)g[u]=Ig(l[u]);else{const E=Ig(l);for(;++u<h;)g[u]=E}u=-1;const b=[],w=[];for(;++u<h;){const E=g[u];let v="",y="";E===99?(v=":",y=":"):E===108?v=":":E===114&&(y=":");let _=s.alignDelimiters===!1?1:Math.max(1,c[u]-v.length-y.length);const S=v+"-".repeat(_)+y;s.alignDelimiters!==!1&&(_=v.length+_+y.length,_>c[u]&&(c[u]=_),w[u]=_),b[u]=S}f.splice(1,0,b),o.splice(1,0,w),p=-1;const R=[];for(;++p<f.length;){const E=f[p],v=o[p];u=-1;const y=[];for(;++u<h;){const _=E[u]||"";let S="",A="";if(s.alignDelimiters!==!1){const L=c[u]-(v[u]||0),D=g[u];D===114?S=" ".repeat(L):D===99?L%2?(S=" ".repeat(L/2+.5),A=" ".repeat(L/2-.5)):(S=" ".repeat(L/2),A=S):A=" ".repeat(L)}s.delimiterStart!==!1&&!u&&y.push("|"),s.padding!==!1&&!(s.alignDelimiters===!1&&_==="")&&(s.delimiterStart!==!1||u)&&y.push(" "),s.alignDelimiters!==!1&&y.push(S),y.push(_),s.alignDelimiters!==!1&&y.push(A),s.padding!==!1&&y.push(" "),(s.delimiterEnd!==!1||u!==h-1)&&y.push("|")}R.push(s.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return R.join(`
77
+ `)}function xx(n){return n==null?"":String(n)}function Ig(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 Ex(n,r,s,l){const d=s.enter("blockquote"),g=s.createTracker(l);g.move("> "),g.shift(2);const f=s.indentLines(s.containerFlow(n,g.current()),kx);return d(),f}function kx(n,r,s){return">"+(s?"":" ")+n}function Ax(n,r){return Ug(n,r.inConstruct,!0)&&!Ug(n,r.notInConstruct,!1)}function Ug(n,r,s){if(typeof r=="string"&&(r=[r]),!r||r.length===0)return s;let l=-1;for(;++l<r.length;)if(n.includes(r[l]))return!0;return!1}function Pg(n,r,s,l){let d=-1;for(;++d<s.unsafe.length;)if(s.unsafe[d].character===`
78
78
  `&&Ax(s.stack,s.unsafe[d]))return/[ \t]/.test(l.before)?"":" ";return`\\
79
- `}function Rx(n,r){const s=String(n);let l=s.indexOf(r),d=l,_=0,f=0;if(typeof r!="string")throw new TypeError("Expected substring");for(;l!==-1;)l===d?++_>f&&(f=_):_=1,d=l+r.length,l=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 Dx(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 Mx(n,r,s,l){const d=Dx(s),_=n.value||"",f=d==="`"?"GraveAccent":"Tilde";if(Tx(n,s)){const u=s.enter("codeIndented"),v=s.indentLines(_,Lx);return u(),v}const o=s.createTracker(l),c=d.repeat(Math.max(Rx(_,d)+1,3)),h=s.enter("codeFenced");let p=o.move(c);if(n.lang){const u=s.enter(`codeFencedLang${f}`);p+=o.move(s.safe(n.lang,{before:p,after:" ",encode:["`"],...o.current()})),u()}if(n.lang&&n.meta){const u=s.enter(`codeFencedMeta${f}`);p+=o.move(" "),p+=o.move(s.safe(n.meta,{before:p,after:`
79
+ `}function Rx(n,r){const s=String(n);let l=s.indexOf(r),d=l,g=0,f=0;if(typeof r!="string")throw new TypeError("Expected substring");for(;l!==-1;)l===d?++g>f&&(f=g):g=1,d=l+r.length,l=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 Dx(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 Mx(n,r,s,l){const d=Dx(s),g=n.value||"",f=d==="`"?"GraveAccent":"Tilde";if(Tx(n,s)){const u=s.enter("codeIndented"),b=s.indentLines(g,Lx);return u(),b}const o=s.createTracker(l),c=d.repeat(Math.max(Rx(g,d)+1,3)),h=s.enter("codeFenced");let p=o.move(c);if(n.lang){const u=s.enter(`codeFencedLang${f}`);p+=o.move(s.safe(n.lang,{before:p,after:" ",encode:["`"],...o.current()})),u()}if(n.lang&&n.meta){const u=s.enter(`codeFencedMeta${f}`);p+=o.move(" "),p+=o.move(s.safe(n.meta,{before:p,after:`
80
80
  `,encode:["`"],...o.current()})),u()}return p+=o.move(`
81
- `),_&&(p+=o.move(_+`
82
- `)),p+=o.move(c),h(),p}function Lx(n,r,s){return(s?"":" ")+n}function Zh(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 Ox(n,r,s,l){const d=Zh(s),_=d==='"'?"Quote":"Apostrophe",f=s.enter("definition");let o=s.enter("label");const c=s.createTracker(l);let h=c.move("[");return h+=c.move(s.safe(s.associationId(n),{before:h,after:"]",...c.current()})),h+=c.move("]: "),o(),!n.url||/[\0- \u007F]/.test(n.url)?(o=s.enter("destinationLiteral"),h+=c.move("<"),h+=c.move(s.safe(n.url,{before:h,after:">",...c.current()})),h+=c.move(">")):(o=s.enter("destinationRaw"),h+=c.move(s.safe(n.url,{before:h,after:n.title?" ":`
83
- `,...c.current()}))),o(),n.title&&(o=s.enter(`title${_}`),h+=c.move(" "+d),h+=c.move(s.safe(n.title,{before:h,after:d,...c.current()})),h+=c.move(d),o()),f(),h}function Bx(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 el(n){return"&#x"+n.toString(16).toUpperCase()+";"}function Lo(n,r,s){const l=qs(n),d=qs(r);return l===void 0?d===void 0?s==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:d===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:l===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}}ev.peek=jx;function ev(n,r,s,l){const d=Bx(s),_=s.enter("emphasis"),f=s.createTracker(l),o=f.move(d);let c=f.move(s.containerPhrasing(n,{after:d,before:o,...f.current()}));const h=c.charCodeAt(0),p=Lo(l.before.charCodeAt(l.before.length-1),h,d);p.inside&&(c=el(h)+c.slice(1));const u=c.charCodeAt(c.length-1),v=Lo(l.after.charCodeAt(0),u,d);v.inside&&(c=c.slice(0,-1)+el(u));const w=f.move(d);return _(),s.attentionEncodeSurroundingInfo={after:v.outside,before:p.outside},o+c+w}function jx(n,r,s){return s.options.emphasis||"*"}function Nx(n,r){let s=!1;return Qh(n,function(l){if("value"in l&&/\r?\n|\r/.test(l.value)||l.type==="break")return s=!0,Rh}),!!((!n.depth||n.depth<3)&&$h(n)&&(r.options.setext||s))}function Hx(n,r,s,l){const d=Math.max(Math.min(6,n.depth||1),1),_=s.createTracker(l);if(Nx(n,s)){const p=s.enter("headingSetext"),u=s.enter("phrasing"),v=s.containerPhrasing(n,{..._.current(),before:`
81
+ `),g&&(p+=o.move(g+`
82
+ `)),p+=o.move(c),h(),p}function Lx(n,r,s){return(s?"":" ")+n}function Zh(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 Ox(n,r,s,l){const d=Zh(s),g=d==='"'?"Quote":"Apostrophe",f=s.enter("definition");let o=s.enter("label");const c=s.createTracker(l);let h=c.move("[");return h+=c.move(s.safe(s.associationId(n),{before:h,after:"]",...c.current()})),h+=c.move("]: "),o(),!n.url||/[\0- \u007F]/.test(n.url)?(o=s.enter("destinationLiteral"),h+=c.move("<"),h+=c.move(s.safe(n.url,{before:h,after:">",...c.current()})),h+=c.move(">")):(o=s.enter("destinationRaw"),h+=c.move(s.safe(n.url,{before:h,after:n.title?" ":`
83
+ `,...c.current()}))),o(),n.title&&(o=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),o()),f(),h}function Bx(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 el(n){return"&#x"+n.toString(16).toUpperCase()+";"}function Mo(n,r,s){const l=qs(n),d=qs(r);return l===void 0?d===void 0?s==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:d===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:l===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}}ev.peek=jx;function ev(n,r,s,l){const d=Bx(s),g=s.enter("emphasis"),f=s.createTracker(l),o=f.move(d);let c=f.move(s.containerPhrasing(n,{after:d,before:o,...f.current()}));const h=c.charCodeAt(0),p=Mo(l.before.charCodeAt(l.before.length-1),h,d);p.inside&&(c=el(h)+c.slice(1));const u=c.charCodeAt(c.length-1),b=Mo(l.after.charCodeAt(0),u,d);b.inside&&(c=c.slice(0,-1)+el(u));const w=f.move(d);return g(),s.attentionEncodeSurroundingInfo={after:b.outside,before:p.outside},o+c+w}function jx(n,r,s){return s.options.emphasis||"*"}function Nx(n,r){let s=!1;return Qh(n,function(l){if("value"in l&&/\r?\n|\r/.test(l.value)||l.type==="break")return s=!0,Ah}),!!((!n.depth||n.depth<3)&&$h(n)&&(r.options.setext||s))}function Hx(n,r,s,l){const d=Math.max(Math.min(6,n.depth||1),1),g=s.createTracker(l);if(Nx(n,s)){const p=s.enter("headingSetext"),u=s.enter("phrasing"),b=s.containerPhrasing(n,{...g.current(),before:`
84
84
  `,after:`
85
- `});return u(),p(),v+`
86
- `+(d===1?"=":"-").repeat(v.length-(Math.max(v.lastIndexOf("\r"),v.lastIndexOf(`
87
- `))+1))}const f="#".repeat(d),o=s.enter("headingAtx"),c=s.enter("phrasing");_.move(f+" ");let h=s.containerPhrasing(n,{before:"# ",after:`
88
- `,..._.current()});return/^[\t ]/.test(h)&&(h=el(h.charCodeAt(0))+h.slice(1)),h=h?f+" "+h:f,s.options.closeAtx&&(h+=" "+f),c(),o(),h}tv.peek=zx;function tv(n){return n.value||""}function zx(){return"<"}nv.peek=Ix;function nv(n,r,s,l){const d=Zh(s),_=d==='"'?"Quote":"Apostrophe",f=s.enter("image");let o=s.enter("label");const c=s.createTracker(l);let h=c.move("![");return h+=c.move(s.safe(n.alt,{before:h,after:"]",...c.current()})),h+=c.move("]("),o(),!n.url&&n.title||/[\0- \u007F]/.test(n.url)?(o=s.enter("destinationLiteral"),h+=c.move("<"),h+=c.move(s.safe(n.url,{before:h,after:">",...c.current()})),h+=c.move(">")):(o=s.enter("destinationRaw"),h+=c.move(s.safe(n.url,{before:h,after:n.title?" ":")",...c.current()}))),o(),n.title&&(o=s.enter(`title${_}`),h+=c.move(" "+d),h+=c.move(s.safe(n.title,{before:h,after:d,...c.current()})),h+=c.move(d),o()),h+=c.move(")"),f(),h}function Ix(){return"!"}iv.peek=Ux;function iv(n,r,s,l){const d=n.referenceType,_=s.enter("imageReference");let f=s.enter("label");const o=s.createTracker(l);let c=o.move("![");const h=s.safe(n.alt,{before:c,after:"]",...o.current()});c+=o.move(h+"]["),f();const p=s.stack;s.stack=[],f=s.enter("reference");const u=s.safe(s.associationId(n),{before:c,after:"]",...o.current()});return f(),s.stack=p,_(),d==="full"||!h||h!==u?c+=o.move(u+"]"):d==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function Ux(){return"!"}rv.peek=Px;function rv(n,r,s){let l=n.value||"",d="`",_=-1;for(;new RegExp("(^|[^`])"+d+"([^`]|$)").test(l);)d+="`";for(/[^ \r\n]/.test(l)&&(/^[ \r\n]/.test(l)&&/[ \r\n]$/.test(l)||/^`|`$/.test(l))&&(l=" "+l+" ");++_<s.unsafe.length;){const f=s.unsafe[_],o=s.compilePattern(f);let c;if(f.atBreak)for(;c=o.exec(l);){let h=c.index;l.charCodeAt(h)===10&&l.charCodeAt(h-1)===13&&h--,l=l.slice(0,h)+" "+l.slice(c.index+1)}}return d+l+d}function Px(){return"`"}function sv(n,r){const s=$h(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))}av.peek=Fx;function av(n,r,s,l){const d=Zh(s),_=d==='"'?"Quote":"Apostrophe",f=s.createTracker(l);let o,c;if(sv(n,s)){const p=s.stack;s.stack=[],o=s.enter("autolink");let u=f.move("<");return u+=f.move(s.containerPhrasing(n,{before:u,after:">",...f.current()})),u+=f.move(">"),o(),s.stack=p,u}o=s.enter("link"),c=s.enter("label");let h=f.move("[");return h+=f.move(s.containerPhrasing(n,{before:h,after:"](",...f.current()})),h+=f.move("]("),c(),!n.url&&n.title||/[\0- \u007F]/.test(n.url)?(c=s.enter("destinationLiteral"),h+=f.move("<"),h+=f.move(s.safe(n.url,{before:h,after:">",...f.current()})),h+=f.move(">")):(c=s.enter("destinationRaw"),h+=f.move(s.safe(n.url,{before:h,after:n.title?" ":")",...f.current()}))),c(),n.title&&(c=s.enter(`title${_}`),h+=f.move(" "+d),h+=f.move(s.safe(n.title,{before:h,after:d,...f.current()})),h+=f.move(d),c()),h+=f.move(")"),o(),h}function Fx(n,r,s){return sv(n,s)?"<":"["}lv.peek=qx;function lv(n,r,s,l){const d=n.referenceType,_=s.enter("linkReference");let f=s.enter("label");const o=s.createTracker(l);let c=o.move("[");const h=s.containerPhrasing(n,{before:c,after:"]",...o.current()});c+=o.move(h+"]["),f();const p=s.stack;s.stack=[],f=s.enter("reference");const u=s.safe(s.associationId(n),{before:c,after:"]",...o.current()});return f(),s.stack=p,_(),d==="full"||!h||h!==u?c+=o.move(u+"]"):d==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function qx(){return"["}function ef(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 $x(n){const r=ef(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 Gx(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 ov(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 Vx(n,r,s,l){const d=s.enter("list"),_=s.bulletCurrent;let f=n.ordered?Gx(s):ef(s);const o=n.ordered?f==="."?")":".":$x(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),ov(s)===f&&p){let u=-1;for(;++u<n.children.length;){const v=n.children[u];if(v&&v.type==="listItem"&&v.children&&v.children[0]&&v.children[0].type==="thematicBreak"){c=!0;break}}}}c&&(f=o),s.bulletCurrent=f;const h=s.containerFlow(n,l);return s.bulletLastUsed=f,s.bulletCurrent=_,d(),h}function Kx(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,l){const d=Kx(s);let _=s.bulletCurrent||ef(s);r&&r.type==="list"&&r.ordered&&(_=(typeof r.start=="number"&&r.start>-1?r.start:1)+(s.options.incrementListMarker===!1?0:r.children.indexOf(n))+_);let f=_.length+1;(d==="tab"||d==="mixed"&&(r&&r.type==="list"&&r.spread||n.spread))&&(f=Math.ceil(f/4)*4);const o=s.createTracker(l);o.move(_+" ".repeat(f-_.length)),o.shift(f);const c=s.enter("listItem"),h=s.indentLines(s.containerFlow(n,o.current()),p);return c(),h;function p(u,v,w){return v?(w?"":" ".repeat(f))+u:(w?_:_+" ".repeat(f-_.length))+u}}function Yx(n,r,s,l){const d=s.enter("paragraph"),_=s.enter("phrasing"),f=s.containerPhrasing(n,l);return _(),d(),f}const Xx=Po(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Qx(n,r,s,l){return(n.children.some(function(f){return Xx(f)})?s.containerPhrasing:s.containerFlow).call(s,n,l)}function Jx(n){const r=n.options.strong||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize strong with `"+r+"` for `options.strong`, expected `*`, or `_`");return r}cv.peek=Zx;function cv(n,r,s,l){const d=Jx(s),_=s.enter("strong"),f=s.createTracker(l),o=f.move(d+d);let c=f.move(s.containerPhrasing(n,{after:d,before:o,...f.current()}));const h=c.charCodeAt(0),p=Lo(l.before.charCodeAt(l.before.length-1),h,d);p.inside&&(c=el(h)+c.slice(1));const u=c.charCodeAt(c.length-1),v=Lo(l.after.charCodeAt(0),u,d);v.inside&&(c=c.slice(0,-1)+el(u));const w=f.move(d+d);return _(),s.attentionEncodeSurroundingInfo={after:v.outside,before:p.outside},o+c+w}function Zx(n,r,s){return s.options.strong||"*"}function eE(n,r,s,l){return s.safe(n.value,l)}function tE(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 nE(n,r,s){const l=(ov(s)+(s.options.ruleSpaces?" ":"")).repeat(tE(s));return s.options.ruleSpaces?l.slice(0,-1):l}const uv={blockquote:Ex,break:Pg,code:Mx,definition:Ox,emphasis:ev,hardBreak:Pg,heading:Hx,html:tv,image:nv,imageReference:iv,inlineCode:rv,link:av,linkReference:lv,list:Vx,listItem:Wx,paragraph:Yx,root:Qx,strong:cv,text:eE,thematicBreak:nE};function iE(){return{enter:{table:rE,tableData:Fg,tableHeader:Fg,tableRow:aE},exit:{codeText:lE,table:sE,tableData:dh,tableHeader:dh,tableRow:dh}}}function rE(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 sE(n){this.exit(n),this.data.inTable=void 0}function aE(n){this.enter({type:"tableRow",children:[]},n)}function dh(n){this.exit(n)}function Fg(n){this.enter({type:"tableCell",children:[]},n)}function lE(n){let r=this.resume();this.data.inTable&&(r=r.replace(/\\([\\|])/g,oE));const s=this.stack[this.stack.length-1];s.type,s.value=r,this.exit(n)}function oE(n,r){return r==="|"?r:n}function cE(n){const r=n||{},s=r.tableCellPadding,l=r.tablePipeAlign,d=r.stringLength,_=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:v,table:f,tableCell:c,tableRow:o}};function f(w,R,E,y){return h(p(w,E,y),w.align)}function o(w,R,E,y){const S=u(w,E,y),g=h([S]);return g.slice(0,g.indexOf(`
90
- `))}function c(w,R,E,y){const S=E.enter("tableCell"),g=E.enter("phrasing"),b=E.containerPhrasing(w,{...y,before:_,after:_});return g(),S(),b}function h(w,R){return wx(w,{align:R,alignDelimiters:l,padding:s,stringLength:d})}function p(w,R,E){const y=w.children;let S=-1;const g=[],b=R.enter("table");for(;++S<y.length;)g[S]=u(y[S],R,E);return b(),g}function u(w,R,E){const y=w.children;let S=-1;const g=[],b=R.enter("tableRow");for(;++S<y.length;)g[S]=c(y[S],w,R,E);return b(),g}function v(w,R,E){let y=uv.inlineCode(w,R,E);return E.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function uE(){return{exit:{taskListCheckValueChecked:qg,taskListCheckValueUnchecked:qg,paragraph:fE}}}function hE(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:dE}}}function qg(n){const r=this.stack[this.stack.length-2];r.type,r.checked=n.type==="taskListCheckValueChecked"}function fE(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 l=s.children[0];if(l&&l.type==="text"){const d=r.children;let _=-1,f;for(;++_<d.length;){const o=d[_];if(o.type==="paragraph"){f=o;break}}f===s&&(l.value=l.value.slice(1),l.value.length===0?s.children.shift():s.position&&l.position&&typeof l.position.start.offset=="number"&&(l.position.start.column++,l.position.start.offset++,s.position.start=Object.assign({},l.position.start)))}}this.exit(n)}function dE(n,r,s,l){const d=n.children[0],_=typeof n.checked=="boolean"&&d&&d.type==="paragraph",f="["+(n.checked?"x":" ")+"] ",o=s.createTracker(l);_&&o.move(f);let c=uv.listItem(n,r,s,{...l,...o.current()});return _&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),c;function h(p){return p+f}}function pE(){return[Vw(),dx(),_x(),iE(),uE()]}function mE(n){return{extensions:[Kw(),px(n),vx(),cE(n),hE()]}}const gE={tokenize:CE,partial:!0},hv={tokenize:wE,partial:!0},fv={tokenize:xE,partial:!0},dv={tokenize:EE,partial:!0},_E={tokenize:kE,partial:!0},pv={name:"wwwAutolink",tokenize:SE,previous:gv},mv={name:"protocolAutolink",tokenize:bE,previous:_v},Ii={name:"emailAutolink",tokenize:yE,previous:vv},gi={};function vE(){return{text:gi}}let Vr=48;for(;Vr<123;)gi[Vr]=Ii,Vr++,Vr===58?Vr=65:Vr===91&&(Vr=97);gi[43]=Ii;gi[45]=Ii;gi[46]=Ii;gi[95]=Ii;gi[72]=[Ii,mv];gi[104]=[Ii,mv];gi[87]=[Ii,pv];gi[119]=[Ii,pv];function yE(n,r,s){const l=this;let d,_;return f;function f(u){return!Lh(u)||!vv.call(l,l.previous)||tf(l.events)?s(u):(n.enter("literalAutolink"),n.enter("literalAutolinkEmail"),o(u))}function o(u){return Lh(u)?(n.consume(u),o):u===64?(n.consume(u),c):s(u)}function c(u){return u===46?n.check(_E,p,h)(u):u===45||u===95||tn(u)?(_=!0,n.consume(u),c):p(u)}function h(u){return n.consume(u),d=!0,c}function p(u){return _&&d&&hn(l.previous)?(n.exit("literalAutolinkEmail"),n.exit("literalAutolink"),r(u)):s(u)}}function SE(n,r,s){const l=this;return d;function d(f){return f!==87&&f!==119||!gv.call(l,l.previous)||tf(l.events)?s(f):(n.enter("literalAutolink"),n.enter("literalAutolinkWww"),n.check(gE,n.attempt(hv,n.attempt(fv,_),s),s)(f))}function _(f){return n.exit("literalAutolinkWww"),n.exit("literalAutolink"),r(f)}}function bE(n,r,s){const l=this;let d="",_=!1;return f;function f(u){return(u===72||u===104)&&_v.call(l,l.previous)&&!tf(l.events)?(n.enter("literalAutolink"),n.enter("literalAutolinkHttp"),d+=String.fromCodePoint(u),n.consume(u),o):s(u)}function o(u){if(hn(u)&&d.length<5)return d+=String.fromCodePoint(u),n.consume(u),o;if(u===58){const v=d.toLowerCase();if(v==="http"||v==="https")return n.consume(u),c}return s(u)}function c(u){return u===47?(n.consume(u),_?h:(_=!0,c)):s(u)}function h(u){return u===null||To(u)||ft(u)||Yr(u)||zo(u)?s(u):n.attempt(hv,n.attempt(fv,p),s)(u)}function p(u){return n.exit("literalAutolinkHttp"),n.exit("literalAutolink"),r(u)}}function CE(n,r,s){let l=0;return d;function d(f){return(f===87||f===119)&&l<3?(l++,n.consume(f),d):f===46&&l===3?(n.consume(f),_):s(f)}function _(f){return f===null?s(f):r(f)}}function wE(n,r,s){let l,d,_;return f;function f(h){return h===46||h===95?n.check(dv,c,o)(h):h===null||ft(h)||Yr(h)||h!==45&&zo(h)?c(h):(_=!0,n.consume(h),f)}function o(h){return h===95?l=!0:(d=l,l=void 0),n.consume(h),f}function c(h){return d||l||!_?s(h):r(h)}}function xE(n,r){let s=0,l=0;return d;function d(f){return f===40?(s++,n.consume(f),d):f===41&&l<s?_(f):f===33||f===34||f===38||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===60||f===63||f===93||f===95||f===126?n.check(dv,r,_)(f):f===null||ft(f)||Yr(f)?r(f):(n.consume(f),d)}function _(f){return f===41&&l++,n.consume(f),d}}function EE(n,r,s){return l;function l(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(n.consume(o),l):o===38?(n.consume(o),_):o===93?(n.consume(o),d):o===60||o===null||ft(o)||Yr(o)?r(o):s(o)}function d(o){return o===null||o===40||o===91||ft(o)||Yr(o)?r(o):l(o)}function _(o){return hn(o)?f(o):s(o)}function f(o){return o===59?(n.consume(o),l):hn(o)?(n.consume(o),f):s(o)}}function kE(n,r,s){return l;function l(_){return n.consume(_),d}function d(_){return tn(_)?s(_):r(_)}}function gv(n){return n===null||n===40||n===42||n===95||n===91||n===93||n===126||ft(n)}function _v(n){return!hn(n)}function vv(n){return!(n===47||Lh(n))}function Lh(n){return n===43||n===45||n===46||n===95||tn(n)}function tf(n){let r=n.length,s=!1;for(;r--;){const l=n[r][1];if((l.type==="labelLink"||l.type==="labelImage")&&!l._balanced){s=!0;break}if(l._gfmAutolinkLiteralWalkedInto){s=!1;break}}return n.length>0&&!s&&(n[n.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),s}const AE={tokenize:jE,partial:!0};function RE(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:LE,continuation:{tokenize:OE},exit:BE}},text:{91:{name:"gfmFootnoteCall",tokenize:ME},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:TE,resolveTo:DE}}}}function TE(n,r,s){const l=this;let d=l.events.length;const _=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let f;for(;d--;){const c=l.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 o;function o(c){if(!f||!f._balanced)return s(c);const h=si(l.sliceSerialize({start:f.end,end:l.now()}));return h.codePointAt(0)!==94||!_.includes(h.slice(1))?s(c):(n.enter("gfmFootnoteCallLabelMarker"),n.consume(c),n.exit("gfmFootnoteCallLabelMarker"),r(c))}}function DE(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 l={type:"gfmFootnoteCall",start:Object.assign({},n[s+3][1].start),end:Object.assign({},n[n.length-1][1].end)},d={type:"gfmFootnoteCallMarker",start:Object.assign({},n[s+3][1].end),end:Object.assign({},n[s+3][1].end)};d.end.column++,d.end.offset++,d.end._bufferIndex++;const _={type:"gfmFootnoteCallString",start:Object.assign({},d.end),end:Object.assign({},n[n.length-1][1].start)},f={type:"chunkString",contentType:"string",start:Object.assign({},_.start),end:Object.assign({},_.end)},o=[n[s+1],n[s+2],["enter",l,r],n[s+3],n[s+4],["enter",d,r],["exit",d,r],["enter",_,r],["enter",f,r],["exit",f,r],["exit",_,r],n[n.length-2],n[n.length-1],["exit",l,r]];return n.splice(s,n.length-s+1,...o),n}function ME(n,r,s){const l=this,d=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let _=0,f;return o;function o(u){return n.enter("gfmFootnoteCall"),n.enter("gfmFootnoteCallLabelMarker"),n.consume(u),n.exit("gfmFootnoteCallLabelMarker"),c}function c(u){return u!==94?s(u):(n.enter("gfmFootnoteCallMarker"),n.consume(u),n.exit("gfmFootnoteCallMarker"),n.enter("gfmFootnoteCallString"),n.enter("chunkString").contentType="string",h)}function h(u){if(_>999||u===93&&!f||u===null||u===91||ft(u))return s(u);if(u===93){n.exit("chunkString");const v=n.exit("gfmFootnoteCallString");return d.includes(si(l.sliceSerialize(v)))?(n.enter("gfmFootnoteCallLabelMarker"),n.consume(u),n.exit("gfmFootnoteCallLabelMarker"),n.exit("gfmFootnoteCall"),r):s(u)}return ft(u)||(f=!0),_++,n.consume(u),u===92?p:h}function p(u){return u===91||u===92||u===93?(n.consume(u),_++,h):h(u)}}function LE(n,r,s){const l=this,d=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let _,f=0,o;return c;function c(R){return n.enter("gfmFootnoteDefinition")._container=!0,n.enter("gfmFootnoteDefinitionLabel"),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(R),n.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(R){return R===94?(n.enter("gfmFootnoteDefinitionMarker"),n.consume(R),n.exit("gfmFootnoteDefinitionMarker"),n.enter("gfmFootnoteDefinitionLabelString"),n.enter("chunkString").contentType="string",p):s(R)}function p(R){if(f>999||R===93&&!o||R===null||R===91||ft(R))return s(R);if(R===93){n.exit("chunkString");const E=n.exit("gfmFootnoteDefinitionLabelString");return _=si(l.sliceSerialize(E)),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(R),n.exit("gfmFootnoteDefinitionLabelMarker"),n.exit("gfmFootnoteDefinitionLabel"),v}return ft(R)||(o=!0),f++,n.consume(R),R===92?u:p}function u(R){return R===91||R===92||R===93?(n.consume(R),f++,p):p(R)}function v(R){return R===58?(n.enter("definitionMarker"),n.consume(R),n.exit("definitionMarker"),d.includes(_)||d.push(_),Je(n,w,"gfmFootnoteDefinitionWhitespace")):s(R)}function w(R){return r(R)}}function OE(n,r,s){return n.check(rl,r,n.attempt(AE,r,s))}function BE(n){n.exit("gfmFootnoteDefinition")}function jE(n,r,s){const l=this;return Je(n,d,"gfmFootnoteDefinitionIndent",5);function d(_){const f=l.events[l.events.length-1];return f&&f[1].type==="gfmFootnoteDefinitionIndent"&&f[2].sliceSerialize(f[1],!0).length===4?r(_):s(_)}}function NE(n){let s=(n||{}).singleTilde;const l={name:"strikethrough",tokenize:_,resolveAll:d};return s==null&&(s=!0),{text:{126:l},insideSpan:{null:[l]},attentionMarkers:{null:[126]}};function d(f,o){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)},v=[["enter",p,o],["enter",f[h][1],o],["exit",f[h][1],o],["enter",u,o]],w=o.parser.constructs.insideSpan.null;w&&jn(v,v.length,0,Io(w,f.slice(h+1,c),o)),jn(v,v.length,0,[["exit",u,o],["enter",f[c][1],o],["exit",f[c][1],o],["exit",p,o]]),jn(f,h-1,c-h+3,v),c=h+v.length-2;break}}for(c=-1;++c<f.length;)f[c][1].type==="strikethroughSequenceTemporary"&&(f[c][1].type="data");return f}function _(f,o,c){const h=this.previous,p=this.events;let u=0;return v;function v(R){return h===126&&p[p.length-1][1].type!=="characterEscape"?c(R):(f.enter("strikethroughSequenceTemporary"),w(R))}function w(R){const E=qs(h);if(R===126)return u>1?c(R):(f.consume(R),u++,w);if(u<2&&!s)return c(R);const y=f.exit("strikethroughSequenceTemporary"),S=qs(R);return y._open=!S||S===2&&!!E,y._close=!E||E===2&&!!S,o(R)}}}class HE{constructor(){this.map=[]}add(r,s,l){zE(this,r,s,l)}consume(r){if(this.map.sort(function(_,f){return _[0]-f[0]}),this.map.length===0)return;let s=this.map.length;const l=[];for(;s>0;)s-=1,l.push(r.slice(this.map[s][0]+this.map[s][1]),this.map[s][2]),r.length=this.map[s][0];l.push(r.slice()),r.length=0;let d=l.pop();for(;d;){for(const _ of d)r.push(_);d=l.pop()}this.map.length=0}}function zE(n,r,s,l){let d=0;if(!(s===0&&l.length===0)){for(;d<n.map.length;){if(n.map[d][0]===r){n.map[d][1]+=s,n.map[d][2].push(...l);return}d+=1}n.map.push([r,s,l])}}function IE(n,r){let s=!1;const l=[];for(;r<n.length;){const d=n[r];if(s){if(d[0]==="enter")d[1].type==="tableContent"&&l.push(n[r+1][1].type==="tableDelimiterMarker"?"left":"none");else if(d[1].type==="tableContent"){if(n[r-1][1].type==="tableDelimiterMarker"){const _=l.length-1;l[_]=l[_]==="left"?"center":"right"}}else if(d[1].type==="tableDelimiterRow")break}else d[0]==="enter"&&d[1].type==="tableDelimiterRow"&&(s=!0);r+=1}return l}function UE(){return{flow:{null:{name:"table",tokenize:PE,resolveAll:FE}}}}function PE(n,r,s){const l=this;let d=0,_=0,f;return o;function o(B){let H=l.events.length-1;for(;H>-1;){const Y=l.events[H][1].type;if(Y==="lineEnding"||Y==="linePrefix")H--;else break}const U=H>-1?l.events[H][1].type:null,P=U==="tableHead"||U==="tableRow"?D:c;return P===D&&l.parser.lazy[l.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,_+=1),p(B)}function p(B){return B===null?s(B):Le(B)?_>1?(_=0,l.interrupt=!0,n.exit("tableRow"),n.enter("lineEnding"),n.consume(B),n.exit("lineEnding"),w):s(B):Ke(B)?Je(n,p,"whitespace")(B):(_+=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||ft(B)?(n.exit("data"),p(B)):(n.consume(B),B===92?v:u)}function v(B){return B===92||B===124?(n.consume(B),u):u(B)}function w(B){return l.interrupt=!1,l.parser.lazy[l.now().line]?s(B):(n.enter("tableDelimiterRow"),f=!1,Ke(B)?Je(n,R,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):R(B))}function R(B){return B===45||B===58?y(B):B===124?(f=!0,n.enter("tableCellDivider"),n.consume(B),n.exit("tableCellDivider"),E):L(B)}function E(B){return Ke(B)?Je(n,y,"whitespace")(B):y(B)}function y(B){return B===58?(_+=1,f=!0,n.enter("tableDelimiterMarker"),n.consume(B),n.exit("tableDelimiterMarker"),S):B===45?(_+=1,S(B)):B===null||Le(B)?A(B):L(B)}function S(B){return B===45?(n.enter("tableDelimiterFiller"),g(B)):L(B)}function g(B){return B===45?(n.consume(B),g):B===58?(f=!0,n.exit("tableDelimiterFiller"),n.enter("tableDelimiterMarker"),n.consume(B),n.exit("tableDelimiterMarker"),b):(n.exit("tableDelimiterFiller"),b(B))}function b(B){return Ke(B)?Je(n,A,"whitespace")(B):A(B)}function A(B){return B===124?R(B):B===null||Le(B)?!f||d!==_?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"),T(B)}function T(B){return B===124?(n.enter("tableCellDivider"),n.consume(B),n.exit("tableCellDivider"),T):B===null||Le(B)?(n.exit("tableRow"),r(B)):Ke(B)?Je(n,T,"whitespace")(B):(n.enter("data"),k(B))}function k(B){return B===null||B===124||ft(B)?(n.exit("data"),T(B)):(n.consume(B),B===92?M:k)}function M(B){return B===92||B===124?(n.consume(B),k):k(B)}}function FE(n,r){let s=-1,l=!0,d=0,_=[0,0,0,0],f=[0,0,0,0],o=!1,c=0,h,p,u;const v=new HE;for(;++s<n.length;){const w=n[s],R=w[1];w[0]==="enter"?R.type==="tableHead"?(o=!1,c!==0&&($g(v,r,c,h,p),p=void 0,c=0),h={type:"table",start:Object.assign({},R.start),end:Object.assign({},R.end)},v.add(s,0,[["enter",h,r]])):R.type==="tableRow"||R.type==="tableDelimiterRow"?(l=!0,u=void 0,_=[0,0,0,0],f=[0,s+1,0,0],o&&(o=!1,p={type:"tableBody",start:Object.assign({},R.start),end:Object.assign({},R.end)},v.add(s,0,[["enter",p,r]])),d=R.type==="tableDelimiterRow"?2:p?3:1):d&&(R.type==="data"||R.type==="tableDelimiterMarker"||R.type==="tableDelimiterFiller")?(l=!1,f[2]===0&&(_[1]!==0&&(f[0]=f[1],u=wo(v,r,_,d,void 0,u),_=[0,0,0,0]),f[2]=s)):R.type==="tableCellDivider"&&(l?l=!1:(_[1]!==0&&(f[0]=f[1],u=wo(v,r,_,d,void 0,u)),_=f,f=[_[1],s,0,0])):R.type==="tableHead"?(o=!0,c=s):R.type==="tableRow"||R.type==="tableDelimiterRow"?(c=s,_[1]!==0?(f[0]=f[1],u=wo(v,r,_,d,s,u)):f[1]!==0&&(u=wo(v,r,f,d,s,u)),d=0):d&&(R.type==="data"||R.type==="tableDelimiterMarker"||R.type==="tableDelimiterFiller")&&(f[3]=s)}for(c!==0&&$g(v,r,c,h,p),v.consume(r.events),s=-1;++s<r.events.length;){const w=r.events[s];w[0]==="enter"&&w[1].type==="table"&&(w[1]._align=IE(r.events,s))}return n}function wo(n,r,s,l,d,_){const f=l===1?"tableHeader":l===2?"tableDelimiter":"tableData",o="tableContent";s[0]!==0&&(_.end=Object.assign({},Is(r.events,s[0])),n.add(s[0],0,[["exit",_,r]]));const c=Is(r.events,s[1]);if(_={type:f,start:Object.assign({},c),end:Object.assign({},c)},n.add(s[1],0,[["enter",_,r]]),s[2]!==0){const h=Is(r.events,s[2]),p=Is(r.events,s[3]),u={type:o,start:Object.assign({},h),end:Object.assign({},p)};if(n.add(s[2],0,[["enter",u,r]]),l!==2){const v=r.events[s[2]],w=r.events[s[3]];if(v[1].end=Object.assign({},w[1].end),v[1].type="chunkText",v[1].contentType="text",s[3]>s[2]+1){const R=s[2]+1,E=s[3]-s[2]-1;n.add(R,E,[])}}n.add(s[3]+1,0,[["exit",u,r]])}return d!==void 0&&(_.end=Object.assign({},Is(r.events,d)),n.add(d,0,[["exit",_,r]]),_=void 0),_}function $g(n,r,s,l,d){const _=[],f=Is(r.events,s);d&&(d.end=Object.assign({},f),_.push(["exit",d,r])),l.end=Object.assign({},f),_.push(["exit",l,r]),n.add(s+1,0,_)}function Is(n,r){const s=n[r],l=s[0]==="enter"?"start":"end";return s[1][l]}const qE={name:"tasklistCheck",tokenize:GE};function $E(){return{text:{91:qE}}}function GE(n,r,s){const l=this;return d;function d(c){return l.previous!==null||!l._gfmTasklistFirstContentOfListItem?s(c):(n.enter("taskListCheck"),n.enter("taskListCheckMarker"),n.consume(c),n.exit("taskListCheckMarker"),_)}function _(c){return ft(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"),o):s(c)}function o(c){return Le(c)?r(c):Ke(c)?n.check({tokenize:VE},r,s)(c):s(c)}}function VE(n,r,s){return Je(n,l,"whitespace");function l(d){return d===null?s(d):r(d)}}function KE(n){return R_([vE(),RE(),NE(n),UE(),$E()])}const WE={};function yv(n){const r=this,s=n||WE,l=r.data(),d=l.micromarkExtensions||(l.micromarkExtensions=[]),_=l.fromMarkdownExtensions||(l.fromMarkdownExtensions=[]),f=l.toMarkdownExtensions||(l.toMarkdownExtensions=[]);d.push(KE(s)),_.push(pE()),f.push(mE(s))}const YE=500,XE=3,QE=3e4,Ao=new Map;function nf(n,r){const s=Qe(n,r);if(!JE(r))return Ao.set(n,{consecutiveFailures:1,lastMessage:s,lastReportedAt:Date.now()}),s;const l=Ao.get(n),d=((l==null?void 0:l.consecutiveFailures)??0)+1,_=Date.now(),f=d>=XE&&(!l||l.lastMessage!==s||_-l.lastReportedAt>=QE);return Ao.set(n,{consecutiveFailures:d,lastMessage:s,lastReportedAt:f?_:(l==null?void 0:l.lastReportedAt)??0}),f?s:null}function Oo(n){Ao.delete(n),l1([n])}function JE(n){const r=No(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 Sv=1e3,Us=new Map;let Qa;function ZE(n,r,s){const l=Symbol(n),d=Math.max(Sv,s.intervalMs),_=Date.now();return Us.set(n,{id:n,intervalMs:d,nextRunAt:s.runImmediately===!1?_+d:_,inFlight:!1,run:r,token:l}),e2(),bv(),()=>{const f=Us.get(n);(f==null?void 0:f.token)===l&&(Us.delete(n),Us.size===0&&Qa!==void 0&&(window.clearInterval(Qa),Qa=void 0))}}function e2(){Qa!==void 0||typeof window>"u"||(Qa=window.setInterval(()=>{bv()},Sv))}async function bv(){const n=Date.now();for(const r of Us.values())r.inFlight||r.nextRunAt>n||t2(r)}async function t2(n){n.inFlight=!0;try{await n.run()}catch{}finally{const r=Us.get(n.id);(r==null?void 0:r.token)===n.token&&(r.inFlight=!1,r.nextRunAt=Date.now()+r.intervalMs)}}function tl(n,r,s){const l=te.useRef(r);te.useEffect(()=>{l.current=r},[r]),te.useEffect(()=>{if(!(!n||s.enabled===!1))return ZE(n,()=>l.current(),{intervalMs:s.intervalMs,runImmediately:s.runImmediately})},[n,s.enabled,s.intervalMs,s.runImmediately])}const Bo=`
85
+ `});return u(),p(),b+`
86
+ `+(d===1?"=":"-").repeat(b.length-(Math.max(b.lastIndexOf("\r"),b.lastIndexOf(`
87
+ `))+1))}const f="#".repeat(d),o=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=el(h.charCodeAt(0))+h.slice(1)),h=h?f+" "+h:f,s.options.closeAtx&&(h+=" "+f),c(),o(),h}tv.peek=zx;function tv(n){return n.value||""}function zx(){return"<"}nv.peek=Ix;function nv(n,r,s,l){const d=Zh(s),g=d==='"'?"Quote":"Apostrophe",f=s.enter("image");let o=s.enter("label");const c=s.createTracker(l);let h=c.move("![");return h+=c.move(s.safe(n.alt,{before:h,after:"]",...c.current()})),h+=c.move("]("),o(),!n.url&&n.title||/[\0- \u007F]/.test(n.url)?(o=s.enter("destinationLiteral"),h+=c.move("<"),h+=c.move(s.safe(n.url,{before:h,after:">",...c.current()})),h+=c.move(">")):(o=s.enter("destinationRaw"),h+=c.move(s.safe(n.url,{before:h,after:n.title?" ":")",...c.current()}))),o(),n.title&&(o=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),o()),h+=c.move(")"),f(),h}function Ix(){return"!"}iv.peek=Ux;function iv(n,r,s,l){const d=n.referenceType,g=s.enter("imageReference");let f=s.enter("label");const o=s.createTracker(l);let c=o.move("![");const h=s.safe(n.alt,{before:c,after:"]",...o.current()});c+=o.move(h+"]["),f();const p=s.stack;s.stack=[],f=s.enter("reference");const u=s.safe(s.associationId(n),{before:c,after:"]",...o.current()});return f(),s.stack=p,g(),d==="full"||!h||h!==u?c+=o.move(u+"]"):d==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function Ux(){return"!"}rv.peek=Px;function rv(n,r,s){let l=n.value||"",d="`",g=-1;for(;new RegExp("(^|[^`])"+d+"([^`]|$)").test(l);)d+="`";for(/[^ \r\n]/.test(l)&&(/^[ \r\n]/.test(l)&&/[ \r\n]$/.test(l)||/^`|`$/.test(l))&&(l=" "+l+" ");++g<s.unsafe.length;){const f=s.unsafe[g],o=s.compilePattern(f);let c;if(f.atBreak)for(;c=o.exec(l);){let h=c.index;l.charCodeAt(h)===10&&l.charCodeAt(h-1)===13&&h--,l=l.slice(0,h)+" "+l.slice(c.index+1)}}return d+l+d}function Px(){return"`"}function sv(n,r){const s=$h(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))}av.peek=Fx;function av(n,r,s,l){const d=Zh(s),g=d==='"'?"Quote":"Apostrophe",f=s.createTracker(l);let o,c;if(sv(n,s)){const p=s.stack;s.stack=[],o=s.enter("autolink");let u=f.move("<");return u+=f.move(s.containerPhrasing(n,{before:u,after:">",...f.current()})),u+=f.move(">"),o(),s.stack=p,u}o=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(")"),o(),h}function Fx(n,r,s){return sv(n,s)?"<":"["}lv.peek=qx;function lv(n,r,s,l){const d=n.referenceType,g=s.enter("linkReference");let f=s.enter("label");const o=s.createTracker(l);let c=o.move("[");const h=s.containerPhrasing(n,{before:c,after:"]",...o.current()});c+=o.move(h+"]["),f();const p=s.stack;s.stack=[],f=s.enter("reference");const u=s.safe(s.associationId(n),{before:c,after:"]",...o.current()});return f(),s.stack=p,g(),d==="full"||!h||h!==u?c+=o.move(u+"]"):d==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function qx(){return"["}function ef(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 $x(n){const r=ef(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 Gx(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 ov(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 Vx(n,r,s,l){const d=s.enter("list"),g=s.bulletCurrent;let f=n.ordered?Gx(s):ef(s);const o=n.ordered?f==="."?")":".":$x(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),ov(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=o),s.bulletCurrent=f;const h=s.containerFlow(n,l);return s.bulletLastUsed=f,s.bulletCurrent=g,d(),h}function Kx(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,l){const d=Kx(s);let g=s.bulletCurrent||ef(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 o=s.createTracker(l);o.move(g+" ".repeat(f-g.length)),o.shift(f);const c=s.enter("listItem"),h=s.indentLines(s.containerFlow(n,o.current()),p);return c(),h;function p(u,b,w){return b?(w?"":" ".repeat(f))+u:(w?g:g+" ".repeat(f-g.length))+u}}function Yx(n,r,s,l){const d=s.enter("paragraph"),g=s.enter("phrasing"),f=s.containerPhrasing(n,l);return g(),d(),f}const Xx=Uo(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Qx(n,r,s,l){return(n.children.some(function(f){return Xx(f)})?s.containerPhrasing:s.containerFlow).call(s,n,l)}function Jx(n){const r=n.options.strong||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize strong with `"+r+"` for `options.strong`, expected `*`, or `_`");return r}cv.peek=Zx;function cv(n,r,s,l){const d=Jx(s),g=s.enter("strong"),f=s.createTracker(l),o=f.move(d+d);let c=f.move(s.containerPhrasing(n,{after:d,before:o,...f.current()}));const h=c.charCodeAt(0),p=Mo(l.before.charCodeAt(l.before.length-1),h,d);p.inside&&(c=el(h)+c.slice(1));const u=c.charCodeAt(c.length-1),b=Mo(l.after.charCodeAt(0),u,d);b.inside&&(c=c.slice(0,-1)+el(u));const w=f.move(d+d);return g(),s.attentionEncodeSurroundingInfo={after:b.outside,before:p.outside},o+c+w}function Zx(n,r,s){return s.options.strong||"*"}function eE(n,r,s,l){return s.safe(n.value,l)}function tE(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 nE(n,r,s){const l=(ov(s)+(s.options.ruleSpaces?" ":"")).repeat(tE(s));return s.options.ruleSpaces?l.slice(0,-1):l}const uv={blockquote:Ex,break:Pg,code:Mx,definition:Ox,emphasis:ev,hardBreak:Pg,heading:Hx,html:tv,image:nv,imageReference:iv,inlineCode:rv,link:av,linkReference:lv,list:Vx,listItem:Wx,paragraph:Yx,root:Qx,strong:cv,text:eE,thematicBreak:nE};function iE(){return{enter:{table:rE,tableData:Fg,tableHeader:Fg,tableRow:aE},exit:{codeText:lE,table:sE,tableData:fh,tableHeader:fh,tableRow:fh}}}function rE(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 sE(n){this.exit(n),this.data.inTable=void 0}function aE(n){this.enter({type:"tableRow",children:[]},n)}function fh(n){this.exit(n)}function Fg(n){this.enter({type:"tableCell",children:[]},n)}function lE(n){let r=this.resume();this.data.inTable&&(r=r.replace(/\\([\\|])/g,oE));const s=this.stack[this.stack.length-1];s.type,s.value=r,this.exit(n)}function oE(n,r){return r==="|"?r:n}function cE(n){const r=n||{},s=r.tableCellPadding,l=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:o}};function f(w,R,E,v){return h(p(w,E,v),w.align)}function o(w,R,E,v){const y=u(w,E,v),_=h([y]);return _.slice(0,_.indexOf(`
90
+ `))}function c(w,R,E,v){const y=E.enter("tableCell"),_=E.enter("phrasing"),S=E.containerPhrasing(w,{...v,before:g,after:g});return _(),y(),S}function h(w,R){return wx(w,{align:R,alignDelimiters:l,padding:s,stringLength:d})}function p(w,R,E){const v=w.children;let y=-1;const _=[],S=R.enter("table");for(;++y<v.length;)_[y]=u(v[y],R,E);return S(),_}function u(w,R,E){const v=w.children;let y=-1;const _=[],S=R.enter("tableRow");for(;++y<v.length;)_[y]=c(v[y],w,R,E);return S(),_}function b(w,R,E){let v=uv.inlineCode(w,R,E);return E.stack.includes("tableCell")&&(v=v.replace(/\|/g,"\\$&")),v}}function uE(){return{exit:{taskListCheckValueChecked:qg,taskListCheckValueUnchecked:qg,paragraph:fE}}}function hE(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:dE}}}function qg(n){const r=this.stack[this.stack.length-2];r.type,r.checked=n.type==="taskListCheckValueChecked"}function fE(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 l=s.children[0];if(l&&l.type==="text"){const d=r.children;let g=-1,f;for(;++g<d.length;){const o=d[g];if(o.type==="paragraph"){f=o;break}}f===s&&(l.value=l.value.slice(1),l.value.length===0?s.children.shift():s.position&&l.position&&typeof l.position.start.offset=="number"&&(l.position.start.column++,l.position.start.offset++,s.position.start=Object.assign({},l.position.start)))}}this.exit(n)}function dE(n,r,s,l){const d=n.children[0],g=typeof n.checked=="boolean"&&d&&d.type==="paragraph",f="["+(n.checked?"x":" ")+"] ",o=s.createTracker(l);g&&o.move(f);let c=uv.listItem(n,r,s,{...l,...o.current()});return g&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),c;function h(p){return p+f}}function pE(){return[Vw(),dx(),_x(),iE(),uE()]}function mE(n){return{extensions:[Kw(),px(n),vx(),cE(n),hE()]}}const gE={tokenize:CE,partial:!0},hv={tokenize:wE,partial:!0},fv={tokenize:xE,partial:!0},dv={tokenize:EE,partial:!0},_E={tokenize:kE,partial:!0},pv={name:"wwwAutolink",tokenize:SE,previous:gv},mv={name:"protocolAutolink",tokenize:bE,previous:_v},Ii={name:"emailAutolink",tokenize:yE,previous:vv},mi={};function vE(){return{text:mi}}let $r=48;for(;$r<123;)mi[$r]=Ii,$r++,$r===58?$r=65:$r===91&&($r=97);mi[43]=Ii;mi[45]=Ii;mi[46]=Ii;mi[95]=Ii;mi[72]=[Ii,mv];mi[104]=[Ii,mv];mi[87]=[Ii,pv];mi[119]=[Ii,pv];function yE(n,r,s){const l=this;let d,g;return f;function f(u){return!Mh(u)||!vv.call(l,l.previous)||tf(l.events)?s(u):(n.enter("literalAutolink"),n.enter("literalAutolinkEmail"),o(u))}function o(u){return Mh(u)?(n.consume(u),o):u===64?(n.consume(u),c):s(u)}function c(u){return u===46?n.check(_E,p,h)(u):u===45||u===95||nn(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&&fn(l.previous)?(n.exit("literalAutolinkEmail"),n.exit("literalAutolink"),r(u)):s(u)}}function SE(n,r,s){const l=this;return d;function d(f){return f!==87&&f!==119||!gv.call(l,l.previous)||tf(l.events)?s(f):(n.enter("literalAutolink"),n.enter("literalAutolinkWww"),n.check(gE,n.attempt(hv,n.attempt(fv,g),s),s)(f))}function g(f){return n.exit("literalAutolinkWww"),n.exit("literalAutolink"),r(f)}}function bE(n,r,s){const l=this;let d="",g=!1;return f;function f(u){return(u===72||u===104)&&_v.call(l,l.previous)&&!tf(l.events)?(n.enter("literalAutolink"),n.enter("literalAutolinkHttp"),d+=String.fromCodePoint(u),n.consume(u),o):s(u)}function o(u){if(fn(u)&&d.length<5)return d+=String.fromCodePoint(u),n.consume(u),o;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||Ro(u)||ft(u)||Kr(u)||Ho(u)?s(u):n.attempt(hv,n.attempt(fv,p),s)(u)}function p(u){return n.exit("literalAutolinkHttp"),n.exit("literalAutolink"),r(u)}}function CE(n,r,s){let l=0;return d;function d(f){return(f===87||f===119)&&l<3?(l++,n.consume(f),d):f===46&&l===3?(n.consume(f),g):s(f)}function g(f){return f===null?s(f):r(f)}}function wE(n,r,s){let l,d,g;return f;function f(h){return h===46||h===95?n.check(dv,c,o)(h):h===null||ft(h)||Kr(h)||h!==45&&Ho(h)?c(h):(g=!0,n.consume(h),f)}function o(h){return h===95?l=!0:(d=l,l=void 0),n.consume(h),f}function c(h){return d||l||!g?s(h):r(h)}}function xE(n,r){let s=0,l=0;return d;function d(f){return f===40?(s++,n.consume(f),d):f===41&&l<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(dv,r,g)(f):f===null||ft(f)||Kr(f)?r(f):(n.consume(f),d)}function g(f){return f===41&&l++,n.consume(f),d}}function EE(n,r,s){return l;function l(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(n.consume(o),l):o===38?(n.consume(o),g):o===93?(n.consume(o),d):o===60||o===null||ft(o)||Kr(o)?r(o):s(o)}function d(o){return o===null||o===40||o===91||ft(o)||Kr(o)?r(o):l(o)}function g(o){return fn(o)?f(o):s(o)}function f(o){return o===59?(n.consume(o),l):fn(o)?(n.consume(o),f):s(o)}}function kE(n,r,s){return l;function l(g){return n.consume(g),d}function d(g){return nn(g)?s(g):r(g)}}function gv(n){return n===null||n===40||n===42||n===95||n===91||n===93||n===126||ft(n)}function _v(n){return!fn(n)}function vv(n){return!(n===47||Mh(n))}function Mh(n){return n===43||n===45||n===46||n===95||nn(n)}function tf(n){let r=n.length,s=!1;for(;r--;){const l=n[r][1];if((l.type==="labelLink"||l.type==="labelImage")&&!l._balanced){s=!0;break}if(l._gfmAutolinkLiteralWalkedInto){s=!1;break}}return n.length>0&&!s&&(n[n.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),s}const AE={tokenize:jE,partial:!0};function RE(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:LE,continuation:{tokenize:OE},exit:BE}},text:{91:{name:"gfmFootnoteCall",tokenize:ME},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:TE,resolveTo:DE}}}}function TE(n,r,s){const l=this;let d=l.events.length;const g=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let f;for(;d--;){const c=l.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 o;function o(c){if(!f||!f._balanced)return s(c);const h=si(l.sliceSerialize({start:f.end,end:l.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 DE(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 l={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)},o=[n[s+1],n[s+2],["enter",l,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",l,r]];return n.splice(s,n.length-s+1,...o),n}function ME(n,r,s){const l=this,d=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let g=0,f;return o;function o(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||ft(u))return s(u);if(u===93){n.exit("chunkString");const b=n.exit("gfmFootnoteCallString");return d.includes(si(l.sliceSerialize(b)))?(n.enter("gfmFootnoteCallLabelMarker"),n.consume(u),n.exit("gfmFootnoteCallLabelMarker"),n.exit("gfmFootnoteCall"),r):s(u)}return ft(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 LE(n,r,s){const l=this,d=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let g,f=0,o;return c;function c(R){return n.enter("gfmFootnoteDefinition")._container=!0,n.enter("gfmFootnoteDefinitionLabel"),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(R),n.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(R){return R===94?(n.enter("gfmFootnoteDefinitionMarker"),n.consume(R),n.exit("gfmFootnoteDefinitionMarker"),n.enter("gfmFootnoteDefinitionLabelString"),n.enter("chunkString").contentType="string",p):s(R)}function p(R){if(f>999||R===93&&!o||R===null||R===91||ft(R))return s(R);if(R===93){n.exit("chunkString");const E=n.exit("gfmFootnoteDefinitionLabelString");return g=si(l.sliceSerialize(E)),n.enter("gfmFootnoteDefinitionLabelMarker"),n.consume(R),n.exit("gfmFootnoteDefinitionLabelMarker"),n.exit("gfmFootnoteDefinitionLabel"),b}return ft(R)||(o=!0),f++,n.consume(R),R===92?u:p}function u(R){return R===91||R===92||R===93?(n.consume(R),f++,p):p(R)}function b(R){return R===58?(n.enter("definitionMarker"),n.consume(R),n.exit("definitionMarker"),d.includes(g)||d.push(g),Qe(n,w,"gfmFootnoteDefinitionWhitespace")):s(R)}function w(R){return r(R)}}function OE(n,r,s){return n.check(il,r,n.attempt(AE,r,s))}function BE(n){n.exit("gfmFootnoteDefinition")}function jE(n,r,s){const l=this;return Qe(n,d,"gfmFootnoteDefinitionIndent",5);function d(g){const f=l.events[l.events.length-1];return f&&f[1].type==="gfmFootnoteDefinitionIndent"&&f[2].sliceSerialize(f[1],!0).length===4?r(g):s(g)}}function NE(n){let s=(n||{}).singleTilde;const l={name:"strikethrough",tokenize:g,resolveAll:d};return s==null&&(s=!0),{text:{126:l},insideSpan:{null:[l]},attentionMarkers:{null:[126]}};function d(f,o){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,o],["enter",f[h][1],o],["exit",f[h][1],o],["enter",u,o]],w=o.parser.constructs.insideSpan.null;w&&Hn(b,b.length,0,zo(w,f.slice(h+1,c),o)),Hn(b,b.length,0,[["exit",u,o],["enter",f[c][1],o],["exit",f[c][1],o],["exit",p,o]]),Hn(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,o,c){const h=this.previous,p=this.events;let u=0;return b;function b(R){return h===126&&p[p.length-1][1].type!=="characterEscape"?c(R):(f.enter("strikethroughSequenceTemporary"),w(R))}function w(R){const E=qs(h);if(R===126)return u>1?c(R):(f.consume(R),u++,w);if(u<2&&!s)return c(R);const v=f.exit("strikethroughSequenceTemporary"),y=qs(R);return v._open=!y||y===2&&!!E,v._close=!E||E===2&&!!y,o(R)}}}class HE{constructor(){this.map=[]}add(r,s,l){zE(this,r,s,l)}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 l=[];for(;s>0;)s-=1,l.push(r.slice(this.map[s][0]+this.map[s][1]),this.map[s][2]),r.length=this.map[s][0];l.push(r.slice()),r.length=0;let d=l.pop();for(;d;){for(const g of d)r.push(g);d=l.pop()}this.map.length=0}}function zE(n,r,s,l){let d=0;if(!(s===0&&l.length===0)){for(;d<n.map.length;){if(n.map[d][0]===r){n.map[d][1]+=s,n.map[d][2].push(...l);return}d+=1}n.map.push([r,s,l])}}function IE(n,r){let s=!1;const l=[];for(;r<n.length;){const d=n[r];if(s){if(d[0]==="enter")d[1].type==="tableContent"&&l.push(n[r+1][1].type==="tableDelimiterMarker"?"left":"none");else if(d[1].type==="tableContent"){if(n[r-1][1].type==="tableDelimiterMarker"){const g=l.length-1;l[g]=l[g]==="left"?"center":"right"}}else if(d[1].type==="tableDelimiterRow")break}else d[0]==="enter"&&d[1].type==="tableDelimiterRow"&&(s=!0);r+=1}return l}function UE(){return{flow:{null:{name:"table",tokenize:PE,resolveAll:FE}}}}function PE(n,r,s){const l=this;let d=0,g=0,f;return o;function o(B){let H=l.events.length-1;for(;H>-1;){const Y=l.events[H][1].type;if(Y==="lineEnding"||Y==="linePrefix")H--;else break}const U=H>-1?l.events[H][1].type:null,P=U==="tableHead"||U==="tableRow"?D:c;return P===D&&l.parser.lazy[l.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):Le(B)?g>1?(g=0,l.interrupt=!0,n.exit("tableRow"),n.enter("lineEnding"),n.consume(B),n.exit("lineEnding"),w):s(B):Ke(B)?Qe(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||ft(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 w(B){return l.interrupt=!1,l.parser.lazy[l.now().line]?s(B):(n.enter("tableDelimiterRow"),f=!1,Ke(B)?Qe(n,R,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):R(B))}function R(B){return B===45||B===58?v(B):B===124?(f=!0,n.enter("tableCellDivider"),n.consume(B),n.exit("tableCellDivider"),E):L(B)}function E(B){return Ke(B)?Qe(n,v,"whitespace")(B):v(B)}function v(B){return B===58?(g+=1,f=!0,n.enter("tableDelimiterMarker"),n.consume(B),n.exit("tableDelimiterMarker"),y):B===45?(g+=1,y(B)):B===null||Le(B)?A(B):L(B)}function y(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"),S):(n.exit("tableDelimiterFiller"),S(B))}function S(B){return Ke(B)?Qe(n,A,"whitespace")(B):A(B)}function A(B){return B===124?R(B):B===null||Le(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"),T(B)}function T(B){return B===124?(n.enter("tableCellDivider"),n.consume(B),n.exit("tableCellDivider"),T):B===null||Le(B)?(n.exit("tableRow"),r(B)):Ke(B)?Qe(n,T,"whitespace")(B):(n.enter("data"),k(B))}function k(B){return B===null||B===124||ft(B)?(n.exit("data"),T(B)):(n.consume(B),B===92?M:k)}function M(B){return B===92||B===124?(n.consume(B),k):k(B)}}function FE(n,r){let s=-1,l=!0,d=0,g=[0,0,0,0],f=[0,0,0,0],o=!1,c=0,h,p,u;const b=new HE;for(;++s<n.length;){const w=n[s],R=w[1];w[0]==="enter"?R.type==="tableHead"?(o=!1,c!==0&&($g(b,r,c,h,p),p=void 0,c=0),h={type:"table",start:Object.assign({},R.start),end:Object.assign({},R.end)},b.add(s,0,[["enter",h,r]])):R.type==="tableRow"||R.type==="tableDelimiterRow"?(l=!0,u=void 0,g=[0,0,0,0],f=[0,s+1,0,0],o&&(o=!1,p={type:"tableBody",start:Object.assign({},R.start),end:Object.assign({},R.end)},b.add(s,0,[["enter",p,r]])),d=R.type==="tableDelimiterRow"?2:p?3:1):d&&(R.type==="data"||R.type==="tableDelimiterMarker"||R.type==="tableDelimiterFiller")?(l=!1,f[2]===0&&(g[1]!==0&&(f[0]=f[1],u=Co(b,r,g,d,void 0,u),g=[0,0,0,0]),f[2]=s)):R.type==="tableCellDivider"&&(l?l=!1:(g[1]!==0&&(f[0]=f[1],u=Co(b,r,g,d,void 0,u)),g=f,f=[g[1],s,0,0])):R.type==="tableHead"?(o=!0,c=s):R.type==="tableRow"||R.type==="tableDelimiterRow"?(c=s,g[1]!==0?(f[0]=f[1],u=Co(b,r,g,d,s,u)):f[1]!==0&&(u=Co(b,r,f,d,s,u)),d=0):d&&(R.type==="data"||R.type==="tableDelimiterMarker"||R.type==="tableDelimiterFiller")&&(f[3]=s)}for(c!==0&&$g(b,r,c,h,p),b.consume(r.events),s=-1;++s<r.events.length;){const w=r.events[s];w[0]==="enter"&&w[1].type==="table"&&(w[1]._align=IE(r.events,s))}return n}function Co(n,r,s,l,d,g){const f=l===1?"tableHeader":l===2?"tableDelimiter":"tableData",o="tableContent";s[0]!==0&&(g.end=Object.assign({},Is(r.events,s[0])),n.add(s[0],0,[["exit",g,r]]));const c=Is(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=Is(r.events,s[2]),p=Is(r.events,s[3]),u={type:o,start:Object.assign({},h),end:Object.assign({},p)};if(n.add(s[2],0,[["enter",u,r]]),l!==2){const b=r.events[s[2]],w=r.events[s[3]];if(b[1].end=Object.assign({},w[1].end),b[1].type="chunkText",b[1].contentType="text",s[3]>s[2]+1){const R=s[2]+1,E=s[3]-s[2]-1;n.add(R,E,[])}}n.add(s[3]+1,0,[["exit",u,r]])}return d!==void 0&&(g.end=Object.assign({},Is(r.events,d)),n.add(d,0,[["exit",g,r]]),g=void 0),g}function $g(n,r,s,l,d){const g=[],f=Is(r.events,s);d&&(d.end=Object.assign({},f),g.push(["exit",d,r])),l.end=Object.assign({},f),g.push(["exit",l,r]),n.add(s+1,0,g)}function Is(n,r){const s=n[r],l=s[0]==="enter"?"start":"end";return s[1][l]}const qE={name:"tasklistCheck",tokenize:GE};function $E(){return{text:{91:qE}}}function GE(n,r,s){const l=this;return d;function d(c){return l.previous!==null||!l._gfmTasklistFirstContentOfListItem?s(c):(n.enter("taskListCheck"),n.enter("taskListCheckMarker"),n.consume(c),n.exit("taskListCheckMarker"),g)}function g(c){return ft(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"),o):s(c)}function o(c){return Le(c)?r(c):Ke(c)?n.check({tokenize:VE},r,s)(c):s(c)}}function VE(n,r,s){return Qe(n,l,"whitespace");function l(d){return d===null?s(d):r(d)}}function KE(n){return R_([vE(),RE(),NE(n),UE(),$E()])}const WE={};function yv(n){const r=this,s=n||WE,l=r.data(),d=l.micromarkExtensions||(l.micromarkExtensions=[]),g=l.fromMarkdownExtensions||(l.fromMarkdownExtensions=[]),f=l.toMarkdownExtensions||(l.toMarkdownExtensions=[]);d.push(KE(s)),g.push(pE()),f.push(mE(s))}const YE=500,XE=3,QE=3e4,ko=new Map;function nf(n,r){const s=Je(n,r);if(!JE(r))return ko.set(n,{consecutiveFailures:1,lastMessage:s,lastReportedAt:Date.now()}),s;const l=ko.get(n),d=((l==null?void 0:l.consecutiveFailures)??0)+1,g=Date.now(),f=d>=XE&&(!l||l.lastMessage!==s||g-l.lastReportedAt>=QE);return ko.set(n,{consecutiveFailures:d,lastMessage:s,lastReportedAt:f?g:(l==null?void 0:l.lastReportedAt)??0}),f?s:null}function Lo(n){ko.delete(n),l1([n])}function JE(n){const r=jo(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 Sv=1e3,Us=new Map;let Qa;function ZE(n,r,s){const l=Symbol(n),d=Math.max(Sv,s.intervalMs),g=Date.now();return Us.set(n,{id:n,intervalMs:d,nextRunAt:s.runImmediately===!1?g+d:g,inFlight:!1,run:r,token:l}),e2(),bv(),()=>{const f=Us.get(n);(f==null?void 0:f.token)===l&&(Us.delete(n),Us.size===0&&Qa!==void 0&&(window.clearInterval(Qa),Qa=void 0))}}function e2(){Qa!==void 0||typeof window>"u"||(Qa=window.setInterval(()=>{bv()},Sv))}async function bv(){const n=Date.now();for(const r of Us.values())r.inFlight||r.nextRunAt>n||t2(r)}async function t2(n){n.inFlight=!0;try{await n.run()}catch{}finally{const r=Us.get(n.id);(r==null?void 0:r.token)===n.token&&(r.inFlight=!1,r.nextRunAt=Date.now()+r.intervalMs)}}function tl(n,r,s){const l=te.useRef(r);te.useEffect(()=>{l.current=r},[r]),te.useEffect(()=>{if(!(!n||s.enabled===!1))return ZE(n,()=>l.current(),{intervalMs:s.intervalMs,runImmediately:s.runImmediately})},[n,s.enabled,s.intervalMs,s.runImmediately])}const Oo=`
91
91
 
92
92
  --- Translation ---
93
- `;function n2({active:n=!0,autoSendEnabled:r,targetLanguage:s,taskSlug:l,role:d,sessionId:_}){const[f,o]=te.useState([]),[c,h]=te.useState([]),[p,u]=te.useState(""),[v,w]=te.useState(""),[R,E]=te.useState(!1),[y,S]=te.useState("ready"),[g,b]=te.useState(Date.now()),[A,L]=te.useState(!1),[,D]=wr(""),[T,k]=te.useState(0),M=te.useRef(n),B=te.useRef(1),H=te.useRef(null);te.useEffect(()=>{M.current=n},[n]);const U=te.useCallback(async()=>{try{const ae=await ye.pollTranslationSession(_,B.current);V(ae.events),B.current=ae.nextCursor,S(ae.status),Oo("Poll conversation translation events"),D(he=>Ro(he,["Poll conversation translation events"]))}catch(ae){const he=nf("Poll conversation translation events",ae);he&&D(he)}},[_]);tl(_?`translation-events:${_}`:null,U,{intervalMs:n?1e3:5e3,runImmediately:!1}),te.useEffect(()=>{o([]),h([]),D(""),S("ready"),B.current=1;let ae=!1;return ye.startTranslationSession(l,d).then(he=>{ae||(S(he.status),B.current=he.nextCursor,U())}).catch(he=>{ae||D(Qe("Start conversation translation session",he))}),()=>{ae=!0,ye.stopTranslationSession(_).catch(()=>{})}},[U,_,l,d]),te.useEffect(()=>{if(!n)return;const ae=H.current;if(!ae)return;const he=window.requestAnimationFrame(()=>{ae.scrollTop=ae.scrollHeight});return()=>window.cancelAnimationFrame(he)},[n,T]);const P=u2(f);te.useEffect(()=>{if(!P)return;b(Date.now());const ae=window.setInterval(()=>b(Date.now()),250);return()=>window.clearInterval(ae)},[P]);async function Y(ae=!1){const he=p;L(!0),D(""),E(!1);try{const W=await ye.translateUserInput(l,d,{text:he,mode:ae?"auto-send":"review-before-send",useContext:!1,send:ae});W.sent?(u(""),E(!1)):(u(Cv(he,W.englishPreview)),E(!0))}catch(W){D(Qe("Translate composer input",W))}finally{L(!1)}}async function X(){const ae=v.trim();if(ae){L(!0),D("");try{const he=await ye.translateManualOutput(l,d,{text:ae});o(W=>ph(mh(W,he)).entries),w(""),k(W=>W+1)}catch(he){D(Qe("Translate pasted English output",he))}finally{L(!1)}}}function V(ae){if(ae.length===0)return;for(const W of ae)W.type==="status"?S(W.status):W.type==="error"?D(Qe("Process translation session event",W.message)):W.type==="failures"&&h(W.failures);const he=ae.filter(W=>W.type==="entry");he.length>0&&(o(W=>{const q=he.reduce((ee,le)=>mh(ee,le.entry),W),ie=ph(q);return ie.removedIds.size>0&&h(ee=>ee.filter(le=>!ie.removedIds.has(le.translationId))),ie.entries}),k(W=>W+1))}async function K(){const ae=R?Vg(p):p;if(ae.trim()){L(!0),D("");try{await ye.sendTranslatedInput(l,d,{englishText:ae}),u(""),E(!1)}catch(he){D(Qe("Send translated English input to role",he))}finally{L(!1)}}}function ne(ae){ae.key!=="Enter"||ae.shiftKey||ae.nativeEvent.isComposing||(ae.preventDefault(),!A&&p.trim()&&(R?K():Y(r)))}async function z(){o([]),h([]),B.current=1,await ye.clearTranslationSession(_).catch(ae=>D(Qe("Clear conversation translation panel",ae)))}async function j(){L(!0),D("");try{const ae=await ye.ignoreTranslationFailures(_);h(ae.failures)}catch(ae){D(Qe("Ignore failed conversation translations",ae))}finally{L(!1)}}async function N(ae){L(!0),D("");try{const he=await ye.retryTranslation(_,ae.translationId);o(W=>ph(mh(W,he)).entries),k(W=>W+1)}catch(he){D(Qe("Retry latest failed conversation translation",he))}finally{L(!1)}}const $=h2(f,y,g),I=c.length,se=r2(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 ",i2(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(o2,{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:v,onChange:ae=>w(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||!v.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()||R&&!p2(ae.target.value))&&E(!1)},onKeyDown:ne,placeholder:"输入中文,先翻译成英文工程指令..."}),x.jsx("div",{className:"translation-composer-actions",children:x.jsx("button",{type:"button",disabled:A||!R||!Vg(p).trim(),onClick:()=>void K(),children:"Send English"})})]})]})]})}function i2(n){var r;return((r=o_.find(s=>s.value===n))==null?void 0:r.label)??n}function r2(n){let r,s=Number.NEGATIVE_INFINITY;for(const l of n){const d=Date.parse(l.failedAt),_=Number.isFinite(d)?d:Number.NEGATIVE_INFINITY;(!r||_>=s)&&(r=l,s=_)}return r}function s2({open:n,taskSlug:r,targetLanguage:s,onClose:l}){const[d,_]=te.useState(!1),[,f]=wr(""),[o,c]=te.useState(null),[h,p]=te.useState(""),[u,v]=te.useState(""),[w,R]=te.useState(""),[E,y]=te.useState(!1),[S,g]=te.useState(null),[b,A]=te.useState(""),[L,D]=te.useState(""),[T,k]=te.useState(""),[M,B]=te.useState(!1);tl(n?`file-translation:${h||"none"}`:null,()=>H(!0),{intervalMs:2e3,runImmediately:!0});async function H(V=!1){try{const K=await ye.getTranslationState();c(K);const ne=h?K.fileIndex.jobs.some(z=>z.id===h):!1;if((!h||!ne)&&K.fileIndex.jobs[0])U(K.fileIndex.jobs[0].id);else if(!K.fileIndex.jobs[0])p(""),v(""),R("");else if(V&&h){const z=await ye.readFileTranslation(h);v(z.output),R(z.report)}}catch(K){f(Qe("Load file translation list",K))}}async function U(V){p(V),v(""),R("");try{const K=await ye.readFileTranslation(V);v(K.output),R(K.report)}catch(K){f(Qe(`Read translated file ${V}`,K))}}async function P(){y(!0),await Y(b,L)}async function Y(V="",K=""){B(!0),f("");try{const ne=await ye.browseTranslationSourceFiles({path:V,query:K,limit:250});g(ne),A(ne.currentPath),D(K)}catch(ne){f(Qe("Browse translation source files",ne))}finally{B(!1)}}async function X(V=T){const K=V.trim();if(K){_(!0),f("");try{if(!r)throw new Error("Create or select a task before translating files.");const ne=await ye.createFileTranslation({taskSlug:r,sourcePath:K,targetLanguage:s});y(!1),await H(),await U(ne.id)}catch(ne){f(Qe(`Create file translation for ${K}`,ne))}finally{_(!1)}}}return n?x.jsxs(x.Fragment,{children:[x.jsx("div",{className:"modal-backdrop file-translation-backdrop",children:x.jsx(l2,{busy:d,state:o,selectedJobId:h,output:u,report:w,onClose:()=>{y(!1),l()},onRefresh:()=>void H(),onSelectJob:V=>void U(V),onTranslate:()=>void P()})}),E?x.jsx(a2,{busy:d||M,state:S,currentPath:b,query:L,selectedPath:T,onBrowse:(V,K)=>void Y(V,K),onClose:()=>y(!1),onQueryChange:D,onSelectPath:k,onTranslate:()=>void X()}):null]}):null}function a2({busy:n,state:r,currentPath:s,query:l,selectedPath:d,onBrowse:_,onClose:f,onQueryChange:o,onSelectPath:c,onTranslate:h}){const p=(r==null?void 0:r.entries)??[],u=p.filter(w=>w.type==="directory"),v=p.filter(w=>w.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:()=>_((r==null?void 0:r.parentPath)??"",""),children:"Up"}),x.jsx("button",{type:"button",disabled:n||!s,onClick:()=>_("",""),children:"Root"})]}),x.jsxs("form",{className:"translation-file-browser-search",onSubmit:w=>{w.preventDefault(),_(s,l)},children:[x.jsx("input",{value:l,onChange:w=>o(w.target.value),placeholder:"Search files"}),x.jsx("button",{type:"submit",disabled:n,children:"Search"}),x.jsx("button",{type:"button",disabled:n||!l,onClick:()=>_(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(w=>x.jsx(Gg,{entry:w,selected:d===w.path,onBrowse:_,onSelectPath:c},w.path))]}):null,v.length>0?x.jsxs("div",{className:"translation-file-browser-group",children:[x.jsx("h3",{children:"Files"}),v.map(w=>x.jsx(Gg,{entry:w,selected:d===w.path,onBrowse:_,onSelectPath:c},w.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:w=>c(w.target.value)})]}),x.jsx("button",{type:"button",disabled:n||!d.trim(),onClick:h,children:"Translate File"})]})]})]})})}function Gg({entry:n,selected:r,onBrowse:s,onSelectPath:l}){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,""):l(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 l2({busy:n,state:r,selectedJobId:s,output:l,report:d,onClose:_,onRefresh:f,onSelectJob:o,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:_,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:()=>o(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(Y_,{remarkPlugins:[yv],children:l||d||"Translation output is not available yet."})})]}):x.jsx("p",{className:"muted",children:"Select a translated file to preview it."})})]})]})}function o2({entry:n}){if(n.sourceKind==="conversation-boundary")return x.jsx(c2,{entry:n});const r=d2(n),s=n.sourceKind==="tool-output",l=n.direction==="user-input-to-english",d=["translation-entry",`is-${n.sourceKind}`,l?"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(Y_,{remarkPlugins:[yv],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 c2({entry:n}){const r=n.boundaryKind==="end"?"结束":"开始",s=n.conversationTurn??0,l=g2(n.occurredAt??n.createdAt);return x.jsxs("div",{className:"translation-conversation-boundary","aria-label":`${r} 第 ${s} 轮 ${l}`,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:l}),x.jsx("span",{className:"translation-boundary-dash","aria-hidden":"true"})]})}function u2(n){const r=n.find(rf);return(r==null?void 0:r.translationStartedAt)??(r==null?void 0:r.createdAt)}function h2(n,r,s){const l=n.find(rf);if(l)return`translating ${m2(Math.max(0,s-f2(l)))}`;const d=n.at(-1);return(d==null?void 0:d.status)==="failed"||r==="failed"?"error":r}function rf(n){return n.status==="queued"||n.status==="translating"}function ph(n){const r=n.length-YE;if(r<=0)return{entries:n,removedIds:new Set};const s=new Set;for(const l of n){if(s.size>=r)break;rf(l)||s.add(l.id)}return s.size===0?{entries:n,removedIds:s}:{entries:n.filter(l=>!s.has(l.id)),removedIds:s}}function f2(n){const r=Date.parse(n.translationStartedAt??n.createdAt);return Number.isFinite(r)?r:Date.now()}function d2(n){return n.status==="queued"||n.status==="translating"?n.sourceText:n.status==="translated"?n.direction==="user-input-to-english"?Cv(n.sourceText,n.translatedText):n.translatedText:n.translatedText||n.sourceText}function Cv(n,r){return`${n.trimEnd()}${Bo}${r.trimStart()}`}function p2(n){return n.includes(Bo)}function Vg(n){const r=n.indexOf(Bo);return r===-1?n:n.slice(r+Bo.length)}function mh(n,r){return n.findIndex(l=>l.id===r.id)===-1?[...n,r]:n.map(l=>l.id===r.id?r:l)}function m2(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),l=Math.floor(r%60).toString().padStart(2,"0");return`${s}:${l}`}function g2(n){const r=new Date(n);return Number.isNaN(r.getTime())?n:r.toLocaleTimeString()}const _2=8;function v2(){const[n,r]=te.useState([]);return te.useEffect(()=>{const s=_=>{var c,h;const f=(h=(c=_.detail)==null?void 0:c.message)==null?void 0:h.trim();if(!f)return;const o=new Date().toISOString();r(p=>{const u=p.find(v=>v.message===f);return u?[{...u,count:u.count+1,updatedAt:o},...p.filter(v=>v.id!==u.id)]:[{id:`ui_error_${Date.now()}_${Math.random().toString(16).slice(2)}`,message:f,count:1,createdAt:o,updatedAt:o},...p].slice(0,_2)})},l=_=>{var o;const f=((o=_.detail)==null?void 0:o.actions)??[];f.length!==0&&r(c=>c.filter(h=>!f.some(p=>h.message.startsWith(`${p} failed.`))))},d=_=>{var o,c;const f=(c=(o=_.detail)==null?void 0:o.message)==null?void 0:c.trim();f&&r(h=>h.filter(p=>p.message!==f))};return window.addEventListener(gh,s),window.addEventListener(_h,l),window.addEventListener(vh,d),()=>{window.removeEventListener(gh,s),window.removeEventListener(_h,l),window.removeEventListener(vh,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:[y2(s.updatedAt),s.count>1?` · repeated ${s.count} times`:""]})]}),x.jsx("button",{type:"button","aria-label":"Dismiss error",onClick:()=>r(l=>l.filter(d=>d.id!==s.id)),children:"Close"})]},s.id))})]})}function y2(n){return new Date(n).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function S2(n,r){return n.find(s=>s.taskSlug===r)??n[0]??null}function b2(n,r){const s=Fs.map(l=>({role:l.name,permissionMode:n.roles[l.name].permissionMode,model:n.roles[l.name].model,effort:n.roles[l.name].effort}));if(r.gateReviewerEnabled){const l=n.roles["gate-reviewer"];s.push({role:"gate-reviewer",permissionMode:l.permissionMode,model:l.model,effort:l.effort})}return s}const C2=["architecture-plan","validation-adequacy","final-diff"];function w2({events:n,maxEvents:r=8,showHeader:s=!0}){const l=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:l.map((d,_)=>x.jsx("li",{children:d},`${d}-${_}`))})]})}function mi({checked:n,className:r,disabled:s,label:l,stateLabel:d,title:_,onChange:f}){const o=["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":`${l}: ${c}`,className:o,disabled:s,title:_,onClick:()=>f(!n),children:[x.jsx("span",{className:"switch-control-label",children:l}),x.jsx("span",{className:"switch-control-track","aria-hidden":"true",children:x.jsx("span",{className:"switch-control-thumb"})})]})}function x2({status:n,bootstrapStatus:r,applyResult:s,hasActiveTask:l=!1,autoTaskHarnessReviewEnabled:d,busy:_=!1,onRefresh:f,onApply:o,onOpenStudio:c,onOpenRepositoryDiff:h,onAutoTaskHarnessReviewChange:p,onStartBootstrap:u,onRestartBootstrap:v,onStopBootstrap:w,onRunBootstrap:R}){const[E,y]=te.useState(!1),[S,g]=te.useState("bypassPermissions"),[b,A]=te.useState("default"),[L,D]=te.useState("default"),T=r==null?void 0:r.session,k=(r==null?void 0:r.status)==="running",M=(T==null?void 0:T.status)==="running",B=(r==null?void 0:r.status)!=="complete",H={permissionMode:S,model:b,effort:L};return l?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:_,onClick:()=>void f(),children:"Refresh"}),n.needsApply?x.jsx("button",{type:"button",disabled:_,onClick:()=>void o(),children:"Update"}):null]}):x.jsx("button",{type:"button",disabled:_,onClick:()=>void o(),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(zi,{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:_,onClick:c,children:"Open Studio"})})]}),x.jsx("button",{className:"harness-review-diff-button",type:"button",disabled:_,onClick:h,children:"Review Diff"}),x.jsx(mi,{checked:d,className:"sidebar-switch",disabled:_,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?E2(r.status):"not loaded"})]}),x.jsx("div",{className:"harness-actions",children:x.jsx("button",{type:"button",disabled:_||!(r!=null&&r.canStart),onClick:()=>{y(!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:(T==null?void 0:T.command)??"Start Harness Engineer, then run bootstrap when ready."})]}),x.jsxs("div",{className:"harness-bootstrap-modal-actions",children:[T?x.jsx(zi,{status:T.status}):null,x.jsx("button",{type:"button",onClick:()=>y(!1),children:"Close"})]})]}),x.jsxs("div",{className:"harness-bootstrap-controls",children:[x.jsxs("label",{children:[x.jsx("span",{children:"Permission"}),x.jsx("select",{value:S,disabled:_||k||M,onChange:U=>g(U.target.value),children:u_.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:b,disabled:_||k||M,onChange:U=>A(U.target.value),children:h_.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:_||k||M,onChange:U=>D(U.target.value),children:f_.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:_||k||!(r!=null&&r.canStart),onClick:()=>void u(H),children:"Start"}),x.jsx("button",{type:"button",disabled:_||k||!(r!=null&&r.canStart),onClick:()=>void v(H),children:"Restart"}),x.jsx("button",{type:"button",disabled:_||!T,onClick:()=>void w(),children:"Stop"}),x.jsx("button",{type:"button",disabled:_||k||!M,onClick:()=>void R(),children:"Run bootstrap"})]})]}),x.jsx("div",{className:"harness-bootstrap-terminal",children:M?x.jsx(Ho,{sessionId:T.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 E2(n){return n.replaceAll("_"," ")}function sf(n){return{total:n.length,accepted:n.filter(r=>r.acceptedAt).length,delivered:n.filter(r=>r.deliveredAt).length}}function k2(n,r=6){const s=[...n].sort(T2).map((d,_)=>({message:d,sequence:_+1}));return[...r===null?s:s.slice(-r)].sort((d,_)=>_.sequence-d.sequence)}function A2({messages:n,orchestration:r,busy:s,maxMessages:l=6,showControls:d=!0,showHeader:_=!0,onModeChange:f,onMarkAllDone:o}){const[c,h]=te.useState(null),p=sf(n),u=(r==null?void 0:r.mode)??"auto",v=k2(n,l);async function w(R){await D2(R.body),h(R.id),window.setTimeout(()=>h(E=>E===R.id?null:E),1200)}return x.jsxs("section",{className:"message-panel",children:[_?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(mi,{checked:u==="auto",className:"message-mode-toggle",disabled:s,label:"Auto orchestration",onChange:R=>f(R?"auto":"manual")})}):null,d&&o?x.jsx("button",{type:"button",disabled:s,onClick:o,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:v.map(({message:R,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:jo(R),children:R2(jo(R))}),x.jsxs("strong",{children:[R.fromRole," ","->"," ",R.toRole]}),x.jsx("span",{children:R.type})]}),x.jsx("p",{children:R.body}),R.failureReason?x.jsx("span",{className:"message-reason",children:R.failureReason}):null,R.bodyPath?x.jsx("span",{className:"message-path",children:R.bodyPath}):null]}),x.jsx("div",{className:"message-actions",children:x.jsx("button",{type:"button",disabled:s,onClick:()=>void w(R),children:c===R.id?"Copied":"Copy"})})]},R.id))})]})}function R2(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 jo(n){return n.acceptedAt??n.deliveredAt??n.dispatchingAt??n.createdAt}function T2(n,r){const s=jo(n).localeCompare(jo(r));if(s!==0)return s;const l=n.createdAt.localeCompare(r.createdAt);return l!==0?l:n.id.localeCompare(r.id)}async function D2(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 M2({defaultPath:n="",recentPaths:r=[],busy:s=!1,onConnect:l}){const[d,_]=te.useState(n);te.useEffect(()=>{n&&_(n)},[n]);async function f(o){o.preventDefault(),await l(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:o=>_(o.target.value),placeholder:"/path/to/repo"}),r.length>0?x.jsxs("select",{"aria-label":"Recent repositories",className:"repo-recent-select",value:"",onChange:o=>{o.target.value&&_(o.target.value)},children:[x.jsx("option",{value:"",children:"Recent"}),r.map(o=>x.jsx("option",{value:o,children:o},o))]}):null,x.jsx("button",{type:"submit",disabled:s||!d.trim(),children:"Connect"})]})})}function L2({tasks:n,activeTaskSlug:r,onSelect:s}){return x.jsx("nav",{className:"task-nav","aria-label":"Tasks",children:n.map(l=>x.jsxs("button",{className:l.taskSlug===r?"task-nav-item is-active":"task-nav-item",type:"button",onClick:()=>s(l.taskSlug),children:[x.jsx("span",{children:l.title||l.taskSlug}),x.jsx(zi,{status:l.status})]},l.taskSlug))})}function O2({project:n,recentRepositoryPaths:r,tasks:s,activeTaskSlug:l,messages:d,orchestration:_,events:f,roundState:o,gateReview:c,translationEnabled:h,translationAutoSendEnabled:p,translationTargetLanguage:u,translationOutputMode:v,translationMemoryInitialized:w,translatorSession:R,harnessStatus:E,harnessBootstrapStatus:y,harnessApplyResult:S,autoTaskHarnessReviewEnabled:g,gatewayStatus:b,gatewayQrLogin:A,gatewayQrCheck:L,gatewayLarkRegistration:D,gatewayLarkRegistrationCheck:T,busy:k,onConnect:M,onRefreshConnectedRepository:B,onPullConnectedRepository:H,onRefreshHarness:U,onApplyHarness:P,onStartHarnessBootstrap:Y,onRestartHarnessBootstrap:X,onStopHarnessBootstrap:V,onRunHarnessBootstrap:K,onOpenHarnessStudio:ne,onOpenRepositoryDiff:z,onAutoTaskHarnessReviewChange:j,onRefreshGateway:N,onGatewayEnabledChange:$,onGatewaySettingsChange:I,onGatewayTranslationChange:se,onCreateGatewayPairingCode:ae,onStartGatewayQrLogin:he,onStartGatewayLarkRegistration:W,onResetGatewayBinding:q,onGateReviewGateEnabledChange:ie,onTranslationEnabledChange:ee,onTranslationAutoSendChange:le,onTranslationTargetLanguageChange:ve,onTranslationOutputModeChange:De,onOpenFileTranslation:Ne,onOpenTranslatorSession:Be,onCreateTranslationBootstrap:ct,onUpdateTranslationMemory:ke,onCreateTask:Gt,onCloseTask:rn,onSelectTask:Vt,themeMode:Kt,onAutoOrchestrationChange:xn,onThemeModeChange:xt,pauseAlertSound:it,onPauseAlertSoundChange:Ot,roleRetryEnabled:pe,onRoleRetryEnabledChange:Se,permissionRequestMode:Ae,onPermissionRequestModeChange:je,launchTemplate:He,canSaveLaunchTemplate:mt,canOneClickStart:qe,onSaveLaunchTemplate:bt,onOneClickStart:yt,onMarkAllMessagesDone:Bt,onDeleteMessageHistory:tt}){const[sn,we]=te.useState(""),[Wt,Nn]=te.useState(!1),[ai,Hn]=te.useState(!1),[jt,zn]=te.useState(()=>l?null:"repository"),Qn=sf(d),Ee=sn.trim(),Yt=H2(n,l,E),In=s.filter(Ie=>Ie.cleanupStatus!=="cleaned"),fn=In.find(Ie=>Ie.taskSlug===l)??null;te.useEffect(()=>{zn(Ie=>!l&&Ie===null?n?"task":"repository":Ie)},[l,n]);function dn(Ie,Pi){zn(Pi?Ie:null)}async function Ui(Ie){Ie.preventDefault(),await Gt({taskSlug:Ee}),we("")}return x.jsxs("div",{className:"project-dashboard",children:[x.jsx("header",{className:"brand-header",children:x.jsx("strong",{children:"VibeCodingMaster"})}),x.jsx(Kr,{title:"Repository",open:jt==="repository",onOpenChange:Ie=>{dn("repository",Ie),Ie&&n&&B()},children:x.jsxs("div",{className:"repository-panel",children:[x.jsx(M2,{defaultPath:(n==null?void 0:n.repoRoot)??"",recentPaths:r,busy:k,onConnect:M}),n?x.jsx(P2,{busy:k,project:n,onPull:H}):null]})}),x.jsx(Kr,{title:"Settings",open:jt==="settings",onOpenChange:Ie=>dn("settings",Ie),children:x.jsxs("div",{className:"sidebar-settings",children:[x.jsxs("button",{"aria-label":`Theme mode: ${Wg(Kt)}`,className:"settings-toggle theme-mode-toggle",disabled:k,title:"Cycle theme: system, light, dark",type:"button",onClick:()=>xt(V2(Kt)),children:[x.jsx("span",{children:"Theme"}),x.jsx("span",{children:Wg(Kt)})]}),x.jsx(mi,{checked:((_==null?void 0:_.mode)??"auto")==="auto",className:"sidebar-switch",disabled:k||!l,label:"Auto orchestration",title:l?"Automatically dispatch role messages during the active task":"Create or select a task first",onChange:xn}),x.jsx(mi,{checked:it,className:"sidebar-switch",disabled:k,label:"Pause alert sound",title:"Play a sound when VCM shows the fixed flow pause dialog",onChange:Ie=>Ot(Ie)}),x.jsx(mi,{checked:pe,className:"sidebar-switch",disabled:k,label:"CC auto retry",title:"Retry temporary Claude Code turn failures before showing the flow pause alert",onChange:Ie=>Se(Ie)}),x.jsxs("label",{className:"settings-select-row",children:[x.jsx("span",{children:"Permission requests"}),x.jsxs("select",{value:Ae,disabled:k,onChange:Ie=>je(Ie.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||!mt,title:"Save the current core role launch settings and optional Gate Reviewer settings",type:"button",onClick:bt,children:[x.jsx("span",{children:"Save launch template"}),x.jsx("span",{children:mt?"ready":"open task"})]}),qe?x.jsxs("button",{className:"settings-toggle is-active",disabled:k,title:B2(He),type:"button",onClick:yt,children:[x.jsx("span",{children:"One-click start"}),x.jsx("span",{children:wv(He)})]}):null,l?x.jsxs(x.Fragment,{children:[x.jsxs("button",{type:"button",onClick:()=>Nn(!0),children:[x.jsx("span",{children:"Messages"}),x.jsxs("span",{className:"muted",children:[Qn.total," total"]})]}),x.jsxs("button",{type:"button",onClick:()=>Hn(!0),children:[x.jsx("span",{children:"Events"}),x.jsxs("span",{className:"muted",children:[f.length," total"]})]})]}):null]})}),x.jsx(Kr,{title:"Translation",open:jt==="translation",onOpenChange:Ie=>dn("translation",Ie),children:x.jsx(j2,{busy:k,enabled:h,autoSendEnabled:p,targetLanguage:u,outputMode:v,memoryInitialized:w,baseUnavailableReason:Yt,translatorSession:R,onAutoSendChange:le,onCreateBootstrap:ct,onEnabledChange:ee,onUpdateMemory:ke,onTargetLanguageChange:ve,onOutputModeChange:De,onOpenFileTranslation:Ne,onOpenTranslatorSession:Be})}),n&&l?x.jsx(Kr,{title:"Gate Review Gates",open:jt==="gate-review-gates",onOpenChange:Ie=>dn("gate-review-gates",Ie),children:x.jsx(z2,{busy:k,state:c,onGateEnabledChange:ie})}):null,x.jsx(Kr,{title:"Gateway",open:jt==="gateway",onOpenChange:Ie=>{dn("gateway",Ie),Ie&&N()},children:x.jsx(U2,{busy:k,qrCheck:L,qrLogin:A,larkRegistration:D,larkRegistrationCheck:T,status:b,onEnabledChange:$,onSettingsChange:I,onCreatePairingCode:ae,onResetBinding:q,onStartLarkRegistration:W,onStartQrLogin:he,onTranslationChange:se})}),n?x.jsx(Kr,{title:"VCM Harness",open:jt==="vcm-harness",onOpenChange:Ie=>dn("vcm-harness",Ie),children:x.jsx(x2,{status:E,bootstrapStatus:y,applyResult:S,hasActiveTask:!!fn,autoTaskHarnessReviewEnabled:g,busy:k,onRefresh:U,onApply:P,onOpenStudio:ne,onOpenRepositoryDiff:z,onAutoTaskHarnessReviewChange:j,onStartBootstrap:Y,onRestartBootstrap:X,onStopBootstrap:V,onRunBootstrap:K})}):null,n?x.jsx(Kr,{title:"Task",open:jt==="task",onOpenChange:Ie=>dn("task",Ie),children:In.length>0?x.jsxs("div",{className:"task-panel",children:[x.jsx(L2,{tasks:In,activeTaskSlug:l,onSelect:Vt}),fn?x.jsx("div",{className:"task-panel-actions",children:x.jsx("button",{className:"danger-button",disabled:k,type:"button",onClick:rn,children:"Close Task"})}):null]}):x.jsx("div",{className:"task-create",children:x.jsxs("form",{onSubmit:Ui,children:[x.jsx("input",{value:sn,onChange:Ie=>we(Ie.target.value),placeholder:"task name"}),x.jsxs("div",{className:"task-create-preview",children:[x.jsxs("small",{children:["branch: ",Ee?`feature/${Ee}`:"feature/<task>"]}),x.jsxs("small",{children:["worktree: ",Ee?`.claude/worktrees/${Ee}`:".claude/worktrees/<task>"]})]}),x.jsx("button",{type:"submit",disabled:k||!Ee,children:"Create"})]})})}):null,n&&fn?x.jsx($2,{task:fn,roundState:o}):null,Wt?x.jsx(W2,{busy:k,messages:d,orchestration:_,onClose:()=>Nn(!1),onMarkAllDone:()=>{l&&Bt(l)},onDeleteMessageHistory:()=>{l&&tt(l)}}):null,ai?x.jsx(K2,{events:f,onClose:()=>Hn(!1)}):null]})}function wv(n){return[n.autoOrchestration?"auto":"manual"].join(" + ")}function B2(n){const r=Object.entries(n.roles).map(([s,l])=>`${s}: ${l.permissionMode} / ${l.model} / ${l.effort}`).join("; ");return`Launch template: ${wv(n)}; ${r}`}function j2({autoSendEnabled:n,baseUnavailableReason:r,busy:s,enabled:l,memoryInitialized:d,outputMode:_,targetLanguage:f,translatorSession:o,onAutoSendChange:c,onCreateBootstrap:h,onEnabledChange:p,onUpdateMemory:u,onOutputModeChange:v,onTargetLanguageChange:w,onOpenFileTranslation:R,onOpenTranslatorSession:E}){const y=!!(s||r),S=(o==null?void 0:o.status)==="running",g=!!(l&&!r&&S),b=r??(S?null:"Start Translator session first."),A=!!(s||b),D=r??"Open Translator session",T=b??"Translation tools are ready";return x.jsxs("div",{className:"sidebar-settings",children:[x.jsx(mi,{checked:g,className:"sidebar-switch",disabled:y||!S,label:"Conversation translation",title:T,onChange:p}),x.jsx(mi,{checked:n,className:"sidebar-switch",disabled:y,label:"Auto-send",onChange:c}),x.jsxs("label",{className:"settings-select-row",children:[x.jsx("span",{children:"Language"}),x.jsx("select",{value:f,disabled:y,onChange:k=>w(k.target.value),children:o_.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:_,disabled:y,onChange:k=>v(k.target.value),children:Q0.map(k=>x.jsx("option",{value:k.value,children:k.label},k.value))})]}),x.jsxs("button",{className:"settings-toggle",disabled:A,title:T,type:"button",onClick:R,children:[x.jsx("span",{children:"File translation"}),x.jsx("span",{children:"open"})]}),d?null:x.jsxs("button",{className:"settings-toggle",disabled:A,title:T,type:"button",onClick:h,children:[x.jsx("span",{children:"Bootstrap"}),x.jsx("span",{children:"run"})]}),x.jsxs("button",{className:"settings-toggle",disabled:A,title:T,type:"button",onClick:u,children:[x.jsx("span",{children:"Update memory"}),x.jsx("span",{children:"run"})]}),b?x.jsx("p",{className:"settings-help-text",children:b}):null,x.jsxs("div",{className:"settings-status-row",children:[x.jsx("span",{children:"Session status"}),x.jsx("strong",{children:N2(o)})]}),x.jsxs("button",{className:"settings-toggle",disabled:y,title:D,type:"button",onClick:E,children:[x.jsx("span",{children:"Open Session"}),x.jsx("span",{children:"open"})]})]})}function N2(n){return n?n.status==="running"?n.activityStatus??"idle":n.status:"not started"}function H2(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 z2({busy:n,onGateEnabledChange:r,state:s}){return x.jsx("div",{className:"sidebar-settings",children:C2.map(l=>{const d=s==null?void 0:s.gates[l],_=!!(d!=null&&d.required);return x.jsx(mi,{checked:_,className:"sidebar-switch",disabled:n||!s,label:I2(l),title:d!=null&&d.status?`status: ${d.status}`:void 0,onChange:f=>r(l,f)},l)})})}function I2(n){switch(n){case"architecture-plan":return"Architecture plan";case"validation-adequacy":return"Validation adequacy";case"final-diff":return"Final diff"}return n}function U2({busy:n,larkRegistration:r,larkRegistrationCheck:s,onCreatePairingCode:l,onEnabledChange:d,onResetBinding:_,onSettingsChange:f,onStartLarkRegistration:o,onStartQrLogin:c,onTranslationChange:h,qrCheck:p,qrLogin:u,status:v}){const[w,R]=te.useState(null),E=(v==null?void 0:v.channel)==="lark",y=(v==null?void 0:v.channel)==="lark"?!!(v.binding.appIdConfigured&&v.binding.appSecretConfigured):!!(v!=null&&v.binding.tokenConfigured),S=(v==null?void 0:v.channel)==="lark"?!!v.binding.boundUserId:!!(v!=null&&v.binding.tokenConfigured);return te.useEffect(()=>{R(null)},[v==null?void 0:v.channel,v==null?void 0:v.binding.appIdConfigured,v==null?void 0:v.binding.appSecretConfigured]),x.jsxs("div",{className:"gateway-panel",children:[x.jsxs("label",{className:"compact-field",children:[x.jsx("span",{children:"Channel"}),x.jsxs("select",{disabled:n||!v,value:(v==null?void 0:v.channel)??"weixin-ilink",onChange:g=>{f({channel:g.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(mi,{checked:!!(v!=null&&v.enabled),className:"sidebar-switch",disabled:n||!v||!v.enabled&&!y,label:"Gateway",title:y?"Enable or disable PM messages and task-changing Gateway commands":"Configure and bind the selected Gateway channel first",onChange:g=>d(g)}),x.jsx(mi,{checked:!!(v!=null&&v.translationEnabled),className:"sidebar-switch",disabled:n||!v,label:"Translation",onChange:g=>h(g)}),S?x.jsx("button",{className:"danger-button",type:"button",disabled:n,onClick:_,children:"Reset Binding"}):E?x.jsxs(x.Fragment,{children:[x.jsx("button",{type:"button",disabled:n,onClick:o,children:"Start QR Setup"}),x.jsx("button",{type:"button",disabled:n||!y,title:y?"Create a short code, then send /bind CODE to the Lark bot":"Complete Lark QR Setup first",onClick:()=>{l().then(g=>{R(g)}).catch(()=>{})},children:"Create Pairing Code"})]}):x.jsx("button",{type:"button",disabled:n,onClick:c,children:"Start QR Login"})]}),E?x.jsxs("div",{className:"gateway-lark-settings",children:[x.jsx("p",{className:"muted",children:v!=null&&v.binding.appIdConfigured&&v.binding.appSecretConfigured?`Lark app configured${v.binding.larkBotName?` · ${v.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,w?x.jsxs("p",{className:"muted",children:["Send ",x.jsxs("code",{children:["/bind ",w.code]})," to the Lark bot before ",nl(w.expiresAt),"."]}):v!=null&&v.binding.pairingCodeExpiresAt?x.jsxs("p",{className:"muted",children:["Pairing code active until ",nl(v.binding.pairingCodeExpiresAt),"."]}):null]}):u?x.jsx("p",{className:"muted",children:"QR login started. Use the login dialog to confirm binding."}):null,!E&&p?x.jsxs("p",{className:"muted",children:["QR status: ",p.status,p.message?` · ${p.message}`:""]}):null]})}function P2({busy:n,onPull:r,project:s}){const l=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:F2(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:q2(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:l??"Pull latest changes with git pull --ff-only",onClick:()=>void r(),children:"Pull"}),x.jsx("span",{className:"muted",children:s.checkedAt?`checked ${nl(s.checkedAt)}`:"status not refreshed"})]}),l?x.jsx("p",{className:"muted",children:l}):null,s.warnings.length>0?x.jsx("ul",{className:"warnings",children:s.warnings.map(_=>x.jsx("li",{children:_},_))}):null]})}function F2(n){return n.branch||"unknown"}function q2(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 $2({roundState:n,task:r}){var p;const[s,l]=te.useState(()=>Date.now()),d=!!(n!=null&&n.startedAt),_=xv(r.createdAt,s),f=Kg(n,(n==null?void 0:n.totalCcActiveMs)??0,s),o=d&&n?Kg(n,n.currentRoundCcActiveMs,s):0,c=d&&n?G2(n,s):0,h=((p=r.title)==null?void 0:p.trim())||r.taskSlug;return te.useEffect(()=>{const u=window.setInterval(()=>l(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:nl(r.createdAt)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Session total"}),x.jsx("dd",{children:xo(_)})]}),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:xo(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:nl(n.startedAt)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Total"}),x.jsx("dd",{children:xo(c)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Role runtime"}),x.jsx("dd",{children:xo(o)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Turn count"}),x.jsx("dd",{children:n.turnCount})]})]})]}):null]})}function Kg(n,r,s){if(!(n!=null&&n.activeTurnStartedAt)||n.status!=="running")return r;const l=Date.parse(n.updatedAt);return Number.isFinite(l)?r+Math.max(0,s-l):r}function G2(n,r){const s=n.status==="running"?r:Date.parse(n.stoppedAt??n.lastTurnEndedAt??"");return xv(n.startedAt??"",Number.isFinite(s)?s:r)}function xv(n,r){const s=Date.parse(n);return Number.isFinite(s)?Math.max(0,r-s):0}function nl(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 xo(n){const r=Math.max(0,Math.floor(n/1e3)),s=Math.floor(r/3600),l=Math.floor(r%3600/60),d=r%60;return s>0?l>0?`${s}h ${l}m`:`${s}h`:l>0?d>0?`${l}m ${d}s`:`${l}m`:`${d}s`}function V2(n){return n==="system"?"light":n==="light"?"dark":"system"}function Wg(n){return n==="system"?"System":n==="light"?"Light":"Dark"}function K2({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(w2,{events:n,maxEvents:null,showHeader:!1})]})})}function W2({busy:n,messages:r,orchestration:s,onClose:l,onMarkAllDone:d,onDeleteMessageHistory:_}){const f=sf(r);function o(){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(`
93
+ `;function n2({active:n=!0,autoSendEnabled:r,targetLanguage:s,taskSlug:l,role:d,sessionId:g}){const[f,o]=te.useState([]),[c,h]=te.useState([]),[p,u]=te.useState(""),[b,w]=te.useState(""),[R,E]=te.useState(!1),[v,y]=te.useState("ready"),[_,S]=te.useState(Date.now()),[A,L]=te.useState(!1),[,D]=br(""),[T,k]=te.useState(0),M=te.useRef(n),B=te.useRef(1),H=te.useRef(null);te.useEffect(()=>{M.current=n},[n]);const U=te.useCallback(async()=>{try{const ae=await ye.pollTranslationSession(g,B.current);V(ae.events),B.current=ae.nextCursor,y(ae.status),Lo("Poll conversation translation events"),D(he=>Ao(he,["Poll conversation translation events"]))}catch(ae){const he=nf("Poll conversation translation events",ae);he&&D(he)}},[g]);tl(g?`translation-events:${g}`:null,U,{intervalMs:n?1e3:5e3,runImmediately:!1}),te.useEffect(()=>{o([]),h([]),D(""),y("ready"),B.current=1;let ae=!1;return ye.startTranslationSession(l,d).then(he=>{ae||(y(he.status),B.current=he.nextCursor,U())}).catch(he=>{ae||D(Je("Start conversation translation session",he))}),()=>{ae=!0,ye.stopTranslationSession(g).catch(()=>{})}},[U,g,l,d]),te.useEffect(()=>{if(!n)return;const ae=H.current;if(!ae)return;const he=window.requestAnimationFrame(()=>{ae.scrollTop=ae.scrollHeight});return()=>window.cancelAnimationFrame(he)},[n,T]);const P=u2(f);te.useEffect(()=>{if(!P)return;S(Date.now());const ae=window.setInterval(()=>S(Date.now()),250);return()=>window.clearInterval(ae)},[P]);async function Y(ae=!1){const he=p;L(!0),D(""),E(!1);try{const W=await ye.translateUserInput(l,d,{text:he,mode:ae?"auto-send":"review-before-send",useContext:!1,send:ae});W.sent?(u(""),E(!1)):(u(Cv(he,W.englishPreview)),E(!0))}catch(W){D(Je("Translate composer input",W))}finally{L(!1)}}async function X(){const ae=b.trim();if(ae){L(!0),D("");try{const he=await ye.translateManualOutput(l,d,{text:ae});o(W=>dh(ph(W,he)).entries),w(""),k(W=>W+1)}catch(he){D(Je("Translate pasted English output",he))}finally{L(!1)}}}function V(ae){if(ae.length===0)return;for(const W of ae)W.type==="status"?y(W.status):W.type==="error"?D(Je("Process translation session event",W.message)):W.type==="failures"&&h(W.failures);const he=ae.filter(W=>W.type==="entry");he.length>0&&(o(W=>{const q=he.reduce((ee,le)=>ph(ee,le.entry),W),ie=dh(q);return ie.removedIds.size>0&&h(ee=>ee.filter(le=>!ie.removedIds.has(le.translationId))),ie.entries}),k(W=>W+1))}async function K(){const ae=R?Vg(p):p;if(ae.trim()){L(!0),D("");try{await ye.sendTranslatedInput(l,d,{englishText:ae}),u(""),E(!1)}catch(he){D(Je("Send translated English input to role",he))}finally{L(!1)}}}function ne(ae){ae.key!=="Enter"||ae.shiftKey||ae.nativeEvent.isComposing||(ae.preventDefault(),!A&&p.trim()&&(R?K():Y(r)))}async function z(){o([]),h([]),B.current=1,await ye.clearTranslationSession(g).catch(ae=>D(Je("Clear conversation translation panel",ae)))}async function j(){L(!0),D("");try{const ae=await ye.ignoreTranslationFailures(g);h(ae.failures)}catch(ae){D(Je("Ignore failed conversation translations",ae))}finally{L(!1)}}async function N(ae){L(!0),D("");try{const he=await ye.retryTranslation(g,ae.translationId);o(W=>dh(ph(W,he)).entries),k(W=>W+1)}catch(he){D(Je("Retry latest failed conversation translation",he))}finally{L(!1)}}const $=h2(f,v,_),I=c.length,se=r2(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 ",i2(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(o2,{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=>w(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()||R&&!p2(ae.target.value))&&E(!1)},onKeyDown:ne,placeholder:"输入中文,先翻译成英文工程指令..."}),x.jsx("div",{className:"translation-composer-actions",children:x.jsx("button",{type:"button",disabled:A||!R||!Vg(p).trim(),onClick:()=>void K(),children:"Send English"})})]})]})]})}function i2(n){var r;return((r=o_.find(s=>s.value===n))==null?void 0:r.label)??n}function r2(n){let r,s=Number.NEGATIVE_INFINITY;for(const l of n){const d=Date.parse(l.failedAt),g=Number.isFinite(d)?d:Number.NEGATIVE_INFINITY;(!r||g>=s)&&(r=l,s=g)}return r}function s2({open:n,taskSlug:r,targetLanguage:s,onClose:l}){const[d,g]=te.useState(!1),[,f]=br(""),[o,c]=te.useState(null),[h,p]=te.useState(""),[u,b]=te.useState(""),[w,R]=te.useState(""),[E,v]=te.useState(!1),[y,_]=te.useState(null),[S,A]=te.useState(""),[L,D]=te.useState(""),[T,k]=te.useState(""),[M,B]=te.useState(!1);tl(n?`file-translation:${h||"none"}`:null,()=>H(!0),{intervalMs:2e3,runImmediately:!0});async function H(V=!1){try{const K=await ye.getTranslationState();c(K);const ne=h?K.fileIndex.jobs.some(z=>z.id===h):!1;if((!h||!ne)&&K.fileIndex.jobs[0])U(K.fileIndex.jobs[0].id);else if(!K.fileIndex.jobs[0])p(""),b(""),R("");else if(V&&h){const z=await ye.readFileTranslation(h);b(z.output),R(z.report)}}catch(K){f(Je("Load file translation list",K))}}async function U(V){p(V),b(""),R("");try{const K=await ye.readFileTranslation(V);b(K.output),R(K.report)}catch(K){f(Je(`Read translated file ${V}`,K))}}async function P(){v(!0),await Y(S,L)}async function Y(V="",K=""){B(!0),f("");try{const ne=await ye.browseTranslationSourceFiles({path:V,query:K,limit:250});_(ne),A(ne.currentPath),D(K)}catch(ne){f(Je("Browse translation source files",ne))}finally{B(!1)}}async function X(V=T){const K=V.trim();if(K){g(!0),f("");try{if(!r)throw new Error("Create or select a task before translating files.");const ne=await ye.createFileTranslation({taskSlug:r,sourcePath:K,targetLanguage:s});v(!1),await H(),await U(ne.id)}catch(ne){f(Je(`Create file translation for ${K}`,ne))}finally{g(!1)}}}return n?x.jsxs(x.Fragment,{children:[x.jsx("div",{className:"modal-backdrop file-translation-backdrop",children:x.jsx(l2,{busy:d,state:o,selectedJobId:h,output:u,report:w,onClose:()=>{v(!1),l()},onRefresh:()=>void H(),onSelectJob:V=>void U(V),onTranslate:()=>void P()})}),E?x.jsx(a2,{busy:d||M,state:y,currentPath:S,query:L,selectedPath:T,onBrowse:(V,K)=>void Y(V,K),onClose:()=>v(!1),onQueryChange:D,onSelectPath:k,onTranslate:()=>void X()}):null]}):null}function a2({busy:n,state:r,currentPath:s,query:l,selectedPath:d,onBrowse:g,onClose:f,onQueryChange:o,onSelectPath:c,onTranslate:h}){const p=(r==null?void 0:r.entries)??[],u=p.filter(w=>w.type==="directory"),b=p.filter(w=>w.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:w=>{w.preventDefault(),g(s,l)},children:[x.jsx("input",{value:l,onChange:w=>o(w.target.value),placeholder:"Search files"}),x.jsx("button",{type:"submit",disabled:n,children:"Search"}),x.jsx("button",{type:"button",disabled:n||!l,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(w=>x.jsx(Gg,{entry:w,selected:d===w.path,onBrowse:g,onSelectPath:c},w.path))]}):null,b.length>0?x.jsxs("div",{className:"translation-file-browser-group",children:[x.jsx("h3",{children:"Files"}),b.map(w=>x.jsx(Gg,{entry:w,selected:d===w.path,onBrowse:g,onSelectPath:c},w.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:w=>c(w.target.value)})]}),x.jsx("button",{type:"button",disabled:n||!d.trim(),onClick:h,children:"Translate File"})]})]})]})})}function Gg({entry:n,selected:r,onBrowse:s,onSelectPath:l}){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,""):l(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 l2({busy:n,state:r,selectedJobId:s,output:l,report:d,onClose:g,onRefresh:f,onSelectJob:o,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:()=>o(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(Y_,{remarkPlugins:[yv],children:l||d||"Translation output is not available yet."})})]}):x.jsx("p",{className:"muted",children:"Select a translated file to preview it."})})]})]})}function o2({entry:n}){if(n.sourceKind==="conversation-boundary")return x.jsx(c2,{entry:n});const r=d2(n),s=n.sourceKind==="tool-output",l=n.direction==="user-input-to-english",d=["translation-entry",`is-${n.sourceKind}`,l?"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(Y_,{remarkPlugins:[yv],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 c2({entry:n}){const r=n.boundaryKind==="end"?"结束":"开始",s=n.conversationTurn??0,l=g2(n.occurredAt??n.createdAt);return x.jsxs("div",{className:"translation-conversation-boundary","aria-label":`${r} 第 ${s} 轮 ${l}`,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:l}),x.jsx("span",{className:"translation-boundary-dash","aria-hidden":"true"})]})}function u2(n){const r=n.find(rf);return(r==null?void 0:r.translationStartedAt)??(r==null?void 0:r.createdAt)}function h2(n,r,s){const l=n.find(rf);if(l)return`translating ${m2(Math.max(0,s-f2(l)))}`;const d=n.at(-1);return(d==null?void 0:d.status)==="failed"||r==="failed"?"error":r}function rf(n){return n.status==="queued"||n.status==="translating"}function dh(n){const r=n.length-YE;if(r<=0)return{entries:n,removedIds:new Set};const s=new Set;for(const l of n){if(s.size>=r)break;rf(l)||s.add(l.id)}return s.size===0?{entries:n,removedIds:s}:{entries:n.filter(l=>!s.has(l.id)),removedIds:s}}function f2(n){const r=Date.parse(n.translationStartedAt??n.createdAt);return Number.isFinite(r)?r:Date.now()}function d2(n){return n.status==="queued"||n.status==="translating"?n.sourceText:n.status==="translated"?n.direction==="user-input-to-english"?Cv(n.sourceText,n.translatedText):n.translatedText:n.translatedText||n.sourceText}function Cv(n,r){return`${n.trimEnd()}${Oo}${r.trimStart()}`}function p2(n){return n.includes(Oo)}function Vg(n){const r=n.indexOf(Oo);return r===-1?n:n.slice(r+Oo.length)}function ph(n,r){return n.findIndex(l=>l.id===r.id)===-1?[...n,r]:n.map(l=>l.id===r.id?r:l)}function m2(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),l=Math.floor(r%60).toString().padStart(2,"0");return`${s}:${l}`}function g2(n){const r=new Date(n);return Number.isNaN(r.getTime())?n:r.toLocaleTimeString()}const _2=8;function v2(){const[n,r]=te.useState([]);return te.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 o=new Date().toISOString();r(p=>{const u=p.find(b=>b.message===f);return u?[{...u,count:u.count+1,updatedAt:o},...p.filter(b=>b.id!==u.id)]:[{id:`ui_error_${Date.now()}_${Math.random().toString(16).slice(2)}`,message:f,count:1,createdAt:o,updatedAt:o},...p].slice(0,_2)})},l=g=>{var o;const f=((o=g.detail)==null?void 0:o.actions)??[];f.length!==0&&r(c=>c.filter(h=>!f.some(p=>h.message.startsWith(`${p} failed.`))))},d=g=>{var o,c;const f=(c=(o=g.detail)==null?void 0:o.message)==null?void 0:c.trim();f&&r(h=>h.filter(p=>p.message!==f))};return window.addEventListener(mh,s),window.addEventListener(gh,l),window.addEventListener(_h,d),()=>{window.removeEventListener(mh,s),window.removeEventListener(gh,l),window.removeEventListener(_h,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:[y2(s.updatedAt),s.count>1?` · repeated ${s.count} times`:""]})]}),x.jsx("button",{type:"button","aria-label":"Dismiss error",onClick:()=>r(l=>l.filter(d=>d.id!==s.id)),children:"Close"})]},s.id))})]})}function y2(n){return new Date(n).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function S2(n,r){return n.find(s=>s.taskSlug===r)??n[0]??null}function b2(n,r){const s=Fs.map(l=>({role:l.name,permissionMode:n.roles[l.name].permissionMode,model:n.roles[l.name].model,effort:n.roles[l.name].effort}));if(r.gateReviewerEnabled){const l=n.roles["gate-reviewer"];s.push({role:"gate-reviewer",permissionMode:l.permissionMode,model:l.model,effort:l.effort})}return s}const C2=["architecture-plan","validation-adequacy","final-diff"];function w2({events:n,maxEvents:r=8,showHeader:s=!0}){const l=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:l.map((d,g)=>x.jsx("li",{children:d},`${d}-${g}`))})]})}function pi({checked:n,className:r,disabled:s,label:l,stateLabel:d,title:g,onChange:f}){const o=["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":`${l}: ${c}`,className:o,disabled:s,title:g,onClick:()=>f(!n),children:[x.jsx("span",{className:"switch-control-label",children:l}),x.jsx("span",{className:"switch-control-track","aria-hidden":"true",children:x.jsx("span",{className:"switch-control-thumb"})})]})}function x2({status:n,bootstrapStatus:r,applyResult:s,hasActiveTask:l=!1,autoTaskHarnessReviewEnabled:d,busy:g=!1,onRefresh:f,onApply:o,onOpenStudio:c,onOpenRepositoryDiff:h,onAutoTaskHarnessReviewChange:p,onStartBootstrap:u,onRestartBootstrap:b,onStopBootstrap:w,onRunBootstrap:R}){const[E,v]=te.useState(!1),[y,_]=te.useState("bypassPermissions"),[S,A]=te.useState("default"),[L,D]=te.useState("default"),T=r==null?void 0:r.session,k=(r==null?void 0:r.status)==="running",M=(T==null?void 0:T.status)==="running",B=(r==null?void 0:r.status)!=="complete",H={permissionMode:y,model:S,effort:L};return l?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 o(),children:"Update"}):null]}):x.jsx("button",{type:"button",disabled:g,onClick:()=>void o(),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(zi,{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(pi,{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?E2(r.status):"not loaded"})]}),x.jsx("div",{className:"harness-actions",children:x.jsx("button",{type:"button",disabled:g||!(r!=null&&r.canStart),onClick:()=>{v(!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:(T==null?void 0:T.command)??"Start Harness Engineer, then run bootstrap when ready."})]}),x.jsxs("div",{className:"harness-bootstrap-modal-actions",children:[T?x.jsx(zi,{status:T.status}):null,x.jsx("button",{type:"button",onClick:()=>v(!1),children:"Close"})]})]}),x.jsxs("div",{className:"harness-bootstrap-controls",children:[x.jsxs("label",{children:[x.jsx("span",{children:"Permission"}),x.jsx("select",{value:y,disabled:g||k||M,onChange:U=>_(U.target.value),children:u_.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:S,disabled:g||k||M,onChange:U=>A(U.target.value),children:h_.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:f_.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||!T,onClick:()=>void w(),children:"Stop"}),x.jsx("button",{type:"button",disabled:g||k||!M,onClick:()=>void R(),children:"Run bootstrap"})]})]}),x.jsx("div",{className:"harness-bootstrap-terminal",children:M?x.jsx(No,{sessionId:T.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 E2(n){return n.replaceAll("_"," ")}function sf(n){return{total:n.length,accepted:n.filter(r=>r.acceptedAt).length,delivered:n.filter(r=>r.deliveredAt).length}}function k2(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 A2({messages:n,orchestration:r,busy:s,maxMessages:l=6,showControls:d=!0,showHeader:g=!0,onModeChange:f,onMarkAllDone:o}){const[c,h]=te.useState(null),p=sf(n),u=(r==null?void 0:r.mode)??"auto",b=k2(n,l);async function w(R){await D2(R.body),h(R.id),window.setTimeout(()=>h(E=>E===R.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(pi,{checked:u==="auto",className:"message-mode-toggle",disabled:s,label:"Auto orchestration",onChange:R=>f(R?"auto":"manual")})}):null,d&&o?x.jsx("button",{type:"button",disabled:s,onClick:o,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:R,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:Bo(R),children:R2(Bo(R))}),x.jsxs("strong",{children:[R.fromRole," ","->"," ",R.toRole]}),x.jsx("span",{children:R.type})]}),x.jsx("p",{children:R.body}),R.failureReason?x.jsx("span",{className:"message-reason",children:R.failureReason}):null,R.bodyPath?x.jsx("span",{className:"message-path",children:R.bodyPath}):null]}),x.jsx("div",{className:"message-actions",children:x.jsx("button",{type:"button",disabled:s,onClick:()=>void w(R),children:c===R.id?"Copied":"Copy"})})]},R.id))})]})}function R2(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 Bo(n){return n.acceptedAt??n.deliveredAt??n.dispatchingAt??n.createdAt}function T2(n,r){const s=Bo(n).localeCompare(Bo(r));if(s!==0)return s;const l=n.createdAt.localeCompare(r.createdAt);return l!==0?l:n.id.localeCompare(r.id)}async function D2(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 M2({defaultPath:n="",recentPaths:r=[],busy:s=!1,onConnect:l}){const[d,g]=te.useState(n);te.useEffect(()=>{n&&g(n)},[n]);async function f(o){o.preventDefault(),await l(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:o=>g(o.target.value),placeholder:"/path/to/repo"}),r.length>0?x.jsxs("select",{"aria-label":"Recent repositories",className:"repo-recent-select",value:"",onChange:o=>{o.target.value&&g(o.target.value)},children:[x.jsx("option",{value:"",children:"Recent"}),r.map(o=>x.jsx("option",{value:o,children:o},o))]}):null,x.jsx("button",{type:"submit",disabled:s||!d.trim(),children:"Connect"})]})})}function L2({tasks:n,activeTaskSlug:r,onSelect:s}){return x.jsx("nav",{className:"task-nav","aria-label":"Tasks",children:n.map(l=>x.jsxs("button",{className:l.taskSlug===r?"task-nav-item is-active":"task-nav-item",type:"button",onClick:()=>s(l.taskSlug),children:[x.jsx("span",{children:l.title||l.taskSlug}),x.jsx(zi,{status:l.status})]},l.taskSlug))})}function O2({project:n,recentRepositoryPaths:r,tasks:s,activeTaskSlug:l,messages:d,orchestration:g,events:f,roundState:o,gateReview:c,translationEnabled:h,translationAutoSendEnabled:p,translationTargetLanguage:u,translationOutputMode:b,translationMemoryInitialized:w,translatorSession:R,harnessStatus:E,harnessBootstrapStatus:v,harnessApplyResult:y,autoTaskHarnessReviewEnabled:_,gatewayStatus:S,gatewayQrLogin:A,gatewayQrCheck:L,gatewayLarkRegistration:D,gatewayLarkRegistrationCheck:T,busy:k,onConnect:M,onRefreshConnectedRepository:B,onPullConnectedRepository:H,onRefreshHarness:U,onApplyHarness:P,onStartHarnessBootstrap:Y,onRestartHarnessBootstrap:X,onStopHarnessBootstrap:V,onRunHarnessBootstrap:K,onOpenHarnessStudio:ne,onOpenRepositoryDiff:z,onAutoTaskHarnessReviewChange:j,onRefreshGateway:N,onGatewayEnabledChange:$,onGatewaySettingsChange:I,onGatewayTranslationChange:se,onStartGatewayQrLogin:ae,onStartGatewayLarkRegistration:he,onResetGatewayBinding:W,onGateReviewGateEnabledChange:q,onTranslationEnabledChange:ie,onTranslationAutoSendChange:ee,onTranslationTargetLanguageChange:le,onTranslationOutputModeChange:ve,onOpenFileTranslation:De,onOpenTranslatorSession:Ne,onCreateTranslationBootstrap:je,onUpdateTranslationMemory:ct,onCreateTask:Ee,onCloseTask:Yt,onSelectTask:sn,themeMode:Nt,onAutoOrchestrationChange:dn,onThemeModeChange:En,pauseAlertSound:wt,onPauseAlertSoundChange:it,roleRetryEnabled:Ot,onRoleRetryEnabledChange:pe,permissionRequestMode:Se,onPermissionRequestModeChange:ke,launchTemplate:Oe,canSaveLaunchTemplate:He,canOneClickStart:_t,onSaveLaunchTemplate:qe,onOneClickStart:St,onMarkAllMessagesDone:yt,onDeleteMessageHistory:Bt}){const[Ze,an]=te.useState(""),[we,Ut]=te.useState(!1),[Yn,Xn]=te.useState(!1),[Pt,pn]=te.useState(()=>l?null:"repository"),Qn=sf(d),Xt=Ze.trim(),Re=H2(n,l,E),Ht=s.filter(Ue=>Ue.cleanupStatus!=="cleaned"),kn=Ht.find(Ue=>Ue.taskSlug===l)??null;te.useEffect(()=>{pn(Ue=>!l&&Ue===null?n?"task":"repository":Ue)},[l,n]);function Ft(Ue,gi){pn(gi?Ue:null)}async function Ui(Ue){Ue.preventDefault(),await Ee({taskSlug:Xt}),an("")}return x.jsxs("div",{className:"project-dashboard",children:[x.jsx("header",{className:"brand-header",children:x.jsx("strong",{children:"VibeCodingMaster"})}),x.jsx(Gr,{title:"Repository",open:Pt==="repository",onOpenChange:Ue=>{Ft("repository",Ue),Ue&&n&&B()},children:x.jsxs("div",{className:"repository-panel",children:[x.jsx(M2,{defaultPath:(n==null?void 0:n.repoRoot)??"",recentPaths:r,busy:k,onConnect:M}),n?x.jsx(P2,{busy:k,project:n,onPull:H}):null]})}),x.jsx(Gr,{title:"Settings",open:Pt==="settings",onOpenChange:Ue=>Ft("settings",Ue),children:x.jsxs("div",{className:"sidebar-settings",children:[x.jsxs("button",{"aria-label":`Theme mode: ${Wg(Nt)}`,className:"settings-toggle theme-mode-toggle",disabled:k,title:"Cycle theme: system, light, dark",type:"button",onClick:()=>En(V2(Nt)),children:[x.jsx("span",{children:"Theme"}),x.jsx("span",{children:Wg(Nt)})]}),x.jsx(pi,{checked:((g==null?void 0:g.mode)??"auto")==="auto",className:"sidebar-switch",disabled:k||!l,label:"Auto orchestration",title:l?"Automatically dispatch role messages during the active task":"Create or select a task first",onChange:dn}),x.jsx(pi,{checked:wt,className:"sidebar-switch",disabled:k,label:"Pause alert sound",title:"Play a sound when VCM shows the fixed flow pause dialog",onChange:Ue=>it(Ue)}),x.jsx(pi,{checked:Ot,className:"sidebar-switch",disabled:k,label:"CC auto retry",title:"Retry temporary Claude Code turn failures before showing the flow pause alert",onChange:Ue=>pe(Ue)}),x.jsxs("label",{className:"settings-select-row",children:[x.jsx("span",{children:"Permission requests"}),x.jsxs("select",{value:Se,disabled:k,onChange:Ue=>ke(Ue.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||!He,title:"Save the current core role launch settings and optional Gate Reviewer settings",type:"button",onClick:qe,children:[x.jsx("span",{children:"Save launch template"}),x.jsx("span",{children:He?"ready":"open task"})]}),_t?x.jsxs("button",{className:"settings-toggle is-active",disabled:k,title:B2(Oe),type:"button",onClick:St,children:[x.jsx("span",{children:"One-click start"}),x.jsx("span",{children:wv(Oe)})]}):null,l?x.jsxs(x.Fragment,{children:[x.jsxs("button",{type:"button",onClick:()=>Ut(!0),children:[x.jsx("span",{children:"Messages"}),x.jsxs("span",{className:"muted",children:[Qn.total," total"]})]}),x.jsxs("button",{type:"button",onClick:()=>Xn(!0),children:[x.jsx("span",{children:"Events"}),x.jsxs("span",{className:"muted",children:[f.length," total"]})]})]}):null]})}),x.jsx(Gr,{title:"Translation",open:Pt==="translation",onOpenChange:Ue=>Ft("translation",Ue),children:x.jsx(j2,{busy:k,enabled:h,autoSendEnabled:p,targetLanguage:u,outputMode:b,memoryInitialized:w,baseUnavailableReason:Re,translatorSession:R,onAutoSendChange:ee,onCreateBootstrap:je,onEnabledChange:ie,onUpdateMemory:ct,onTargetLanguageChange:le,onOutputModeChange:ve,onOpenFileTranslation:De,onOpenTranslatorSession:Ne})}),n&&l?x.jsx(Gr,{title:"Gate Review Gates",open:Pt==="gate-review-gates",onOpenChange:Ue=>Ft("gate-review-gates",Ue),children:x.jsx(z2,{busy:k,state:c,onGateEnabledChange:q})}):null,x.jsx(Gr,{title:"Gateway",open:Pt==="gateway",onOpenChange:Ue=>{Ft("gateway",Ue),Ue&&N()},children:x.jsx(U2,{busy:k,qrCheck:L,qrLogin:A,larkRegistration:D,larkRegistrationCheck:T,status:S,onEnabledChange:$,onSettingsChange:I,onResetBinding:W,onStartLarkRegistration:he,onStartQrLogin:ae,onTranslationChange:se})}),n?x.jsx(Gr,{title:"VCM Harness",open:Pt==="vcm-harness",onOpenChange:Ue=>Ft("vcm-harness",Ue),children:x.jsx(x2,{status:E,bootstrapStatus:v,applyResult:y,hasActiveTask:!!kn,autoTaskHarnessReviewEnabled:_,busy:k,onRefresh:U,onApply:P,onOpenStudio:ne,onOpenRepositoryDiff:z,onAutoTaskHarnessReviewChange:j,onStartBootstrap:Y,onRestartBootstrap:X,onStopBootstrap:V,onRunBootstrap:K})}):null,n?x.jsx(Gr,{title:"Task",open:Pt==="task",onOpenChange:Ue=>Ft("task",Ue),children:Ht.length>0?x.jsxs("div",{className:"task-panel",children:[x.jsx(L2,{tasks:Ht,activeTaskSlug:l,onSelect:sn}),kn?x.jsx("div",{className:"task-panel-actions",children:x.jsx("button",{className:"danger-button",disabled:k,type:"button",onClick:Yt,children:"Close Task"})}):null]}):x.jsx("div",{className:"task-create",children:x.jsxs("form",{onSubmit:Ui,children:[x.jsx("input",{value:Ze,onChange:Ue=>an(Ue.target.value),placeholder:"task name"}),x.jsxs("div",{className:"task-create-preview",children:[x.jsxs("small",{children:["branch: ",Xt?`feature/${Xt}`:"feature/<task>"]}),x.jsxs("small",{children:["worktree: ",Xt?`.claude/worktrees/${Xt}`:".claude/worktrees/<task>"]})]}),x.jsx("button",{type:"submit",disabled:k||!Xt,children:"Create"})]})})}):null,n&&kn?x.jsx($2,{task:kn,roundState:o}):null,we?x.jsx(W2,{busy:k,messages:d,orchestration:g,onClose:()=>Ut(!1),onMarkAllDone:()=>{l&&yt(l)},onDeleteMessageHistory:()=>{l&&Bt(l)}}):null,Yn?x.jsx(K2,{events:f,onClose:()=>Xn(!1)}):null]})}function wv(n){return[n.autoOrchestration?"auto":"manual"].join(" + ")}function B2(n){const r=Object.entries(n.roles).map(([s,l])=>`${s}: ${l.permissionMode} / ${l.model} / ${l.effort}`).join("; ");return`Launch template: ${wv(n)}; ${r}`}function j2({autoSendEnabled:n,baseUnavailableReason:r,busy:s,enabled:l,memoryInitialized:d,outputMode:g,targetLanguage:f,translatorSession:o,onAutoSendChange:c,onCreateBootstrap:h,onEnabledChange:p,onUpdateMemory:u,onOutputModeChange:b,onTargetLanguageChange:w,onOpenFileTranslation:R,onOpenTranslatorSession:E}){const v=!!(s||r),y=(o==null?void 0:o.status)==="running",_=!!(l&&!r&&y),S=r??(y?null:"Start Translator session first."),A=!!(s||S),D=r??"Open Translator session",T=S??"Translation tools are ready";return x.jsxs("div",{className:"sidebar-settings",children:[x.jsx(pi,{checked:_,className:"sidebar-switch",disabled:v||!y,label:"Conversation translation",title:T,onChange:p}),x.jsx(pi,{checked:n,className:"sidebar-switch",disabled:v,label:"Auto-send",onChange:c}),x.jsxs("label",{className:"settings-select-row",children:[x.jsx("span",{children:"Language"}),x.jsx("select",{value:f,disabled:v,onChange:k=>w(k.target.value),children:o_.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:v,onChange:k=>b(k.target.value),children:Q0.map(k=>x.jsx("option",{value:k.value,children:k.label},k.value))})]}),x.jsxs("button",{className:"settings-toggle",disabled:A,title:T,type:"button",onClick:R,children:[x.jsx("span",{children:"File translation"}),x.jsx("span",{children:"open"})]}),d?null:x.jsxs("button",{className:"settings-toggle",disabled:A,title:T,type:"button",onClick:h,children:[x.jsx("span",{children:"Bootstrap"}),x.jsx("span",{children:"run"})]}),x.jsxs("button",{className:"settings-toggle",disabled:A,title:T,type:"button",onClick:u,children:[x.jsx("span",{children:"Update memory"}),x.jsx("span",{children:"run"})]}),S?x.jsx("p",{className:"settings-help-text",children:S}):null,x.jsxs("div",{className:"settings-status-row",children:[x.jsx("span",{children:"Session status"}),x.jsx("strong",{children:N2(o)})]}),x.jsxs("button",{className:"settings-toggle",disabled:v,title:D,type:"button",onClick:E,children:[x.jsx("span",{children:"Open Session"}),x.jsx("span",{children:"open"})]})]})}function N2(n){return n?n.status==="running"?n.activityStatus??"idle":n.status:"not started"}function H2(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 z2({busy:n,onGateEnabledChange:r,state:s}){return x.jsx("div",{className:"sidebar-settings",children:C2.map(l=>{const d=s==null?void 0:s.gates[l],g=!!(d!=null&&d.required);return x.jsx(pi,{checked:g,className:"sidebar-switch",disabled:n||!s,label:I2(l),title:d!=null&&d.status?`status: ${d.status}`:void 0,onChange:f=>r(l,f)},l)})})}function I2(n){switch(n){case"architecture-plan":return"Architecture plan";case"validation-adequacy":return"Validation adequacy";case"final-diff":return"Final diff"}return n}function U2({busy:n,larkRegistration:r,larkRegistrationCheck:s,onEnabledChange:l,onResetBinding:d,onSettingsChange:g,onStartLarkRegistration:f,onStartQrLogin:o,onTranslationChange:c,qrCheck:h,qrLogin:p,status:u}){const b=(u==null?void 0:u.channel)==="lark",w=(u==null?void 0:u.channel)==="lark"?!!(u.binding.appIdConfigured&&u.binding.appSecretConfigured):!!(u!=null&&u.binding.tokenConfigured),R=(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(pi,{checked:!!(u!=null&&u.enabled),className:"sidebar-switch",disabled:n||!u||!u.enabled&&!w,label:"Gateway",title:w?"Enable or disable PM messages and task-changing Gateway commands":"Configure the selected Gateway channel first",onChange:E=>l(E)}),x.jsx(pi,{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"}):R?x.jsx("button",{className:"danger-button",type:"button",disabled:n,onClick:d,children:"Reset Binding"}):x.jsx("button",{type:"button",disabled:n,onClick:o,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 P2({busy:n,onPull:r,project:s}){const l=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:F2(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:q2(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:l??"Pull latest changes with git pull --ff-only",onClick:()=>void r(),children:"Pull"}),x.jsx("span",{className:"muted",children:s.checkedAt?`checked ${Lh(s.checkedAt)}`:"status not refreshed"})]}),l?x.jsx("p",{className:"muted",children:l}):null,s.warnings.length>0?x.jsx("ul",{className:"warnings",children:s.warnings.map(g=>x.jsx("li",{children:g},g))}):null]})}function F2(n){return n.branch||"unknown"}function q2(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 $2({roundState:n,task:r}){var p;const[s,l]=te.useState(()=>Date.now()),d=!!(n!=null&&n.startedAt),g=xv(r.createdAt,s),f=Kg(n,(n==null?void 0:n.totalCcActiveMs)??0,s),o=d&&n?Kg(n,n.currentRoundCcActiveMs,s):0,c=d&&n?G2(n,s):0,h=((p=r.title)==null?void 0:p.trim())||r.taskSlug;return te.useEffect(()=>{const u=window.setInterval(()=>l(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:Lh(r.createdAt)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Session total"}),x.jsx("dd",{children:wo(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:wo(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:Lh(n.startedAt)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Total"}),x.jsx("dd",{children:wo(c)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Role runtime"}),x.jsx("dd",{children:wo(o)})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Turn count"}),x.jsx("dd",{children:n.turnCount})]})]})]}):null]})}function Kg(n,r,s){if(!(n!=null&&n.activeTurnStartedAt)||n.status!=="running")return r;const l=Date.parse(n.updatedAt);return Number.isFinite(l)?r+Math.max(0,s-l):r}function G2(n,r){const s=n.status==="running"?r:Date.parse(n.stoppedAt??n.lastTurnEndedAt??"");return xv(n.startedAt??"",Number.isFinite(s)?s:r)}function xv(n,r){const s=Date.parse(n);return Number.isFinite(s)?Math.max(0,r-s):0}function Lh(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 wo(n){const r=Math.max(0,Math.floor(n/1e3)),s=Math.floor(r/3600),l=Math.floor(r%3600/60),d=r%60;return s>0?l>0?`${s}h ${l}m`:`${s}h`:l>0?d>0?`${l}m ${d}s`:`${l}m`:`${d}s`}function V2(n){return n==="system"?"light":n==="light"?"dark":"system"}function Wg(n){return n==="system"?"System":n==="light"?"Light":"Dark"}function K2({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(w2,{events:n,maxEvents:null,showHeader:!1})]})})}function W2({busy:n,messages:r,orchestration:s,onClose:l,onMarkAllDone:d,onDeleteMessageHistory:g}){const f=sf(r);function o(){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
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
- `))&&_()}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:o,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:l,children:"Close"})]})]}),x.jsx(A2,{busy:n,maxMessages:null,messages:r,orchestration:s,showControls:!1,showHeader:!1})]})})}function Kr({children:n,onOpenChange:r,open:s,title:l}){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:l}),x.jsx("span",{"aria-hidden":"true",className:"sidebar-section-chevron"})]}),s?x.jsx("div",{className:"sidebar-section-content",children:n}):null]})}function Oh(n,r){return n.find(s=>s.role===r)}function Y2({activeRole:n,roles:r=jh,sessions:s,onSelect:l}){return x.jsx("div",{className:"role-tabs",role:"tablist","aria-label":"Role sessions",children:r.map(d=>{const _=Oh(s,d.name),f=(_==null?void 0:_.status)==="running"?_.activityStatus??"idle":(_==null?void 0:_.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:()=>l(d.name),children:[x.jsx("span",{children:d.label}),x.jsx(zi,{status:f})]},d.name)})})}function X2({role:n,session:r,permissionMode:s,model:l,effort:d,active:_=!0,busy:f,translationEnabled:o,translationAutoSendEnabled:c,translationTargetLanguage:h,translationRole:p=n,translationSession:u=r,onPermissionModeChange:v,onModelChange:w,onEffortChange:R,onStart:E,onResume:y,onStop:S,onRestart:g,onNotifyHarnessUpdated:b,onTerminalEvent:A}){const L=_&&W0(p)&&o&&(u==null?void 0:u.status)==="running";return x.jsx("section",{className:"session-console",children:x.jsxs("div",{className:L?"session-console-body has-translation":"session-console-body",children:[x.jsxs("div",{className:"terminal-pane",children:[x.jsx(Hh,{role:n,session:r,permissionMode:s,model:l,effort:d,busy:f,onPermissionModeChange:v,onModelChange:w,onEffortChange:R,onStart:E,onResume:y,onStop:S,onRestart:g,onNotifyHarnessUpdated:b}),(r==null?void 0:r.status)==="running"?x.jsx(Ho,{sessionId:r.id,active:_,onEvent:A},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."})]})]}),L?x.jsx("div",{className:"translation-pane",children:x.jsx(n2,{active:_,autoSendEnabled:c,targetLanguage:h,taskSlug:u.taskSlug,role:p,sessionId:u.id},`${p}:${u.id}`)}):null]})})}function Q2(n,r,s){var _;if(!n||s.mode!=="auto")return null;const l=new Map(n.map(f=>[f.id,f])),d=r.filter(f=>{var o;return f.dispatchingAt?((o=l.get(f.id))==null?void 0:o.dispatchingAt)!==f.dispatchingAt:!1});return d.length===0?null:((_=d.sort(J2)[d.length-1])==null?void 0:_.toRole)??null}function J2(n,r){const s=n.dispatchingAt??n.deliveredAt??n.acceptedAt??"",l=r.dispatchingAt??r.deliveredAt??r.acceptedAt??"";return s!==l?s.localeCompare(l):n.createdAt.localeCompare(r.createdAt)}const Z2={"project-manager":"bypassPermissions",architect:"bypassPermissions",coder:"bypassPermissions",reviewer:"bypassPermissions","gate-reviewer":"bypassPermissions",translator:"bypassPermissions","harness-engineer":"bypassPermissions"},ek={"project-manager":"default",architect:"default",coder:"default",reviewer:"default","gate-reviewer":"default",translator:"default","harness-engineer":"default"},tk={"project-manager":"default",architect:"default",coder:"default",reviewer:"default","gate-reviewer":"default",translator:"medium","harness-engineer":"medium"};function nk({task:n,activeRole:r,gateReviewerEnabled:s,translationEnabled:l,translationAutoSendEnabled:d,translationTargetLanguage:_,translationOutputMode:f,launchTemplate:o,refreshNonce:c=0,onTaskChanged:h,onActiveRoleChange:p,onMessagesChanged:u,onOrchestrationChanged:v,onRoundStateChanged:w,onEventsChanged:R,onLaunchStateChanged:E}){const[y,S]=te.useState(null),[g,b]=te.useState(()=>Xg(o)),[A,L]=te.useState(()=>Qg(o)),[D,T]=te.useState(()=>Jg(o)),[k,M]=te.useState(!1),[,B]=wr(""),[H,U]=te.useState([]),[P,Y]=te.useState(null),X=te.useRef(null),V=te.useRef(""),K=te.useMemo(()=>JSON.stringify(o),[o]),ne=!!(y!=null&&y.sessions.some(ee=>ee.role==="gate-reviewer")),z=s||ne,j=[...Fs,...z?[a_]:[]],N=te.useCallback((ee,le)=>{var Ne;const ve=((Ne=X.current)==null?void 0:Ne.taskSlug)===n.taskSlug?X.current.messages:null,De=Q2(ve,ee,le);X.current={taskSlug:n.taskSlug,messages:ee},Y(le),u==null||u(ee),v==null||v(le),De&&(p(De),he(`auto switched to ${De} before VCM dispatch`))},[p,u,v,n.taskSlug]),$=te.useCallback((ee,le,ve,De)=>{S(ee),N(le,ve),w==null||w(De)},[N,w]),I=te.useCallback(async()=>{const ee=await ye.getTaskWorkspaceState(n.taskSlug);$(ee.taskStatus,ee.messages,ee.orchestration,ee.roundState),Oo("Poll task workspace state"),B(le=>Ro(le,["Load task workspace state","Poll task workspace state"]))},[$,n.taskSlug]),se=te.useCallback((ee,le)=>{const ve=nf(ee,le);ve&&B(ve)},[]);tl(`task-workspace:${n.taskSlug}:${c}`,()=>I().catch(ee=>{se("Poll task workspace state",ee)}),{intervalMs:3e3,runImmediately:!0}),te.useEffect(()=>{U([]),R==null||R([])},[R,n.taskSlug]),te.useEffect(()=>{b(Xg(o)),L(Qg(o)),T(Jg(o))},[K,n.taskSlug]),te.useEffect(()=>{y&&!z&&r==="gate-reviewer"&&p("project-manager"),y&&r==="translator"&&p("project-manager")},[r,z,p,y]),te.useEffect(()=>{const ee=y==null?void 0:y.task;if(!ee||ee.taskSlug!==n.taskSlug)return;const le=Yg(ee);if(le===Yg(n)){V.current="";return}V.current!==le&&(V.current=le,h().catch(ve=>{V.current="",B(Qe("Refresh task list after task status changed",ve))}))},[h,y==null?void 0:y.task,n]),te.useEffect(()=>{const ee=(y==null?void 0:y.sessions)??[],le=ee.filter(Be=>ik(Be.role)),ve=new Set(le.map(Be=>Be.role)),De=ee.some(Be=>Be.role==="gate-reviewer"),Ne={};for(const Be of $s)Ne[Be.name]={permissionMode:g[Be.name],model:A[Be.name],effort:D[Be.name]};E==null||E({taskSlug:n.taskSlug,roles:Ne,autoOrchestration:((P==null?void 0:P.mode)??"auto")==="auto",statusLoaded:!!y,sessionCount:le.length,hasAnySession:le.length>0,hasGateReviewerSession:De,allRolesHaveSession:Fs.every(Be=>ve.has(Be.name))})},[A,D,E,P==null?void 0:P.mode,g,y,n.taskSlug]);async function ae(ee,le="Run role session action"){M(!0),B("");try{await ee(),await I(),await h()}catch(ve){B(Qe(le,ve))}finally{M(!1)}}function he(ee){U(le=>{const ve=[...le,`${new Date().toLocaleTimeString()} ${ee}`];return R==null||R(ve),ve})}function W(ee,le){b(ve=>({...ve,[ee]:le}))}function q(ee,le){L(ve=>({...ve,[ee]:le}))}function ie(ee,le){T(ve=>({...ve,[ee]:le}))}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(Y2,{activeRole:r,roles:j,sessions:(y==null?void 0:y.sessions)??[],onSelect:p})]}),x.jsx("div",{className:"workspace-grid",children:x.jsx("div",{className:"workspace-main",children:x.jsx("div",{className:"role-console-stack",children:j.map(ee=>{const le=ee.name,ve=le===r,De=(y==null?void 0:y.sessions)??[],Ne=Oh(De,le),Be=f==="pm-final-only"?"project-manager":le,ct=Oh(De,Be);return x.jsx("div",{className:ve?"role-console-panel is-active":"role-console-panel","aria-hidden":!ve,children:x.jsx(X2,{role:le,session:Ne,permissionMode:g[le],model:A[le],effort:D[le],active:ve,busy:k,translationEnabled:l,translationAutoSendEnabled:d,translationTargetLanguage:_,translationRole:Be,translationSession:ct,onPermissionModeChange:ke=>W(le,ke),onModelChange:ke=>q(le,ke),onEffortChange:ke=>ie(le,ke),onStart:()=>void ae(async()=>{await ye.startRoleSession(n.taskSlug,le,{cols:100,rows:28,permissionMode:g[le],model:A[le],effort:D[le]}),he(`started ${le} with ${g[le]} / ${A[le]} / ${D[le]}`)},`Start ${le} session`),onResume:()=>void ae(async()=>{await ye.resumeRoleSession(n.taskSlug,le,{cols:100,rows:28,permissionMode:g[le],model:A[le],effort:D[le]}),he(`resumed ${le} with ${g[le]} / ${A[le]} / ${D[le]}`)},`Resume ${le} session`),onStop:()=>void ae(async()=>{await ye.stopRoleSession(n.taskSlug,le),he(`stopped ${le}`)},`Stop ${le} session`),onRestart:()=>void ae(async()=>{await ye.restartRoleSession(n.taskSlug,le,{cols:100,rows:28,permissionMode:g[le],model:A[le],effort:D[le]}),he(`restarted ${le} with ${g[le]} / ${A[le]} / ${D[le]}`)},`Restart ${le} session`),onNotifyHarnessUpdated:()=>void ae(async()=>{await ye.notifyRoleHarnessUpdated(n.taskSlug,le),he(`notified ${le} to reload latest harness`)},`Notify ${le} to reload harness`),onTerminalEvent:ke=>he(`${ee.label}: ${ke}`)})},le)})})})})]})}function ik(n){return Fs.some(r=>r.name===n)}function Yg(n){return[n.status,n.updatedAt,n.cleanupStatus??"",n.cleanedAt??""].join(":")}function Xg(n){var s;const r={...Z2};for(const l of $s)r[l.name]=((s=n.roles[l.name])==null?void 0:s.permissionMode)??r[l.name];return r}function Qg(n){var s;const r={...ek};for(const l of $s)r[l.name]=((s=n.roles[l.name])==null?void 0:s.model)??r[l.name];return r}function Jg(n){var s;const r={...tk};for(const l of $s)r[l.name]=((s=n.roles[l.name])==null?void 0:s.effort)??r[l.name];return r}const rk=120*1e3,Zg=1400,sk=3;function ak(n){return!!(n!=null&&n.initialized)}function lk(){const[n,r]=te.useState(null),[s,l]=te.useState([]),[d,_]=te.useState(null),[f,o]=te.useState(null),[c,h]=te.useState(null),[p,u]=te.useState(null),[v,w]=te.useState(null),[R,E]=te.useState(null),[y,S]=te.useState(null),[g,b]=te.useState(null),[A,L]=te.useState(null),[D,T]=te.useState(!1),[k,M]=te.useState(null),[B,H]=te.useState(null),[U,P]=te.useState(!1),[Y,X]=te.useState([]),[V,K]=te.useState(null),[ne,z]=te.useState(null),[j,N]=te.useState(null),[$,I]=te.useState(null),[se,ae]=te.useState(null),[he,W]=te.useState(null),[q,ie]=te.useState("project-manager"),[ee,le]=te.useState("system"),[ve,De]=te.useState(!0),[Ne,Be]=te.useState(!0),[ct,ke]=te.useState("off"),[Gt,rn]=te.useState(!1),[Vt,Kt]=te.useState(!1),[xn,xt]=te.useState(!1),[it,Ot]=te.useState(Y0),[pe,Se]=te.useState(X0),[Ae,je]=te.useState(!1),[He,mt]=te.useState(!1),[qe,bt]=te.useState(!1),[yt,Bt]=te.useState(!1),[tt,sn]=te.useState(!1),[we,Wt]=te.useState(null),[Nn,ai]=te.useState("bypassPermissions"),[Hn,jt]=te.useState("default"),[zn,Qn]=te.useState("medium"),[Ee,Yt]=te.useState(null),[In,fn]=te.useState("bypassPermissions"),[dn,Ui]=te.useState("default"),[Ie,Pi]=te.useState("medium"),[Fi,Ks]=te.useState(()=>J0()),[Jn,al]=te.useState(null),[li,At]=te.useState(0),[It,_i]=te.useState(null),[Ws,qo]=te.useState(null),[ll,ol]=te.useState(!1),[Un,qi]=te.useState(!1),[,St]=wr(""),vi=te.useRef({}),oi=te.useRef({}),yi=te.useRef({}),ut=te.useRef(null),$i=te.useRef(""),Jr=te.useRef(""),En=te.useRef(""),Zn=te.useRef(""),Ys=te.useRef(""),Xs=te.useRef({}),Q=te.useMemo(()=>S2(Y,V),[Y,V]),pn=(Jn==null?void 0:Jn.taskSlug)===(Q==null?void 0:Q.taskSlug)?Jn:null,Gi=c===(Q==null?void 0:Q.taskSlug)?d:null,Er=p===(Q==null?void 0:Q.taskSlug)?f:null,Ut=!!(n&&Q&&ak(Gi)),Xt=(we==null?void 0:we.status)==="running",Qs=!!(Vt&&Ut&&Xt),$o=!!(pn!=null&&pn.statusLoaded),Js=!!(Q&&(pn!=null&&pn.statusLoaded)&&!pn.hasAnySession),an=te.useCallback(G=>{le(G.themeMode),De(G.flowPauseAlerts),Be(G.roleRetryEnabled),ke(G.permissionRequestMode),rn(G.autoTaskHarnessReviewEnabled),Kt(G.translationEnabled),xt(G.translationAutoSendEnabled),Ot(G.translationTargetLanguage),Se(G.translationOutputMode),Ks(G.launchTemplate)},[]),ln=te.useCallback(()=>{ut.current!==null&&(window.clearInterval(ut.current),ut.current=null)},[]),cl=te.useCallback(()=>{ln(),Eo(),ut.current=window.setInterval(()=>{Eo()},Zg)},[ln]),on=te.useCallback(()=>{ln();let G=1;Eo(),ut.current=window.setInterval(()=>{G+=1,Eo(),G>=sk&&ut.current!==null&&(window.clearInterval(ut.current),ut.current=null)},Zg)},[ln]),Zr=te.useCallback((G,fe=`manual-${Date.now()}`,$e={})=>{_i({id:fe,text:G}),$e.sound==="strong"?cl():$e.sound==="weak"?on():ln()},[on,cl,ln]),ul=te.useCallback(()=>{ln(),_i(null)},[ln]);te.useEffect(()=>{Q!=null&&Q.taskSlug&&(yi.current[Q.taskSlug]=Date.now())},[Q==null?void 0:Q.taskSlug]);const Zs=te.useCallback(G=>{Q!=null&&Q.taskSlug&&z({taskSlug:Q.taskSlug,messages:G})},[Q==null?void 0:Q.taskSlug]),Vi=te.useCallback(G=>{Q!=null&&Q.taskSlug&&N({taskSlug:Q.taskSlug,orchestration:G})},[Q==null?void 0:Q.taskSlug]),hl=te.useCallback(G=>{Q!=null&&Q.taskSlug&&I({taskSlug:Q.taskSlug,events:G})},[Q==null?void 0:Q.taskSlug]),ea=te.useCallback((G,fe)=>{var dt;if(!Gt||!n||!Q||G.taskSlug!==Q.taskSlug||G.status!=="stopped"||!G.roundId||(fe==null?void 0:fe.status)!=="running"||((dt=G.roleRecovery)==null?void 0:dt.status)==="failed")return;const $e=e_(G);Xs.current[G.taskSlug]!==$e&&(Xs.current[G.taskSlug]=$e,ye.startTaskHarnessRetrospective({taskSlug:G.taskSlug,trigger:"auto"}).then(async gn=>{E(gn),await mn({syncLaunchOptions:!0})}).catch(gn=>{gk(gn)||St(Qe("Auto task harness review",gn))}))},[Q,Gt,n,mn]),Ki=te.useCallback(G=>{var pl,ml;if(!(Q!=null&&Q.taskSlug)||G.taskSlug!==Q.taskSlug)return;if(ae({taskSlug:G.taskSlug,roundState:G}),G.status==="running"&&G.activeRole==="gate-reviewer"&&ie("gate-reviewer"),((pl=G.roleRecovery)==null?void 0:pl.status)==="waiting"||((ml=G.roleRecovery)==null?void 0:ml.status)==="retrying"){oi.current[G.taskSlug]={status:G.status};return}if(G.status!=="stopped"||!G.roundId){oi.current[G.taskSlug]={status:G.status};return}const fe=e_(G),$e=vi.current[G.taskSlug],dt=oi.current[G.taskSlug];if(ea(G,dt),oi.current[G.taskSlug]={status:G.status},$e===fe||(vi.current[G.taskSlug]=fe,!hk(G,dt,yi.current[G.taskSlug])))return;const gn=G.activeRole??"role",ci=ve?uk(G)>=rk?"strong":"weak":"none",Xi=G.roleRecovery,na=(Xi==null?void 0:Xi.status)==="failed"?pk(Xi,gn):`No new turn started after ${gn} stopped.`;Zr(na,fe,{sound:ci})},[Q==null?void 0:Q.taskSlug,ea,ve,Zr]),Go=te.useCallback(G=>{al(fe=>(fe==null?void 0:fe.taskSlug)===G.taskSlug&&fe.statusLoaded===G.statusLoaded&&fe.sessionCount===G.sessionCount&&fe.hasAnySession===G.hasAnySession&&fe.hasGateReviewerSession===G.hasGateReviewerSession&&fe.allRolesHaveSession===G.allRolesHaveSession&&fe.autoOrchestration===G.autoOrchestration&&JSON.stringify(fe.roles)===JSON.stringify(G.roles)?fe:G)},[]);async function Si(){const G=await ye.listTasks();return X(G),K(fe=>{var $e;return fe&&G.some(dt=>dt.taskSlug===fe)?fe:(($e=G[0])==null?void 0:$e.taskSlug)??null}),G}async function es(G=Q==null?void 0:Q.taskSlug){if(!G)return _(null),h(null),null;const fe=await ye.getHarnessStatus(G);return _(fe),h(G),fe}async function kr(G=Q==null?void 0:Q.taskSlug){if(!G)return o(null),u(null),null;const fe=await ye.getHarnessBootstrapStatus(G);return o(fe),u(G),fe}async function Ar(){const G=await ye.getGatewayStatus();return S(G),G}async function Vo(){const G=await ye.getRecentRepositoryPaths();return l(G),G}async function Rr(){if(!n)return je(!1),!1;const G=await ye.getTranslationState();return je(G.memoryInitialized),G.memoryInitialized}async function kn(G){const[fe,$e]=await Promise.all([ye.listMessages(G),ye.getOrchestrationState(G)]);z({taskSlug:G,messages:fe}),N({taskSlug:G,orchestration:$e})}async function ts(G){const fe=await ye.getGateReviewState(G);return W({taskSlug:G,state:fe}),Oo("Poll Gate Review state"),St($e=>Ro($e,["Refresh Gate Review state","Poll Gate Review state"])),fe}function ns(G,fe){const $e=nf(G,fe);$e&&St($e)}function Qt(G){G&&(ai(G.permissionMode),G.model&&jt(G.model),G.effort&&Qn(G.effort))}async function bi(G={}){const fe=await ye.getTranslatorSession();return Wt(fe),G.syncLaunchOptions&&Qt(fe),fe}function ei(G){G&&(fn(G.permissionMode),G.model&&Ui(G.model),G.effort&&Pi(G.effort))}async function mn(G={}){const fe=await ye.getHarnessEngineerSession();return Yt(fe),G.syncLaunchOptions&&ei(fe),fe}function fl(G,fe,$e={}){var dt;Wt(G.translatorSession),je(!!((dt=G.translationState)!=null&&dt.memoryInitialized)),Yt(G.harnessEngineerSession),E(G.harnessFeedbackState),fe&&G.harnessStatus?(_(G.harnessStatus),h(fe)):(_(null),h(null)),fe&&G.harnessBootstrapStatus?(o(G.harnessBootstrapStatus),u(fe)):(o(null),u(null)),$e.syncLaunchOptions&&(Qt(G.translatorSession),ei(G.harnessEngineerSession))}async function Tr(G={}){if(!n)return Wt(null),je(!1),Yt(null),_(null),o(null),h(null),u(null),E(null),null;const fe=(Q==null?void 0:Q.taskSlug)??null,$e=await ye.getProjectRuntimeState(fe);return fl($e,fe,G),$e}function ti(){const G=["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 fe of G)Oo(fe);St(fe=>Ro(fe,G))}te.useEffect(()=>{Promise.all([ye.getCurrentProject(),ye.getRecentRepositoryPaths(),ye.getAppPreferences(),ye.getGatewayStatus()]).then(async([G,fe,$e,dt])=>{r(G),l(fe),S(dt),an($e),G&&await Si()}).catch(G=>St(Qe("Load initial app data",G)))},[an]),te.useEffect(()=>{const G=window.matchMedia("(prefers-color-scheme: dark)"),fe=()=>ol(G.matches);return fe(),G.addEventListener("change",fe),()=>G.removeEventListener("change",fe)},[]),te.useEffect(()=>()=>ln(),[ln]),te.useEffect(()=>{const G=ee==="system"?ll?"dark":"light":ee;document.documentElement.dataset.theme=G,document.documentElement.dataset.themeMode=ee},[ll,ee]),te.useEffect(()=>{if(!(y!=null&&y.enabled)||!n||!Q)return;const G=`${n.repoRoot}:${Q.taskSlug}`;if(y.currentProjectId===n.repoRoot&&y.currentTaskSlug===Q.taskSlug){$i.current=G;return}$i.current!==G&&($i.current=G,ye.updateGatewaySettings({currentProjectId:n.repoRoot,currentTaskSlug:Q.taskSlug}).then(fe=>S(fe)).catch(fe=>{$i.current===G&&($i.current=""),St(Qe("Sync Gateway active project/task",fe))}))},[Q==null?void 0:Q.taskSlug,y==null?void 0:y.currentProjectId,y==null?void 0:y.currentTaskSlug,y==null?void 0:y.enabled,n==null?void 0:n.repoRoot]),te.useEffect(()=>{if(!(Q!=null&&Q.taskSlug)){W(null);return}ts(Q.taskSlug).catch(G=>St(Qe("Refresh Gate Review state",G)))},[Q==null?void 0:Q.taskSlug]),te.useEffect(()=>{Jr.current="",En.current="",Zn.current="",Ys.current="",Wt(null),ai("bypassPermissions"),jt("default"),Qn("medium"),je(!1),Yt(null),fn("bypassPermissions"),Ui("default"),Pi("medium"),_(null),o(null),h(null),u(null),E(null)},[n==null?void 0:n.repoRoot]),tl(n?`project-runtime:${n.repoRoot}:${(Q==null?void 0:Q.taskSlug)??"no-task"}`:null,async()=>{try{const G=(n==null?void 0:n.repoRoot)??"",fe=!!(n&&Jr.current!==G);await Tr({syncLaunchOptions:fe}),fe&&(Jr.current=G),ti()}catch(G){ns("Poll project runtime state",G)}},{intervalMs:3e3,runImmediately:!0}),te.useEffect(()=>{if(!n||!(Q!=null&&Q.taskSlug)||!(Ee!=null&&Ee.claudeSessionId)||Ee.status==="running"||Ee.status==="done")return;const G=`${n.repoRoot}:${Q.taskSlug}:${Ee.claudeSessionId}`;Ys.current!==G&&(Ys.current=G,ye.resumeHarnessEngineerSession({taskSlug:Q.taskSlug,permissionMode:Ee.permissionMode,model:Ee.model,effort:Ee.effort}).then(fe=>{Yt(fe),ei(fe)}).catch(fe=>St(Qe("Resume Harness Engineer session",fe))))},[Q==null?void 0:Q.taskSlug,Ee==null?void 0:Ee.claudeSessionId,Ee==null?void 0:Ee.cwd,Ee==null?void 0:Ee.effort,Ee==null?void 0:Ee.model,Ee==null?void 0:Ee.permissionMode,Ee==null?void 0:Ee.status,n==null?void 0:n.repoRoot]),te.useEffect(()=>{!n||!(Q!=null&&Q.taskSlug)||!(Ee!=null&&Ee.claudeSessionId)||Ee.status!=="running"||Ee.cwd===Q.worktreePath||ye.ensureHarnessEngineerSession({taskSlug:Q.taskSlug,permissionMode:Ee.permissionMode,model:Ee.model,effort:Ee.effort}).then(G=>{Yt(G),ei(G)}).catch(G=>St(Qe("Move Harness Engineer session to active task worktree",G)))},[Q==null?void 0:Q.taskSlug,Q==null?void 0:Q.worktreePath,Ee==null?void 0:Ee.claudeSessionId,Ee==null?void 0:Ee.cwd,Ee==null?void 0:Ee.effort,Ee==null?void 0:Ee.model,Ee==null?void 0:Ee.permissionMode,Ee==null?void 0:Ee.status,n==null?void 0:n.repoRoot]),te.useEffect(()=>{if(!n||!(Q!=null&&Q.taskSlug)||!Ut||!(we!=null&&we.claudeSessionId)||we.status==="running"||we.status==="done")return;const G=`${n.repoRoot}:${Q.taskSlug}:${we.claudeSessionId}`;Zn.current!==G&&(Zn.current=G,ye.resumeTranslatorSession({taskSlug:Q.taskSlug,cols:100,rows:28,permissionMode:we.permissionMode,model:we.model,effort:we.effort}).then(fe=>{Wt(fe),Qt(fe)}).catch(fe=>{Zn.current="",St(Qe("Resume Translator session",fe))}))},[Q==null?void 0:Q.taskSlug,n==null?void 0:n.repoRoot,Ut,we==null?void 0:we.claudeSessionId,we==null?void 0:we.cwd,we==null?void 0:we.effort,we==null?void 0:we.model,we==null?void 0:we.permissionMode,we==null?void 0:we.status]),te.useEffect(()=>{!n||!(Q!=null&&Q.taskSlug)||!Ut||!(we!=null&&we.claudeSessionId)||we.status!=="running"||we.cwd===Q.worktreePath||ye.ensureTranslatorSession({taskSlug:Q.taskSlug,cols:100,rows:28,permissionMode:we.permissionMode,model:we.model,effort:we.effort}).then(G=>{Wt(G),Qt(G)}).catch(G=>St(Qe("Move Translator session to active task worktree",G)))},[Q==null?void 0:Q.taskSlug,Q==null?void 0:Q.worktreePath,n==null?void 0:n.repoRoot,Ut,we==null?void 0:we.claudeSessionId,we==null?void 0:we.cwd,we==null?void 0:we.effort,we==null?void 0:we.model,we==null?void 0:we.permissionMode,we==null?void 0:we.status]),te.useEffect(()=>{if(!n||!Vt||!(Q!=null&&Q.taskSlug)||!Ut||!Xt){En.current="";return}const G=`${n.repoRoot}:${Q.taskSlug}`;En.current===G&&(we==null?void 0:we.status)==="running"||(En.current=G,ye.ensureTranslatorSession({taskSlug:Q.taskSlug}).then(fe=>{Wt(fe),Qt(fe)}).catch(fe=>{En.current="",St(Qe("Ensure Translator session for active task",fe))}))},[n==null?void 0:n.repoRoot,Q==null?void 0:Q.taskSlug,Vt,Ut,Xt]);const cn=(Q==null?void 0:Q.taskSlug)??null,Ci=cn&&(he==null?void 0:he.taskSlug)===cn?he.state:null,Pn=cn&&(se==null?void 0:se.taskSlug)===cn?se.roundState:null,Dr=cn&&(Jn==null?void 0:Jn.taskSlug)===cn?Jn:null,is=!!(cn&&(Ci!=null&&Ci.activeGate||(Pn==null?void 0:Pn.activeRole)==="gate-reviewer"||Dr!=null&&Dr.hasGateReviewerSession));tl(is&&cn?`gate-review:${cn}`:null,async()=>{if(cn)try{await ts(cn)}catch(G){ns("Poll Gate Review state",G)}},{intervalMs:3e3,runImmediately:!1});async function Te(G,fe="Run UI action"){qi(!0),St("");try{await G()}catch($e){St(Qe(fe,$e))}finally{qi(!1)}}async function rs(){if(!Q)throw new Error("Create or select a task before closing it.");const G=[`Close task "${Q.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: ${Q.worktreePath}`,`- deletes the Git branch: ${Q.branch}`,"- deletes VCM task/session/message/orchestration state","","VCM will not check running sessions or uncommitted changes before closing."].join(`
96
- `);window.confirm(G)&&(await ye.cleanupTask(Q.taskSlug,{force:!0,forceDeleteBranch:!0}),K(null),z(null),N(null),I(null),ae(null),W(null),At($e=>$e+1),await Si())}const ss=ne&&ne.taskSlug===(Q==null?void 0:Q.taskSlug)?ne.messages:[],dl=j&&j.taskSlug===(Q==null?void 0:Q.taskSlug)?j.orchestration:null,Jt=$&&$.taskSlug===(Q==null?void 0:Q.taskSlug)?$.events:[],Ht=se&&se.taskSlug===(Q==null?void 0:Q.taskSlug)?se.roundState:null,Wi=Q!=null&&Q.taskSlug&&(Ht!=null&&Ht.roleRecovery)?fk(Q.taskSlug,Ht.roleRecovery):null,Yi=Ht!=null&&Ht.roleRecovery&&Ht.roleRecovery.status!=="failed"&&Wi!==Ws?dk(Ht.roleRecovery):null,ta=he&&he.taskSlug===(Q==null?void 0:Q.taskSlug)?he.state:null,as=!!(ta&&Object.values(ta.gates).some(G=>G.required));return x.jsxs(Z0,{sidebar:x.jsx(O2,{project:n,recentRepositoryPaths:s,tasks:Y,activeTaskSlug:(Q==null?void 0:Q.taskSlug)??null,messages:ss,orchestration:dl,events:Jt,roundState:Ht,gateReview:ta,translationEnabled:Qs,translationAutoSendEnabled:xn,translationTargetLanguage:it,translationOutputMode:pe,translationMemoryInitialized:Ae,translatorSession:we,harnessStatus:Gi,harnessBootstrapStatus:Er,harnessApplyResult:v,autoTaskHarnessReviewEnabled:Gt,gatewayStatus:y,gatewayQrLogin:g,gatewayQrCheck:A,gatewayLarkRegistration:k,gatewayLarkRegistrationCheck:B,busy:Un,onConnect:G=>Te(async()=>{const fe=await ye.connectProject({repoPath:G});r(fe),w(null),await Promise.all([Si(),Vo()])},"Connect repository"),onRefreshConnectedRepository:()=>Te(async()=>{const G=await ye.getCurrentProject();r(G)},"Refresh connected repository"),onPullConnectedRepository:()=>Te(async()=>{const G=await ye.pullCurrentProject();r(G)},"Pull connected repository"),onRefreshHarness:()=>Te(async()=>{if(!Q)throw new Error("Create or select a task before refreshing VCM Harness.");w(null),await Promise.all([es(Q.taskSlug),kr(Q.taskSlug)])},"Refresh VCM Harness"),onApplyHarness:()=>Te(async()=>{if(!Q)throw new Error("Create or select a task before applying VCM Harness.");const G=await ye.applyHarness({taskSlug:Q.taskSlug});w(G),await Promise.all([es(Q.taskSlug),kr(Q.taskSlug)])},"Apply VCM Harness"),onStartHarnessBootstrap:G=>Te(async()=>{if(!Q)throw new Error("Create or select a task before starting Harness Bootstrap.");const fe=await ye.startHarnessBootstrap({taskSlug:Q.taskSlug,cols:120,rows:32,...G});o(fe.status),u(Q.taskSlug),await mn({syncLaunchOptions:!0})},"Start Harness Bootstrap"),onRestartHarnessBootstrap:G=>Te(async()=>{if(!Q)throw new Error("Create or select a task before restarting Harness Bootstrap.");const fe=await ye.restartHarnessBootstrap({taskSlug:Q.taskSlug,cols:120,rows:32,...G});o(fe.status),u(Q.taskSlug),await mn({syncLaunchOptions:!0})},"Restart Harness Bootstrap"),onStopHarnessBootstrap:()=>Te(async()=>{const G=await ye.stopHarnessBootstrap();o(G),u((Q==null?void 0:Q.taskSlug)??null),await mn()},"Stop Harness Bootstrap"),onRunHarnessBootstrap:()=>Te(async()=>{if(!Q)throw new Error("Create or select a task before running Harness Bootstrap.");const G=await ye.runHarnessBootstrap({taskSlug:Q.taskSlug});o(G.status),u(Q.taskSlug),await mn()},"Run Harness Bootstrap"),onOpenHarnessStudio:()=>Bt(!0),onOpenRepositoryDiff:()=>sn(!0),onAutoTaskHarnessReviewChange:G=>{rn(G),Te(async()=>{const fe=await ye.updateAppPreferences({autoTaskHarnessReviewEnabled:G});an(fe)},"Update auto task harness review setting")},onRefreshGateway:()=>Te(async()=>{await Ar()},"Refresh Gateway status"),onGatewayEnabledChange:G=>{Te(async()=>{const fe=await ye.updateGatewaySettings({enabled:G,...G&&n?{currentProjectId:n.repoRoot,currentTaskSlug:(Q==null?void 0:Q.taskSlug)??null}:{}});S(fe)},"Update Gateway enabled setting")},onGatewaySettingsChange:G=>Te(async()=>{const fe=await ye.updateGatewaySettings(G);S(fe)},"Update Gateway settings"),onGatewayTranslationChange:G=>{Te(async()=>{const fe=await ye.updateGatewaySettings({translationEnabled:G});S(fe)},"Update Gateway translation setting")},onCreateGatewayPairingCode:async()=>{qi(!0),St("");try{const G=await ye.createGatewayPairingCode();return S(G.status),G}catch(G){throw St(Qe("Create Gateway pairing code",G)),G}finally{qi(!1)}},onStartGatewayQrLogin:()=>{Te(async()=>{const G=await ye.startGatewayQrLogin();b(G),L(null),T(!0),await Ar()},"Start Gateway QR login")},onStartGatewayLarkRegistration:()=>{Te(async()=>{const G=await ye.startGatewayLarkRegistration();M(G),H(null),P(!0),await Ar()},"Start Lark Gateway QR setup")},onResetGatewayBinding:()=>{Te(async()=>{const G=await ye.resetGatewayBinding();S(G),b(null),L(null),T(!1),M(null),H(null),P(!1)},"Reset Gateway binding")},onGateReviewGateEnabledChange:(G,fe)=>{Te(async()=>{if(!Q)throw new Error("Create or select a task before changing Gate Review Gates.");const $e=await ye.updateGateReviewSettings(Q.taskSlug,{gates:{[G]:fe}});W({taskSlug:Q.taskSlug,state:$e})},`Update ${G} Gate Review setting`)},onTranslationEnabledChange:G=>{Kt(G),Te(async()=>{const fe=await ye.updateAppPreferences({translationEnabled:G});an(fe)},"Update conversation translation setting")},onTranslationAutoSendChange:G=>{xt(G),Te(async()=>{const fe=await ye.updateAppPreferences({translationAutoSendEnabled:G});an(fe)},"Update translation auto-send setting")},onTranslationTargetLanguageChange:G=>{Ot(G),Te(async()=>{const fe=await ye.updateAppPreferences({translationTargetLanguage:G});an(fe)},"Update translation target language")},onTranslationOutputModeChange:G=>{Se(G),Te(async()=>{const fe=await ye.updateAppPreferences({translationOutputMode:G});an(fe)},"Update translation output mode")},onOpenFileTranslation:()=>mt(!0),onOpenTranslatorSession:()=>bt(!0),onCreateTranslationBootstrap:()=>{Te(async()=>{if(!Q)throw new Error("Create or select a task before running Translation Bootstrap.");await ye.createTranslationBootstrap({taskSlug:Q.taskSlug,targetLanguage:it}),await Rr(),await bi()},"Create Translation Bootstrap task")},onUpdateTranslationMemory:()=>{Te(async()=>{if(!Q)throw new Error("Create or select a task before updating translation memory.");await ye.createTranslationMemoryUpdate({taskSlug:Q.taskSlug,targetLanguage:it}),await Rr(),await bi()},"Create translation memory update task")},onCreateTask:G=>Te(async()=>{const fe=await ye.createTask(G);await Si(),K(fe.taskSlug)},"Create task"),onCloseTask:()=>{Te(rs,"Close task")},onSelectTask:K,themeMode:ee,onAutoOrchestrationChange:G=>{Te(async()=>{if(!Q)throw new Error("Create or select a task before changing auto orchestration.");const fe=await ye.updateOrchestrationState(Q.taskSlug,{mode:G?"auto":"manual"});N({taskSlug:Q.taskSlug,orchestration:fe})},"Update auto orchestration mode")},onThemeModeChange:G=>{le(G),Te(async()=>{const fe=await ye.updateAppPreferences({themeMode:G});an(fe)},"Update theme setting")},pauseAlertSound:ve,onPauseAlertSoundChange:G=>{De(G),G&&yk(),Te(async()=>{const fe=await ye.updateAppPreferences({flowPauseAlerts:G});an(fe)},"Update pause alert sound setting")},roleRetryEnabled:Ne,onRoleRetryEnabledChange:G=>{Be(G),Te(async()=>{const fe=await ye.updateAppPreferences({roleRetryEnabled:G});an(fe)},"Update CC retry setting")},permissionRequestMode:ct,onPermissionRequestModeChange:G=>{ke(G),Te(async()=>{const fe=await ye.updateAppPreferences({permissionRequestMode:G});an(fe)},"Update permission request setting")},launchTemplate:Fi,canSaveLaunchTemplate:$o,canOneClickStart:Js,onSaveLaunchTemplate:()=>{Te(async()=>{if(!(pn!=null&&pn.statusLoaded))throw new Error("Open a task workspace before saving a launch template.");const G=await ye.updateAppPreferences({launchTemplate:{version:1,roles:pn.roles,autoOrchestration:pn.autoOrchestration}});an(G)},"Save launch template")},onOneClickStart:()=>{Te(async()=>{if(!Q)throw new Error("Create or select a task before one-click start.");const G=await ye.getTaskStatus(Q.taskSlug);if(G.sessions.some(dt=>Nh.some(gn=>gn===dt.role)))throw new Error("One-click start is only available before any role session has started.");const fe=await ye.updateOrchestrationState(Q.taskSlug,{mode:Fi.autoOrchestration?"auto":"manual"});N({taskSlug:Q.taskSlug,orchestration:fe});const $e=b2(Fi,{gateReviewerEnabled:as});for(const dt of $e){const gn={cols:100,rows:28,permissionMode:dt.permissionMode,model:dt.model,effort:dt.effort},ci=G.sessions.find(Xi=>Xi.role===dt.role);(ci==null?void 0:ci.status)!=="running"&&(ci!=null&&ci.claudeSessionId?await ye.resumeRoleSession(Q.taskSlug,dt.role,gn):await ye.startRoleSession(Q.taskSlug,dt.role,gn))}ie("project-manager"),await kn(Q.taskSlug),await Si(),At(dt=>dt+1)},"One-click start role sessions")},onMarkAllMessagesDone:G=>{Te(async()=>{const fe=await ye.markAllMessagesDone(G);z({taskSlug:G,messages:fe.messages}),await kn(G)},"Mark all role messages done")},onDeleteMessageHistory:G=>{Te(async()=>{const fe=await ye.deleteMessageHistory(G);z({taskSlug:G,messages:fe.messages}),await kn(G)},"Delete role message history")}}),children:[x.jsx(v2,{}),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:ul,children:"Confirm"})]})}):null,Yi&&Wi?x.jsxs("div",{className:"role-recovery-toast",role:"status",children:[x.jsx("span",{children:Yi}),x.jsx("button",{type:"button",onClick:()=>qo(Wi),children:"Close"})]}):null,D&&g?x.jsx(ok,{busy:Un,qrCheck:A,qrLogin:g,onCheck:()=>{Te(async()=>{const G=await ye.checkGatewayQrLogin();L(G),(G.status==="confirmed"||G.status==="binded_redirect")&&T(!1),await Ar()})},onClose:()=>T(!1)}):null,U&&k?x.jsx(ck,{busy:Un,registration:k,registrationCheck:B,onCheck:()=>{Te(async()=>{const G=await ye.checkGatewayLarkRegistration();H(G),G.gatewayStatus&&S(G.gatewayStatus),G.status==="confirmed"&&(P(!1),await Ar())},"Check Lark Gateway QR setup")},onClose:()=>P(!1)}):null,n&&Q?x.jsx(nk,{task:Q,activeRole:q,gateReviewerEnabled:as,translationEnabled:Qs,translationAutoSendEnabled:xn,translationTargetLanguage:it,translationOutputMode:pe,launchTemplate:Fi,refreshNonce:li,onTaskChanged:async()=>{await Si()},onActiveRoleChange:ie,onMessagesChanged:Zs,onOrchestrationChanged:Vi,onRoundStateChanged:Ki,onEventsChanged:hl,onLaunchStateChanged:Go}):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(s2,{open:He,taskSlug:(Q==null?void 0:Q.taskSlug)??null,targetLanguage:it,onClose:()=>mt(!1)}),x.jsx(_1,{open:yt,busy:Un,status:Gi,bootstrapStatus:Er,engineerSession:Ee,permissionMode:In,model:dn,effort:Ie,taskSlug:(Q==null?void 0:Q.taskSlug)??null,onClose:()=>Bt(!1),onRefresh:()=>{Te(async()=>{if(!Q)throw new Error("Create or select a task before refreshing Harness Studio.");await Promise.all([es(Q.taskSlug),kr(Q.taskSlug),mn()])},"Refresh Harness Studio")},onPermissionModeChange:fn,onModelChange:Ui,onEffortChange:Pi,onEngineerStart:()=>{Te(async()=>{if(!Q)throw new Error("Create or select a task before starting Harness Engineer.");const G=await ye.startHarnessEngineerSession({taskSlug:Q.taskSlug,cols:120,rows:32,permissionMode:In,model:dn,effort:Ie});Yt(G),ei(G)},"Start Harness Engineer")},onEngineerResume:()=>{Te(async()=>{if(!Q)throw new Error("Create or select a task before resuming Harness Engineer.");const G=await ye.resumeHarnessEngineerSession({taskSlug:Q.taskSlug,cols:120,rows:32,permissionMode:In,model:dn,effort:Ie});Yt(G),ei(G)},"Resume Harness Engineer")},onEngineerRestart:()=>{Te(async()=>{if(!Q)throw new Error("Create or select a task before restarting Harness Engineer.");const G=await ye.restartHarnessEngineerSession({taskSlug:Q.taskSlug,cols:120,rows:32,permissionMode:In,model:dn,effort:Ie});Yt(G),ei(G)},"Restart Harness Engineer")},onEngineerStop:()=>{Te(async()=>{const G=await ye.stopHarnessEngineerSession();Yt(G)},"Stop Harness Engineer")},onEngineerNotifyHarnessUpdated:()=>{Te(async()=>{const G=await ye.notifyHarnessEngineerHarnessUpdated();Yt(G),ei(G)},"Notify Harness Engineer to reload harness")},onOpenRepositoryDiff:()=>sn(!0),onReviewTaskHarness:()=>{Te(async()=>{if(!Q)throw new Error("Create or select a task before reviewing task harness.");const G=await ye.startTaskHarnessRetrospective({taskSlug:Q.taskSlug,trigger:"manual"});E(G),await mn({syncLaunchOptions:!0})},"Review task harness")}}),x.jsx(y1,{open:tt,taskSlug:(Q==null?void 0:Q.taskSlug)??null,onClose:()=>sn(!1)}),x.jsx(x1,{open:qe,busy:Un,session:we,permissionMode:Nn,model:Hn,effort:zn,onClose:()=>bt(!1),onPermissionModeChange:ai,onModelChange:jt,onEffortChange:Qn,onStart:()=>{Te(async()=>{if(!Q)throw new Error("Create or select a task before starting Translator.");const G=await ye.startTranslatorSession({taskSlug:Q.taskSlug,cols:100,rows:28,permissionMode:Nn,model:Hn,effort:zn});Wt(G),Qt(G)},"Start Translator session")},onResume:()=>{Te(async()=>{if(!Q)throw new Error("Create or select a task before resuming Translator.");const G=await ye.resumeTranslatorSession({taskSlug:Q.taskSlug,cols:100,rows:28,permissionMode:Nn,model:Hn,effort:zn});Wt(G),Qt(G)},"Resume Translator session")},onRestart:()=>{Te(async()=>{if(!Q)throw new Error("Create or select a task before restarting Translator.");const G=await ye.restartTranslatorSession({taskSlug:Q.taskSlug,cols:100,rows:28,permissionMode:Nn,model:Hn,effort:zn});Wt(G),Qt(G)},"Restart Translator session")},onStop:()=>{Te(async()=>{const G=await ye.stopTranslatorSession();Wt(G)},"Stop Translator session")},onNotifyHarnessUpdated:()=>{Te(async()=>{const G=await ye.notifyTranslatorHarnessUpdated();Wt(G),Qt(G)},"Notify Translator to reload harness")}}),x.jsx(e1,{busy:Un,state:R,onCancel:G=>{Te(async()=>{const fe=await ye.decideHarnessFeedback({action:"cancel",taskSlug:Q==null?void 0:Q.taskSlug,comment:G});E(fe)},"Cancel Harness feedback")},onApprove:G=>{Te(async()=>{if(!Q)throw new Error("Create or select a task before approving Harness feedback.");const fe=await ye.decideHarnessFeedback({action:"approve",taskSlug:Q.taskSlug,comment:G});E(fe),await mn()},"Approve Harness feedback")},onComment:G=>{Te(async()=>{if(!Q)throw new Error("Create or select a task before sending Harness feedback comments.");const fe=await ye.decideHarnessFeedback({action:"comment",taskSlug:Q.taskSlug,comment:G});E(fe),await mn()},"Send Harness feedback comment")},onReject:G=>{Te(async()=>{const fe=await ye.decideHarnessFeedback({action:"reject",taskSlug:Q==null?void 0:Q.taskSlug,comment:G});E(fe)},"Reject Harness feedback")}})]})}function ok({busy:n,onCheck:r,onClose:s,qrCheck:l,qrLogin:d}){const[_,f]=te.useState(""),[o,c]=wr("");return te.useEffect(()=>{let h=!1;if(c(""),f(""),d.qrcodeUrl.startsWith("data:image/")){f(d.qrcodeUrl);return}try{const p=Xr(0,"M");p.addData(d.qrcodeUrl),p.make(),h||f(p.createDataURL(8,2))}catch(p){h||c(Qe("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:_?x.jsx("img",{alt:"Weixin Gateway QR login",src:_}):x.jsx("div",{className:"gateway-qr-placeholder",children:o?"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:(l==null?void 0:l.status)??d.status})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Expires"}),x.jsx("dd",{children:Ev(d.expiresAt)})]}),l!=null&&l.message?x.jsxs("div",{children:[x.jsx("dt",{children:"Message"}),x.jsx("dd",{children:l.message})]}):null]})]}),x.jsx("footer",{children:x.jsx("button",{type:"button",disabled:n,onClick:r,children:"Confirm"})})]})})}function ck({busy:n,onCheck:r,onClose:s,registration:l,registrationCheck:d}){const[_,f]=te.useState(""),[o,c]=wr("");return te.useEffect(()=>{let h=!1;c(""),f("");try{const p=Xr(0,"M");p.addData(l.qrUrl),p.make(),h||f(p.createDataURL(8,2))}catch(p){h||c(Qe("Render Lark Gateway setup QR code",p))}return()=>{h=!0}},[l.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:_?x.jsx("img",{alt:"Lark Gateway setup QR code",src:_}):x.jsx("div",{className:"gateway-qr-placeholder",children:o?"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:(d==null?void 0:d.status)??l.status})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Expires"}),x.jsx("dd",{children:Ev(l.expiresAt)})]}),l.userCode?x.jsxs("div",{children:[x.jsx("dt",{children:"User Code"}),x.jsx("dd",{children:l.userCode})]}):null,d!=null&&d.larkBotName?x.jsxs("div",{children:[x.jsx("dt",{children:"Bot"}),x.jsx("dd",{children:d.larkBotName})]}):null,d!=null&&d.message?x.jsxs("div",{children:[x.jsx("dt",{children:"Message"}),x.jsx("dd",{children:d.message})]}):null]}),x.jsx("a",{href:l.qrUrl,target:"_blank",rel:"noreferrer",children:"Open setup link"})]}),x.jsx("footer",{children:x.jsx("button",{type:"button",disabled:n,onClick:r,children:"Confirm"})})]})})}function Ev(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 Wr=null;function uk(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 hk(n,r,s){if((r==null?void 0:r.status)==="running")return!0;const l=Date.parse(n.stoppedAt??n.lastTurnEndedAt??"");return!!(s&&Number.isFinite(l)&&l>s)}function e_(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=_k(n.role),s=kv(n);return n.status==="retrying"?`CC 出错,正在重试 ${r}${s} · 第 ${n.attempt}/${n.maxAttempts} 次`:`CC 出错,重试中 ${r}${s} · 第 ${n.attempt}/${n.maxAttempts} 次 · ${vk(n.nextRetryAt)}`}function pk(n,r){const s=kv(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 kv(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["Task final acceptance is not complete yet.","Task Harness Retrospective has already been triggered","Harness feedback is already active.","Harness Engineer is reserved for an active Harness feedback item.","Harness Engineer is busy or unavailable."].some(r=>n.message.includes(r))}function _k(n){return n.split("-").filter(Boolean).map(r=>`${r.slice(0,1).toUpperCase()}${r.slice(1)}`).join(" ")}function vk(n){if(!n)return"即将重试";const r=Date.parse(n)-Date.now();return!Number.isFinite(r)||r<=0?"即将重试":`${Math.ceil(r/6e4)} 分钟后`}async function yk(){const n=Av();return n?Rv(n):!1}async function Eo(){const n=Av();if(!n||!await Rv(n))return!1;try{const s=n.createGain(),l=n.currentTime+.025;return s.gain.setValueAtTime(.85,n.currentTime),s.connect(n.destination),i_(n,s,{frequency:587.33,startAt:l,duration:.18,peakGain:.045}),i_(n,s,{frequency:783.99,startAt:l+.11,duration:.28,peakGain:.055}),window.setTimeout(()=>{s.disconnect()},800),!0}catch{return!1}}function Av(){const n=window.AudioContext??window.webkitAudioContext;if(!n)return null;try{return(!Wr||Wr.state==="closed")&&(Wr=new n),Wr}catch{return null}}function t_(n){Wr=null,n&&n.state!=="closed"&&n.close().catch(()=>{})}async function Rv(n){if(n_(n))return!0;try{await n.resume();const r=n_(n);return!r&&n===Wr&&t_(n),r}catch{return n===Wr&&t_(n),!1}}function n_(n){return n.state==="running"}function i_(n,r,s){const l=n.createGain(),d=n.createOscillator(),_=n.createOscillator(),f=s.startAt+s.duration;l.gain.setValueAtTime(1e-4,s.startAt),l.gain.exponentialRampToValueAtTime(s.peakGain,s.startAt+.018),l.gain.exponentialRampToValueAtTime(1e-4,f),d.type="sine",d.frequency.setValueAtTime(s.frequency,s.startAt),_.type="triangle",_.frequency.setValueAtTime(s.frequency*2.01,s.startAt),d.connect(l),_.connect(l),l.connect(r),d.start(s.startAt),_.start(s.startAt),d.stop(f+.02),_.stop(f+.02)}const Tv=document.getElementById("root");if(!Tv)throw new Error("Missing #root element.");H0.createRoot(Tv).render(x.jsx(te.StrictMode,{children:x.jsx(lk,{})}));
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:o,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:l,children:"Close"})]})]}),x.jsx(A2,{busy:n,maxMessages:null,messages:r,orchestration:s,showControls:!1,showHeader:!1})]})})}function Gr({children:n,onOpenChange:r,open:s,title:l}){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:l}),x.jsx("span",{"aria-hidden":"true",className:"sidebar-section-chevron"})]}),s?x.jsx("div",{className:"sidebar-section-content",children:n}):null]})}function Oh(n,r){return n.find(s=>s.role===r)}function Y2({activeRole:n,roles:r=jh,sessions:s,onSelect:l}){return x.jsx("div",{className:"role-tabs",role:"tablist","aria-label":"Role sessions",children:r.map(d=>{const g=Oh(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:()=>l(d.name),children:[x.jsx("span",{children:d.label}),x.jsx(zi,{status:f})]},d.name)})})}function X2({role:n,session:r,permissionMode:s,model:l,effort:d,active:g=!0,busy:f,translationEnabled:o,translationAutoSendEnabled:c,translationTargetLanguage:h,translationRole:p=n,translationSession:u=r,onPermissionModeChange:b,onModelChange:w,onEffortChange:R,onStart:E,onResume:v,onStop:y,onRestart:_,onNotifyHarnessUpdated:S,onTerminalEvent:A}){const L=g&&W0(p)&&o&&(u==null?void 0:u.status)==="running";return x.jsx("section",{className:"session-console",children:x.jsxs("div",{className:L?"session-console-body has-translation":"session-console-body",children:[x.jsxs("div",{className:"terminal-pane",children:[x.jsx(Hh,{role:n,session:r,permissionMode:s,model:l,effort:d,busy:f,onPermissionModeChange:b,onModelChange:w,onEffortChange:R,onStart:E,onResume:v,onStop:y,onRestart:_,onNotifyHarnessUpdated:S}),(r==null?void 0:r.status)==="running"?x.jsx(No,{sessionId:r.id,active:g,onEvent:A},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."})]})]}),L?x.jsx("div",{className:"translation-pane",children:x.jsx(n2,{active:g,autoSendEnabled:c,targetLanguage:h,taskSlug:u.taskSlug,role:p,sessionId:u.id},`${p}:${u.id}`)}):null]})})}function Q2(n,r,s){var g;if(!n||s.mode!=="auto")return null;const l=new Map(n.map(f=>[f.id,f])),d=r.filter(f=>{var o;return f.dispatchingAt?((o=l.get(f.id))==null?void 0:o.dispatchingAt)!==f.dispatchingAt:!1});return d.length===0?null:((g=d.sort(J2)[d.length-1])==null?void 0:g.toRole)??null}function J2(n,r){const s=n.dispatchingAt??n.deliveredAt??n.acceptedAt??"",l=r.dispatchingAt??r.deliveredAt??r.acceptedAt??"";return s!==l?s.localeCompare(l):n.createdAt.localeCompare(r.createdAt)}const Z2={"project-manager":"bypassPermissions",architect:"bypassPermissions",coder:"bypassPermissions",reviewer:"bypassPermissions","gate-reviewer":"bypassPermissions",translator:"bypassPermissions","harness-engineer":"bypassPermissions"},ek={"project-manager":"default",architect:"default",coder:"default",reviewer:"default","gate-reviewer":"default",translator:"default","harness-engineer":"default"},tk={"project-manager":"default",architect:"default",coder:"default",reviewer:"default","gate-reviewer":"default",translator:"medium","harness-engineer":"medium"};function nk({task:n,activeRole:r,gateReviewerEnabled:s,translationEnabled:l,translationAutoSendEnabled:d,translationTargetLanguage:g,translationOutputMode:f,launchTemplate:o,refreshNonce:c=0,onTaskChanged:h,onActiveRoleChange:p,onMessagesChanged:u,onOrchestrationChanged:b,onRoundStateChanged:w,onEventsChanged:R,onLaunchStateChanged:E}){const[v,y]=te.useState(null),[_,S]=te.useState(()=>Xg(o)),[A,L]=te.useState(()=>Qg(o)),[D,T]=te.useState(()=>Jg(o)),[k,M]=te.useState(!1),[,B]=br(""),[H,U]=te.useState([]),[P,Y]=te.useState(null),X=te.useRef(null),V=te.useRef(""),K=te.useMemo(()=>JSON.stringify(o),[o]),ne=!!(v!=null&&v.sessions.some(ee=>ee.role==="gate-reviewer")),z=s||ne,j=[...Fs,...z?[a_]:[]],N=te.useCallback((ee,le)=>{var Ne;const ve=((Ne=X.current)==null?void 0:Ne.taskSlug)===n.taskSlug?X.current.messages:null,De=Q2(ve,ee,le);X.current={taskSlug:n.taskSlug,messages:ee},Y(le),u==null||u(ee),b==null||b(le),De&&(p(De),he(`auto switched to ${De} before VCM dispatch`))},[p,u,b,n.taskSlug]),$=te.useCallback((ee,le,ve,De)=>{y(ee),N(le,ve),w==null||w(De)},[N,w]),I=te.useCallback(async()=>{const ee=await ye.getTaskWorkspaceState(n.taskSlug);$(ee.taskStatus,ee.messages,ee.orchestration,ee.roundState),Lo("Poll task workspace state"),B(le=>Ao(le,["Load task workspace state","Poll task workspace state"]))},[$,n.taskSlug]),se=te.useCallback((ee,le)=>{const ve=nf(ee,le);ve&&B(ve)},[]);tl(`task-workspace:${n.taskSlug}:${c}`,()=>I().catch(ee=>{se("Poll task workspace state",ee)}),{intervalMs:3e3,runImmediately:!0}),te.useEffect(()=>{U([]),R==null||R([])},[R,n.taskSlug]),te.useEffect(()=>{S(Xg(o)),L(Qg(o)),T(Jg(o))},[K,n.taskSlug]),te.useEffect(()=>{v&&!z&&r==="gate-reviewer"&&p("project-manager"),v&&r==="translator"&&p("project-manager")},[r,z,p,v]),te.useEffect(()=>{const ee=v==null?void 0:v.task;if(!ee||ee.taskSlug!==n.taskSlug)return;const le=Yg(ee);if(le===Yg(n)){V.current="";return}V.current!==le&&(V.current=le,h().catch(ve=>{V.current="",B(Je("Refresh task list after task status changed",ve))}))},[h,v==null?void 0:v.task,n]),te.useEffect(()=>{const ee=(v==null?void 0:v.sessions)??[],le=ee.filter(je=>ik(je.role)),ve=new Set(le.map(je=>je.role)),De=ee.some(je=>je.role==="gate-reviewer"),Ne={};for(const je of $s)Ne[je.name]={permissionMode:_[je.name],model:A[je.name],effort:D[je.name]};E==null||E({taskSlug:n.taskSlug,roles:Ne,autoOrchestration:((P==null?void 0:P.mode)??"auto")==="auto",statusLoaded:!!v,sessionCount:le.length,hasAnySession:le.length>0,hasGateReviewerSession:De,allRolesHaveSession:Fs.every(je=>ve.has(je.name))})},[A,D,E,P==null?void 0:P.mode,_,v,n.taskSlug]);async function ae(ee,le="Run role session action"){M(!0),B("");try{await ee(),await I(),await h()}catch(ve){B(Je(le,ve))}finally{M(!1)}}function he(ee){U(le=>{const ve=[...le,`${new Date().toLocaleTimeString()} ${ee}`];return R==null||R(ve),ve})}function W(ee,le){S(ve=>({...ve,[ee]:le}))}function q(ee,le){L(ve=>({...ve,[ee]:le}))}function ie(ee,le){T(ve=>({...ve,[ee]:le}))}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(Y2,{activeRole:r,roles:j,sessions:(v==null?void 0:v.sessions)??[],onSelect:p})]}),x.jsx("div",{className:"workspace-grid",children:x.jsx("div",{className:"workspace-main",children:x.jsx("div",{className:"role-console-stack",children:j.map(ee=>{const le=ee.name,ve=le===r,De=(v==null?void 0:v.sessions)??[],Ne=Oh(De,le),je=f==="pm-final-only"?"project-manager":le,ct=Oh(De,je);return x.jsx("div",{className:ve?"role-console-panel is-active":"role-console-panel","aria-hidden":!ve,children:x.jsx(X2,{role:le,session:Ne,permissionMode:_[le],model:A[le],effort:D[le],active:ve,busy:k,translationEnabled:l,translationAutoSendEnabled:d,translationTargetLanguage:g,translationRole:je,translationSession:ct,onPermissionModeChange:Ee=>W(le,Ee),onModelChange:Ee=>q(le,Ee),onEffortChange:Ee=>ie(le,Ee),onStart:()=>void ae(async()=>{await ye.startRoleSession(n.taskSlug,le,{cols:100,rows:28,permissionMode:_[le],model:A[le],effort:D[le]}),he(`started ${le} with ${_[le]} / ${A[le]} / ${D[le]}`)},`Start ${le} session`),onResume:()=>void ae(async()=>{await ye.resumeRoleSession(n.taskSlug,le,{cols:100,rows:28,permissionMode:_[le],model:A[le],effort:D[le]}),he(`resumed ${le} with ${_[le]} / ${A[le]} / ${D[le]}`)},`Resume ${le} session`),onStop:()=>void ae(async()=>{await ye.stopRoleSession(n.taskSlug,le),he(`stopped ${le}`)},`Stop ${le} session`),onRestart:()=>void ae(async()=>{await ye.restartRoleSession(n.taskSlug,le,{cols:100,rows:28,permissionMode:_[le],model:A[le],effort:D[le]}),he(`restarted ${le} with ${_[le]} / ${A[le]} / ${D[le]}`)},`Restart ${le} session`),onNotifyHarnessUpdated:()=>void ae(async()=>{await ye.notifyRoleHarnessUpdated(n.taskSlug,le),he(`notified ${le} to reload latest harness`)},`Notify ${le} to reload harness`),onTerminalEvent:Ee=>he(`${ee.label}: ${Ee}`)})},le)})})})})]})}function ik(n){return Fs.some(r=>r.name===n)}function Yg(n){return[n.status,n.updatedAt,n.cleanupStatus??"",n.cleanedAt??""].join(":")}function Xg(n){var s;const r={...Z2};for(const l of $s)r[l.name]=((s=n.roles[l.name])==null?void 0:s.permissionMode)??r[l.name];return r}function Qg(n){var s;const r={...ek};for(const l of $s)r[l.name]=((s=n.roles[l.name])==null?void 0:s.model)??r[l.name];return r}function Jg(n){var s;const r={...tk};for(const l of $s)r[l.name]=((s=n.roles[l.name])==null?void 0:s.effort)??r[l.name];return r}const rk=120*1e3,Zg=1400,sk=3;function ak(n){return!!(n!=null&&n.initialized)}function lk(){const[n,r]=te.useState(null),[s,l]=te.useState([]),[d,g]=te.useState(null),[f,o]=te.useState(null),[c,h]=te.useState(null),[p,u]=te.useState(null),[b,w]=te.useState(null),[R,E]=te.useState(null),[v,y]=te.useState(null),[_,S]=te.useState(null),[A,L]=te.useState(null),[D,T]=te.useState(!1),[k,M]=te.useState(null),[B,H]=te.useState(null),[U,P]=te.useState(!1),[Y,X]=te.useState([]),[V,K]=te.useState(null),[ne,z]=te.useState(null),[j,N]=te.useState(null),[$,I]=te.useState(null),[se,ae]=te.useState(null),[he,W]=te.useState(null),[q,ie]=te.useState("project-manager"),[ee,le]=te.useState("system"),[ve,De]=te.useState(!0),[Ne,je]=te.useState(!0),[ct,Ee]=te.useState("off"),[Yt,sn]=te.useState(!1),[Nt,dn]=te.useState(!1),[En,wt]=te.useState(!1),[it,Ot]=te.useState(Y0),[pe,Se]=te.useState(X0),[ke,Oe]=te.useState(!1),[He,_t]=te.useState(!1),[qe,St]=te.useState(!1),[yt,Bt]=te.useState(!1),[Ze,an]=te.useState(!1),[we,Ut]=te.useState(null),[Yn,Xn]=te.useState("bypassPermissions"),[Pt,pn]=te.useState("default"),[Qn,Xt]=te.useState("medium"),[Re,Ht]=te.useState(null),[kn,Ft]=te.useState("bypassPermissions"),[Ui,Ue]=te.useState("default"),[gi,Xr]=te.useState("medium"),[Pi,Ks]=te.useState(()=>J0()),[Jn,sl]=te.useState(null),[ai,At]=te.useState(0),[qt,_i]=te.useState(null),[Ws,Fo]=te.useState(null),[al,ll]=te.useState(!1),[zn,Qr]=te.useState(!1),[,xt]=br(""),vi=te.useRef({}),li=te.useRef({}),yi=te.useRef({}),ut=te.useRef(null),Fi=te.useRef(""),Jr=te.useRef(""),An=te.useRef(""),Zn=te.useRef(""),Ys=te.useRef(""),Xs=te.useRef({}),Q=te.useMemo(()=>S2(Y,V),[Y,V]),mn=(Jn==null?void 0:Jn.taskSlug)===(Q==null?void 0:Q.taskSlug)?Jn:null,qi=c===(Q==null?void 0:Q.taskSlug)?d:null,wr=p===(Q==null?void 0:Q.taskSlug)?f:null,$t=!!(n&&Q&&ak(qi)),Qt=(we==null?void 0:we.status)==="running",Qs=!!(Nt&&$t&&Qt),qo=!!(mn!=null&&mn.statusLoaded),Js=!!(Q&&(mn!=null&&mn.statusLoaded)&&!mn.hasAnySession),ln=te.useCallback(G=>{le(G.themeMode),De(G.flowPauseAlerts),je(G.roleRetryEnabled),Ee(G.permissionRequestMode),sn(G.autoTaskHarnessReviewEnabled),dn(G.translationEnabled),wt(G.translationAutoSendEnabled),Ot(G.translationTargetLanguage),Se(G.translationOutputMode),Ks(G.launchTemplate)},[]),on=te.useCallback(()=>{ut.current!==null&&(window.clearInterval(ut.current),ut.current=null)},[]),ol=te.useCallback(()=>{on(),xo(),ut.current=window.setInterval(()=>{xo()},Zg)},[on]),cn=te.useCallback(()=>{on();let G=1;xo(),ut.current=window.setInterval(()=>{G+=1,xo(),G>=sk&&ut.current!==null&&(window.clearInterval(ut.current),ut.current=null)},Zg)},[on]),Zr=te.useCallback((G,fe=`manual-${Date.now()}`,$e={})=>{_i({id:fe,text:G}),$e.sound==="strong"?ol():$e.sound==="weak"?cn():on()},[cn,ol,on]),cl=te.useCallback(()=>{on(),_i(null)},[on]);te.useEffect(()=>{Q!=null&&Q.taskSlug&&(yi.current[Q.taskSlug]=Date.now())},[Q==null?void 0:Q.taskSlug]);const Zs=te.useCallback(G=>{Q!=null&&Q.taskSlug&&z({taskSlug:Q.taskSlug,messages:G})},[Q==null?void 0:Q.taskSlug]),$i=te.useCallback(G=>{Q!=null&&Q.taskSlug&&N({taskSlug:Q.taskSlug,orchestration:G})},[Q==null?void 0:Q.taskSlug]),ul=te.useCallback(G=>{Q!=null&&Q.taskSlug&&I({taskSlug:Q.taskSlug,events:G})},[Q==null?void 0:Q.taskSlug]),ea=te.useCallback((G,fe)=>{var dt;if(!Yt||!n||!Q||G.taskSlug!==Q.taskSlug||G.status!=="stopped"||!G.roundId||(fe==null?void 0:fe.status)!=="running"||((dt=G.roleRecovery)==null?void 0:dt.status)==="failed")return;const $e=e_(G);Xs.current[G.taskSlug]!==$e&&(Xs.current[G.taskSlug]=$e,ye.startTaskHarnessRetrospective({taskSlug:G.taskSlug,trigger:"auto"}).then(async _n=>{E(_n),await gn({syncLaunchOptions:!0})}).catch(_n=>{gk(_n)||xt(Je("Auto task harness review",_n))}))},[Q,Yt,n,gn]),Gi=te.useCallback(G=>{var dl,pl;if(!(Q!=null&&Q.taskSlug)||G.taskSlug!==Q.taskSlug)return;if(ae({taskSlug:G.taskSlug,roundState:G}),G.status==="running"&&G.activeRole==="gate-reviewer"&&ie("gate-reviewer"),((dl=G.roleRecovery)==null?void 0:dl.status)==="waiting"||((pl=G.roleRecovery)==null?void 0:pl.status)==="retrying"){li.current[G.taskSlug]={status:G.status};return}if(G.status!=="stopped"||!G.roundId){li.current[G.taskSlug]={status:G.status};return}const fe=e_(G),$e=vi.current[G.taskSlug],dt=li.current[G.taskSlug];if(ea(G,dt),li.current[G.taskSlug]={status:G.status},$e===fe||(vi.current[G.taskSlug]=fe,!hk(G,dt,yi.current[G.taskSlug])))return;const _n=G.activeRole??"role",oi=ve?uk(G)>=rk?"strong":"weak":"none",Wi=G.roleRecovery,na=(Wi==null?void 0:Wi.status)==="failed"?pk(Wi,_n):`No new turn started after ${_n} stopped.`;Zr(na,fe,{sound:oi})},[Q==null?void 0:Q.taskSlug,ea,ve,Zr]),$o=te.useCallback(G=>{sl(fe=>(fe==null?void 0:fe.taskSlug)===G.taskSlug&&fe.statusLoaded===G.statusLoaded&&fe.sessionCount===G.sessionCount&&fe.hasAnySession===G.hasAnySession&&fe.hasGateReviewerSession===G.hasGateReviewerSession&&fe.allRolesHaveSession===G.allRolesHaveSession&&fe.autoOrchestration===G.autoOrchestration&&JSON.stringify(fe.roles)===JSON.stringify(G.roles)?fe:G)},[]);async function Si(){const G=await ye.listTasks();return X(G),K(fe=>{var $e;return fe&&G.some(dt=>dt.taskSlug===fe)?fe:(($e=G[0])==null?void 0:$e.taskSlug)??null}),G}async function es(G=Q==null?void 0:Q.taskSlug){if(!G)return g(null),h(null),null;const fe=await ye.getHarnessStatus(G);return g(fe),h(G),fe}async function xr(G=Q==null?void 0:Q.taskSlug){if(!G)return o(null),u(null),null;const fe=await ye.getHarnessBootstrapStatus(G);return o(fe),u(G),fe}async function Er(){const G=await ye.getGatewayStatus();return y(G),G}async function Go(){const G=await ye.getRecentRepositoryPaths();return l(G),G}async function kr(){if(!n)return Oe(!1),!1;const G=await ye.getTranslationState();return Oe(G.memoryInitialized),G.memoryInitialized}async function Rn(G){const[fe,$e]=await Promise.all([ye.listMessages(G),ye.getOrchestrationState(G)]);z({taskSlug:G,messages:fe}),N({taskSlug:G,orchestration:$e})}async function ts(G){const fe=await ye.getGateReviewState(G);return W({taskSlug:G,state:fe}),Lo("Poll Gate Review state"),xt($e=>Ao($e,["Refresh Gate Review state","Poll Gate Review state"])),fe}function ns(G,fe){const $e=nf(G,fe);$e&&xt($e)}function Jt(G){G&&(Xn(G.permissionMode),G.model&&pn(G.model),G.effort&&Xt(G.effort))}async function bi(G={}){const fe=await ye.getTranslatorSession();return Ut(fe),G.syncLaunchOptions&&Jt(fe),fe}function ei(G){G&&(Ft(G.permissionMode),G.model&&Ue(G.model),G.effort&&Xr(G.effort))}async function gn(G={}){const fe=await ye.getHarnessEngineerSession();return Ht(fe),G.syncLaunchOptions&&ei(fe),fe}function hl(G,fe,$e={}){var dt;Ut(G.translatorSession),Oe(!!((dt=G.translationState)!=null&&dt.memoryInitialized)),Ht(G.harnessEngineerSession),E(G.harnessFeedbackState),fe&&G.harnessStatus?(g(G.harnessStatus),h(fe)):(g(null),h(null)),fe&&G.harnessBootstrapStatus?(o(G.harnessBootstrapStatus),u(fe)):(o(null),u(null)),$e.syncLaunchOptions&&(Jt(G.translatorSession),ei(G.harnessEngineerSession))}async function Ar(G={}){if(!n)return Ut(null),Oe(!1),Ht(null),g(null),o(null),h(null),u(null),E(null),null;const fe=(Q==null?void 0:Q.taskSlug)??null,$e=await ye.getProjectRuntimeState(fe);return hl($e,fe,G),$e}function ti(){const G=["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 fe of G)Lo(fe);xt(fe=>Ao(fe,G))}te.useEffect(()=>{Promise.all([ye.getCurrentProject(),ye.getRecentRepositoryPaths(),ye.getAppPreferences(),ye.getGatewayStatus()]).then(async([G,fe,$e,dt])=>{r(G),l(fe),y(dt),ln($e),G&&await Si()}).catch(G=>xt(Je("Load initial app data",G)))},[ln]),te.useEffect(()=>{const G=window.matchMedia("(prefers-color-scheme: dark)"),fe=()=>ll(G.matches);return fe(),G.addEventListener("change",fe),()=>G.removeEventListener("change",fe)},[]),te.useEffect(()=>()=>on(),[on]),te.useEffect(()=>{const G=ee==="system"?al?"dark":"light":ee;document.documentElement.dataset.theme=G,document.documentElement.dataset.themeMode=ee},[al,ee]),te.useEffect(()=>{if(!(v!=null&&v.enabled)||!n||!Q)return;const G=`${n.repoRoot}:${Q.taskSlug}`;if(v.currentProjectId===n.repoRoot&&v.currentTaskSlug===Q.taskSlug){Fi.current=G;return}Fi.current!==G&&(Fi.current=G,ye.updateGatewaySettings({currentProjectId:n.repoRoot,currentTaskSlug:Q.taskSlug}).then(fe=>y(fe)).catch(fe=>{Fi.current===G&&(Fi.current=""),xt(Je("Sync Gateway active project/task",fe))}))},[Q==null?void 0:Q.taskSlug,v==null?void 0:v.currentProjectId,v==null?void 0:v.currentTaskSlug,v==null?void 0:v.enabled,n==null?void 0:n.repoRoot]),te.useEffect(()=>{if(!(Q!=null&&Q.taskSlug)){W(null);return}ts(Q.taskSlug).catch(G=>xt(Je("Refresh Gate Review state",G)))},[Q==null?void 0:Q.taskSlug]),te.useEffect(()=>{Jr.current="",An.current="",Zn.current="",Ys.current="",Ut(null),Xn("bypassPermissions"),pn("default"),Xt("medium"),Oe(!1),Ht(null),Ft("bypassPermissions"),Ue("default"),Xr("medium"),g(null),o(null),h(null),u(null),E(null)},[n==null?void 0:n.repoRoot]),tl(n?`project-runtime:${n.repoRoot}:${(Q==null?void 0:Q.taskSlug)??"no-task"}`:null,async()=>{try{const G=(n==null?void 0:n.repoRoot)??"",fe=!!(n&&Jr.current!==G);await Ar({syncLaunchOptions:fe}),fe&&(Jr.current=G),ti()}catch(G){ns("Poll project runtime state",G)}},{intervalMs:3e3,runImmediately:!0}),te.useEffect(()=>{if(!n||!(Q!=null&&Q.taskSlug)||!(Re!=null&&Re.claudeSessionId)||Re.status==="running"||Re.status==="done")return;const G=`${n.repoRoot}:${Q.taskSlug}:${Re.claudeSessionId}`;Ys.current!==G&&(Ys.current=G,ye.resumeHarnessEngineerSession({taskSlug:Q.taskSlug,permissionMode:Re.permissionMode,model:Re.model,effort:Re.effort}).then(fe=>{Ht(fe),ei(fe)}).catch(fe=>xt(Je("Resume Harness Engineer session",fe))))},[Q==null?void 0:Q.taskSlug,Re==null?void 0:Re.claudeSessionId,Re==null?void 0:Re.cwd,Re==null?void 0:Re.effort,Re==null?void 0:Re.model,Re==null?void 0:Re.permissionMode,Re==null?void 0:Re.status,n==null?void 0:n.repoRoot]),te.useEffect(()=>{!n||!(Q!=null&&Q.taskSlug)||!(Re!=null&&Re.claudeSessionId)||Re.status!=="running"||Re.cwd===Q.worktreePath||ye.ensureHarnessEngineerSession({taskSlug:Q.taskSlug,permissionMode:Re.permissionMode,model:Re.model,effort:Re.effort}).then(G=>{Ht(G),ei(G)}).catch(G=>xt(Je("Move Harness Engineer session to active task worktree",G)))},[Q==null?void 0:Q.taskSlug,Q==null?void 0:Q.worktreePath,Re==null?void 0:Re.claudeSessionId,Re==null?void 0:Re.cwd,Re==null?void 0:Re.effort,Re==null?void 0:Re.model,Re==null?void 0:Re.permissionMode,Re==null?void 0:Re.status,n==null?void 0:n.repoRoot]),te.useEffect(()=>{if(!n||!(Q!=null&&Q.taskSlug)||!$t||!(we!=null&&we.claudeSessionId)||we.status==="running"||we.status==="done")return;const G=`${n.repoRoot}:${Q.taskSlug}:${we.claudeSessionId}`;Zn.current!==G&&(Zn.current=G,ye.resumeTranslatorSession({taskSlug:Q.taskSlug,cols:100,rows:28,permissionMode:we.permissionMode,model:we.model,effort:we.effort}).then(fe=>{Ut(fe),Jt(fe)}).catch(fe=>{Zn.current="",xt(Je("Resume Translator session",fe))}))},[Q==null?void 0:Q.taskSlug,n==null?void 0:n.repoRoot,$t,we==null?void 0:we.claudeSessionId,we==null?void 0:we.cwd,we==null?void 0:we.effort,we==null?void 0:we.model,we==null?void 0:we.permissionMode,we==null?void 0:we.status]),te.useEffect(()=>{!n||!(Q!=null&&Q.taskSlug)||!$t||!(we!=null&&we.claudeSessionId)||we.status!=="running"||we.cwd===Q.worktreePath||ye.ensureTranslatorSession({taskSlug:Q.taskSlug,cols:100,rows:28,permissionMode:we.permissionMode,model:we.model,effort:we.effort}).then(G=>{Ut(G),Jt(G)}).catch(G=>xt(Je("Move Translator session to active task worktree",G)))},[Q==null?void 0:Q.taskSlug,Q==null?void 0:Q.worktreePath,n==null?void 0:n.repoRoot,$t,we==null?void 0:we.claudeSessionId,we==null?void 0:we.cwd,we==null?void 0:we.effort,we==null?void 0:we.model,we==null?void 0:we.permissionMode,we==null?void 0:we.status]),te.useEffect(()=>{if(!n||!Nt||!(Q!=null&&Q.taskSlug)||!$t||!Qt){An.current="";return}const G=`${n.repoRoot}:${Q.taskSlug}`;An.current===G&&(we==null?void 0:we.status)==="running"||(An.current=G,ye.ensureTranslatorSession({taskSlug:Q.taskSlug}).then(fe=>{Ut(fe),Jt(fe)}).catch(fe=>{An.current="",xt(Je("Ensure Translator session for active task",fe))}))},[n==null?void 0:n.repoRoot,Q==null?void 0:Q.taskSlug,Nt,$t,Qt]);const un=(Q==null?void 0:Q.taskSlug)??null,Ci=un&&(he==null?void 0:he.taskSlug)===un?he.state:null,In=un&&(se==null?void 0:se.taskSlug)===un?se.roundState:null,Rr=un&&(Jn==null?void 0:Jn.taskSlug)===un?Jn:null,is=!!(un&&(Ci!=null&&Ci.activeGate||(In==null?void 0:In.activeRole)==="gate-reviewer"||Rr!=null&&Rr.hasGateReviewerSession));tl(is&&un?`gate-review:${un}`:null,async()=>{if(un)try{await ts(un)}catch(G){ns("Poll Gate Review state",G)}},{intervalMs:3e3,runImmediately:!1});async function Te(G,fe="Run UI action"){Qr(!0),xt("");try{await G()}catch($e){xt(Je(fe,$e))}finally{Qr(!1)}}async function rs(){if(!Q)throw new Error("Create or select a task before closing it.");const G=[`Close task "${Q.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: ${Q.worktreePath}`,`- deletes the Git branch: ${Q.branch}`,"- deletes VCM task/session/message/orchestration state","","VCM will not check running sessions or uncommitted changes before closing."].join(`
96
+ `);window.confirm(G)&&(await ye.cleanupTask(Q.taskSlug,{force:!0,forceDeleteBranch:!0}),K(null),z(null),N(null),I(null),ae(null),W(null),At($e=>$e+1),await Si())}const ss=ne&&ne.taskSlug===(Q==null?void 0:Q.taskSlug)?ne.messages:[],fl=j&&j.taskSlug===(Q==null?void 0:Q.taskSlug)?j.orchestration:null,Zt=$&&$.taskSlug===(Q==null?void 0:Q.taskSlug)?$.events:[],zt=se&&se.taskSlug===(Q==null?void 0:Q.taskSlug)?se.roundState:null,Vi=Q!=null&&Q.taskSlug&&(zt!=null&&zt.roleRecovery)?fk(Q.taskSlug,zt.roleRecovery):null,Ki=zt!=null&&zt.roleRecovery&&zt.roleRecovery.status!=="failed"&&Vi!==Ws?dk(zt.roleRecovery):null,ta=he&&he.taskSlug===(Q==null?void 0:Q.taskSlug)?he.state:null,as=!!(ta&&Object.values(ta.gates).some(G=>G.required));return x.jsxs(Z0,{sidebar:x.jsx(O2,{project:n,recentRepositoryPaths:s,tasks:Y,activeTaskSlug:(Q==null?void 0:Q.taskSlug)??null,messages:ss,orchestration:fl,events:Zt,roundState:zt,gateReview:ta,translationEnabled:Qs,translationAutoSendEnabled:En,translationTargetLanguage:it,translationOutputMode:pe,translationMemoryInitialized:ke,translatorSession:we,harnessStatus:qi,harnessBootstrapStatus:wr,harnessApplyResult:b,autoTaskHarnessReviewEnabled:Yt,gatewayStatus:v,gatewayQrLogin:_,gatewayQrCheck:A,gatewayLarkRegistration:k,gatewayLarkRegistrationCheck:B,busy:zn,onConnect:G=>Te(async()=>{const fe=await ye.connectProject({repoPath:G});r(fe),w(null),await Promise.all([Si(),Go()])},"Connect repository"),onRefreshConnectedRepository:()=>Te(async()=>{const G=await ye.getCurrentProject();r(G)},"Refresh connected repository"),onPullConnectedRepository:()=>Te(async()=>{const G=await ye.pullCurrentProject();r(G)},"Pull connected repository"),onRefreshHarness:()=>Te(async()=>{if(!Q)throw new Error("Create or select a task before refreshing VCM Harness.");w(null),await Promise.all([es(Q.taskSlug),xr(Q.taskSlug)])},"Refresh VCM Harness"),onApplyHarness:()=>Te(async()=>{if(!Q)throw new Error("Create or select a task before applying VCM Harness.");const G=await ye.applyHarness({taskSlug:Q.taskSlug});w(G),await Promise.all([es(Q.taskSlug),xr(Q.taskSlug)])},"Apply VCM Harness"),onStartHarnessBootstrap:G=>Te(async()=>{if(!Q)throw new Error("Create or select a task before starting Harness Bootstrap.");const fe=await ye.startHarnessBootstrap({taskSlug:Q.taskSlug,cols:120,rows:32,...G});o(fe.status),u(Q.taskSlug),await gn({syncLaunchOptions:!0})},"Start Harness Bootstrap"),onRestartHarnessBootstrap:G=>Te(async()=>{if(!Q)throw new Error("Create or select a task before restarting Harness Bootstrap.");const fe=await ye.restartHarnessBootstrap({taskSlug:Q.taskSlug,cols:120,rows:32,...G});o(fe.status),u(Q.taskSlug),await gn({syncLaunchOptions:!0})},"Restart Harness Bootstrap"),onStopHarnessBootstrap:()=>Te(async()=>{const G=await ye.stopHarnessBootstrap();o(G),u((Q==null?void 0:Q.taskSlug)??null),await gn()},"Stop Harness Bootstrap"),onRunHarnessBootstrap:()=>Te(async()=>{if(!Q)throw new Error("Create or select a task before running Harness Bootstrap.");const G=await ye.runHarnessBootstrap({taskSlug:Q.taskSlug});o(G.status),u(Q.taskSlug),await gn()},"Run Harness Bootstrap"),onOpenHarnessStudio:()=>Bt(!0),onOpenRepositoryDiff:()=>an(!0),onAutoTaskHarnessReviewChange:G=>{sn(G),Te(async()=>{const fe=await ye.updateAppPreferences({autoTaskHarnessReviewEnabled:G});ln(fe)},"Update auto task harness review setting")},onRefreshGateway:()=>Te(async()=>{await Er()},"Refresh Gateway status"),onGatewayEnabledChange:G=>{Te(async()=>{const fe=await ye.updateGatewaySettings({enabled:G,...G&&n?{currentProjectId:n.repoRoot,currentTaskSlug:(Q==null?void 0:Q.taskSlug)??null}:{}});y(fe)},"Update Gateway enabled setting")},onGatewaySettingsChange:G=>Te(async()=>{const fe=await ye.updateGatewaySettings(G);y(fe)},"Update Gateway settings"),onGatewayTranslationChange:G=>{Te(async()=>{const fe=await ye.updateGatewaySettings({translationEnabled:G});y(fe)},"Update Gateway translation setting")},onStartGatewayQrLogin:()=>{Te(async()=>{const G=await ye.startGatewayQrLogin();S(G),L(null),T(!0),await Er()},"Start Gateway QR login")},onStartGatewayLarkRegistration:()=>{Te(async()=>{const G=await ye.startGatewayLarkRegistration();M(G),H(null),P(!0),await Er()},"Start Lark Gateway QR setup")},onResetGatewayBinding:()=>{Te(async()=>{const G=await ye.resetGatewayBinding();y(G),S(null),L(null),T(!1),M(null),H(null),P(!1)},"Reset Gateway binding")},onGateReviewGateEnabledChange:(G,fe)=>{Te(async()=>{if(!Q)throw new Error("Create or select a task before changing Gate Review Gates.");const $e=await ye.updateGateReviewSettings(Q.taskSlug,{gates:{[G]:fe}});W({taskSlug:Q.taskSlug,state:$e})},`Update ${G} Gate Review setting`)},onTranslationEnabledChange:G=>{dn(G),Te(async()=>{const fe=await ye.updateAppPreferences({translationEnabled:G});ln(fe)},"Update conversation translation setting")},onTranslationAutoSendChange:G=>{wt(G),Te(async()=>{const fe=await ye.updateAppPreferences({translationAutoSendEnabled:G});ln(fe)},"Update translation auto-send setting")},onTranslationTargetLanguageChange:G=>{Ot(G),Te(async()=>{const fe=await ye.updateAppPreferences({translationTargetLanguage:G});ln(fe)},"Update translation target language")},onTranslationOutputModeChange:G=>{Se(G),Te(async()=>{const fe=await ye.updateAppPreferences({translationOutputMode:G});ln(fe)},"Update translation output mode")},onOpenFileTranslation:()=>_t(!0),onOpenTranslatorSession:()=>St(!0),onCreateTranslationBootstrap:()=>{Te(async()=>{if(!Q)throw new Error("Create or select a task before running Translation Bootstrap.");await ye.createTranslationBootstrap({taskSlug:Q.taskSlug,targetLanguage:it}),await kr(),await bi()},"Create Translation Bootstrap task")},onUpdateTranslationMemory:()=>{Te(async()=>{if(!Q)throw new Error("Create or select a task before updating translation memory.");await ye.createTranslationMemoryUpdate({taskSlug:Q.taskSlug,targetLanguage:it}),await kr(),await bi()},"Create translation memory update task")},onCreateTask:G=>Te(async()=>{const fe=await ye.createTask(G);await Si(),K(fe.taskSlug)},"Create task"),onCloseTask:()=>{Te(rs,"Close task")},onSelectTask:K,themeMode:ee,onAutoOrchestrationChange:G=>{Te(async()=>{if(!Q)throw new Error("Create or select a task before changing auto orchestration.");const fe=await ye.updateOrchestrationState(Q.taskSlug,{mode:G?"auto":"manual"});N({taskSlug:Q.taskSlug,orchestration:fe})},"Update auto orchestration mode")},onThemeModeChange:G=>{le(G),Te(async()=>{const fe=await ye.updateAppPreferences({themeMode:G});ln(fe)},"Update theme setting")},pauseAlertSound:ve,onPauseAlertSoundChange:G=>{De(G),G&&yk(),Te(async()=>{const fe=await ye.updateAppPreferences({flowPauseAlerts:G});ln(fe)},"Update pause alert sound setting")},roleRetryEnabled:Ne,onRoleRetryEnabledChange:G=>{je(G),Te(async()=>{const fe=await ye.updateAppPreferences({roleRetryEnabled:G});ln(fe)},"Update CC retry setting")},permissionRequestMode:ct,onPermissionRequestModeChange:G=>{Ee(G),Te(async()=>{const fe=await ye.updateAppPreferences({permissionRequestMode:G});ln(fe)},"Update permission request setting")},launchTemplate:Pi,canSaveLaunchTemplate:qo,canOneClickStart:Js,onSaveLaunchTemplate:()=>{Te(async()=>{if(!(mn!=null&&mn.statusLoaded))throw new Error("Open a task workspace before saving a launch template.");const G=await ye.updateAppPreferences({launchTemplate:{version:1,roles:mn.roles,autoOrchestration:mn.autoOrchestration}});ln(G)},"Save launch template")},onOneClickStart:()=>{Te(async()=>{if(!Q)throw new Error("Create or select a task before one-click start.");const G=await ye.getTaskStatus(Q.taskSlug);if(G.sessions.some(dt=>Nh.some(_n=>_n===dt.role)))throw new Error("One-click start is only available before any role session has started.");const fe=await ye.updateOrchestrationState(Q.taskSlug,{mode:Pi.autoOrchestration?"auto":"manual"});N({taskSlug:Q.taskSlug,orchestration:fe});const $e=b2(Pi,{gateReviewerEnabled:as});for(const dt of $e){const _n={cols:100,rows:28,permissionMode:dt.permissionMode,model:dt.model,effort:dt.effort},oi=G.sessions.find(Wi=>Wi.role===dt.role);(oi==null?void 0:oi.status)!=="running"&&(oi!=null&&oi.claudeSessionId?await ye.resumeRoleSession(Q.taskSlug,dt.role,_n):await ye.startRoleSession(Q.taskSlug,dt.role,_n))}ie("project-manager"),await Rn(Q.taskSlug),await Si(),At(dt=>dt+1)},"One-click start role sessions")},onMarkAllMessagesDone:G=>{Te(async()=>{const fe=await ye.markAllMessagesDone(G);z({taskSlug:G,messages:fe.messages}),await Rn(G)},"Mark all role messages done")},onDeleteMessageHistory:G=>{Te(async()=>{const fe=await ye.deleteMessageHistory(G);z({taskSlug:G,messages:fe.messages}),await Rn(G)},"Delete role message history")}}),children:[x.jsx(v2,{}),qt?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:qt.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:cl,children:"Confirm"})]})}):null,Ki&&Vi?x.jsxs("div",{className:"role-recovery-toast",role:"status",children:[x.jsx("span",{children:Ki}),x.jsx("button",{type:"button",onClick:()=>Fo(Vi),children:"Close"})]}):null,D&&_?x.jsx(ok,{busy:zn,qrCheck:A,qrLogin:_,onCheck:()=>{Te(async()=>{const G=await ye.checkGatewayQrLogin();L(G),(G.status==="confirmed"||G.status==="binded_redirect")&&T(!1),await Er()})},onClose:()=>T(!1)}):null,U&&k?x.jsx(ck,{busy:zn,registration:k,registrationCheck:B,onCheck:()=>{Te(async()=>{const G=await ye.checkGatewayLarkRegistration();H(G),G.gatewayStatus&&y(G.gatewayStatus),G.status==="confirmed"&&(P(!1),await Er())},"Check Lark Gateway QR setup")},onClose:()=>P(!1)}):null,n&&Q?x.jsx(nk,{task:Q,activeRole:q,gateReviewerEnabled:as,translationEnabled:Qs,translationAutoSendEnabled:En,translationTargetLanguage:it,translationOutputMode:pe,launchTemplate:Pi,refreshNonce:ai,onTaskChanged:async()=>{await Si()},onActiveRoleChange:ie,onMessagesChanged:Zs,onOrchestrationChanged:$i,onRoundStateChanged:Gi,onEventsChanged:ul,onLaunchStateChanged:$o}):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(s2,{open:He,taskSlug:(Q==null?void 0:Q.taskSlug)??null,targetLanguage:it,onClose:()=>_t(!1)}),x.jsx(_1,{open:yt,busy:zn,status:qi,bootstrapStatus:wr,engineerSession:Re,permissionMode:kn,model:Ui,effort:gi,taskSlug:(Q==null?void 0:Q.taskSlug)??null,onClose:()=>Bt(!1),onRefresh:()=>{Te(async()=>{if(!Q)throw new Error("Create or select a task before refreshing Harness Studio.");await Promise.all([es(Q.taskSlug),xr(Q.taskSlug),gn()])},"Refresh Harness Studio")},onPermissionModeChange:Ft,onModelChange:Ue,onEffortChange:Xr,onEngineerStart:()=>{Te(async()=>{if(!Q)throw new Error("Create or select a task before starting Harness Engineer.");const G=await ye.startHarnessEngineerSession({taskSlug:Q.taskSlug,cols:120,rows:32,permissionMode:kn,model:Ui,effort:gi});Ht(G),ei(G)},"Start Harness Engineer")},onEngineerResume:()=>{Te(async()=>{if(!Q)throw new Error("Create or select a task before resuming Harness Engineer.");const G=await ye.resumeHarnessEngineerSession({taskSlug:Q.taskSlug,cols:120,rows:32,permissionMode:kn,model:Ui,effort:gi});Ht(G),ei(G)},"Resume Harness Engineer")},onEngineerRestart:()=>{Te(async()=>{if(!Q)throw new Error("Create or select a task before restarting Harness Engineer.");const G=await ye.restartHarnessEngineerSession({taskSlug:Q.taskSlug,cols:120,rows:32,permissionMode:kn,model:Ui,effort:gi});Ht(G),ei(G)},"Restart Harness Engineer")},onEngineerStop:()=>{Te(async()=>{const G=await ye.stopHarnessEngineerSession();Ht(G)},"Stop Harness Engineer")},onEngineerNotifyHarnessUpdated:()=>{Te(async()=>{const G=await ye.notifyHarnessEngineerHarnessUpdated();Ht(G),ei(G)},"Notify Harness Engineer to reload harness")},onOpenRepositoryDiff:()=>an(!0),onReviewTaskHarness:()=>{Te(async()=>{if(!Q)throw new Error("Create or select a task before reviewing task harness.");const G=await ye.startTaskHarnessRetrospective({taskSlug:Q.taskSlug,trigger:"manual"});E(G),await gn({syncLaunchOptions:!0})},"Review task harness")}}),x.jsx(y1,{open:Ze,taskSlug:(Q==null?void 0:Q.taskSlug)??null,onClose:()=>an(!1)}),x.jsx(x1,{open:qe,busy:zn,session:we,permissionMode:Yn,model:Pt,effort:Qn,onClose:()=>St(!1),onPermissionModeChange:Xn,onModelChange:pn,onEffortChange:Xt,onStart:()=>{Te(async()=>{if(!Q)throw new Error("Create or select a task before starting Translator.");const G=await ye.startTranslatorSession({taskSlug:Q.taskSlug,cols:100,rows:28,permissionMode:Yn,model:Pt,effort:Qn});Ut(G),Jt(G)},"Start Translator session")},onResume:()=>{Te(async()=>{if(!Q)throw new Error("Create or select a task before resuming Translator.");const G=await ye.resumeTranslatorSession({taskSlug:Q.taskSlug,cols:100,rows:28,permissionMode:Yn,model:Pt,effort:Qn});Ut(G),Jt(G)},"Resume Translator session")},onRestart:()=>{Te(async()=>{if(!Q)throw new Error("Create or select a task before restarting Translator.");const G=await ye.restartTranslatorSession({taskSlug:Q.taskSlug,cols:100,rows:28,permissionMode:Yn,model:Pt,effort:Qn});Ut(G),Jt(G)},"Restart Translator session")},onStop:()=>{Te(async()=>{const G=await ye.stopTranslatorSession();Ut(G)},"Stop Translator session")},onNotifyHarnessUpdated:()=>{Te(async()=>{const G=await ye.notifyTranslatorHarnessUpdated();Ut(G),Jt(G)},"Notify Translator to reload harness")}}),x.jsx(e1,{busy:zn,state:R,onCancel:G=>{Te(async()=>{const fe=await ye.decideHarnessFeedback({action:"cancel",taskSlug:Q==null?void 0:Q.taskSlug,comment:G});E(fe)},"Cancel Harness feedback")},onApprove:G=>{Te(async()=>{if(!Q)throw new Error("Create or select a task before approving Harness feedback.");const fe=await ye.decideHarnessFeedback({action:"approve",taskSlug:Q.taskSlug,comment:G});E(fe),await gn()},"Approve Harness feedback")},onComment:G=>{Te(async()=>{if(!Q)throw new Error("Create or select a task before sending Harness feedback comments.");const fe=await ye.decideHarnessFeedback({action:"comment",taskSlug:Q.taskSlug,comment:G});E(fe),await gn()},"Send Harness feedback comment")},onReject:G=>{Te(async()=>{const fe=await ye.decideHarnessFeedback({action:"reject",taskSlug:Q==null?void 0:Q.taskSlug,comment:G});E(fe)},"Reject Harness feedback")}})]})}function ok({busy:n,onCheck:r,onClose:s,qrCheck:l,qrLogin:d}){const[g,f]=te.useState(""),[o,c]=br("");return te.useEffect(()=>{let h=!1;if(c(""),f(""),d.qrcodeUrl.startsWith("data:image/")){f(d.qrcodeUrl);return}try{const p=Wr(0,"M");p.addData(d.qrcodeUrl),p.make(),h||f(p.createDataURL(8,2))}catch(p){h||c(Je("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:o?"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:(l==null?void 0:l.status)??d.status})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Expires"}),x.jsx("dd",{children:Ev(d.expiresAt)})]}),l!=null&&l.message?x.jsxs("div",{children:[x.jsx("dt",{children:"Message"}),x.jsx("dd",{children:l.message})]}):null]})]}),x.jsx("footer",{children:x.jsx("button",{type:"button",disabled:n,onClick:r,children:"Confirm"})})]})})}function ck({busy:n,onCheck:r,onClose:s,registration:l,registrationCheck:d}){const[g,f]=te.useState(""),[o,c]=br("");return te.useEffect(()=>{let h=!1;c(""),f("");try{const p=Wr(0,"M");p.addData(l.qrUrl),p.make(),h||f(p.createDataURL(8,2))}catch(p){h||c(Je("Render Lark Gateway setup QR code",p))}return()=>{h=!0}},[l.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:g?x.jsx("img",{alt:"Lark Gateway setup QR code",src:g}):x.jsx("div",{className:"gateway-qr-placeholder",children:o?"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:(d==null?void 0:d.status)??l.status})]}),x.jsxs("div",{children:[x.jsx("dt",{children:"Expires"}),x.jsx("dd",{children:Ev(l.expiresAt)})]}),l.userCode?x.jsxs("div",{children:[x.jsx("dt",{children:"User Code"}),x.jsx("dd",{children:l.userCode})]}):null,d!=null&&d.larkBotName?x.jsxs("div",{children:[x.jsx("dt",{children:"Bot"}),x.jsx("dd",{children:d.larkBotName})]}):null,d!=null&&d.message?x.jsxs("div",{children:[x.jsx("dt",{children:"Message"}),x.jsx("dd",{children:d.message})]}):null]}),x.jsx("a",{href:l.qrUrl,target:"_blank",rel:"noreferrer",children:"Open setup link"})]}),x.jsx("footer",{children:x.jsx("button",{type:"button",disabled:n,onClick:r,children:"Confirm"})})]})})}function Ev(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 Vr=null;function uk(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 hk(n,r,s){if((r==null?void 0:r.status)==="running")return!0;const l=Date.parse(n.stoppedAt??n.lastTurnEndedAt??"");return!!(s&&Number.isFinite(l)&&l>s)}function e_(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=_k(n.role),s=kv(n);return n.status==="retrying"?`CC 出错,正在重试 ${r}${s} · 第 ${n.attempt}/${n.maxAttempts} 次`:`CC 出错,重试中 ${r}${s} · 第 ${n.attempt}/${n.maxAttempts} 次 · ${vk(n.nextRetryAt)}`}function pk(n,r){const s=kv(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 kv(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["Task final acceptance is not complete yet.","Task Harness Retrospective has already been triggered","Harness feedback is already active.","Harness Engineer is reserved for an active Harness feedback item.","Harness Engineer is busy or unavailable."].some(r=>n.message.includes(r))}function _k(n){return n.split("-").filter(Boolean).map(r=>`${r.slice(0,1).toUpperCase()}${r.slice(1)}`).join(" ")}function vk(n){if(!n)return"即将重试";const r=Date.parse(n)-Date.now();return!Number.isFinite(r)||r<=0?"即将重试":`${Math.ceil(r/6e4)} 分钟后`}async function yk(){const n=Av();return n?Rv(n):!1}async function xo(){const n=Av();if(!n||!await Rv(n))return!1;try{const s=n.createGain(),l=n.currentTime+.025;return s.gain.setValueAtTime(.85,n.currentTime),s.connect(n.destination),i_(n,s,{frequency:587.33,startAt:l,duration:.18,peakGain:.045}),i_(n,s,{frequency:783.99,startAt:l+.11,duration:.28,peakGain:.055}),window.setTimeout(()=>{s.disconnect()},800),!0}catch{return!1}}function Av(){const n=window.AudioContext??window.webkitAudioContext;if(!n)return null;try{return(!Vr||Vr.state==="closed")&&(Vr=new n),Vr}catch{return null}}function t_(n){Vr=null,n&&n.state!=="closed"&&n.close().catch(()=>{})}async function Rv(n){if(n_(n))return!0;try{await n.resume();const r=n_(n);return!r&&n===Vr&&t_(n),r}catch{return n===Vr&&t_(n),!1}}function n_(n){return n.state==="running"}function i_(n,r,s){const l=n.createGain(),d=n.createOscillator(),g=n.createOscillator(),f=s.startAt+s.duration;l.gain.setValueAtTime(1e-4,s.startAt),l.gain.exponentialRampToValueAtTime(s.peakGain,s.startAt+.018),l.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(l),g.connect(l),l.connect(r),d.start(s.startAt),g.start(s.startAt),d.stop(f+.02),g.stop(f+.02)}const Tv=document.getElementById("root");if(!Tv)throw new Error("Missing #root element.");H0.createRoot(Tv).render(x.jsx(te.StrictMode,{children:x.jsx(lk,{})}));